/* Joined by scripts/sync-nav.mjs (scripts/lib/asset-bundles.mjs) from /css/theme.css, /css/tabs/class-builder.css.
   Do not edit: change those and run npm run sync:nav. */
/* /css/theme.css */
/* ============================================================
   theme.css: four independent display axes, all opt-in.
   Loaded site-wide via each page's head + js/theme.js.

   Axis 1  data-theme="dark"        light  <->  dark
   Axis 2  data-palette="accessible" riso  <->  high-contrast, colourblind-safe
   Axis 3  data-textsize="lg|xl"     everything a size up, or two
   Axis 4  data-font="reading"       a face built to be unambiguous, with air

   Everything is driven by redefining the ~12 core tokens from
   base.css. Because the site's chrome and components read those tokens
   (var(--ink), var(--paper), var(--riso-pink)…), overriding them here
   restyles the whole page with no per-component work.

   The default (no attributes) stays the riso brand exactly as it was.
   ============================================================ */

/* ── DARK · riso identity, dark ground ─────────────────────── */
:root[data-theme="dark"] {
  --paper:            #14201b;
  --on-brand:         #14201b;   /* brand fills are light here, so dark text */
  --paper-white:      #1b2a24;
  --ink:              #e9f1ea;
  --ink-dim:          #b1c3b8;
  --ink-faint:        #7d8f85;

  --riso-pink:        #ff9ec4;
  --riso-pink-deep:   #ffb3d1;   /* emphasis reads *lighter* on dark */
  --riso-green:       #46d99f;
  --riso-green-deep:  #6fe6b8;
  --riso-coral:       #ff9e80;
  --riso-yellow:      #f2cf5c;

  --line:             rgba(233, 241, 234, 0.18);
  --line-strong:      rgba(233, 241, 234, 0.34);
}

/* ── ACCESSIBLE · light ────────────────────────────────────
   High contrast (near-black ink on white, AA+), and the pink/green
   pairing, the red-green colourblind trap, is replaced by
   blue/orange, which stays distinguishable in every common colour-
   vision deficiency. Hue never carries meaning alone on this site
   (labels, borders and shape do too), which is what makes the swap
   safe rather than merely different. */
:root[data-palette="accessible"] {
  --paper:            #ffffff;
  --on-brand:         #ffffff;   /* accessible fills are deep, so light text */
  --paper-white:      #ffffff;
  --ink:              #111418;
  --ink-dim:          #3d444d;   /* AA on white */
  --ink-faint:        #5a626c;   /* lifted from the faint riso tone */

  --riso-pink:        #c2410c;   /* orange, was pink */
  --riso-pink-deep:   #9a3412;
  --riso-green:       #1d63c9;   /* blue, was green */
  --riso-green-deep:  #174ea6;
  --riso-coral:       #b45309;   /* amber-brown, third distinct hue */
  --riso-yellow:      #a16207;   /* darkened so it holds on white */

  --line:             rgba(17, 20, 24, 0.30);
  --line-strong:      rgba(17, 20, 24, 0.52);
}

/* ── ACCESSIBLE · dark ─────────────────────────────────────
   Same blue/orange logic, brightened to hold contrast on a near-black
   neutral ground. */
:root[data-theme="dark"][data-palette="accessible"] {
  --paper:            #0c0e12;
  --on-brand:         #0c0e12;   /* fills lighten again on dark */
  --paper-white:      #15181e;
  --ink:              #f4f6f9;
  --ink-dim:          #c3ccd6;
  --ink-faint:        #98a2ae;

  --riso-pink:        #ff9e5c;   /* orange */
  --riso-pink-deep:   #ffb784;
  --riso-green:       #6ba6f5;   /* blue */
  --riso-green-deep:  #9cc4fb;
  --riso-coral:       #f0a35e;
  --riso-yellow:      #e2c14e;

  --line:             rgba(244, 246, 249, 0.22);
  --line-strong:      rgba(244, 246, 249, 0.40);
}

/* Smooth the switch, but never fight reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color 0.18s ease, color 0.18s ease; }
}

/* ============================================================
   The control. A small fixed panel, bottom-right, legible in all four
   modes because it too is built from tokens.
   ============================================================ */
