/* Nahla Routes. A dispatch board: a quiet street map, a navy ledger in Nahla's colours, the van colours on top. */
@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-next-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-next-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-next-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #1B2131;
  --navy-2: #222A3D;
  --navy-3: #2B3550;
  --navy-line: #323D58;
  --on-navy: #F3F5F9;
  --muted-on-navy: #A3ADC2;
  --tan: #BD9C73;
  --tan-strong: #D2B48C;
  --tan-soft: rgba(189, 156, 115, 0.14);
  --burgundy: #5C2441;
  --worse: #E58A7C;
  --paper: #FFFFFF;
  --ink: #1B2131;
  --muted: #5D6577;
  --line: #D5DAE2;
  --line-soft: #E7EAEF;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ledger-w: 420px;
  --font: "Atkinson Next", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 400 15px/1.45 var(--font); color: var(--ink); background: #E9ECF0; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }
.booting { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); }

/* ------------------------------------------------------------------ opening screen */
.open { min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px; background: var(--navy); color: var(--on-navy); }
.open-inner { width: min(520px, 100%); }
.open-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; margin-bottom: 44px; }
.open-brand img { border-radius: 10px; }
.open-title { font-size: clamp(30px, 5vw, 42px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 14px; max-width: 16ch; }
.open-text { color: var(--muted-on-navy); font-size: 17px; margin: 0 0 30px; max-width: 46ch; }
.drop {
  display: grid; justify-items: center; gap: 6px; padding: 34px 20px; border: 1.5px dashed #46526F; border-radius: 16px;
  background: var(--navy-2); cursor: pointer; text-align: center;
  transition: border-color 180ms ease, background-color 180ms ease, transform 160ms var(--ease-out);
}
.drop:hover, .drop.over { border-color: var(--tan); background: #262F45; }
.drop:active { transform: scale(0.99); }
.drop:focus-within { outline: 2px solid var(--tan); outline-offset: 3px; }
.drop-icon { color: var(--tan); margin-bottom: 4px; }
.drop-main { font-weight: 700; font-size: 18px; }
.drop-sub { color: var(--muted-on-navy); font-size: 14px; }
.open-error { color: var(--worse); min-height: 1.4em; margin: 14px 0 0; }
.open-note { color: var(--muted-on-navy); font-size: 14px; margin: 6px 0 0; }

/* ------------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: var(--ledger-w) 1fr; height: 100dvh; overflow: hidden; }
.stage { position: relative; min-width: 0; }
.map { position: absolute; inset: 0; background: #EEF0F2; }

/* ------------------------------------------------------------------ the ledger (navy panel) */
.ledger { background: var(--navy); color: var(--on-navy); overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 40px; scrollbar-width: thin; scrollbar-color: #3A4560 transparent; }
.sheet-handle { display: none; }
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.brand img { border-radius: 8px; flex: none; }
.brand-text { display: grid; min-width: 0; }
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.3; }
.file-name { background: none; border: 0; padding: 0; text-align: left; color: var(--muted-on-navy); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-name:hover { color: var(--on-navy); text-decoration: underline; text-underline-offset: 3px; }

.mode { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--navy-2); border: 1px solid var(--navy-line); }
.mode-btn { position: relative; z-index: 1; border: 0; background: none; padding: 9px 10px; border-radius: 9px; font-weight: 700; color: var(--muted-on-navy); transition: color 200ms ease; }
.mode-btn[aria-selected="true"] { color: var(--navy); }
.mode-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--tan-strong); transition: transform 280ms var(--ease-in-out); }
.mode[data-mode="plan"] .mode-thumb { transform: translateX(100%); }

.headline { font-size: 20px; line-height: 1.34; font-weight: 500; margin: 18px 0 16px; letter-spacing: -0.005em; text-wrap: pretty; min-height: 3.9em; }
.headline .soft { color: var(--muted-on-navy); }

