:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --ink: #16181d;
  --ink-2: #4a505c;
  --muted: #7a808c;
  --line: #e3e6eb;
  --grid: #eceef2;
  --ps: #1f77b4;
  --rd: #ff7f0e;
  --pm: #2ca02c;
  --human: #111111;
  --dim: #c9ccd2;
  --box-stroke: #2b2f36;
  --sel-bg: #eef5fc; --hl-bg: #fff9d6; --hl-ink: #4a3b00;
  --accent: #1f77b4;
  --cite-bg: #eceef1;
  --cite-bg-hover: #dcdfe5;
  --type-sim: #7b4fc0;
  --type-user: #23862b;
  --type-assistant: #0d7f8c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418;
    --surface: #1b1e24;
    --ink: #eceef2;
    --ink-2: #b4b9c3;
    --muted: #8a909c;
    --line: #2c3038;
    --grid: #23272e;
    --ps: #4c9be0;
    --rd: #ff9a3c;
    --pm: #4fc24f;
    --human: #f4f4f4;
    --dim: #474b54;
    --box-stroke: #d5d8de;
    --sel-bg: #1a2633; --hl-bg: #4a3f0f; --hl-ink: #fbe9a6;
    --accent: #6aaee8;
    --cite-bg: #2a2e36;
    --cite-bg-hover: #3a3f49;
    --type-sim: #b99cf0;
    --type-user: #5ccb5c;
    --type-assistant: #4cc4d0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121418; --surface: #1b1e24; --ink: #eceef2; --ink-2: #b4b9c3; --muted: #8a909c;
  --line: #2c3038; --grid: #23272e; --ps: #4c9be0; --rd: #ff9a3c; --pm: #4fc24f; --human: #f4f4f4;
  --dim: #474b54; --box-stroke: #d5d8de; --sel-bg: #1a2633; --hl-bg: #4a3f0f; --hl-ink: #fbe9a6; --accent: #6aaee8; --cite-bg: #2a2e36; --cite-bg-hover: #3a3f49;
  --type-sim: #b99cf0; --type-user: #5ccb5c; --type-assistant: #4cc4d0; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 64px; } /* side room for the floating .secnav */
