/* whiff-term: the look of the redesign (SPEC 14). Every colour and size lives once, on :root; the screens
   name classes and never colours. Nothing here loads from the internet: the fonts are in web/fonts. */

/* Archivo as The Daily Whiff serves it: one variable file (weight 100-900, width 62-125%) for every weight and the
   condensed cut, its Latin Extended part only when a name needs it (copied from thedailywhiff.com, SIL OFL, fonts/OFL.txt). */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("fonts/archivo-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("fonts/archivo-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* ground and surfaces */
  --bg: #181a1e;              /* graphite (owner) */
  --surface-1: #24272d;       /* tier 1 panel: read first */
  --surface-2: #1e2025;       /* tier 2 panel */
  --surface-sunk: #141619;    /* inputs, tracks, heatmap ground */
  --surface-hover: #2a2e35;   /* row and control hover */
  --line-1: #2b2f36;          /* table hairlines */
  --line-2: #383d45;          /* panel borders, header rules */
  --line-3: #4b515a;          /* group rules, key caps */

  /* text, three levels (AA on every surface) */
  --text-1: #f4f2ed;          /* chalk (owner) */
  --text-2: #b3b0a7;
  --text-3: #9a978f;

  /* accent: controls only, never data */
  --accent: #d0612a;          /* leather orange (owner) */
  --accent-text: #e57c47;
  --accent-ink: #15171a;
  --accent-wash: rgba(208, 97, 42, .14);

  /* meaning: text and outlines only, never fills of data */
  --good: #86c98a;
  --bad: #ef7a6e;
  --warn: #e3b04f;
  --good-wash: rgba(134, 201, 138, .12);
  --bad-wash: rgba(239, 122, 110, .12);
  --warn-wash: rgba(227, 176, 79, .13);
  --live: #f0645a;

  /* pitch types: fills (tags, bars, heatmaps) with dark ink on top */
  --p-ff: #ee5a4f; --p-si: #e8aa3e; --p-fc: #d273c6; --p-sl: #5fb5ae; --p-st: #a8dff0;
  --p-cu: #4f8ff7; --p-ch: #86b06f; --p-fs: #f2dc84; --p-kn: #c9b6f5; --p-ot: #8f8a82;
  --p-ink: #15171a;
  --heat-any: #f4f2ed;        /* all types together: a chalk ramp */

  /* type */
  --font-ui: "Archivo", system-ui, sans-serif;
  --font-num: var(--font-ui);  /* figures in Archivo with tabular digits (paper.css), as The Daily Whiff sets them */
  --fs-10: 10px; --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-15: 15px; --fs-22: 22px; --fs-26: 26px; --fs-40: 40px;
  --cond: 75%;

  /* space and density */
  --row: 19px;
  --sp-1: 2px; --sp-2: 4px; --sp-3: 6px; --sp-4: 8px; --sp-5: 12px; --sp-6: 16px; --sp-7: 24px;
  --gutter: 8px;
  --margin: 12px;

  /* lines and radii */
  --bw: 1px;
  --ring: 2px;
  --r-1: 2px;
  --r-2: 4px;
}

