/* Lanes: an industrial palette. Graphite steel, concrete, safety yellow for what needs a person, signal red for
   exceptions, cobalt for links. Condensed labels, mono numerals, square corners. */
:root {
  --steel: #232B33; --steel-2: #303A44; --ink: #1B2026; --canvas: #E4E2DC; --panel: #F6F5F1; --paper: #FFFDF5;
  --line: #C9C6BD; --line-soft: #DDDAD2; --muted: #59616A; --faint: #8B9198;
  --hazard: #F2B300; --signal: #C62828; --rust: #9A3A22; --cobalt: #1D4E89; --go: #2E6B47; --accent: #1D4E89;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace; --cond: "Barlow Condensed", Barlow, sans-serif;
}
html { font-size: 13.5px; }
body { font-variant-numeric: tabular-nums; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.mono, .api, pre, code, kbd { font-family: var(--mono); }
h1, h2, h3 { font-family: var(--cond); }

/* ── app bar ───────────────────────────────────────────────────────────────────────────────── */
.appbar { height: 46px; background: var(--steel); color: #E9ECEF; display: flex; align-items: stretch; gap: 22px;
  padding: 0 18px; border-bottom: 3px solid var(--hazard); }
.appbrand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.brand-mark { width: 20px; height: 20px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 4px, var(--ink) 4px 8px);
  border: 1px solid var(--hazard); }