.figures { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.95fr) minmax(0, 1.35fr); gap: 0; margin: 0 0 6px; border-top: 1px solid var(--navy-line); border-bottom: 1px solid var(--navy-line); }
.figure { padding: 12px 0; min-width: 0; }
.figure + .figure { padding-left: 12px; border-left: 1px solid var(--navy-line); }
.figure dt { font-size: 12.5px; color: var(--muted-on-navy); line-height: 1.35; min-height: 2.7em; }
.figure dd { margin: 4px 0 0; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.delta { display: block; font-size: 13px; font-weight: 700; color: var(--tan-strong); font-variant-numeric: tabular-nums; min-height: 1.4em; }
.delta.worse { color: var(--worse); }
.delta:empty::after { content: "\00a0"; }

h2 { font-size: 14px; font-weight: 700; margin: 0; letter-spacing: 0.005em; }

.change { margin-top: 18px; }
.change-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.change-count { font-size: 13px; color: var(--muted-on-navy); font-variant-numeric: tabular-nums; }
.curve { position: relative; height: 128px; border-radius: 12px; background: var(--navy-2); border: 1px solid var(--navy-line); touch-action: none; cursor: ew-resize; user-select: none; }
.curve svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.curve .axis { stroke: var(--navy-line); stroke-width: 1; }
.curve .area { fill: rgba(189, 156, 115, 0.12); }
.curve .line { fill: none; stroke: var(--tan); stroke-width: 2; stroke-linejoin: round; }
.curve .tick { fill: #56627F; }
.curve .tick.on { fill: var(--tan-strong); }
.curve .knob { fill: var(--navy); stroke: var(--tan-strong); stroke-width: 3; transition: cx 200ms var(--ease-out), cy 200ms var(--ease-out); }
.curve .guide { stroke: var(--tan-strong); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; transition: x1 200ms var(--ease-out), x2 200ms var(--ease-out); }
.curve .lab { fill: var(--muted-on-navy); font-size: 11.5px; font-family: var(--font); }
.curve:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }
.change-note { font-size: 13px; color: var(--muted-on-navy); margin: 8px 0 0; }

.stale { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--tan-soft); border: 1px solid rgba(189, 156, 115, 0.45); }
.stale p { margin: 0 0 10px; font-size: 14px; }

