:root {
  --bg: #fff; --paper: #fff; --bg-2: #f4f4f5;
  --ink: #18181b; --ink-2: #3f3f46; --ink-3: #71717a;
  --rule: #e4e4e7; --rule-2: #f4f4f5;
  --accent: #4caf50; --accent-bg: #e8f5e9; --pos: #2d7a4f; --warn: #b45309;
  --nav-bg: #ffffffdb; --ink-black: #111111;
  --content: 680px; /* one content width for every block on the page */
  /* diagram colours: a muted red for the counter-example, the accent green for FrontierRSI */
  --bad: #b42318; --bad-bg: #fdf3f2; --bad-rule: #f1cdc9; --good-bg: #eef7ef; --good-rule: #b9dfbb;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
:root[data-theme="dark"] {
  --bg: #121312; --paper: #151713; --bg-2: #1b1f1b;
  --ink: #f4f4f5; --ink-2: #d4d4d8; --ink-3: #a1a1aa;
  --rule: #303530; --rule-2: #232823;
  --accent: #6bcf70; --accent-bg: #18351f; --pos: #8bdb91; --warn: #f59e0b;
  --nav-bg: #121312e0; --ink-black: #e4e4e7; color-scheme: dark;
  --bad: #f28b82; --bad-bg: #2a1a19; --bad-rule: #5a2f2b; --good-bg: #172419; --good-rule: #2f5a33;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121312; --paper: #151713; --bg-2: #1b1f1b;
    --ink: #f4f4f5; --ink-2: #d4d4d8; --ink-3: #a1a1aa;
    --rule: #303530; --rule-2: #232823;
    --accent: #6bcf70; --accent-bg: #18351f; --pos: #8bdb91; --warn: #f59e0b;
    --nav-bg: #121312e0; --ink-black: #e4e4e7; color-scheme: dark;
    --bad: #f28b82; --bad-bg: #2a1a19; --bad-rule: #5a2f2b; --good-bg: #172419; --good-rule: #2f5a33;
  }
}
* { box-sizing: border-box; }
/* Smooth light/dark switch: added by the theme toggle for half a second. */
@media (prefers-reduced-motion: no-preference) {
  html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, fill 0.4s ease, stroke 0.4s ease,
      filter 0.4s ease, opacity 0.4s ease !important;
  }
}
html, body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased;
  margin: 0; padding: 0; font-size: 15px; line-height: 1.55; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.container { max-width: calc(var(--content) + 48px); margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 11; background: var(--bg); }

/* nav */
nav.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--nav-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule); }
nav.top .container { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-size: 13px; font-weight: 600; text-decoration: none; letter-spacing: 0; display: inline-flex; align-items: center; gap: 7px; }
.brand-logo { width: 19px; height: 19px; flex: none; color: var(--ink); }   /* spiral mark, drawn by data-build/make_brand_logo.py */
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { font-size: 13px; font-weight: 600; text-decoration: none; }
.nav-links a:hover { color: var(--accent); }
.theme-btn { font-family: var(--mono); background: none; color: var(--ink-2); border: 1px solid var(--rule);
  width: 30px; height: 30px; cursor: pointer; font-size: 13px; }
.theme-btn:hover { border-color: var(--ink); color: var(--ink); }

/* hero */
.hero { border-bottom: 1px solid var(--rule); padding: 56px 0 40px; text-align: center; }
.hero h1 { font-size: 56px; font-weight: 700; line-height: 1.05; margin: 0 0 12px; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: center; gap: 0.22em; }
.hero-logo { width: 0.92em; height: 0.92em; flex: none; color: var(--ink); }
/* "by Abundant" lockup, as on swe-marathon.org; the logo image is black, so it is inverted in dark mode. */
.abundant-brand { width: fit-content; display: flex; align-items: center; justify-content: center; gap: 7px; height: 30px;
  margin: 0 auto 16px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-3); text-decoration: none; }