.brand-name { font-family: var(--cond); font-weight: 700; font-size: 21px; letter-spacing: .06em; text-transform: uppercase; }
.brand-sub { font-family: var(--cond); font-size: 12px; color: #93A0AB; letter-spacing: .08em; text-transform: uppercase; }
.appnav { display: flex; align-items: stretch; }
.navlink { display: flex; align-items: center; gap: 6px; padding: 0 11px; color: #AEB8C1; font-family: var(--cond);
  font-size: 15px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; border-bottom: 4px solid transparent;
  margin-bottom: -3px; }
.navlink:hover { color: #fff; }
.navlink.is-active { color: #fff; border-bottom-color: #fff; background: var(--steel-2); }
.navlink kbd { font-size: 9.5px; color: #77838E; border: 1px solid #46515B; padding: 0 3px; line-height: 13px; letter-spacing: 0; }
.btn kbd { font-size: 9.5px; color: var(--faint); border: 1px solid var(--line); padding: 0 3px; line-height: 13px; }
.count-pill { background: var(--hazard); color: var(--ink); padding: 0 5px; font-size: 12px; font-weight: 700; font-family: var(--mono); letter-spacing: 0; }
.appclock { margin-left: auto; display: flex; align-items: center; }
.clock { display: flex; align-items: baseline; gap: 8px; }
.clock-label { font-family: var(--cond); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: #93A0AB; }
.clock-digits { font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--hazard); letter-spacing: .02em; }
.clock-digits small { font-size: 12px; color: #C9A23A; }
.clock-zone { font-size: 11px; color: #93A0AB; }
.replay-state { font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: #AEB8C1;
  border: 1px solid #46515B; padding: 0 6px; }
.replay-state.is-playing { color: var(--ink); background: var(--hazard); border-color: var(--hazard); }

footer.app-footer { position: sticky; bottom: 0; height: 26px; background: var(--steel); color: #93A0AB; display: flex;
  align-items: center; gap: 16px; padding: 0 18px; font-size: 11.5px; z-index: 30; }
footer.app-footer .link { color: #C3CCD4; }
.synthetic { font-family: var(--cond); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: #93A0AB; white-space: nowrap; }

/* ── generic parts every screen uses ─────────────────────────────────────────────────────────── */
.panel { background: var(--panel); border: 1px solid var(--line); }
.panel-head { display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: #ECEAE4; }
.panel-head h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.page-head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.page-head h1 { font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; line-height: 1.1; }
.page-head > span { color: var(--muted); }
.link { color: var(--cobalt); text-decoration: underline; text-decoration-color: rgba(29, 78, 137, .3); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--cobalt); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 11px;
  border: 1px solid #A9A69D; background: #fff; font-family: var(--cond); font-weight: 600; font-size: 14px;
  letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--steel); color: #fff; border-color: var(--steel); }
.btn-primary kbd { color: #AEB8C1; border-color: #4A5560; }
.btn-accent { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.btn-go { background: var(--hazard); color: var(--ink); border-color: #C99500; min-width: 150px; }
.btn-go.is-on { background: var(--steel); color: var(--hazard); border-color: var(--steel); }
.btn-go kbd { border-color: rgba(0, 0, 0, .25); color: rgba(0, 0, 0, .55); }
.btn-go.is-on kbd { border-color: #4A5560; color: #AEB8C1; }
.btn:focus-visible, .row:focus-visible, .input:focus-visible, a:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid #A9A69D; }
.seg button { height: 28px; padding: 0 9px; background: #fff; border-left: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.seg button:first-child { border-left: 0; }
.seg button.is-on { background: var(--steel); color: #fff; }
.input, select.input { height: 30px; border: 1px solid #A9A69D; padding: 0 8px; background: #fff; min-width: 0; }
textarea.input { height: auto; padding: 6px 8px; }
.mchip { padding: 2px 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mchip:hover { border-color: var(--ink); color: var(--ink); }
.mchip.is-on { color: #fff; background: var(--steel); border-color: var(--steel); font-weight: 600; }
.notice { padding: 6px 10px; border: 1px solid var(--ink); border-left-width: 4px; background: var(--paper); margin-bottom: 8px; }
.notice.is-error { border-color: var(--signal); color: var(--signal); }
.label { font-family: var(--cond); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.big { font-family: var(--mono); font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }

.tiles { display: grid; background: var(--panel); border: 1px solid var(--line); }
.tiles > div { padding: 9px 12px; border-left: 1px solid var(--line); }
.tiles > div:first-child { border-left: 0; }
.tiles span { display: block; font-family: var(--cond); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tiles b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 3px; }
.tiles i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.tiles .is-weak { background: #FBEFD0; box-shadow: inset 0 3px 0 var(--hazard); }

table.feed, table.grid-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
table.grid-table { table-layout: auto; }
.feed th, .grid-table th { text-align: left; font-family: var(--cond); font-weight: 600; font-size: 12px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); padding: 5px 8px; border-bottom: 1px solid var(--line); background: #ECEAE4; white-space: nowrap; }
.feed td, .grid-table td { padding: 4px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.feed tr.row { cursor: pointer; }
.feed tr.row:hover td { background: #EFEDE7; }
.feed tr.row.is-open td { background: #E9E7E0; border-bottom-color: transparent; }
.feed tr.row.is-child td:nth-child(3) { padding-left: 16px; }
.feed tr.detail > td { background: #E9E7E0; padding: 0; border-bottom: 1px solid var(--line); }
.api { font-size: 12px; }
.api b { font-weight: 600; color: var(--cobalt); }

.tier { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 0 4px; border: 1px solid #A9A69D; color: var(--muted); background: #fff; }
.tier-1 { border-color: var(--cobalt); color: var(--cobalt); }
.tier-2 { border-color: var(--ink); color: var(--ink); background: var(--hazard); }
.tier-3 { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip { display: inline-block; font-family: var(--cond); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 0 6px; border: 1px solid transparent; white-space: nowrap; }
.chip-done { background: #DCE6DF; color: var(--go); }
.chip-waiting { background: var(--hazard); color: var(--ink); }
.chip-decided, .chip-rejected { border-color: #A9A69D; color: var(--muted); }
.chip-approved { border-color: var(--cobalt); color: var(--cobalt); }
.chip-declined { border-color: var(--ink); color: var(--ink); }
.chip-reverted { border: 1px dashed #8B9198; color: var(--muted); font-style: italic; }
.chip-failed { background: var(--signal); color: #fff; }

.entry { padding: 10px 14px 14px; }
.entry h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin-bottom: 8px; }
.facts dt, .kv dt { color: var(--muted); }
.kv { display: grid; grid-template-columns: 78px 1fr; gap: 3px 8px; }
.checks { margin-top: 6px; font-size: 12px; color: var(--muted); }
.checks li::before { content: "– "; }
.ev { margin-top: 6px; }
.ev-cap { font-size: 12px; font-weight: 600; margin-bottom: 2px; display: flex; gap: 8px; align-items: baseline; }
.ev-src { font-weight: 400; color: var(--muted); font-size: 11px; }
.ev-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); font-size: 12px; }
.ev-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ev-table td { padding: 2px 6px; border-bottom: 1px solid #EEECE6; font-family: var(--mono); font-size: 11.5px; }
details.sql summary { cursor: pointer; color: var(--cobalt); font-size: 12px; user-select: none; }
details.sql pre { margin-top: 4px; padding: 8px 10px; background: #1F262D; color: #DDE3E8; border-left: 3px solid var(--hazard); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; }
.htmx-request .htmx-hide { opacity: .4; }
.feed tr.row, .entry, article.panel { scroll-margin-top: 56px; }
.replay-mode { font-size: 11px; color: var(--muted); border: 1px dashed #A9A69D; padding: 0 6px; white-space: nowrap; }

.doc h2 { font-size: 19px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.doc h3 { font-size: 16px; font-weight: 700; letter-spacing: .02em; margin: 14px 0 4px; }
.doc h2:first-child, .doc h3:first-child { margin-top: 0; }
.doc p { margin: 6px 0; line-height: 1.55; max-width: 82ch; }
.doc ul { margin: 6px 0 6px 18px; list-style: square; }
.doc li { margin: 3px 0; line-height: 1.5; max-width: 82ch; }
.doc code { font-size: 12px; background: #E9E7E0; padding: 0 3px; }
.doc h4 { font-size: 14px; font-weight: 600; margin: 10px 0 4px; }
.doc ol { margin: 6px 0 6px 22px; list-style: decimal; }
.doc pre.codeblock { margin: 8px 0; padding: 8px 10px; background: #1F262D; color: #DDE3E8; border-left: 3px solid var(--hazard); font-size: 12px; line-height: 1.5; overflow-x: auto; max-width: 100ch; }
.doc pre.codeblock code { background: none; padding: 0; }
.doc pre.mermaid { margin: 8px 0; padding: 8px; background: #fff; border: 1px solid var(--line); font-size: 12px; overflow-x: auto; }
.doc pre.mermaid:not([data-processed]) { color: var(--faint); font-size: 11px; max-height: 160px; overflow: hidden; }
.doc .tablewrap { overflow-x: auto; max-width: 100%; margin: 8px 0; }
.doc table.doctable { border-collapse: collapse; font-size: 12.5px; }
.doc table.doctable th, .doc table.doctable td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; line-height: 1.4; }
.doc table.doctable th { background: #ECEAE4; font-weight: 600; }
.doc i { font-style: italic; }

/* ── Lanes board ───────────────────────────────────────────────────────────────────────────── */
.deck { display: flex; align-items: flex-end; gap: 18px; }
.deck-title { flex: 1; }
.deck h1 { font-size: 26px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; line-height: 1; }
.deck h1 span { font-size: 17px; font-weight: 500; color: var(--muted); letter-spacing: .03em; margin-left: 8px; }
.regions { display: flex; gap: 4px; margin-top: 7px; flex-wrap: wrap; }
.transport { display: flex; align-items: center; gap: 6px; }
.scrub { width: 230px; margin-left: 6px; }
.scrub-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.scrub-top b { color: var(--ink); font-weight: 600; }
.scrub-rail { position: relative; height: 10px; background: #fff; border: 1px solid #A9A69D; margin-top: 2px; }
.scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, #3C4752 0 3px, #2A333B 3px 6px); }
.scrub-rail i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--hazard); margin-left: -1px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }

.plates { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.plate { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--steel); padding: 6px 11px 7px; min-width: 0; }
.plate span { display: block; font-family: var(--cond); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate b { display: block; font-family: var(--mono); font-size: 24px; font-weight: 600; line-height: 1.15; }
.plate b small { font-size: 12px; color: var(--muted); margin-right: 4px; }
.plate i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate.is-hot { border-top-color: var(--hazard); background: #FBF3DA; }

.yard { display: grid; grid-template-columns: minmax(0, 1fr) 404px; gap: 10px; margin-top: 10px; height: calc(100vh - 252px); min-height: 520px; }
.board-panel { background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.axis, .lane { display: grid; grid-template-columns: 196px minmax(0, 1fr) 214px; }
.axis { height: 38px; background: var(--steel); color: #C3CCD4; flex-shrink: 0; }
.axis-meta, .axis-receipt { font-family: var(--cond); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 0 12px; display: flex; align-items: center; }
.axis-receipt { border-left: 1px solid #46515B; }
.axis-track { position: relative; border-left: 1px solid #46515B; }
.tick { position: absolute; top: 3px; transform: translateX(-50%); white-space: nowrap; line-height: 14px; }
.tick::after { content: ""; position: absolute; left: 50%; top: 15px; width: 1px; height: 18px; background: #46515B; }
.tick b { font-family: var(--cond); font-size: 12.5px; font-weight: 600; color: #E9ECEF; }
.tick em { font-style: normal; font-family: var(--mono); font-size: 9.5px; color: #8796A3; margin-left: 3px; }
.tick.is-today b { color: var(--hazard); }
.axis-now { position: absolute; bottom: -1px; transform: translateX(-50%); background: var(--hazard); color: var(--ink); font-family: var(--mono);
  font-size: 10px; font-weight: 600; padding: 0 3px; z-index: 2; }

.lanes { overflow-y: auto; flex: 1; min-height: 0; }
.lanes-empty { padding: 28px 24px; color: var(--muted); max-width: 70ch; }
.lane { height: 70px; border-bottom: 1px solid var(--line-soft); box-shadow: inset 4px 0 0 #8E9AA5; background: var(--panel); }
.lane-waiting { box-shadow: inset 4px 0 0 var(--hazard); background: #FBF5E2; }
.lane-acted { box-shadow: inset 4px 0 0 var(--steel); }
.lane-declined, .lane-reverted { box-shadow: inset 4px 0 0 var(--faint); }
.lane-meta { padding: 7px 10px 0 14px; min-width: 0; }
.lane-ref { display: flex; align-items: center; gap: 6px; }
.lane-ref b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.region-code { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--faint); }
.mode { font-family: var(--cond); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; padding: 0 4px; line-height: 15px; }
.mode-sea { background: var(--cobalt); }
.mode-air { background: #6B4E9B; }
.mode-road { background: #6C5B3B; }
.lane-route { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lane-route span { color: var(--faint); font-weight: 400; }
.lane-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lane-track { position: relative; overflow: hidden; border-left: 1px solid var(--line-soft);
  background-image: repeating-linear-gradient(to right, rgba(0,0,0,.05) 0 1px, transparent 1px calc(100% / 21)); }
.rail { position: absolute; top: 29px; height: 0; border-top: 2px dashed #8E9AA5; }
.rail-done { position: absolute; top: 28px; height: 4px; background: var(--steel); }
.clip { position: absolute; top: 34px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.clip-left { left: 3px; }
.clip-right { right: 3px; }
.late { position: absolute; top: 27px; height: 6px; background: repeating-linear-gradient(-45deg, var(--signal) 0 3px, #E57373 3px 6px); }
.promise { position: absolute; top: 24px; width: 9px; height: 9px; margin-left: -4.5px; transform: rotate(45deg); background: #fff; border: 2px solid var(--signal); }
.stop { position: absolute; top: 25px; margin-left: -5px; }
.stop i { display: block; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--steel); }
.stop.is-passed i { background: var(--steel); }
.stop-call i { width: 8px; height: 8px; margin: 1px; }
.stop em { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); font-style: normal; font-family: var(--mono); font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.stop-origin em { left: auto; right: 2px; transform: none; }
.stop-destination em { left: 6px; transform: none; color: var(--ink); font-weight: 600; }
.free { position: absolute; left: 0; right: 0; top: 50px; height: 9px; }
.free span { position: absolute; top: 0; height: 9px; }
.free-used { background: repeating-linear-gradient(-45deg, #B9B5AA 0 2px, #D9D6CD 2px 4px); }
.free-left { background: var(--hazard); border: 1px solid #B88600; }
.free-over { background: var(--signal); }
.free-label { top: -2px !important; height: auto !important; margin-left: 6px; font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--ink); white-space: nowrap; background: rgba(246, 245, 241, .85); padding: 0 2px; }
.free-label.is-soon { color: #8A5A00; }
.free-label.is-over { color: var(--signal); }
.flags { position: absolute; top: 4px; display: flex; gap: 2px; padding-left: 3px; }
.flags::before { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 26px; background: var(--ink); }
.flag { font-family: var(--cond); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 15px;
  padding: 0 10px 0 5px; color: #fff; background: var(--rust); white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%); }
.flag-waiting { background: var(--hazard); color: var(--ink); }
.flag-decided { background: var(--cobalt); }
.flag-declined, .flag-reverted { background: #8B9198; }
.nowline { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--hazard); box-shadow: 0 0 0 1px rgba(27, 32, 38, .25); }

.ticket { position: relative; display: block; margin: 6px 10px 6px 12px; padding: 4px 8px 4px 12px; background: var(--paper); border: 1px solid var(--line);
  min-width: 0; height: 55px; overflow: hidden;
  background-image: radial-gradient(circle at 0 6px, var(--panel) 2.5px, transparent 3px); background-size: 6px 10px; background-repeat: repeat-y;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .06); }
.ticket:hover { border-color: var(--ink); }
.pin { position: absolute; top: 3px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.ticket-top { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; }
.ticket-top time { color: var(--muted); }
.stamp { font-family: var(--cond); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border: 1.5px solid var(--go); color: var(--go);
  padding: 0 3px; line-height: 12px; transform: rotate(-2deg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.ticket-waiting .stamp { border-color: #A87A00; color: #8A5A00; background: #FFF1C2; }
.ticket-approved .stamp { border-color: var(--cobalt); color: var(--cobalt); }
.ticket-declined .stamp, .ticket-rejected .stamp, .ticket-rolled_back .stamp { border-color: var(--muted); color: var(--muted); }
.more { margin-left: auto; margin-right: 8px; color: var(--muted); font-size: 10px; }
.ticket-call { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--cobalt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ticket-line { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 5px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); flex-shrink: 0; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; }
.lg-rail { width: 18px; height: 4px; background: var(--steel); }
.lg-plan { width: 18px; border-top: 2px dashed #8E9AA5; }
.lg-stop { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--steel); background: #fff; }
.lg-late { width: 18px; height: 6px; background: repeating-linear-gradient(-45deg, var(--signal) 0 3px, #E57373 3px 6px); }
.lg-free { width: 18px; height: 8px; background: var(--hazard); }
.lg-dem { width: 18px; height: 8px; background: var(--signal); }
.lg-flag { width: 16px; height: 10px; background: var(--rust); clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%); }
.lg-now { width: 3px; height: 12px; background: var(--hazard); box-shadow: 0 0 0 1px rgba(0,0,0,.3); }

.side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.side-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 11px; }
.side-head h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.side-head span { font-size: 11.5px; }
.mapcard { background: #1E262D; color: #C3CCD4; border: 1px solid #11161A; flex-shrink: 0; }
.mapcard .side-head span { color: #8796A3; }
.map { display: block; width: 100%; height: auto; padding: 0 6px 6px; }
.grat path { stroke: #2A343D; stroke-width: .6; fill: none; }
.region { fill: #303C47; stroke: #303C47; stroke-width: 16; stroke-linejoin: round; }
.region-label { font-family: var(--cond); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; fill: #8796A3; }
.port { fill: #7C8B97; }
.port-airport { fill: #9B8BC0; }
.route { fill: none; stroke: #6E9BCF; stroke-width: 1; stroke-dasharray: 3 2; opacity: .7; }
.route-waiting { stroke: var(--hazard); opacity: .95; }
.route-declined, .route-reverted { stroke: #8B9198; }
.ship circle { fill: #6E9BCF; stroke: #1E262D; stroke-width: 1.2; }
.ship-waiting circle { fill: var(--hazard); }
.ship-declined circle, .ship-reverted circle { fill: #8B9198; }
.tickercard { background: var(--panel); border: 1px solid var(--line); flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tickercard .side-head { border-bottom: 1px solid var(--line); background: #ECEAE4; }
.tickercard .side-head span { color: var(--muted); }
.ticker { overflow-y: auto; flex: 1; min-height: 0; }
.tk { display: grid; grid-template-columns: 40px 26px minmax(0, 1fr); column-gap: 6px; padding: 4px 11px; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.tk time { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tk b { font-family: var(--cond); font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tk-call { grid-column: 3; font-family: var(--mono); font-size: 10.5px; color: var(--cobalt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-who { grid-column: 3; font-size: 11px; color: var(--muted); }
.tk-waiting { background: #FBF5E2; }
.tk-empty { padding: 10px 11px; color: var(--muted); }

@keyframes landed { 0% { background-color: var(--hazard); transform: translateX(14px); opacity: .2; } 30% { opacity: 1; transform: none; } 100% { background-color: transparent; } }
@keyframes lane-in { 0% { background-color: #FFE38A; } 100% { background-color: var(--panel); } }
.landed { animation: landed 2.2s ease-out; }
.lane.is-new { animation: lane-in 2.6s ease-out; }

/* ── narrow windows: everything below lives in media queries, so the 1440 px layout is unchanged ── */
@media (max-width: 1099px) {
  .appbar { height: auto !important; flex-wrap: wrap; row-gap: 0; padding-top: 4px; }
  .appbrand { height: 34px; }
  .appclock { height: 34px; }
  .appnav { order: 3; width: 100%; overflow-x: auto; height: 34px; scrollbar-width: none; }
  .appnav::-webkit-scrollbar { display: none; }
  .navlink kbd, .brand-sub { display: none; }
  .navlink { white-space: nowrap; }
  .deck, .r-head { flex-direction: column; align-items: stretch; gap: 8px !important; }
  .transport, .r-replay { flex-wrap: wrap; row-gap: 6px; }
  .r-pills { flex-wrap: wrap; row-gap: 4px; }
  .plates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .yard { grid-template-columns: minmax(0, 1fr); height: auto; }
  .lanes { max-height: 70vh; }
  .axis, .lane { grid-template-columns: 170px minmax(0, 1fr); }
  .axis-receipt { display: none; }
  .lane { height: auto; }
  .lane-track { min-height: 66px; }
  .ticket { grid-column: 1 / -1; margin: 0 10px 6px 14px; }
  .r-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .r-tiles > div:nth-child(4) { border-left: 0; }
  .r-tiles > div:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .r-stack { grid-template-columns: minmax(0, 1fr) !important; }
  .r-stack > * { grid-column: 1 / -1 !important; border-left: 0 !important; border-right: 0 !important; }
  .r-queue > * + * { border-top: 1px solid var(--line); }
  .r-paramrow { flex-wrap: wrap; }
  .r-svg { max-width: 100%; height: auto; }
  .r-terms ul { max-height: 230px; overflow-y: auto; }
  .r-wrap { flex-wrap: wrap; row-gap: 2px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll > table.feed { min-width: 940px; }
  .table-scroll > table.grid-table, .table-scroll > table.ev-table { min-width: 640px; }
}
@media (max-width: 699px) {
  .kbd-hint { display: none; }
  main { padding-left: 10px !important; padding-right: 10px !important; }
  .appbar { padding-left: 10px !important; padding-right: 10px !important; column-gap: 10px !important; }
  .appclock { order: 4; width: 100%; height: 24px; margin-left: 0 !important; }
  .clock-label { display: none; }
  .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .axis, .lane { grid-template-columns: minmax(0, 1fr); }
  .axis-meta { display: none; }
  .r-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .r-variants { grid-template-columns: minmax(0, 1fr) !important; }
  .r-variants > * { border-left: 0 !important; }
  .r-history { grid-template-columns: 1fr !important; gap: 0 !important; padding: 4px 0; }
  .r-filters label { flex: 1 1 140px; }
  .r-filters .input { width: 100% !important; }
  .panel-head { flex-wrap: wrap; row-gap: 2px; }
  .big { font-size: 26px; }
  footer.app-footer > span:last-child { display: none; }
}

/* lane detail: shipper line, reefer trace, rolled marker */
.lane-shipper { font-size: 11.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spark { position: absolute; right: 8px; top: 4px; stroke: var(--steel); stroke-width: 1.6; }
.spark polyline { stroke: currentColor; }
.spark-band { fill: #E3ECE6; }
.spark.is-out { stroke: var(--signal); }
.spark-label { position: absolute; right: 12px; bottom: 3px; font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.8); }
.spark-label.is-out { color: var(--signal); }
.rolled { position: absolute; bottom: 4px; font-family: var(--mono); font-size: 10px; font-weight: 600; padding: 0 5px; border: 1px dashed var(--signal); color: var(--signal); background: #fff; white-space: nowrap; }
.lane-meta { padding-top: 5px; line-height: 1.25; }
.lane-route { margin-top: 1px; }
.lane-shipper, .lane-sub { font-size: 11px; }
