/* jafo wall — "grid" situation board. One unit (--u) scales the whole board:
   19.2px at 1920×1080, 38.4px at 3840×2160, 13.7px at 1366×768. */
:root {
  color-scheme: light;
  --u: min(1vw, 1.7778vh);
  --page: #eceff3;
  --tile: #ffffff;
  --tile-2: #f5f7fa;
  --ink: #14181f;
  --ink-2: #545c69;
  --ink-3: #8a919c;
  --hair: #e4e8ed;
  --base: #c4cad2;
  --ring: rgba(16, 24, 40, 0.07);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px -12px rgba(16, 24, 40, 0.10);
  --spark: #c9ced6;
  --flash: rgba(37, 125, 224, 0.10);
  --danger: #ec4647;
  --medical: #00b894;
  --general: #257de0;
  --neutral: #8a929e;
  /* unit status: one-hue ordinal (violet), validated --ordinal on #ffffff */
  --u-on_scene: #43299f;
  --u-en_route: #6a4ce2;
  --u-busy: #8b74ea;
  --u-available: #b3a6f3;
  --u-ink-on_scene: #ffffff; --u-ink-en_route: #ffffff; --u-ink-busy: #ffffff; --u-ink-available: #14181f;
  --warn-bg: #fff1ee;
  --warn-ink: #8f1d1e;
  --warn-edge: #dc3c3d;
  --ok-ink: #0d7a3a;
  --blur: rgba(20, 30, 50, 0.16);
  --map-filter: grayscale(1) brightness(1.05) contrast(0.86);
  --font: "Archivo", ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d1014; --tile: #171b21; --tile-2: #1d222a;
    --ink: #eef1f5; --ink-2: #a9b1bd; --ink-3: #737c89;
    --hair: #262c35; --base: #3a424d; --ring: rgba(255, 255, 255, 0.06);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    --spark: #3a414c; --flash: rgba(51, 140, 237, 0.16);
    --danger: #eb6263; --medical: #00a888; --general: #338ced; --neutral: #8a929e;
    --u-on_scene: #cbc2f8; --u-en_route: #a08ff0; --u-busy: #7a62e4; --u-available: #5a43c6;
    --u-ink-on_scene: #0b0b0b; --u-ink-en_route: #0b0b0b; --u-ink-busy: #ffffff; --u-ink-available: #ffffff;
    --warn-bg: #3a1517; --warn-ink: #ffd9d6; --warn-edge: #eb6263; --ok-ink: #53c556;
    --blur: rgba(255, 255, 255, 0.2);
    --map-filter: grayscale(1) invert(1) brightness(0.9) contrast(0.82);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1014; --tile: #171b21; --tile-2: #1d222a;
  --ink: #eef1f5; --ink-2: #a9b1bd; --ink-3: #737c89;
  --hair: #262c35; --base: #3a424d; --ring: rgba(255, 255, 255, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --spark: #3a414c; --flash: rgba(51, 140, 237, 0.16);
  --danger: #eb6263; --medical: #00a888; --general: #338ced; --neutral: #8a929e;
  --u-on_scene: #cbc2f8; --u-en_route: #a08ff0; --u-busy: #7a62e4; --u-available: #5a43c6;
  --u-ink-on_scene: #0b0b0b; --u-ink-en_route: #0b0b0b; --u-ink-busy: #ffffff; --u-ink-available: #ffffff;
  --warn-bg: #3a1517; --warn-ink: #ffd9d6; --warn-edge: #eb6263; --ok-ink: #53c556;
  --blur: rgba(255, 255, 255, 0.2);
  --map-filter: grayscale(1) invert(1) brightness(0.9) contrast(0.82);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--page); color: var(--ink);
  font-family: var(--font); font-size: calc(var(--u) * 1); line-height: 1.25;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  cursor: none;
}
svg { display: block; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ board */
.board {
  height: 100vh; width: 100vw;
  padding: calc(var(--u) * 0.95) calc(var(--u) * 1.25);
  display: flex; flex-direction: column; gap: calc(var(--u) * 0.75);
  animation: drift 900s ease-in-out infinite alternate;   /* burn-in care */
}
@keyframes drift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(3px, 2px); }
  50% { transform: translate(-2px, 4px); }
  75% { transform: translate(-4px, -1px); }
  100% { transform: translate(2px, -3px); }
}

