/*
 * Type: Concourse carries everything functional, from real files only (3 and 4
 * regular, 3 and 4 bold). Advocate appears in two places only: the wordmark
 * (54 wide) and the About page's headings (34 narrow), both regular. Never on
 * controls, labels, ranks, numerals or scores. font-synthesis is off so no
 * weight is ever faked.
 */
@font-face {
  font-family: "Concourse";
  src: url("/fonts/concourse_3_regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Concourse";
  src: url("/fonts/concourse_4_regular.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Concourse";
  src: url("/fonts/concourse_3_bold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Concourse";
  src: url("/fonts/concourse_4_bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Advocate 54 Wide";
  src: url("/fonts/advocate_54_wide_reg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Advocate 34 Narrow";
  src: url("/fonts/advocate_34_narr_reg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #000000;
  --ink: #ededea;
  --ink-soft: #b3b3ae;
  --muted: #b0b0ab;
  --quiet: #8c8c88;
  --faint: #6c6c68;
  /* Unpressed control words: quieter than ink, never so dim they read as disabled. */
  --idle: #a6a6a1;
  /* Opaque grid greys: crossings never brighten into plaid. */
  --grid: #1f1f1f;
  --grid-minor: #141414;
  --zero: #3d3d3d;
  --rule: #1f1f1f;
  --surface: #0b0b0b;
  --surface-raised: #161616;
  --line: #262626;
  --focus: #ffffff;
  --face: "Concourse", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --wordmark: "Advocate 54 Wide", "Concourse", ui-sans-serif, sans-serif;
  --heading: "Advocate 34 Narrow", "Concourse", ui-sans-serif, sans-serif;
  --switch: cubic-bezier(0.33, 0, 0.15, 1);
  /*
   * Type scale. One size per job, so the same kind of text is the same size everywhere:
   * display (wordmark), lead (the subtitle and About's lede), body (About), control
   * (switches, picker, pill, slider), ui (nav, legend, footer), micro (ticks' neighbours: axis titles, slider stops).
   */
  --fs-display: 32px;
  --fs-lead: 15px;
  --fs-body: 17px;
  --fs-ui: 13px;
  /* Controls read a step above the chart's own labels: they are what you touch. */
  --fs-control: 14px;
  --fs-micro: 11px;
  /* Plot insets: the control band aligns to the plot's edges, the masthead to the page margin. */
  --plot-left: 42px;
  --plot-right: 14px;
  color-scheme: dark;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
}

body {
  font-family: var(--face);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100svh;
  min-height: 720px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 36px 16px;
}

/*
 * Masthead: one row. The wordmark and its subtitle share one middle, split by a
 * hairline; the nav sits at the right. On a phone the
 * subtitle drops to its own line under the wordmark.
 */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 2px 0 20px;
}

.brand {
  display: flex;
  /* Centered on the hairline, not on the baseline: the small-caps wordmark and the lowercase subtitle then share one optical middle. */
  align-items: center;
  min-width: 0;
}

.wordmark {
  flex: none;
  margin: 0;
  font-family: var(--wordmark);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
}

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

.description {
  min-width: 0;
  margin: 0 0 0 22px;
  padding-left: 22px;
  border-left: 1px solid #333331;
  font-size: var(--fs-lead);
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desc-short { display: none; }

.nav {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs-ui);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  text-underline-offset: 4px;
}

.nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: #5a5a57; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav-sep { color: var(--faint); }

/* The figure: a 40px control band on the plot, then the plot itself. */
.stage {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
}

.band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: wrap;
  min-height: 40px;
  padding: 0 var(--plot-right) 0 var(--plot-left);
  border-top: 1px solid var(--rule);
}

.band-left, .band-right {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.band-caption {
  margin: 0;
  font-size: var(--fs-ui);
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
.chart:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Caption-word switches: the active word white, the others muted, an underline on hover. */
.words {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.words button {
  min-height: 32px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: var(--idle);
  font-size: var(--fs-control);
  font-weight: 500;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: color 160ms ease-out;
}

.words button:first-child { padding-left: 0; }
.words button:hover { color: var(--ink-soft); text-decoration: underline; }
.words button[aria-pressed="true"] { color: var(--ink); }
.words button[aria-pressed="true"]:hover { text-decoration: none; }

.picker-placeholder {
  color: var(--muted);
  font-size: var(--fs-control);
  padding: 0 12px;
}

/* Model picker */
.picker { position: relative; }

.picker-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: var(--fs-control);
  white-space: nowrap;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: color 160ms ease-out;
}

.picker-button:hover,
.picker-button[aria-expanded="true"] {
  color: var(--ink);
}

.picker-button:hover .picker-count { text-decoration: underline; text-decoration-color: #5a5a57; }

.swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}

.chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease-out;
}

.picker-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.picker-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, calc(100vw - 32px));
  max-height: min(72svh, 600px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0a0a0a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.picker-panel[hidden] { display: none; }

.picker-tools {
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.picker-filter {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.picker-filter::placeholder { color: var(--faint); }

.picker-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 7px;
  min-height: 32px;
}

.text-button:hover { color: var(--ink); background: var(--surface-raised); }

.picker-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 10px;
}

.lab-group + .lab-group { border-top: 1px solid #161616; }

.lab-name {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 12px 16px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.lab-count {
  margin-left: auto;
  font-weight: 400;
  color: var(--muted);
}

.lab-group ul { list-style: none; margin: 0; padding: 0 6px; }

.model-row {
  display: grid;
  grid-template-columns: 18px 28px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.model-row:hover { background: var(--surface-raised); }

.model-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #ededea;
}

.sample { width: 28px; height: 10px; overflow: visible; }
.sample line { stroke: var(--c); stroke-width: 2; stroke-linecap: round; }
.sample circle { fill: var(--c); }

.model-name { color: var(--ink); }

.older-tag {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.peak {
  color: var(--muted);
  font-size: 13px;
}

.picker-empty {
  margin: 0;
  padding: 18px 16px;
  color: var(--muted);
}

/* Plot box: both views share it and cross-fade inside it, so the page never reflows. */
.chart {
  position: relative;
  flex: 1 1 auto;
  min-height: 380px;
  margin: 0 0 6px;
}

.chart > svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

svg text { font-family: var(--face); font-variant-numeric: lining-nums tabular-nums; }

.measure { position: absolute; left: -10000px; top: 0; visibility: hidden; }

/* Gridlines: opaque hex, 1px, crisp. Log 2 and 5 steps sit one step quieter than the decades. */
.gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.gridline-v.minor { stroke: var(--grid-minor); }

.tick {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 400;
  dominant-baseline: central;
}

.tick-y { text-anchor: end; }
.tick-x { text-anchor: middle; }

.axis-title {
  fill: #b4b4af;
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.09em;
  font-feature-settings: "case" 1;
  dominant-baseline: central;
}

.axis-title-x { text-anchor: middle; }

.release { transition: opacity 180ms ease-out; }
.release.muted { opacity: 0.5; }

.curve {
  fill: none;
  stroke: var(--c);
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.casing {
  fill: none;
  stroke: var(--ground);
  stroke-width: 5.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.release.older .curve {
  stroke-width: 2;
  stroke-dasharray: 5 4;
  stroke-linecap: butt;
}

.release.muted .curve { stroke-width: 1.75; }

.dot {
  fill: var(--c);
  stroke: var(--ground);
  stroke-width: 1.5;
}

.label {
  fill: var(--c);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: var(--ground);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.label.older { font-weight: 400; }

.tag {
  fill: var(--c);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: var(--ground);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.leader {
  stroke: var(--c);
  stroke-width: 1;
  stroke-linecap: round;
}

svg.compact .label { font-size: 11.5px; }
svg.compact .tag { font-size: 10.5px; }

.label-wrap, .tag-wrap, .leader-wrap { transition: opacity 160ms ease-out; }
.label-wrap { cursor: default; }
.tag-wrap { opacity: 0.92; }
.leader-wrap { opacity: 0.6; }
.label-wrap[data-idle="0"],
.tag-wrap[data-idle="0"],
.leader-wrap[data-idle="0"] { opacity: 0; pointer-events: none; }
.tag-wrap[data-none="1"] { display: none; }

/* Focus: the active line comes forward with every effort tag; the others drop to a quarter. */
svg.focusing .release:not(.is-active) { opacity: 0.25; }
svg.focusing .release.is-active { opacity: 1; --c: var(--c-focus); }
svg.focusing .label-wrap.is-active,
svg.focusing .tag-wrap.is-active { opacity: 1; }
svg.focusing .leader-wrap.is-active { opacity: 0.9; }
svg.focusing .label-wrap[data-idle="1"]:not(.is-active),
svg.focusing .leader-wrap[data-idle="1"]:not(.is-active) { opacity: 0.5; }
svg.focusing .tag-wrap[data-idle="1"]:not(.is-active) { opacity: 0.3; }
svg.focusing .tag-wrap[data-idle="0"]:not(.is-active) { opacity: 0; }
svg.focusing .tag-wrap.under-readout { opacity: 0; }

/* Hover: dotted crosshair to both axes with value chips; a readout beside the dot. */
.crosshair { opacity: 0; pointer-events: none; transition: opacity 120ms ease-out; }
.crosshair.on { opacity: 1; }
.crosshair path { fill: none; stroke: var(--c); stroke-width: 1; stroke-dasharray: 1 3; stroke-linecap: round; opacity: 0.8; }
.chip rect { fill: var(--c); }
.chip text {
  fill: #000;
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
}

.readout { pointer-events: none; opacity: 0; transition: opacity 120ms ease-out; }
.readout.on { opacity: 1; }
.readout text {
  dominant-baseline: central;
  paint-order: stroke;
  stroke: var(--ground);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.ro-name { fill: var(--c); font-size: 13px; font-weight: 600; }
.ro-step { fill: var(--ink); font-size: 12px; font-weight: 400; }
svg.compact .ro-name { font-size: 12px; }
svg.compact .ro-step { font-size: 11.5px; }

/* Reduced motion: an opacity crossfade, no positions in between. */
@keyframes cf-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes cf-in { from { opacity: 0; } to { opacity: 1; } }
.crossfade-out { animation: cf-out 180ms linear forwards; pointer-events: none; }
svg.crossfade-in > :not(.crossfade-out) { animation: cf-in 180ms linear both; }

@media (prefers-reduced-motion: reduce) {
  .release, .label-wrap, .tag-wrap, .leader-wrap, .crosshair, .readout { transition-duration: 1ms; }
}

.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-soft);
}

.empty[hidden] { display: none; }
.empty p { margin: 0; }

.empty button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 500;
}

.noscript {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

/* Footer: the legend and the one source line (the free tier's credit) on one quiet row. */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-top: 4px;
  font-size: var(--fs-ui);
  line-height: 1.4;
  color: var(--ink-soft);
}

.source { color: var(--ink-soft); }

.foot p { margin: 0; }

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  color: var(--ink-soft);
}

.legend-hint { color: var(--muted); }

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.legend svg { display: block; overflow: visible; }
.legend-dot { fill: var(--ink-soft); stroke: var(--ground); stroke-width: 1; }
.legend-dash { stroke: var(--ink-soft); stroke-width: 2; stroke-dasharray: 5 4; }

.source a {
  color: var(--ink-soft);
  text-decoration-thickness: 1px;
  text-decoration: underline;
  text-decoration-color: #4a4a47;
  text-underline-offset: 3px;
}

.source a:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* Which controls each view shows. The slider and Linear | Log share one slot on the band. */
.stage[data-view="board"] .band-caption,
.stage[data-view="board"] .scale-switch,
.stage[data-view="curves"] .index-switch,
.stage[data-view="curves"] .budget { display: none; }
.slot { display: flex; align-items: center; }
/* The Leaderboard band carries the slider: a taller row, the chip clear of the rule above it. */
.stage[data-view="board"] .band { padding-top: 8px; padding-bottom: 4px; }

/* Leaderboard | Curves: the band's one pill container; its thumb slides on the switch curve. */
.view-pill {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.pill-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: var(--thumb-w, 50%);
  border-radius: 999px;
  background: #262626;
  transition: transform 420ms var(--switch), width 420ms var(--switch);
}

.view-pill button {
  position: relative;
  min-height: 28px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--idle);
  font-size: var(--fs-control);
  font-weight: 500;
  transition: color 200ms ease-out;
}

.view-pill button:hover { color: var(--ink-soft); }
.view-pill button[aria-pressed="true"] { color: var(--ink); }

/* Budget slider: the Log cost axis shrunk to one track, big enough to grab and read at a glance. */
.budget { display: flex; align-items: center; gap: 16px; padding: 4px 0; }
.budget-readout { font-size: var(--fs-control); color: var(--ink-soft); white-space: nowrap; }
.budget-track { position: relative; width: 340px; height: 64px; flex: none; }
.budget-track:has(.budget-input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.budget-svg { display: block; overflow: visible; cursor: ew-resize; touch-action: none; }
.budget-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.budget-line { stroke: #6a6a66; stroke-width: 2; }
.budget-gap { stroke: #3d3d3d; stroke-width: 2; }
.budget-tick { stroke: #a6a6a1; stroke-width: 1; shape-rendering: crispEdges; }
.budget-rug line { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; shape-rendering: crispEdges; }
.budget-label {
  fill: #c9c9c4;
  font-size: var(--fs-control);
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: central;
}
.budget-thumb { stroke: var(--ink); stroke-width: 1.5; }
.budget-handle { fill: var(--ink); stroke: var(--ground); stroke-width: 2; transition: transform 120ms ease-out; transform-box: fill-box; transform-origin: center; }
.budget-svg:hover .budget-handle { transform: scale(1.12); }
.budget-chip rect { fill: var(--ink); }
.budget-chip text {
  fill: #000;
  /* At least the body size on every screen (ISC-84). */
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.budget.dragging .budget-thumb { stroke: #ffffff; }
.budget.dragging .budget-handle { fill: #ffffff; transform: scale(1.12); }

/* The two views share the plot box and cross-fade inside it. */
.view.inactive { pointer-events: none; }
.empty.inactive { display: none; }

.board {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.board-scroll { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.board.expanded .board-scroll { overflow-y: auto; overscroll-behavior: contain; }
.board-svg { display: block; overflow: hidden; user-select: none; -webkit-user-select: none; }

.board-foot {
  display: flex;
  align-items: baseline;
  gap: 18px;
  min-height: 40px;
  padding: 8px 0 0 var(--name-x, 58px);
  font-size: 15px;
}

.more {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #4a4a47;
  text-underline-offset: 4px;
}
.more:hover { color: var(--ink); text-decoration-color: var(--ink); }
.more[hidden] { display: none; }

.board-note { margin: 0; color: var(--quiet); }
.board-note[hidden] { display: none; }
.note-name { color: var(--c); }

/* Leaderboard type (Daniel, 2026-09-24: "way too condensed and small"): nothing under 13px. Each class is also the kind
   the board measures with, so the measuring svg and the board read the same rules. */
.axis-line { stroke: var(--zero); stroke-width: 1; shape-rendering: crispEdges; }
.break-gap { fill: var(--ground); }
.break-lines { fill: none; stroke: var(--quiet); stroke-width: 1.25; stroke-linecap: round; }
.board-tick { fill: #c9c9c4; font-size: 14px; font-weight: 400; text-anchor: middle; dominant-baseline: central; }
.board-title {
  fill: #d6d6d1;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-feature-settings: "case" 1;
  dominant-baseline: central;
}
.board-cost-title { text-anchor: end; }
.brank { fill: var(--quiet); font-size: 15px; text-anchor: end; dominant-baseline: central; }
.compact .brank { font-size: 13px; }

.group-line { stroke: var(--zero); stroke-width: 1; shape-rendering: crispEdges; }
.group-name {
  fill: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: var(--ground);
  stroke-width: 10px;
  stroke-linejoin: round;
}

.bname {
  fill: var(--c);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.005em;
  dominant-baseline: central;
}
.bname.older { font-weight: 400; }
.compact .bname { font-size: 16px; }
/* The score and its effort word share one alphabetic baseline, set in the board's geometry. */
.bscore {
  fill: var(--ink);
  font-size: 20px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--ground);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.compact .bscore { font-size: 18px; }
.bscore-tag { fill: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: 0.02em; }
.compact .bscore-tag { font-size: 13px; }
.bcost { fill: var(--ink-soft); font-size: 17px; text-anchor: end; dominant-baseline: central; }
.compact .bcost { font-size: 15px; }
.btag {
  fill: var(--c);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: var(--ground);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.brow .bin { transition: opacity 140ms ease-out; }
.board-svg.focusing .brow:not(.is-focus) .bin { opacity: 0.35; }
.brow .track { fill: var(--c); fill-opacity: 0.35; }
.brow .bline { stroke: var(--c); stroke-width: 3; stroke-linecap: round; }
.brow.older .bline { stroke-width: 2.5; stroke-dasharray: 6 4; stroke-linecap: butt; }
.brow .hair { stroke: var(--quiet); stroke-width: 1.5; opacity: 0.8; }
.brow .fill { fill: var(--c); stroke: var(--ground); stroke-width: 2; }
.brow .ring { fill: var(--ground); stroke: var(--quiet); stroke-width: 1.75; }
/* Per-dot effort tags show only on the hovered or tapped row. */
.brow .btag { opacity: 0; transition: opacity 140ms ease-out; }
.brow .btag.over { fill: var(--quiet); }
.brow.is-focus .btag[data-on="1"] { opacity: 0.92; }
.brow .sel { cursor: pointer; }
.sel-hit { fill: transparent; }
.sel-dot { fill: var(--ground); stroke: #5a5a57; stroke-width: 1.5; }
.brow.selected .sel-dot { fill: var(--c); stroke: var(--c); }
.brow .sel:hover .sel-dot { stroke: var(--c); }

/* The score switch reads larger over the Leaderboard. */
.stage[data-view="board"] .index-switch button { font-size: 16px; }

.legend-ring { fill: none; stroke: var(--quiet); stroke-width: 1.25; }


/* About: one centered 640px column on the same black. Advocate 34 narrow for the H1 and section heads, Concourse 17px for the body. */
.page-about {
  height: auto;
  min-height: 100svh;
}

.page-about .foot { justify-content: center; }

.about {
  width: 100%;
  max-width: 600px;
  margin: 44px auto 64px;
  font-size: var(--fs-body);
  line-height: 1.62;
  color: #d6d6d1;
}

.about h1,
.about h2 {
  font-family: var(--heading);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.1;
}

.about h1 { margin: 0 0 20px; font-size: 48px; letter-spacing: 0.005em; }
.about h2 {
  margin: 52px 0 16px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 24px;
  letter-spacing: 0.02em;
}
.about p { margin: 0 0 18px; }
.about .lede { margin-bottom: 0; font-size: 21px; line-height: 1.5; color: var(--ink); }

.about a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #5a5a57;
  text-underline-offset: 3px;
}

.about a:hover { text-decoration-color: var(--ink); }

.terms { margin: 0; }
.terms dt { margin-top: 22px; font-weight: 600; color: var(--ink); }
.terms dt:first-child { margin-top: 0; }
.terms dd { margin: 4px 0 0; color: #c9c9c4; }

.about-figure { margin: 28px 0 8px; }
.about-figure svg { display: block; overflow: visible; }
.about-figure figcaption { margin-top: 10px; font-size: var(--fs-ui); color: var(--quiet); }
.fig-tag { fill: var(--ink-soft); font-size: 11px; font-weight: 500; letter-spacing: 0.02em; text-anchor: middle; }
.fig-ring { fill: none; stroke: var(--quiet); stroke-width: 1.25; }

/* Phones */
@media (max-width: 640px) {
  :root { --plot-left: 30px; --plot-right: 6px; }
  body { font-size: 14px; }
  .page {
    height: 100svh;
    min-height: 700px;
    padding: 14px 16px 12px;
  }
  :root { --fs-display: 25px; --fs-lead: 13.5px; --fs-body: 16px; }
  .masthead { flex-wrap: wrap; padding: 0 0 12px; gap: 6px 16px; }
  /* The subtitle takes its own line under the wordmark: the brand wraps, and the nav stays beside the wordmark. */
  .brand { flex-wrap: wrap; flex: 1 1 0; row-gap: 7px; }
  .description { flex: 1 1 100%; margin: 0; padding-left: 0; border-left: 0; white-space: normal; }
  .desc-long { display: none; }
  .desc-short { display: inline; }
  .nav { gap: 7px; }
  .band { flex-wrap: wrap; padding: 4px var(--plot-right) 4px 0; }
  /* Phones: the switch and the view pill share the first row; the slider (or Linear | Log and the picker) gets its own. */
  .band-right { display: contents; }
  .band-left { order: 1; flex: 1 1 auto; }
  .view-pill { order: 2; }
  .slot { order: 3; flex: 1 1 100%; }
  #picker-slot, .picker { order: 4; }
  .stage[data-view="curves"] .slot { flex: 0 1 auto; }
  .stage[data-view="board"] .picker { display: none; }
  /* Phones: the slider takes its own full-width row, the count above it. */
  .budget { flex: 1 1 100%; flex-wrap: wrap; gap: 2px 12px; padding: 2px 0 0; }
  .budget-readout { flex: 1 1 100%; }
  .budget-track { width: 100%; max-width: 340px; }
  .budget-svg { width: 100%; height: auto; }
  .view-pill button { padding: 0 11px; }
  .band-left, .band-right { gap: 12px; }
  .band-caption { display: none; }
  .picker { min-width: 0; }
  .picker-count { overflow: hidden; text-overflow: ellipsis; }
  .picker-panel { left: auto; right: 0; width: calc(100vw - 32px); max-height: 64svh; }
  .words button { min-height: 36px; }
  .chart { flex: 1 1 auto; min-height: 330px; margin: 6px 0 8px; }
  .foot { font-size: 12.5px; gap: 8px; }
  .about { margin-top: 22px; }
  .about h1 { font-size: 36px; margin-bottom: 14px; }
  .about .lede { font-size: 18px; }
  .about h2 { font-size: 21px; margin-top: 38px; padding-top: 20px; }
  .legend { gap: 6px 14px; }
}
.board-tick.skip { display: none; }

/*
 * History (F12): a timeline of data updates in the same plot box as the two charts, newest first.
 * The panel scrolls inside the box, so the page never reflows and the footer credit stays on screen.
 * Without JavaScript the Worker's render shows it for ?view=history; with it, the one crossfade
 * clock moves between all three views.
 */
.view-pill { grid-template-columns: auto auto auto; }
.stage:not([data-view="history"]) .history-caption,
.stage[data-view="history"] .band-caption:not(.history-caption),
.stage[data-view="history"] .index-switch,
.stage[data-view="history"] .scale-switch,
.stage[data-view="history"] .budget,
.stage[data-view="history"] .picker,
.stage[data-view="history"] #picker-slot,
.stage[data-view="history"] .noscript { display: none; }

.history {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--plot-right) 24px var(--plot-left);
  opacity: 0;
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: #333331 transparent;
}
.stage[data-view="history"] .history { opacity: 1; pointer-events: auto; }
.history.inactive { pointer-events: none; }
.history:focus { outline: none; }

.hist-list { max-width: 1000px; margin: 0 auto; }

.batch {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 0 36px;
  padding: 26px 0 30px;
  border-top: 1px solid var(--rule);
}
.batch:first-child { border-top: 0; padding-top: 18px; }

.batch-head { position: sticky; top: 14px; align-self: start; }
.batch-time { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.batch-summary { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }

.batch-note { margin: 0 0 24px; padding-left: 16px; border-left: 1px solid #333331; }
.note-text { margin: 0; max-width: 68ch; font-size: var(--fs-body); line-height: 1.55; color: #d9d9d5; }
.note-label { margin: 8px 0 0; font-size: 13px; color: var(--quiet); }

.kind-group + .kind-group { margin-top: 22px; }
.kind-head { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.kind-count { margin-left: 6px; font-weight: 400; color: var(--quiet); }

.changes { margin: 0; padding: 0; list-style: none; }

.change {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 150px 84px;
  grid-template-areas: "name meta values delta";
  align-items: baseline;
  gap: 2px 18px;
  padding: 8px 0;
  position: relative;
  border-bottom: 1px solid #141414;
  font-size: 15px;
  line-height: 1.35;
}

.hist-model {
  grid-area: name;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
button.hist-model:hover, .hist-model[aria-expanded="true"] { text-decoration-color: currentColor; }
.hist-model.static { cursor: default; }
/* A continued row: same release as the row above, so its name is not repeated, and the rule between them goes. */
.change.cont .hist-model { position: absolute; }
.change:has(+ .change.cont) { border-bottom-color: transparent; }
.change.cont { padding-top: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ch-meta { grid-area: meta; display: flex; gap: 10px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.ch-values { grid-area: values; justify-self: end; white-space: nowrap; color: var(--ink); }
.ch-delta { grid-area: delta; justify-self: end; white-space: nowrap; font-weight: 600; color: var(--quiet); }
/* Direction only, and quiet: green for a higher score or a lower price, red for the reverse. */
.ch-delta.better { color: #8cc49a; }
.ch-delta.worse { color: #de9489; }
.ch-delta.note { font-weight: 400; font-size: 13px; letter-spacing: 0.02em; }

.ch-more > summary { padding: 8px 0 0; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.ch-more > summary:hover { color: var(--ink); }

.spark-row { padding: 10px 0 14px; border-bottom: 1px solid #141414; }
.spark { display: flex; flex-direction: column; gap: 6px; }
.spark-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.spark-cap { margin: 0; font-size: 13px; color: var(--ink-soft); }
.spark-word { margin-right: 4px; font-weight: 600; color: var(--ink); }

.hist-more {
  display: block;
  width: max-content;
  margin: 12px auto 28px;
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-control);
  font-weight: 500;
  text-decoration: none;
}
.hist-more:hover { border-color: #3d3d3d; }

.hist-empty { max-width: 560px; margin: 88px auto 0; font-size: var(--fs-body); line-height: 1.5; text-align: center; color: var(--ink-soft); }

.history-note { color: #c9c9c4; }

@media (max-width: 640px) {
  .history { padding: 0 0 16px; }
  .batch { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 0 22px; }
  .batch-head { position: static; }
  .batch-time { font-size: 16px; }
  .batch-note { margin-bottom: 18px; padding-left: 12px; }
  .note-text { font-size: 16px; }
  /* Every row on a phone: the name on its own line (once per run), then effort and index, values, delta. */
  .change {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name name name" "meta values delta";
    gap: 2px 12px;
    font-size: 14px;
  }
  .hist-model { font-size: 15px; }
  .change.cont { grid-template-areas: "meta values delta"; }
  .ch-meta { font-size: 13px; }
  .hist-empty { margin-top: 56px; font-size: 16px; }
}
