/* Prism site styles. Loaded by index.html as app.css?v=<fingerprint> (the build stamps it). */
/* Layout: an optics bench. One idea enters as a beam and the prism splits it into five ways of learning
   (one colour each, red to violet). The library groups lessons by subject, each with its own colour;
   a lesson runs down the left with progress and the concept map on the right. */
:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #eceff4;
  --ink: #141821;
  --ink-2: #434a5a;
  --muted: #646b7b;
  --line: #d8dce4;
  --grid: #eceff4;
  --glass: #dde4f0;
  --focus: #2f5fd0;
  --button: #1a1f2c;
  --button-ink: #ffffff;
  --good: #17794a;
  --bad: #b0341d;
  --good-bg: #e6f4ec;
  --bad-bg: #fbeae6;
  --hc-ink-2: #1b202b;
  --hc-muted: #2c3240;
  --hc-line: #7a8292;
  --shadow: 0 10px 30px rgba(20, 24, 33, .14);
  --shadow-soft: 0 1px 2px rgba(20, 24, 33, .06), 0 4px 14px rgba(20, 24, 33, .05);
  --topbar-bg: rgba(243, 244, 247, .86);
  --l-analogy: #e0522f;
  --l-simulation: #c98a00;
  --l-maths: #14935f;
  --l-story: #2f6fd6;
  --l-socratic: #7a4fd1;
  --l-learn: #3b4556;
  --l-practice: #0f766e;
  --l-play: #c2255c;
  --s-physics: #3d5bd9;
  --s-chemistry: #0d8577;
  --s-biology: #3c8d2f;
  --s-maths: #c26a00;
  --s-english: #c0365e;
  --s-hindi: #a24a17;
  --font-display: "Spectral", "Noto Serif Devanagari", Georgia, "Times New Roman", serif;
  --font-body: "Prism Digits", "Atkinson Hyperlegible", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Prism Digits", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 12px;
  --topbar-h: 60px;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015; --surface: #161921; --surface-2: #1e222c; --ink: #eef0f5; --ink-2: #b9bfcc;
    --muted: #8e95a5; --line: #2b303b; --grid: #1d212a; --glass: #283042; --focus: #7aa2ff;
    --button: #eef0f5; --button-ink: #11141b; --good: #52c98c; --bad: #ff8c72; --good-bg: #14281e; --bad-bg: #2e1814;
    --hc-ink-2: #f6f7fa; --hc-muted: #dde1e8; --hc-line: #8a92a2; --shadow: 0 10px 30px rgba(0, 0, 0, .55);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); --topbar-bg: rgba(14, 16, 21, .86);
    --l-analogy: #ff7a55; --l-simulation: #f0b429; --l-maths: #3cc68f; --l-story: #6b9cf2; --l-socratic: #a585f2; --l-learn: #c3cad6; --l-practice: #2dd4bf; --l-play: #f06595;
    --s-physics: #7d95ff; --s-chemistry: #3cc3b0; --s-biology: #7ccd6a; --s-maths: #f0a040; --s-english: #f0789a; --s-hindi: #e8925a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1015; --surface: #161921; --surface-2: #1e222c; --ink: #eef0f5; --ink-2: #b9bfcc;
  --muted: #8e95a5; --line: #2b303b; --grid: #1d212a; --glass: #283042; --focus: #7aa2ff;
  --button: #eef0f5; --button-ink: #11141b; --good: #52c98c; --bad: #ff8c72; --good-bg: #14281e; --bad-bg: #2e1814;
  --hc-ink-2: #f6f7fa; --hc-muted: #dde1e8; --hc-line: #8a92a2; --shadow: 0 10px 30px rgba(0, 0, 0, .55);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); --topbar-bg: rgba(14, 16, 21, .86);
  --l-analogy: #ff7a55; --l-simulation: #f0b429; --l-maths: #3cc68f; --l-story: #6b9cf2; --l-socratic: #a585f2; --l-learn: #c3cad6; --l-practice: #2dd4bf; --l-play: #f06595;
  --s-physics: #7d95ff; --s-chemistry: #3cc3b0; --s-biology: #7ccd6a; --s-maths: #f0a040; --s-english: #f0789a; --s-hindi: #e8925a;
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 64px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.page { display: grid; gap: 0; min-height: 100%; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--focus); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page.easy { --font-body: "Lexend", "Noto Sans Devanagari", system-ui, sans-serif; letter-spacing: .01em; }
.page.lang-hi { line-height: 1.75; }
.page.lang-hi h1, .page.lang-hi h2, .page.lang-hi h3 { line-height: 1.35; }
.page.hc { --ink-2: var(--hc-ink-2); --muted: var(--hc-muted); --line: var(--hc-line); --grid: var(--hc-line); }
.page.hc :focus-visible { outline-width: 3px; }
.page.calm *, .page.calm *::before, .page.calm *::after { animation: none !important; transition: none !important; }

.kicker, .eyebrow { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.page.lang-hi .kicker, .page.lang-hi .eyebrow { letter-spacing: .02em; text-transform: none; font-family: var(--font-body); font-size: .8125rem; font-weight: 600; }
.note { font-size: .875rem; color: var(--muted); }
.error { color: var(--bad); font-size: .9375rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.row .spacer { flex: 1; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--button); background: var(--button); color: var(--button-ink); border-radius: 999px; padding: 9px 18px; cursor: pointer; font-weight: 700; font-size: .9375rem; text-decoration: none; line-height: 1.3; }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 600; }
.btn-ghost:hover { border-color: var(--ink-2); opacity: 1; }
.btn-small { padding: 5px 13px; font-size: .875rem; }
.btn svg { width: 16px; height: 16px; flex: none; }
.link-btn { border: 0; background: none; color: var(--focus); padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 13px; cursor: pointer; font-size: .875rem; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--button); color: var(--button-ink); font-weight: 700; }
.seg button:disabled { cursor: default; }
.input { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.input:focus-visible { outline-offset: 0; }
select.input { padding: 7px 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--topbar-bg); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar-inner { display: flex; align-items: center; gap: 10px 18px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.proto { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 2px 7px; border-radius: 999px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: .875rem; flex: 1 1 auto; min-width: 0; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top-nav { display: flex; align-items: center; gap: 2px; }
.menu-btn { display: none; }
.menu-btn svg { width: 18px; height: 18px; }
.lang button[lang="hi"] { font-family: "Noto Sans Devanagari", var(--font-body); }
.display-wrap { position: relative; }
.display-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 320px; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; }
.display-panel .head { display: flex; justify-content: space-between; align-items: center; }
.display-panel h2 { font-size: 1.1875rem; }
.setting { display: grid; gap: 6px; }
/* Option rows fill the panel with equal-width buttons, instead of a stretched pill with an empty tail. */
.display-panel .seg { display: flex; }
.display-panel .seg button { flex: 1 1 0; text-align: center; padding-inline: 8px; }
.display-panel .profile-list { justify-self: start; }
.display-panel .profile-list button { flex: 0 1 auto; padding-inline: 14px; }
.setting .label { font-size: .875rem; color: var(--ink-2); }
@media (max-width: 600px) {
  .display-panel { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); width: auto; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
  .crumbs { order: 3; flex-basis: 100%; }
  .top-actions .display-label { display: none; }
  .top-actions { flex-wrap: wrap; gap: 6px 8px; max-width: 100%; justify-content: flex-end; }
  .top-actions { flex-wrap: nowrap; }
  .menu-btn { display: inline-flex; padding: 6px 9px; }
  .top-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 16px 12px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-soft); z-index: 35; }
  .top-nav.open { display: flex; }
  .top-about { padding: 12px 4px; font-size: 1rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .top-about:last-child { border-bottom: 0; }
  .topbar-inner { position: relative; }
  .seg.lang button { padding: 6px 10px; }
  /* On a phone the top bar scrolls away, and the lens tabs stick to the top of the screen instead. */
  .topbar { position: static; }
  .proto { display: none; }
  .lens-bar { top: env(safe-area-inset-top, 0px) !important; }
}

/* Prism art */
.prism-art { width: 100%; max-width: 520px; height: auto; color: var(--ink); justify-self: center; }
.prism-art .glass { fill: var(--glass); fill-opacity: .7; stroke: var(--ink-2); stroke-width: 1.5; stroke-linejoin: round; }
.prism-art .beam-in { stroke: url(#beam-in); stroke-width: 4; stroke-linecap: round; }
.prism-art .beam-inside { stroke: var(--ink); stroke-opacity: .35; stroke-width: 3; }
.prism-art .beam line { stroke-width: 4; stroke-opacity: .55; stroke-linecap: round; transition: stroke-opacity .2s, stroke-width .2s; }
.prism-art .beam circle { fill-opacity: .55; transition: fill-opacity .2s; }
.prism-art .beam text { fill: var(--ink-2); font-family: var(--font-body); font-size: 15px; }
.prism-art .incoming-label { fill: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.lesson-art .beam { cursor: pointer; }
.lesson-art .beam line { stroke-opacity: .4; }
.lesson-art .beam circle { fill-opacity: .4; }
.lesson-art .beam text { fill: var(--muted); }
.lesson-art .beam.active line { stroke-width: 6; stroke-opacity: 1; }
.lesson-art .beam.active circle { fill-opacity: 1; }
.lesson-art .beam.active text { fill: var(--ink); font-weight: 700; }
.lesson-art .beam:hover line { stroke-opacity: .85; }
@media (max-width: 520px) { .prism-art .beam text, .prism-art .incoming-label { display: none; } }

/* Home */
.home { display: grid; gap: 44px; padding-block: 36px 56px; }
.home-hero { display: grid; gap: 36px; align-items: center; padding-top: 12px; }
@media (min-width: 900px) { .home-hero { grid-template-columns: 1.05fr 1fr; gap: 56px; } }
.home-hero h1 { font-size: clamp(2.25rem, 1.4rem + 3vw, 3.5rem); line-height: 1.08; letter-spacing: -0.02em; margin-top: 12px; max-width: 18ch; }
.home-hero .lede { font-size: 1.125rem; color: var(--ink-2); max-width: 50ch; margin-top: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.hero-stats { list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 0; border-top: 1px solid var(--line); padding-top: 18px; }
.hero-stats li { display: grid; gap: 2px; padding-right: 22px; margin-right: 22px; border-right: 1px solid var(--line); }
.hero-stats li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-stats b { font-family: var(--font-display); font-size: 1.625rem; font-weight: 600; line-height: 1.1; }
.hero-stats span { font-size: .8125rem; color: var(--muted); }
@media (max-width: 520px) { .hero-stats { grid-template-columns: repeat(2, auto); row-gap: 14px; } .hero-stats li:nth-child(2) { border-right: 0; margin-right: 0; padding-right: 0; } }
.hero-trust { margin-top: 14px; font-size: .875rem; color: var(--muted); }
.hero-continue { margin-top: 10px; font-size: .9375rem; }
.hero-continue a { color: var(--ink); font-weight: 600; }
.hero-shot { display: grid; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-soft), 0 24px 60px rgba(10, 14, 24, .18); color: inherit; text-decoration: none; overflow: hidden; transition: border-color .2s, transform .2s; }
.hero-shot:hover { border-color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .hero-shot:hover { transform: translateY(-2px); } }
.shot-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.shot-dots { display: flex; gap: 6px; }
.shot-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.shot-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 0; }
.shot-tab { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.shot-tab::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.shot-tab.on { border-color: var(--c); color: var(--ink); background: var(--surface-2); font-weight: 600; }
.shot-bench { display: block; margin: 12px 14px 0; border: 1px solid var(--line); border-radius: 12px; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; }
.shot-bench svg { display: block; width: 100%; height: auto; }
.shot-bench .wire { fill: none; stroke: var(--ink-2); stroke-width: 2.5; stroke-linejoin: round; }
.shot-bench .res { fill: none; stroke: var(--l-simulation); stroke-width: 3; stroke-linejoin: round; }
.shot-bench .cell-long { stroke: var(--ink); stroke-width: 3; }
.shot-bench .cell-short { stroke: var(--ink); stroke-width: 6; }
.shot-bench .meter-ring { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2.5; }
.shot-bench .meter-a { fill: var(--ink); font-family: var(--font-body); font-weight: 700; font-size: 16px; text-anchor: middle; }
.shot-bench .lbl { fill: var(--ink-2); font-family: var(--font-mono); font-size: 13px; }
.shot-bench .lbl.mid { text-anchor: middle; }
.shot-bench .flow { fill: var(--l-simulation); }
.shot-meters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 0; }
.shot-meter { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.shot-meter b { color: var(--ink); font-size: .9375rem; margin-left: 4px; }
.shot-meter.maths { color: var(--ink-2); }
.shot-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; padding: 14px; font-size: .875rem; color: var(--ink-2); }
.shot-go { color: var(--ink); font-weight: 700; white-space: nowrap; }
.subjects-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
.subjects-head .search { margin-top: 0; flex: 0 1 400px; }
.home-band { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .home-band { grid-template-columns: 1fr 1.6fr; } }
.setup-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 12px; align-content: start; box-shadow: var(--shadow-soft); }
.setup-card h2 { font-size: 1.375rem; }
.setup-card p { color: var(--ink-2); font-size: .9375rem; }
.setup-sum { display: grid; gap: 6px; margin: 0; font-size: .9375rem; }
.setup-sum div { display: flex; gap: 10px; }
.setup-sum dt { color: var(--muted); min-width: 6.5em; }
.setup-sum dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.how { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.how-item { border-top: 3px solid var(--c); padding-top: 12px; display: grid; gap: 6px; align-content: start; }
.how-item h3 { font-size: 1.125rem; }
.how-item p { color: var(--ink-2); font-size: .9375rem; }
.section-title { font-size: clamp(1.625rem, 1.2rem + 1.2vw, 2.125rem); }
.subjects { display: grid; gap: 36px; }
.subject-block { display: grid; gap: 14px; }
.subject-head { display: flex; gap: 12px; align-items: flex-start; }
.subject-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--s); margin-top: 8px; flex: none; }
.subject-head h2 { font-size: 1.5rem; }
.subject-head p { color: var(--ink-2); font-size: .9375rem; }
.lesson-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.lesson-card { position: relative; display: grid; gap: 8px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--s); border-radius: var(--radius); padding: 18px 20px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow-soft); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-2); border-top-color: var(--s); }
.lesson-card h3 { font-size: 1.375rem; }
.lesson-card p { color: var(--ink-2); font-size: .9375rem; }
.lesson-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: .8125rem; color: var(--muted); }
.lesson-go { margin-left: auto; color: var(--ink); font-weight: 700; font-size: .875rem; }
.meter-mini { display: inline-flex; gap: 3px; }
.meter-mini span { width: 14px; height: 5px; border-radius: 3px; background: var(--line); }
.meter-mini span.on { background: var(--good); }
.lesson-card.done .lesson-status { color: var(--good); font-weight: 700; }
.soon-card { border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 8px; align-content: start; color: var(--muted); }
.soon-card ul { margin: 0; padding-left: 1.1em; display: grid; gap: 2px; font-size: .9375rem; }
.mission { font-size: .9375rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 18px; }
.mission a { white-space: nowrap; }