/* ---------- base: the page scrolls, the top bar and the status bar stay ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; min-width: 1280px; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text-1); font: 400 var(--fs-13)/1.35 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: var(--ring) solid var(--accent); outline-offset: 1px; }
button { font: inherit; color: inherit; }
.num, .n { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.c1 { color: var(--text-1); } .c2 { color: var(--text-2); } .c3, .dim { color: var(--text-3); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.caps, .kl {
  font-size: var(--fs-11); font-weight: 700; font-stretch: var(--cond); letter-spacing: .08em; text-transform: uppercase;
}
.kbd, kbd {
  display: inline-flex; align-items: center; height: 16px; padding: 0 4px; font: 400 10px/1 var(--font-num);
  color: var(--text-2); background: var(--surface-2); border: var(--bw) solid var(--line-3); border-radius: var(--r-1);
  white-space: nowrap; vertical-align: 1px;
}
a.go, a.lnk { color: inherit; text-decoration: none; }
a.go:hover, a.lnk:hover { color: var(--accent-text); }
a.go:focus-visible { outline: var(--ring) solid var(--accent); outline-offset: 1px; border-radius: var(--r-1); }
.note { margin: 6px 0; font-size: var(--fs-12); color: var(--text-2); }
.note b { color: var(--text-1); font-weight: 600; }
.foot, .pn-foot { padding: 6px 12px 8px; font-size: var(--fs-11); color: var(--text-3); border-top: var(--bw) solid var(--line-1); }
.pn-foot b { color: var(--text-2); font-weight: 600; }

/* ---------- top bar ---------- */
.wt-top {
  position: sticky; top: 0; z-index: 10; flex: 0 0 auto; display: flex; align-items: center; gap: 16px;
  height: 40px; padding: 0 var(--margin); background: var(--bg); border-bottom: var(--bw) solid var(--line-1);
}
.wt-brand { font-size: 13px; font-weight: 700; font-stretch: var(--cond); letter-spacing: .1em; white-space: nowrap; }
.wt-brand span { color: var(--accent-text); }
.wt-cmd {
  position: relative; flex: 1 1 420px; max-width: 560px; display: flex; align-items: center; gap: 8px; height: 28px;
  padding: 0 6px 0 10px; background: var(--surface-sunk); border: var(--bw) solid var(--line-2); border-radius: var(--r-2);
}
.wt-cmd label { font: 12px var(--font-num); color: var(--accent-text); }
.wt-cmd input {
  flex: 1; min-width: 0; height: 100%; border: 0; padding: 0; background: transparent; outline: none;
  font: 12px var(--font-num); color: var(--text-1);
}
.wt-cmd input::placeholder { color: var(--text-3); }
.wt-cmd:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wt-cmd .k-act { display: none; gap: 4px; }
.wt-cmd:focus-within .k-act { display: inline-flex; }
.wt-cmd:focus-within .k-idle { display: none; }
.wt-cmd.is-error, .wt-cmd.is-error:focus-within { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.wt-cmd-err {
  position: absolute; left: -1px; top: calc(100% + 4px); z-index: 12; padding: 3px 10px; white-space: nowrap;
  font-size: var(--fs-11); color: var(--bad); background: var(--surface-sunk); border: var(--bw) solid var(--line-2); border-radius: var(--r-2);
}
.wt-nav { display: flex; gap: 2px; margin-left: auto; }
.wt-nav a {
  display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border-radius: var(--r-2);
  color: var(--text-2); text-decoration: none; font-size: 12px; font-weight: 700; font-stretch: var(--cond); letter-spacing: .07em;
}
.wt-nav a i { font: normal 400 10px var(--font-num); letter-spacing: 0; color: var(--text-3); }
.wt-nav a:hover { background: var(--surface-hover); color: var(--text-1); }
.wt-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.wt-nav a[aria-current="page"] i { color: var(--accent-ink); }
.wt-clock { font: 12px var(--font-num); color: var(--text-2); }

/* ---------- status bar ---------- */
.wt-status {
  position: sticky; bottom: 0; z-index: 10; flex: 0 0 auto; display: flex; align-items: center; gap: 18px;
  height: 24px; padding: 0 var(--margin); background: var(--bg); border-top: var(--bw) solid var(--line-1);
  font: var(--fs-11) var(--font-num); color: var(--text-3); white-space: nowrap;
}
.wt-status b { font-weight: 500; color: var(--text-2); }
.wt-status b.warn { color: var(--warn); }
.wt-status .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--good); }
.wt-status .dot.warn { background: var(--warn); }
.wt-status .end { margin-left: auto; }
.wt-status .note-below { font-family: var(--font-ui); }
#help-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 2px 0 6px; cursor: pointer;
  background: none; border: 0; border-radius: var(--r-1); font: var(--fs-11) var(--font-num); color: var(--text-3);
}
#help-toggle:hover { color: var(--text-1); }
#help-toggle[aria-pressed="true"] .kbd { color: var(--accent-text); border-color: var(--accent); }

