/* Tarnline. Load-sheet paper, slate ink, national-highway green, signal amber and red. */
@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 500; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 500; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #f3f2ee;
  --sheet: #ffffff;
  --ink: #1b2225;
  --ink-2: #434e54;
  --ink-3: #5c676d;
  --rule: #d6d3ca;
  --rule-2: #e6e4dd;
  --nh: #0b6045;
  --nh-2: #0e7a58;
  --nh-tint: #e2eee8;
  --amber: #8a5200;
  --amber-fill: #e9a23b;
  --amber-tint: #fbf0d9;
  --red: #a9271c;
  --red-fill: #cf3b2c;
  --red-tint: #f7e3df;
  --sel: #fff3cf;
  --focus: #1d5fa8;
  --head: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --body: Barlow, 'Segoe UI', Arial, sans-serif;
  --r: 3px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.45 var(--body); font-variant-numeric: tabular-nums lining-nums; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; line-height: 1.15; letter-spacing: 0; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
.h-small { font-size: 15px; font-weight: 600; color: var(--ink); margin: 18px 0 8px; }
p { margin: 0; }
a { color: var(--nh); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { top: 8px; }
.sub { display: block; color: var(--ink-3); font-size: 13px; line-height: 1.35; }
.num { text-align: right; white-space: nowrap; }
.is-bad { color: var(--red); }
.is-warn { color: var(--amber); }
.is-good { color: var(--nh); }
b.is-bad { color: var(--red); }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 212px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: calc(100vh - var(--concept-bar)); }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 56px; background: var(--ink); color: #e9ecea; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.wordmark { font-family: var(--head); font-weight: 600; font-size: 21px; color: #fff; text-decoration: none; padding-left: 14px; position: relative; }
.wordmark::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; background: var(--nh-2); box-shadow: 0 0 0 0 transparent; }
.wordmark:hover { color: #fff; }
.org { color: #b9c2c0; font-size: 14px; white-space: nowrap; }
.clock { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 14px; }
.clock-time b { font-weight: 600; color: #fff; }
.clock-pos { color: #b9c2c0; }
.feed-err { color: #ffcf8a; }
.who select { background: transparent; color: #fff; border: 1px solid #56646a; border-radius: var(--r); padding: 6px 28px 6px 10px; font: inherit; font-size: 14px; max-width: 330px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #c8d0ce 50%), linear-gradient(135deg, #c8d0ce 50%, transparent 50%); background-position: right 13px top 50%, right 8px top 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.who select option { color: var(--ink); background: #fff; }
.top .menu-btn { display: none; }
.top .btn-quiet { color: #fff; border-color: #56646a; background: transparent; }
.top .btn-quiet:hover { background: #2c3539; }

.rail { background: var(--sheet); border-right: 1px solid var(--rule); padding: 16px 0; position: sticky; top: 56px; height: calc(100vh - 56px - var(--concept-bar)); display: flex; flex-direction: column; }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 18px 9px 20px; color: var(--ink-2); text-decoration: none; font-weight: 500; border-left: 3px solid transparent; min-height: 40px; }
.rail a:hover { background: var(--paper); color: var(--ink); }
.rail a[aria-current='page'] { border-left-color: var(--nh); color: var(--ink); background: var(--nh-tint); font-weight: 600; }
.count { font-size: 12px; font-weight: 600; background: var(--ink); color: #fff; border-radius: 10px; padding: 1px 7px; min-width: 22px; text-align: center; }
.rail .rail-close, .rail .rail-role, .filters .filters-toggle { display: none; }
.rail-foot { margin-top: auto; padding: 0 20px; font-size: 12px; color: var(--ink-3); }
.viewonly { display: block; color: var(--amber); font-weight: 600; margin-bottom: 4px; }
.main { padding: 24px 28px 96px; min-width: 0; outline: none; }
.view { max-width: 1560px; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 14px/1.2 var(--body); color: var(--ink); background: var(--sheet); border: 1px solid #b9b5aa; border-radius: var(--r); padding: 8px 14px; min-height: 36px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--nh); border-color: var(--nh); color: #fff; }
.btn-primary:hover { background: #084a35; border-color: #084a35; color: #fff; }
.btn-quiet { background: transparent; border-color: var(--rule); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--nh); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.field span { font-weight: 500; }
.field select, .field input, .field textarea { font: 400 14px/1.3 var(--body); color: var(--ink); background: var(--sheet); border: 1px solid #b9b5aa; border-radius: var(--r); padding: 7px 9px; min-height: 36px; max-width: 220px; }
.field select { padding-right: 26px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: right 13px top 52%, right 8px top 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { max-width: none; width: 100%; resize: vertical; }
.field-wide { margin-top: 12px; }
.field-search input { width: 240px; max-width: 100%; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); min-height: 36px; cursor: pointer; }
.check input, td.cb input, th.cb input { width: 17px; height: 17px; accent-color: var(--nh); }
.seg { display: inline-flex; border: 1px solid #b9b5aa; border-radius: var(--r); background: var(--sheet); overflow: hidden; flex-wrap: wrap; }
.seg-btn { font: 500 13px/1 var(--body); color: var(--ink-2); background: none; border: 0; border-right: 1px solid var(--rule); padding: 0 12px; min-height: 34px; cursor: pointer; }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--ink); background: var(--paper); }
.seg-btn[aria-pressed='true'] { background: var(--ink); color: #fff; }

.screen-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.status-line { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.status-line b { font-weight: 600; color: var(--ink); }
.head-tools, .viewsbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.savebox { display: flex; gap: 6px; }
.savebox[hidden] { display: none; }
.savebox input { font: inherit; font-size: 14px; border: 1px solid #b9b5aa; border-radius: var(--r); padding: 5px 8px; width: 170px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 12px 14px; background: var(--sheet); border: 1px solid var(--rule); border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 14px; background: var(--sheet); border: 1px solid var(--rule); border-bottom: 0; border-top: 1px dashed var(--rule); }
.chip { font: 400 13px/1 var(--body); background: var(--nh-tint); color: var(--ink); border: 1px solid #b8d3c6; border-radius: 14px; padding: 6px 10px; cursor: pointer; display: inline-flex; gap: 6px; min-height: 30px; align-items: center; }
.chip b { font-weight: 600; }
.chip:hover { border-color: var(--nh); }
.chip-clear { background: none; border: 0; color: var(--nh); text-decoration: underline; font: inherit; font-size: 13px; cursor: pointer; padding: 6px; }
.bulk { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--sel); border: 1px solid #ecd58f; border-bottom: 0; font-size: 14px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th { text-align: left; font: 600 13px/1.2 var(--head); color: var(--ink-2); padding: 9px 12px; border-bottom: 1px solid var(--rule); background: #faf9f6; white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-row] { cursor: pointer; }
.tbl tbody tr:hover td { background: #fbfaf7; }
.tbl tr.is-sel td { background: var(--sel); }
.tbl tr.is-done td { color: var(--ink-3); }
.tbl-tight td, .tbl-tight th { padding: 7px 10px; }
.tbl th.num { text-align: right; }
.th-sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.th.num .th-sort, th.num .th-sort { flex-direction: row-reverse; }
.th-sort:hover { color: var(--ink); text-decoration: underline; }
.arrow { width: 10px; display: inline-block; }
td.cb, th.cb { width: 34px; padding-right: 0; }
.row-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.row-link:hover { text-decoration: underline; color: var(--nh); }
.cust { max-width: 300px; }
.list-foot { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.pager-btns { display: flex; align-items: center; gap: 8px; }
.pager-n { padding: 0 6px; }

.tag { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 7px; border-radius: 2px; white-space: nowrap; }
.tag-ok { background: var(--nh-tint); color: var(--nh); }
.tag-warn { background: var(--amber-tint); color: var(--amber); }
.tag-bad { background: var(--red-tint); color: var(--red); }
.tag-done { background: #eceae4; color: var(--ink-2); }
.tag-done-late { background: #eceae4; color: var(--red); }
.sev { display: inline-block; font: 600 12.5px/1 var(--head); padding: 4px 6px; border-radius: 2px; border: 1px solid; min-width: 28px; text-align: center; }
.sev-P1 { background: var(--red-fill); border-color: var(--red-fill); color: #fff; }
.sev-P2 { background: var(--amber-tint); border-color: var(--amber-fill); color: var(--amber); }
.sev-P3 { background: var(--sheet); border-color: var(--rule); color: var(--ink-2); }
.key-acc { font-size: 12px; font-weight: 600; color: var(--nh); white-space: nowrap; }
.done-mark { font-weight: 600; color: var(--ink-2); }

/* Number plate: white plate, thin black border, like Indian HSRP plates */
.plate { display: inline-block; font: 600 13px/1 var(--head); letter-spacing: .04em; color: #111; background: #fff; border: 1.5px solid #111; border-radius: 3px; padding: 3px 6px 3px 12px; white-space: nowrap; position: relative; }
.plate::before { content: ''; position: absolute; left: 3px; top: 3px; bottom: 3px; width: 4px; background: #2a4d8f; border-radius: 1px; }

/* ---------- Panels ---------- */
.panel { background: var(--sheet); border: 1px solid var(--rule); padding: 14px 16px 16px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-more { font-size: 14px; }
.panel-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; }
.empty-inline { color: var(--ink-3); font-size: 14px; }
.empty { background: var(--sheet); border: 1px solid var(--rule); padding: 40px 24px; text-align: center; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--ink-3); margin-bottom: 14px; }
.viewonly-note { background: var(--amber-tint); border-left: 3px solid var(--amber-fill); padding: 9px 12px; font-size: 14px; margin: 6px 0 10px; }

/* ---------- Control tower ---------- */
.tower-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); gap: 18px; align-items: start; }
.map-wrap { background: var(--sheet); border: 1px solid var(--rule); }
.map-bar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--rule-2); flex-wrap: wrap; }
.map-bar h2 { margin: 0; }
.map-bar .btn { margin-left: auto; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend-note { color: var(--ink-3); }
.sw { display: inline-block; width: 18px; height: 4px; }
.sw-ok { background: var(--nh-2); } .sw-warn { background: var(--amber-fill); } .sw-bad { background: var(--red-fill); } .sw-idle { background: #c9c6bd; }
.sw-load { height: 12px; background: #d9e6e0; border: 1px solid #a9c5b7; } .sw-trip { height: 12px; background: var(--nh); } .sw-late { height: 12px; background: var(--red-fill); } .sw-service { height: 12px; background: var(--amber-tint); border: 1px solid var(--amber-fill); } .sw-now { width: 2px; height: 14px; background: var(--ink); }
.map-box { position: relative; padding: 6px 10px 10px; }
.map { display: block; width: 100%; height: auto; max-height: 660px; margin: 0 auto; }
.lane { cursor: pointer; outline: none; }
.lane-hit { stroke: transparent; stroke-width: 22; fill: none; }
.lane-line { fill: none; }
.lane-line { stroke-linecap: round; stroke: #c9c6bd; transition: stroke .15s; }
.lane-ok .lane-line { stroke: var(--nh-2); }
.lane-warn .lane-line { stroke: var(--amber-fill); }
.lane-bad .lane-line { stroke: var(--red-fill); }
.lane:hover .lane-line, .lane:focus-visible .lane-line { stroke: var(--ink); }
.lane.is-sel .lane-line { stroke: var(--ink); }
.lane:focus-visible .lane-hit { stroke: rgba(29, 95, 168, .25); }
.lane.is-dim { opacity: .22; pointer-events: none; }
.truck { fill: #fff; stroke: var(--ink); stroke-width: 1.6; pointer-events: none; }
.truck-bad { fill: var(--red-fill); stroke: #fff; stroke-width: 1.8; }
.truck-warn { fill: var(--amber-fill); stroke: #fff; stroke-width: 1.5; }
.truck.is-stopped { stroke: var(--red); stroke-width: 2.5; fill: #fff; }
.truck.is-dim { opacity: .2; }
.hub rect { fill: var(--ink); }
.hub text { font: 600 23px var(--head); fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.hub .hub-note { font: 500 17px var(--body); fill: var(--red); }
.hub.is-hot rect { fill: var(--red-fill); }
.hub.is-dim { opacity: .3; }
.tip { position: absolute; z-index: 5; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.35; padding: 7px 10px; border-radius: var(--r); pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap; }
.tip .is-bad { color: #ffb4a8; }
.tip-sub { color: #b9c2c0; }
.tower-side { min-width: 0; }
.lane-facts { color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.declist { list-style: none; margin: 0; padding: 0; }
.declist li + li { border-top: 1px solid var(--rule-2); }
.declist a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 2px; text-decoration: none; color: var(--ink); }
.declist a:hover .dec-title { text-decoration: underline; }
.dec-main { min-width: 0; }
.dec-title { display: block; font-weight: 600; }
.doors { list-style: none; margin: 0; padding: 0; }
.doors li { display: grid; grid-template-columns: 104px 1fr 112px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; border-top: 1px solid var(--rule-2); }
.doors li:first-child { border-top: 0; }
.doors a { color: var(--ink); font-weight: 600; text-decoration: none; }
.doors a:hover { text-decoration: underline; }
.door-track { height: 8px; background: var(--rule-2); position: relative; }
.door-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--nh-2); max-width: 100%; }
.door-fill.is-over { background: var(--red-fill); }
.door-fill.is-near { background: var(--amber-fill); }
.doors .num { font-size: 13px; color: var(--ink-2); }
.dec-slack { font-size: 13px; white-space: nowrap; color: var(--ink-2); padding-top: 2px; }
.perf { background: var(--sheet); border: 1px solid var(--rule); padding: 14px 16px 12px; margin-top: 18px; }
.perf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.perf-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.insight { margin: 10px 0 6px; color: var(--ink); font-size: 15px; max-width: 80ch; }
.chart-key { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.key { display: inline-block; width: 18px; height: 3px; margin-left: 10px; }
.key:first-child { margin-left: 0; }
.key-cur { background: var(--nh); } .key-prev { border-top: 2px dashed var(--ink-3); height: 0; }
.key-in { height: 10px; background: var(--nh); } .key-out { height: 10px; background: #7fb09a; } .key-van { height: 10px; background: #d3d0c6; }
.chart { position: relative; outline: none; }
.chart:focus-visible { outline: 2px solid var(--focus); }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { top: 6px; transform: translateX(-50%); }
.grid { stroke: var(--rule-2); stroke-width: 1; }
.ytick, .xtick { font: 400 12px var(--body); fill: var(--ink-3); }
.ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ln-cur { stroke: var(--nh); stroke-width: 2.2; }
.ln-prev { stroke: var(--ink-3); stroke-dasharray: 4 4; stroke-width: 1.5; }
.enddot { fill: var(--nh); }
.cursor { stroke: var(--ink); stroke-width: 1; opacity: 0; }
.cursor.on { opacity: .45; }
.b-in { fill: var(--nh); } .b-out { fill: #7fb09a; } .b-van { fill: #d3d0c6; }
.capline { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 6 3; }
.caplabel { font: 500 12px var(--body); fill: var(--red); }

/* ---------- Lane strip (signature) ---------- */
.lanestrip { display: block; width: 100%; height: auto; margin: 10px 0 4px; }
.ls-road { stroke: #c9c6bd; stroke-width: 6; stroke-linecap: round; }
.ls-done { stroke: var(--nh); stroke-width: 6; stroke-linecap: round; }
.ls-town line { stroke: var(--ink-3); stroke-width: 1.5; }
.ls-town text { font: 400 13px var(--body); fill: var(--ink-3); }
.ls-here text { fill: var(--red); font-weight: 600; }
.ls-here line { stroke: var(--red); }
.ls-hub rect { fill: var(--ink); }
.ls-hub text { font: 600 15px var(--head); fill: var(--ink); }
.ls-truck circle { fill: #fff; stroke: var(--nh); stroke-width: 3; }
.ls-truck .ls-dot { fill: var(--nh); stroke: none; }
.ls-truck.is-late circle { stroke: var(--red-fill); }
.ls-truck.is-late .ls-dot { fill: var(--red-fill); }
.ls-promise { font: 500 13.5px var(--body); fill: var(--ink-2); }

/* ---------- Exceptions: list + decision ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.has-detail .split { grid-template-columns: minmax(0, 1.25fr) minmax(400px, 1fr); }
.has-detail .tbl-ex th:nth-child(7), .has-detail .tbl-ex td:nth-child(7) { display: none; }
.split-detail { background: var(--sheet); border: 1px solid var(--rule); }
.detail .tbl td.num { white-space: normal; }
.detail .tbl { font-size: 13.5px; }
.worst-line { margin-top: 8px; }
.detail { padding: 16px 18px 20px; }
.detail-head h2 { font-size: 22px; margin: 4px 0 6px; }
.detail-kicker { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }
.detail-kicker .sub { display: inline; }
.detail-back { display: none; margin-bottom: 10px; }
.facts { margin: 0; padding-left: 18px; color: var(--ink); }
.facts li { margin: 3px 0; }
.decision { margin-top: 18px; border-top: 2px solid var(--ink); padding-top: 4px; }
.opts { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 12px; border: 1px solid var(--rule); border-radius: var(--r); cursor: pointer; background: var(--sheet); }
.opt:hover { border-color: var(--ink-3); }
.opt.is-on { border-color: var(--nh); box-shadow: inset 3px 0 0 var(--nh); background: #f8fbf9; }
.opt input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--nh); }
.opt-tag { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.opt.is-on .opt-tag { color: var(--nh); }
.opt-label { display: block; font-weight: 600; font-size: 15.5px; margin: 1px 0 6px; }
.opt-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); }
.opt-why { display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 5px; }
.conf { display: inline-flex; align-items: center; gap: 7px; }
.conf-track { display: inline-block; width: 64px; height: 6px; background: var(--rule-2); border-radius: 3px; overflow: hidden; }
.conf-fill { display: block; height: 100%; }
.conf-high { background: var(--nh); } .conf-fair { background: var(--amber-fill); } .conf-low { background: var(--red-fill); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.decided { padding: 12px 14px; background: var(--nh-tint); border-left: 3px solid var(--nh); margin-top: 8px; }
.decided-dismissed { background: #eeece6; border-left-color: var(--ink-3); }
.decided-what { font-weight: 600; margin-bottom: 4px; }
.decided .btn { margin-top: 10px; }

/* ---------- Drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(27, 34, 37, .32); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--sheet); z-index: 31; overflow: auto; padding: 18px 22px 40px; border-left: 1px solid var(--rule); outline: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-head h2 { font-size: 24px; }
.dw-status { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-top: 10px; }
.dw-status .sub { display: inline; }
.dw-ex { background: var(--red-tint); padding: 8px 12px; font-size: 14px; margin: 6px 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 14px 0 0; }
.kv div { border-top: 1px solid var(--rule-2); padding-top: 6px; }
.kv dt { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.kv dd { margin: 2px 0 0; font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 2px; }
.ev { display: grid; grid-template-columns: 128px 1fr; gap: 10px; padding: 6px 0 6px 14px; border-left: 2px solid var(--rule); position: relative; font-size: 14px; }
.ev::before { content: ''; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; background: var(--sheet); border: 2px solid var(--ink-3); border-radius: 50%; }
.ev:first-child::before { background: var(--nh); border-color: var(--nh); }
.ev-issue { color: var(--red); }
.ev-issue::before { border-color: var(--red); }
.ev-time { color: var(--ink-3); font-size: 13px; }

/* ---------- Vehicle schedule ---------- */
.fleet-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.runs { background: var(--sheet); border: 1px solid var(--rule); padding: 4px 0 6px; }
.runs h2 { margin: 10px 14px 6px; }
.runlist { list-style: none; margin: 0; padding: 0; }
.runlist a { display: block; padding: 10px 14px; border-top: 1px solid var(--rule-2); text-decoration: none; color: var(--ink); border-left: 3px solid transparent; }
.runlist a:hover { background: #fbfaf7; }
.runlist a.is-sel { background: var(--sel); border-left-color: var(--amber-fill); }
.runlist a.is-done .run-route { color: var(--ink-3); }
.run-route { font-weight: 600; display: block; }
.run-ok { display: block; margin-top: 4px; }
.board-wrap { background: var(--sheet); border: 1px solid var(--rule); padding: 14px 16px; min-width: 0; }
.board-tools { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.board-tools h2 { margin: 0 auto 8px 0; }
.board-wrap .legend { margin-bottom: 10px; }
.run-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.cands { display: grid; gap: 0; margin: 10px 0 16px; border-top: 1px solid var(--rule-2); }
.cand { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule-2); font-size: 14px; }
.cand.is-no { color: var(--ink-3); }
.cand.is-no .plate { opacity: .7; }
.cand-main .sub { margin-top: 2px; }
.cand.is-no .cand-main .sub { color: var(--red); }
.cand-no { font-size: 13px; color: var(--ink-3); }
.assigned { padding: 10px 12px; background: var(--nh-tint); margin: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.board-scroll { overflow-x: auto; }
.board { min-width: 860px; font-size: 13px; }
.board-row { display: grid; grid-template-columns: 230px 1fr; border-bottom: 1px solid var(--rule-2); }
.board-row.is-sel { background: var(--sel); }
.board-veh { padding: 8px 10px 8px 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.board-veh .sub { font-size: 12.5px; }
.fit { font-size: 12.5px; font-weight: 500; }
.fit-ok { color: var(--nh); } .fit-no { color: var(--red); }
.board-track { position: relative; min-height: 52px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 9 - 1px), var(--rule-2) calc(100% / 9 - 1px), var(--rule-2) calc(100% / 9)); }
.board-axis .board-track { background: none; min-height: 28px; }
.board-axis { position: sticky; top: 0; background: var(--sheet); z-index: 2; border-bottom: 1px solid var(--rule); }
.board-axis .board-veh { font: 600 13px var(--head); color: var(--ink-2); justify-content: flex-end; }
.tick { position: absolute; bottom: 6px; transform: translateX(-50%); color: var(--ink-3); font-size: 12px; }
.tick:first-child { transform: none; }
.tick:last-child { transform: translateX(-100%); }
.nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); z-index: 1; }
.blk { position: absolute; top: 12px; height: 28px; border: 0; padding: 0 6px; font: 500 12px/28px var(--body); text-align: left; overflow: hidden; white-space: nowrap; cursor: default; border-radius: 2px; }
.blk-trip { background: var(--nh); color: #fff; }
.blk-trip.is-late { background: var(--red-fill); }
.blk-trip.is-planned { background: repeating-linear-gradient(135deg, var(--nh) 0 6px, #157d5c 6px 12px); }
.blk-load, .blk-unload { background: #d9e6e0; box-shadow: inset 0 0 0 1px #a9c5b7; }
.blk-service { background: var(--amber-tint); box-shadow: inset 0 0 0 1px var(--amber-fill); color: var(--amber); }
.blk:focus-visible { outline-offset: 1px; z-index: 3; }
.idle { position: absolute; left: 8px; top: 16px; color: var(--ink-3); font-size: 12.5px; }

/* ---------- Hubs ---------- */
.heat-wrap { padding-bottom: 4px; }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 13.5px; }
.heat th { font: 600 12.5px var(--head); color: var(--ink-2); padding: 6px 6px; text-align: right; white-space: nowrap; }
.heat thead th:first-child, .heat tbody th { text-align: left; }
.heat tbody th { padding: 4px 10px 4px 8px; font: 600 14px var(--head); min-width: 140px; }
.heat .link { color: var(--ink); text-decoration: none; font-weight: 600; }
.heat .link:hover { text-decoration: underline; color: var(--nh); }
.heat tbody th .sub { font: 400 12px var(--body); }
.heat th.is-now { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.heat td { padding: 0 6px; height: 38px; min-width: 46px; }
.heat tr.is-sel th { background: var(--sel); }
.u { border-radius: 2px; }
.u-0 { background: #f1f0ec; color: var(--ink-3); }
.u-1 { background: #dcebe4; color: var(--ink); }
.u-2 { background: #a9cfbd; color: var(--ink); }
.u-3 { background: var(--amber-fill); color: #2a1a00; font-weight: 600; }
.u-4 { background: var(--red-fill); color: #fff; font-weight: 600; }
.heat td.is-past { opacity: .55; }
.heat-key { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12.5px; color: var(--ink-2); padding: 8px 8px 6px; }
.heat-key .u { padding: 3px 8px; }
.hub-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.hub-detail .perf { margin-top: 0; }

/* ---------- POD ---------- */
.pod .split { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.podlist { list-style: none; margin: 0; padding: 0; background: var(--sheet); border: 1px solid var(--rule); max-height: calc(100vh - 210px); overflow: auto; }
.podlist a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--rule-2); color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
.podlist a:hover { background: #fbfaf7; }
.podlist a.is-sel { background: var(--sel); border-left-color: var(--amber-fill); }
.pod-top { display: flex; justify-content: space-between; gap: 8px; }
.pod-top .sub { display: inline; }
.pod-cons { display: block; font-size: 14px; }
.pod .split-detail { position: static; max-height: none; padding: 18px 22px; }
.slip { max-width: 760px; }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.slip-head h2 { font-size: 24px; }
.slip-state { font-weight: 600; font-size: 14px; padding: 4px 10px; border: 1px solid; border-radius: 2px; }
.state-needs-review { color: var(--amber); background: var(--amber-tint); }
.state-accepted, .state-accepted-automatically { color: var(--nh); background: var(--nh-tint); }
.state-claim-raised { color: var(--red); background: var(--red-tint); }
.kv-slip { grid-template-columns: repeat(3, 1fr); }
.slip-proof { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.slip-proof figure { margin: 0; border: 1px solid var(--rule); padding: 10px; background: #fcfcfa; }
.slip-proof svg { display: block; width: 100%; height: 120px; }
.slip-proof figcaption { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.sig-line { stroke: var(--rule); stroke-width: 1; }
.sig-ink { fill: none; stroke: #20366b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fence-ring { fill: var(--nh-tint); stroke: var(--nh); stroke-width: 1; stroke-dasharray: 3 3; }
.fence-home { fill: var(--ink); }
.fence-sig { fill: var(--nh); stroke: #fff; stroke-width: 1.5; }
.fence-sig.is-out { fill: var(--red-fill); }
.flags { margin: 0; padding: 10px 12px 10px 30px; background: var(--amber-tint); border-left: 3px solid var(--amber-fill); }
.flags li { margin: 2px 0; }

/* ---------- Activity ---------- */
.tbl-audit .before { color: var(--ink-3); }

/* ---------- Customer tracking (Ninebridge brand) ---------- */
.track-mode .app { grid-template-columns: 1fr; }
.track-mode .top, .track-mode .rail { display: none; }
.track-mode .main { padding: 0; }
.track-mode body, body.track-mode { background: #eef3f0; }
.track { min-height: calc(100vh - var(--concept-bar)); display: flex; flex-direction: column; }
.tk-top { background: var(--nh); color: #fff; padding: 16px 24px; display: flex; align-items: baseline; gap: 8px; }
.tk-brand { font: 600 24px var(--head); }
.tk-sub { font-size: 15px; opacity: .85; }
.tk-internal { margin-left: auto; color: #fff; font-size: 14px; }
.tk-internal:hover { color: #e2eee8; }
.tk-main { width: min(760px, 100%); margin: 0 auto; padding: 28px 20px 40px; flex: 1; }
.tk-main h1 { font-size: 30px; margin-bottom: 14px; }
.tk-form label { font-weight: 600; font-size: 14px; }
.tk-row { display: flex; gap: 8px; margin: 6px 0 22px; }
.tk-row input { flex: 1; font: 500 17px var(--body); padding: 10px 12px; border: 1px solid #9fb3aa; border-radius: var(--r); min-height: 46px; letter-spacing: .02em; }
.tk-row .btn { min-height: 46px; padding: 0 22px; font-size: 15px; }
.tk-hint { color: var(--ink-2); }
.tk-card { background: #fff; border: 1px solid #cfdcd5; padding: 22px 24px; }
.tk-card h2 { font-size: 24px; margin: 4px 0 6px; }
.tk-card h3 { margin: 18px 0 8px; }
.tk-lr { font-weight: 600; color: var(--nh); display: flex; gap: 10px; flex-wrap: wrap; }
.tk-lr span { color: var(--ink-3); font-weight: 400; }
.tk-steps { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); margin: 20px 0 6px; padding: 0; counter-reset: s; }
.tk-steps li { position: relative; padding-top: 18px; font-size: 13px; color: var(--ink-3); text-align: center; }
.tk-steps li::before { content: ''; position: absolute; top: 4px; left: 0; right: 0; height: 4px; background: #dbe3df; }
.tk-steps li::after { content: ''; position: absolute; top: 0; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #b9c7c0; }
.tk-steps li.done::before, .tk-steps li.now::before { background: var(--nh); }
.tk-steps li.done::after { background: var(--nh); border-color: var(--nh); }
.tk-steps li.now { color: var(--ink); font-weight: 600; }
.tk-steps li.now::after { border-color: var(--nh); border-width: 3px; }
.tk-events { list-style: none; margin: 0; padding: 0; }
.tk-events li { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid #e6ece9; font-size: 14.5px; }
.tk-events li.issue { color: var(--red); }
.tk-time { color: var(--ink-3); font-size: 13.5px; }
.tk-pkg { margin-top: 14px; font-size: 13.5px; color: var(--ink-3); }
.tk-foot { text-align: center; font-size: 13px; color: var(--ink-3); padding: 20px; }

/* ---------- Demo corner, toast, tour, skeleton ---------- */
.demo { position: static; }
.demo-panel { position: fixed; right: 16px; z-index: 40; background: var(--sheet); border: 1px solid var(--rule); padding: 14px; width: 260px; display: grid; gap: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .14); }
.demo-panel[hidden] { display: none; }
.demo-note { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r); font-size: 14px; z-index: 60; max-width: min(560px, calc(100% - 32px)); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast-bad { background: var(--red); }
.toast[hidden] { display: none; }
.tour { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(440px, calc(100% - 32px)); background: var(--sheet); border: 1px solid var(--ink); padding: 16px 18px; z-index: 55; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }
.tour h2 { font-size: 19px; margin: 2px 0 6px; }
.tour p { font-size: 14.5px; color: var(--ink-2); }
.tour-step { font-size: 13px; color: var(--ink-3); }
.tour .actions { justify-content: flex-end; }
.tour-ring { position: absolute; border: 3px solid var(--amber-fill); border-radius: 4px; z-index: 15; pointer-events: none; transition: all .25s; }
.skel { display: grid; gap: 14px; }
.skel-line, .skel-block { background: linear-gradient(90deg, #e9e7e1, #f3f2ee, #e9e7e1); background-size: 200% 100%; animation: sk 1.1s linear infinite; border-radius: 2px; }
.skel-line { height: 16px; } .w40 { width: 40%; } .w55 { width: 55%; } .w70 { width: 70%; }
.skel-block { height: 340px; }
@keyframes sk { to { background-position: -200% 0; } }
.error-state { padding: 40px; background: var(--sheet); border: 1px solid var(--rule); }
.error-state p { margin: 10px 0 16px; color: var(--ink-2); }
.noscript { padding: 20px; }
.print-only { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Narrower screens ---------- */
@media (max-width: 1280px) {
  .tower-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr); }
  .has-detail .split { grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr); }
  .has-detail .tbl-ex th:nth-child(6), .has-detail .tbl-ex td:nth-child(6) { display: none; }
  .org-sub { display: none; }
}
@media (max-width: 1060px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; top: 56px; left: 0; width: 260px; height: auto; max-height: calc(100vh - 56px); z-index: 25; transform: translateX(-105%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0, 0, 0, .15); border-bottom: 1px solid var(--rule); }
  .rail.open { transform: none; }
  .top .menu-btn { display: inline-flex; order: -1; }
  .top .who, .org { display: none; }
  .rail .rail-close { display: inline-flex; margin: 0 16px 10px; align-self: flex-start; }
  .rail .rail-role { display: flex; margin: 16px 20px 12px; }
  .rail-role select { max-width: none; width: 100%; min-height: 44px; }
  .top { gap: 14px; padding: 0 14px; }
  .clock-pos { display: none; }
  .tower-grid, .hub-detail { grid-template-columns: 1fr; }
  .fleet-grid { grid-template-columns: 1fr; }
  .runlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .has-detail .split { grid-template-columns: 1fr; }
  .has-detail .split-list, .has-detail .filters, .has-detail .chips, .has-detail .bulk, .has-detail .viewsbar { display: none; }
  .split-detail { position: static; max-height: none; }
  .detail-back { display: inline-flex; }
  .pod .split { grid-template-columns: 1fr; }
  .pod.has-detail .split-list { display: none; }
  .pod:not(.has-detail) .split-detail { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .tour { padding: 10px 14px; width: calc(100% - 24px); }
  .tour h2 { font-size: 17px; margin: 0 0 4px; }
  .tour p { font-size: 13px; line-height: 1.35; }
  .tour .btn { min-height: 40px; }
  .main { padding: 16px 14px 96px; }
  h1 { font-size: 23px; }
  .top { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 12px; row-gap: 6px; }
  .org { display: none; }
  .clock { margin-left: auto; gap: 8px; font-size: 13px; }
  .clock .btn { padding: 4px 8px; }
  .top .who { display: none; }
  .rail { top: 0; max-height: 100vh; width: min(300px, 86vw); }
  .rail a { min-height: 48px; }
  .filters { padding: 10px; gap: 8px; }
  .filters .field { flex: 1 1 calc(50% - 8px); }
  .filters .field select, .filters .field input { max-width: none; width: 100%; min-height: 44px; }
  .filters .filters-toggle { display: inline-flex; flex: 0 0 auto; }
  .filters:not(.is-open) .field:not(.field-search), .filters:not(.is-open) .check { display: none; }
  .filters .field-search { flex: 1 1 0 !important; }
  .field-search input { width: 100%; }
  .check { min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .seg-btn { min-height: 44px; flex: 1 0 auto; }
  .seg { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .seg-btn { border-bottom: 1px solid var(--rule); }
  .screen-head { align-items: stretch; }
  .viewsbar { width: 100%; }
  .map-bar .btn { margin-left: 0; }
  .map-box { padding: 0 2px 6px; }
  .hub text { font-size: 28px; stroke-width: 6px; }
  .hub .hub-note { display: none; }
  .kv, .kv-slip { grid-template-columns: 1fr 1fr; }
  .slip-proof { grid-template-columns: 1fr; }
  .drawer { padding: 14px 16px 40px; }
  .ev { grid-template-columns: 1fr; gap: 0; }
  .tk-steps { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .tk-events li { grid-template-columns: 1fr; gap: 0; }
  .tk-main h1 { font-size: 25px; }
  .tk-card { padding: 16px; }
  .cand { grid-template-columns: 1fr auto; }
  .cand .plate { grid-column: 1 / -1; justify-self: start; }
  .board { min-width: 720px; }
  .ls-town text { display: none; }

  .ls-hub text { font-size: 22px; }
  .ls-promise { font-size: 20px; }
  .lanestrip { margin: 14px 0 8px; }
  .board-row { grid-template-columns: 170px 1fr; }
  .btn-sm, .chip, .seg-btn, .link, .runlist a, .pager .btn, .th-sort { min-height: 44px; }
  .link, .th-sort { display: inline-flex; align-items: center; }
  .blk { top: 8px; height: 36px; line-height: 36px; }
  .board-track { min-height: 52px; }
  td.cb input, th.cb input, .check input { width: 24px; height: 24px; }
  .ls-here text { display: none; }
  .field select, .field input { min-height: 44px; }
  .panel-links a, .panel-more { display: inline-flex; align-items: center; min-height: 44px; }
  .tbl-aff thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl-aff tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
  .tbl-aff td { border: 0; padding: 2px 0; text-align: left; }
  .tbl-aff td.num { text-align: left; }
  .tbl-aff td::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-3); }
  .tbl-aff td.cust { grid-column: 1 / -1; }
  .perf-tools { width: 100%; }
  .heat tbody th { min-width: 120px; }
}
.hub-detail > *, .tower-grid > *, .fleet-grid > *, .split > * { min-width: 0; }

@media (max-width: 900px) {
  /* stacked rows for long tables */
  .tbl-ships thead, .tbl-ex thead, .tbl-audit thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl-ships tr, .tbl-ex tr, .tbl-audit tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
  .tbl-ships td, .tbl-ex td, .tbl-audit td { border: 0; padding: 2px 0; text-align: left; }
  .tbl-ships td.num, .tbl-ex td.num { text-align: left; white-space: normal; }
  .tbl-ships td::before, .tbl-ex td::before, .tbl-audit td::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-3); }
  .tbl-ships td:first-child, .tbl-ships td.cust, .tbl-audit td:nth-child(3) { grid-column: 1 / -1; }
  .tbl-ex td.cb { grid-row: 1; grid-column: 2; justify-self: end; }
  .tbl-ex td.cb::before, .tbl-ex td:nth-child(2)::before { display: none; }
  .tbl-ex td:nth-child(2) { grid-row: 1; grid-column: 1; }
  .tbl-ex td:nth-child(3), .tbl-ex td:nth-child(7) { grid-column: 1 / -1; }
  .tbl-ex td:nth-child(6) { display: none; }
  .tbl tbody tr:hover td { background: none; }
}
@media (min-width: 721px) and (max-width: 900px) {
  .tbl-ships tr { grid-template-columns: repeat(4, 1fr); }
  .tbl-ships td:first-child, .tbl-ships td.cust { grid-column: span 2; }
}

/* phone: one header row, decisions before the map, region as a select */
.region-sel, .rail-extras { display: none; }
@media (max-width: 720px) {
  .top { flex-wrap: nowrap; height: 56px; min-height: 56px; padding: 0 12px; row-gap: 0; gap: 10px; }
  .top #refresh, .top #demoBtn, .top .who { display: none; }
  .clock { margin-left: auto; font-size: 13px; white-space: nowrap; }
  .clk-day { display: none; }
  .brand { flex: 1; }
  .rail-extras { display: grid; gap: 8px; margin: 12px 20px; }
  .seg-region, .btn-print { display: none; }
  .region-sel { display: block; width: 100%; min-height: 44px; font: inherit; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); color: var(--ink); }
  .head-tools { width: 100%; }
  .tower-side { display: contents; }
  .tower-grid > .lane-panel { order: 0; }
  .tower-grid > .panel-dec { order: 1; }
  .tower-grid > .map-wrap { order: 2; }
  .tower-grid > .panel-door { order: 3; }
}
