/* Zenith · Biology Masterclass prototype
   Tokens follow design/Main.dc.html (v3). Dark only: Zenith has no light theme. */

:root {
  --bg: #0b0b0c;
  --surface: #151517;
  --surface-2: #1c1c1f;
  --surface-3: #232326;
  --line: #232326;
  --line-2: #2c2c30;
  --line-3: #3a3a3e;
  --text: #f5f5f7;
  --text-2: #d2d2d7;
  --muted: #a1a1a6;
  --faint: #8e8e93;

  /* Earned levels (spec 6.1). Only used where there is evidence. */
  --lv-not-started: #242428;
  --lv-seen: #3a3470;
  --lv-getting: #2f6fd6;
  --lv-nailed: #1fbf9f;
  --lv-spaced: #b6f36b;
  --flag: #ff9f0a;

  /* Feedback: always paired with words and a symbol. */
  --ok: #30d158;
  --ok-bg: rgba(48, 209, 88, 0.1);
  --bad: #ff6961;
  --bad-bg: rgba(255, 69, 58, 0.1);

  /* Zenith is marked by light, not hue. */
  --kz: #ffffff;
  --kz-glow: rgba(255, 255, 255, 0.4);
  --kz-soft: rgba(255, 255, 255, 0.07);

  /* The stage */
  --stage-bg: #101012;
  --stage-lamp: rgba(236, 228, 210, 0.07);

  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --r-stage: 22px;
  --r-panel: 16px;
  --r-control: 999px;
  --gutter: 56px;            /* same side padding as the dashboard pages (style.css .page) */
  --page-max: 1440px;        /* same max width as the dashboard pages */
  --read: 38rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

.mono { font-family: var(--mono); font-feature-settings: 'tnum' 1; }

/* ---------- Top bar ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px var(--gutter) 0;
  max-width: var(--page-max); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--text); color: var(--bg);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.proto-note {
  font-size: 12.5px; color: var(--muted);
  padding: 5px 11px; border-radius: var(--r-control);
  border: 1px solid var(--line-2); background: var(--surface);
}

/* Dashboard sub-page bar: matches .subpage-topbar in ~/app/static/style.css */
.subpage-topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  max-width: var(--page-max); margin: 0 auto; padding: 26px var(--gutter) 0; min-height: 36px;
}
.subpage-topbar .links { display: flex; gap: 22px; font-size: 15px; }
.subpage-topbar .links a { color: #2997ff; text-decoration: none; }
.subpage-topbar .links a:hover { color: #6cb8ff; }
.subpage-topbar .links a.dim { color: var(--faint); }
.subpage-topbar .links a.dim:hover { color: var(--text); }
.subpage-topbar .clock { font-size: 13px; color: var(--faint); }
.level-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; margin-right: 4px; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 6px 10px 6px 0; border-radius: 8px;
}
.back:hover { color: var(--text); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 18px; border-radius: var(--r-control);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-size: 14.5px; font-weight: 550; text-decoration: none; white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: #ffffff; border-color: #ffffff; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 10px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-control);
}
.seg button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 14px; border-radius: var(--r-control); font-size: 13.5px; font-weight: 550;
  min-height: 32px;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--surface-3); color: var(--text); }

/* ---------- Overview ---------- */

.overview {
  max-width: var(--page-max); margin: 0 auto;
  padding: 40px var(--gutter) 160px;
}
.ov-head { display: grid; gap: 14px; max-width: 46rem; }
.ov-title {
  margin: 6px 0 0; font-size: clamp(40px, 5.2vw, 60px); line-height: 1; font-weight: 700;
  letter-spacing: -0.045em; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
}
.ov-title .mono { font-size: 0.42em; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.ov-lede { margin: 0; font-size: 18px; line-height: 1.55; color: var(--text-2); max-width: 40rem; }
.ov-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.ov-flag {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted);
}
.ov-flag::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--flag); flex: none;
}

.route { list-style: none; margin: 48px 0 0; padding: 0; border-top: 1px solid var(--line); }
.route-item {
  display: grid; grid-template-columns: 44px minmax(0, 1.2fr) minmax(0, 1fr) 150px;
  gap: 24px; align-items: start; padding: 26px 0; border-bottom: 1px solid var(--line);
}
.route-step {
  font-family: var(--mono); font-size: 14px; color: var(--faint);
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; margin-top: 2px;
}
.route-item h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
.route-item h2 a { text-decoration: none; }
.route-item h2 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.route-desc { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.oc {
  display: inline-grid; grid-template-columns: 10px auto; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  padding: 4px 9px 4px 7px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface);
}
.oc i { width: 10px; height: 10px; border-radius: 3px; background: var(--lv-not-started); box-shadow: inset 0 0 0 1px #34343a; }
.oc-note { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); }
.route-status { display: grid; gap: 10px; justify-items: start; }
.status {
  font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px;
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); }
.status.is-missing { color: var(--muted); }
.status.is-missing::before { background: transparent; border: 1.5px dashed var(--muted); width: 8px; height: 8px; }

