/*
 * Every color is a role token, so light and dark mode swap in one place.
 * The chart script reads the same tokens, which keeps the charts and the page in step.
 *
 * Series colors are system hues stepped until the set passes lightness, chroma, and color-vision
 * checks on each mode's background, in this order; reorder or replace them only after re-running
 * those checks.
 * Worse and better are reserved for regressions and improvements and never stand in for a series.
 */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --hover: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --grid: #f0f0f2;
  --rule: #e5e5ea;
  --axis: #c7c7cc;
  --accent: #007aff;
  --worse: #ff3b30;
  --worse-text: #d70015;
  --better: #34c759;
  --better-text: #248a3d;
  --noise: #d1d1d6;
  --shadow: rgba(0, 0, 0, 0.08);
  --worse-wash: rgba(255, 59, 48, 0.07);
  --better-wash: rgba(52, 199, 89, 0.08);
  --mark: rgba(0, 122, 255, 0.14);
  --s1: #007aff;
  --s2: #f28a00;
  --s3: #00a9a1;
  --s4: #af52de;
  --s5: #d4a000;
  --s6: #c43dad;
  --s7: #a86a2c;
  --s8: #3d8fb8;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #111113;
    --hover: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #c7c7cc;
    --muted: #98989d;
    --grid: #1f1f22;
    --rule: #2c2c2e;
    --axis: #48484a;
    --accent: #0a84ff;
    --worse: #ff453a;
    --worse-text: #ff6961;
    --better: #30d158;
    --better-text: #30d158;
    --noise: #3a3a3c;
    --shadow: rgba(0, 0, 0, 0.5);
    --worse-wash: rgba(255, 69, 58, 0.08);
    --better-wash: rgba(48, 209, 88, 0.07);
    --mark: rgba(10, 132, 255, 0.3);
    --s1: #0a84ff;
    --s2: #d67800;
    --s3: #139e96;
    --s4: #bf5af2;
    --s5: #b38a00;
    --s6: #cc4fb8;
    --s7: #b87838;
    --s8: #3f9fcf;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113;
  --hover: #1c1c1e;
  --ink: #f5f5f7;
  --ink-2: #c7c7cc;
  --muted: #98989d;
  --grid: #1f1f22;
  --rule: #2c2c2e;
  --axis: #48484a;
  --accent: #0a84ff;
  --worse: #ff453a;
  --worse-text: #ff6961;
  --better: #30d158;
  --better-text: #30d158;
  --noise: #3a3a3c;
  --shadow: rgba(0, 0, 0, 0.5);
  --worse-wash: rgba(255, 69, 58, 0.08);
  --better-wash: rgba(48, 209, 88, 0.07);
  --mark: rgba(10, 132, 255, 0.3);
  --s1: #0a84ff;
  --s2: #d67800;
  --s3: #139e96;
  --s4: #bf5af2;
  --s5: #b38a00;
  --s6: #cc4fb8;
  --s7: #b87838;
  --s8: #3f9fcf;
}

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

/* Layout rules below set display, which would otherwise override the hidden attribute. */
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: layout rules below set display, which must not override the hidden attribute. */
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px / 1.55 var(--font);
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration-color: var(--axis);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.sha {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px 72px;
}

/* Header */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
}

.top h1 {
  font-size: 20px;
  letter-spacing: -0.015em;
}

.top h1 a {
  text-decoration: none;
}

.top h1 a:hover {
  color: inherit;
}

.meta {
  margin: 0;
  color: var(--muted);
}

/* Settings: a gear in the header over a panel of display choices */

/* The project's own links, such as its documentation, sit at the end of the row before the settings. */
.site-links {
  display: flex;
  gap: 16px;
  margin-left: auto;
  font-size: 13px;
}

.settings {
  position: relative;
  margin-left: auto;
}

.site-links:not([hidden]) + .settings {
  margin-left: 0;
}

.icon-button {
  display: inline-flex;
  padding: 6px;
  margin: -6px;
  border-radius: 6px;
  color: var(--muted);
  transition:
    background-color 120ms ease,
    color 120ms ease;
}

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

.icon-button .icon {
  width: 17px;
  height: 17px;
  stroke-width: 1.4;
}

/* The panel hangs from the gear's right edge and opens toward the left, inside the page. */
.settings .settings-panel {
  right: -6px;
  left: auto;
  display: grid;
  gap: 12px;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  max-height: none;
  padding: 16px 18px;
}

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

