/* ── Hubshape tokens ──────────────────────────────────────────────────────────
   Asphalt chrome, paper ground, ink text. Marking yellow lights one thing per view and never carries text on
   light grounds; gold is the wordmark's "shape" on light, mustard the accent text. Funnel Display for the
   wordmark and titles, Red Hat Text for the interface, Red Hat Mono (tabular) for figures. One control height. */
:root {
  --marking: #FFCF1A;
  --gold: #D49E00;
  --mustard: #7A5B00;
  --asphalt: #1B1B1D;
  --ink: #141416;
  --cream: #FFF4C2;
  --paper: #F7F6F1;

  --ink-2: #3A3A40;
  --muted: #6E6D74;
  --muted-2: #9C9AA2;
  --line: #E4E2DA;
  --line-soft: #EEEDE7;
  --surface: #FFFFFF;
  --surface-2: #FBFAF6;
  --bar: #F2F1EC;
  --chrome-2: #26262A;
  --chrome-3: #333338;
  --chrome-text: #F7F6F1;
  --chrome-muted: rgba(247, 246, 241, 0.58);

  --green: #2F7D4F;
  --green-bg: rgba(47, 125, 79, 0.11);
  --amber: #8A5A00;
  --amber-bg: rgba(212, 158, 0, 0.16);
  --red: #B3261E;
  --red-bg: rgba(179, 38, 30, 0.1);
  --blue: #2F5A8A;
  --blue-bg: rgba(47, 90, 138, 0.1);
  --grey-bg: #EFEEE8;
  --alert: #D9342B;
  /* A figure resting on an estimate Libra worked out, until a real number replaces it (the purple dot). */
  --estimate: #7A3FC0;
  /* Competitors' footprints, one a competitor (MAP.rivals in lib/palette.ts). */
  --rival-1: #B3261E;
  --rival-2: #2F5A8A;
  --rival-3: #2F7D4F;
  --rival-4: #7B3FA0;
  --rival-5: #B0601E;
  /* The scenario themes (src/config/themes.ts), each with its tint; mirrored in lib/palette.ts THEME. Partner usage
     is plum, not the estimate's violet, so a theme tag never reads as a purple dot. */
  --theme-commercial: #B3261E;
  --theme-commercial-bg: rgba(179, 38, 30, 0.1);
  --theme-network: #2F5A8A;
  --theme-network-bg: rgba(47, 90, 138, 0.1);
  --theme-final_delivery: #A35F00;
  --theme-final_delivery-bg: rgba(212, 140, 0, 0.16);
  --theme-partner_usage: #8E3B8F;
  --theme-partner_usage-bg: rgba(142, 59, 143, 0.11);
  --theme-growth: #2F7D4F;
  --theme-growth-bg: rgba(47, 125, 79, 0.11);
  --theme-overheads: #0B7A75;
  --theme-overheads-bg: rgba(11, 122, 117, 0.11);
  /* Programme: a scenario that combines themes, in a neutral grey. */
  --theme-programme: #6E6D74;
  --theme-programme-bg: rgba(110, 109, 116, 0.12);

  --scroll-thumb: rgba(122, 91, 0, 0.32);
  --scroll-thumb-hover: rgba(122, 91, 0, 0.55);

  --control-h: 32px;
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Red Hat Text', system-ui, sans-serif;
  --display: 'Funnel Display', 'Red Hat Text', system-ui, sans-serif;
  --mono: 'Red Hat Mono', ui-monospace, Consolas, monospace;
  --shadow: 0 1px 0 rgba(20, 20, 22, 0.04), 0 8px 24px -16px rgba(20, 20, 22, 0.22);

  /* The motif as repeating tiles. The cells are drawn on a torus, so a tile repeats with no seam. Cells is mustard
     hairlines with gold hubs, for header bands and tile corners; fine is white hairlines, for texture on filled bars. */
  --motif-cells: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='72'%3E%3Cpath d='M21.3 0L13.9 4.9M13.9 4.9L13.2 4.8M13.2 4.8L8.3 0M60.4 0L61.1 1.7M61.1 1.7L55.3 6.2M55.3 6.2L41.3 0M67.3 0L61.1 1.7M113 1.8L105.5 7.3M105.5 7.3L84.9 2.1M84.9 2.1L82.6 0M112.8 0L113 1.8M134.7 0.7L113 1.8M134.8 0L134.7 0.7M138.1 4.3L134.7 0.7M167.2 0L161.2 7.1M161.2 7.1L138.1 4.3M209.5 0L207.7 1.4M207.7 1.4L199.1 0M13.2 4.8L0 15.7M27.7 33.1L0 44.7M13.9 4.9L27.7 33.1M50 32.3L43.8 35.8M43.8 35.8L36.2 37.3M36.2 37.3L27.7 33.1M55.3 6.2L50 32.3M84.9 2.1L76.2 39.4M76.2 39.4L50 32.3M105.5 7.3L109.4 36.6M109.4 36.6L109.1 37M109.1 37L81.5 44.6M81.5 44.6L76.2 39.4M138.1 4.3L135.4 37.9M135.4 37.9L109.4 36.6M161.2 7.1L168 30.2M168 30.2L152.1 41.8M152.1 41.8L141.6 42.7M141.6 42.7L135.4 37.9M197.2 0L180.5 32.5M180.5 32.5L168 30.2M207.7 1.4L219.4 27.7M219.4 27.7L212.5 33.6M212.5 33.6L188.3 40M188.3 40L180.5 32.5M240 15.7L224.3 28.7M224.3 28.7L219.4 27.7M29.2 66.7L21.3 72M8.3 72L0 63.8M36.2 37.3L29.2 66.7M43.8 35.8L60.4 72M41.3 72L29.2 66.7M81.5 44.6L79.2 68.9M79.2 68.9L67.3 72M109.1 37L112.8 72M82.6 72L79.2 68.9M141.6 42.7L134.8 72M152.1 41.8L170.3 68.4M170.3 68.4L167.2 72M188.3 40L188.4 64.6M188.4 64.6L170.3 68.4M212.5 33.6L214.1 68.2M214.1 68.2L209.5 72M199.1 72L197.3 71.7M197.3 71.7L188.4 64.6M224.3 28.7L239.4 45M239.4 45L237.6 61.5M237.6 61.5L214.1 68.2M240 44.7L239.4 45M240 63.8L237.6 61.5' fill='none' stroke='rgb(122,91,0)' stroke-opacity='0.2' stroke-width='1'/%3E%3Cpath d='M4.2 27.1a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M35.5 11.7a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M69.2 18.7a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M89.5 23.4a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M123 18.9a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M148.5 20.9a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M177.3 12.4a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M196.9 22.5a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M228.7 8.4a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M15.2 53.3a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M45.7 60.6a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M59.5 54.3a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M99 58.1a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M121.2 55.7a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M152.2 62.8a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M170.2 50.4a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M204.3 50.4a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0M220 49.6a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0 -2.2 0' fill='rgb(212,158,0)' fill-opacity='0.45'/%3E%3C/svg%3E");
  --motif-fine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24'%3E%3Cpath d='M12.4 2.5L6.4 0M14.1 0L12.4 2.5M32.7 5.3L30.2 0M41.1 0L32.7 5.3M13.4 8.6L0 14M12.4 2.5L13.4 8.6M32.3 8.5L15.4 10.4M15.4 10.4L13.4 8.6M32.7 5.3L32.3 8.5M47.5 0L47 14.4M47 14.4L46.4 15.1M46.4 15.1L32.6 9M32.6 9L32.3 8.5M16.2 20.6L14.1 24M6.4 24L0 21.3M15.4 10.4L16.2 20.6M29.5 22.6L16.2 20.6M32.6 9L29.5 22.6M46.4 15.1L46.9 20.3M46.9 20.3L41.1 24M30.2 24L29.5 22.6M48 14L47 14.4M47.6 21.2L46.9 20.3M47.6 21.2L47.5 24' fill='none' stroke='white' stroke-opacity='0.3' stroke-width='1'/%3E%3C/svg%3E");
  --head-ground: color-mix(in srgb, var(--gold) 7%, var(--surface));
  /* Tables: one row height, one cell padding, the card's gutter, a band on even rows and a light under the pointer. */
  --row-h: 38px;
  --cell-x: 12px;
  --gutter: 14px;
  /* The band is a whisper of the header's gold, so the header stays the one warm ground of a table. */
  --row-band: color-mix(in srgb, var(--gold) 2.5%, var(--surface));
  --row-hover: color-mix(in srgb, var(--marking) 16%, var(--surface));
  --head-rule: color-mix(in srgb, var(--gold) 45%, var(--line));
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); }
body { font: 400 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Thin, quiet scrollbars everywhere. */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: padding-box; }

/* ── App frame ─────────────────────────────────────────────────────────────── */
.app { height: 100vh; display: flex; flex-direction: column; }
.app-header { flex: none; height: 52px; display: flex; align-items: center; gap: 16px; padding: 0 16px 0 18px; background: var(--asphalt); color: var(--chrome-text); }
/* The logo owns the nav column; everything after it lines up with the page title. */
.app-header .brand { flex: none; width: 210px; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.app-header .brand svg.icon { width: 26px; height: 26px; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.app-header .ws-switch { display: flex; align-items: center; gap: 8px; height: var(--control-h); padding: 0 10px; border-radius: var(--radius); background: transparent; border: 0; color: var(--chrome-text); cursor: pointer; max-width: 420px; margin-left: -2px; }
.app-header .ws-switch:hover { background: var(--chrome-2); }
.app-header .ws-switch b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header .ws-switch span { color: var(--chrome-muted); white-space: nowrap; }
.app-header .spacer { flex: 1; }
.app-header .status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--chrome-muted); white-space: nowrap; min-width: 0; overflow: hidden; }
.app-header .status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47, 125, 79, 0.25); }
.app-header .status .dot.warn { background: var(--gold); box-shadow: 0 0 0 3px rgba(212, 158, 0, 0.25); }
.app-header .view-pick { flex: none; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--chrome-muted); white-space: nowrap; }
.app-header .view-pick .select { width: 220px; height: var(--control-h); background-color: var(--chrome-2); border-color: var(--chrome-3); color: var(--chrome-text); font-size: 13px; font-weight: 600; }
.app-header .view-pick .select:focus { border-color: var(--chrome-muted); box-shadow: none; }
.app-header .view-pick option, .app-header .view-pick optgroup { background: var(--surface); color: var(--ink); }
.view-pick.bare { display: block; }
.view-pick.bare .select { width: 100%; }
.app-header .hbtn { height: var(--control-h); display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; color: var(--chrome-text); cursor: pointer; text-decoration: none; font-size: 12.5px; white-space: nowrap; }
.app-header .hbtn:hover { background: var(--chrome-2); }
.app-body { flex: 1; min-height: 0; display: flex; }

.sidenav { flex: none; width: 228px; background: var(--asphalt); color: var(--chrome-text); display: flex; flex-direction: column; padding: 6px 10px 12px; overflow: hidden; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.sidenav .groups { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.nav-cat, .nav-single { width: 100%; height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--chrome-text); cursor: pointer; text-decoration: none; font-weight: 500; font-size: 13px; text-align: left; position: relative; white-space: nowrap; }
.nav-cat:hover, .nav-single:hover { background: var(--chrome-2); }
.nav-cat .chev { margin-left: auto; width: 14px; height: 14px; opacity: 0.5; transition: transform 0.15s; }
.nav-cat.open .chev { transform: rotate(90deg); }
.nav-cat svg.i, .nav-single svg.i { width: 16px; height: 16px; opacity: 0.8; flex: none; }
.nav-single.active { background: var(--chrome-3); }
.nav-single.active::before, .nav-item.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--marking); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 26px; }
.nav-item { height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: var(--radius); color: var(--chrome-muted); text-decoration: none; font-size: 12.5px; position: relative; white-space: nowrap; }
.nav-item:hover { color: var(--chrome-text); background: var(--chrome-2); }
.nav-item.active { color: var(--chrome-text); background: var(--chrome-3); font-weight: 500; }
.nav-item.active::before { left: -36px; }
.nav-item .count, .nav-single .count { margin-left: auto; font: 500 11px var(--mono); color: var(--chrome-muted); }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--alert); flex: none; }
.nav-foot { flex: none; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 10px; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.nav-clock { font-size: 11.5px; color: var(--chrome-muted); padding: 2px 10px; line-height: 1.4; }
.nav-clock b { display: block; color: var(--chrome-text); font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ── Page ──────────────────────────────────────────────────────────────────── */
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.page-header { flex: none; padding: 18px 24px 0; background: transparent; position: relative; }
.page-header > .row, .page-header > .blurb, .page-header > .sub-row, .page-header > .meta, .page-header > .page-tabs { position: relative; }
.page-header .row { display: flex; align-items: center; gap: 16px; min-height: 34px; }
.page-header h1 { font: 700 23px/1.15 var(--display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.page-header .actions { flex: none; display: flex; gap: 8px; align-items: center; }
.page-header .blurb { margin: 4px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-header .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.page-header .meta b { color: var(--ink); font-weight: 600; }
.page-header:not(.with-tabs) { padding-bottom: 14px; }
.page-tabs { display: flex; gap: 2px; margin-top: 12px; border-bottom: 1px solid var(--line); overflow: hidden; }
.page-tabs button, .modal-tabs button { height: 36px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
/* A bar of many tabs (Settings, Registers) closes up so every tab stays in view at 1440. */
.page-tabs.dense button { padding: 0 5px; }
.page-tabs .tab-more svg, .modal-tabs .tab-more svg { transform: rotate(90deg); opacity: 0.7; }
.page-tabs button:hover, .modal-tabs button:hover { color: var(--ink); }
.page-tabs button.on, .modal-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.page-tabs .count, .modal-tabs .count { font: 500 11px var(--mono); color: var(--muted); background: var(--grey-bg); border-radius: 10px; padding: 1px 6px; }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--alert); display: inline-block; flex: none; }
.estimate-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--estimate); display: inline-block; flex: none; margin-left: 5px; vertical-align: middle; box-shadow: 0 0 0 2px color-mix(in srgb, var(--estimate) 22%, transparent); cursor: help; }
.page-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 16px 24px 20px; }
.page-body.row { flex-direction: row; }
/* Playback › The plan: figures, a chart and three tables one under another, the tab scrolling as one. */
.plan-tab { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* A combination's tab (playback/plan.tsx): its state line, its figures and one view under its own tab row. */
.plan-tab > .note { flex: none; display: flex; align-items: center; gap: 10px; }
.plan-tab > .note > span { flex: 1; min-width: 0; }
.plan-tab { gap: 12px; }
.modal-tabs.plan-views { padding: 0; }
.plan-name { flex: none; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.plan-name label { font-size: 12.5px; color: var(--ink-2); }
.plan-name .input { width: 320px; }
.settle-how { flex: none; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-width: 0; }
.settle-how > .muted { min-width: 0; }
/* Playback › a combination › Running commentary (lib/playback-commentary). */
.commentary { max-width: 96ch; }
.commentary section { padding: 0 0 6px; }
.commentary section + section { border-top: 1px solid var(--line); padding-top: 12px; }
.commentary h3 { font-size: 13.5px; font-weight: 650; color: var(--ink); margin: 0 0 8px; }
.commentary h4 { font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.commentary .commentary-scenario { margin: 0 0 10px 0; padding-left: 12px; border-left: 3px solid var(--line); }
.commentary p.say-warn { color: var(--amber); }
.commentary p.say-bad { color: var(--red); }
/* How they combine (Playback): the answer first, larger; the money bridge as a short table; the model's commentary under its toggle. */
.combine .combine-answer p:first-child { font-size: 15px; font-weight: 600; color: var(--ink); }
.combine ul { margin: 0 0 6px; padding-left: 18px; }
.combine ul li { margin: 0 0 4px; }
.combine-bridge { border-collapse: collapse; margin: 0 0 10px; min-width: 420px; font-size: 13px; }
.combine-bridge td, .combine-bridge th { padding: 4px 10px 4px 0; text-align: left; border-bottom: 1px solid var(--line); }
.combine-bridge th { font-weight: 600; color: var(--muted); font-size: 12px; }
.combine-bridge .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.combine-bridge tr.sum td { font-weight: 600; }
.combine-bridge tr.twice td.n { color: var(--red); }
.combine-bridge tr.total td { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); }
.combine-bridge.lines { margin-top: 4px; }
.combine-model { margin-top: 10px; padding-top: 6px; }
.combine-model section + section { border-top: 1px solid var(--line); padding-top: 12px; }
.filter-bar { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.filter-bar > * { flex: 1 1 0; min-width: 0; }
.filter-bar > .btn { flex: none; }
.stack { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.split { flex: 1; min-height: 0; display: grid; gap: 14px; }
.split > * { min-height: 0; min-width: 0; }
.fill { flex: 1; min-height: 0; }
.none { flex: none; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.card.fill { flex: 1; }
.card:has(> .loading.overlay) { position: relative; }
.card-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); min-height: 52px; position: relative; isolation: isolate; }
.card-head::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--motif-cells); background-position: right -30px top -10px; opacity: 0.75; -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000 100%); mask-image: linear-gradient(90deg, transparent 45%, #000 100%); }
.card.dark .card-head::after { display: none; }
.card-head h2:not(:empty)::before { content: ''; display: inline-block; width: 4px; height: 14px; border-radius: 2px; margin-right: 9px; vertical-align: -2px; background: linear-gradient(180deg, var(--gold), var(--mustard)); }
.card-head h2 { font: 600 13.5px var(--font); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A card title is never squeezed or cut: it keeps its line and the tools wrap below it when the row is full. */
.card-head { flex-wrap: wrap; row-gap: 8px; }
.card-head h2 { flex: 1 0 auto; min-width: min(100%, max-content); max-width: 100%; }
.card-head .tools { margin-left: auto; flex-wrap: wrap; }
.card-head h2 .sub { color: var(--muted); font-weight: 400; }
.card-head .tools { display: flex; align-items: center; gap: 8px; flex: none; }
.card-body { padding: 14px; overflow: auto; min-height: 0; flex: 1; }
.card-body.flush { padding: 0; }
.card-body.fixed { overflow: hidden; display: flex; flex-direction: column; }
.card-body.fixed > svg { flex: 1; min-height: 0; }
.card.dark { background: var(--asphalt); color: var(--chrome-text); border-color: var(--asphalt); }

/* ── Controls ─────────────────────────────────────────────────────────────── */
.btn { height: var(--control-h); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 500; font-size: 12.5px; text-decoration: none; white-space: nowrap; flex: none; }
.btn:hover { border-color: #CFCDC4; background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--asphalt); border-color: var(--asphalt); color: var(--paper); }
.btn.primary:hover { background: var(--chrome-3); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bar); }
.btn.danger { color: var(--red); border-color: rgba(179, 38, 30, 0.35); }
.btn.icon { width: var(--control-h); padding: 0; }
.btn svg { width: 14px; height: 14px; }
.input, .select, .textarea { height: var(--control-h); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 10px; outline: none; width: 100%; min-width: 0; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(20, 20, 22, 0.06); }
.select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E6D74' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.textarea { height: auto; min-height: 88px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.search { position: relative; display: inline-flex; align-items: center; width: 220px; flex: none; }
.search svg { position: absolute; left: 9px; width: 13px; height: 13px; color: var(--muted); }
.search .input { padding-left: 28px; }
.seg { display: inline-flex; height: var(--control-h); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); flex: none; }
.seg button { border: 0; background: transparent; padding: 0 11px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--asphalt); color: var(--paper); }
/* How many hubs? (the centre of gravity's pane): one chip a number, the full width; the suggested number has a gold dot. */
.seg.nchips { display: flex; width: 100%; }
.seg.nchips button { flex: 1; padding: 0; position: relative; font-variant-numeric: tabular-nums; }
.seg.nchips button:disabled { cursor: default; opacity: 0.35; }
.seg.nchips button.suggested::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.toggles button::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; border: 1.5px solid currentColor; vertical-align: 0; box-sizing: border-box; }
.toggles button.on::before { background: var(--marking); border-color: var(--marking); }
/* A narrow Explore panel (the build pane open beside it) keeps its title: the toggles in its header go compact, the
   dark fill alone saying which are on. */
@container bi-panel (max-width: 640px) {
  .bi-panel-head .toggles button { padding: 0 6px; font-size: 12px; }
  .bi-panel-head .toggles button::before { display: none; }
}
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; min-height: var(--control-h); }
.check input { width: 15px; height: 15px; accent-color: var(--asphalt); }