.measures {
  margin-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px;
}
.measures div { border-left: 1px solid var(--line-2); padding-left: 16px; }
.measures dt { font-size: 13px; color: var(--muted); }
.measures dd { margin: 4px 0 0; font-size: 15px; color: var(--text); line-height: 1.45; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; font-size: 12px; color: var(--faint); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.source-line { margin-top: 36px; font-size: 12.5px; color: var(--faint); max-width: 48rem; line-height: 1.55; }

/* ---------- Masterclass layout ---------- */

.mc {
  max-width: var(--page-max); margin: 0 auto;
  padding: 18px var(--gutter) 0;
  display: grid; grid-template-columns: minmax(0, var(--read)) minmax(0, 1fr);
  gap: clamp(28px, 3.4vw, 56px);
  align-items: start;
}
.mc-read { min-width: 0; padding-bottom: 220px; }
.mc-stage-col { position: sticky; top: 16px; min-width: 0; }

.mc-title {
  margin: 14px 0 0; font-size: clamp(36px, 3.6vw, 46px); line-height: 1.02; font-weight: 700;
  letter-spacing: -0.04em;
}
.anchor {
  margin: 22px 0 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: grid; gap: 6px;
}
.anchor-code { font-family: var(--mono); font-size: 13px; color: var(--text); }
.anchor p { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.55; }
.anchor small { font-size: 12.5px; color: var(--faint); line-height: 1.5; }

.why { margin: 22px 0 0; font-size: 18px; line-height: 1.6; color: var(--text-2); }

.lesson { margin-top: 12px; }
.sec {
  padding: 40px 0 8px; scroll-margin-top: 24px;
  border-top: 1px solid var(--line); margin-top: 36px;
  position: relative;
}
.sec:first-child { border-top: 0; margin-top: 0; }
.sec-num { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.sec h2 {
  margin: 6px 0 0; font-size: 27px; line-height: 1.15; font-weight: 650; letter-spacing: -0.025em;
}
.sec p, .sec li { font-size: 17px; line-height: 1.65; color: var(--text-2); }
.sec p { margin: 14px 0 0; max-width: 66ch; }
.sec strong { color: var(--text); font-weight: 600; }
.sec ul, .sec ol { margin: 14px 0 0; padding-left: 1.3em; max-width: 64ch; }
.sec li + li { margin-top: 6px; }
.sec.is-active h2 { color: var(--text); }
.sec.is-kz { box-shadow: -18px 0 0 -16px var(--kz); }

.term { color: var(--text); font-weight: 600; }
.struct-link {
  color: var(--text); text-decoration: underline; text-decoration-color: rgba(245, 245, 247, 0.35);
  text-underline-offset: 3px; text-decoration-thickness: 1px;
  background: none; border: 0; padding: 0; font-size: inherit; line-height: inherit; font-weight: inherit;
}
.struct-link:hover { text-decoration-color: var(--text); }

.steps { list-style: none; padding: 0 !important; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative; padding: 10px 0 10px 44px; border-radius: 10px;
  transition: background 0.2s;
}
.steps li::before {
  content: counter(step); position: absolute; left: 8px; top: 11px;
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-3);
  display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.steps li.is-on { background: var(--kz-soft); }
.steps li.is-on::before { border-color: var(--kz); color: var(--text); }

.chain {
  margin: 20px 0 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  display: grid; gap: 8px;
}
.chain-label { font-size: 13px; color: var(--muted); }
.chain-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.chain-row b { font-weight: 550; }
.chain-row .arrow { color: var(--faint); }

.confusion {
  margin: 20px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line);
}
.confusion h3 { margin: 0; font-size: 15px; font-weight: 650; }
.confusion p { margin: 6px 0 0; font-size: 15.5px; }

.callout-flag {
  margin: 18px 0 0; font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: baseline;
}
.callout-flag::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--flag); transform: translateY(-1px); }

/* Zenith note on a section (annotate on a section target) */
.kz-note {
  margin: 16px 0 0; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5); background: var(--kz-soft);
  font-size: 15px; color: var(--text); display: flex; gap: 10px; align-items: flex-start;
}
.kz-note .k { flex: none; }

/* ---------- Questions ---------- */