.setting {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  align-items: baseline;
  column-gap: 16px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.suites {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 16px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px 32px;
  margin-top: 14px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 40px;
}

/* A filter keeps its label beside its values; the values wrap among themselves. */
.filter {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px 18px;
  min-width: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  min-width: 0;
}

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

/* Options are plain text: the current one is ink, the rest are muted. */
.option {
  color: var(--muted);
  transition: color 120ms ease;
}

.option:hover {
  color: var(--ink);
}

.option[aria-checked="true"],
.option[aria-pressed="true"],
.option[aria-selected="true"],
.option[aria-expanded="true"] {
  color: var(--ink);
}

/* Selection never changes weight, so choosing an option never shifts its neighbours. */
.option[role="radio"][aria-checked="true"] {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.suites .option {
  padding-bottom: 6px;
  font-size: 15px;
}

.suites .option[aria-selected="true"] {
  box-shadow: inset 0 -2px 0 var(--ink);
}

.sections .option {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.sections .option[aria-selected="true"] {
  background: var(--hover);
}

/* A hidden value keeps its place but fades, with a hollow key. */
.filters .option[aria-pressed="false"] {
  opacity: 0.45;
}

.filters .option[aria-pressed="false"]:hover {
  color: var(--muted);
}

.sections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 10px 0 0 -8px;
}

.line-key {
  display: inline-block;
  width: 12px;
  height: 2px;
  margin-right: 7px;
  border-radius: 1px;
  vertical-align: middle;
  background: var(--key);
  transition: opacity 120ms ease;
}

.line-key.dashed {
  background: repeating-linear-gradient(90deg, var(--key) 0 4px, transparent 4px 7px);
}

.line-key.dotted {
  background: repeating-linear-gradient(90deg, var(--key) 0 2px, transparent 2px 4px);
}

.filters .option[aria-pressed="false"] .line-key {
  background: none;
  box-shadow: inset 0 0 0 1px var(--key);
}

/* Disclosures and quiet actions: text with a faint rounded fill on hover, offset by their own
   padding so their text still lines up with the column. */
.disclosure,
.more,
.charts-more,
.changes-more,
.readout-more,
.menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px -8px;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--muted);
  transition:
    background-color 120ms ease,
    color 120ms ease;
}

.disclosure:hover:not(:disabled),
.more:hover,
.charts-more:hover,
.changes-more:hover,
.readout-more:hover,
.menu-button:hover,
.menu-button[aria-expanded="true"] {
  background: var(--hover);
  color: var(--ink);
}

.disclosure .toggle-icon {
  width: 11px;
  height: 11px;
  color: var(--muted);
}

/* A full-width band that opens a whole part of the page, or loads more of it, with its label
   centred; a faint fill on hover says it can be pressed. */
.wide-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  transition:
    background-color 120ms ease,
    color 120ms ease;
}

.wide-toggle:hover {
  background: var(--hover);
  color: var(--ink);
}

.wide-toggle .toggle-icon {
  width: 11px;
  height: 11px;
}

#history .wide-toggle {
  margin-top: 16px;
  border-bottom: 0;
}

/* Filter menus: a summary button over a panel of checkboxes */

.menu {
  position: relative;
}

.menu-button {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink);
}

.menu-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  left: -10px;
  width: max-content;
  min-width: 200px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: 360px;
  overflow: auto;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 10px 30px var(--shadow);
}

.menu-search {
  width: 100%;
  margin: 2px 0 6px;
  padding: 6px 8px;
}

.menu-all {
  display: block;
  padding: 4px 8px;
  font-size: 13px;
}

/* Clears a filtered legend row; quieter than the values it sits beside. */
.chips-all {
  color: var(--muted);
  font-size: 13px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
}

.menu-item:hover,
.menu-item:focus-within {
  background: var(--hover);
}

.menu-item input {
  margin: 0;
  accent-color: var(--accent);
}

.menu-item label {
  flex: 1;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.menu-item .only {
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
}

.menu-item:hover .only,
.menu-item:focus-within .only {
  opacity: 1;
}

.menu-item .only:hover {
  color: var(--accent);
}

/* Sections */

main {
  display: grid;
  gap: 48px;
  margin-top: 28px;
}

.trail-chart {
  height: 112px;
}

/* At most two charts side by side: a column is never narrower than half the row, and below twice
   its smallest width the charts stack in one. */
.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(460px, calc((100% - 48px) / 2))), 1fr));
  gap: 56px 48px;
}

.chart-card {
  min-width: 0;
}