/* ── Badges, stats, empty ─────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--grey-bg); color: var(--ink-2); white-space: nowrap; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.badge { max-width: 100%; }
/* The words of a badge end in an ellipsis inside the pill when it has no room, never cut off by the cell edge. */
.badge > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 20%, transparent); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.dark { background: var(--asphalt); color: var(--paper); border-color: var(--asphalt); box-shadow: none; }
.badge.dark .dot { background: var(--paper); box-shadow: 0 0 0 2px rgba(247, 246, 241, 0.2); }
.stats { flex: none; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 11px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: var(--shadow); position: relative; isolation: isolate; overflow: hidden; transition: box-shadow 160ms ease, transform 160ms ease; }
.stat::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--mustard), var(--gold)); opacity: 0.55; }
.stat::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--motif-cells); background-position: right bottom; -webkit-mask-image: radial-gradient(110% 140% at 100% 100%, #000 0%, transparent 62%); mask-image: radial-gradient(110% 140% at 100% 100%, #000 0%, transparent 62%); }
.stat:hover { box-shadow: 0 1px 0 rgba(20, 20, 22, 0.04), 0 18px 36px -18px rgba(20, 20, 22, 0.35); }
@media (prefers-reduced-motion: no-preference) { .stat:hover { transform: translateY(-1px); } }
.stat .l { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font: 600 20px/1.2 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v.words { font: 600 18px/1.33 var(--font); letter-spacing: -0.01em; }
.stat .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s.good { color: var(--green); }
.stat .s.bad { color: var(--red); }
.stat.lit { border-color: var(--gold); }
.stat.lit::before { background: linear-gradient(90deg, var(--gold), var(--marking)); opacity: 1; height: 4px; }
.empty { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center; padding: 32px 20px; color: var(--muted); flex: 1; }
.empty-motif { position: relative; width: 260px; height: 64px; margin-bottom: 6px; }
.empty b { color: var(--ink); font-weight: 600; font-size: 14px; }
.empty .btn { margin-top: 8px; }
/* Loading (kit): the one loading state. The area dims (an overlay also blurs what it covers) under a dark pill with a
   yellow spinner and one plain line, which reads on light and dark surfaces alike. It fades in after 150 ms, so a
   quick load never flashes; a failure shows at once, in red, with Try again. */
.loading { display: flex; align-items: center; justify-content: center; animation: loading-in 160ms ease-out 150ms both; }
.loading.failed { animation: none; }
@keyframes loading-in { from { opacity: 0; visibility: hidden; } to { opacity: 1; visibility: visible; } }
.loading.block { flex: 1; align-self: stretch; min-height: 160px; border-radius: var(--radius); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.loading.overlay { position: absolute; inset: 0; z-index: 6; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); background: color-mix(in srgb, var(--paper) 55%, transparent); }
.loading-box { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; max-width: calc(100% - 32px); padding: 8px 22px 8px 18px; border-radius: 999px; background: var(--asphalt); color: var(--chrome-text); border: 1px solid color-mix(in srgb, var(--chrome-text) 16%, transparent); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--ink) 55%, transparent); font-size: 14px; font-weight: 600; line-height: 1.3; }
.loading-box > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loading-box .spinner { width: 20px; height: 20px; border-width: 2.5px; border-color: color-mix(in srgb, var(--chrome-text) 22%, transparent); border-top-color: var(--marking); }
.loading.failed .loading-box { background: var(--surface); color: var(--red); border-color: var(--red); padding-right: 8px; }
.loading.inline { display: inline-flex; justify-content: flex-start; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
.loading.inline .spinner { border-color: color-mix(in srgb, var(--ink) 18%, transparent); border-top-color: var(--gold); }
.loading.inline.failed { color: var(--red); }
/* A scenario's rerun in its row on the Scenarios list: a failure's words wrap in the cell, Try again under them. */
.rerun-row .loading.inline { flex-wrap: wrap; row-gap: 4px; white-space: normal; line-height: 1.3; }
/* Where an overlay sits, its container holds it. */
:is(.card, .modal-body, .page-body, .screen-tile, .focus-canvas):has(> .loading.overlay) { position: relative; }
.spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ── Tables ───────────────────────────────────────────────────────────────── */
/* One table design (the kit's DataTable; EditGrid and the figure tables follow it): one row height and one cell
   padding everywhere, the first and last columns on the card's gutter, so the first column lines up with the card
   title. Text left, figures right in tabular mono; every cell one line, cut with an ellipsis whose full text shows in
   a hover card. Even rows are banded and the row under the pointer is lit, both from the tokens. */
.table-wrap { flex: 1; min-height: 0; overflow: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; line-height: 1.35; table-layout: fixed; }
table.table thead { position: sticky; top: 0; z-index: 2; }
table.table thead tr { background-color: var(--head-ground); background-image: linear-gradient(90deg, var(--head-ground) 0%, var(--head-ground) 55%, transparent 100%), var(--motif-cells); background-size: 100% 100%, 240px 72px; background-repeat: no-repeat, repeat; background-position: 0 0, right -30px top -19px; }
/* A header sits on the bottom line of the header row, so a two-line heading and a one-line heading share a baseline. */
table.table th { background: transparent; text-align: left; vertical-align: bottom; font: 600 12px/1.25 var(--font); color: var(--ink-2); padding: 6px var(--cell-x) 9px; height: var(--row-h); border-bottom: 1px solid var(--head-rule); white-space: normal; overflow: hidden; overflow-wrap: normal; }
table.table th[aria-sort] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
table.table th .sort { display: inline-block; margin-left: 4px; font-size: 9px; color: var(--gold); vertical-align: 1px; }
table.table th.num .sort { margin-left: 0; margin-right: 4px; }
/* A cell that holds a control keeps the row height (the 32px control and 3px above and below) and gives the control the
   width of its column, so the value in it starts where the heading does. */
table.table td:has(> select, > input, > .btn, > span > .btn, > span > select, > .row-flex > input) { padding: 3px 4px; }
table.table td .input, table.table td .select { padding-left: 7px; }
table.table :is(th, td):first-child { padding-left: var(--gutter); }
table.table :is(th, td):last-child { padding-right: var(--gutter); }
table.table tr.groups th { height: 26px; padding-top: 6px; padding-bottom: 4px; font-size: 11px; letter-spacing: 0.02em; color: var(--mustard); border-bottom: 0; vertical-align: middle; }
table.table tr.groups th.group { text-align: center; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--gold) 55%, transparent), inset 1px 0 0 color-mix(in srgb, var(--gold) 25%, transparent); }
table.table th.sortable { cursor: pointer; user-select: none; }
table.table th.sortable:hover { color: var(--ink); }
table.table td { padding: 0 var(--cell-x); height: var(--row-h); border-bottom: 1px solid var(--line-soft); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background-clip: padding-box; }
/* A table wider than its card scrolls sideways with its first column (what each row is) held in place. */
table.table :is(th, td):first-child { position: sticky; left: 0; z-index: 1; }
table.table thead th:first-child { background-color: var(--head-ground); }
table.table tbody tr > td:first-child { background-color: var(--surface); }
table.table tbody tr:nth-child(even) > td { background-color: var(--row-band); }
table.table tbody tr > td { transition: background-color 120ms ease; }
table.table tbody tr:hover > td { background-color: var(--row-hover); }
table.table tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
table.table tbody tr:last-child > td { border-bottom-color: var(--line); }
/* A long name that may wrap (Column.wrap) runs to a second line inside the same row padding. */
table.table td.wrap { white-space: normal; overflow-wrap: normal; word-break: normal; padding-top: 6px; padding-bottom: 6px; }
/* A wide table of figures (every option on every measure) closes up its columns so each figure shows in full. */
.card.dense table.table :is(th, td) { padding-left: 7px; padding-right: 7px; }
.card.dense table.table :is(th, td):first-child { padding-left: var(--gutter); }
.card.dense table.table :is(th, td):last-child { padding-right: var(--gutter); }
table.table td.strong { font-weight: 600; }
table.table :is(td, th).num { text-align: right; }
table.table td.num { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.table :is(td, th).center { text-align: center; }
table.table tr.clickable { cursor: pointer; }
table.table tbody tr.selected > td { background: var(--cream); }
table.table tbody tr.selected > td:first-child { box-shadow: inset 3px 0 0 var(--marking); }
table.table tbody tr.total > td { font-weight: 600; border-top: 0; border-bottom: 0; box-shadow: inset 0 1px 0 var(--head-rule); background: var(--head-ground); position: sticky; bottom: 0; }
table.table tbody tr.total > td:first-child { box-shadow: inset 0 1px 0 var(--head-rule); }
table.table .muted { color: var(--muted); }
/* What sits in a cell keeps to the row: badges and people centred on the line, links quiet until hovered. */
table.table td .badge, table.table td .person { vertical-align: middle; }
table.table td a:not(.btn) { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold) 70%, transparent); text-underline-offset: 3px; }
table.table td a:not(.btn):hover { color: var(--mustard); text-decoration-color: currentColor; }
table.table td > .empty, table.table + .empty { padding: 28px 20px; }
.link-cell { appearance: none; border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; }
.link-cell:hover, .link-cell:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
/* A row that opens (DataTable expand): its chevron, and the full-width row under it that holds what lies behind it. */
table.table :is(td, th):first-child:has(> .row-chevron), table.table thead th:first-child:empty { padding-right: 4px; }
.row-chevron { width: 22px; height: 22px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; vertical-align: middle; }
.row-chevron:hover, .row-chevron:focus-visible { background: var(--grey-bg); color: var(--ink); }
.row-chevron .i { transition: transform 140ms ease; }
.row-chevron.on { color: var(--ink); }
.row-chevron.on .i { transform: rotate(90deg); }
/* A chevron that counts the rows it opens (SubRows), and those rows: the parent's columns, a shade lighter, marked at the left. */
.row-chevron.counted { width: auto; min-width: 22px; gap: 2px; padding: 0 4px 0 2px; grid-auto-flow: column; font-size: 11.5px; font-variant-numeric: tabular-nums; }
table.table tbody tr.sub-row > td { background: var(--surface-2); font-size: 12.5px; }
table.table tbody tr.sub-row > td:first-child { box-shadow: inset 3px 0 0 var(--marking); }
table.table tbody tr.sub-row:hover > td { background: var(--grey-bg); }
table.table tbody tr.sub-row.last > td { border-bottom-color: var(--line); }
/* What a scenario's actions share: the last line under them, so the rows add up to the scenario. */
table.table tbody tr.sub-row.sub-foot > td { font-style: italic; color: var(--ink-2); }
/* A scenario's theme (kit/theme.tsx): .theme-<key> sets --theme and --theme-tint for whatever sits inside it: the tag,
   a row's band at its left edge, a group's heading row, the pack's band. */