.a11y-controls {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--riso-green);
}
.a11y-tab { display: none; border: 0; background: none; color: var(--ink); cursor: pointer; padding: 2px; line-height: 0; }
.a11y-tab svg { width: 18px; height: 18px; }
/* The closed button says what it is: a bare half-moon was missed by readers who came looking for text size. */
.a11y-tab-lbl { display: none; font-family: var(--font-body, inherit); font-size: 14px; font-weight: 700; color: var(--ink); }
.a11y-controls.a11y-min .a11y-tab { display: inline-flex; align-items: center; gap: 7px; }
.a11y-controls.a11y-min .a11y-tab-lbl { display: inline; }
.a11y-controls.a11y-min { border-radius: 999px; padding: 9px 14px; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a11y-hide { border: 0; background: none; color: var(--ink-faint); cursor: pointer; padding: 0 2px 2px; line-height: 0; }
.a11y-hide:hover { color: var(--ink); }
@media (pointer: coarse) {
  .a11y-hide { min-width: 26px; min-height: 26px; padding: 6px; line-height: 0; }
}
.a11y-hide svg { width: 12px; height: 12px; }
.a11y-controls.a11y-min .a11y-head,
.a11y-controls.a11y-min .a11y-btn,
.a11y-controls.a11y-min .a11y-rule,
.a11y-controls.a11y-min .a11y-seg-lbl,
.a11y-controls.a11y-min .a11y-seg,
.a11y-controls.a11y-min .a11y-lang-sel { display: none; }

.a11y-controls-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 2px 2px;
}
.a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.a11y-btn:hover { border-color: var(--ink); }
.a11y-btn svg { width: 15px; height: 15px; flex: none; }
.a11y-btn .on-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  margin-left: auto;
}
/* Pressed = this mode is active. */
.a11y-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-white);
  border-color: var(--ink);
}
.a11y-btn[aria-pressed="true"] .on-dot { background: var(--riso-green); border-color: var(--paper-white); }
.a11y-btn:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }

/* Text size: three stops, not a slider; a slider invites fiddling, three
   stops is a decision. The letters are drawn at the sizes they stand for. */
.a11y-rule { border: 0; border-top: 1px dashed var(--line-strong); margin: 8px 2px 7px; }
.a11y-seg-lbl {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); padding: 0 2px 4px;
}
.a11y-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.a11y-size {
  border: 0; border-right: 1.5px solid var(--line-strong);
  background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  padding: 7px 0 8px; cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.a11y-size { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.a11y-size-w { font-family: var(--font-body, inherit); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.a11y-size:last-child { border-right: 0; }
.a11y-size:hover { background: var(--paper-white); }
.a11y-size[aria-checked="true"] { background: var(--ink); color: var(--paper-white); }
.a11y-size:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: -3px; }
/* Language is a dropdown: one row however many languages there are. */
.a11y-seg-lbl[for] { display: block; }
.a11y-lang-sel {
  display: block; width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body, inherit); font-size: 14px;
  padding: 6px 12px; cursor: pointer;
}
.a11y-lang-sel:hover { background: var(--paper-white); }
.a11y-lang-sel:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }

/* The moon shows in light, the sun in dark: mirrors the games' toggle. */
.a11y-btn .icon-sun { display: none; }
:root[data-theme="dark"] .a11y-btn .icon-sun { display: block; }
:root[data-theme="dark"] .a11y-btn .icon-moon { display: none; }

@media (max-width: 560px) {
  /* A phone gets the whole panel, as a sheet along the bottom: labels, text
     size and language included. A student who needs bigger text is the
     student on a phone, so none of it is left to a wider screen. The small
     round button (a11y-min) still keeps it out of the page until pressed. */
  .a11y-controls { right: 10px; bottom: 10px; padding: 8px; }
  .a11y-controls:not(.a11y-min) { left: 10px; max-height: 80vh; overflow-y: auto; padding: 14px; gap: 10px; }
  .a11y-controls:not(.a11y-min) .a11y-btn { padding: 12px 14px; font-size: 14px; }
  .a11y-controls:not(.a11y-min) .a11y-size { padding: 12px 0; }
  .a11y-controls:not(.a11y-min) .a11y-lang-sel { padding: 11px 12px; font-size: 16px; }
  .a11y-controls.a11y-min { min-height: 44px; display: inline-flex; align-items: center; }
  .a11y-controls.a11y-min .a11y-tab { min-height: 44px; }
}

