/* Until Inter loads, a fallback with Inter's metrics, so lines break the same way and nothing shifts when it arrives */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"); size-adjust: 107.1%;
             ascent-override: 90.4%; descent-override: 22.5%; line-gap-override: 0%; }
/* Cambrian. The institute's screen stack: warm paper and ink, Inter at display and text sizes, JetBrains Mono for
   instrument labels, STIX Two Text for mathematics. Colour carries meaning only, here and in the live replay:
   cyan = a proved library result, magenta = a new claim or its proof in flight, green = checked and accepted,
   red = rejected, gold = added to the institute's main library.
   The shared site stylesheets set --ink, --paper and --display on the body, so this page keeps its own --cb-* names,
   and scopes its rules under #main so they win over the shared element rules. */
:root {
  --cb-paper: #faf8f3; --cb-ink: #1d1d1b; --cb-body: #2a2926; --cb-soft: #3c3a36; --cb-faint: #6e6d68;
  --cb-hair: #8a8a8a; --cb-rule: rgba(29, 29, 27, .14);
  --cb-c: #009fe3; --cb-m: #e6007e; --cb-m-text: #d40075; --cb-ok: #0b7a3e; --cb-no: #c8401f;
  --cb-gold: #ffc328; --cb-gold-ink: #8a6200;
  --cb-ok-text: #0a6e38; --cb-no-text: #a8361a;   /* the verdict hues, darkened for small text on their tints (5.2:1, 5.3:1) */
  --cb-display: "Inter Display", "InterVariable", "Inter", "Inter Fallback", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --cb-text: "InterVariable", "Inter", "Inter Fallback", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --cb-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --cb-math: "STIX Two Text", "STIX Two Math", "Cambria Math", "Times New Roman", serif;
  --cb-pad: clamp(16px, 2.6vw, 32px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cb-paper: #141413; --cb-ink: #faf8f3; --cb-body: #e9e6df; --cb-soft: #c9c5bc; --cb-faint: #8d8a83;
    --cb-hair: #6f6d68; --cb-rule: rgba(250, 248, 243, .16);
    --cb-c: #2bb3f0; --cb-m: #ff3d9e; --cb-m-text: #ff3d9e; --cb-ok: #35c172; --cb-no: #ff6a3d;
    --cb-gold: #ffc328; --cb-gold-ink: #ffc328; --cb-ok-text: #35c172; --cb-no-text: #ff6a3d;
  }
}

html body[data-rpi-page="cambrian"] { background: var(--cb-paper); color: var(--cb-body); }
html body[data-rpi-page="cambrian"] > .skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--cb-ink);
  color: var(--cb-paper); padding: 8px 12px; font: 600 14px/1.2 var(--cb-text); text-decoration: none; }
html body[data-rpi-page="cambrian"] > .skip:focus { left: 8px; }
#main { display: block; font-family: var(--cb-text); font-weight: 420; font-size: clamp(17px, 1.2vw, 19px);
        line-height: 1.42; color: var(--cb-body); font-optical-sizing: auto; -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility; overflow-wrap: break-word; }
#main *, #main *::before, #main *::after { box-sizing: border-box; }
#main a { color: inherit; text-underline-offset: .2em; }
:where(#main) p { margin: 0 0 .9em; }
#main :focus-visible { outline: 2px solid var(--cb-ink) !important; outline-offset: 3px; }
.cb-wrap { width: min(calc(100% - 2 * var(--cb-pad)), 75rem); margin-inline: auto; }

#main .cb-label { font-family: var(--cb-mono); font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
                  font-size: 11.5px; line-height: 1.35; color: var(--cb-soft); margin: 0; }
#main .cb-small { font-size: 14px; line-height: 1.42; color: var(--cb-soft); }
#main .cb-h1 { font-family: var(--cb-display); font-weight: 820; line-height: .94; letter-spacing: -.045em;
               color: var(--cb-ink); margin: 0; font-size: clamp(40px, 5.3vw, 76px); text-wrap: balance; max-width: 15em;
               text-shadow: 0 0 .5px color-mix(in srgb, var(--cb-ink) 55%, transparent); }
#main h2 { font-family: var(--cb-display); font-weight: 780; letter-spacing: -.028em; line-height: 1.02;
           color: var(--cb-ink); font-size: clamp(32px, 4vw, 58px); margin: .28em 0 .5em; max-width: 18em; }
#main h3 { font-family: var(--cb-display); font-weight: 780; letter-spacing: -.02em; line-height: 1.08;
           color: var(--cb-ink); font-size: clamp(21px, 1.7vw, 26px); margin: .55em 0 .45em; }
#main .cb-lede { font-weight: 450; line-height: 1.32; letter-spacing: -.008em; color: var(--cb-ink);
                 font-size: clamp(19px, 1.6vw, 24px); max-width: 44em; }
#main .cb-num { font-family: var(--cb-display); font-weight: 860; letter-spacing: -.05em; line-height: .86;
                font-variant-numeric: tabular-nums lining-nums; color: var(--cb-ink); }

/* The hero: the proposition, then the loop running, all in the first screen. */
.cb-hero { padding-top: clamp(18px, 2.6vh, 30px); }
.cb-herogrid { display: flex; flex-direction: column; }
#main .cb-kicker { margin-bottom: 12px; }
#main .cb-herogrid .cb-lede { margin: clamp(12px, 1.8vh, 18px) 0 0; font-size: clamp(17px, 1.32vw, 19.5px); max-width: 62em; }
.cb-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 8px; }
/* The Now line: the loop's current status, from status.json, dated exactly as the file gives it. */
#main .cb-nowline { margin: 10px 0 0; font-size: 15px; line-height: 1.4; color: var(--cb-ink); max-width: 76em;
  display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 14px; align-items: baseline; }   /* hanging indent */
