/* ============================================================
   RefCard — design system
   "The measurement, not the verdict."
   Instrument-grade: precise, quiet, data-forward.
   ============================================================ */

:root {
  /* ===== Redesign palette — "Refined Analytical, Teal" (Direction 3 / Variation A) =====
     CRITICAL COLOR RULE: teal (--accent) is STRUCTURE ONLY (eyebrows, links, active nav,
     brand). Good/bad is ALWAYS green/red. One meaning per color. */
  --paper:        #FFFFFF;   /* clean white page background */
  --surface:      #FFFFFF;
  --panel:        #FAFAFA;   /* subtle tint for grouped panels/tiles */
  --ink:          #1C1C1C;   /* primary text — near-black, high contrast */
  --ink-soft:     #444444;   /* secondary text */
  --ink-faint:    #767676;   /* captions — still readable */
  --line:         #E4E4E4;   /* hairlines */
  --line-strong:  #C8C8C8;   /* neutral divider — kept GREY to protect un-reskinned pages;
                                the 2px black signature rule is --rule (see spec note) */
  --rule:         #1C1C1C;   /* the signature 2px black rule under nav/heroes */

  --accent:       #0E7C73;   /* TEAL — structure only: eyebrows, active-nav underline, brand, links */
  --accent-soft:  #EAF4F3;   /* teal wash for the featured KPI tile */

  --good:         #1A7D5A;   /* GREEN = more accurate (negative grade). Grades/dots only. */
  --good-soft:    #E4F1EB;
  --good-ink:     #0F5A3F;
  --bad:          #C0392B;   /* RED = less accurate (positive grade). Grades/dots only. */
  --neutral-dot:  #C8C8C8;   /* league-average marker */

  /* ---- back-compat aliases: existing component CSS references these names; values are
         remapped to the new palette (NOT renamed) so the un-reskinned pages keep working. ---- */
  --signal:       var(--accent);
  --signal-soft:  var(--accent-soft);
  --signal-deep:  #0A5751;
  --signal-bright:#12A596;
  --poor:         var(--bad);
  --poor-soft:    #F6E7D8;
  --poor-ink:     #8A4517;
  --flag:         #B5701B;   /* amber — outlier / caution flags only */
  --flag-soft:    #F6EAD8;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  --maxw: 1080px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-data: "IBM Plex Mono", "SF Mono", "Roboto Mono", ui-monospace, monospace;
  --font-display: "Inter", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* tabular figures everywhere numbers appear */
.num, td.num, .grade, .stat-val { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

a { color: inherit; text-decoration: none; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- top nav ---------- */
.nav {
  border-bottom: 2px solid var(--rule);   /* the signature analytical black rule */
  background: var(--surface);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 32px;
}
.brand {
  font-family: var(--font-sans);
  font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
  color: var(--ink); display: flex; align-items: center; gap: 9px;
}
.brand .teal { color: var(--accent); }
.brand .mark {
  width: 20px; height: 20px; border-radius: var(--r-sm);
  background: var(--accent); display: inline-block; position: relative; flex: none;
}
.brand .mark::after {
  content: ""; position: absolute; left: 5px; top: 5px; width: 10px; height: 10px;
  border: 2px solid #fff; border-radius: 2px;
}
.nav-links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav-links a {
  font-family: var(--font-sans);
  font-size: 13px; color: var(--ink-soft); font-weight: 600;
  padding: 4px 0; border-bottom: 3px solid transparent; transition: color .15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; }
.eyebrow {
  font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.02em;
  max-width: 16ch; margin-bottom: 22px;
}
.hero h1 em { font-style: normal; color: var(--signal); }
.hero .lede {
  font-size: 18px; color: var(--ink-soft); max-width: 56ch; line-height: 1.6;
}

/* ---------- section frame ---------- */
.section { padding: 40px 0; }
.section-head { margin-bottom: 24px; }
.section-head .kicker {
  font-family: var(--font-data); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px;
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--ink-soft); margin-top: 8px; max-width: 64ch; }

/* ---------- spread strip (signature element) ---------- */
.spread {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 28px 18px;
}
.spread-axis { position: relative; height: 96px; margin: 8px 0 0; }
.spread-track {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: var(--line-strong);
}
.spread-mid {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 1px; height: 56px; background: var(--line-strong);
}
.spread-band {
  position: absolute; top: 50%; transform: translateY(-50%); height: 40px;
  background: var(--signal-soft); border-radius: var(--r-sm); opacity: .5;
}
.tick {
  position: absolute; top: 50%; width: 2px; height: 22px;
  background: var(--good); transform: translate(-50%,-50%);
  border-radius: 1px; cursor: pointer; transition: height .12s, background .12s;
}
.tick:hover { height: 34px; background: var(--good-ink); z-index: 3; }
.tick.poor { background: var(--poor); }
.tick.poor:hover { background: #8a3614; }
.tick.flag-low { opacity: .35; height: 14px; }
.tick-label {
  position: absolute; top: 50%; transform: translate(-50%, 14px);
  font-family: var(--font-data); font-size: 11px; color: var(--ink-soft);
  white-space: nowrap; pointer-events: none;
}
.tick-label.below { transform: translate(-50%, -26px); }
.spread-scale {
  display: flex; justify-content: space-between;
  font-family: var(--font-data); font-size: 11px; color: var(--ink-faint);
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line);
}
.spread-scale b { color: var(--ink-soft); font-weight: 500; }

/* ---------- stat row ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { background: var(--surface); padding: 18px 20px; }
.stat-label { font-size: 12px; color: var(--ink-faint); letter-spacing: .02em; margin-bottom: 6px; }
.stat-val { font-size: 26px; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.stat-val small { font-size: 13px; color: var(--ink-faint); font-family: var(--font-sans); }

/* ---------- table ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
table.grades { width: 100%; border-collapse: collapse; }
table.grades th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-faint);
  letter-spacing: .03em; text-transform: uppercase;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--paper);
  cursor: pointer; user-select: none; white-space: nowrap;
}
table.grades th.right, table.grades td.right { text-align: right; }
table.grades th:hover { color: var(--ink); }
table.grades td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
table.grades tr:last-child td { border-bottom: none; }
table.grades tbody tr { transition: background .1s; }
table.grades tbody tr:hover { background: var(--paper); }
.rank-cell { font-family: var(--font-data); color: var(--ink-faint); width: 44px; }
.ref-name { font-weight: 500; }
.ref-name a:hover { color: var(--signal-deep); }
.grade { font-weight: 800; }
.grade.good { color: var(--good); }
.grade.poor { color: var(--poor); }
.bar-cell { width: 300px; }
.bar { position: relative; height: 8px; background: var(--paper); border-radius: 4px; }
.bar-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.bar-fill { position: absolute; top: 0; height: 8px; border-radius: 4px; }
.bar-fill.good { background: var(--signal); }
.bar-fill.poor { background: var(--poor); }
.pill {
  display: inline-block; font-family: var(--font-data); font-size: 11px;
  padding: 2px 7px; border-radius: var(--r-sm); letter-spacing: .02em;
}
.pill.low { background: var(--flag-soft); color: var(--flag); }
.games-cell { font-family: var(--font-data); color: var(--ink-soft); font-size: 14px; }

/* ---------- notes / callouts ---------- */
.note {
  display: flex; gap: 12px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--signal);
  border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 14px; color: var(--ink-soft);
}
.note b { color: var(--ink); font-weight: 500; }
.note-icon { color: var(--signal); flex: none; font-family: var(--font-data); font-weight: 600; }

/* ---------- season tabs ---------- */
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg button {
  font-family: var(--font-data); font-size: 13px; padding: 6px 14px; border: none;
  background: transparent; color: var(--ink-soft); border-radius: var(--r-sm); cursor: pointer;
  transition: all .12s;
}
.seg button.active { background: var(--surface); color: var(--signal-deep); box-shadow: 0 1px 2px rgba(0,0,0,.05); font-weight: 500; }

/* ---------- trajectory sparkline ---------- */
.traj-cell { width: 120px; }
.traj-tag { font-family: var(--font-data); font-size: 11px; color: var(--ink-faint); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 32px 0 48px; color: var(--ink-faint); font-size: 13px; }
.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.foot a { color: var(--ink-soft); }
.foot a:hover { color: var(--ink); }

/* ---------- methodology prose ---------- */
.prose { max-width: 68ch; }
.prose p { margin-bottom: 16px; color: var(--ink-soft); }
.prose h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 28px 0 10px; color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 500; }
.prose .principle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; margin: 16px 0; }
.prose .principle .pt { font-weight: 500; color: var(--ink); margin-bottom: 4px; }