.theme-commercial { --theme: var(--theme-commercial); --theme-tint: var(--theme-commercial-bg); }
.theme-network { --theme: var(--theme-network); --theme-tint: var(--theme-network-bg); }
.theme-final_delivery { --theme: var(--theme-final_delivery); --theme-tint: var(--theme-final_delivery-bg); }
.theme-partner_usage { --theme: var(--theme-partner_usage); --theme-tint: var(--theme-partner_usage-bg); }
.theme-growth { --theme: var(--theme-growth); --theme-tint: var(--theme-growth-bg); }
.theme-overheads { --theme: var(--theme-overheads); --theme-tint: var(--theme-overheads-bg); }
.theme-programme { --theme: var(--theme-programme); --theme-tint: var(--theme-programme-bg); }
.theme-none { --theme: var(--line); --theme-tint: var(--grey-bg); }
.badge.theme { background: var(--theme-tint); color: var(--theme); }
.badge.theme.theme-none { color: var(--muted); border-style: dashed; }
.field[class*='theme-'] > .select { box-shadow: inset 4px 0 0 var(--theme); }
table.table tbody tr.themed > td:first-child { box-shadow: inset 4px 0 0 var(--theme); }
table.table tbody tr.group-row > td { height: 30px; padding-top: 0; padding-bottom: 0; background: var(--theme-tint); border-bottom: 1px solid color-mix(in srgb, var(--theme) 30%, var(--line)); box-shadow: inset 4px 0 0 var(--theme); }
table.table tbody tr.group-row:hover > td { background: var(--theme-tint); }
.group-head { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.badge.theme.solid { background: var(--theme); color: var(--surface); border-color: var(--theme); box-shadow: none; }
.badge.theme.solid.theme-none { background: var(--grey-bg); color: var(--muted); border-color: var(--line); }
/* A scenario's window (Modal theme): a band in its theme's colour across the head, its tag beside the title. */
.modal.themed > .modal-head { box-shadow: inset 0 4px 0 var(--theme); }
.modal-head h2 > .clip { display: inline-block; margin-left: 10px; vertical-align: 3px; font: 400 12px/1 var(--font); }
.group-head .n { font: 600 11px/1 var(--mono); color: var(--ink-2); }
.group-head .means { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; }
.also-in { flex: none; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; line-height: 16px; white-space: nowrap; cursor: default; }
table.table tbody tr.row-open > td.row-open-cell { height: auto; padding: 10px var(--gutter) 12px; white-space: normal; overflow: visible; background: var(--surface-2); box-shadow: inset 3px 0 0 var(--marking); }
table.table tbody tr.row-open:hover > td.row-open-cell { background: var(--surface-2); }
/* The opened row's breakdown: a line on what the figures mean, a compact waterfall, and its steps beside it. */
.step-breakdown { display: flex; flex-direction: column; gap: 8px; }
.step-head { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.step-head b { color: var(--ink); }
.step-grid { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(560px, 1.4fr); gap: 16px; align-items: start; }
.step-breakdown.compact .step-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.step-waterfall { display: flex; min-width: 0; }
.step-waterfall.fill { flex: 1; min-height: 0; }
/* A waterfall with a small card of figures under each bar, in line with it (StepWaterfall figures). */
.step-waterfall.with-figs { flex-direction: column; gap: 8px; }
.step-chart { flex: 1; min-height: 0; display: flex; }
.step-figs { flex: none; display: grid; gap: 4px; }
.step-fig { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 3px 8px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface-2); text-align: center; cursor: default; transition: border-color 120ms ease, background-color 120ms ease; }
.step-fig b { font: 600 12.5px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.step-fig.strong b { font-weight: 700; }
.step-fig b.bad { color: var(--red); }
.step-fig b.good { color: var(--green); }
.step-fig span { max-width: 100%; font: 400 11px var(--font); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-fig .badge { margin-top: 3px; max-width: 100%; font-family: var(--font); }
.step-fig.lit { border-color: var(--gold); background: var(--row-hover); }
.step-table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 12px; }
.step-table :is(th, td).grow { width: 100%; max-width: 0; }
.step-table td.num { overflow: visible; }
.step-table th.act-h { width: 64px; }
.step-table th { text-align: left; font: 600 11px var(--font); color: var(--muted); padding: 0 8px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-table td { padding: 0 8px; height: 22px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-table :is(th, td).num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.step-table td.act { text-align: right; color: var(--mustard); font-weight: 600; }
.step-table tr.strong td { font-weight: 700; border-bottom-color: var(--line); }
.step-table tr.muted td { color: var(--muted); font-style: italic; }
.step-table tr.lit td { background: var(--cream); }
/* An opened row's breakdown in a table (Cost to serve): one height at a glance, the waterfall filling it beside its
   steps, the steps scrolling in their own body under a sticky heading, and the whole held in view when the table
   scrolls sideways. The table's own row height and gutters do not reach the steps' table. */
table.table tr.row-open > td.row-open-cell { padding-top: 8px; padding-bottom: 10px; }
.table-wrap:has(td.row-open-cell) { container-type: inline-size; }
td.row-open-cell > .step-breakdown { position: sticky; left: var(--gutter); width: calc(100cqw - 2 * var(--gutter)); gap: 6px; }
/* Tall enough for a customer's twelve steps under their heading (337px), so they never scroll by a row. */
.step-breakdown:not(.compact) .step-grid { height: 340px; align-items: stretch; }
.step-breakdown:not(.compact) .step-waterfall.fill { height: 100%; min-height: 0; }
.step-table-wrap { min-width: 0; min-height: 0; }
.step-breakdown:not(.compact) .step-table-wrap { overflow: auto; scrollbar-width: thin; }
.step-breakdown:not(.compact) .step-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
table.table td.row-open-cell .step-table :is(th, td) { height: 25px; padding: 0 8px; line-height: 1.3; font-size: 12px; }
table.table td.row-open-cell .step-table th { height: auto; padding: 0 8px 5px; vertical-align: bottom; }
/* An analysis screen inside a dashboard tile reads at a glance: its card heads and footers sit tighter. */
.screen-tile .card-head { min-height: 40px; padding: 6px 12px; }
.screen-tile .table-foot { padding-top: 5px; padding-bottom: 5px; }
/* Explain: the working behind one figure, in a modal of fixed height so its tabs do not jump. */
.modal:has(.explain-body) { height: min(780px, calc(100vh - 48px)); }
.explain-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.explain-figure { flex: none; display: flex; align-items: center; gap: 12px; min-width: 0; }
.explain-value { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.explain-value b { font: 700 22px var(--mono); color: var(--ink); white-space: nowrap; }
.explain-value span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.explain-flag { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--red); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.explain-formula { flex: none; padding: 10px 12px; border-radius: var(--radius); background: var(--cream); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.explain-formula .w { font-size: 12.5px; color: var(--ink-2); }
.explain-formula .n { font: 600 12.5px var(--mono); color: var(--ink); }
.explain-formula .note-line, .explain-formula .why { font-size: 12px; color: var(--ink-2); }
.mono-s { font-family: var(--mono); font-size: 11.5px; }
/* A label with a badge or dot beside it (Revenue with its basis badge in a waterfall row). */
.row-flag { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.row-flag > .clip { min-width: 0; }
.row-flag > .badge { flex: none; }
/* Buttons side by side in a table cell or a modal footer (Team work's Done and Release). */
.row-actions { display: inline-flex; align-items: center; gap: 6px; }
/* A calculation's method in full (Team work): it scrolls inside the modal, which keeps its height. */
.calc-method { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); max-height: 300px; overflow: auto; white-space: pre-wrap; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
/* A revenue cell: its basis badge at the left, the figure at the right. */
.rev-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.rev-cell .badge { font-family: var(--font); }
.page-tabs .tab-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; padding-bottom: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 0; }
.page-tabs .tab-tools b { color: var(--ink); font-weight: 600; }
.page-tabs .tab-tools .meta { margin: 0; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
/* A kit button beside the tabs keeps its own look, not a tab's. */
.page-tabs .tab-tools .btn { height: var(--control-h); padding: 0 12px; margin-bottom: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.page-tabs .tab-tools .btn:disabled { opacity: 0.5; cursor: default; }
/* The pack page: who wrote its words, or that Claude is rewriting them. */
.pack-words { display: inline-flex; align-items: center; gap: 10px; }
.pack-words-state { font-size: 12.5px; color: var(--muted); outline: none; }
.pack-words-state.stale { color: var(--amber); font-weight: 600; }
.page-tabs .tab-tools .meta > * { white-space: nowrap; }
.hover-card { position: fixed; z-index: 1000; width: max-content; min-width: 160px; max-width: 320px; pointer-events: none; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow), 0 8px 24px rgba(20, 20, 22, 0.14); font-size: 12px; line-height: 1.4; color: var(--ink); }
.hover-card .head { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.hover-card .head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hover-card .head b { font: 700 14px var(--display); }
.hover-card .head span { color: var(--muted); font-size: 11px; }
.hover-card .head.only { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.hover-card .body { color: var(--ink-2); white-space: pre-line; }
.hover-card .body + .row { margin-top: 6px; }
.hover-card .row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
/* A long label wraps under itself and its figure keeps its line (up to 55% of the card), so a long label never squeezes the
   figure into a word a line (the Project plan's Benefits cards, 6 Nov 2026). */
.hover-card .row span { color: var(--muted); }
.hover-card .row > span { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.hover-card .row > b { flex: 0 0 auto; max-width: 55%; }
/* A row whose label carries a second line (a one-off's timing and source) wraps rather than pushing its figure out. */
.hover-card .row > span:has(> .hc-wrap) { flex: 1 1 auto; min-width: 0; }
.hover-card .row:has(> span > .hc-wrap) > b { flex: none; }
.hover-card .row b { font-weight: 600; font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 0; text-align: right; }
.hover-card .formula, .map-card .formula { margin: 0 0 6px; padding: 6px 8px; border-radius: 6px; background: var(--cream); border: 1px solid var(--line-soft); font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink); }
.hover-card .src, .map-card .src { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.hover-card .head + .src, .hover-card .src:first-child { margin: 0 0 6px; padding: 0 0 6px; border-top: 0; border-bottom: 1px solid var(--line-soft); }
.hover-card .src b, .map-card .src b { color: var(--ink-2); font-weight: 600; }
.hover-card .src .unsourced, .map-card .src .unsourced { color: var(--amber); font-weight: 600; }
.hover-card .foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.hover-card.wide { max-width: 460px; }
/* A long card in parts: on hover its first part and a line naming the rest; pinned (a click on its thing), it holds its
   place with a close at the top and its parts as tabs, the open part the card's one scroller. */
.hover-card .pin-hint { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); color: var(--mustard); font-size: 11px; font-weight: 600; }
.hover-card .hc-part.stacked + .hc-part.stacked { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.hover-card .hc-part.stacked > h4 { margin: 0 0 2px; font: 600 10.5px var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
/* A card that stays (a route's) can be moved onto and read. */
.hover-card.stay { pointer-events: auto; }
.hover-card.pinned { pointer-events: auto; width: 460px; max-height: calc(100vh - 16px); display: flex; flex-direction: column; z-index: 999; box-shadow: var(--shadow), 0 14px 36px rgba(20, 20, 22, 0.22); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.hover-card.pinned > * { flex: none; }
.hover-card.pinned .head { padding-top: 0; }
.hover-card.pinned .head .pick-close { margin: -4px -6px 0 0; }
.hover-card.pinned > .hc-part { flex: 1 1 auto; min-height: 0; overflow: auto; }
.hc-tabs { display: flex; gap: 2px; margin: 0 -12px 8px; padding: 0 8px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hc-tabs button { height: 28px; padding: 0 6px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); font: 500 11.5px var(--font); cursor: pointer; white-space: nowrap; }
.hc-tabs button:hover { color: var(--ink); }
.hc-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.hover-card .hc-table { margin-top: 6px; border-collapse: collapse; width: 100%; font-size: 11px; }
.hover-card .hc-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 2px 8px 3px 0; border-bottom: 1px solid var(--line-soft); }
.hover-card .hc-table td { padding: 1px 8px 1px 0; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.hover-card .hc-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hover-card .hc-table tfoot td { color: var(--muted); padding-top: 3px; }
.pager { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; }
.table-foot { flex: none; border-top: 1px solid var(--line-soft); padding: 8px 14px; font-size: 12px; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.amber-text { color: var(--amber); font-weight: 600; font-size: 11px; }
.day-dots, .day-letters > span { display: inline-flex; gap: 5px; vertical-align: middle; }
.day-dots i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--line); box-sizing: border-box; }
.day-dots i.on { background: var(--ink-2); border-color: var(--ink-2); }
.day-dots i.changed { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber-bg); }
.day-dots i.on.changed { background: var(--amber); }
.day-letters { display: inline-flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.day-letters i { width: 11px; text-align: center; font: 600 10px var(--mono); font-style: normal; color: var(--muted); }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
/* A small colour key before a word in a table cell (who delivered a sector, on Catchments). */
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bar-cell { display: flex; align-items: center; gap: 8px; }
.track { flex: 1; height: 10px; border-radius: 5px; background: var(--bar); box-shadow: inset 0 1px 1px rgba(20, 20, 22, 0.06); overflow: hidden; min-width: 40px; display: block; }
.track i { display: block; height: 100%; border-radius: 5px; background-color: var(--ink-2); background-image: var(--motif-fine); background-size: 48px 24px; }
.track i.over { background-color: var(--red); }
.mix { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bar); box-shadow: inset 0 1px 1px rgba(20, 20, 22, 0.06); }
.mix i { display: block; height: 100%; background-image: var(--motif-fine); background-size: 48px 24px; }
.mix i + i { box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.6); }
.bar-cell { display: flex; align-items: center; gap: 8px; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(20, 20, 22, 0.42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
/* Four sizes, chosen by what the modal holds (see Modal in the kit): sm a confirmation or one choice, md a record form,
   lg a wide form or a form with a short table, xl a table, grid or preview. None is ever wider than the window allows. */
.modal { --modal-w: 720px; background: var(--surface); border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(20, 20, 22, 0.5); display: flex; flex-direction: column; max-height: calc(100vh - 48px); width: min(var(--modal-w), calc(100vw - 48px)); overflow: hidden; }
.modal.sm { --modal-w: 480px; } .modal.lg { --modal-w: 1040px; } .modal.xl { --modal-w: 1360px; height: calc(100vh - 48px); }
/* Nearly the whole screen: a record that opens on a summary (a scenario's map, actions and waterfall). */
.modal-overlay:has(> .modal.full) { padding: 16px; }
.modal.full { --modal-w: 100vw; width: calc(100vw - 32px); height: calc(100vh - 32px); max-height: calc(100vh - 32px); }
/* A scenario's master waterfall under its actions: a fixed share of the column, the actions table scrolling above it. */
.card.summary-waterfall { flex: 0 0 46%; }
.modal-head { flex: none; padding: 16px 20px 14px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.modal-head .close { position: relative; }
.modal-head .eyebrow { font-size: 11.5px; color: var(--mustard); font-weight: 600; margin-bottom: 2px; }
.modal-head h2 { font: 700 18px/1.25 var(--display); }
.modal-head .desc { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.modal-head .close { margin-left: auto; border: 0; background: transparent; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); flex: none; }
.modal-head .close:hover { background: var(--bar); color: var(--ink); }
.modal-tabs { flex: none; display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.modal-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px; }
.modal-body.fill { overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.modal-foot .spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check-row { display: flex; align-items: center; gap: 8px; min-height: var(--control-h); font-size: 13px; color: var(--ink); cursor: pointer; }
.check-row input { width: 15px; height: 15px; margin: 0; accent-color: var(--asphalt); flex: none; }
.card > .table-foot { border-top: 1px solid var(--line-soft); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.form-error { margin-top: 12px; padding: 8px 12px; border-radius: var(--radius); background: var(--red-bg); color: var(--red); font-size: 12.5px; }
.note { padding: 9px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--ink-2); font-size: 12.5px; }
.note.warn { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.note.bad { background: var(--red-bg); border-color: transparent; color: var(--red); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--asphalt); color: var(--paper); padding: 10px 16px; border-radius: 10px; z-index: 60; font-size: 13px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.4); max-width: 640px; }
.toast.bad { background: var(--red); }

/* ── Lists, key-values, misc ──────────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.list .item:last-child { border-bottom: 0; }
.list .item.clickable { cursor: pointer; }
.list .item.clickable:hover { background: var(--surface-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend .line-glyph { display: inline-block; margin-right: 5px; vertical-align: 0; }
.legend .toggle { cursor: pointer; user-select: none; }
.legend .toggle.off { opacity: 0.4; text-decoration: line-through; }
.prose { font-size: 13px; line-height: 1.6; color: var(--ink-2); max-width: 78ch; }
.prose p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.mustard { color: var(--mustard); }
.good { color: var(--green); }
.bad { color: var(--red); }
.row-flex { display: flex; gap: 8px; align-items: center; }
.rival-chip { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.row-flex:has(> .rival-chip) { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.map-host { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--paper); }
/* The stage holds still and takes every pointer; the pan wrapper inside it is its own GPU layer, moved by a CSS
   transform while a gesture runs, so panning and zooming repaint nothing. The svg may paint beyond its box, so a
   pan shows the land just outside the frame rather than an empty edge. */
.map-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.map-pan { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-pan > svg { display: block; overflow: visible; }
/* Dragging across the map never selects its place names. */
.map-host, .map-host svg, .map-host svg text { -webkit-user-select: none; user-select: none; }
/* While a pan or wheel zoom runs, nothing in the map is hit tested, so hover handlers stay quiet. */
.map-stage.moving svg { pointer-events: none; }
/* A screen that drops pins on the map (Centre of gravity): the map itself takes a crosshair, markers keep theirs. */
.map-stage.placing { cursor: crosshair; }
.map-overlay { position: absolute; left: 12px; bottom: 10px; max-width: calc(52% - 12px); background: rgba(247, 246, 241, 0.92); border-radius: 8px; padding: 6px 10px; }
.map-tools { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; gap: 4px; }
.map-tools .btn { background: rgba(255, 255, 255, 0.94); }
.map-layers { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: calc(100% - 190px); }
.map-layers .seg { background: rgba(255, 255, 255, 0.96); }
/* The map's sources behind an i at its corner; its key compact, folding to one Key button. */
.map-info { position: absolute; right: 10px; bottom: 10px; z-index: 2; background: rgba(255, 255, 255, 0.94); }
.map-overlay { padding: 5px 8px; max-width: calc(46% - 12px); }
.map-key { gap: 3px 10px; font-size: 10.5px; line-height: 1.25; }
.map-key.folded { display: block; }
.map-key-toggle { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px 0 2px; border: 0; border-radius: 6px; background: transparent; font: 700 10.5px var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; }
.map-key-toggle:hover { background: rgba(20, 20, 22, 0.06); color: var(--ink); }
.map-key:not(.folded) .map-key-toggle { flex-basis: 100%; justify-content: flex-start; height: 18px; }
.map-overlay:has(.map-key.folded) { padding: 3px 4px; }
/* Full screen: the map fills the window as an overlay on <body>; Escape or the close button returns it. */
.map-full { position: fixed; inset: 0; z-index: 900; background: var(--paper); display: flex; flex-direction: column; }
.map-full > .map-host { flex: 1; }
/* The hover card for a demand cell: a styled card that follows the cursor, never a native tooltip. */
.map-card { position: absolute; z-index: 3; width: 240px; pointer-events: none; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow), 0 8px 24px rgba(20, 20, 22, 0.14); font-size: 12px; line-height: 1.4; color: var(--ink); }
.map-card.wide { width: 360px; }
.map-card .head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.map-card .head b { flex: none; white-space: nowrap; font: 700 16px var(--display); }
/* The postcode on one line, what and where it is in full on the line under it. */
.map-card .head span { color: var(--muted); font-size: 11px; }
.map-card .row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.map-card .row span { color: var(--muted); white-space: nowrap; }
.map-card .row b { font-weight: 600; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.map-card .foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); color: var(--mustard); font-weight: 600; }
.map-card .foot span { color: var(--muted); font-weight: 400; }
/* A map with a panel docked beside it (a pinned route): the map narrows, the panel never covers it. */
.map-dock { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.map-dock > .map-col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dock-panel { flex: none; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.dock-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line-soft); }
.dock-head h3 { margin: 0; font: 700 15px var(--display); white-space: nowrap; }
.dock-head span { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.dock-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.dock-body > .dock-top { flex: none; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line-soft); }
.dock-body .dock-table { display: contents; }
.dock-body .card { flex: 1; border: 0; border-radius: 0; box-shadow: none; }
.dock-body .link-cell { display: block; max-width: 100%; }
.dock-body table.table { --row-h: 30px; --cell-x: 8px; font-size: 12px; }
.dock-body table.table tr.divider td { height: 26px; background: var(--surface-2); color: var(--mustard); font-size: 11.5px; font-weight: 600; text-align: center; }
.dock-foot { flex: none; padding: 7px 14px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.dock-foot .how { color: var(--ink-2); font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; margin: 0; font-size: 12px; }
.fact-grid > div { display: flex; gap: 8px; min-width: 0; justify-content: space-between; }
.fact-grid dt { color: var(--muted); flex: none; }
.fact-grid dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; font-variant-numeric: tabular-nums; }
.dock-sum { padding: 6px 8px; border-radius: 6px; background: var(--cream); border: 1px solid var(--line-soft); font-family: var(--mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outcome-bar { min-width: 280px; display: flex; flex-direction: column; gap: 4px; }
.outcome-bar .bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--line-soft); }
.outcome-bar .bar i { display: block; height: 100%; }
.outcome-bar .counts { display: flex; gap: 12px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.outcome-bar .counts i, .outcome-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.outcome-dot { width: 10px; height: 10px; margin: 0; vertical-align: -1px; }
.hover-card .body .formula { margin: 6px 0; white-space: nowrap; }
.hover-card .body .outcome-bar { white-space: normal; }
/* A customer's day: what the view shows and what to look for, above the map. */
.map-brief { flex: none; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.map-brief .what { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-brief .figs { display: flex; gap: 14px; align-items: center; color: var(--muted); white-space: nowrap; min-width: 0; }
.map-brief .figs b { color: var(--ink); font-variant-numeric: tabular-nums; }
.map-brief .look { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-head { display: flex; align-items: flex-start; gap: 6px; }
.pick-head .grow > span { display: block; font-size: 11.5px; }
.pick-close { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; margin: -3px -4px 0 0; }
.pick-close:hover { background: rgba(20, 20, 22, 0.08); color: var(--ink); }

/* ── Sign-in and front ─────────────────────────────────────────────────────── */
.solo { height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--asphalt); }
.solo .motif { position: relative; overflow: hidden; }
.solo .motif svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.solo .panel { background: var(--paper); display: flex; flex-direction: column; justify-content: center; padding: 0 9vw; gap: 18px; }
.solo .panel h1 { font: 700 30px/1.15 var(--display); }
.solo .panel p { color: var(--muted); margin: 0; }
.solo form { display: flex; flex-direction: column; gap: 12px; max-width: 380px; }

/* ── Print (report) ────────────────────────────────────────────────────────── */
@media print {
  html, body { overflow: visible; height: auto; background: #fff; }
  .print-hide { display: none !important; }
}
/* Report › Recommended plan: what to check before the total goes to the customer, a line each. */
.plan-tab { overflow-y: auto; padding-bottom: 4px; }
.plan-tab > * { flex: none; }
.plan-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.45; }
/* The scenario list with verifiers (/print/[ws]/verifiers): a plain page to print. */
.print-list { max-width: 1100px; margin: 0 auto; padding: 32px 24px; background: #fff; color: var(--ink); overflow: auto; height: 100%; }
.print-list header { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; align-items: flex-start; }
.print-list h1 { font: 700 22px/1.2 var(--display); }
.print-list p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 80ch; }
.print-list table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.print-list th, .print-list td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.print-list th { font-weight: 600; font-size: 11.5px; color: var(--muted); }
.print-list .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.print-list footer { margin-top: 18px; font-size: 11px; color: var(--muted); }
@media print { .print-list { padding: 0; max-width: none; } .print-list tr { break-inside: avoid; } }

/* ── Overview: the next step and the study checklist ─────────────────────── */
.hero-card { position: relative; background: var(--asphalt); color: var(--paper); border-color: var(--asphalt); }
.hero-motif { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 72%); mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 72%); }
.hero-motif svg { width: 100%; height: 100%; display: block; }
.hero-body { position: relative; z-index: 1; margin-top: auto; padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 8px; }
.hero-eyebrow { font: 600 12px var(--font); color: var(--marking); letter-spacing: 0.02em; }
.hero-body h2 { font: 700 26px/1.15 var(--display); letter-spacing: -0.01em; }
.hero-body p { margin: 0; color: rgba(247, 246, 241, 0.78); font-size: 14px; line-height: 1.5; }
.hero-body .hero-detail { color: rgba(247, 246, 241, 0.6); font-size: 12.5px; }
.hero-btn { align-self: flex-start; margin-top: 8px; background: var(--paper); color: var(--ink); border-color: var(--paper); }
.hero-btn:hover { background: #fff; }
.hero-progress { height: 4px; border-radius: 2px; background: rgba(247, 246, 241, 0.16); margin-top: 14px; overflow: hidden; }
.hero-progress i { display: block; height: 100%; background: var(--paper); border-radius: 2px; }
.hero-foot { font-size: 12px; color: rgba(247, 246, 241, 0.55); }
.list .item.step { gap: 14px; padding: 11px 16px; }
.list .item.step .grow { flex: 1 1 50%; }
.step-detail { flex: 0 1 auto; max-width: 45%; font-size: 12px; line-height: 1.4; text-align: right; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.step-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 11.5px var(--mono); color: var(--muted); border: 1.5px solid var(--line); background: var(--surface); }
.list .item.step.done .step-mark { background: var(--asphalt); border-color: var(--asphalt); color: var(--paper); }
.list .item.step.done b { color: var(--muted); font-weight: 500; }
.list .item.step.now { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.list .item.step.now .step-mark { border-color: var(--ink); color: var(--ink); }
.stage-tile { border-radius: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.stage-tile.now { background: var(--asphalt); color: var(--paper); border-color: var(--asphalt); }

/* ── Motif layers ────────────────────────────────────────────────────────── */
.motif-layer svg { width: 100%; height: 100%; display: block; }
main.main { position: relative; }
main.main > .page { position: relative; z-index: 1; }
.app-header { position: relative; overflow: hidden; }
.app-header > *:not(.motif-layer) { position: relative; }

/* ── Nav footer: guide, issues, account ──────────────────────────────────── */
.nav-foot .nav-single { height: 30px; font-size: 12.5px; color: var(--chrome-muted); font-weight: 500; }
.nav-foot .nav-single:hover { color: var(--chrome-text); }
.nav-foot .nav-single.active { color: var(--chrome-text); }
.nav-foot .nav-person { height: 28px; margin: 0 2px; font-size: 12px; background: var(--chrome-2); color: var(--chrome-text); border-color: transparent; }
.nav-account { position: relative; margin-top: 6px; border-radius: var(--radius); background: var(--chrome-2); padding: 9px 10px; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.nav-account .who { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nav-account .who b { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-account .who span { font-size: 11px; color: var(--chrome-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-account .out { position: relative; flex: none; width: 28px; height: 28px; border-radius: 6px; border: 0; background: transparent; color: var(--chrome-muted); cursor: pointer; display: grid; place-items: center; }
.nav-account .out:hover { background: var(--chrome-3); color: var(--chrome-text); }
.nav-version { display: block; margin: 5px 2px 0; font: 400 10.5px var(--mono); color: var(--chrome-muted); opacity: 0.55; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.nav-version:hover { opacity: 0.9; }

/* Settings > Release notes: a band across the table for each release, then one row a change. */
.release-notes table.table tr.divider td { height: 34px; background: var(--surface-2); border-top: 1px solid var(--line); }
.release-band { display: flex; align-items: center; gap: 10px; min-width: 0; }
.release-band b { font: 600 13px var(--mono); color: var(--ink); }
.release-band > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.release-band .headline { color: var(--ink); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.release-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 3px 0; }
.release-line b { font-weight: 600; }
.release-line b.fix { font-weight: 500; }
.release-line p { flex-basis: 100%; margin: 0; color: var(--muted); line-height: 1.45; max-width: 120ch; }

/* ── Guide drawer ────────────────────────────────────────────────────────── */
.drawer-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(20, 20, 22, 0.25); display: flex; justify-content: flex-end; }
.drawer { width: 420px; height: 100%; background: var(--surface); display: flex; flex-direction: column; box-shadow: -20px 0 60px -30px rgba(20, 20, 22, 0.5); }
.drawer-head { position: relative; flex: none; background: var(--asphalt); color: var(--paper); padding: 22px 22px 18px; overflow: hidden; display: flex; gap: 12px; }
.drawer-head > div:not(.drawer-motif) { flex: 1; min-width: 0; position: relative; z-index: 1; }
.drawer-head .close { z-index: 1; }
/* The Ask panel's name in the brand's yellow gradient, as on a lit stat. */
.ask-brand { font: 700 13px var(--font); letter-spacing: 0.02em; background: linear-gradient(90deg, var(--gold), var(--marking)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.drawer-motif { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%); mask-image: linear-gradient(90deg, transparent 0%, #000 70%); }
.drawer-motif svg { width: 100%; height: 100%; display: block; }
.drawer-head h2 { font: 700 21px/1.2 var(--display); margin: 4px 0 6px; overflow-wrap: anywhere; }
.drawer-head p { margin: 0; color: rgba(247, 246, 241, 0.75); font-size: 13px; line-height: 1.5; }
.drawer-head .close { position: relative; align-self: flex-start; border: 0; background: rgba(255, 255, 255, 0.08); color: var(--paper); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.drawer-tabs { flex: none; display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 22px 22px; font-size: 13px; line-height: 1.55; }
.drawer-body h3 { font: 600 12.5px var(--font); color: var(--mustard); margin: 16px 0 8px; }
.drawer-body h3:first-child { margin-top: 0; }
.guide-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.guide-terms { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.guide-terms dt { font-weight: 600; }
.guide-terms dd { margin: 0; color: var(--ink-2); }
/* The How it works guide (kit Guide): over the right of the screen, so the page under it never moves. Its body scrolls
   inside itself; headings, paragraphs and terms each keep their own spacing. */
.drawer.guide { width: min(520px, calc(100vw - 48px)); }
.guide-overlay { background: rgba(20, 20, 22, 0.18); }
.guide-body { display: flex; flex-direction: column; gap: 18px; padding: 18px 24px 28px; font-size: 13px; line-height: 1.55; color: var(--ink); }
.guide-sec { display: flex; flex-direction: column; gap: 8px; }
.guide-sec h3 { margin: 0; font: 600 12.5px var(--font); letter-spacing: 0.02em; color: var(--mustard); }
.guide-sec + .guide-sec { padding-top: 16px; border-top: 1px solid var(--line-soft); }
.guide-sec p { margin: 0; color: var(--ink-2); }
.guide-sec p b { color: var(--ink); }
.guide-sec .guide-terms { gap: 10px; }
.guide-terms > div { display: flex; flex-direction: column; gap: 3px; }
.guide-terms dt { color: var(--ink); }
.guide-terms dt .badge { font-weight: 500; }
.guide-terms dd b { color: var(--ink); }
/* A guide still built from a DockPanel straight inside a page: lifted over the screen like the kit Guide, so it never
   pushes the page body away, and its prose spaced and scrolling. Move these to <Guide> (kit). */
.page > .dock-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; max-width: calc(100vw - 48px); box-shadow: -20px 0 60px -30px rgba(20, 20, 22, 0.5); }
.page > .dock-panel .dock-body { overflow: auto; }
.dock-body > .prose { padding: 16px 22px 24px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.dock-body > .prose h3 { margin: 10px 0 0; font: 600 12.5px var(--font); color: var(--mustard); }
.dock-body > .prose h3:first-child { margin-top: 0; }
.dock-body > .prose p { margin: 0; }
.dock-body > .prose b { color: var(--ink); }

/* Ask Hubshape (components/shell/ask-drawer): the screen stays visible and usable beside it, so no dimming. */
.drawer-overlay.see-through { background: transparent; pointer-events: none; }
.drawer-overlay.see-through .drawer { pointer-events: auto; border-left: 1px solid var(--line); }
.ask-body { display: flex; flex-direction: column; }
.ask-starters h3 { margin-top: 0; }
.ask-starters .list { margin: 0 -22px; border-top: 1px solid var(--line-soft); }
.ask-starter { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; padding: 11px 22px !important; font: inherit; color: inherit; }
.ask-starter .grow { flex: 1; min-width: 0; }
.ask-starter .i { flex: none; color: var(--muted); }
/* The thing the panel is open on: a line under the head, its card on hover, a cross back to the whole screen. */
.ask-focus { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 22px; height: 40px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; }
.ask-focus .grow { flex: 1; min-width: 0; }
.ask-focus .pick-close { margin: 0; }
.ask-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-actions { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.ask-raised { margin-top: 12px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-soft); font-size: 12.5px; }
.ask-raised .grow { flex: 1; min-width: 0; }
.ask-raise { display: flex; flex-direction: column; gap: 12px; }
.ask-raise h3 { margin: 0; }
.ask-raise p { margin: 0; }
.ask-raise .textarea { min-height: 120px; }
.ask-raise-row { display: flex; gap: 10px; align-items: flex-end; }
.ask-raise-row .field { flex: 1; min-width: 0; }
/* The one Ask button (kit/ask): a 32px button with the Ask mark; icon-only in a card's head. */
.btn.ask-btn .i { color: var(--mustard); }
.btn.ask-btn.icon-only { width: var(--control-h); padding: 0; justify-content: center; }
/* The page's Ask (kit PageAsk): a quiet outline button whose Ask mark says what it is, at the far right of the tab bar or
   the line under the title (Rob, 27 Oct 2026: no yellow fill). */
.btn.page-ask { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn.page-ask:hover { background: var(--grey-bg); border-color: var(--line); }
.btn.page-ask .i { color: var(--mustard); }
:is(.page-tabs, .modal-tabs) .tab-end { flex: none; align-self: stretch; margin-left: auto; padding: 0 0 0 12px; display: flex; align-items: center; }
:is(.page-tabs, .modal-tabs) .tab-tools + .tab-end { margin-left: 0; }
/* The tab bars' button rule (36px, no border) is for tabs: the Ask at the end is a 28px outline button, so it sits inside
   the 36px bar above its bottom line. */
:is(.page-tabs, .modal-tabs) .tab-end .btn.page-ask { height: 28px; padding: 0 10px; margin-bottom: 0; border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.page-header .sub-row { display: flex; align-items: center; gap: 16px; margin-top: 4px; min-height: var(--control-h); }
.page-header .sub-row .blurb { margin: 0; flex: 1; min-width: 0; }
.page-header .sub-row .page-ask { margin-left: auto; }
.hover-card .hc-ask { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); display: flex; }
.modal-head .modal-ask { margin-left: auto; position: relative; flex: none; }
/* The Ask panel opens over a window (a scenario's), so the window stays in view beside it. */
.drawer-overlay.see-through { z-index: 60; }
.ask-thread { display: flex; flex-direction: column; gap: 12px; }
.ask-msg { display: flex; flex-direction: column; gap: 4px; }
.ask-msg p { margin: 0 0 6px; }
.ask-msg ul { margin: 0 0 6px; padding-left: 18px; }
.ask-msg.user { align-self: flex-end; max-width: 85%; background: var(--grey-bg); border-radius: var(--radius); padding: 8px 10px; }
.ask-msg.user p { margin: 0; }
.ask-msg.error { color: var(--muted); }
/* Ask Hubshape's change card: a change it proposed, for the person to confirm or dismiss (ask-change-card.tsx). */
.ask-change { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; }
.ask-change.done { border-color: var(--green); }
.ask-change.dismissed { flex-direction: row; align-items: center; gap: 8px; color: var(--muted); background: var(--surface-2); border-color: var(--line-soft); }
.ask-change .grow { flex: 1; min-width: 0; }
.ask-change p { margin: 0; }
.ask-change-head { display: flex; align-items: center; gap: 8px; }
.ask-change-rows { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; margin: 0; }
.ask-change-rows dt { color: var(--muted); }
.ask-change-rows dd { margin: 0; overflow-wrap: anywhere; }
.ask-change-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ask-change .error-text { color: var(--red); }
.ask-sources { font-size: 12px; color: var(--muted); }
.ask-cite { color: var(--ink); text-decoration: underline; text-decoration-color: var(--mustard); text-underline-offset: 2px; }
.ask-meta { font: 500 11px var(--mono); color: var(--muted); }
.ask-foot { flex: none; display: flex; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.ask-foot .input { flex: 1; }

.drawer-tabs button { height: 38px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.drawer-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.drawer-tabs .count { font: 500 11px var(--mono); color: var(--muted); background: var(--grey-bg); border-radius: 10px; padding: 1px 6px; }
.guide-task { border: 0; background: transparent; text-align: left; width: 100%; padding: 11px 0 !important; border-bottom: 1px solid var(--line-soft) !important; cursor: pointer; }
.guide-tasks { margin: 0; padding-left: 0; list-style: none; counter-reset: g; display: flex; flex-direction: column; gap: 16px; }
.guide-tasks li { counter-increment: g; position: relative; padding-left: 34px; }
.guide-tasks li::before { content: counter(g); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font: 600 11.5px var(--mono); }
.guide-tasks p { margin: 2px 0 8px; color: var(--ink-2); }
/* The User guide tab: the PDF's cover in small, the download, and its chapters. */
.guide-book { position: relative; height: 132px; border-radius: 12px; overflow: hidden; background: var(--asphalt); color: var(--paper); padding: 18px 18px 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; margin-bottom: 12px; }
.guide-book > *:not(.guide-book-motif) { position: relative; }
.guide-book-motif { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 65%); mask-image: linear-gradient(90deg, transparent 0%, #000 65%); }
.guide-book-motif svg { width: 100%; height: 100%; display: block; }
.guide-book-mark { position: absolute !important; top: 16px; left: 18px; font: 700 16px/1 var(--display); letter-spacing: -0.03em; }
.guide-book-mark span:last-child { color: var(--marking); }
.guide-book b { font: 700 26px/1.05 var(--display); letter-spacing: -0.03em; color: var(--paper); }
.guide-book > span:last-child { font-size: 12px; color: var(--chrome-muted); }
.guide-download { width: 100%; justify-content: center; margin-bottom: 10px; }
.guide-chapters { margin: 0; padding-left: 22px; columns: 2; column-gap: 26px; color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.guide-chapters li { break-inside: avoid; margin-bottom: 3px; }
.guide-chapters li::marker { font: 500 11px var(--mono); color: var(--mustard); }

/* ── Welcome (first visit to a workspace) ────────────────────────────────── */
.welcome { width: 980px; height: 600px; max-height: calc(100vh - 48px); display: grid; grid-template-columns: 300px 1fr; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(20, 20, 22, 0.5); }
.welcome-rail { position: relative; background: var(--asphalt); color: var(--paper); padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.welcome-rail > *:not(.motif-layer) { position: relative; }
.welcome-rail h2 { font: 700 24px/1.15 var(--display); margin: 0; }
.welcome-rail .count { font: 500 12px var(--mono); color: var(--chrome-muted); }
.welcome-bar { display: flex; gap: 4px; }
.welcome-bar i { flex: 1; height: 4px; border-radius: 2px; background: rgba(247, 246, 241, 0.16); }
.welcome-bar i.done { background: var(--paper); }
.welcome-bar i.now { background: var(--marking); }
.welcome-steps { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.welcome-steps button { text-align: left; border: 0; background: transparent; color: var(--chrome-muted); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.welcome-steps button.on { background: var(--chrome-3); color: var(--chrome-text); }
.welcome-main { display: flex; flex-direction: column; min-height: 0; }
.welcome-scene { flex: 1; min-height: 0; padding: 30px 34px 10px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.welcome-scene h3 { font: 700 22px/1.2 var(--display); margin: 0; }
.welcome-scene p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; max-width: 62ch; }
.welcome-foot { flex: none; display: flex; gap: 8px; padding: 14px 34px 22px; }
.welcome-foot .spacer { flex: 1; }
.welcome-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.welcome-words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.welcome-words div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.welcome-words span { display: block; font: 500 11px var(--mono); color: var(--muted); }
.welcome-words b { font-size: 15px; }

/* People in tables: initials on a disc toned by the name, then the name. */
.person { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; vertical-align: middle; }
.person > b { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 9px/1 var(--font); letter-spacing: 0.02em; background: var(--grey-bg); color: var(--ink-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent); }
.person > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.person.t1 > b { background: var(--asphalt); color: var(--paper); box-shadow: none; }
.person.t2 > b { background: var(--cream); color: var(--mustard); }
.person.t3 > b { background: var(--blue-bg); color: var(--blue); }
.person.t4 > b { background: var(--green-bg); color: var(--green); }

/* Form controls inside table cells: they keep inside the cell, and the cell never shows an ellipsis beside them. */
table.table td:has(> select, > input, > textarea, > .btn, > span > .btn, > span > select, > .row-flex) { text-overflow: clip; }
table.table td > input[type='checkbox'] { width: 15px; height: 15px; margin: 0; vertical-align: middle; accent-color: var(--asphalt); }
table.table td .select, table.table td .input { max-width: 100%; min-width: 0; }
table.table td > .select, table.table td > .input, table.table td > span > .select { width: 100% !important; }
.stale-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-left: 6px; vertical-align: 1px; box-shadow: 0 0 0 2px rgba(212, 158, 0, 0.22); }

/* A heading that opens with a workspace word ("pallets a year") still starts with a capital. */
table.table th::first-letter { text-transform: uppercase; }

/* ── Report: sections of text and live figures ───────────────────────────── */
.report-doc { display: flex; flex-direction: column; gap: 18px; max-width: 920px; }
.report-block { position: relative; }
.report-block .prose { max-width: 78ch; }
.fig-val { font-weight: 600; color: var(--ink); border-bottom: 1.5px dotted var(--gold); cursor: help; white-space: nowrap; }
.fig-val:focus { outline: 2px solid var(--marking); outline-offset: 1px; }
.fig-val.missing { color: var(--red); font-family: var(--mono); font-size: 0.85em; border-bottom-color: var(--red); }
.report-block > .block-tools { position: absolute; top: -6px; right: 0; }
.block-tools { display: inline-flex; gap: 2px; opacity: 0; transition: opacity 120ms ease; background: var(--surface); border-radius: var(--radius); }
.report-block:hover .block-tools, .block-tools:focus-within { opacity: 1; }
.block-tools .btn { width: 28px; height: 28px; }

.figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.figure-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); background: var(--head-ground); min-height: 44px; }
.figure-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-no { color: var(--mustard); font-weight: 700; margin-right: 8px; }
.figure-tools { display: inline-flex; }
.figure-tools .block-tools { opacity: 1; background: transparent; }
.figure-caption { margin: 10px 12px 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.figure-chart { display: block; width: 100%; height: auto; padding: 10px 12px 2px; }
.figure-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 12px 0; font-size: 11.5px; color: var(--muted); }
.figure-legend .k { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }
.figure-legend .k.circle { border-radius: 50%; }
.figure-legend .k.line { height: 2px; vertical-align: 3px; width: 14px; }
.figure-legend .k.ring { border-radius: 50%; border: 2px solid; background: transparent; }
/* A figure's table follows the app's table: the same row height, cell padding, header, band and figures. */
.figure-table { padding: 4px 0 8px; overflow-x: auto; }
.figure-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.35; }
.figure-table th { text-align: left; vertical-align: bottom; font: 600 12px/1.25 var(--font); color: var(--ink-2); padding: 6px var(--cell-x) 9px; border-bottom: 1px solid var(--head-rule); white-space: nowrap; }
.figure-table td { padding: 0 var(--cell-x); height: var(--row-h); border-bottom: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.figure-table :is(th, td):first-child { padding-left: var(--gutter); }
.figure-table :is(th, td):last-child { padding-right: var(--gutter); }
.figure-table tbody tr:nth-child(even) td { background: var(--row-band); }
/* The first column names the row (an option, a customer): it wraps, so the figures beside it stay in view. */
.figure-table td:first-child { white-space: normal; min-width: 150px; padding-top: 6px; padding-bottom: 6px; }
.figure-table .num { text-align: right; }
.figure-table td.num { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.figure-table th.num { font-family: var(--font); }
.figure-table td.strong { font-weight: 600; }
.figure-table tr.lit td { background: var(--cream); }
.figure-table tr.lit td:first-child { box-shadow: inset 3px 0 0 var(--marking); }
.figure-table tr.muted td { color: var(--muted); }
.figure-table tr.total td { font-weight: 600; background: var(--head-ground); border-bottom: 0; box-shadow: inset 0 1px 0 var(--head-rule); }
.figure-measures { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.figure-measures > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-width: 0; }
.figure-measures .l { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-measures .v { font: 600 18px/1.2 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.figure-measures .d { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-measures .d.good { color: var(--green); } .figure-measures .d.bad { color: var(--red); }
.figure-sources { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 7px 12px; border-top: 1px solid var(--line-soft); background: var(--surface-2); font-size: 11.5px; color: var(--muted); }
.figure-missing { padding: 22px 14px; color: var(--muted); font-size: 12.5px; text-align: center; }
.basis { flex: none; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.basis.ok { background: var(--green-bg); color: var(--green); }
.basis.est { background: var(--amber-bg); color: var(--amber); }

.checklist-search { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.checklist { display: flex; flex-direction: column; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 0; background: var(--surface); }
.checklist .check { min-height: 30px; padding: 0 10px; font-size: 12.5px; min-width: 0; }
.checklist .check:hover { background: var(--surface-2); }
.checklist .check.on { background: color-mix(in srgb, var(--marking) 12%, transparent); }
.checklist .check .clip { display: block; }
.evidence-form { overflow: auto; align-content: start; padding-right: 4px; }
.chips { display: flex; gap: 4px; overflow: hidden; }
.chip { flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--grey-bg); font-size: 11.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
a.chip:hover { background: var(--cream); color: var(--ink); }

/* ─── Explore: the BI canvas ─────────────────────────────────────────────── */
/* The frame is opaque from its first frame, so the side navigation never shows through; only its content fades in. */
.focus-frame { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--paper); }
.focus-frame > .focus-body { animation: focus-in 0.28s ease both; }
@keyframes focus-in { from { opacity: 0; } to { opacity: 1; } }
/* The top row: the product's mark (its name on hover), the dashboards as tabs, the tools and the cross, all in one line. */
.focus-top { flex: none; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.focus-brand { flex: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.focus-brand b { font: 700 15px var(--display); letter-spacing: -0.01em; color: var(--ink); }
.focus-sep { flex: none; width: 1px; height: 22px; background: var(--line); }
.focus-tools { flex: none; display: flex; gap: 6px; align-items: center; }
.focus-top .focus-tabs { flex: 1; min-width: 0; height: 100%; margin: 0; gap: 0; border-bottom: 0; align-items: stretch; }
.focus-tabs button { height: 100%; padding: 0 8px; gap: 5px; margin-bottom: 0; border-bottom: 3px solid transparent; border-top: 3px solid transparent; font-size: 12.5px; }
.focus-tabs .count { padding: 0 5px; font-size: 10.5px; }
/* The open dashboard is plain to see: ink and bold, a thick underline in the marking colour, its count filled. */
.focus-tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--marking); background: var(--surface-2); }
.focus-tabs button.on .count { background: var(--ink); color: var(--paper); }
.xfilter { flex: none; height: var(--control-h); display: flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--marking); color: var(--ink); font-size: 12px; font-weight: 600; min-width: 0; }
.xfilter span { flex: 1; min-width: 0; }
.xfilter span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xfilter button { border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; }
.xfilter button:hover { background: rgba(20, 20, 22, 0.12); }
.bar-btn { height: var(--control-h); display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border-radius: var(--radius); border: 1px solid var(--chrome-3); background: var(--chrome-2); color: var(--chrome-text); font: 500 12.5px var(--font); cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.bar-btn:hover:not(:disabled) { background: var(--chrome-3); }
.bar-btn.on { border-color: var(--marking); color: var(--marking); }
.bar-btn.primary { background: var(--marking); border-color: var(--marking); color: var(--ink); font-weight: 600; }
.bar-btn.primary:hover:not(:disabled) { background: var(--gold); }
.bar-btn.icon { width: var(--control-h); padding: 0; justify-content: center; }
.bar-btn:disabled { opacity: 0.45; cursor: default; }
.focus-body { flex: 1; min-height: 0; display: flex; }
.focus-canvas { flex: 1; min-width: 0; min-height: 0; padding: 8px 8px 8px; position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.focus-grid { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.focus-grid > .grid-canvas { flex: 1; min-height: 0; }
.focus-canvas::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--motif-cells); background-size: 480px 144px; opacity: 0.55; pointer-events: none; }
.focus-pane { flex: none; width: 0; overflow: hidden; transition: width 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); border-left: 1px solid var(--line); background: var(--surface); }
.focus-pane.open { width: 240px; }
/* Folded away, the pane leaves a rail: a button that opens it on the filters, with how many are in force. */
.focus-pane:not(.open) { width: 40px; }
.pane-rail { width: 40px; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0; }
.pane-rail button { width: var(--control-h); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 9px 0; font: 600 12px var(--font); }
.pane-rail button:hover { background: var(--bar); color: var(--ink); }
.pane-rail button span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.pane-rail .count { writing-mode: horizontal-tb; transform: none; font: 500 11px var(--mono); color: var(--muted); background: var(--grey-bg); border-radius: 10px; padding: 1px 5px; }
.grid-canvas { position: relative; width: 100%; height: 100%; border-radius: var(--radius-lg); }
.grid-canvas.editing { background-image: linear-gradient(to right, rgba(122, 91, 0, 0.08) 1px, transparent 1px), linear-gradient(to bottom, rgba(122, 91, 0, 0.08) 1px, transparent 1px); background-size: var(--cw) var(--ch); }
.grid-item { position: absolute; display: flex; transition: left 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.grid-item.lifted { z-index: 5; filter: drop-shadow(0 18px 28px rgba(20, 20, 22, 0.2)); }
.grid-ghost { position: absolute; border: 2px dashed var(--gold); border-radius: var(--radius-lg); background: rgba(255, 207, 26, 0.08); pointer-events: none; transition: left 0.12s, top 0.12s, width 0.12s, height 0.12s; }
.grid-ghost.clash { border-color: var(--red); background: var(--red-bg); }
.grid-size { position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; cursor: nwse-resize; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); border-radius: 0 0 4px 0; opacity: 0; transition: opacity 0.15s; z-index: 2; }
.grid-item:hover .grid-size { opacity: 1; }
.bi-panel { container: bi-panel / inline-size; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; animation: panel-in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; transition: border-color 0.15s, box-shadow 0.15s; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.bi-panel.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 158, 0, 0.3), var(--shadow); }
.bi-panel-head { flex: none; min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line-soft); position: relative; isolation: isolate; }
.bi-panel-head::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--motif-cells); background-position: right -30px top -10px; opacity: 0.7; -webkit-mask-image: linear-gradient(90deg, transparent 50%, #000 100%); mask-image: linear-gradient(90deg, transparent 50%, #000 100%); }
.bi-panel-head[data-grip] { cursor: grab; }
.grid-canvas.dragging .bi-panel-head[data-grip] { cursor: grabbing; }
.bi-panel-head h3 { flex: 1; min-width: 0; font: 600 13px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-panel-head h3::before { content: ""; display: inline-block; width: 4px; height: 13px; border-radius: 2px; margin-right: 8px; vertical-align: -2px; background: linear-gradient(180deg, var(--gold), var(--mustard)); }
.bi-panel-head .sub { color: var(--muted); font-weight: 400; }
.bi-panel-head .tools { display: flex; gap: 6px; align-items: center; flex: none; }
.panel-acts { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.bi-panel:hover .panel-acts, .bi-panel.selected .panel-acts { opacity: 1; }
.panel-acts button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.panel-acts button:hover { background: var(--bar); color: var(--ink); }
.bi-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 8px 10px; position: relative; }
.bi-panel-body.flush { padding: 0; }
.bi-panel-body > .card { flex: 1; min-height: 0; border: 0; box-shadow: none; border-radius: 0; }
.bi-panel-note { flex: none; font-size: 11px; color: var(--muted); padding: 5px 12px; border-top: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-panel-note b { color: var(--mustard); font-weight: 600; }
.bi-panel-note .ignored { color: var(--amber); font-weight: 600; }
/* A tick list in the narrow BI pane: its card's head already says how many are kept, so the count beside the search goes. */
.pane-body .checklist-search .row-flag > .muted { display: none; }
/* The flows map's key, under the map in its panel (Hubshape BI). */
.bi-map-key { flex: none; font-size: 11px; color: var(--muted); padding: 4px 12px; border-top: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-split { flex: 1; min-height: 0; display: flex; }
.bi-split > .bi-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.bi-split > .bi-side { flex: none; width: 42%; max-width: 360px; border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; }
.bi-side .card { flex: 1; min-height: 0; border: 0; box-shadow: none; border-radius: 0; }
.kpi { position: relative; isolation: isolate; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 2px 4px; overflow: hidden; cursor: default; }
.kpi > .motif-layer { z-index: -1; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font: 700 34px/1.05 var(--display); color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; }
.kpi-sub { font-size: 11.5px; color: var(--mustard); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Headline figures side by side in one tile: smaller values, so five sit in a row. */
.kpi-strip { flex: 1; min-height: 0; display: flex; gap: 6px; }
.kpi-strip .kpi { min-width: 0; padding: 2px 6px; border-left: 1px solid var(--line-soft); }
.kpi-strip .kpi:first-child { border-left: 0; }
.kpi-strip .kpi-value { font-size: 22px; }
.kpi-strip .kpi-label { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-in { animation: chart-in 0.45s ease both; }
@keyframes chart-in { from { opacity: 0; } to { opacity: 1; } }
.chart-in .bar-mark { transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), x 0.35s, y 0.35s, height 0.35s; }
.chart-in .line-mark { stroke-dasharray: 4000; stroke-dashoffset: 4000; animation: line-draw 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes line-draw { to { stroke-dashoffset: 0; } }
.pane { width: 240px; height: 100%; display: flex; flex-direction: column; }
/* The pane's head: the Filters and Build tabs with the fold-away cross; the Build tab's actions under them. */
.pane-tabs .pane-icon.close { margin-left: auto; }
.pane-actions { flex: none; display: flex; gap: 6px; padding: 10px 10px 0; }
/* The dates every tile reads, always in sight at the top of the pane (and on its rail when folded away). */
.pane-dates { flex: none; display: flex; align-items: center; gap: 7px; margin: 10px 10px 0; height: var(--control-h); padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); font: 600 12.5px var(--font); cursor: pointer; text-align: left; }
.pane-dates:hover { border-color: var(--ink); }
.pane-dates span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-dates .gap-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-left: auto; }
.pane-actions > * { flex: 1; min-width: 0; }
.pane-actions .btn { width: 100%; justify-content: center; }
.pane-icon { flex: none; width: var(--control-h); height: var(--control-h); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.pane-icon:hover { background: var(--bar); color: var(--ink); }
.pane-icon.on { border-color: var(--ink); color: var(--ink); }
.pane-icon.close { border-color: transparent; }
.view-switch { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; min-width: 0; min-height: var(--control-h); padding: 2px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.view-switch button, .view-edit { flex: 1 1 64px; min-width: 0; height: 26px; padding: 0 8px; border: 0; border-radius: calc(var(--radius) - 2px); background: transparent; color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.15s, color 0.15s; }
.view-switch button:hover { color: var(--ink); }
.view-switch button.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.view-switch button.add { flex: none; width: 26px; padding: 0; display: grid; place-items: center; }
.view-edit { background: var(--surface); color: var(--ink); outline: 1px solid var(--gold); cursor: text; }
.pane-tabs { flex: none; display: flex; gap: 2px; align-items: center; padding: 0 6px 0 10px; border-bottom: 1px solid var(--line); }
.pane-tabs button { height: 40px; padding: 0 10px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pane-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.pane-tabs button .count { font: 500 11px var(--mono); color: var(--muted); background: var(--grey-bg); border-radius: 10px; padding: 1px 6px; }
.pane-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
/* Every control in the pane fits its column, whatever width it was given: nothing spills past the cards. */
.pane-body :is(input, select, textarea, button, .search, .select, .search-select, .filter-card, .well, .well-body, .xfilter) { max-width: 100%; min-width: 0; box-sizing: border-box; }
.pane-title { font: 600 13px var(--font); display: flex; align-items: center; gap: 8px; }
.pane-title span { color: var(--muted); font-weight: 400; font-size: 12px; }
.pane-empty { color: var(--muted); font-size: 12.5px; }
.well { display: flex; flex-direction: column; gap: 6px; }
.well-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--mustard); font-weight: 700; }
.well-body { display: flex; flex-direction: column; gap: 6px; }
.well-body .row-flex { display: flex; gap: 6px; align-items: center; }
.well-body .row-flex > .select { flex: 1; min-width: 0; }
.well-help { font-size: 11.5px; color: var(--muted); }
.filter-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color 0.15s; }
.filter-card.set { border-color: var(--gold); }
.filter-card-head { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px 0 10px; border: 0; background: transparent; cursor: pointer; text-align: left; color: var(--ink); }
.filter-card-head b { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; }
.filter-scope { font-size: 11px; color: var(--muted); }
.filter-count { font: 500 11px var(--mono); color: var(--mustard); }
.filter-x { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.filter-x:hover { background: var(--bar); color: var(--ink); }
.filter-card-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.gallery-group { display: flex; flex-direction: column; gap: 8px; }
.gallery-group h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--mustard); font-weight: 700; }
.gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.gallery-card { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s; }
.gallery-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--shadow); }
.gallery-card > b { font-size: 13px; }
.gallery-card > span:last-child { font-size: 12px; color: var(--muted); line-height: 1.35; }
.gallery-art { position: relative; height: 64px; border-radius: var(--radius); background: var(--surface-2); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 6px; isolation: isolate; }
.gallery-art > .motif-layer { z-index: -1; }
.gallery-art .glyph { display: flex; gap: 5px; align-items: flex-end; height: 48px; padding-bottom: 6px; }
.gallery-art .glyph i { width: 14px; border-radius: 3px 3px 0 0; background: var(--asphalt); }
.gallery-art.table .glyph { flex-direction: column; align-items: stretch; justify-content: center; gap: 5px; width: 64%; }
.gallery-art.table .glyph i { width: auto; height: 6px; border-radius: 3px; background: var(--asphalt); opacity: 0.75; }
.gallery-art.card .glyph b { font: 700 28px var(--display); color: var(--ink); padding-bottom: 6px; }
.gallery-art.map { background: color-mix(in srgb, var(--cream) 55%, var(--surface)); }
.dash-list { display: flex; flex-direction: column; gap: 6px; }

/* SearchSelect: a searchable dropdown whose matches open under the box. */
.combo .input { text-overflow: ellipsis; }
.combo-list { position: fixed; z-index: 70; max-height: 420px; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow), 0 12px 32px rgba(20, 20, 22, 0.16); padding: 4px; }
.combo-opt { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.combo-opt span { color: var(--muted); font-size: 11.5px; }
.combo-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.combo-line b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-line .badge { flex: none; }
.combo-head { flex: none; padding: 6px 8px 6px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.combo-x { flex: none; margin-left: auto; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.combo-x:hover { background: var(--surface-2); color: var(--ink); }
.combo-head b { color: var(--ink); }
.combo-opt:hover { background: var(--surface-2); }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; height: var(--control-h); max-width: 100%; padding: 0 4px 0 10px; border-radius: var(--radius); background: var(--cream); border: 1px solid var(--gold); color: var(--ink); font-size: 12.5px; font-weight: 600; flex: none; min-width: 0; }
.filter-chip > button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.filter-chip > button:hover { background: rgba(20, 20, 22, 0.08); color: var(--ink); }
.combo-opt.on { background: var(--surface-2); }
.combo-opt.picked b::after { content: " · open"; color: var(--muted); font-weight: 400; }
.combo-note { padding: 4px 4px 4px 8px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; min-height: 32px; }
.combo-opts { flex: 1; min-height: 0; overflow: auto; }
.combo-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 2px; margin-top: 4px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--muted); }

/* Follow an order in Explore: what it was, who touched it, then the trace. */
.journey .bi-side.journey-side { width: 46%; max-width: 520px; }
.journey-facts { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; min-width: 0; }
.journey-facts .clip { flex: 1; min-width: 0; color: var(--muted); }
.journey-providers { flex: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.provider { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface-2); min-width: 0; font-size: 12px; }
.provider-role { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.provider .muted { font-size: 11.5px; }

/* Tour: a walkthrough over the screen, lighting one thing at a time. */
.tour { position: fixed; inset: 0; z-index: 80; }
.tour-dim { position: fixed; inset: 0; background: rgba(20, 20, 22, 0.55); }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(20, 20, 22, 0.55); outline: 2px solid var(--gold); outline-offset: 0; transition: left 260ms ease, top 260ms ease, width 260ms ease, height 260ms ease; pointer-events: none; }
.tour-card { position: fixed; width: 380px; display: flex; flex-direction: column; gap: 6px; padding: 58px 16px 12px; background: var(--surface); border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(20, 20, 22, 0.5); overflow: hidden; isolation: isolate; transition: left 260ms ease, top 260ms ease; }
.tour-motif { position: absolute; left: 0; right: 0; top: 0; height: 46px; z-index: -1; border-bottom: 1px solid var(--line-soft); }
.tour-count { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.tour-card > b { font: 700 17px var(--display); }
.tour-body { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.tour-body p { margin: 0 0 6px; }
.tour-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.tour-dots { flex: 1; display: flex; gap: 4px; }
.tour-dots button { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.tour-dots button.done { background: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.tour-dots button.on { background: var(--gold); width: 18px; border-radius: 4px; }
/* A visual's wrapper, so the tour can find a panel by its type; it makes no box of its own. */
.vis-wrap { display: contents; }

/* ── Stacked scenarios: out-of-date flags (src/components/kit/waterfall.tsx) ── */
.stale-flag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.stale-flag .i { flex: none; }
.stale-flag button { appearance: none; border: 0; background: none; padding: 0 0 0 6px; margin: 0; border-left: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.stale-flag button:disabled { opacity: 0.55; cursor: default; }
.note.warn.stale-note { display: flex; align-items: center; gap: 10px; flex: none; }
.note.warn.stale-note > span { flex: 1; min-width: 0; }
.note.info-note { display: flex; align-items: center; gap: 10px; flex: none; }
.note.info-note > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-axis { font-size: 10.5px; }

/* Side tabs: tabs over one column of a panel. */
.side-tabs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-tabs-bar { flex: none; display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line-soft); }
.side-tabs-bar button { height: 36px; padding: 0 8px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.side-tabs-bar button.on { color: var(--ink); border-bottom-color: var(--ink); }
.side-tabs-bar .count { font: 500 11px var(--mono); color: var(--muted); background: var(--grey-bg); border-radius: 10px; padding: 1px 6px; }
.side-tabs-bar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.side-tabs-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.journey-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 10px; }
.journey-scroll .journey-providers { padding: 0; border: 0; }
.journey-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.route-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface-2); font-size: 12px; }
.route-card > div { display: flex; flex-direction: column; min-width: 0; }
.route-card > div > span { font-size: 10.5px; color: var(--muted); }
.route-card > div > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-card .route-head { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; }
.trace-apart td { color: var(--muted); }

/* An order's journey as stages: each in the files, not needed, or not in the files. */
.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stage { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface-2); min-width: 0; }
.stage.none { background: var(--surface); }
.stage.missing { border-style: dashed; }
.stage-n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--mono); background: var(--ink); color: var(--surface); }
.stage.none .stage-n, .stage.missing .stage-n { background: var(--grey-bg); color: var(--muted); }
.stage-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.stage-head { display: flex; align-items: center; gap: 8px; }
.stage-head .badge { margin-left: auto; }

/* The run tray (kit/runs.tsx): runs in the queue and just finished, in the bottom right corner over every screen. */
.run-tray { position: fixed; right: 18px; bottom: 18px; z-index: 55; width: 340px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.run-tray > * { pointer-events: auto; animation: panel-in 0.22s ease-out; }
.run-card, .run-notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow), 0 14px 32px -14px rgba(20, 20, 22, 0.32); overflow: hidden; }
.run-band { position: relative; height: 58px; background: var(--asphalt); }
.run-hide { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; border: 0; background: rgba(247, 246, 241, 0.12); color: var(--chrome-text); cursor: pointer; }
.run-hide:hover { background: rgba(247, 246, 241, 0.24); }
.run-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.run-head { display: flex; align-items: center; gap: 8px; }
.run-head b { flex: 1; min-width: 0; font: 700 14px var(--display); }
.run-step { color: var(--ink-2); font-size: 12px; }
.run-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.run-progress .num { font-weight: 600; width: 34px; text-align: right; }
.run-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--bar); overflow: hidden; }
.run-bar i { display: block; height: 100%; border-radius: 4px; background: var(--motif-fine), var(--gold); transition: width 0.9s linear; }
.run-left { color: var(--muted); white-space: nowrap; border-bottom: 1px dotted var(--muted-2); cursor: default; }
.run-actions { display: flex; align-items: center; gap: 4px; margin: 0 -6px -4px; font-size: 12px; }
.run-actions .muted { margin-left: auto; padding-right: 6px; }
.run-notice { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; }
.run-notice .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.run-notice b { font-weight: 700; }
.run-notice .muted, .run-notice .run-error { font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.run-notice .run-error { color: var(--red); }
.run-mark { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green-bg); color: var(--green); }
.run-notice.bad { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.run-notice.bad .run-mark { background: var(--red-bg); color: var(--red); }
.run-pill { align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; height: var(--control-h); padding: 0 12px 0 0; border-radius: var(--radius); border: 0; overflow: hidden; background: var(--asphalt); color: var(--chrome-text); font-size: 12px; cursor: pointer; box-shadow: var(--shadow); }
.run-loader { display: block; width: 100%; height: 100%; }
.run-pill .run-loader { width: 56px; height: 32px; }
.run-loader .ground { fill: var(--asphalt); }
.run-loader .edges { fill: none; stroke: color-mix(in srgb, var(--paper) 13%, var(--asphalt)); stroke-width: 1; }
.run-loader .lanes { fill: none; stroke: color-mix(in srgb, var(--paper) 24%, var(--asphalt)); stroke-width: 1; stroke-dasharray: 2 3; }
.run-loader .filled { fill: color-mix(in srgb, var(--marking) 16%, var(--asphalt)); stroke: none; transition: fill 0.6s; }
.run-loader .lit { fill: var(--marking); stroke: var(--asphalt); stroke-width: 1; }
.run-loader .route { fill: none; stroke: var(--marking); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--route-len); stroke-dashoffset: var(--route-len); animation: route-draw 2.6s ease-in-out infinite; }
.run-loader .dot { fill: var(--asphalt); stroke: color-mix(in srgb, var(--paper) 34%, var(--asphalt)); stroke-width: 1.1; }
.run-loader .hub { fill: var(--asphalt); stroke: var(--paper); stroke-width: 1.4; }
.run-loader .van { fill: var(--paper); stroke: var(--marking); stroke-width: 2; }
.run-loader.waiting .route { stroke: color-mix(in srgb, var(--marking) 55%, var(--asphalt)); stroke-dasharray: none; stroke-dashoffset: 0; animation: route-wait 2.4s ease-in-out infinite; }
@keyframes route-draw { 0% { stroke-dashoffset: var(--route-len); } 70%, 100% { stroke-dashoffset: 0; } }
@keyframes route-wait { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) { .run-loader .route { animation: none; stroke-dashoffset: 0; } .run-loader .van { display: none; } .run-loader.waiting .route { animation: none; } }
.run-mark.wait { background: var(--bar); }
/* A waterfall bar's hover card (kit/bar-breakdown.tsx): what is in it, how it is driven, why, and what we would expect. */
.hover-card:has(.bar-bd) { max-width: 460px; }
.bar-bd { display: flex; flex-direction: column; gap: 7px; }
.bar-bd section + section { padding-top: 6px; border-top: 1px solid var(--line-soft); }
.bar-bd h4 { margin: 0 0 2px; font: 600 10.5px var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.bar-bd p { margin: 0; color: var(--ink-2); }
.bar-bd p + p { margin-top: 3px; }
.bar-bd .no-yardstick { color: var(--amber); font-weight: 600; }
.bar-bd table { border-collapse: collapse; width: 100%; font-size: 11px; }
.bar-bd th { font-weight: 600; color: var(--muted); padding: 0 0 2px 8px; }
.bar-bd td { padding: 1px 0 1px 8px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.bar-bd td:first-child, .bar-bd th:first-child { padding-left: 0; }
.bar-bd .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bar-bd tr.less td { color: var(--muted); }
.bar-bd tr.muted td { color: var(--muted); }
.bar-bd tr.total td { font-weight: 600; border-top: 1px solid var(--line-soft); padding-top: 2px; }

/* A whole screen in a dashboard tile (Cost to serve, a map view): its tabs and controls in one slim row, its body
   filling the tile. */
.screen-tile { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.page.embedded { flex: 1; min-height: 0; }
.page-header.embedded { padding: 0 10px; background: var(--surface); }
.page-header.embedded > .page-tabs { margin-top: 0; }
.page-header.embedded .page-tabs button { height: 34px; padding: 0 9px; font-size: 12.5px; }
.page-header.embedded > .row { min-height: 40px; justify-content: flex-end; font-size: 12px; color: var(--muted); }
.page-header.embedded .actions { display: flex; gap: 6px; align-items: center; }
.page.embedded > .page-body { padding: 8px; gap: 8px; }
.pane-title .link-btn { margin-left: auto; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--mustard); font: 500 12px var(--font); cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

/* The dashboard gallery (Business Intelligence): three cards a row that share the screen's height, never a scroll;
   the Saved tab's cards scroll inside the gallery when there are many. */
.dash-gallery { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dash-gallery.saved { grid-template-rows: none; grid-auto-rows: 210px; overflow: auto; align-content: start; padding-right: 2px; }
.dash-card { min-width: 0; min-height: 0; display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; font: inherit; color: inherit; transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s; animation: panel-in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.dash-card:hover, .dash-card:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 158, 0, 0.22), 0 14px 30px -18px rgba(20, 20, 22, 0.35); transform: translateY(-1px); outline: none; }
.dash-art { flex: 1; min-height: 70px; position: relative; isolation: isolate; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line-soft); }
.dash-art-svg { position: absolute; inset: 6px 10px 6px 34%; width: calc(66% - 10px); height: calc(100% - 12px); }
.dash-art-svg .ink { fill: var(--ink-2); }
.dash-art-svg .soft { fill: var(--line); }
.dash-art-svg .lit { fill: var(--gold); }
.dash-art-svg .land { fill: var(--cream); stroke: var(--gold); stroke-width: 1.2; }
.dash-art-svg .lane { stroke: var(--muted-2); stroke-width: 1.4; }
.dash-art-svg .route { fill: none; stroke: var(--muted-2); stroke-width: 2; stroke-linecap: round; }
.dash-art-svg .lit-stroke { stroke: var(--gold); stroke-width: 2.6; }
.dash-art-svg .area { fill: var(--amber-bg); }
.dash-figure { position: absolute; left: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 2px; max-width: 46%; cursor: help; }
.dash-figure b { font: 700 26px/1.05 var(--display); letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-figure span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-badge { position: absolute; top: 10px; left: 12px; font: 600 11px var(--font); color: var(--blue); background: var(--blue-bg); border-radius: 10px; padding: 2px 8px; }
.dash-text { flex: none; display: flex; flex-direction: column; gap: 3px; padding: 10px 14px 10px; }
.dash-text > b { font: 600 15px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-purpose { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 11.5px; color: var(--muted-2); }
.dash-open { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; color: var(--mustard); font-weight: 600; }

/* A screen whose body is one card (a table): the card sits flat in the tile, edge to edge. */
.page.embedded > .page-body:has(> .card:only-child) { padding: 0; }
.page.embedded > .page-body > .card:only-child { border: 0; border-radius: 0; box-shadow: none; }

/* Grades A to F (kit/grade.tsx), drawn like the EU energy label: six colours from dark green to red, each with the
   letter colour that keeps it readable (white on the dark ends, ink on the light middle; contrast 4.5:1 or more). */
:root {
  --grade-a: #1A7F3C; --grade-a-text: #FFFFFF;
  --grade-b: #5DAE3B; --grade-b-text: #141416;
  --grade-c: #C9D52A; --grade-c-text: #141416;
  --grade-d: #F4D21F; --grade-d-text: #141416;
  --grade-e: #F08A24; --grade-e-text: #141416;
  --grade-f: #C8261E; --grade-f-text: #FFFFFF;
}
.grade-tag { --g: var(--grade-c); --gt: var(--grade-c-text); display: inline-flex; align-items: center; height: 20px; padding: 0 10px 0 7px; font: 700 12px/1 var(--display); color: var(--gt); background: var(--g); clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 0 100%); border-radius: 3px 0 0 3px; flex: none; cursor: help; vertical-align: middle; }
.g-a { --g: var(--grade-a); --gt: var(--grade-a-text); }
.g-b { --g: var(--grade-b); --gt: var(--grade-b-text); }
.g-c { --g: var(--grade-c); --gt: var(--grade-c-text); }
.g-d { --g: var(--grade-d); --gt: var(--grade-d-text); }
.g-e { --g: var(--grade-e); --gt: var(--grade-e-text); }
.g-f { --g: var(--grade-f); --gt: var(--grade-f-text); }
/* The small tag, for a line of text or a dense hover card: the same arrow, a text line high. */
.grade-tag.sm { height: 15px; padding: 0 8px 0 5px; font-size: 10px; clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 0 100%); }
/* Inside a hover or map card, the card's row and head rules (muted, mono, 11px) leave the tag as it is drawn. */
:is(.hover-card, .map-card) span.grade-tag { font: 700 12px/1 var(--display); opacity: 1; filter: none; white-space: nowrap; }
:is(.hover-card, .map-card) span.grade-tag.sm { font-size: 10px; }
.grade-inline { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.grade-inline.wrap { display: inline; line-height: 1.9; }
.grade-inline.wrap > .grade-inline { margin: 0 4px 0 2px; }
.grade-label { display: grid; gap: 2px; width: 120px; cursor: help; }
.grade-bar { display: flex; align-items: center; justify-content: space-between; height: 13px; padding: 0 9px 0 5px; background: var(--g); color: var(--gt); font: 700 9.5px/1 var(--display); clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%); opacity: 0.35; }
.grade-bar.on { opacity: 1; height: 17px; font-size: 11px; box-shadow: inset 0 0 0 1.5px rgba(20, 20, 22, 0.35); }
.grade-bar b { font-weight: 700; }
.bench-band { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 6px; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: 11.5px; cursor: help; }
.grade-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }

/* Scenario stages (kit/stage.tsx): five steps in a row, the scenario's lit, its moves to the right. */
.stage-strip { display: flex; align-items: center; gap: 8px; flex: none; min-height: var(--control-h); }
.stage-strip .spacer { flex: 1; }
.stage-steps { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.stage-steps li { display: inline-flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 10px 0 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.stage-steps li b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--grey-bg); font-size: 11px; color: var(--ink-2); }
.stage-steps li.done { color: var(--ink-2); }
.stage-steps li.done b { background: var(--green-bg); color: var(--green); }
.stage-steps li.now { border-color: var(--asphalt); color: var(--ink); font-weight: 600; }
.stage-steps li.now b { background: var(--asphalt); color: var(--paper); }

/* Hubshape BI's dashboard menu (kit DashMenu): one button and the open dashboard's name in the top row, the dashboards
   in their groups in a panel under it. Controls at the one height. */
.dash-menu { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; position: relative; height: 100%; }
.dash-menu-btn { flex: none; height: var(--control-h); display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 600 12.5px var(--font); cursor: pointer; position: relative; }
.dash-menu-btn:hover, .dash-menu-btn.on { background: var(--surface-2); border-color: var(--ink); }
.dash-menu-btn .alert-dot { position: absolute; top: -3px; right: -3px; }
.dash-current { min-width: 0; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dash-current b { font: 700 15px var(--display); letter-spacing: -0.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.dash-current .count, .dash-menu-panel .count { padding: 0 5px; border-radius: 999px; background: var(--bar); color: var(--ink-2); font-size: 10.5px; font-weight: 600; }
.dash-menu-panel { position: absolute; top: calc(100% - 2px); left: 0; z-index: 60; display: flex; flex-direction: column; gap: 14px; width: min(1120px, calc(100vw - 32px)); max-height: calc(100vh - 72px); overflow: auto; padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(20, 20, 22, 0.16); }
/* Each group's dashboards as a grid of cards across the panel, so every one shows in full with what it is for. */
.dash-menu-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 12px; min-width: 0; }
.dash-menu-group h4 { grid-column: 1 / -1; margin: 0 0 2px; padding: 0 8px; font: 700 10.5px var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dash-menu-group button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: transparent; text-align: left; cursor: pointer; color: var(--ink); min-width: 0; }
.dash-menu-group button:hover { background: var(--surface-2); }
.dash-menu-group button.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--marking); }
.dash-menu-group .line { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dash-menu-group .line b { font-weight: 600; }
.dash-menu-group .sub { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

/* A data gap's window (components/gap-modal.tsx): every tab holds the same height, its one table or form scrolling inside. */
.gap-pane { height: min(560px, calc(100vh - 260px)); display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.gap-pane-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.gap-pane-body > .card { flex: 1; min-height: 0; }
.gap-pane-foot { flex: none; display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.gap-pane-foot .spacer { flex: 1; }
.gap-pane .form-error { margin-top: 0; }
.gap-resting { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.gap-close textarea.textarea { height: 150px; padding: 8px 10px; }
.gap-replace { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.gap-replace-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 200px 170px 110px; gap: 10px; align-items: center; }
.gap-replace-row .field { margin: 0; }
.gap-replace-row .field > span:first-child:empty { display: none; }
.gap-file { cursor: pointer; }
.gap-evidence { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.gap-evidence-text { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-soft); white-space: pre-wrap; font: inherit; max-height: 220px; overflow: auto; }
.gap-replaced { border-collapse: collapse; font-size: 12.5px; }
.gap-replaced td { padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line-soft); }
.gap-form textarea.textarea { height: 72px; min-height: 72px; padding: 6px 10px; }

/* A scenario's conversation and change log (kit/talk.tsx): one list, newest first, scrolling inside its card. */
.talk-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.talk-item { flex: none; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }
.talk-item.challenge.open, .talk-item.decision.open { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); box-shadow: inset 3px 0 0 var(--red); }
.talk-item.log { background: var(--surface-2); }
.talk-item header, .talk-reply header { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; }
.talk-item header .spacer, .talk-reply header .spacer { flex: 1; }
.talk-item header .mono { font-size: 11px; flex: none; }
.talk-target { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.talk-via, .talk-action { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.talk-body { font-size: 13px; line-height: 1.45; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.talk-body p { margin: 0 0 6px; white-space: normal; }
.talk-body ul { margin: 0 0 6px 18px; padding: 0; white-space: normal; }
.talk-closed { font-size: 12.5px; color: var(--green); background: var(--green-bg); border-radius: var(--radius); padding: 6px 9px; }
.talk-replies { display: flex; flex-direction: column; gap: 6px; margin-left: 26px; padding-left: 10px; border-left: 2px solid var(--line-soft); }
.talk-reply { display: flex; flex-direction: column; gap: 4px; }
.talk-item footer { display: flex; gap: 14px; }
.talk-changes { border-collapse: collapse; font-size: 12px; width: 100%; table-layout: fixed; }
.talk-changes th { text-align: left; font-weight: 600; color: var(--muted); width: 160px; padding: 2px 8px 2px 0; vertical-align: top; }
.talk-changes td { padding: 2px 0; vertical-align: top; overflow-wrap: anywhere; color: var(--ink-2); }
.talk-changes td.was { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); width: 42%; }
.talk-changes td.arrow { width: 22px; text-align: center; color: var(--muted); }
.hc-ask { display: flex; gap: 8px; }
.ask-post { display: block; margin-top: 6px; }
.wait-list { flex: 1; min-height: 0; }

/* A window's close: a white outlined 32px button, clear on the window's header (Rob, 27 Oct 2026). */
.modal-head .close { width: var(--control-h); height: var(--control-h); border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--line)); background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 20, 22, 0.08); }
.modal-head .close:hover { background: var(--surface); border-color: var(--ink); color: var(--ink); }

/* The run tray while a window is open: its pill, docked in a band below the window, clear of every control. */
.run-tray.docked { bottom: 10px; right: 16px; width: auto; z-index: 60; }
.run-tray.docked .run-pill { cursor: default; }
body:has(.run-tray.docked) .modal-overlay:has(> .modal.full) { padding-bottom: 58px; align-items: flex-start; }
body:has(.run-tray.docked) .modal.full { height: calc(100vh - 74px); max-height: calc(100vh - 74px); }

/* What shows a scenario's figures, veiled with the standard loader while its run is queued or running. */
.veil-host { position: relative; flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; }

/* Key details: what it is on the left, filled to the height; how it is filed and how the engine treats it on the right. */
.key-details { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.key-details > .card { min-height: 0; }
.key-what { height: 100%; display: flex; flex-direction: column; }
.key-what .field.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.key-what .field.grow .textarea { flex: 1; min-height: 160px; resize: none; }
.key-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto; }
.key-side > .card { flex: none; }
.key-acts p { margin: 0 0 6px; font-size: 13px; }
.key-acts .mono { display: inline-block; width: 22px; color: var(--muted); }

/* What changes: the difference with its arrow, green where better and red where worse; a line that holds, in words. */
/* Why a line of What changes moved: a short note under it (lib/what-changes). */
.wc-note { display: block; margin-top: 2px; font-style: normal; font-size: 12px; line-height: 1.3; color: var(--muted); }
.wc-diff { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.wc-diff i { font-style: normal; font-size: 10px; }
.wc-diff.good { color: var(--green); }
.wc-diff.bad { color: var(--red); }
.wc-none { color: var(--muted); }
.wc-none b { color: var(--ink-2); font-weight: 600; }

/* ── Gantt and heat grid (kit/gantt.tsx: Playback › Project plan) ────────────────────────────────────────────────
   One scroller each: the header stays on top and the first columns at the left while the timeline or the weeks move. */
.gantt { flex: 1; min-height: 0; min-width: 0; overflow: auto; position: relative; --gantt-weekend: color-mix(in srgb, var(--ink) 3.5%, transparent); --gantt-line: var(--line-soft); }
.gantt-inner { position: relative; min-height: 100%; }
.gantt-head { position: sticky; top: 0; z-index: 4; display: flex; height: 48px; background: var(--head-ground); border-bottom: 1px solid var(--head-rule); }
.gantt-cols { position: sticky; left: 0; z-index: 3; display: flex; flex: none; width: var(--gantt-left); background: inherit; border-right: 1px solid var(--line); }
.gantt-head .gantt-cols { background: var(--head-ground); align-items: flex-end; padding-bottom: 8px; font: 600 12px/1.25 var(--font); color: var(--ink-2); }
.gantt-cols > span { flex: none; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; min-width: 0; }
.gantt-cols > span.num { justify-content: flex-end; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; }
/* A task's text that wraps (GanttColumn wrap): up to three lines, its row grown to fit (GanttRow lines). */
.gantt-cols > span.wrap { white-space: normal; }
.gantt-cols > span.wrap > .wrap-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; line-height: 15px; overflow-wrap: anywhere; }
.gantt-head .gantt-cols > span.num { font-family: var(--font); }
.gantt-scale { position: relative; flex: none; }
.gantt-scale .band { position: absolute; left: 0; right: 0; height: 24px; top: 24px; }
.gantt-scale .band.top { top: 0; }
.gantt-scale .band > span { position: absolute; top: 0; height: 24px; display: flex; align-items: center; padding: 0 6px; font-size: 11px; color: var(--muted); border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.gantt-scale .band.top > span { font-weight: 600; color: var(--ink-2); }
.gantt-body { position: relative; }
.gantt-grid { position: absolute; top: 0; pointer-events: none; }
.gantt-grid.week { background-image: repeating-linear-gradient(90deg, var(--gantt-line) 0 1px, transparent 1px calc(var(--day) * 5), var(--gantt-weekend) calc(var(--day) * 5) calc(var(--day) * 7)); }
.gantt-grid .gline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--gantt-line); }
.gantt-grid .today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--gold); pointer-events: auto; z-index: 1; }
.gantt-links { position: absolute; top: 0; pointer-events: none; z-index: 1; overflow: visible; }
.gantt-links path { fill: none; stroke: var(--muted-2); stroke-width: 1.2; }
.gantt-links path.critical { stroke: var(--ink); stroke-width: 1.6; }
.gantt-links path.late { stroke: var(--red); }
.gantt-links .head { fill: var(--muted-2); }
.gantt-links .head.critical { fill: var(--ink); }
.gantt-row { position: absolute; left: 0; right: 0; height: var(--row); display: flex; border-bottom: 1px solid var(--line-soft); }
.gantt-row .gantt-cols { background: var(--surface); align-items: center; font-size: 12.5px; }
.gantt-row.group .gantt-cols { background: color-mix(in srgb, var(--gold) 6%, var(--surface)); font-weight: 600; }
.gantt-row.group { background: color-mix(in srgb, var(--gold) 3%, transparent); }
.gantt-row.clickable { cursor: pointer; }
.gantt-row.clickable:hover .gantt-cols, .gantt-row.clickable:hover { background: var(--row-hover); }
.gantt-lane { position: relative; flex: none; height: 100%; }
.gantt-bar { position: absolute; top: calc(50% - 7px); height: 14px; border-radius: 4px; background: var(--blue); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent); overflow: hidden; z-index: 2; }
.gantt-bar > b { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--surface) 35%, transparent); }
.gantt-bar.critical { background: var(--ink); }
.gantt-bar.late { background: var(--red); }
.gantt-bar.done { background: var(--green); }
/* A task of a scenario awaiting verification: its colour kept (critical, late, float), hatched and lighter. */
.gantt-bar.awaiting { opacity: 0.72; background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--surface) 60%, transparent) 0 3px, transparent 3px 7px); }
.gantt-ms.awaiting { border-style: dashed; }
.gantt-key i.awaiting { background: var(--blue); opacity: 0.72; background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--surface) 60%, transparent) 0 3px, transparent 3px 7px); }
.gantt-bar.group { top: calc(50% - 3px); height: 6px; border-radius: 3px; background: var(--muted-2); box-shadow: none; }
.gantt-bar.group.solid { top: calc(50% - 7px); height: 14px; border-radius: 4px; background: var(--blue); }
.gantt-bar.group.solid.critical { background: var(--ink); }
.gantt-bar.group.solid.late { background: var(--red); }
.gantt-bar.group.solid.done { background: var(--green); }
.gantt-row.group .caret { display: inline-block; width: 12px; color: var(--muted); }
/* A task group inside a workstream (project plan, 11 Nov 2026): its heading lighter and indented, its summary bar a
   darker band from its first start to its last finish. */
.gantt-row.group.sub .gantt-cols { background: var(--surface); font-weight: 600; color: var(--ink-2); }
.gantt-row.group.sub { background: transparent; }
.gantt-row.sub .gantt-bar.group { top: calc(50% - 4px); height: 8px; border-radius: 2px; background: color-mix(in srgb, var(--blue) 60%, var(--ink-2)); }
.gantt-row.sub .gantt-bar.group.critical { background: var(--ink); }
.gantt-row.sub .gantt-bar.group.late { background: var(--red); }
.gantt-row.sub .gantt-bar.group.done { background: var(--green); }
/* Dragging a task onto a group (Gantt and Tasks): the grip, and the row it would land in. */
.task-grip { cursor: grab; color: var(--muted-2); padding: 0 4px 0 0; font-style: normal; user-select: none; }
.task-grip:hover { color: var(--ink-2); }
.drop-zone { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; border-radius: 4px; }
.drop-zone[data-drop="on"] { outline: 2px dashed var(--blue); outline-offset: 2px; background: color-mix(in srgb, var(--blue) 10%, transparent); }
.mini-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 4px; font-size: 11px; padding: 1px 6px; color: var(--ink-2); cursor: pointer; font-weight: 500; flex: none; }
.mini-btn:hover { border-color: var(--ink-2); }
.gantt-ms { position: absolute; top: calc(50% - 6px); width: 12px; height: 12px; transform: rotate(45deg); background: var(--surface); border: 2px solid var(--ink-2); z-index: 2; border-radius: 2px; }
.gantt-ms.critical { background: var(--ink); border-color: var(--ink); }
.gantt-ms.late { background: var(--red); border-color: var(--red); }
.gantt-ms.done { background: var(--green); border-color: var(--green); }
.gantt-limit { position: absolute; top: 4px; bottom: 4px; width: 2px; background: var(--red); border-radius: 1px; z-index: 2; }
.gantt-limit::after { content: ''; position: absolute; top: -2px; left: -3px; border: 4px solid transparent; border-top-color: var(--red); }
.gantt-key { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
.gantt-key i { display: inline-block; width: 18px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.gantt-key i.ms { width: 9px; height: 9px; transform: rotate(45deg); border-radius: 1px; }

.heat { flex: 1; min-height: 0; min-width: 0; overflow: auto; }
.heat-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.heat-table th, .heat-table td { height: 34px; padding: 0 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.heat-table thead th { position: sticky; top: 0; z-index: 2; background: var(--head-ground); border-bottom: 1px solid var(--head-rule); font-weight: 600; color: var(--ink-2); text-align: left; vertical-align: bottom; padding-bottom: 7px; height: 44px; }
.heat-table th.fixed, .heat-table td.fixed { position: sticky; z-index: 1; background: var(--surface); overflow: hidden; text-overflow: ellipsis; max-width: 0; }
.heat-table thead th.fixed { z-index: 3; background: var(--head-ground); }
.heat-table th.fixed.num, .heat-table td.fixed.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.heat-table thead th.fixed.num { font-family: var(--font); }
.heat-table th.cell { min-width: 46px; text-align: center; font-weight: 500; }
.heat-table th.cell span { display: block; font-size: 11px; }
.heat-table th.cell small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.heat-table td.cell { text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 46px; border-left: 1px solid var(--surface); }
.heat-table td.cell.over { background: var(--red-bg); color: var(--red); font-weight: 600; }
.heat-table td.cell.near { background: var(--amber-bg); color: var(--amber); }
.heat-table td.cell.ok { background: var(--green-bg); color: var(--green); }
.heat-table tr.total td { font-weight: 600; border-top: 1px solid var(--head-rule); }
.heat-table tr.total td.fixed { background: var(--surface-2); }
.heat-table tr.clickable { cursor: pointer; }
.heat-table tr.clickable:hover td.fixed { background: var(--row-hover); }
.heat-table td.fixed:last-of-type { border-right: 1px solid var(--line); }

/* The public demo's guided tour (components/shell/demo-tour.tsx): the cursor that presses the real controls, the ring
   on what a step is about, and the step card at the bottom right of the screen. */
.demo-tour-cursor { position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none; opacity: 0; transition: transform .7s cubic-bezier(.45,.05,.25,1), opacity .3s; filter: drop-shadow(0 3px 6px rgba(20, 20, 22, .35)); }
.demo-tour-cursor.on { opacity: 1; }
.demo-tour-cursor svg { display: block; transition: transform .15s; }
.demo-tour-cursor svg path { fill: var(--asphalt); stroke: var(--paper); stroke-width: 1.6; stroke-linejoin: round; }
.demo-tour-cursor.down svg { transform: scale(.82); }
.demo-tour-cursor .ripple { position: absolute; left: -14px; top: -14px; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--marking); animation: demo-tour-ripple .6s ease-out forwards; }
@keyframes demo-tour-ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
/* The spotlight is the kit's (.tour-spot) over the whole app; only the card takes the pointer, so the visitor can also
   use the screen under it. While a screen loads the whole screen dims and the card waits at the bottom right. */
.demo-tour { position: fixed; inset: 0; z-index: 390; pointer-events: none; }
.demo-tour-spot { transition: left .5s cubic-bezier(.2,.8,.2,1), top .5s cubic-bezier(.2,.8,.2,1), width .5s cubic-bezier(.2,.8,.2,1), height .5s cubic-bezier(.2,.8,.2,1); }
.demo-tour-dim { position: fixed; inset: 0; background: rgba(20, 20, 22, 0.32); transition: opacity .3s; }
.demo-tour-card { z-index: 410; pointer-events: auto; transition: left .5s cubic-bezier(.2,.8,.2,1), top .5s cubic-bezier(.2,.8,.2,1); }
.demo-tour-card .tour-body { min-height: 40px; }
.demo-tour-card .tour-foot { justify-content: flex-end; }
.demo-tour-card .btn.primary { min-width: 72px; }
.tour-progress { display: flex; gap: 3px; margin-top: 4px; }
.tour-progress i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.tour-progress i.done { background: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.tour-progress i.on { background: var(--gold); }
.demo-tour-wait { color: var(--muted); }
.demo-tour-wait i { display: inline-block; width: 4px; height: 4px; margin-left: 3px; border-radius: 50%; background: var(--muted); animation: demo-tour-wait 1s infinite both; }
.demo-tour-wait i:nth-child(2) { animation-delay: .15s; } .demo-tour-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes demo-tour-wait { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .demo-tour-spot, .demo-tour-card, .demo-tour-cursor { transition: none !important; } }
/* ─── Show me (/show-me): a full-screen map with the question bar over it, and its side panel ─── */
.card.show-me-map { flex: 1; min-width: 0; }
.card.show-me-map > .card-body { position: relative; }
.card.show-me-side { flex: none; width: 440px; }
.prompt-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(760px, calc(100% - 32px)); z-index: 6; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 6px 6px 6px 14px; box-shadow: 0 6px 24px rgba(20, 20, 22, 0.14); cursor: text; }
.prompt-bar > .i { color: var(--mustard); flex: none; }
.prompt-bar .input { border: 0; box-shadow: none; flex: 1; padding: 0 4px; background: transparent; }
.prompt-bar .input:focus { box-shadow: none; }
.prompt-bar .note { position: absolute; left: 14px; top: -22px; font-size: 12px; color: var(--muted); }
.show-error { flex: none; margin: 10px 14px 0; padding: 8px 10px; border-radius: var(--radius); background: var(--red-bg); color: var(--red); font-size: 13px; }
.show-totals { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); background: var(--surface-2); }
.show-list { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.show-fig { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.show-fig .label { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-fig .value { font-weight: 600; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; cursor: help; }
.show-fig.missing .value { color: var(--muted); font-weight: 400; }
.delta-chip { align-self: flex-start; font-size: 11px; font-weight: 600; line-height: 16px; padding: 0 6px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.delta-chip.good { color: var(--green); background: var(--green-bg); }
.delta-chip.bad { color: var(--red); background: var(--red-bg); }
.delta-chip.flat { color: var(--muted); background: var(--grey-bg); }
.show-words { margin: 0; line-height: 1.5; }
.show-estimate { color: var(--estimate); font-weight: 600; }
.show-knock h3, .show-item h3 { margin: 0; font-size: 13px; font-weight: 600; }
.show-knock ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.45; }
.show-item { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.show-item.tone-more { border-left: 3px solid var(--green); }
.show-item.tone-less { border-left: 3px solid var(--red); }
.show-item.tone-changed { border-left: 3px solid var(--blue); }
.show-item .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.show-item .who { font-size: 12px; color: var(--ink-2); cursor: help; }
.show-item .figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.show-item .note, .show-list > .note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.show-examples { display: flex; flex-direction: column; gap: 8px; }
.show-examples .btn { justify-content: flex-start; }
.show-turn { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 9px 12px; background: var(--surface); cursor: pointer; }
.show-turn:hover { border-color: var(--line); }
.show-turn.on { border-color: var(--ink-2); box-shadow: 0 0 0 1px var(--ink-2) inset; }
.show-turn .q { font-weight: 600; }
.show-turn .t { font-size: 13px; color: var(--ink-2); }
.show-turn .m { font-size: 12px; color: var(--muted); }

/* RACI by stage (Project plan, Alastair Kennedy 11 Nov 2026): a table a workstream, people down the left (sticky), its
   task groups across the top opening to their tasks; letters in blue cells, R darkest, then A, C, I; grey for none. */
.raci-body { overflow: auto; position: relative; }
.raci-streams { display: flex; flex-direction: column; gap: 14px; padding: 12px; }
.raci-stream { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.raci-stream-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13px; flex-wrap: wrap; }
.raci-stream-head b { max-width: 420px; }
.raci-wrap { overflow-x: auto; }
/* The letters and stages in the colours of Alastair Kennedy's example (11 Nov 2026): dark navy headings, stages as chevrons
   from navy to grey-blue, letters in navy on a blue scale (R darkest, then A, C and I), grey where there is none. */
.raci-table { --raci-ink: #1d3b66; --raci-head: #16294a; --raci-label: #e4e7eb; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
.raci-table th, .raci-table td { padding: 0 8px; height: 36px; white-space: nowrap; text-align: left; font-weight: 400; }
.raci-table thead th { font-weight: 600; color: var(--ink-2); background: var(--surface); }
.raci-table thead th.who, .raci-table thead th.role, .raci-table thead th.org { background: var(--raci-head); color: #fff; font-weight: 700; border-radius: 2px; }
.raci-table .who { position: sticky; left: 0; z-index: 2; background: var(--raci-label); width: 170px; min-width: 170px; max-width: 170px; font-weight: 600; color: var(--raci-ink); }
.raci-table .role { position: sticky; left: 173px; z-index: 2; background: var(--raci-label); width: 150px; min-width: 150px; max-width: 150px; color: var(--raci-ink); }
.raci-table .org { position: sticky; left: 326px; z-index: 2; background: var(--raci-label); width: 120px; min-width: 120px; max-width: 120px; box-shadow: 6px 0 6px -6px rgba(20, 20, 22, 0.18); }
.raci-table tr.checks .who, .raci-table tr.checks .role, .raci-table tr.checks .org { background: var(--surface); }
.raci-table .who .clip, .raci-table .role .clip { display: block; overflow: hidden; text-overflow: ellipsis; }
.raci-table th.raci-stage { min-width: 96px; padding: 0; background: var(--stage, #22406f); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); }
.raci-table th.raci-stage.first { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.raci-table th.raci-stage button { all: unset; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 20px; height: 36px; width: 100%; box-sizing: border-box; cursor: pointer; color: #fff; font-weight: 700; }
.raci-table th.raci-stage button .muted { color: rgba(255, 255, 255, 0.72); font-weight: 500; }
.raci-table th.raci-stage button:disabled { cursor: default; }
.raci-table th.raci-stage .caret { width: 10px; color: rgba(255, 255, 255, 0.8); }
.raci-table th.task, .raci-table th.all { font-weight: 500; color: var(--muted); text-align: center; font-size: 11.5px; height: 22px; }
.raci-cell { text-align: center !important; font-weight: 700; font-size: 14px; border-radius: 2px; min-width: 64px; position: relative; letter-spacing: 0.02em; color: var(--raci-ink, #1d3b66); }
/* The table's own cell rule would make the letters plain: bold navy letters, as in the example. */
.raci-table td.raci-cell { font-weight: 700; font-size: 14px; }
.raci-table td.raci-cell.mixed { font-weight: 600; font-size: 11.5px; }
.raci-cell.task { min-width: 52px; font-size: 13px; }
.raci-table td.raci-cell.task { font-size: 13px; }
.raci-cell.none { background: #e2e4e8; color: transparent; font-weight: 400; }
.raci-cell.r { background: #1a8bb3; }
.raci-cell.a { background: #5fcdf2; }
.raci-cell.c { background: #9fdcf1; }
.raci-cell.i { background: #ccecf7; }
.raci-cell.mixed { background: repeating-linear-gradient(135deg, #9fdcf1 0 4px, #ccecf7 4px 8px); font-weight: 600; font-style: italic; font-size: 11.5px; }
.raci-cell.edit { cursor: pointer; }
.raci-cell.edit:hover { outline: 2px solid var(--raci-ink, #1d3b66); outline-offset: -2px; }
.raci-cell.edit select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.raci-table tr.checks th, .raci-table tr.checks td { border-top: 1px solid var(--line-soft); }
.raci-check { text-align: center !important; }
.raci-org { display: flex; align-items: center; gap: 6px; min-width: 0; }
.raci-key { gap: 14px; flex-wrap: wrap; }
.raci-key .raci-cell { display: inline-block; min-width: 26px; padding: 0 4px; margin-right: 5px; font-style: normal; line-height: 18px; }

/* Hubshape for Vos: a negative figure (a lane that loses money) in the warning red. */
.neg { color: var(--red); }
/* Hubshape for Vos: a small table inside an opened row (a lane's loops), plain so it never fights the outer table. */
.loops-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 4px 0 8px; font-size: 12.5px; }
.loops-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.loops-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loops-table :is(th, td).num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Two lanes up close (Profitability): a losing lane, where it delivers, and what its trucks do next there */
.uc { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 16px; }
.uc-flow { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.uc-node { border: 1.5px solid var(--ink); border-radius: 10px; padding: 10px 14px; display: flex; align-items: baseline; gap: 12px; background: var(--paper); cursor: default; }
.uc-node b { font: 700 18px var(--display); color: var(--ink); white-space: nowrap; }
.uc-node span { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.uc-node.none { border-style: dashed; border-color: var(--muted); background: transparent; }
.uc-node.none b { color: var(--muted); }
.uc-node.feeds { background: var(--amber-bg); border-color: var(--amber); }
.uc-link { display: flex; align-items: center; gap: 12px; padding-left: 18px; cursor: default; }
.uc-arrow { width: 18px; height: 32px; flex: none; stroke: var(--ink); fill: var(--ink); }
.uc-link b { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.uc-link span { display: block; font-size: 12.5px; color: var(--ink-2); }
.uc-link .neg { color: var(--red); font-weight: 600; }
.uc-say { flex: none; background: var(--asphalt); color: var(--chrome-text, #F7F6F1); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; line-height: 1.45; }
.uc-say b { box-shadow: inset 0 -3px 0 var(--marking); }
.uc.safe .uc-node:first-child, .uc.holds .uc-node:first-child { border-width: 1.5px; }

/* Project plan: a simple Gantt bar in a table cell */
.gantt-track { position: relative; height: 14px; border-radius: 4px; background: var(--surface-2); }
.gantt-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; background: var(--asphalt); box-shadow: inset 0 -3px 0 var(--marking); }
.sc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.sc-body > .stats { flex: none; }

/* Quick wins' loop analysis: how often a loop ran, run by run */
.qw-runs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.qw-runs-figs { flex: none; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.qw-runs-figs b { color: var(--ink); font-family: var(--mono); }
.qw-runs-chart { flex: 1; min-height: 120px; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; display: flex; }
.qw-week { flex: none; width: 100%; border-collapse: collapse; font-size: 12px; }
.qw-week th, .qw-week td { padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); }
.qw-week th { font-family: var(--font); color: var(--muted); font-weight: 600; }
.qw-week td:first-child { text-align: left; font-family: var(--font); color: var(--muted); }
/* Quick wins' day map key: the leg colour scale, empty runs, no GPS, the home base, a loop that did not come home. */
.qw-legend { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; max-width: calc(100% - 20px);
  padding: 5px 8px; font-size: 10.5px; line-height: 1.2; color: var(--ink-2, currentColor); background: rgba(255, 255, 255, 0.94); border-radius: 6px; }
.qw-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.qw-legend-scale { gap: 0 !important; }
.qw-legend-scale i { display: block; width: 14px; height: 8px; }
.qw-legend-line { display: inline-block; width: 18px; height: 2px; }
.qw-legend-dash { display: inline-block; width: 18px; height: 0; border-top: 2px dashed; }
.qw-legend-base { display: inline-block; width: 9px; height: 9px; border: 1.5px solid; border-radius: 2px; }
.qw-legend-end { display: inline-block; width: 8px; height: 8px; border: 1.5px solid; border-radius: 50%; }
.qw-legend-chip { display: inline-block; width: 22px; height: 8px; vertical-align: middle; }
/* A two-line table cell (kit Cell2): the figure on top, a quieter line of detail under it */
.cell2 { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cell2-top { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell2-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
td.num .cell2 { align-items: flex-end; }
