  :root {
    --paper:      #F1F3F5;
    --surface:    #FFFFFF;
    --surface-2:  #F7F8FA;
    --ink:        #12161C;
    --ink-2:      #3B4552;
    --muted:      #6B7785;
    --rule:       #DCE1E7;
    --rule-soft:  #E9EDF1;

    --model:      #0F7A85;
    --model-soft: #17A2AE;
    --truth:      #C02648;
    --banked:     #333E4B;

    --shadow: 0 1px 2px rgba(18,22,28,.06), 0 8px 24px -12px rgba(18,22,28,.18);

    --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
    --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --step: clamp(.75rem, .68rem + .3vw, .82rem);
    --maxw: 1180px;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --paper:      #0D1116;
      --surface:    #151B21;
      --surface-2:  #1A2129;
      --ink:        #E9EEF3;
      --ink-2:      #BAC5D0;
      --muted:      #8593A1;
      --rule:       #26303A;
      --rule-soft:  #1E262E;

      --model:      #3FC7D4;
      --model-soft: #5FD8E3;
      --truth:      #FF6B85;
      --banked:     #C3CBD4;

      --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
    }
  }
  :root[data-theme="light"] {
    --paper:#F1F3F5; --surface:#FFFFFF; --surface-2:#F7F8FA;
    --ink:#12161C; --ink-2:#3B4552; --muted:#6B7785;
    --rule:#DCE1E7; --rule-soft:#E9EDF1;
    --model:#0F7A85; --model-soft:#17A2AE; --truth:#C02648; --banked:#333E4B;
    --shadow: 0 1px 2px rgba(18,22,28,.06), 0 8px 24px -12px rgba(18,22,28,.18);
  }
  :root[data-theme="dark"] {
    --paper:#0D1116; --surface:#151B21; --surface-2:#1A2129;
    --ink:#E9EEF3; --ink-2:#BAC5D0; --muted:#8593A1;
    --rule:#26303A; --rule-soft:#1E262E;
    --model:#3FC7D4; --model-soft:#5FD8E3; --truth:#FF6B85; --banked:#C3CBD4;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }

  .wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(1.25rem, 1rem + 2vw, 2.75rem) clamp(1rem, .6rem + 1.6vw, 2rem) 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* ---------- header ---------- */
  .masthead { display: flex; flex-direction: column; gap: .6rem; }

  .eyebrow {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
  }

  h1 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(1.7rem, 1.35rem + 1.7vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -.015em;
    margin: 0;
    text-wrap: balance;
  }

  .dek {
    margin: 0;
    max-width: 62ch;
    color: var(--ink-2);
    font-size: .97rem;
  }

  .chiprow { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }

  .chip {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .04em;
    padding: .25rem .55rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    color: var(--muted);
    background: var(--surface);
  }
  .chip.live { color: var(--model); border-color: color-mix(in srgb, var(--model) 45%, transparent); }
  .chip.mock { color: var(--truth); border-color: color-mix(in srgb, var(--truth) 45%, transparent); }

  /* Data-currency stamp. Quiet when current; --truth (the same warning colour the
     page already uses for a claim it does not stand behind) once the live data has
     stopped moving, because a board that silently stalls is the worse failure. */
  .freshness {
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .03em;
    color: var(--muted);
    margin-top: .1rem;
    min-height: 1em;
  }
  .freshness.stale { color: var(--truth); font-weight: 600; }

  /* A failed payload fetch. Loud on purpose: the alternative this replaces was the
     previous hitter's numbers sitting silently under the new name. */
  .who-meta.load-failed { color: var(--truth); font-weight: 600; }

  /* ---------- colophon ---------- */
  .colophon {
    margin-top: 1.4rem;
    padding-top: .9rem;
    border-top: 1px solid var(--rule-soft);
    font-size: .72rem;
    line-height: 1.55;
    color: var(--muted);
  }
  .colophon a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
  .colophon a:hover { color: var(--ink-2); }

  /* ---------- panels ---------- */
  .panel {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 3px;
    box-shadow: var(--shadow);
  }

  .panel-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--rule-soft);
  }

  .panel-title {
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--muted);
  }

  /* ---------- player picker ---------- */
  /* ---- player picker: 2,112 player-seasons, so search rather than tabs ---- */
  /* season selector, above the search box */
  .season-radio {
    display: flex; flex-wrap: wrap; gap: .35rem;
    padding: .85rem 1.1rem .1rem;
  }
  .season-radio button {
    padding: .3rem .6rem;
    background: var(--surface);
    border: 1px solid var(--rule); border-radius: 3px;
    cursor: pointer; color: var(--ink-2);
    font-family: var(--mono); font-size: .7rem; letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
    display: inline-flex; align-items: baseline; gap: .4rem;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
  }
  .season-radio button:hover { background: var(--surface-2); }
  .season-radio button:focus-visible { outline: 2px solid var(--model); outline-offset: 1px; }
  .season-radio button.on {
    background: var(--surface-2);
    border-color: var(--model);
    color: var(--ink);
  }
  .live-dot {
    font-size: .58rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--model);
  }
  .live-dot::before {
    content: "●"; margin-right: .25rem; font-size: .5rem; vertical-align: .08em;
  }

  .picker-bar {
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--rule-soft);
  }
  .picker-input {
    flex: 1 1 18rem; min-width: 0;
    padding: .5rem .7rem;
    background: var(--surface-2);
    border: 1px solid var(--rule);
    border-radius: 5px;
    color: var(--ink);
    font-family: var(--sans); font-size: .9rem;
  }
  .picker-input::placeholder { color: var(--muted); }
  .picker-input:focus-visible { outline: 2px solid var(--model); outline-offset: 1px; }
  .picker-hint {
    font-family: var(--mono); font-size: .63rem; letter-spacing: .05em;
    text-transform: uppercase; color: var(--muted);
  }

  .picker-list {
    list-style: none; margin: 0; padding: 0;
    max-height: 15rem; overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1px;
    background: var(--rule-soft);
  }
  .picker-list button {
    width: 100%; text-align: left;
    padding: .55rem .85rem;
    background: var(--surface);
    border: 0; border-left: 2px solid transparent;
    cursor: pointer; color: var(--ink-2); font-family: inherit;
    display: flex; align-items: baseline; gap: .5rem;
    transition: background .14s ease, color .14s ease;
  }
  .picker-list button:hover { background: var(--surface-2); }
  .picker-list button:focus-visible { outline: 2px solid var(--model); outline-offset: -2px; }
  .picker-list button.on {
    background: var(--surface-2); border-left-color: var(--model); color: var(--ink);
  }
  .picker-list .nm {
    font-family: var(--serif); font-size: .92rem; font-weight: 600;
    letter-spacing: -.005em; flex: 1 1 auto;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .picker-list .yr, .picker-list .pa {
    font-family: var(--mono); font-size: .63rem; letter-spacing: .04em;
    color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto;
  }
  .picker-empty {
    padding: .8rem 1.1rem; background: var(--surface);
    font-size: var(--step); color: var(--muted);
  }

  /* how many player-seasons each milestone rests on */
  .support {
    margin: 0; padding: 0 1.1rem 1rem;
    font-family: var(--mono); font-size: .63rem; letter-spacing: .04em;
    color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.7;
  }
  .support b { color: var(--ink-2); font-weight: 600; }

  /* currently selected hitter, above the slider */
  .who { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
  .who-name {
    font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
    letter-spacing: -.01em; color: var(--ink);
  }
  .who-meta {
    font-family: var(--mono); font-size: .66rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .tab-tag {
    font-family: var(--mono); font-size: .58rem; letter-spacing: .09em;
    text-transform: uppercase; color: var(--muted); margin-top: .12rem;
  }
  .tab-tag.miss { color: var(--truth); }
  .tab-tag.good { color: var(--model); }

  /* ---------- slider ---------- */
  .control { padding: 1.15rem 1.1rem 1.35rem; display: flex; flex-direction: column; gap: .9rem; }

  .control-top {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
  }

  .standpoint { display: flex; align-items: baseline; gap: .5rem; }
  .standpoint .num {
    font-family: var(--mono); font-size: clamp(2rem, 1.5rem + 2vw, 2.9rem);
    font-weight: 600; line-height: 1; color: var(--model);
    font-variant-numeric: tabular-nums;
  }
  .standpoint .unit {
    font-family: var(--mono); font-size: .72rem; letter-spacing: .13em;
    text-transform: uppercase; color: var(--muted);
  }

  input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 26px; background: transparent; cursor: pointer; margin: 0;
  }
  input[type="range"]::-webkit-slider-runnable-track {
    height: 3px; background: var(--rule); border-radius: 2px;
  }
  input[type="range"]::-moz-range-track {
    height: 3px; background: var(--rule); border-radius: 2px;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; margin-top: -7.5px;
    background: var(--model); border: 3px solid var(--surface);
    border-radius: 50%; box-shadow: 0 0 0 1px var(--model);
  }
  input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    background: var(--model); border: 3px solid var(--surface);
    border-radius: 50%; box-shadow: 0 0 0 1px var(--model);
  }
  input[type="range"]:focus-visible { outline: 2px solid var(--model); outline-offset: 4px; }

  .ticks {
    display: flex; justify-content: space-between;
    font-family: var(--mono); font-size: .68rem; color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .ticks span { flex: 1; text-align: center; }
  .ticks span:first-child { text-align: left; }
  .ticks span:last-child { text-align: right; }
  .ticks span.on { color: var(--model); font-weight: 600; }

  .toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--mono); font-size: .7rem; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted);
    cursor: pointer; user-select: none;
    padding: .35rem .6rem; border: 1px solid var(--rule); border-radius: 2px;
    background: var(--surface);
  }
  .toggle:hover { color: var(--ink-2); border-color: var(--muted); }
  .toggle:focus-within { outline: 2px solid var(--model); outline-offset: 2px; }
  .toggle input { accent-color: var(--truth); margin: 0; }

  /* ---------- chart ---------- */
  .chartbox { padding: .6rem .4rem .2rem; }
  svg { display: block; width: 100%; height: auto; }
  .ax-label {
    font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
    text-transform: uppercase; fill: var(--muted);
  }
  .ax-num { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
  .ms-num { font-family: var(--mono); font-size: 10px; fill: var(--muted); letter-spacing: .04em; }
  .anno { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; }

  .legend {
    display: flex; flex-wrap: wrap; gap: 1.1rem;
    padding: .3rem 1.1rem 1rem;
    font-family: var(--mono); font-size: .68rem; color: var(--muted);
    letter-spacing: .04em;
  }
  .legend i { display: inline-block; width: 22px; height: 3px; margin-right: .45rem; vertical-align: middle; border-radius: 2px; }

  /* ---------- readouts ---------- */
  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0;
  }
  .card {
    padding: .95rem 1.1rem;
    border-right: 1px solid var(--rule-soft);
    display: flex; flex-direction: column; gap: .2rem;
  }
  .card:last-child { border-right: 0; }
  .card-label {
    font-family: var(--mono); font-size: .64rem; letter-spacing: .11em;
    text-transform: uppercase; color: var(--muted);
  }
  .card-val {
    font-family: var(--mono); font-size: 1.5rem; font-weight: 600;
    font-variant-numeric: tabular-nums; line-height: 1.15; color: var(--ink);
  }
  .card-val.model { color: var(--model); }
  .card-val.truth { color: var(--truth); }
  .card-sub { font-family: var(--mono); font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }

  /* ---------- table ---------- */
  .tablewrap { overflow-x: auto; }
  table { border-collapse: collapse; width: 100%; min-width: 620px; }
  th, td {
    padding: .55rem .8rem;
    text-align: right;
    font-family: var(--mono); font-size: .8rem;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--rule-soft);
    white-space: nowrap;
  }
  th {
    font-size: .64rem; letter-spacing: .11em; text-transform: uppercase;
    color: var(--muted); font-weight: 500;
    border-bottom: 1px solid var(--rule);
  }
  th:first-child, td:first-child { text-align: left; }
  tbody tr:last-child td { border-bottom: 0; }
  tbody tr.past td { color: var(--muted); }
  td.center { color: var(--model); font-weight: 600; }
  td.act { color: var(--truth); }
  .band { color: var(--ink-2); }
  /* The conditioning event, shown beside the number it conditions. Muted on
     purpose: it qualifies the projection rather than competing with it. */
  td.chance { color: var(--muted); font-variant-numeric: tabular-nums; }
  /* The season-end row answers a DIFFERENT question from the milestone rows above
     it, and the two legitimately disagree (see the "two questions" note). The rule
     marks the boundary so the gap reads as a change of question, not an error. */
  tbody tr.finalrow td { border-top: 1px solid var(--rule); }

  /* ---------- notes ---------- */
  .notes { padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
  .note { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; }
  .note-key {
    font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
    text-transform: uppercase; padding: .2rem .45rem; border-radius: 2px;
    border: 1px solid var(--rule); color: var(--muted); white-space: nowrap;
  }
  .note-key.live { color: var(--model); border-color: color-mix(in srgb, var(--model) 45%, transparent); }
  .note-key.mock { color: var(--truth); border-color: color-mix(in srgb, var(--truth) 45%, transparent); }
  .note p { margin: 0; font-size: .87rem; color: var(--ink-2); }
  .note code {
    font-family: var(--mono); font-size: .82em;
    background: var(--surface-2); padding: .05em .3em; border-radius: 2px;
  }

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

  @media (max-width: 640px) {
    .card { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
    .picker-list { grid-template-columns: 1fr; }
  }

  /* ---------- phone ----------
     The chart is a fixed 900x420 viewBox scaled to the container. MEASURED, not
     estimated: the inset chain from body to <svg> is 53.4 fixed px, so at a 390 px
     viewport the svg is 336.6 px wide and one user unit renders at 0.374 CSS px.
     .ax-num at 10.5 therefore renders at 3.9 CSS px -- unreadable. 11 CSS px needs
     11 / 0.374 = 29.4 user units, so 30. app.js widens the SVG margins under the
     same breakpoint, because 30-unit type does not fit 52 units of left margin. */
  @media (max-width: 720px) {
    .ax-num   { font-size: 30px; }
    .ms-num   { font-size: 30px; }
    .anno     { font-size: 30px; }
    .ax-label { font-size: 28px; }

    /* A thumb-swipe over the list scrolled the list instead of the page.
       min(), not a bare 45vh: MEASURED, 45vh is 340 px on a 844-tall phone against
       the 15rem (240 px) it replaces -- a bare 45vh would make the list 41% TALLER
       and grow the trap it is meant to shrink. min() caps it at today's height in
       portrait and cuts it to 175 px in landscape, where 45vh actually binds.
       `contain` keeps a bottomed-out list from flinging the page underneath it. */
    .picker-list { max-height: min(45vh, 15rem); overscroll-behavior: contain; }

    /* 18 standpoints run together at this width. app.js thins them here only;
       without this rule the class it adds is inert. `visibility`, not `display`,
       so the row keeps its spacing and the remaining labels stay put. */
    .ticks span.hide { visibility: hidden; }
  }

  /* Shown only when the data fetch fails -- overwhelmingly because the page was
     opened over file://, where browsers block fetch outright. */
  .load-error {
    margin: 0; padding: .9rem 1.1rem;
    background: var(--truth); color: #fff;
    font: 500 var(--step)/1.5 var(--sans);
  }
  .load-error code {
    font-family: var(--mono); background: rgba(255,255,255,.18);
    padding: .1em .4em; border-radius: 3px;
  }
