:root {
  color-scheme: light;
  --bg: #fff;
  --text: #0a0a0a;
  --muted: #737373;
  --border: #e5e5e5;
  --grid: #f0f0f0;
  --wash: #f5f5f5;
  /* One colour per lab, from slopalytics.com; see color() in lib/model.js. */
  --lab-openai: #303840;
  --lab-anthropic: #ae5235;
  --lab-google: #218347;
  --lab-meta: #3f7fc8;
  --lab-deepseek: #216b70;
  --lab-moonshot: #ab3f83;
  --lab-zai: #8e7318;
  --lab-xiaomi: #b85212;
  --lab-alibaba: #6d55bd;
  --lab-mistral: #ac4d20;
  --lab-other: #7a6a60;
  /* Chinese text falls through the Latin faces to the platform's CJK font. */
  --sans:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --text: #fafafa;
  --muted: #a3a3a3;
  --border: #262626;
  --grid: #1c1c1c;
  --wash: #171717;
  --lab-openai: #f1f3f5;
  --lab-anthropic: #df9477;
  --lab-google: #56ca80;
  --lab-meta: #94c4ff;
  --lab-deepseek: #33979c;
  --lab-moonshot: #ee86c4;
  --lab-zai: #ecd36e;
  --lab-xiaomi: #ff8b45;
  --lab-alibaba: #9b94ee;
  --lab-mistral: #ffad70;
  --lab-other: #a8978b;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus {
  top: 12px;
}
.wrap {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.brand svg {
  width: 26px;
  height: 26px;
}
.brand path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
}
.brand circle {
  fill: currentColor;
}
nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
}
nav a {
  color: var(--muted);
  text-decoration: none;
}
nav a:hover {
  color: var(--text);
}
.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.icon-button:hover {
  color: var(--text);
}
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.icon-button svg path {
  fill: currentColor;
}

/* Hero */
.hero {
  padding-top: 32px;
}
.hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
h1 {
  margin: 0;
  font-size: 64px;
  font-weight: 500;
  letter-spacing: -1.6px;
  line-height: 1;
}
.hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-top: 40px;
}
.hero-bottom p {
  margin: 0;
  max-width: 400px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 8px;
}
.button {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover {
  background: var(--wash);
}
.button.solid {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.button.solid:hover {
  opacity: 0.85;
}

/* Leaderboard */
h2 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.6px;
}
#leaderboard {
  margin-top: 96px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
/* Facets in the filter dialog, above its search box and run list. */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 4px 0 16px;
}
.facet {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.facet .segmented {
  flex-wrap: wrap;
}
.facet-label {
  font-size: 12px;
  color: var(--muted);
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
}
.segmented button {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
.segmented button:hover {
  color: var(--text);
}
.segmented button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}
.updated {
  font-size: 12px;
  color: var(--muted);
}
.updated time {
  color: var(--text);
}
.picker,
select {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  font-weight: 500;
}
.picker span {
  color: var(--muted);
  font-weight: 400;
}
.panel {
  border: 1px solid var(--border);
}
.chart {
  position: relative;
  margin: 0 0 40px;
  padding: 16px 12px 8px;
}
/* Narrow screens scroll the chart sideways rather than shrink its labels. */
#chart {
  overflow-x: auto;
}
#chart > svg {
  min-width: 720px;
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--sans);
}
.chart .grid {
  stroke: var(--muted);
  stroke-dasharray: 2 6;
  opacity: 0.35;
}
.chart .axis {
  stroke: var(--border);
}
.chart .tick {
  font-size: 12px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart .axis-title {
  font-size: 12px;
  fill: var(--muted);
}
.chart .empty {
  font-size: 13px;
  fill: var(--muted);
}
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
}
.chart-note {
  margin: 0;
  padding: 4px 4px 0;
  font-size: 12px;
  color: var(--muted);
}
.subscription-notes {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.subscription-notes summary {
  cursor: pointer;
}
.subscription-notes p {
  max-width: 85ch;
  line-height: 1.6;
}
.chart .line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linejoin: round;
  opacity: 0.8;
}
.chart .leader {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.75;
  opacity: 0.3;
}
.chart .limit {
  stroke: var(--text);
  stroke-dasharray: 2 3;
  opacity: 0.5;
}
.chart .limit-label {
  font-size: 11px;
  fill: var(--muted);
}
.chart .pareto {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  opacity: 0.6;
}
.chart .series-label text {
  font-size: 13px;
  font-weight: 550;
  fill: currentColor;
}
.chart .series-label .agent {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  fill: var(--muted);
}
.chart .chart-logo {
  width: 16px;
  height: 16px;
}
/* Pointing at a series, or focusing one of its points, fades the others. */
.chart .series,
.chart .pareto-series {
  transition: opacity 0.15s;
}
.chart
  svg:has(.series:hover, .series:focus-within)
  :is(.series, .pareto-series):not(:hover, :focus-within) {
  opacity: 0.2;
}
/* With the Pareto frontier shown, everything off it recedes: series with no
   frontier point fade, and so do off-frontier points of the others. */
