/* Busy Is Not Productive, the underground flow game: the solo game, the room's main screen, the phones and the
 * results board. The Stratflow look of One Mine, Two Scoreboards (always light), with what the underground mine
 * needs: eight stations, six stock places, the fill loop, and the engine room. This file stands on its own:
 * nothing outside the underground folder is needed by these pages. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
:root {
  --bg: #f3f5f7; --panel: #ffffff; --panel-2: #eaeef2; --ink: #1d2329; --ink-2: #454c54; --muted: #69717a;
  --line: #dbe1e7; --line-strong: #b4bdc6;
  --accent: #052f5b; --accent-ink: #ffffff; --accent-soft: #e3ebf4;
  --ledger: #3b3a3a; --ledger-ink: #f7f7f7;
  --head: #052f5b; --cta: #8b0000; --cta-ink: #ffffff; --cta-hover: #6c0000; --mark: #8b0000; --gold: #edcd1f; --navy: #052f5b;
  --good: #0ca30c; --good-ink: #0a5c0a; --warn: #fab219; --warn-ink: #6a4900;
  --serious: #ec835a; --serious-ink: #8b3410; --crit: #d03b3b; --crit-ink: #a31f1f;
  --s1: #2a78d6; --s1-pale: #aeccef; --s2: #eb6834; --s3: #1baf7a; --grid: #e2e6e9; --axis: #b8c1c8;
  /* what a station is doing has colours of its own (version 3): green, yellow and red are kept for stock */
  --st-run: #2a78d6; --st-down: #9aa3ad; --st-starved: #d887fb; --st-blocked: #79268b; --ref: #8a939c;
  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-head: 'Nunito Sans', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --r: 6px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
.wrap { max-width: 1260px; margin: 0 auto; padding-inline: 20px; padding-block: 22px 56px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: .01em; }
h1, h2, .callout .hd, .predict label { font-family: var(--font-head); font-weight: 800; letter-spacing: -.01em; color: var(--head); }
h1 { font-size: 2.3rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.prose { max-width: 70ch; display: grid; gap: 12px; }
.prose p { color: var(--ink-2); }
.eyebrow { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--head); font-size: .95rem; }
.eyebrow::before { content: ''; display: inline-block; width: 26px; height: 3px; background: var(--gold); vertical-align: middle; margin: -2px 10px 0 0; }
.stack { display: grid; gap: 24px; }
.stack-sm { display: grid; gap: 12px; }
.stack > *, .stack-sm > * { min-width: 0; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 70ch; }

/* ---------- the masthead, the round rail, the company band ---------- */
.masthead { background: var(--panel); border-top: 4px solid var(--navy); border-bottom: 1px solid var(--line); }
.masthead-in { max-width: 1260px; margin: 0 auto; padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.masthead .logo { display: block; line-height: 0; flex: 0 0 auto; border-radius: 4px; }
.masthead .logo img { display: block; height: 52px; width: auto; }
.masthead .brand { display: grid; gap: 1px; align-items: start; padding-left: 20px; border-left: 1px solid var(--line-strong); }
.masthead .brand b { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; line-height: 1.2; color: var(--head); }
.masthead .brand span { font-size: .85rem; color: var(--muted); }
.masthead .luck { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); flex-wrap: wrap; }
.luck code { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: .08em; color: var(--ink); }
.luck input { width: 5.5em; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); }
.masthead.slim .masthead-in { padding: 10px 16px; max-width: 520px; }
.masthead.slim .logo img { height: 38px; }
.masthead.slim .brand { padding-left: 14px; }
.masthead.slim .brand b { font-size: 1rem; }
.rail { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line-strong); margin-bottom: 28px; scrollbar-width: thin; }
.rail button { flex: 0 0 auto; border: 0; background: transparent; padding: 10px 12px 9px; font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); cursor: pointer; border-radius: var(--r) var(--r) 0 0; }
.rail button b { font-weight: 700; margin-right: 6px; color: var(--muted); }
.rail button[aria-current="true"] { background: transparent; color: var(--head); box-shadow: inset 0 -3px 0 var(--gold); }
.rail button[aria-current="true"] b { color: var(--head); }
.rail button:disabled { color: var(--line-strong); cursor: not-allowed; }
.rail button:disabled b { color: var(--line-strong); }
.rail button:not(:disabled):not([aria-current="true"]):hover { background: var(--panel-2); }
.corp { background: var(--navy); color: #ffffff; }
.corp-in { max-width: 1260px; margin: 0 auto; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; font-size: .88rem; }
.corp a { color: #ffffff; text-underline-offset: 3px; }
.corp a:hover { color: var(--gold); }
.corp .links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); display: grid; gap: 6px; max-width: 86ch; }
@media (max-width: 640px) {
  .masthead-in { padding: 10px 16px; }
  .masthead .logo img { height: 40px; }
  .masthead .brand { padding-left: 0; border-left: 0; flex-basis: 100%; }
  .masthead .luck { margin-left: 0; }
  .masthead.slim .brand { padding-left: 0; }
  .masthead.slim .brand b { font-size: .95rem; }
  h1 { font-size: 1.9rem; }
  .wrap { padding-inline: 16px; }
}

