/* Visual system for the Data Hall Simulator. Tokens follow the project style guide.
   These tokens are the single source: scripts/check-contrast.mjs reads this file for both themes.
   Rule: grey is normal. Colour appears only on abnormal or attention state, and every status also carries a shape and a word. */
@font-face { font-family: "Geist"; src: url("/fonts/geist-latin-variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono-latin-variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* surfaces: warm neutrals from the brick palette */
  --bg: #efe9e5; --panel: #ffffff; --zone-grey: #f6f1ee; --eq: #f6f1ee; --zone-rule: #4a3d38;
  /* ink and lines */
  --ink: #1e1512; --body: #4a3d38; --muted: #675953; --line: #e8dfda; --line-strong: #8a7b74; --flow: #675953;
  /* brand and focus */
  --brand: #8c3324; --on-brand: #ffffff; --highlight: #f3ddd5; --focus: #8c3324;
  /* status: text and fill pairs from the style guide; never shown by colour alone */
  --ok: #1e6b45; --ok-bg: #e3f1e8; --warn: #7a5300; --warn-bg: #fbefd2; --alarm: #a3161a; --alarm-bg: #fbe0df; --info: #2a4f86; --info-bg: #e2eaf6; --stale: #5b5e66; --stale-bg: #ecedef;
  /* chart bands */
  --band-ok: #e3f1e8; --band-warn: #fbefd2; --band-alarm: #fbe0df;
  /* Hall floor plan: load steps (colour-blind safe, blue to orange), tile edge, and their text */
  --fill-1: #dbe9f6; --fill-2: #9fc6e6; --fill-3: #f3efe6; --fill-4: #f9cf9b; --fill-5: #f0a05a; --fill-6: #d9641a;
  --fill-ink: #0d131b; --fill-6-ink: #0d131b; --tile-edge: #2d3644;
  /* scale */
  --r: 16px; --r-card: 24px; --gap: 16px; --gutter: 16px;
  --fs-0: 12px; --fs-1: 13px; --fs-2: 15px; --fs-3: 17px; --fs-4: 22px; --fs-5: 40px; --fs-6: 56px;
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1412; --panel: #241c19; --zone-grey: #2c2320; --eq: #2c2320; --zone-rule: #a89890;
    --ink: #f3ece8; --body: #dcd0ca; --muted: #c2b3ac; --line: #3a2e29; --line-strong: #8f7f78; --flow: #b5a59e;
    --brand: #e0a193; --on-brand: #1a1412; --highlight: #3d2a25; --focus: #e0a193;
    --ok: #7fd3a6; --ok-bg: #1b3327; --warn: #f2c77a; --warn-bg: #3a2e14; --alarm: #ff9a92; --alarm-bg: #3d1c1a; --info: #a9c4f2; --info-bg: #1d2a40; --stale: #c4c8cf; --stale-bg: #2a2d33;
    --band-ok: #1b3327; --band-warn: #3a2e14; --band-alarm: #3d1c1a;
    --fill-1: #1e3550; --fill-2: #2c5a86; --fill-3: #3b3a33; --fill-4: #7a4f1f; --fill-5: #9b5f23; --fill-6: #d07a2c;
    --fill-ink: #eef3f9; --fill-6-ink: #0d131b; --tile-edge: #c4cedb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1412; --panel: #241c19; --zone-grey: #2c2320; --eq: #2c2320; --zone-rule: #a89890;
  --ink: #f3ece8; --body: #dcd0ca; --muted: #c2b3ac; --line: #3a2e29; --line-strong: #8f7f78; --flow: #b5a59e;
  --brand: #e0a193; --on-brand: #1a1412; --highlight: #3d2a25; --focus: #e0a193;
  --ok: #7fd3a6; --ok-bg: #1b3327; --warn: #f2c77a; --warn-bg: #3a2e14; --alarm: #ff9a92; --alarm-bg: #3d1c1a; --info: #a9c4f2; --info-bg: #1d2a40; --stale: #c4c8cf; --stale-bg: #2a2d33;
  --band-ok: #1b3327; --band-warn: #3a2e14; --band-alarm: #3d1c1a;
  --fill-1: #1e3550; --fill-2: #2c5a86; --fill-3: #3b3a33; --fill-4: #7a4f1f; --fill-5: #9b5f23; --fill-6: #d07a2c;
  --fill-ink: #eef3f9; --fill-6-ink: #0d131b; --tile-edge: #c4cedb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-2)/1.55 var(--font-sans); min-height: 100vh; }
a { color: var(--info); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--panel); padding: 8px 12px; border-radius: var(--r); z-index: 9; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); margin: 0; font-size: var(--fs-2); }
.note { color: var(--muted); font-size: var(--fs-1); margin: 6px 0 0; }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.brand { font-weight: 600; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.error { padding: 12px 16px; border-radius: var(--r); background: var(--alarm-bg); color: var(--alarm); font-weight: 600; margin-bottom: var(--gap); }
h1 { font-size: 40px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
h2 { font-size: var(--fs-4); font-weight: 500; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 12px; }
h3 { font-size: var(--fs-2); font-weight: 600; margin: 0; }

/* ---------- buttons, pills, status ---------- */
.btn { font: inherit; font-weight: 500; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover:not([disabled]) { filter: brightness(1.06); }
.btn-quiet { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover:not([disabled]) { background: var(--zone-grey); filter: none; }
.btn[disabled] { background: var(--panel); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.btn-small { min-height: 44px; padding: 0 14px; font-size: var(--fs-1); }
.pill { display: inline-flex; gap: 6px; align-items: center; min-height: 28px; border-radius: 999px; padding: 2px 12px; font-size: var(--fs-1); color: var(--body); background: var(--panel); border: 1px solid var(--line-strong); white-space: nowrap; }
.pill-hall, .pill-demo { background: var(--zone-grey); }
.pill-demo { background: var(--info-bg); color: var(--info); border-color: transparent; }
.pill-status { border: 0; font-weight: 600; }
.pill-status[data-level="normal"] { background: var(--ok-bg); color: var(--ok); }
.pill-status[data-level="atrisk"], .pill-status[data-level="warning"] { background: var(--warn-bg); color: var(--warn); }
.pill-status[data-level="critical"] { background: var(--alarm-bg); color: var(--alarm); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-2); white-space: nowrap; }
.status .i { font-weight: 700; }
.s-ok { color: var(--ok); }
.s-warn { color: var(--warn); }
.s-alarm { color: var(--alarm); }
.s-off { color: var(--stale); }
.tag { font-size: var(--fs-0); border: 1px solid var(--line-strong); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* ---------- shell: sidebar card, page meta, main column ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--gap); padding: var(--gutter); align-items: start; flex: 1; }
.sidebar { position: sticky; top: var(--gutter); display: grid; gap: 20px; align-content: start; min-height: calc(100vh - 32px); padding: 24px 16px; background: var(--panel); border-radius: var(--r-card); }
.brand-row { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brand-mark { position: relative; width: 36px; height: 36px; border-radius: 10px; background: var(--brand); flex: 0 0 auto; }
.brand-mark::after { content: ""; position: absolute; right: 8px; bottom: 8px; width: 7px; height: 7px; border-radius: 50%; background: #e9b04e; }
.brand-sub { display: block; color: var(--muted); font-size: var(--fs-1); line-height: 1.3; }
.rail { display: grid; gap: 4px; }
.rail a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: var(--fs-2); font-weight: 500; }
.rail a:hover { background: var(--zone-grey); }
.rail a[aria-current="page"] { background: var(--zone-grey); }
.rail a[aria-current="page"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.rail-secondary { border-top: 1px solid var(--line); padding-top: 16px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.sidebar-footer .role-label { color: var(--muted); font-size: var(--fs-1); margin: 0; }
.sidebar-footer #acct-role { font-weight: 600; font-size: var(--fs-2); }
.sidebar-footer form { display: grid; gap: 8px; margin-top: 4px; }
.sidebar-footer select { max-width: none; }
.role-options { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 6px; }
.role-options legend { padding: 0; margin-bottom: 4px; font-size: var(--fs-1); color: var(--muted); }
.role-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); color: var(--ink); font-size: var(--fs-1); line-height: 1.3; cursor: pointer; }
.role-choice input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.role-choice:has(input:checked) { border-color: var(--ink); font-weight: 600; }
.role-choice:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
.content { display: grid; gap: var(--gap); min-width: 0; align-content: start; }
.page-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-meta .pill { font-family: var(--font-mono); font-size: var(--fs-0); }

/* ---------- panes and cards ---------- */
.pane { background: var(--panel); border-radius: var(--r-card); padding: 24px; min-width: 0; display: grid; gap: 12px; align-content: start; }
.pane > h2 { margin: 0; }
.stack { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap); }
.situation { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
.runway-side { display: grid; gap: var(--gap); align-content: stretch; min-width: 0; }
.page { display: grid; gap: var(--gap); }
.page-head { display: grid; gap: 8px; }
.page-head h1 { margin: 0; }
.card, .panel { border-radius: var(--r-card); background: var(--panel); padding: 24px; margin: 0; }
.card { border: 0; min-width: 0; }
.panel { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.card .detail { color: var(--muted); font-size: var(--fs-2); margin: 4px 0 0; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); margin-top: 12px; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }

/* Overview: one composed grid, read top to bottom */
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.overview-grid > .wide { grid-column: 1 / -1; }
.overview-grid > .span-2 { grid-column: span 2; }

/* Runway: the hero reads the cooling runway; the side tiles read chilled water and battery */
.state { border-radius: var(--r-card); padding: 28px; display: grid; gap: 12px; align-content: start; background: var(--ok-bg); border: 0; }
.state .hero-label { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; color: var(--ok); font-size: var(--fs-2); }
.state .hero-word { font-size: var(--fs-6); font-weight: 600; letter-spacing: -.05em; line-height: 1; margin: 8px 0 0; color: var(--ok); font-variant-numeric: tabular-nums; }
.state .hero-sub { font-size: var(--fs-3); margin: 0; color: var(--ink); }
.state .msg { margin: 0; color: var(--body); max-width: 60ch; }
.state .next { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.state.atrisk, .state.warning { background: var(--warn-bg); }
.state.atrisk .hero-label, .state.atrisk .hero-word, .state.warning .hero-label, .state.warning .hero-word { color: var(--warn); }
.state.critical { background: var(--alarm-bg); }
.state.critical .hero-label, .state.critical .hero-word { color: var(--alarm); }
.state.stale { background: var(--stale-bg); }
.state.stale .hero-label, .state.stale .hero-word { color: var(--stale); }
.tile { background: var(--panel); border-radius: var(--r-card); padding: 24px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.tile .lbl { color: var(--muted); font-size: var(--fs-1); }
.tile .big { font-size: var(--fs-5); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--muted); font-size: var(--fs-2); }
.tile.warn .big { color: var(--warn); }
.tile.bad .big { color: var(--alarm); }
.meter { height: 10px; border-radius: 999px; background: var(--line); margin-top: 10px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--flow); border-radius: 999px; }
.tile.warn .meter > i { background: var(--warn); }
.tile.bad .meter > i { background: var(--alarm); }

/* ---------- forms, tables, dialog ---------- */
.field { display: grid; gap: 6px; margin-top: 10px; }
label { font-weight: 500; font-size: var(--fs-2); }
input[type="number"], input[type="text"], select, textarea { font: inherit; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); color: var(--ink); width: 100%; max-width: 320px; }
textarea { max-width: none; min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-2); margin-top: 8px; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: var(--fs-2); }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.crumbs { font-size: var(--fs-2); color: var(--muted); margin: 6px 0; }
.catalog-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.catalog-filter a, .chip-link { padding: 6px 14px; min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: var(--fs-1); background: var(--panel); }
.catalog-filter a[aria-current="true"], .chip-link[aria-current="true"] { border-color: var(--ink); font-weight: 600; }

dialog { border: 0; border-radius: var(--r-card); max-width: 560px; width: calc(100% - 32px); padding: 24px; background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(30, 21, 18, 0.35); }
.dlg-warn { margin-top: 8px; font-size: var(--fs-2); color: var(--warn); }
.dlg-warn:empty { display: none; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.result { font-size: var(--fs-2); color: var(--alarm); min-height: 1em; }
.dlg-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.dlg-head h2 { margin: 0; font-size: var(--fs-4); }
#dlg-preview h3 { margin: 12px 0 6px; font-size: var(--fs-1); color: var(--muted); font-weight: 600; }
.tier-tag { font-size: var(--fs-0); font-weight: 600; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 10px; color: var(--muted); white-space: nowrap; }
.tier-tag.confirm { border-color: var(--warn); color: var(--warn); }
.tier-tag.typed { border-color: var(--alarm); color: var(--alarm); }
.tier { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.tier:first-child { border-top: 0; }
.tier .name { font-weight: 600; }
.tier .why { color: var(--muted); font-size: var(--fs-1); }

.toast { position: fixed; right: 16px; bottom: 16px; z-index: 8; background: var(--ink); color: var(--panel); border-radius: var(--r); padding: 12px 14px; display: flex; gap: 12px; align-items: center; max-width: min(460px, calc(100% - 32px)); }
.toast[hidden] { display: none; }
.toast .btn { background: var(--panel); color: var(--ink); border-color: var(--panel); }
.toast a { color: var(--panel); font-weight: 600; }
.toast.error { background: var(--alarm-bg); color: var(--ink); border: 2px solid var(--alarm); }
.toast.error a { color: var(--info); }
.sp-form .sp-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-form input[type="number"] { width: 140px; }

/* ---------- charts, bullets, chain diagram ---------- */
.diagram svg, .chart svg, .bullets svg, .tlstrip svg { display: block; width: 100%; height: auto; }
.diagram svg text, .chart svg text, .bullets svg text, .tlstrip svg text { font-family: var(--font-sans); fill: var(--ink); }
svg .t-muted { fill: var(--muted); }
svg .zone-grey { fill: var(--zone-grey); }
svg .zone-white { fill: var(--panel); stroke: var(--line-strong); stroke-dasharray: 6 5; }
svg .eq { fill: var(--eq); stroke: var(--line-strong); stroke-width: 1.4; }
svg .eq.warn { stroke: var(--warn); stroke-width: 2.2; fill: var(--warn-bg); }
svg .eq.bad { stroke: var(--alarm); stroke-width: 2.6; fill: var(--alarm-bg); }
svg .flow { stroke: var(--flow); fill: none; stroke-linecap: round; }
svg .flow.off { stroke-dasharray: 5 5; opacity: .7; }
svg .flow.bad { stroke: var(--alarm); }
svg .flow.water { stroke: var(--info); }
svg .fill-water { fill: var(--info); opacity: .55; }
svg .track { fill: var(--line); }
svg .bar-ok { fill: var(--flow); }
svg .bar-bad { fill: var(--alarm); }
svg .mark { stroke: var(--ink); stroke-width: 2.5; }
svg .band-ok { fill: var(--band-ok); }
svg .band-warn { fill: var(--band-warn); }
svg .band-alarm { fill: var(--band-alarm); }
svg .series { fill: none; stroke: var(--ink); stroke-width: 2.6; }
svg .series-2 { fill: none; stroke: var(--flow); stroke-width: 2; stroke-dasharray: 5 4; }
svg .proj { fill: none; stroke: var(--alarm); stroke-width: 2.2; stroke-dasharray: 6 5; }
svg .proj.warn { stroke: var(--warn); }
svg .gridline { stroke: var(--line); }
svg .evline { stroke: var(--line-strong); stroke-dasharray: 3 4; }
svg .dot { fill: var(--ink); stroke: var(--panel); stroke-width: 2; }
svg .t-ok { fill: var(--ok); } svg .t-warn { fill: var(--warn); } svg .t-alarm { fill: var(--alarm); } svg .t-info { fill: var(--info); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-1); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px; border: 1px solid var(--line-strong); background: var(--eq); }
.legend .w::before { background: var(--warn-bg); border-color: var(--warn); }
.legend .a::before { background: var(--alarm-bg); border-color: var(--alarm); }
.bullet-row { margin: 6px 0 12px; }
.bullet-row .head { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-1); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip { display: inline-flex; min-height: 28px; align-items: center; gap: 6px; padding: 2px 12px; border-radius: 999px; font-size: var(--fs-1); background: var(--zone-grey); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--alarm-bg); color: var(--alarm); }
.grey-chip { background: var(--zone-grey); }
.big-status { font-size: var(--fs-4); font-weight: 500; line-height: 1.2; }
.big-status .status { font-size: var(--fs-4); }
.tlstrip { overflow-x: auto; }

/* comparison: do nothing against restart */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.opt h3 { font-size: var(--fs-1); margin-bottom: 6px; }
.opt.rec { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.opt dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: var(--fs-1); }
.opt dt { color: var(--muted); }
.opt dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.t-bad { color: var(--alarm); } .t-warn { color: var(--warn); } .t-ok { color: var(--ok); }
.cmp { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.cmp th, .cmp td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp thead th { font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cmp thead th.rec { color: var(--ink); }
.cmp tbody th { color: var(--body); font-weight: 500; }
.cmp td { font-weight: 500; font-variant-numeric: tabular-nums; }
.window { margin: 10px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--highlight); border: 0; }
.window.closed { background: var(--alarm-bg); }
.acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* incidents */
.incident { border-radius: var(--r); padding: 16px 18px; background: var(--zone-grey); border: 0; }
.incident.warning { background: var(--warn-bg); }
.incident.alarm { background: var(--alarm-bg); }
.incident .root { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.incident .root .i { font-weight: 700; font-size: 18px; line-height: 1.2; }
.incident.alarm .root .i { color: var(--alarm); }
.incident.warning .root .i { color: var(--warn); }
.incident ul { margin: 8px 0 0 28px; padding: 0; color: var(--body); font-size: var(--fs-2); }
.incident .meta { font-size: var(--fs-0); color: var(--muted); }
.incident.acked { border: 1px dashed var(--line-strong); background: var(--panel); }
.incident.p1 .root .i { color: var(--alarm); }
.incident.p2 .root .i { color: var(--warn); }
.incident.p3 .root .i { color: var(--muted); }
.incident .prio { font-size: var(--fs-1); font-weight: 600; }
.inc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.incident button[aria-pressed="true"] { border-color: var(--ink); font-weight: 600; }

/* timeline */
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tl-list li { display: grid; grid-template-columns: 76px 20px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.tl-list .when { font-variant-numeric: tabular-nums; font-family: var(--font-mono); color: var(--muted); font-size: var(--fs-1); }
.tl-list .who { color: var(--muted); font-size: var(--fs-1); }
.tl-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.tl-filter button { font: inherit; min-height: 44px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 0 16px; cursor: pointer; }
.tl-filter button[aria-pressed="true"] { background: var(--zone-grey); border-color: var(--ink); font-weight: 600; }

/* prediction exercise */
.prediction-exercise { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.prediction-exercise > summary { cursor: pointer; color: var(--info); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.prediction-body { display: grid; gap: 10px; margin-top: 8px; }
.prediction-body p { margin: 0; }
.prediction-fieldset { min-width: 0; border: 0; padding: 0; display: grid; gap: 8px; }
.prediction-fieldset legend { padding: 0 0 6px; font-weight: 600; }
.prediction-choice { display: flex; gap: 10px; align-items: center; min-height: 52px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); cursor: pointer; }
.prediction-choice:has(input:checked) { background: var(--highlight); border-color: var(--brand); }
.prediction-choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.prediction-label { font-weight: 600; }
.prediction-peaks, .prediction-result { display: grid; gap: 6px; padding: 14px; background: var(--zone-grey); border-radius: var(--r); }
.prediction-result { background: var(--panel); border: 1px solid var(--line); }

/* hall floor plan */
.hall-head h1 { margin-bottom: 2px; }
.hall-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--gap); align-items: start; margin-top: 12px; }
.hall-plan-card { background: var(--panel); border-radius: var(--r-card); padding: 20px; min-width: 0; }
.hall-key { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 10px; }
.hall-key .chip { display: inline-block; font-size: var(--fs-0); font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.hall-key .grey-chip { background: var(--zone-rule); color: var(--panel); }
.hall-key .white-chip { background: var(--panel); color: var(--ink); border: 1px dashed var(--tile-edge); }
.hall-key .boundary-chip { background: var(--panel); color: var(--ink); border: 2px solid var(--tile-edge); }
.plan-svg { width: 100%; height: auto; display: block; }
.plan-svg .axis, .plan-svg .aisle { font-size: 12px; fill: var(--muted); }
.plan-svg .aisle { font-size: 11px; }
.plan-svg a { outline: none; }
.plan-svg .tile .body { fill: var(--panel); stroke: var(--tile-edge); stroke-width: 1.4; }
.plan-svg .tile.k-breaker .body { stroke-width: 2.2; }
.plan-svg .tile.k-plant .body { fill: var(--zone-rule); stroke: var(--zone-rule); }
.plan-svg .tile.fill-1 .body { fill: var(--fill-1); }
.plan-svg .tile.fill-2 .body { fill: var(--fill-2); }
.plan-svg .tile.fill-3 .body { fill: var(--fill-3); }
.plan-svg .tile.fill-4 .body { fill: var(--fill-4); }
.plan-svg .tile.fill-5 .body { fill: var(--fill-5); }
.plan-svg .tile.fill-6 .body { fill: var(--fill-6); }
.plan-svg .tile.band-outside .body { stroke-width: 3; }
.plan-svg .tile.fill-6 .body { stroke: var(--fill-6-ink); stroke-width: 3; }
.plan-svg .tile text.lbl { font-size: 12.5px; font-weight: 700; fill: var(--ink); }
.plan-svg .tile text.val { font-size: 11.5px; fill: var(--ink); }
.plan-svg .tile[class*="fill-"] text.lbl, .plan-svg .tile[class*="fill-"] text.val { fill: var(--fill-ink); }
.plan-svg .tile.fill-6 text.lbl, .plan-svg .tile.fill-6 text.val { fill: var(--fill-6-ink); }
.plan-svg .tile.k-plant text.lbl, .plan-svg .tile.k-plant text.val { fill: var(--panel); }
.plan-svg .tile .glyph { font-size: 13px; font-weight: 700; }
.plan-svg .tile.k-plant text.lbl { font-size: 11.5px; }
.plan-svg .glyph.s-ok, .plan-svg .glyph.band-recommended { fill: var(--ok); }
.plan-svg .glyph.s-warn, .plan-svg .glyph.band-allowable { fill: var(--warn); }
.plan-svg .glyph.s-alarm, .plan-svg .glyph.band-outside { fill: var(--alarm); }
.plan-svg .glyph.s-off { fill: var(--muted); }
.plan-svg .tile.k-plant .glyph { fill: var(--panel); }
.plan-svg a:hover .body { stroke: var(--ink); }
.plan-svg a[aria-current="true"] .body { stroke: var(--ink); stroke-width: 3; }
.plan-svg a:focus-visible .body { stroke: var(--focus); stroke-width: 3.2; }
.hall-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 12px; }
.hall-legend h3 { font-size: var(--fs-1); margin-bottom: 6px; color: var(--muted); }
.fill-scale, .band-scale { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: var(--fs-1); }
.fill-scale li, .band-scale li { display: flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 22px; height: 14px; border-radius: 4px; border: 1px solid var(--tile-edge); }
.sw.fill-1 { background: var(--fill-1); } .sw.fill-2 { background: var(--fill-2); } .sw.fill-3 { background: var(--fill-3); }
.sw.fill-4 { background: var(--fill-4); } .sw.fill-5 { background: var(--fill-5); } .sw.fill-6 { background: var(--fill-6); }
.shape-sample { display: inline-block; width: 40px; }
.shape-sample svg { display: block; }
.shape-sample svg rect { fill: none; stroke: var(--tile-edge); stroke-width: 1.6; }
.shape-sample.outside svg rect { stroke-width: 3; }
.hall-detail { min-width: 0; }
.hall-detail .crumbs { margin: 0 0 4px; }
.hall-detail .facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 12px 0 0; font-size: var(--fs-1); }
.hall-detail .facts dt { color: var(--muted); }
.hall-detail .facts dd { margin: 0; }
.hall-detail .section-h { margin-top: 14px; }
.section-h { font-size: var(--fs-3); font-weight: 600; margin: 12px 0 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .overview-grid > .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .situation, .cols, .compare, .hall-layout { grid-template-columns: minmax(0, 1fr); }
  .runway-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
  .sidebar { position: static; min-height: 0; padding: 16px; gap: 12px; }
  .rail { display: flex; flex-wrap: wrap; gap: 4px; }
  .rail a { flex: 0 0 auto; min-height: 44px; }
  .rail a[aria-current="page"]::after { display: none; }
  .rail-secondary { border-top: 0; padding-top: 0; }
  .sidebar-footer { margin-top: 0; padding-top: 12px; }
  h1 { font-size: 32px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-grid > .span-2 { grid-column: auto; }
  .runway-side { grid-template-columns: minmax(0, 1fr); }
  .state .hero-word { font-size: 48px; }
  .pane, .card, .state, .tile { padding: 20px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .table thead { position: absolute; left: -9999px; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 0; }
  .table td:first-child { font-weight: 600; }
  .table td.num { text-align: left; }
  .tier { grid-template-columns: 1fr; }
  .tl-list li { grid-template-columns: 64px 18px minmax(0, 1fr); }
  .hall-legend { grid-template-columns: 1fr; }
  .hall-plan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .plan-svg { min-width: 620px; }
}
@media (prefers-reduced-motion: no-preference) {
  .meter > i, svg .fill-water, .bar > span { transition: width .4s ease, height .4s ease, y .4s ease; }
}

/* bars and alarm lists */
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--info); border-radius: 999px; }
.bar.alarm-bar > span { background: var(--alarm); }
.bar.warn-bar > span { background: var(--warn); }
.alarms { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