#main .cb-nowline .cb-label { display: inline-flex; align-items: center; gap: 8px; color: var(--cb-ink); }
#main .cb-nowline .cb-label::before { content: ""; width: 14px; height: 0; border-top: 2px dashed var(--cb-ink); }
#main .cb-nowline[data-state="done"] .cb-label::before { border-top-style: solid; }
.cb-key { font-family: var(--cb-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
          color: var(--cb-soft); display: inline-flex; align-items: center; gap: 7px; }
.cb-key::before { content: ""; width: 9px; height: 9px; display: inline-block; background: var(--k); }
.cb-key-c { --k: var(--cb-c); }  .cb-key-ok { --k: var(--cb-ok); }
.cb-key-no { --k: var(--cb-no); } .cb-key-gold { --k: var(--cb-gold); }
.cb-band { position: relative; height: clamp(330px, 40vh, 410px); border-top: 1px solid var(--cb-rule);
           border-bottom: 1px solid var(--cb-rule); }
#loop-canvas { display: block; width: 100%; height: 100%; cursor: default; touch-action: pan-y; }
#main #loop-canvas:focus-visible { outline: 2px solid var(--cb-ink) !important; outline-offset: 3px; }
/* A landed theorem comes up over the library, in gold, while the loop keeps it. */
.cb-landed { position: absolute; left: 0; top: 0; z-index: 2; visibility: hidden; opacity: 0; transition: opacity .25s ease, visibility .25s;
             background: var(--cb-paper); border: 1px solid var(--cb-rule); border-top: 4px solid var(--cb-gold);
             padding: 14px 16px 16px; box-sizing: border-box; overflow: hidden; pointer-events: none; }
.cb-landed.is-on { visibility: visible; opacity: 1; }
/* The record strip's tooltip: statement, verdict and the checker's reason. */
.cb-tip { position: absolute; z-index: 3; max-width: 300px; padding: 8px 10px; background: var(--cb-paper); color: var(--cb-ink);
          border: 1.5px solid var(--cb-ink); font: 400 13px/1.35 var(--cb-text); pointer-events: none; visibility: hidden; }
.cb-tip.is-on { visibility: visible; }
.cb-tip b { display: block; font: 700 11px/1.3 var(--cb-mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 3px; }
#main .cb-landed .cb-label { display: flex; align-items: flex-start; gap: 8px; color: var(--cb-ink); height: 2.7em; overflow: hidden; }
#main .cb-landed .cb-label::before { content: ""; width: 9px; height: 9px; background: var(--cb-gold); flex: none; margin-top: 3px; }
#main .cb-landed h3 { font-size: clamp(17px, 1.5vw, 22px); margin: .55em 0 .5em; }
#main .cb-landed .cb-math { font-size: clamp(15px, 1.3vw, 19px); margin: 0; }
.cb-landed.is-plain h3 { color: var(--cb-ink); }
.cb-landed.is-claim { border-top-color: var(--cb-m); }
#main .cb-landed.is-claim .cb-label::before { background: var(--cb-m); }
#main .cb-landed.is-claim .cb-math { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .cb-landed { transition: none; } }
.cb-band-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
               padding: 24px; text-align: center; }
.cb-band.is-live .cb-band-off { display: none; }

#main .cb-btn { font-family: var(--cb-mono); font-weight: 700; font-size: 11px; letter-spacing: .13em; text-transform: uppercase;
                background: none; color: var(--cb-ink); border: 1.5px solid var(--cb-ink); border-radius: 0; padding: 7px 11px;
                cursor: pointer; line-height: 1.2; min-height: 34px; }
#main .cb-btn:hover { background: var(--cb-ink); color: var(--cb-paper); }
#main .cb-btn[aria-pressed="true"] { background: var(--cb-ink); color: var(--cb-paper); cursor: default; }
#main .cb-btn b { font-weight: 700; color: inherit; opacity: .78; margin-left: .35em; }
#main .cb-btn:disabled { opacity: .4; cursor: default; }

   
.cb-now .cb-label { color: var(--cb-ink); margin-bottom: 8px; }
.cb-now-line { margin: 0; min-height: 4.3em; font-size: 15.5px; line-height: 1.42; color: var(--cb-body); }
.cb-tries { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--cb-rule); min-height: 5.6em; display: grid; gap: 4px; }
.cb-tries li { font-size: 13.5px; line-height: 1.35; color: var(--cb-body); display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.cb-tries li::before { content: ""; width: 9px; height: 9px; background: var(--k, var(--cb-hair)); transform: translateY(1px); }
.cb-tries li.ok { --k: var(--cb-ok); } .cb-tries li.no { --k: var(--cb-no); } .cb-tries li.gold { --k: var(--cb-gold); }
.cb-tries li.note { --k: transparent; color: var(--cb-soft); }
.cb-tries b { color: var(--cb-ink); font-weight: 650; }
.cb-now-line b { color: var(--cb-ink); font-weight: 650; }

/* Sections */
.cb-sec { padding: clamp(64px, 11vh, 128px) 0 0; }
.cb-sec > .cb-wrap { border-top: 1px solid var(--cb-rule); padding-top: clamp(28px, 4vh, 44px); }
.cb-intro { max-width: 40em; font-size: clamp(18px, 1.35vw, 21px); color: var(--cb-ink); }

/* The six steps: each rule takes the colour of what that step adds to the drawing. */
.cb-steps { list-style: none; margin: clamp(28px, 4vh, 44px) 0 0; padding: 0; display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vh, 44px) clamp(24px, 2.8vw, 44px); }
.cb-step { position: relative; padding-top: 16px; min-width: 0; }
.cb-step::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--sc); }
.cb-step[data-s=choose] { --sc: var(--cb-c); } .cb-step[data-s=screen] { --sc: var(--cb-ink); }
.cb-step[data-s=prove] { --sc: var(--cb-m); } .cb-step[data-s=check] { --sc: var(--cb-ok); }
.cb-step[data-s=repair] { --sc: var(--cb-no); } .cb-step[data-s=keep] { --sc: var(--cb-gold); }
#main .cb-step h3 { margin-top: .5em; }
#main .cb-step p:not(.cb-label) { margin: 0; font-size: clamp(16px, 1.1vw, 17.5px); line-height: 1.46; }

/* The record in numbers */

/* Theorems in mathematical notation */
.cb-thms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 2.8vw, 44px); margin-top: clamp(28px, 4vh, 44px); }
.cb-thm { border-top: 1px solid var(--cb-rule); padding: 20px 0 30px; min-width: 0; display: flex; flex-direction: column; }
.cb-thm-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.cb-thm-top .cb-label { display: inline-flex; align-items: center; gap: 8px; }
.cb-thm-top .cb-label::before { content: ""; width: 9px; height: 9px; background: var(--cb-gold); }
.cb-forms { font-family: var(--cb-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
            color: var(--cb-ink); border: 1.5px solid var(--cb-ink); padding: 2px 7px; white-space: nowrap; }
#main .cb-thm h3 { font-size: clamp(19px, 1.45vw, 22px); margin: .7em 0 .7em; }
.cb-math { font-family: var(--cb-math); font-size: clamp(19px, 1.45vw, 22px); line-height: 1.5; color: var(--cb-ink);
           margin: 0 0 14px; font-variant-numeric: lining-nums; }
.cb-math > span { display: block; }
.cb-math i { font-style: italic; }
.cb-math .cb-then { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--cb-rule); }
.cb-math .cb-impl { color: var(--cb-soft); margin-right: .25em; }
.cb-math .cb-word { font-family: var(--cb-text); font-size: .8em; font-weight: 450; letter-spacing: -.005em; }
.cb-lim { position: relative; display: inline-block; margin-right: .12em; }
.cb-lim small { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: -.32em; font-size: .56em;
                white-space: nowrap; line-height: 1; }
.cb-math .cb-hasl { padding-bottom: .5em; }
.cb-nw { white-space: nowrap; }
#main .cb-thm p.cb-gloss { margin: 4px 0 14px; font-size: 15.5px; line-height: 1.45; color: var(--cb-body); }
/* What each theorem was made from: two library results (cyan) and the new theorem (gold). */
.cb-made { margin: 2px 0 12px; display: grid; gap: 6px; }
#main .cb-made .cb-label { margin-bottom: 2px; }
#main .cb-made p.cb-par, #main .cb-made p.cb-new { margin: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 8px;
  align-items: baseline; font-size: 14.5px; line-height: 1.42; color: var(--cb-body); padding: 5px 0 5px 10px; border-left: 3px solid var(--cb-c); }