.q {
  margin: 26px 0 0; padding: 18px 18px 16px; border-radius: var(--r-panel);
  border: 1px solid var(--line-2); background: var(--surface);
  scroll-margin-top: 90px;
}
.q.is-kz { border-color: rgba(255, 255, 255, 0.7); box-shadow: 0 0 0 4px var(--kz-soft); }
.q-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.q-kind { font-size: 13px; color: var(--muted); }
.q-meta { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.q-text { margin: 8px 0 0 !important; font-size: 16.5px !important; color: var(--text) !important; line-height: 1.5 !important; }
.q-opts { display: grid; gap: 8px; margin-top: 14px; }
.q-opt {
  text-align: left; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text-2); font-size: 15px; line-height: 1.4;
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start;
  transition: border-color 0.2s, background 0.2s;
}
.q-opt:hover { border-color: var(--line-3); color: var(--text); }
.q-opt .key { font-family: var(--mono); font-size: 13px; color: var(--faint); padding-top: 1px; }
.q-opt.is-right { border-color: var(--ok); background: var(--ok-bg); color: var(--text); }
.q-opt.is-wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--text); }
.q textarea, .q input[type='text'] {
  width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  font-size: 15.5px; line-height: 1.5; resize: vertical;
}
.q textarea { min-height: 96px; }
.q textarea:focus, .q input:focus { outline: none; border-color: var(--muted); }
.q-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.q-fb { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.q-fb:empty { display: none; }
.fb-line { display: flex; gap: 10px; align-items: baseline; }
.fb-mark { font-weight: 650; flex: none; }
.fb-mark.ok { color: var(--ok); }
.fb-mark.bad { color: var(--bad); }
.q-provenance { margin-top: 12px; font-size: 12px; color: var(--faint); line-height: 1.5; }

.slots { display: grid; gap: 8px; margin-top: 12px; }
.slot {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 14.5px; line-height: 1.45;
}
.slot .tick { font-weight: 700; }
.slot.is-hit { border-color: rgba(48, 209, 88, 0.5); }
.slot.is-hit .tick { color: var(--ok); }
.slot.is-miss { border-style: dashed; border-color: var(--line-3); color: var(--muted); }
.slot.is-miss .tick { color: var(--muted); }
.slot-name { color: var(--text); font-weight: 600; }
.model {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg);
  border: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--text-2);
}

/* ---------- Stage ---------- */

.stage {
  border-radius: var(--r-stage); border: 1px solid var(--line);
  background: var(--stage-bg);
  overflow: hidden; position: relative;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
}
.stage.is-kz { border-color: rgba(255, 255, 255, 0.55); }
.stage-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line);
}
.stage-title { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; min-width: 0; }
.stage-title b { color: var(--text); font-weight: 600; }
.kz-flag {
  display: none; align-items: center; gap: 8px; font-size: 13px; color: var(--text);
  padding: 4px 6px 4px 10px; border-radius: var(--r-control); border: 1px solid rgba(255, 255, 255, 0.55);
}
.kz-flag.is-on { display: inline-flex; }
.kz-flag button { border: 0; background: var(--text); color: var(--bg); border-radius: var(--r-control); font-size: 12.5px; font-weight: 600; padding: 3px 10px; }

.stage-canvas {
  position: relative;
  background: radial-gradient(ellipse 60% 62% at 50% 52%, var(--stage-lamp), transparent 70%);
}
.stage-canvas svg { width: 100%; height: auto; touch-action: manipulation; }
.stage-foot {
  border-top: 1px solid var(--line); padding: 12px 16px; min-height: 64px;
  display: grid; gap: 4px; align-content: center;
}
.stage-caption { font-size: 12px; color: var(--faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stage-info { font-size: 14.5px; color: var(--text-2); line-height: 1.45; }
.stage-info b { color: var(--text); font-weight: 600; }
.stage-info .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }

.legend-list { display: none; }
.stage.is-compact .legend-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; list-style: none;
  margin: 0; padding: 10px 16px 0; font-size: 13px; color: var(--text-2);
}
.legend-list li { display: flex; gap: 8px; align-items: baseline; }
.legend-list .n { font-family: var(--mono); font-size: 11.5px; color: var(--muted); min-width: 16px; }

