/* Round 18 tokens (dashboard-redesign-18.md section 4). Dark is the default; <html data-theme="light"> flips to the light block.
   New role names first; the old theme.css names (--ink, --mut, --line, --surface, --subtle, --teal*, --live) map onto the roles, so every older rule
   follows the theme. Data colours (magma UTCI, solar, wind, smoke) come from the data files, never from here. */
:root {
  --bg-0: hsl(192 18% 7%); --map: hsl(195 10% 17%); --sf: hsl(192 16% 10% / .94); --sf-solid: hsl(192 16% 10%);
  --sf-2: hsl(192 13% 14%); --sf-3: hsl(192 11% 19%); --ln: hsl(192 10% 21%); --ln-2: hsl(192 9% 28%);
  --tx-1: hsl(190 12% 94%); --tx-2: hsl(190 8% 72%); --tx-3: hsl(190 6% 52%); --on-acc: #fff;
  --acc: hsl(186 51% 35%); --acc-hi: hsl(186 46% 62%); --acc-t: hsl(186 46% 62% / .14);
  --ok: hsl(186 46% 62%); --ok-t: hsl(186 46% 62% / .12); --ok-line: hsl(186 46% 62% / .35);
  --watch: hsl(38 84% 60%); --watch-t: hsl(38 84% 60% / .16);
  --alert: hsl(8 74% 58%); --alert-t: hsl(8 74% 58% / .18); --on-alert: hsl(192 18% 8%);
  --chip: hsl(192 18% 7% / .62);
  --sh: 0 1px 2px hsl(200 30% 2% / .4), 0 8px 24px hsl(200 30% 2% / .35);
  --hdr: 48px; --r: 12px; --r-2: 8px; --r-3: 6px;
  color-scheme: dark;
}
[data-theme="light"], #deck, #storywel {
  --bg-0: hsl(190 14% 97%); --map: hsl(190 10% 86%); --sf: hsl(0 0% 100% / .96); --sf-solid: #fff;
  --sf-2: hsl(190 18% 96%); --sf-3: hsl(190 14% 92%); --ln: hsl(190 12% 90%); --ln-2: hsl(190 10% 84%);
  --tx-1: hsl(190 34% 12%); --tx-2: hsl(190 12% 34%); --tx-3: hsl(190 6% 46%); --on-acc: #fff;
  --acc: hsl(186 51% 35%); --acc-hi: hsl(186 55% 30%); --acc-t: hsl(186 40% 93%);
  --ok: hsl(186 55% 30%); --ok-t: hsl(186 40% 93%); --ok-line: hsl(186 55% 30% / .4);
  --watch: hsl(38 88% 34%); --watch-t: hsl(40 80% 92%);
  --alert: hsl(8 70% 48%); --alert-t: hsl(8 70% 48% / .12); --on-alert: #fff;
  --chip: hsl(0 0% 100% / .78);
  --sh: 0 1px 2px hsl(190 30% 10% / .06), 0 4px 16px hsl(190 30% 10% / .1);
  color-scheme: light;
}
/* the deck (intro, outro) and the welcome card stay light in both themes */
:root, [data-theme="light"], #deck, #storywel {
  --ink: var(--tx-1); --ink-2: var(--tx-2); --mut: var(--tx-3); --line: var(--ln); --line-2: var(--ln-2);
  --subtle: var(--sf-2); --surface: var(--sf); --teal: var(--acc); --teal-d: var(--acc-hi); --teal-t: var(--acc-t);
  --live: var(--alert); --watch-t2: var(--watch-t); --shadow: var(--sh);
}
/* Heat demo page (heat/index.html). Concept: docs/heat-ux.md. Tokens of core/css/theme.css (Helvetica Neue, ink, teal, --live for alerts only);
   data colours come from the data files, not from here. Fixed regions, nothing overlaps: left layers panel + icon rail | map | right crew panel;
   the top bar (area switch, "i") and the dock (time, footer sentence) sit inside the map column. */