#main .cb-made p.cb-new { border-left-color: var(--cb-gold); color: var(--cb-ink); }
#main .cb-made b { font-family: var(--cb-mono); font-weight: 700; font-size: 12px; color: var(--cb-ink); }
#main .cb-made i { font-family: var(--cb-math); font-size: 1.08em; }
.cb-landed.is-made { border-top-color: var(--cb-c); }
#main .cb-landed.is-made .cb-label::before { background: var(--cb-c); }
#main .cb-landed .cb-made { margin: 10px 0 0; }
#main .cb-landed .cb-made p.cb-par { font-size: 14px; }
#main .cb-landed.is-made .cb-made p.cb-par { font-size: 13px; padding: 3px 0 3px 8px; line-height: 1.38; }
.cb-watch { display: none; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; padding-top: 4px; }
.cb-js .cb-watch { display: flex; }
#main .cb-watch .cb-btn { min-height: 30px; padding: 5px 9px; font-size: 10.5px; }
#main .cb-watch .cb-label { flex-basis: 100%; }
.cb-bars.cb-why { margin-top: clamp(34px, 5vh, 52px); max-width: 46em; }
.cb-why .cb-bar i { background: color-mix(in srgb, var(--cb-no) 72%, transparent); }
.cb-bars.cb-why li { grid-template-columns: minmax(12em, 24em) minmax(0, 1fr) 3em; }

/* In progress */
.cb-next { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px clamp(32px, 4vw, 64px);
           margin-top: clamp(28px, 4vh, 44px); align-items: start; }
.cb-bars { margin: 0; }
.cb-bars-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cb-bars ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cb-bars li { display: grid; grid-template-columns: minmax(9.5em, 11em) minmax(0, 1fr) 5.2em; gap: 12px; align-items: center; }
.cb-bars .cb-bn { font-size: 14.5px; color: var(--cb-ink); line-height: 1.2; }
.cb-bars .cb-bv { font-family: var(--cb-mono); font-size: 12.5px; font-weight: 700; color: var(--cb-ink); text-align: right;
                  font-variant-numeric: tabular-nums; }