/* SVG styles */
.cell .s { transition: opacity 0.25s var(--ease); }
.cell .s.is-dim { opacity: 0.16; }
.cell .s .hit { fill: transparent; stroke: transparent; pointer-events: all; }
.cell .s .hit[fill='none'] { fill: none; pointer-events: stroke; }
.cell g[data-hl='ribosomes'] .ribo { fill: #ffffff; }
.cell .s.is-sub:not(.is-clickable) { pointer-events: none; }
.cell .sub-hl { opacity: 0; transition: opacity 0.2s var(--ease); }
.cell .s.is-sub.is-kz .sub-hl, .cell .s.is-sub.is-hover .sub-hl { opacity: 1; }
.cell .s.is-sub:focus-visible .sub-hl { opacity: 1; }
.cell g[data-hl='stroma'] .s[data-id='stroma'] .sub-hl,
.cell g[data-hl='granum'] .s[data-id='granum'] .sub-hl,
.cell g[data-hl='thylakoid'] .s[data-id='thylakoid'] .sub-hl,
.cell g[data-hl='starch-grain'] .s[data-id='starch-grain'] .sub-hl,
.cell g[data-hl='chloroplast-envelope'] .s[data-id='chloroplast-envelope'] .sub-hl { opacity: 1; }
.absent-note text { fill: var(--muted); font-family: var(--font); font-weight: 550; }
.cell .s.is-clickable { cursor: pointer; }
.cell .s:focus { outline: none; }
.cell .s.is-hover .shape, .cell .s:focus-visible .shape { filter: url(#hover-lift); }
.cell .s.is-kz .shape { filter: url(#kz-glow); }
.cell .s.is-cyto .shape { opacity: 0.32; }
.cell .s.is-cyto.is-kz .shape, .cell .s.is-cyto.is-shown .shape { opacity: 1; }

.lbl { transition: opacity 0.18s var(--ease); }
.lbl text { fill: var(--text-2); font-family: var(--font); font-weight: 500; }
.lbl line { stroke: #8f8a80; stroke-width: 1; vector-effect: non-scaling-stroke; }
.lbl circle { fill: #d9d3c4; }
.lbl.is-off { opacity: 0; pointer-events: none; }
.lbl.is-kz text { fill: #ffffff; font-weight: 650; }
.lbl.is-kz line { stroke: #ffffff; }
.lbl.is-blank text { fill: var(--muted); }

.num-marker circle { fill: #0e0e10; stroke: #d9d3c4; vector-effect: non-scaling-stroke; }
.num-marker text { fill: var(--text); font-family: var(--mono); font-weight: 600; }

.sel-ring { fill: none; stroke: var(--text); stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; stroke-width: 1.5; }
.kz-bracket { fill: none; stroke: var(--kz); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.kz-needle { stroke: var(--kz); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.kz-tip { fill: none; stroke: var(--kz); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.trace-path { fill: none; stroke: var(--kz); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0.9; }
.trace-dot circle { fill: var(--bg); stroke: var(--kz); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.trace-dot text { fill: var(--text); font-family: var(--mono); font-weight: 600; }
.test-mark circle { fill: var(--bg); stroke: var(--text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.test-mark text { fill: var(--text); font-family: var(--mono); font-weight: 700; }
.flash-ok .shape { filter: url(#ok-glow); }

/* Zenith callout over the stage (annotate on a structure) */
.kz-callout {
  position: absolute; z-index: 3; max-width: 240px;
  padding: 10px 12px; border-radius: 12px; background: rgba(16, 16, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8); color: var(--text);
  font-size: 13.5px; line-height: 1.45; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.kz-callout .who { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 2px; }

/* Test panel in the stage foot */
.test-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.test-row input {
  flex: 1 1 200px; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); font-size: 15px;
}
.test-row input:focus { outline: none; border-color: var(--muted); }
.score { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- Zenith dock ---------- */

.dock {
  position: fixed; z-index: 20; bottom: 16px;
  left: var(--dock-left, 16px); width: var(--dock-width, calc(100% - 32px));
  display: grid; gap: 8px;
}
.dock-panel {
  display: none; border-radius: 20px; border: 1px solid var(--line-2); background: var(--surface);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55); overflow: hidden;
  max-height: min(46vh, 430px); grid-template-rows: auto minmax(0, 1fr) auto;
}
.dock.is-open .dock-panel { display: grid; }
.dock.is-acting .dock-panel { border-color: rgba(255, 255, 255, 0.6); }
.dock-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 8px; flex-wrap: wrap;
  padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line);
}
.dock.is-min .dock-head { border-bottom: 0; }
.dock.is-min .dock-log, .dock.is-min .checks { display: none !important; }
.dock .min-btn { display: none; }
.dock.is-min .min-btn, .dock.is-acting .min-btn { display: inline-flex; }
.dock-state { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); min-width: 0; flex: 1 1 220px; }
.dock-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dock.is-acting .dock-state .dot { background: var(--kz); box-shadow: 0 0 0 4px var(--kz-soft); }
.dock-state .label { white-space: nowrap; }
.dock-state .sim { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.stage-info .kz-note { margin: 0 0 8px; font-size: 14px; padding: 9px 12px; }
.dock-tools .btn { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }
.dock-tools .stop { background: var(--text); color: var(--bg); border-color: var(--text); }
.dock-tools .stop[hidden] { display: none; }
.dock-log { overflow-y: auto; padding: 12px 16px; display: grid; gap: 10px; align-content: start; overscroll-behavior: contain; }
.msg { font-size: 15px; line-height: 1.55; color: var(--text-2); max-width: 62ch; }
.msg.me { justify-self: end; background: var(--surface-3); color: var(--text); padding: 8px 12px; border-radius: 14px 14px 4px 14px; }
.msg.kz { color: var(--text); }
.msg .ctx { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); }
.act {
  font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: baseline;
}
.act .mark { flex: none; font-weight: 700; color: var(--text); }
.act.is-rejected .mark, .act.is-error .mark { color: var(--bad); }
.act.is-cancelled .mark { color: var(--faint); }
.act code { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button {
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  border-radius: var(--r-control); padding: 6px 12px; font-size: 13px;
}
.suggest button:hover { border-color: var(--line-3); color: var(--text); }
details.ctx-json summary { cursor: pointer; font-size: 12px; color: var(--faint); }
details.ctx-json pre {
  margin: 6px 0 0; padding: 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow-x: auto; max-height: 220px;
}
.checks { padding: 10px 16px 12px; border-top: 1px solid var(--line); display: none; gap: 8px; }
.checks.is-open { display: grid; }
.checks p { margin: 0; font-size: 12.5px; color: var(--faint); }
.checks .row { display: flex; flex-wrap: wrap; gap: 6px; }

.dock-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px; border-radius: var(--r-control);
  background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.dock-bar .brand-mark { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; flex: none; }
.ctx-chip {
  display: none; align-items: center; gap: 6px; flex: none; max-width: 44%;
  padding: 4px 4px 4px 10px; border-radius: var(--r-control); border: 1px dashed var(--line-3);
  font-size: 12.5px; color: var(--text-2);
}
.ctx-chip.is-on { display: inline-flex; }
.ctx-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-chip button { border: 0; background: transparent; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.ctx-chip button:hover { background: var(--surface-3); color: var(--text); }
.dock-bar input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 15.5px; padding: 9px 4px;
}
.dock-bar input::placeholder { color: var(--faint); }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0;
  background: var(--surface-3); color: var(--text); display: grid; place-items: center;
}
.icon-btn:hover { background: var(--line-3); }
.icon-btn.send { background: var(--text); color: var(--bg); }
.icon-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- Microscopy page ---------- */

.mc.is-single { grid-template-columns: minmax(0, 46rem); justify-content: center; }
.mc.is-single .mc-stage-col { display: none; }

.figure {
  margin: 26px 0 0; border-radius: var(--r-stage); border: 1px solid var(--line); background: var(--stage-bg);
  overflow: hidden;
}
@media (min-width: 1100px) {
  .mc.is-single .figure.is-wide { margin-left: -6rem; margin-right: -6rem; }
}
.figure-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.figure-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.figure-head .note { font-size: 12px; color: var(--faint); }
.figure-body { padding: 16px; }
.figure-foot { padding: 0 16px 14px; font-size: 12px; color: var(--faint); line-height: 1.5; }

.compare { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14.5px; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.compare th { font-weight: 600; color: var(--text); font-size: 13.5px; }
.compare td { color: var(--text-2); }
.compare th:first-child, .compare td:first-child { color: var(--muted); font-weight: 500; width: 26%; }
.table-wrap { overflow-x: auto; }

.formula {
  margin: 20px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
  padding: 18px; border-radius: var(--r-panel); border: 1px solid var(--line-2); background: var(--surface);
}
.frac { display: inline-grid; text-align: center; font-size: 18px; }
.frac span:first-child { border-bottom: 1.5px solid var(--text-2); padding: 0 6px 4px; }
.frac span:last-child { padding: 4px 6px 0; }
.formula .eq { font-size: 18px; color: var(--text); }
.units {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 14px; color: var(--text);
}
.units .op { color: var(--muted); font-size: 12px; }

.res-demo { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; align-items: center; }
.res-view { border-radius: 14px; background: #08080a; border: 1px solid var(--line); aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; }
.res-view svg { width: 100%; height: 100%; }
.res-controls { display: grid; gap: 16px; }
.range { display: grid; gap: 6px; }
.range label { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); }
.range output { font-family: var(--mono); font-size: 13px; color: var(--muted); }
input[type='range'] { width: 100%; accent-color: #f5f5f7; }
.verdict { font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }

.bench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px); gap: 18px; align-items: start; }
.eyepiece { position: relative; border-radius: 50%; aspect-ratio: 1; background: #070708; border: 1px solid var(--line-2); overflow: hidden; touch-action: none; max-width: 520px; width: 100%; justify-self: center; }
.eyepiece svg { width: 100%; height: 100%; cursor: grab; }
.eyepiece svg.is-dragging { cursor: grabbing; }
.bench-side { display: grid; gap: 14px; }
.bench-step { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; background: var(--surface); }
.bench-step.is-locked { opacity: 0.45; }
.bench-step.is-done { border-color: rgba(48, 209, 88, 0.45); }
.bench-step h4 { margin: 0; font-size: 14px; font-weight: 650; display: flex; gap: 8px; align-items: baseline; }
.bench-step h4 .mono { font-size: 12px; color: var(--muted); font-weight: 500; }
.bench-step p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.field-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field-row label { font-size: 13px; color: var(--muted); }
.field-row input {
  width: 110px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg);
  font-family: var(--mono); font-size: 14px;
}
.field-row input:focus { outline: none; border-color: var(--muted); }
.field-row .unit { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.diag { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.diag:empty { display: none; }
.obj-switch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.practice { display: grid; gap: 12px; }
.practice .prob { font-size: 16px; color: var(--text); line-height: 1.55; }
.practice .prob .mono { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  :root { --read: 34rem; --gutter: 16px; }
  .route-item { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr); }
  .route-status { grid-column: 2 / -1; grid-auto-flow: column; justify-content: start; align-items: center; }
}

@media (max-width: 900px) {
  .mc { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
  .mc-stage-col { position: sticky; top: 0; z-index: 5; order: -1; margin: 0 calc(var(--gutter) * -1); background: var(--bg); padding: 8px var(--gutter) 8px; }
  .mc-stage-col .stage { border-radius: 16px; }
  .stage-foot { min-height: 0; padding: 8px 12px; }
  .stage-caption { display: none; }
  .mc-read { padding-bottom: 180px; }
  .stage-foot:has(.stage-info > .hint:only-child) { display: none; }
  .stage.is-compact .legend-list { font-size: 12.5px; gap: 2px 12px; padding: 6px 12px 8px; }
  .measures { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .bench { grid-template-columns: minmax(0, 1fr); }
  .res-demo { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .route-item { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .route-step { display: none; }
  .route-status { grid-column: auto; }
  .ov-lede { font-size: 16.5px; }
  .sec p, .sec li { font-size: 16.5px; }
  .proto-note { display: none; }
  .stage-bar { padding: 8px 8px 8px 12px; }
  .stage-title { font-size: 12.5px; }
  .seg button { padding: 5px 10px; font-size: 12.5px; }
  .dock { bottom: 8px; }
  .dock-panel { max-height: 58vh; }
  .icon-btn { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Masterclass v2 (7 Nov 2026): deeper lessons, plant and bacterial stages,
   Words page, mixed test, new question types and widgets.
   ========================================================================== */

/* Section furniture */
.sec-num { display: flex; gap: 10px; align-items: baseline; }
.sec-code { font-family: var(--mono); font-size: 12px; color: var(--faint); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; }
.sec h3.sub { margin: 30px 0 0; font-size: 18.5px; line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.mini-h { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.q-group { margin-top: 30px; }
.q-group > .mini-h { margin-bottom: -10px; }

/* The spec, word for word */
details.anchor { display: block; }
details.anchor summary { cursor: pointer; list-style: none; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
details.anchor summary::-webkit-details-marker { display: none; }
details.anchor summary::after { content: 'Show'; margin-left: auto; font-size: 12.5px; color: var(--faint); }
details.anchor[open] summary::after { content: 'Hide'; }
.anchor-sum { font-size: 13px; color: var(--muted); }
.anchor-list { margin: 12px 0 0; display: grid; gap: 10px; }
.anchor-list div { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
.anchor-list dt { font-size: 13px; color: var(--text); padding-top: 2px; }
.anchor-list dd { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.5; display: grid; gap: 3px; }
.anchor-list dd small { font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.anchor-src { display: block; margin-top: 12px; }

/* Contents */
.toc-wrap { margin: 26px 0 0; padding: 16px 18px; border-radius: var(--r-panel); border: 1px solid var(--line); }
.toc { margin: 0; padding: 0 0 0 1.4em; columns: 2; column-gap: 28px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.toc li { break-inside: avoid; padding: 2px 0; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Words, checks, model wording, worked examples */
.words-wrap, .checks-wrap { margin: 26px 0 0; }
.words { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.words div { display: grid; grid-template-columns: minmax(130px, 34%) minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.words dt { font-weight: 600; color: var(--text); font-size: 15px; line-height: 1.45; }
.words dd { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.checks-list { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 8px; max-width: none; }
.checks-list li { margin: 0 !important; padding: 10px 12px 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.ck-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.sec .ck-q { margin: 0; font-size: 15.5px; color: var(--text); line-height: 1.45; }
.ck-btn { flex: none; border: 1px solid var(--line-3); background: transparent; color: var(--text-2); border-radius: var(--r-control); padding: 4px 12px; font-size: 12.5px; min-height: 30px; }
.ck-btn:hover { color: var(--text); border-color: var(--muted); }
.sec .ck-a { margin: 8px 0 0; font-size: 15px; color: var(--text-2); padding-top: 8px; border-top: 1px dashed var(--line-3); }
.say { margin: 20px 0 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); border-left: 3px solid var(--text-2); }
.say h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.sec .say p { margin: 6px 0 0; font-size: 16px; color: var(--text); }
.worked { margin: 20px 0 0; display: grid; gap: 10px; }
.worked-ex { padding: 12px 16px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.worked-ex h4 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.sec .worked-ex p { margin: 5px 0 0; font-size: 15.5px; }
.full-answer { margin: 14px 0 0; padding-left: 1.4em; }
.full-answer li { padding-left: 4px; }

/* Views on the stage ("Two membranes", "Only in plant cells") */
.views-wrap { margin: 16px 0 0; }
.views { display: flex; flex-wrap: wrap; gap: 6px; }
.view-btn { border: 1px solid var(--line-3); background: transparent; color: var(--text-2); border-radius: var(--r-control); padding: 6px 14px; font-size: 13.5px; min-height: 34px; }
.view-btn:hover { color: var(--text); border-color: var(--muted); }
.view-btn[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.sec .view-note { margin: 10px 0 0; font-size: 14.5px; color: var(--text-2); }
.view-note:empty { display: none; }
.zoom-out[hidden] { display: none; }

/* Where next */
.mc-next { display: flex; flex-wrap: wrap; gap: 8px; margin: 56px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }

/* New question types */
.q-tick .tickbox { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-3); margin-top: 2px; }
.q-tick[aria-pressed='true'] .tickbox { background: var(--text); border-color: var(--text); box-shadow: inset 0 0 0 3px var(--bg); }
.q-tick[aria-pressed='true'] { border-color: var(--muted); color: var(--text); }
.q-opt.is-missed { border-color: var(--bad); border-style: dashed; }
.q-opt .note { grid-column: 2; font-size: 13.5px; color: var(--muted); }
.num-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.q .num-row input[type='text'] { margin-top: 0; max-width: 240px; font-family: var(--mono); }
.num-row .unit { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.num-row .unit.pre { color: var(--text); }
.sec .ord-hint { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.ord-list { list-style: none; margin: 10px 0 0 !important; padding: 0 !important; display: grid; gap: 6px; }
.ord-list:empty { display: none; }
.ord-list li { margin: 0 !important; }
.ord-item { width: 100%; text-align: left; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-3); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.4; }
.ord-item .n { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding-top: 1px; }
.ord-item .mk { font-weight: 700; }
.ord-item.is-right { border-color: var(--ok); background: var(--ok-bg); }
.ord-item.is-right .mk { color: var(--ok); }
.ord-item.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.ord-item.is-wrong .mk { color: var(--bad); }
.ord-pool { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ord-pool[hidden] { display: none; }
.ord-chip { border: 1px dashed var(--line-3); background: transparent; color: var(--text-2); border-radius: 10px; padding: 8px 12px; font-size: 14px; line-height: 1.35; text-align: left; }
.ord-chip:hover { border-color: var(--muted); color: var(--text); border-style: solid; }

/* Teaching figures */
.fig .figure-body { padding: 14px 16px 10px; }
.fig-svg { width: 100%; height: auto; }
.compare caption { caption-side: top; text-align: left; font-size: 12.5px; color: var(--faint); padding: 0 0 6px; }

/* Scale-bar bench */
.sb-view { border-radius: 14px; overflow: hidden; }
.sb-view svg { width: 100%; height: auto; }
.bench.sb { grid-template-columns: minmax(0, 1fr); }
.bench.sb .bench-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Spot the mistakes */
.dr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 18px; align-items: start; }
.dr-view svg { width: 100%; height: auto; border-radius: 12px; }
.dr-spot { cursor: pointer; outline: none; }
.dr-spot:focus-visible circle { stroke: #1a1a1a !important; stroke-dasharray: 3 3; }
.dr-side { display: grid; gap: 10px; }
.dr .dr-status { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.dr-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.dr-list:empty { display: none; }

/* Electron micrograph quiz */
.tem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 18px; align-items: start; }
.tem-view svg { width: 100%; height: auto; border-radius: 12px; }
.tem-side { display: grid; gap: 10px; }
.tem .tem-q { margin: 0; font-size: 15px; color: var(--text); font-weight: 550; }
.tem-opts { display: grid; gap: 6px; }

/* Three cells side by side */
.c3-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.c3-chip { border: 1px solid var(--line-3); background: transparent; color: var(--text-2); border-radius: var(--r-control); padding: 5px 12px; font-size: 13px; min-height: 32px; }
.c3-chip:hover { color: var(--text); border-color: var(--muted); }
.c3-chip[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.c3-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.c3-panel { border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 10px; background: #0e0e10; min-width: 0; }
.c3-panel h4 { margin: 2px 4px 4px; font-size: 13px; font-weight: 600; color: var(--text); }
.c3-canvas svg { width: 100%; height: auto; }
.c3 .c3-status { margin: 4px 4px 0; font-size: 12.5px; color: var(--muted); min-height: 1.4em; line-height: 1.4; }
.c3 .c3-status.is-yes { color: var(--text); }
.c3 .c3-note { margin: 12px 0 0; font-size: 14.5px; color: var(--text-2); min-height: 1.5em; }

/* Words page */
.words-page .views { margin-top: 28px; }
.fc { margin: 18px 0 0; display: grid; gap: 12px; max-width: 46rem; }
.fc-card { border-radius: var(--r-stage); border: 1px solid var(--line-2); background: var(--stage-bg); padding: 26px 26px 24px; min-height: 180px; display: grid; align-content: center; gap: 10px; }
.fc-meta { margin: 0; font-size: 12.5px; color: var(--faint); }
.fc-front { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 650; letter-spacing: -0.015em; color: var(--text); }
.fc-back { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text-2); padding-top: 12px; border-top: 1px solid var(--line-2); }
.fc-back[hidden] { display: none; }
.wl-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 40px 0 0; }
.wl-search { flex: 1 1 260px; max-width: 420px; padding: 10px 14px; border-radius: var(--r-control); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 15px; }
.wl-search:focus { outline: none; border-color: var(--muted); }
.wl-count { margin: 0; font-size: 13px; color: var(--faint); }
.wl-group { margin-top: 28px; }
.wl-group h2 { margin: 0 0 10px; font-size: 20px; font-weight: 650; letter-spacing: -0.015em; }
.wl-src { font-size: 12.5px; color: var(--faint); text-decoration: none; white-space: nowrap; }
.wl-src:hover { color: var(--text); text-decoration: underline; }

/* Mixed test */
.mt-score { margin: 18px 0 0; font-size: 15px; color: var(--text-2); }
.mt-q { padding-top: 26px; }
.mt-q .q { margin-top: 10px; }
.mt-again { margin-top: 30px; }

@media (max-width: 900px) {
  .toc { columns: 1; }
  .bench.sb, .dr, .tem { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .bench.sb .bench-side { grid-template-columns: minmax(0, 1fr); }
  .words div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .c3-grid { grid-template-columns: minmax(0, 1fr); }
  .c3-panel { display: grid; grid-template-columns: 44% minmax(0, 1fr); align-items: center; gap: 4px 10px; }
  .c3-panel h4 { grid-column: 2; grid-row: 1; align-self: end; }
  .c3-panel .c3-canvas { grid-column: 1; grid-row: 1 / span 2; }
  .c3-panel .c3-status { grid-column: 2; grid-row: 2; align-self: start; }
  .fc-front { font-size: 21px; }
  .fc-card { padding: 20px; }
}

/* ---------- Biology widgets on the TK topic pages (tk-bio.js) ---------- */
/* The cell stage and the microscopy benches draw their own frame, so the topic page's figure frame goes. */
figure.tk-fig.tk-bio-frame { border: 0; background: transparent; overflow: visible; border-radius: 0; }
figure.tk-fig.tk-bio-frame > .figure-head { padding: 0 0 10px; border: 0; }
figure.tk-fig.tk-bio-frame > .figure-body { padding: 0; }
figure.tk-fig.tk-bio-frame > .figure-foot { padding: 10px 2px 0; }
.tk-bio-host > .figure { margin: 0; }
.tk-bio-wait { margin: 0; padding: 28px 16px; color: var(--faint); font-size: 14px; }
.tk-cellstage .stage-canvas { min-height: 120px; }
.tk-cell-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 2px 16px; }
.tk-cell-tools[hidden] { display: none; }
.tk-cell-tools .view-btn { font-size: 13px; min-height: 32px; padding: 5px 12px; }
.tk-cell-tools .view-btn[aria-pressed='true'] { color: var(--text); border-color: var(--text-2); background: var(--surface-2); }
.tk-cellstage .stage-foot { min-height: 76px; }
.tk-cellstage .stage-info .hint { color: var(--muted); }