.abundant-brand-by { line-height: 1; }
.abundant-brand-lockup { display: flex; align-items: center; height: 30px; }
.abundant-brand-logo { display: block; width: auto; height: 20px; }
:root[data-theme="dark"] .abundant-brand-lockup { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .abundant-brand-lockup { filter: invert(1); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hero .tagline { font-size: 17px; color: var(--ink-2); margin: 0; text-wrap: balance; }
.stats-strip { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid;
  grid-template-columns: repeat(4, 1fr); margin: 28px 0 0; text-align: left; }
.stat { border-right: 1px solid var(--rule-2); padding: 14px 16px 13px 0; min-width: 0; }
.stat + .stat { padding-left: 16px; }
.stat:last-child { border-right: none; }
.stat-num { font-size: 24px; font-weight: 500; line-height: 1; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.stat-num .unit { color: var(--ink-3); margin-left: 4px; font-size: 12px; font-weight: 400; }
.stat-label { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* sections */
section { padding: 56px 0; border-bottom: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h2 { font-size: 31px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.eyebrow { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase; }
.note { font-size: 13px; color: var(--ink-3); margin: 16px 0 0; }
.badge { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--rule)); color: var(--pos); background: var(--accent-bg); }

/* pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-family: var(--mono); font-size: 12px; border: 1px solid var(--rule); color: var(--ink-2); background: none;
  padding: 5px 11px; cursor: pointer; }
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* leaderboard area filter: one line on desktop, spread across the full width */
#lb-pills .pill { font-size: 11px; padding: 5px 8px; white-space: nowrap; }
@media (min-width: 700px) { #lb-pills { flex-wrap: nowrap; justify-content: space-between; } #lb-pills .pill { flex: 1 1 auto; } }

/* leaderboard */
.lb-chart { border: 1px solid var(--rule); padding: 8px 22px 10px; }
.lb-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.1em; padding: 8px 0; }
.lb-row { margin: 0 -10px; padding: 7px 10px; }
.lb-row.top1 { background: var(--accent-bg); }
.lb-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.lb-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.lb-name { font-weight: 600; font-size: 14px; }
.lab-logo { display: inline-flex; width: 16px; height: 16px; flex: none; color: var(--ink); }
.lab-logo .logo { width: 16px; height: 16px; }
.best-model { display: inline-flex; align-items: center; gap: 5px; vertical-align: bottom; }
.best-model .lab-logo, .best-model .lab-logo .logo { width: 12px; height: 12px; }
.effort { font-family: var(--mono); font-size: 11px; color: var(--pos); }
.harness { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
/* Task results table: the agent always goes on its own line under the model name. */
.tlb-row .harness { flex-basis: 100%; }
.lb-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.track { height: 6px; background: var(--rule-2); }
.fill { height: 100%; }
.axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding-top: 8px; }

/* area matrix */
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--rule); padding: 9px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.matrix th { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix td.cell { position: relative; }
.matrix td.cell span { position: relative; }
.matrix td.lead { font-weight: 700; color: var(--pos); }
.heat { position: absolute; inset: 3px; background: var(--accent); }
.scroll-x { overflow-x: auto; }

/* features */
.features { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.feature { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 22px 24px; }
.feature h3 { font-size: 17px; margin: 0 0 8px; }
.feature p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* design principles: one subsection each */
.principle { padding: 22px 0; border-top: 1px solid var(--rule); }
.principle:last-child { border-bottom: 1px solid var(--rule); }
.principle:first-child { border-top: none; padding-top: 4px; }   /* no rule right under the section heading */
.principle h3 { font-size: 19px; margin: 0 0 8px; text-wrap: balance; }
.principle p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.principle p + p { margin-top: 10px; }
.principle p a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.principle p a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.diagram { margin: 16px 0 0; }
/* Diagrams (diagrams.js): two panels, 1px rules like the leaderboard, colour only on the markers. */
.dg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 680px; margin: 0 auto; }
/* 332px = a panel's width when the diagram is at its 680px maximum; panels never grow past that, even when stacked. */
.dg-panel { border: 1px solid var(--rule); background: var(--bg); min-width: 0; width: 100%; max-width: 332px; justify-self: center; }
.dg-title { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.dg-sq { width: 8px; height: 8px; flex: none; }
.dg-bad .dg-sq { background: var(--bad); }
.dg-good .dg-sq { background: var(--pos); }
.dg-good .dg-title { color: var(--ink); }
.dg svg { display: block; width: 100%; height: auto; }
.dg svg text { font-family: var(--sans); }
.dg-t { font-size: 13px; fill: var(--ink); }
.dg-label { font-family: var(--mono) !important; font-size: 10px; letter-spacing: 0.08em; fill: var(--ink-3); }
.dg-box { fill: var(--bg-2); stroke: var(--ink-3); stroke-width: 1; }
.dg-box-plain { fill: var(--bg); stroke: var(--ink-3); stroke-width: 1; }
.dg-node { fill: var(--bg); stroke: var(--ink-2); stroke-width: 1.25; }
.dg-group { fill: none; stroke: var(--ink-3); stroke-width: 1.25; stroke-dasharray: 6 4; }
.dg-group-label { font-family: var(--mono) !important; font-size: 11px; letter-spacing: 0.08em; fill: var(--ink-2); }
.dg-line { stroke: var(--ink-3); stroke-width: 1.25; fill: none; }
.dg-dash { stroke-dasharray: 3 4; }
.dg-head-ink { fill: var(--ink-3); }
.dg-head-good { fill: var(--pos); }
.dg-good-line { stroke: var(--pos); stroke-width: 1.25; stroke-dasharray: 4 4; fill: none; }
.dg-good-solid { stroke: var(--pos); stroke-width: 1.75; fill: none; }
.dg-good-label { font-family: var(--mono) !important; font-size: 11px; fill: var(--pos); }
.dg-opt { fill: var(--bg-2); stroke: var(--ink-3); stroke-width: 1; }   /* same grey as the other diagram boxes */
.dg-pick { fill: var(--accent-bg); stroke: var(--pos); stroke-width: 1.25; }
.dg-q { font-family: var(--mono) !important; font-size: 13px; fill: var(--ink-2); }
.dg-check { fill: none; stroke: var(--pos); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dg-dim { opacity: 0.4; }
.dg-x { fill: none; stroke: var(--bad); stroke-width: 2.25; stroke-linecap: round; }
@media (max-width: 620px) {
  /* Phones: one panel per row at the full screen width, and larger small labels, so diagram text stays readable. */
  .dg { grid-template-columns: 1fr; }
  .dg-panel { max-width: 360px; }   /* full width on phones, but never larger than this on narrow desktop windows */
  .dg-t { font-size: 14px; }
  .dg-label { font-size: 12px; }
  .dg-group-label { font-size: 12.5px; }
  .dg-good-label { font-size: 13px; }
  .dg-q { font-size: 14px; }
  .rc-tick { font-size: 13.5px; }
  .rc-label, .rc-note { font-size: 14.5px; }
}
/* Reward calibration chart (Scoring) */
.rc-fig { margin: 4px 0 18px; }
.rc-grid { stroke: var(--rule-2); stroke-width: 1; }
.rc-axis { stroke: var(--ink-3); stroke-width: 1.25; }
.rc-guide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 4; }
.rc-tick { font-family: var(--mono) !important; font-size: 12px; fill: var(--ink-3); }
.rc-label { font-size: 13px; fill: var(--ink-2); }
.rc-note { font-size: 13px; fill: var(--ink); }
.rc-line { fill: none; stroke: var(--pos); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.rc-dot { fill: var(--pos); stroke: var(--bg); stroke-width: 2; }

/* task instruction summary (task pages) */
.ts { display: grid; grid-template-columns: 110px minmax(0, 1fr); margin: 0; border-top: 1px solid var(--rule); }
.ts dt, .ts dd { padding: 12px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.ts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding-top: 15px; }
.ts dd { color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.ts ul { margin: 0; padding-left: 18px; }
.ts li + li { margin-top: 4px; }
.ts code { font-family: var(--mono); font-size: 13px; background: var(--bg-2, rgba(127,127,127,0.12)); padding: 1px 4px; overflow-wrap: anywhere; }
@media (max-width: 620px) { .ts { grid-template-columns: 1fr; } .ts dt { border-bottom: none; padding-bottom: 0; } .ts dd { padding-top: 4px; } }

/* score vs cost (Pareto frontier) */
.pf-host { max-width: 680px; margin: 0 auto; }
.pf-wrap { border: 1px solid var(--rule); padding: 6px 10px 2px; }
.pf { display: block; width: 100%; height: auto; }
.pf text { font-family: var(--sans); }
.pf-grid { stroke: var(--rule-2); stroke-width: 1; }
.pf-axis { stroke: var(--ink-3); stroke-width: 1; }
.pf-tick { font-family: var(--mono) !important; font-size: 10.5px; fill: var(--ink-3); }
.pf-label { font-size: 11px; fill: var(--ink-3); }
.pf-front { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-dasharray: 5 4; }
.pf-dot { stroke: var(--bg); stroke-width: 2; }
.pf-dot.on { stroke: var(--bg); stroke-width: 2; }
.pf-name { font-size: 12px; fill: var(--ink-2); }
.pf-name.on { fill: var(--ink); font-weight: 600; }

/* raw results strip chart (task pages) */
.sc-sum { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.sc-sum b { color: var(--ink); }
.sc-wrap { overflow-x: auto; border: 1px solid var(--rule); padding: 6px 10px 2px; }
.sc { display: block; width: 100%; height: auto; }
.sc-narrow .sc-mlbl { font-size: 11px; }
.sc text { font-family: var(--sans); }
.sc-band { fill: var(--accent-bg); }
.sc-bandlbl { fill: var(--pos); font-family: var(--mono) !important; font-size: 10px; letter-spacing: 0.06em; }
.sc-grid { stroke: var(--rule-2); stroke-width: 1; }
.sc-axis { stroke: var(--ink-3); stroke-width: 1; }
.sc-row { stroke: var(--rule-2); stroke-width: 1; }
.sc-tick { fill: var(--ink-3); font-family: var(--mono) !important; font-size: 10.5px; }
.sc-axlbl { fill: var(--ink-3); font-size: 11px; }
.sc-axlbl.strong { fill: var(--ink); font-weight: 600; }
.sc-mlbl { fill: var(--ink); font-size: 12px; }
.sc-dot { stroke: var(--bg); stroke-width: 1.5; }
.sc-dot.zero { fill: var(--bg); stroke-width: 2; }
.sc-dot:hover { stroke: var(--ink); }
.sc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin: 8px 0 0; }
.sc-legend .k { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 10px; }
.sc-legend .k:first-child { margin-left: 0; }
.sc-legend .k.pos { background: var(--ink-3); }
.sc-legend .k.zero { border: 2px solid var(--ink-3); }
.sc-legend .k.band { background: var(--accent-bg); border-radius: 0; width: 16px; }


/* tasks: one subsection each, grouped by area */
.task-item { display: block; padding: 18px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.task-item:last-child { border-bottom: 1px solid var(--rule); }
.task-item h3 { font-size: 18px; margin: 0 0 6px; text-wrap: balance; }
.task-item h3 .chev { color: var(--ink-3); font-weight: 400; }
.task-item h3 a { color: inherit; text-decoration: none; }
.task-item h3 a:hover, .task-item h3 a:focus-visible { color: var(--accent); }
.task-item .sc-compact { margin-top: 12px; }
.task-item p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.task-meta b { color: var(--ink); }

/* tasks (old grid) */
.family { margin-bottom: 44px; }
.family-head { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3);
  display: flex; flex-wrap: wrap; column-gap: 10px; align-items: baseline; margin-bottom: 6px; }
.family-head .n { white-space: nowrap; }
.family-head b { color: var(--ink); font-family: var(--sans); font-size: 26px; font-weight: 700; letter-spacing: -0.01em;
  text-transform: none; }
.family-blurb { font-size: 14px; color: var(--ink-3); margin: 0 0 14px; }
.tasks-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.task { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 20px 22px; text-decoration: none;
  display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.task:hover { background: var(--bg-2); }
.task-title { display: flex; justify-content: space-between; gap: 10px; font-size: 17px; font-weight: 700; line-height: 1.25; }
.task-title .chev { color: var(--ink-3); font-weight: 400; }
.task-desc { font-size: 13px; color: var(--ink-2); flex: 1; }
.task-stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); }
.task-stats div { padding: 7px 9px; }
.task-stats div + div { border-left: 1px solid var(--rule); }
.k { font-family: var(--mono); font-size: 9px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }
.v { font-family: var(--mono); font-size: 12px; font-weight: 700; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* method */
.method p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.formula { border: 1px solid var(--rule); background: var(--bg-2); padding: 14px 18px; margin: 0 0 14px;
  display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 10px 24px; }
/* Each row: a small label, then the formula, typeset with a stacked fraction (never broken across lines). */
.formula .fr { display: contents; }
.formula .fl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.formula .fx { display: inline-flex; align-items: center; white-space: nowrap; font-size: 16px; color: var(--ink); }
.formula i { font-style: italic; }
.formula .par { font-size: 2.1em; font-weight: 300; line-height: 1; margin: -0.1em 0.04em 0; color: var(--ink-2); }
.formula .sep { margin: 0 0.35em 0 0.1em; }
.formula .eq { margin: 0 0.4em; }
.formula .frac { display: inline-flex; flex-direction: column; align-items: center; font-size: 0.94em; line-height: 1.35; }
.formula .frac > span { padding: 0 0.3em; }
.formula .frac > span:first-child { border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.formula .frac > span:last-child { padding-top: 2px; }
@media (max-width: 620px) {
  .formula { grid-template-columns: 1fr; gap: 2px; padding: 12px 14px; }
  .formula .fl { margin-top: 14px; }
  .formula .fl:first-child { margin-top: 0; }
  .formula .fx { font-size: 15px; }
}

/* task page */
.back { font-family: var(--mono); font-size: 12px; text-decoration: none; color: var(--ink-3); }
.back:hover { color: var(--ink); }
.task-hero { padding: 44px 0 30px; border-bottom: 1px solid var(--rule); }
.task-hero h1 { font-size: 44px; line-height: 1.1; margin: 14px 0 12px; overflow-wrap: anywhere; }
h1, h2, .task-title, .lb-name { overflow-wrap: anywhere; }
.task-hero .lead { font-size: 16px; color: var(--ink-2); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { font-family: var(--mono); font-size: 11px; border: 1px solid var(--rule); padding: 6px 9px; color: var(--ink-2); }
.chip b { color: var(--ink); }
.tlb { border: 1px solid var(--rule); }
.tlb-row { display: grid; grid-template-columns: 32px minmax(180px, 1.4fr) minmax(0, 1.6fr) 140px; align-items: center; gap: 14px;
  padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.tlb-row:last-child { border-bottom: none; }
.tlb-row.head { font-family: var(--mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.tlb-row.best { background: var(--accent-bg); }
.rank { width: 22px; height: 22px; display: inline-grid; place-items: center; font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--rule); color: var(--ink-2); }
.rank.r1 { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.trials { display: flex; gap: 8px; flex-wrap: wrap; }
.trial { font-family: var(--mono); font-size: 11px; border: 1px solid var(--rule); padding: 4px 7px; white-space: nowrap; }
.trial b { color: var(--ink); }
.trial .raw { color: var(--ink-3); }
.trial.zero b { color: var(--ink-3); }
.trial.fail { border-style: dashed; color: var(--ink-3); }
.avg { display: flex; align-items: center; gap: 10px; }
.avg .track { flex: 1; }
.avg .num { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }

footer { padding: 40px 0 60px; color: var(--ink-3); font-size: 13px; }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .tasks-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .container { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .hero h1 { font-size: 40px; }
  .task-hero h1 { font-size: 32px; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(3) { padding-left: 0; border-top: 1px solid var(--rule-2); }
  .stat:nth-child(4) { border-top: 1px solid var(--rule-2); }
  .tasks-grid, .features { grid-template-columns: 1fr; }
  .nav-links a.hide-sm { display: none; }
  .tlb-row { grid-template-columns: 26px minmax(0, 1fr) 92px; row-gap: 8px; }
  .tlb-row > :nth-child(3) { grid-column: 2 / 4; grid-row: 2; }
  .tlb-row > :nth-child(4) { grid-column: 3; grid-row: 1; }
  .tlb-row.head > :nth-child(3) { display: none; }
  .lb-row .harness { display: none; }
  .matrix td:first-child { white-space: nowrap; }
  .nav-links { gap: 12px; }
}
/* Narrow phones: five items plus the theme button must fit without sideways scrolling. */
@media (max-width: 430px) {
  .nav-links { gap: 8px; }
  .nav-links a { font-size: 12.5px; }
  nav.top .container { gap: 8px; }
}
@media (max-width: 400px) {
  .nav-links { gap: 4px; }
  .nav-links a, .brand { font-size: 12px; }
  .brand { gap: 4px; }
  .brand-logo { width: 15px; height: 15px; }
}

