/* Bansar China — "Shipment File" tracking front-end. Self-hosted fonts, no CDN. */
@font-face { font-family: "Lato"; src: url("fonts/lato-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("fonts/lato-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("fonts/lato-900.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plexmono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --navy: #173284;
  --navy-2: #0f2466;
  --navy-ink: #10215a;
  --orange: #F78619;
  --orange-ink: #9a4c00;
  --orange-soft: #fff4e8;
  --ink: #1d2433;
  --muted: #4f5668;
  --line: #d6d9e0;
  --desk: #E5E5E5;
  --soft: #f4f5f8;
  --ok: #17603d;
  --ok-bg: #e4f2ea;
  --warn: #7a4300;
  --warn-bg: #fdecd8;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.5 "Lato", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--desk); }
img, svg { display: block; }
a { color: var(--navy); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
button { font: inherit; }
.mono { font-family: var(--mono); font-weight: 500; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 2px; }
.spine :focus-visible { outline-color: #fff; }

/* ---------- shell: navy spine + desk ---------- */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--navy) 0 216px, var(--orange) 216px 220px, var(--desk) 220px); }
.spine {
  background: var(--navy); color: #fff; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 26px; padding: 22px 18px 20px;
  border-right: 4px solid var(--orange);
}
.plate { display: block; background: #fff; border-radius: var(--radius); padding: 12px 14px; text-decoration: none; }
.plate img { width: 100%; max-width: 150px; height: auto; }
.eyebrow { display: block; font-size: 12px; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.spine .eyebrow { color: #f9b56f; }
.spine-ref { display: flex; flex-direction: column; gap: 8px; }
.spine-no { font-family: var(--mono); font-size: 12px; letter-spacing: -.03em; line-height: 1.45; word-break: break-all; color: #fff; }
.spine-route { color: #dfe4f3; font-size: 14px; line-height: 1.4; }
.spine-route b { color: #fff; display: inline-block; max-width: 100%; }
.spine-index { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: idx; }
.spine-index a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; color: #dfe4f3; text-decoration: none; border-radius: var(--radius); font-weight: 700; font-size: 15px; }
.spine-index a .n { font-family: var(--mono); font-size: 12px; color: #f9b56f; }
.spine-index a[aria-current="true"] { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.spine-index a:hover { background: rgba(255, 255, 255, .08); }
.spine-foot { margin-top: 2px; }
.spine-facts { margin: 0; display: flex; flex-direction: column; gap: 0; border-top: 1px solid rgba(255, 255, 255, .22); }
.spine-facts > div { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .22); }
.spine-facts dt { color: #c9d1ec; font-size: 11px; }
.spine-facts dd { color: #fff; font-size: 15px; margin-top: 2px; }
.spine-facts .mono { font-size: 13px; }
.spine-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: var(--radius); color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; }
.spine-link:hover { background: rgba(255, 255, 255, .1); }
.spine-link svg { width: 18px; height: 18px; }
.spine-note { color: #dfe4f3; font-size: 14px; line-height: 1.5; }

.desk { min-width: 0; padding: 32px clamp(16px, 3vw, 48px) 8px; display: flex; flex-direction: column; gap: 22px; max-width: 1200px; width: 100%; }

/* ---------- the file (paper sheet) ---------- */
.file { background: #fff; border-radius: 6px; border-top: 4px solid var(--orange); box-shadow: 0 1px 2px rgba(15, 36, 102, .08), 0 10px 28px rgba(15, 36, 102, .07); }
.cover { padding: 26px 32px 22px; }
.cover-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.stamp { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; border: 1.5px solid var(--navy); border-radius: 3px; color: var(--navy); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 900; letter-spacing: .02em; background: var(--navy); color: #fff; }
.pill[hidden] { display: none; }
.pill.p-port, .pill.p-ts { background: var(--orange); color: var(--navy-ink); }
.pill.p-arrived { background: var(--ok); color: #fff; }
.pill.p-wait, .pill.p-archive, .pill.p-limited { background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 1px #9aa0ad; }
.cover-no { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 14px 0 18px; }
.cover-no h1 { font: 500 clamp(19px, 2.4vw, 25px)/1.2 var(--mono); color: var(--navy); letter-spacing: .02em; overflow-wrap: anywhere; min-width: 0; }
.no-wrap { min-width: 0; }
/* r5: container-token view (masked B/L number, no PDF) */
.mask-hint { margin: -6px 0 18px; padding: 4px 0 4px 12px; border-left: 3px solid var(--orange); font-size: 14px; line-height: 1.45; color: var(--muted); max-width: 62ch; }
.docs .mask-hint { margin: 0; }
.fields dd .tag { margin-left: 6px; vertical-align: 1px; }
.no-wrap .lbl { font: 700 12px/1.3 "Lato", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.fields > div { padding: 12px 18px 12px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
/* label and value rows line up across each row of the cover grid, even when a label wraps */
@supports (grid-template-rows: subgrid) {
  .fields > div { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
}
dt { font-size: 12px; line-height: 1.35; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.code { font-family: var(--mono); font-size: .82em; font-weight: 500; color: var(--muted); white-space: nowrap; }
.arrow { color: var(--orange-ink); padding: 0 4px; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 18px; border-radius: var(--radius); font: 700 15px/1.1 "Lato", sans-serif; text-decoration: none; cursor: pointer; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); }
.btn:hover { background: var(--soft); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--navy-ink); }
.btn.primary:hover { background: #ff9a3c; }
.btn.solid { background: var(--navy); color: #fff; }
.btn.solid:hover { background: var(--navy-2); }
.btn.icon { padding: 0 12px; }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 14px; }

/* ---------- folder tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tab { appearance: none; position: relative; top: 1px; margin-top: 8px; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; background: transparent; color: var(--muted); font: 700 15px/1 "Lato", sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tab .n { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--orange-ink); }
.tab:hover { color: var(--navy); }
.tab[aria-selected="true"] { background: #fff; border-color: var(--line); color: var(--navy); box-shadow: inset 0 3px 0 var(--orange); }
.tab[hidden] { display: none; }
.panel { padding: 28px 32px 32px; }
.panel[hidden] { display: none; }

/* ---------- shipment tab ---------- */
.status { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px 32px; align-items: start; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.status h2 { font: 900 clamp(22px, 2.4vw, 28px)/1.2 "Lato", sans-serif; margin: 8px 0 10px; color: var(--ink); }
.status .sub { color: var(--muted); max-width: 62ch; }
.status .sub + .sub { margin-top: 8px; }
.status .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.badge { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge[hidden] { display: none; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.badge.b-ok { background: var(--ok-bg); color: var(--ok); box-shadow: none; }
.badge.b-warn { background: var(--warn-bg); color: var(--warn); box-shadow: none; }
.badge.b-stale { background: var(--soft); color: var(--muted); }
.eta { background: var(--soft); border-left: 4px solid var(--navy); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.eta[hidden] { display: none; }
.eta-row { display: flex; flex-direction: column; gap: 3px; }
.eta-row + .eta-row { border-top: 1px dashed #c2c6cf; padding-top: 12px; }
.eta-row .v { font: 900 20px/1.25 "Lato", sans-serif; color: var(--navy); }
.eta-row .v small { font-size: 15px; font-weight: 700; }
.eta-row .v.tba { font-size: 17px; color: var(--ink); }
.nw { white-space: nowrap; }
.eta-row .why { font-size: 14px; color: var(--muted); }
.eta-row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted); }
.eta-src { list-style: none; margin: 4px 0 0; padding: 0; font-size: 14px; }
.eta-src li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dotted #c2c6cf; }
.notice { border: 1px solid #f3b877; background: var(--orange-soft); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); font-size: 15px; margin-top: 14px; }

.sec { padding: 24px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.sec:last-child { border-bottom: 0; padding-bottom: 0; }
.sec[hidden] { display: none; }
.sec h3 { display: flex; align-items: baseline; gap: 10px; font: 900 18px/1.3 "Lato", sans-serif; margin-bottom: 12px; color: var(--ink); }
.sec h3 .n { font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--orange-ink); }
.secs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 44px; }
.secs .sec.wide { grid-column: 1 / -1; }
dl.rows { margin: 0; }
dl.rows > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
dl.rows > div:last-child { border-bottom: 0; }
dl.rows dt { padding-top: 2px; }
dl.rows dd { margin: 0; font-weight: 700; }
dl.rows dd .light { font-weight: 400; color: var(--muted); }

.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 8px; margin-top: 14px; }
.box { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 2px 2px 12px; background: #fff; min-width: 0; }
.box .mono { font-size: 15px; letter-spacing: .03em; overflow-wrap: anywhere; }
.box.more { display: none; }
.boxes.open .box.more { display: flex; }
.copy { appearance: none; border: 0; background: transparent; color: var(--navy); width: 44px; height: 44px; min-width: 44px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.copy:hover { background: var(--soft); }
.copy svg { width: 18px; height: 18px; }
.more-btn { margin-top: 10px; }

.legs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.legs li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.legs li:last-child { border-bottom: 0; }
.legs .lno { font-family: var(--mono); font-size: 13px; color: var(--orange-ink); padding-top: 3px; }
.legs .vn { font-weight: 900; }
.legs .vd { display: block; font-size: 14px; color: var(--muted); }
.legs .tracked { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--navy); background: #e8ecf8; border-radius: 3px; padding: 3px 8px; white-space: nowrap; }
.contact-phone { display: inline-flex; align-items: center; min-height: 44px; margin: -11px 0; font-weight: 700; }

/* ---------- journey tab ---------- */
.journey-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 20px; margin-bottom: 14px; }
.journey-head h2, .docs h2 { font: 900 22px/1.25 "Lato", sans-serif; }
.journey-head p { color: var(--muted); font-size: 15px; }
.mapwrap { position: relative; height: clamp(340px, 54vh, 540px); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #e6ebf1; }
#map { position: absolute; inset: 0; }
#map.no-map::after { content: "Map unavailable in this browser"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend li[hidden] { display: none; }
.lg-line { width: 28px; height: 0; border-top: 3.5px solid var(--navy); }
.lg-line.dash { border-top: 3px dashed var(--navy); }
.lg-line.onw { border-top: 3px dotted var(--orange-ink); }
.lg-dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--navy); background: #fff; }
.lg-dot.ts { background: var(--orange); border: 2px solid var(--navy-ink); border-radius: 2px; transform: rotate(45deg); width: 11px; height: 11px; }
.lg-dot.fin { background: var(--navy); border-color: var(--navy); box-shadow: inset 0 0 0 2px #fff; }
.lg-ship { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 14px solid var(--orange); }

/* markers (pins are absolute inside the marker element; marker centre = coordinate) */
.mk { width: 14px; height: 14px; }
.mk > i { position: absolute; inset: 0; border-radius: 50%; background: #fff; border: 3px solid var(--navy); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); }
.mk.ts > i { background: var(--orange); border: 2px solid var(--navy-ink); border-radius: 2px; transform: rotate(45deg); }
.mk.final > i { background: var(--navy); border-color: var(--navy); box-shadow: inset 0 0 0 2px #fff, 0 0 0 1.5px #fff; }
.mk.quiet { width: 10px; height: 10px; }
.mk.quiet > i { border-width: 2px; border-color: #5b6272; }
.mk .lab { position: absolute; white-space: nowrap; background: #fff; color: var(--navy-ink); font: 700 12px/1.25 "Lato", sans-serif; padding: 3px 7px; border-radius: 3px; box-shadow: 0 1px 3px rgba(16, 33, 90, .35); pointer-events: none; }
.mk .lab small { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--muted); margin-left: 3px; }
.mk[data-side="right"] .lab { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
.mk[data-side="left"] .lab { right: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
.mk[data-side="below"] .lab { top: calc(100% + 5px); left: 50%; transform: translateX(-50%); }
.mk[data-side="above"] .lab { bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); }
.mk.compact .lab .nm { display: none; }
.mk.compact .lab small { margin-left: 0; }
.mk.dot-only .lab { display: none; }
.mk.ship { width: 30px; height: 30px; z-index: 3; }
.mk.ship svg { position: absolute; inset: 0; width: 30px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.mk.ship .lab { background: var(--navy); color: #fff; }
.mk.ship[data-side="right"] .lab { left: calc(100% + 4px); }
.mk.ship[data-side="left"] .lab { right: calc(100% + 4px); }
.mk.ship .lab.off { display: none; }
.maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }
.maplibregl-ctrl-attrib { font-size: 11px; }

.log-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 20px; margin: 30px 0 10px; }
.log-head h3 { font: 900 18px/1.3 "Lato", sans-serif; }
.keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.keys li { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 900px) { .keys { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 28px; } }
.log { width: 100%; border-collapse: collapse; font-size: 15px; }
.log th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--navy); }
.log td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.log td.c-date { white-space: nowrap; font-weight: 700; }
.log td.c-time { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.log td.c-ev b { display: block; }
.log td.c-ev .note { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.log td.c-place .code { margin-left: 4px; }
/* "Now" divider: a full-width row, no value in the Date column */
.log tr.k-now td { background: var(--orange-soft); border-top: 1px solid #f3b877; border-bottom: 1px solid #f3b877; padding: 12px; }
.log tr.k-now td.c-now { box-shadow: inset 4px 0 0 var(--orange); padding-left: 16px; }
.now-lbl { display: inline-flex; align-items: center; gap: 7px; font: 900 13px/1.5 "Lato", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-ink); }
.now-lbl::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px #fbd3a8; }
.now-txt b { display: block; }
.now-txt .note { display: block; font-size: 14px; color: var(--ink); margin-top: 2px; }
.now-txt .now-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.t-late { background: #fff; color: #8a3c00; box-shadow: inset 0 0 0 1.5px #c86200; margin-left: 6px; }
.k-stop { color: var(--ink); font-size: 13px; }
.log tr.k-next td.c-ev b { font-weight: 700; color: #343b4b; }
.log tr.k-end td { background: var(--soft); }
.tag { display: inline-block; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; line-height: 1.5; }
.t-act { background: var(--navy); color: #fff; }
.t-est { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px #f0b06b; }
.t-pln { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px #8a90a0; }
.log .src { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- documents tab ---------- */
.docs { display: flex; flex-direction: column; gap: 16px; }
.doc-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 20px; background: linear-gradient(90deg, var(--soft) 0 6px, #fff 6px); }
.doc-card .ico { width: 56px; height: 64px; }
.doc-card h3 { font: 900 17px/1.3 "Lato", sans-serif; }
.doc-card p { color: var(--muted); font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.doc-card > div { min-width: 0; }
.doc-card .acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; padding: 4px 32px 20px; font-size: 14px; color: var(--muted); }
.foot address { font-style: normal; display: flex; flex-direction: column; gap: 0; max-width: 520px; }
.foot address b { color: var(--ink); }
.foot .links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.foot .links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.foot .stamp-time { font-variant-numeric: tabular-nums; }

/* ---------- search & not found ---------- */
.sheet { background: #fff; border-radius: 6px; border-top: 4px solid var(--orange); box-shadow: 0 1px 2px rgba(15, 36, 102, .08), 0 10px 28px rgba(15, 36, 102, .07); padding: 34px 36px 36px; max-width: 1080px; }
.search-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px 40px; align-items: start; margin-top: 26px; }
.search-grid .lookup { margin-top: 0; }
.formats-panel { background: var(--soft); border-left: 4px solid var(--navy); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 18px 6px; }
.formats-panel .formats { margin-top: 0; }
.formats-panel .formats td, .formats-panel .formats th { border-bottom-color: #c2c6cf; }
.page-search .foot, .page-notfound .foot { padding-left: 36px; padding-right: 36px; max-width: 1080px; margin-top: auto; }
.sheet h1 { font: 900 clamp(24px, 3vw, 32px)/1.2 "Lato", sans-serif; margin: 8px 0 8px; }
.sheet .lead { color: var(--muted); max-width: 60ch; }
.lookup { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; }
.lookup label { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--navy); }
.lookup .row { display: flex; gap: 10px; flex-wrap: wrap; }
.lookup input { flex: 1 1 240px; min-width: 0; height: 56px; padding: 0 16px; border: 1.5px solid #5b6272; border-radius: var(--radius); font: 500 19px/1 var(--mono); letter-spacing: .04em; color: var(--ink); background: #fff; text-transform: uppercase; }
.lookup input::placeholder { color: #6b7180; text-transform: none; letter-spacing: 0; font-family: "Lato", sans-serif; font-size: 16px; }
.lookup input:focus { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.lookup input:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; }
.lookup .btn { height: 56px; padding: 0 24px; }
.hint { font-size: 14px; color: var(--muted); max-width: 64ch; }
.err { color: #9b1c1c; font-weight: 700; font-size: 15px; }
.formats { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: 15px; }
.formats caption { text-align: left; font: 900 16px/1.3 "Lato", sans-serif; padding-bottom: 8px; }
.formats th, .formats td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.formats th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 2px solid var(--navy); }
.formats td .mono { color: var(--navy); }
.results { margin-top: 30px; }
.results h2 { font: 900 20px/1.3 "Lato", sans-serif; margin-bottom: 10px; }
.res { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--navy); }
.res li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.res li > .meta { grid-column: 1; }
.res li > .btn { grid-column: 2; grid-row: 1 / span 2; }
.res .no { display: block; font-family: var(--mono); font-size: 15px; color: var(--navy); overflow-wrap: anywhere; }
.res .cont { display: block; margin-top: 2px; }
.results .hint { margin-bottom: 12px; }
.res li:last-child { border-bottom: 0; }
.formats tbody tr:last-child td { border-bottom: 0; }
.res .meta { font-size: 14px; color: var(--muted); }
.res .meta b { color: var(--ink); }
.checks { margin: 18px 0 0; padding-left: 20px; color: var(--muted); }
.checks li { margin: 4px 0; }
.q-echo { font-family: var(--mono); color: var(--navy); background: var(--soft); padding: 1px 6px; border-radius: 3px; overflow-wrap: anywhere; }

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

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .search-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .secs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .spine { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; border-right: 0; border-bottom: 4px solid var(--orange); }
  .plate { padding: 7px 9px; }
  .plate img { max-width: 104px; }
  .shell { background: var(--desk); }
  .spine-ref, .spine-facts, .spine-note { display: none; }
  .foot { padding: 4px 6px 20px; }
  .spine-foot { margin: 0 0 0 auto; }
  .desk { padding: 18px 12px 4px; gap: 18px; }
  .status { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cover { padding: 20px 16px 18px; }
  .panel { padding: 20px 16px 24px; }
  .tabs { position: sticky; top: 0; z-index: 6; padding: 0 6px; gap: 2px; }
  .tab { flex: 1 1 0; justify-content: center; padding: 0 6px; font-size: 14px; min-width: 0; }
  .tab .n { display: none; }
  .fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fields > div { padding-right: 10px; }
  .fields > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  dl.rows > div { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .legs li { grid-template-columns: minmax(0, 1fr) auto; }
  .legs .lno { grid-column: 1 / -1; }
  .doc-card { grid-template-columns: 44px minmax(0, 1fr); gap: 12px 14px; padding: 16px; }
  .doc-card .ico { width: 40px; height: 46px; }
  .doc-card .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .sheet { padding: 22px 16px 24px; }
  .page-search .foot, .page-notfound .foot { padding: 4px 6px 20px; }
  .formats-panel { padding: 12px 14px 4px; }
  .lookup .btn { width: 100%; }
  .res li { grid-template-columns: minmax(0, 1fr); }
  .res li > .btn { grid-column: 1; grid-row: auto; justify-self: start; }
  .formats thead { display: none; }
  .formats tr { display: block; padding: 10px 0; border-bottom: 1px dashed var(--line); }
  .formats td { display: block; border: 0; padding: 2px 0; }
  .formats td:first-child { font-weight: 900; }
  .formats tbody tr:last-child { border-bottom: 0; }
  .mapwrap { height: 360px; }
  /* events table -> stacked cards */
  .log thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .log, .log tbody, .log tr, .log td { display: block; }
  .log tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 12px 14px; background: #fff; }
  .log td { border: 0; padding: 0; }
  .log td.c-date, .log td.c-time { display: inline; font-size: 14px; }
  .log td.c-time { margin-left: 6px; }
  .log td.c-ev { margin-top: 6px; }
  .log td.c-place { font-size: 14px; color: var(--muted); margin-top: 2px; }
  .log td.c-basis { margin-top: 8px; }
  .log td.c-basis .src { display: inline; margin-left: 8px; }
  .log tr.k-now { background: var(--orange-soft); border: 2px solid var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
  .log tr.k-now td { background: transparent; box-shadow: none; border: 0; padding: 0; }
  .log tr.k-now td.c-now { box-shadow: none; padding: 0; }
  .log tr.k-now td.now-txt { margin-top: 6px; }
  .log tr.k-end { background: var(--soft); }
  .log tr.k-end td { background: transparent; }
  .foot { flex-direction: column; }
}
@media (max-width: 360px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .cover-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