/* ---------- buttons, panels, notes ---------- */
.btn { border: 1px solid var(--line-strong); background: var(--panel); padding: 9px 16px; border-radius: var(--r); cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--cta); color: var(--cta-ink); border-color: var(--cta); font-weight: 600; }
.btn.primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent); padding-inline: 8px; text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel.wait { text-align: center; color: var(--ink-2); }
.panel.wait b { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); margin-bottom: 4px; }
.callout { border-left: 4px solid var(--navy); background: var(--panel); padding: 14px 18px; border-radius: 0 var(--r) var(--r) 0; display: grid; gap: 8px; }
.callout .hd { font-size: 1.3rem; line-height: 1.2; }
.callout p { color: var(--ink-2); max-width: 74ch; }
.callout.teach { border-left-color: var(--gold); }
.note { font-size: .85rem; color: var(--muted); max-width: 80ch; }
.banner { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--panel)); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.facts div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.facts dt { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: .95rem; color: var(--ink-2); }
dl { margin: 0; }
.rounds { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.rounds li { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; display: grid; gap: 3px; align-content: start; }
.rounds li b { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .95rem; }
.rounds li span { font-size: .95rem; color: var(--ink-2); }
.list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; max-width: 78ch; color: var(--ink-2); }
.list b { color: var(--ink); }

