/* Sandtable · Dallas. Apple-style materials over a live city: system font, system colours,
   frosted glass with a soft highlight, sentence case, one accent (blue). Red only for emergencies. */
:root {
  --label: #F5F5F7;
  --label-2: rgba(235, 235, 245, 0.62);
  --label-3: rgba(235, 235, 245, 0.34);
  --sep: rgba(84, 84, 88, 0.55);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.34);
  --material: rgba(28, 28, 30, 0.52);
  --material-thick: rgba(28, 28, 30, 0.74);
  --hairline: rgba(255, 255, 255, 0.09);
  --blue: #0A84FF;
  --link: #409CFF;
  --red: #FF453A;
  --orange: #FF9F0A;
  --green: #30D158;
  --gray: #8E8E93;
  --shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.45), 0 18px 48px rgba(0, 0, 0, 0.38);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--label); font: 400 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; letter-spacing: -0.006em; overflow: hidden; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }
.map { position: fixed; inset: 0; }

.glass {
  background: var(--material);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: 22px;
}
/* panels full of text use the thicker material and dim what is behind them, so text stays legible over light buildings */
.stations, .side, .col, .heatbar, .toast, .planbar, .answer {
  background: var(--material-thick);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(0.7);
  backdrop-filter: blur(40px) saturate(180%) brightness(0.7);
}