:root { --pw-l: 268px; --pw-r: 352px; --gap: 12px; --rail: 40px; --L: calc(var(--gap) * 2 + var(--pw-l) + 8px + var(--rail)); --R: calc(var(--gap) * 2 + var(--pw-r)); }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e9eef0; color: var(--ink); font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
#c { position: fixed; inset: 0; touch-action: none; } html, body { overscroll-behavior: none; } .ic { flex: none; display: block; }
small { font-size: 11px; line-height: 15px; color: var(--mut); } b { font-weight: 600; font-variant-numeric: tabular-nums; } b i { font-style: normal; font-weight: 400; color: var(--mut); margin-left: 2px; font-size: .85em; }
h1, h2, h3 { margin: 0; font-weight: 600; } h2 { font-size: 13px; } h3 { font-size: 11px; color: var(--ink-2); grid-column: 1 / -1; }
.panel, #top, #dock, #tip, #sheet, #rail { background: var(--surface); box-shadow: var(--shadow); border-radius: 12px; box-sizing: border-box; }
button { font: inherit; color: inherit; } :focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.hc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--sf-3); font-size: 12px; font-weight: 500; cursor: pointer; }
.hc-btn:hover { background: var(--subtle); } .hc-btn.ico { width: 30px; padding: 0; } .hc-btn.sm { width: 26px; height: 26px; border-color: transparent; background: none; color: var(--mut); }
.hc-btn.sm:hover { color: var(--teal); background: var(--teal-t); } .hc-btn.pri { background: var(--teal); border-color: var(--teal); color: #fff; } .hc-btn.pri:hover { background: var(--teal-d); }
.hc-btn[aria-pressed=true], .hc-btn[aria-expanded=true] { background: var(--teal-t); border-color: var(--teal); color: var(--teal-d); }
.hc-sel { height: 30px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--sf-3); font: inherit; font-size: 12px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.hc-tag { padding: 1px 8px; border-radius: 9px; background: var(--subtle); color: var(--ink-2); font-size: 11px; font-weight: 600; } .hc-tag.now { background: rgba(214, 69, 43, .1); color: var(--live); } .hc-tag.forecast { background: var(--teal-t); color: var(--teal-d); }
.hc-empty, .b-none { margin: 0; padding: 8px 0; color: var(--mut); font-size: 12px; display: flex; gap: 6px; align-items: center; } .b-none .ic { color: var(--teal); }
.pill { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 5px; border-radius: 10px; font-size: 10px; font-weight: 600; white-space: nowrap; background: var(--subtle); color: var(--ink-2); }
.pill.io { padding: 2px; } .pill.ok { background: var(--teal-t); color: var(--teal-d); } .pill.watch { background: var(--watch-t); color: var(--watch); } .pill.alert { background: var(--live); color: #fff; }
.hc-chart, .hc-spark { width: 100%; height: auto; display: block; } .hc-chart { background: var(--subtle); border-radius: 6px; } .hc-spark { width: 46px; height: 18px; flex: none; }

/* top bar: area switch and "i", centred in the map column */
#top { position: fixed; z-index: 20; top: var(--gap); left: calc(var(--L) + (100vw - var(--L) - var(--R)) / 2); transform: translateX(-50%); padding: 5px 5px 5px 12px; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - var(--L) - var(--R)); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; } .brand img { height: 16px; }
.scenes { display: flex; gap: 2px; padding: 2px; background: var(--subtle); border-radius: 8px; }
.scenes a { padding: 4px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 12px; font-weight: 500; white-space: nowrap; } .scenes a:hover { color: var(--ink); } .scenes a.on { background: var(--sf-3); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }

/* left: simulation layers */
#layers { position: fixed; z-index: 10; top: var(--gap); bottom: var(--gap); left: var(--gap); width: var(--pw-l); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.ly-list { display: flex; flex-direction: column; gap: 2px; }
.ly { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: none; text-align: left; cursor: pointer; color: var(--ink-2); }
.ly span { flex: 1; font-weight: 500; } .ly:hover:not(:disabled):not(.dis) { background: var(--subtle); } .ly.on { background: var(--teal-t); border-color: var(--teal); color: var(--teal-d); } .ly.on span { font-weight: 600; }
.ly:disabled, .ly.dis { opacity: .5; cursor: default; } .ly.dis { height: 28px; font-size: 12px; } .ly-slots { gap: 0; }
.ly-legend:empty { display: none; } .lv-legend { margin: 0; } .lv-legend + .lv-legend { margin-top: 8px; }
.lv-title { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-bottom: 4px; } .lv-bar { height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(20, 38, 41, .08); }
.lv-ticks { position: relative; height: 14px; font-size: 10px; color: var(--mut); font-variant-numeric: tabular-nums; } .lv-ticks span { position: absolute; transform: translateX(-50%); } .lv-bands { display: none; }
.b-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
#rail { position: fixed; z-index: 10; top: var(--gap); left: calc(var(--gap) + var(--pw-l) + 8px); width: var(--rail); padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.rl { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.rl:hover:not(:disabled) { background: var(--subtle); color: var(--ink); } .rl.on { background: var(--teal-t); color: var(--teal-d); } .rl:disabled { opacity: .35; cursor: default; }
.rl-tip { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); padding: 3px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.rl:hover .rl-tip, .rl:focus-visible .rl-tip { opacity: 1; }

/* right: crew (overview, sort, list, detail) */
#crew { position: fixed; z-index: 10; top: var(--gap); bottom: var(--gap); right: var(--gap); width: var(--pw-r); display: flex; flex-direction: column; overflow: hidden; }
.pn-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0; } .pn-h h2 { font-size: 15px; } .pn-h small { font-weight: 400; margin-left: 6px; }
.th-menu { display: flex; flex-direction: column; gap: 8px; margin: 8px 16px 0; padding: 12px; border-radius: 8px; background: var(--subtle); } .th-menu[hidden] { display: none; }
.th-menu label { display: flex; flex-direction: column; font-size: 12px; } .th-menu label span { display: flex; gap: 8px; align-items: center; } .th-menu input { flex: 1; accent-color: var(--teal); } .th-menu b { min-width: 64px; text-align: right; }
.ov { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.b-cnt { display: grid; grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); gap: 4px; } .b-cnt small { font-size: 10.5px; line-height: 13px; } .b-cnt div { display: flex; flex-direction: column; } .b-cnt b { font-size: 20px; font-weight: 500; line-height: 24px; } .b-cnt .hot b { color: var(--live); }
.b-chart { display: flex; flex-direction: column; gap: 2px; }
.b-al { display: flex; flex-direction: column; gap: 4px; } .b-more { padding-left: 2px; }
.al { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--sf-3); cursor: pointer; text-align: left; } .al:hover { border-color: var(--teal); }
.al small { grid-column: 2; } .al b { font-size: 12px; }
.pn-sort { display: flex; align-items: center; gap: 2px; padding: 8px 16px; } .pn-sort small { margin-right: 6px; }
.pn-sort button { height: 24px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: 12px; cursor: pointer; } .pn-sort button:hover { background: var(--subtle); } .pn-sort button[aria-pressed=true] { background: var(--teal-t); color: var(--teal-d); font-weight: 600; }
.rows { flex: 1; overflow-y: auto; padding: 0 6px 8px; }
.row { padding: 5px 6px; border-radius: 8px; cursor: pointer; } .row + .row { box-shadow: 0 -1px 0 var(--line); } .row:hover, .row.hov { background: var(--subtle); } .row.sel { background: var(--teal-t); box-shadow: inset 0 0 0 1px var(--teal); }
/* one line per person: icon | name | status | sparkline | heat now | time on site | locate; numbers larger than their labels */
.r1 { display: grid; grid-template-columns: 16px minmax(84px, 1fr) auto 46px 42px 46px 24px; align-items: center; gap: 5px; min-height: 30px; } .nm { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ric { color: var(--teal); display: inline-flex; } .row.hot .ric { color: var(--live); }
.st:empty { width: 0; } .sp { display: flex; align-items: center; } .num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; white-space: nowrap; } .num b { font-size: 13px; font-weight: 600; } .num small { font-size: 9.5px; line-height: 11px; } .row.hot .num.heat b { color: var(--live); } .hc-pending { color: var(--mut); font-weight: 400; font-style: italic; }
.r3 { margin: 8px 0 2px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; cursor: default; } .r3c { display: flex; flex-direction: column; gap: 2px; }
.r3g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 8px; font-size: 12px; } .r3g div { display: flex; flex-direction: column; } .r3f { margin: 0; font-weight: 600; font-size: 12px; } .r3f:empty { display: none; } .r3m { margin: 0; color: var(--ink-2); font-size: 12px; }
.r3s { display: grid; gap: 2px; } .r3s div { display: flex; justify-content: space-between; font-size: 11px; color: var(--mut); border-top: 1px dashed var(--line-2); padding-top: 3px; }

