/* ZGG Ship · "Voyage Console" tracking UI
   Brand DNA (measured on zggship.com): Inter, blue #004C99, navy #0F172A, white / #F9FAFB, pill buttons. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jbmono-latin.woff2") format("woff2"); }

:root {
  --blue: #004C99; --blue-d: #003D7A; --blue-50: #EEF5FC; --blue-100: #D6E6F7;
  --navy: #0F172A; --ink: #0F172A; --muted: #475569; --faint: #64748B;
  --bg: #F9FAFB; --card: #FFFFFF; --line: #E5E7EB; --line-2: #CBD5E1;
  --gold: #F5C500;
  --ok: #065F46; --ok-bg: #D1FAE5; --ok-dot: #059669;
  --warn: #92400E; --warn-bg: #FEF3C7; --warn-dot: #D97706;
  --stale: #334155; --stale-bg: #E2E8F0; --stale-dot: #64748B;
  --focus: #004C99;
  --top: 56px; --panel: 316px; --tabs: 64px;
  --r-lg: 16px; --r-md: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .08);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
img, svg { display: block; }
a { color: var(--blue); }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
.mono { font-family: var(--mono); font-variant-ligatures: none; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff;
  padding: 12px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 14px;
  padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; min-height: 44px; border-radius: 8px; flex: none; }
.brand img { height: 30px; width: auto; }
.tb-title { font-size: 13.5px; font-weight: 600; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line);
  line-height: 24px; white-space: nowrap; }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px;
  padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.tb-btn:hover { border-color: var(--line-2); background: var(--bg); }
.tb-btn svg { flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent; font: 600 14.5px/1.2 "Inter", sans-serif; text-decoration: none;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-ghost { background: #fff; color: var(--blue); border-color: #B7CDE6; }
.btn-ghost:hover { background: var(--blue-50); border-color: var(--blue); }
.btn-sm { padding: 0 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--blue); cursor: pointer; }
.icon-btn:hover { border-color: var(--blue); background: var(--blue-50); }

/* ---------- small elements ---------- */
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.t-act { background: var(--ok-bg); color: var(--ok); }
.t-est { background: var(--warn-bg); color: var(--warn); }
.t-pln { background: #F1F5F9; color: var(--stale); box-shadow: inset 0 0 0 1px #94A3B8; }
.t-end { background: var(--stale-bg); color: var(--stale); }
/* r5: reference date printed on the B/L (cargo closing) - neither actual nor schedule */
.t-ref { background: var(--blue-50); color: var(--blue-d); box-shadow: inset 0 0 0 1px var(--blue-100); }
.ev-ref .ev-dot { background: var(--blue-50); border-color: var(--blue); border-style: dotted; }
/* r5: container-token view (masked B/L, no document) */
.cv-hint { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--blue-50); color: var(--blue-d);
  font-size: 12.5px; line-height: 1.45; border-left: 3px solid var(--blue); }
.is-cview .bl-no { color: var(--muted); }
.lim-state { display: inline-block; margin-top: 18px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.phase { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; background: var(--blue-50); color: var(--blue); }
.phase.p-arc, .phase.p-lim { background: var(--stale-bg); color: var(--stale); }
.phase.p-done { background: var(--ok-bg); color: var(--ok); }
.age { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 12px 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--stale-bg); color: var(--stale); }
.age::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stale-dot); flex: none; }
.age.a-ok { background: var(--ok-bg); color: var(--ok); }
.age.a-ok::before { background: var(--ok-dot); }
.age.a-warn { background: var(--warn-bg); color: var(--warn); }
.age.a-warn::before { background: var(--warn-dot); }
.age.a-info { background: var(--blue-50); color: var(--blue); }
.age.a-info::before { background: var(--blue); }

/* =====================================================================
   SEARCH + NOT FOUND
   ===================================================================== */