/* Cosmetic leak handling: the lesson-card icons are external two-tone
   (green/pink) SVG images, so page tokens can't reach inside them. In
   the accessible palette that green/pink clashes with the blue/orange
   scheme, so neutralise them to a quiet monochrome - decorative only,
   no meaning is carried by their colour. */
:root[data-palette="accessible"] .lesson-card-icon { filter: grayscale(1) contrast(0.95); }

/* Flat type in the accessible palette. The riso "misregistration" offset
   (a coloured text-shadow ghost behind headings) is a brand flourish, but
   it doubles the letterforms and lowers legibility - the opposite of what
   a high-contrast mode is for. Strip it so accessible type is crisp. */
:root[data-palette="accessible"] * { text-shadow: none !important; }
:root[data-palette="accessible"] main::after { opacity: 0 !important; }


/* ── TEXT SIZE · scale the surface, don't stretch the type ──
   The exam maker is drawn in fixed pixels, so growing only the words would
   burst its buttons and squeeze its option letters. Zooming the whole body
   keeps every proportion the design already has: bigger words in bigger
   boxes, with the same air between them.

   Two things zoom does not do for us. Media queries still measure the real
   viewport, so a desktop layout does not fall back to its phone one just
   because it got 30% bigger; the steps are therefore gentler the narrower
   the screen. And viewport units are not scaled, so `100vw` inside a zoomed
   body paints wider than the window; --zoom is published here for the
   handful of rules that need to divide it back out. */
:root { --zoom: 1; }
/* Steps sized for a reader who needs them, eased on a narrower window: the top
   bar is about 900px wide before zoom, and media queries do not see the zoom, so
   a big step on a small window pushed the bar off the screen. */
:root { --zoom: 1; }
:root[data-textsize="lg"] { --zoom: 1.25; }
:root[data-textsize="xl"] { --zoom: 1.5; }
:root[data-textsize="lg"] body { zoom: 1.25; }
:root[data-textsize="xl"] body { zoom: 1.5; }
@media (max-width: 1450px) {
  :root[data-textsize="xl"] { --zoom: 1.3; }
  :root[data-textsize="xl"] body { zoom: 1.3; }
}
@media (max-width: 1200px) {
  :root[data-textsize="lg"] { --zoom: 1.12; }
  :root[data-textsize="lg"] body { zoom: 1.12; }
  :root[data-textsize="xl"] { --zoom: 1.2; }
  :root[data-textsize="xl"] body { zoom: 1.2; }
}
@media (max-width: 1000px) {
  :root[data-textsize="lg"] { --zoom: 1.05; }
  :root[data-textsize="lg"] body { zoom: 1.05; }
  :root[data-textsize="xl"] { --zoom: 1.1; }
  :root[data-textsize="xl"] body { zoom: 1.1; }
}
@media (max-width: 820px) {
  :root[data-textsize="lg"] { --zoom: 1.2; }
  :root[data-textsize="lg"] body { zoom: 1.2; }
  :root[data-textsize="xl"] { --zoom: 1.35; }
  :root[data-textsize="xl"] body { zoom: 1.35; }
}
/* Zoom can leave a few pixels of a wide child past the edge; a reader at this size should never have to scroll sideways for them. */
:root[data-textsize], :root[data-textsize] body { overflow-x: clip; }
/* Wider spacing: the British Dyslexia Association's guidance is wider letter,
   word and line spacing; this is the whole of it, left to the reader to turn on. */
:root[data-spacing="wide"] body { letter-spacing: 0.04em; word-spacing: 0.12em; }
:root[data-spacing="wide"] p, :root[data-spacing="wide"] li, :root[data-spacing="wide"] td { line-height: 1.8; }
/* A lesson's own switches (HL, theme) are a fixed corner toolbar that zoom pushes past the right edge: let it scroll with the page, inside it. */
:root[data-textsize] .toolbar { position: absolute; left: .5rem; right: .5rem; justify-content: flex-end; }
/* Paper is paper: the setting is about this screen, not the printout. */
@media print { :root[data-textsize] body { zoom: 1 !important; } }

/* ── READING FONT · unambiguous letterforms, and room to breathe ──
   Not a "dyslexia font": those do not survive testing. What does help is a
   face whose b/d/p/q and I/l/1 cannot be confused, more space between the
   letters and the lines, and a shorter line to return from. Atkinson
   Hyperlegible was drawn for low vision by the Braille Institute; the rest
   is spacing. The stylesheet is fetched by js/theme.js only when the switch
   is on, so nobody downloads a font they never asked for. */