/* dock: inside the map column, holds the footer sentence */
#dock { position: fixed; z-index: 20; bottom: var(--gap); left: calc(var(--L)); right: calc(var(--R)); max-width: 760px; margin: 0 auto; padding: 10px 16px 8px; display: flex; flex-direction: column; gap: 4px; }
.dk-top { display: flex; align-items: center; gap: 10px; } #dk-t { font-size: 16px; font-weight: 600; white-space: nowrap; } .dk-run { margin-left: auto; color: var(--mut); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; } .dk-top .seg { flex: none; }
.dk-track { position: relative; height: 20px; } .dk-track::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--line-2) var(--now), transparent var(--now)), repeating-linear-gradient(135deg, var(--teal-t) 0 4px, #cfe3e5 4px 8px); }
.dk-track::after { content: ""; position: absolute; left: var(--now); top: 3px; width: 2px; height: 14px; margin-left: -1px; background: var(--live); border-radius: 1px; pointer-events: none; }
#dk-s { position: relative; z-index: 1; width: 100%; height: 20px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
#dk-s::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--sf-3); border: 2px solid var(--teal); box-shadow: var(--shadow); } #dk-s::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--sf-3); border: 2px solid var(--teal); }
.dk-ticks { position: relative; height: 18px; margin: 0 8px; } .dk-tick { position: absolute; transform: translateX(-50%); border: 0; background: none; padding: 0 2px; font-size: 10px; font-variant-numeric: tabular-nums; cursor: pointer; color: var(--mut); }
.dk-tick.forecast { color: var(--teal-d); } .dk-tick.now { color: var(--live); font-weight: 700; } .dk-tick:hover { color: var(--ink); }
.dk-note { font-size: 10px; color: var(--mut); text-align: center; }

/* tooltip, sheet, hovers */
#tip { position: fixed; z-index: 30; width: 320px; max-height: calc(100vh - 2 * var(--gap)); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; } #tip[hidden], #sheet[hidden] { display: none; }
.tp-h { display: flex; align-items: center; gap: 8px; } .tp-h > div { flex: 1; display: flex; flex-direction: column; min-width: 0; } .tp-ic { color: var(--teal); }
.tp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 8px; font-size: 12px; } .tp-grid div { display: flex; flex-direction: column; } .tp-grid span { font-size: 11px; color: var(--mut); }
.tp-t { font-size: 11px; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; } .tp-f { font-weight: 600; font-size: 12px; }
.tp-src { display: grid; gap: 2px; } .dis { display: flex; justify-content: space-between; opacity: .5; font-size: 11px; border-top: 1px dashed var(--line-2); padding-top: 2px; }
#sheet { position: fixed; z-index: 40; top: 64px; left: calc(var(--L) + (100vw - var(--L) - var(--R)) / 2); transform: translateX(-50%); width: min(440px, calc(100vw - var(--L) - var(--R))); max-height: calc(100vh - 200px); overflow-y: auto; padding: 16px; }
#sheet [data-x] { float: right; } #sheet .inset { margin-top: 12px; } .hq-table th { text-align: left; width: 70px; vertical-align: top; } .hq-table td { vertical-align: top; padding: 3px 0; font-size: 12px; } .hq-limits { margin: 0; padding-left: 16px; font-size: 12px; }
#bhover, #heat-hover { position: fixed; z-index: 30; padding: 4px 8px; font-size: 12px; background: var(--surface); box-shadow: var(--shadow); border-radius: 8px; pointer-events: none; } #bhover[hidden], #heat-hover[hidden] { display: none; }
.hc-notice { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 24px 32px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); max-width: 420px; }
.cesium-viewer-bottom, .cesium-credit-logoContainer { left: calc(var(--L)) !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* parts that only the phone layout shows, and the top-bar fit (main.js fitTop: long names, no brand text, short names) */
.ly-lg, .cr-chev, .cr-spark, .scenes .sn, #top.short .scenes .ln, #top.nobrand .brand span { display: none; } #top.short .scenes .sn { display: inline; }
.cr-h { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: default; }
.tp-tls { display: flex; flex-direction: column; gap: 8px; }
/* phone (<= 820 px): the map fills the screen. Top: one row, area switch (scrolls sideways) + "i". Under it: one chip row (UTCI, Solar, Wind)
   and a thin legend strip with a "tune" button (popover: full legend, wind sliders). Bottom: the dock (play, time, tag, scrubber, five hour
   labels), above it the crew bottom sheet (collapsed one line / half list / full list + detail) or the person card. Tap targets 40 px. */
@media (max-width: 820px) {
  :root { --gap: 6px; --L: 6px; --R: 6px; --dock-h: 56px; --above-dock: calc(var(--dock-h) + 12px); --ly-b: 140px; }
  html, body { font-size: 14px; } small, .num small, .pill, .lv-ticks, .lv-title, .hc-tag { font-size: 12px; }
  .hc-btn { min-width: 40px; min-height: 40px; } .hc-btn.sm, .row .hc-btn.sm, #tip .hc-btn.sm { width: 40px; height: 40px; }
  #top { left: 50%; width: calc(100vw - 12px); max-width: none; padding: 3px; gap: 4px; } .brand { display: none; }
  .scenes { overflow-x: auto; flex: 1; scrollbar-width: none; } .scenes a { flex: none; padding: 0 10px; min-width: 44px; justify-content: center; box-sizing: border-box; height: 40px; display: inline-flex; align-items: center; } #qi { width: 40px; height: 40px; }
  #layers { top: 56px; bottom: auto; left: 6px; right: 6px; width: auto; max-height: calc(100dvh - 56px - var(--above-dock) - 70px); padding: 3px; gap: 0; overflow-y: auto; }
  #layers > h2, #layers .ly-wx, #layers .ly-slots, #rail { display: none; }
  .ly-list { flex-direction: row; gap: 3px; } .ly { flex: 1; height: 40px; justify-content: center; gap: 6px; padding: 0 6px; } .ly small { display: none; }
  .ly-lgrow { display: flex; align-items: center; gap: 4px; padding: 0 0 0 8px; height: 26px; } .ly-legend { flex: 1; min-width: 0; }
  .ly-lg { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 40px; margin: -7px 0; border: 0; background: none; color: var(--ink-2); cursor: pointer; } .ly-lg[aria-expanded=true] { color: var(--teal-d); }
  #layers:not(.pop) .lv-title, #layers:not(.pop) .lg-note, #layers:not(.pop) .lv-legend + .lv-legend, #layers:not(.pop) .ly-wind { display: none; }
  #layers:not(.pop) .lv-bar { height: 6px; } #layers:not(.pop) .lv-ticks { height: 13px; font-size: 11px; line-height: 13px; } #layers:not(.pop) .lv-ticks span:first-child { transform: none; } #layers:not(.pop) .lv-ticks span:last-child { transform: translateX(-100%); }
  #layers.pop .ly-lgrow { height: auto; align-items: flex-start; padding: 6px 0 4px 8px; } #layers.pop .ly-lg { margin: 0; } #layers.pop .ly-wind { padding: 2px 8px 6px; }
  .ly-wind { flex-direction: row; gap: 10px; } .ly-wind span small { display: none; } .ly-wind label { flex: 1; } .ly-wind input { height: 32px; }
  #crew { top: auto; left: 6px; right: 6px; bottom: var(--above-dock); width: auto; } #crew.open { height: min(46dvh, calc(100dvh - var(--ly-b) - var(--above-dock) - 8px)); } #crew.full { height: calc(100dvh - var(--ly-b) - var(--above-dock) - 8px); }
  #crew:not(.open) .pn-sort, #crew:not(.open) .rows, #crew:not(.open) .th-menu, .ov, #crew:not(.full) .r3 { display: none; }
  body.tip-on:not(.sheet-full) #crew, body.sheet-full #tip { display: none !important; }
  .pn-h { position: relative; padding: 8px 6px 2px 12px; } .pn-h::before { content: ""; position: absolute; left: 50%; top: 4px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-2); }
  .pn-h h2 { font-size: 14px; white-space: nowrap; } .pn-h h2 small { font-size: 13px; } .cr-h { height: 40px; cursor: pointer; touch-action: none; gap: 10px; }
  .cr-spark { display: inline-flex; margin-left: auto; } .cr-spark .hc-spark { width: 64px; } .cr-chev { display: inline-flex; color: var(--mut); transform: rotate(180deg); transition: transform .15s; } #crew.open .cr-chev { transform: none; }
  .pn-sort { padding: 2px 12px; overflow-x: auto; } .pn-sort button { height: 40px; padding: 0 10px; font-size: 13px; }
  .r1 { min-height: 40px; grid-template-columns: 18px minmax(60px, 1fr) auto 48px 46px 52px 40px; } .nm { font-size: 14px; }
  #dock { left: 6px; right: 6px; max-width: none; height: var(--dock-h); padding: 6px 12px 4px 6px; display: grid; grid-template-columns: auto auto auto 1fr; grid-template-rows: 30px 14px; column-gap: 8px; row-gap: 0; align-items: center; }
  .dk-top { display: contents; } #dk-speed, .dk-run, .dk-top .seg, .dk-note { display: none; }
  #dk-play { width: 40px; height: 40px; grid-area: 1 / 1 / 3 / 2; } #dk-t { grid-area: 1 / 2 / 3 / 3; font-size: 15px; white-space: nowrap; } #dk-k { grid-area: 1 / 3 / 3 / 4; }
  .dk-track { grid-area: 1 / 4 / 2 / 5; height: 30px; min-width: 0; } .dk-track::before { top: 13px; } .dk-track::after { top: 8px; } #dk-s { height: 30px; }
  .dk-ticks { grid-area: 2 / 4 / 3 / 5; height: 14px; margin: 0 8px; pointer-events: none; } .dk-tick { font-size: 11px; line-height: 14px; padding: 0; } .dk-tick:nth-child(even) { display: none; }
  #tip { left: 6px !important; right: 6px; top: auto !important; bottom: var(--above-dock); width: auto; max-height: calc(100dvh - var(--ly-b) - var(--above-dock) - 8px); padding: 8px 10px 10px; gap: 6px; font-size: 13px; }
  #tip .tp-grid { grid-template-columns: repeat(4, 1fr); gap: 4px 6px; } .tp-src { display: none; }
  .tp-tls { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; scrollbar-width: thin; } .tp-t { flex: 0 0 calc(100% - 28px); scroll-snap-align: start; } .tp-t:nth-child(2) { order: -1; }
  #sheet { top: 56px; left: 50%; width: calc(100vw - 12px); max-height: calc(100dvh - 70px); } #sheet [data-x] { width: 40px; height: 40px; } .th-menu input { height: 32px; }
  .seg a, .seg button { height: 40px; }
}
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--subtle); border-radius: 8px; }
.seg button { height: 26px; min-width: 32px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; } .seg button[aria-pressed=true] { background: var(--sf-3); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.seg a { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 6px; color: var(--ink-2); font-size: 12px; text-decoration: none; white-space: nowrap; } .seg a[aria-pressed=true] { background: var(--sf-3); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
#tip .tp-grid b i { font-style: normal; font-weight: 400; color: var(--mut); }

/* info cards (info.js): "i" button, dotted-underline label, the one card; phone: the card is a sheet above the dock, 40 px hit areas */
.ii { position: relative; flex: none; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 4px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: var(--sf-3); color: var(--ink-2); font: italic 600 10px/1 Georgia, serif; vertical-align: 1px; cursor: help; }
.ii:hover, .ii[aria-expanded=true] { border-color: var(--teal); color: var(--teal-d); background: var(--teal-t); }
.il { position: relative; display: inline; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: inherit; text-decoration: underline dotted rgba(76, 95, 98, .55); text-underline-offset: 2px; cursor: help; }
.il:hover, .il[aria-expanded=true] { color: var(--teal-d); text-decoration-color: var(--teal); }
#icard { position: fixed; z-index: 50; width: 320px; max-width: calc(100vw - 16px); overflow-y: auto; padding: 12px 14px 14px; background: var(--surface); box-shadow: 0 8px 28px rgba(20, 38, 41, .2); border-radius: 12px; box-sizing: border-box; font-size: 12px; line-height: 1.45; } #icard[hidden] { display: none; }
#icard .ic-h { display: flex; align-items: center; gap: 8px; margin: -2px -6px 4px 0; } #icard .ic-h b { font-size: 14px; flex: 1; } .ic-u { padding: 1px 7px; border-radius: 9px; background: var(--subtle); color: var(--ink-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
#icard .ic-one { font-size: 13px; color: var(--ink); margin: 0 0 6px; } #icard h4 { margin: 10px 0 2px; font-size: 11px; font-weight: 600; color: var(--ink-2); } #icard p { margin: 0; color: var(--ink-2); }
#icard ul { margin: 0; padding-left: 16px; color: var(--ink-2); } #icard li + li { margin-top: 3px; } #icard a { color: var(--teal-d); } .ic-src small { display: block; }
.rh { display: grid; grid-template-columns: 16px minmax(84px, 1fr) auto 46px 42px 46px 24px; align-items: end; gap: 5px; padding: 0 12px 4px; border-bottom: 1px solid var(--line); } .rh small { font-size: 10.5px; white-space: nowrap; } .rh-h { grid-column: 4 / 6; text-align: right; } .rh-t { text-align: right; } .rh-st { display: flex; justify-content: center; } .rh-st .ii { margin: 0; }
.th-h { display: flex; align-items: center; } .th-dept { margin: 0; font-size: 12px; color: var(--ink-2); } .th-dept b { margin-right: 4px; color: var(--ink); }
.b-ct { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; } .b-cnt .warm b { color: var(--watch); }
.ly-lgrow { display: flex; align-items: flex-start; gap: 4px; } .ly-lgrow .ly-legend { flex: 1; min-width: 0; } .ly-lgrow > .ii { margin-top: 1px; } .ly-about { margin-top: -6px; }
.tp-t > span { display: block; } .hn ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; } .hn li { display: flex; flex-direction: column; font-size: 12px; } .hn .il { font-weight: 600; align-self: flex-start; }
@media (max-width: 820px) {
  .ii::after { content: ""; position: absolute; inset: -13px; } .il::after { content: ""; position: absolute; inset: -12px -3px; }
  .ly-lgrow > .ii { width: 20px; height: 20px; margin: 2px 6px 0; font-size: 12px; } #layers:not(.pop) .ly-about { display: none; } .rh { grid-template-columns: 18px minmax(60px, 1fr) auto 48px 46px 52px 40px; padding: 0 12px 4px; } #crew:not(.open) .rh { display: none; }
  #icard.sheet { left: 6px !important; right: 6px; top: auto !important; bottom: var(--above-dock); width: auto; max-width: none; max-height: calc(100dvh - 56px - var(--above-dock) - 8px) !important; font-size: 13px; }
  #icard.sheet .ic-h .hc-btn { width: 40px; height: 40px; }
}
.tp-note { font-size: 11px; color: var(--ink-2); }
.th-pr { display: flex; flex-direction: column; gap: 4px; } .th-pr .seg { align-self: flex-start; }
/* outline view toggle inside the phone tune popover (the rail is hidden on phones) */
.ly-ph { display: none; }
@media (max-width: 820px) { #layers.pop .ly-ph { display: flex; padding: 2px 8px 6px; } .rl-ph { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--sf-3); color: var(--ink-2); font-size: 13px; } .rl-ph.on { background: var(--teal-t); color: var(--teal-d); border-color: var(--teal); } }
/* smoke (round 6): chip under Wind, source list, popover (phone: a sheet above the dock) */
.sw { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px var(--sf-solid), 0 0 0 3px var(--line-2); }
.ly-sm.on { background: var(--teal-t); color: var(--teal-d); border-color: var(--teal); }
.ly-smoke:empty { display: none; } .ly-smoke { display: flex; flex-direction: column; gap: 4px; }
.sp-note { margin: 0; font-size: 11px; line-height: 1.4; color: var(--ink-2); }
#smpop { position: fixed; z-index: 45; width: 300px; max-width: calc(100vw - 16px); padding: 10px 12px 12px; background: var(--surface); box-shadow: 0 8px 28px rgba(20, 38, 41, .22); border-radius: 12px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
#smpop[hidden] { display: none; }
.sp-h { display: flex; align-items: center; gap: 8px; } .sp-h b { flex: 1; font-size: 14px; }
.sp-r { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 8px; } .sp-r small { color: var(--ink-2); } .sp-r b { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.sp-r .seg { grid-column: 2 / 4; flex-wrap: wrap; } .sp-f { display: flex; justify-content: flex-end; } .sp-f .hc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; }
@media (max-width: 820px) {
  #smpop.sheet { left: 6px !important; right: 6px; top: auto !important; bottom: var(--above-dock); width: auto; max-width: none; max-height: calc(100dvh - 120px - var(--above-dock)); overflow-y: auto; font-size: 13px; }
  .ly-smoke { padding: 4px 8px; } #layers:not(.pop) .ly-smoke .sp-note, #layers:not(.pop) .ly-smoke .sm-h { display: none; }
  #layers:not(.pop) .sm-list { flex-direction: row; flex-wrap: wrap; } #layers:not(.pop) .sm-list li > :not(.sm-n) { display: none; }
  .sm-n { height: 36px; } .sp-r input { height: 32px; }
}
/* base map switch (round 7): three radio buttons at the top of the rail, a hairline under them; phone: a segment in the tune popover */
.rl-base { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.ly-ph .seg { margin-right: 8px; } .ly-ph .seg button:disabled { opacity: .35; }
@media (max-width: 820px) { #layers.pop .ly-ph { flex-wrap: wrap; gap: 6px; align-items: center; } }
/* hover readouts (round 7): small, next to the cursor */
#heat-hover, #bhover { padding: 2px 6px; font-size: 11px; border-radius: 6px; box-shadow: 0 1px 4px rgba(20, 38, 41, .18); white-space: nowrap; }
/* person card (round 7): floating window, drag by the header, compact mode with four numbers */
#tip .tp-c { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { #tip .tp-c { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 821px) { #tip.compact { width: 264px; } }
#tip.compact .tp-h b { white-space: nowrap; }
/* smoke round 8: view modes, threshold, slice button, density key */
.sp-r select { grid-column: 2 / 3; height: 26px; font: inherit; }
/* smoke exposure badge and the slice panel (round 8) */
.smk { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding: 0 5px; height: 16px; border-radius: 8px; background: #ece9f3; color: #4a3f6b; font-size: 10.5px; font-weight: 600; vertical-align: middle; } .smk.now { background: #4a3f6b; color: #fff; }
#slice { position: fixed; z-index: 28; left: calc(var(--gap) + var(--pw-l) + var(--rail) + 20px); bottom: calc(var(--dock-h, 110px) + 24px); width: 470px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; } #slice[hidden] { display: none; }
.sl-h { display: flex; align-items: center; gap: 8px; } .sl-h b { font-size: 13px; } .sl-h small { flex: 1; color: var(--ink-2); }
@media (max-width: 820px) { #slice { left: 6px; right: 6px; width: auto; bottom: var(--above-dock); } }
@media (max-width: 820px) { #layers:not(.pop) .sm-modes, #layers:not(.pop) .sm-tools, #layers:not(.pop) .sm-key { display: none; } }
.r1 .st { display: inline-flex; align-items: center; gap: 3px; } .r1 .st .smk { margin-left: 0; }
.sp-warn { color: var(--watch); }
/* vertical section (round 11): larger, draggable by its header */
#slice { width: 588px; } #slice .sl-h { cursor: grab; user-select: none; } #slice.drag .sl-h { cursor: grabbing; }
.sl-key { display: grid; grid-template-columns: 120px 1fr; gap: 2px 10px; align-items: center; font-size: 10.5px; color: var(--ink-2); } .sl-key i { height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2); }
.sl-key span { display: inline-flex; align-items: center; gap: 4px; } .sl-key em { display: inline-block; width: 12px; height: 8px; border-radius: 2px; } .sl-key > div { display: flex; flex-wrap: wrap; gap: 2px 10px; }
@media (max-width: 820px) {
  #layers { background: var(--surface); padding: 3px; gap: 0; }
  #layers > .card { padding: 0; border: 0; border-radius: 0; gap: 0; background: none; } #layers > .card > h2 { display: none; } #layers > .card.ly-wx, #layers > .card.ly-slots { display: none; }
  #layers:not(.pop) .w-els, #layers:not(.pop) .rg-help, #layers:not(.pop) .ly-smoke .rg, #layers:not(.pop) .c-wind .ly-wind { display: none; }
  #layers.pop .w-els { padding: 2px 8px 6px; } .chip { height: 34px; }
  #slice { width: auto; }
}
/* round 12: Add source button and the placement hint */
#smhint { position: fixed; z-index: 30; top: 64px; left: 50%; transform: translateX(-50%); padding: 7px 14px; border-radius: 16px; background: #142629; color: #fff; font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow); pointer-events: none; } #smhint[hidden] { display: none; }
body.sm-adding #c canvas { cursor: crosshair !important; }
@media (max-width: 820px) { #smhint { top: auto; bottom: calc(var(--above-dock, 120px) + 10px); } .sm-add { height: 36px; } #layers:not(.pop) .ly-smoke .sm-add { display: inline-flex; } }
.smk.zero { background: var(--subtle); color: var(--mut); }
/* round 12: smoke exposure in the crew list and the person cards; the "Smoke" sort and header show only while a source exists */
#crew:not(.has-smoke) .so-smk, #crew:not(.has-smoke) .rh-sm { display: none; } .rh-st { display: inline-flex; align-items: flex-end; gap: 4px; } .rh-sm { font-size: 10.5px; }
.smk { min-width: 22px; justify-content: center; } .smk.now { background: #6b4a8f; }
.tp-smk { display: grid; grid-template-columns: auto 110px auto auto; align-items: center; gap: 6px; padding: 4px 0 2px; font-size: 12px; } .tp-smk > span { color: var(--ink-2); } .tp-smk b { font-size: 12px; } .tp-smk small { color: var(--mut); } .tp-smk svg { width: 110px; height: 18px; }
.smk-b span b { font-weight: 600; }
#top { overflow: hidden; }

