/* The challenge site's one style sheet, written by `cb feed` (crates/cb/src/pages.rs).
   A website with light technical accents: cards and a sticky header, monospace for numbers
   and code, a low-poly mesh, a shield and a terminal that types. Green is a good result,
   amber the bar and the crown; outcome colours always sit beside a glyph and a word.
   One typeface, served from the site itself: Instrument Sans (SIL OFL 1.1). The accent is
   set per site by assets/accent.css, linked after this sheet. */
@font-face {
  font-family: "Instrument Sans";
  src: url("instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
:root {
  --bg: #F7F7F5; --card: #FFFFFF; --ink: #161A24; --dim: #5C6375; --faint: #9AA0AD;
  --line: #E6E6E1; --soft: #F1F0EC; --accent: #0F6B7A;
  --good: #087A55; --red: #C0392B; --bar: #9A5C00;
  --d0: #0072B2; --d1: #C25400; --d2: #00896B; --d3: #B5479B;
  --d4: #8F6C00; --d5: #6A51C8; --d6: #8C564B; --d7: #4D6B7C;
  --t-1: 0.8125rem; --t0: 1rem; --t1: 1.25rem; --t2: 1.5625rem;
  --t3: 1.953rem; --t4: 2.875rem;
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s5: 3rem; --s6: 4rem;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0E1016; --card: #161922; --ink: #E8EAF0; --dim: #9BA2B3; --faint: #5D6474;
    --line: #252A36; --soft: #1C2029; --accent: #5CC3D1;
    --good: #4FD6A0; --red: #F0857A; --bar: #E8B45A;
    --d0: #56B4E9; --d1: #FF9F5A; --d2: #3DDBA6; --d3: #F08FC7;
    --d4: #F0C33C; --d5: #A99BFF; --d6: #D6A08F; --d7: #9FB6C4;
    color-scheme: dark;
  }
}
/* Dark is for screens: a page prints light */
@media screen {
:root[data-theme=dark] {
    --bg: #0E1016; --card: #161922; --ink: #E8EAF0; --dim: #9BA2B3; --faint: #5D6474;
    --line: #252A36; --soft: #1C2029; --accent: #5CC3D1;
    --good: #4FD6A0; --red: #F0857A; --bar: #E8B45A;
    --d0: #56B4E9; --d1: #FF9F5A; --d2: #3DDBA6; --d3: #F08FC7;
    --d4: #F0C33C; --d5: #A99BFF; --d6: #D6A08F; --d7: #9FB6C4;
    color-scheme: dark;
}
}
:root { --good-soft: color-mix(in srgb, var(--good) 14%, var(--card)); }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; -webkit-user-select: none; user-select: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--t0)/1.6 var(--sans); font-stretch: 100%; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 650; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: var(--t4); line-height: 1.08; letter-spacing: -.03em; overflow-wrap: anywhere; }
h2 { font-size: var(--t2); letter-spacing: -.01em; margin-bottom: var(--s2); }
h3 { font-size: var(--t1); margin: var(--s3) 0 var(--s1); }
h4 { font-size: var(--t0); font-weight: 650; margin: var(--s3) 0 var(--s1); }
p, ul, ol, dl, pre, table, details { margin: 0 0 var(--s2); }
p, li, dd, caption { max-width: 68ch; }
ul, ol { padding-left: var(--s3); }
li + li { margin-top: .25rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .18em; }
main a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }
/* A link to an id lands below the sticky header */
[id] { scroll-margin-top: 5rem; }
bdi, td, tbody th { overflow-wrap: anywhere; }
pre, code, kbd { font-family: var(--mono); font-size: .875em; }
code { background: var(--soft); padding: 1px 5px; border-radius: 4px; }
pre {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: var(--s1) var(--s2); overflow-x: auto; line-height: 1.5; tab-size: 4;
}
pre code { font-size: 1em; background: none; padding: 0; }
.num, .ctx-qty, .stat dd {
  font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
time { font-variant-numeric: tabular-nums; }
.empty, .enter-note, .chart-note, .block-note,
.threat-link, .research-state, .research-nojs, .sub { color: var(--dim); }
.chart-note, .sub, .block-note { font-size: var(--t-1); }

/* Controls (the copy and theme buttons) */
button, select, input { font: inherit; font-size: var(--t-1); color: var(--ink); }
button {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: .3rem .75rem; cursor: pointer; font-weight: 600;
}
button:hover { border-color: var(--accent); }
select, input {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .5rem;
  max-width: 100%;
}
label { font-size: var(--t-1); color: var(--dim); }
.copy { margin: calc(-1 * var(--s1)) 0 var(--s2); }
#open-prs ul { padding-left: var(--s3); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-weight: 400; font-size: inherit; }
.button {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--card);
  padding: 10px 18px; border-radius: 9px; font: 600 15px var(--sans); white-space: nowrap;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button.small { padding: 7px 14px; font-size: 14px; }

/* Shell: a sticky header, the page, the footer, centred */
.skip { position: absolute; left: var(--s2); top: -4rem; background: var(--card); padding: var(--s1) var(--s2); z-index: 30; }
.skip:focus { top: var(--s1); }
main, .site-footer { max-width: 1168px; margin-inline: auto; padding-inline: 24px; }
.site-header {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px 28px;
  min-height: 64px; padding: 8px max(24px, calc((100% - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
/* The wordmark as the brand: two or three lines of block art, small enough for the bar */
.brandart { display: block; font: 7px/1 var(--mono); white-space: pre; letter-spacing: 0; color: var(--ink); }
.brand-art:hover .brandart { color: var(--accent); }
.top { display: flex; align-items: center; gap: 22px; flex: 1; font-size: 15px; }
.top > a, .menu > summary { color: var(--dim); }
.top > a:hover, .menu > summary:hover { color: var(--ink); text-decoration: none; }
.site-header button { width: auto; height: 34px; color: var(--dim); font-weight: 500; }
/* The theme button: one icon, the mode it is in (system until the script says) */
.site-header button.theme { width: 34px; padding: 0; display: inline-grid; place-items: center; }
.theme .ti { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: none; }
.theme:not([data-theme=light]):not([data-theme=dark]) .ti-system, .theme[data-theme=light] .ti-light, .theme[data-theme=dark] .ti-dark { display: block; }

/* The Challenges menu: <details>, so it opens with keyboard and touch and no script */
.menu { position: relative; margin: 0; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { color: var(--ink); font-weight: 600; }
.chev { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.menu[open] .chev { transform: rotate(180deg); }
.menupanel { display: none; }
details.menu[open] .menupanel {
  display: block; position: absolute; top: calc(100% + 14px); left: -16px; z-index: 20; width: 380px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
}
.mi { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
a.mi:hover { background: var(--soft); text-decoration: none; }
.mi b { display: block; font-weight: 600; font-size: 14.5px; }
.mi small { display: block; color: var(--dim); font-size: 13px; line-height: 1.4; }
.mi .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-top: 7px; outline: 3px solid var(--good-soft); }
.mi.soon { color: var(--dim); }
.soon .dot { background: var(--faint); outline: 0; }
.mval { font: 13px var(--mono); color: var(--good); padding-top: 2px; white-space: nowrap; }
.mgroup { margin: 8px 10px 2px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.menupanel .all { display: block; border-top: 1px solid var(--line); margin-top: 6px; padding: 11px 10px 6px; font-size: 14px; }

main { padding-block: var(--s5) var(--s6); }
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s2) var(--s4);
  border-top: 1px solid var(--line); padding-block: var(--s3) var(--s5); font-size: 14px; color: var(--dim);
}
.site-footer p { margin: 0; }
.foottitle { margin: 0; font-weight: 700; color: var(--ink); }
.footart { font: 11px/1.1 var(--mono); color: var(--faint); margin: 0; padding: 0; background: none; border: 0; border-radius: 0; overflow: hidden; }
main > section { border-top: 1px solid var(--line); margin-top: var(--s5); padding-top: var(--s4); }
.hero h1 + p { margin-top: var(--s2); }
main > h1 + p, .summary, .intro { font-size: 19px; color: var(--dim); margin-top: var(--s2); }
main > section#verdict { border-top: 0; padding-top: 0; margin-top: var(--s4); }

/* Art: a mesh's facets fade from the top; the shield; a terminal that types */
.f0 { fill: var(--accent); fill-opacity: .3; }
.f1 { fill: var(--accent); fill-opacity: .25; }
.f2 { fill: var(--accent); fill-opacity: .2; }
.f3 { fill: var(--accent); fill-opacity: .15; }
.f4 { fill: var(--accent); fill-opacity: .1; }
.f5 { fill: var(--accent); fill-opacity: .06; }
.shield { display: block; width: 230px; max-width: 100%; height: auto; filter: drop-shadow(0 18px 40px color-mix(in srgb, var(--accent) 35%, transparent)); }
.shield polygon { stroke: color-mix(in srgb, var(--card) 40%, transparent); stroke-width: .6; fill-opacity: .92; }
.shield .f1, .shield .f3, .shield .f5 { fill-opacity: .72; }
.rim { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.shieldtext { fill: #FFF; fill-opacity: .85; font: 700 64px var(--mono); }
.term { margin: 0; width: 100%; max-width: 440px; background: #10131B; border: 1px solid #262B38; border-radius: 12px; overflow: hidden; text-align: left; }
.term .bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #161A24; border-bottom: 1px solid #262B38; font: 12px var(--mono); color: #7C8496; }
.term .bar i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.term .bar i + i { background: #FEBC2E; }
.term .bar i + i + i { background: #28C840; }
.term .bar span { margin-left: 8px; }
.term pre { margin: 0; padding: 14px 16px; border: 0; border-radius: 0; background: none; font: 12.5px/1.65 var(--mono); color: #D7DBE5; white-space: pre; }
.term .ln { opacity: 0; animation: ln .01s forwards; }
/* Scoped like .term .ln, so its animation shorthand does not reset the delay */
.term .ln1 { animation-delay: .35s; } .term .ln2 { animation-delay: .7s; } .term .ln3 { animation-delay: 1.05s; } .term .ln4 { animation-delay: 1.4s; }
.term .ln5 { animation-delay: 1.75s; } .term .ln6 { animation-delay: 2.1s; } .term .ln7 { animation-delay: 2.45s; } .term .ln8 { animation-delay: 2.8s; }
@keyframes ln { to { opacity: 1; } }
/* The cursor follows the last line, and blinks only once that line is shown */
.cursor { display: inline-block; width: 7px; height: 14px; background: #6FE3B4; vertical-align: -2px; opacity: 0; animation: blink 1s steps(1) infinite; }
.ln1 + .cursor { animation-delay: .7s; } .ln2 + .cursor { animation-delay: 1.05s; } .ln3 + .cursor { animation-delay: 1.4s; } .ln4 + .cursor { animation-delay: 1.75s; }
.ln5 + .cursor { animation-delay: 2.1s; } .ln6 + .cursor { animation-delay: 2.45s; } .ln7 + .cursor { animation-delay: 2.8s; } .ln8 + .cursor { animation-delay: 3.15s; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0; } }

/* Outcomes: the glyph carries the colour, the word stays ink */
.out { white-space: nowrap; }
.out > span, .outcome { font-weight: 650; }
.outcome::before { content: "\25A0\A0"; content: "\25A0\A0" / ""; }
.out-good > span, .o-good::before { color: var(--good); }
.out-bad > span, .o-bad::before { color: var(--red); }
.out-wait > span, .out-warn > span, .o-warn::before, .o-claim::before { color: var(--bar); }
.out-plain > span, .o-base::before { color: var(--dim); }
.out-base > span { color: var(--ink); }

/* Hub */
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: var(--s1); }
.steps > li { counter-increment: step; position: relative; padding-left: 2rem; margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -.1em; font-weight: 650; font-stretch: 75%;
  font-variant-numeric: tabular-nums; color: var(--accent); font-size: var(--t1); line-height: 1.25;
}
.step-head { font-weight: 650; }
.step-body { display: block; color: var(--dim); }
main > .hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s3) 44px; align-items: center;
  border-top: 0; margin-top: 0; padding-top: var(--s3); overflow-x: clip;
}
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--s3); }
main .button { text-decoration: none; }
.button.outline { background: none; color: var(--ink); border: 1px solid var(--line); }
.art { position: relative; z-index: 0; display: grid; justify-items: center; }
.bgmesh {
  position: absolute; z-index: -1; inset: -40px -24px; width: calc(100% + 48px); height: calc(100% + 80px); pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 45%, transparent); mask-image: radial-gradient(closest-side, #000 45%, transparent);
}
.bgmesh polygon { fill: none; stroke: var(--line); }
.bgmesh circle { fill: var(--good); }
.art .term { margin-top: -46px; position: relative; }
.term .ok { color: #6FE3B4; } .term .acc { color: #C4B5FF; }
.strip { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s2); margin: var(--s5) 0 0; }
.strip li { margin: 0; color: var(--dim); font-size: 14px; }
.strip .n { font: 600 12px var(--mono); color: var(--faint); }
.strip b { display: block; margin: 4px 0 2px; color: var(--ink); font-size: 16px; }
.strip .last b { color: var(--bar); }
.head { display: flex; align-items: baseline; gap: var(--s2); margin-bottom: var(--s2); }
.head h2 { margin: 0; }
.right { margin-left: auto; font-size: 14px; }
main a.name { color: var(--ink); text-decoration: none; }
.name { font-weight: 600; }
.mini, .crown { display: block; margin-top: 2px; font: 400 13px var(--sans); color: var(--dim); white-space: normal; }
.crown { font-weight: 600; color: var(--bar); }
.now { color: var(--good); }
tr.soon td, tr.soon .name { color: var(--dim); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 20px; font: 600 12px var(--sans); background: var(--soft); color: var(--dim); white-space: nowrap; justify-self: start; }
.pill.open { background: var(--good-soft); color: var(--good); }
.pill.rec { background: color-mix(in srgb, var(--bar) 14%, var(--card)); color: var(--bar); }
.pill.claim { background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--accent); }
main > #new { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: var(--s3) var(--s4); }
/* People: the crown in the hero, the invitation under the standings */
.asciiart {
  font: 20px/1.2 var(--mono); color: var(--bar); white-space: pre; margin: 0; text-align: left;
  background: none; border: 0; padding: 0; overflow: visible;
  text-shadow: 0 0 18px color-mix(in srgb, var(--bar) 40%, transparent);
}
.invite { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: var(--s3) var(--s4); margin-top: var(--s3); }
@media (max-width: 880px) {
  main > .hero { grid-template-columns: minmax(0, 1fr); }
  .about { grid-template-columns: minmax(0, 1fr); }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tables */
table { border-collapse: collapse; width: 100%; font-size: var(--t-1); }
caption { text-align: left; caption-side: top; color: var(--dim); padding-bottom: var(--s1); }
th, td { text-align: left; vertical-align: top; padding: .45rem var(--s2) .45rem 0; border-bottom: 1px solid var(--line); }
thead th { font-weight: 600; color: var(--dim); white-space: nowrap; }
tbody th { font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; font-size: var(--t0); }
td:last-child, th:last-child { padding-right: 0; }
td { min-width: 4.5em; }
td time { white-space: nowrap; }
.table-wrap { overflow-x: auto; position: relative; margin-bottom: var(--s2); }
.table-wrap table { margin: 0; }

/* Challenge page: the hero, where it stands, room left in a transaction, records */
.crumb { font-size: 14px; color: var(--dim); margin-top: 0; }
/* A page with a breadcrumb starts close under the header: the crumb is the gap */
main:has(.crumb) { padding-top: var(--s3); }
main > .hero:has(.crumb) { padding-top: 0; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.params { font: 13px var(--mono); color: var(--dim); }
.diagram .term { margin-top: 0; }
.diagmesh {
  position: absolute; z-index: -1; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent); mask-image: radial-gradient(closest-side, #000 40%, transparent);
}
.diagcap { max-width: 440px; margin: var(--s2) 0 0; font-size: var(--t-1); color: var(--dim); }
.lead { font-size: var(--t1); }
.stat .v { color: var(--ink); }
.stat .v-holder { color: var(--bar); font-weight: 600; font-family: var(--sans); overflow-wrap: anywhere; }
.stat .v-take { color: var(--bar); }
.stat .s { font: 400 var(--t-1)/1.4 var(--sans); color: var(--dim); }
.note, .was { color: var(--dim); }
.budget { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.budget li { margin: 0; }
.budget p { margin: 0 0 6px; }
.budget-bar { display: block; width: 100%; height: 12px; }
.b-lim { fill: var(--soft); }
.b-was, .key-was { fill: color-mix(in srgb, var(--good) 30%, var(--soft)); background: color-mix(in srgb, var(--good) 30%, var(--soft)); }
.b-now, .key-now { fill: var(--good); background: var(--good); }
.key-lim { background: var(--soft); border: 1px solid var(--line); }
details.more > summary { cursor: pointer; color: var(--accent); margin: var(--s1) 0 var(--s2); }

/* The hero's board (how many times cheaper, the holder, the bar) and its chart */
.board { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: var(--s3) var(--s4); align-self: center; display: flex; flex-direction: column; justify-content: center; }
.big { margin: 0; line-height: 1; }
.big-n { font: 700 clamp(3.25rem, 8vw, 5.25rem)/1 var(--sans); font-stretch: 85%; letter-spacing: -.02em; color: var(--good); font-variant-numeric: tabular-nums; }
.big-u { font: 650 var(--t2) var(--sans); color: var(--ink); white-space: nowrap; }
.big-label { display: block; margin-top: var(--s1); font: 400 var(--t0) var(--sans); color: var(--dim); }
.big-sub { margin: var(--s1) 0 0; font: 15px var(--mono); color: var(--dim); }
.board .stats { margin: var(--s3) 0 0; gap: var(--s2) var(--s4); }
.board .stat dd:not(.s) { font-size: var(--t1); }
.board .note { font-size: var(--t-1); margin: var(--s2) 0 0; }
.board-count { margin: var(--s2) 0 0; font-size: var(--t-1); color: var(--faint); }
.hero-chart { grid-column: 1 / -1; min-width: 0; }
.hero-chart { margin-top: var(--s2); }
.hero-chart .chart-wide { max-width: none; font-size: 10px; }
/* Avatars: GitHub's, by login, round */
img.av { width: 24px; height: 24px; border-radius: 50%; vertical-align: -6px; margin-right: 7px; background: var(--soft); border: 1px solid var(--line); }
.v-holder img.av { width: 28px; height: 28px; vertical-align: -6px; }
.who { display: inline-block; }
.chart .av-img { clip-path: circle(50%); }
.chart .av-ring { fill: var(--card); stroke: var(--good); stroke-width: 2; }
.chart .av-try { stroke: var(--dim); stroke-width: 1.5; }
/* About: the links, then the diagram */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3) 44px; align-items: start; }
.about h3 { margin-top: 0; }
.links { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.links li { margin: 0; }
.links a { font-weight: 600; }
/* A submission's page: its words and its patch */
.sub-title { overflow-wrap: anywhere; }
.sub-who { font-size: var(--t1); }
.sub-who a { color: var(--ink); }
.patch-msg { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.6 var(--mono); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: var(--s2); }
.patch .diff-body { font-size: 12.5px; }
.patch div.dl { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }

/* The record chart (two sizes, swapped at 720 px) */
.chart { display: block; width: 100%; height: auto; color: var(--dim); font-family: inherit; overflow: visible; }
.chart-wide { max-width: 45rem; font-size: 13px; }
.chart-narrow { display: none; font-size: 12px; }
.chart text { fill: var(--dim); stroke: none; }
.chart .axis, .chart .axis-ada, .chart .better { font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); }
.area { fill: color-mix(in srgb, var(--good) 12%, transparent); }
.rec-line { fill: none; stroke: var(--good); stroke-width: 2.5; stroke-linejoin: round; }
.bar-line { stroke: var(--bar); stroke-dasharray: 5 5; }
.chart .bar-line text { fill: var(--bar); font-weight: 650; }
.goal-line { stroke: var(--dim); stroke-dasharray: 2 4; }
.chart .goal-line text { fill: var(--dim); stroke: none; }
.chart .rec-label { fill: var(--ink); }
.chart .rec-now { fill: var(--good); font-weight: 650; }
.pts .pt-rec { fill: var(--good); }
.pts .pt-base { fill: var(--ink); }
.pts .pt-try { fill: none; stroke: var(--dim); stroke-width: 1.5; }
.pts .pt-claim { stroke-dasharray: 2 1.7; }
.fails { stroke: var(--red); stroke-width: 2; }
.chart-note { margin-top: var(--s1); }

/* Enter */
/* A long line wraps; its continuation hangs 2ch in, so a new line is told from a wrapped one */
pre.code, #agent-prompt { white-space: pre-wrap; overflow-wrap: anywhere; text-indent: 2ch hanging each-line; }
#agent-prompt { max-height: 22rem; overflow: auto; }
pre.code { background: #0D0F14; color: #D7DBE4; border-color: #262B38; padding: var(--s2); }
details.byhand { border: 1px solid var(--line); border-radius: 10px; padding: var(--s1) var(--s2); background: var(--card); }
details.byhand > summary { cursor: pointer; font-weight: 600; }
details.byhand[open] > summary { margin-bottom: var(--s2); }
details.byhand > :last-child { margin-bottom: 0; }
.rules li::marker { color: var(--good); }
.enter-links { margin-top: var(--s3); }

/* Bring your agent (join/index.html) */
.joinpick h2 { font-size: var(--t1); }
.joinlist { list-style: none; padding: 0; display: grid; gap: 6px; }
.joinlist li { margin: 0; }
.joinlist a, .joinlist li.soon {
  display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
.joinlist a { color: var(--ink); text-decoration: none; }
.joinlist a:hover { border-color: var(--accent); }
.joinlist li.soon .name { color: var(--faint); }
.joinlist .sub { margin-top: 0; }
.joincards { display: grid; gap: var(--s3); margin-top: var(--s4); }
.joincard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: var(--s3); }
.joincard > :last-child { margin-bottom: 0; }
.joinreads { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s3); }
.joinreads li { margin: 0; }
.joinreads p { color: var(--dim); margin: 4px 0 0; }
.agent-line code { overflow-wrap: anywhere; }
.facts, .limits {
  display: grid; grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr); gap: .35rem var(--s3);
}
.facts > div { display: contents; }
dt { color: var(--dim); }
dd { margin: 0; }

/* How it works: a sticky contents list beside the text, two groups */
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s4) 40px; align-items: start; margin-top: var(--s5); }
.toc { position: sticky; top: 88px; font-size: 14px; }
.toc ul { list-style: none; padding: 0; margin: 0 0 var(--s2); }
.toc li + li { margin-top: 0; }
main .toc a { display: block; padding: 4px 12px; border-radius: 6px; color: var(--dim); text-decoration: none; }
main .toc a:hover { background: var(--soft); color: var(--ink); }
.tocgroup { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; margin: 0; padding-top: var(--s2); }
.tocgroup:first-child { padding-top: 0; }
main .tocgroup > a { color: var(--dim); }
.prose { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: var(--s4); min-width: 0; }
.prose h2.group { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 52px 0 18px; padding-top: 26px; border-top: 1px solid var(--line); }
.prose h2.group.first { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h2.group + h3 { margin-top: 0; }
.formula { font: 14px/1.6 var(--mono); background: var(--soft); border-radius: 8px; padding: 10px 14px; max-width: none; overflow-x: auto; }
.flow { font-size: 13px; white-space: pre; }
.checks td.num { width: 5rem; }
.flow-crown { color: var(--bar); font-weight: 650; }
.flow-no { color: var(--red); }
.flow-ok { color: var(--good); }
.flow-aside { color: var(--dim); }
@media (max-width: 880px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
}

/* Context (the research page) */
.ctx-lead { font-size: var(--t1); }
.ctx-flow { padding-left: var(--s3); }
.ctx-here { font-weight: 600; }
.ctx-step { font-weight: 600; }
.ctx-detail { display: block; font-weight: 400; color: var(--dim); font-size: var(--t-1); margin: 0; }
.ctx-source { display: block; color: var(--dim); font-size: var(--t-1); overflow-wrap: anywhere; margin: 0; }
.ctx-levers, .ctx-list, .data-links, .research-axes { padding-left: var(--s3); }
.ctx-sources { font-size: var(--t-1); }

/* A diff (research.js's diff dialog) */
.diff-files { list-style: none; padding: 0; font-size: var(--t-1); }
.diff-files li { margin: .15rem 0; }
.diff-stat { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--dim); }
.diff-name { overflow-wrap: anywhere; font-weight: 600; }
.diff-file { border-top: 1px solid var(--line); margin: 0 0 var(--s3); }
.diff-file > summary {
  position: sticky; top: 0; z-index: 1; background: var(--bg); cursor: pointer;
  display: flex; flex-wrap: wrap; gap: 0 var(--s2); align-items: baseline;
  padding: var(--s1) 0; font-size: var(--t-1); overflow-wrap: anywhere;
}
.diff-file > summary::marker { color: var(--dim); }
:where(.dl) { border-left: 3px solid transparent; }
.dl-add { box-shadow: none; border-left: 3px solid var(--good); background: color-mix(in srgb, var(--good) 8%, transparent); }
.dl-del { box-shadow: none; border-left: 3px solid var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.dl-hunk, .dl-meta { color: var(--dim); }

/* Research page (the map, tree and panel are drawn by research.js) */
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s2); }
.panel { border-top: 1px solid var(--line); margin-top: var(--s5); padding-top: var(--s4); }
.stats { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: var(--s3) 0; }
.stat dt { font-size: var(--t-1); }
.stat dd { font-size: var(--t3); line-height: 1.1; }
.map-controls { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: center; margin-bottom: var(--s2); }
.map-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; }
.map-svg text { fill: var(--dim); font-size: 12px; }
.map-svg .axis-title { fill: var(--ink); font-weight: 600; }
.map-svg .grid { stroke: var(--line); }
.map-svg .bar { stroke: var(--dim); stroke-dasharray: 4 4; }
.map-svg .dot { stroke: var(--card); stroke-width: 2; }
.map-svg .base { fill: var(--card); stroke: var(--ink); stroke-width: 2.5; }
.map-svg .nd { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.map-svg .hit { fill: transparent; }
.map-svg .pt { cursor: pointer; outline: none; }
.map-svg .focus-ring { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; }
.map-svg .pt:focus-visible .focus-ring, .map-svg .pt.sel .focus-ring { opacity: 1; }
.map-svg .pt.sel .focus-ring { stroke: var(--ink); stroke-dasharray: 3 3; }
.map-svg .pt-label { fill: var(--ink); font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; pointer-events: none; }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem var(--s3); font-size: var(--t-1); color: var(--dim); }
.legend li { margin: 0; display: inline-flex; align-items: center; gap: .4rem; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.key-base { border: 2px solid var(--ink); }
.key-nd { border: 2px solid var(--accent); }
.dot.d0 { fill: var(--d0); } .dot.d1 { fill: var(--d1); } .dot.d2 { fill: var(--d2); } .dot.d3 { fill: var(--d3); }
.dot.d4 { fill: var(--d4); } .dot.d5 { fill: var(--d5); } .dot.d6 { fill: var(--d6); } .dot.d7 { fill: var(--d7); }
.key.d0 { background: var(--d0); } .key.d1 { background: var(--d1); } .key.d2 { background: var(--d2); } .key.d3 { background: var(--d3); }
.key.d4 { background: var(--d4); } .key.d5 { background: var(--d5); } .key.d6 { background: var(--d6); } .key.d7 { background: var(--d7); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: .4rem; padding-left: var(--s2); border-left: 2px solid var(--line); }
.tree li { margin: .15rem 0; }
.node {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; text-align: left;
  font-weight: 400; background: none; border-color: transparent;
}
.node[aria-current=true] { border-color: var(--accent); background: var(--card); }
.node-id { font-weight: 650; overflow-wrap: anywhere; }
.node-dir { color: var(--dim); }
.sub { margin-top: var(--s2); }
div.sub { font-size: var(--t0); color: var(--ink); }
.sub-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.sub-head h3 { margin: 0; overflow-wrap: anywhere; }
.sub-summary, .readme-excerpt { white-space: pre-line; }
.files { padding-left: var(--s3); font-size: var(--t-1); }
.tax-def { color: var(--dim); }
.tax-values, .deferred { padding-left: var(--s3); }
.tax-count { color: var(--dim); font-size: var(--t-1); }
.tax-vdef { display: block; color: var(--dim); font-size: var(--t-1); }
.diff-dialog {
  width: min(64rem, 100vw - 2rem); max-height: calc(100vh - 2rem); padding: 0;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.diff-dialog::backdrop { background: rgb(0 0 0 / .5); }
.diff-head { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; padding: var(--s2); border-bottom: 1px solid var(--line); }
.diff-title { flex: 1 1 16rem; min-width: 0; }
.diff-title h2 { margin: 0; font-size: var(--t1); }
.diff-sub { margin: 0; color: var(--dim); font-size: var(--t-1); overflow-wrap: anywhere; }
.ghost { font-size: var(--t-1); }
.diff-scroll { overflow: auto; padding: var(--s2); }
.diff-body { overflow-x: auto; font-family: var(--mono); font-size: var(--t-1); line-height: 1.5; }
div.dl { white-space: pre; min-width: max-content; padding: 0 var(--s2) 0 calc(var(--s2) - 3px); }

/* Phone: one column, tables stacked */
@media (max-width: 719.98px) {
  h1 { font-size: var(--t3); }
  main > h1 + p, .summary, .intro { font-size: var(--t0); }
  main, .site-footer { padding-inline: var(--s2); }
  main > section { margin-top: var(--s4); padding-top: var(--s3); }
  .chart-wide { display: none; }
  .chart-narrow { display: block; }
  .facts, .limits { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dd, .limits dd { margin-bottom: var(--s1); }
  table.stack, .stack tbody, .stack tr, .stack td, .stack tbody th, .stack caption { display: block; }
  table.stack { overflow: visible; }
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .stack tr { border-top: 1px solid var(--line); padding: var(--s1) 0; }
  .stack tr:last-child { border-bottom: 1px solid var(--line); }
  .stack td, .stack tbody th, .stack td:last-child { border: 0; padding: .1rem 0; text-align: left; white-space: normal; }
  .stack td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s1); }
  .stack td::before { content: attr(data-label); content: attr(data-label) / ""; color: var(--dim); font-size: var(--t-1); font-weight: 400; font-stretch: 100%; }
  .stack td.num { font-size: var(--t0); }
}

/* Phone (720 px or less): the nav wraps onto its own row and the open menu is a full-width list in the header, scrolling */
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; padding-inline: var(--s2); gap: 8px 16px; }
  .top { order: 3; flex: 1 1 100%; flex-wrap: wrap; gap: 8px 22px; }
  .menu[open] { flex: 1 1 100%; }
  details.menu[open] .menupanel { position: static; width: auto; margin-top: 10px; max-height: calc(100vh - 8rem); overflow-y: auto; }
}

/* Motion: the record line draws once and a terminal types; nothing moves, and every line
   shows at once, when motion is reduced */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important }
  .term .ln, .cursor { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .chart .rec-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 900ms ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

@media print {
  .site-header, .copy, .skip { display: none !important; }
  .site-footer, main { max-width: none; }
  body { background: #fff; }
  .diff-file > summary { position: static; }
}
