/* Kill Sheet. Reads like a printed board report: white page, near black ink, serif headlines and
   figures, hairline rules instead of boxes. One deep blue leads the charts; the rest of the chart
   colors are a validated data palette. Green and red mean ahead and behind only. */
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
:root {
  color-scheme: light;
  --serif: "Source Serif 4", Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Display", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: oklch(1 0 0);
  --plane: oklch(1 0 0);
  --wash: oklch(0.968 0.003 260);
  --surface: oklch(1 0 0);
  --ink: oklch(0.19 0.018 262);
  --ink-2: oklch(0.44 0.014 262);
  --line: oklch(0.9 0.004 262);
  --line-strong: oklch(0.76 0.008 262);
  --rule: var(--ink);
  --rule-soft: var(--line-strong);
  --primary: oklch(0.3 0.075 262);
  --primary-hover: oklch(0.24 0.07 262);
  --primary-ink: oklch(1 0 0);
  --primary-soft: oklch(0.95 0.014 262);
  --focus: oklch(0.5 0.15 255);
  --danger: oklch(0.5 0.19 27);
  /* data */
  --s1: #1757ac;
  --s2: #c3c9d1;
  --s3: #7d8590;
  --s-prev: #9aa1ab;
  --hl: #b87d00;
  --grid: #ebebeb;
  --axis: #bdbdbd;
  --good: #0aac23;
  --good-ink: #006c10;
  --bad: #dc3c3d;
  --bad-ink: #b3262a;
  --q1: #b6d5f8; --q2: #84b9f3; --q3: #519ced; --q4: #257de0; --q5: #1757ac;
  --map-empty: oklch(0.955 0.003 262);
  --good-soft: oklch(0.95 0.05 150);
  --bad-soft: oklch(0.955 0.035 25);
  --accent: #b87d00;
  --c1: #1757ac; --c2: #5b93d6; --c3: #a9c8ee; --c4: #5f6772; --c5: #9aa1ab; --c6: #cfd3d9;
  --shadow-lift: 0 8px 24px oklch(0.2 0.02 262 / 0.16), 0 1px 3px oklch(0.2 0.02 262 / 0.12);
  --r: 3px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --z-sticky: 10;
  --z-deck: 20;
  --z-toast: 60;
  --z-tip: 70;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.158 0.006 264);
  --plane: oklch(0.158 0.006 264);
  --wash: oklch(0.2 0.008 264);
  --surface: oklch(0.158 0.006 264);
  --ink: oklch(0.935 0.006 85);
  --ink-2: oklch(0.7 0.01 264);
  --line: oklch(0.245 0.008 264);
  --line-strong: oklch(0.34 0.01 264);
  --rule: oklch(0.6 0.012 264);
  --rule-soft: oklch(0.34 0.01 264);
  --primary: oklch(0.935 0.006 85);
  --primary-hover: oklch(1 0 0);
  --primary-ink: oklch(0.158 0.006 264);
  --primary-soft: oklch(0.24 0.01 264);
  --focus: oklch(0.78 0.13 245);
  --danger: oklch(0.74 0.16 27);
  --s1: #4c9af5;
  --s2: #3f4753;
  --s3: #8a929e;
  --s-prev: #5f6773;
  --hl: #d28e05;
  --grid: oklch(0.225 0.007 264);
  --axis: oklch(0.36 0.01 264);
  --good: #19b83a;
  --good-ink: #5fd470;
  --bad: #eb6263;
  --bad-ink: #f08a8a;
  --good-soft: oklch(0.3 0.07 150);
  --bad-soft: oklch(0.3 0.07 25);
  --q1: #0e3d7e; --q2: #1757ac; --q3: #257de0; --q4: #6aabf1; --q5: #b6d5f8;
  --map-empty: oklch(0.21 0.008 264);
  --accent: #d28e05;
  --c1: #4c9af5; --c2: #2f6fc4; --c3: #244f8f; --c4: #a3abb7; --c5: #6f7783; --c6: #474e5a;
  --shadow-lift: 0 12px 28px oklch(0 0 0 / 0.55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--plane);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-weight: 550; white-space: nowrap;
  transition: transform 140ms var(--ease), background-color 140ms ease, border-color 140ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink-2); transition: background-color 140ms ease, transform 140ms var(--ease); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn.spin .ic { animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { padding: 2px 0; border: 0; background: none; color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--plane); }
  .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
  .btn-quiet:hover { color: var(--ink); }
  .icon-btn:not(:disabled):hover { background: var(--plane); color: var(--ink); }
}
.field { display: grid; gap: 6px; align-content: start; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); transition: border-color 140ms ease, box-shadow 140ms ease; font-variant-numeric: tabular-nums;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.small { width: 76px; }
.select { width: auto; padding-right: 6px; font-weight: 600; }
.hint { font-size: 13px; color: var(--ink-2); }
.hint.bad, .error { color: var(--danger); font-weight: 550; }
.error { font-size: 13.5px; min-height: 20px; }