.cb-bar { height: 16px; position: relative; }
.cb-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: color-mix(in srgb, var(--cb-c) 62%, transparent); }
.cb-bars figcaption { margin-top: 14px; }
.cb-status { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.cb-status::before { content: ""; width: 14px; height: 0; border-top: 2px dashed var(--cb-ink); }
.cb-goal { margin-top: clamp(40px, 6vh, 64px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
           gap: 24px clamp(32px, 4vw, 64px); padding-top: 26px; border-top: 1px solid var(--cb-rule); }
#main .cb-goal h3 { font-size: clamp(24px, 2.3vw, 34px); margin-top: .3em; }
#main .cb-goal p { margin: 0 0 .8em; }
.cb-seal { display: flex; align-items: baseline; gap: 16px; margin-top: 6px; }
.cb-seal .cb-num { font-size: clamp(54px, 5.6vw, 88px); }

/* What a theorem was made from: open by default; phones fold it after load */
#main .cb-made-d > summary { cursor: pointer; list-style: none; display: inline-flex; gap: 8px; align-items: center; padding: 2px 0; margin-bottom: 4px; }
#main .cb-made-d > summary::-webkit-details-marker { display: none; }
#main .cb-made-d > summary::after { content: "+"; font-size: 14px; letter-spacing: 0; }
#main .cb-made-d[open] > summary::after { content: "−"; }

/* The composition web: library results (cyan) and the new theorems (gold) made from them */
.cb-web { margin: clamp(26px, 4vh, 40px) 0 clamp(10px, 2vh, 20px); }
.cb-web-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; align-items: center; }
#main .cb-web-key { margin: 0; display: flex; gap: 16px; }
.cb-web-box { margin-top: 10px; min-height: 226px; }
.cb-web-box svg { display: block; overflow: visible; }
.cb-web-edge { stroke: color-mix(in srgb, var(--cb-ink) 30%, transparent); stroke-width: 1.3; }
.cb-web-edge.is-on { stroke: var(--cb-ink); stroke-width: 2; }
.cb-web-edge.is-dim { stroke: color-mix(in srgb, var(--cb-ink) 12%, transparent); }
.cb-web-node { cursor: pointer; outline: none; }
.cb-web-hit { fill: transparent; }
.cb-web-ring { fill: none; stroke: none; }
.cb-web-node.is-focus .cb-web-ring { stroke: var(--cb-ink); stroke-width: 2; }
.cb-web-p .cb-web-dot { fill: var(--cb-paper); stroke: var(--cb-c); stroke-width: 2.5; }
.cb-web-p.is-on .cb-web-dot, .cb-web-p.is-sel .cb-web-dot { fill: var(--cb-c); }
.cb-web-t .cb-web-box { fill: var(--cb-gold); stroke: var(--cb-gold-ink); stroke-width: 1; }
.cb-web-num { font: 700 11px var(--cb-mono); fill: #1d1d1b; }
.cb-web-label { font: 700 10px var(--cb-mono); letter-spacing: .06em; fill: var(--cb-soft); }
.cb-web-short { font: 500 11px var(--cb-text); fill: var(--cb-soft); }
.cb-web-node.is-on .cb-web-short { fill: var(--cb-ink); }
.cb-web-node.is-dim .cb-web-short { fill: var(--cb-faint); }
.cb-web-node.is-dim .cb-web-dot { stroke: color-mix(in srgb, var(--cb-c) 35%, var(--cb-paper)); }
.cb-web-node.is-dim .cb-web-box { fill: color-mix(in srgb, var(--cb-gold) 35%, var(--cb-paper)); stroke: color-mix(in srgb, var(--cb-gold-ink) 35%, var(--cb-paper)); }
.cb-web-node.is-dim .cb-web-num { fill: color-mix(in srgb, #1d1d1b 45%, var(--cb-paper)); }
.cb-web-node.is-dim .cb-web-label { fill: var(--cb-faint); }
.cb-web-node.is-on .cb-web-label { fill: var(--cb-ink); }
#main .cb-web-detail { min-height: 2.9em; margin: 6px 0 0; color: var(--cb-ink); max-width: 60em; }
.cb-web-list { display: none; }
html:not(.cb-early) .cb-web-list { display: block; margin: 8px 0 0; padding-left: 1.2em; font-size: 14px; }
html:not(.cb-early) .cb-web-box, html:not(.cb-early) .cb-web-detail { display: none; }
#main .cb-web figcaption { margin-top: 8px; max-width: 46em; }
.cb-thm.is-flash { animation: cb-flash 1.6s ease-out; }
@keyframes cb-flash { 0% { box-shadow: 0 0 0 3px var(--cb-gold); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .cb-thm.is-flash { animation: none; } }
/* Record-strip filters */
/* Recognition terms: one box above the cards that use them */
.cb-terms { margin: 0 0 10px; }
#main .cb-terms-all { margin: clamp(24px, 3.5vh, 36px) 0 0; }
#main .cb-terms-all dl { max-width: 46em; }
#main .cb-terms summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-family: var(--cb-mono);
  font-weight: 700; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--cb-ink); padding: 4px 0; }
#main .cb-terms summary::-webkit-details-marker { display: none; }
#main .cb-terms summary::after { content: "+"; font-size: 14px; letter-spacing: 0; }
#main .cb-terms[open] summary::after { content: "−"; }
#main .cb-terms dl { margin: 6px 0 0; padding-left: 10px; border-left: 1px solid var(--cb-rule); font-size: 14px; line-height: 1.42; }
#main .cb-terms dt { font-weight: 650; color: var(--cb-ink); margin-top: 6px; }
#main .cb-terms dt:first-child { margin-top: 0; }
#main .cb-terms dd { margin: 1px 0 0; color: var(--cb-body); }
#main .cb-terms i { font-family: var(--cb-math); font-size: 1.08em; }
#main .cb-axioms { margin: 10px 0 0 !important; font-size: 13.5px !important; }
/* Before the loop, on phones: each era opens to its first result, with a control for the rest */
.cb-era-toggle { display: none; }
@media (max-width: 640px) {
  html.cb-early #main .cb-era-toggle { display: inline-block; justify-self: start; margin-top: 4px; }
  html.cb-early .cb-era:not(.is-open) .cb-era-body > div:nth-child(n+2),
  html.cb-early .cb-era:not(.is-open) .cb-five > li:nth-child(n+2) { display: none; }
}

/* Today’s pool beside the staged pool, to scale */
.cb-scale { margin: clamp(28px, 4vh, 44px) 0 0; }
.cb-scale-box { width: 100%; min-height: 240px; }
#scale-canvas { display: block; }
.cb-scale figcaption { margin-top: 12px; max-width: 46em; }
.cb-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Before the loop */
.cb-era { display: grid; grid-template-columns: minmax(10em, 15em) minmax(0, 1fr); gap: 20px clamp(28px, 4vw, 64px);
          padding: 30px 0 34px; border-top: 1px solid var(--cb-rule); }
#main .cb-era h3 { margin: .45em 0 .4em; }
.cb-five { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px clamp(22px, 2.4vw, 40px); }
.cb-five li { border-left: 3px solid var(--cb-c); padding-left: 14px; font-size: 15.5px; line-height: 1.45; min-width: 0; }
.cb-five li b { display: block; color: var(--cb-ink); font-weight: 650; margin-bottom: 2px; }
.cb-five .cb-math { font-size: 19px; display: block; margin: 4px 0 0; }

/* People */
.cb-people { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(32px, 4vw, 64px); }
#main .cb-people h3 { margin-top: .2em; }
#main .cb-contact { display: inline-block; margin-top: 10px; font-family: var(--cb-mono); font-weight: 700; font-size: 13px;
                    letter-spacing: .1em; text-decoration: none; background: var(--cb-ink); color: var(--cb-paper);
                    border: 1.5px solid var(--cb-ink); padding: 13px 18px; }
#main a.cb-contact:hover { background: var(--cb-m); border-color: var(--cb-m); color: #fff; }
.cb-foot { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: clamp(48px, 8vh, 96px) 0 36px; }
.cb-foot .cb-label { font-weight: 400; }

/* Phones: the shared navigation script turns the site nav into a menu after the page has drawn, which made the
   whole page jump. With scripts on, this page takes the menu layout from the first frame. Without scripts the
   nav stays as it is. */
@media (max-width: 960px) {
  html.cb-early body[data-rpi-page="cambrian"]:not(.rpi-mobile-ready) .rpi-top .rpi-interior-nav { display: none; }
  html.cb-early body[data-rpi-page="cambrian"]:not(.rpi-mobile-ready) .rpi-top > .rpi-container {
    display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px;
    padding: 12px 20px; box-sizing: border-box; width: 100%; max-width: none; margin: 0; }
  html.cb-early body[data-rpi-page="cambrian"]:not(.rpi-mobile-ready) .rpi-top .rpi-brand { font-size: .85rem; line-height: 1.15; flex-shrink: 1; }
}

/* The shared header and footer in dark mode, on this page only. */
@media (prefers-color-scheme: dark) {
  html body[data-rpi-page="cambrian"] > .rpi-top,
  html body[data-rpi-page="cambrian"] .rpi-mobile-header { background: #1b1c1a; border-bottom-color: #34342f; color: #faf8f3; }
  html body[data-rpi-page="cambrian"] .rpi-brand,
  html body[data-rpi-page="cambrian"] .rpi-site-nav .rpi-nav-group > summary,
  html body[data-rpi-page="cambrian"] .rpi-interior-nav > .rpi-container > a,
  html body[data-rpi-page="cambrian"] .rpi-site-nav .rpi-nav-links a,
  html body[data-rpi-page="cambrian"] .rpi-menu-toggle,
  html body[data-rpi-page="cambrian"] .rpi-bottom a { color: #faf8f3; }
  html body[data-rpi-page="cambrian"] .rpi-site-nav .rpi-nav-group > summary:hover,
  html body[data-rpi-page="cambrian"] .rpi-interior-nav > .rpi-container > a:hover,
  html body[data-rpi-page="cambrian"] .rpi-site-nav .rpi-nav-links a:hover { background: #26302f; border-color: #4a5552; }
  html body[data-rpi-page="cambrian"] .rpi-site-nav .rpi-nav-group.has-current > summary,
  html body[data-rpi-page="cambrian"] .rpi-site-nav .rpi-nav-links a[aria-current] { background: #2b2838; border-color: #57526e; }
  html body[data-rpi-page="cambrian"] .rpi-site-nav .rpi-nav-links { background: #1b1c1a; border-color: #34342f; }
  html body[data-rpi-page="cambrian"] .rpi-site-nav a.rpi-collaborate-link,
  html body[data-rpi-page="cambrian"] .rpi-menu-toggle { border-color: #5d6a64; }
  html body[data-rpi-page="cambrian"] .rpi-menu-toggle:hover { background: #26302f; }
  html body[data-rpi-page="cambrian"] .rpi-top .rpi-mobile-panel { background: #1b1c1a; border-bottom-color: #34342f; }
  html body[data-rpi-page="cambrian"] .rpi-bottom { background: #1b1c1a; border-top-color: #34342f; }
  html body[data-rpi-page="cambrian"] ::selection { background: #2a3b5a; color: #faf8f3; }
}

/* Tablet */
@media (max-width: 1100px) {
    .cb-now { grid-column: 1 / -1; }
  .cb-steps, .cb-thms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-next, .cb-goal, .cb-people { grid-template-columns: minmax(0, 1fr); }
  .cb-era { grid-template-columns: minmax(0, 1fr); }
}
/* Phone */
@media (max-width: 640px) {
  .cb-hero { padding-top: 16px; }
  .cb-k-long { display: none; }
  #main .cb-h1 { font-size: clamp(34px, 10.6vw, 46px); }
  .cb-herogrid > .cb-band { order: 3; margin-top: 14px; }
  .cb-herogrid > .cb-keys { order: 4; margin-top: 10px; }
  .cb-web-box { min-height: 420px; }
  .cb-herogrid > .cb-lede, .cb-herogrid > .cb-nowline { order: 5; }
    .cb-herogrid > .cb-caveat { order: 7; }
  .cb-bars.cb-why li { grid-template-columns: minmax(0, 1fr) 3em; }
  .cb-band { height: clamp(380px, 56vh, 410px); }
  #main .cb-nowline { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
    .cb-steps, .cb-thms, .cb-era-body, .cb-five { grid-template-columns: minmax(0, 1fr); }
    .cb-sec { padding-top: 44px; }
  .cb-sec > .cb-wrap { padding-top: 22px; }
  .cb-scale-box { min-height: 302px; }
  .cb-keys { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; } .cb-key { font-size: 9.5px; }
  .cb-bars li { grid-template-columns: minmax(0, 1fr) 4.6em; gap: 4px 10px; }
  .cb-bars .cb-bar { grid-column: 1 / -1; grid-row: 2; }
  .cb-now-line { min-height: 5.8em; }
  #main .cb-landed .cb-made p.cb-par { font-size: 13px; padding: 3px 0 3px 8px; }
  #main .cb-landed.is-made .cb-made p.cb-par { font-size: 12.5px; }
  #main .cb-landed .cb-label { font-size: 10px; letter-spacing: .1em; }
  #main .cb-landed { padding: 10px 12px 12px; }
}
@media print { .cb-stage, .cb-caveat { display: none; } }
#main .cb-landed .cb-math .cb-made { font-family: var(--cb-text); font-size: 14px; }
#main .cb-made p.cb-new b { font-family: var(--cb-math); font-size: 17px; font-weight: 400; }

/* ---------- Round 11 ---------- */
/* The hero's opening: on wide screens the lede (44em) and the Now line side by side */
#main .cb-nowline .cb-label::before { content: ""; width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--cb-ink); }
#main .cb-nowline[data-state="done"] .cb-label::before { background: var(--cb-ok); }
.cb-status::before { width: 8px !important; height: 8px !important; border: 0 !important; border-radius: 50%; background: var(--cb-ink); }
/* The colour key; its last three entries filter the record strip */
.cb-keys { align-items: center; }
#main .cb-keybtn { background: none; border: 0; border-bottom: 1.5px solid transparent; padding: 3px 0; margin: 0; cursor: pointer; color: var(--cb-soft);
                   font: inherit; font-family: var(--cb-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
#main .cb-keybtn:hover { color: var(--cb-ink); border-bottom-color: var(--cb-hair); }
#main .cb-keybtn[aria-pressed="true"] { color: var(--cb-ink); border-bottom-color: var(--cb-ink); }
/* the ← control's visible tooltip */
.cb-tip-btn { position: relative; }
.cb-tip-btn::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap;
  background: var(--cb-ink); color: var(--cb-paper); font: 700 10.5px/1 var(--cb-mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 7px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.cb-tip-btn:hover::after, .cb-tip-btn:focus-visible::after { opacity: 1; }
#main .cb-caveat { padding: 14px 0 0; font-size: 13.5px; color: var(--cb-soft); max-width: 60em; }
/* The theorem as the event: beside the pool, never over it */
.cb-landed { border: 1px solid var(--cb-rule); border-top: 3px solid var(--cb-gold); }
#main .cb-landed .cb-label { height: auto; min-height: 0; overflow: visible; font-size: 10.5px; }
#main .cb-landed h3 { font-size: clamp(18px, 1.6vw, 23px); margin: .4em 0 .25em; }
#main .cb-landed .cb-hyp { font-size: clamp(15px, 1.25vw, 18px); color: var(--cb-soft); margin: 10px 0 0; line-height: 1.4; }
#main .cb-landed .cb-con { font-size: clamp(22px, 2.2vw, 31px); line-height: 1.25; color: var(--cb-ink); margin: 6px 0 0; }
#main .cb-landed .cb-con .cb-impl { color: var(--cb-m); }
#main .cb-landed.is-landed-gold .cb-con .cb-impl, #main .cb-landed:not(.is-claim):not(.is-made) .cb-con .cb-impl { color: var(--cb-gold-ink); }
#main .cb-landed .cb-con .cb-word { font-size: .72em; }
#main .cb-landed .cb-con > span, #main .cb-landed .cb-hyp > span > span { display: inline; }
#main .cb-landed .cb-con .cb-impl { margin-right: .3em; }
#main .cb-landed.is-made .cb-made p.cb-par { font-size: 14px; padding: 4px 0 4px 10px; line-height: 1.4; }
/* The reconciled record */
.cb-recon { margin: clamp(30px, 4.5vh, 48px) 0 0; max-width: 62rem; }
#main .cb-recon > .cb-label { margin: 22px 0 8px; color: var(--cb-ink); }
#main .cb-recon > .cb-label:first-child { margin-top: 0; }
.cb-rbar { display: flex; gap: 2px; height: 22px; }
.cb-rbar span { display: block; height: 100%; background: var(--r); }
.r-none { --r: color-mix(in srgb, var(--cb-ink) 13%, transparent); } .r-ref { --r: color-mix(in srgb, var(--cb-ink) 45%, transparent); }
.r-sel { --r: var(--cb-m); }
.r-first { --r: var(--cb-ok); } .r-rep { --r: color-mix(in srgb, var(--cb-ok) 62%, transparent); }
.r-later { --r: color-mix(in srgb, var(--cb-ok) 38%, transparent); } .r-never { --r: var(--cb-no); }
.r-lib { --r: var(--cb-gold); } .r-kept { --r: color-mix(in srgb, var(--cb-ok) 62%, transparent); }
.cb-rbar span.r-ret { background: none; box-shadow: inset 0 0 0 1.5px var(--cb-ok); }
#main .cb-rkey { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14.5px; }
.cb-rkey li { display: inline-flex; align-items: baseline; gap: 6px; }
.cb-rkey li::before { content: ""; width: 10px; height: 10px; background: var(--r); flex: none; align-self: center; }
.cb-rkey li.r-ret::before { background: none; box-shadow: inset 0 0 0 1.5px var(--cb-ok); }
.cb-rkey b { font-family: var(--cb-mono); font-weight: 700; color: var(--cb-ink); }
#main .cb-rnote { margin: 8px 0 0; font-size: 15px; color: var(--cb-ink); max-width: 46em; }
.cb-rzoom { display: block; width: 100%; height: 22px; margin: 14px 0 0; }
.cb-rzoom polygon { fill: color-mix(in srgb, var(--cb-m) 9%, transparent); stroke: color-mix(in srgb, var(--cb-m) 50%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
#main .cb-recon figcaption { margin-top: 18px; max-width: 46em; }
/* Card craft: disclosure chevrons; the forms badge never moves the heading */
#main .cb-made-d > summary::after, #main .cb-terms summary::after, #main .cb-made-d[open] > summary::after, #main .cb-terms[open] summary::after {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg);
  margin-left: 2px; transition: transform .15s; font-size: 0; }
#main .cb-made-d[open] > summary::after, #main .cb-terms[open] summary::after { transform: rotate(45deg) translate(-1px, -1px); }
.cb-thm-top { min-height: 22px; }
.cb-forms { padding: 0 6px; font-size: 10px; line-height: 18px; letter-spacing: .1em; border-width: 1px; }
/* People: a one-line heading */
#main .cb-people { grid-template-columns: minmax(0, 1fr); gap: 12px; }
#main .cb-people .cb-h2-s { font-size: clamp(24px, 2.4vw, 34px); max-width: none; margin: .2em 0 .2em; }

@media (max-width: 640px) {
      .cb-herogrid > .cb-band { order: 3; margin-top: 12px; }
  .cb-herogrid > .cb-keys { order: 4; margin-top: 10px; }
      #main .cb-herogrid .cb-nowline { order: 7; display: block; margin: 12px 0 0; }
  .cb-herogrid > .cb-caveat { order: 8; }
  .cb-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  #main .cb-keybtn { font-size: 9.5px; }
    #main .cb-landed .cb-hyp { display: none; }
  #main .cb-landed .cb-con { font-size: 21px; margin-top: 6px; }
  #main .cb-landed.is-made .cb-made p.cb-par { font-size: 13px; padding: 3px 0 3px 8px; }
  .cb-rbar { height: 18px; }
  #main .cb-rkey { font-size: 14px; flex-direction: column; }
}

/* ---------- Round 12: live progress ---------- */
.cb-prog { padding: clamp(40px, 6vh, 64px) 0 0; }
.cb-prog > .cb-wrap { border-top: 1px solid var(--cb-rule); padding-top: clamp(22px, 3vh, 32px); }
.cb-pg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; }
#main .cb-pg-head h2 { font-size: clamp(26px, 2.6vw, 38px); margin: .25em 0 0; }
#main .cb-pg-asof { margin: 0; }
.cb-pg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 28px clamp(28px, 3vw, 56px); margin-top: 22px; align-items: start; }
/* the five stages, drawn like the replay's stations */
.cb-pg-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 14px; position: relative; }
.cb-pg-st { position: relative; padding-top: 44px; min-width: 0; }
.cb-pg-st::before { content: ""; position: absolute; left: 0; right: -14px; top: 15px; border-top: 1.5px solid color-mix(in srgb, var(--cb-ink) 30%, transparent); }
.cb-pg-st:last-child::before { right: 0; }
.cb-pg-st.is-waiting::before { border-top-style: dashed; }
.cb-pg-box { position: absolute; left: 0; top: 0; width: 30px; height: 30px; box-sizing: border-box; background: var(--cb-paper);
             border: 1.5px solid var(--cb-faint); z-index: 1; overflow: hidden; }
.cb-pg-box i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; }
.is-done .cb-pg-box { background: var(--cb-ok); border-color: var(--cb-ok); }
.is-done .cb-pg-box::after { content: ""; position: absolute; left: 10px; top: 5px; width: 7px; height: 13px; border-right: 2.5px solid var(--cb-paper);
                             border-bottom: 2.5px solid var(--cb-paper); transform: rotate(45deg); }
.is-running .cb-pg-box { border: 2px solid var(--cb-m); box-shadow: 0 0 0 3px var(--cb-paper), 0 0 0 4px var(--cb-ink); }
.is-running .cb-pg-box i { height: var(--p); background: var(--cb-m); transition: height .9s ease; }
#main .cb-pg-st .cb-label { display: block; color: var(--cb-faint); font-size: 10.5px; }
#main .cb-pg-st.is-running .cb-label { color: var(--cb-m-text); }
#main .cb-pg-st.is-done .cb-label { color: var(--cb-ok-text); }
.cb-pg-lab { display: block; margin-top: 3px; font-size: 14px; line-height: 1.35; color: var(--cb-soft); }
.is-running .cb-pg-lab { color: var(--cb-ink); font-weight: 600; }
/* the running stage, opened up */
.cb-pg-detail { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--cb-rule); }
#main .cb-pg-now { color: var(--cb-ink); margin: 0 0 6px; }
#main .cb-pg-big { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.cb-pg-big .cb-num { font-size: clamp(48px, 5vw, 76px); }
.cb-pg-of { font-size: clamp(16px, 1.3vw, 19px); color: var(--cb-ink); }
.cb-pg-bar { display: flex; gap: 3px; height: 18px; margin-top: 14px; }
.cb-pg-seg { position: relative; display: block; background: color-mix(in srgb, var(--cb-m) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cb-m) 45%, transparent); }
.cb-pg-seg i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cb-m); transition: width .9s ease; }
.cb-pg-seg.is-done i { background: var(--cb-ok); }
#main .cb-pg-parts { list-style: none; margin: 6px 0 0; padding: 0; display: flex; gap: 3px; font-size: 13px; color: var(--cb-body); }
.cb-pg-parts li { min-width: 0; }
.cb-pg-parts b { font-family: var(--cb-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--cb-ink); margin-right: 4px; }
.cb-pg-foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 28px; margin-top: 14px; }
.cb-pg-spark { margin: 0; }
.cb-pg-spark svg { display: block; overflow: visible; }
.cb-pg-spark path { fill: none; stroke: var(--cb-m); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
#main .cb-pg-spark figcaption { margin: 2px 0 0; font-size: 12px; }
#main .cb-pg-eta { margin: 0; font-size: 14.5px; color: var(--cb-ink); max-width: 30em; }
/* the latest results */
.cb-pg-latest { border-left: 1px solid var(--cb-rule); padding-left: clamp(18px, 2vw, 28px); }
#main .cb-pg-latest > .cb-label { color: var(--cb-ink); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
#main .cb-pg-latest > .cb-label::before { content: ""; width: 9px; height: 9px; background: var(--cb-gold); }
.cb-pg-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-height: 30rem; overflow-y: auto; }
.cb-pg-results li { padding-bottom: 12px; border-bottom: 1px solid var(--cb-rule); }
.cb-pg-results li:last-child { border-bottom: 0; padding-bottom: 0; }
#main .cb-pg-results .cb-label { margin: 0 0 4px; font-size: 10.5px; }
#main .cb-pg-results h3 { font-size: 18px; margin: 0 0 4px; line-height: 1.2; }
#main .cb-pg-results h3 a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
#main .cb-pg-results p:not(.cb-label) { margin: 0; font-size: 14.5px; line-height: 1.42; color: var(--cb-body); }
@media (prefers-reduced-motion: reduce) { .cb-pg-seg i, .is-running .cb-pg-box i { transition: none; } }
@media (max-width: 1100px) { .cb-pg-grid { grid-template-columns: minmax(0, 1fr); } .cb-pg-latest { border-left: 0; padding-left: 0; border-top: 1px solid var(--cb-rule); padding-top: 18px; } }
@media (max-width: 640px) {
  .cb-pg-stages { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cb-pg-st { padding: 0 0 14px 44px; min-height: 44px; }
  .cb-pg-st::before { left: 15px; right: auto; top: 30px; bottom: -0px; border-top: 0; border-left: 1.5px solid color-mix(in srgb, var(--cb-ink) 30%, transparent); }
  .cb-pg-st.is-waiting::before { border-left-style: dashed; }
  .cb-pg-st:last-child::before { display: none; }
  #main .cb-pg-parts { flex-direction: column; gap: 2px; }
  .cb-pg-parts li { flex: none !important; }
}

/* ---------- Round 13: the first screen belongs to the replay ---------- */
#main .cb-hero .cb-lede { margin: clamp(10px, 1.4vh, 16px) 0 0; font-size: clamp(16.5px, 1.25vw, 18px); max-width: none; }
.cb-band { margin-top: clamp(12px, 1.8vh, 18px); }
html.cb-early .cb-band-off { display: none; }
.cb-band.is-failed .cb-band-off { display: flex; }
.cb-band .cb-keys { position: absolute; left: 0; right: 0; top: auto; z-index: 2; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.cb-band .cb-keys:not([style*="top"]) { visibility: hidden; }
.cb-hbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-top: 12px; }
.cb-ctlrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cb-ctlgap { display: inline-flex; align-items: center; gap: 8px; margin-left: 14px; }
.cb-big3 { display: flex; gap: 10px clamp(20px, 3vw, 44px); margin: 0; }
.cb-big3 > div { display: flex; flex-direction: column; gap: 2px; }
.cb-big3 dt { font-size: clamp(28px, 2.4vw, 36px); white-space: nowrap; }
.cb-big3 dt small { font-size: .42em; letter-spacing: -.01em; font-weight: 780; margin-left: .18em; }
.cb-big3 dd { margin: 0; font-size: 13px; line-height: 1.25; color: var(--cb-body); white-space: nowrap; }
.cb-now { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--cb-rule); display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 24px; }
#main .cb-now #cb-now-head { white-space: nowrap; margin: 2px 0 0; grid-row: span 2; }
#main .cb-now-line { min-height: 0; margin: 0; }
.cb-tries { min-height: 0; margin: 4px 0 0; padding-top: 0; border-top: 0; }
#main .cb-caveat { padding: 10px 0 0; font-size: 14px; letter-spacing: 0; color: var(--cb-soft); max-width: 60em; margin: 0; }
/* Progress: the Now line, and what the install brings */
#main .cb-prog .cb-nowline { display: block; margin: 10px 0 0; padding: 0; border: 0; font-size: 15px; max-width: 60em; }
#main .cb-prog .cb-nowline .cb-label { display: inline-flex; margin: 0 8px 0 0; }
.cb-install { margin-top: clamp(28px, 4vh, 40px); padding-top: 18px; border-top: 1px solid var(--cb-rule); }
#main .cb-install h3 { font-size: clamp(20px, 1.9vw, 27px); margin: .35em 0 .2em; }
#main .cb-install > .cb-small { margin: 0 0 10px; }
.cb-install .cb-scale { margin-top: 8px; }
/* Six steps, as one compact strip */
.cb-steps-s { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px clamp(14px, 1.6vw, 24px); margin-top: 18px; }
.cb-steps-s .cb-step { padding-top: 10px; }
#main .cb-steps-s .cb-step p:not(.cb-label) { font-size: 14.5px; line-height: 1.4; margin-top: 6px; }
#main .cb-axioms { margin-top: 16px !important; font-size: 13.5px !important; max-width: 60em; }
/* Three earlier milestones, details behind each */
.cb-ms-list { margin-top: 14px; border-top: 1px solid var(--cb-rule); }
.cb-ms { border-bottom: 1px solid var(--cb-rule); }
#main .cb-ms > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 10.5em minmax(0, 1fr) 16px; gap: 6px 18px; align-items: baseline; padding: 14px 0; }
#main .cb-ms > summary::-webkit-details-marker { display: none; }
#main .cb-ms > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--cb-ink); border-bottom: 1.5px solid var(--cb-ink); transform: rotate(45deg); justify-self: end; align-self: center; transition: transform .15s; }
#main .cb-ms[open] > summary::after { transform: rotate(-135deg); }
#main .cb-ms > summary .cb-label { color: var(--cb-ink); }
.cb-ms-line { font-size: clamp(16px, 1.2vw, 18px); color: var(--cb-ink); }
.cb-ms-body { padding: 0 0 18px; margin-left: calc(10.5em + 18px); max-width: 52em; }
#main .cb-ms-body p { font-size: 15.5px; line-height: 1.5; margin: 0 0 .8em; }
#main .cb-ms-body .cb-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cb-math.cb-inl { font-size: 1.08em; white-space: nowrap; }
#main .cb-h2-s { font-size: clamp(24px, 2.4vw, 34px); }
/* the goal */
#next .cb-goal { margin-top: 10px; border-top: 0; padding-top: 0; }
/* the web on a phone: each row's results, named */
.cb-web-legend text { font: 400 12px var(--cb-text); fill: var(--cb-body); }
.cb-web-legend .cb-web-legid { font: 700 11px var(--cb-mono); fill: var(--cb-ink); }
@media (max-width: 1100px) {
  .cb-steps-s { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb-big3 { width: 100%; }
}
@media (max-width: 640px) {
  .cb-herogrid > .cb-kicker { order: 0; } .cb-herogrid > .cb-h1 { order: 1; }
  .cb-herogrid > .cb-lede { order: 2 !important; display: block; }
  .cb-herogrid > .cb-band { height: auto; margin-top: 10px; }
  .cb-band #loop-canvas { height: clamp(360px, 54vh, 400px); }
  .cb-herogrid > .cb-hbar { display: contents; }
  .cb-herogrid .cb-ctlrow { order: 3; margin-top: 12px; gap: 6px; }
  .cb-herogrid > .cb-band { order: 4 !important; }
  .cb-herogrid .cb-big3 { order: 5; margin-top: 10px; }
  .cb-herogrid > .cb-now { order: 6; } .cb-herogrid > .cb-caveat { order: 7 !important; }
  #main .cb-ctlrow .cb-btn { min-height: 32px; padding: 5px 9px; font-size: 10.5px; }
  .cb-ctlrow .cb-label { display: none; }
  .cb-next-long { display: none; }
  .cb-band .cb-keys { position: static; padding: 8px 0 6px; visibility: visible !important; }
  .cb-ctlgap { margin-left: 0; }
  .cb-big3 { flex-wrap: wrap; gap: 10px 20px; }
  .cb-now { grid-template-columns: minmax(0, 1fr); }
  .cb-steps-s { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #main .cb-ms > summary { grid-template-columns: minmax(0, 1fr) 16px; }
  #main .cb-ms > summary .cb-label { grid-column: 1; }
  .cb-ms-line { grid-column: 1; }
  #main .cb-ms > summary::after { grid-column: 2; grid-row: 1 / span 2; }
  .cb-ms-body { margin-left: 0; }
  #main .cb-ms-body .cb-five { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Round 14: the band near the finish ---------- */
#main .cb-pg-title { font-size: clamp(18px, 1.5vw, 21px); margin: 2px 0 6px; }
#main .cb-pg-title-l { font-size: clamp(22px, 2vw, 28px); margin: 4px 0 8px; }
.cb-pg-tick { display: inline-block; width: 6px; height: 11px; border-right: 2px solid var(--cb-ok); border-bottom: 2px solid var(--cb-ok);
              transform: rotate(45deg) translate(-1px, -2px); margin: 0 9px 0 3px; }
.cb-pg-parts li.is-done { color: var(--cb-ok-text); }
#main .cb-pg-prev { margin: 14px 0 0; font-size: 14.5px; color: var(--cb-body); max-width: 46em; }
#main .cb-pg-prev b { color: var(--cb-ink); font-weight: 600; }
#main .cb-pg-since { margin: 6px 0 0; }

/* ---------- Round 14: critic 3 ---------- */
/* the key row is the record's label plus three real filter buttons */
#main .cb-band .cb-keys { gap: 6px 10px; }
#main .cb-keylab { font-family: var(--cb-mono); font-weight: 700; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--cb-ink); margin-right: 6px; }
#main .cb-keybtn { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 3px 9px; border: 1.5px solid var(--cb-ink);
                   border-bottom-width: 1.5px; background: var(--cb-paper); color: var(--cb-ink); font-size: 10.5px; }
#main .cb-keybtn::before { content: ""; width: 9px; height: 9px; background: var(--k); flex: none; }
#main .cb-keybtn:hover { background: color-mix(in srgb, var(--cb-ink) 8%, var(--cb-paper)); }
#main .cb-keybtn[aria-pressed="true"] { background: var(--cb-ink); color: var(--cb-paper); }
/* the claim card: long results are set smaller */
#main .cb-landed.is-long .cb-con { font-size: clamp(18px, 1.6vw, 22px); }
/* theorem cards: the area, then what the step does, then the count of forms */
.cb-thm-top { flex-wrap: wrap; gap: 4px 10px; justify-content: flex-start; }
.cb-thm-top > .cb-label:not(.cb-thm-kind) { order: 0; }
#main .cb-thm-kind { order: 1; color: var(--cb-soft); }
#main .cb-thm-kind::before { content: "· "; }
.cb-thm-top .cb-forms { order: 2; margin-left: auto; }
@media (max-width: 640px) {
  .cb-band #loop-canvas { height: 350px; }
  #main .cb-h1 { font-size: clamp(32px, 10vw, 42px); }
  #main .cb-hero .cb-lede { font-size: 16.5px; line-height: 1.34; }
  .cb-herogrid .cb-ctlrow { order: 5; margin-top: 10px; }
  .cb-herogrid .cb-big3 { order: 6; }
  .cb-herogrid > .cb-now { order: 7; } .cb-herogrid > .cb-caveat { order: 8 !important; }
  .cb-band .cb-keys { padding: 8px 0 4px; }
  #main .cb-keylab { flex-basis: 100%; font-size: 9.5px; }
  .cb-band .cb-keys { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }   /* fixed rows: no reflow when fonts land */
  #main .cb-keylab { grid-column: 1 / -1; }
  #main .cb-keybtn { min-height: 44px; padding: 5px 8px; font-size: 10px; line-height: 1.25; text-align: left; letter-spacing: .08em; }
  #main .cb-landed.is-long .cb-con { font-size: 16px; }
  #main .cb-landed .cb-con { font-size: 19px; }
}
#main .cb-pg-pnote { margin: 6px 0 0; }

/* Round 15: the estimate as a range, and why the tail is slow */
#main div.cb-pg-eta p { margin: 0; font-size: 14.5px; color: var(--cb-ink); max-width: 34em; }
#main div.cb-pg-eta p.cb-pg-slow { margin-top: 6px; color: var(--cb-body); }
#main .cb-install-note { max-width: 52em; font-size: 14.5px !important; }

/* ---------- Round 15: phone fixes ---------- */
/* hover styles only where there is a hover; touch never leaves a button looking pressed */
@media (hover: none) {
  #main .cb-btn:hover { background: none; color: var(--cb-ink); }
  #main .cb-btn[aria-pressed="true"]:hover { background: var(--cb-ink); color: var(--cb-paper); }
  #main .cb-keybtn:hover { background: var(--cb-paper); }
  .cb-tip-btn:hover::after { opacity: 0; }
}
#main #cb-play[aria-pressed] { background: none; color: var(--cb-ink); }   /* Play/Pause is an action, not a state */
#main #cb-play:hover { background: var(--cb-ink); color: var(--cb-paper); }
/* theorem cards: one square for the area, then what the step does in plain text */
#main .cb-thm-top .cb-thm-kind::before { content: "· "; width: auto; height: auto; background: none; }
/* anchors land below the sticky header */
#main .cb-thm, #main #theorems, #main #progress { scroll-margin-top: 96px; }
@media (max-width: 640px) {
  #main .cb-ctlrow .cb-btn { min-height: 44px; min-width: 44px; font-size: 11px; }
  .cb-back-long { display: inline; }
  #main .cb-keylab { font-size: 10.5px; }
  #main .cb-keybtn { font-size: 11px; }
  #main .cb-thm-top .cb-thm-kind { order: 3; flex-basis: 100%; }
  #main .cb-thm-top .cb-thm-kind::before { content: none; }
  .cb-bars.cb-why .cb-bars-head > .cb-label:last-child { display: none; }
  #main .cb-web-detail { position: sticky; bottom: 0; z-index: 2; background: var(--cb-paper); padding: 8px 0; margin: 0;
                         border-top: 1px solid var(--cb-rule); min-height: 0; }
  .cb-web-legend text { font-size: 12px; }
}
.cb-back-long { display: none; }
#main .cb-landed #cb-landed-title { margin: .45em 0 0; }

/* Round 17: craft and access */
/* a plain line under a theorem's title */
#main .cb-thm p.cb-lead { margin: -2px 0 12px; font-size: 15.5px; line-height: 1.45; color: var(--cb-body); max-width: 34em; }
/* the record's bars: every segment holds 3:1 against the page, in both themes */
.r-ref { --r: color-mix(in srgb, var(--cb-ink) 55%, transparent); }
.r-rep, .r-kept { --r: color-mix(in srgb, var(--cb-ok) 75%, transparent); }
.r-later { --r: color-mix(in srgb, var(--cb-ok) 28%, transparent); }
.cb-rbar span.r-later, .cb-rkey li.r-later::before { box-shadow: inset 0 0 0 1.5px var(--cb-ok); }
.cb-rbar span.r-none, .cb-rkey li.r-none::before { box-shadow: inset 0 0 0 1px var(--cb-hair); }
/* gold on a light page gets an ink edge, as in the record strip */
.cb-key-gold::before, #main .cb-keybtn.cb-key-gold::before, .cb-rkey li.r-lib::before, .cb-rbar span.r-lib { box-shadow: inset 0 0 0 1px var(--cb-gold-ink); }
@media (prefers-color-scheme: dark) {
  .cb-why .cb-bar i { background: var(--cb-no); }
}
/* reduced motion: nothing on this page slides, fades or spins */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #main *, #main *::before, #main *::after { transition-duration: 0s !important; animation: none !important; scroll-behavior: auto !important; }
}
/* letters in the plain lines are set in the math face, as in "Made from" (and Greek never pulls in another text font) */
#main .cb-thm .cb-lead i, #main .cb-thm .cb-gloss i { font-family: var(--cb-math); font-size: 1.08em; }
#main .cb-thm .cb-lead sup, #main .cb-thm .cb-gloss sup { line-height: 0; }

/* Round 18: the way back from a jump, and the web's one-line key */
.cb-backrow { display: flex; align-items: center; gap: 14px; margin: clamp(12px, 1.8vh, 18px) 0 0; min-width: 0; }
.cb-backrow[hidden] { display: none; }
#main .cb-backbtn { background: var(--cb-ink); color: var(--cb-paper); border-color: var(--cb-ink); }
#main .cb-backbtn:hover { background: var(--cb-paper); color: var(--cb-ink); }
.cb-backname { color: var(--cb-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 640px) { .cb-herogrid > .cb-backrow { order: 2; } .cb-backname { display: none; } #main .cb-backbtn { min-height: 44px; } }
#main .cb-web-how { margin: 6px 0 0; color: var(--cb-body); max-width: 60em; }
#main .cb-web-detail { margin-top: 18px; }
/* On a phone, "Made from" and "Terms" stay folded (each would add 140-250 px a card) behind toggles that look tappable */
@media (max-width: 640px) {
  #main .cb-made-d > summary, #main .cb-terms > summary { min-height: 44px; box-sizing: border-box; padding: 0 14px; margin: 4px 0 8px;
    border: 1.5px solid var(--cb-ink); color: var(--cb-ink); display: inline-flex; align-items: center; gap: 10px; }
  #main .cb-made-d[open] > summary, #main .cb-terms[open] > summary { background: var(--cb-ink); color: var(--cb-paper); }
}

/* Round 19: how the loop will learn, under the goal */
.cb-learn { margin-top: clamp(26px, 4vh, 40px); padding-top: 18px; border-top: 1px solid var(--cb-rule); max-width: 62em; }
#main .cb-learn ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 40px; }
#main .cb-learn li { margin: 0; color: var(--cb-body); }
#main .cb-learn li b { color: var(--cb-ink); font-weight: 650; }
#main .cb-learn-status { margin: 14px 0 0; color: var(--cb-ink); }
@media (max-width: 760px) { #main .cb-learn ul { grid-template-columns: minmax(0, 1fr); } }