/* ---------- top ---------- */
.top { position: fixed; top: 16px; left: 16px; right: 16px; display: flex; gap: 12px; align-items: stretch; pointer-events: none; z-index: 6; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 16px; border-radius: 18px; cursor: default; }
.brand b { font-weight: 600; font-size: 15px; }
.brand small { display: block; color: var(--label-2); font-size: 12px; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gray); flex: none; }
.dot.live { background: var(--green); box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.22); }
.dot.stale { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.22); }
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 12px; align-self: center; background: var(--fill); border: 0; box-shadow: none; -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.seg button { border: 0; background: none; padding: 6px 20px; border-radius: 9px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--label); }
.seg button[aria-selected="true"] { background: #636366; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); font-weight: 600; }
.stats { margin-left: auto; display: flex; align-items: center; gap: 22px; padding: 9px 20px; border-radius: 18px; }
.stats div { display: flex; flex-direction: column; line-height: 1.12; }
.stats b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.stats span { font-size: 11px; color: var(--label-2); white-space: nowrap; }
.stats .red b { color: var(--red); } .stats .amber b { color: var(--orange); }
.clock { padding: 9px 18px; text-align: right; line-height: 1.12; display: flex; flex-direction: column; justify-content: center; border-radius: 18px; }
.clock b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.clock span { font-size: 11px; color: var(--label-2); }

/* ---------- panels ---------- */
.stations { position: fixed; top: 92px; left: 16px; width: 300px; max-height: calc(100vh - 196px); overflow-y: auto; padding: 12px; z-index: 4; }
.side { position: fixed; top: 92px; right: 16px; width: 344px; max-height: calc(100vh - 196px); overflow-y: auto; padding: 12px; z-index: 4; }
.stations::-webkit-scrollbar, .side::-webkit-scrollbar { width: 6px; }
.stations::-webkit-scrollbar-thumb, .side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 3px; }
.stations, .side { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.stations.more::after { content: ""; position: sticky; bottom: -12px; display: block; height: 36px; margin: -36px -12px -12px; background: linear-gradient(rgba(28, 28, 30, 0), rgba(28, 28, 30, 0.95)); border-radius: 0 0 22px 22px; pointer-events: none; }
.head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 8px 8px; }
.head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.head span { color: var(--label-2); font-size: 12px; }
.tabs { display: flex; gap: 2px; padding: 2px; margin: 0 2px 10px; border-radius: 10px; background: var(--fill); }
.tabs button[role="tab"] { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px; cursor: pointer; font-weight: 500; font-size: 13px; }
.tabs button[aria-selected="true"] { background: #636366; font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12); }
.tabs .n { color: var(--label-2); margin-left: 5px; font-weight: 500; }
.tabs .x { align-self: center; margin: 0 4px; }

.st { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: 14px; padding: 9px 10px; cursor: pointer; }
.st:hover { background: rgba(255, 255, 255, 0.05); }
.st.sel { background: rgba(10, 132, 255, 0.18); }
.st .l1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.st .l1 b { font-weight: 600; font-size: 15px; }
.st .l1 span { color: var(--label-2); font-size: 12px; flex: none; }
.st .l2 { color: var(--label-2); font-size: 12px; margin-top: 1px; }
.st .l2 .r { color: var(--red); font-weight: 600; }
.st .none { color: var(--label-3); font-size: 12px; }
.pieces { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.pc { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
.pc.p1 { background: var(--red); } .pc.p2 { background: var(--orange); } .pc.p3, .pc.p4 { background: var(--blue); }
.pc.clear { background: var(--gray); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.45); }
.pc.pend { box-shadow: 0 0 0 1.5px var(--blue), 0 0 0 3.5px rgba(10, 132, 255, 0.3); }

/* pending switches: pinned to the bottom of the Stations panel, so "Copy for dispatch" is always in view */
/* solid: a blurred panel inside a blurred panel does not blur, and the list would show through */
.plan { position: sticky; bottom: -12px; margin: 10px -12px -12px; padding: 12px 18px 14px; background: #232325; border-top: 0.5px solid var(--sep); border-radius: 0 0 22px 22px; }
.plan h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.plan .moves { max-height: min(28vh, 180px); overflow-y: auto; }
.plan .row2 { margin-top: 8px; }
.plan .row2 .btn { white-space: nowrap; }
.plan .row2 .btn.primary { flex: 2; }
.move { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.move .m { flex: 1; }
.move .m b { display: block; font-weight: 600; }
.move .m small { color: var(--label-2); }
/* ...and in the Board view, where the Stations panel is hidden, a bar of its own */
.planbar { position: fixed; left: 16px; bottom: 132px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 16px; border-radius: 16px; }
body.plan-open .boardview { bottom: 188px; }
.planbar b { white-space: nowrap; font-weight: 600; }
.planbar .list { display: none; }
.planbar .btn { white-space: nowrap; padding: 7px 11px; }

.x { border: 0; background: var(--fill); color: var(--label-2); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; line-height: 1; padding: 0; flex: none; }
.x:hover { color: var(--label); background: var(--fill-2); }
.btn { border: 0; background: var(--fill); border-radius: 10px; padding: 9px 13px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: var(--fill-2); }
.btn.primary { background: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #3395FF; }
.btn.full { width: 100%; }
.btn[disabled], .btn.primary[disabled] { background: var(--fill); color: var(--label-3); cursor: default; }
.back { border: 0; background: none; color: var(--link); cursor: pointer; padding: 2px 4px 8px; font-weight: 400; font-size: 15px; display: inline-flex; align-items: center; gap: 2px; }
.back:hover { opacity: 0.8; }

/* unit rows */
.off { display: grid; grid-template-columns: 76px 1fr auto; gap: 0 12px; align-items: center; width: 100%; text-align: left; border: 0; background: none; border-radius: 14px; padding: 7px 8px; cursor: pointer; }
.off:hover { background: rgba(255, 255, 255, 0.05); }
.off.dim { opacity: 0.62; }
.badge { min-width: 50px; height: 30px; padding: 0 8px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; background: var(--fill); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gray); flex: none; }
.badge.p1::before { background: var(--red); } .badge.p2::before { background: var(--orange); } .badge.p3::before, .badge.p4::before { background: var(--blue); }
.badge.clear { color: var(--label-2); }
.badge.station::before { display: none; }
.off .badge { width: 100%; min-width: 0; padding: 0 6px; overflow: hidden; white-space: nowrap; }
.off .badge.long { font-size: 11px; letter-spacing: -0.02em; gap: 4px; }
.card .who .badge.long { font-size: 14px; }
.off .c { min-width: 0; }
.off .c b { font-weight: 500; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.3; }
.off .c small { color: var(--label-2); font-size: 12px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.off .t { text-align: right; font-weight: 600; white-space: nowrap; }
.off .t small { display: block; color: var(--label-2); font-weight: 400; font-size: 11px; }
/* long scenes: orange, never red; red is for emergencies */
.warn { color: var(--orange); } .bad { color: var(--orange); font-weight: 700; } .blue { color: var(--link); }
.r { color: var(--red); font-weight: 600; }
.nw { white-space: nowrap; }
.sect { margin: 14px 10px 4px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.sect.more { display: block; border: 0; background: none; cursor: pointer; color: var(--link); padding: 0; text-align: left; }
.note { color: var(--label-3); font-size: 12px; padding: 10px 10px 2px; margin: 0; }
.note.lead { color: var(--label-2); padding: 0 10px 6px; }

/* the unit card: an inset grouped list */
.card .who { display: flex; align-items: center; gap: 14px; padding: 2px 4px; }
.card .who .badge { min-width: 70px; height: 44px; font-size: 17px; border-radius: 12px; }
.card .who h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.card .who p { margin: 1px 0 0; color: var(--label-2); }
.facts { margin-top: 14px; background: rgba(118, 118, 128, 0.14); border-radius: 14px; padding: 0 12px; }
.fact { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 10px 0; border-bottom: 0.5px solid var(--sep); }
.fact:last-child { border-bottom: 0; }
.fact > span { font-size: 13px; color: var(--label-2); padding-top: 1px; }
.fact b { font-weight: 500; }
.fact small { display: block; color: var(--label-2); }
.acts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.card .acts { position: sticky; bottom: -12px; z-index: 1; margin: 12px -12px -12px; padding: 10px 12px 12px; background: #232325; border-top: 0.5px solid var(--sep); border-radius: 0 0 22px 22px; }
.acts .row2 .dd { min-width: 0; gap: 6px; padding: 9px 10px; }
.acts .row2 .dd .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1; }
.pri { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px; }
.pri.p1 { background: rgba(255, 69, 58, 0.2); color: #FF6961; } .pri.p2 { background: rgba(255, 159, 10, 0.2); color: #FFB340; } .pri.p3, .pri.p4 { background: rgba(10, 132, 255, 0.2); color: #409CFF; }
.story { margin-top: 12px; background: rgba(118, 118, 128, 0.14); border-radius: 14px; padding: 8px 12px; }
.story h4 { margin: 2px 0 4px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.story .lead { margin: 2px 0 6px; }
.story .lead b { display: block; font-weight: 600; }
.story .lead span { color: var(--label-2); font-size: 13px; }
.story div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 0.5px solid var(--sep); font-size: 13px; }
.story div:last-child { border-bottom: 0; }
.story div span { color: var(--label-2); white-space: nowrap; }

/* events: icon, what happened, why it matters, time */
.ev { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; width: 100%; text-align: left; border: 0; background: none; border-radius: 14px; padding: 9px 8px; cursor: pointer; }
.ev:hover { background: rgba(255, 255, 255, 0.05); }
.ev.static { cursor: default; }
.ev.static:hover { background: none; }
.ev + .ev { box-shadow: 0 -0.5px 0 var(--sep); }
.ev:hover + .ev, .ev:hover { box-shadow: none; }
.ev .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ev .ic.red { background: var(--red); } .ev .ic.orange { background: var(--orange); } .ev .ic.blue { background: var(--blue); }
.ev .ic.green { background: var(--green); } .ev .ic.gray { background: #48484A; }
.ev .tx { min-width: 0; }
.ev b { display: block; font-weight: 500; line-height: 1.3; }
.ev small { display: block; color: var(--label-2); font-size: 12px; margin-top: 1px; }
.ev .so { display: block; color: var(--label); font-size: 12px; margin-top: 4px; padding: 4px 8px; border-radius: 8px; background: rgba(118, 118, 128, 0.2); }
.ev time { color: var(--label-3); font-size: 12px; padding-top: 1px; }
.ev.urgent { background: rgba(255, 69, 58, 0.16); }
.ev.urgent b { color: #FF6961; font-weight: 600; }
.ev.urgent .so { background: rgba(255, 69, 58, 0.2); color: #FFD3D0; }
.ev.notice { background: rgba(255, 159, 10, 0.13); }
.ev.notice b { color: #FFB340; font-weight: 600; }
.ev.urgent + .ev, .ev + .ev.urgent, .ev.notice + .ev, .ev + .ev.notice { box-shadow: none; }

/* the heat map bar: what usually happens, by weekday and hour; centred between the panels */
.heatbar { position: fixed; top: 92px; left: 332px; right: 376px; margin: 0 auto; width: fit-content; max-width: calc(100vw - 708px); z-index: 6; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 18px; }
.heatbar .hrow { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.heatbar .hrow.sub { justify-content: space-between; flex-wrap: nowrap; gap: 12px; padding: 0 4px; }
.heatbar .lbl { font-weight: 600; padding-left: 4px; }
.heatbar .sum { color: var(--label-2); font-size: 12px; min-width: 0; }
.heatbar .dd { width: auto; padding: 6px 10px; }
.heatbar .dd .k { display: none; }
.heatbar .dd .v { text-align: left; white-space: nowrap; }
.stepper { display: flex; align-items: center; background: var(--fill); border-radius: 10px; }
.stepper button { border: 0; background: none; width: 30px; height: 30px; cursor: pointer; font-size: 15px; border-radius: 10px; }
.stepper button:hover { background: var(--fill-2); }
.stepper b { min-width: 104px; text-align: center; font-weight: 600; }
.play { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.legend { display: flex; align-items: center; gap: 6px; color: var(--label-2); font-size: 11px; flex: none; }
.legend i { width: 64px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(10, 132, 255, 0.5), #FF9F0A, #FF453A); }

/* custom dropdown: an Apple-style menu */
.dd { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: var(--fill); border-radius: 10px; padding: 9px 12px; cursor: pointer; text-align: left; }
.dd:hover { background: var(--fill-2); }
.dd .k { color: var(--label-2); font-size: 13px; }
.dd .v { flex: 1; font-weight: 500; text-align: right; }
.dd svg { opacity: 0.6; flex: none; }
.dd-menu { position: fixed; z-index: 40; max-height: 360px; overflow-y: auto; padding: 5px; border-radius: 14px; background: rgba(40, 40, 42, 0.86); }
.dd-opt { display: grid; grid-template-columns: 18px 1fr auto; gap: 0 8px; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px; padding: 7px 10px 7px 6px; cursor: pointer; align-items: center; }
.dd-opt:hover, .dd-opt.active { background: var(--blue); }
.dd-opt:hover small, .dd-opt.active small, .dd-opt:hover .tag, .dd-opt.active .tag { color: rgba(255, 255, 255, 0.85); }
.dd-opt .ck { color: var(--label); font-size: 13px; text-align: center; }
.dd-opt b { font-weight: 500; }
.dd-opt small { grid-column: 2 / -1; color: var(--label-2); font-size: 12px; }
.dd-opt .tag { color: var(--label-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dd-opt .tag.r { color: #FF6961; }

/* ---------- the board view ---------- */
.boardview { position: fixed; top: 92px; left: 16px; right: 16px; bottom: 132px; z-index: 5; display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); gap: 10px; }
.col { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 12px 10px; border-radius: 20px; transition: background 0.15s, box-shadow 0.15s; }
.col.over { background: rgba(10, 132, 255, 0.22); box-shadow: var(--shadow), inset 0 0 0 2px var(--blue); }
.col h3 { flex: none; margin: 0 2px; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col .meta { flex: none; color: var(--label-2); font-size: 12px; margin: 1px 2px 0; line-height: 1.3; }
.col .meta + .meta { margin-bottom: 8px; }
.col .list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.col .list::-webkit-scrollbar { width: 0; }
.tile { border: 0; background: var(--fill); border-radius: 12px; padding: 8px 10px; cursor: grab; text-align: left; width: 100%; }
.tile:hover { background: var(--fill-2); }
.tile.dragging { opacity: 0.35; }
.tile .l1 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile .l1 b { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tile .l1 b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.tile.p1 .l1 b::before { background: var(--red); } .tile.p2 .l1 b::before { background: var(--orange); } .tile.p3 .l1 b::before, .tile.p4 .l1 b::before { background: var(--blue); }
.tile .l1 em { font-style: normal; font-size: 12px; font-weight: 600; }
.tile small { color: var(--label-2); font-size: 12px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tile.clear { background: rgba(118, 118, 128, 0.14); }
.tile.pend { box-shadow: inset 0 0 0 1.5px var(--blue); }
.col .empty { color: var(--label-3); font-size: 12px; padding: 8px 2px; }
/* a unit opened from the Board: its card sits above the columns */
body.board-card .side { z-index: 8; }

/* ---------- Orbit, the assistant ---------- */
.orbit { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(620px, calc(100vw - 720px)); min-width: 420px; z-index: 7; display: flex; flex-direction: column; gap: 10px; }
.ask { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px; }
.ask input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 10px 6px; font-size: 16px; }
.ask input::placeholder { color: var(--label-3); }
.mic, .send { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.mic { background: var(--fill); } .mic.on { background: var(--red); }
.send { background: var(--blue); color: #fff; }
.answer { padding: 14px 18px; font-size: 15px; line-height: 1.5; max-height: 40vh; overflow-y: auto; }
.answer .who { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--label-2); margin-bottom: 4px; }
.answer.thinking .text { color: var(--label-2); }
.proposal { margin-top: 10px; background: rgba(10, 132, 255, 0.14); border-radius: 14px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.proposal .m { flex: 1; } .proposal .m b { font-weight: 600; } .proposal .m small { display: block; color: var(--label-2); }
.chips { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips > :first-child { margin-left: auto; } .chips > :last-child { margin-right: auto; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--hairline); background: var(--material); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 500; box-shadow: var(--shadow); white-space: nowrap; }
.chips button:hover { background: var(--material-thick); }

/* ---------- map extras ---------- */
.tools { position: fixed; left: 16px; bottom: 18px; display: flex; gap: 8px; z-index: 6; }
.tool { padding: 9px 14px; border-radius: 12px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.tool[aria-pressed="true"] { background: rgba(10, 132, 255, 0.5); }
#panel { display: none; }
/* banners: centred across the screen; moved under the heat bar while it is open */
.hud { position: fixed; left: 16px; right: 16px; top: 92px; z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.hud.low { top: auto; bottom: 140px; }
body.plan-open .hud.low { bottom: 196px; }
body.board-card .hud.low { right: 376px; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 10px 12px 10px 16px; border-radius: 16px; max-width: min(520px, 100%); animation: drop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.toast .t { flex: 1; min-width: 0; }
.toast .t b { display: block; font-weight: 600; }
.toast .t small { color: var(--label-2); font-size: 12px; }
.hud.short .toast .t small { display: none; } /* one line over a phone's map strip */
.toast .btn { padding: 7px 12px; }
.toast i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; }
.toast.alert .t b { color: #FF6961; }
.toast.alert i { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 69, 58, 0.25); }
.toast.notice .t b { color: #FFB340; }
.toast.notice i { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 159, 10, 0.25); }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.maplibregl-popup.tip .maplibregl-popup-content { background: rgba(40, 40, 42, 0.86); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: var(--label); font: 500 12px/1.3 var(--font); padding: 6px 9px; border-radius: 9px; box-shadow: var(--shadow); }
.maplibregl-popup.tip .maplibregl-popup-tip { display: none; }
.maplibregl-popup.tip, .maplibregl-popup.tip .maplibregl-popup-content { pointer-events: none; } /* hover passes through the tip */
/* zoom and compass: one row in the free bottom-right corner, under the Units panel */
.maplibregl-ctrl-bottom-right { bottom: 18px !important; right: 16px !important; display: flex; flex-direction: row-reverse; align-items: center; gap: 8px; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 !important; }
.maplibregl-ctrl-group { display: flex; background: var(--material) !important; -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border: 1px solid var(--hairline); border-radius: 12px !important; box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button + button { border-top: 0 !important; border-left: 0.5px solid var(--sep) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: var(--material) !important; color: var(--label-3); }
.maplibregl-ctrl-attrib a { color: var(--label-2); }
.maplibregl-ctrl-attrib:not(:hover) .maplibregl-ctrl-attrib-inner { display: none; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

@media (min-width: 1101px) and (max-width: 1300px) {
  .chips { flex-wrap: wrap; justify-content: center; overflow: visible; }
  .chips > :first-child, .chips > :last-child { margin: 0; }
}
/* short screens: compact station rows so all of them fit */
@media (max-height: 820px) {
  .stations { max-height: calc(100vh - 160px); }
  .stations .head { padding: 2px 8px 6px; }
  .st { padding: 6px 10px; }
  .pieces { margin-top: 4px; gap: 3px; }
  .pc { width: 9px; height: 9px; }
}
/* ---------- smaller screens: the Units panel opens over the map when needed ---------- */
@media (max-width: 1100px) {
  .stations { width: 260px; max-height: calc(100vh - 280px); }
  .side { display: none; z-index: 8; width: 320px; max-height: calc(100vh - 260px); }
  body.side-open .side { display: block; }
  #panel { display: block; }
  .tools { bottom: 132px; }
  .orbit { left: 16px; right: 172px; width: auto; min-width: 0; transform: none; }
  .chips { justify-content: flex-start; }
  .heatbar { left: 292px; right: 16px; max-width: none; }
  .boardview { bottom: 180px; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
  .planbar { bottom: 132px; left: auto; right: 16px; }
  body.plan-open .boardview { bottom: 180px; }
  .st .l1 { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
  .stats { gap: 14px; padding: 9px 14px; }
  .stats b, .clock b { font-size: 17px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  body.side-open .heatbar { right: 352px; }
  body.side-open .orbit { right: 352px; } /* Orbit's answer stays beside the card */
  body.board-card .hud.low { right: 352px; }
}
/* tablets in portrait: one overlay at a time, so the heat bar and the card both fit; the header's numbers get a row */
@media (min-width: 761px) and (max-width: 1000px) {
  body.side-open .stations { display: none; }
  body.side-open .heatbar { left: 16px; }
}
@media (min-width: 761px) and (max-width: 940px) {
  .top { flex-wrap: wrap; }
  .clock { display: none; }
  .stats { order: 3; flex: 1 0 100%; margin-left: 0; justify-content: space-between; }
  .stations, .side, .heatbar, .hud, .boardview { top: 150px; }
  .stations { max-height: calc(100vh - 338px); }
  .side { max-height: calc(100vh - 318px); }
}
@media (max-width: 760px) {
  .top { top: 8px; left: 8px; right: 8px; gap: 8px; flex-wrap: wrap; }
  .brand { padding: 8px 12px; flex: 1; min-width: 0; }
  .brand small { overflow: hidden; text-overflow: ellipsis; }
  .seg button { padding: 6px 12px; }
  .clock { display: none; }
  .stats { order: 3; flex: 1 0 100%; margin-left: 0; justify-content: space-between; gap: 6px; padding: 8px 12px; }
  .stats b { font-size: 16px; }
  .stats span { font-size: 10px; }
  .stations { display: none; }
  .side { top: auto; left: 8px; right: 8px; bottom: 74px; width: auto; max-height: min(56vh, calc(100vh - var(--heat-bottom, 0px) - 190px)); border-radius: 22px; }
  body.side-open .heatbar .hrow.sub { display: none; }
  /* while the sheet is open: the header's numbers step aside for the map, a station card leaves more map above it,
     and Orbit's answer shows over the sheet until it is closed */
  body.side-open .stats { display: none; }
  body.side-open .heatbar, body.side-open .hud { top: 72px; }
  body.station-card .side { max-height: min(46vh, calc(100vh - var(--heat-bottom, 0px) - 190px)); }
  body.side-open .orbit { z-index: 9; }
  .answer { max-height: 30vh; }
  .tools { left: 8px; right: 8px; bottom: 74px; justify-content: center; }
  .tool { padding: 8px 11px; font-size: 13px; }
  body.side-open .tools { display: none; }
  .chips { display: none; }
  .orbit { left: 8px; right: 8px; bottom: 12px; }
  .heatbar { top: 150px; left: 8px; right: 8px; width: auto; }
  .heatbar .hrow.sub { flex-wrap: wrap; }
  .hud { top: 150px; left: 8px; right: 8px; }
  .hud.low { bottom: 132px; }
  body.plan-open .hud.low { bottom: 188px; }
  body.board-card .hud.low { top: 150px; bottom: auto; right: 8px; }
  .boardview { top: 150px; left: 8px; right: 8px; bottom: 124px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; overflow-y: auto; }
  .boardview .col .list { overflow: visible; }
  .planbar { left: 8px; right: 8px; bottom: 124px; justify-content: space-between; }
  body.plan-open .boardview { bottom: 180px; }
  .maplibregl-ctrl-group { display: none; }
  .maplibregl-ctrl-bottom-right { bottom: 124px !important; right: 8px !important; }
  body.plan-open .maplibregl-ctrl-bottom-right { bottom: 180px !important; }
}