:root[data-font="reading"] {
  --font-display: 'Atkinson Hyperlegible', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --sans: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --serif: 'Atkinson Hyperlegible', system-ui, sans-serif;
}
:root[data-font="reading"] body {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  letter-spacing: 0.012em;
  word-spacing: 0.08em;
  line-height: 1.65;
}
/* The exam paper is set in a serif on purpose, it is a facsimile of a real
   paper, so it changes with everything else rather than staying the odd
   one out. */
:root[data-font="reading"] .sheet,
:root[data-font="reading"] .sheet .q,
:root[data-font="reading"] .qdemo,
:root[data-font="reading"] .lede,
:root[data-font="reading"] .sub,
:root[data-font="reading"] .figcap,
:root[data-font="reading"] .mis,
:root[data-font="reading"] h1, :root[data-font="reading"] h2, :root[data-font="reading"] h3 {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
}
:root[data-font="reading"] .sheet .q,
:root[data-font="reading"] .sheet .stem,
:root[data-font="reading"] .sheet .part,
:root[data-font="reading"] .sheet .opts li { line-height: 1.7; }
/* A long line is the other half of the problem: the eye has to find the
   start of the next one. */
:root[data-font="reading"] .sheet .stem-body,
:root[data-font="reading"] .sheet .ptext,
:root[data-font="reading"] .passage,
:root[data-font="reading"] .card p,
:root[data-font="reading"] .sub { max-width: 62ch; }
/* Mono stays mono: codes, units and the paper code are read character by
   character, and that is what a monospace is for. */
:root[data-font="reading"] .mono,
:root[data-font="reading"] code, :root[data-font="reading"] kbd,
:root[data-font="reading"] .sit-clock, :root[data-font="reading"] .code-chip { font-family: var(--font-mono); letter-spacing: 0; }


/* ── LANGUAGE · support around the question, never inside it ──
   The paper stays in the language of the exam. What arrives beside it is a
   translated rubric, a bilingual command term, and a glossary the reader can
   tap: in two modes, because the exam allows the word and not the
   definition. */
.i18n-rubric { display: block; font-family: var(--font-body, system-ui), system-ui, sans-serif; font-style: normal; color: var(--riso-green-deep); margin-top: 3px; }
.sheet .gl, .gl {
  font-weight: inherit; border-bottom: 1.8px dotted var(--riso-pink-deep);
  cursor: help; background: none;
}
.sheet .gl:hover, .gl:hover { background: color-mix(in srgb, var(--riso-pink) 22%, transparent); }
.gl-pop {
  position: absolute; z-index: 60; width: min(340px, calc(100vw / var(--zoom, 1) - 24px));
  background: var(--paper-white); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 11px; box-shadow: 4px 4px 0 var(--riso-pink);
  padding: 11px 13px; font-family: var(--font-body, system-ui), system-ui, sans-serif; font-size: 13.5px; line-height: 1.5;
}
.gl-w { font-weight: 700; font-size: 15px; }
.gl-w span { color: var(--riso-pink-deep); }
.gl-d { color: var(--ink-dim); font-size: 12.8px; margin-top: 5px; }
.gl-mode { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 6px; }
/* The paper prints as the exam prints: no dots, no glosses. */
@media print { .sheet .gl { border-bottom: 0; } .gl-pop, .i18n-offer { display: none !important; } }

/* Offered once, to a browser that is already set to the language. */
.i18n-offer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 70;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: min(680px, calc(100vw / var(--zoom, 1) - 24px));
  background: var(--paper-white); border: 1.5px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--riso-green); padding: 11px 14px; font-size: 13.5px; color: var(--ink);
}
.i18n-offer-en { color: var(--ink-dim); }
.i18n-offer button {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 12px; cursor: pointer;
  background: var(--paper); color: var(--ink);
}
.i18n-offer .i18n-yes { background: var(--riso-green); color: var(--on-brand); font-weight: 700; }
.i18n-offer button:hover { background: var(--riso-pink); color: var(--on-brand); }
@media (max-width: 560px) { .i18n-offer { left: 10px; right: 10px; transform: none; max-width: none; } }