/* Lesson */
.lesson { display: grid; gap: 22px; padding-block: 24px 56px; }
.hero { display: grid; gap: 18px; align-items: center; }
.lesson .hero .lede { max-width: 64ch; }
.hero h1 { font-size: clamp(2.25rem, 1.4rem + 3.2vw, 3.5rem); margin-top: 6px; letter-spacing: -0.01em; }
.hero .eyebrow { color: var(--s-current, var(--muted)); }
.lede { font-size: 1.125rem; color: var(--ink-2); max-width: 50ch; margin-top: 12px; }
.meta { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.meta li { font-size: .8125rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; background: var(--surface); }
.meta li.draft { border-color: var(--l-simulation); color: var(--ink); background: color-mix(in srgb, var(--l-simulation) 14%, var(--surface)); }
.meta li.reviewed { border-color: var(--l-maths); color: var(--ink); background: color-mix(in srgb, var(--l-maths) 14%, var(--surface)); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow-soft); }
.tool { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tool-label { font-size: .8125rem; color: var(--muted); }
.tool-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: .875rem; max-width: 100%; }
.tool-btn:hover { border-color: var(--ink-2); }
.tool-btn b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.tool-btn::after { content: "▾"; color: var(--muted); font-size: .75rem; }
.tool-sep { width: 1px; align-self: stretch; background: var(--line); }
@media (max-width: 640px) { .tool-sep { display: none; } .toolbar { gap: 10px; } }

.layout { display: grid; gap: 28px; align-items: start; }
.layout > * { min-width: 0; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } .rail { position: sticky; top: calc(var(--topbar-h) + 16px); } }
.lesson-main { display: grid; gap: 22px; min-width: 0; }
.rail { display: grid; gap: 16px; }