.chart-card h3 {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chart-card .note {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 400;
}

.chart {
  position: relative;
  height: 260px;
  margin-top: 14px;
}

.chart,
.trail-chart {
  position: relative;
  touch-action: pan-y;
}

.drag-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent);
  opacity: 0.08;
  border-radius: 4px;
  pointer-events: none;
}

/* ECharts sets the cursor inline on its root as the pointer crosses elements; every point of a
   plot does the same thing on click, so the cursor stays a crosshair throughout. */
.chart > div {
  /* biome-ignore lint/complexity/noImportantStyles: ECharts sets the cursor inline, which only an important rule overrides. */
  cursor: crosshair !important;
}

/* Readout under each chart: one row per line, at the hovered or selected run.
   Fixed column widths and tabular digits keep every row in place while the numbers change. */

.readout-table {
  width: 100%;
  margin-top: 8px;
  table-layout: fixed;
  font-size: 13px;
}

.readout-table col.num {
  width: 6.5em;
}

.readout-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.readout-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
}

.readout-value {
  color: var(--ink);
  font-weight: 500;
}

/* A row that regressed or improved at this run carries a faint wash of its verdict color. */
.readout-table tr[data-verdict="worse"] td {
  background: var(--worse-wash);
}

.readout-table tr[data-verdict="better"] td {
  background: var(--better-wash);
}

.readout-table tr[data-verdict="worse"] td:first-child,
.readout-table tr[data-verdict="better"] td:first-child {
  color: var(--ink);
}

.readout-table td:first-child,
.readout-table th:first-child {
  padding-left: 8px;
}

.readout-table td:last-child,
.readout-table th:last-child {
  padding-right: 8px;
}

.multiples .readout-table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

.readout-more {
  margin-top: 8px;
  padding-left: 8px;
  color: var(--muted);
  font-size: 13px;
}

.readout-more:hover {
  color: var(--ink);
}

/* Small multiples: one heading per metric over a grid of compact charts */

.charts.is-faceted {
  grid-template-columns: 1fr;
  gap: 56px;
}

.metric-group h2 {
  font-size: 15px;
}

.metric-group h2 .note {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 400;
}

.multiples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(340px, calc((100% - 48px) / 2))), 1fr));
  gap: 48px 48px;
  margin-top: 24px;
}

.multiples .chart-card h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.multiples .chart {
  height: 180px;
  margin-top: 8px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

/* Run bar: which run the charts show, kept on screen while they scroll */

.charts-area {
  display: grid;
  gap: 24px;
}

.run-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -12px;
  padding: 12px 12px 10px;
  background: var(--bg);
}

/* The bar's background bleeds past the column so lines scroll cleanly under it, but its rule
   stays on the column edges. */
.run-bar::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  border-bottom: 1px solid var(--rule);
}

.run-bar.is-preview .run-subject {
  color: var(--ink-2);
  font-weight: 500;
}

.run-bar.is-preview .sha {
  opacity: 0.6;
}

.run-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  white-space: nowrap;
}

.run-head .step {
  padding: 10px 6px;
  margin: -10px -4px;
  color: var(--muted);
  font-size: 15px;
}

.run-head .step:hover:not(:disabled) {
  color: var(--ink);
}

.run-head .step:disabled {
  opacity: 0.3;
  cursor: default;
}

.run-head .sha {
  margin-left: 4px;
}

