/* PlaylistEval project page.
   Light-only by design: there are intentionally no prefers-color-scheme overrides. */

:root {
  color-scheme: only light;

  /* Surfaces */
  --page: #ffffff;
  --wash: #f2f8ef;
  --surface: #ffffff;

  /* Ink */
  --ink: #0f2417;
  --ink-2: #3a5143;
  --muted: #5b6f62;

  /* Hairlines */
  --line: #dfeadb;
  --line-strong: #c3d9bc;

  /* Green scale */
  --green-50: #f2f8ef;
  --green-100: #e2f2dc;
  --green-200: #c8e6bf;
  --green-300: #a3d49a;
  --green-600: #2f8a4c;
  --green-700: #1d6b3c;
  --green-800: #154f2c;

  /* Chart roles */
  --mark-ret: #1f7a45;
  --mark-uni: #7d8c82;
  --gain-pos: #a3d49a;
  --gain-neg: #e2b4ae;
  --ref-human: #1d6b3c;
  --ref-chance: #8a978e;
  --grid: #e6efe2;
  --neg: #a3342b;

  --radius: 16px;
  --radius-sm: 10px;
  --pill: 999px;
  --max: 1160px;
  --prose: 760px;
  --gutter: 16px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-card: 0 1px 2px rgba(15, 36, 23, 0.04), 0 10px 30px -14px rgba(29, 107, 60, 0.18);
}
@media (min-width: 720px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-800); }
:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--green-200); color: var(--ink); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--green-700); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex-shrink: 0;
  padding: 6px 12px; border-radius: var(--pill);
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.nav a:hover { background: var(--green-50); color: var(--ink); }
.nav a.is-active { background: var(--green-100); color: var(--green-800); }
/* The nav clips its overflow, so draw the focus ring inside the pill. */
.nav a:focus-visible { outline-offset: -2px; }
/* Set by JS only when the links do not fit: fade the right edge to show that the row scrolls. */
.nav.is-overflowing {
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  mask-image: linear-gradient(90deg, #000 85%, transparent);
  padding-right: 18px;
}
/* Scrolled to the end: fade the left edge instead, so the last link is fully visible. */
.nav.is-overflowing.at-end {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px);
  mask-image: linear-gradient(90deg, transparent, #000 18px);
}
@media (max-width: 719px) {
  .brand span { display: none; }
  .nav a { padding: 6px 9px; font-size: 14px; }
  .nav a[href="#overview"] { display: none; }
}

.nowrap { white-space: nowrap; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 56px 0 44px;
  text-align: center;
  background:
    radial-gradient(900px 420px at 50% -80px, var(--green-100) 0%, rgba(226, 242, 220, 0) 72%),
    linear-gradient(180deg, var(--green-50) 0%, rgba(242, 248, 239, 0) 100%);
}
@media (min-width: 1024px) { .hero { padding: 84px 0 60px; } }
.hero-inner { display: flex; flex-direction: column; align-items: center; }

.hero-tag {
  margin: 0 0 22px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px 5px 11px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-800);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--pill);
}
.hero-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green-600); }

.hero-title { margin: 0 0 28px; font-weight: 400; max-width: 980px; }
.hero-name {
  display: block;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.9rem, 8.2vw, 5.4rem); line-height: 1; letter-spacing: -0.03em;
  color: var(--ink);
}
.hero-question {
  display: block; margin-top: 16px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.35rem, 3.1vw, 2.2rem); line-height: 1.22; letter-spacing: -0.012em;
  color: var(--green-800);
  text-wrap: balance;
}