.btn { border: 0; border-radius: 9px; padding: 9px 14px; font-weight: 700; font-size: 14px; transition: transform 140ms var(--ease-out), background-color 160ms ease; }
.btn:active { transform: scale(0.97); }
.btn-tan { background: var(--tan-strong); color: var(--navy); }
.btn-tan:hover { background: #DCC29E; }
.btn-ghost { background: transparent; color: var(--on-navy); border: 1px solid var(--navy-line); }
.btn-ghost:hover { border-color: #4A5878; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.fewer { margin-top: 22px; }
.fewer-text { font-size: 13.5px; color: var(--muted-on-navy); margin: 6px 0 10px; }
.fewer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fewer-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 11px 12px; border-radius: 11px; background: var(--navy-2); border: 1px solid var(--navy-line); }
.fewer-list .who { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.fewer-list .what { grid-column: 1; font-size: 13px; color: var(--muted-on-navy); }
.fewer-list .btn { grid-row: 1 / span 2; grid-column: 2; }

.vans-wrap { margin-top: 24px; }
.vans-head { display: grid; grid-template-columns: 12px minmax(0, 1fr) 38px 40px 42px 26px; column-gap: 9px; align-items: baseline; padding: 0 6px 8px 10px; }
.vans-head h2 { grid-column: 1 / span 2; }
.vans-cols { display: contents; }
.vans-cols span { text-align: right; font-size: 12px; color: var(--muted-on-navy); }
.vans { list-style: none; margin: 0; padding: 0; }
.van {
  position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr) 38px 40px 42px 26px; align-items: center; column-gap: 9px;
  padding: 9px 6px 9px 10px; border-radius: 10px; cursor: pointer; transition: background-color 160ms ease;
}
.van + .van { margin-top: 2px; }
@media (hover: hover) and (pointer: fine) { .van:hover { background: var(--navy-2); } }
.van[aria-current="true"] { background: var(--navy-3); outline: 1px solid rgba(210, 180, 140, 0.5); outline-offset: -1px; }
.van[aria-current="true"] .chip { outline: 2px solid var(--navy-3); box-shadow: 0 0 0 3.5px var(--tan-strong); }
.van .chip { width: 12px; height: 12px; border-radius: 4px; }
.van.off .chip { background: transparent !important; border: 2px solid #5A6684; }
.van .who { min-width: 0; }
.van .name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.van .area { display: block; font-size: 12.5px; color: var(--muted-on-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.van .num { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 500; }
.van .num small { display: block; font-size: 11.5px; font-weight: 700; color: var(--tan-strong); min-height: 1.3em; }
.van .num small.worse { color: var(--worse); }
.van.off .num { color: #6B7690; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: #33405E; color: var(--muted-on-navy); flex: none; }
.van-menu-btn { width: 26px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted-on-navy); transition: background-color 150ms ease, color 150ms ease; }
.van-menu-btn:hover { background: #33405E; color: var(--on-navy); }
.van-menu { position: absolute; right: 6px; top: calc(100% - 4px); z-index: 5; width: 230px; padding: 6px; border-radius: 12px; background: #263049; border: 1px solid #3A4766; transform-origin: top right; animation: pop 160ms var(--ease-out); }
.van-menu button { display: grid; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; color: var(--on-navy); }
.van-menu button:hover { background: #303B58; }
.van-menu button span { font-size: 12.5px; color: var(--muted-on-navy); }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

.fold { margin-top: 18px; border-top: 1px solid var(--navy-line); }
.fold summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 2px 4px; font-weight: 700; font-size: 14px; cursor: pointer; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted-on-navy); border-bottom: 2px solid var(--muted-on-navy); transform: rotate(45deg); transition: transform 200ms var(--ease-out); margin-right: 4px; }
.fold[open] summary::after { transform: rotate(-135deg); }
.fold summary span:first-child { margin-right: auto; }
.fold-count { font-size: 12.5px; color: var(--muted-on-navy); margin-right: 12px; font-weight: 500; }
.fold-body { padding: 8px 0 4px; }
.fold-note { font-size: 13px; color: var(--muted-on-navy); margin: 10px 0 0; }
.check-group + .check-group { margin-top: 14px; }
.check-group h3 { font-size: 13.5px; margin: 0 0 4px; }
.check-group p { font-size: 13px; color: var(--muted-on-navy); margin: 0 0 6px; }
.check-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.check-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 6px 6px; border-radius: 7px; font-size: 13.5px; color: var(--on-navy); }
.check-list button:hover { background: var(--navy-2); }
.check-list button span:last-child { color: var(--muted-on-navy); flex: none; }
.check-list li.no-pin { display: flex; justify-content: space-between; gap: 10px; padding: 6px; font-size: 13.5px; }
.check-list li.no-pin span:last-child { color: var(--muted-on-navy); flex: none; }

.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.settings label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted-on-navy); }
.settings input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--navy-line); background: var(--navy-2); color: var(--on-navy); font-variant-numeric: tabular-nums; }
.settings input:focus { border-color: var(--tan); outline: none; }
.about p { font-size: 13.5px; color: var(--muted-on-navy); margin: 0 0 10px; }
.about strong { color: var(--on-navy); font-weight: 700; }

/* while the routes file is read and the map is prepared */
.veil { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--navy); color: var(--on-navy); transition: opacity 420ms ease; }
.veil.gone { opacity: 0; pointer-events: none; }
.veil-inner { display: grid; justify-items: center; gap: 14px; }
.veil-bar { width: 180px; height: 3px; border-radius: 3px; background: var(--navy-3); overflow: hidden; position: relative; }
.veil-bar span { position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--tan); animation: run 1.1s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.veil p { margin: 0; color: var(--muted-on-navy); font-size: 14px; }