/* ---------- the screen: a 12-column grid ---------- */
main { flex: 1 0 auto; padding: var(--gutter) var(--margin) 16px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); align-content: start; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s9 { grid-column: span 9; } .s12 { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: var(--gutter); min-width: 0; }

/* context header: the player or the game */
.wt-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; min-height: 40px; }
.wt-name { font-size: var(--fs-22); font-weight: 700; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.wt-name .vs { color: var(--text-3); font-weight: 400; margin: 0 6px; }
.wt-meta { font-size: var(--fs-13); color: var(--text-2); white-space: nowrap; }
.wt-meta b { color: var(--text-1); font-weight: 600; }
.wt-head .sn { margin-left: auto; }

/* ---------- panels: three tiers ---------- */
.pn {
  --pn-bg: var(--surface-2);
  position: relative; min-width: 0; display: flex; flex-direction: column;
  background: var(--pn-bg); border: var(--bw) solid var(--line-1); border-radius: var(--r-2);
}
.pn-h { display: flex; align-items: baseline; gap: 10px; min-height: 30px; padding: 8px 12px 6px; border-bottom: var(--bw) solid var(--line-1); }
.pn-t {
  font-size: var(--fs-11); font-weight: 700; font-stretch: var(--cond); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2); white-space: nowrap;
}
.pn-n { margin-left: auto; font-size: var(--fs-11); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pn-b { padding: 8px 12px 10px; min-width: 0; }
.pn-b.flush { padding: 0 6px 4px; }
.pn.t1 { --pn-bg: var(--surface-1); border-color: var(--line-2); }
.pn.t1 .pn-t { color: var(--text-1); font-size: 12px; }
.pn.t3 { --pn-bg: var(--bg); background: transparent; border: 0; border-top: var(--bw) solid var(--line-2); border-radius: 0; }
.pn.t3 .pn-h { padding-left: 0; padding-right: 0; border-bottom-color: transparent; }
.pn.t3 .pn-b, .pn.t3 .pn-foot { padding-left: 0; padding-right: 0; }
.pn.t3 .pn-b.flush { padding: 0 0 4px; }
.pn.t3 .pn-t { color: var(--text-3); }
.pn.is-error { border-color: var(--bad); }
.pn-n.bad { color: var(--bad); }
.empty { display: flex; align-items: center; gap: 8px; padding: 14px 12px; font-size: var(--fs-12); color: var(--text-3); }
.empty b { color: var(--text-2); font-weight: 600; }
.empty.screen { justify-content: center; padding: 48px 12px; font-size: var(--fs-13); }
.pn.t3 .empty { padding-left: 0; }
.sub { display: block; margin-top: 2px; font-size: var(--fs-11); color: var(--text-3); }

/* ---------- tables: <table>, sticky head, hover, a focused row, column groups ---------- */
.tw { min-width: 0; overflow-x: auto; }
.tw.list { max-height: calc(var(--row) * 14 + 32px); overflow-y: auto; }
.tw.list.grouped { max-height: calc(var(--row) * 14 + 54px); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-12); }
th {
  position: sticky; top: 0; z-index: 1; padding: 6px 6px 4px; background: var(--pn-bg, var(--bg));
  font: 600 var(--fs-10)/1.15 var(--font-ui); font-stretch: var(--cond); letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); text-align: right; vertical-align: bottom; border-bottom: var(--bw) solid var(--line-2);
}
th .term { letter-spacing: inherit; }
thead tr.gh th { position: static; padding: 6px 3px 0; text-align: left; vertical-align: bottom; border-bottom: 0; font-weight: 700; color: var(--text-2); }
thead tr.gh th span.g { display: block; padding: 5px 3px 0; border-top: var(--bw) solid var(--line-3); }
thead tr.gh + tr th { top: 0; }
td {
  height: var(--row); padding: 0 6px; line-height: 18px; text-align: right; white-space: nowrap;
  font-family: var(--font-num); border-bottom: var(--bw) solid var(--line-1);
}
tbody tr:last-child td { border-bottom: 0; }
th.l, td.l, th:first-child, td:first-child, td.text { text-align: left; }
td.l, td.text { font-family: var(--font-ui); }
td.num { font-family: var(--font-num); }
td.pl, td.pl a { color: var(--text-1); font-family: var(--font-ui); font-weight: 600; text-align: left; }
td.wrap { white-space: normal; line-height: 1.35; padding-top: 2px; padding-bottom: 2px; min-width: 260px; }
td.c { text-align: center; } th.c { text-align: center; }
.gs { box-shadow: inset 1px 0 0 var(--line-2); }
td.hi { color: var(--text-1); font-weight: 700; }
td.big { font-size: var(--fs-13); }
tbody tr:hover td { background: var(--surface-hover); }
tbody tr:focus-within td { background: var(--accent-wash); }
tbody tr.is-new td { background: rgba(244, 242, 237, .06); }
tbody tr.grp td {
  height: 22px; line-height: 24px; text-align: left; font: 700 var(--fs-11)/24px var(--font-ui); font-stretch: var(--cond);
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); border-bottom-color: var(--line-2); background: none;
}
tbody tr.grp.prose td {
  height: auto; padding-top: 8px; padding-bottom: 5px; line-height: 1.45; white-space: normal;
  font: 400 var(--fs-12)/1.45 var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--text-2);
}
tbody tr.grp.prose td b { color: var(--text-1); }
tbody tr.rule td { box-shadow: inset 0 1px 0 var(--line-3); }
tbody tr.thin td { opacity: .55; }
tbody tr.soft td { opacity: .7; }
td.hc { position: relative; }
td.hc > i { position: absolute; inset: 2px 3px; background: var(--heat-any); }
td.hc > span { position: relative; }
td.hc.same::after { content: ""; position: absolute; inset: 2px 3px; box-shadow: inset 0 0 0 1px #6b717b; }
.seq td { height: 27px; }

/* ---------- pitch types: the class names the colour ---------- */
.ff { --pc: var(--p-ff); } .si { --pc: var(--p-si); } .fc { --pc: var(--p-fc); } .sl { --pc: var(--p-sl); } .st { --pc: var(--p-st); }
.cu { --pc: var(--p-cu); } .ch { --pc: var(--p-ch); } .fs { --pc: var(--p-fs); } .kn { --pc: var(--p-kn); } .ot { --pc: var(--p-ot); }
.any { --pc: var(--heat-any); }
.pt {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 15px; border-radius: var(--r-1);
  background: var(--pc, var(--p-ot)); color: var(--p-ink); font: 700 10px/1 var(--font-num); vertical-align: middle; flex: 0 0 auto;
}
.pt.lg { width: 30px; height: 20px; font-size: 12px; }
.pt.xl { width: 46px; height: 32px; font-size: 18px; }
.ptn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ptn + .ptn { margin-left: 8px; }

/* ---------- probability bar: the model's share, a tick at his plain mix ---------- */
.pbs { display: flex; flex-direction: column; gap: 2px; }
.pb { display: grid; grid-template-columns: 30px minmax(0, 1fr) 62px 44px; align-items: center; column-gap: 10px; height: 26px; }
.pb-tr { position: relative; height: 14px; background: var(--surface-sunk); }
.pb-f { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pc); }
.pb-m { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text-1); box-shadow: 0 0 0 1px var(--bg); }
.pb-v { font: var(--fs-15) var(--font-num); text-align: right; }
.pb-u { font: var(--fs-11) var(--font-num); color: var(--text-3); text-align: right; }
.pb.top .pb-tr { height: 20px; }
.pb.top .pb-v { font-size: 18px; font-weight: 700; }
.pb.sm { height: 20px; grid-template-columns: 26px minmax(0, 1fr) 48px 36px; }
.pb.sm .pb-tr { height: 8px; }
.pb.sm .pb-m { top: -3px; bottom: -3px; }
.pb.sm .pb-v { font-size: var(--fs-12); }
.pb-key { display: flex; gap: 16px; margin-top: 4px; padding-left: 40px; font-size: var(--fs-11); color: var(--text-3); }
.pb-key i { display: inline-block; width: 2px; height: 10px; margin-right: 5px; background: var(--text-1); vertical-align: -1px; }