.authors {
  margin: 0 0 4px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px;
  font-size: 17px; font-weight: 500; color: var(--ink);
}
/* The asterisk glyph already sits high, so it needs only a small lift to top out at cap height, as in the paper. */
.author sup, .affil-note sup { font-size: 0.8em; line-height: 0; vertical-align: 0.28em; }
.author sup { color: var(--green-700); font-weight: 600; margin-left: 1px; }
.affil { margin: 0 0 28px; font-size: 15px; color: var(--ink-2); }
.affil-note { display: inline-block; margin-left: 12px; font-size: 13px; color: var(--muted); }
.affil-note sup { margin-right: 2px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none;
  color: #fff; background: var(--green-700); border: 1px solid var(--green-700); border-radius: var(--pill);
  box-shadow: 0 6px 16px -8px rgba(29, 107, 60, 0.55);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { color: #fff; background: var(--green-800); border-color: var(--green-800); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
@media (max-width: 599px) {
  .links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 380px; }
  .btn { justify-content: center; padding: 0 12px; }
}
.btn-quiet { color: var(--green-800); background: var(--surface); border-color: var(--line-strong); box-shadow: none; }
.btn-quiet:hover { color: var(--green-800); background: var(--green-50); border-color: var(--green-300); }

/* Placeholder links (href="#") render as a muted "soon" chip until a real URL is filled in. */
.btn[href="#"] {
  color: var(--muted); background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--line-strong); box-shadow: none; cursor: default;
}
.btn[href="#"]:hover { color: var(--muted); background: rgba(255, 255, 255, 0.7); transform: none; }
.btn[href="#"]::after {
  content: 'soon';
  margin-left: 2px; padding: 3px 7px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--green-800); background: var(--green-100); border-radius: var(--pill);
}