/* ------------------------------------------------------------------ header */
.top { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--u) * 2); flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: calc(var(--u) * 0.8); min-width: 0; }
.mark {
  width: calc(var(--u) * 2.5); height: calc(var(--u) * 2.5); border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--tile); flex: none;
}
.mark svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mark circle { fill: currentColor; stroke: none; }
.brand-title {
  font-size: calc(var(--u) * 1.5); font-weight: 750; letter-spacing: -0.01em;
  font-variation-settings: "wdth" 112; line-height: 1.05;
}
.brand-region { font-size: calc(var(--u) * 0.98); color: var(--ink-2); font-weight: 500; margin-top: 2px; }
.demo-pill {
  margin-left: calc(var(--u) * 0.6); padding: calc(var(--u) * 0.25) calc(var(--u) * 0.7);
  border-radius: 999px; background: var(--ink); color: var(--tile);
  font-size: calc(var(--u) * 0.78); font-weight: 650; letter-spacing: 0.02em;
}
.top-right { display: flex; align-items: center; gap: calc(var(--u) * 1.6); }
.walls { display: flex; gap: calc(var(--u) * 0.2); opacity: 0.75; }
.walls a {
  color: var(--ink-3); text-decoration: none; font-size: calc(var(--u) * 0.72); font-weight: 550;
  padding: calc(var(--u) * 0.2) calc(var(--u) * 0.45); border-radius: 6px; text-transform: lowercase;
}
.walls a.on { color: var(--ink-2); background: var(--tile); box-shadow: inset 0 0 0 1px var(--hair); }
.lag { font-size: calc(var(--u) * 0.85); font-weight: 600; color: var(--ink-2); background: var(--tile); box-shadow: inset 0 0 0 1px var(--hair); border-radius: 999px; padding: calc(var(--u) * 0.2) calc(var(--u) * 0.7); white-space: nowrap; }
.fresh { display: flex; align-items: center; gap: calc(var(--u) * 0.45); color: var(--ink-2); font-size: calc(var(--u) * 0.95); font-weight: 500; font-variant-numeric: tabular-nums; }
.fresh-dot { width: calc(var(--u) * 0.55); height: calc(var(--u) * 0.55); border-radius: 50%; background: var(--ok-ink); box-shadow: 0 0 0 calc(var(--u) * 0.18) color-mix(in srgb, var(--ok-ink) 18%, transparent); }
.fresh.stale .fresh-dot { background: var(--ink-3); box-shadow: none; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.clock-time { font-size: calc(var(--u) * 2.2); font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clock-date { font-size: calc(var(--u) * 0.95); color: var(--ink-2); margin-top: calc(var(--u) * 0.2); font-weight: 500; }

/* ------------------------------------------------------------------ warning banner */
.banner {
  flex: 0 0 auto; display: flex; align-items: center; gap: calc(var(--u) * 1);
  background: var(--warn-bg); color: var(--warn-ink);
  border-radius: calc(var(--u) * 0.8); padding: calc(var(--u) * 0.7) calc(var(--u) * 1.2);
  box-shadow: inset calc(var(--u) * 0.35) 0 0 var(--warn-edge);
}
.banner-ico { width: calc(var(--u) * 2.4); height: calc(var(--u) * 2.4); flex: none; color: var(--warn-edge); }
.banner-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.banner-body { min-width: 0; flex: 1; }
.banner-event { font-size: calc(var(--u) * 1.7); font-weight: 750; font-variation-settings: "wdth" 108; }
.banner-headline { font-size: calc(var(--u) * 1.0); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-more { font-size: calc(var(--u) * 0.95); font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------------------------ grid */
.grid {
  flex: 1 1 auto; min-height: 0;
  display: grid; gap: calc(var(--u) * 0.85);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1.08fr) minmax(0, 1fr) minmax(0, 0.5fr);
  grid-template-areas:
    "now now now now now kind kind kind kind kind kind kind"
    "list list list list list map map map flow flow flow flow"
    "vol vol vol vol vol vol vol vol vol vol vol vol";
}
.tile {
  background: var(--tile); border-radius: calc(var(--u) * 0.9);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--ring);
  padding: calc(var(--u) * 1.05) calc(var(--u) * 1.2);
  min-width: 0; min-height: 0; position: relative; overflow: hidden;
  transition: box-shadow 1.2s ease;
}
.tile::after {   /* change highlight: a brief wash that settles */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--flash); opacity: 0; transition: opacity 2.2s ease;
}
.tile.flash::after { opacity: 1; transition: opacity 0.25s ease; }
.tile.spot { box-shadow: var(--shadow), inset 0 0 0 2px color-mix(in srgb, var(--ink) 9%, transparent); }

.eyebrow {
  font-size: calc(var(--u) * 0.95); font-weight: 650; color: var(--ink-2);
  letter-spacing: 0.06em; text-transform: uppercase; font-variation-settings: "wdth" 108;
}
.tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: calc(var(--u) * 1); }
.tile-note { font-size: calc(var(--u) * 0.95); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.now { grid-area: now; display: flex; flex-direction: column; }
.kinds { grid-area: kind; }
.top-active { grid-area: list; display: flex; flex-direction: column; }
.map-tile { grid-area: map; padding: 0; }
.flow { grid-area: flow; display: flex; flex-direction: column; }
.volume { grid-area: vol; display: flex; flex-direction: column; padding-bottom: calc(var(--u) * 0.6); }

/* ------------------------------------------------------------------ right now */
.now-main { margin-top: calc(var(--u) * 0.2); min-height: calc(var(--u) * 5.6); display: flex; align-items: center; }
.now-figure { display: flex; align-items: baseline; gap: calc(var(--u) * 0.8); }
.now-num { font-size: calc(var(--u) * 5.8); font-weight: 680; letter-spacing: -0.04em; line-height: 0.95; }
.now-unit { font-size: calc(var(--u) * 1.75); font-weight: 600; color: var(--ink-2); letter-spacing: -0.01em; }
.now-quiet { display: flex; align-items: center; gap: calc(var(--u) * 1); }
.quiet-ico {
  width: calc(var(--u) * 5); height: calc(var(--u) * 5); border-radius: 50%; flex: none;
  display: grid; place-items: center; background: color-mix(in srgb, var(--ok-ink) 12%, var(--tile)); color: var(--ok-ink);
  animation: breathe 6s ease-in-out infinite;
}
.quiet-ico svg { width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.quiet-text { font-size: calc(var(--u) * 3.6); font-weight: 700; letter-spacing: -0.03em; line-height: 1; display: flex; flex-direction: column; }
.quiet-sub { font-size: calc(var(--u) * 1.5); font-weight: 550; color: var(--ink-2); letter-spacing: -0.01em; margin-top: calc(var(--u) * 0.35); }
.now-sentence {
  margin: calc(var(--u) * 0.5) 0 calc(var(--u) * 0.6); font-size: calc(var(--u) * 1.3); line-height: 1.3; font-weight: 500;
  color: var(--ink); max-width: 34em; text-wrap: pretty; flex: 1 1 auto; min-height: 0;
}
.now-sentence b { font-weight: 680; }
.now-facts { display: flex; gap: calc(var(--u) * 2.2); border-top: 1px solid var(--hair); padding-top: calc(var(--u) * 0.75); }
.fact { display: flex; flex-direction: column; }
.fact-num { font-size: calc(var(--u) * 2.0); font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
.fact-label { font-size: calc(var(--u) * 0.95); color: var(--ink-2); margin-top: calc(var(--u) * 0.25); }
.now-last {
  margin-top: calc(var(--u) * 0.6); font-size: calc(var(--u) * 0.95); color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-last b { color: var(--ink-2); font-weight: 600; }

/* ------------------------------------------------------------------ kind tiles */
.kinds { display: grid; gap: calc(var(--u) * 0.85); grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.kt { display: flex; flex-direction: column; padding: calc(var(--u) * 0.95) calc(var(--u) * 1.05); }
.kt-head { display: flex; align-items: center; gap: calc(var(--u) * 0.6); min-width: 0; }
.kico {
  width: calc(var(--u) * 2); height: calc(var(--u) * 2); border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; background: var(--kc);
}
.kico svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kico.k-other svg circle { fill: currentColor; }
.k-violence, .k-fire { --kc: var(--danger); }
.k-medical { --kc: var(--medical); }
.k-traffic, .k-property, .k-suspicious { --kc: var(--general); }
.k-other { --kc: var(--neutral); }
.kt-label {
  font-size: calc(var(--u) * 0.98); font-weight: 600; line-height: 1.1; color: var(--ink);
  font-variation-settings: "wdth" 90; min-width: 0;
}
.kt-body { flex: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: calc(var(--u) * 0.6); min-height: 0; }
.kt-count { display: flex; flex-direction: column; line-height: 1; }
.kt-num { font-size: calc(var(--u) * 3.7); font-weight: 680; letter-spacing: -0.035em; line-height: 0.9; }
.kt.zero .kt-num { color: var(--ink-3); font-weight: 560; }
.kt-sub { font-size: calc(var(--u) * 0.95); color: var(--ink-2); margin-top: calc(var(--u) * 0.3); }
.kt-spark { flex: 0 1 58%; display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.kt-day { font-size: calc(var(--u) * 0.95); color: var(--ink-2); text-align: right; margin-bottom: calc(var(--u) * 0.3); white-space: nowrap; }
.kt-day b { color: var(--ink); font-weight: 680; font-size: 1.15em; }
.kt-spark svg { width: 100%; height: calc(var(--u) * 2.4); overflow: visible; }
.kt-now { display: flex; justify-content: space-between; font-size: calc(var(--u) * 0.72); color: var(--ink-3); margin-top: calc(var(--u) * 0.2); }

/* weather tile (8th) */
.wx { padding: calc(var(--u) * 0.95) calc(var(--u) * 1.05); display: flex; flex-direction: column; }
.wx-main { display: flex; align-items: flex-end; justify-content: space-between; gap: calc(var(--u) * 0.6); flex: 1; min-height: 0; }
.wx-temp { font-size: calc(var(--u) * 3.4); font-weight: 680; letter-spacing: -0.035em; line-height: 0.9; }
.wx-side { display: flex; flex-direction: column; align-items: flex-end; gap: calc(var(--u) * 0.1); font-size: calc(var(--u) * 0.9); padding-bottom: 2px; color: var(--ink-2); text-align: right; white-space: nowrap; min-width: 0; }
.wx-side b { color: var(--ink); font-weight: 650; }
.wx-ico { width: calc(var(--u) * 2); height: calc(var(--u) * 2); border-radius: 50%; display: grid; place-items: center; background: var(--tile-2); color: var(--ink-2); flex: none; box-shadow: inset 0 0 0 1px var(--hair); }
.wx-ico svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wx.alerting { box-shadow: var(--shadow), inset 0 0 0 2px var(--warn-edge); }
.wx.alerting .wx-ico { background: var(--warn-bg); color: var(--warn-edge); }
.wx-alert { font-size: calc(var(--u) * 0.85); font-weight: 650; color: var(--warn-ink); background: var(--warn-bg); border-radius: 6px; padding: 1px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ------------------------------------------------------------------ top active list */
.rows { list-style: none; margin: calc(var(--u) * 0.45) 0 0; padding: 0; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: calc(var(--u) * 0.85); padding: calc(var(--u) * 0.42) 0; border-top: 1px solid var(--hair);
  position: relative;
}
.row:first-child { border-top: 0; }
.row .kico { width: calc(var(--u) * 2.1); height: calc(var(--u) * 2.1); }
.row-main { min-width: 0; }
.row-title { font-size: calc(var(--u) * 1.15); font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.005em; }
.row-meta { font-size: calc(var(--u) * 0.95); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row-sep { font-size: calc(var(--u) * 0.85); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding: calc(var(--u) * 0.55) 0 calc(var(--u) * 0.1); border-top: 1px solid var(--hair); font-variation-settings: "wdth" 108; }
.row-sep + .row { border-top: 0; }
.row-meta .sep { color: var(--ink-3); padding: 0 0.35em; }
.row-right { display: flex; flex-direction: column; align-items: flex-end; gap: calc(var(--u) * 0.25); }
.row-age { font-size: calc(var(--u) * 0.95); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.fresh-row::before { content: ""; position: absolute; inset: 0 calc(var(--u) * -1.2); background: var(--flash); animation: rowfade 4s ease forwards; pointer-events: none; }
@keyframes rowfade { from { opacity: 1; } to { opacity: 0; } }
.row.dim .row-title { color: var(--ink-2); font-weight: 560; }
.row.dim .kico { opacity: 0.55; }
.hi-pill { display: inline-block; font-size: 0.82em; font-weight: 700; color: var(--ink); background: var(--tile-2); box-shadow: inset 0 0 0 1px var(--hair); border-radius: 5px; padding: 0 0.4em; margin-right: 0.4em; vertical-align: 1px; }
.empty-list { flex: 1; display: grid; place-items: center; color: var(--ink-3); font-size: calc(var(--u) * 1.1); text-align: center; }

/* status chip: icon shape + label, never color alone */
.chip {
  display: inline-flex; align-items: center; gap: calc(var(--u) * 0.35);
  font-size: calc(var(--u) * 0.88); font-weight: 650; white-space: nowrap;
  padding: calc(var(--u) * 0.18) calc(var(--u) * 0.55) calc(var(--u) * 0.18) calc(var(--u) * 0.4);
  border-radius: 999px; background: var(--tile-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair);
}
.chip svg { width: calc(var(--u) * 0.95); height: calc(var(--u) * 0.95); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chip.s-new { background: var(--ink); color: var(--tile); box-shadow: none; }
.chip.s-on_scene { background: color-mix(in srgb, var(--u-on_scene) 14%, var(--tile)); }
.chip.s-quiet, .chip.s-cleared, .chip.s-ended { color: var(--ink-2); background: transparent; }

.redacted { display: inline-block; background: var(--blur); color: transparent; border-radius: 4px; filter: blur(1.5px); padding: 0 2px; min-width: 2.6em; line-height: 1.1; }

/* ------------------------------------------------------------------ map */
#map { position: absolute; inset: 0; background: var(--tile-2); }
.leaflet-container { background: var(--tile-2); font-family: var(--font); }
.leaflet-tile-pane { filter: var(--map-filter); opacity: 0.9; }
.leaflet-control-attribution { font-size: 9px !important; background: color-mix(in srgb, var(--tile) 70%, transparent) !important; color: var(--ink-3) !important; }
.leaflet-control-attribution a { color: var(--ink-3) !important; }
.map-cap {
  position: absolute; left: calc(var(--u) * 0.8); top: calc(var(--u) * 0.8); z-index: 500;
  background: color-mix(in srgb, var(--tile) 92%, transparent); border-radius: calc(var(--u) * 0.6);
  padding: calc(var(--u) * 0.45) calc(var(--u) * 0.75); box-shadow: var(--shadow), inset 0 0 0 1px var(--ring);
  max-width: calc(100% - var(--u) * 1.6);
}
.map-note { font-size: calc(var(--u) * 0.9); color: var(--ink-2); margin-top: 2px; }
.pin {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: var(--kc); color: #fff; box-shadow: 0 0 0 2px var(--tile), 0 2px 6px rgba(0, 0, 0, 0.25);
}
.pin svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pin.past { background: var(--ink-3); opacity: 0.55; box-shadow: 0 0 0 2px var(--tile); }
.pin.pulse::after { content: ""; position: absolute; inset: -40%; border-radius: 50%; box-shadow: 0 0 0 2px var(--kc); animation: ping 3s ease-out infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 0.8; } to { transform: scale(1.4); opacity: 0; } }

/* ------------------------------------------------------------------ pipeline */
.pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: calc(var(--u) * 0.45); }
.stage { display: flex; flex-direction: column; align-items: flex-start; position: relative; min-width: 0; padding-right: calc(var(--u) * 1.2); }
.stage:not(:last-child)::after {   /* flow direction */
  content: ""; position: absolute; right: calc(var(--u) * 0.55); top: calc(var(--u) * 1.2);
  width: calc(var(--u) * 0.5); height: calc(var(--u) * 0.5);
  border-top: 2px solid var(--base); border-right: 2px solid var(--base); transform: rotate(45deg);
}
.stage-num { font-size: calc(var(--u) * 2.85); font-weight: 680; letter-spacing: -0.035em; line-height: 1; }
.stage.zero .stage-num { color: var(--ink-3); font-weight: 560; }
.stage.s-cleared .stage-num { color: var(--ink-2); }
.stage-top { display: flex; align-items: center; gap: calc(var(--u) * 0.4); }
.stage-label { font-size: calc(var(--u) * 0.95); color: var(--ink-2); margin-top: calc(var(--u) * 0.3); white-space: nowrap; }
.stage-ico {
  width: calc(var(--u) * 1.25); height: calc(var(--u) * 1.25); border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--tile-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair);
}
.stage-ico svg { width: 66%; height: 66%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.stage.s-new .stage-ico { background: var(--ink); color: var(--tile); box-shadow: none; }

/* ------------------------------------------------------------------ units */
.units-block { margin-top: auto; padding-top: calc(var(--u) * 0.6); border-top: 1px solid var(--hair); }
.units { display: flex; flex-direction: column; gap: calc(var(--u) * 0.4); margin-top: calc(var(--u) * 0.45); }
.urow { display: grid; grid-template-columns: calc(var(--u) * 4.2) minmax(0, 1fr) calc(var(--u) * 3.6); align-items: center; gap: calc(var(--u) * 0.7); }
.urow-name { font-size: calc(var(--u) * 1.0); font-weight: 620; }
.urow-total { font-size: calc(var(--u) * 0.95); color: var(--ink-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.urow-total b { color: var(--ink); font-size: 1.25em; font-weight: 680; }
.ubar { display: flex; gap: 2px; height: calc(var(--u) * 1.3); }
.ubar.big { height: calc(var(--u) * 1.46); }
.useg {
  border-radius: 4px; min-width: 0; display: flex; align-items: center; padding-left: calc(var(--u) * 0.35);
  font-size: calc(var(--u) * 0.85); font-weight: 680; overflow: visible; white-space: nowrap;
  transition: flex-grow 1s cubic-bezier(.2, .7, .2, 1);
}
.useg.track { background: var(--tile-2); box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink-3); font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.3) calc(var(--u) * 1.0); margin-top: calc(var(--u) * 0.5); }
.lg { display: inline-flex; align-items: center; gap: calc(var(--u) * 0.35); font-size: calc(var(--u) * 0.85); color: var(--ink-2); white-space: nowrap; }
.sw { width: calc(var(--u) * 0.75); height: calc(var(--u) * 0.75); border-radius: 3px; flex: none; }

/* ------------------------------------------------------------------ volume */
.vol-chart { flex: 1; min-height: 0; position: relative; margin-top: calc(var(--u) * 0.3); }
.vol-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.vol-chart text { font-family: var(--font); }
.ax { fill: var(--ink-3); }
.ax-strong { fill: var(--ink-2); font-weight: 650; }

.board.warn .now-last { display: none; }
.board.warn .now-sentence { font-size: calc(var(--u) * 1.2); }

/* ------------------------------------------------------------------ connection */
.conn {
  position: fixed; right: calc(var(--u) * 1.2); bottom: calc(var(--u) * 1.0); z-index: 1000;
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--tile); color: var(--ink-2); box-shadow: var(--shadow), inset 0 0 0 1px var(--ring);
  font-size: calc(var(--u) * 0.85); font-weight: 600;
}
.conn-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink-3); border-top-color: transparent; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .board, .quiet-ico, .pin.pulse::after, .conn-dot { animation: none; }
}

/* Sensitive tag (wall opened with ?sensitive=show) */
.sens-tag { display: inline-block; vertical-align: 0.18em; font: 700 clamp(11px, 0.42em, 22px)/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .08em; text-transform: uppercase; color: #c26a00; border: 1.5px solid currentColor;
  border-radius: 0.5em; padding: 0.32em 0.6em; margin-right: 0.45em; white-space: nowrap; }

/* JAFO helicopter brand mark */
.heli-mark { height: calc(var(--u) * 2.9); width: auto; flex: none; filter: drop-shadow(0 4px 6px rgba(10,20,60,.25)); animation: heli-bob 6s ease-in-out infinite; }
@keyframes heli-bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) { .heli-mark { animation: none; } }
