/* Layout: one concept, four quadrants. A sticky quadrant bar on top; I Watch (video + live mechanism),
   II Read (full printable notes), III Explore (verified references), IV Test (quiz, spot the mistake, traps, answer studio). */
:root {
  --paper: #FBF8F3; --card: #FFFFFF; --ink: #182028; --muted: #5B6670; --line: #E7DFD3; --soft: #F4EFE7;
  --screen: #0B3A40; --screen-ink: #E7F6F3; --screen-muted: #8CC9C2; --trace: #FF7A50;
  --teal: #0E7880; --deep: #09464E; --coral: #F2603A; --coral-ink: #C4441F; --mint: #E3F3EF; --on-deep: #FBF8F3;
  --good: #138A5C; --good-bg: #E3F5EC; --bad: #C2362C; --bad-bg: #FBE7E4; --tip: #FFF6D8; --tip-line: #E9B949;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif; --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif; --hand: "Caveat", "Segoe Print", cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0D1618; --card: #132124; --ink: #E9F1F0; --muted: #9DB1B3; --line: #22383C; --soft: #10201F;
  --screen: #05191C; --screen-ink: #E7F6F3; --screen-muted: #7FBAB3; --trace: #FF8A63;
  --teal: #4CC3C2; --deep: #A7E3DD; --coral: #FF7F57; --coral-ink: #FF9D7E; --mint: #12302D; --on-deep: #0D1618;
  --good: #3CCB8D; --good-bg: #0F2D22; --bad: #FF8073; --bad-bg: #331A18; --tip: #2A2510; --tip-line: #B8912F; color-scheme: dark } }
:root[data-theme="dark"] {
  --paper: #0D1618; --card: #132124; --ink: #E9F1F0; --muted: #9DB1B3; --line: #22383C; --soft: #10201F;
  --screen: #05191C; --screen-ink: #E7F6F3; --screen-muted: #7FBAB3; --trace: #FF8A63;
  --teal: #4CC3C2; --deep: #A7E3DD; --coral: #FF7F57; --coral-ink: #FF9D7E; --mint: #12302D; --on-deep: #0D1618;
  --good: #3CCB8D; --good-bg: #0F2D22; --bad: #FF8073; --bad-bg: #331A18; --tip: #2A2510; --tip-line: #B8912F; color-scheme: dark }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.65 var(--body); }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 760; letter-spacing: -0.015em; }
h3 { font-size: 1.3rem; font-weight: 740; }
h4 { font-size: 1.08rem; font-weight: 720; }
p { margin: 0; }
a { color: var(--teal); }
i.v { font-style: italic; }
.eyebrow { font: 700 .78rem/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--coral-ink); }
.muted { color: var(--muted); }
button { font-family: var(--body); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
[hidden] { display: none !important; }
.preview-note { font: 700 .8rem/1.3 var(--body); background: var(--coral); color: #fff; text-align: center; padding: 8px 16px; }

/* Top bar */
.top { display: flex; align-items: center; gap: 12px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 1.2rem/1 var(--display); color: var(--ink); text-decoration: none; }
.brand img { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); flex: none; }
.brand b { color: var(--coral); }
.top .back { margin-left: auto; font-weight: 700; text-decoration: none; color: var(--deep); padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-size: .95rem; }
.theme { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.theme svg { width: 18px; height: 18px; }
@media (max-width: 520px) { .brand span { display: none; } }

/* Lesson hero */
.lhero { padding-block: 20px 30px; display: grid; gap: 14px; }
.crumbs { font-size: .92rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.lhero .sub { font-size: 1.2rem; color: var(--muted); max-width: 52ch; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 700 .82rem/1 var(--body); padding: 9px 13px; border-radius: 999px; background: var(--mint); color: var(--deep); }
.progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.progress span { height: 8px; border-radius: 99px; background: var(--line); transition: background .4s; }
.progress span.done { background: var(--coral); }
.progress-label { font-size: .9rem; color: var(--muted); }

/* Sticky quadrant bar */
.qbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.qbar nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-block: 10px; }
.qbar a { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; padding: 9px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: .95rem; min-width: 0; white-space: nowrap; }
.qbar a b { font: 800 1rem/1 var(--display); color: var(--coral); }
.qbar a.on { background: var(--deep); color: var(--on-deep); border-color: var(--deep); }
.qbar a.on b { color: var(--trace); }
.qbar a .ok { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.qbar a .ok.done { background: var(--good); }
@media (max-width: 560px) { .qbar nav { gap: 4px; } .qbar a { gap: 5px; padding: 9px 2px; font-size: .88rem; } .qbar a .ok { width: 6px; height: 6px; order: 3; } .qbar a .lbl { display: none; } .qbar a::after { content: attr(data-short); } }
@media (max-width: 380px) { .qbar a { font-size: .8rem; gap: 4px; } .qbar a b { font-size: .9rem; } }

section.quad { padding-block: 56px 40px; border-bottom: 1px solid var(--line); }
.qhead { display: grid; gap: 8px; margin-bottom: 26px; max-width: 64ch; }
.qhead .qn { display: flex; align-items: center; gap: 12px; }
.qhead .qn span.big { font: 800 2.6rem/1 var(--display); color: var(--coral); }
.done-btn { margin-top: 26px; font: 700 .95rem/1 var(--body); padding: 13px 18px; border-radius: 999px; border: 2px solid var(--deep); background: none; color: var(--deep); cursor: pointer; }
.done-btn[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }

/* I Watch */
.watch { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; align-items: start; }
.vid { width: 100%; aspect-ratio: 9 / 16; border-radius: 22px; background: #000; display: block; box-shadow: 0 24px 50px -30px rgba(0,0,0,.6); }
.monitor { background: var(--screen); border-radius: 24px; padding: 16px; color: var(--screen-ink); min-width: 0; }
.mon-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 700 .78rem/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--screen-muted); }
canvas.mech { width: 100%; display: block; margin-top: 8px; background: color-mix(in srgb, var(--screen-ink) 4%, transparent); border-radius: 14px; }
.caption { min-height: 2.8em; margin-top: 10px; font-weight: 600; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pills button { font: 700 .8rem/1 var(--body); color: var(--screen-ink); background: transparent; border: 1.5px solid color-mix(in srgb, var(--screen-ink) 35%, transparent); border-radius: 999px; padding: 9px 12px; cursor: pointer; }
.pills button.on { background: var(--trace); border-color: var(--trace); color: #fff; }
.notice { margin-top: 18px; display: grid; gap: 10px; }
.notice div { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.notice b.n { font: 800 1.1rem/1.4 var(--display); color: var(--coral); }
@media (max-width: 820px) { .watch { grid-template-columns: 1fr; } .vid { max-width: 320px; margin: 0 auto; } }

/* II Read: the notes */
.notes { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 44px); display: grid; gap: 34px; }
.notes .nhead { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 18px; }
.notes .nhead p { color: var(--muted); font-size: .95rem; }
.pdf { font: 700 .95rem/1 var(--body); padding: 13px 18px; border-radius: 999px; background: var(--coral); color: #fff; border: 0; cursor: pointer; }
.toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; padding: 16px 20px; background: var(--soft); border-radius: 16px; margin: 0; list-style: none; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { text-decoration: none; color: var(--ink); font-weight: 600; }
.toc a::before { content: counter(t) ". "; color: var(--coral-ink); font-weight: 800; }
@media (max-width: 640px) { .toc { grid-template-columns: 1fr; } }
.nsec { display: grid; gap: 14px; counter-increment: s; }
.notes { counter-reset: s; }
.nsec > h3::before { content: counter(s) "  "; color: var(--coral); font-weight: 800; margin-right: 6px; }
.nsec p, .nsec li { max-width: 72ch; }
.nsec ul, .nsec ol { margin: 0; padding-left: 1.25em; display: grid; gap: 6px; }
.keybox { border: 2px solid var(--deep); border-radius: 18px; padding: 18px 20px; display: grid; gap: 10px; }
.keybox h4 { color: var(--deep); }
.eq { font: 600 1.15rem/1.5 var(--body); background: var(--soft); border-radius: 12px; padding: 14px 18px; text-align: center; overflow-x: auto; }
.eq .ar { color: var(--coral-ink); font-weight: 800; padding: 0 .4em; }
.callout { border-left: 4px solid var(--tip-line); background: var(--tip); border-radius: 0 14px 14px 0; padding: 14px 16px; }
.callout b:first-child { display: block; margin-bottom: 4px; }
.why { border-left: 4px solid var(--teal); background: var(--mint); border-radius: 0 14px 14px 0; padding: 14px 16px; }
.why b:first-child { display: block; margin-bottom: 4px; color: var(--deep); }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
figure { margin: 0; display: grid; gap: 6px; min-width: 0; }
figure .frame { aspect-ratio: 16 / 9; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
figure canvas { width: 100%; display: block; }
figcaption { font-size: .9rem; color: var(--muted); }
figcaption b { color: var(--ink); }
@media (max-width: 820px) { .figs { grid-template-columns: 1fr; } }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 460px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--coral); vertical-align: middle; }
.ladder { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.ladder span { background: var(--soft); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; }
.ladder i { font-style: normal; color: var(--coral-ink); font-weight: 800; }
.mols { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mols.c1 { grid-template-columns: minmax(0, 280px); }
.mols.c2 { grid-template-columns: repeat(2, minmax(0, 280px)); }
.mols.c3 { grid-template-columns: repeat(3, minmax(0, 260px)); }
@media (max-width: 640px) { .mols, .mols.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mols.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mol { margin: 0; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 12px; display: grid; gap: 4px; align-content: start; min-width: 0; color: var(--ink); }
.mol .molsvg svg { width: 100%; height: auto; display: block; }
.mol figcaption { text-align: center; font-size: .92rem; line-height: 1.35; color: var(--muted); }
.mol figcaption b { display: block; color: var(--ink); }
.pair.solo { grid-template-columns: 1fr; }
@media print { .mols { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } .mols.c2 { grid-template-columns: repeat(2, minmax(0, 200px)) !important; } .mols.c3 { grid-template-columns: repeat(3, minmax(0, 190px)) !important; } .mol { break-inside: avoid; } }
.svgbox { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.svgbox svg { width: 100%; height: auto; display: block; }
.revise { background: var(--screen); color: var(--screen-ink); border-radius: 20px; padding: 22px 24px; display: grid; gap: 10px; }
.revise h3 { color: var(--screen-ink); }
.revise h3::before { color: var(--trace) !important; }
.revise ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.revise li::marker { color: var(--trace); font-weight: 800; }
.sign { font-size: .9rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 14px; }

/* III Explore */
.refs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.refcol { display: grid; gap: 12px; align-content: start; min-width: 0; }
.refcol > h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.ref { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 6px; }
.ref .t { font-weight: 700; line-height: 1.35; }
.ref .s { font-size: .92rem; color: var(--muted); line-height: 1.45; }
.ref a { font-weight: 700; font-size: .92rem; text-decoration: none; }
.ref .why2 { font-size: .9rem; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
@media (max-width: 900px) { .refs { grid-template-columns: 1fr; } }
.refs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) { .refs.two { grid-template-columns: 1fr; } }
.ref .t { position: relative; padding-left: 38px; }
.ref .t .no { position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--mint); color: var(--deep); font: 800 .85rem/26px var(--display); text-align: center; }
.ref .s, .ref a { margin-left: 38px; }
.refcol > h3 .cnt { font: 800 .8rem/1 var(--body); background: var(--coral); color: #fff; border-radius: 999px; padding: 4px 8px; }

/* IV Test */
.tblock { display: grid; gap: 16px; margin-top: 34px; }
.tblock:first-of-type { margin-top: 0; }
.quiz { display: grid; gap: 14px; }
.qq { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 12px; }
.qq .qt { font-weight: 700; }
.qq .qt span { color: var(--coral-ink); margin-right: 6px; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opts button { text-align: left; font: 600 1rem/1.35 var(--body); padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.opts button:hover:not(:disabled) { border-color: var(--deep); }
.opts button:disabled { cursor: default; }
.opts button.right { background: var(--good-bg); border-color: var(--good); }
.opts button.wrong { background: var(--bad-bg); border-color: var(--bad); }
.opts button.right::after { content: "  ✓"; color: var(--good); font-weight: 800; }
.opts button.wrong::after { content: "  ✗"; color: var(--bad); font-weight: 800; }
.fb { font-size: .98rem; border-radius: 12px; padding: 12px 14px; background: var(--soft); }
.fb b { color: var(--good); } .fb.no b { color: var(--bad); }
@media (max-width: 640px) { .opts { grid-template-columns: 1fr; } }
.scorebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--screen); color: var(--screen-ink); border-radius: 16px; padding: 14px 18px; }
.scorebar strong { font: 800 1.6rem/1 var(--display); color: var(--trace); }
.scorebar button { font: 700 .9rem/1 var(--body); padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--screen-muted); background: none; color: var(--screen-ink); cursor: pointer; }
.pair { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 760px) { .pair { grid-template-columns: 1fr; } .pair .vid { max-width: 280px; margin: 0 auto; } }
.mistake { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 12px; }
.mistake .claim { font-family: var(--hand); font-size: 1.45rem; line-height: 1.3; color: var(--ink); background: var(--soft); border-radius: 12px; padding: 12px 16px; }
.mistake .claim s { text-decoration-color: var(--bad); }
.reveal { font: 700 .92rem/1 var(--body); padding: 11px 16px; border-radius: 999px; border: 2px solid var(--coral); background: none; color: var(--coral-ink); cursor: pointer; justify-self: start; }
.traps { display: grid; gap: 12px; }
.trap { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: grid; gap: 10px; }
.trap .st { font-weight: 700; }
.tf { display: flex; gap: 8px; }
.tf button { font: 700 .9rem/1 var(--body); padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.tf button.right { background: var(--good-bg); border-color: var(--good); }
.tf button.wrong { background: var(--bad-bg); border-color: var(--bad); }

/* Answer-Writing Studio (notebook paper, same in light and dark) */
.nb { color-scheme: light; --np: #FFFEFA; --nrule: #BFD3EA; --nink: #1D2B4F; --nsoft: #4A5878; --nred: #D2443A; --nmargin: #E8A3A0; }
.studio { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.sheet { position: relative; background: var(--np) repeating-linear-gradient(var(--np) 0 31px, var(--nrule) 31px 32px); background-position: 0 14px; color: var(--nink); border-radius: 8px; padding: 18px 18px 22px 58px; line-height: 32px; box-shadow: 0 1px 0 #d8d2c4, 0 20px 40px -26px rgba(0,0,0,.45); min-width: 0; }
.sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: 40px; width: 2px; background: var(--nmargin); }
.sheet .q { font-weight: 700; } .sheet .soft { color: var(--nsoft); }
.hand { font-family: var(--hand); color: var(--nred); font-size: 1.5rem; line-height: 32px; }
.stamp { display: inline-block; font: 700 .78rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; border: 2px solid var(--nred); color: var(--nred); padding: 6px 10px; border-radius: 6px; transform: rotate(-2deg); margin-bottom: 4px; }
.sheet .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.nbtn { font: 700 .9rem/1 var(--body); padding: 10px 14px; border-radius: 8px; border: 2px solid var(--nink); background: #fff; color: var(--nink); box-shadow: 3px 3px 0 var(--nink); cursor: pointer; }
.nbtn.red { background: var(--nred); color: #fff; }
.timer { font-family: var(--hand); font-size: 2rem; color: var(--nred); font-variant-numeric: tabular-nums; }
.scheme { list-style: none; margin: 0; padding: 0; }
.scheme li label { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; cursor: pointer; }
.scheme input { width: 20px; height: 20px; margin: 6px 0 0; accent-color: var(--nred); }
.scheme b { font-family: var(--hand); font-size: 1.6rem; color: var(--nred); }
.score { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--nink); margin-top: 6px; padding-top: 2px; }
.score .hand { font-size: 2.1rem; }
.sheet summary { cursor: pointer; font-weight: 700; }
@media (max-width: 760px) { .studio { grid-template-columns: 1fr; } .sheet { padding-left: 48px; } .sheet::before { left: 32px; } }

.next { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin-block: 40px; }
.next .btn-next { font: 700 .95rem/1 var(--body); padding: 12px 18px; border-radius: 999px; background: var(--coral); color: #fff; text-decoration: none; }
.next .soon { font: 700 .8rem/1 var(--body); padding: 8px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); }
footer { border-top: 1px solid var(--line); padding-block: 26px; color: var(--muted); font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Print: the notes only, as a clean handout */
@media print {
  :root { --paper: #fff; --card: #fff; --ink: #111; --muted: #444; --line: #ccc; --soft: #f3f3f3; --mint: #eef6f4; --tip: #fff8e1; --screen: #fff; --screen-ink: #111; --coral: #c4441f; --coral-ink: #c4441f; --deep: #09464e; color-scheme: light; }
  body { font-size: 11.5pt; background: #fff; }
  .preview-note, .top, .lhero, .qbar, #watch, #explore, #test, .next, footer, .pdf, .done-btn, #read > .wrap > .qhead { display: none !important; }
  section.quad { padding: 0; border: 0; }
  .notes { border: 0; padding: 0; border-radius: 0; gap: 18px; }
  .keybox, figure, tr, .callout, .why, .revise, .svgbox, .eq, .ladder { break-inside: avoid; }
  .nsec > h3, .nsec h4 { break-after: avoid; }
  .figs { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .svgbox { max-width: 520px; margin: 0 auto; }
  .notes, .nsec, .keybox, .revise { display: block !important; } .notes > * + * { margin-top: 20px; } .nsec > * + *, .keybox > * + *, .revise > * + * { margin-top: 10px; }
  .tbl { overflow: visible; } table { min-width: 0; }
  figure { display: block; } figure .frame { aspect-ratio: auto; } figure canvas { height: auto !important; } figcaption { display: block; margin-top: 6px; font-size: 9.5pt; }
  .revise { border: 2px solid #111; }
  a { color: #111; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* 3D stereocentre viewer (Quadrant I) */
.viewer { position: relative; aspect-ratio: 1; width: 100%; border-radius: 24px; background: radial-gradient(circle at 50% 45%, #0E4950 0%, var(--screen) 70%); touch-action: none; cursor: grab; overflow: hidden; min-width: 0; }
:root[data-theme="dark"] .viewer { background: radial-gradient(circle at 50% 45%, #0A2428 0%, var(--screen) 70%); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .viewer { background: radial-gradient(circle at 50% 45%, #0A2428 0%, var(--screen) 70%); border: 1px solid var(--line); } }
.viewer canvas { width: 100%; height: 100%; display: block; }
.viewer .name { position: absolute; left: 16px; top: 14px; font: 700 .8rem/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--screen-muted); pointer-events: none; }
.viewer .name b { color: var(--trace); }
.viewer .hint { position: absolute; left: 16px; bottom: 14px; font: 600 .8rem/1 var(--body); color: var(--screen-muted); background: rgba(5,25,28,.55); padding: 7px 10px; border-radius: 999px; pointer-events: none; }
.ctrl { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ctrl button { font: 700 .88rem/1 var(--body); padding: 11px 14px; border-radius: 999px; border: 1.5px solid var(--deep); background: none; color: var(--deep); cursor: pointer; }
.ctrl button[aria-pressed="true"] { background: var(--deep); color: var(--on-deep); }
.explain { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--coral); border-radius: 14px; padding: 12px 14px; margin-top: 12px; min-height: 5.4em; }