/* Sign in */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate-box { width: min(380px, 100%); padding: 28px; display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.gate-box h1 { font-size: 24px; letter-spacing: -0.02em; }
.gate-box p { color: var(--ink-2); }
.gate-mark { width: 40px; height: 40px; }
.code-input { height: 48px; font-size: 22px; letter-spacing: 0.3em; }
.gate .btn { height: 44px; }

/* Shell */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: 16px; padding: 10px 24px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; }
.brand b { font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--plane); border-radius: var(--r); }
.tabs button, .seg button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms var(--ease);
}
.tabs button:active, .seg button:active { transform: scale(0.97); }
.tabs button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px oklch(0.3 0.02 245 / 0.14); }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; display: inline-flex; gap: 2px; padding: 3px; background: var(--plane); border-radius: var(--r); border: 1px solid var(--line); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.dot.stale { background: var(--bad); }
.me-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 650; }
.menu {
  position: fixed; inset: auto; top: 54px; right: 24px; margin: 0; min-width: 190px; padding: 6px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift);
  transform-origin: top right; opacity: 1; transform: scale(1);
  transition: opacity 140ms var(--ease), transform 140ms var(--ease), display 140ms allow-discrete, overlay 140ms allow-discrete;
}
.menu:not(:popover-open) { opacity: 0; transform: scale(0.96); }
@starting-style { .menu:popover-open { opacity: 0; transform: scale(0.96); } }
.menu p { padding: 6px 10px 8px; font-size: 13px; color: var(--ink-2); }
.menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
@media (hover: hover) and (pointer: fine) { .menu button:hover { background: var(--plane); } }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 14px; }
.notice .ic { color: var(--bad-ink); margin-top: 2px; }
.notice .why { color: var(--ink-2); }

.main { max-width: 1240px; margin: 0 auto; padding: 20px 24px 64px; display: grid; gap: 16px; }
.main > * { min-width: 0; }
.controls > * { min-width: 0; }
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.controls.inline { margin-bottom: 12px; }
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 12px; border: 1px solid var(--primary); border-radius: 999px; background: var(--primary-soft); font-size: 13.5px; transition: transform 140ms var(--ease); }
.chip:active { transform: scale(0.97); }
.chip span { color: var(--ink-2); }
.chip .ic { width: 14px; height: 14px; }