/* ---------- mix bar: shares side by side, the code inside when it fits ---------- */
.mx { display: flex; gap: 1px; height: 16px; min-width: 0; }
.mx > i {
  display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; white-space: nowrap;
  background: var(--pc); color: var(--p-ink); font: normal 700 10px var(--font-num);
}
.mx.ref { height: 6px; opacity: .55; }
.mx.lg { height: 22px; }
.mx.lg > i { font-size: 11px; }
.mx.md { height: 10px; opacity: .7; }
.mixes { display: grid; grid-template-columns: 88px 22px minmax(0, 1fr); row-gap: 3px; column-gap: 8px; align-items: center; font-size: var(--fs-12); }

/* ---------- zone heatmap: 20 x 20 cells of 0.2 ft, catcher's view ---------- */
.heats { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.hm-w { display: inline-flex; flex-direction: column; gap: 4px; margin: 0; }
.hm { display: block; color: var(--pc); background: var(--surface-sunk); }
.hm .sz { fill: none; stroke: rgba(244, 242, 237, .9); stroke-width: 1; }
.hm .sz-shadow { fill: none; stroke: rgba(20, 22, 25, .6); stroke-width: 3; }
.hm-ax { display: flex; justify-content: space-between; font: var(--fs-10) var(--font-num); color: var(--text-3); }
.hm-cap { display: flex; align-items: center; gap: 6px; font-size: var(--fs-11); white-space: nowrap; }
.hm-cap b { font: 700 var(--fs-11) var(--font-num); color: var(--text-1); }
.hm-cap .n { font-family: var(--font-num); color: var(--text-3); }
.hm-empty { display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; font-size: var(--fs-11); color: var(--text-3); background: var(--surface-sunk); }

/* ---------- KPI row: 2 to 5 values ---------- */
.kp { display: flex; }
.kp > div { flex: 1 1 0; min-width: 0; padding-right: 16px; }
.kp > div + div { padding-left: 16px; border-left: var(--bw) solid var(--line-1); }
.kl { color: var(--text-3); white-space: nowrap; }
.kv { font: 500 var(--fs-26)/1.15 var(--font-num); color: var(--text-1); white-space: nowrap; }
.kv small { margin-left: 4px; font-size: var(--fs-13); font-weight: 400; color: var(--text-2); }
.kv.md { font-size: var(--fs-22); }
.kv.sm { font-size: 20px; }
.ks { font-size: var(--fs-11); color: var(--text-3); white-space: nowrap; }
.ks b { font: 500 var(--fs-11) var(--font-num); color: var(--text-2); }
.ks b.good { color: var(--good); } .ks b.bad { color: var(--bad); } .ks b.warn { color: var(--warn); }
.kps { display: flex; flex-direction: column; gap: 16px; }

/* ---------- surprise gauge: bits 0-6+, bands at 1 and 3, a tick at the league ---------- */
.sg { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sg-tr { position: relative; display: grid; grid-template-columns: 1fr 2fr 3fr; gap: 1px; height: 8px; }
.sg-tr > i { background: #2c3037; }
.sg-tr > i:nth-child(2) { background: #343841; }
.sg-tr > i:nth-child(3) { background: #3d3530; }
.sg-v { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: var(--text-1); box-shadow: 0 0 0 1px var(--bg); }
.sg-v.warn { background: var(--warn); }
.sg-lg {
  position: absolute; top: 10px; width: 0; height: 0; margin-left: -4px;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 5px solid var(--text-3);
}
.sg-lb { display: grid; grid-template-columns: 1fr 2fr 3fr; gap: 1px; margin-top: 6px; font-size: var(--fs-10); color: var(--text-3); white-space: nowrap; }
.sg.inline { flex-direction: row; align-items: center; gap: 8px; height: 18px; }
.sg.inline .sg-tr { width: 90px; height: 6px; flex: 0 0 auto; }

/* ---------- runner diamond ---------- */
.dm { display: inline-block; vertical-align: middle; }
.dm rect { fill: transparent; stroke: var(--text-3); stroke-width: 1.2; }
.dm rect.on { fill: var(--text-1); stroke: var(--text-1); }

/* ---------- sparkline: min and max at the end, no axes ---------- */
.sps { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.sp-w { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.sp { display: flex; align-items: center; gap: 6px; }
.sp svg { display: block; overflow: visible; }
.sp path { fill: none; stroke: var(--pc, var(--text-2)); stroke-width: 1.5; }
.sp circle { fill: var(--pc, var(--text-2)); }
.sp .mm { display: flex; flex-direction: column; font: var(--fs-10)/1.15 var(--font-num); color: var(--text-3); }
.sp-w figcaption { font-size: var(--fs-11); color: var(--text-2); }

/* ---------- verdict tag: a word in its meaning colour ---------- */
.vd, .tag {
  display: inline-flex; align-items: center; height: 16px; padding: 0 6px; border: var(--bw) solid currentColor; border-radius: var(--r-1);
  font: 700 var(--fs-10)/1 var(--font-ui); font-stretch: var(--cond); letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; vertical-align: middle; color: var(--text-2);
}
.vd.good, .tag.good { color: var(--good); background: var(--good-wash); }
.vd.bad, .tag.bad { color: var(--bad); background: var(--bad-wash); }
.vd.warn, .tag.warn { color: var(--warn); background: var(--warn-wash); }
.vd.mute, .tag.dim { color: var(--text-2); background: none; }
.banner { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: var(--bw) solid; border-radius: var(--r-2); font-size: var(--fs-13); }
.banner.good { background: rgba(134, 201, 138, .08); border-color: rgba(134, 201, 138, .35); color: var(--text-1); }
.banner.bad { background: rgba(239, 122, 110, .08); border-color: rgba(239, 122, 110, .4); color: var(--text-1); }
.banner.warn { background: rgba(227, 176, 79, .08); border-color: rgba(227, 176, 79, .4); color: var(--text-1); }

/* ---------- interval row: the estimate, its 95% interval and zero on one scale ---------- */
.ci { position: relative; display: block; height: var(--row); }
.ci .z { position: absolute; top: 2px; bottom: 2px; width: 1px; background: var(--text-3); }
.ci .w { position: absolute; top: 9px; height: 2px; min-width: 2px; background: var(--text-2); }
.ci .p { position: absolute; top: 6px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--text-1); }
.ci .p.good { background: var(--good); } .ci .p.bad { background: var(--bad); }
td.cic { padding: 0 10px; min-width: 120px; }
th.cic { padding-left: 10px; padding-right: 10px; }
th.cic .scale { position: relative; display: block; height: 12px; font-family: var(--font-num); letter-spacing: 0; text-transform: none; }
th.cic .scale span { position: absolute; bottom: 0; }

/* small bar inside a table cell (a share, an index) */
.cb { display: inline-flex; align-items: center; gap: 8px; }
.cb > span:first-child { position: relative; flex: 0 0 auto; width: 64px; height: 6px; background: var(--surface-sunk); }
.cb > span:first-child i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text-2); }

/* ---------- buttons and the replay transport ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 26px; min-width: 30px; padding: 0 8px;
  background: var(--surface-2); border: var(--bw) solid var(--line-2); border-radius: var(--r-2); color: var(--text-1);
  font: 600 var(--fs-12) var(--font-ui); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--line-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary .kbd { background: transparent; border-color: rgba(21, 23, 26, .45); color: var(--accent-ink); }
.btn.on { border-color: var(--accent); background: var(--accent-wash); }
.btn:disabled { color: var(--text-3); background: transparent; cursor: default; }
.btn svg { width: 12px; height: 12px; fill: currentColor; }
.rp { display: flex; align-items: center; gap: 6px; padding-left: 2px; }
.rp-pos { margin: 0 6px; font: var(--fs-12) var(--font-num); color: var(--text-2); white-space: nowrap; }
.rp-pos b { color: var(--text-1); font-weight: 700; }
.rp-keys { margin-left: 8px; font-size: var(--fs-11); color: var(--text-3); white-space: nowrap; }
.rp-speed { display: flex; align-items: center; gap: 4px; margin-left: 8px; font-size: var(--fs-11); color: var(--text-3); }
.rp-speed .btn { height: 22px; min-width: 0; padding: 0 6px; font: 500 var(--fs-11) var(--font-num); }
.rng { position: relative; flex: 1 1 auto; max-width: 760px; height: 26px; display: flex; align-items: center; min-width: 120px; cursor: pointer; touch-action: none; }
.rng-tr { position: relative; width: 100%; height: 4px; background: var(--line-2); border-radius: 2px; }
.rng-f { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.rng-th { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.rng-tick { position: absolute; top: -3px; width: 1px; height: 10px; background: var(--line-3); }

/* ---------- LIVE or REPLAY ---------- */
.mode {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-1);
  font-size: var(--fs-11); font-weight: 700; font-stretch: var(--cond); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.mode.live { background: var(--text-1); color: var(--p-ink); }
.mode.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2px rgba(240, 100, 90, .25); }
.mode.replay { border: var(--bw) dashed var(--text-3); color: var(--text-2); }
.mode.final { border: var(--bw) solid var(--line-3); color: var(--text-2); }

/* ---------- season tabs ---------- */
.sn { display: flex; gap: 4px; align-items: center; }
.sn a {
  display: flex; align-items: baseline; gap: 6px; height: 24px; padding: 3px 8px 0; border: var(--bw) solid var(--line-2);
  border-radius: var(--r-2); text-decoration: none; color: var(--text-2); font: var(--fs-12) var(--font-num); white-space: nowrap;
}
.sn a b { font: 700 var(--fs-10) var(--font-ui); font-stretch: var(--cond); letter-spacing: .08em; color: var(--text-3); }
.sn a .c { color: var(--text-3); }
.sn a:hover { border-color: var(--line-3); color: var(--text-1); }
.sn a[aria-current="page"] { border-color: var(--accent); background: var(--accent-wash); color: var(--text-1); }
.sn a[aria-current="page"] b { color: var(--accent-text); }
.sn .keys { display: flex; align-items: center; gap: 3px; margin-left: 4px; }

/* ---------- pick list: a name that fits several players ---------- */
.pk {
  position: absolute; left: -1px; top: calc(100% + 4px); z-index: 12; width: 420px; padding: 4px;
  background: var(--surface-1); border: var(--bw) solid var(--line-3); border-radius: var(--r-2); box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.pk-h { padding: 6px 8px 4px; font-size: var(--fs-11); color: var(--text-3); }
.pk a {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 28px; padding: 0 8px;
  border-radius: var(--r-1); color: var(--text-1); text-decoration: none; font-size: var(--fs-13); cursor: pointer;
}
.pk a .kbd { justify-content: center; }
.pk a .m { font-size: var(--fs-11); color: var(--text-3); white-space: nowrap; }
.pk a:hover { background: var(--surface-hover); }
.pk a.is-sel { background: var(--accent-wash); box-shadow: inset 2px 0 0 var(--accent); }
.pk-f { display: flex; gap: 12px; margin-top: 4px; padding: 6px 8px 4px; border-top: var(--bw) solid var(--line-1); font-size: var(--fs-11); color: var(--text-3); }

/* ---------- inline help (P8): a dotted underline, the explanation on hover or focus; `?` turns it off ---------- */
.term { text-decoration: underline dotted var(--text-3); text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: help; }
.term:hover, .term:focus { color: var(--text-1); text-decoration-color: var(--accent); outline: none; }
.term:focus-visible { outline: var(--ring) solid var(--accent); outline-offset: 1px; border-radius: var(--r-1); }
.help-off .term { text-decoration: none; cursor: inherit; }
.help-off .term:hover { color: inherit; }
#tip {
  position: fixed; left: 0; top: 0; z-index: 20; width: max-content; max-width: 320px; padding: 8px 10px;
  background: #2f333b; border: var(--bw) solid var(--line-3); border-radius: var(--r-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  font: 400 var(--fs-12)/1.4 var(--font-ui); color: var(--text-1); letter-spacing: normal; text-transform: none; text-align: left;
  white-space: normal; pointer-events: none;
}
#tip b { font-weight: 700; }
#tip .k { display: block; margin-top: 4px; font-size: var(--fs-11); color: var(--text-2); }
#tip[hidden] { display: none; }

/* ---------- screens' own pieces ---------- */
.answer { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.answer .num { font-size: var(--fs-40); font-weight: 700; line-height: 1; }
.zone-grid { position: relative; flex: 0 0 auto; width: 224px; height: 224px; }
.zone-grid .out {
  position: absolute; width: 50%; height: 50%; display: flex; flex-direction: column; padding: 4px 6px;
  border: var(--bw) solid var(--line-1); font-family: var(--font-num); line-height: 1.2;
}
.zone-grid .out span:first-child { font-size: 12px; color: var(--text-1); }
.zone-grid .out span + span { font-size: 10px; color: var(--text-3); }
.zone-grid .in {
  position: absolute; left: 34px; top: 34px; width: 156px; height: 156px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--bg); outline: 1px solid rgba(244, 242, 237, .9);
}
.zone-grid .in > div {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface-2); font-family: var(--font-num); line-height: 1.25;
}
.zone-grid .in > div::before { content: ""; position: absolute; inset: 0; background: var(--heat-any); opacity: var(--o, 0); }
.zone-grid .in span { position: relative; }
.zone-grid .in span:first-child { font-size: 13px; font-weight: 500; color: var(--text-1); }
.zone-grid .in span + span { font-size: 10px; color: var(--text-2); }
.side-note { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-11); line-height: 1.45; color: var(--text-3); }
.bullets { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-11); line-height: 1.45; color: var(--text-3); }
.cal-svg text { font: var(--fs-10) var(--font-num); fill: var(--text-3); }
.cal-svg text.w { font-family: var(--font-ui); }

/* Below 1440 a row of heatmaps steps down to 120 px rather than wrap early (they never go smaller). */
@media (max-width: 1439px) {
  .heats.fit .hm, .heats.fit .hm-empty { width: 120px; height: 120px; }
}
.tx td.hc { padding: 0 4px; }
.tx th, .tight th, .tight td { padding-left: 4px; padding-right: 4px; }
.cut { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.roomy td { height: 26px; }
.roomy.keys td { height: 24px; }
.roomy.keys thead { display: none; }
.cal { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 16px; align-items: start; }
