:root {
    --portal-ink: #092f3b;
    --portal-muted: #6b7d82;
    --portal-line: #dce6e7;
    --portal-paper: #f4f7f6;
    --portal-card: #ffffff;
    --portal-navy: #061d27;
    --portal-navy-2: #0a2a34;
    --portal-cyan: #20c9d8;
    --portal-lime: #bce94b;
    --portal-green: #159c79;
    --portal-shadow: 0 18px 48px rgba(7, 36, 45, .08);
}

body {
    min-width: 320px;
    color: var(--portal-ink);
    background:
        radial-gradient(circle at 88% 0, rgba(32, 201, 216, .09), transparent 25rem),
        var(--portal-paper);
    font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Keep mixed Persian/English portal copy readable instead of inheriting the
   wrong paragraph direction from a surrounding flex/grid container. */
.portal-workspace .bidi-fa,
.portal-login .bidi-fa {
    direction: rtl;
    unicode-bidi: isolate;
    text-align: right;
}

.portal-workspace .bidi-en,
.portal-login .bidi-en {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

.portal-workspace .bidi-auto,
.portal-login .bidi-auto {
    unicode-bidi: plaintext;
}

.portal-workspace input[dir="auto"],
.portal-workspace textarea[dir="auto"],
.portal-login input[dir="auto"] {
    text-align: start;
}

.navbar-portal {
    min-height: 76px;
    padding: 10px clamp(16px, 3vw, 38px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 72% -120%, rgba(32, 201, 216, .34), transparent 42%),
        linear-gradient(110deg, var(--portal-navy), #073440) !important;
    box-shadow: 0 14px 32px rgba(3, 31, 40, .16);
}

.we-portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff !important;
}

.we-portal-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    background: #082d38;
    box-shadow: 0 10px 28px rgba(0, 93, 255, .22);
}

.we-portal-brand > span {
    display: grid;
    line-height: 1.05;
}

.we-portal-brand strong {
    font-size: .9rem;
    letter-spacing: .055em;
}

.we-portal-brand small {
    margin-top: 6px;
    color: #8fb0b6;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .15em;
}

.container-fluid.p-4 {
    max-width: 1680px;
    padding: clamp(18px, 3vw, 40px) !important;
}

.card,
.card-portal,
.login-card {
    overflow: hidden;
    border: 1px solid var(--portal-line) !important;
    border-radius: 18px !important;
    background: var(--portal-card);
    box-shadow: var(--portal-shadow) !important;
}

.card-header {
    padding: 13px 18px;
    border: 0;
    color: #eafafa;
    background: linear-gradient(115deg, var(--portal-navy-2), #0b414a) !important;
    font-size: .82rem;
    font-weight: 800;
}

.stat-box {
    min-height: 124px;
    display: grid;
    place-content: center;
    border-top: 3px solid var(--portal-cyan) !important;
}

.stat-box .fs-3,
h4,
h5 {
    color: var(--portal-ink) !important;
}

.btn {
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 11px;
    font-size: .8rem;
    font-weight: 750;
}

.btn-primary,
.btn-portal {
    border-color: #087a85 !important;
    background: linear-gradient(135deg, #087a85, #0aa6b3) !important;
}

.form-control,
.form-select {
    min-height: 42px;
    padding: 9px 12px;
    border-color: var(--portal-line);
    border-radius: 11px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--portal-cyan);
    box-shadow: 0 0 0 3px rgba(32, 201, 216, .12);
}

.table {
    color: var(--portal-ink);
    font-size: .82rem;
}

.table thead th {
    padding: 13px 14px;
    border: 0;
    color: #9ec0c4;
    background: var(--portal-navy-2);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.table tbody td {
    padding: 13px 14px;
    border-color: var(--portal-line);
    vertical-align: middle;
}

.dsc-timeline::before {
    background: #b8dadd !important;
}

.dsc-tl-dot {
    width: 54px !important;
    height: 54px !important;
    border: 1px solid #b9e4e6;
    color: #087a85;
    background: #e9f9f8 !important;
    font-size: 1.35rem !important;
    box-shadow: 0 8px 20px rgba(8, 122, 133, .12);
}

.dsc-tl-item.dsc-tl-last .dsc-tl-dot {
    color: #0d765d;
    border-color: #b7e3d8;
    background: #e7f8f2 !important;
}

body:has(.login-card) {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 75% 15%, rgba(32, 201, 216, .18), transparent 24rem),
        linear-gradient(145deg, #061c25, #092b34 64%, #073440) !important;
}

.login-card {
    max-width: 430px !important;
    border-color: rgba(255, 255, 255, .12) !important;
}

.login-card .card-body {
    padding: clamp(26px, 5vw, 42px) !important;
}

.we-portal-login-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 22px;
    background: #082d38;
    box-shadow: 0 16px 34px rgba(0, 93, 255, .2);
}

@media (max-width: 767px) {
    .navbar-portal {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column-reverse;
    }

    .navbar-portal > .d-flex {
        width: 100%;
        justify-content: space-between;
    }

    .we-portal-brand small {
        display: none;
    }
}

/* Booking-first client portal */
.portal-workspace {
    background: #f1f5f6;
}

.portal-hero,
.case-detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: clamp(24px, 4vw, 46px);
    overflow: hidden;
    border: 1px solid rgba(32, 201, 216, .18);
    border-radius: 24px;
    color: #f5fbff;
    background:
        radial-gradient(circle at 12% 0, rgba(32, 201, 216, .22), transparent 30rem),
        linear-gradient(120deg, #061d27, #0a3b47);
    box-shadow: 0 20px 54px rgba(7, 36, 45, .16);
}

.portal-eyebrow {
    display: block;
    margin-bottom: 10px;
    color: #75e5ed;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .18em;
}

.portal-hero h1,
.case-detail-hero h1 {
    margin: 0 0 10px;
    color: #fff !important;
    font-size: clamp(1.65rem, 3vw, 2.6rem);
    font-weight: 900;
}

.portal-hero p {
    max-width: 680px;
    margin: 0;
    color: #b9d3d7;
}

.portal-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 10px;
    min-width: min(100%, 360px);
}

.portal-hero-stats > div {
    display: grid;
    gap: 3px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 16px;
    text-align: center;
    background: rgba(255, 255, 255, .055);
}

.portal-hero-stats strong { color: #fff; font-size: 1.45rem; }
.portal-hero-stats span { color: #9bbbc0; font-size: .68rem; }

.portal-route-panel {
    overflow: hidden;
    border: 1px solid #cbdfe1;
    border-radius: 24px;
    background: #092f3b;
    box-shadow: 0 20px 54px rgba(7, 36, 45, .13);
}
.portal-route-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px clamp(18px, 3vw, 32px);
    color: #eafafa;
    background: linear-gradient(110deg, #092c38, #0a3f4b);
}
.portal-route-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #78e2e8;
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .16em;
}
.portal-route-heading h2 { margin: 0 0 7px; color: #fff !important; font-size: clamp(1.2rem, 2.2vw, 1.65rem); font-weight: 850; }
.portal-route-heading p { margin: 0; color: #b8d5d9; font-size: .79rem; }
.portal-route-counter {
    display: grid;
    flex: 0 0 auto;
    gap: 2px;
    min-width: 120px;
    padding: 10px 15px;
    border: 1px solid rgba(188, 233, 75, .35);
    border-radius: 15px;
    background: rgba(188, 233, 75, .1);
}
.portal-route-counter strong { color: #d3f98b; font-size: 1.55rem; line-height: 1; }
.portal-route-counter span { color: #dcefb7; font-size: .68rem; }
.portal-route-content { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); direction: ltr; }
.portal-map-stage { position: relative; min-height: 430px; }
#portal-routes-map { width: 100%; height: 430px; background: #d9e7e7; z-index: 0; }
.portal-map-note,
.portal-map-tools {
    position: absolute;
    z-index: 500;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    color: #f0fcfc;
    background: rgba(5, 32, 42, .91);
    box-shadow: 0 12px 30px rgba(5, 32, 42, .23);
    backdrop-filter: blur(10px);
}
.portal-map-note { top: 16px; right: 16px; display: flex; align-items: center; gap: 7px; padding: 10px 14px; font-size: .73rem; }
.portal-map-note i { color: #bce94b; }
.portal-map-tools { bottom: 16px; left: 16px; width: min(355px, calc(100% - 32px)); padding: 15px; }
.portal-map-tools label { display: block; margin-bottom: 8px; color: #eafafa; font-size: .76rem; font-weight: 800; }
.portal-map-search { display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid #527079; border-radius: 10px; background: #123b47; }
.portal-map-search i { color: #7ed7dc; }
.portal-map-search input { width: 100%; min-height: 39px; border: 0; outline: 0; color: #fff; background: transparent; font-size: .76rem; }
.portal-map-search input::placeholder { color: #a8c2c7; }
.portal-map-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 11px; color: #c5dcdf; font-size: .68rem; }
.portal-map-meta a { color: #c5dcdf; text-decoration: none; white-space: nowrap; }
.portal-map-meta a:hover { color: #fff; text-decoration: underline; }
.portal-map-popup { direction: rtl; min-width: 170px; }
.portal-map-popup strong { display: block; margin-bottom: 7px; color: #113844; }
.portal-map-popup a { display: block; padding: 5px 0; color: #087a85; font-weight: 800; text-decoration: none; }
.portal-map-popup a:hover { text-decoration: underline; }
.portal-route-fallback { display: grid; place-content: center; height: 100%; padding: 20px; color: #0b3b47; text-align: center; }
.portal-port-clock {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;
    border-left: 1px solid rgba(255, 255, 255, .12);
    direction: rtl;
    color: #f0fbfc;
    background:
        radial-gradient(circle at 20% 70%, rgba(32, 201, 216, .15), transparent 15rem),
        linear-gradient(155deg, #0b3544, #102a47);
}
.portal-clock-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.portal-clock-heading h3 { margin: 0; color: #fff !important; font-size: 1.12rem; font-weight: 850; }
.portal-clock-heading select { max-width: 53%; min-width: 110px; padding: 7px 10px; border: 1px solid #496a77; border-radius: 10px; color: #ecfbfd; background: #123b49; font-size: .74rem; }
.portal-clock-main { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 24px); flex: 1; min-height: 225px; }
.portal-clock-face { position: relative; flex: 0 0 142px; width: 142px; height: 142px; border: 2px solid #4e7790; border-radius: 50%; background: radial-gradient(circle at center, #244a70 0 53%, #163d61 54%); box-shadow: 0 0 0 9px rgba(255, 255, 255, .035), inset 0 0 18px rgba(0, 0, 0, .25); }
.portal-clock-tick { position: absolute; width: 4px; height: 11px; border-radius: 3px; background: #83a9b9; }
.portal-clock-tick-12 { top: 8px; left: calc(50% - 2px); }
.portal-clock-tick-3 { top: calc(50% - 5px); right: 8px; transform: rotate(90deg); }
.portal-clock-tick-6 { bottom: 8px; left: calc(50% - 2px); }
.portal-clock-tick-9 { top: calc(50% - 5px); left: 8px; transform: rotate(90deg); }
.portal-clock-hand { position: absolute; bottom: 50%; left: calc(50% - 2px); width: 4px; border-radius: 4px; transform-origin: center bottom; background: #fff; }
.portal-clock-hour { height: 40px; }
.portal-clock-minute { height: 53px; width: 3px; left: calc(50% - 1.5px); }
.portal-clock-second { height: 57px; width: 1px; left: calc(50% - .5px); background: #bce94b; }
.portal-clock-pin { position: absolute; top: calc(50% - 6px); left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: #bce94b; box-shadow: 0 0 15px rgba(188, 233, 75, .6); }
.portal-clock-readout { display: grid; gap: 8px; min-width: 0; }
.portal-clock-readout span { color: #a9c7d3; font-size: .75rem; }
.portal-clock-readout strong { color: #fff; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1; white-space: nowrap; }
.portal-clock-readout small { color: #c0d8df; font-size: .72rem; }
.portal-clock-weather { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px; border: 1px solid #365d70; border-radius: 14px; background: rgba(255, 255, 255, .055); font-size: .74rem; }
.portal-clock-weather strong { color: #d6f49d; font-size: .78rem; }
.portal-clock-disclaimer { margin: 14px 0 0; color: #9bbbc7; font-size: .68rem; }

.booking-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
    gap: 20px;
}

.booking-case-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid #dbe7e8;
    border-top: 4px solid #17a9b7;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(7, 36, 45, .08);
    transition: transform .2s ease, box-shadow .2s ease;
}

.booking-case-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 48px rgba(7, 36, 45, .13);
}

.booking-case-head,
.booking-route,
.btn-open-case,
.portal-panel-title,
.portal-chat-actions,
.portal-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Layout order is independent from writing direction:
   identifiers stay on the left and their state stays on the right. */
.booking-case-head,
.case-detail-hero,
.booking-route,
.document-row,
.portal-message-meta {
    direction: ltr;
}

/* Direct Persian panel headings: title on the right, icon on the left. */
.portal-panel-title:not(:has(> div)) {
    direction: ltr;
}

/* Split headings keep the Persian title group on the right and English
   metadata on the left; inside the group the title precedes the icon. */
.portal-panel-title > div {
    direction: ltr;
}

.booking-case-kicker { color: #0b8792; font-size: .65rem; font-weight: 900; letter-spacing: .1em; }
.booking-case-head h2 { margin: 3px 0 0; color: #082f3b; font-size: 1.25rem; font-weight: 900; }
.booking-job { color: #71858a; font-size: .75rem; }

.case-status {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    color: #0a5961;
    background: #e2f7f7;
    font-size: .7rem;
    font-weight: 850;
    white-space: nowrap;
}

.case-status-cancelled { color: #9d2d38; background: #fee8ea; }
.case-status-delivered { color: #09644d; background: #ddf5ec; }
.case-status-in_transit { color: #805c00; background: #fff3cd; }

.booking-route {
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    background: #f1f8f8;
}

.booking-route > div { display: grid; gap: 4px; flex: 1; }
.booking-route > div:first-child { text-align: left; }
.booking-route > div:last-child { text-align: right; }
.booking-route span, .booking-contact-row span, .booking-meta-grid span, .case-facts span { color: #7b9094; font-size: .66rem; font-weight: 800; }
.booking-route strong { color: #123e48; font-size: .82rem; }
.booking-route > i { color: #16a6b3; }

.booking-mini-timeline {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 4px;
    padding: 4px 2px 0;
}

.mini-timeline-step {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 1;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    color: #90a1a4;
    text-align: center;
}

.mini-timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 13px;
    left: calc(-50% - 4px);
    width: calc(100% + 4px);
    height: 4px;
    border-radius: 99px;
    background: #c8d5da;
    box-shadow: inset 0 1px 2px rgba(8, 35, 48, .18);
}

/* Illuminate only connectors before the last recorded completed milestone. */
.booking-mini-timeline .mini-timeline-step:has(~ .is-done)::after,
.case-timeline .case-timeline-step:has(~ .is-done)::after {
    background: linear-gradient(90deg, #13adbd 0%, #25deec 35%, #e1ffff 48%, #66faff 52%, #13adbd 70%, #13adbd 100%);
    background-size: 300% 100%;
    box-shadow: 0 0 5px #25deec, 0 0 12px rgba(13, 203, 223, .7), 0 0 22px rgba(13, 203, 223, .3);
    animation: portalLedFlow 3s linear infinite;
}

.mini-timeline-dot {
    display: grid;
    width: 28px;
    height: 28px;
    place-content: center;
    border: 2px solid #d7e3e4;
    border-radius: 50%;
    color: #91a4a7;
    background: #fff;
    box-shadow: 0 0 0 4px #fff;
    font-size: .7rem;
}

.mini-timeline-step.is-done .mini-timeline-dot {
    border-color: #0e9aa6;
    color: #fff;
    background: #0e9aa6;
}

.mini-timeline-step.is-current .mini-timeline-dot {
    border-color: #0e9aa6;
}

.mini-timeline-step.is-done:not(:has(~ .is-done)) .mini-timeline-dot {
    border-color: #b0ffff;
    color: #fff;
    background: #078492;
    box-shadow: 0 0 0 4px rgba(13, 203, 223, .12), 0 0 13px rgba(13, 203, 223, .8);
}

.mini-timeline-step small {
    max-width: 80px;
    overflow: hidden;
    font-size: .58rem;
    font-weight: 800;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-timeline-step.is-done small,
.mini-timeline-step.is-current small { color: #16626b; }

.booking-contact-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.booking-contact-row > div { display: grid; grid-template-columns: auto 1fr; gap: 0 9px; padding: 13px; border: 1px solid #e1eaeb; border-radius: 13px; }
.booking-contact-row i { grid-row: span 2; align-self: center; color: #0d95a1; font-size: 1.25rem; }
.booking-contact-row strong { color: #173e47; font-size: .76rem; }

.booking-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.booking-meta-grid > div { display: grid; gap: 3px; padding: 10px; border-radius: 11px; text-align: center; background: #f7f9f9; }
.booking-meta-grid strong { color: #173e47; font-size: .76rem; }

.btn-open-case {
    padding: 13px 15px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #087a85, #0aa6b3);
    font-size: .8rem;
    font-weight: 850;
    text-decoration: none;
}
.btn-open-case:hover { color: #fff; background: linear-gradient(135deg, #066a74, #078f9b); }
.portal-empty-state { padding: 70px 20px; border: 1px dashed #bdd0d2; border-radius: 22px; text-align: center; background: #fff; }
.portal-empty-state > i { color: #20a7b3; font-size: 3rem; }

.case-detail-hero { padding: 26px 32px; }
.case-detail-hero h1 small { color: #96bac0; font-size: .42em; }
.case-route-inline { display: flex; align-items: center; gap: 10px; color: #b7d1d5; font-size: .82rem; }
.case-route-inline i { color: #4edbe5; }
.case-detail-hero .case-status { font-size: .78rem; }

.case-timeline-panel {
    border-color: #cfe2e4;
    box-shadow: 0 18px 45px rgba(7, 36, 45, .09);
}

.case-timeline-scroll {
    padding: 26px 24px 22px;
    overflow-x: auto;
    background:
        radial-gradient(circle at 88% 15%, rgba(32, 201, 216, .08), transparent 20rem),
        linear-gradient(180deg, #fbfdfd, #f3f8f8);
}

.case-timeline {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    min-width: max-content;
}

.case-timeline-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 11px;
    min-width: 150px;
    padding: 0 12px;
    text-align: center;
}

.case-timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    z-index: 0;
    top: 25px;
    left: -50%;
    width: 100%;
    height: 5px;
    border-radius: 99px;
    background: #c8d5da;
    box-shadow: inset 0 1px 2px rgba(8, 35, 48, .18);
}

.case-timeline-marker {
    position: relative;
    z-index: 2;
    display: grid;
    width: 54px;
    height: 54px;
    place-content: center;
    border: 3px solid #d9e5e6;
    border-radius: 50%;
    color: #8ba0a4;
    background: #fff;
    box-shadow: 0 0 0 7px #f7fafa, 0 9px 22px rgba(7, 36, 45, .08);
    font-size: 1.05rem;
}

.case-timeline-step.is-done .case-timeline-marker {
    border-color: #07919d;
    color: #fff;
    background: linear-gradient(145deg, #08a6b2, #08727d);
}

.case-timeline-step.is-current .case-timeline-marker {
    border-color: #92bac1;
    color: #66868e;
    background: #f5f9fa;
}

.case-timeline-step.is-done:not(:has(~ .is-done)) .case-timeline-marker {
    border-color: #b0ffff;
    color: #fff;
    background: radial-gradient(circle at 35% 25%, #20ccd9, #066676);
    box-shadow: 0 0 0 7px rgba(13, 203, 223, .10), 0 0 18px rgba(13, 203, 223, .8), 0 0 32px rgba(13, 203, 223, .25);
}

.case-timeline-content { display: grid; justify-items: center; gap: 3px; }
.case-timeline-content strong { color: #173e47; font-size: .78rem; }
.case-timeline-content span { color: #819599; font-size: .7rem; font-weight: 750; }
.case-timeline-content small { max-width: 145px; color: #9aa9ac; font-size: .62rem; line-height: 1.5; }
.case-timeline-step.is-done .case-timeline-content span { color: #0a7f89; }
.case-timeline-step.is-current .case-timeline-content strong { color: #66868e; }
.import-timeline { grid-auto-columns: minmax(175px, 1fr); }
.import-timeline .case-timeline-step { grid-template-rows: 54px 1fr; align-content: start; }
.import-timeline .case-timeline-content { align-content: start; }
.import-timeline .case-timeline-content small { color: #617d84; font-size: .7rem; }
.import-timeline .case-timeline-content strong { direction: ltr; }
.timeline-download { display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 175px; padding: 8px 10px; margin-top: 7px; border: 1px solid #9ed9dd; border-radius: 9px; color: #065c66; background: #eafafb; font-size: .72rem; text-decoration: none; overflow-wrap: anywhere; }
.timeline-download:hover, .timeline-download:focus-visible { background: #087984; color: #fff; }

.portal-free-time-note { margin: 0; padding: 15px 20px 0; color: #607b82; font-size: .76rem; line-height: 1.9; }
.portal-free-time-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 13px; padding: 16px 20px 20px; }
.portal-free-time-item { min-width: 0; padding: 16px; border: 1px solid #c8e8e5; border-radius: 15px; background: #f1fbf8; }
.portal-free-time-item.is-warning { border-color: #f3d89c; background: #fff9e9; }
.portal-free-time-item.is-overdue { border-color: #f0b6b6; background: #fff3f3; }
.portal-free-time-item.is-no_free_time_set { border-color: #d7e1e3; background: #f5f8f9; }
.portal-free-time-item-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; color: #133e47; font-size: .82rem; }
.portal-free-time-item-head strong { overflow-wrap: anywhere; }
.portal-free-time-state { padding: 5px 9px; border-radius: 999px; color: #087566; background: #d9f4ec; font-size: .68rem; font-weight: 800; }
.is-warning .portal-free-time-state { color: #875b08; background: #ffedbb; }
.is-overdue .portal-free-time-state { color: #a32d35; background: #ffe0e0; }
.is-no_free_time_set .portal-free-time-state { color: #61777b; background: #e7edef; }
.portal-free-time-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.portal-free-time-stats > div { display: grid; align-content: start; gap: 5px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.8); }
.portal-free-time-stats span { color: #6f8589; font-size: .68rem; }
.portal-free-time-stats strong { color: #173e47; font-size: .78rem; }
.is-overdue .portal-free-time-stats > div:last-child strong { color: #bd333d; }

/* Move the light towards the left, following the RTL shipment path. */
@keyframes portalLedFlow {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

/* A single rail and travelling head; no restart at individual milestones. */
.led-ready > .mini-timeline-step::after,
.led-ready > .case-timeline-step::after { display: none; }

.portal-neon-rail {
    position: absolute;
    height: 5px;
    border-radius: 99px;
    pointer-events: none;
    background: #c8d5da;
    box-shadow: inset 0 1px 2px rgba(8, 35, 48, .18);
}

.portal-neon-progress {
    position: absolute;
    right: 0;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    background: #1099a8;
    box-shadow: 0 0 5px #20cfde, 0 0 13px rgba(13, 203, 223, .45);
}

.portal-neon-beam {
    position: absolute;
    top: 0;
    right: -110px;
    width: 110px;
    height: 100%;
    border-radius: inherit;
    /* White head at the advancing left edge, turquoise tail behind it. */
    background: linear-gradient(90deg, transparent, #eaffff 12%, #71ffff 27%, #1dcfdf 50%, transparent);
    filter: drop-shadow(0 0 4px #b7ffff);
    animation: portalNeonAdvance 3.2s linear infinite;
}

.portal-neon-rail.is-ltr { transform: scaleX(-1); }

@keyframes portalNeonAdvance {
    from { right: -110px; }
    to { right: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-neon-beam { animation: none; right: 0; width: 100%; }
    .mini-timeline-step::after,
    .case-timeline-step::after { animation: none !important; }
}

.case-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, .8fr); gap: 20px; align-items: start; }
.case-main-column, .case-side-column { display: grid; gap: 20px; }
.portal-panel { overflow: hidden; border: 1px solid #dce7e8; border-radius: 19px; background: #fff; box-shadow: 0 14px 38px rgba(7, 36, 45, .07); }
.portal-panel-title { min-height: 55px; padding: 14px 18px; color: #efffff; background: linear-gradient(115deg, #082c36, #0b424c); font-size: .82rem; font-weight: 850; }
.portal-panel-title > div { display: flex; align-items: center; gap: 8px; }
.portal-panel-title small { color: #8ebbc0; }

.case-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #e5eeee; }
.case-facts > div { display: grid; gap: 7px; min-height: 86px; padding: 17px; background: #fff; }
.case-facts strong { color: #123b45; font-size: .85rem; }

.document-groups { display: grid; gap: 18px; padding: 18px; }
.document-group h3 { margin: 0 0 8px; color: #70898e; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.document-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border-bottom: 1px solid #e6eeee; color: #123c46; font-size: .77rem; text-decoration: none; }
.document-row:hover { color: #057985; background: #f2fbfb; }
.document-row span { display: flex; align-items: center; gap: 7px; }
.document-empty { margin: 0; padding: 11px 13px; color: #8a9a9d; font-size: .75rem; background: #f8fafa; }

.contact-panel .team-contact { display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 13px; border: 1px solid #e1eaeb; border-radius: 13px; direction: ltr; }
.team-contact > i { display: grid; width: 38px; height: 38px; place-content: center; border-radius: 12px; color: #087e89; background: #e9f8f8; }
.team-contact > div { display: grid; gap: 2px; }
.team-contact span { color: #7c9094; font-size: .68rem; }
.team-contact strong { color: #173e47; font-size: .8rem; }
.contact-note { margin: 14px 16px 16px; color: #72898d; font-size: .7rem; line-height: 1.8; }

.portal-chat-messages { display: grid; gap: 10px; max-height: 480px; min-height: 240px; padding: 16px; overflow-y: auto; background: #f4f8f8; }
.portal-message { max-width: 88%; padding: 11px 13px; border: 1px solid #dfe9ea; border-radius: 14px 14px 4px 14px; background: #fff; }
.portal-message-own { justify-self: end; border-color: #b7e2e5; border-radius: 14px 14px 14px 4px; background: #e9f9f9; }
.portal-message-meta { gap: 14px; margin-bottom: 6px; color: #799095; font-size: .62rem; }
.portal-message-meta strong { color: #0d6f78; }
.portal-message-text { color: #153e47; font-size: .78rem; line-height: 1.8; overflow-wrap: anywhere; }
.portal-attachment { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: #087b86; font-size: .7rem; text-decoration: none; }
.portal-chat-empty { display: grid; place-items: center; place-content: center; gap: 8px; min-height: 210px; color: #8da0a3; font-size: .75rem; }
.portal-chat-empty i { font-size: 2rem; }
.portal-chat-form { padding: 14px; border-top: 1px solid #dfe8e9; background: #fff; }
.portal-chat-form textarea { width: 100%; padding: 11px 12px; resize: vertical; border: 1px solid #d9e5e6; border-radius: 12px; outline: none; color: #123d46; font-size: .78rem; }
.portal-chat-form textarea:focus { border-color: #20a9b5; box-shadow: 0 0 0 3px rgba(32, 169, 181, .12); }
.portal-chat-actions { margin-top: 10px; gap: 10px; }
.portal-chat-actions button, .btn-attach { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 15px; border: 0; border-radius: 11px; font-size: .76rem; font-weight: 850; cursor: pointer; }
.portal-chat-actions button { color: #fff; background: #078b97; }
.btn-attach { color: #0a727c; background: #e8f6f6; }
.btn-attach input { display: none; }

.booking-vessel-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 18px 12px; padding: 10px 12px; border: 1px solid #a5dce2; border-radius: 11px; color: #096f7d; background: #edfafa; text-decoration: none; font-size: .77rem; font-weight: 800; }
.booking-vessel-link:hover { color: #054c57; background: #d9f3f4; }
.portal-vessel-link-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border: 1px solid #bde1e4; border-radius: 17px; color: #123c46; background: #f0fbfb; box-shadow: 0 10px 28px rgba(7, 36, 45, .05); }
.portal-vessel-link-panel > div { display: flex; align-items: center; gap: 9px; font-weight: 850; }
.portal-vessel-link-panel > div > i { color: #087e89; font-size: 1.15rem; }
.portal-vessel-open { display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; border-radius: 11px; color: #fff; background: #087e89; text-decoration: none; white-space: nowrap; font-size: .78rem; font-weight: 850; }
.portal-vessel-open:hover { color: #fff; background: #065d67; }
.portal-vessel-finder { overflow: hidden; margin-top: 28px; border: 1px solid #d2e4e7; border-radius: 20px; background: #fff; box-shadow: 0 15px 35px rgba(7, 36, 45, .08); }
.portal-vessel-finder > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 17px 22px; color: #fff; background: linear-gradient(115deg, #082c36, #0b424c); cursor: pointer; list-style: none; font-size: .9rem; font-weight: 850; }
.portal-vessel-finder > summary::-webkit-details-marker { display: none; }
.portal-vessel-finder > summary span { display: inline-flex; align-items: center; gap: 10px; }
.portal-vessel-finder > summary small { color: #9cdddf; font-size: .72rem; }
.portal-vessel-finder > summary .portal-vessel-chevron { transition: transform .2s ease; }
.portal-vessel-finder[open] > summary .portal-vessel-chevron { transform: rotate(180deg); }
.portal-vessel-finder-body { padding: 16px; }
.portal-vessel-finder-body > p { margin: 0 0 14px; color: #617f85; font-size: .77rem; }
.portal-vessel-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.portal-vessel-controls p { flex: 1 1 240px; margin: 0; color: #617f85; font-size: .77rem; }
.portal-vessel-controls button { flex: 0 0 auto; }
#portal-vesselfinder-map { min-height: 400px; overflow: hidden; border: 1px solid #dce8e9; border-radius: 13px; background: #edf5f6; direction: ltr; }
#portal-vesselfinder-map iframe { display: block; width: 100%; height: 400px; border: 0; }
#portal-vesselfinder-map noscript p { margin: 20px; }
.portal-vessel-list { display: grid; gap: 9px; margin-top: 14px; }
.portal-vessel-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid #e1eeee; border-radius: 11px; background: #f7fbfb; }
.portal-vessel-row > div { display: flex; align-items: center; gap: 12px; color: #123c46; }
.portal-vessel-row span { color: #66858b; font-size: .78rem; }
.portal-vessel-row a, .portal-vessel-foot a { color: #087e89; font-weight: 800; text-decoration: none; }
.portal-vessel-foot { margin-top: 14px; color: #718b90; font-size: .72rem; }

@media (max-width: 980px) {
    .portal-hero { align-items: stretch; flex-direction: column; }
    .portal-route-content { grid-template-columns: 1fr; }
    .portal-port-clock { min-height: 330px; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
    .case-layout { grid-template-columns: 1fr; }
    .case-side-column { grid-row: 1; }
}

@media (max-width: 620px) {
    .portal-vessel-link-panel, .portal-vessel-row { align-items: stretch; flex-direction: column; }
    .portal-route-heading { align-items: flex-start; flex-direction: column; }
    .portal-route-counter { min-width: 0; }
    .portal-map-stage, #portal-routes-map { min-height: 460px; height: 460px; }
    .portal-map-note { top: 10px; right: 10px; max-width: calc(100% - 20px); }
    .portal-map-tools { bottom: 10px; left: 10px; width: calc(100% - 20px); }
    .portal-port-clock { padding: 20px 16px; }
    .portal-clock-main { min-height: 200px; }
    .portal-clock-face { flex-basis: 122px; width: 122px; height: 122px; }
    .portal-hero-stats { grid-template-columns: repeat(3, 1fr); min-width: 0; }
    .portal-hero-stats > div { padding: 11px 6px; }
    .booking-contact-row, .case-facts { grid-template-columns: 1fr; }
    .booking-meta-grid { grid-template-columns: repeat(2, 1fr); }
    .case-detail-hero { align-items: flex-start; flex-direction: column; }
    .portal-message { max-width: 96%; }
    .case-timeline-scroll { padding-inline: 12px; }
    .case-timeline { grid-auto-columns: 135px; }
    .case-timeline-step { min-width: 135px; padding-inline: 8px; }
}