.run-subject {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tally {
  display: inline-flex;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
}

.tally .change {
  min-width: 0;
}

.run-facts {
  overflow: hidden;
  margin-top: 2px;
  padding-left: 56px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.run-facts .boundary {
  margin-left: 12px;
  color: var(--ink-2);
}

.run-facts .boundary::before {
  content: "Environment: ";
  color: var(--muted);
}

/* Unpins the selected run; a link-like action that shows its hover like the other quiet controls. */
.run-facts .follow {
  margin-left: 12px;
  color: var(--accent);
  font-size: 12px;
}

.run-facts .follow:hover {
  text-decoration: underline;
}

/* Commit message of the selected run */

.message {
  min-width: 0;
}

.message-head {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.run-body {
  max-width: 80ch;
  margin: 12px 0 0;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.run-facts-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
  margin: 14px 0 0;
  font-size: 13px;
}

.run-facts-list dt {
  color: var(--muted);
}

.run-facts-list dd {
  margin: 0;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* Changes: the latest runs that regressed or improved */

.changes-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  text-align: left;
}

.changes-toggle:disabled {
  cursor: default;
}

.changes-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.changes-counts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  color: var(--muted);
  font-size: 13px;
}

.changes-counts .change {
  min-width: 0;
  font-weight: 600;
}

.change-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.change-run {
  position: relative;
  display: grid;
  grid-template-columns: 7ch minmax(0, 1fr) minmax(0, max-content) auto;
  align-items: baseline;
  column-gap: 16px;
  margin: 0 -12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.change-run .lead .change {
  min-width: 0;
  font-weight: 600;
}

.change-run + .change-run::before {
  content: "";
  position: absolute;
  top: 0;
  right: 12px;
  left: 12px;
  border-top: 1px solid var(--grid);
}

.change-run:hover::before,
.change-run[aria-selected="true"]::before,
.change-run:hover + .change-run::before,
.change-run[aria-selected="true"] + .change-run::before {
  border-top-color: transparent;
}

.change-run:hover,
.change-run[aria-selected="true"] {
  background: var(--hover);
}

.change-run .subject {
  overflow: hidden;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.change-run .when {
  color: var(--muted);
  font-size: 12px;
}

.change-run .tentative {
  margin-right: 10px;
  color: var(--ink-2);
}

.change-run .moves {
  flex-wrap: nowrap;
  max-width: 34vw;
  overflow: hidden;
  gap: 10px;
  color: var(--muted);
}

.change-run .moves .move {
  white-space: nowrap;
}

.change-run .moves .move:first-child .change {
  display: none;
}

.moves {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 13px;
}

.move {
  overflow-wrap: anywhere;
}

.history-table td.moves-cell,
.history-table th:last-child:nth-child(2) {
  white-space: normal;
  text-align: left;
}

.history-table td.moves-cell .change {
  display: inline-block;
  font-size: inherit;
}

.move .change {
  min-width: 0;
  margin-right: 6px;
  font-weight: 600;
}

.move .what {
  color: var(--ink-2);
}

.move .metric {
  margin-left: 5px;
  color: var(--muted);
}

.overview {
  display: grid;
  gap: 12px;
}

/* Grid items default to their content's width, and a drawn chart would then hold its grid open
   after the window narrows. */
main > *,
.overview > *,
.charts-area > *,
.charts > *,
.multiples > * {
  min-width: 0;
}

.changes-more {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.changes-more:hover {
  color: var(--ink);
}

/* Tables */

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 10px 0 10px 28px;
  text-align: right;
  white-space: nowrap;
  vertical-align: baseline;
}

th:first-child,
td:first-child {
  padding-left: 0;
  text-align: left;
}

thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  border-bottom: 1px solid var(--rule);
}

tbody tr + tr td {
  border-top: 1px solid var(--grid);
}

.change {
  display: inline-block;
  min-width: 6ch;
  color: var(--muted);
}

/* A change carries a sign and an arrow, so color is never its only cue. */
.change.worse {
  color: var(--worse-text);
}

.change.better {
  color: var(--better-text);
}

.icon {
  width: 0.85em;
  height: 0.85em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.05em;
}

.change .icon {
  margin-right: 3px;
  stroke-width: 2.2;
}

.run-head .step .icon {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}

.menu-button .chevron {
  width: 10px;
  height: 10px;
  color: var(--muted);
}

.sort-icon {
  margin-left: 4px;
}

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 2px;
}

/* Runs list */

.history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 32px;
}

.search {
  font: inherit;
  width: min(100%, 260px);
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
}

.search:focus {
  outline: 0;
  border-bottom-color: var(--accent);
}

.search::placeholder {
  color: var(--muted);
}

#history {
  margin-top: 20px;
}

.history-table {
  width: 100%;
}

.history-table td:first-child {
  white-space: normal;
  min-width: 280px;
  max-width: 520px;
  overflow-wrap: anywhere;
}

.history-table td .change {
  display: block;
  font-size: 12.5px;
}

.history-table tbody tr {
  cursor: pointer;
}

.history-table tbody tr:hover td {
  background: var(--hover);
}

.history-table tbody tr[aria-selected="true"] td {
  background: var(--hover);
}

.row-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 960px) {
  .row-meta {
    display: inline-block;
    margin: 0 0 0 10px;
    white-space: nowrap;
  }
}

/* A run's way back to the charts, quiet beside its author and date until pointed at. */
.show-run {
  margin-left: 10px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.show-run:hover {
  text-decoration: underline;
}

/* Pages below the overview: the way back, then what the page shows */

.page-head {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin-top: 24px;
}

.page-head .back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -3px;
  color: var(--muted);
  text-decoration: none;
}