/* Slides: the same sections make the page and the presentation */
.slide { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px 24px; min-width: 0; }
.slide.quiet { background: transparent; border-style: dashed; }
.slide-head { display: grid; gap: 4px; margin-bottom: 18px; }
.slide-head h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
.slide-head p { color: var(--ink-2); font-size: 14px; max-width: 80ch; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 36px; align-items: start; }
.split.wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.stack { display: grid; gap: 26px; }
.panel { min-width: 0; }
.panel h3, .plot-title { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.plot-title { margin-top: 24px; }
.panel-sub { font-size: 13px; color: var(--ink-2); margin: -6px 0 10px; }
.none { color: var(--ink-2); padding: 18px 0; }

/* Headline figures: one hero, three supporting, split by hairlines instead of boxes */
.stats { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats.small { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.stat { display: grid; gap: 2px; align-content: start; padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stat-value { font-size: 30px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.stat.hero .stat-value { font-size: 56px; letter-spacing: -0.035em; line-height: 1.05; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.delta b { color: var(--ink); font-weight: 650; }
.delta .ic { width: 14px; height: 14px; }
.delta.up .ic { color: var(--good-ink); }
.delta.down .ic { color: var(--bad-ink); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 36px; padding: 14px 0 0; }
.facts dt { font-size: 13px; color: var(--ink-2); }
.facts dd { font-weight: 650; font-size: 16px; }

/* Charts */
.plot { min-width: 0; }
.chart { display: block; overflow: visible; }
.chart text { font-family: inherit; fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .cap, .chart .end.strong { fill: var(--ink); font-weight: 650; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .hit:focus-visible, .col-group:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.col-group { outline: none; }
.col-group.pick { cursor: pointer; }
.col-group path { transition: opacity 120ms ease; }
.chart:has(.col-group:hover) .col-group:not(:hover) path { opacity: 0.55; }
.col-group.muted path { opacity: 0.4; }
.target-mark { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line.actual { stroke: var(--s1); }
.line.proj { stroke: var(--s1); stroke-dasharray: 2 6; }
.line.target { stroke: var(--ink-2); }
.area { fill: var(--s1); opacity: 0.1; }
.dot { }
.chart .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.cross { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; flex: none; background: var(--c); }
.key.rect { width: 10px; height: 10px; border-radius: 2px; }
.key.line { width: 16px; height: 2px; border-radius: 1px; }
.key.line.dash { background: linear-gradient(90deg, var(--c) 0 4px, transparent 4px 8px, var(--c) 8px 12px, transparent 12px 16px); }
.key.tick { width: 14px; height: 2px; border-radius: 1px; }

.tip {
  position: fixed; left: 0; top: 0; z-index: var(--z-tip); pointer-events: none;
  min-width: 120px; max-width: 280px; padding: 8px 10px; border-radius: var(--r);
  background: var(--ink); color: var(--bg); font-size: 13px; box-shadow: var(--shadow-lift);
  opacity: 0; transition: opacity 100ms ease;
}
.tip.on { opacity: 1; }
.tip-title { font-weight: 600; opacity: 0.75; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tip-row b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tip-row span:last-child { opacity: 0.8; }
.tip-key { width: 12px; height: 2px; border-radius: 1px; background: var(--c); flex: none; }
.tip-key.dash { background: linear-gradient(90deg, var(--c) 0 4px, transparent 4px 8px, var(--c) 8px 12px); }

/* Ranked bars */
.bars { display: grid; gap: 2px; }
.bar-row {
  display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 34px; padding: 4px 8px; margin: 0 -8px;
  border: 0; border-radius: 6px; background: transparent; text-align: left; width: calc(100% + 16px);
  transition: background-color 120ms ease;
}
button.bar-row[aria-pressed="true"] { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
@media (hover: hover) and (pointer: fine) { button.bar-row:hover { background: var(--plane); } button.bar-row[aria-pressed="true"]:hover { background: var(--primary-soft); } }
.bl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; font-size: 14px; }
.bl small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.bt { display: block; height: 10px; }
.bt i { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 0 4px 4px 0; }
.bv { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.bars + .link { margin-top: 10px; }

/* Share of a whole */
.share { display: flex; gap: 2px; height: 28px; }
.share button { width: var(--w); min-width: 6px; padding: 0 8px; border: 0; border-radius: 4px; background: var(--c); color: #fff; font-weight: 650; font-size: 13px; text-align: left; overflow: hidden; white-space: nowrap; transition: filter 120ms ease; }
.share button:nth-child(2) { color: #0b0b0b; }
.share button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
@media (hover: hover) and (pointer: fine) { .share button:hover { filter: brightness(1.08); } }
.share-key { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-size: 14px; }
.share-key li { display: inline-flex; align-items: center; gap: 7px; }
.share-key b { font-weight: 650; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { overflow-x: auto; min-width: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table thead th { font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-bottom-color: var(--line-strong); }
.table tbody th { font-weight: 550; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--ink-2); }
.table tfoot th, .table tfoot td, .table tr.total th, .table tr.total td { font-weight: 650; border-bottom-color: var(--line-strong); }
.table tfoot td.muted, .table tr.total td.muted { font-weight: 400; }
.after-table { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.issues summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.issues .table td:last-child { white-space: normal; min-width: 260px; }

/* Map */
.map { display: block; width: 100%; max-height: 520px; }
.zip { fill: var(--map-empty); stroke: var(--surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.zip.q1 { fill: var(--q1); } .zip.q2 { fill: var(--q2); } .zip.q3 { fill: var(--q3); } .zip.q4 { fill: var(--q4); } .zip.q5 { fill: var(--q5); }
.zip[role="button"] { cursor: pointer; outline: none; }
.zip[role="button"]:hover, .zip[role="button"]:focus-visible, .zip.on { stroke: var(--ink); stroke-width: 2; }
.map-key { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.map-key i { width: 26px; height: 10px; border-radius: 2px; }
.map-key .q1 { background: var(--q1); } .map-key .q2 { background: var(--q2); } .map-key .q3 { background: var(--q3); } .map-key .q4 { background: var(--q4); } .map-key .q5 { background: var(--q5); }
.map-key + .panel-sub { margin-top: 8px; }
.map-key span:first-child { margin-right: 4px; } .map-key span:last-child { margin-left: 4px; }

/* Targets */
.scores { display: grid; }
.score {
  display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(160px, 2.2fr) minmax(150px, 1fr) minmax(170px, 1.1fr); align-items: center; gap: 18px;
  padding: 14px 12px; margin: 0 -12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left;
  transition: background-color 120ms ease;
}
.score:first-child { border-top: 0; }
.score[aria-pressed="true"] { background: var(--primary-soft); border-radius: var(--r); border-top-color: transparent; }
.score[aria-pressed="true"] + .score { border-top-color: transparent; }
@media (hover: hover) and (pointer: fine) { .score:not([aria-pressed="true"]):hover { background: var(--plane); } }
.score-name { font-weight: 650; }
.score-nums { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.score-nums b { color: var(--ink); font-size: 20px; font-weight: 650; letter-spacing: -0.015em; }
.score-proj { color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.meter { position: relative; height: 10px; border-radius: 5px; background: var(--line); }
.meter i { display: block; height: 100%; width: var(--w); min-width: 0; border-radius: 5px; background: var(--s1); }
.meter.good i { background: var(--good); }
.meter.bad i { background: var(--bad); }
.meter b { position: absolute; left: var(--x); top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.status.good .ic { color: var(--good-ink); }
.status.bad .ic { color: var(--bad-ink); }
.status.wait, .status.none { color: var(--ink-2); font-weight: 500; }
.edit-line { margin-top: 16px; }
.empty { display: grid; gap: 18px; justify-items: start; max-width: 70ch; }
.target-form { display: grid; gap: 22px; max-width: 760px; }
.target-form fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 14px; min-width: 0; }
.target-form legend { padding: 0; font-weight: 650; font-size: 15px; margin-bottom: 4px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.field-grid.q { grid-template-columns: repeat(4, minmax(80px, 140px)); }
.grow-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.actions { display: flex; gap: 8px; }

.deck-bar { display: none; }
#toast {
  position: fixed; left: 50%; bottom: 20px; z-index: var(--z-toast); max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: var(--r);
  background: var(--ink); color: var(--bg); font-weight: 550; font-size: 14px;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Presentation mode: one section at a time, sized for a room */
body.present { background: var(--bg); font-size: 19px; }
body.present .topbar, body.present .notice { display: none; }
body.present .main { max-width: none; min-height: 100dvh; padding: 4vh 5vw 84px; align-content: center; }
body.present .slide { border: 0; padding: 0; animation: slide-in 220ms var(--ease); }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.present .slide-head { margin-bottom: 28px; }
body.present .slide-head h2 { font-size: 40px; letter-spacing: -0.03em; }
body.present .slide-head p { font-size: 19px; }
body.present .panel h3, body.present .plot-title { font-size: 19px; }
body.present .panel-sub, body.present .hint { font-size: 15px; }
body.present .stat-label, body.present .facts dt { font-size: 16px; }
body.present .stat-value { font-size: 44px; }
body.present .stat.hero .stat-value { font-size: 88px; }
body.present .delta { font-size: 16px; }
body.present .facts dd { font-size: 22px; }
body.present .chart text { font-size: 15px; }
body.present .legend, body.present .table, body.present .share-key { font-size: 17px; }
body.present .table thead th { font-size: 15px; }
body.present .bl { font-size: 18px; } body.present .bl small { font-size: 14px; }
body.present .bar-row { min-height: 42px; }
body.present .bt { height: 14px; }
body.present .share { height: 28px; }
body.present .score-name, body.present .status { font-size: 19px; }
body.present .score-nums b { font-size: 28px; }
body.present .score-proj { font-size: 16px; }
body.present .score { padding: 20px 12px; }
body.present .map { max-height: calc(100dvh - 420px); }
body.present #toast { bottom: 76px; }
body.present .deck-bar {
  position: fixed; left: 50%; bottom: 16px; z-index: var(--z-deck); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 5px 6px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift);
  opacity: 0.35; transition: opacity 160ms ease;
}
body.present .deck-bar:hover, body.present .deck-bar:focus-within { opacity: 1; }
.deck-pos { min-width: 70px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .split, .split.wide-left { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat { border-left: 0; padding: 14px 0; border-top: 1px solid var(--line); }
  .stats .stat:nth-child(-n+2) { border-top: 0; }
  .stats .stat.hero { grid-column: 1 / -1; }
  .stats .stat.hero + .stat { border-top: 1px solid var(--line); }
  .stats.small .stat:nth-child(-n+2) { border-top: 0; }
  .score { grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .score .meter-slot { grid-column: 1 / -1; order: 3; }
  .score .status { order: 4; } .score .score-proj { order: 5; text-align: right; }
  .score-nums { text-align: right; }
}
@media (max-width: 640px) {
  .topbar { padding: 8px 14px; gap: 8px; flex-wrap: wrap; }
  .brand b, .sync, .btn .lbl { display: none; }
  .main { padding: 14px 12px 48px; }
  .slide { padding: 16px 14px 18px; border-radius: 10px; }
  .stat.hero .stat-value { font-size: 44px; }
  .stat-value { font-size: 24px; }
  .input { font-size: 16px; }
  .field-grid.q { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: minmax(96px, 42%) 1fr auto; gap: 8px; }
  .notice { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .btn:active, .icon-btn:active, .chip:active, .tabs button:active, .seg button:active { transform: none; }
}
body.present .bars + .link { display: none; }

.stats.four { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.facts.lead { padding: 0 0 18px; }
.panel-sub.lead { margin: 0 0 14px; font-size: 14px; }
.issues.spaced { margin-top: 20px; }
body.present .panel-sub.lead { font-size: 18px; }
@media (max-width: 900px) { .stats.four { grid-template-columns: 1fr 1fr; } .stats.four .stat:nth-child(-n+2) { border-top: 0; } }

/* ---- Board report look: rules instead of boxes, serif headlines and figures, flat marks ---- */
body { font-family: var(--sans); background: var(--bg); }
.topbar { padding: 14px 32px 0; gap: 28px; border-top: 4px solid var(--rule); border-bottom: 1px solid var(--line-strong); align-items: flex-end; }
.brand { align-items: center; gap: 12px; padding-bottom: 12px; }
.brand img { width: 30px; height: 30px; border-radius: 2px; }
.brand b { display: grid; font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.brand b small { font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.tabs { gap: 22px; padding: 0; background: none; border-radius: 0; align-self: flex-end; }
.tabs button { height: auto; padding: 0 0 12px; border-radius: 0; font-size: 14.5px; font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { background: none; box-shadow: none; color: var(--ink); border-bottom-color: var(--rule); }
.top-right { padding-bottom: 9px; }
.seg { gap: 0; padding: 0; background: none; border: 1px solid var(--line-strong); border-radius: var(--r); }
.seg button { height: 32px; border-radius: 0; border-left: 1px solid var(--line-strong); font-weight: 550; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
.btn { font-weight: 550; }
.me-btn { border-radius: 50%; }
.menu { border-radius: 4px; }
.chip { border-radius: var(--r); border-color: var(--line-strong); background: var(--wash); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover, .icon-btn:not(:disabled):hover, .menu button:hover, button.bar-row:hover, .donut-key button:hover, .score:not([aria-pressed="true"]):hover { background: var(--wash); }
  .btn-primary:hover { background: var(--primary-hover); }
  .tabs button:hover { color: var(--ink); }
  .table tbody tr:hover { background: var(--wash); }
}

.main { max-width: 1200px; padding: 26px 32px 80px; gap: 44px; }
.controls { margin-bottom: -18px; }
.slide { background: none; border: 0; border-top: 2px solid var(--rule); border-radius: 0; padding: 16px 0 0; }
.slide.quiet { border-top: 1px solid var(--line-strong); border-style: solid; }
.slide-head { gap: 6px; margin-bottom: 24px; }
.slide-head h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: -0.012em; line-height: 1.2; }
.slide-head p { font-size: 14.5px; line-height: 1.5; max-width: 72ch; }
.panel h3, .plot-title { font-size: 13.5px; font-weight: 650; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.plot-title { margin-top: 30px; }
.panel-sub { margin: -4px 0 12px; }
.split { gap: 36px 48px; }

/* Headline figures set like a financial summary: serif numerals over hairlines */
.stats, .stats.small, .stats.four { gap: 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.stat { gap: 3px; padding: 18px 24px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: none; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat.hero { background: none; }
.stat-label { font-size: 13px; font-weight: 550; }
.stat-value { font-family: var(--serif); font-size: 36px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.12; font-variant-numeric: lining-nums tabular-nums; }
.stat.hero .stat-value { font-size: 68px; font-weight: 700; letter-spacing: -0.025em; line-height: 1; margin: 4px 0 6px; }
.delta { gap: 5px; }
.delta b { font-weight: 650; }
.delta.up b { color: var(--good-ink); }
.delta.down b { color: var(--bad-ink); }
.facts { gap: 0; padding: 16px 0 0; }
.facts > div { padding: 0 28px; border-left: 1px solid var(--line); }
.facts > div:first-child { padding-left: 0; border-left: 0; }
.facts.lead { padding: 0 0 20px; }
.facts dd { font-family: var(--serif); font-size: 20px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }

.bt { height: 9px; }
.bt i { border-radius: 0 2px 2px 0; }
.bars li:first-child .bl { font-weight: 650; }
.bv { font-weight: 650; }
button.bar-row, .donut-key li > * { border-radius: var(--r); }
button.bar-row[aria-pressed="true"], .donut-key button[aria-pressed="true"] { background: var(--wash); box-shadow: inset 0 0 0 1px var(--ink); }
.share button { border-radius: 2px; }
.meter, .meter i { border-radius: 2px; }
.meter { height: 9px; }
.score { margin: 0; padding: 16px 8px; }
.score[aria-pressed="true"] { background: var(--wash); border-radius: 0; box-shadow: inset 0 0 0 1px var(--line-strong); }
.score-name { font-weight: 650; }
.score-nums b { font-family: var(--serif); font-size: 24px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.table thead th { border-bottom: 1px solid var(--rule); }
.table tfoot th, .table tfoot td, .table tr.total th, .table tr.total td { border-top: 1px solid var(--rule); border-bottom: 0; }
.tip { border-radius: var(--r); }
#toast { border-radius: var(--r); }

.gate { background: var(--wash); }
.gate-box { border: 0; border-top: 4px solid var(--rule); border-radius: 0; padding: 32px; box-shadow: var(--shadow-lift); }
.gate-box h1 { font-family: var(--serif); font-size: 32px; font-weight: 700; letter-spacing: -0.015em; }
.gate-mark { width: 44px; height: 44px; border-radius: 2px; }

body.present .main { gap: 0; padding: 5vh 6vw 84px; }
body.present .slide { border-top: 0; padding: 0; background: transparent; }
body.present .slide-head { margin-bottom: 30px; padding-bottom: 18px; border-bottom: 2px solid var(--rule); }
body.present .slide-head h2 { font-size: 46px; letter-spacing: -0.02em; }
body.present .stat.hero .stat-value { font-size: 112px; }
body.present .stat-value { font-size: 50px; }
body.present .facts dd { font-size: 26px; }
body.present .score-nums b { font-size: 30px; }
body.present .deck-bar { border-radius: 4px; }

@media (max-width: 900px) {
  .stats .stat, .stats.four .stat { border-left: 0; padding: 14px 0; border-top: 1px solid var(--line); }
  .stats .stat:nth-child(-n+2), .stats.small .stat:nth-child(-n+2), .stats.four .stat:nth-child(-n+2) { border-top: 0; }
  .stats .stat.hero + .stat { border-top: 1px solid var(--line); }
  .facts { gap: 12px 0; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 14px 0; gap: 10px 14px; align-items: center; }
  .brand { padding-bottom: 8px; } .brand b { display: none; }
  .tabs { gap: 16px; order: 3; width: 100%; }
  .main { padding: 18px 14px 56px; gap: 34px; }
  .slide { padding: 14px 0 0; }
  .slide-head h2 { font-size: 22px; }
  .stat.hero .stat-value { font-size: 54px; } .stat-value { font-size: 28px; }
  .facts > div { padding: 0 16px; }
}

/* Entrance, once per view. Everything is visible by default; marks only settle into place. */
@media (prefers-reduced-motion: no-preference) {
  .main.enter .slide { animation: fade 240ms ease-out backwards; }
  .main.enter .bt i, .main.enter .meter i { animation: grow-x 420ms var(--ease) backwards; transform-origin: left center; }
  .main.enter .col-group path { animation: grow-y 420ms var(--ease) backwards; transform-box: fill-box; transform-origin: center bottom; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }

/* ---- More chart kinds ---- */
.gap-top { margin-top: 28px; }
.chart .line { stroke-width: 2; }
.chart .area { opacity: 0.14; }
.spark-slot { margin-top: 10px; min-height: 40px; }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { opacity: 0.16; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-box, .ring-box { position: relative; width: var(--size); height: var(--size); flex: none; }
.donut { display: block; }
.arc { stroke: var(--surface); stroke-width: 2; transition: opacity 140ms ease, transform 180ms var(--ease); transform-box: fill-box; transform-origin: center; }
.arc.pick { cursor: pointer; }
.arc.dim { opacity: 0.35; }
.donut:has(.arc:hover) .arc:not(:hover) { opacity: 0.5; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center b { font-family: var(--serif); font-size: calc(var(--size) * 0.15); font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 12.5px; color: var(--ink-2); }
.donut-key { flex: 1 1 200px; display: grid; gap: 2px; min-width: 0; }
.donut-key li > * { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 44px; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 3px; background: transparent; text-align: left; font-size: 14px; transition: background-color 120ms ease; }
.dk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.donut-key b { font-weight: 650; font-variant-numeric: tabular-nums; }
.dk-pct { color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.heat { display: grid; gap: 2px; overflow-x: auto; }
.heat-row { display: grid; grid-template-columns: minmax(96px, 150px) repeat(var(--cols), minmax(34px, 1fr)); gap: 2px; align-items: center; min-width: 560px; }
.heat-row.head span { font-size: 12px; color: var(--ink-2); text-align: center; }
.heat-label { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.cell { height: 28px; border-radius: 2px; display: grid; place-items: center; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; background: var(--map-empty); color: var(--ink-2); }
.cell.off { background: transparent; border: 1px dashed var(--line); }
.cell:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cell.h1, .map-key .h1 { background: color-mix(in oklab, var(--s1) 22%, var(--map-empty)); }
.cell.h2, .map-key .h2 { background: color-mix(in oklab, var(--s1) 42%, var(--map-empty)); }
.cell.h3, .map-key .h3 { background: color-mix(in oklab, var(--s1) 62%, var(--map-empty)); }
.cell.h4, .map-key .h4 { background: color-mix(in oklab, var(--s1) 82%, var(--map-empty)); }
.cell.h5, .map-key .h5 { background: var(--s1); }
.cell.h1, .cell.h2 { color: var(--ink); } .cell.h3, .cell.h4, .cell.h5 { color: #fff; }
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.ring-slot { display: grid; justify-items: center; gap: 10px; padding: 6px 12px 22px; border-left: 1px solid var(--line); }
.ring-slot:first-child { border-left: 0; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--s1); stroke-width: 8; stroke-linecap: butt; }
.ring.good .ring-fill { stroke: var(--good); } .ring.bad .ring-fill { stroke: var(--bad); }
.ring-label { display: grid; text-align: center; gap: 2px; }
.ring-label b { font-weight: 650; } .ring-label span { color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
body.present .donut-key li > * { font-size: 18px; padding: 10px; }
body.present .heat-label, body.present .cell { font-size: 16px; } body.present .cell { height: 40px; }
@media (prefers-reduced-motion: no-preference) {
  .main.enter .chart .line:not(.proj), .main.enter .spark-line { stroke-dasharray: 3000; animation: draw 700ms var(--ease) backwards; }
  .main.enter .ring-fill { animation: ring 600ms var(--ease) backwards; }
}
@keyframes pop { from { opacity: 0; transform: scale(0.8); } }
@keyframes draw { from { stroke-dashoffset: 3000; } to { stroke-dashoffset: 0; } }
@keyframes ring { from { stroke-dasharray: 0 1000; } }

/* ---- Executive pass: a lead section, findings, flagged marks ---- */
.topbar { border-top: 3px solid var(--accent); }
.slide { border-top: 1px solid var(--rule-soft); padding-top: 18px; scroll-margin-top: 84px; }
.slide.lead { border-top: 2px solid var(--rule); }
.slide-head h2 { font-size: 23px; font-weight: 600; max-width: 34em; }
.slide.lead .slide-head h2 { font-size: 34px; font-weight: 700; letter-spacing: -0.018em; line-height: 1.14; max-width: 26em; }
.slide-head h2, .stat-value, .facts dd, .score-nums b, .donut-center b, .brand b, .gate-box h1 { font-optical-sizing: auto; }
.lead-split { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.find-list { display: grid; }
.find-list li { border-bottom: 1px solid var(--line); }
.find-list li:last-child { border-bottom: 0; }
.find-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; width: 100%; padding: 11px 6px 11px 0; border: 0; background: none; text-align: left; font-family: var(--serif); font-size: 16px; line-height: 1.35; transition: color 140ms ease; }
.find-list .ic { margin-top: 4px; color: var(--ink-2); transition: transform 180ms var(--ease), color 140ms ease; }
@media (hover: hover) and (pointer: fine) { .find-list button:hover .ic { transform: translateX(3px); color: var(--accent); } }
.chart .note { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .dot.hot { fill: var(--hl); }
.chart .end.strong { font-weight: 600; }
.cell.h3, .cell.h4, .cell.h5 { color: #fff; }
:root[data-theme="dark"] .cell.h4, :root[data-theme="dark"] .cell.h5 { color: #0b0e13; }
:root[data-theme="dark"] .delta.up b { color: var(--good-ink); }
:root[data-theme="dark"] .tip { background: oklch(0.26 0.01 264); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-lift); }
:root[data-theme="dark"] #toast { background: oklch(0.26 0.01 264); color: var(--ink); }
:root[data-theme="dark"] .spark-area, :root[data-theme="dark"] .chart .area { opacity: 0.2; }
body.present .slide-head h2, body.present .slide.lead .slide-head h2 { font-size: 44px; font-weight: 700; max-width: 24em; }
body.present .slide, body.present .slide.lead { border-top: 0; }
body.present .find-list button { font-size: 21px; padding: 14px 6px 14px 0; }
body.present .chart .note { font-size: 15px; }
@media (max-width: 900px) { .lead-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .slide.lead .slide-head h2 { font-size: 25px; } .slide-head h2 { font-size: 20px; } }