/* ---------------------------------------------------------------- Chinese
   Two things the Latin-tuned chrome gets wrong for a language written in
   characters: a line can break between any two of them, so a nav tab or a
   button label splits down the middle; and the tracking that opens up small
   uppercase Latin labels only pushes hanzi apart. Both are fixed on the
   chrome, never on the paper; the questions stay English and keep their own
   typography.  */
:root[data-lang="zh"] .topbar,
:root[data-lang="zh"] .em-rail,
:root[data-lang="zh"] .em-start,
:root[data-lang="zh"] .dt-actions,
:root[data-lang="zh"] .a11y-controls,
:root[data-lang="zh"] .sit-top,
:root[data-lang="zh"] .sit-how { letter-spacing: normal; }

:root[data-lang="zh"] .topbar a,
:root[data-lang="zh"] .tab,
:root[data-lang="zh"] .em-btn,
:root[data-lang="zh"] .share-lbl,
:root[data-lang="zh"] .dice-lbl,
:root[data-lang="zh"] .take-btn,
:root[data-lang="zh"] .a11y-lang,
:root[data-lang="zh"] .sit-mini { white-space: nowrap; }

/* /css/tabs/class-builder.css */
/* The class builders (Tarsia, dominoes, picture reveal, pub quiz, revision maps),
   laid out like the escape rooms page: a hero with a small live example
   beside it, then "Build one for your topic" (from the question bank, or
   your own), then the editor. The topic picker itself is tools/topics.js. */

/* ---------- hero ---------- */
.cb-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px 44px; align-items: center; margin: 4px 0 30px; }
.cb-hero-text { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.cb-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.cb-hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(34px, 5vw, 54px); line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; }
.cb-hero h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--riso-pink-deep); }
.cb-hero p { margin: 0; max-width: 62ch; color: var(--ink-dim); font-size: 16.5px; line-height: 1.55; }
.cb-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.cb-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 17px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-white); color: var(--ink); font: inherit; font-family: var(--font-display); font-size: 15px; font-weight: 650; line-height: 1.3; text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.cb-btn:hover { transform: translateY(-1px); }
.cb-btn:active:not(:disabled) { transform: translate(1px, 1px); }
.cb-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper-white); }
.cb-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* The live example: a card beside the words, its own animation per tool. */
.cb-demo { position: relative; justify-self: end; width: min(100%, 360px); min-height: 220px; padding: 14px 16px; background: var(--paper-white); border: 1.5px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--riso-pink); overflow: hidden; }
.cb-demo-cap { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.cb-demo-cap b { font-weight: 500; color: var(--riso-green-deep); }

/* ---------- build one for your topic ---------- */
.cb-build { margin: 0 0 34px; }
.cb-build-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 12px; }
.cb-build-h h2 { margin: 0; font-family: var(--font-display); font-size: 26px; letter-spacing: -.01em; }
.cb-build-h span { color: var(--ink-dim); font-size: 15px; }
.cb-card { display: grid; gap: 14px; padding: 18px 20px; background: var(--paper-white); border: 1.5px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--riso-green); }
.cb-card > * { min-width: 0; }
.cb-pane[hidden] { display: none; }

/* Pills: a segmented switch, wrapping on a phone. */
.cb-seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--paper-white); }
.cb-seg button { border: 0; background: transparent; padding: 7px 13px; color: var(--ink); font: inherit; font-family: var(--font-display); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.cb-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper-white); }
/* hidden means hidden: the level pills on a course without levels, the
   course pills on a builder with one course */
.cb-seg[hidden], .cb-courses[hidden], .cb-go-act[hidden] { display: none; }
.cb-seg button:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: -3px; }
.cb-top { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.cb-courses { display: flex; flex-wrap: wrap; gap: 8px; }

/* Themes as tabs, one at a time. */
.cb-themes { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; border-bottom: 1.5px solid var(--line); }
.cb-themes[hidden] { display: none; }
.cb-themes button { position: relative; display: grid; justify-items: start; gap: 1px; margin-bottom: -1.5px; padding: 8px 12px 10px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink-dim); font: inherit; text-align: left; cursor: pointer; }
.cb-themes button b { font-family: var(--font-display); font-size: 14px; color: var(--ink); }
.cb-themes button span { font-size: 12px; white-space: nowrap; }
.cb-themes button i { position: absolute; top: 4px; right: 0; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--riso-pink); color: var(--on-brand); font-family: var(--font-mono); font-size: 12px; font-style: normal; text-align: center; }
.cb-themes button[aria-selected="true"] { border-bottom-color: var(--riso-pink-deep); color: var(--ink); }