.hero-stats {
  margin: 44px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%; max-width: 780px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.hero-stats > div {
  display: flex; flex-direction: column-reverse; align-items: center; gap: 2px;
  padding: 18px 8px;
}
.hero-stats > div + div { border-left: 1px solid var(--line); }
.hero-stats dd {
  margin: 0;
  font-family: var(--font-sans); font-weight: 600; font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  letter-spacing: -0.02em; line-height: 1.1; color: var(--ink);
}
.hero-stats dt { font-size: 13px; line-height: 1.35; color: var(--muted); }
@media (max-width: 599px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats > div:nth-child(3) { border-left: 0; }
  .hero-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
@media (min-width: 1024px) { .section { padding: 92px 0; } }
.section-tight { padding-top: 12px; }
@media (min-width: 1024px) { .section-tight { padding-top: 20px; } }
.section.washed { background: var(--wash); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-last { border-bottom: 0 !important; }

.section-head { max-width: var(--prose); margin: 0 auto 36px; text-align: center; }
.kicker {
  margin: 0 0 12px;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.kicker span {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 22px; padding: 0 6px;
  color: var(--green-800); background: var(--green-100); border-radius: 6px;
  letter-spacing: 0.04em;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.85rem, 3.6vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.section-lead { margin: 16px auto 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }
@media (max-width: 599px) { .section-lead { text-align: left; } }

.prose { max-width: var(--prose); margin: 0 auto; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.abstract p { font-size: 17.5px; line-height: 1.75; color: var(--ink-2); text-align: left; hyphens: auto; }
.abstract strong { color: var(--ink); font-weight: 600; }

/* ---------- Figures ---------- */
.figure { margin: 0 auto; max-width: 1100px; }
.figure-media {
  position: relative; display: block;
  padding: clamp(8px, 2vw, 22px);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
  text-decoration: none;
}
.figure-media img { width: 100%; height: auto; border-radius: 4px; }
.zoom-hint {
  position: absolute; right: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  font-size: 12.5px; font-weight: 600; color: var(--green-800);
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line-strong); border-radius: var(--pill);
  box-shadow: 0 2px 8px rgba(15, 36, 23, 0.08);
  opacity: 0; transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}
.zoom-hint svg { width: 14px; height: 14px; }
.figure-media:hover .zoom-hint, .figure-media:focus-visible .zoom-hint { opacity: 1; transform: none; }
/* Touch screens have no hover: show the hint below the image instead of over it. */
@media (hover: none) {
  .zoom-hint { position: static; display: flex; width: max-content; margin: 8px 0 0 auto; opacity: 1; transform: none; box-shadow: none; }
}

.figure figcaption {
  max-width: 900px; margin: 18px auto 0; padding: 0;
  font-size: 15px; line-height: 1.65; color: var(--ink-2);
}
.figure figcaption strong { color: var(--ink); font-weight: 600; }
.fig-label {
  display: inline-block; margin-right: 8px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-700);
}
.step {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; margin: 0 2px 0 1px;
  font-size: 11.5px; font-weight: 700; line-height: 1;
  color: #fff; background: var(--ink); border-radius: 50%;
  vertical-align: 1px;
}

/* ---------- Results: controls ---------- */
.controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 0 14px;
}
.seg {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--pill);
}
.seg[hidden] { display: none; }
.seg-label {
  padding: 0 8px 0 10px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.seg button {
  min-height: 34px; padding: 0 13px;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  background: transparent; border: 0; border-radius: var(--pill); cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.seg button:hover { background: var(--green-50); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--green-700); color: #fff; }
.check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none;
}
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--green-700); cursor: pointer; }

/* ---------- Results: panels ---------- */
.panel {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px 18px 10px;
}
.panel[hidden] { display: none; }

.board-legend, .heat-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding: 2px 2px 12px; margin-bottom: 4px;
  font-size: 13px; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.lg { display: inline-flex; align-items: center; gap: 8px; }
.lg-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lg-ret { background: var(--mark-ret); }
.lg-uni { width: 14px; height: 14px; background: #fff; border: 2px solid var(--mark-uni); }
.lg-line { width: 0; height: 16px; display: inline-block; border-left: 2px dashed; }
.lg-human { border-color: var(--ref-human); }
.lg-chance { border-color: var(--ref-chance); }

/* Board grid: name | input | track | ret | uni | gain */
.brow {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) 58px minmax(240px, 2.3fr) 70px 70px 62px;
  align-items: stretch;
  column-gap: 12px;
}
.bc { display: flex; align-items: center; min-width: 0; }
.lbl-short { display: none; }
.bc-num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.brow-head .bc {
  padding: 10px 0 8px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.02em;
}
.brow-head .bc-num.is-sorted { color: var(--green-800); }
/* The arrow is decoration (aria-sort carries the state), so give it empty alt text where supported. */
.brow-head .bc-num.is-sorted::after { content: '\2193'; content: '\2193' / ''; margin-left: 3px; }
.brow-head .bc-track { align-items: flex-end; padding-bottom: 6px; }

.axis { position: relative; width: 100%; height: 30px; }
.axis .tick {
  position: absolute; bottom: 0; transform: translateX(-50%);
  font-size: 11.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums;
}
.axis .ref-label {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: 0.01em;
}
/* The human label ends at its line, and a short dashed stub ties the two together. */
.axis .ref-label.human { color: var(--green-800); transform: translateX(-100%); padding-right: 6px; }
.axis .ref-label.chance { color: var(--muted); }
.axis .ref-stub { position: absolute; top: 0; bottom: -6px; width: 0; border-left: 2px dashed var(--ref-human); opacity: 0.55; }

.group-row {
  text-wrap: balance;
  padding: 16px 0 6px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-800);
  border-bottom: 1px solid var(--line);
}
.board-body .brow { border-bottom: 1px solid var(--line); }
.board-body .brow:last-child { border-bottom: 0; }
.board-body .brow:hover { background: linear-gradient(90deg, var(--green-50), rgba(242, 248, 239, 0.35)); }