.band { position: relative; color: #fff; text-align: center; padding: 52px 16px 60px; --focus: var(--gold);
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(0, 76, 153, .85) 0%, rgba(0, 76, 153, 0) 60%),
    linear-gradient(180deg, #0F172A 0%, #0B1B36 100%); }
.band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, #D74E1C 0%, var(--gold) 30%, #3E7CC0 70%, var(--blue) 100%); }
body.search { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.search main { flex: 1 0 auto; }
body.search .topbar { padding-left: max(16px, calc((100vw - 1080px) / 2 + 16px)); padding-right: max(16px, calc((100vw - 1080px) / 2 + 16px)); }
.band .eyebrow { color: #AFC6E3; }
.band h1 { font-size: 34px; line-height: 1.15; font-weight: 650; letter-spacing: -.02em; margin: 10px auto 10px; max-width: 760px; }
.band .lede { color: #CBD5E1; font-size: 15.5px; max-width: 560px; margin: 0 auto; }
.pill { display: flex; align-items: center; gap: 6px; max-width: 640px; margin: 28px auto 0; padding: 6px;
  background: #fff; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.pill:focus-within { box-shadow: 0 0 0 3px var(--gold), 0 10px 30px rgba(0, 0, 0, .35); }
.pill label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding-left: 16px; color: var(--faint); }
.pill input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: 500 16px "Inter", sans-serif; letter-spacing: .01em; }
.pill input::placeholder { color: #64748B; }
.pill button { flex: none; height: 48px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--blue); color: #fff;
  font-weight: 650; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.pill button:hover { background: var(--blue-d); }
.pill button:focus-visible { outline-color: var(--gold); }
.hint { margin-top: 14px; font-size: 13.5px; color: #AFC6E3; }
.form-error { display: inline-block; margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: #FEE2E2; color: #991B1B;
  font-weight: 600; font-size: 13.5px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.section { padding: 36px 0; }
.sec-title { font-size: 20px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 6px; }
.sec-lede { color: var(--muted); margin-bottom: 18px; }

.explain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.explain article { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.explain .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); margin-bottom: 12px; }
.explain h2 { font-size: 15.5px; font-weight: 650; margin-bottom: 4px; }
.explain p { color: var(--muted); font-size: 14px; }

.results { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.res { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 16px; align-items: center;
  padding: 16px 18px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); min-height: 64px; }
.res:first-child { border-top: 0; }
.res:hover { background: var(--blue-50); }
.res-no { font-family: var(--mono); font-weight: 600; font-size: 14px; word-break: break-all; }
.res-ctr { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.res-route { font-weight: 600; }
.res-date { color: var(--muted); font-size: 13.5px; }
.res-go { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 650; font-size: 14px; white-space: nowrap; }
.res-status { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.nf-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.nf-tips li { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.nf-tips b { display: block; margin-bottom: 4px; }
.nf-tips span { color: var(--muted); font-size: 14px; }
.nf-tips ul, ul.nf-tips { padding: 0; }
.qmark { font-family: var(--mono); background: rgba(255, 255, 255, .12); padding: 2px 8px; border-radius: 8px; word-break: break-all; }

.site-foot { border-top: 1px solid var(--line); background: #fff; padding: 22px 0 28px; font-size: 13px; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: flex-start; justify-content: space-between; }
.contact b { color: var(--ink); display: block; font-size: 13px; }
.contact a { color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.contact p + p { margin-top: 2px; }

/* =====================================================================
   TRACK PAGE · desktop application layout
   ===================================================================== */
body.track { overflow: hidden; }
.app { display: grid; grid-template-columns: var(--panel) minmax(0, 1fr); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); }
.panel { border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; min-width: 0;
  /* scroll shadows: show that more content sits above / below */
  background:
    linear-gradient(#fff 30%, rgba(255, 255, 255, 0)) center top / 100% 36px no-repeat local,
    linear-gradient(rgba(255, 255, 255, 0), #fff 70%) center bottom / 100% 36px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(15, 23, 42, .16), rgba(15, 23, 42, 0)) center top / 100% 12px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(15, 23, 42, .16), rgba(15, 23, 42, 0)) center bottom / 100% 12px no-repeat scroll,
    #fff; }
.p-details, .p-journey { padding: 18px 18px 6px; }
.p-block + .p-block { margin-top: 16px; }
.blrow { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bl-no { font-size: 14px; font-weight: 600; letter-spacing: .01em; word-break: break-all; line-height: 1.35; min-width: 0; }
h1.status { font-size: 22px; line-height: 1.22; font-weight: 700; letter-spacing: -.015em; margin: 10px 0 6px; }
.status-sub { color: var(--muted); font-size: 14px; line-height: 1.5; }
.p-block .age { margin-top: 12px; }

.eta { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); padding: 14px; }
.eta-label { font-size: 12px; font-weight: 650; color: var(--muted); }
.eta-port { font-size: 15px; font-weight: 650; margin-top: 2px; }
.eta-port span { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.nw { white-space: nowrap; }
.kv-src { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.eta-main { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin-top: 4px; line-height: 1.25; }
.eta-main.eta-tba { font-size: 16px; color: var(--muted); }
.prog-cap { font-size: 11.5px; font-weight: 650; color: var(--muted); margin-bottom: 5px; }
.eta-to { font-size: 14px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.eta-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.eta-note { margin-top: 8px; font-size: 13px; color: var(--muted); }
.eta-src { list-style: none; padding: 0; margin-top: 10px; border-top: 1px solid var(--line); }
.eta-src li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.eta-src li:last-child { border-bottom: 0; }
.eta-src .s-how { color: var(--muted); }
.eta-src .s-time { grid-column: 1 / -1; font-weight: 650; color: var(--ink); }
.eta-next { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.eta-next b { color: var(--ink); }

.actions { display: grid; gap: 8px; margin-top: 16px; }
.vcard { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.vc-name { font-size: 16px; font-weight: 700; letter-spacing: -.005em; margin-top: 4px; }
.vc-src { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.vc-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
dl.kv { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr); gap: 7px 12px; margin-top: 12px; font-size: 13.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kv-sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 3px 0; }
.prog { margin-top: 12px; }
.prog-bar { position: relative; height: 6px; border-radius: 99px; background: var(--blue-100); overflow: hidden; }
.prog-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 99px; }
.prog-txt { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.prog-txt b { color: var(--ink); }

.p-journey { border-top: 8px solid var(--bg); margin-top: 18px; padding-top: 18px; }
.j-head h2 { font-size: 16.5px; font-weight: 700; margin-top: 4px; letter-spacing: -.005em; }
.j-route { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.j-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; padding: 8px 10px; background: var(--bg); border-radius: 10px; }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 12px 0 14px; font-size: 12px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.mapkey .k-note { display: block; white-space: normal; max-width: 220px; font-weight: 500; color: var(--muted); border-top: 1px solid var(--line); padding-top: 5px; margin-top: 2px; }
.leglist { display: none; }

.evlist { list-style: none; padding: 0; margin: 0 0 8px; }
.ev { position: relative; padding: 0 0 16px 28px; }
.ev::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.ev:last-child::before { display: none; }
.ev.ev-act::before { background: #A7D8C4; }
.ev-dot { position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #94A3B8; background: #fff; }
.ev-act .ev-dot { background: var(--ok-dot); border-color: var(--ok-dot); }
.ev-act .ev-dot::after { content: ""; position: absolute; left: 3.5px; top: 1.5px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ev-est .ev-dot { border-color: var(--warn-dot); }
.ev-pln .ev-dot { border-style: dashed; }
.ev-now .ev-dot { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 76, 153, .16); }
.ev-end .ev-dot { background: var(--stale-bg); border-color: var(--stale-dot); }
.ev-title { font-size: 14px; font-weight: 650; line-height: 1.35; }
.ev-time { font-size: 13px; color: var(--ink); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ev-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.ev-now { background: var(--blue-50); margin: 0 -10px 12px -10px; padding: 10px 10px 12px 38px; border-radius: 12px; }
.ev-now .ev-dot { left: 10px; top: 12px; }
.ev-now::before { left: 17px; }
.ev-now .age { min-height: 24px; font-size: 12px; padding: 2px 10px 2px 8px; }

.p-foot { padding: 16px 18px 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.p-foot .refresh { font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.p-foot .contact b { margin-bottom: 2px; }

/* ---------- stage (map) ---------- */
.stage { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: #EEF2F6; }
.map-wrap { position: relative; min-height: 0; }
.map { position: absolute; inset: 0; }
.map.no-map { display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.mapkey { position: absolute; top: 12px; left: 12px; z-index: 2; list-style: none; margin: 0; padding: 8px 12px; display: grid; gap: 4px;
  background: rgba(255, 255, 255, .95); border-radius: 12px; box-shadow: var(--shadow); font-size: 12px; font-weight: 600; color: var(--ink); }
.mapkey li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mapkey i { width: 22px; height: 0; border-top: 3.5px solid var(--blue); flex: none; }
.mapkey i.k-rem { border-top: 3px dashed var(--blue); }
.mapkey i.k-onw { border-top: 3px dashed var(--faint); }
.mapkey i.k-route { border-top: 3px dashed var(--faint); }
.mapkey i.k-sel { border-top: 8px solid rgba(245, 197, 0, .55); border-radius: 4px; }
.mapkey i.k-ship { width: 22px; height: 12px; border: 0; background: no-repeat center/12px 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 20 22 12 17 4 22z' fill='%23F5C500' stroke='%230F172A' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.map-actions { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: flex; gap: 8px; flex-wrap: wrap; }
.map-actions .btn { box-shadow: var(--shadow); }
.m-status { display: none; }

.legstrip { display: flex; gap: 10px; overflow-x: auto; padding: 12px 14px; background: #fff; border-top: 1px solid var(--line);
  scroll-snap-type: x proximity; scrollbar-width: thin; }
.legstrip-label { flex: none; align-self: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.strip-sum { flex: none; align-self: center; margin-left: 6px; padding: 4px 8px 4px 16px; border-left: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.strip-sum .ss-route { font-size: 14px; font-weight: 700; color: var(--ink); }
.key-toggle { display: none !important; }
.leg { flex: 0 0 auto; width: 250px; max-width: 78vw; min-height: 68px; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 9px 12px 10px; display: grid; gap: 1px; cursor: pointer; scroll-snap-align: start; position: relative; }
.leg:hover { border-color: var(--line-2); background: var(--bg); }
.leg[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-50); }
.leg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.leg-no { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.leg-ves { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.leg-route { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lstat { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: #F1F5F9; color: var(--stale); }
.ls-current { background: var(--blue); color: #fff; }
.ls-done { background: var(--ok-bg); color: var(--ok); }
.ls-next { background: var(--warn-bg); color: var(--warn); }
.ls-plan { background: #F1F5F9; color: var(--stale); box-shadow: inset 0 0 0 1px #94A3B8; }
.ls-end { background: var(--stale-bg); color: var(--stale); }

/* ---------- map markers (dot is absolute at the anchor point) ---------- */
.zpin, .zship { position: absolute; width: 0; height: 0; }
.zpin-dot { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.zpin.r-load .zpin-dot { background: var(--navy); border: 2.5px solid #fff; box-shadow: 0 0 0 1.5px var(--navy); }
.zpin.r-final .zpin-dot { left: -8px; top: -8px; width: 16px; height: 16px; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--blue); }
.zpin.r-ts .zpin-dot { border-radius: 3px; transform: rotate(45deg); background: #fff; border: 3px solid var(--blue); }
.zpin.r-call .zpin-dot { left: -4.5px; top: -4.5px; width: 9px; height: 9px; background: var(--faint); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--faint); }
.zpin-lbl { position: absolute; white-space: nowrap; font: 650 12px/1.2 "Inter", sans-serif; color: var(--ink); background: rgba(255, 255, 255, .94);
  padding: 3px 7px; border-radius: 7px; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); pointer-events: none; }
.zpin-lbl small { font: 600 10.5px/1 var(--mono); color: var(--muted); margin-left: 4px; }
.zpin.code-only .zpin-name { display: none; }
.zpin.code-only .zpin-lbl small { margin-left: 0; }
.zpin.r-call .zpin-lbl { font-weight: 550; color: #1E293B; }
.zpin[data-side="right"] .zpin-lbl { left: 13px; top: 0; transform: translateY(-50%); }
.zpin[data-side="left"] .zpin-lbl { right: 13px; top: 0; transform: translateY(-50%); }
.zpin[data-side="below"] .zpin-lbl { top: 12px; left: 0; transform: translateX(-50%); }
.zpin[data-side="above"] .zpin-lbl { bottom: 12px; left: 0; transform: translateX(-50%); }
.zpin.dot-only .zpin-lbl { display: none; }
.zpin.dim { opacity: .45; }
.zship { z-index: 5; }
.zship-halo { position: absolute; left: -21px; top: -21px; width: 42px; height: 42px; border-radius: 50%; background: rgba(0, 76, 153, .16);
  box-shadow: 0 0 0 1px rgba(0, 76, 153, .25); }
.zship-hull { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; filter: drop-shadow(0 1px 1.5px rgba(15, 23, 42, .45)); }
.zship-tip { position: absolute; white-space: nowrap; font: 650 12px/1.2 "Inter", sans-serif; color: #fff; background: var(--navy);
  padding: 4px 8px; border-radius: 7px; pointer-events: none; }
.zship[data-side="right"] .zship-tip { left: 20px; top: 0; transform: translateY(-50%); }
.zship[data-side="left"] .zship-tip { right: 20px; top: 0; transform: translateY(-50%); }
.zship[data-side="below"] .zship-tip { top: 20px; left: 0; transform: translateX(-50%); }
.zship[data-side="above"] .zship-tip { bottom: 20px; left: 0; transform: translateX(-50%); }
.zship.stale .zship-halo { background: rgba(100, 116, 139, .18); box-shadow: 0 0 0 1px rgba(100, 116, 139, .3); }

/* MapLibre controls: 44 px targets, unclipped attribution */
.maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }
.maplibregl-ctrl-group { border-radius: 12px !important; overflow: hidden; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-attrib-inner { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 4px; }
.maplibregl-ctrl-attrib a { color: #1E293B; }
.maplibregl-cooperative-gesture-screen { font-family: "Inter", sans-serif; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: var(--top) 0 0 var(--panel); z-index: 40; background: rgba(15, 23, 42, .32); opacity: 0; transition: opacity .2s; }
.scrim.show { opacity: 1; }
.drawer { position: fixed; z-index: 45; top: var(--top); bottom: 0; left: var(--panel); width: min(440px, calc(100vw - var(--panel)));
  background: #fff; border-right: 1px solid var(--line); box-shadow: 16px 0 40px rgba(15, 23, 42, .18); overflow-y: auto;
  transform: translateX(-24px); opacity: 0; visibility: hidden; transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s; }
.drawer.open { transform: none; opacity: 1; visibility: visible; transition: transform .22s ease, opacity .22s ease; }
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 17px; font-weight: 700; }
.d-sec { padding: 18px; border-bottom: 1px solid var(--line); }
.d-sec:last-child { border-bottom: 0; }
.d-sec h3 { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.d-big { font-size: 16px; font-weight: 650; }
.d-muted { color: var(--muted); font-size: 14px; margin-top: 2px; }
.d-fine { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.d-sec dl.kv { margin-top: 10px; }
.ctr { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.ctr li { font: 600 13.5px/1 var(--mono); padding: 11px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; text-align: center; letter-spacing: .02em; }
.ctr-more { margin-top: 10px; }
.d-actions { display: grid; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px); overflow-wrap: anywhere; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.tabs { display: none; }

/* ---------- limited (B/L summary only) ---------- */
.lim-stage { display: grid; place-items: center; padding: 40px; color: #fff; --focus: var(--gold);
  background: radial-gradient(90% 120% at 30% 0%, rgba(0, 76, 153, .9), rgba(0, 76, 153, 0) 65%), linear-gradient(180deg, #0F172A, #0B1B36); }
.lim-card { width: min(640px, 100%); }
.lim-route { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 16px; }
.lim-pt b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; }
.lim-pt small { display: block; color: #AFC6E3; font-size: 13px; font-weight: 600; margin-top: 4px; }
.lim-pt.end { text-align: right; }
.lim-line { height: 0; border-top: 3px dashed rgba(255, 255, 255, .55); position: relative; }
.lim-line::before, .lim-line::after { content: ""; position: absolute; top: -8.5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.lim-line::before { left: -6px; }
.lim-line::after { right: -6px; }
.lim-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; color: #E2E8F0; font-size: 14px; }
.lim-facts b { color: #fff; }
.lim-msg { margin-top: 28px; color: #CBD5E1; font-size: 14.5px; max-width: 520px; }
.lim-lead { display: block; color: #fff; font-weight: 600; margin-bottom: 6px; }
.lim-msg a { color: #fff; font-weight: 600; display: inline-block; padding: 12px 0; margin: -12px 0; }

/* ---------- fix round: scroll cue, past-due schedule, transshipment labels ---------- */
.panel { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
.p-more { position: sticky; bottom: 0; height: 0; z-index: 4; }
.p-more-in { position: absolute; left: 0; right: 0; bottom: 0; height: 92px; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 12px; pointer-events: none; background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .97) 58%); }
.p-more button { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 18px;
  border-radius: 999px; border: 1px solid #B7CDE6; background: #fff; color: var(--blue); font: 600 13.5px/1 "Inter", sans-serif;
  box-shadow: var(--shadow); cursor: pointer; }
.p-more button:hover { background: var(--blue-50); border-color: var(--blue); }
.due { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.due::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #94A3B8; margin-right: 6px; vertical-align: 1px; }
.eta-src .due { grid-column: 1 / -1; margin-top: 0; }
.eta-next .due-inline { margin-top: 6px; }
.leg-due { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-due::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #94A3B8; margin-right: 6px; vertical-align: 1px; }
.zpin-ts { display: block; font: 700 9.5px/1.25 "Inter", sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); margin-top: 1px; }
.zpin.code-min .zpin-ts { display: none; }
.zpin.no-code .zpin-lbl small { display: none; }
.mapkey i.k-ts { height: 12px; border: 0; position: relative; }
.mapkey i.k-ts::after { content: ""; position: absolute; left: 6px; top: 1px; width: 6px; height: 6px; border: 2.5px solid var(--blue); background: #fff;
  border-radius: 2px; transform: rotate(45deg); }

/* =====================================================================
   MOBILE / TABLET  (< 900 px): three bottom tabs, state kept
   ===================================================================== */
@media (max-width: 899px) {
  :root { --top: 52px; }
  .tb-title { display: none; }
  .tb-btn .tb-txt { display: none; }
  .tb-btn { padding: 0; width: 44px; }
  .band { padding: 36px 16px 44px; }
  .band h1 { font-size: 27px; }
  .explain, .nf-tips { grid-template-columns: 1fr; }
  .res { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .res-date { grid-column: 1; }
  .res-go { grid-column: 2; grid-row: 1 / span 2; }

  body.track { overflow: auto; padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
  body.track.is-limited { padding-bottom: 0; }
  .app { display: block; height: auto; }
  .panel { border-right: 0; overflow: visible; background: #fff; max-width: 680px; margin: 0 auto; min-height: calc(100dvh - var(--top) - var(--tabs)); }
  body[data-tab="map"] .panel { display: none; }
  body[data-tab="details"] .p-journey { display: none; }
  body[data-tab="journey"] .p-details { display: none; }
  body[data-tab="journey"] .p-journey { border-top: 0; margin-top: 0; }
  .p-details, .p-journey { padding: 16px 16px 4px; }
  .stage { position: fixed; z-index: 5; top: var(--top); left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
  /* the map keeps >= 300 px (or the whole visible stage when the screen is shorter, never < 45vh): the leg strip
     then moves below the fold of the stage (it scrolls), so status card, view buttons, zoom control and route keep room
     and nothing of the map sits under the tab bar */
  .stage { grid-template-rows: minmax(max(45vh, min(300px, calc(100dvh - var(--top) - var(--tabs) - env(safe-area-inset-bottom)))), 1fr) auto;
    overflow-y: auto; overscroll-behavior: contain; }
  body[data-tab="details"] .stage, body[data-tab="journey"] .stage { visibility: hidden; pointer-events: none; }
  .m-status { display: block; position: absolute; z-index: 3; top: 10px; left: 10px; right: 10px; padding: 8px 12px 10px;
    background: rgba(255, 255, 255, .97); border-radius: 14px; box-shadow: var(--shadow); }
  .ms-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .ms-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .m-status .age { min-height: 24px; padding: 2px 10px 2px 8px; font-size: 11.5px; margin-top: 2px; max-width: 100%; }
  .ms-more { flex: none; min-height: 44px; margin: -6px -8px -6px 0; padding: 0 8px; border: 0; background: none; color: var(--blue); font-weight: 650; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
  .map-actions { left: 10px; right: 10px; top: var(--msh, 92px); bottom: auto; flex-wrap: nowrap; }
  .map-actions .btn { padding: 0 14px; }
  .key-toggle { display: inline-flex !important; }
  .mapkey { display: none; top: calc(var(--msh, 92px) + 54px); left: 10px; gap: 4px; padding: 8px 12px; font-size: 11.5px; }
  .mapkey.open { display: grid; }
  .strip-sum { display: none; }
  .legstrip { padding: 10px 10px; gap: 8px; }
  .legstrip-label { display: none; }
  .leg { width: min(300px, calc(100vw - 80px)); min-height: 64px; }
  .leglist { display: grid; gap: 8px; margin-top: 12px; }
  .leglist .leg { width: 100%; max-width: none; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; cursor: pointer;
    font-size: 12px; font-weight: 650; color: var(--muted); min-height: 44px; position: relative; }
  .tab[aria-selected="true"] { color: var(--blue); }
  .tab[aria-selected="true"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
  .scrim { inset: 0; }
  .drawer { top: 0; left: 0; right: 0; width: auto; border-right: 0; transform: translateY(24px); }
  .drawer.open { transform: none; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }

  body.is-limited .app { display: block; }
  .lim-stage { padding: 32px 18px 36px; }
  .lim-pt b { font-size: 20px; }
}
@media (max-width: 420px) {
  .pill { margin-top: 22px; }
  .pill label { padding-left: 12px; gap: 6px; }
  .pill label svg { display: none; }
  .pill button { padding: 0 18px; }
  .pill .btn-txt-long { display: none; }
  .lim-route { grid-template-columns: 1fr; gap: 10px; }
  .lim-pt.end { text-align: left; }
  .lim-line { width: 0; height: 36px; border-top: 0; border-left: 3px dashed rgba(255, 255, 255, .55); margin-left: 6px; }
  .lim-line::before { left: -8.5px; top: -6px; }
  .lim-line::after { left: -8.5px; right: auto; top: auto; bottom: -6px; }
}
@media (min-width: 421px) { .pill .btn-txt-short { display: none; } }
@media (max-width: 420px) { .pill .btn-txt-short { display: inline; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
/* map view toggle: "Whole voyage" + "Active leg" read as one segmented control */
#fit-all:not([hidden]) + #m-active:not([hidden]) { margin-left: -9px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
#fit-all:has(+ #m-active:not([hidden])) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
#fit-all[aria-pressed="true"], #m-active[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
#fit-all[aria-pressed="false"], #m-active[aria-pressed="false"] { background: #fff; border-color: #B7CDE6; color: var(--blue); }
.key-toggle[aria-expanded="true"] { background: var(--blue-50) !important; border-color: var(--blue) !important; }
@media (max-width: 899px) { .map-actions .key-toggle { margin-left: auto; } }
/* wide-but-short mobile layout (tablet, landscape phone): view buttons + Key sit beside the status card,
   so the top overlay band is one row and the route keeps more height */
@media (min-width: 680px) and (max-width: 899px) {
  .m-status { right: auto; width: calc(100% - 330px); max-width: 480px; }
  .map-actions { top: 10px; left: auto; right: 10px; }
  .mapkey { top: 64px; left: auto; right: 10px; }
}