.chart .point {
  transition: opacity 0.15s;
}
.chart svg.show-frontier .series:not(.on-frontier, :hover, :focus-within) {
  opacity: 0.2;
}
.chart
  svg.show-frontier
  .series.on-frontier:not(:hover, :focus-within)
  :is(.line, .point:not(.on-frontier)) {
  opacity: 0.3;
}
.chart .series:is(:hover, :focus-within) .leader {
  opacity: 0.7;
}
.chart .marker {
  fill: currentColor;
  stroke: var(--bg);
  stroke-width: 1.8;
  paint-order: stroke;
  transform-box: fill-box;
  transform-origin: center;
}
.chart .point {
  cursor: pointer;
  outline: none;
}
.chart .point:hover .marker,
.chart .point:focus-visible .marker {
  transform: scale(1.35);
}
.chart .point:focus-visible .marker {
  stroke: var(--text);
}
/* Hovering or focusing a point draws guides to both axes with its values. */
.chart .crosshair {
  display: none;
  pointer-events: none;
}
.chart .point:is(:hover, :focus-visible) .crosshair {
  display: inline;
}
.chart .crosshair path {
  fill: none;
  stroke: var(--text);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.55;
}
.chart .crosshair text {
  font-size: 11px;
  font-family: var(--mono);
  fill: var(--text);
  stroke: var(--bg);
  stroke-width: 4px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.chart-tip {
  position: absolute;
  z-index: 2;
  width: 240px;
  padding: 12px 14px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  font-size: 12px;
  pointer-events: none;
}
:root[data-theme="dark"] .chart-tip {
  background: var(--wash);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
}
.chart-tip .tip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.chart-tip .tip-head strong {
  color: var(--text);
  font-weight: 600;
}
.chart-tip .tip-logo {
  width: 16px;
  height: 16px;
  flex: none;
}
.chart-tip .tip-sub {
  margin: 2px 0 10px 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.chart-tip dl {
  margin: 0;
  display: grid;
  gap: 5px;
}
.chart-tip dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.chart-tip dt {
  color: var(--muted);
}
.chart-tip dd {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.chart-tip .plotted :is(dt, dd) {
  color: var(--text);
}
.chart-tip .plotted dd {
  font-weight: 600;
}
.chart-tip .tip-hint {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
  padding: 0 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
.leaderboard {
  min-width: 640px;
  font-size: 14px;
}
.leaderboard th {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}
.leaderboard th:hover {
  color: var(--text);
}
.leaderboard th:not(:first-child) {
  text-align: right;
}
.leaderboard td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.leaderboard tr:last-child td {
  border-bottom: 0;
}
.leaderboard th:first-child,
.leaderboard td:first-child {
  padding-left: 0;
}
.leaderboard th:last-child,
.leaderboard td:last-child {
  padding-right: 0;
}
th button span {
  margin-left: 4px;
}
.num {
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.model {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  text-align: left;
}
.model::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--model);
}
.model:hover .model-name {
  text-decoration: underline;
}
.model-name,
.model .agent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brand-logo {
  width: 20px;
  height: 20px;
  flex: none;
}
.harness-logo {
  width: 15px;
  height: 15px;
}
.effort,
.agent {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.bar-cell {
  width: 40%;
}
.bar {
  position: relative;
  display: block;
  height: 12px;
  background: var(--wash);
}
.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--model);
}
.score {
  font-weight: 600;
}
.empty {
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
}
.footnote {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* README sections */
.prose {
  max-width: 680px;
  margin-top: 80px;
}
.prose p,
.prose li {
  line-height: 1.65;
}
.prose a {
  text-decoration-color: var(--muted);
  text-underline-offset: 2px;
}
.prose a:hover {
  text-decoration-color: currentColor;
}
.prose ol,
.prose ul {
  padding-left: 22px;
}
.prose li + li {
  margin-top: 6px;
}
code {
  font-family: var(--mono);
  font-size: 0.875em;
}
:not(pre) > code {
  padding: 1px 4px;
  background: var(--wash);
}
pre {
  margin: 0 0 16px;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--wash);
  font-size: 13px;
  line-height: 1.6;
}
.authors ul {
  list-style: none;
  padding: 0;
  columns: 3;
  column-gap: 24px;
  font-size: 14px;
}
.authors li {
  margin: 0 0 4px;
  break-inside: avoid;
}

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--border);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 32px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.site-footer p {
  margin: 0;
}
.site-footer nav {
  display: flex;
  flex-shrink: 0;
  align-items: baseline;
  gap: 16px;
  font-family: var(--sans);
  font-size: 12px;
}
.site-footer .credit {
  font-size: 11px;
}

/* Dialogs */
dialog {
  width: min(440px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.4);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
dialog h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.3px;
}
#detail-content p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}
#detail-content table {
  font-size: 13px;
}
#detail-content th,
#detail-content td {
  padding: 7px 0;
  border-top: 1px solid var(--border);
}
#detail-content th {
  text-align: left;
  font-weight: 400;
  color: var(--muted);
}
#detail-content td {
  text-align: right;
  font-family: var(--mono);
}
dialog input[type="search"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
}
.picker-actions {
  display: flex;
  gap: 16px;
  margin: 10px 0 6px;
  font-size: 12px;
  color: var(--muted);
}
.picker-actions button:hover {
  color: var(--text);
}
/* The filter dialog keeps one height however many runs match; only the run
   list scrolls, so the facets and search stay in view. It is wider than the
   other dialogs so the model facet wraps onto fewer rows. */
#config-dialog[open] {
  display: flex;
  flex-direction: column;
  width: min(640px, calc(100% - 32px));
  height: min(800px, calc(100vh - 64px));
  height: min(800px, calc(100dvh - 64px));
  overflow: hidden;
}
#config-dialog > :not(#config-options) {
  flex-shrink: 0;
}
#config-options {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
#config-options label {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}
#config-options input {
  accent-color: var(--text);
}
#config-options p {
  font-size: 14px;
  color: var(--muted);
}
/* On phones and short windows the facets alone nearly fill the dialog and
   would leave the run list a sliver, so the whole dialog scrolls instead,
   with the heading and its close button pinned. */
@media (max-width: 720px), (max-height: 760px) {
  #config-dialog[open] {
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    padding-top: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #config-dialog .dialog-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0;
    padding: 20px 0 12px;
    background: var(--bg);
  }
  #config-options {
    flex: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  nav {
    gap: 16px;
  }
  .hero {
    padding-top: 16px;
  }
  .hero-top,
  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  h1 {
    font-size: 44px;
    letter-spacing: -1px;
  }
  #leaderboard {
    margin-top: 64px;
  }
  .authors ul {
    columns: 2;
  }
  .site-footer .wrap {
    flex-direction: column;
  }
}