.page-head .back:hover {
  color: var(--accent);
}

.page-head .back .icon {
  width: 12px;
  height: 12px;
}

.page-head h2 {
  font-size: 20px;
  letter-spacing: -0.015em;
}

.page-head h2:focus {
  outline: 0;
}

.page-title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.scope {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}

.scope-key {
  color: var(--muted);
  font-weight: 400;
}

.page-note {
  margin: 0;
  color: var(--muted);
}

main[data-page="runs"] #history {
  margin-top: 0;
}

/* A chart's own page gives it the column's full width and most of the window's height. */
main[data-page="chart"] .charts {
  grid-template-columns: 1fr;
}

main[data-page="chart"] .chart {
  height: clamp(280px, 58vh, 560px);
}

main[data-page="chart"] .multiples .chart {
  height: 260px;
}

.chart-link {
  text-decoration: none;
}

.chart-link:hover {
  text-decoration: underline;
}

a.wide-toggle {
  text-decoration: none;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  cursor: pointer;
}

.check input {
  margin: 0;
  accent-color: var(--accent);
}

.more,
.charts-more {
  justify-self: start;
  margin-top: 16px;
  color: var(--muted);
}

.more:hover {
  color: var(--ink);
}

.empty-row td {
  color: var(--muted);
}

.notes-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--ink-2);
}

.notes-list li + li {
  margin-top: 4px;
}

.problem {
  margin-top: 40px;
}

.problem p {
  margin: 6px 0 0;
  color: var(--ink-2);
}

@media (max-width: 720px) {
  .page {
    padding: 32px 16px 48px;
  }

  main {
    gap: 44px;
    margin-top: 32px;
  }

  .suites {
    margin-top: 24px;
  }

  .filters {
    gap: 10px 20px;
  }

  th,
  td {
    padding-left: 16px;
  }

  .readout-table col.num {
    width: 5.5em;
  }

  .run-facts {
    padding-left: 0;
  }

  .change-run {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The runs table stacks each run's changes under its commit. */
  .history-table thead {
    display: none;
  }

  .history-table tr,
  .history-table td {
    display: block;
  }

  .history-table td.moves-cell {
    padding: 0 0 12px;
    border-top: 0;
  }

  .history-table td:first-child {
    min-width: 0;
    padding-bottom: 6px;
  }

  .tally .word {
    display: none;
  }

  main {
    gap: 40px;
  }

  .change-run {
    grid-template-columns: 7ch minmax(0, 1fr);
    row-gap: 2px;
  }

  .change-run .subject {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .change-run .when,
  .change-run .moves {
    grid-column: 2;
    max-width: none;
  }

  .change-run .moves {
    flex-wrap: wrap;
  }

  .change-run,
  .run-bar {
    margin: 0 -8px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .run-bar::after {
    right: 8px;
    left: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    /* biome-ignore lint/complexity/noImportantStyles: a reduced-motion preference must win over every component's transition. */
    transition: none !important;
  }
}

/* Movers: a ranked table of every line, for suites too large to chart at once */

.layout {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.layout-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.charts.is-movers {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.movers-table {
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}

.movers-table col.spark {
  width: 140px;
}

.movers-table col.num {
  width: 8em;
}

.movers-table tbody tr {
  cursor: pointer;
}

.movers-table tbody tr:hover td {
  background: var(--hover);
}

.movers-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.movers-table .metric {
  margin-left: 6px;
  color: var(--muted);
}

.movers-table .shifts {
  color: var(--muted);
  font-size: 12px;
}

.sparkline {
  display: block;
  width: 120px;
  height: 24px;
  margin-left: auto;
  fill: none;
  stroke: var(--axis);
  stroke-width: 1.25;
  stroke-linejoin: round;
}

.sparkline.worse {
  stroke: var(--worse);
}

.sparkline.better {
  stroke: var(--better);
}

@media (max-width: 720px) {
  .movers-table col.spark,
  .movers-table td.spark-cell,
  .movers-table thead th:nth-child(2) {
    display: none;
  }

  .movers-table col.spark {
    width: 0;
  }

  .movers-table col.num {
    width: 5.5em;
  }

  .movers-table .shifts {
    display: none;
  }
}

/* A quiet notice pinned to the bottom of the window after an unexpected error. */
.failure {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 10px 30px var(--shadow);
  color: var(--ink-2);
  font-size: 13px;
}

.failure .disclosure {
  margin: 0;
  color: var(--accent);
}