.judge { display: flex; align-items: center; gap: 10px; padding: 9px 0; min-width: 0; }
.judge img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.judge-name { font-size: 14.5px; font-weight: 500; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.judge-note { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
/* Separated from the name by a real space (added in JS), so it lines up with the name when it wraps. */
.best-badge {
  display: inline-block; padding: 1px 7px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--green-800); background: var(--green-100); border-radius: var(--pill);
  vertical-align: 1px;
}
.mods { display: inline-flex; gap: 3px; color: var(--ink-2); }
.mods svg { width: 17px; height: 17px; }

.track { position: relative; width: 100%; align-self: stretch; min-height: 40px; }
.track .grid, .track .ref { position: absolute; top: 0; bottom: 0; width: 0; }
.track .grid { border-left: 1px solid var(--grid); }
.track .ref.human { border-left: 2px dashed var(--ref-human); opacity: 0.55; }
.track .ref.chance { border-left: 2px dashed var(--ref-chance); opacity: 0.6; }
.track .bar {
  position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px;
  background: var(--gain-pos);
}
.track .bar.neg { background: var(--gain-neg); }
.track .dot {
  position: absolute; top: 50%;
  border-radius: 50%; box-shadow: 0 0 0 2px #fff;
}
.track .dot.ret { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--mark-ret); z-index: 2; }
/* The uniform ring is a little larger than the retrieved dot, so equal values read as a dot in a halo. */
.track .dot.uni { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: #fff; border: 2px solid var(--mark-uni); z-index: 1; }

.val { font-size: 14.5px; color: var(--ink-2); }
.val.ret { font-weight: 600; color: var(--ink); }
.val.pos { color: var(--green-700); font-weight: 500; }
.val.neg { color: var(--neg); font-weight: 500; }
.val.zero { color: var(--muted); }
.brow.is-sort-uni .val.uni, .brow.is-sort-delta .val.delta { font-weight: 600; }

.noscript { margin: 16px 0 10px; font-size: 14.5px; color: var(--ink-2); }

.tooltip {
  position: absolute; z-index: 20; pointer-events: none;
  min-width: 170px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px -8px rgba(15, 36, 23, 0.25);
  font-size: 13px; color: var(--ink-2);
}
.tooltip[hidden] { display: none; }
.tt-title { margin: 0 0 6px; font-weight: 600; color: var(--ink); }
.tt-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.tt-row b { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 44px; }
.tt-key { width: 14px; height: 0; border-top: 3px solid; border-radius: 2px; }
.tt-key.ret { border-color: var(--mark-ret); }
.tt-key.uni { border-color: var(--mark-uni); }
.tt-key.gain { border-color: var(--gain-pos); }

/* Board below 900px: name + values on one line, dumbbell underneath.
   (The six-column desktop row needs ~760px of panel, which tablets in portrait don't have.) */
@media (max-width: 899px) {
  .panel { padding: 12px 12px 6px; }
  /* Fixed number columns so values line up from row to row. */
  .brow {
    grid-template-columns: minmax(0, 1fr) 42px 38px 44px;
    grid-template-areas: "name ret uni delta" "track track track track";
    column-gap: 8px;
  }
  .bc-name { grid-area: name; }
  .bc-input { display: none; }
  .bc-track { grid-area: track; }
  .bc-num:nth-of-type(4) { grid-area: ret; }
  .bc-num:nth-of-type(5) { grid-area: uni; }
  .bc-num:nth-of-type(6) { grid-area: delta; }
  .brow-head .bc { padding: 8px 0 2px; }
  .brow-head .bc-track { padding: 4px 0 6px; }
  .lbl-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lbl-short { display: inline !important; }
  /* Top-align so values and logo stay on the first line when a name (or the Best badge) wraps. */
  .brow:not(.brow-head) .bc-name, .brow:not(.brow-head) .bc-num { align-items: flex-start; }
  .judge { padding: 10px 0 0; align-items: flex-start; }
  .judge img { margin-top: -2px; }
  .judge-name { font-size: 14px; }
  .val { font-size: 13.5px; line-height: 18.2px; padding-top: 10px; }
  .track { min-height: 30px; }
}

/* ---------- Results: domain heatmap ---------- */
.heat-legend { gap: 8px 16px; }
.heat-legend-title { font-weight: 600; color: var(--ink); }
.heat-scale { display: inline-flex; align-items: center; gap: 2px; }
.heat-scale .sw {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 22px; padding: 0 4px;
  font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums;
  border-radius: 3px;
}
.heat-best { color: var(--muted); }
.heat-best b { color: var(--ink); }

.table-frame { position: relative; }
/* Right-edge fade, shown by JS while more columns are hidden to the right. */
.table-frame::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 8px; width: 36px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface));
  pointer-events: none; opacity: 0; transition: opacity .2s ease;
}
.table-frame.can-scroll::after { opacity: 1; }
/* position: relative makes the scroller the containing block for the visually-hidden labels in cells,
   so they are clipped here instead of widening the page. */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 0 8px; }
