/* Boxette Flights — embed-only client page (style B: light, cards). */

@font-face { font-family: 'ProximaNova'; src: url('/fonts/ProximaNova-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'ProximaNova'; src: url('/fonts/ProximaNova-Semibold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'ProximaNova'; src: url('/fonts/ProximaNova-Extrabld.woff') format('woff'); font-weight: 800; font-display: swap; }

:root {
    --bg: #F5F8FB; --card: #fff; --border: #E2E7EC;
    --accent: #13CFE8; --accent-hover: #0fb8cf; --accent-deep: #0b7d8f; --accent-light: rgba(19,207,232,.08);
    --accent-text: #095f6d; /* darker accent ink for text on the accent-light tint (≥4.5:1) */
    --ink: #141414; --gray: #6b6b6b; --gray-light: #BDBDBD;
    --green: #27AE60; --blue: #2D9CDB; --orange: #F2994A; --purple: #9B51E0;
    --red: #EB5757; --red-text: #c43e3e; --yellow: #ffc53d; --delay-warn: #8a6d04;
    --mint-ink: #4c5a53; /* ink specific to the mint hero panel */
    --radius: 14px; --shadow: 0 2px 12px rgba(8,70,128,.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg); color: var(--ink);
    font-family: 'ProximaNova', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px; line-height: 1.5;
}
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
input { font: inherit; }
.muted { color: var(--gray); }
[hidden] { display: none !important; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 24px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ===== 1. TRACK SEARCH =====
   boxette.ge banner language: mint panel, chevron pattern, starburst sticker. */
.track-card {
    position: relative; overflow: hidden;
    padding: 28px; border: none;
    /* two-zone composition: mint solid under the left text zone, then the cyan
       chevron band at full strength across the right ~40% — anchored by the star.
       Top layer (mint solid→transparent) doubles as the mask that hides the
       chevron under the text and reveals it on the right. */
    background:
        linear-gradient(100deg,
            #EAF7F0 0%, #EAF7F0 44%,
            rgba(234,247,240,.45) 56%, rgba(234,247,240,0) 66%),
        repeating-linear-gradient(115deg,
            rgba(19,207,232,.30) 0 16px, rgba(19,207,232,0) 16px 32px,
            rgba(19,207,232,.15) 32px 48px, rgba(19,207,232,0) 48px 64px);
    background-color: #EAF7F0;
}
.track-title { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.track-subtitle { color: var(--mint-ink); margin-top: 5px; }
.track-star {
    position: absolute; right: 26px; top: 22px; width: 74px; height: 74px;
    pointer-events: none;
}
/* desktop: bigger star, vertically centered in the right pattern zone; taller hero */
@media (min-width: 1024px) {
    .track-card { padding: 32px 28px; }
    .track-star { width: 120px; height: 120px; right: 48px; top: 50%; bottom: auto; transform: translateY(-50%); }
}
/* mobile: keep compact — small star + subdued pattern, mint stays dominant */
@media (max-width: 767px) {
    .track-star { width: 52px; height: 52px; right: 14px; top: 12px; }
    .track-card {
        background:
            linear-gradient(105deg, #EAF7F0 0%, #EAF7F0 60%, rgba(234,247,240,0) 92%),
            repeating-linear-gradient(115deg,
                rgba(19,207,232,.16) 0 14px, rgba(19,207,232,0) 14px 28px,
                rgba(19,207,232,.08) 28px 42px, rgba(19,207,232,0) 42px 56px);
        background-color: #EAF7F0;
    }
}
.track-form { display: flex; gap: 10px; margin-top: 16px; max-width: 560px; }
.track-form input {
    flex: 1; min-width: 0; padding: 12px 14px; border: 1.5px solid var(--border);
    border-radius: 8px; background: var(--card); color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.track-form input::placeholder { color: var(--gray); }
.track-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.track-form button {
    padding: 12px 26px; background: var(--ink); color: #fff; font-weight: 600;
    border-radius: 8px; transition: background .15s ease, transform .1s ease;
    flex: none;
}
.track-form button:hover { background: #2b2b2b; }
.track-form button:active { transform: scale(0.97); }
.track-form button:disabled, .track-form button[aria-disabled="true"] { opacity: .6; cursor: wait; }
#trackBtn { min-width: 128px; }
.track-msg { margin-top: 10px; font-size: 13px; color: var(--red-text); max-width: 560px; }
.track-msg-help { color: var(--gray); margin-top: 4px; font-weight: 400; }
.track-msg-help a { color: var(--accent-deep); }

/* ===== 2. TRACK RESULT ===== */
.track-result { display: flex; flex-direction: column; gap: 14px; animation: rise-in 250ms ease-out; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
.track-back { align-self: flex-start; color: var(--gray); font-size: 13px; padding: 8px 0; transition: color .15s ease; }
.track-back:hover { color: var(--ink); }

/* Parcel page (?track=…): body.parcel-only is set before first paint by the
   inline script in index.html and kept in sync by app.js; only the parcel
   cards and the help line stay. The Drupal host hides its header, breadcrumb,
   hero and footer the same way (site repo, scripts/flights-app-banner-tail.css). */
body.parcel-only .track-card,
body.parcel-only .track-back { display: none !important; }

.t-status { padding: 20px 24px; }
.t-status-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.t-tracknum { font-size: 14px; font-weight: 600; letter-spacing: .02em; color: var(--gray); display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.t-copy { color: var(--gray); font-size: 15px; padding: 12px; margin: -10px -8px; border-radius: 6px; transition: color .15s ease, background .15s ease, transform .1s ease; }
.t-copy:hover { color: var(--accent-deep); background: var(--accent-light); }
.t-copy:active { transform: scale(0.97); }
.t-copy svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.t-copy.copied svg { animation: copy-pop 200ms ease-out; }
@keyframes copy-pop { from { transform: scale(0.6); opacity: 0; } }
.t-pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 100px; padding: 6px 14px; font-weight: 600; font-size: 13px; }
.t-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
/* pill tint variants set from JS via data-status class — text darkened for ≥4.5:1 on own tint */
.t-pill.scheduled    { background: rgba(130,130,130,.10); color: var(--gray); }
.t-pill.in-transit   { background: rgba(45,156,219,.10);  color: #1c6fa0; }
.t-pill.terminal     { background: rgba(255,197,61,.14);  color: #8a660a; }
.t-pill.customs      { background: rgba(242,153,74,.12);  color: #a35415; }
.t-pill.distribution { background: rgba(155,81,224,.10);  color: #7a2fc4; }
.t-pill.ready        { background: rgba(39,174,96,.10);   color: #1b7a43; }
.t-pill .t-dot { background: currentColor; }

.t-progress { display: flex; gap: 4px; list-style: none; margin-top: 16px; }
.t-progress li { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.t-progress li.done { background: var(--green); }
.t-progress li.current { background: var(--accent); animation: seg-pulse 1.8s ease-in-out infinite; }
@keyframes seg-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.t-stage { margin-top: 10px; font-size: 19px; font-weight: 800; color: var(--ink); }
.t-meta { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.t-meta-line b { font-variant-numeric: tabular-nums; }

.t-history { padding: 20px 24px; }
.t-history h2 { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
@keyframes dot-pulse { 0%,100% { box-shadow: 0 0 0 4px var(--accent-light); } 50% { box-shadow: 0 0 0 7px rgba(19,207,232,.16); } }

.t-help { font-size: 13px; }
.t-help a { color: var(--accent-deep); }

/* ===== 3. SCHEDULE ===== */
.schedule { display: flex; flex-direction: column; gap: 16px; }
.schedule-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.schedule-title { font-size: 22px; font-weight: 800; display: inline-flex; align-items: center; gap: 10px; }
.live-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(39,174,96,.10); color: #1b7a43;
    border-radius: 100px; padding: 4px 12px; font-size: 11px; font-weight: 600; letter-spacing: .05em;
}
.live-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: seg-pulse 1.8s ease-in-out infinite; }
.auto-refresh-info { color: var(--gray); font-size: 12px; }
.auto-refresh-info span { color: var(--ink); font-weight: 600; }

/* direction switcher: boxette.ge homepage toggle style — rectangular tabs,
   active = cyan fill, inactive = white with thin ink border */
.direction-switcher { display: inline-flex; gap: 10px; align-self: flex-start; }
.direction-slider { display: none; }
.direction-btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    padding: 12px 22px; min-width: 160px;
    background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px;
    color: var(--ink); font-weight: 600;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.direction-btn:hover { background: var(--accent-light); }
.direction-btn:active { transform: scale(0.97); }
.direction-btn.active { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.direction-btn svg { width: 16px; height: 16px; fill: currentColor; }
.direction-count { background: rgba(20,20,20,.08); color: inherit; border-radius: 100px; padding: 1px 8px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.direction-btn.active .direction-count { background: rgba(20,20,20,.12); color: var(--ink); }

/* filter chips */
.filters-section { display: flex; gap: 28px; flex-wrap: wrap; }
.filter-block-label { color: var(--gray); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1.5px solid var(--border); border-radius: 100px; padding: 7px 14px;
    background: var(--card); color: var(--gray); font-weight: 600; font-size: 13px;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .1s ease;
}
.filter-chip:hover { border-color: var(--gray-light); }
.filter-chip:active { transform: scale(0.97); }
.filter-chip.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent-text); }
.filter-chip .flag-img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
.chip-icon svg { width: 15px; height: 15px; fill: currentColor; display: block; }
.pill-count { font-size: 11px; font-weight: 600; color: var(--gray); font-variant-numeric: tabular-nums; }
.filter-chip.active .pill-count { color: var(--accent-text); }
.pill-count:empty { display: none; }

/* table */
.flights-table-wrapper { overflow-x: auto; }
.flights-table { width: 100%; border-collapse: collapse; }
/* cyan header band — the tariff-table style used across boxette.ge */
.flights-table th {
    position: sticky; top: 0; z-index: 2; background: var(--accent);
    text-align: left; color: var(--ink); font-size: 13px; font-weight: 600;
    /* long Georgian headers (სავარაუდო გაცემის დრო) may take two lines rather than
       widen their column past the site's content width */
    padding: 12px; line-height: 1.3; vertical-align: middle;
}
/* the short leading headers (country, transport, number, date) never wrap */
.flights-table th:nth-child(-n+4) { white-space: nowrap; }
.flights-table thead tr th:first-child { border-top-left-radius: 0; }
.flights-table td { padding: 12px; border-bottom: 1px solid #eef1f4; vertical-align: middle; font-variant-numeric: tabular-nums; }
.flights-table th:first-child, .flights-table td:first-child { padding-left: 16px; }
.flights-table th:last-child, .flights-table td:last-child { padding-right: 16px; }
.flights-table tbody tr:nth-child(even) { background: #f8fafc; }
.flights-table tbody tr { transition: background-color .15s ease; }
@media (hover: hover) and (pointer: fine) {
    .flights-table tbody tr.expandable:hover { background: var(--accent-light); }
    .flights-table tbody tr.expandable:hover .row-more { background: var(--ink); border-color: var(--ink); color: #fff; }
}
.flights-table tbody tr:last-child td { border-bottom: 0; }

.cell-country { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cell-country .flag-img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; }
.cell-transport { display: inline-flex; align-items: center; gap: 7px; color: var(--gray); }
.cell-transport svg { width: 15px; height: 15px; fill: var(--gray); }
.cell-flight { font-weight: 600; }
.date-main { font-weight: 600; }
.date-pending { color: var(--gray); font-weight: 400; font-style: italic; }
.transit-days-inline { color: var(--gray); font-weight: 400; font-size: 12px; }
/* in the table the transit length always sits on its own line under the date, so rows
   keep one rhythm instead of wrapping only where a column happens to be narrow */
.flights-table .transit-days-inline { display: block; line-height: 1.3; }

.delay-info { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--gray); }
.delay-info.on-time { color: #1b7a43; }
.delay-info.delay-warn { color: var(--delay-warn); }
.delay-info.delay-danger { color: var(--red-text); }
.delay-icon { width: 13px; height: 13px; fill: currentColor; flex: none; }

/* status badges (shared table + mobile) */
.status-badge {
    display: inline-flex; align-items: center; gap: 7px;
    border-radius: 100px; padding: 5px 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-badge .badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status-badge.scheduled    { background: rgba(130,130,130,.10); color: var(--gray); }
.status-badge.in-transit   { background: rgba(45,156,219,.10);  color: #1c6fa0; }
.status-badge.terminal     { background: rgba(255,197,61,.14);  color: #8a660a; }
.status-badge.customs      { background: rgba(242,153,74,.12);  color: #a35415; }
.status-badge.distribution { background: rgba(155,81,224,.10);  color: #7a2fc4; }
.status-badge.ready        { background: rgba(39,174,96,.10);   color: #1b7a43; }
/* skeleton */
.skeleton-wrap { padding: 10px 16px; }
.skeleton-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eef1f4; }
.skeleton-row:last-child { border-bottom: 0; }
.skeleton-cell { flex: 1; height: 14px; border-radius: 6px; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* empty / error */
.empty-state, .error-state { padding: 48px 16px; text-align: center; }
.empty-state svg, .error-state svg { width: 40px; height: 40px; fill: var(--gray-light); margin-bottom: 10px; }
.empty-text { color: var(--gray); }
.error-msg { color: var(--red-text); font-size: 15px; font-weight: 600; }
.error-detail { color: var(--gray); font-size: 12px; margin-top: 4px; }
.retry-btn { margin-top: 14px; padding: 9px 22px; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 600; transition: background .15s ease, transform .1s ease; }
.retry-btn:hover { background: #2b2b2b; }
.retry-btn:active { transform: scale(0.97); }

/* pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination:empty { display: none; }
.page-btn {
    min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
    border: 1.5px solid var(--border); background: var(--card); color: var(--gray);
    font-weight: 600; font-variant-numeric: tabular-nums;
    transition: border-color .15s ease, color .15s ease, background .15s ease, transform .1s ease;
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-deep); }
.page-btn:active:not(:disabled) { transform: scale(0.97); }
.page-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: default; }
.page-ellipsis { color: var(--gray); padding: 0 2px; }

/* ===== FLIGHT DETAIL (accordion) ===== */
.flights-table tbody tr.expandable { cursor: pointer; }
/* "Details" is a real, labelled button (valid aria-expanded home + native
   keyboard): a bare chevron did not tell customers that a row opens the map
   and the flight's progress. */
/* status left, Details pinned to the cell's right edge: the buttons line up in one column
   however long the status label is */
.cell-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-more {
    display: inline-flex; align-items: center; gap: 3px; flex: none;
    padding: 5px 7px 5px 11px; border: 1.5px solid var(--border); border-radius: 6px;
    background: var(--card); color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.row-more svg { width: 16px; height: 16px; fill: currentColor; display: block; transition: transform .2s ease; }
.row-more:active { transform: scale(0.97); }
.row-more:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-light), 0 0 0 1.5px var(--accent-deep); }
.flights-table tbody tr.open .row-more, .m-card.open .row-more { background: var(--accent); border-color: var(--accent); color: var(--ink); }
tr.open .row-more svg, .m-card.open .row-more svg { transform: rotate(180deg); }
tr.open td { background: var(--accent-light) !important; }

/* one line above the table saying what a click gives */
.schedule-hint { display: flex; align-items: center; gap: 8px; margin-bottom: -4px; color: var(--gray); font-size: 13px; }
.schedule-hint svg { width: 18px; height: 18px; fill: var(--accent-deep); flex: none; }

.flights-table tbody tr.detail-row { cursor: default; }
.flights-table tbody tr.detail-row:hover { box-shadow: none; background: #f6fafc; }
.flights-table tbody tr.detail-row > td { background: #f6fafc !important; padding: 20px 24px; }

.detail-stack { animation: detail-in 200ms ease-out; }
@keyframes detail-in { from { opacity: 0; transform: translateY(-4px); } }
.detail-stack { display: flex; flex-direction: column; gap: 16px; }
.detail-block { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.detail-block h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.detail-loading { color: var(--gray); padding: 8px 0; font-size: 13px; }
.detail-fail { color: var(--red); padding: 8px 0; font-size: 13px; }

/* ===== UNIFIED JOURNEY =====
   One chronological flow, top to bottom: stage → its checkpoints → next stage.
   Done stages are compact; the current one is highlighted and explained;
   future ones show what comes next and how long it usually takes. */
.d-journey { list-style: none; max-width: 780px; }
.d-journey > li { position: relative; padding: 0 0 22px 32px; }
.d-journey > li:last-child { padding-bottom: 0; }
.d-journey > li::before { content: ''; position: absolute; left: 6px; top: 20px; bottom: -2px; width: 2px; background: var(--border); }
.d-journey > li.done::before { background: var(--green); opacity: .45; }
.d-journey > li:last-child::before { display: none; }
.d-journey > li::after {
    content: ''; position: absolute; left: 0; top: 4px;
    /* border-box: the global reset skips pseudo-elements, and without it the
       3px border pushes the dot center off the 7px connector line */
    box-sizing: border-box;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--card); border: 3px solid var(--border);
}
.d-journey > li.done::after { background: var(--green); border-color: var(--green); }
.d-journey > li.current::after { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); animation: dot-pulse 1.8s ease-in-out infinite; }
.j-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.j-label { font-weight: 600; font-size: 14px; color: var(--gray); }
.d-journey > li.done .j-label, .d-journey > li.current .j-label { color: var(--ink); }
.d-journey > li.current .j-label { font-size: 15px; }
/* dates sit left, right after the label — not pushed to the far edge */
/* Dates ride the right edge so every timestamp lines up on one vertical rail. */
.j-date { color: var(--gray); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.j-expected {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(20,20,20,.06); color: var(--gray);
    border-radius: 100px; padding: 2px 9px; font-size: 11px; font-weight: 600;
}
.d-journey > li.current .j-expected { background: var(--accent-light); color: var(--accent-text); }
.j-desc { font-size: 13px; color: var(--gray); margin-top: 4px; max-width: 560px; }
/* event times sit inline after the text, aligned left like the stage dates */
.j-events { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.j-events li { position: relative; padding-left: 18px; display: flex; align-items: baseline; gap: 12px; font-size: 13px; }
.j-events li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.j-events li.latest::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.j-events li.latest .j-ev-txt { font-weight: 600; }
.j-ev-time { color: var(--gray); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; margin-left: auto; }

/* operator notices pinned under a stage (customer-visible chronicle comments) */
.j-note { margin-top: 8px; max-width: 560px; border-radius: 8px; border: 1px solid; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.j-note.good     { background: rgba(39,174,96,.10);  border-color: rgba(39,174,96,.35);  color: #1b7a43; }
.j-note.warn     { background: rgba(255,197,61,.14); border-color: rgba(255,197,61,.55); color: #8a660a; }
.j-note.critical { background: rgba(235,87,87,.10);  border-color: rgba(235,87,87,.4);   color: var(--red-text); }
.j-note-time { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; opacity: .8; font-variant-numeric: tabular-nums; }

/* map */
.d-map { height: 280px; border-radius: 8px; overflow: hidden; background: #e8eef2; }
.d-map-wrap { position: relative; }
/* LIVE sits ON the map itself — solid background so tiles never bleed through.
   Top-left, red, and blinking: it must read as a live broadcast indicator. */
.live-badge--map {
    position: absolute; top: 10px; left: 10px; right: auto; z-index: 800;
    background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
    color: #d92d20;
    animation: live-blink 1.4s ease-in-out infinite;
}
.live-badge--map::before { background: #d92d20; animation: none; }
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.d-map-note { margin-top: 8px; font-size: 12px; color: var(--gray); display: flex; align-items: center; gap: 6px; }
.d-map-note::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.d-map-head { display: flex; align-items: center; gap: 10px; }
/* route waypoints: dot + city name riding above it */
.t-city-wrap { position: relative; }
.t-city-dot { display: block; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--gray-light); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.t-city-dot.reached { border-color: var(--accent-hover); }
.t-city-tag {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: #fff; font-size: 10px; font-weight: 600;
    border-radius: 5px; padding: 2px 7px; white-space: nowrap;
}
/* the plane parked on this city (before departure, at a hub) reaches ~14px up */
.t-city-wrap.under-plane .t-city-tag { bottom: 22px; }
.t-plane-wrap { position: relative; }
.t-plane-tag {
    position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: #fff; font-size: 10px; font-weight: 600;
    border-radius: 5px; padding: 2px 7px; white-space: nowrap;
}
.t-plane-svg { display: block; }

/* dispatch simple detail */
.d-kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed #eef1f4; font-size: 13px; }
.d-kv:last-child { border-bottom: 0; }
.d-kv b { font-variant-numeric: tabular-nums; }

/* mobile detail inside card */
.m-card-detail { margin-top: 14px; border-top: 1.5px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.m-card.expandable { cursor: pointer; }

@media (max-width: 1023px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* ===== MOBILE CARDS ===== */
.mobile-cards { display: none; flex-direction: column; gap: 12px; }
.m-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.m-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.m-card-flight { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.m-card-flight .flag-img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; }
.m-card-flight svg { width: 14px; height: 14px; fill: var(--gray); }
.m-card-rows { display: flex; flex-direction: column; gap: 6px; }
.m-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.m-row-label { color: var(--gray); flex: none; }
.m-row-value { text-align: right; font-variant-numeric: tabular-nums; }
.m-card-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.m-card-foot .row-more { width: 100%; justify-content: center; min-height: 44px; font-size: 13px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1023px) {
    .wrap { padding: 18px 16px 40px; }
}
@media (max-width: 767px) {
    .wrap { padding: 14px 12px 32px; gap: 16px; }
    .track-card { padding: 20px 16px 18px; }
    .track-title { font-size: 20px; }
    .track-form { flex-direction: row; }
    .track-form button { padding: 12px 18px; }
    .t-status, .t-history { padding: 18px 16px; }
    .direction-switcher { align-self: stretch; display: flex; }
    .direction-btn { flex: 1; min-width: 0; padding: 12px 8px; }
    .filter-chip { padding: 11px 16px; min-height: 44px; }
    .filters-section { gap: 14px; }
    .m-card-head { align-items: flex-start; }
    .m-card-head .status-badge { white-space: normal; text-align: left; }
    /* hide the table itself, not the wrapper: the skeleton/empty/error states
       live inside the wrapper and must stay reachable on phones */
    .flights-table { display: none !important; }
    .flights-table-wrapper.cards-mode { display: none !important; }
    .mobile-cards { display: flex; }
    /* comfortable tap targets (negative margins keep the visual size) */
    .t-copy { padding: 14px; margin: -12px -10px; }
    .track-back { padding: 12px 8px 12px 0; }
    .page-btn { min-width: 44px; height: 44px; }
}

/* ===== FOCUS ===== */
/* brand focus ring — echoes the search input: cyan border + accent-light halo */
.direction-btn:focus-visible, .filter-chip:focus-visible, .page-btn:focus-visible,
.track-form button:focus-visible, .t-copy:focus-visible, .track-back:focus-visible,
.retry-btn:focus-visible {
    outline: none; box-shadow: 0 0 0 3px var(--accent-light), 0 0 0 1.5px var(--accent-deep);
}


/* ===== SKELETON PRIMITIVES =====
   Shape-mimicking loaders: .sk carries the shimmer, modifiers set the shape.
   Skeletons approximate the layout they stand in for to keep the swap calm. */
/* Flat base + a transform-only ::after sweep: compositor-friendly, so ~60
   shimmer boxes during load never repaint on the main thread. */
.sk, .skeleton-cell { position: relative; overflow: hidden; border-radius: 6px; background: #eef1f4; }
.sk::after, .skeleton-cell::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #f7f9fb 50%, transparent); transform: translateX(-100%); animation: shimmer 1.4s linear infinite; }
.sk-line { height: 14px; }
.sk-line.w-25 { width: 25%; }
.sk-line.w-40 { width: 40%; }
.sk-line.w-60 { width: 60%; }
.sk-line.w-80 { width: 80%; }
.sk-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.sk-pill { width: 110px; height: 31px; border-radius: 999px; }

/* Track search skeleton: mirrors the t-status card + journey card */
.track-skel { animation: none; } /* rise-in belongs to the real result only */
.track-skel .sk-back { width: 180px; height: 29px; margin-bottom: 0; }
.track-skel .sk-map { height: 280px; border-radius: 8px; }
.track-skel .t-progress-skel { list-style: none; display: flex; gap: 4px; margin: 16px 0 14px; padding: 0; }
.track-skel .t-progress-skel li { flex: 1; height: 5px; border-radius: 4px; }
.track-skel .sk-line + .sk-line { margin-top: 10px; }
.skel-journey-row { display: flex; gap: 14px; align-items: flex-start; padding: 11px 0; }
.skel-journey-row .skel-lines { flex: 1; display: grid; gap: 8px; }

/* Expanded flight-detail skeleton (replaces the old text-only loader) */
.detail-skel { display: flex; flex-direction: column; gap: 16px; }
.detail-skel .detail-block .sk-line.w-25 { margin-bottom: 14px; }

/* ===== REDUCED MOTION =====
   Neutralize shimmer, pulses and entrance movement; state changes stay
   instant. JS mirrors this for scrollIntoView. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .sk::after, .skeleton-cell::after { animation: none !important; content: none !important; }
}


/* Re-search keeps the previous parcel visible but visibly inert. */
.track-result.searching { opacity: .55; pointer-events: none; transition: opacity .15s ease; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Auto-refresh failed: the timestamp goes quiet instead of asserting freshness. */
.auto-refresh-info.stale span { color: var(--gray); font-weight: 400; }

/* Programmatic focus targets (SR landing spots, tabindex="-1"): the focus is
   real but the browser's ring around a whole section reads as a stray border. */
#trackResult:focus, #schedule:focus { outline: none; }

/* Land/Sea detail: stands in for the map block, so the panel never leaves the
   "where is it" question visibly unanswered. */
.d-nomap-note { margin: 0; color: var(--gray); font-size: .875rem; line-height: 1.5; }