.cb-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 22px; align-items: start; }
.cb-note { grid-column: 1 / -1; margin: 0 0 6px; color: var(--ink-dim); font-size: 14px; }
.cb-row { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; font-size: 14.5px; line-height: 1.3; cursor: pointer; }
.cb-row input { flex: none; accent-color: var(--riso-pink-deep); transform: translateY(1px); }
.cb-row .code { min-width: 3.2em; white-space: nowrap; font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
.cb-row .n { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.cb-row.off { opacity: .45; cursor: not-allowed; }
.cb-all { justify-self: start; padding: 6px 0; border: 0; background: none; color: var(--riso-pink-deep); font: inherit; font-size: 13.5px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.cb-go { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.cb-meter { flex: 1 1 260px; font-size: 14px; color: var(--ink-dim); }
.cb-meter.ready { color: var(--riso-green-deep); font-weight: 600; }
.cb-go-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cb-go-act label { font-size: 13.5px; color: var(--ink-dim); }
.cb-msg { margin: 0; font-size: 14px; color: var(--riso-green-deep); }
.cb-msg.bad { color: var(--riso-pink-deep); }

/* On a narrow phone a pill group wraps: each choice becomes its own pill. */
@media (max-width: 420px) {
  .cb-seg { gap: 6px; border: 0; border-radius: 0; overflow: visible; background: none; }
  .cb-seg button { border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-white); }
  .cb-seg button[aria-pressed="true"] { background: var(--ink); }
}
@media (max-width: 760px) {
  .cb-hero { grid-template-columns: minmax(0, 1fr); }
  .cb-demo { justify-self: start; }
  .cb-card { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .cb-demo *, .cb-demo *::before, .cb-demo *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
}
@media print { .cb-hero, .cb-build { display: none !important; } }

/* A CSV dragged over the pairs card (tools/csv-pairs.js): the whole card
   takes it, and says so. */
.pr-card.csv-over { position: relative; outline: 2.5px dashed var(--riso-green-deep); outline-offset: 5px; }
.pr-card.csv-over::after { content: "Drop the CSV to fill the table"; position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; border-radius: inherit; background: color-mix(in srgb, var(--paper-white) 88%, transparent); color: var(--ink); font-family: var(--font-display); font-size: 21px; font-weight: 650; pointer-events: none; }
.pr-csv-strip .csv-pick { flex: none; }
.pr-csv-strip small a { color: var(--riso-pink-deep); font-weight: 600; text-underline-offset: 2px; }

/* The ready-made packs' drawings ink their lines in currentColor, so they
   follow the theme. */
.pr-stock-thumb { color: var(--ink); }

/* AP Biology: a unit opens to its CED topics (tools/topics.js), as on the
   escape rooms page. */
.cb-unit { min-width: 0; }
.cb-topics { margin: 0 0 6px 24px; }
.cb-topics summary { width: max-content; max-width: 100%; padding: 2px 0; color: var(--riso-pink-deep); font-size: 13.5px; font-weight: 650; cursor: pointer; }
.cb-topics .cb-row { padding: 3px 0; font-size: 14px; }
.cb-topics .cb-row .code { min-width: 2.6em; }
/* Your saved: the list of a teacher's kept builds (js/saved-builds.js) */
.sb { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; position: relative; }
.sb[hidden] { display: none; }
.sb .sb-n { font-family: var(--font-mono, monospace); font-size: 12px; }
.sb .sb-note { font-size: 13px; color: var(--ink); opacity: .75; }
.sb .sb-list { flex-basis: 100%; min-width: min(420px, 100%); border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper-white); padding: 6px; display: grid; gap: 2px; }
.sb .sb-list[hidden] { display: none; }
.sb .sb-row { display: flex; align-items: center; gap: 6px; }
.sb .sb-open { flex: 1; min-width: 0; display: grid; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.sb .sb-open:hover { background: var(--bg3, rgba(0, 0, 0, .06)); }
.sb .sb-open strong, .sb .sb-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb .sb-open span { font-size: 13px; opacity: .7; }
.sb .sb-act { border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink); text-decoration: underline; cursor: pointer; padding: 6px; }
.sb .sb-empty { margin: 0; padding: 8px 10px; font-size: 14px; }