.table-scroll:focus-visible { outline-offset: 4px; }
.heat { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 2px; }
.heat th, .heat td { font-size: 13.5px; }
.heat td { font-variant-numeric: tabular-nums; }
.heat thead th {
  padding: 10px 4px 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center;
  white-space: nowrap;
}
.heat thead th.heat-name { text-align: left; padding-left: 0; }
@media (min-width: 1216px) { .heat thead th:not(.heat-name) { width: 88px; } }
.heat th.heat-overall, .heat td.heat-overall-cell { border-left: 6px solid var(--surface); }
/* Pinned name column (header included). The box-shadows cover the 2px spacing gaps on both sides,
   so cells scrolling underneath don't peek through. */
.heat thead th.heat-name, .heat tbody th[scope="row"] {
  position: sticky; left: 0;
  background: var(--surface);
  box-shadow: -2px 0 0 var(--surface), 2px 0 0 var(--surface);
}
.heat thead th.heat-name { z-index: 2; }
.heat tbody th[scope="row"] {
  z-index: 1;
  padding: 6px 12px 6px 0; text-align: left; font-weight: 500; color: var(--ink);
  white-space: nowrap;
}
@media (max-width: 599px) {
  /* Narrow, wrapping names on phones so several data columns stay in view. */
  .heat { min-width: 640px; }
  .heat tbody th[scope="row"] { white-space: normal; width: 124px; min-width: 124px; max-width: 124px; padding-right: 8px; }
  .heat tbody th[scope="row"] .judge { gap: 6px; }
  .heat tbody th[scope="row"] .judge-name { font-size: 12.5px; }
  .heat td { min-width: 50px; }
}
.heat tbody th[scope="row"] .judge { padding: 0; gap: 8px; }
.heat tbody th[scope="row"] img { width: 18px; height: 18px; }
.heat tbody th[scope="row"] .judge-name { font-size: 13.5px; }
.heat td {
  min-width: 56px; height: 34px; padding: 0 6px; text-align: center;
  border-radius: 4px;
}
.heat td.best { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.heat .heat-group th {
  padding: 14px 0 4px; text-align: left;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-800);
  background: var(--surface);
}
/* Group labels stay pinned at the left edge while the table scrolls. */
.heat-group-label { position: sticky; left: 0; display: inline-block; }
/* On phones, keep each label within the visible part of the table (and clear of the right fade). */
@media (max-width: 599px) { .heat-group-label { max-width: calc(100vw - 98px); } }
/* One-hue sequential ramp (validated: monotone lightness, adjacent step >= 0.06). */
.h0 { background: #cff8d3; color: var(--ink); }
.h1 { background: #abe3b2; color: var(--ink); }
.h2 { background: #8ace93; color: var(--ink); }
.h3 { background: #6ab977; color: var(--ink); }
.h4 { background: #4fa25e; color: var(--ink); }
.h5 { background: #2c7c3f; color: #fff; }
.h6 { background: #216a32; color: #fff; }
.h7 { background: #174f24; color: #fff; }

.table-notes {
  margin: 16px 0 0;
  font-size: 13.5px; line-height: 1.7; color: var(--muted);
}
/* Baseline-aligned so the chip labels sit on the sentence's baseline. */
.mod { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; color: var(--ink-2); }
.mod svg { width: 16px; height: 16px; align-self: center; }

/* ---------- Results: takeaways ---------- */
.takeaways {
  margin-top: 40px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
@media (max-width: 759px) { .takeaways { grid-template-columns: 1fr; } }
.takeaway {
  padding: 22px 22px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.takeaway-n {
  margin: 0 0 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; color: var(--green-700);
}
.takeaway h3 {
  margin: 0 0 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--ink);
}
.takeaway p:last-child { margin: 0; font-size: 15px; line-height: 1.65; color: var(--ink-2); }

/* ---------- Citation ---------- */
.bib { position: relative; max-width: 900px; margin: 0 auto; }
.bib pre {
  margin: 0; overflow-x: auto;
  padding: 22px 24px; padding-right: 110px;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; color: var(--ink);
  background: var(--green-50); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
/* <code> would otherwise fall back to the UA monospace font. */
.bib code { font: inherit; }
@media (max-width: 959px) {
  /* Below ~960px the longest field (title) no longer fits, so wrap instead of scrolling sideways,
     with continuation lines hung under the value column ("      title={" is 13 characters).
     Copy reads textContent, so the copied BibTeX keeps its original line breaks. */
  .bib pre {
    white-space: pre-wrap; overflow-wrap: anywhere;
    text-indent: 13ch hanging each-line;
  }
}
@media (max-width: 599px) {
  /* Phones: the Copy button sits above the text instead of beside it. */
  .bib pre { padding: 58px 16px 18px; font-size: 12.5px; }
}
/* Narrow phones: slightly smaller so the url field stays on one line. */
@media (max-width: 399px) { .bib pre { font-size: 11.5px; padding-left: 12px; padding-right: 12px; } }
.bib-copy {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 13px 0 11px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--green-800);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--pill); cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.bib-copy:hover { background: var(--green-100); border-color: var(--green-300); }
.bib-copy svg { width: 16px; height: 16px; }
.bib-copy.is-done { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ---------- Acknowledgements ---------- */
.ack p { font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.ack .ack-meta { font-size: 14.5px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--page); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;
  padding-top: 26px; padding-bottom: 32px;
  font-size: 13.5px; color: var(--muted);
}
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--green-800); }

/* ---------- Lightbox ---------- */
/* The dialog shrinks to the figure, which is fitted inside 96vw x 94vh.
   --ar (width / height) is set by JS so the size is known before the full image loads. */
.lightbox {
  --fig-w: min(calc(96vw - 40px), calc((94vh - 74px) * var(--ar, 1.5)));
  width: calc(var(--fig-w) + 40px); max-width: 96vw; max-height: 94vh; overflow: hidden;
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(15, 36, 23, 0.45);
}
.lightbox::backdrop { background: rgba(15, 36, 23, 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lightbox-bar { display: flex; justify-content: flex-end; padding: 10px 10px 0; margin: 0; }
.lightbox-close {
  width: 40px; height: 40px; display: grid; place-items: center;
  font: inherit; font-size: 26px; line-height: 1; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer;
}
.lightbox-close:hover { background: var(--green-100); }
.lightbox-body { padding: 4px 20px 20px; }
/* aspect-ratio reserves the full box before any image data arrives, so the dialog doesn't jump. */
.lightbox-body img {
  display: block; width: var(--fig-w); height: auto; aspect-ratio: var(--ar, 1.5); margin: 0 auto;
}

/* ---------- Windows High Contrast / forced colors ---------- */
@media (forced-colors: active) {
  .seg button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .track .dot.ret, .lg-ret { forced-color-adjust: none; background: CanvasText; }
  .track .bar { forced-color-adjust: none; background: GrayText; }
  .judge img { forced-color-adjust: none; background: #fff; border-radius: 4px; }
  .nav a.is-active { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