/* ---------- ref detail ---------- */
.ref-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.ref-head h1 { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -0.02em; }
.chart-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }

@media (max-width: 640px) {
  .hero { padding: 48px 0 28px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
  .bar-cell { display: none; }
}

/* spread additions */
.spread-band-label {
  position: absolute; top: 50%; transform: translate(-50%, -36px);
  font-family: var(--font-data); font-size: 10px; letter-spacing: .03em;
  color: var(--signal-deep); white-space: nowrap; opacity: .8;
}
.spread-readout {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-soft); text-align: center;
}
.spread-readout b { color: var(--ink); font-weight: 500; font-family: var(--font-data); }

/* ===== ref detail v2 ===== */
.grade-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 28px; }
.grade-big { font-family: var(--font-data); font-size: 46px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.grade-big.good { color: var(--good); } .grade-big.poor { color: var(--poor); }
.grade-hero .lbl { font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; }
.adj-row { display: flex; gap: 22px; flex-wrap: wrap; }
.adj-item .av { font-family: var(--font-data); font-size: 18px; font-weight: 500; }
.adj-item .al { font-size: 11px; color: var(--ink-faint); }
.adj-arrow { font-family: var(--font-data); color: var(--ink-faint); align-self: center; }
.season-switch { display: inline-flex; gap: 2px; }

.anat { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:720px){ .anat { grid-template-columns: 1fr; } .grade-hero { grid-template-columns: 1fr; gap: 16px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card h4 { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.card .sub { font-size: 12px; color: var(--ink-faint); margin-bottom: 16px; }

.cat-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: none; }
.cat-count { font-family: var(--font-data); font-size: 18px; font-weight: 500; width: 28px; text-align: right; }
.cat-name { flex: 1; font-size: 14px; }
.cat-name .d { font-size: 11px; color: var(--ink-faint); display: block; margin-top: 1px; line-height: 1.4; }
.cat-row.muted { opacity: .68; }
.cat-row.muted .cat-count { color: var(--flag); }
.cat-badge { font-family: var(--font-data); font-size: 10px; padding: 1px 6px; border-radius: var(--r-sm); background: var(--flag-soft); color: var(--flag); white-space: nowrap; }

.rate-compare { display: flex; align-items: flex-end; gap: 18px; margin-top: 6px; }
.rate-pair { flex: 1; }
.rate-bar-track { height: 28px; background: var(--paper); border-radius: var(--r-sm); position: relative; margin-top: 6px; overflow: hidden; }
.rate-bar-fill { height: 100%; border-radius: var(--r-sm); }
.rate-num { font-family: var(--font-data); font-size: 15px; font-weight: 500; }
.rate-cap { font-size: 11px; color: var(--ink-faint); }

.disc-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
.disc-cell { background: var(--surface); padding: 15px 17px; }
.disc-cell .v { font-family: var(--font-data); font-size: 25px; font-weight: 700; color: var(--ink); line-height: 1; }
.disc-cell .l { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-top: 6px; }
.disc-cell .sub { font-size: 10px; color: var(--ink-faint); font-family: var(--font-data); margin-top: 3px; }

.inc-list { display: flex; flex-direction: column; }
.inc-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.inc-row:last-child { border-bottom: none; }
.inc-cat { font-family: var(--font-data); font-size: 10px; letter-spacing: .03em; padding: 3px 8px; border-radius: var(--r-sm); white-space: nowrap; text-transform: uppercase; }
.inc-cat.affects { background: var(--signal-soft); color: var(--signal-deep); }
.inc-cat.noaffect { background: var(--flag-soft); color: var(--flag); }
.inc-fix { font-size: 14px; font-weight: 500; }
.inc-meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.inc-min { font-family: var(--font-data); font-size: 12px; color: var(--ink-faint); }

/* ===== FotMob match log + xG ===== */
.xg-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 26px; margin-top: 14px; }
.xg-big { font-family: var(--font-data); font-size: 38px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; color: var(--ink); }
.xg-hero .lbl { font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; }
.xg-split { display: flex; gap: 22px; flex-wrap: wrap; }
.xg-split .it .v { font-family: var(--font-data); font-size: 18px; font-weight: 500; }
.xg-split .it .v.gift { color: var(--poor); }
.xg-split .it .v.denial { color: var(--signal); }
.xg-split .it .l { font-size: 11px; color: var(--ink-faint); }

.mlog { width: 100%; border-collapse: collapse; font-size: 13px; }
.mlog th { text-align: right; font-size: 11px; font-weight: 500; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .03em; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mlog th.l, .mlog td.l { text-align: left; }
.mlog td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--line); font-family: var(--font-data); white-space: nowrap; }
.mlog tr:last-child td { border-bottom: none; }
.mlog tbody tr.has-err { background: var(--flag-soft); }
.mlog tbody tr.has-err:hover { background: #f3e3cc; }
.mlog tbody tr:hover { background: var(--paper); }
.mlog .fix { font-family: var(--font-sans); font-weight: 500; }
.mlog .dt { color: var(--ink-faint); font-size: 12px; }
.mlog .xg-pos { color: var(--poor); }
.mlog .xg-neg { color: var(--signal); }
.mlog .xg-zero { color: var(--ink-faint); }
.errflag { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.errflag.yes { background: var(--flag); }
.errflag.no { background: var(--line-strong); }
.errflag.unk { background: transparent; border: 1px solid var(--line-strong); }
.err-detail td { background: var(--surface); text-align: left; font-family: var(--font-sans);
  font-size: 12px; color: var(--ink-soft); padding: 6px 12px 12px 28px; border-bottom: 1px solid var(--line); }
.err-detail .ec { font-family: var(--font-data); font-size: 10px; text-transform: uppercase; padding: 1px 6px; border-radius: var(--r-sm); margin-right: 8px; }
.err-detail .ec.affects { background: var(--signal-soft); color: var(--signal-deep); }
.err-detail .ec.noaffect { background: var(--flag-soft); color: var(--flag); }
.mlog-foot { font-family: var(--font-data); font-size: 11px; color: var(--ink-faint); margin-top: 10px; }
.mlog-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 12px; color: var(--ink-soft); }
.mlog-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Game Flow ===== */
.gf-summary { font-family: var(--font-data); font-size: 15px; color: var(--signal-deep); font-weight: 500;
  margin: 0 0 18px; padding: 10px 16px; background: var(--signal-soft); border-radius: var(--r-md); display: inline-block; }
.gf-card { padding: 22px 24px; }
.gf-axis { padding: 16px 0; border-bottom: 1px solid var(--line); }
.gf-axis:last-child { border-bottom: none; }
.gf-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; }
.gf-name { font-size: 15px; font-weight: 500; }
.gf-name .gf-q { font-weight: 400; color: var(--ink-faint); font-size: 12px; margin-left: 8px; }
.gf-val { font-family: var(--font-data); font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.gf-val b { color: var(--ink); font-weight: 600; }
.gf-spectrum { position: relative; height: 34px; }
.gf-track { position: absolute; left: 0; right: 0; top: 14px; height: 4px;
  background: linear-gradient(90deg, var(--line-strong), var(--signal-soft), var(--line-strong)); border-radius: 2px; }
.gf-median { position: absolute; top: 10px; width: 1px; height: 12px; background: var(--line-strong); left: 50%; }
.gf-marker { position: absolute; top: 7px; width: 3px; height: 18px; background: var(--signal); border-radius: 2px; transform: translateX(-50%); }
.gf-marker::after { content: attr(data-pct); position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-data); font-size: 10px; font-weight: 600; color: var(--signal-deep); white-space: nowrap; }
.gf-ends { display: flex; justify-content: space-between; font-family: var(--font-data); font-size: 10px;
  color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

/* Referees table style column */
.style-cell { font-family: var(--font-data); font-size: 11px; }
.style-tag { color: var(--ink-soft); }
.style-tag.muted { color: var(--ink-faint); }

/* Profile All-seasons compact view */
.all-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 24px; }
.all-hero .lbl { font-family: var(--font-data); font-size: 12px; color: var(--ink-faint); letter-spacing: .04em; text-transform: uppercase; }
.all-table { width: 100%; border-collapse: collapse; }
.all-table th { font-family: var(--font-data); font-size: 11px; font-weight: 500; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: right; }
.all-table th.l { text-align: left; }
.all-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-family: var(--font-data); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.all-table td.l, .all-table td.all-season { text-align: left; }
.all-table tr:last-child td { border-bottom: none; }
.all-row { cursor: pointer; transition: background .12s; }
.all-row:hover:not(.disabled) { background: var(--paper); }
.all-row.disabled { cursor: default; }
.all-season { font-family: var(--font-sans); font-weight: 600; }
.all-more { font-family: var(--font-data); font-size: 12px; color: var(--signal-deep); }
.all-table td.grade.good { color: var(--signal); } .all-table td.grade.poor { color: var(--poor); }

/* Match-log game tempo */
.mlog-tempo { font-family: var(--font-data); font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.mlog-tempo.muted { color: var(--ink-faint); }

/* Overview hook stats */
.stat.hook { transition: background .12s; }
.stat-val-sm { font-family: var(--font-sans); font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin-top: 2px; line-height: 1.15; }
.stat-val-sm a { color: var(--ink); border-bottom: 1px solid transparent; transition: border .12s; }
.stat-val-sm a:hover { border-bottom-color: var(--signal); color: var(--signal-deep); }
.stat-foot { font-family: var(--font-data); font-size: 11px; color: var(--ink-faint); margin-top: 6px; }
.stat-foot.good { color: var(--good); } .stat-foot.poor { color: var(--poor); }

/* Grade key explainer */
.grade-key { display: flex; gap: 24px; flex-wrap: wrap; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13px; color: var(--ink-soft); }
.gk-item { display: inline-flex; align-items: center; gap: 8px; }
.gk-item b { color: var(--ink); font-weight: 600; }
.gk-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.gk-dot.good { background: var(--good); } .gk-dot.poor { background: var(--poor); } .gk-dot.zero { background: var(--line-strong); }

/* Nav dropdown */
.nav-drop { position: relative; display: flex; align-items: center; }
.nav-drop > a {
  font-family: var(--font-sans);
  font-size: 13px; color: var(--ink-soft); font-weight: 600;
  padding: 4px 0; border-bottom: 3px solid transparent; transition: color .15s;
  display: flex; align-items: center; gap: 5px; line-height: 1;
}
.nav-drop > a:hover { color: var(--ink); }
.nav-drop > a.active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-caret { font-size: 9px; opacity: .6; }
.nav-drop-menu { position: absolute; top: 100%; left: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(20,32,43,.08); padding: 6px; min-width: 170px;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all .14s; z-index: 50; }
/* interior dropdowns left-align; the last one (Methodology, rightmost) right-aligns to stay on-screen */
.nav-links > .nav-drop:last-child .nav-drop-menu { left: auto; right: 0; }
/* reveal: hover (desktop), focus-within (keyboard a11y), open (tap/touch) */
.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu,
.nav-drop.open .nav-drop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-drop-menu a { display: block; padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-soft); }
.nav-drop-menu a:hover { background: var(--paper); color: var(--ink); }

/* ---- Mobile nav: wrap to fit; dropdowns become tap accordions (no clipping, no h-scroll) ---- */
@media (max-width: 760px){
  .nav-inner { height: auto; min-height: 52px; flex-wrap: wrap; gap: 6px 18px; padding: 9px 20px; }
  .nav-links { width: 100%; margin-left: 0; gap: 10px 18px; flex-wrap: wrap; align-items: flex-start; }
  .nav-drop { flex-wrap: wrap; }
  .nav-drop-menu, .nav-links > .nav-drop:last-child .nav-drop-menu {
    position: static; display: none; width: 100%; min-width: 0; left: auto; right: auto;
    box-shadow: none; border: none; background: transparent; padding: 2px 0 6px 12px;
    opacity: 1; visibility: visible; transform: none; }
  .nav-drop.open .nav-drop-menu, .nav-drop:focus-within .nav-drop-menu { display: block; }
  .nav-drop-menu a { padding: 7px 10px; }
}

/* Game flow as stat-grid (matches disciplinary boxes) */
.gfg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.gfg-cell { background: var(--surface); padding: 18px 16px 14px; }
.gfg-val { font-family: var(--font-data); font-size: 19px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.gfg-label { font-size: 12px; color: var(--ink-soft); margin-top: 7px; font-weight: 500; }
.gfg-pos { font-family: var(--font-data); font-size: 11px; color: var(--signal-deep); margin-top: 3px; }
.gfg-mini { position: relative; height: 4px; margin-top: 12px; }
.gfg-mini-track { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--paper); border-radius: 2px; }
.gfg-mini-mark { position: absolute; top: -2px; width: 3px; height: 8px; background: var(--signal); border-radius: 2px; transform: translateX(-50%); }
@media (max-width: 720px){ .gfg-grid { grid-template-columns: repeat(2,1fr); } }

/* Game flow — clean row layout */
.gfr-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.gfr { display: grid; grid-template-columns: 1fr 220px; gap: 24px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.gfr:last-child { border-bottom: none; }
.gfr-main { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.gfr-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.gfr-q { display: block; font-size: 11px; font-weight: 400; color: var(--ink-faint); margin-top: 2px; }
.gfr-val { font-family: var(--font-data); font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.gfr-pos { display: flex; flex-direction: column; gap: 5px; }
.gfr-bar { position: relative; height: 6px; background: var(--paper); border-radius: 3px; }
.gfr-bar-mid { position: absolute; left: 50%; top: -2px; width: 1px; height: 10px; background: var(--line-strong); }
.gfr-bar-mark { position: absolute; top: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); transform: translateX(-50%); border: 1.5px solid var(--surface); }
.gfr-read { font-family: var(--font-data); font-size: 11px; text-align: right; }
.gfr-read.hi, .gfr-read.lo { color: var(--signal-deep); }
.gfr-read.mid { color: var(--ink-faint); }
@media (max-width: 640px){ .gfr { grid-template-columns: 1fr; gap: 10px; } .gfr-pos { width: 100%; } }

/* Game flow — bolder block treatment */
.gf-block { margin-top: 20px; }
.gf-blockhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.gf-h3 { font-family: var(--font-sans); font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); margin: 0; }
.gfr-val { font-size: 17px !important; }
.gfr-readline { display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; flex-wrap: nowrap; }
.gfr-pct { font-family: var(--font-data); font-size: 10px; color: var(--ink-faint); white-space: nowrap; }
.gfr-read { white-space: nowrap; }

/* Secondary stat row (slightly lighter) */
.stats-sec .stat { background: var(--surface); }
.stats-sec .stat-foot { line-height: 1.4; }

/* Biggest Calls club filter */
.club-filter { padding: 7px 12px; font-family: var(--font-sans); font-size: 13px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); cursor: pointer; }
.club-summary { padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 14px; margin-bottom: 14px; }

/* Compare scope dividers */
.cmp-divider { font-family: var(--font-data); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); padding: 16px 0 8px; margin-top: 8px; }
.cmp-divider:first-child { margin-top: 0; }
.cmp-divider span { font-weight: 400; color: var(--ink-faint); text-transform: none; letter-spacing: 0; }