/* ---------- the mine: eight stations with the stock places between them ---------- */
.mine { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.mine-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }
.mine-head b { color: var(--ink); font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .04em; text-transform: uppercase; }
.chain-scroll { overflow-x: auto; padding: 18px 12px 10px; }
.chain { display: flex; align-items: stretch; min-width: 1130px; }
.tile { flex: 1 1 0; min-width: 84px; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); padding: 7px 7px 8px; display: grid; gap: 4px; align-content: start; position: relative; }
.tile.constraint { border-color: var(--mark); box-shadow: inset 0 0 0 1px var(--mark); }
.tile .nm { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .01em; font-size: .74rem; color: var(--ink-2); line-height: 1.1; min-height: 2.2em; }
.tile .plate { display: flex; align-items: baseline; gap: 4px; }
.tile .plate b { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; line-height: 1; }
.tile .wasl { font-size: .72rem; color: var(--muted); line-height: 1.1; margin-top: -3px; }
.tile .plate small { color: var(--muted); font-size: .74rem; }
.tile .fleet { font-size: .72rem; color: var(--ink-2); line-height: 1.25; min-height: 2.5em; }
.tile .meter { height: 8px; background: var(--panel-2); border-radius: 2px; position: relative; overflow: hidden; }
.tile .meter u { position: absolute; inset: 0 auto 0 0; background: var(--s1); width: 0; transition: width .12s linear; }
.tile .meter i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .55; }
.tile .st { font-size: .76rem; min-height: 1.2em; color: var(--muted); white-space: nowrap; }
.tile .st::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; background: transparent; }
.tile[data-state] .st { color: var(--ink-2); font-weight: 600; }
.tile[data-state="cap"] { border-color: var(--st-run); } .tile[data-state="cap"] .st::before { background: var(--st-run); }
.tile[data-state="want"] .st { font-weight: 400; } .tile[data-state="want"] .st::before { background: var(--st-run); height: 5px; vertical-align: 0; }
.tile[data-state="input"] { border-color: var(--st-starved); box-shadow: inset 0 0 0 1px var(--st-starved); } .tile[data-state="input"] .st::before { background: var(--st-starved); }
.tile[data-state="room"] { border-color: var(--st-blocked); box-shadow: inset 0 0 0 1px var(--st-blocked); } .tile[data-state="room"] .st::before { background: var(--st-blocked); }
.tile[data-state="down"] { border-color: var(--st-down); background: var(--panel-2); } .tile[data-state="down"] .st::before { background: var(--st-down); }
.tile.constraint[data-state] { border-color: var(--mark); box-shadow: inset 0 0 0 1px var(--mark); }
/* where a station's capacity went over the weeks played: the empty end of the bar is capacity the plan did not ask for */
.tile .went { display: flex; height: 12px; border: 1px solid var(--line-strong); border-radius: 3px; overflow: hidden; background: var(--panel); gap: 1px; }
.tile .went i { display: block; height: 100%; flex: 0 0 auto; min-width: 0; }
.tile .went .g-run { background: var(--st-run); } .tile .went .g-down { background: var(--st-down); } .tile .went .g-starved { background: var(--st-starved); } .tile .went .g-blocked { background: var(--st-blocked); }
.tile .rv { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: .7rem; color: var(--ink-2); line-height: 1.3; }
.tile .rv span:first-child { font-weight: 600; color: var(--ink); }
.tile .by { font-size: .68rem; line-height: 1.2; color: var(--ink); background: var(--accent-soft); border-radius: 3px; padding: 2px 4px; }
.tile .tag { position: absolute; top: -12px; right: 6px; background: var(--mark); color: #ffffff; font-family: var(--font-display); font-weight: 600; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; }
.tile .flag { position: absolute; bottom: -10px; left: 6px; background: var(--ink); color: var(--bg); font-family: var(--font-display); font-weight: 600; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.tile select { width: 100%; padding: 2px 2px; font-size: .74rem; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel); }
.tile label.pick { font-size: .72rem; display: flex; gap: 5px; align-items: center; color: var(--ink-2); cursor: pointer; line-height: 1.2; }
.tile .fixed { font-size: .74rem; color: var(--muted); }
.gap { width: 58px; flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 3px; padding-inline: 1px; }
.gap.end { width: 52px; }
.gap .arrow { width: 100%; height: 2px; background: var(--line-strong); position: relative; }
.gap .arrow::after { content: ''; position: absolute; right: 0; top: -3px; border: 4px solid transparent; border-left: 6px solid var(--line-strong); border-right: 0; }
/* a stock: the outline is the most room the game offers there, the box inside it the room this mine has */
.gap .tank { width: 30px; height: 56px; border: 1px dashed var(--line-strong); border-top: 0; border-radius: 0 0 4px 4px; position: relative; background: transparent; }
.gap .tank .built { position: absolute; inset: auto -1px -1px -1px; border: 1px solid var(--ink-2); border-top: 0; border-radius: 0 0 4px 4px; background: var(--panel-2); overflow: hidden; }
.gap .tank i { position: absolute; inset: auto 0 0 0; height: 0; background: var(--muted); transition: height .12s linear; }
.gap .tank b { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--ink); opacity: .6; }
.gap .tank[data-zone="green"] i { background: var(--good); } .gap .tank[data-zone="yellow"] i { background: var(--warn); } .gap .tank[data-zone="red"] i { background: var(--crit); }
.gap .gn { font-size: .6rem; color: var(--muted); text-align: center; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em; font-family: var(--font-display); font-weight: 600; }
.gap .lv { font-size: .7rem; color: var(--ink-2); text-align: center; line-height: 1.15; white-space: nowrap; }
.gap .lv small { display: block; color: var(--muted); font-size: .66rem; }
.gap .lv small.wasp { color: var(--ink-2); }
.gap .kz { font-size: .64rem; font-weight: 600; line-height: 1.2; color: var(--ink-2); white-space: nowrap; }
.gap .kz::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 3px; background: var(--muted); }
.gap .kz.green::before { background: var(--good); } .gap .kz.yellow::before { background: var(--warn); } .gap .kz.red::before { background: var(--crit); } .gap .kz.plan, .gap .kz.none { visibility: hidden; }
.gap .ef { display: grid; font-size: .62rem; line-height: 1.2; color: var(--muted); text-align: center; white-space: nowrap; min-height: 2.4em; }
.gap .ef .r { color: var(--crit-ink); font-weight: 600; }
.gap select { width: 50px; padding: 1px 0; font-size: .7rem; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel); }
.gap.none .arrow { margin-top: 26px; }
.surface { width: 60px; flex: 0 0 auto; margin-left: 6px; border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 8px; display: grid; gap: 4px; align-content: start; color: var(--muted); background: repeating-linear-gradient(135deg, var(--panel), var(--panel) 6px, var(--panel-2) 6px, var(--panel-2) 12px); }
.surface .nm { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; font-size: .66rem; letter-spacing: .03em; line-height: 1.1; }
.surface small { font-size: .64rem; line-height: 1.2; }
.loop { margin: 2px 12px 12px; position: relative; height: 26px; }
.loop svg { display: block; width: 100%; height: 26px; overflow: visible; }
.loop svg path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 3; }
.loop svg text { font-size: 11px; fill: var(--muted); font-family: var(--font-body); }
.daybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 8px 14px 12px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }
.daybar b { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); letter-spacing: .03em; }
/* the keys: one beside each thing it explains */
.daybar .keys { flex: 1 1 100%; display: grid; gap: 3px; }
.keys .keyline { margin-top: 0; }
.keyline > b { font-family: var(--font-body); font-size: .78rem; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.keys .keynote { font-size: .78rem; color: var(--muted); max-width: 110ch; }
.keyline .l-cap::before { background: var(--st-run); } .keyline .l-want::before, .keyline .d-want::before { background: var(--st-run); height: 5px; vertical-align: 0; }
.keyline .l-input::before { background: var(--st-starved); } .keyline .l-room::before { background: var(--st-blocked); } .keyline .l-down::before { background: var(--st-down); }
.keyline .d-cap::before { background: var(--st-run); } .keyline .d-input::before { background: var(--st-starved); } .keyline .d-room::before { background: var(--st-blocked); } .keyline .d-down::before { background: var(--st-down); }
.keyline .z-green::before { background: var(--good); } .keyline .z-yellow::before { background: var(--warn); } .keyline .z-red::before { background: var(--crit); }
/* each station, day by day: one mark a day, flat out the full height, to plan half of it */
.dbd { padding: 10px 14px 12px; border-top: 1px solid var(--line); display: grid; gap: 3px; }
.dbd-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 4px; }
.dbd-h > b { font-family: var(--font-display); font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; }
.dbd-h .keyline { margin-top: 0; }
.dbd-r, .dbd-x { display: grid; grid-template-columns: 150px minmax(0, 1fr) 82px; gap: 8px; align-items: center; }
.dbd-n { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; font-size: .76rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbd-d { display: block; width: 100%; height: 12px; background: var(--panel-2); border-radius: 2px; }
.dbd-d .d-cap, .dbd-d .d-want { fill: var(--st-run); } .dbd-d .d-input { fill: var(--st-starved); } .dbd-d .d-room { fill: var(--st-blocked); } .dbd-d .d-down { fill: var(--st-down); }
.dbd-d .cv { fill: var(--panel-2); }
.dbd-w { font-size: .74rem; color: var(--ink-2); text-align: right; white-space: nowrap; }
.dbd-ax { position: relative; height: 14px; font-size: .68rem; color: var(--muted); }
.dbd-ax i { position: absolute; top: 0; font-style: normal; white-space: nowrap; border-left: 1px solid var(--line-strong); padding-left: 3px; line-height: 1.1; }
/* the Round 1 mine, small, above a later run */
.mine.compact .chain-scroll { padding: 10px 12px 8px; }
.mine.compact .tile { padding: 5px 7px 6px; gap: 3px; background: var(--panel); }
.mine.compact .tile .nm { min-height: 2.2em; }
.mine.compact .tile .plate b { font-size: 1.25rem; }
.mine.compact .gap .tank { height: 30px; width: 24px; }
.mine.compact .gap .arrow { display: none; }
.mine.compact .gap .ef { min-height: 0; }
.mine.compact .gap.none .gn { display: none; }
.pair { display: grid; gap: 8px; min-width: 0; }
.mine.rows-only .dbd { border-top: 0; }
/* the eight tiles share their rows, so that every number, bar and line sits level across the mine */
@supports (grid-template-rows: subgrid) {
  .chain { display: grid; grid-auto-flow: column; grid-template-rows: repeat(9, auto); grid-template-columns: repeat(7, minmax(84px, 1fr) 58px) minmax(84px, 1fr) 52px; }
  .chain > .tile, .chain > .gap { grid-row: 1 / -1; width: auto; min-width: 0; }
  .chain > .tile { grid-template-rows: subgrid; row-gap: 4px; }
  .tile > .nm { grid-row: 1; } .tile > .plate { grid-row: 2; } .tile > .wasl { grid-row: 3; } .tile > .fleet { grid-row: 4; } .tile > .meter { grid-row: 5; }
  .tile > .st, .tile > select, .tile > .fixed { grid-row: 6; } .tile > .went, .tile > label.pick { grid-row: 7; } .tile > .rv { grid-row: 8; } .tile > .by { grid-row: 9; }
  .tile .nm, .tile .fleet, .mine.compact .tile .nm { min-height: 0; }
  .mine.compact .chain { grid-template-rows: repeat(4, auto); }
  .mine.compact .chain > .tile { row-gap: 3px; }
  .mine.compact .tile > .went { grid-row: 3; } .mine.compact .tile > .rv { grid-row: 4; }
}
.daybar.top { border-top: 0; border-bottom: 1px solid var(--line); padding: 8px 14px; }
/* playing the weeks */
.play { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn.sm { padding: 4px 12px; font-size: .88rem; }
.daybar .wk { min-width: 7.2em; }

/* ---------- the four figures at the head of a run ---------- */
.figs { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.figrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fig { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; display: grid; gap: 1px; align-content: start; min-width: 0; background: var(--bg); }
.fig.fuc { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.fig .fl { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; color: var(--ink-2); }
.fig .fv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-height: 2rem; }
.fig .fv strong { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1.05; }
.fig .fv small { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.fig .fs { font-size: .76rem; color: var(--muted); line-height: 1.25; }
.fig .fc { font-size: 1.02rem; color: var(--ink); line-height: 1.3; margin-top: 3px; }
.fig .fr { font-size: .78rem; color: var(--muted); }
.fig { position: relative; }
.fig .fw { display: none; position: absolute; left: 10px; top: 2.05rem; font-size: 1.02rem; font-weight: 600; color: var(--muted); }
.figs.pending .fig .fw { display: block; }
.figs.pending .fv, .figs.pending .fs, .figs.pending .fc { visibility: hidden; }
.figs .fn { margin-top: 8px; font-size: .8rem; }
.figs.pending .fn { visibility: hidden; }
.uc { font-weight: 400; color: var(--ink-2); white-space: nowrap; }
td .uc, .three .uc { font-size: .88em; }
@media (max-width: 760px) { .figrow { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fig .fv strong { font-size: 1.6rem; } }

/* ---------- the prediction and the reveal ---------- */
.predict { display: grid; gap: 14px; }
.predict label { font-size: 1.35rem; line-height: 1.2; }
.predict .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.predict input[type=range] { flex: 1 1 260px; min-width: 0; accent-color: var(--accent); }
.predict output { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; min-width: 4.2ch; text-align: right; line-height: 1; }
.reveal { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); gap: 12px 44px; align-items: end; }
.reveal .big { font-family: var(--font-display); font-weight: 700; font-size: 3.2rem; line-height: .95; }
.reveal small { display: block; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-display); font-weight: 600; }

/* ---------- the two reports ---------- */
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.board { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.board > header { padding: 10px 14px; border-radius: var(--r) var(--r) 0 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.board.cost > header { background: var(--ledger); color: var(--ledger-ink); }
.board.flow > header { background: var(--accent); color: var(--accent-ink); }
.board > header h3 { font-size: 1.2rem; }
.board > header span { font-size: .82rem; opacity: .85; }
.rows { display: grid; }
.rw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: baseline; }
.rw:last-child { border-bottom: 0; }
.rw .k { color: var(--ink-2); font-size: .92rem; }
.rw .v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rw .sub { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); }
.rw .wide { grid-column: 1 / -1; }
.reading { padding: 10px 14px; background: var(--panel-2); font-size: .9rem; color: var(--ink-2); border-radius: 0 0 var(--r) var(--r); }
.reading b { color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.good { border-color: var(--good); color: var(--good-ink); } .chip.good::before { background: var(--good); }
.chip.watch { border-color: var(--warn); color: var(--warn-ink); } .chip.watch::before { background: var(--warn); border-radius: 1px; transform: rotate(45deg); }
.chip.bad { border-color: var(--crit); color: var(--crit-ink); } .chip.bad::before { background: var(--crit); border-radius: 1px; }
.utilgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.utilgrid div { border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; font-size: .78rem; display: grid; gap: 1px; align-content: start; }
.utilgrid b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.utilgrid .chip { justify-self: start; font-size: .68rem; padding: 0 6px; }
.pace { display: grid; grid-template-columns: auto 1fr auto; gap: 3px 8px; align-items: center; font-size: .82rem; margin-top: 6px; }
.pace i { display: block; height: 8px; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 1px; }
.pace span:nth-child(3n) { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.stockrows { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 3px 10px; font-size: .84rem; margin-top: 6px; align-items: center; }
.stockrows .z { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: -1px; background: var(--muted); }
.stockrows .z.green { background: var(--good); } .stockrows .z.yellow { background: var(--warn); } .stockrows .z.red { background: var(--crit); }
.stockrows > span:not(:nth-child(4n+1)) { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.pos { color: var(--good-ink); font-weight: 600; } .neg { color: var(--crit-ink); font-weight: 600; }

/* ---------- charts ---------- */
.chart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 10px; min-width: 0; }
.chart h3 { margin-bottom: 2px; }
.chart .cap { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg text { font-family: var(--font-body); font-size: 11px; fill: var(--muted); }
.chart svg .lbl { fill: var(--ink-2); font-size: 11.5px; }
.chart svg .lbl-strong { fill: var(--ink); font-weight: 600; font-size: 12px; }
.chart svg .halo { paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.charts2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.lg { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .85rem; color: var(--ink-2); margin-bottom: 6px; }
.lg span::before { content: ''; display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--muted); }
.lg .c1::before { background: var(--s1); } .lg .c2::before { background: var(--s2); } .lg .c3::before { background: var(--s3); } .lg .cg::before { background: var(--ref); }
.lg .ln::before { height: 0; border-top: 2px dashed var(--ink); background: none; vertical-align: 3px; }
#tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 9px; border-radius: 4px; font-size: .82rem; line-height: 1.35; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

/* ---------- tables ---------- */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; color: var(--muted); vertical-align: bottom; white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.n { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.hl td { background: var(--accent-soft); }
tr.sum td { font-weight: 600; border-top: 2px solid var(--line-strong); }

/* ---------- saving cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); padding: 12px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; cursor: pointer; align-items: start; align-content: start; }
.card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.card input { margin-top: 5px; accent-color: var(--accent); width: 16px; height: 16px; }
.card b { font-weight: 600; }
.card .sv { grid-column: 2; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--head); }
.card p { grid-column: 2; font-size: .88rem; color: var(--ink-2); }
.card p.now { font-size: .82rem; color: var(--muted); }
.target { display: grid; gap: 6px; max-width: 640px; }
.target .bar { height: 12px; background: var(--panel-2); border-radius: 3px; position: relative; overflow: hidden; }
.target .bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.target .bar u { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }

/* ---------- Round 3: the design ---------- */
.design-tools { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .design-tools { grid-template-columns: minmax(0, 1fr); } }
.toggle { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.toggle input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }
.endure td, .endure th { padding: 6px 10px; }
.endure .ok { color: var(--good-ink); } .endure .thin { color: var(--warn-ink); } .endure .short { color: var(--crit-ink); font-weight: 600; }
.steps { counter-reset: step; display: grid; gap: 14px; }
.steps > div { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 4px 12px; align-items: start; }
.steps > div::before { counter-increment: step; content: counter(step); font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--bg); background: var(--navy); border-radius: 50%; width: 1.7em; height: 1.7em; display: grid; place-items: center; }
.steps > div > * { grid-column: 2; }
.steps > div > :first-child { grid-row: 1; }
.quiz { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz button { border: 1px solid var(--line-strong); background: var(--panel); border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.quiz button.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--panel)); font-weight: 600; }
.quiz button.wrong { border-color: var(--crit); color: var(--crit-ink); }

/* ---------- Round 4: the engine room ---------- */
.er { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .er { grid-template-columns: minmax(0, 1fr); } }
.dots { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.dots i { width: 22px; height: 22px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); font-style: normal; font-size: .72rem; display: grid; place-items: center; color: var(--muted); font-family: var(--font-display); font-weight: 600; }
.dots i.done { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.dots i.now { border: 2px solid var(--ink); color: var(--ink); }
.decision { border: 2px solid var(--ink); border-radius: var(--r); background: var(--panel); padding: 16px; display: grid; gap: 12px; }
.decision h3 { font-size: 1.3rem; text-transform: none; letter-spacing: .01em; font-weight: 700; font-family: var(--font-head); color: var(--head); }
.decision .sit { color: var(--ink-2); font-size: .95rem; display: grid; gap: 8px; }
.decision .opts { display: grid; gap: 8px; }
.decision .opt { text-align: left; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; }
.decision .opt:hover { border-color: var(--accent); }
.decision .opt b { font-weight: 600; }
.decision .opt span { font-size: .85rem; color: var(--ink-2); }
.decision .opt.picked { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.zonechips { display: flex; flex-wrap: wrap; gap: 6px; }
.zc { border-radius: 99px; padding: 2px 10px; font-size: .82rem; font-weight: 600; border: 1px solid var(--line-strong); }
.zc.green { border-color: var(--good); color: var(--good-ink); background: color-mix(in srgb, var(--good) 10%, var(--panel)); }
.zc.yellow { border-color: var(--warn); color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 14%, var(--panel)); }
.zc.red { border-color: var(--crit); color: var(--crit-ink); background: color-mix(in srgb, var(--crit) 10%, var(--panel)); }
.said { display: grid; gap: 6px; font-size: .92rem; }
.said div { padding: 8px 10px; border-radius: 4px; background: var(--panel-2); }
.said div.cost { border-left: 4px solid var(--ledger); }
.said div.flow { border-left: 4px solid var(--accent); }
.said div.happened { border-left: 4px solid var(--crit); background: color-mix(in srgb, var(--crit) 6%, var(--panel)); }
.said b { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; display: block; color: var(--muted); }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.three .panel { display: grid; gap: 4px; }
.three .panel.you { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.three .big { font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; line-height: 1; }
.three small { color: var(--muted); }

/* ---------- the debrief ---------- */
.statement { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.statement:first-child { border-top: 0; padding-top: 0; }
.statement q { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.2; quotes: none; }
.statement p { color: var(--ink-2); max-width: 78ch; }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.field { display: grid; gap: 4px; }
.field label { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; color: var(--muted); font-weight: 600; }
.field input[type=text], .field input[type=number], .field select { padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); font-size: 1rem; width: 100%; }
.field input.codein { font-family: var(--font-display); font-size: 2rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi div { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--panel); display: grid; gap: 2px; align-content: start; }
.kpi small { color: var(--muted); font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; font-size: .82rem; }
.kpi b { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; }

/* ---------- the room and the phones ---------- */
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .lobby { grid-template-columns: minmax(0, 1fr); } }
.code { font-family: var(--font-display); font-weight: 700; font-size: 5.5rem; letter-spacing: .14em; line-height: 1; }
.joinurl { font-size: 1.05rem; word-break: break-all; color: var(--ink-2); }
.qr { width: 190px; max-width: 100%; background: #ffffff; padding: 8px; border-radius: var(--r); line-height: 0; }
.qr svg, .qr img { width: 100%; height: auto; display: block; }
.seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.seat { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; background: var(--bg); display: grid; gap: 2px; min-height: 64px; align-content: start; }
.seat b { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; color: var(--ink-2); }
.seat span { font-size: .92rem; }
.seat.empty span { color: var(--muted); }
.seat.ready { border-color: var(--good); }
.phone { max-width: 520px; margin: 0 auto; padding-inline: 16px; padding-block: 14px 40px; display: grid; gap: 16px; }
.phone h1 { font-size: 1.8rem; }
.phone .me { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: .9rem; color: var(--ink-2); border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.phone .me b { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.bigbtn { width: 100%; padding: 14px 16px; font-size: 1.05rem; text-align: left; display: grid; gap: 2px; }
.bigbtn span { font-size: .88rem; font-weight: 400; opacity: .9; }
.picked { border-color: var(--accent) !important; box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft) !important; }
.wait { text-align: center; padding: 28px 16px; color: var(--ink-2); }
.wait b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); margin-bottom: 6px; }

/* ---------- the results board ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.filters .field { min-width: 10em; }
th button.sort { all: unset; cursor: pointer; }
th button.sort::after { content: ' \2195'; opacity: .4; }
td.who { font-weight: 600; white-space: nowrap; max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
.code-gate { max-width: 34em; }
.code-gate .code-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.code-gate input.code-input { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); font-size: 1.1rem; letter-spacing: .08em; text-transform: uppercase; min-width: 0; flex: 0 1 14em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- report parts: segmented bars, key lines, table colours ---------- */
.seg { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--panel-2); margin-top: 6px; }
.seg i { display: block; height: 100%; }
.keyline { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .78rem; color: var(--ink-2); margin-top: 6px; }
.keyline span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; background: var(--muted); }
.seg .g-run { background: var(--s1); } .keyline .g-run::before { background: var(--s1); }
.seg .g-down { background: var(--st-down); } .keyline .g-down::before { background: var(--st-down); }
.seg .g-starved { background: var(--st-starved); } .keyline .g-starved::before { background: var(--st-starved); }
.seg .g-blocked { background: var(--st-blocked); } .keyline .g-blocked::before { background: var(--st-blocked); }
.seg .g-plan { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong); } .keyline .g-plan::before { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg { gap: 1px; }
.utilgrid.months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
td.ok { color: var(--good-ink); } td.thin { color: var(--warn-ink); } td.short { color: var(--crit-ink); font-weight: 600; }
.stockrows .zc { font-size: .72rem; padding: 0 7px; }
.three .panel span { font-size: .9rem; color: var(--ink-2); }
.tile .fixed { font-size: .74rem; color: var(--muted); min-height: 1.4em; }
.decision .opt:disabled { cursor: default; opacity: .75; }
.decision .opt.picked:disabled { opacity: 1; }
.calc .note { font-size: .78rem; }
@media (max-width: 480px) {
  .utilgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .utilgrid.months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reveal .big { font-size: 2.6rem; }
}
.facts.c3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.gap .tank[data-zone="plan"] i { background: var(--line-strong); }
.calc { align-items: start; }
.field label { min-height: 1.3em; }

/* ---------- the room: departments, votes, the phones' entries ---------- */
.tally { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; font-size: .92rem; }
.tally i { display: block; height: 12px; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 2px; }
.tally span:nth-child(3n) { font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line-strong); border-radius: 99px; padding: 2px 10px; font-size: .88rem; background: var(--panel); }
.pill b { font-variant-numeric: tabular-nums; }
.decision .opt .votes { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--accent); }
.kpi .chip, .kpi .zc { justify-self: start; }
.note.nudge { color: var(--crit-ink); font-weight: 600; }
.chart details { margin-top: 8px; font-size: .85rem; }
.chart summary, details > summary { cursor: pointer; }
.chart summary { color: var(--accent); }
.phone .callout .hd { font-size: 1.15rem; }
.phone .said { font-size: .9rem; }
.banner pre { margin: 0; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; font-size: .82rem; }
#save-status { color: var(--ink-2); }
td.nw { white-space: nowrap; }
.filters input[type=date], .filters input[type=text], .filters select { padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); }

/* the phone's session code field (the room's join form) */
.field input.passin { text-transform: uppercase; letter-spacing: .08em; }
.field .note { margin: 0; }

@media (max-width: 640px) { .dbd-r, .dbd-x { grid-template-columns: 76px minmax(0, 1fr) 62px; gap: 6px; } .dbd-n { font-size: .66rem; white-space: normal; line-height: 1.05; } .dbd-w { font-size: .68rem; } }
@media (max-width: 640px) { .rw .v .uc { display: block; font-size: .85em; } }