.freq { margin-top: 22px; }
.freq-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.freq-scope { font-size: 13px; color: var(--muted-on-navy); text-align: right; }
.freq-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--navy-2); gap: 2px; }
.freq-bar span { display: block; height: 100%; transition: flex-grow 320ms var(--ease-out), opacity 160ms ease; }
.freq-bar.focused span { opacity: 0.3; }
.freq-bar.focused span.on { opacity: 1; }
.freq-list { list-style: none; margin: 10px 0 0; padding: 0; }
.freq-list button { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 42px; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 8px; text-align: left; color: var(--on-navy); font-size: 14px; transition: background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .freq-list button:hover { background: var(--navy-2); } }
.freq-list button[aria-pressed="true"] { background: var(--navy-3); outline: 1px solid rgba(210, 180, 140, 0.5); outline-offset: -1px; }
.freq-list .sw { width: 10px; height: 10px; border-radius: 3px; }
.freq-list .n { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.freq-list .pc { font-variant-numeric: tabular-nums; color: var(--muted-on-navy); font-size: 13px; text-align: right; }
.freq-note { font-size: 13px; color: var(--muted-on-navy); margin: 8px 0 0; }
.card .freq-line { font-size: 14px; margin: 0 0 12px; padding: 9px 11px; border-radius: 9px; background: #F4F1EC; }
.card .freq-line strong { font-weight: 700; }

/* ------------------------------------------------------------------ over the map */
.bar { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; pointer-events: none; z-index: 3; }
.bar > * { pointer-events: auto; }
.bar-gap { flex: 1; pointer-events: none; }
.day { display: flex; align-items: center; height: 40px; border-radius: 11px; background: var(--paper); border: 1px solid var(--line); }
.day-pick select { appearance: none; border: 0; background: none; height: 38px; padding: 0 6px; font-weight: 700; font-size: 14.5px; color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; }
.icon-btn { width: 36px; height: 38px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 10px; transition: color 150ms ease, transform 140ms var(--ease-out); }
.icon-btn:hover { color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 700; font-size: 14px; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 140ms var(--ease-out); }
.pill:active { transform: scale(0.97); }
.pill[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.pill-dark { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.pill-dark:hover { background: #6B2B4D; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 48px; width: 320px; padding: 6px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); transform-origin: top right; animation: pop 170ms var(--ease-out); }
.menu button { display: grid; gap: 2px; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; }
.menu button:hover, .menu button:focus-visible { background: #F1F3F6; outline: none; }
.menu strong { font-size: 14.5px; }
.menu span { font-size: 13px; color: var(--muted); }

.legend-hint { position: absolute; left: 14px; bottom: 14px; z-index: 2; font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, 0.86); border: 1px solid var(--line-soft); padding: 6px 10px; border-radius: 9px; pointer-events: none; transition: opacity 200ms ease; }
.legend-hint:empty { opacity: 0; }

.card { position: absolute; top: 66px; right: 14px; z-index: 4; width: 330px; max-height: calc(100% - 86px); overflow-y: auto; padding: 16px 16px 14px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); transform-origin: top right; animation: pop 190ms var(--ease-out); }
.card-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: grid; place-items: center; }
.card-close:hover { background: #F1F3F6; color: var(--ink); }
.card h3 { font-size: 17px; line-height: 1.32; margin: 0 34px 2px 0; }
.card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.card .vanline { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.card .vanline .lbl { color: var(--muted); font-weight: 400; width: 76px; flex: none; }
.card .vanline i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.card .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 6px 0 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.card .facts div { font-size: 12.5px; color: var(--muted); }
.card .facts strong { display: block; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.card .warn { font-size: 13px; background: #FBF4EA; border: 1px solid #EBD9BF; border-radius: 9px; padding: 8px 10px; margin: 0 0 12px; }
.card label.move { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.card select, .selection select { width: 100%; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--paper); padding: 0 10px; font-weight: 700; font-size: 14px; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card .actions .btn { background: #F1F3F6; color: var(--ink); }
.card .actions .btn:hover { background: #E7EAEF; }
.card .actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.card .actions .btn.on { background: var(--navy); color: #fff; }

.selection { position: absolute; left: 50%; bottom: 18px; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--navy); color: var(--on-navy); transform: translateX(-50%); animation: rise 220ms var(--ease-out); max-width: calc(100% - 28px); }
.selection strong { white-space: nowrap; }
.selection select { width: auto; min-width: 190px; background: var(--navy-2); color: var(--on-navy); border-color: var(--navy-line); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 6; overflow: hidden; background: rgba(27, 33, 49, 0.08); }
.progress span { position: absolute; top: 0; bottom: 0; left: 0; width: 34%; background: var(--burgundy); animation: run 1.1s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
@keyframes run { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.lasso { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.lasso path { fill: rgba(27, 33, 49, 0.07); stroke: var(--navy); stroke-width: 1.6; stroke-dasharray: 5 4; }
.stage.lassoing .maplibregl-canvas-container { cursor: crosshair; }

.toast { position: absolute; right: 16px; bottom: 16px; z-index: 6; max-width: 360px; padding: 11px 14px; border-radius: 12px; background: var(--navy); color: var(--on-navy); font-size: 14px; display: flex; gap: 12px; align-items: center; animation: rise-r 220ms var(--ease-out); }
.toast button { border: 0; background: none; color: var(--tan-strong); font-weight: 700; padding: 0; }
@keyframes rise-r { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.depot { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); border: 2px solid #fff; display: grid; place-items: center; }
.depot svg { display: block; }

.maplibregl-ctrl-group { border-radius: 10px !important; box-shadow: none !important; border: 1px solid var(--line); }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* ------------------------------------------------------------------ phone and small screens: the ledger becomes a sheet */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .stage { grid-row: 1; grid-column: 1; }
  .ledger {
    --peek: 200px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; height: 86dvh; border-radius: 18px 18px 0 0; padding-top: 6px;
    transform: translateY(calc(100% - var(--peek))); transition: transform 420ms var(--ease-drawer);
  }
  .ledger.up { transform: translateY(0); }
  .sheet-handle { display: grid; place-items: center; height: 26px; margin: 0 -20px 4px; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 42px; height: 5px; border-radius: 3px; background: #4A5674; }
  .headline { font-size: 17px; min-height: 0; margin: 12px 0 10px; }
  .figure dd { font-size: 19px; }
  .bar { top: 10px; left: 10px; right: 10px; gap: 6px; }
  .pill span { display: none; }
  .day-pick select { max-width: 138px; text-overflow: ellipsis; }
  .pill { padding: 0 11px; }
  .card { top: auto; bottom: calc(200px + 12px); left: 10px; right: 10px; width: auto; max-height: 52dvh; transform-origin: bottom center; }
  .selection { bottom: calc(200px + 12px); }
  .legend-hint { display: none; }
  .toast { bottom: calc(200px + 12px); right: 10px; left: 10px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .progress span { animation: none; width: 100%; opacity: 0.5; }
}

/* ------------------------------------------------------------------ driver sheets (printed) */
.print { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; }
  .app, .open, .booting { display: none !important; }
  .print { display: block; color: #000; font: 11pt/1.35 var(--font); }
  .sheet { break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #1B2131; padding-bottom: 6px; margin-bottom: 8px; }
  .sheet h1 { font-size: 18pt; margin: 0; }
  .sheet .meta { font-size: 9.5pt; color: #444; text-align: right; }
  .sheet table { width: 100%; border-collapse: collapse; }
  .sheet th { text-align: left; font-size: 9pt; color: #444; border-bottom: 1px solid #999; padding: 3px 4px; }
  .sheet td { border-bottom: 1px solid #ddd; padding: 4px; vertical-align: top; font-size: 10pt; }
  .sheet td.n { width: 26px; font-weight: 700; }
  .sheet td a { color: #1B2131; }
  .sheet .chip { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .sheet .new { font-weight: 700; }
}