.overview { display: grid; gap: 18px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-soft); }
.words { border-top: 1px solid var(--line); padding-top: 14px; }
.words summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; list-style: none; }
.words summary::-webkit-details-marker { display: none; }
.words summary::after { content: "+"; margin-left: auto; font-size: 1.25rem; line-height: 1; color: var(--muted); }
.words[open] summary::after { content: "−"; }
.words summary h2 { display: inline; margin: 0; }
.words-count { font-size: .875rem; color: var(--muted); }
.words[open] .glossary { margin-top: 6px; }
.overview h2 { font-size: 1.1875rem; margin-bottom: 10px; }
.ideas { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ideas li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: .9375rem; }
.idea-num { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); }
.ideas li > div { display: grid; gap: 4px; }
.glossary { display: grid; gap: 8px; margin: 0; font-size: .9375rem; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: -6px 0 0; color: var(--ink-2); }
.pill { justify-self: start; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.page.lang-hi .pill { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .75rem; }
.pill.got { border-color: var(--good); color: var(--good); background: var(--good-bg); }
.pill.not { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }

/* Lens bar */
.lens-bar { position: sticky; top: var(--topbar-h); z-index: 20; background: var(--bg); padding-block: 8px 0; display: grid; gap: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tab { flex: 1 0 auto; min-width: 128px; border: 1px solid transparent; background: transparent; text-align: left; padding: 9px 12px; cursor: pointer; display: grid; gap: 2px; border-radius: 10px; }
.tab:hover { background: var(--surface-2); }
.tab-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9375rem; white-space: nowrap; }
.tab-blurb { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.tab-pick { font-family: var(--font-mono); font-size: .5625rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; font-weight: 500; }
.tab[aria-selected="true"] { background: var(--surface); border-color: var(--line); box-shadow: inset 0 -3px 0 var(--c), var(--shadow-soft); }
@media (max-width: 640px) { .tab { min-width: 0; padding: 8px 12px; } .tab-blurb { display: none; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 24px 28px; display: grid; gap: 18px; min-width: 0; box-shadow: var(--shadow-soft); }
.panel-head { display: grid; gap: 8px; }
.panel-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.panel-head h2 { font-size: 1.75rem; display: flex; align-items: center; gap: 12px; }
.glyph { width: 28px; height: 4px; border-radius: 2px; background: var(--c); flex: none; }
.panel-head p { color: var(--ink-2); max-width: 64ch; }
.panel-head p.style-note { font-size: .9375rem; color: var(--ink); background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-radius: 10px; padding: 8px 12px; max-width: 68ch; }
.listen[aria-pressed="true"] { border-color: var(--ink); }
.prose { display: grid; gap: 12px; max-width: 68ch; }
.prose h3 { font-size: 1.25rem; margin-top: 6px; }
.hint-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* Analogy cards */
.cards { display: grid; gap: 14px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; background: var(--surface); }
.card h3 { font-size: 1.3125rem; }
.card-head { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.page.lang-hi .tag { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .75rem; }
.tag-ai { background: color-mix(in srgb, var(--l-socratic) 16%, var(--surface)); color: var(--ink); }
.map-wrap { overflow-x: auto; }
.map { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.map th { text-align: left; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.page.lang-hi .map th { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .8125rem; }
.map td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--grid); vertical-align: top; }
.map td:first-child { width: 45%; color: var(--ink-2); }
.limit { font-size: .9375rem; color: var(--ink-2); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.thinking { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--ink-2); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--l-socratic); animation: pulse 1s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.8); } }

/* Simulation */
.sim-stage { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.sim-stage canvas { display: block; width: 100%; height: 300px; }
.sim-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
#sim-dom { padding: 18px; }
/* Virtual lab (sim kind "lab", lab.js): a circuit on an isometric bench, or the same circuit as a diagram */
#sim-dom:has(.lab) { padding: 12px 10px 4px; }
.lab { display: grid; gap: 10px; }
.lab-top { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; }
.lab-benches { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-bench { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .875rem; line-height: 1.3; cursor: pointer; }
.lab-bench[aria-pressed="true"] { background: var(--button); color: var(--button-ink); border-color: var(--button); font-weight: 700; }
.lab-pic svg { display: block; width: 100%; height: auto; max-height: 430px; margin: 0 auto; }
.lab-live { margin: 0; font-size: .875rem; color: var(--ink-2); min-height: 2.8em; }
.lab-svg { color: var(--ink); }
.lab-svg text { font-family: var(--font-body); font-size: 14px; fill: currentColor; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.lab-svg .lab-small { font-size: 13px; fill: var(--ink-2); }
.lab-svg .lab-pm { font-size: 17px; font-weight: 700; }
.lab-svg polygon { stroke: currentColor; stroke-opacity: .45; stroke-width: .8; stroke-linejoin: round; }
.lab-svg .s1, .lab-svg .s2 { fill: #000; stroke: none; }
.lab-svg .s1 { fill-opacity: .12; } .lab-svg .s2 { fill-opacity: .26; }
.lab-svg .bt { fill: var(--surface-2); } .lab-svg .bs1 { fill: var(--line); } .lab-svg .bs2 { fill: var(--line); opacity: .7; }
.lab-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lab-wire { stroke: currentColor; stroke-width: 2.5; }
.lab-sym { stroke: currentColor; stroke-width: 2.5; }
.lab-dot { fill: currentColor; }
.lab-dots { stroke: var(--l-simulation); stroke-width: 6; stroke-dasharray: 0 24; animation: lab-flow 1s linear infinite; }
@keyframes lab-flow { to { stroke-dashoffset: -24; } }
.lab.paused .lab-dots { animation-play-state: paused; }
.page.calm .lab-dots { display: none; }
@media (prefers-reduced-motion: reduce) { .lab-dots { display: none; } }
.lab-svg .lab-arrow { fill: var(--l-simulation); stroke: currentColor; stroke-opacity: .8; }
.lab-lever { stroke: var(--ink-2); stroke-width: 4; }
.lab-knob { fill: var(--l-analogy); stroke: currentColor; stroke-width: .8; }
.lab-fil { stroke: currentColor; stroke-width: 1.2; }
.lab-glass { stroke: currentColor; stroke-width: 1.2; }
.lab-nichrome { stroke: var(--ink-2); stroke-width: 2.2; }
.lab-haze { stroke: var(--muted); stroke-width: 1.5; }
.lab-enamel { stroke: #c0602a; stroke-width: 2; }
.lab-pin { stroke: var(--ink-2); stroke-width: 1.4; }
.lab-lead { stroke: var(--l-maths); stroke-width: 2.2; }
.lab-needle { stroke: var(--bad); stroke-width: 2; }
.lab-svg .lab-let { font-size: 11px; font-weight: 700; }
.lab-grid { stroke: var(--line); stroke-width: 1; }
.lab-vline { stroke: var(--muted); stroke-dasharray: 5 5; }
.lab-svg .lab-gdot { stroke: var(--surface); stroke-width: 2; }
.lab-hit { cursor: pointer; }
.lab-stepper { display: flex; align-items: center; gap: 8px; }
.lab-stepper output { min-width: 4.5em; text-align: center; }
.lab-step { min-width: 44px; min-height: 40px; padding: 4px 0; font-size: 1.125rem; }
.lab-switch { min-height: 40px; }
/* Test-tube rack (rack.js): the chosen tube, gas bubbles (still under reduced motion), a teacher-only warning */
.lab-svg .rack-sel { fill: var(--l-simulation); fill-opacity: .08; stroke: var(--l-simulation); stroke-width: 2; }
.lab-svg .rack-warn { fill: var(--bad); font-weight: 700; }
.lab-svg .rack-warm { fill: var(--bad); font-weight: 700; font-size: 14px; }
.rack-bub { fill: #fff; fill-opacity: .75; stroke: currentColor; stroke-opacity: .5; stroke-width: .8; transform-box: fill-box; animation: rack-rise 1.5s ease-in infinite; }
.rack-bub.b2 { animation-delay: .5s; } .rack-bub.b3 { animation-delay: 1s; }
@keyframes rack-rise { to { transform: translateY(-24px); opacity: 0; } }
.lab.paused .rack-bub { animation-play-state: paused; }
.page.calm .rack-bub { animation: none; }
@media (prefers-reduced-motion: reduce) { .rack-bub { animation: none; } }
/* Compass near a current (field.js): the card, wire, field lines, and the needle's swing (off under reduced motion) */
.lab-svg .fld-card { fill: var(--surface); stroke: currentColor; stroke-opacity: .35; }
.fld-wire { stroke: #c46a32; stroke-width: 5; }
.fld-post { stroke: var(--muted); stroke-width: 4; }
.fld-gap { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.lab-svg .fld-line { fill: none; stroke: var(--l-story); stroke-width: 1.6; stroke-opacity: .9; }
.lab-svg .fld-arrow { fill: var(--l-story); stroke: none; }
.fld-ndl { animation: fld-swing .6s ease-out; }
@keyframes fld-swing { from { transform: rotate(var(--d)); } }
.page.calm .fld-ndl { animation: none; }
@media (prefers-reduced-motion: reduce) { .fld-ndl { animation: none; } }
/* Coins and dice (trials.js): outcome tiles (favourable ones shaded), the relative-frequency line, and a short pop for a new result (off under reduced motion) */
.lab-pic svg.tri-svg { max-height: 600px; }
.tri-go { display: flex; flex-wrap: wrap; gap: 6px; }
.tri-go .btn[aria-disabled="true"], #tri-reset[aria-disabled="true"] { opacity: .55; }
.lab-svg .tri-big { font-size: 17px; font-weight: 700; }
.lab-svg .tri-lbl { font-size: 17px; font-weight: 700; }
.lab-svg .tri-hd { font-size: 13px; font-weight: 700; fill: var(--ink-2); }
.lab-svg .tri-n { font-family: var(--font-mono, monospace); }
.lab-svg .tri-coin { font-size: 20px; font-weight: 700; fill: #4a3600; stroke: none; }
.lab-svg .tri-fav { fill: var(--l-simulation); fill-opacity: .28; stroke: var(--l-simulation); stroke-width: 1.5; }
.lab-svg .tri-out { fill: var(--surface-2); stroke: currentColor; stroke-opacity: .3; }
.lab-svg .tri-last { stroke: currentColor; stroke-opacity: 1; stroke-width: 2.5; }
.lab-svg .tri-blank { fill: none; stroke: currentColor; stroke-opacity: .5; stroke-dasharray: 5 4; }
.lab-svg .tri-die { fill: var(--surface); stroke: currentColor; stroke-width: 1.5; }
.lab-svg .tri-pip { fill: currentColor; }
.lab-svg .tri-p { stroke: var(--l-maths); stroke-width: 2; stroke-dasharray: 6 5; }
.lab-svg .tri-pl { fill: var(--l-maths); font-weight: 700; }
.lab-svg .tri-rf { fill: none; stroke: var(--l-simulation); stroke-width: 2.5; stroke-linejoin: round; }
/* Optical bench (optics.js) */
.opt-slide { display: flex; align-items: center; gap: 6px; }
.opt-slide input[type="range"] { flex: 1; min-width: 0; }
.opt-slide .lab-step[aria-disabled="true"] { opacity: .55; }
.lab-svg .opt-rail { fill: var(--surface-2); stroke: currentColor; stroke-opacity: .4; }
.opt-tick { stroke: currentColor; stroke-opacity: .6; stroke-width: 1; }
.opt-axis { stroke: currentColor; stroke-opacity: .45; stroke-width: 1; stroke-dasharray: 6 5; }
.opt-stand { stroke: var(--muted); stroke-width: 3; }
.lab-svg .opt-glass { fill: var(--l-story); fill-opacity: .22; stroke: var(--l-story); stroke-width: 2; }
.opt-mirror { stroke: currentColor; stroke-width: 4; }
.opt-back { stroke: currentColor; stroke-opacity: .45; stroke-width: 4; stroke-dasharray: 2 3; }
.lab-svg .opt-wax { fill: #f1e6c8; stroke: #8a7a52; stroke-width: .8; }
.lab-svg .opt-wax-i { fill: #c9b27a; stroke: none; }
.lab-svg .opt-flame { fill: #f59e0b; stroke: none; }
.lab-svg .opt-light { fill: #f5b33a; fill-opacity: .16; stroke: none; }
.lab-svg .opt-card { fill: #f6f3ea; stroke: #6b6a63; stroke-width: 1; vector-effect: non-scaling-stroke; }
.lab-svg .opt-patch { fill: #f5a623; stroke: none; }
.lab-svg .opt-ok { fill: var(--good); font-weight: 700; }
.opt-ray { stroke: var(--l-simulation); stroke-width: 2; }
.opt-virt { stroke: var(--l-simulation); stroke-width: 1.6; stroke-dasharray: 5 5; }
.opt-obj { stroke: currentColor; stroke-width: 3; }
.opt-img { stroke: var(--l-analogy); stroke-width: 3; }
.opt-dash { stroke-dasharray: 5 4; }
.opt-scr { stroke: var(--muted); stroke-width: 4; stroke-opacity: .55; }
.lab-svg .opt-mark, .lab-svg .opt-oh { fill: currentColor; stroke: none; }
.lab-svg .opt-ih { fill: var(--l-analogy); stroke: none; }
.lab-svg .opt-rh { fill: var(--l-simulation); stroke: none; }
/* Plane mirrors (mirrors.js) */
.mir-hatch { stroke: currentColor; stroke-opacity: .5; stroke-width: 1.2; }
.mir-normal { stroke: currentColor; stroke-opacity: .7; stroke-width: 1.4; stroke-dasharray: 5 5; }
.mir-refl { stroke: var(--l-story); stroke-width: 2.5; }
.mir-arc { stroke: currentColor; stroke-opacity: .7; stroke-width: 1.4; }
.lab-svg .mir-rh { fill: var(--l-story); stroke: none; }
.lab-svg .mir-box { fill: var(--l-simulation); stroke: currentColor; stroke-width: 1; }
.lab-svg .mir-ang { font-weight: 700; }
.lab-svg .mir-eye { fill: var(--surface); stroke: currentColor; stroke-width: 1.5; }
.lab-svg .mir-word { font-size: 20px; font-weight: 700; fill: #1d2230; stroke: #f6f3ea; }
.lab-svg .mir-ring { fill: none; stroke: currentColor; stroke-opacity: .25; stroke-dasharray: 3 5; }
.lab-svg .mir-obj { fill: var(--l-analogy); stroke: currentColor; stroke-width: 1; }
.lab-svg .mir-img { fill: var(--l-analogy); fill-opacity: .35; stroke: var(--l-analogy); stroke-dasharray: 3 3; }
.lab-svg .mir-n { font-size: 11px; font-weight: 700; }
.lab-svg .mir-flip { transform-box: fill-box; transform-origin: center; transform: scaleX(-1); }
/* Light through glass (glass.js) */
.lab-svg .gl-glass { fill: var(--l-story); fill-opacity: .14; stroke: var(--l-story); stroke-width: 2; }
.gl-ray { stroke: currentColor; stroke-width: 2.5; }
.gl-c0 { stroke: #e5484d; } .gl-c1 { stroke: #f08c00; } .gl-c2 { stroke: #d4a800; } .gl-c3 { stroke: #2f9e44; }
.gl-c4 { stroke: #1c7ed6; } .gl-c5 { stroke: #4c3fc4; } .gl-c6 { stroke: #9c36b5; }
.gl-ghost { stroke: currentColor; stroke-opacity: .45; stroke-width: 1.4; stroke-dasharray: 5 5; }
.gl-shift { stroke: var(--l-analogy); stroke-width: 2; }
.lab-svg .gl-head { fill: currentColor; stroke: none; }
/* A block in a liquid (tank.js): the density table under the picture */
.lab-svg .tk-w { stroke: var(--l-analogy); fill: var(--l-analogy); stroke-opacity: 1; }
.lab-svg .tk-u { stroke: var(--l-maths); fill: var(--l-maths); stroke-opacity: 1; }
.tk-tables { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 4px 0; }
.tk-table { flex: 1 1 220px; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.tk-table caption { text-align: left; font-weight: 600; color: var(--ink-2); padding-bottom: 2px; }
.tk-table th, .tk-table td { padding: 2px 6px; border-bottom: 1px solid var(--line); text-align: right; font-weight: 400; }
.tk-table th:first-child { text-align: left; }
.tk-table thead th { color: var(--muted); font-size: .8125rem; }
.tk-table tr.tk-on th, .tk-table tr.tk-on td { font-weight: 700; background: var(--grid); }
/* A trolley on a track (track.js): the tape with a mark every second, and the two live graphs */
.lab-pic svg.trk-svg { max-height: 640px; }
.trk-go { display: flex; flex-wrap: wrap; gap: 6px; }
.trk-go .btn[aria-disabled="true"] { opacity: .55; }
.lab-svg .trk-clock { font-weight: 700; font-family: var(--font-mono, monospace); }
.lab-svg .trk-gt { font-size: 13px; font-weight: 700; }
.lab-svg .trk-buf { fill: var(--muted); stroke: currentColor; stroke-width: 1; }
.lab-svg .trk-tape { fill: var(--surface-2); stroke: currentColor; stroke-opacity: .35; }
.trk-tick { stroke: currentColor; stroke-width: 1.2; }
.lab-svg .trk-mark { fill: currentColor; }
.lab-svg .trk-ml { fill: var(--l-story); font-weight: 700; font-size: 12px; }
.lab-svg .trk-body { fill: var(--l-analogy); stroke: currentColor; stroke-width: 1.5; }
.lab-svg .trk-wheel { fill: var(--surface); stroke: currentColor; stroke-width: 1.5; }
.lab-svg .trk-pen { stroke: currentColor; stroke-width: 2; }
.lab-svg .trk-dl, .lab-svg .trk-vl { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.lab-svg .trk-dl { stroke: var(--l-maths); } .lab-svg .trk-vl { stroke: var(--l-simulation); }
.lab-svg .trk-area { fill: var(--l-simulation); fill-opacity: .3; stroke: none; }
.lab-svg .trk-tri { fill: var(--l-story); fill-opacity: .3; stroke: none; }
.lab-svg .trk-slope { stroke: currentColor; stroke-width: 1.6; stroke-dasharray: 5 4; }
.lab-svg .trk-pt { fill: currentColor; stroke: var(--surface); stroke-width: 1; }
.lab-svg .trk-now { fill: var(--l-simulation); stroke: var(--surface); stroke-width: 2; }
/* A pushed trolley (track.js): the push and friction arrows and the mass; two trolleys that collide (collide.js) */
.lab-svg .trk-fp, .lab-svg .trk-ff, .lab-svg .col-a1, .lab-svg .col-a2 { fill: none; stroke-width: 3; }
.lab-svg .trk-fp { stroke: var(--l-maths); } .lab-svg .trk-ff { stroke: var(--l-story); }
.lab-svg .col-a1 { stroke: var(--l-analogy); } .lab-svg .col-a2 { stroke: var(--l-maths); }
.lab-svg .trk-head { stroke: none; } .lab-svg .trk-fp.trk-head { fill: var(--l-maths); } .lab-svg .trk-ff.trk-head { fill: var(--l-story); }
.lab-svg .col-a1.trk-head { fill: var(--l-analogy); } .lab-svg .col-a2.trk-head { fill: var(--l-maths); }
.lab-svg .trk-kg { font-size: 10px; font-weight: 700; fill: var(--ink); stroke: none; }
.lab-svg .col-t1, .lab-svg .col-t2 { stroke: currentColor; stroke-width: 1.5; fill-opacity: .55; }
.lab-svg .col-t1, .lab-svg .col-b1 { fill: var(--l-analogy); } .lab-svg .col-t2, .lab-svg .col-b2 { fill: var(--l-maths); }
.lab-svg .col-b3 { fill: var(--l-story); }
/* A beaker on a burner (heat.js) */
.lab-pic svg.ht-svg { max-height: 620px; }
.lab-svg .ht-water { fill: #8fbfe8; fill-opacity: .55; stroke: none; }
.lab-svg .ht-ice { fill: #d4ecf4; stroke: currentColor; stroke-width: 1; stroke-opacity: .6; }
.lab-svg .ht-gas { fill: var(--muted); fill-opacity: .35; stroke: none; }
.lab-svg .ht-barbox { fill: none; stroke: currentColor; stroke-width: 1; stroke-opacity: .5; }
.lab-svg .ht-bub { fill: var(--surface); fill-opacity: .7; stroke: currentColor; stroke-width: .8; stroke-opacity: .6; }
.lab-svg .ht-steam { fill: none; stroke: currentColor; stroke-width: 2; stroke-opacity: .35; stroke-linecap: round; }
.lab-svg .ht-burner { fill: var(--muted); stroke: currentColor; stroke-width: 1.2; }
.lab-svg .ht-flame { fill: #f08a24; fill-opacity: .85; stroke: #d9480f; stroke-width: 1; }
.lab-svg .ht-tube { fill: var(--surface); stroke: currentColor; stroke-width: 1.2; }
.lab-svg .ht-red { fill: #d64541; stroke: none; }
.lab-svg .ht-key { stroke: currentColor; stroke-opacity: .55; stroke-dasharray: 4 4; }
.lab-svg .ht-big { font-size: 22px; font-weight: 700; font-family: var(--font-mono, monospace); }
.lab-svg .ht-key-sq { stroke: currentColor; stroke-width: 1; stroke-opacity: .5; }
.lab-svg .ht-line { fill: none; stroke: var(--l-simulation); stroke-width: 2.5; stroke-linejoin: round; }
/* Separating a mixture (sep.js): glassware, filter paper, grains, vapour; the table of where each part is */
.lab-pic svg.sep-svg { max-height: 520px; }
.lab-svg .sep-glass { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.lab-svg .sep-dish { fill: var(--surface); stroke: currentColor; stroke-width: 2; }
.lab-svg .sep-paper { fill: #f4f1e8; stroke: currentColor; stroke-width: 1; stroke-opacity: .7; }
.lab-svg .sep-dot { stroke: currentColor; stroke-width: .9; stroke-opacity: .7; }
.lab-svg .sep-wisp { fill: none; stroke: currentColor; stroke-width: 2; stroke-opacity: .35; stroke-linecap: round; }
.lab-svg .sep-cotton { fill: #fafafa; stroke: currentColor; stroke-width: 1; }
.lab-svg .sep-line { stroke: #555; stroke-width: 1.2; stroke-dasharray: 3 2; }
.lab-svg .sep-arrow { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lab-svg .sep-h { font-weight: 700; }
.lab-svg .sep-pole { fill: #fff; font-weight: 700; font-size: 13px; }
.sep-table { margin: 8px 4px 0; width: calc(100% - 8px); }
.sep-table th, .sep-table td { text-align: left; }
/* Sound in air and an echo (wave.js): layers of air as dots, the pressure graph, a wall and a timeline */
.lab-pic svg.wv-svg { max-height: 560px; }
.lab-svg .wv-col { stroke: currentColor; stroke-opacity: .8; stroke-width: 3.6; stroke-linecap: round; stroke-dasharray: 0 8; fill: none; }
.lab-svg .wv-col.wv-red { stroke: #d64541; stroke-opacity: 1; stroke-width: 4.6; }
.lab-svg .wv-tick { stroke: #d64541; stroke-width: 2; }
.lab-svg .wv-spk { fill: var(--muted); stroke: currentColor; stroke-width: 1.2; }
.lab-svg .wv-box { fill: none; stroke: currentColor; stroke-width: 1; stroke-opacity: .5; }
.lab-svg .wv-fill { fill: var(--l-simulation); stroke: none; }
.lab-svg .wv-line { fill: none; stroke: var(--l-simulation); stroke-width: 2.5; stroke-linejoin: round; }
.lab-svg .wv-lamk { fill: none; stroke: var(--l-story); stroke-width: 2; }
.lab-svg .wv-laml { fill: var(--l-story); font-weight: 700; font-size: 13px; }
.lab-svg .wv-man { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lab-svg .wv-wall { fill: var(--muted); stroke: currentColor; stroke-width: 1.2; }
.lab-svg .wv-min { stroke: var(--l-story); stroke-width: 1.5; stroke-dasharray: 5 4; }
.lab-svg .wv-pulse { fill: none; stroke: var(--l-simulation); stroke-width: 3; stroke-linecap: round; }
.lab-svg .wv-band { fill: var(--l-story); fill-opacity: .18; stroke: none; }
.lab-svg .wv-mk { stroke: currentColor; stroke-width: 2.5; }
.lab-svg .wv-mk.wv-echo { stroke: var(--l-simulation); }
.lab-svg .wv-now { stroke: var(--l-simulation); stroke-width: 2; stroke-dasharray: 3 3; }
.wv-row { flex-wrap: wrap; gap: 6px; }
.wv-row .lab-step { min-width: 48px; padding: 4px 6px; font-size: 1rem; }
.wv-row output { min-width: 5em; }
.wv-note { margin: 0; font-size: .875rem; color: var(--ink-2); }
.lab-svg .col-zero { stroke: currentColor; stroke-width: 1.2; }
.lab-svg .col-h { font-weight: 700; }
.lab-pic svg.col-svg { max-height: 460px; }
/* A clinometer (clino.js): the right triangle */
.lab-svg .cl-tw { fill: currentColor; fill-opacity: .14; stroke: currentColor; stroke-width: 1.5; }
.lab-svg .cl-sq { fill: none; stroke: currentColor; stroke-width: 1.5; }
.lab-svg .cl-hz { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 6 4; }
.lab-svg .cl-h { stroke: var(--l-analogy); stroke-width: 4; }
.lab-svg .cl-los { stroke: var(--l-maths); stroke-width: 2.5; }
.lab-svg .cl-arc { fill: none; stroke: var(--l-simulation); stroke-width: 2.5; }
.lab-svg .cl-pt { fill: var(--l-simulation); }
.lab-svg .cl-ht { fill: var(--l-analogy); font-weight: 700; }
/* A number line (line.js, the foundations steps): below zero shaded, 0 marked strongly, hops counting the steps */
.lab-svg .ln-below { fill: var(--l-story); fill-opacity: .13; }
.lab-svg .ln-bl { fill: var(--l-story); font-weight: 700; }
.lab-svg .ln-tick { stroke: currentColor; stroke-width: 1.5; }
.lab-svg .ln-zero { stroke: currentColor; stroke-width: 4; }
.lab-svg .ln-z { font-size: 22px; font-weight: 700; }
.lab-svg .ln-hop { stroke: var(--l-maths); stroke-width: 2; }
.lab-svg .ln-dot { fill: var(--l-simulation); stroke: var(--surface); stroke-width: 3; }
.lab-svg .ln-tag { fill: var(--surface); stroke: var(--l-simulation); stroke-width: 2; }
.lab-svg .ln-val { font-size: 18px; font-weight: 700; }
.lab-svg .ln-tube { fill: var(--surface); stroke: currentColor; stroke-opacity: .5; stroke-width: 1.5; }
.lab-svg .ln-liq { fill: var(--l-analogy); stroke: none; }
.lab-svg .ln-coin { fill: var(--l-simulation); stroke: currentColor; stroke-opacity: .5; }
.lab-svg .ln-owe { fill: none; stroke: var(--l-story); stroke-width: 1.5; stroke-dasharray: 3 2; }
.lab-svg .ln-hit { fill: transparent; stroke: none; }
.ln-ctl .opt-slide { gap: 10px; }
.ln-move { min-width: 56px; min-height: 48px; font-size: 1.375rem; }
.ln-zero-btn { min-height: 48px; }
@media (max-width: 560px) { .lab-svg.ln-svg text { font-size: 18px; } .lab-svg.ln-svg .lab-small { font-size: 17px; } .lab-svg.ln-svg .ln-z { font-size: 26px; } .lab-svg.ln-svg .ln-val { font-size: 22px; } .step-bench { padding: 8px 2px 2px; } }
/* Area tiles (tiles.js) */
.lab-svg .tl-p { stroke: currentColor; stroke-width: 1.5; }
.lab-svg .tl-k0 { fill: var(--l-maths); fill-opacity: .28; } .lab-svg .tl-k1 { fill: var(--l-simulation); fill-opacity: .3; }
.lab-svg .tl-k2 { fill: var(--l-analogy); fill-opacity: .3; } .lab-svg .tl-k3 { fill: none; stroke-dasharray: 6 4; }
.lab-svg .tl-cut { stroke: var(--bad); stroke-width: 2; stroke-dasharray: 6 4; }
.tl-hl { stroke: var(--bad); stroke-width: 2; stroke-opacity: .55; }
.tl-grid { stroke: currentColor; stroke-opacity: .15; stroke-width: 1; }
.lab-svg .tl-lbl { font-size: 17px; font-weight: 700; } .lab-svg .tl-n { font-size: 13px; font-weight: 700; } .lab-svg .tl-tot { font-weight: 700; }
.lab-svg .tri-dot { fill: var(--l-simulation); stroke: var(--surface); stroke-width: 2; }
.tri-new { transform-box: fill-box; transform-origin: center; animation: tri-pop .35s ease-out; }
@keyframes tri-pop { from { transform: rotate(-30deg) scale(.6); opacity: .3; } }
.page.calm .tri-new { animation: none; }
@media (prefers-reduced-motion: reduce) { .tri-new { animation: none; } }
@media (max-width: 560px) { #sim-dom:has(.lab) { padding: 10px 4px 4px; } .lab-svg text { font-size: 16px; } .lab-svg .lab-small { font-size: 15px; } }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--l-simulation); margin-right: 6px; vertical-align: -1px; }
.controls { display: grid; gap: 14px 22px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.controls:empty { display: none; }
.control { display: grid; gap: 6px; font-size: .9375rem; }
.control label, .control .label { color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.control output, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.control input[type="range"] { width: 100%; accent-color: var(--l-simulation); }
.readout { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; }
.readout .eq { font-family: var(--font-mono); font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.page.lang-hi .readout .eq { font-family: var(--font-body); }
.readout .eq b { font-weight: 600; color: var(--ink); }
.readout .note { margin-left: auto; }
.readout-sep { color: var(--muted); padding: 0 6px; }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tasks li { display: flex; gap: 10px; align-items: flex-start; }
.task-mark { flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; border: 1.5px solid var(--muted); position: relative; }
.tasks li.done .task-mark { background: var(--good); border-color: var(--good); }
.tasks li.done .task-mark::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tasks li.done span:last-child { color: var(--muted); }
#sim-tone[aria-pressed="true"] { background: var(--l-simulation); border-color: var(--l-simulation); color: #111111; }

/* Word simulations (grammar) */
.word-task { display: grid; gap: 14px; }
.word-head { display: grid; gap: 6px; }
.word-q { font-weight: 700; font-size: 1.0625rem; display: flex; align-items: center; gap: 10px; }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.words.hindi { font-size: 1.25rem; }
.word { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 1.125rem; display: inline-grid; gap: 2px; justify-items: center; line-height: 1.3; }
.word:hover:not(:disabled) { border-color: var(--ink-2); }
.word:disabled { cursor: default; }
.word.plain { border-style: dashed; color: var(--muted); }
.word-tag { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.word.role-S { border-color: var(--l-story); background: color-mix(in srgb, var(--l-story) 14%, var(--surface)); }
.word.role-V { border-color: var(--l-analogy); background: color-mix(in srgb, var(--l-analogy) 14%, var(--surface)); }
.word.role-O { border-color: var(--l-maths); background: color-mix(in srgb, var(--l-maths) 14%, var(--surface)); }
.word.role-N { border-color: var(--l-socratic); background: color-mix(in srgb, var(--l-socratic) 14%, var(--surface)); }
.role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.role-dot.role-S { background: var(--l-story); } .role-dot.role-V { background: var(--l-analogy); } .role-dot.role-O { background: var(--l-maths); }
.role-chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-family: var(--font-body); font-size: .875rem; color: var(--muted); }
.role-chip.on.role-S { border-color: var(--l-story); color: var(--ink); background: color-mix(in srgb, var(--l-story) 14%, var(--surface)); }
.role-chip.on.role-V { border-color: var(--l-analogy); color: var(--ink); background: color-mix(in srgb, var(--l-analogy) 14%, var(--surface)); }
.role-chip.on.role-O { border-color: var(--l-maths); color: var(--ink); background: color-mix(in srgb, var(--l-maths) 14%, var(--surface)); }
.arrow { color: var(--muted); }
.word-msg { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); }
.word-msg.good { background: var(--good-bg); color: var(--ink); box-shadow: inset 3px 0 0 var(--good); }
.word-msg.bad { background: var(--bad-bg); color: var(--ink); box-shadow: inset 3px 0 0 var(--bad); }
.swap-box { border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.classify { display: grid; gap: 10px; }
.classify-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.classify-word { font-size: 1.25rem; font-weight: 700; min-width: 5em; }

/* Maths */
math { font-family: math, "STIX Two Math", "Cambria Math", "Latin Modern Math", serif; font-size: 1.15em; }
.eqn { padding: 12px 16px; background: var(--surface-2); border-radius: 10px; overflow-x: auto; }
.symbols { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.symbols dt { font-family: var(--font-mono); font-weight: 500; }
.symbols dd { margin: 0; color: var(--ink-2); }
.worked { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.worked h3 { font-size: 1.1875rem; }
.rule-box { border-left: 3px solid var(--l-maths); background: color-mix(in srgb, var(--l-maths) 8%, var(--surface)); border-radius: 0 10px 10px 0; padding: 10px 14px; display: grid; gap: 4px; }
.example-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: grid; gap: 4px; }
.example-box .en { font-size: 1.0625rem; }
.derive { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.derive-title { margin: 0; font-weight: 700; }
.derive-steps { margin: 0; padding-left: 1.6em; display: grid; gap: 12px; }
.derive-steps > li { padding-left: 4px; }
.derive-steps > li > p { margin: 0 0 6px; }
.derive-steps > li:focus { outline: none; }
.derive-steps > li:last-child .eqn { box-shadow: inset 0 0 0 1px var(--ink-2); }
.derive-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.calc { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.calc .control { min-width: 130px; flex: 1 1 130px; }
.calc-out { font-family: var(--font-mono); font-size: 1.0625rem; padding: 8px 0; flex: 1 1 200px; }
.page.lang-hi .calc-out { font-family: var(--font-body); }
details { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
details summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: 10px; }
.page.lvl-simple .hide-simple { display: none !important; }
.page:not(.lvl-simple) .only-simple { display: none !important; }

/* Light simulation extras */
.spectrum-wrap { display: grid; gap: 6px; }
.spectrum-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.spectrum-wrap .label { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.spectrum { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-size: .75rem; }
.spectrum .band { flex: 1 1 0; min-width: 0; padding: 5px 2px; text-align: center; color: var(--ink-2); border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spectrum .band:last-child { border-right: 0; }
.spectrum .band.visible { flex: .8 1 0; }
.spectrum .band.visible span { background: rgba(255, 255, 255, .88); color: #111111; border-radius: 3px; padding: 0 3px; font-weight: 700; }
.spectrum .abbr { display: none; }
@media (max-width: 560px) { .spectrum .full { display: none; } .spectrum .abbr { display: inline; } }
.vis-bar { position: relative; height: 16px; border-radius: 4px; }
.vis-marker { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: var(--ink); border: 1px solid var(--surface); border-radius: 2px; }
.vis-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: -3px; margin-right: 8px; border: 1px solid var(--line); }

/* Story */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 0 18px; position: relative; padding-bottom: 20px; }
.timeline li::before { content: ""; position: absolute; left: 109px; top: 14px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .year { font-family: var(--font-mono); font-size: .875rem; color: var(--ink-2); text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; }
.timeline .entry { padding-left: 20px; position: relative; display: grid; gap: 4px; }
.timeline .entry::before { content: ""; position: absolute; box-sizing: border-box; left: -6px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--l-story); }
.timeline li.highlight .entry::before { background: var(--l-story); }
.timeline .who { font-weight: 700; }
.timeline .idea { font-size: .875rem; color: var(--muted); font-style: italic; }
@media (max-width: 520px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .timeline li::before, .timeline .entry::before { display: none; }
  .timeline .year { text-align: left; color: var(--l-story); }
  .timeline .entry { padding-left: 0; }
}

/* Questions (Socratic) */
.chat { display: grid; gap: 10px; max-height: 480px; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.tutor { background: var(--surface-2); border-bottom-left-radius: 4px; justify-self: start; }
.bubble.learner { background: color-mix(in srgb, var(--l-socratic) 14%, var(--surface)); border-bottom-right-radius: 4px; justify-self: end; }
.bubble.feedback-good { box-shadow: inset 3px 0 0 var(--good); }
.bubble.feedback-bad { box-shadow: inset 3px 0 0 var(--bad); }
.who-label { display: block; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.page.lang-hi .who-label { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: .75rem; }
.chat-form { display: grid; gap: 8px; }
.chat-form textarea { resize: vertical; min-height: 64px; }
.options { display: grid; gap: 8px; }
.option-btn { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.option-btn:hover { border-color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--muted); }
.status .dot { --c: var(--muted); }
.status.on .dot { --c: var(--good); }

/* Check */
.check { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 24px 28px; display: grid; gap: 18px; box-shadow: var(--shadow-soft); }
.check h2 { font-size: 1.75rem; }
.check-intro { color: var(--ink-2); max-width: 64ch; }
.check-form { display: grid; gap: 22px; }
.q { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.q legend, .q .q-label { font-weight: 700; padding: 0; margin-bottom: 8px; display: flex; gap: 10px; }
.q-num { font-family: var(--font-mono); color: var(--muted); font-weight: 500; flex: none; }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.opt:hover { border-color: var(--ink-2); }
.opt input { margin-top: 4px; accent-color: var(--ink); flex: none; }
.opt.correct { border-color: var(--good); background: var(--good-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.fb { border-radius: 10px; padding: 10px 14px; display: grid; gap: 6px; font-size: .9375rem; background: var(--surface-2); }
.verdict { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.verdict svg { width: 16px; height: 16px; flex: none; }
.check textarea { width: 100%; min-height: 96px; resize: vertical; }
.idea-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.idea-rows li { display: flex; gap: 10px; align-items: flex-start; }
.selfcheck { display: grid; gap: 6px; }
.selfcheck label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.selfcheck input { margin-top: 5px; accent-color: var(--ink); }
.summary { border: 1px solid var(--ink); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; }
.summary h3 { font-size: 1.375rem; }
.next-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.next-steps li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* Where to go next */
.next { display: grid; gap: 14px; }
.next h2 { font-size: 1.5rem; }
.next h3.sub { font-size: 1.125rem; margin-top: 6px; }
.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.next-card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--s); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow-soft); }
.next-card h3 { font-size: 1.25rem; }
.next-card p { color: var(--ink-2); font-size: .9375rem; }
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sources { display: grid; gap: 8px; font-size: .9375rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 16px; }
.sources h2 { font-size: 1.1875rem; color: var(--ink); }
.sources ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* Rail */
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; box-shadow: var(--shadow-soft); }
.side-card h2 { font-size: 1.1875rem; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.side-card h2 .note { font-family: var(--font-body); font-weight: 400; }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.meter span { height: 6px; border-radius: 3px; background: var(--line); }
.meter span.on { background: var(--c); }
.profile { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; font-size: .9375rem; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cmap { display: grid; }
.cmap-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cmap-split { display: grid; gap: 8px; }
.cmap-col { display: grid; gap: 6px; justify-items: center; align-content: start; }
.cmap-link { display: block; width: 100%; height: 16px; overflow: visible; }
.cmap-link path { stroke: var(--line); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; }
.cmap-more { margin: 16px 0 6px; text-align: center; }
.cnode { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px; display: grid; gap: 1px; justify-items: center; text-align: center; min-width: 0; color: inherit; text-decoration: none; }
.cmap-row > .cnode:not(.soon) { min-width: 62%; }
a.cnode:hover { border-color: var(--ink-2); }
.cnode.current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2); }
.cnode-title { font-weight: 700; font-size: .9375rem; }
.cnode-meta { font-size: .75rem; color: var(--muted); }
.cnode.done .cnode-meta { color: var(--good); font-weight: 700; }
.cnode.soon { border-style: dashed; color: var(--muted); font-size: .8125rem; padding: 3px 10px; background: transparent; }

/* Personalise dialog */
dialog.setup { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog.setup::backdrop { background: rgba(10, 12, 18, .45); }
.setup-inner { display: grid; gap: 0; max-height: inherit; }
.setup-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; border-bottom: 1px solid var(--line); }
.setup-top h2 { font-size: 1.5rem; }
.setup-body { overflow-y: auto; padding: 4px 22px 8px; display: grid; gap: 0; }
.step { display: grid; gap: 10px; padding-block: 16px; border-bottom: 1px solid var(--line); scroll-margin-top: 8px; }
.step:last-child { border-bottom: 0; }
.step-label { display: grid; gap: 2px; }
.step-label h3 { font-size: 1.125rem; }
.setup-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.choice { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; align-content: start; }
.choice:hover { border-color: var(--ink-2); }
.choice[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.choice-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.choice-desc { color: var(--ink-2); font-size: .9375rem; }
.choice-meta { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.page.lang-hi .choice-meta, .lang-hi-dialog .choice-meta { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .8125rem; }
.quiz { display: grid; gap: 10px; max-width: 640px; }
.quiz-progress { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: .9375rem; }
.chip:hover { border-color: var(--ink-2); }
.chip-mark { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); display: inline-block; position: relative; flex: none; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); font-weight: 700; }
.chip[aria-pressed="true"] .chip-mark { background: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] .chip-mark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.chip-custom { cursor: default; border-color: var(--ink); background: var(--surface-2); font-weight: 700; padding-right: 6px; }
.chip-x { border: 0; background: transparent; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; font-size: 1rem; line-height: 1; color: var(--ink-2); }
.chip-x:hover { background: var(--line); }
.custom-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.custom-form label { font-size: .9375rem; color: var(--ink-2); }
.custom-form .input { flex: 1 1 220px; max-width: 340px; }

/* Search */
.search { position: relative; margin-top: 20px; max-width: 540px; }
.search-input { width: 100%; padding: 12px 16px 12px 42px; border-radius: 999px; font-size: 1rem; box-shadow: var(--shadow-soft); -webkit-appearance: none; appearance: none; }
.search-icon { position: absolute; left: 15px; top: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-out { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; display: grid; gap: 6px; max-height: min(440px, 60vh); overflow-y: auto; }
.search-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.search-hits a { display: grid; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; border-left: 3px solid var(--s); }
.search-hits a:hover, .search-hits a:focus-visible { background: var(--surface-2); }
.hit-title { font-weight: 700; }
.hit-where { font-size: .8125rem; color: var(--muted); }
.search-hits li.soon .hit-title { color: var(--ink-2); font-weight: 600; }

/* Home: subject cards */
.subjects-sec { display: grid; gap: 16px; }
.section-head { display: grid; gap: 4px; }
.subject-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.subject-card { position: relative; overflow: hidden; display: grid; gap: 12px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px 22px 20px; text-decoration: none; color: inherit; box-shadow: var(--shadow-soft); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.subject-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--s); }
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-2); }
.subject-card h3 { font-size: 1.75rem; }
.subject-card p { color: var(--ink-2); font-size: .9375rem; }
.subject-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--s, var(--s-current)); background: color-mix(in srgb, var(--s, var(--s-current)) 13%, var(--surface)); flex: none; }
.subject-icon svg { width: 28px; height: 28px; }
.subject-icon.big { width: 64px; height: 64px; border-radius: 16px; --s: var(--s-current); }
.subject-icon.big svg { width: 40px; height: 40px; }
.class-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.class-dot { font-family: var(--font-mono); font-size: .75rem; min-width: 32px; text-align: center; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.class-dot.some { border-color: var(--s); color: var(--ink); }
.class-dot.full { background: var(--s); border-color: var(--s); color: var(--surface); font-weight: 500; }

/* Subject page */
.subject-page { display: grid; gap: 22px; padding-block: 30px 60px; }
.subject-hero { display: grid; grid-template-columns: auto 1fr; gap: 16px 20px; align-items: start; }
.subject-hero h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.25rem); letter-spacing: -0.01em; }
.subject-hero .lede { margin-top: 8px; }
.subject-hero .count { margin-top: 8px; font-size: .9375rem; color: var(--muted); }
.subject-hero .search { grid-column: 1 / -1; margin-top: 0; }
.class-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.class-tab { display: grid; justify-items: center; padding: 10px 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: inherit; }
.class-tab:hover { border-color: var(--ink-2); }
.class-tab[aria-current="page"] { border-color: var(--s-current); box-shadow: inset 0 0 0 1px var(--s-current), var(--shadow-soft); background: color-mix(in srgb, var(--s-current) 9%, var(--surface)); }
.class-tab-k { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.class-tab-n { font-family: var(--font-display); font-size: 1.875rem; font-weight: 600; line-height: 1.1; }
.class-tab-m { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.page.lang-hi .class-tab-k { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .75rem; }
.verify-note { font-size: .875rem; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 9px 14px; }
.chapters-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.chapters-head h2 { font-size: 1.5rem; }
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ch-link { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
a.ch-link:hover { border-color: var(--ink-2); box-shadow: var(--shadow-soft); }
.ch-num { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 500; font-size: 1rem; background: color-mix(in srgb, var(--s-current) 13%, var(--surface)); }
.ch-body { display: grid; gap: 2px; min-width: 0; }
.ch-kicker { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.page.lang-hi .ch-kicker { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .75rem; }
.ch-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
.ch-topics { font-size: .875rem; color: var(--ink-2); }
.ch-status { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.chapter.done .ch-status { color: var(--good); font-weight: 700; }
.chapter.soon .ch-link { background: transparent; border-style: dashed; }
.chapter.soon .ch-num { background: var(--surface-2); color: var(--muted); }
.chapter.soon .ch-title { color: var(--ink-2); }
.soon-tag { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .06em; text-transform: uppercase; border: 1px dashed var(--line); border-radius: 999px; padding: 2px 9px; }
.page.lang-hi .soon-tag { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .75rem; }
@media (max-width: 600px) {
  .subject-hero { grid-template-columns: 1fr; }
  .ch-link { grid-template-columns: 36px minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; }
  .ch-status { grid-column: 2; }
  .ch-num { width: 34px; height: 34px; font-size: .875rem; }
  .class-tabs { gap: 6px; }
  .class-tab-n { font-size: 1.375rem; }
}

/* Lesson extras */
.lang-note { font-size: .9375rem; color: var(--ink); background: color-mix(in srgb, var(--l-story) 10%, var(--surface)); border-radius: 10px; padding: 10px 14px; }
.loading { padding-block: 72px; display: grid; gap: 14px; justify-items: start; }
.loading-note { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
#view-lesson .tab { min-width: 108px; }

/* Learn: the full explanation */
.learn { display: grid; gap: 28px; }
.learn-toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 14px; background: var(--surface-2); display: grid; gap: 8px; }
.learn-toc ol { margin: 0; padding-left: 1.5em; columns: 2 240px; column-gap: 28px; }
.learn-toc li { padding: 2px 0; break-inside: avoid; }
.learn-toc .link-btn { text-align: left; text-decoration: none; color: var(--ink); }
.learn-toc .link-btn:hover { text-decoration: underline; }
.learn-sec { display: grid; gap: 14px; scroll-margin-top: calc(var(--topbar-h) + 120px); padding-top: 22px; border-top: 1px solid var(--line); }
.learn-sec:first-of-type { border-top: 0; padding-top: 0; }
.learn-sec > h3 { font-size: 1.625rem; }
.learn .prose { max-width: 72ch; gap: 14px; }
.learn .prose > p { font-size: 1.0625rem; }
.prose h4 { font-family: var(--font-body); font-size: 1.0625rem; font-weight: 700; margin: 8px 0 0; }
.learn-list { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.learn-list li::marker { color: var(--muted); }
.callout { --c: var(--l-story); border-radius: 10px; padding: 12px 16px; display: grid; gap: 4px; background: color-mix(in srgb, var(--c) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); }
.callout.tip { --c: var(--l-maths); } .callout.remember { --c: var(--l-story); } .callout.warning { --c: var(--bad); }
.callout.real { --c: var(--l-analogy); } .callout.think { --c: var(--l-socratic); } .callout.exam { --c: var(--l-simulation); } .callout.history { --c: var(--l-story); }
.callout-kicker { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.callout-title { font-weight: 700; }
.callout.puzzle { --c: var(--l-play); }
.callout.puzzle p { font-size: 1.0625rem; }
.check-block { border: 1px dashed color-mix(in srgb, var(--l-maths) 60%, var(--line)); border-radius: 10px; padding: 10px 14px; display: grid; gap: 6px; }
.check-block p { margin: 0; }
.check-kicker { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--l-maths); margin-right: 6px; }
.check-block summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.table-wrap { overflow-x: auto; }
.learn-table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.learn-table caption { caption-side: bottom; text-align: left; font-size: .8125rem; color: var(--muted); padding-top: 6px; }
.learn-table th { text-align: left; font-weight: 700; background: var(--surface-2); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.learn-table td { padding: 8px 12px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.fig { margin: 0; display: grid; gap: 8px; justify-items: center; background: var(--surface-2); border-radius: 12px; padding: 16px; }
.fig svg { width: 100%; max-width: 540px; height: auto; color: var(--ink); overflow: visible; }
.fig svg text { font-family: var(--font-body); fill: currentColor; }
.fig figcaption { font-size: .875rem; color: var(--ink-2); text-align: center; max-width: 62ch; }
.eqn-wrap { display: grid; gap: 4px; }
.eqn-note { font-size: .875rem; color: var(--muted); }
.derive.example { border-color: color-mix(in srgb, var(--l-maths) 45%, var(--line)); background: color-mix(in srgb, var(--l-maths) 3%, var(--surface)); }
.derive .ex-problem { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.answer { font-weight: 600; }
.mistakes { display: grid; gap: 12px; }
.mistake { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.mistake p { border-radius: 10px; padding: 10px 14px; display: grid; gap: 2px; align-content: start; }
.mistake .wrong { background: var(--bad-bg); }
.mistake .right { background: var(--good-bg); }
.mk { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; }
.wrong .mk { color: var(--bad); } .right .mk { color: var(--good); }
.summary-list li { padding-left: 2px; }
.formulas { display: grid; gap: 8px 18px; grid-template-columns: minmax(0, max-content) 1fr; align-items: center; margin: 0; }
.formulas dt .eqn { padding: 6px 14px; }
.formulas dd { margin: 0; color: var(--ink-2); font-size: .9375rem; }
.fcalc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; gap: 8px; }
@media (max-width: 640px) {
  .mistake { grid-template-columns: 1fr; }
  .formulas { grid-template-columns: 1fr; }
  .formulas dd { margin-bottom: 8px; }
  .learn-sec > h3 { font-size: 1.375rem; }
}

/* Practice */
.practice { display: grid; gap: 16px; }
.practice-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.problem { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 12px; background: var(--surface); }
.problem.right { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.problem.wrong { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.problem-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.problem-n { font-family: var(--font-mono); font-weight: 500; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .8125rem; }
.level-tag { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.page.lang-hi .level-tag { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .75rem; }
.level-tag.easy { color: var(--good); background: var(--good-bg); }
.level-tag.hard { color: var(--bad); background: var(--bad-bg); }
.problem-q { font-size: 1.0625rem; }
.problem-hint { background: color-mix(in srgb, var(--l-socratic) 10%, var(--surface)); border-radius: 10px; padding: 10px 14px; }
.problem-sol { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 12px; }
.drill { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 10px; }
.drill-title { margin: 0; }
.drill p { margin: 0; }
.drill-nav { align-items: center; gap: 10px; flex-wrap: wrap; }
.drill-count { font-family: var(--font-mono); font-size: .875rem; }
.drill-score { margin-left: auto; }
.drill-card { overflow-wrap: anywhere; }
.drill-msg:empty { display: none; }
.drill-msg.good { color: var(--good); font-weight: 600; }
.drill-msg.bad { color: var(--bad); }
.drill-tol { font-size: .8125rem; }
.drill-work { font-size: .9375rem; overflow-wrap: break-word; }
.drill-steps li { display: grid; gap: 4px; }
@media print { .drill { display: none !important; } }
.mark-row .btn.mark-right[aria-pressed="true"] { border-color: var(--good); color: var(--good); background: var(--good-bg); }
.mark-row .btn.mark-wrong[aria-pressed="true"] { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }

/* Rail: chapters in this class */
.rail-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; max-height: 440px; overflow-y: auto; }
.rail-chapters a, .rail-chapters li > span { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: inherit; font-size: .9375rem; align-items: baseline; }
.rail-chapters a:hover { background: var(--surface-2); }
.rail-chapters li.current a { background: color-mix(in srgb, var(--s-current) 13%, var(--surface)); font-weight: 700; }
.rail-chapters li.soon { color: var(--muted); }
.rc-n { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); text-align: right; }
.rc-done { color: var(--good); font-weight: 700; }
a.next-subject { text-decoration: none; color: inherit; }
a.next-subject:hover { border-color: var(--ink-2); }
#next-course { padding-top: 4px; }

footer.site-foot { color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); margin-top: 24px; background: var(--surface); }
.foot-grid { display: grid; gap: 28px 32px; padding-block: 36px 24px; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.foot-brand { grid-column: 1 / -1; display: grid; gap: 10px; align-content: start; }
@media (min-width: 760px) { .foot-brand { grid-column: auto; } }
.foot-brand p { max-width: 42ch; margin: 0; line-height: 1.55; }
.foot-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.foot-logo svg { width: 22px; height: 22px; }
.foot-col { display: grid; gap: 8px; align-content: start; }
.foot-col h2 { font-family: var(--font-body); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 4px; }
.page.lang-hi .foot-col h2 { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.foot-col a { color: var(--muted); text-decoration: none; }
.foot-col a:hover { color: var(--ink); text-decoration: underline; }
.foot-base { border-top: 1px solid var(--line); padding-block: 14px 28px; font-size: .8125rem; }
/* Learn, one part at a time */
.learn-mode { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.learn-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.learn-dots { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.learn-dots button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: transparent; padding: 0; cursor: pointer; }
.learn-dots button.done { background: color-mix(in srgb, var(--l-learn) 45%, transparent); border-color: var(--l-learn); }
.learn-dots button.on { border-color: var(--l-learn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--l-learn) 30%, transparent); }
.learn-reveal { margin: 4px 0 8px; }
/* The bench in a Learn step (experiment.js). #sim-bench keeps the Simulation tab's spacing wherever it is. */
#sim-bench { display: grid; gap: 18px; min-width: 0; }
.exp-ask { display: grid; gap: 10px; }
.exp-ask .exp-q { font-weight: 600; }
.exp-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.exp-opts .btn { white-space: normal; text-align: left; }
.exp-guess { color: var(--ink-2); font-style: italic; }
.exp-goal { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; border-radius: 10px; padding: 10px 14px; background: color-mix(in srgb, var(--l-simulation) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--l-simulation); }
.exp-goal-text { display: flex; gap: 10px; align-items: flex-start; margin: 0; flex: 1 1 260px; }
.exp-goal.done .task-mark { background: var(--good); border-color: var(--good); }
.exp-goal.done .task-mark::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.exp-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.exp-bench { min-width: 0; }
.exp-result { border-left: 3px solid var(--good); padding: 4px 0 4px 12px; }
.learn .prose > .exp-result { font-size: 1.0625rem; }
.learn-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
/* Starting-point check */
.place-card { border: 1px solid var(--line); border-left: 4px solid var(--l-socratic); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; display: grid; gap: 8px; }
.place-card h3 { margin: 0; }
.place-card p { margin: 0; }
.place-card.compact { padding: 8px 14px; }
.place-q { font-size: 1.0625rem; font-weight: 600; }
.place-options { display: grid; gap: 8px; }
.place-options .btn { justify-content: flex-start; text-align: left; white-space: normal; }
/* No MathML support: hide the drawn formula and show its TeX source as readable text. */
.no-mathml math semantics > :not(annotation) { display: none; }
.no-mathml math annotation { display: inline; font-family: "IBM Plex Mono", monospace; font-size: .92em; }
.mathml-note { margin-top: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: .9375rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; }
.foot-links a { color: inherit; }
.about { max-width: 72ch; padding-block: 28px 48px; display: grid; gap: 28px; }
.about-hero h1 { margin: 4px 0 10px; }
.about-sec h2 { margin: 0 0 8px; }
.about-sec ul, .about-steps { padding-left: 1.2em; display: grid; gap: 8px; margin: 0; }
.about-sec p { margin: 0 0 8px; }
.top-about { color: inherit; font-size: .9375rem; text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.top-about:hover { background: var(--line); }

@media (max-width: 560px) {
  .panel, .check { padding: 18px 16px 22px; }
  .bubble { max-width: 95%; }
  .home { gap: 34px; padding-block: 24px 44px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* Play: learn by doing, one card at a time */
.play { display: grid; gap: 16px; max-width: 720px; }
.play-progress { display: flex; align-items: center; gap: 12px; }
.play-track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.play-track span { display: block; height: 100%; background: var(--l-play); border-radius: inherit; transition: width .3s ease; }
.play-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; display: grid; gap: 14px; }
.play-card h3 { font-size: 1.25rem; line-height: 1.35; }
.play-card h3:focus { outline: none; }
.play-card .kicker { color: var(--l-play); }
.play-info > div > p, .play-explain p { margin: 0 0 8px; }
.play-options { display: grid; gap: 10px; }
.play-opt, .play-step { text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; min-height: 48px; }
.play-opt:hover:not(:disabled), .play-step:hover:not(:disabled) { border-color: var(--ink-2); }
.play-opt[aria-pressed="true"] { border-color: var(--l-play); box-shadow: 0 0 0 2px color-mix(in srgb, var(--l-play) 30%, transparent); }
.play-opt.right, .play-step.right, .play-num.right { border-color: var(--good); background: var(--good-bg); color: var(--ink); }
.play-opt.wrong, .play-step.wrong, .play-num.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--ink); }
.play-opt:disabled, .play-step:disabled { cursor: default; opacity: 1; }
.play-opt:disabled:not(.right):not(.wrong) { opacity: .55; }
.play-numform { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.play-num { width: 11em; font-size: 1.125rem; }
.play-unit { font-weight: 700; color: var(--ink-2); }
.play-explain { border-radius: 12px; padding: 12px 14px; border-left: 4px solid var(--line); background: var(--surface-2); }
.play-explain.good { border-left-color: var(--good); }
.play-explain.bad { border-left-color: var(--bad); }
.play-explain.shown { border-left-color: var(--l-story); }
.play-explain .verdict { font-weight: 700; }
.play-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.play-sim { display: grid; gap: 12px; }
.play-plot { width: 100%; height: auto; display: block; }
.play-plot .axis { stroke: var(--ink-2); stroke-width: 1.5; }
.play-plot .vline { stroke: var(--muted); stroke-dasharray: 4 4; }
.play-plot .tick, .play-plot .axis-label { fill: var(--muted); font: 12px var(--font-body); }
.play-plot .legend, .play-plot .axis-label { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.play-plot .legend { font: 600 12px var(--font-body); }
.play-readout { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-mono); font-size: .875rem; }
.play-controls { display: grid; gap: 10px; }
.play-help { display: flex; gap: 14px; }
.play-order { display: grid; gap: 10px; }
.play-placed { margin: 0; padding-left: 1.6em; display: grid; gap: 8px; }
.play-pool { display: grid; gap: 8px; }
.play-match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.play-col { display: grid; gap: 8px; align-content: start; }
.pair-n { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: 8px; border-radius: 50%; background: var(--good); color: #fff; font-size: .8125rem; font-weight: 700; vertical-align: 1px; }
.play-done h3 { font-size: 1.5rem; }
@media (max-width: 560px) { .play-card { padding: 16px; } .play-match-cols { gap: 8px; } .play-opt, .play-step { padding: 10px 12px; } }

/* Connections to other chapters */
.conn-strip { display: grid; gap: 8px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.conn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.conn-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .875rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; text-align: left; }
.conn-chip:hover { border-color: var(--s); }
.conn-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s); flex: none; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.conn-card { border: 1px solid var(--line); border-top: 4px solid var(--s); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.conn-card:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.conn-card h4 { margin: 0; font-size: 1.0625rem; }
.conn-card p { margin: 0; }
.conn-try { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.conn-try summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.conn-go { justify-self: start; }
.conn-next ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* Learners on a shared phone */
.profile-list { flex-wrap: wrap; }
.profile-form { display: flex; gap: 8px; margin-top: 8px; }
.profile-form .input { flex: 1; min-width: 0; }

/* Printable worksheet: built from the open lesson just before printing (see buildPrintSheet in app.js). */
.print-sheet { display: none; }
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body:has(.print-sheet:not(:empty)) > .page { display: none !important; }
  .print-sheet:not(:empty) { display: block; }
  .print-sheet { --ink: #000; --ink-2: #222; --muted: #444; --line: #999; --surface: #fff; --surface-2: #f1f1f1; --l-maths: #555;
    font: 11pt/1.45 "Atkinson Hyperlegible", system-ui, sans-serif; color: #000; }
  .print-sheet h1 { font: 600 20pt/1.2 "Spectral", Georgia, serif; margin: 2pt 0 6pt; }
  .print-sheet h2 { font: 600 13.5pt/1.25 "Spectral", Georgia, serif; margin: 14pt 0 6pt; border-bottom: 1px solid #999; padding-bottom: 2pt; }
  .print-sheet h3, .print-sheet h4 { font-size: 11pt; margin: 8pt 0 3pt; }
  .print-sheet p { margin: 0 0 5pt; }
  .print-sheet .ps-head { border-bottom: 2px solid #000; padding-bottom: 6pt; }
  .print-sheet .ps-kicker { font: 9pt "IBM Plex Mono", monospace; letter-spacing: .05em; text-transform: uppercase; color: #444; margin: 0; }
  .print-sheet .ps-name { margin-top: 6pt; color: #333; }
  .print-sheet ol { padding-left: 1.4em; }
  .print-sheet .ps-practice li { break-inside: avoid; margin-bottom: 4pt; }
  .print-sheet .ps-level { font-size: 8.5pt; color: #555; text-transform: uppercase; letter-spacing: .04em; }
  .print-sheet .ps-space { height: 30mm; border-bottom: 1px dashed #bbb; margin-bottom: 6pt; }
  .print-sheet .ps-answers { break-before: page; }
  .print-sheet .ps-answers li { break-inside: avoid; margin-bottom: 8pt; }
  .print-sheet .ps-answer { margin-top: 2pt; }
  .print-sheet .ps-foot { margin-top: 14pt; font-size: 8.5pt; color: #555; border-top: 1px solid #ccc; padding-top: 4pt; }
  .print-sheet button, .print-sheet .derive-controls { display: none !important; }
  .print-sheet .derive, .print-sheet .example-box, .print-sheet .note-box, .print-sheet figure { break-inside: avoid; background: none !important; }
  .print-sheet .eqn { overflow: visible; }
  .print-sheet math { color: #000; }
  /* Any other page (home, a subject list) prints without the controls. */
  .topbar, .site-foot, .lens-bar, .listen, .print-btn, .search { display: none !important; }
}

/* ---------- Labs: the Labs home and a lab page ---------- */
.labs-teaser { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--shadow-soft); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; }
.labs-teaser:hover { border-color: var(--ink-2); }
.labs-teaser-text { display: grid; gap: 4px; min-width: 0; }
.labs-teaser-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.labs-teaser .kicker { color: var(--l-simulation); }
.labs-hero { display: grid; gap: 12px; padding: 32px 0 8px; }
.labs-hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; max-width: 18ch; }
.labs-hero .eyebrow { color: var(--l-simulation); }
.labs-hero .lede { max-width: 62ch; color: var(--ink-2); }
.labs-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 8px 0 0; }
.labs-stats div { display: grid; }
.labs-stats dt { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.page.lang-hi .labs-stats dt { font-family: var(--font-body); font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: none; }
.labs-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; }
.labs-strip { display: flex; gap: 4px; max-width: 420px; }
.labs-strip span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.labs-strip span.some { background: linear-gradient(90deg, var(--l-simulation) 50%, var(--line) 50%); }
.labs-strip span.on { background: var(--good); }
.labs-start { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 24px 0; padding: 20px 22px; border-radius: 16px; border: 1px solid var(--line); border-left: 5px solid var(--l-simulation); background: var(--surface); }
.labs-start-text { display: grid; gap: 4px; min-width: 0; }
.labs-start h2 { font-size: 1.5rem; }
.labs-start p { color: var(--ink-2); }
.labs-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 8px 0 20px; }
.labs-filters .seg { flex-wrap: wrap; }
.labs-group { margin: 0 0 28px; }
.labs-group .section-title { display: flex; align-items: center; gap: 10px; }
.labs-group-icon { width: 26px; height: 26px; color: var(--s); display: inline-flex; }
.labs-group-icon svg { width: 100%; height: 100%; }
.lab-grid-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.lab-card { position: relative; overflow: hidden; display: grid; gap: 10px; align-content: start; padding: 22px 20px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--shadow-soft); transition: transform .15s ease, border-color .15s ease; }
.lab-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--s); }
.lab-card:hover { transform: translateY(-2px); border-color: var(--ink-2); }
.lab-card h3 { font-size: 1.375rem; }
.lab-card-benches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lab-card-benches li { font-size: .8125rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.lab-card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 4px; }
.lab-card-foot .lesson-go { margin-left: auto; }
.lab-goals { display: inline-flex; gap: 3px; }
.lab-goals span { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.lab-goals span.on { background: var(--good); }
@media (prefers-reduced-motion: reduce) { .lab-card, .lab-card:hover { transition: none; transform: none; } }

/* A lab page: the lesson view in lab mode shows only the lab shell. */
.lab-mode #view-lesson > :not(#lab-shell) { display: none !important; }
.lab-shell { display: grid; gap: 24px; padding-bottom: 32px; }
.lab-nav { position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 20; display: flex; gap: 6px; overflow-x: auto; padding: 8px; margin-top: 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--topbar-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); scrollbar-width: none; }
.lab-nav button { flex: none; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: .875rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.lab-nav button:hover { background: var(--line); }
.lab-nav button[aria-current="true"] { background: var(--button); color: var(--button-ink); }
@media (max-width: 600px) { .lab-nav { top: env(safe-area-inset-top, 0px); } }
.lab-head { display: grid; gap: 10px; scroll-margin-top: 130px; }
.lab-head .eyebrow { color: var(--s-current, var(--l-simulation)); }
.lab-head h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
.lab-head .lede { max-width: 66ch; color: var(--ink-2); }
.lab-learn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.lab-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lab-chips li { font-size: .875rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.lab-head-links { font-size: .9375rem; }
.lab-grid { display: grid; gap: 20px; align-items: start; }
.lab-bench, .lab-steps, .lab-why { scroll-margin-top: 130px; }
.lab-bench { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background-color: var(--surface-2); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; min-width: 0; }
.lab-slot #sim-bench { display: grid; gap: 10px; }
.lab-slot .sim-stage { background: var(--surface); border-radius: var(--radius); }
.lab-steps { display: grid; gap: 12px; min-width: 0; }
.lab-steps-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lab-steps-head h2 { font-size: 1.5rem; }
.lab-step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lab-step { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.lab-step.met { border-color: var(--good); }
.lab-step-top { display: flex; gap: 12px; align-items: flex-start; }
.lab-step-n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--muted); font-family: var(--font-mono); font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.lab-step.done .lab-step-n { background: var(--good); border-color: var(--good); color: var(--surface); font-size: 0; }
.lab-step.done .lab-step-n::after { content: ""; width: 5px; height: 10px; margin-top: -3px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lab-step-text { margin: 3px 0 0; }
.lab-predict { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.lab-predict .kicker { color: var(--l-simulation); }
.lab-predict .exp-q { margin: 0; font-weight: 600; }
.lab-predict .exp-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-step-btns { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 40px; }
.lab-step .exp-guess { margin: 0; padding-left: 40px; color: var(--ink-2); font-size: .9375rem; }
.lab-step-result { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--good-bg); color: var(--ink); font-size: .9375rem; }
.lab-why { display: grid; gap: 10px; }
.lab-why h2 { font-size: 1.5rem; }
.lab-why-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.lab-why-card { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
.lab-why-card:hover { border-color: var(--ink-2); }
.lab-next { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.lab-next-card { flex: 1 1 280px; display: grid; gap: 4px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); border-left: 5px solid var(--s); background: var(--surface); color: inherit; text-decoration: none; }
.lab-next-card:hover { border-color: var(--ink-2); border-left-color: var(--s); }
.lab-next-title { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; }
.sim-lab-link { margin: 4px 0 0; font-weight: 600; }
@media (min-width: 900px) {
  .lab-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); }
  .lab-bench { position: sticky; top: calc(var(--topbar-h) + 64px); max-height: calc(100vh - var(--topbar-h) - 76px); overflow-y: auto; }
}

/* ---------- Word meanings (app.js: tap a dotted word, or press and hold any word) ---------- */
.gl-word { text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--muted); cursor: help; border-radius: 3px; }
.gl-word:hover { background: var(--surface-2); }
.gl-word:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.words-hint { font-size: .875rem; color: var(--muted); margin: 4px 0 0; }
#view-lesson { -webkit-touch-callout: none; }
.word-pop { position: fixed; z-index: 60; width: min(340px, calc(100vw - 24px)); display: grid; gap: 6px; padding: 14px 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.word-pop p { margin: 0; }
.word-pop-term { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.word-pop-meaning { font-size: 1rem; line-height: 1.5; }
.word-pop-src { font-size: .8125rem; color: var(--muted); }
.word-pop-src:empty { display: none; }
.word-pop .btn { justify-self: end; }

/* ---------- Maths basics (#basics) and a foundations step (#step/<id>): app.js renderBasics and renderStep ---------- */
.hero-basics { margin-top: 14px; font-size: 1rem; }
.hero-basics a { color: var(--ink-2); font-weight: 600; }
.basics-hero, .step-head { display: grid; gap: 10px; padding: 28px 0 6px; }
.basics-hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; max-width: 18ch; }
.basics-hero .eyebrow, .step-head .eyebrow { color: var(--s-maths); }
.basics-hero .lede { max-width: 60ch; }
.basics-group { margin-top: 26px; display: grid; gap: 12px; }
.basics-group h2 { font-size: 1.375rem; }
.basics-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.basics-card { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.basics-card:hover { border-color: var(--ink-2); }
.basics-card-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.basics-card-title { font-weight: 700; font-size: 1.0625rem; }
.basics-more { margin-top: 22px; }
.step-tick { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: var(--good); }
.step-tick.on { border-color: transparent; }
.step-tick svg { width: 30px; height: 30px; }
.step-page { max-width: 760px; }
.step-back { font-weight: 600; justify-self: start; padding: 6px 0; }
.step-head h1 { font-size: clamp(1.875rem, 4.5vw, 2.75rem); line-height: 1.12; }
.step-sec { margin-top: 26px; display: grid; gap: 12px; }
.step-sec:focus { outline: none; }
.step-sec h2 { font-size: 1.3125rem; display: flex; align-items: center; gap: 10px; }
.step-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--button); color: var(--button-ink); font-family: var(--font-mono); font-size: .9375rem; }
.step-prompt { font-size: 1.1875rem; font-weight: 700; }
.step-bench { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 10px 4px; }
.step-bench .lab-top { display: none; }
.step-controls { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; padding: 2px; }
.step-controls > .control { flex: 0 1 auto; min-width: 0; }
.step-controls > .ln-ctl { flex: 1 1 100%; }
.step-controls .ln-zero-btn { justify-self: start; }
.step-page input[type="range"] { height: 34px; }
.step-see { font-size: 1.25rem; line-height: 1.5; padding: 14px 16px; border-left: 4px solid var(--l-simulation); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; min-height: 3.6em; }
.step-name { border: 2px solid var(--l-maths); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); display: grid; gap: 6px; justify-items: start; }
.step-name.waiting { border-style: dashed; border-color: var(--line); gap: 12px; }
.step-term { font-family: var(--font-display); font-size: 1.875rem; font-weight: 700; line-height: 1.2; }
.step-term:focus { outline: none; }
.step-meaning { font-size: 1.1875rem; }
.step-big { min-height: 48px; padding: 10px 20px; font-size: 1rem; }
.step-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.step-q { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); display: grid; gap: 12px; }
.step-q-text { font-size: 1.1875rem; font-weight: 700; }
.step-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.step-opt { min-height: 52px; min-width: 84px; font-size: 1.1875rem; font-family: var(--font-body); }
.step-opt.right { border-color: var(--good); background: var(--good-bg); color: var(--ink); }
.step-opt.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--ink); }
.step-fb { display: grid; gap: 10px; justify-items: start; }
.step-fb:empty { display: none; }
.step-fb p { font-size: 1.0625rem; }
.step-done { margin: 30px 0 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 14px; }
.step-ticked { display: flex; gap: 14px; align-items: center; }
.step-ticked .step-tick, .step-ticked .step-tick svg { width: 40px; height: 40px; }
.step-done-title { font-weight: 700; font-size: 1.1875rem; }
.step-nav { gap: 10px 12px; }
.place-step { font-weight: 700; white-space: nowrap; }

/* ---------- A balance scale (balance.js, a lab bench with `balance`) ---------- */
.lab-svg .bl-stand { fill: currentColor; fill-opacity: .16; stroke: currentColor; stroke-opacity: .6; stroke-width: 2.5; stroke-linejoin: round; }
.lab-svg .bl-mark { stroke: currentColor; stroke-opacity: .6; stroke-width: 2; }
.lab-svg .bl-state { font-size: 15px; font-weight: 700; }
.lab-svg .bl-ok { fill: var(--good); }
.lab-svg .bl-beam { stroke: currentColor; stroke-width: 6; stroke-linecap: round; }
.lab-svg .bl-beam.bl-even { stroke: var(--good); }
.lab-svg .bl-needle { stroke: var(--l-simulation); stroke-width: 3; stroke-linecap: round; }
.lab-svg .bl-pivot { fill: var(--surface); stroke: currentColor; stroke-width: 2.5; }
.lab-svg .bl-string { fill: none; stroke: currentColor; stroke-opacity: .55; stroke-width: 1.5; }
.lab-svg .bl-pan { fill: currentColor; fill-opacity: .1; stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; }
.lab-svg .bl-box { fill: var(--l-analogy); fill-opacity: .3; stroke: currentColor; stroke-width: 2; }
.lab-svg .bl-box.bl-open { fill: var(--surface); fill-opacity: 1; stroke-dasharray: 5 3; }
.lab-svg .bl-lid { stroke: currentColor; stroke-opacity: .6; stroke-width: 1.5; }
.lab-svg .bl-q { font-size: 18px; font-weight: 700; pointer-events: none; }
.lab-svg .bl-blk { fill: var(--l-simulation); stroke: currentColor; stroke-opacity: .55; stroke-width: 1; }
.lab-svg .bl-form { font-size: 20px; font-weight: 700; font-family: var(--font-mono); }
.bl-side { display: grid; gap: 8px; }
.bl-row { display: flex; align-items: center; gap: 10px; }
.bl-what { min-width: 6.5em; }
.bl-side .lab-stepper output.bl-n { min-width: 2em; font-size: 1.125rem; }
.bl-pm { min-width: 52px; min-height: 48px; font-size: 1.375rem; }
.bl-acts-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bl-btn { min-height: 48px; }
.bl-btn[aria-disabled="true"], .bl-pm[aria-disabled="true"] { opacity: .5; }
@media (max-width: 560px) { .lab-svg.bl-svg text { font-size: 17px; } .lab-svg.bl-svg .bl-q { font-size: 20px; } .lab-svg.bl-svg .bl-form { font-size: 22px; } .lab-svg.bl-svg .bl-state { font-size: 17px; } }

/* ---------- "Check your basics" on a lesson (app.js renderBasicsCheck; src/lesson-steps.json) ---------- */
.basics-check { margin-bottom: 18px; }
.bc { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--s-maths); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-soft); }
.bc summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; cursor: pointer; list-style: none; min-height: 32px; }
.bc summary::-webkit-details-marker { display: none; }
.bc summary::after { content: "+"; margin-left: auto; font-size: 1.375rem; line-height: 1; color: var(--muted); }
.bc[open] summary::after { content: "−"; }
.bc summary h2 { display: inline; margin: 0; font-size: 1.1875rem; }
.bc-count { font-size: .875rem; color: var(--muted); }
.bc-lede { margin: 8px 0 0; color: var(--ink-2); max-width: 70ch; }
.bc-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.bc-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
.bc-step { margin: 0; font-size: .8125rem; font-weight: 700; color: var(--s-maths); }
.bc-q { margin: 0; font-weight: 700; }
.bc-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.bc-opt { min-height: 44px; font-family: var(--font-body); }
.bc-opt.bc-idk { color: var(--ink-2); font-weight: 500; }
.bc-opt.right { border-color: var(--good); background: var(--good-bg); color: var(--ink); }
.bc-opt.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--ink); }
.bc-fb { display: grid; gap: 8px; justify-items: start; }
.bc-fb:empty { display: none; }
.bc-fb p { margin: 0; }
.bc-ok { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bc-ok .step-tick, .bc-ok .step-tick svg { width: 24px; height: 24px; }

/* Report a mistake: a quiet line under the lesson's details and at the end of a basics step. */
.report-line { margin-top: 12px; font-size: .875rem; color: var(--muted); }
.report-line a { color: var(--ink-2); font-weight: 600; }
.report-line .note { margin-left: 4px; }
.step-done + .report-line, #view-step > .report-line { margin-top: 28px; }