h1, h2 { line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.note { color: var(--ink-2); margin: 0 0 16px; }
.note b { color: var(--ink); font-weight: 600; }
.note a, .lede a { color: var(--ink); text-decoration: none; background: var(--cite-bg); padding: 0 4px; border-radius: 4px; }
.note a:hover, .lede a:hover { background: var(--cite-bg-hover); }
.lb-cta { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
/* light underline so highlighted text still reads as a link */
.note a, .lede a, .authors a, .foot a, .cat .links-cell a {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: var(--muted);
}
.note a b { color: inherit; }
.note.after { margin: 12px 0 0; font-size: 14px; }
/* a table column name in running text, styled like the leaderboard header */
.col { font-size: .8em; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--ink); }

/* hero */
.hero { position: relative; padding: 40px 0 20px; text-align: center; }
.theme-toggle {
  position: absolute; top: 12px; right: 16px; display: flex; gap: 2px; padding: 2px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.theme-toggle button {
  font: inherit; font-size: 12px; padding: 3px 9px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.theme-toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hero h1 .tl { display: inline-block; }
.hero .subtitle { max-width: 800px; margin-left: auto; margin-right: auto; }
.hero .lede { max-width: 950px; margin-left: auto; margin-right: auto; }
.authors { margin: 14px auto 4px; max-width: 720px; font-size: 1.04rem; line-height: 1.6; color: var(--ink); }
.authors span { white-space: nowrap; margin: 0 7px; }
.authors a { color: inherit; background: var(--cite-bg); padding: 0 4px; border-radius: 4px; }
.authors a:hover { background: var(--cite-bg-hover); }
.authors sup, .affils sup { font-size: .7em; margin-left: 1px; }
.affils { margin: 0 auto 4px; max-width: 820px; font-size: .95rem; line-height: 1.5; color: var(--ink-2); }
.affils span { white-space: nowrap; margin: 0 6px; }
.contact { margin: 0 0 16px; font-size: .9rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hero .links { justify-content: center; }
.award {
  display: inline-block; margin-bottom: 8px; padding: 4px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
}
.award:hover { border-color: var(--ink-2); }
.part-title {
  justify-content: center; text-align: center; text-transform: uppercase;
  font-size: clamp(1.5rem, 3.4vw, 1.9rem); letter-spacing: .06em; margin-bottom: 12px;
}
.part-break { margin-top: 56px; padding-top: 32px; border-top: 2px solid var(--line); scroll-margin-top: 90px; }
.part-break + section.dim { border-top: 0; margin-top: 0; padding-top: 8px; }
.selbar b { color: var(--ink-2); font-weight: 600; }
.sel-hint { font-size: 15px; background: var(--hl-bg); color: var(--hl-ink); padding: 3px 10px; border-radius: 6px; }
.sel-hint b { color: inherit; font-weight: 700; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--muted); font-weight: 600; }
.hero h1 { font-size: clamp(1.75rem, 4.2vw, 2.6rem); margin: 4px 0 6px; }
.subtitle { margin: 0 0 10px; font-size: clamp(1.05rem, 2.2vw, 1.25rem); font-weight: 500; color: var(--ink); line-height: 1.35; }
.subtitle u { text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.lede { color: var(--ink-2); margin: 0 0 14px; font-size: 1.04rem; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a {
  text-decoration: none; color: var(--bg); border: 1px solid var(--ink); border-radius: 8px;
  padding: 5px 14px; font-weight: 600; font-size: 14px; background: var(--ink);
}
.links a:hover { background: var(--ink-2); border-color: var(--ink-2); }

/* sticky legend + selection bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.legend { display: flex; flex-direction: column; gap: 2px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent;
  background: none; color: var(--ink); font: inherit; font-size: 13px; padding: 3px 8px;
  border-radius: 999px; cursor: pointer; line-height: 1.4;
}
.chip:hover { background: var(--surface); }
.chip.on { border-color: var(--ink-2); background: var(--surface); }
.chip.static { cursor: default; }
.chip.static:hover { background: none; }
.chip svg { flex: none; overflow: visible; }
.selbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 28px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.selbar .pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.selbar .pill button, .selbar .clear {
  border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0 4px; line-height: 1;
}
.selbar .pill button { font-size: 16px; }
.selbar .clear { text-decoration: underline; font-size: 13px; }
.selbar .pill button:hover, .selbar .clear:hover { color: var(--ink); }

#view-results section#leaderboard { padding-top: 24px; }
section { padding: 36px 0 8px; scroll-margin-top: 90px; }
section.dim { border-top: 1px solid var(--line); margin-top: 28px; }

/* leaderboard */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.lb { border-collapse: collapse; width: 100%; min-width: 860px; font-variant-numeric: tabular-nums; }
.lb th, .lb td { padding: 8px 10px; text-align: right; white-space: nowrap; }
.lb th:nth-child(2), .lb td:nth-child(2) { text-align: left; }
.lb th:first-child, .lb td:first-child { text-align: center; width: 44px; color: var(--muted); }
.lb thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--surface); }
.lb thead th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.lb thead th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.lb thead th .arr { opacity: 0; font-size: 10px; }
.lb thead th.sorted { color: var(--ink); }
.lb thead th.sorted .arr { opacity: 1; }
.lb tbody tr { border-top: 1px solid var(--grid); cursor: pointer; transition: opacity .15s, background .15s; }
.lb tbody tr:first-child { border-top: 0; }
.lb tbody tr:hover { background: var(--surface); }
.lb tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lb tbody tr.selected { background: var(--sel-bg); box-shadow: inset 3px 0 0 var(--accent); }
.has-active .lb tbody tr:not(.active) { opacity: .42; }
.name { display: inline-flex; align-items: center; gap: 8px; }
.name .model { font-weight: 600; }
.badge { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; font-weight: 600; }
.badge.fw-PS { color: var(--ps); }
.badge.fw-RD { color: var(--rd); }
.badge.fw-Persimmon { color: var(--pm); }
.score { position: relative; display: inline-block; min-width: 64px; padding-bottom: 5px; }
.score .bar-bg { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--grid); }
.score .bar-fg { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--muted); opacity: .55; }
.lb td.overall { font-weight: 700; }
.lb td.overall .bar-fg { background: var(--ink); opacity: .7; }
.best { font-weight: 700; }
.second { text-decoration: underline; text-underline-offset: 3px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 550; font-size: 14.5px;
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

/* catalog */
.cat { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 14px; }
.cat th, .cat td { padding: 10px 12px; text-align: left; vertical-align: top; }
.cat thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.cat tbody tr { border-top: 1px solid var(--grid); }
.cat tbody tr:first-child { border-top: 0; }
.cat td:first-child, .cat td:nth-child(2), .cat td:nth-child(3) { white-space: nowrap; }
.cat .desc { color: var(--ink-2); min-width: 220px; }
.cat td:nth-child(4) { min-width: 120px; }
.cat .links-cell { white-space: nowrap; }
.cat .links-cell a { display: inline-block; margin-right: 10px; font-size: 13.5px; }
.cat .links-cell a:hover { text-decoration-color: currentColor; }
.cat .name svg { margin-top: 1px; }
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.type { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.type-sim { --t: var(--type-sim); }
.type-user { --t: var(--type-user); }
.type-assistant { --t: var(--type-assistant); }
.type[class*="type-"] { color: var(--t); border-color: color-mix(in srgb, var(--t) 45%, transparent); background: color-mix(in srgb, var(--t) 10%, transparent); }
.show { border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.show:hover { border-color: var(--ink-2); background: var(--surface); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.key { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* charts */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
@media (max-width: 860px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
.chart { width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart text { fill: var(--ink-2); font-size: 11.5px; }
.chart .title { fill: var(--ink); font-size: 14px; font-weight: 650; }
.chart .axis-label { fill: var(--muted); font-size: 11.5px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line); stroke-width: 1; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart .ref { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .overlay { fill: transparent; cursor: crosshair; }

.series { transition: opacity .15s; }
.series.fw-PS { color: var(--ps); }
.series.fw-RD { color: var(--rd); }
.series.fw-Persimmon { color: var(--pm); }
.series.human { color: var(--human); }
.series .line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: .75; }
.series.human .line, .series.fw-Persimmon .line { stroke-width: 2.4; opacity: 1; }
.series .mk { fill: currentColor; stroke: var(--bg); stroke-width: .8; }
.series .mk.thin { fill: none; stroke: currentColor; stroke-width: 1.4; }
.series .hit { fill: transparent; stroke: none; cursor: pointer; }
.series.model-icon { color: var(--ink-2); }
.has-active .plot .series:not(.active):not(.human) { color: var(--dim); opacity: .45; }
.has-active .series.active .line { stroke-width: 2.6; opacity: 1; }
.series.active .mk:not(.thin) { stroke-width: 1; }

/* box plot */
.box rect.body { fill: currentColor; fill-opacity: .9; stroke: var(--box-stroke); stroke-width: 1; }
.box .whisk { stroke: var(--box-stroke); stroke-width: 1; }
.box .med { stroke: var(--box-stroke); stroke-width: 1.8; }
.box .out { fill: none; stroke: var(--box-stroke); stroke-width: .8; }
.box .row-label, .chart .row-label { fill: var(--ink); font-size: 12.5px; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.has-active .series.box:not(.active):not(.human) .whisk,
.has-active .series.box:not(.active):not(.human) .med,
.has-active .series.box:not(.active):not(.human) .out { stroke: var(--dim); }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; }
#catalog-filter { margin-bottom: 16px; }
.seg button { border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 7px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* tooltip */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.16); padding: 8px 10px; font-size: 12.5px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.tip .t-head { display: flex; align-items: center; gap: 6px; font-weight: 650; margin-bottom: 2px; }
.tip .t-sub { color: var(--muted); font-size: 11.5px; }
.tip .t-row { display: flex; justify-content: space-between; gap: 14px; }
.tip .t-row span:last-child { font-weight: 600; }
.tip .t-hint { color: var(--muted); font-size: 11px; margin-top: 4px; }

.cite { margin-top: 56px; }
.cite-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cite pre { margin: 0; padding: 14px 16px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); }
.copy { font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); cursor: pointer; }
.copy:hover { color: var(--ink); border-color: var(--ink-2); }

.foot {
  color: var(--ink-2); font-size: 14px; margin-top: 40px; padding-top: 28px; padding-bottom: 48px;
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px;
}
.foot p { margin: 0; }
.foot-k { color: var(--muted); font-weight: 600; margin-right: 4px; }

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .hero { padding-top: 28px; }
  .legend-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .legend-row::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}
@media (max-width: 640px) {
  .cat, .cat tbody, .cat tr, .cat td { display: block; min-width: 0 !important; }
  .cat thead { display: none; }
  .cat tbody tr { padding: 12px 14px; }
  .cat td { padding: 2px 0; white-space: normal !important; }
  .cat td:nth-child(2), .cat td:nth-child(3) { display: inline-block; margin: 4px 6px 4px 0; }
  .cat td:nth-child(4) { color: var(--muted); font-size: 13px; }
  .cat td:last-child:not(:empty) { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* floating section navigation (bottom right) */
.secnav {
  position: fixed; right: 16px; bottom: 16px; z-index: 20; display: flex; flex-direction: column; gap: 4px;
  padding: 4px; border-radius: 18px;
  background: rgba(128, 132, 140, .35); backdrop-filter: blur(0.2px);
}
.secnav button {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.secnav button:hover:not(:disabled) { background: rgba(128, 132, 140, .25); color: var(--ink); }
.secnav button:disabled { opacity: .3; cursor: default; }
.secnav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) {
  .wrap { padding: 0 48px 0 16px; }
  .secnav { right: 6px; bottom: 10px; padding: 3px; gap: 2px; }
  .secnav button { width: 26px; height: 26px; }
}
@media print { .secnav, .theme-toggle { display: none; } .wrap { padding: 0 16px; } }