/* Biggest Calls helped/hurt (when club-filtered) */
.bc-row.helped { border-left: 3px solid var(--signal); padding-left: 13px; }
.bc-row.hurt { border-left: 3px solid var(--poor); padding-left: 13px; }
.bc-role { font-family: var(--font-data); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: var(--r-sm); }
.bc-role.helped { background: var(--signal-soft); color: var(--signal-deep); }
.bc-role.hurt { background: var(--flag-soft, #f6e6d8); color: var(--poor); }
.cs-helped { color: var(--signal-deep); font-weight: 500; }
.cs-hurt { color: var(--poor); font-weight: 500; }

/* Game flow stat-grid (per-season capable) */
.gf-seg .gf-tab { font-family: var(--font-data); font-size: 12px; padding: 5px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: var(--r-sm); cursor: pointer; margin-right: 6px; }
.gf-seg .gf-tab.active { background: var(--signal-soft); color: var(--signal-deep); border-color: var(--signal); }
.gfc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.gfc { background: var(--surface); padding: 18px 16px 16px; }
.gfc-val { font-family: var(--font-data); font-size: 21px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.gfc-val.muted { color: var(--ink-faint); }
.gfc-label { font-size: 12px; color: var(--ink-soft); margin-top: 8px; font-weight: 500; }
.gfc-read { font-family: var(--font-data); font-size: 11px; margin-top: 4px; }
.gfc-read.hi, .gfc-read.lo { color: var(--signal-deep); }
.gfc-read.mid, .gfc-read.muted { color: var(--ink-faint); }
.gfc-bar { position: relative; height: 4px; margin-top: 12px; background: var(--paper); border-radius: 2px; }
.gfc-bar-mid { position: absolute; left: 50%; top: -2px; width: 1px; height: 8px; background: var(--line-strong); }
.gfc-bar-mark { position: absolute; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); transform: translateX(-50%); border: 1.5px solid var(--surface); }
@media (max-width: 720px){ .gfc-grid { grid-template-columns: repeat(2,1fr); } }

/* VAR's role panel */
.var-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.var-cell { background: var(--surface); padding: 18px 18px 16px; }
.var-cell.var-letdown { background: var(--flag-soft, #f9efe4); }
.var-v { font-family: var(--font-data); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1; }
.var-letdown .var-v { color: var(--flag); }
.var-l { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 8px; }
.var-d { font-size: 12px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }
@media (max-width: 700px){ .var-grid { grid-template-columns: 1fr; } }

/* VAR-as-official record */
.varc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.varc-cell { background: var(--surface); padding: 18px 16px 16px; }
.varc-cell.varc-score { background: var(--paper); }
.varc-v { font-family: var(--font-data); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1; }
.varc-v.flag { color: var(--flag); }
.varc-l { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 8px; }
.varc-d { font-size: 11px; color: var(--ink-soft); margin-top: 5px; line-height: 1.45; }
.varc-d.good { color: var(--signal-deep); font-weight: 500; }
.varc-d.poor { color: var(--poor); font-weight: 500; }
@media (max-width: 720px){ .varc-grid { grid-template-columns: repeat(2,1fr); } }

/* Added-time profile section */
.adt-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.adt-cell { background: var(--surface); padding: 18px 18px 16px; }
.adt-cell.adt-headline { background: var(--paper); }
.adt-v { font-family: var(--font-data); font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1; }
.adt-v.small { font-size: 22px; }
.adt-v.flag { color: var(--flag); } .adt-v.good { color: var(--signal); }
.adt-u { font-size: 13px; font-weight: 400; color: var(--ink-faint); margin-left: 4px; }
.adt-l { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 9px; }
.adt-d { font-size: 11px; color: var(--ink-soft); margin-top: 5px; line-height: 1.45; }
.adt-d.poor { color: var(--poor); font-weight: 500; } .adt-d.good { color: var(--signal-deep); font-weight: 500; }
@media (max-width: 720px){ .adt-grid { grid-template-columns: 1fr; } }

/* Style-vocabulary legend (compact, on-page, mobile-friendly) */
.style-legend { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 0 16px; }
.style-legend summary { font-family: var(--font-data); font-size: 12px; color: var(--ink-soft); cursor: pointer; padding: 12px 0; list-style: none; }
.style-legend summary::-webkit-details-marker { display: none; }
.style-legend summary::before { content: "＋ "; color: var(--signal-deep); }
.style-legend[open] summary::before { content: "－ "; }
.style-legend[open] summary { border-bottom: 1px solid var(--line); }
.sl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; padding: 14px 0 4px; }
.sl-item { display: flex; flex-direction: column; gap: 2px; }
.sl-term { font-family: var(--font-data); font-size: 12px; font-weight: 600; color: var(--ink); }
.sl-def { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.sl-foot { font-size: 12px; color: var(--ink-faint); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.sl-foot a { color: var(--signal-deep); border-bottom: 1px solid var(--signal); }
@media (max-width: 640px){ .sl-grid { grid-template-columns: 1fr; } }

/* Unified VAR block — two halves (booth record + how VAR reviews him) */
.var-twohalf { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.varhalf { background: var(--surface); padding: 20px 22px; }
.varhalf-empty { background: var(--paper); }
.varhalf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.varhalf-head h4 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.varhalf-tag { font-family: var(--font-data); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--signal-deep); background: var(--signal-soft); padding: 2px 7px; border-radius: var(--r-sm); }
.varhalf-tag.alt { color: var(--ink-soft); background: var(--paper); }
.varhalf-sub { font-size: 12px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.5; }
.varstat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.varstat { min-width: 56px; }
.varstat-v { font-family: var(--font-data); font-size: 23px; font-weight: 600; color: var(--ink); line-height: 1; }
.varstat-v.flag { color: var(--flag); } .varstat-v.good { color: var(--signal); }
.varstat-l { font-size: 11px; color: var(--ink-soft); margin-top: 5px; }
.varstat-key .varstat-v { color: var(--signal-deep); }
.varhalf-read { font-family: var(--font-data); font-size: 11px; margin: 14px 0 0; line-height: 1.5; }
.varhalf-read.good { color: var(--signal-deep); } .varhalf-read.poor { color: var(--poor); } .varhalf-read.mid { color: var(--ink-faint); }
@media (max-width: 720px){ .var-twohalf { grid-template-columns: 1fr; } }

/* ---- Compact spacing for the per-season body (works with Option A grade panel) ---- */
.card { padding: 16px 18px; }
.card .sub { margin-bottom: 12px; }
#seasonbody .sec-title:first-child { margin-top: 18px; }

/* ============================================================
   REDESIGN SYSTEM COMPONENTS (Direction 3 / Variation A)
   Shared patterns introduced with the reskin. Teal = structure;
   good/bad = green/red, always.
   ============================================================ */

/* ---- 2px black signature rule (hero → content divider) ---- */
.hero-rule { height: 2px; background: var(--rule); margin: 4px 0 0; }

/* ---- KPI tile row (hero key numbers) — stronger, roomier (addendum) ---- */
.kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
/* DATA-FIRST (2026-08): the strip is a strip, not a stage. This deliberately reverses the earlier
   "generous whitespace" addendum for the hero/KPI/chapter scaffold — the reader came for the table,
   so highlight stats are compact and the data starts inside the first screen. Whitespace still
   governs INSIDE panels and between later sections; it no longer governs the top of the page. */
.kpi { background: var(--surface); padding: 12px 16px; display: flex; flex-direction: column;
  justify-content: space-between; min-height: 0; }
.kpi.feat { background: var(--accent-soft); }
/* label is SUPPORT — small, muted, uppercase; number/name is SIGNAL — big + dark */
.kpi-label { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 3px; }
.kpi-num { font-family: var(--font-sans); font-size: 23px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--ink); line-height: 1.05; margin-top: 0; }
.kpi-num.good { color: var(--good); }        /* good value reads GREEN, never teal */
.kpi-name { font-family: var(--font-sans); font-size: 15px; font-weight: 800; letter-spacing: -0.015em;
  color: var(--ink); line-height: 1.15; margin-top: 0; }
.kpi-name a { color: inherit; border-bottom: 1px solid transparent; transition: border-color .12s; }
.kpi-name a:hover { border-bottom-color: var(--accent); }
.kpi-desc { font-size: 10.5px; color: var(--ink-faint); margin-top: 3px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kpi-desc.good { color: var(--good); font-weight: 600; font-family: var(--font-data); }
.kpi-desc.mono { font-family: var(--font-data); }

/* ============================================================
   REDESIGN — shared page scaffold (hero + chapters)
   Promoted from the approved Overview so every top-level page
   shares the same hero pattern, chapter rhythm, table-head
   treatment, and low-sample toggle. One meaning per color;
   teal = structure, good/bad = green/red.
   ============================================================ */

/* Hero — one confident moment: eyebrow → H1 → lede → KPI row → black rule */
.page-hero { padding: 26px 0 20px; }
.page-hero h1 { font-family: var(--font-sans); font-weight: 800; font-size: clamp(23px,2.6vw,30px);
  letter-spacing: -0.025em; line-height: 1.12; max-width: 36ch; margin-bottom: 0; }
.page-hero h1 em { font-style: normal; color: var(--accent); }
.page-hero .lede { font-size: 13px; font-weight: 400; color: var(--ink-faint); line-height: 1.5;
  max-width: 88ch; margin-top: 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.page-hero .lede b { color: var(--ink); font-weight: 700; }
@media (max-width: 640px){ .page-hero { padding: 20px 0 16px; } }

/* Chapters — generous vertical separation between major sections (~60px) */
.chap { padding: 30px 0 0; }
.chap-head { margin-bottom: 14px; max-width: 78ch; }
.chap-head .kicker { font-family: var(--font-sans); font-size: 10px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 5px; }
.chap-head h2 { font-family: var(--font-sans); font-size: 17px; font-weight: 800;
  letter-spacing: -0.015em; line-height: 1.2; }
.chap-head p { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; line-height: 1.5; }
.chap-head p b { color: var(--ink); font-weight: 700; }

/* Table chapter head: title + controls on one line; grade key as a muted caption below */
.tbl-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 16px; margin-bottom: 20px; }
.gradekey-cap { border: none !important; background: transparent !important; padding: 0 !important;
  gap: 18px 26px !important; font-size: 12px !important; color: var(--ink-faint) !important; margin-bottom: 18px; }
.tbl-foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Low-sample toggle — quiet, Inter, teal accent */
.lowtog { font-size: 13px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none; }
.lowtog input { width: 15px; height: 15px; accent-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   TOOLTIP — the shared caveat mechanism (2026-08)
   Caveats belong on the column/label they qualify, not in a paragraph above the data.
   Hover on a fine pointer; tap-to-open sheet on touch. Promoted from index.html so every
   page can use one implementation instead of re-inventing it.
   ============================================================ */
.tip { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.tip-btn { border: 0; background: none; padding: 0 1px; margin: 0; cursor: pointer; color: var(--ink-faint);
  font-size: 12px; line-height: 1; font-family: var(--font-sans); }
.tip-btn:hover, .tip-btn:focus-visible { color: var(--accent); outline: none; }
  /* DEFAULT (touch / narrow): a bottom-centred sheet that can never overflow the viewport */
.tip-pop { position: fixed; left: 50%; bottom: 20px; top: auto; right: auto; transform: translateX(-50%);
  z-index: 30; width: min(340px, 92vw); background: var(--ink); color: #fff; font-family: var(--font-sans);
  font-weight: 400; font-size: 12.5px; line-height: 1.5; letter-spacing: 0; text-transform: none;
  padding: 13px 15px; border-radius: 10px; box-shadow: 0 10px 34px rgba(0,0,0,.28); display: none; white-space: normal; }
.tip.open .tip-pop { display: block; }
  /* DESKTOP (hover + fine pointer): anchor under the button and reveal on hover too */
  @media (hover: hover) and (pointer: fine) {
  .tip-pop { position: absolute; top: calc(100% + 8px); right: 0; left: auto; bottom: auto; transform: none;
    width: min(290px, 84vw); box-shadow: 0 8px 26px rgba(0,0,0,.20); }
  .tip:hover .tip-pop { display: block; }
  }
