/* TrackingBench's own components on FrontierCS's page structure (frontier.css). Identity colors live in leaderboard-init.js, the chart's chrome in chart.js. */
@font-face { font-family: "Google Sans Code"; src: url("../fonts/google-sans-code/google-sans-code-latin-variable.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Optimistic"; src: url("../fonts/Optimistic-AI-VF.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #1f1f1f;
  --ink-2: #3c4043;
  --ink-3: #5f6368;
  --rule: #dadce0;
  --rule-strong: #80868b;
  --tint: #f1f3f4;
  --faint: #9aa0a6;
  --blue: #0b57d0;
  --selected: #3c4043;
  --on-selected: #ffffff;
  --verified: #137333;
  --community: #5b4bc4;
  --shadow: #20212426;
  --place-1: #0b57d033;
  --place-2: #0b57d01f;
  --place-3: #0b57d00f;
  --font-sans: "Optimistic", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Google Sans Code", ui-monospace, Menlo, monospace;
  --max: 1320px;
  --gutter: clamp(20px, 4.2vw, 60px);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e0c0c;
  --surface: #0e0c0c;
  --ink: #e3e1df;
  --ink-2: #c7c5c3;
  --ink-3: #999795;
  --rule: #2a2828;
  --rule-strong: #6b6967;
  --tint: #1f1d1d;
  --faint: #6b6967;
  --blue: #8ab4f8;
  --selected: #e3e1df;
  --on-selected: #0e0c0c;
  --verified: #81c995;
  --community: #a99ff0;
  --shadow: #00000080;
  --place-1: #8ab4f84d;
  --place-2: #8ab4f82e;
  --place-3: #8ab4f817;
}
* { box-sizing: border-box; }
/* Anchors land clear of the sticky header, whose height is set in frontier.css: 76 px, 60 px at 1000 px, about 87 px at 720 px. */
html { scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink-2); font: 16px/1.5 var(--font-sans); font-variant-numeric: tabular-nums; }
a { color: var(--blue); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

#theme-toggle { width: 36px; height: 36px; align-items: center; justify-content: center; padding: 0; flex: none; border: 0; background: none; }
.theme-icon-sun, [data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
.brand img { display: block; width: auto; height: 22px; }

main { padding-inline: var(--gutter); }
.chart-section, .breakdown { max-width: var(--max); margin-inline: auto; }
/* The chart comes first: a title, the plot, then the controls that change it. */
#leaderboard { padding-top: 44px; }
#leaderboard h1 { margin: 0 0 20px; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: .05em; text-align: center; text-transform: uppercase; }
.pill-toggle-container { order: -1; display: flex; justify-content: center; margin: 0; }
#boards { justify-content: center; }
.pill-toggle { display: inline-flex; gap: 4px; padding: 5px; border: 1px solid var(--rule-strong); border-radius: 100px; }
.pill-toggle button { flex: 1; border: 0; border-radius: 100px; padding: 7px 22px; color: var(--ink-2); background: transparent; font-size: 15px; line-height: 21px; white-space: nowrap; }
.pill-toggle button:hover { background: var(--tint); }
.pill-toggle button[aria-pressed="true"] { color: var(--on-selected); background: var(--selected); }
#x-axis-filter { display: flex; }
#x-axis-filter button { padding: 3px 12px; font-size: 14px; }
#status-filter button { padding: 3px 14px; font-size: 14px; }

/* The plot, then one centered column of controls. */
/* The three protocols, above the chart: a task sentence, then one column per table. */
.protocols { max-width: 1240px; margin: 0 auto 28px; }
.protocols h2 { font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
.protocols .task { margin: 0 0 18px; max-width: 880px; color: var(--ink-2); font-size: 17px; line-height: 1.45; }
.protocols ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; border-top: 1px solid var(--ink-2); }
.protocols li { padding-top: 14px; }
.protocols h3 { font-size: 18px; line-height: 1.3; margin: 0 0 6px; }
.protocols li p { margin: 0 0 6px; color: var(--ink-2); font-size: 16px; line-height: 1.45; }
.protocols li p:last-child { color: var(--ink); margin-bottom: 0; }
@media (max-width: 860px) { .protocols ol { grid-template-columns: 1fr; gap: 0; } .protocols li { padding: 14px 0; border-bottom: 1px solid var(--rule); } }
.workbench { max-width: 1240px; margin-inline: auto; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 24px auto 0; }
.filters { max-width: 1160px; width: 100%; margin-inline: auto; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 28px; }
.filter { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.filter > span { color: var(--ink-2); font: 400 13.5px/1.5 var(--font-mono); }
.multiselect { position: relative; }
.multiselect summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 42px; padding-inline: 12px; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); list-style: none; }
.multiselect summary::-webkit-details-marker { display: none; }
.multiselect summary::after { content: "▾"; color: var(--ink-3); }
.multiselect summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown { position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 20; min-width: 100%; width: 280px; max-width: calc(100vw - 40px); padding: 8px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 2px 6px var(--shadow), 0 8px 24px var(--shadow); }
.options { max-height: 260px; overflow-y: auto; }
.options label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 4px; cursor: pointer; }
.options label:hover { background: var(--tint); }
input[type="checkbox"] { accent-color: var(--blue); }
input[type="search"] { width: 100%; min-width: 0; height: 42px; padding-inline: 12px; margin-bottom: 6px; color: inherit; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); }
.secondary-filters { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 20px; font-size: 14px; }
.secondary-filters label { display: inline-flex; align-items: center; gap: 6px; }
select { padding: 5px 8px; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 4px; color: var(--ink); }
.text-button { padding: 0; border: 0; background: none; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

.legend { order: -2; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13px; white-space: nowrap; }
/* One row only where the longest legend (Table 1's, 1248 px) fits inside the page gutters. */
@media (min-width: 1380px) { .legend { flex-wrap: nowrap; } }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.legend .hollow { background: transparent !important; border: 2px solid; }
#reusable-scatterplot-container { min-height: 360px; }
#reusable-scatterplot-container svg { margin: auto; overflow: visible; }
.axis, .point-label { font-family: var(--font-sans); }
.axis-title { font-family: var(--font-mono); }
.icon-button { display: inline-flex; padding: 6px; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.icon-button:hover { background: var(--tint); color: var(--ink); }
.chart-note { min-height: 20px; font-size: 14px; color: var(--ink-3); margin: 8px 0 0; text-align: center; }
.empty { text-align: center; color: var(--ink-3); padding: 24px; }
.chart-tooltip { position: absolute; left: 0; top: 0; z-index: 20; pointer-events: none; max-width: min(320px, calc(100vw - 16px)); padding: 8px 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 2px 6px var(--shadow), 0 8px 24px var(--shadow); }
.chart-tooltip div:first-child { color: var(--ink); font-weight: 600; margin-bottom: 2px; }

.breakdown { padding-top: 80px; }
.notes-block { margin-top: 64px; }
h3 { font-weight: 600; font-size: 22px; line-height: 1.5; color: var(--ink); margin: 32px 0 10px; }
p { margin: 0 0 14px; }
.breakdown .section-heading { margin-top: 32px; }
.breakdown .section-heading h3 { margin: 0 0 12px; }
.table-key { font-size: 16px; margin: 0; }
.table-key span { padding: 1px 6px; border-radius: 3px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.result-count, .table-description { font-size: 14px; color: var(--ink-3); }
.table-description { margin-right: auto; }
/* Rows after FrontierCS's task list: a name with a line under it, then a sentence with a quieter one. */
.notes { margin: 0; border-top: 1px solid var(--ink-2); }
.note-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.notes dt { color: var(--ink); font-size: 19px; font-weight: 450; line-height: 1.3; }
.notes dt small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 14px; font-weight: 400; line-height: 1.4; }
.notes dd { margin: 0; }
.notes dd p { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.4; }
.notes dd .note-more { margin-top: 4px; color: var(--ink-3); font-size: 14px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { display: block; padding: 12px; }
@media (max-width: 1000px) {
  html { scroll-padding-top: 68px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 16px 20px; }
}
/* The width below which leaderboard-init.js draws the chart 320 px tall. */
@media (max-width: 768px) {
  #reusable-scatterplot-container { min-height: 320px; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: 96px; }
  .note-row { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  /* Touch targets of about 40 px; the rim shrinks so the taller pills do not grow the switch much. */
  .pill-toggle { padding: 1px; }
  .pill-toggle button, #x-axis-filter button, #status-filter button { min-height: 40px; padding: 4px 12px; font-size: 13.5px; white-space: normal; }
  .secondary-filters { gap: 4px 16px; }
  .secondary-filters label, .text-button { min-height: 40px; }
  .text-button { display: inline-flex; align-items: center; }
  select { min-height: 40px; }
  .filters { gap: 10px; }
  .filter:last-child { grid-column: 1 / -1; }
  .filter:nth-child(2) .dropdown { left: auto; right: 0; }
  .dropdown { bottom: auto; top: calc(100% + 4px); }
  .breakdown { padding-top: 56px; }
  #reusable-scatterplot-container .axis-title { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
