/* My Rough Page — site styles (Design System v1.1, Style A "Smart notebook").
   Built by sitegen/build.py: the DARK-TOKENS block below is copied into the
   prefers-color-scheme media query and into :root[data-theme="dark"]. */

/* ------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --paper: #FFFDF6; --paper-deep: #F6F1E3; --card: #FFFFFF; --raised: #FFFFFF; --lab: #FDFDF8;
  --border: #E6E0CF; --border-soft: #F0EBDD; --dashed: #B8B2A0; --dashed-strong: #8C8676;
  --rule: #E3EAF3; --grid: #EDF2F8; --grid-border: #D9E3EE; --dots: #CBD5C4; --margin: #F0C9C1;
  --ink: #1F2328; --ink-soft: #57554D; --heading: #12352D;
  --btn-bg: #12352D; --btn-ink: #FFFFFF; --shadow-ink: #1F2328;
  --correct: #145C32; --correct-bg: #E5F4EA; --wrong: #8A2B0E; --wrong-bg: #FDEEE8; --wrong-line: #B4471F;
  --hint-bg: #FFF7D6; --hint-line: #C9A400; --hl: #FFE45C;
  --mint: #BDF5A8; --pink: #FFC7DE; --chip-ink: #1F2328;
  --sticky: #FFF1A1; --sticky-ink: #1F2328; --sticky-title: #8A2B0E; --sticky-shadow: 0 6px 14px rgba(60, 50, 10, .18);
  --olive-bg: #E3F7DA; --olive: #4F7A12; --olive-ink: #3D5F0E;
  --bridge-bg: #FBEBD6; --bridge-ink: #7A4505; --bridge-line: #A15C07;
  --hand: #A15C07; --pen: #1E4FD6;
  --acc-science: #0A6C74; --tint-science: #DDF1F2;
  --acc-maths: #5B3FC4; --tint-maths: #ECE7FB;
  --acc-social: #A15C07; --acc-english: #B0305A; --acc-hindi: #4F7A12;
  --acc: var(--acc-science); --tint: var(--tint-science); --acc-fill: #0A6C74; --on-acc: #FFFFFF;
  --foot-bg: #12352D; --foot-ink: #EEEADF; --foot-soft: #C8D3CE; --foot-line: #4A6B62;
  /* diagram tokens (hand-coded SVG figures, content/<chapter>/diagrams) */
  --dg-water: #D3ECEE; --dg-clear: #EEF5F6; --dg-carbon: #3F4448; --dg-rubber: #7A5442; --dg-flame: #F6A43C;
  --dg-flame-core: #4A86E0; --dg-spirit: #E9E2F3; --dg-crystal: #BDE3A6; --dg-crystal-line: #4F7A12;
  --dg-redbrown: #9C3D1E; --dg-cuso4: #3D8BD9; --dg-palegreen: #CDEBC5; --dg-yellow: #F5C518; --dg-white: #FFFFFF;
  --dg-milky: #F0EFE8; --dg-metal: #A9AFB5; --dg-silver-grey: #7E848A; --dg-heat: #C8322B; --dg-bottle: #6B3A1E;
  --dg-sun: #F5B800; --dg-wood: #C9A27A; --dg-black: #1E1E1E; --dg-verdigris: #5FAF8F; --dg-copper-metal: #C77B45;
  --dg-packet: #F6D27A; --dg-apple: #F8EFC9; --dg-apple-brown: #C08A4A; --dg-skin: #F3D9C4; --dg-t1: #D7EFF0;
  --dg-t2: #E6E0FA; --dg-t3: #FBE6CC; --dg-t4: #FADCE6; --dg-none: #ECEAE3; --dg-poly: #E3DCC6; --dg-row-bad: #FDE1CB;
  --dg-row-good: #DDF1E3; --dg-atom-cu: #B8692E; --dg-atom-o: #D9443C; --dg-atom-h: #FFFFFF; --dg-pop: #FDE3DC;
  /* chapter 9 diagram tokens (content/C10-SCI-CH09/diagrams/_src/optics.py) */
  --dg-ray-a: #C2410C; --dg-ray-b: #6D28D9; --dg-ray-c: #0F7A3B; --dg-glass: #DDF1F2; --dg-zone1: #E6F4EA; --dg-zone2: #FCEBD9; --dg-zone3: #EDE7FB; --dg-mirror-back: #8C8676; --dg-water-ch9: #D3ECEE; --dg-car: #F2B84B; --dg-carpet: #E9D7F0;
  /* maths diagram tokens (content/C10-MATH-CH08/diagrams/_src/mlib.py; colour 1 = opposite/sin, colour 2 = adjacent/cos) */
  --dg-m-opp: #C2410C; --dg-m-adj: #1D5FBF; --dg-m-opp-bg: #FCE7DA; --dg-m-adj-bg: #DEE9FB; --dg-m-hyp-bg: #EFEDE6; --dg-m-angle: #E6DFFB; --dg-m-shade: #F1EEFB; --dg-m-undef: #FBDCC8; --dg-m-band1: #E6F4EA; --dg-m-band2: #FCEBD9; --dg-m-band3: #EDE7FB; --dg-m-grid: #D6E0EC; --dg-m-garden: #DDEFD3; --dg-m-plant: #3F7F22; --dg-m-path: #EADFC8;
  /* chapter 2 diagram tokens (content/C10-SCI-CH02/diagrams/_src/clib.py; the pH band and indicator colours are the same in both themes) */
  --dg-ph-red: #D7263D; --dg-ph-orange: #F28C28; --dg-ph-yellow: #F5D02F; --dg-ph-green: #3FA34D; --dg-ph-blue: #2563C9; --dg-ph-violet: #6B3FA0; --dg-ph-on-dark: #FFFFFF; --dg-ph-on-light: #1F2328; --dg-lit-red: #D64550; --dg-lit-blue: #3B6FD4; --dg-lit-purple: #8A4FB8; --dg-pink: #F06BA8; --dg-tur-yellow: #F2C230; --dg-tur-ob: #C9772B; --dg-tur-rb: #9C3D1E; --dg-cab-red: #D94E86; --dg-cab-green: #4FA35A; --dg-cab-purple: #7A4AA8; --dg-soap: #E4EEF2; --dg-cl2: #E3EDA4; --dg-glow: #FFE45C; --dg-badge-a: #FCE3D3; --dg-badge-b: #DCE8FA; --dg-cork: #C9A27A; --dg-pellet: #F4F4F0; --dg-atom-cl: #8BC34A; --dg-atom-na: #9A7FD1; --dg-glucose: #F6E7B0; --dg-cork-board: #E7CFA6; --dg-card-pin: #D9443C;
  /* history chapter 2 diagram tokens (content/C10-HIST-CH02/diagrams/_src/hlib02.py) */ --dg-land-h2: #F6EEDF; --dg-sea-h2: #D9ECF6; --dg-coast-h2: #5B4A38; --dg-stl-h2: #AFA594; --dg-pt-h2: #B42318; --dg-tint-h2: #FBEBD6; --dg-flagr-h2: #D23B2A; --dg-flagg-h2: #2E8B47; --dg-flagy-h2: #F2C230; --dg-flagw-h2: #FFFFFF;
  /* chapter 13 diagram tokens (content/C10-SCI-CH13/diagrams/_src/c13lib.py) */ --dg-sky13: #EAF5FC; --dg-sun13: #F6B73C; --dg-ray13: #E08A12; --dg-leaf13: #5FA84A; --dg-leafdk13: #3C7D32; --dg-grass13: #7DBB4B; --dg-trunk13: #8B5A2B; --dg-petal13: #E8638C; --dg-sunfl13: #F5C431; --dg-flowerc13: #7A4B1E; --dg-fur13: #C98B4E; --dg-tiger13: #F08A24; --dg-stripe13: #2B2118; --dg-frog13: #7CC35B; --dg-snake13: #9BAF3A; --dg-eagle13: #7A5230; --dg-white13: #FFFFFF; --dg-beak13: #F2C230; --dg-heron13: #C9D3DC; --dg-fish13: #5B9BD5; --dg-fin13: #2F6FB0; --dg-bug13: #6B8E23; --dg-aqbug13: #8C6A3F; --dg-grey13: #A7A39A; --dg-bird13: #A9743F; --dg-owl13: #9A6B3E; --dg-peacock13: #2B7BB9; --dg-pfeather13: #3E9A5B; --dg-water13: #CFE8F7; --dg-waterln13: #3B8CC4; --dg-soil13: #B98A5E; --dg-mud13: #8A6A4A; --dg-gravel13: #C9C1B3; --dg-mush13: #D9533F; --dg-cream13: #F4EADA; --dg-pest13: #D7263D; --dg-ozone13: #9FC5E8; --dg-ozonelt13: #DCEAF6; --dg-uv13: #7C3AED; --dg-wedge13: #F6C453; --dg-bandp13: #CFE6F7; --dg-bandh13: #D7EFCB; --dg-bands13: #F9D7BF; --dg-bandt13: #FBF1B0; --dg-fsun13: #F7A541; --dg-fprod13: #F9EFA6; --dg-fherb13: #9FD38A; --dg-fcarn13: #C99A6B; --dg-ftop13: #E9D2B6; --dg-card-a13: #E5F0FB; --dg-card-b13: #FCEBD8; --dg-card-c13: #E6F4EA; --dg-card-d13: #F1E8FB; --dg-binb13: #BFE3B0; --dg-binn13: #C9DBF3; --dg-plastic13: #E3EEF6; --dg-glass13: #BFE3D9; --dg-paper13: #F2EEE4; --dg-metal13: #AEB6BE; --dg-skin13: #F1C9A5; --dg-cloth13: #E9D8B4; --dg-rubber13: #3F6FB0; --dg-fridge13: #EEF2F5; --dg-red13: #D33A2C; --dg-ef-mark13: #0A6C74;
  /* chapter 12 diagram tokens (content/C10-SCI-CH12/diagrams/_src/c12lib.py) */ --dg-fl12: #0F766E; --dg-magn12: #E05A47; --dg-mags12: #4C7FD1; --dg-magbody12: #C8322B; --dg-skin12: #F6D7BF; --dg-skin-ln12: #8A5A3C; --dg-card12: #F1E4C8; --dg-live12: #D12B2B; --dg-neu12: #1F2328; --dg-earth12: #15803D; --dg-force12: #B45309; --dg-filing12: #3F4448; --dg-paper12: #FBFAF6; --dg-soil12: #C9A27A; --dg-rod12: #B9C2CC; --dg-dial12: #F7F4EC; --dg-card-a12: #E5F0FB; --dg-card-b12: #FCEBD8; --dg-card-c12: #E6F4EA; --dg-card-d12: #F1E8FB; --dg-dr-ok12: #15803D;
  /* chapter 11 diagram tokens (content/C10-SCI-CH11/diagrams/_src/c11lib.py) */ --dg-wire11: #4A4F57; --dg-res11: #B45309; --dg-fil11: #D97706; --dg-glow11: #FDE68A; --dg-cur11: #1D4ED8; --dg-elec11: #7C3AED; --dg-water11: #BFE3F5; --dg-water-ln11: #2B7BB0; --dg-pipe11: #9AA4AE; --dg-tank11: #E6EEF3; --dg-board11: #F3E3C3; --dg-nichrome11: #6B7280; --dg-copper11: #C2410C; --dg-porc11: #F5F2EA; --dg-iron11: #CBD5DF; --dg-plate11: #E8E4D8; --dg-lcd11: #D7EBD0; --dg-box11: #EEF3F8; --dg-card-a11: #E5F0FB; --dg-card-b11: #FCEBD8; --dg-card-c11: #E6F4EA; --dg-card-d11: #F1E8FB; --dg-cv-pt11: #B91C1C;
  /* chapter 10 diagram tokens (content/C10-SCI-CH10/diagrams/_src/c10lib.py) */ --dg-sp-r: #D7263D; --dg-sp-o: #EE7D1E; --dg-sp-y: #E0B000; --dg-sp-g: #2E9A44; --dg-sp-b: #2563C9; --dg-sp-i: #4535A8; --dg-sp-v: #8B2FC0; --dg-eyeball: #FBF8F1; --dg-vitreous: #EEF4F8; --dg-aqueous: #DFF0F6; --dg-iris10: #7A5236; --dg-muscle10: #E79A86; --dg-retina10: #D9473E; --dg-nerve10: #F2C14E; --dg-cornea10: #D4EEF6; --dg-img-sharp: #15803D; --dg-img-blur: #B45309; --dg-sky10: #CFE6FA; --dg-sky-dark10: #141B33; --dg-air10: #8A9AA8; --dg-earth10: #B9C2A6; --dg-atmos10: #6C9BC8; --dg-drop10: #DDF0FA; --dg-room10: #3A3F4A; --dg-beam10: #FFF2A8; --dg-smoke10: #B9BEC6; --dg-forest10: #2F5D3A; --dg-trunk10: #5A4030; --dg-mist10: #E8EEF0; --dg-hill10: #7FAE6A; --dg-star10: #F5B800; --dg-plane10: #DDE3EA; --dg-card-a10: #E7F1FB; --dg-card-b10: #FDEEDC;
  /* chapter 8 diagram tokens (content/C10-SCI-CH08/diagrams/_src/c8lib.py) */ --dg-pea-y: #F3CF3E; --dg-pea-g: #8CC152; --dg-fl-violet: #8C5BC6; --dg-fl-violet-dk: #5E3592; --dg-fl-white: #FFFFFF; --dg-pea-leaf: #8DCB6E; --dg-pea-stem: #3F8A3A; --dg-calyx8: #6DB25A; --dg-org-blue: #3E7BD6; --dg-org-blue-lt: #A9C8F2; --dg-org-red: #D8423A; --dg-org-green: #3E9E4E; --dg-org-pink: #F29BC0; --dg-org-white: #FFFFFF; --dg-chrom8: #FBE3E9; --dg-zyg8: #FFF4D6; --dg-card-a8: #E4F2E7; --dg-card-b8: #EFEDE6; --dg-cb-a: #FBEFC4; --dg-cb-b: #DDF0D2; --dg-cb-c: #E6E0FA; --dg-cb-d: #FBDCD2; --dg-cb-line: #9A8F6A; --dg-cb-b-pat: #B2D99E; --dg-cb-c-pat: #C3B7F2; --dg-cb-d-pat: #F2B09C;
  /* chapter 7 diagram tokens (content/C10-SCI-CH07/diagrams/_src/c7lib.py) */ --dg-dna: #2F64C0; --dg-dna-change: #E0701A; --dg-page7: #FFFDF4; --dg-amoeba-y: #FBEDB0; --dg-amoeba-nuc: #5A4632; --dg-leish: #F6D3B3; --dg-plasmo-cell: #A9D98F; --dg-cover-red: #C93A30; --dg-yeast: #F4E3B2; --dg-planaria: #C67A3E; --dg-regrow: #FBEDE0; --dg-hydra: #7DBF6A; --dg-hydra-dark: #3F8A3A; --dg-sand: #EDC184; --dg-hypha: #8F8A7C; --dg-bread: #EED6A4; --dg-spor-young: #F3D46A; --dg-spor-ripe: #6A5236; --dg-spore: #4A3A28; --dg-petal: #F6B3C8; --dg-petal-vein: #D9668E; --dg-sepal: #6DB25A; --dg-fl-ovary: #F4A452; --dg-fl-stigma: #F9D6E0; --dg-style7: #F7C77E; --dg-filament: #F3D452; --dg-anther: #E58A2C; --dg-ovule7: #FFF1BE; --dg-pollen7: #F2BF2C; --dg-ptube: #E2702A; --dg-ovary-wall: #BFDDA0; --dg-germ-cell: #8A5AB8; --dg-seed-green: #8DB255; --dg-cotyledon: #E3EFC0; --dg-embryo7: #F2CE48; --dg-pea-coat: #B9D372; --dg-rajma-coat: #9E3434; --dg-root7: #F1E6CC; --dg-potato: #DDBB7E; --dg-cotton: #FAF8F1; --dg-stem7: #7FB86A; --dg-flesh-line: #B76E5E; --dg-red-sec: #E58C7E; --dg-lining: #D9473E; --dg-uterus-wall: #F8E3CF; --dg-gland7: #EAC17A; --dg-vas: #5F86C9; --dg-scope: #4C5862; --dg-scope-light: #C7D0D6; --dg-slide-glass: #DDEFF7; --dg-fov: #FBF8E8; --dg-cloth: #E6DCC4; --dg-bowl: #E3E8EC; --dg-card-a7: #E4F2E7; --dg-card-b7: #FDEBDD;
  /* chapter 6 diagram tokens (content/C10-SCI-CH06/diagrams/_src/c6lib.py) */ --dg-nerve: #D23A2E; --dg-soma: #F2A24A; --dg-soma-nuc: #5B3416; --dg-axon: #F7D9A6; --dg-myelin: #C9B6EA; --dg-muscle: #EE9A8C; --dg-muscle-dark: #C2574A; --dg-capillary: #D9443C; --dg-cord: #F7EBCD; --dg-grey-matter: #F3B6C0; --dg-spark: #F7C61C; --dg-hormone: #E2961A; --dg-auxin: #2E9E48; --dg-cranium: #EFE3C6; --dg-meninges: #F0A9B2; --dg-cerebrum: #F7E6CB; --dg-cerebellum: #E8C29B; --dg-brainstem: #EECBB2; --dg-callosum: #E2CDA8; --dg-hypo: #F2A86B; --dg-pituitary: #E0735A; --dg-pineal: #B990D6; --dg-thyroid: #F08A3C; --dg-parathyroid: #B7461B; --dg-thymus: #E7C2D6; --dg-adrenal: #F5C437; --dg-testis: #F2CC4A; --dg-uterus: #F2A2B6; --dg-ovary: #58BBAA; --dg-box: #D9B27C; --dg-box-in: #EBD3A8; --dg-window: #DCEFFA; --dg-root: #B07A48; --dg-bamboo: #D8C27A; --dg-shoot-cell: #E3F4D8; --dg-mimosa-bg: #1F2E25; --dg-on-dark: #F4F1E6; --dg-mimosa-leaf: #7CC46A; --dg-pan: #8D959C; --dg-steam: #9AA3AA;
  /* chapter 5 diagram tokens (content/C10-SCI-CH05/diagrams/_src/c5lib.py) */ --dg-oxy: #C62F2F; --dg-deoxy: #2958B8; --dg-oxy-fill: #F8C2BA; --dg-deoxy-fill: #C3D7F4; --dg-wall: #E7998C; --dg-xylem: #2F78C8; --dg-phloem: #D9721C; --dg-chloro: #3E9B45; --dg-leaf: #8CCB78; --dg-leaf-dark: #4E9A46; --dg-leaf-cream: #F5EFD2; --dg-starch: #1E2446; --dg-iodine-stain: #D8A956; --dg-epi: #F4F7EC; --dg-safranin: #D1567C; --dg-guard: #E3F2D6; --dg-soil: #E3C9A0; --dg-bark: #A0704A; --dg-crown: #79BD6A; --dg-seed: #A8C46A; --dg-vaseline: #CFCCC2; --dg-koh: #EEF5F6; --dg-body: #FBF0E6; --dg-tissue: #F6C9D0; --dg-alveoli: #EE8A6A; --dg-cartilage: #E9EEF4; --dg-rib: #EFE3CC; --dg-diaphragm: #E79A86; --dg-liver: #A9553C; --dg-gall: #B9CC4C; --dg-pancreas: #F3D58A; --dg-stomach: #F3BBA9; --dg-gut: #F7D8BC; --dg-colon: #E8B48C; --dg-kidney: #B4533F; --dg-bladder: #F3CDA6; --dg-capsule: #F4D766; --dg-tubule: #F8E7A0; --dg-mouth: #F2A3A0; --dg-nasal: #F7D1C4; --dg-cyto: #FBF3D8; --dg-vacuole: #DCEEF7; --dg-mito: #F2A65A; --dg-nucleus: #C2A8E0; --dg-amoeba: #E5EEF5; --dg-food: #D9443C; --dg-sugar: #E0952A; --dg-membrane: #8C6BB0; --dg-jar: #EAF4F6; --dg-pot: #C8794A;
  /* chapter 4 diagram tokens (content/C10-SCI-CH04/diagrams/_src/c4lib.py) */ --dg-at-c: #4A5056; --dg-at-h: #E4E6E8; --dg-at-o: #D9443C; --dg-at-cl: #3F9B4F; --dg-at-n: #2F6FC4; --dg-grp: #FCE3D3; --dg-soot: #2B2B2B; --dg-ghee: #F6E2A0; --dg-foam: #FFFFFF; --dg-scum: #E9E4D4; --dg-mic-water: #DCEFF7; --dg-flame-blue: #4A86E0; --dg-flame-yellow: #F5C518; --dg-tin: #C9CED3; --dg-bottle-oil: #F7E7A6;
  /* chapter 3 diagram tokens (content/C10-SCI-CH03/diagrams/_src/c3lib.py) */ --dg-badge-metal: #DCE6EF; --dg-badge-nonmetal: #FBE3BF; --dg-e-metal: #2F5D8A; --dg-e-nonmetal: #B5470C; --dg-rust: #A0461E; --dg-oil: #F3D36B; --dg-cacl2: #FFFFFF; --dg-mud: #5B4A3A; --dg-rail: #8E969D; --dg-mould: #E2D3B8; --dg-molten: #FF8A1F; --dg-zinc: #C3CCD4; --dg-chrome: #E8EDF2; --dg-paint: #3E8E5A; --dg-iodine: #4B2E6B; --dg-bromine: #8C2F17; --dg-gold: #E2B33C; --dg-sulphur: #F2D64B; --dg-hx-strip: #EEF3F7; --dg-rx-h: #FFF1C9;
  --r-sm: 8px; --r: 12px; --r-card: 16px;
}

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --paper: #17211E; --paper-deep: #17211E; --card: #24312C; --raised: #1F2B27; --lab: #1F2B27;
  --border: #34433D; --border-soft: #2C3A35; --dashed: #4A5A53; --dashed-strong: #6B7B74;
  --rule: rgba(238, 234, 223, .06); --grid: rgba(238, 234, 223, .06); --grid-border: #34433D; --dots: rgba(238, 234, 223, .14); --margin: rgba(240, 201, 193, .28);
  --ink: #EEEADF; --ink-soft: #B9B5A8; --heading: #FFF7DD;
  --btn-bg: #EEEADF; --btn-ink: #17211E; --shadow-ink: #0E1513;
  --correct: #6FD99A; --correct-bg: rgba(111, 217, 154, .12); --wrong: #FF9F7F; --wrong-bg: rgba(255, 159, 127, .12); --wrong-line: #FF9F7F;
  --hint-bg: rgba(233, 217, 138, .12); --hint-line: #E9D98A; --hl: rgba(255, 228, 92, .30);
  --sticky: #E9D98A; --sticky-ink: #2A2410; --sticky-title: #7A2509; --sticky-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  --olive-bg: rgba(169, 216, 106, .10); --olive: #A9D86A; --olive-ink: #CFE8AE;
  --bridge-bg: rgba(242, 178, 92, .14); --bridge-ink: #F2B25C; --bridge-line: #F2B25C;
  --hand: #F2B25C; --pen: #8DB0FF;
  --acc-science: #5CCFD6; --tint-science: rgba(92, 207, 214, .14);
  --acc-maths: #B3A2FF; --tint-maths: rgba(179, 162, 255, .14);
  --acc-social: #F2B25C; --acc-english: #FF8FB1; --acc-hindi: #A9D86A;
  --on-acc: #0E1513;
  --foot-bg: #1F2B27; --foot-ink: #EEEADF; --foot-soft: #B9B5A8; --foot-line: #34433D;
  /* diagram tokens */
  --dg-water: #1D4A4E; --dg-clear: #2C3D3A; --dg-carbon: #A3A9AE; --dg-rubber: #B08672; --dg-flame: #F2A64C;
  --dg-flame-core: #86B5FF; --dg-spirit: #3E3A52; --dg-crystal: #A6D486; --dg-crystal-line: #D3EBB4;
  --dg-redbrown: #CF6B45; --dg-cuso4: #3F86CF; --dg-palegreen: #93C99E; --dg-yellow: #F2CF3D; --dg-white: #F2EFE6;
  --dg-milky: #D9D6CB; --dg-metal: #B6BCC2; --dg-silver-grey: #9DA3A8; --dg-heat: #FF8A70; --dg-bottle: #9A5C36;
  --dg-sun: #F2C94C; --dg-wood: #A88462; --dg-black: #0A0F0D; --dg-verdigris: #6CC3A0; --dg-copper-metal: #D89060;
  --dg-packet: #C9A94F; --dg-apple: #E6DBAA; --dg-apple-brown: #B98550; --dg-skin: #D9B89E; --dg-t1: #1F4447;
  --dg-t2: #3A3463; --dg-t3: #4A3A22; --dg-t4: #4C2A38; --dg-none: #34433D; --dg-poly: #46554F; --dg-row-bad: #4D3326;
  --dg-row-good: #1F4630; --dg-atom-cu: #D08A55; --dg-atom-o: #F07468; --dg-atom-h: #F2EFE6; --dg-pop: #4E2A22;
  /* chapter 9 diagram tokens */
  --dg-ray-a: #FF9A62; --dg-ray-b: #C4A8FF; --dg-ray-c: #7EE0A0; --dg-glass: #1F4447; --dg-zone1: #21382B; --dg-zone2: #3D3022; --dg-zone3: #302C48; --dg-mirror-back: #8D9A94; --dg-water-ch9: #1D4A4E; --dg-car: #D9A440; --dg-carpet: #3B3046;
  /* maths diagram tokens */
  --dg-m-opp: #FF9A62; --dg-m-adj: #7FB2FF; --dg-m-opp-bg: #4A2F22; --dg-m-adj-bg: #22344F; --dg-m-hyp-bg: #34433D; --dg-m-angle: #433A6E; --dg-m-shade: #2E3546; --dg-m-undef: #5A3424; --dg-m-band1: #21382B; --dg-m-band2: #3D3022; --dg-m-band3: #302C48; --dg-m-grid: #3A4A44; --dg-m-garden: #23402C; --dg-m-plant: #8FD18A; --dg-m-path: #4A4032;
  /* chapter 2 diagram tokens */
  --dg-ph-red: #D7263D; --dg-ph-orange: #F28C28; --dg-ph-yellow: #F5D02F; --dg-ph-green: #3FA34D; --dg-ph-blue: #2563C9; --dg-ph-violet: #6B3FA0; --dg-ph-on-dark: #FFFFFF; --dg-ph-on-light: #1F2328; --dg-lit-red: #D64550; --dg-lit-blue: #3B6FD4; --dg-lit-purple: #8A4FB8; --dg-pink: #F06BA8; --dg-tur-yellow: #F2C230; --dg-tur-ob: #C9772B; --dg-tur-rb: #A8462A; --dg-cab-red: #D94E86; --dg-cab-green: #4FA35A; --dg-cab-purple: #7A4AA8; --dg-soap: #2A4648; --dg-cl2: #9FB24A; --dg-glow: #F2CF3D; --dg-badge-a: #4A2F22; --dg-badge-b: #22344F; --dg-cork: #A88462; --dg-pellet: #D9D6CB; --dg-atom-cl: #9CCF5E; --dg-atom-na: #B39DE6; --dg-glucose: #8C7C46; --dg-cork-board: #5A4630; --dg-card-pin: #F07468;
  /* history chapter 2 diagram tokens (content/C10-HIST-CH02/diagrams/_src/hlib02.py) */ --dg-land-h2: #3A4842; --dg-sea-h2: #1C3342; --dg-coast-h2: #D6C8B4; --dg-stl-h2: #66756C; --dg-pt-h2: #FF8C7A; --dg-tint-h2: #3E3326; --dg-flagr-h2: #C8463A; --dg-flagg-h2: #3F9A57; --dg-flagy-h2: #D9AE2E; --dg-flagw-h2: #E9E5DA;
  /* chapter 13 diagram tokens (content/C10-SCI-CH13/diagrams/_src/c13lib.py) */ --dg-sky13: #1C2E3A; --dg-sun13: #D99A2B; --dg-ray13: #F2B65A; --dg-leaf13: #3F7A33; --dg-leafdk13: #2C5A26; --dg-grass13: #4F8A34; --dg-trunk13: #6E4A2A; --dg-petal13: #B94A6C; --dg-sunfl13: #C9A02A; --dg-flowerc13: #4A2E14; --dg-fur13: #9A6A3C; --dg-tiger13: #C46E1E; --dg-stripe13: #1A140E; --dg-frog13: #4E8F3A; --dg-snake13: #6F7F2A; --dg-eagle13: #5E4026; --dg-white13: #D8D4C8; --dg-beak13: #C9A02A; --dg-heron13: #7E8B96; --dg-fish13: #3E6E9E; --dg-fin13: #7FB0E0; --dg-bug13: #556F1E; --dg-aqbug13: #6B5032; --dg-grey13: #6F6B63; --dg-bird13: #7C5530; --dg-owl13: #6E4D2E; --dg-peacock13: #2A6496; --dg-pfeather13: #2D7044; --dg-water13: #1F4A63; --dg-waterln13: #7CC4EE; --dg-soil13: #6B5338; --dg-mud13: #4E3D2C; --dg-gravel13: #5E5A52; --dg-mush13: #A8402F; --dg-cream13: #CFC4B0; --dg-pest13: #FF6B7A; --dg-ozone13: #2E5A80; --dg-ozonelt13: #22394D; --dg-uv13: #C9A7FF; --dg-wedge13: #8A6A1E; --dg-bandp13: #1F3E55; --dg-bandh13: #24412A; --dg-bands13: #4A3326; --dg-bandt13: #4A4320; --dg-fsun13: #7A4A12; --dg-fprod13: #4A4320; --dg-fherb13: #2B5A2E; --dg-fcarn13: #5A3D26; --dg-ftop13: #4A3A2C; --dg-card-a13: #1F3346; --dg-card-b13: #45352A; --dg-card-c13: #1F3A2A; --dg-card-d13: #352C47; --dg-binb13: #2F5A2A; --dg-binn13: #2B4A75; --dg-plastic13: #3A4A57; --dg-glass13: #2E4A44; --dg-paper13: #4A4740; --dg-metal13: #6E7882; --dg-skin13: #B88A66; --dg-cloth13: #5A4D36; --dg-rubber13: #2E5585; --dg-fridge13: #3A454E; --dg-red13: #B5352A; --dg-ef-mark13: #5CCFD6;
  /* chapter 12 diagram tokens (content/C10-SCI-CH12/diagrams/_src/c12lib.py) */ --dg-fl12: #5EEAD4; --dg-magn12: #B9473A; --dg-mags12: #3B67AE; --dg-magbody12: #E06A5E; --dg-skin12: #C9A386; --dg-skin-ln12: #5A3A26; --dg-card12: #4A4030; --dg-live12: #FF7A7A; --dg-neu12: #D8D4C8; --dg-earth12: #5EDB8A; --dg-force12: #F5B342; --dg-filing12: #C9CED3; --dg-paper12: #2A3430; --dg-soil12: #6B5338; --dg-rod12: #8693A0; --dg-dial12: #33413B; --dg-card-a12: #1F3346; --dg-card-b12: #45352A; --dg-card-c12: #1F3A2A; --dg-card-d12: #352C47; --dg-dr-ok12: #5EDB8A;
  /* chapter 11 diagram tokens (content/C10-SCI-CH11/diagrams/_src/c11lib.py) */ --dg-wire11: #BFC5CC; --dg-res11: #F2A65A; --dg-fil11: #FBBF24; --dg-glow11: #6B5314; --dg-cur11: #8AB4FF; --dg-elec11: #C9A7FF; --dg-water11: #24506A; --dg-water-ln11: #7CC4EE; --dg-pipe11: #7D8894; --dg-tank11: #2E3E48; --dg-board11: #4A3E2A; --dg-nichrome11: #B6BEC8; --dg-copper11: #F59E6B; --dg-porc11: #3A4046; --dg-iron11: #5A6B7A; --dg-plate11: #3B4540; --dg-lcd11: #1E3B2A; --dg-box11: #26343F; --dg-card-a11: #1F3346; --dg-card-b11: #45352A; --dg-card-c11: #1F3A2A; --dg-card-d11: #352C47; --dg-cv-pt11: #FF8A8A;
  /* chapter 10 diagram tokens (content/C10-SCI-CH10/diagrams/_src/c10lib.py) */ --dg-sp-r: #FF6B6B; --dg-sp-o: #FFA552; --dg-sp-y: #F5D547; --dg-sp-g: #6FD584; --dg-sp-b: #6FA6FF; --dg-sp-i: #9C8CFF; --dg-sp-v: #D08BFF; --dg-eyeball: #2A3632; --dg-vitreous: #24353A; --dg-aqueous: #21414A; --dg-iris10: #B88A64; --dg-muscle10: #99554A; --dg-retina10: #F07468; --dg-nerve10: #C79C34; --dg-cornea10: #2A5560; --dg-img-sharp: #5EDB8A; --dg-img-blur: #F5B342; --dg-sky10: #1E3A5A; --dg-sky-dark10: #05070F; --dg-air10: #A8B6C2; --dg-earth10: #55604A; --dg-atmos10: #86B0DC; --dg-drop10: #203F4E; --dg-room10: #151A20; --dg-beam10: #F6E27A; --dg-smoke10: #7A828C; --dg-forest10: #21402A; --dg-trunk10: #3E2C20; --dg-mist10: #55636A; --dg-hill10: #3F6A3A; --dg-star10: #F2C94C; --dg-plane10: #C3CCD6; --dg-card-a10: #1F3346; --dg-card-b10: #45352A;
  /* chapter 8 diagram tokens (content/C10-SCI-CH08/diagrams/_src/c8lib.py) */ --dg-pea-y: #D8B436; --dg-pea-g: #6E9E42; --dg-fl-violet: #A685DA; --dg-fl-violet-dk: #D2BDF2; --dg-fl-white: #ECE9E0; --dg-pea-leaf: #4F8F45; --dg-pea-stem: #8FD18A; --dg-calyx8: #3F7F3A; --dg-org-blue: #5B92E6; --dg-org-blue-lt: #93B6E8; --dg-org-red: #EE6B60; --dg-org-green: #5DBB6C; --dg-org-pink: #E58BB2; --dg-org-white: #F2EFE6; --dg-chrom8: #4E2E38; --dg-zyg8: #40392A; --dg-card-a8: #1F3A2A; --dg-card-b8: #34433D; --dg-cb-a: #4A4222; --dg-cb-b: #24402A; --dg-cb-c: #36305A; --dg-cb-d: #4D2C26; --dg-cb-line: #A69C7A; --dg-cb-b-pat: #3B6A45; --dg-cb-c-pat: #5A4E94; --dg-cb-d-pat: #7E4A3F;
  /* chapter 7 diagram tokens (content/C10-SCI-CH07/diagrams/_src/c7lib.py) */ --dg-dna: #86B0F0; --dg-dna-change: #F7A04E; --dg-page7: #2B3833; --dg-amoeba-y: #5C532E; --dg-amoeba-nuc: #E7D9B8; --dg-leish: #6E5038; --dg-plasmo-cell: #4D8A44; --dg-cover-red: #F07468; --dg-yeast: #6A5A33; --dg-planaria: #C08048; --dg-regrow: #5C4A3C; --dg-hydra: #4F8F48; --dg-hydra-dark: #9BD48C; --dg-sand: #7E5E38; --dg-hypha: #C9C3B2; --dg-bread: #5B4A2E; --dg-spor-young: #C7AA45; --dg-spor-ripe: #9C8158; --dg-spore: #E6D6B0; --dg-petal: #A35C77; --dg-petal-vein: #E99AB6; --dg-sepal: #3F7F3A; --dg-fl-ovary: #B9762F; --dg-fl-stigma: #8F5D6B; --dg-style7: #9E7A3E; --dg-filament: #B59B34; --dg-anther: #D07A25; --dg-ovule7: #857A4C; --dg-pollen7: #E0B032; --dg-ptube: #F7A04E; --dg-ovary-wall: #4F6E3C; --dg-germ-cell: #C7A6EC; --dg-seed-green: #6F9440; --dg-cotyledon: #5E7340; --dg-embryo7: #D2AE33; --dg-pea-coat: #7C9A45; --dg-rajma-coat: #B85454; --dg-root7: #BCAE8A; --dg-potato: #8E7447; --dg-cotton: #4A4A44; --dg-stem7: #5C9A50; --dg-flesh-line: #D9978A; --dg-red-sec: #A8574C; --dg-lining: #E2706A; --dg-uterus-wall: #5E4C3E; --dg-gland7: #9C7C45; --dg-vas: #8FB2EC; --dg-scope: #A3AFB8; --dg-scope-light: #5D6A72; --dg-slide-glass: #2D4652; --dg-fov: #1E2723; --dg-cloth: #5C5446; --dg-bowl: #3E4A50; --dg-card-a7: #1F3A2A; --dg-card-b7: #46302A;
  /* chapter 6 diagram tokens (content/C10-SCI-CH06/diagrams/_src/c6lib.py) */ --dg-nerve: #FF7F6E; --dg-soma: #C9792E; --dg-soma-nuc: #2E1A0A; --dg-axon: #7E6034; --dg-myelin: #6C5A98; --dg-muscle: #A3554B; --dg-muscle-dark: #E08A7C; --dg-capillary: #F07468; --dg-cord: #4C4535; --dg-grey-matter: #8C4D59; --dg-spark: #F2D04E; --dg-hormone: #F2B04C; --dg-auxin: #6FD18A; --dg-cranium: #6B6250; --dg-meninges: #A35C67; --dg-cerebrum: #5B4C3B; --dg-cerebellum: #7C5B40; --dg-brainstem: #705447; --dg-callosum: #6F6048; --dg-hypo: #B26E36; --dg-pituitary: #C25A43; --dg-pineal: #8A64A6; --dg-thyroid: #C76A28; --dg-parathyroid: #E07A4C; --dg-thymus: #7A5869; --dg-adrenal: #BF9628; --dg-testis: #B8962E; --dg-uterus: #9C5568; --dg-ovary: #3B8C7F; --dg-box: #8C6D44; --dg-box-in: #5E4B30; --dg-window: #22404E; --dg-root: #D3A06C; --dg-bamboo: #9C874A; --dg-shoot-cell: #2E4A30; --dg-mimosa-bg: #101A14; --dg-on-dark: #F4F1E6; --dg-mimosa-leaf: #7CC46A; --dg-pan: #A2A9AF; --dg-steam: #7E878E;
  /* chapter 5 diagram tokens (content/C10-SCI-CH05/diagrams/_src/c5lib.py) */ --dg-oxy: #F07468; --dg-deoxy: #86B0F0; --dg-oxy-fill: #6A2E2C; --dg-deoxy-fill: #26406A; --dg-wall: #8E4B44; --dg-xylem: #7FB8F0; --dg-phloem: #F2A65A; --dg-chloro: #79C77D; --dg-leaf: #3E7A3C; --dg-leaf-dark: #2F6230; --dg-leaf-cream: #CFC6A2; --dg-starch: #141A3A; --dg-iodine-stain: #B98A3A; --dg-epi: #2C3A34; --dg-safranin: #EE8DAA; --dg-guard: #35503A; --dg-soil: #5E4A33; --dg-bark: #8A6040; --dg-crown: #3F7A3C; --dg-seed: #7D9A48; --dg-vaseline: #7E7B72; --dg-koh: #2C3D3A; --dg-body: #2C3833; --dg-tissue: #6B3B46; --dg-alveoli: #B45C44; --dg-cartilage: #56636E; --dg-rib: #5E5546; --dg-diaphragm: #99554A; --dg-liver: #8C4A36; --dg-gall: #8DA03A; --dg-pancreas: #A68C45; --dg-stomach: #7C4C42; --dg-gut: #6C5444; --dg-colon: #7E5A44; --dg-kidney: #9A4A3A; --dg-bladder: #7A5C42; --dg-capsule: #A68E2E; --dg-tubule: #8E7C34; --dg-mouth: #8A4D4B; --dg-nasal: #6E4A42; --dg-cyto: #3A3A2C; --dg-vacuole: #244150; --dg-mito: #B87335; --dg-nucleus: #6E5A92; --dg-amoeba: #2E3F49; --dg-food: #F07468; --dg-sugar: #F2B25C; --dg-membrane: #C1A6E6; --dg-jar: #24373A; --dg-pot: #9C5E3A;
  /* chapter 4 diagram tokens (content/C10-SCI-CH04/diagrams/_src/c4lib.py) */ --dg-at-c: #C3C8CD; --dg-at-h: #5E666C; --dg-at-o: #F07468; --dg-at-cl: #7CCB88; --dg-at-n: #86B0F0; --dg-grp: #4A2F22; --dg-soot: #0E0E0E; --dg-ghee: #B79E52; --dg-foam: #DDE6E8; --dg-scum: #CFC8B2; --dg-mic-water: #1E3F4C; --dg-flame-blue: #86B5FF; --dg-flame-yellow: #F2CF3D; --dg-tin: #8E979F; --dg-bottle-oil: #A6914A;
  /* chapter 3 diagram tokens (content/C10-SCI-CH03/diagrams/_src/c3lib.py) */ --dg-badge-metal: #2B3B4A; --dg-badge-nonmetal: #4A3920; --dg-e-metal: #9CC3E6; --dg-e-nonmetal: #FFB07A; --dg-rust: #C9703F; --dg-oil: #B99B3B; --dg-cacl2: #E9E5DA; --dg-mud: #9A8670; --dg-rail: #A7AEB4; --dg-mould: #5C5040; --dg-molten: #FF9A3C; --dg-zinc: #8E9AA5; --dg-chrome: #C9D2DA; --dg-paint: #5DB27A; --dg-iodine: #9C7CC4; --dg-bromine: #C4583A; --dg-gold: #E8C25A; --dg-sulphur: #E2C845; --dg-hx-strip: #26363F; --dg-rx-h: #3D3824;
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #17211E; --paper-deep: #17211E; --card: #24312C; --raised: #1F2B27; --lab: #1F2B27;
  --border: #34433D; --border-soft: #2C3A35; --dashed: #4A5A53; --dashed-strong: #6B7B74;
  --rule: rgba(238, 234, 223, .06); --grid: rgba(238, 234, 223, .06); --grid-border: #34433D; --dots: rgba(238, 234, 223, .14); --margin: rgba(240, 201, 193, .28);
  --ink: #EEEADF; --ink-soft: #B9B5A8; --heading: #FFF7DD;
  --btn-bg: #EEEADF; --btn-ink: #17211E; --shadow-ink: #0E1513;
  --correct: #6FD99A; --correct-bg: rgba(111, 217, 154, .12); --wrong: #FF9F7F; --wrong-bg: rgba(255, 159, 127, .12); --wrong-line: #FF9F7F;
  --hint-bg: rgba(233, 217, 138, .12); --hint-line: #E9D98A; --hl: rgba(255, 228, 92, .30);
  --sticky: #E9D98A; --sticky-ink: #2A2410; --sticky-title: #7A2509; --sticky-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  --olive-bg: rgba(169, 216, 106, .10); --olive: #A9D86A; --olive-ink: #CFE8AE;
  --bridge-bg: rgba(242, 178, 92, .14); --bridge-ink: #F2B25C; --bridge-line: #F2B25C;
  --hand: #F2B25C; --pen: #8DB0FF;
  --acc-science: #5CCFD6; --tint-science: rgba(92, 207, 214, .14);
  --acc-maths: #B3A2FF; --tint-maths: rgba(179, 162, 255, .14);
  --acc-social: #F2B25C; --acc-english: #FF8FB1; --acc-hindi: #A9D86A;
  --on-acc: #0E1513;
  --foot-bg: #1F2B27; --foot-ink: #EEEADF; --foot-soft: #B9B5A8; --foot-line: #34433D;
  /* diagram tokens */
  --dg-water: #1D4A4E; --dg-clear: #2C3D3A; --dg-carbon: #A3A9AE; --dg-rubber: #B08672; --dg-flame: #F2A64C;
  --dg-flame-core: #86B5FF; --dg-spirit: #3E3A52; --dg-crystal: #A6D486; --dg-crystal-line: #D3EBB4;
  --dg-redbrown: #CF6B45; --dg-cuso4: #3F86CF; --dg-palegreen: #93C99E; --dg-yellow: #F2CF3D; --dg-white: #F2EFE6;
  --dg-milky: #D9D6CB; --dg-metal: #B6BCC2; --dg-silver-grey: #9DA3A8; --dg-heat: #FF8A70; --dg-bottle: #9A5C36;
  --dg-sun: #F2C94C; --dg-wood: #A88462; --dg-black: #0A0F0D; --dg-verdigris: #6CC3A0; --dg-copper-metal: #D89060;
  --dg-packet: #C9A94F; --dg-apple: #E6DBAA; --dg-apple-brown: #B98550; --dg-skin: #D9B89E; --dg-t1: #1F4447;
  --dg-t2: #3A3463; --dg-t3: #4A3A22; --dg-t4: #4C2A38; --dg-none: #34433D; --dg-poly: #46554F; --dg-row-bad: #4D3326;
  --dg-row-good: #1F4630; --dg-atom-cu: #D08A55; --dg-atom-o: #F07468; --dg-atom-h: #F2EFE6; --dg-pop: #4E2A22;
  /* chapter 9 diagram tokens */
  --dg-ray-a: #FF9A62; --dg-ray-b: #C4A8FF; --dg-ray-c: #7EE0A0; --dg-glass: #1F4447; --dg-zone1: #21382B; --dg-zone2: #3D3022; --dg-zone3: #302C48; --dg-mirror-back: #8D9A94; --dg-water-ch9: #1D4A4E; --dg-car: #D9A440; --dg-carpet: #3B3046;
  /* maths diagram tokens */
  --dg-m-opp: #FF9A62; --dg-m-adj: #7FB2FF; --dg-m-opp-bg: #4A2F22; --dg-m-adj-bg: #22344F; --dg-m-hyp-bg: #34433D; --dg-m-angle: #433A6E; --dg-m-shade: #2E3546; --dg-m-undef: #5A3424; --dg-m-band1: #21382B; --dg-m-band2: #3D3022; --dg-m-band3: #302C48; --dg-m-grid: #3A4A44; --dg-m-garden: #23402C; --dg-m-plant: #8FD18A; --dg-m-path: #4A4032;
  /* chapter 2 diagram tokens */
  --dg-ph-red: #D7263D; --dg-ph-orange: #F28C28; --dg-ph-yellow: #F5D02F; --dg-ph-green: #3FA34D; --dg-ph-blue: #2563C9; --dg-ph-violet: #6B3FA0; --dg-ph-on-dark: #FFFFFF; --dg-ph-on-light: #1F2328; --dg-lit-red: #D64550; --dg-lit-blue: #3B6FD4; --dg-lit-purple: #8A4FB8; --dg-pink: #F06BA8; --dg-tur-yellow: #F2C230; --dg-tur-ob: #C9772B; --dg-tur-rb: #A8462A; --dg-cab-red: #D94E86; --dg-cab-green: #4FA35A; --dg-cab-purple: #7A4AA8; --dg-soap: #2A4648; --dg-cl2: #9FB24A; --dg-glow: #F2CF3D; --dg-badge-a: #4A2F22; --dg-badge-b: #22344F; --dg-cork: #A88462; --dg-pellet: #D9D6CB; --dg-atom-cl: #9CCF5E; --dg-atom-na: #B39DE6; --dg-glucose: #8C7C46; --dg-cork-board: #5A4630; --dg-card-pin: #F07468;
  /* history chapter 2 diagram tokens (content/C10-HIST-CH02/diagrams/_src/hlib02.py) */ --dg-land-h2: #3A4842; --dg-sea-h2: #1C3342; --dg-coast-h2: #D6C8B4; --dg-stl-h2: #66756C; --dg-pt-h2: #FF8C7A; --dg-tint-h2: #3E3326; --dg-flagr-h2: #C8463A; --dg-flagg-h2: #3F9A57; --dg-flagy-h2: #D9AE2E; --dg-flagw-h2: #E9E5DA;
  /* chapter 13 diagram tokens (content/C10-SCI-CH13/diagrams/_src/c13lib.py) */ --dg-sky13: #1C2E3A; --dg-sun13: #D99A2B; --dg-ray13: #F2B65A; --dg-leaf13: #3F7A33; --dg-leafdk13: #2C5A26; --dg-grass13: #4F8A34; --dg-trunk13: #6E4A2A; --dg-petal13: #B94A6C; --dg-sunfl13: #C9A02A; --dg-flowerc13: #4A2E14; --dg-fur13: #9A6A3C; --dg-tiger13: #C46E1E; --dg-stripe13: #1A140E; --dg-frog13: #4E8F3A; --dg-snake13: #6F7F2A; --dg-eagle13: #5E4026; --dg-white13: #D8D4C8; --dg-beak13: #C9A02A; --dg-heron13: #7E8B96; --dg-fish13: #3E6E9E; --dg-fin13: #7FB0E0; --dg-bug13: #556F1E; --dg-aqbug13: #6B5032; --dg-grey13: #6F6B63; --dg-bird13: #7C5530; --dg-owl13: #6E4D2E; --dg-peacock13: #2A6496; --dg-pfeather13: #2D7044; --dg-water13: #1F4A63; --dg-waterln13: #7CC4EE; --dg-soil13: #6B5338; --dg-mud13: #4E3D2C; --dg-gravel13: #5E5A52; --dg-mush13: #A8402F; --dg-cream13: #CFC4B0; --dg-pest13: #FF6B7A; --dg-ozone13: #2E5A80; --dg-ozonelt13: #22394D; --dg-uv13: #C9A7FF; --dg-wedge13: #8A6A1E; --dg-bandp13: #1F3E55; --dg-bandh13: #24412A; --dg-bands13: #4A3326; --dg-bandt13: #4A4320; --dg-fsun13: #7A4A12; --dg-fprod13: #4A4320; --dg-fherb13: #2B5A2E; --dg-fcarn13: #5A3D26; --dg-ftop13: #4A3A2C; --dg-card-a13: #1F3346; --dg-card-b13: #45352A; --dg-card-c13: #1F3A2A; --dg-card-d13: #352C47; --dg-binb13: #2F5A2A; --dg-binn13: #2B4A75; --dg-plastic13: #3A4A57; --dg-glass13: #2E4A44; --dg-paper13: #4A4740; --dg-metal13: #6E7882; --dg-skin13: #B88A66; --dg-cloth13: #5A4D36; --dg-rubber13: #2E5585; --dg-fridge13: #3A454E; --dg-red13: #B5352A; --dg-ef-mark13: #5CCFD6;
  /* chapter 12 diagram tokens (content/C10-SCI-CH12/diagrams/_src/c12lib.py) */ --dg-fl12: #5EEAD4; --dg-magn12: #B9473A; --dg-mags12: #3B67AE; --dg-magbody12: #E06A5E; --dg-skin12: #C9A386; --dg-skin-ln12: #5A3A26; --dg-card12: #4A4030; --dg-live12: #FF7A7A; --dg-neu12: #D8D4C8; --dg-earth12: #5EDB8A; --dg-force12: #F5B342; --dg-filing12: #C9CED3; --dg-paper12: #2A3430; --dg-soil12: #6B5338; --dg-rod12: #8693A0; --dg-dial12: #33413B; --dg-card-a12: #1F3346; --dg-card-b12: #45352A; --dg-card-c12: #1F3A2A; --dg-card-d12: #352C47; --dg-dr-ok12: #5EDB8A;
  /* chapter 11 diagram tokens (content/C10-SCI-CH11/diagrams/_src/c11lib.py) */ --dg-wire11: #BFC5CC; --dg-res11: #F2A65A; --dg-fil11: #FBBF24; --dg-glow11: #6B5314; --dg-cur11: #8AB4FF; --dg-elec11: #C9A7FF; --dg-water11: #24506A; --dg-water-ln11: #7CC4EE; --dg-pipe11: #7D8894; --dg-tank11: #2E3E48; --dg-board11: #4A3E2A; --dg-nichrome11: #B6BEC8; --dg-copper11: #F59E6B; --dg-porc11: #3A4046; --dg-iron11: #5A6B7A; --dg-plate11: #3B4540; --dg-lcd11: #1E3B2A; --dg-box11: #26343F; --dg-card-a11: #1F3346; --dg-card-b11: #45352A; --dg-card-c11: #1F3A2A; --dg-card-d11: #352C47; --dg-cv-pt11: #FF8A8A;
  /* chapter 10 diagram tokens (content/C10-SCI-CH10/diagrams/_src/c10lib.py) */ --dg-sp-r: #FF6B6B; --dg-sp-o: #FFA552; --dg-sp-y: #F5D547; --dg-sp-g: #6FD584; --dg-sp-b: #6FA6FF; --dg-sp-i: #9C8CFF; --dg-sp-v: #D08BFF; --dg-eyeball: #2A3632; --dg-vitreous: #24353A; --dg-aqueous: #21414A; --dg-iris10: #B88A64; --dg-muscle10: #99554A; --dg-retina10: #F07468; --dg-nerve10: #C79C34; --dg-cornea10: #2A5560; --dg-img-sharp: #5EDB8A; --dg-img-blur: #F5B342; --dg-sky10: #1E3A5A; --dg-sky-dark10: #05070F; --dg-air10: #A8B6C2; --dg-earth10: #55604A; --dg-atmos10: #86B0DC; --dg-drop10: #203F4E; --dg-room10: #151A20; --dg-beam10: #F6E27A; --dg-smoke10: #7A828C; --dg-forest10: #21402A; --dg-trunk10: #3E2C20; --dg-mist10: #55636A; --dg-hill10: #3F6A3A; --dg-star10: #F2C94C; --dg-plane10: #C3CCD6; --dg-card-a10: #1F3346; --dg-card-b10: #45352A;
  /* chapter 8 diagram tokens (content/C10-SCI-CH08/diagrams/_src/c8lib.py) */ --dg-pea-y: #D8B436; --dg-pea-g: #6E9E42; --dg-fl-violet: #A685DA; --dg-fl-violet-dk: #D2BDF2; --dg-fl-white: #ECE9E0; --dg-pea-leaf: #4F8F45; --dg-pea-stem: #8FD18A; --dg-calyx8: #3F7F3A; --dg-org-blue: #5B92E6; --dg-org-blue-lt: #93B6E8; --dg-org-red: #EE6B60; --dg-org-green: #5DBB6C; --dg-org-pink: #E58BB2; --dg-org-white: #F2EFE6; --dg-chrom8: #4E2E38; --dg-zyg8: #40392A; --dg-card-a8: #1F3A2A; --dg-card-b8: #34433D; --dg-cb-a: #4A4222; --dg-cb-b: #24402A; --dg-cb-c: #36305A; --dg-cb-d: #4D2C26; --dg-cb-line: #A69C7A; --dg-cb-b-pat: #3B6A45; --dg-cb-c-pat: #5A4E94; --dg-cb-d-pat: #7E4A3F;
  /* chapter 7 diagram tokens (content/C10-SCI-CH07/diagrams/_src/c7lib.py) */ --dg-dna: #86B0F0; --dg-dna-change: #F7A04E; --dg-page7: #2B3833; --dg-amoeba-y: #5C532E; --dg-amoeba-nuc: #E7D9B8; --dg-leish: #6E5038; --dg-plasmo-cell: #4D8A44; --dg-cover-red: #F07468; --dg-yeast: #6A5A33; --dg-planaria: #C08048; --dg-regrow: #5C4A3C; --dg-hydra: #4F8F48; --dg-hydra-dark: #9BD48C; --dg-sand: #7E5E38; --dg-hypha: #C9C3B2; --dg-bread: #5B4A2E; --dg-spor-young: #C7AA45; --dg-spor-ripe: #9C8158; --dg-spore: #E6D6B0; --dg-petal: #A35C77; --dg-petal-vein: #E99AB6; --dg-sepal: #3F7F3A; --dg-fl-ovary: #B9762F; --dg-fl-stigma: #8F5D6B; --dg-style7: #9E7A3E; --dg-filament: #B59B34; --dg-anther: #D07A25; --dg-ovule7: #857A4C; --dg-pollen7: #E0B032; --dg-ptube: #F7A04E; --dg-ovary-wall: #4F6E3C; --dg-germ-cell: #C7A6EC; --dg-seed-green: #6F9440; --dg-cotyledon: #5E7340; --dg-embryo7: #D2AE33; --dg-pea-coat: #7C9A45; --dg-rajma-coat: #B85454; --dg-root7: #BCAE8A; --dg-potato: #8E7447; --dg-cotton: #4A4A44; --dg-stem7: #5C9A50; --dg-flesh-line: #D9978A; --dg-red-sec: #A8574C; --dg-lining: #E2706A; --dg-uterus-wall: #5E4C3E; --dg-gland7: #9C7C45; --dg-vas: #8FB2EC; --dg-scope: #A3AFB8; --dg-scope-light: #5D6A72; --dg-slide-glass: #2D4652; --dg-fov: #1E2723; --dg-cloth: #5C5446; --dg-bowl: #3E4A50; --dg-card-a7: #1F3A2A; --dg-card-b7: #46302A;
  /* chapter 6 diagram tokens (content/C10-SCI-CH06/diagrams/_src/c6lib.py) */ --dg-nerve: #FF7F6E; --dg-soma: #C9792E; --dg-soma-nuc: #2E1A0A; --dg-axon: #7E6034; --dg-myelin: #6C5A98; --dg-muscle: #A3554B; --dg-muscle-dark: #E08A7C; --dg-capillary: #F07468; --dg-cord: #4C4535; --dg-grey-matter: #8C4D59; --dg-spark: #F2D04E; --dg-hormone: #F2B04C; --dg-auxin: #6FD18A; --dg-cranium: #6B6250; --dg-meninges: #A35C67; --dg-cerebrum: #5B4C3B; --dg-cerebellum: #7C5B40; --dg-brainstem: #705447; --dg-callosum: #6F6048; --dg-hypo: #B26E36; --dg-pituitary: #C25A43; --dg-pineal: #8A64A6; --dg-thyroid: #C76A28; --dg-parathyroid: #E07A4C; --dg-thymus: #7A5869; --dg-adrenal: #BF9628; --dg-testis: #B8962E; --dg-uterus: #9C5568; --dg-ovary: #3B8C7F; --dg-box: #8C6D44; --dg-box-in: #5E4B30; --dg-window: #22404E; --dg-root: #D3A06C; --dg-bamboo: #9C874A; --dg-shoot-cell: #2E4A30; --dg-mimosa-bg: #101A14; --dg-on-dark: #F4F1E6; --dg-mimosa-leaf: #7CC46A; --dg-pan: #A2A9AF; --dg-steam: #7E878E;
  /* chapter 5 diagram tokens (content/C10-SCI-CH05/diagrams/_src/c5lib.py) */ --dg-oxy: #F07468; --dg-deoxy: #86B0F0; --dg-oxy-fill: #6A2E2C; --dg-deoxy-fill: #26406A; --dg-wall: #8E4B44; --dg-xylem: #7FB8F0; --dg-phloem: #F2A65A; --dg-chloro: #79C77D; --dg-leaf: #3E7A3C; --dg-leaf-dark: #2F6230; --dg-leaf-cream: #CFC6A2; --dg-starch: #141A3A; --dg-iodine-stain: #B98A3A; --dg-epi: #2C3A34; --dg-safranin: #EE8DAA; --dg-guard: #35503A; --dg-soil: #5E4A33; --dg-bark: #8A6040; --dg-crown: #3F7A3C; --dg-seed: #7D9A48; --dg-vaseline: #7E7B72; --dg-koh: #2C3D3A; --dg-body: #2C3833; --dg-tissue: #6B3B46; --dg-alveoli: #B45C44; --dg-cartilage: #56636E; --dg-rib: #5E5546; --dg-diaphragm: #99554A; --dg-liver: #8C4A36; --dg-gall: #8DA03A; --dg-pancreas: #A68C45; --dg-stomach: #7C4C42; --dg-gut: #6C5444; --dg-colon: #7E5A44; --dg-kidney: #9A4A3A; --dg-bladder: #7A5C42; --dg-capsule: #A68E2E; --dg-tubule: #8E7C34; --dg-mouth: #8A4D4B; --dg-nasal: #6E4A42; --dg-cyto: #3A3A2C; --dg-vacuole: #244150; --dg-mito: #B87335; --dg-nucleus: #6E5A92; --dg-amoeba: #2E3F49; --dg-food: #F07468; --dg-sugar: #F2B25C; --dg-membrane: #C1A6E6; --dg-jar: #24373A; --dg-pot: #9C5E3A;
  /* chapter 4 diagram tokens (content/C10-SCI-CH04/diagrams/_src/c4lib.py) */ --dg-at-c: #C3C8CD; --dg-at-h: #5E666C; --dg-at-o: #F07468; --dg-at-cl: #7CCB88; --dg-at-n: #86B0F0; --dg-grp: #4A2F22; --dg-soot: #0E0E0E; --dg-ghee: #B79E52; --dg-foam: #DDE6E8; --dg-scum: #CFC8B2; --dg-mic-water: #1E3F4C; --dg-flame-blue: #86B5FF; --dg-flame-yellow: #F2CF3D; --dg-tin: #8E979F; --dg-bottle-oil: #A6914A;
  /* chapter 3 diagram tokens (content/C10-SCI-CH03/diagrams/_src/c3lib.py) */ --dg-badge-metal: #2B3B4A; --dg-badge-nonmetal: #4A3920; --dg-e-metal: #9CC3E6; --dg-e-nonmetal: #FFB07A; --dg-rust: #C9703F; --dg-oil: #B99B3B; --dg-cacl2: #E9E5DA; --dg-mud: #9A8670; --dg-rail: #A7AEB4; --dg-mould: #5C5040; --dg-molten: #FF9A3C; --dg-zinc: #8E9AA5; --dg-chrome: #C9D2DA; --dg-paint: #5DB27A; --dg-iodine: #9C7CC4; --dg-bromine: #C4583A; --dg-gold: #E8C25A; --dg-sulphur: #E2C845; --dg-hx-strip: #26363F; --dg-rx-h: #3D3824;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper-deep); color: var(--ink);
  font: 400 16px/1.7 "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--heading); text-underline-offset: 2px; }
a:hover { color: var(--acc); }
p { margin: 0 0 .6em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 .6em; padding-left: 1.3em; }
b, strong { font-weight: 600; }
h1, h2, h3, h4 { margin: 0; color: var(--heading); }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--btn-bg); color: var(--btn-ink); padding: 10px 14px; border-radius: var(--r); z-index: 50; }
.skip-link:focus { top: 8px; }
.small { font-size: 14px; line-height: 1.55; }
.muted { color: var(--ink-soft); }
.hand, .kicker-hand { font-family: "Kalam", cursive; }
.kicker-hand { display: block; font-size: 16px; color: var(--hand); }
.ico { flex-shrink: 0; vertical-align: middle; }
code.mathfail { color: var(--wrong); }

/* textures */
.ruled, .ruled-sec { background-color: var(--paper); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px); }
.graph { background-color: var(--card); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
.dots { background-color: var(--lab); background-image: radial-gradient(var(--dots) 1.1px, transparent 1.5px); background-size: 18px 18px; }
.margin-paper {
  background-color: var(--paper);
  background-image: linear-gradient(90deg, transparent 30px, var(--margin) 30px, var(--margin) 31.5px, transparent 31.5px),
                    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px);
  border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 16px 20px 44px;
}

/* ------------------------------------------------------------ header / footer */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 10px 12px 10px 8px; background: var(--raised); border-bottom: 1px solid var(--border);
  position: relative; z-index: 10;
}
.topbar--home { padding-left: 14px; }
.topbar-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r); border: 1px solid transparent; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; flex-shrink: 0; text-decoration: none;
}
.lang-btn { border-color: var(--border); background: var(--card); font-size: 13px; font-weight: 600; }
.tb-title { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 1; text-align: center; line-height: 1.35; }
.tb-kicker { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tb-main { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--heading); min-height: 44px; }
.logo-mark { color: var(--heading); flex-shrink: 0; }
.logo-scribble { stroke: var(--acc); }
.logo-word { font-family: "Kalam", cursive; font-weight: 700; font-size: 22px; color: var(--heading); line-height: 1; }
.logo-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; align-self: center; margin-bottom: 4px; }
.logo-hero .logo-word { font-size: 40px; }
.show-dark { display: none; }
.is-dark .show-dark { display: inline-flex; }
.is-dark .show-light { display: none; }
.lang { position: relative; }
.lang-menu {
  position: absolute; right: 0; top: 50px; min-width: 200px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: 0 10px 24px rgba(0, 0, 0, .15); padding: 6px; display: flex; flex-direction: column; z-index: 30;
}
.lang-opt { padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-soft); }
.lang-opt.is-on { color: var(--ink); font-weight: 600; background: var(--paper-deep); }
.readbar { position: sticky; top: 0; height: 4px; background: var(--border); z-index: 9; }
.readbar-fill { display: block; height: 4px; background: var(--acc); transform-origin: 0 50%; transform: scaleX(0); }

.site-foot {
  display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 28px; background: var(--foot-bg); color: var(--foot-ink); font-size: 14px;
}
.foot-langs, .foot-links { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.foot-lang { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--foot-line); color: var(--foot-soft); }
.foot-lang.is-on { background: var(--foot-ink); color: #12352D; border-color: var(--foot-ink); font-weight: 600; }
.foot-soon, .foot-note { color: var(--foot-soft); font-size: 13px; }

/* ------------------------------------------------------------ layout */
.main { display: block; }
.stack { display: flex; flex-direction: column; gap: 26px; padding: 22px 16px 36px; max-width: 760px; margin: 0 auto; }
.lesson { display: flex; flex-direction: column; gap: 26px; padding: 22px 16px 120px; max-width: 760px; margin: 0 auto; }
.main--lesson { background: var(--paper); }
.main--lesson, .main--practice, .main--test { min-height: 70vh; }
.block { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.h-sec { font-family: "Kalam", cursive; font-weight: 700; font-size: 24px; line-height: 1.2; color: var(--heading); }
.h-sub { font-family: "Kalam", cursive; font-weight: 700; font-size: 20px; line-height: 1.25; color: var(--heading); margin: 14px 0 4px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-head { display: flex; flex-direction: column; gap: 8px; }
.l-title { font-family: "Kalam", cursive; font-weight: 700; font-size: 30px; line-height: 1.15; color: var(--heading); }
.wavy { display: block; margin-top: -6px; }
.wavy path { stroke: var(--hand); }
.wavy--acc path { stroke: var(--acc); }
@media (min-width: 760px) {
  .main--lesson .lesson {
    background-image: linear-gradient(90deg, transparent 18px, var(--margin) 18px, var(--margin) 19.5px, transparent 19.5px);
    padding-left: 44px;
  }
}

/* ------------------------------------------------------------ buttons, chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px;
  border-radius: var(--r); font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid transparent; line-height: 1.3; text-align: center;
}
.btn--primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn--primary:hover { color: var(--btn-ink); filter: brightness(1.12); }
.btn--secondary { background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn--text { background: transparent; color: var(--heading); padding: 8px 4px; text-decoration: underline; min-height: 44px; }
.btn--big { min-height: 52px; border-radius: 14px; font-size: 16px; width: 100%; }
.btn--wide { width: 100%; }
.btn--sm { min-height: 44px; font-size: 14px; padding: 6px 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; line-height: 1.4; white-space: nowrap; }
.chip--plain { background: var(--paper-deep); color: var(--ink); }
.chip--src { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.chip--diff, .chip--marks { background: var(--card); border: 1px solid var(--border); color: var(--ink); }
.chip--mint { background: var(--mint); color: var(--chip-ink); }
.chip--pink { background: var(--pink); color: var(--chip-ink); }
.chip--olive { background: var(--card); border: 1px solid var(--olive); color: var(--olive-ink); }
.chip--bridge { background: var(--bridge-bg); color: var(--bridge-ink); }
.chip--mark { border: 1.5px solid var(--heading); color: var(--heading); background: transparent; }
.pill-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.pill {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.pill.is-on, .pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pill-row--sticky { position: sticky; top: 0; z-index: 8; background: var(--raised); border-bottom: 1px solid var(--border); padding: 10px 16px; }

/* ------------------------------------------------------------ home */
.hero { display: flex; flex-direction: column; gap: 14px; padding: 28px 20px 30px; border-bottom: 1px solid var(--border); }
.hero > * { max-width: 720px; }
.hero .chip { align-self: flex-start; font-size: 13px; padding: 5px 10px; }
.hero-title { font-family: "Kalam", cursive; font-weight: 700; font-size: 36px; line-height: 1.1; }
.hero-sub { font-size: 16px; line-height: 1.7; }
@media (min-width: 760px) { .hero { align-items: center; } .hero > * { width: 100%; } }
mark.hl { background: linear-gradient(transparent 42%, var(--hl) 42%, var(--hl) 88%, transparent 88%); color: inherit; font-weight: 600; padding: 0 1px; }
.class-row { display: flex; gap: 8px; flex-wrap: wrap; }
.class-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r); font-size: 15px; }
.class-btn.is-on { background: var(--btn-bg); color: var(--btn-ink); font-weight: 600; border: 2px solid var(--btn-bg); }
.class-btn.is-soon { border: 1.5px dashed var(--dashed); color: var(--ink-soft); font-size: 14px; }
.subj-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-card); background: var(--card);
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--acc); text-decoration: none; color: var(--ink);
}
.subj-card:hover { color: var(--ink); }
.subj-card--soon { box-shadow: none; border: 1.5px dashed var(--dashed); }
.subj-ico { width: 56px; height: 56px; border-radius: 14px; background: var(--tint); color: var(--acc); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.subj-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.subj-txt b { font-size: 18px; }
.subj-txt span { font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.subj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.subj-soon { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; border-radius: 14px; border: 1.5px dashed var(--dashed); color: var(--ink-soft); font-size: 13px; line-height: 1.35; }
.subj-soon b { color: var(--ink); }
.subj-soon .ico { color: var(--acc); }
.how-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.how-step { display: flex; gap: 14px; align-items: flex-start; position: relative; padding-bottom: 14px; }
.how-step::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--border); }
.how-step--last { padding-bottom: 0; }
.how-step--last::before { display: none; }
.how-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.how-step--last .how-ico { background: var(--mint); color: var(--chip-ink); }
.how-txt { display: flex; flex-direction: column; padding-top: 2px; line-height: 1.45; }
.how-txt b { font-size: 15px; }
.how-txt span { font-size: 14px; color: var(--ink-soft); }

/* ------------------------------------------------------------ stickies & notes */
.sticky {
  background: var(--sticky); color: var(--sticky-ink); padding: 16px 18px 18px; box-shadow: var(--sticky-shadow);
  transform: rotate(-1.2deg); width: 100%; max-width: 340px; align-self: center; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.55;
}
.sticky a { color: var(--sticky-ink); }
.sticky--pink { background: var(--pink); color: var(--chip-ink); transform: rotate(1.2deg); }
.sticky-head { display: flex; align-items: center; gap: 8px; font-family: "Kalam", cursive; font-weight: 700; font-size: 20px; color: #12352D; }
.sticky-head h2 { font-size: 20px; color: inherit; font-family: inherit; }
.sticky-head--warn { color: var(--sticky-title); }
.mistakes { max-width: 380px; transform: rotate(-0.6deg); }
.mk-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.mk-list li { border-top: 1px dashed rgba(60, 50, 10, .3); padding-top: 10px; }
.mk-list li:first-child { border-top: 0; padding-top: 0; }
.mk-list p { margin: 0 0 4px; }
.mk-wrong { display: flex; gap: 6px; font-weight: 600; color: #8A2B0E; }
.mk-why { font-size: 14px; }
.mk-do { display: flex; gap: 6px; color: #145C32; font-weight: 600; }
.mini-sticky { background: var(--sticky); color: var(--sticky-ink); padding: 8px 12px; font-size: 14px; line-height: 1.5; transform: rotate(-0.6deg); margin-top: 8px; }
.mini-sticky b:first-child { font-family: "Kalam", cursive; font-size: 16px; color: var(--sticky-title); }
.note { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--acc); border-radius: var(--r); padding: 12px 14px; font-size: 15px; line-height: 1.6; }
.note-head { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--heading); }
.note-head .ico { color: var(--acc); }
.note--safety { border-left-color: var(--wrong-line); }
.note--safety .note-head .ico { color: var(--wrong); }
.note--aside { border: 1.5px dashed var(--dashed); }
.note--aside .note-head .ico { color: var(--ink-soft); }
.note--info { background: var(--hint-bg); border-color: var(--hint-line); border-left-color: var(--hint-line); }
.note--info .note-head .ico { color: var(--ink); }
.rule-card { margin: 0; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 12px 14px; box-shadow: 3px 3px 0 var(--acc); }
.dyk { background: var(--olive-bg); border: 1.5px dashed var(--olive); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.6; border-radius: 4px; }
.dyk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dyk-title { display: inline-flex; align-items: center; gap: 8px; font-family: "Kalam", cursive; font-weight: 700; font-size: 20px; color: var(--ink); }
.dyk-title .ico { color: var(--olive); }
.dyk-src { font-size: 13px; color: var(--ink-soft); }
.hintbox { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--hint-bg); font-size: 14px; line-height: 1.55; }
.hintbox ul { margin: 6px 0; padding-left: 1.1em; }

/* ------------------------------------------------------------ lesson */
.lesson-title { display: flex; flex-direction: column; gap: 6px; }
.los { margin-top: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 0 14px; font-size: 15px; }
.los summary, .more summary, .fig-more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; list-style: none; }
.los summary::-webkit-details-marker, .more summary::-webkit-details-marker, .fig-more summary::-webkit-details-marker, .sol-card summary::-webkit-details-marker { display: none; }
.los summary::after, .more summary::after, .fig-more summary::after { content: "+"; margin-left: auto; font-size: 20px; font-weight: 400; }
.los[open] summary::after, .more[open] summary::after, .fig-more[open] summary::after { content: "–"; }
.los ul { padding-bottom: 10px; }
.l-intro .rule-card, .l-intro .note { margin-bottom: 0; }
.hook { display: flex; gap: 12px; align-items: flex-start; }
.nb-card { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 16px; box-shadow: 4px 4px 0 var(--shadow-ink); }
.hook > .ico { color: var(--hand); }
.hook p { font-size: 16px; line-height: 1.6; }
.l-sec { display: flex; flex-direction: column; gap: 12px; }
.ruled-sec { line-height: 2; margin: 0 -16px; padding: 4px 16px; background-color: transparent; }
.ruled-sec > p, .ruled-sec > ul, .ruled-sec > ol { margin: 0; }
.ruled-sec ul, .ruled-sec ol { line-height: 1.8; }
.ruled-sec .note, .ruled-sec .dyk, .ruled-sec .lab, .ruled-sec .table-wrap, .ruled-sec .eq-block, .ruled-sec .fig, .ruled-sec .sticky { line-height: 1.6; }
.ruled-sec .h-sub { margin-top: 10px; }
.lab { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--border);
  background-color: var(--lab); background-image: radial-gradient(var(--dots) 1.1px, transparent 1.5px); background-size: 18px 18px; font-size: 15px; }
.lab-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.lab-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: start; }
.lab-tag { display: inline-flex; align-items: center; gap: 4px; font-family: "Kalam", cursive; font-weight: 700; font-size: 17px; color: var(--acc); line-height: 1.5; }
.lab-text { line-height: 1.6; }
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); background: var(--card); scrollbar-width: thin; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.5; }
.table-wrap th, .table-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; min-width: 84px; }
.table-wrap th { background: var(--paper-deep); font-weight: 600; }
.table-wrap tr:last-child td { border-bottom: 0; }
/* wide table: fade the edge that has more to see, and a cue line under the box (tcUpdate / initTableCue in site.js) */
.table-wrap.is-overflow { --tc-l: 0px; --tc-r: 40px;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .18) 0, #000 var(--tc-l), #000 calc(100% - var(--tc-r)), rgba(0, 0, 0, .18) 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .18) 0, #000 var(--tc-l), #000 calc(100% - var(--tc-r)), rgba(0, 0, 0, .18) 100%); }
.table-wrap.is-overflow.is-scrolled { --tc-l: 28px; }
.table-wrap.is-overflow.at-end { --tc-r: 0px; }
.table-wrap.is-overflow:focus-visible { -webkit-mask-image: none; mask-image: none; }
.table-cue { margin: 4px 2px 0; text-align: right; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.l-sec > .table-cue, .ruled-sec > .table-cue { margin-top: -8px; }
.fig { margin: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); line-height: 1.5; }
.fig-frame { min-height: 160px; border-radius: 10px; border: 2px dashed var(--dashed); padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  background-color: var(--lab); background-image: radial-gradient(var(--dots) 1.1px, transparent 1.5px); background-size: 18px 18px; }
.fig-soon { display: inline-flex; align-items: center; gap: 6px; font-family: "Kalam", cursive; font-size: 17px; color: var(--ink-soft); }
.fig-title { font-size: 16px; color: var(--ink); }
.fig-id { font-size: 12px; color: var(--ink-soft); letter-spacing: .02em; }
.fig-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.fig figcaption { font-size: 13px; color: var(--ink-soft); }
.fig-more { font-size: 13px; color: var(--ink-soft); }
.fig-more summary { font-size: 13px; color: var(--heading); }
.fig-more p { margin-bottom: 8px; }
.fig--drawn figcaption { display: flex; flex-direction: column; gap: 4px; }
.fig--drawn .fig-title { font-size: 15px; color: var(--ink); }
.fig-purpose { font-size: 13px; color: var(--ink-soft); }
.fig-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.fig-meta .fig-tags { justify-content: flex-start; }
.fig-art { border-radius: 10px; background: var(--card); }
.fig-art svg { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; }
.fig-art svg.dg-resp.is-wide { max-width: 720px; }   /* responsive figure in its wide-screen layout (initResp) */
.fig-toggle { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1.5px solid var(--heading); border-radius: var(--r); background: transparent; color: var(--heading); font-size: 14px; font-weight: 600; cursor: pointer; }
.fig-toggle[aria-pressed="true"] { background: var(--heading); color: var(--paper); }
.xp-ctl { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; border-radius: 10px; background: var(--paper-deep); }
.xp-label { font-size: 14px; color: var(--ink); }
.xp-label b { font-weight: 600; }
.xp-range { width: 100%; min-height: 44px; margin: 0; accent-color: var(--acc); cursor: pointer; }
.xp-range:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.xp-read { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; }
.xp-r1 { font-family: "Kalam", cursive; font-weight: 700; font-size: 17px; color: var(--heading); }
.xp-r2 { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
/* angle explorer (Maths Ch 8 V4; built by initAe in site.js) */
.ae { display: flex; flex-direction: column; gap: 10px; }
.ae-main { display: flex; flex-direction: column; gap: 10px; }
.ae-figs { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ae-figs svg { display: block; width: 100%; height: auto; max-width: 440px; margin: 0 auto; }
.ae-bars { max-width: 360px !important; }
.ae-hit { cursor: grab; touch-action: none; }
.ae.is-dragging .ae-hit { cursor: grabbing; }
.ae-labs { transition: opacity .1s linear; }
.ae-labs.is-fading { opacity: 0; }
.ae-read { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; min-width: 0; }
.ae-read p { margin: 0; }
.ae-read b { font-weight: 600; }
.ae-r-ang { font-family: "Kalam", cursive; font-weight: 700; font-size: 20px; color: var(--heading); }
.ae-r-c { font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; color: var(--heading); }
.ae-r-sides { color: var(--ink-soft); }
.ae-r-sin b:first-child { color: var(--dg-m-opp); }
.ae-r-cos b:first-child { color: var(--dg-m-adj); }
.ae-exact { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--dashed); }
.ae-exact-h { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.ae-exact-v { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 16px; }
.ae-ex { white-space: nowrap; }
.fig-art .katex svg { display: block; width: 100%; height: inherit; max-width: none; margin: 0; }
.ae-ctl { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; border-radius: 10px; background: var(--paper-deep); }
.ae-label { font-size: 14px; color: var(--ink); }
.ae-label b { font-weight: 600; }
.ae-range { width: 100%; min-height: 44px; margin: 0; accent-color: var(--acc); cursor: pointer; }
.ae-range:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.ae-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-chip { min-width: 52px; min-height: 44px; padding: 6px 10px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 15px/1 "Lexend", sans-serif; cursor: pointer; }
.ae-chip[aria-pressed="true"] { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; }
.ae--values .ae-chip { border: 2px solid var(--acc); font-size: 16px; flex: 1 1 52px; }
.ae-swap { align-self: flex-start; }
.ae-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (min-width: 720px) {
  .ae-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { .ae-labs { transition: none; } }
/* pH explorer (Science Ch 2 V9; built by initPh in site.js) */
.ph { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ph-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-tab { flex: 1 1 auto; min-height: 44px; padding: 8px 12px; border-radius: var(--r); border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.ph-tab[aria-selected="true"] { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; }
.ph-inds { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ph-inds legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ph-chip { position: relative; display: inline-flex; }
.ph-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ph-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font-size: 14px; cursor: pointer; }
.ph-chip input:checked + span { background: var(--tint); border-color: var(--acc); font-weight: 600; }
.ph-chip input:checked + span::before { content: "✓\00a0"; }
.ph-chip input:focus-visible + span, .ph button:focus-visible, .ph select:focus-visible, .ph input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.ph-main { display: flex; flex-direction: column; gap: 10px; }
.ph-pic { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ph-pic svg { display: block; width: 140px; height: auto; }
.ph-pair { display: flex; gap: 22px; justify-content: center; }
.ph-pair svg { width: 64px; margin: 0 auto; }
.ph-liq { transition: fill .35s ease; }
.ph-cw { margin: 0; font-size: 14px; font-weight: 600; text-align: center; color: var(--ink); }
.ph-read { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); font-size: 14px; line-height: 1.45; min-width: 0; font-variant-numeric: tabular-nums; }
.ph-read p { margin: 0; }
.ph-m { display: flex; flex-direction: column; gap: 6px; }
.ph-sl { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ph-sel { min-height: 44px; width: 100%; padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; }
.ph-list { display: none; flex-wrap: wrap; gap: 4px; }
.ph-sb { min-height: 44px; padding: 4px 10px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 13.5px/1.2 "Lexend", sans-serif; cursor: pointer; text-align: left; }
.ph-sb b { font-weight: 600; color: var(--ink-soft); }
.ph-sb[aria-pressed="true"] { border-color: var(--acc); background: var(--tint); }
.ph-name { font-family: "Kalam", cursive; font-weight: 700; font-size: 19px; color: var(--heading); }
.ph-big { font-size: 22px; font-weight: 600; color: var(--ink); }
.ph-note, .ph-per, .ph-setup { color: var(--ink-soft); }
.ph-nat { font-weight: 600; color: var(--heading); }
.ph-start { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ph-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-btns button, .ph-pz-open, .ph-pz-go, .ph-dil, .ph-cc { min-height: 44px; padding: 6px 12px; border-radius: var(--r); border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.ph-reset { border-style: dashed !important; }
.ph-cc[aria-pressed="true"] { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; }
.ph-dil:disabled { opacity: .5; cursor: not-allowed; }
.ph-pz-open { align-self: flex-start; }
.ph-banner { padding: 8px 10px; border-radius: 8px; background: var(--correct-bg); color: var(--correct); font-weight: 600; }
.ph-full { color: var(--wrong); font-weight: 600; }
.ph-graph { display: block; width: 100%; max-width: 360px; height: auto; }
.ph-pz { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; border: 2px dashed var(--hint-line); background: var(--hint-bg); }
.ph-pz-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ph-guess { width: 90px; min-height: 44px; padding: 4px 8px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; }
.ph-ccs { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-dil { align-self: flex-start; }
.ph-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ph-tn { font-weight: 600; }
.ph-cap { color: var(--ink-soft); }
.ph-rul { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; }
.ph-ptr { transition: transform .35s ease; }
.ph-key { margin: 0; text-align: center; font-size: 13px; color: var(--ink-soft); }
.ph-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (min-width: 720px) {
  .ph-main { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: start; gap: 14px; }
  .ph-sel, .ph-sl { display: none; }
  .ph-list { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .ph-liq, .ph-ptr { transition: none; } }
/* Reactivity explorer (Science Ch 3 T04-V14; built by initRx in site.js) */
.rx { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.rx-ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rx-h { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.rx-ms, .rx-g { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.rx-rs { display: flex; flex-direction: column; gap: 6px; }
.rx-gl { flex: 0 0 100%; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.rx-m, .rx-hm { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  padding: 3px 6px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--dg-badge-metal, #DCE6EF); color: var(--ink); font: 15px/1.15 "Lexend", sans-serif; cursor: pointer; }
.rx-m b, .rx-hm b { font-weight: 600; }
.rx-mn { display: none; font-family: "Kalam", cursive; font-size: 14px; }
.rx-rel { font-size: 12.5px; font-weight: 600; color: var(--acc); white-space: nowrap; }
.rx-rel:empty { display: none; }
.rx-hm { cursor: default; background: var(--dg-rx-h, #FFF1C9); border-style: dashed; border-color: var(--dashed-strong); min-width: 40px; }
.rx-m[aria-pressed="true"] { border: 3px solid var(--acc); box-shadow: 0 0 0 2px var(--card) inset; }
.rx-m.rx-cmp, .rx-hm.rx-cmp { outline: 2.5px dashed var(--acc); outline-offset: 2px; }
.rx-r { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px/1.2 "Lexend", sans-serif; cursor: pointer; text-align: left; }
.rx-r[aria-pressed="true"] { background: var(--tint); border-color: var(--acc); font-weight: 600; }
.rx-r[aria-pressed="true"]::before { content: "✓\00a0"; }
.rx-m:focus-visible, .rx-r:focus-visible, .rx button:focus-visible, .rx-tog input:focus-visible + span { outline: 3px solid var(--acc); outline-offset: 2px; }
.rx-tog { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; align-self: flex-start; font-weight: 600; cursor: pointer; }
.rx-tog input { width: 22px; height: 22px; accent-color: var(--acc-fill); }
.rx-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rx-pic { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rx-svg { display: block; width: 150px; height: auto; }
@media (min-width: 760px) { .rx-svg { width: 180px; } }
.rx-cap { margin: 0; font-size: 14px; font-weight: 600; text-align: center; }
.rx-hg { margin: 0; font-size: 13px; color: var(--wrong); font-weight: 600; text-align: center; }
.rx-read { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); line-height: 1.45; min-width: 0; }
.rx-ask { display: flex; flex-direction: column; gap: 6px; }
.rx-q { margin: 0; font-family: "Kalam", cursive; font-weight: 700; font-size: 19px; color: var(--heading); }
.rx-yn { display: flex; gap: 8px; }
.rx-y, .rx-again { min-height: 44px; min-width: 76px; padding: 6px 14px; border-radius: var(--r); border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 15px/1.2 "Lexend", sans-serif; cursor: pointer; }
.rx-again { align-self: flex-start; border-style: dashed; }
.rx-res { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rx-ban { margin: 0; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--hint-line); background: var(--hint-bg); color: var(--ink); font-weight: 600; }
.rx-ban span { color: var(--wrong); font-size: 18px; }
.rx-fb { margin: 0; font-weight: 600; }
.rx-ok { color: var(--correct); } .rx-ok::before { content: "✓ "; }
.rx-no { color: var(--wrong); } .rx-no::before { content: "✗ "; }
.rx-dl { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rx-dl dt { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-top: 4px; }
.rx-dl dd { margin: 0; min-width: 0; }
.rx-v1 { font-weight: 600; font-size: 17px; }
.rx-note { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.rx-v3 { overflow-x: auto; }
.rx-eq .katex { font-size: 1.12em; white-space: nowrap; }
@media (min-width: 760px) {
  .rx { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 16px; align-items: start; }
  .rx-ctl { display: contents; }
  .rx-ctl > .rx-h:first-child { grid-column: 1; grid-row: 1; }
  .rx-ms { grid-column: 1; grid-row: 2 / span 4; flex-direction: column; flex-wrap: nowrap; }
  .rx-m, .rx-hm { flex-direction: row; justify-content: flex-start; gap: 6px; width: 100%; }
  .rx-mn { display: inline; }
  .rx-rel { margin-left: auto; }
  .rx-ctl > .rx-h:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  .rx-rs { grid-column: 2; grid-row: 2; }
  .rx-tog { grid-column: 2; grid-row: 3; }
  .rx-main { grid-column: 2; grid-row: 4; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { .rx * { transition: none !important; animation: none !important; } }
/* Name-it explorer (Science Ch 4 T05-V13; built by initNi in site.js) */
.ni { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.ni-ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ni-h { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.ni-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ni-c, .ni-f, .ni-p { min-width: 44px; min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.ni-c[aria-pressed="true"], .ni-f[aria-pressed="true"], .ni-p[aria-pressed="true"] { background: var(--tint); border-color: var(--acc); font-weight: 600; }
.ni-f[aria-pressed="true"]::before { content: "✓\00a0"; }
.ni-pnote { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.ni-tog { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; align-self: flex-start; font-weight: 600; cursor: pointer; }
.ni-tog input { width: 22px; height: 22px; accent-color: var(--acc-fill); }
.ni-sur, .ni-op { min-height: 44px; padding: 6px 14px; border-radius: var(--r); border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 15px/1.2 "Lexend", sans-serif; cursor: pointer; }
.ni-sur { align-self: flex-start; border-style: dashed; }
.ni button:focus-visible, .ni-tog input:focus-visible + span { outline: 3px solid var(--acc); outline-offset: 2px; }
.ni-sf { max-width: 100%; overflow-x: auto; padding: 6px 0; border-radius: 10px; background: var(--card); border: 1.5px solid var(--border); text-align: center; }
.ni-svg { display: inline-block; max-width: none; height: auto; vertical-align: middle; }
.ni-read { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); line-height: 1.45; min-width: 0; }
.ni-why-not { padding: 10px 12px; border-radius: 8px; border: 2px solid var(--hint-line); background: var(--hint-bg); }
.ni-wnh { margin: 0 0 4px; font-weight: 600; } .ni-wnh span { color: var(--wrong); }
.ni-wnm { margin: 0; }
.ni-quiz { display: flex; flex-direction: column; gap: 6px; }
.ni-qh { margin: 0; font-family: "Kalam", cursive; font-weight: 700; font-size: 18px; color: var(--heading); }
.ni-ops { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.ni-op { text-align: left; font-weight: 500; }
.ni-op.ni-right { border-color: var(--correct); background: var(--correct-bg); color: var(--correct); }
.ni-op.ni-right::before { content: "✓ "; }
.ni-op.ni-wrong { border-color: var(--wrong); background: var(--wrong-bg); color: var(--wrong); }
.ni-op.ni-wrong::before { content: "✗ "; }
.ni-fb { margin: 0; font-weight: 600; }
.ni-ok { color: var(--correct); } .ni-no { color: var(--wrong); }
.ni-dl { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ni-dl dt { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-top: 4px; }
.ni-dl dd { margin: 0; min-width: 0; overflow-x: auto; }
.ni-tb { font-family: "Kalam", cursive; font-weight: 700; font-size: 24px; color: var(--heading); }
.ni-tag { display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px; background: var(--border); color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.ni-k .katex { font-size: 1.12em; white-space: nowrap; }
.ni-wl { display: block; }
@media (min-width: 760px) {
  .ni { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px 16px; align-items: start; }
  .ni-ctl { grid-row: 1 / span 2; }
}
@media (min-width: 1100px) {
  .ni { grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1fr); }
  .ni-ctl { grid-row: 1; }
}
/* Maths explorers (Ch 1 HCF–LCM explorer, Ch 2 graph explorer; built by initHl / initGx in site.js) and the
   question-view toggle for svg[data-reveal] (Ch 2 T03-V2) */
.dg.is-q .dg-ans { display: none; }
.mx { font-family: "KaTeX_Main", "Times New Roman", serif; font-size: 1.12em; }
.mx i { font-family: "KaTeX_Math", "Times New Roman", serif; font-style: italic; }
.mx sup { font-size: .72em; line-height: 0; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hlx, .gx { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.hl-ins { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.hl-in { display: flex; flex-direction: column; gap: 4px; flex: 1 1 130px; min-width: 0; }
.hl-in label, .gx-lab { font-size: 14px; font-weight: 600; color: var(--ink); }
.hl-box, .gx-num { min-height: 44px; width: 100%; min-width: 0; padding: 6px 10px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 17px "Lexend", sans-serif; }
.hl-box[aria-invalid="true"], .gx-num[aria-invalid="true"] { border-color: var(--wrong); }
.hl-err, .gx-err { margin: 0; font-size: 13px; color: var(--wrong); }
.hl-err::before, .gx-err::before { content: "✗ "; }
.hl-add { align-self: flex-start; }
.hl-chips, .gx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-chip, .gx-chip { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px/1.2 "Lexend", sans-serif; cursor: pointer; text-align: left; }
.hl-chip[aria-pressed="true"], .gx-chip[aria-pressed="true"] { background: var(--tint); border-color: var(--acc); font-weight: 600; }
.hl-seg { display: inline-flex; align-self: flex-start; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.hl-sv { min-height: 44px; min-width: 76px; padding: 6px 14px; border: 0; background: var(--card); color: var(--ink); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.hl-sv[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; }
.hlx button:focus-visible, .hlx input:focus-visible, .hl-tw:focus-visible, .gx button:focus-visible, .gx input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.hl-pics { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hl-pic { flex: 0 1 170px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 10px; background: var(--paper-deep); }
.hl-pic svg { display: block; width: 170px; max-width: 100%; height: auto; }
.hl-pic p { margin: 0; text-align: center; }
.hl-f { color: var(--ink); }
.hl-one { justify-content: center; padding: 12px; font-size: 14px; color: var(--ink); }
.hl-pn { font-weight: 600; }
.hl-anim .hl-pic { animation: hl-in .3s ease-out; }
@keyframes hl-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hl-tw { overflow-x: auto; max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.hl-t { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.hl-t th, .hl-t td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.hl-t thead th { background: var(--paper-deep); font-family: "Lexend", sans-serif; font-weight: 600; }
.hl-t tbody th { text-align: left; font-weight: 400; }
.hl-t tr.hl-rmn th, .hl-t tr.hl-rmn td { border-top: 2px solid var(--ink); color: var(--dg-m-opp); font-weight: 600; }
.hl-t tr.hl-rmx th, .hl-t tr.hl-rmx td { color: var(--dg-m-adj); font-weight: 600; border-bottom: 0; }
.hl-t td.hl-cmn { background: var(--dg-m-opp-bg); }
.hl-t td.hl-cmx { background: var(--dg-m-adj-bg); }
.hl-t td.hl-both { background: linear-gradient(90deg, var(--dg-m-opp-bg) 50%, var(--dg-m-adj-bg) 50%); }
.hl-m { font-size: 12px; font-family: "Lexend", sans-serif; }
.hl-mn { color: var(--dg-m-opp); }
.hl-mx { color: var(--dg-m-adj); }
.hl-miss { color: var(--ink-soft); }
.hl-key { margin: 0; font-size: 13px; color: var(--ink-soft); }
.hl-res { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; overflow-wrap: anywhere; }
.hl-res p { margin: 0; }
.hl-r b { font-weight: 700; }
.hl-rh .hl-k, .hl-rh b { color: var(--dg-m-opp); }
.hl-rl .hl-k, .hl-rl b { color: var(--dg-m-adj); }
.hl-k { font-family: "Lexend", sans-serif; font-weight: 600; font-size: .9em; }
.hl-note { font-size: 14px; }
.hl-msg { font-weight: 600; }
.hl-chk { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.hl-ok { background: var(--correct-bg); border: 1.5px solid var(--correct); }
.hl-warn { background: var(--hint-bg); border: 1.5px solid var(--hint-line); }
.hl-tick { color: var(--correct); font-weight: 700; }
.hl-rule { color: var(--ink-soft); font-size: 13px; }
.gx-form { margin: 0; font-size: 15px; color: var(--ink-soft); }
.gx-poly { margin: 0; font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
.gx-main { display: flex; flex-direction: column; gap: 10px; }
.gx-left { min-width: 0; }
.gx-svg { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; }
.gx-left p { margin: 4px 0 0; text-align: center; font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; }
.gx-cap { color: var(--ink); }
.gx-kcap, .gx-mcap { color: var(--ink-soft); font-weight: 400 !important; font-size: 15px !important; }
.gx-read { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; overflow-wrap: anywhere; }
.gx-row p { margin: 0; }
.gx-h { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.gx-hf { font-weight: 400; margin-left: 6px; color: var(--ink); }
.gx-v { line-height: 1.9; }
.gx-vs { display: inline-block; margin-left: 12px; }
.gx-ok { font-family: "Lexend", sans-serif; font-size: 14px; color: var(--correct); font-weight: 600; }
.gx-row.is-grey .gx-v { color: var(--ink-soft); font-style: italic; }
.gx-xb { margin-top: 4px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--heading); font: 600 14px "Lexend", sans-serif; text-decoration: underline; cursor: pointer; }
.gx-x { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px dashed var(--dashed); }
.gx-fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .9em; line-height: 1.15; margin: 0 2px; }
.gx-fr > span:first-child { border-bottom: 1.2px solid currentColor; padding: 0 2px; }
.gx-rt { white-space: nowrap; }
.gx-rt > span { border-top: 1.2px solid currentColor; padding: 0 1px; }
.gx-ctl { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; border-radius: 10px; background: var(--paper-deep); }
.gx-c { display: grid; grid-template-columns: 92px minmax(0, 1fr) 68px; align-items: center; gap: 4px 8px; }
.gx-c .gx-err { grid-column: 1 / -1; }
.gx-num { text-align: center; padding: 6px 4px; }
.gx-range { width: 100%; min-height: 44px; margin: 0; accent-color: var(--acc); cursor: pointer; background: transparent; }
.gx-range::-webkit-slider-thumb { width: 26px; height: 26px; }
.gx-tg { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-tg button:disabled { opacity: .6; cursor: not-allowed; }
@media (min-width: 720px) {
  .gx-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { .hl-anim .hl-pic { animation: none; } }
/* Two-lines explorer (Maths Ch 3, T02-V7; built by initTl in site.js). Line 1 solid colour 1, line 2 dashed colour 2. */
.tl { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.tl-eqs { display: flex; flex-direction: column; gap: 2px; }
.tl-eq { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.tl-ln { font-size: 13px; font-weight: 600; color: var(--ink-soft); min-width: 44px; }
.tl-sw { display: inline-block; width: 26px; height: 0; border-top: 3px solid var(--dg-m-opp); }
.tl-sw2 { border-top: 3px dashed var(--dg-m-adj); }
.tl-ex { font-size: 1.3em; overflow-wrap: anywhere; }
.tl-tg { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-main { display: flex; flex-direction: column; gap: 10px; }
.tl-left { min-width: 0; }
.tl-svg { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; }
.tl-note { margin: 4px 0 0; text-align: center; font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; color: var(--ink); }
.tl-read { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; overflow-wrap: anywhere; }
.tl-read p { margin: 0; }
.tl-ban { padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--ink); font-weight: 600; background: var(--card); }
.tl-ban--i { background: var(--correct-bg); }
.tl-ban--p { background: var(--wrong-bg); }
.tl-ban--c { background: var(--dg-m-band3); }
.tl-bad { padding: 8px 10px; border-radius: 8px; border: 1.5px dashed var(--wrong); color: var(--ink); }
.tl-pt { display: flex; flex-direction: column; gap: 2px; }
.tl-xy { font-size: 1.15em; }
.tl-off { font-size: 14px; color: var(--ink-soft); }
.tl-rat { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border-top: 1px dashed var(--dashed); }
.tl-rh { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.tl-rows { display: flex; flex-direction: column; }
.tl-r { line-height: 2.2; }
.tl-cmp { min-height: 0; padding-left: 18px; font-size: 18px; line-height: 1; }
.tl-dz { color: var(--ink-soft); font-style: italic; }
.tl-con { line-height: 2.1; font-weight: 600; }
.tl-mh { display: block; font-weight: 400; line-height: 1.5; }
.tl-ctl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px 10px 10px; border-radius: 10px; background: var(--paper-deep); }
.tl-c { display: grid; grid-template-columns: 34px minmax(0, 1fr) 64px; align-items: center; gap: 2px 8px; }
.tl-c .tl-err { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--wrong); }
.tl-c .tl-err::before { content: "✗ "; }
.tl-lab { font: 600 17px "KaTeX_Main", "Times New Roman", serif; color: var(--ink); }
.tl-num { min-height: 44px; width: 100%; min-width: 0; padding: 6px 4px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 17px "Lexend", sans-serif; text-align: center; }
.tl-num[aria-invalid="true"] { border-color: var(--wrong); }
.tl-range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; min-height: 44px; margin: 0; background: transparent; cursor: pointer; }
.tl-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--border); }
.tl-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--border); }
/* the thumb is drawn 24 px but its hit area is 44 × 44 px (transparent ring) */
.tl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 44px; margin-top: -19px; border: 0; border-radius: 50%;
  background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, transparent 13px); }
.tl-range::-moz-range-thumb { width: 44px; height: 44px; border: 0; border-radius: 50%; background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, transparent 13px); }
.tl-range:focus-visible::-webkit-slider-thumb { background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, var(--acc) 13px 15px, transparent 15.5px); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chip { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px/1.2 "Lexend", sans-serif; cursor: pointer; text-align: left; }
.tl-chip[aria-pressed="true"] { background: var(--tint); border-color: var(--acc); font-weight: 600; }
.tl button:focus-visible, .tl input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.tl, .tl * { transition: none; animation: none; }
@media (min-width: 600px) {
  .tl-ctl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tl-c { grid-template-columns: 30px minmax(0, 1fr) 58px; }
}
@media (min-width: 900px) {
  .tl-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 14px; }
}
/* AP explorer (Maths Ch 5, T03-V6; built by initAp in site.js). Bars colour 1; the reversed copy hatched colour 2. */
.ap { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.ap-seg { display: inline-flex; align-self: flex-start; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.ap-v, .ap-pv { min-height: 44px; min-width: 76px; padding: 6px 14px; border: 0; background: var(--card); color: var(--ink); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.ap-v[aria-pressed="true"], .ap-pv[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; }
.ap-list { margin: 0; font-size: 1.35em; overflow-wrap: anywhere; }
.ap-ctl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px 10px 10px; border-radius: 10px; background: var(--paper-deep); }
.ap-c { display: grid; grid-template-columns: 26px minmax(0, 1fr) 70px; align-items: center; gap: 2px 8px; }
.ap-c .ap-err { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--wrong); }
.ap-c .ap-err::before { content: "✗ "; }
.ap-lab { font: 19px "KaTeX_Math", "Times New Roman", serif; font-style: italic; color: var(--ink); }
.ap-num { min-height: 44px; width: 100%; min-width: 0; padding: 6px 4px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 17px "Lexend", sans-serif; text-align: center; }
.ap-num[aria-invalid="true"] { border-color: var(--wrong); }
.ap-range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; min-height: 44px; margin: 0; background: transparent; cursor: pointer; }
.ap-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--border); }
.ap-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--border); }
/* the thumb is drawn 24 px but its hit area is 44 × 44 px (transparent ring) */
.ap-range::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 44px; margin-top: -19px; border: 0; border-radius: 50%;
  background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, transparent 13px); }
.ap-range::-moz-range-thumb { width: 44px; height: 44px; border: 0; border-radius: 50%; background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, transparent 13px); }
.ap-range:focus-visible::-webkit-slider-thumb { background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, var(--acc) 13px 15px, transparent 15.5px); }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chip { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px/1.2 "Lexend", sans-serif; cursor: pointer; text-align: left; }
.ap-chip[aria-pressed="true"] { background: var(--tint); border-color: var(--acc); font-weight: 600; }
.ap-tg { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-tg button:disabled { opacity: .75; cursor: not-allowed; }
.ap-main { display: flex; flex-direction: column; gap: 10px; }
.ap-left { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fig-art .ap-svg { display: block; width: 100%; height: 220px; max-width: none; margin: 0; border-radius: 6px; cursor: pointer; }
.fig-art .ap-run, .fig-art .ap-psvg { display: block; width: 100%; max-width: none; margin: 0; }
.ap-svg:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.ap-note { margin: 0; text-align: center; font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; color: var(--ink); }
.ap-rh { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ap-count { margin: 0; font-size: 1.15em; font-weight: 600; }
.ap-pmsg { margin: 4px 0 0; font-size: 14px; color: var(--ink); }
.ap-pmsg:empty { display: none; }
.ap-read { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; overflow-wrap: anywhere; }
.ap-read p { margin: 0; line-height: 1.9; }
.ap-cap { font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; line-height: 1.4 !important; }
.ap-twice { font-weight: 600; line-height: 1.5 !important; padding: 6px 8px; border-radius: 8px; border: 1.5px dashed var(--acc); }
.ap-mid1, .ap-midr { font-weight: 600; }
.ap button:focus-visible, .ap input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.ap, .ap * { transition: none; animation: none; }
@media (min-width: 600px) {
  .ap-ctl:not(.ap-kc) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .fig-art .ap-svg { height: 280px; }
}
@media (min-width: 900px) {
  .ap-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 14px; }
}
/* similarity explorer (Maths Ch 6, T03-V8; initSx). The drawing is sized in real px (viewBox = container width). */
.sx { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.sx-seg { display: inline-flex; align-self: flex-start; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.sx-m { min-height: 44px; min-width: 96px; padding: 6px 14px; border: 0; background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; cursor: pointer; }
.sx-m[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.fig-art .sx-svg { display: block; width: 100%; height: auto; max-width: none; margin: 0; overflow: visible; }
.sx-hd { cursor: grab; touch-action: none; outline: none; }
.sx-hd .sx-ring { stroke: transparent; }
.sx-hd:focus .sx-ring, .sx-hd:hover .sx-ring { stroke: var(--acc); }
.sx-p1, .sx-p2 { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sx-p1[hidden], .sx-p2[hidden], .sx-c[hidden] { display: none; }
.sx-hint { margin: 0; font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; color: var(--ink-soft); }
.sx-read, .sx-read2 { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; overflow-wrap: anywhere; }
.sx-read p, .sx-read2 p { margin: 0; }
.sx-rows { display: flex; flex-direction: column; gap: 2px; }
.sx-r { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.sx-k { min-width: 70px; font-weight: 600; color: var(--ink-soft); }
.sx-v { font-size: 1.2em; min-width: 64px; }
.sx-dec { color: var(--ink); }
.sx-st { padding: 7px 10px; border-radius: 8px; border: 1.5px solid var(--ink); background: var(--correct-bg); font-weight: 600; }
.sx-st--no { border-style: dashed; border-color: var(--wrong); background: var(--wrong-bg); }
.sx-st--no::before { content: "✗ "; color: var(--wrong); }
.sx-note { padding: 7px 10px; border-radius: 8px; border: 1.5px dashed var(--acc); background: var(--card); font-size: 14px; line-height: 1.45; }
.sx-note::before { content: "! "; font-weight: 700; color: var(--acc); }
.sx-leg { font-size: 14px; color: var(--ink-soft); }
.sx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sx-chip { min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.sx-chip[aria-pressed="true"] { background: var(--tint); border-color: var(--acc); font-weight: 600; }
.sx-chip[aria-pressed="true"]::before { content: "✓ "; }
.sx-ctl { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; border-radius: 10px; background: var(--paper-deep); }
.sx-c { display: grid; grid-template-columns: 74px minmax(0, 1fr) 52px; align-items: center; gap: 2px 8px; }
.sx-lab { font-weight: 600; font-size: 14px; color: var(--ink); }
.sx-out { font: 600 16px "Lexend", sans-serif; text-align: right; color: var(--ink); }
.sx-tg { display: flex; flex-wrap: wrap; gap: 6px; }
.sx-unlock[aria-pressed="true"] { font-weight: 600; }
.sx-range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; min-height: 44px; margin: 0; background: transparent; cursor: pointer; }
.sx-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--border); }
.sx-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--border); }
.sx-range::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 44px; margin-top: -19px; border: 0; border-radius: 50%; background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, transparent 13px); }
.sx-range::-moz-range-thumb { width: 44px; height: 44px; border: 0; border-radius: 50%; background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, transparent 13px); }
.sx-range:focus-visible::-webkit-slider-thumb { background: radial-gradient(circle, var(--acc) 0 10px, var(--card) 10px 12.5px, var(--acc) 13px 15px, transparent 15.5px); }
.sx-cap { font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; line-height: 1.4; }
.sx-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.sx-t th, .sx-t td { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: right; }
.sx-t th:first-child { text-align: left; font-weight: 600; white-space: nowrap; }
.sx-t thead th { font-size: 13px; color: var(--ink-soft); }
.sx-sum th, .sx-sum td { font-weight: 600; border-bottom: 0; }
.sx-unch { font-weight: 600; }
.sx button:focus-visible, .sx input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.sx, .sx * { transition: none; animation: none; }
/* static first view (no JS): Topic 4 shows the "Scale" picture, every other page the "Parallel line" picture */
.dg .sx-v2 { display: none; }
.fig[data-block-id*="-T04."] .dg .sx-v1 { display: none; }
.fig[data-block-id*="-T04."] .dg .sx-v2 { display: inline; }
/* coordinate explorer (Maths Ch 7, T02-V8): initCx in site.js; static first view = content/C10-MATH-CH07/diagrams */
.cx { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.cx-seg { display: inline-flex; align-self: flex-start; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.cx-m { min-height: 44px; min-width: 96px; padding: 6px 14px; border: 0; background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; cursor: pointer; }
.cx-m[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.fig-art .cx-svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0; overflow: visible; touch-action: none; }
.cx-hd { cursor: grab; touch-action: none; outline: none; }
.cx-hd .cx-ring { stroke: transparent; }
.cx-hd:focus .cx-ring, .cx-hd:hover .cx-ring { stroke: var(--acc); }
.cx-hint { display: flex; gap: 18px; margin: 0; font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; color: var(--ink-soft); }
.cx-note { margin: 0; padding: 7px 10px; border-radius: 8px; border: 1.5px dashed var(--wrong); background: var(--wrong-bg); font-size: 14px; font-weight: 600; }
.cx-note[hidden], .cx-ratio[hidden] { display: none; }
.cx-note::before { content: "! "; color: var(--wrong); }
.cx-work { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; overflow-x: auto; }
.cx-l { white-space: nowrap; font-size: 16px; line-height: 2; }
.cx-l .mx { font-size: 1.05em; }
.cx-l0 .katex { font-size: 1.05em; }
.cx-l .gx-fr { font-size: .95em; }
.cx-ans { font-weight: 600; }
.cx-cap { margin: 2px 0 0; font-size: 14px; font-weight: 600; }
.cx-cross { color: var(--dg-m-opp); }
.cx-midc { font-family: "Kalam", cursive; font-size: 16px; }
.cx-ratio { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; border-radius: 10px; background: var(--paper-deep); }
.cx-rt-line { margin: 0; font-size: 16px; }
.cx-k { font-weight: 600; color: var(--ink-soft); }
.cx-sts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cx-st { display: flex; align-items: center; gap: 6px; }
.cx-stk { min-width: 18px; font: italic 600 18px "KaTeX_Math", "Times New Roman", serif; }
.cx-st button { width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 20px "Lexend", sans-serif; cursor: pointer; }
.cx-st button:disabled { opacity: .45; cursor: default; }
.cx-st output { min-width: 22px; text-align: center; font: 600 18px "Lexend", sans-serif; }
.cx-move { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-move fieldset { display: flex; gap: 8px; align-items: center; margin: 0; padding: 4px 10px 8px; border: 1.5px solid var(--border); border-radius: 10px; min-width: 0; }
.cx-move legend { padding: 0 4px; font-size: 14px; font-weight: 600; }
.cx-in { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.cx-ax { font: italic 16px "KaTeX_Math", "Times New Roman", serif; }
.cx-in input { width: 58px; height: 44px; box-sizing: border-box; padding: 4px 6px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--card); color: var(--ink); font: 16px "Lexend", sans-serif; }
.cx button:focus-visible, .cx input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.cx, .cx * { transition: none; animation: none; }
/* static first view (no JS): Topic 4 shows the "Ratio" picture, every other page the "Distance" picture */
.dg .cx-v2 { display: none; }
.fig[data-block-id*="-T04."] .dg .cx-v1 { display: none; }
.fig[data-block-id*="-T04."] .dg .cx-v2 { display: inline; }
/* routine cards that highlight the routine taught on this topic page (Ch 3 T05-V5): .dg-hl-T0n shows only inside a
   figure whose block id is that topic's (no JS needed; hidden in the revision pack) */
.dg .dg-hl { display: none; }
.fig[data-block-id*="-T01."] .dg-hl-T01, .fig[data-block-id*="-T02."] .dg-hl-T02, .fig[data-block-id*="-T03."] .dg-hl-T03,
.fig[data-block-id*="-T04."] .dg-hl-T04, .fig[data-block-id*="-T05."] .dg-hl-T05, .fig[data-block-id*="-T06."] .dg-hl-T06 { display: inline; }
.keypoints { border: 2px dashed var(--acc); border-radius: 14px; padding: 14px 16px; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.kp-head { display: flex; align-items: center; gap: 8px; color: var(--acc); }
.kp-head h2 { font-family: "Kalam", cursive; font-weight: 700; font-size: 20px; color: var(--acc); }
.kp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.55; }
.kp-list li { display: flex; gap: 10px; }
.kp-list .ico { color: var(--acc); margin-top: 3px; }
.l-nav { display: flex; flex-direction: column; gap: 10px; }
.nav-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nav-card { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 14px; border-radius: 14px; background: var(--paper-deep); border: 1px solid var(--border); color: var(--ink); text-decoration: none; line-height: 1.35; }
.nav-card b { font-size: 14px; }
.nav-card--next { background: var(--btn-bg); color: var(--btn-ink); align-items: flex-end; text-align: right; border-color: var(--btn-bg); }
.nav-card--next:hover { color: var(--btn-ink); }
.report { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--ink-soft); text-align: center; }
.notes-fab {
  position: fixed; right: 14px; bottom: 18px; z-index: 12; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 10px;
  border-radius: 18px; border: 1.5px solid var(--ink); background: var(--card); color: var(--pen); box-shadow: 0 8px 20px rgba(30, 30, 30, .18);
  opacity: .92; cursor: not-allowed; font-size: 13px; font-weight: 600; line-height: 1.2;
}
@media (max-width: 520px) { .notes-fab { padding: 10px; border-radius: 16px; } .notes-fab span { display: none !important; } .notes-fab::after { content: "Soon"; position: absolute; top: -8px; right: -6px; font-size: 10px; font-weight: 600; background: var(--pink); color: var(--chip-ink); border-radius: 999px; padding: 1px 6px; } }
.notes-fab span { display: flex; flex-direction: column; color: var(--ink); }
.notes-fab small { font-size: 11px; font-weight: 500; color: var(--ink-soft); }

/* worked examples & steps */
.we { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 12px; }
.we-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.we-title { font-family: "Kalam", cursive; font-weight: 700; font-size: 22px; }
.we-sub { font-size: 14px; color: var(--ink-soft); margin: -4px 0 0; }
.we-body { border-radius: 14px; border: 1px solid var(--grid-border); padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.6; }
.pre-q { font-size: 15px; }
.pre-given, .pre-concept { font-size: 14px; color: var(--ink-soft); }
.pre-given b, .pre-given strong, .pre-concept strong { color: var(--ink); }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--acc-fill); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; margin-top: 1px; }
.step-n--done { background: var(--btn-bg); color: var(--btn-ink); }
.step-n--check { background: var(--card); border: 2px solid var(--acc); color: var(--acc); }
.step-n--dot { background: transparent; border: 2px solid var(--dashed); width: 14px; height: 14px; margin: 6px 7px 0; }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.6; }
.step-body p { margin: 0; }
.step-head { font-weight: 600; color: var(--heading); }
.step.is-hidden { display: none; }
.steps-ctl { display: flex; gap: 10px; flex-wrap: wrap; }
.steps-ctl .btn--primary { flex: 1 1 160px; }
.ans-line { font-size: 15px; }
.final { display: inline-block; max-width: 100%; padding: 4px 12px; border: 2.5px solid var(--heading); border-radius: 12px 18px 14px 20px; background: var(--card); font-weight: 600; overflow-x: auto; vertical-align: middle; }
.final--text { display: inline; padding: 2px 8px; line-height: 2.1; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.eqbox .final { overflow: visible; }

/* long-equation box (K) */
.eq-block { margin: 2px 0; }
.eqbox { display: block; margin: 8px 0; line-height: 1.5; }
.eqbox-frame { display: block; position: relative; border-radius: 12px; border: 1px solid var(--grid-border);
  background-color: var(--card); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; line-height: 1.5; }
.eqbox-scroll { display: block; overflow-x: auto; overflow-y: hidden; padding: 14px 16px 12px; white-space: nowrap; scrollbar-width: thin; scrollbar-color: var(--dashed-strong) transparent; }
.eqbox-scroll::-webkit-scrollbar { height: 6px; }
.eqbox-scroll::-webkit-scrollbar-thumb { background: var(--dashed-strong); border-radius: 6px; }
.eqbox .katex-display { margin: 0; text-align: left; }
.eqbox .katex-display > .katex { text-align: left; }
.eqbox-more { position: absolute; top: 0; right: 0; bottom: 0; width: 56px; display: none; align-items: center; justify-content: flex-end; padding-right: 8px; pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--card) 75%); border-radius: 0 12px 12px 0; }
.eqbox-more .ico { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--ink); color: var(--ink); }
.eqbox-frame::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 32px; pointer-events: none; opacity: 0; z-index: 1;
  background: linear-gradient(270deg, rgba(255, 255, 255, 0), var(--card) 80%); border-radius: 12px 0 0 12px; }
.eqbox.is-overflow:not(.at-end) .eqbox-more { display: flex; }
.eqbox.is-overflow.is-scrolled .eqbox-frame::before { opacity: 1; }
.eqbox-cap { display: none; text-align: right; font-size: 13px; color: var(--ink-soft); padding: 4px 2px 0; white-space: normal; line-height: 1.4; }
.eqbox.is-overflow .eqbox-cap { display: block; }
.eqinline { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; scrollbar-width: thin; padding: 1px 0; }
.katex { font-size: 1.15em; }
.step-body .katex, .answer .katex { font-size: 1.12em; }

/* ------------------------------------------------------------ questions */
.qc-sec { background: var(--paper-deep); border-radius: var(--r-card); padding: 16px; margin: 0 -4px; }
.qc-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 12px; }
.qc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); flex-wrap: wrap; }
.qc-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.q-prompt { font-size: 16px; line-height: 1.6; font-weight: 500; }
.q-prompt--big { font-size: 17px; }
.q-prompt p { margin-bottom: .5em; }
.mcq { display: flex; flex-direction: column; gap: 10px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opts--ar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-radius: var(--r); border: 2px solid var(--ink);
  background: var(--card); color: var(--ink); text-align: left; cursor: pointer; font-size: 16px; line-height: 1.45; width: 100%;
}
.opt--ar { font-size: 13px; line-height: 1.3; padding: 6px 10px; gap: 8px; }
.opt-letter { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.opt-text { flex: 1; min-width: 0; }
.opt-state { display: none; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.opt.is-selected { border-width: 3px; border-color: var(--heading); background: var(--paper-deep); box-shadow: 3px 3px 0 var(--heading); }
.opt.is-selected .opt-letter { background: var(--heading); color: var(--paper); border-color: var(--heading); }
.opt.is-right { border-color: var(--correct); background: var(--correct-bg); color: var(--correct); }
.opt.is-right .opt-state--ok { display: inline-flex; }
.opt.is-wrong { border-color: var(--wrong-line); background: var(--wrong-bg); color: var(--wrong); }
.opt.is-wrong .opt-state--no { display: inline-flex; }
.opt.is-right .opt-letter, .opt.is-wrong .opt-letter { display: none; }
.opt.is-dim { border: 1.5px solid var(--dashed); color: var(--ink-soft); }
.opt[disabled] { cursor: default; }
.opt--ar .opt-state span { display: none; }
.opt--ar.is-right .opt-letter, .opt--ar.is-wrong .opt-letter { display: flex; }
.fb { display: flex; flex-direction: column; gap: 6px; border-radius: var(--r); padding: 12px 14px; font-size: 15px; line-height: 1.55; }
.fb--ok { background: var(--correct-bg); border: 1.5px solid var(--correct); }
.fb--no { background: var(--wrong-bg); border: 1.5px solid var(--wrong-line); }
.fb--neutral { background: var(--card); border: 1.5px solid var(--border); }
.fb-title { font-family: "Kalam", cursive; font-weight: 700; font-size: 19px; margin: 0; }
.fb--ok .fb-title { color: var(--correct); }
.fb--no .fb-title { color: var(--wrong); }
.fb-why b, .fb-right b { font-weight: 600; }
.fb-right { border-top: 1px dashed var(--wrong-line); padding-top: 8px; }
.hint-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px dashed var(--hint-line); background: var(--hint-bg); font-size: 14px; font-weight: 600; cursor: pointer; }
.hint-box { padding: 12px 14px; border-radius: var(--r); background: var(--hint-bg); font-size: 15px; line-height: 1.55; }
.sol { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--border); padding-top: 12px; }
.ar { display: flex; flex-direction: column; gap: 10px; }
.ar-row { display: flex; gap: 10px; font-size: 15px; line-height: 1.55; font-weight: 400; }
.ar-tag { flex-shrink: 0; padding: 0 8px; height: 24px; border-radius: 6px; background: var(--btn-bg); color: var(--btn-ink); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; }
.ar-tag--r { background: transparent; border: 1.5px solid var(--heading); color: var(--heading); }
.selfcheck { display: flex; flex-direction: column; gap: 10px; }
.sc-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.answer-box { width: 100%; min-height: 84px; padding: 10px 12px; border-radius: var(--r); border: 1.5px solid var(--dashed-strong); background: var(--paper); color: var(--ink); font: 400 15px/1.6 "Lexend", system-ui, sans-serif; resize: vertical; }
.answer-box--lined { line-height: 28px; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 27px, var(--rule) 27px, var(--rule) 28px); background-attachment: local; padding: 12px 14px; }
.sc-show { align-self: flex-start; }
.sc-answer { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--border); padding-top: 12px; }
.answer { display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.6; }
.answer--full { gap: 12px; }
.ans-sub { font-weight: 600; color: var(--heading); }
.work-list { padding-left: 1.4em; }
.fb-note { display: flex; gap: 8px; align-items: flex-start; background: var(--hint-bg); border-radius: var(--r); padding: 10px 12px; font-size: 14px; }
.sc-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.sc-mark > span { grid-column: 1 / -1; font-size: 14px; font-weight: 600; }
.sc-mark .btn[aria-pressed="true"] { outline: 3px solid var(--acc); outline-offset: 1px; }
.sc-result { font-size: 14px; font-weight: 600; margin: 0; }
.sc-result.is-ok { color: var(--correct); }
.points { display: flex; flex-direction: column; gap: 8px; }
.points-h { font-size: 14px; font-weight: 600; margin: 0; }
.point { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r); border: 1.5px solid var(--dashed-strong); background: var(--card); color: var(--ink); text-align: left; font-size: 14px; line-height: 1.5; cursor: pointer; width: 100%; min-height: 48px; }
.point-box { flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; color: transparent; }
.point-text { flex: 1; min-width: 0; }
.point-v { flex-shrink: 0; font-weight: 600; color: var(--ink-soft); }
.point[aria-pressed="true"] { border: 2px solid var(--correct); background: var(--correct-bg); }
.point[aria-pressed="true"] .point-box { background: var(--correct); border-color: var(--correct); color: var(--card); }
.point[aria-pressed="true"] .point-v { color: var(--correct); }
.points-total { font-size: 14px; margin: 0; }

/* skip-check */
.skipcheck { background: var(--bridge-bg); border: 2px dashed var(--bridge-line); border-radius: var(--r-card); padding: 16px; margin: 0 -4px; }
.skip-result { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 4px 4px 0 var(--acc); }
.skip-result .hand { font-size: 22px; color: var(--heading); }
.skip-pass, .skip-fail { display: flex; flex-direction: column; gap: 10px; }

/* ------------------------------------------------------------ subject & chapter */
.torn-head { display: flex; flex-direction: column; padding: 16px 16px 0; max-width: 760px; margin: 0 auto; }
.torn path { fill: var(--acc-fill); }
.torn { display: block; }
.torn-body { background: var(--acc-fill); color: #FFFFFF; padding: 8px 18px 20px; border-radius: 0 0 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.torn-body--row { flex-direction: row; justify-content: space-between; align-items: flex-end; }
.torn-body .ico { color: #FFFFFF; }
.th-kicker { font-size: 13px; }
.th-title { font-family: "Kalam", cursive; font-weight: 700; font-size: 38px; line-height: 1; color: #FFFFFF; }
.th-title--ch { font-size: 31px; line-height: 1.1; }
.th-sub { font-size: 14px; }
.th-chips { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; padding-top: 4px; }
.th-chips span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.th-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.units { display: flex; flex-direction: column; gap: 22px; }
.unit { display: flex; flex-direction: column; gap: 10px; }
.unit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.h-unit { font-family: "Kalam", cursive; font-weight: 700; font-size: 21px; line-height: 1.2; }
.unit-marks { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.ch-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: var(--r-card); background: var(--card); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--acc); text-decoration: none; color: var(--ink); }
.ch-card:hover { color: var(--ink); }
.ch-top { display: flex; gap: 12px; align-items: flex-start; }
.ch-num { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--paper-deep); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; font-family: "Kalam", cursive; font-weight: 700; font-size: 18px; }
.ch-num--ready { width: 40px; height: 40px; border-radius: 12px; background: var(--acc-fill); color: #FFFFFF; font-size: 20px; }
.ch-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; line-height: 1.35; }
.ch-txt b { font-size: 16px; }
.ch-txt span { font-size: 13px; color: var(--ink-soft); }
.ch-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.ch-bars span { height: 6px; border-radius: 999px; background: var(--border); }
.ch-path { font-size: 13px; color: var(--ink-soft); margin-top: -6px; }
.ch-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); min-height: 60px; }
.ch-name { flex: 1; font-size: 15px; line-height: 1.35; }
.ch-soon { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.why { gap: 10px; line-height: 2; }
.tick-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }
.tick-list li { display: flex; gap: 10px; }
.tick-list .ico { color: var(--acc); margin-top: 3px; }
.pre-list li { margin-bottom: 4px; }
.path-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.path-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: var(--card); border: 2px solid var(--ink); text-decoration: none; color: var(--ink); line-height: 1.35; }
.path-card:hover { color: var(--ink); box-shadow: 3px 3px 0 var(--acc); }
.path-card b { font-size: 15px; }
.path-card span:last-child { font-size: 13px; color: var(--ink-soft); }
.path-n { font-family: "Kalam", cursive; font-weight: 700; font-size: 15px; color: var(--acc); }
.path-card--last { background: var(--mint); color: var(--chip-ink); }
.path-card--last .path-n, .path-card--last span:last-child { color: var(--chip-ink); }
.path-how p { margin: 0; }
.topic-list { display: flex; flex-direction: column; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--border); overflow: hidden; }
.topic-row { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: var(--ink); min-height: 60px; }
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: var(--tint); color: var(--ink); }
.topic-n { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--acc); color: var(--acc); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.topic-row--bridge { background: var(--paper); }
.topic-row--bridge .topic-n { border-style: dashed; border-color: var(--bridge-line); color: var(--bridge-ink); }
.topic-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; line-height: 1.4; }
.topic-t { font-size: 15px; font-weight: 500; }
.topic-m { font-size: 13px; color: var(--ink-soft); }
.wrap-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1.5px dashed var(--acc); background: var(--card); text-decoration: none; color: var(--ink); }
.wrap-card > span { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.wrap-card > span > span { font-size: 13px; color: var(--ink-soft); }
.wrap-card--review { border-style: solid; border-color: var(--border); }
.time-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.time-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.time-list li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------ NCERT */
.ncert-group { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 12px; }
.sol-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; scroll-margin-top: 12px; }
.sol-card summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "loc chev" "title chev" "chips chev"; gap: 2px 10px; padding: 14px 14px; min-height: 56px; align-items: center; }
.sol-loc { grid-area: loc; font-size: 13px; font-weight: 600; color: var(--acc); }
.sol-title { grid-area: title; font-size: 15px; font-weight: 500; line-height: 1.45; }
.sol-chips { grid-area: chips; display: flex; gap: 6px; margin-top: 4px; }
.sol-chev { grid-area: chev; transition: transform .15s; }
.sol-card[open] .sol-chev { transform: rotate(90deg); }
.sol-card[open] summary { border-bottom: 1px dashed var(--border); }
.sol-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.6; }
.sol-body .steps { border-radius: 12px; }

/* ------------------------------------------------------------ practice */
.main--practice, .main--pyq, .main--test, .main--review, .main--ncert, .main--revision { background: var(--paper-deep); }
.practice { display: flex; flex-direction: column; gap: 12px; }
.pr-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pr-topic { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.pr-topic select { min-height: 44px; flex: 1; min-width: 0; border-radius: var(--r); border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font: inherit; font-weight: 500; padding: 0 10px; }
.pr-status { font-size: 14px; font-weight: 600; }
.pr-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.pr-dots span { width: 18px; height: 6px; border-radius: 999px; background: var(--border); }
.pr-dots span.is-now { background: var(--ink); }
.pr-dots span.is-ok { background: var(--correct); }
.pr-dots span.is-no { background: var(--wrong-line); }
.pr-items .pq { display: flex; flex-direction: column; gap: 12px; }
.pq-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--border); }
.pq-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pq-label { font-family: "Kalam", cursive; font-weight: 700; font-size: 18px; color: var(--heading); margin-right: 4px; }
.pq-title { font-weight: 600; margin: 0; }
.pr-nav { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.pr-hdr { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ PYQ */
.pyq { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 12px; }
.pyq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 13px; font-weight: 600; }
.pyq-src { color: var(--acc); }
.pyq-group { margin-top: 10px; }
.pyq-open { align-self: flex-start; }
.pyq-ans { display: flex; flex-direction: column; gap: 12px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.seg-btn { min-height: 44px; border: 0; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.seg-btn.is-on { background: var(--btn-bg); color: var(--btn-ink); }
.exam-view { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 15px; line-height: 1.6; border: 1px solid var(--border); }
.ex-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ex-text { flex: 1; min-width: 0; }
.ex-row .chip { margin-top: 4px; }
.ex-note { font-size: 13px; color: var(--ink-soft); }

/* ------------------------------------------------------------ test */
.test { display: flex; flex-direction: column; gap: 16px; }
.test-intro, .test-run, .test-results { display: flex; flex-direction: column; gap: 14px; }
.test-bar { position: sticky; top: 0; z-index: 8; background: var(--raised); border: 1px solid var(--border); border-radius: 0 0 14px 14px; margin: -22px -16px 0; padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.test-bar-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.timer { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: var(--r); background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer.is-low { background: var(--wrong-line); color: #FFFFFF; }
.nav-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.nav-chip { min-height: 44px; border-radius: 8px; border: 1.5px dashed var(--dashed-strong); background: transparent; color: var(--ink-soft); font-size: 14px; cursor: pointer; }
.nav-chip.is-done { background: var(--btn-bg); color: var(--btn-ink); border: 1.5px solid var(--btn-bg); font-weight: 600; }
.nav-chip.is-flag { background: var(--pink); color: var(--chip-ink); border: 1.5px solid var(--ink); font-weight: 600; }
.nav-chip.is-now { border: 3px solid var(--heading); background: var(--card); color: var(--ink); font-weight: 700; }
.nav-legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink-soft); font-size: 12px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.lg--done { background: var(--btn-bg); }
.lg--now { border: 2.5px solid var(--heading); }
.lg--flag { background: var(--pink); border: 1px solid var(--ink); }
.lg--todo { border: 1.5px dashed var(--dashed-strong); }
.tq { display: flex; flex-direction: column; gap: 12px; }
.tq-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tq-sec { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.tq-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--card); border: 2px solid var(--ink); }
.tq-n { font-family: "Kalam", cursive; font-weight: 700; font-size: 20px; color: var(--heading); }
.opt-choose { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.fkeys { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.fkeys-btns { display: flex; gap: 4px; }
.fkey { min-width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font-size: 15px; cursor: pointer; }
.flag-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r); border: 1.5px dashed var(--dashed-strong); background: transparent; font-size: 14px; font-weight: 600; cursor: pointer; }
.flag-btn[aria-pressed="true"] { background: var(--pink); color: var(--chip-ink); border: 1.5px solid var(--ink); }
.tq-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.confirm { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: var(--card); border: 2px solid var(--ink); box-shadow: 0 12px 30px rgba(30, 30, 30, .2); }
.confirm h2 { font-size: 22px; }
.score-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 18px; border-radius: 18px; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--acc); text-align: center; }
.score { padding: 2px 26px; border: 3px solid var(--heading); border-radius: 30px 44px 34px 48px; font-family: "Kalam", cursive; font-weight: 700; font-size: 48px; line-height: 1.2; color: var(--heading); }
.score small { font-size: 26px; }
.sec-table { display: flex; flex-direction: column; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--border); overflow: hidden; font-size: 14px; }
.sec-row { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--border-soft); }
.sec-row--h { background: var(--paper-deep); font-weight: 600; border-top: 0; }
.st-ok { color: var(--correct); font-weight: 600; }
.marking { display: flex; flex-direction: column; gap: 22px; }
.mark-q { display: flex; flex-direction: column; gap: 10px; }
.mark-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--card); border: 2px solid var(--ink); }
.mark-top { display: flex; justify-content: space-between; align-items: center; }
.you-wrote { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); font-size: 14px; line-height: 1.55; }
.yw-text { white-space: pre-wrap; margin: 0; }
.mark-total { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.mark-total b { font-size: 20px; }
.rev-list { display: flex; flex-direction: column; gap: 10px; }
.rev-item { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--border); font-size: 14px; }
.rev-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.rev-score { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--wrong); }
.rev-yours { padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--wrong-line); background: var(--wrong-bg); color: var(--wrong); margin: 0; }
.rev-right { display: flex; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--correct); background: var(--correct-bg); color: var(--correct); font-weight: 600; margin: 0; }
.topic-res { display: flex; flex-direction: column; gap: 8px; }
.tr-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); font-size: 14px; color: var(--ink); text-decoration: none; }
.tr-row > span:first-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
a.tr-row { border: 2px solid var(--ink); }
.unsaved { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1.5px dashed var(--dashed); font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

/* ------------------------------------------------------------ revision */
.margin-paper .l-title { font-size: 28px; margin-bottom: 8px; }
.margin-paper p { line-height: 1.75; font-size: 15px; }
.eq-sheet { border-radius: var(--r-card); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--shadow-ink); overflow: hidden; }
.eq-group { padding: 14px 16px; border-bottom: 1.5px dashed var(--dashed); }
.eq-group:last-child { border-bottom: 0; }
.eq-h { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; font-family: inherit; }
.eq-group .eqbox { margin: 6px 0; }
.eq-group--defs ul { font-size: 14px; line-height: 1.6; }
.recall { gap: 12px; }
.recall-dots { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.recall-dots span { height: 6px; border-radius: 999px; background: var(--dashed); }
.recall-dots span.is-ok { background: var(--correct); }
.recall-dots span.is-no { background: var(--wrong-line); }
.flip { display: flex; flex-direction: column; }
.flip-front, .flip-back { min-height: 230px; padding: 22px 20px; border-radius: 18px; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--shadow-ink); display: flex; flex-direction: column; justify-content: space-between; gap: 14px; text-align: left; }
.flip-front { cursor: pointer; color: var(--ink); width: 100%; }
.flip-back { background: var(--sticky); color: var(--sticky-ink); justify-content: flex-start; }
.flip-back .btn--secondary { background: #FFFFFF; color: #1F2328; border-color: #1F2328; }
.flip-back .btn--primary { background: #12352D; color: #FFFFFF; }
.flip-k { font-family: "Kalam", cursive; font-size: 16px; color: var(--hand); }
.flip-k--a { color: var(--sticky-title); }
.flip-q { font-size: 19px; line-height: 1.5; font-weight: 500; }
.flip-q2 { font-size: 15px; line-height: 1.5; opacity: .8; }
.flip-a { font-size: 19px; line-height: 1.45; }
.flip-tap { align-self: flex-end; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.flip-ask { font-size: 14px; font-weight: 600; margin-top: auto; }
.recall-done { display: flex; flex-direction: column; gap: 12px; padding: 22px 20px; border-radius: 18px; border: 2px solid var(--ink); background: var(--card); }
.recall-done .hand { font-size: 24px; color: var(--heading); }
@media (prefers-reduced-motion: no-preference) {
  .flip-back:not([hidden]), .flip-front:not([hidden]) { animation: flipin .22s ease-out; }
  @keyframes flipin { from { transform: rotateY(70deg); opacity: .3; } to { transform: none; opacity: 1; } }
}

/* review */
.review-set { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; scroll-margin-top: 12px; }
.review-set .qc-card { background: var(--paper); }
.set-head { display: flex; flex-direction: column; gap: 4px; }
.set-head .chip { align-self: flex-start; }
.set-score { font-weight: 600; color: var(--heading); }

/* ------------------------------------------------------------ desktop */
@media (min-width: 760px) {
  .h-sec { font-size: 26px; }
  .l-title { font-size: 34px; }
  .hero-title { font-size: 44px; }
  .subj-grid { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* subject accent: Mathematics pages */
html[data-subject="maths"] { --acc: var(--acc-maths); --tint: var(--tint-maths); --acc-fill: #5B3FC4; }

/* Print graph paper link (graphical questions) */
.gp-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 6px 12px; border: 1px dashed var(--border); border-radius: var(--r); color: var(--acc); text-decoration: none; background: var(--card); }
.gp-link::before { content: "🖨"; }
.gp-link:hover, .gp-link:focus-visible { border-style: solid; }

/* ------------------------------------------------------------ label-the-diagram trainer (Science Ch 5 WRAP-V14; initLdt) */
.ldt { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.ldt-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ldt-tab { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink);
  font: 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.ldt-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.ldt-modes { display: inline-flex; align-self: flex-start; border: 1.5px solid var(--heading); border-radius: var(--r); overflow: hidden; }
.ldt-mode { min-height: 44px; min-width: 76px; padding: 6px 14px; border: 0; background: var(--card); color: var(--heading); font: 600 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.ldt-mode + .ldt-mode { border-left: 1.5px solid var(--heading); }
.ldt-mode[aria-pressed="true"] { background: var(--heading); color: var(--paper); }
.ldt-p { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ldt-how { margin: 0; font-size: 14px; color: var(--ink-soft); }
.ldt-stage { position: relative; width: 100%; max-width: 520px; margin: 0 auto; }
.ldt-stage .ldt-svg { display: block; width: 100%; height: auto; }
.ldt-ring { fill: none; stroke: var(--acc); stroke-width: 0; transition: stroke-width .15s; }
.ldt-ring.is-on { stroke-width: 2.5; }
.ldt-slot { position: absolute; transform: translateY(-50%); box-sizing: border-box; min-height: 44px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 10px; border: 2px dashed var(--dashed-strong); background: var(--card); color: var(--ink);
  font: 12.5px/1.15 "Lexend", sans-serif; text-align: left; cursor: pointer; z-index: 1; }
.ldt-slot.is-l { justify-content: flex-end; text-align: right; }
.ldt-n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px;
  background: var(--paper-deep); color: var(--ink); font-weight: 600; font-size: 13px; flex: none; }
.ldt-l { min-width: 0; }
.has-sel .ldt-slot:not([aria-disabled]) { border-color: var(--acc); border-style: solid; }
.ldt-slot.is-over { outline: 3px solid var(--acc); outline-offset: 1px; }
.ldt-slot.is-ok { border: 2px solid var(--correct); background: var(--correct-bg); color: var(--correct); cursor: default; font-weight: 600; }
.ldt-slot.is-ok .ldt-n { background: var(--correct); color: var(--card); }
.ldt-slot.is-shown { border: 2px solid var(--dashed-strong); background: var(--paper-deep); color: var(--ink-soft); cursor: default; }
.ldt-slot.is-wrong { border: 2px solid var(--hint-line); background: var(--hint-bg); }
.ldt-stage.is-list .ldt-slot { pointer-events: none; border-style: solid; }
@media (prefers-reduced-motion: no-preference) {
  .ldt-slot.is-wrong { animation: ldt-flash .6s ease-out; }
  @keyframes ldt-flash { 0%, 40% { box-shadow: 0 0 0 4px var(--hint-line); } 100% { box-shadow: 0 0 0 0 transparent; } }
}
@media (prefers-reduced-motion: reduce) { .ldt-ring { transition: none; } .ldt-slot.is-wrong { animation: none; } }
.ldt-slot:focus-visible, .ldt-chip:focus-visible, .ldt-tab:focus-visible, .ldt-mode:focus-visible, .ldt-b:focus-visible, .ldt-row select:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.ldt-count { margin: 0; font-weight: 600; font-size: 14px; }
.ldt-hint { margin: 0; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--hint-line); background: var(--hint-bg); color: var(--ink); }
.ldt-done { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--correct-bg); color: var(--correct); font-weight: 600; }
.ldt-bank { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ldt-chip { min-height: 44px; max-width: 100%; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink);
  font: 14px/1.2 "Lexend", sans-serif; cursor: grab; touch-action: none; text-align: left; overflow-wrap: anywhere; }
.ldt-chip[aria-pressed="true"] { background: var(--tint); border: 2.5px solid var(--acc); font-weight: 600; }
.ldt-chip[aria-pressed="true"]::before { content: "✓\00a0"; }
.ldt-chip[disabled] { opacity: .45; cursor: not-allowed; }
.ldt-chip.is-drag { opacity: .4; }
.ldt-ghost { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -120%); box-shadow: 0 6px 14px rgba(0, 0, 0, .25); }
.ldt-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ldt-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 10px; padding: 6px 8px; border-radius: 10px; background: var(--paper-deep); }
.ldt-row label { font-weight: 600; font-size: 14px; }
.ldt-row select { min-height: 44px; min-width: 0; width: 100%; padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; }
.ldt-fb { grid-column: 1 / -1; font-size: 14px; }
.ldt-fb:empty { display: none; }
.ldt-fb.is-ok { color: var(--correct); font-weight: 600; }
.ldt-fb.is-no { color: var(--ink); }
.ldt-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ldt-b { min-height: 44px; padding: 6px 14px; border-radius: var(--r); border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.ldt-b[disabled] { opacity: .45; cursor: not-allowed; }
.ldt-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------- virtual labs (Ch 7 V18: initVl in site.js) */
.vl { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.vl-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.vl-tab { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink);
  font: 500 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.vl-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.vl-p { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vl-p[hidden] { display: none; }
.vl-note { margin: 0; font-size: 13px; color: var(--ink-soft); font-style: italic; }
.vl-safe { margin: 0; padding: 8px 10px; border-radius: 8px; border-left: 4px solid var(--hint-line); background: var(--hint-bg); font-size: 14px; }
.vl-safe::before { content: "Safety: "; font-weight: 600; }
.vl-top { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.vl-scope { width: 100%; display: flex; justify-content: center; }
.vl-scope .vl-pic { display: block; height: 150px; width: auto; max-width: 100%; }
.vl.is-wide .vl-top { flex-direction: row; justify-content: center; gap: 20px; }
.vl.is-wide .vl-scope { width: auto; flex: 0 0 auto; }
.vl.is-wide .vl-scope .vl-pic { height: 260px; }
.vl-fovwrap { width: 100%; display: flex; justify-content: center; }
.vl-fov { position: relative; width: min(320px, calc(100% - 32px)); aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--ink); background: var(--dg-fov, #FBF8E8); box-sizing: border-box; flex: 0 0 auto; }
.vl.is-wide .vl-fovwrap { width: auto; }
.vl.is-wide .vl-fov { width: 320px; }
.vl-img { position: absolute; inset: 0; transform-origin: 50% 50%; transition: filter .2s, transform .3s; }
.vl-img .vl-pic { display: block; width: 100%; height: 100%; }
.vl-seedbox { position: relative; width: min(320px, 100%); aspect-ratio: 300 / 240; margin: 0 auto; border-radius: 12px; background: var(--paper-deep); touch-action: none; }
.vl-tg { position: absolute; box-sizing: border-box; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; z-index: 2; }
.vl-tg:hover { box-shadow: 0 0 0 2px var(--acc) inset; }
.vl-tg.is-ok { box-shadow: 0 0 0 3px var(--correct) inset; }
.vl-tg.is-no { box-shadow: 0 0 0 3px var(--hint-line) inset; }
.vl-ctl { display: flex; flex-direction: column; gap: 8px; }
.vl-btns { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.vl-b { min-height: 44px; min-width: 44px; max-width: 100%; padding: 6px 12px; border-radius: var(--r); border: 1.5px solid var(--heading); background: var(--card);
  color: var(--heading); font: 600 14px/1.2 "Lexend", sans-serif; cursor: pointer; }
.vl-b[aria-pressed="true"] { background: var(--heading); color: var(--paper); }
.vl-b[disabled] { opacity: .45; cursor: not-allowed; }
.vl-b[hidden] { display: none; }
.vl-li { border-style: dashed; }
.vl-focus { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.vl-focus label { font-weight: 600; }
.vl-focus input { flex: 1 1 auto; min-width: 0; height: 44px; accent-color: var(--acc); }
.vl-task { margin: 0; font-weight: 600; }
.vl-task[hidden] { display: none; }
.vl-hp { margin: 0; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--hint-line); background: var(--hint-bg); }
.vl-fb { margin: 0; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--border); background: var(--paper-deep); }
.vl-fb.is-ok { border-color: var(--correct); background: var(--correct-bg); color: var(--correct); font-weight: 600; }
.vl-fb.is-no { border-color: var(--hint-line); background: var(--hint-bg); color: var(--ink); }
.vl-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.vl-steps li { padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--border); color: var(--ink-soft); }
.vl-steps li.is-done { color: var(--correct); border-color: var(--correct); }
.vl-steps li.is-done .vl-sn::after { content: " ✓"; }
.vl-steps li.is-cur { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.vl-steptext { margin: 0; }
.vl-seedg { transform-box: view-box; transform-origin: 150px 112px; transform: scale(.77); transition: transform .5s; }
.vl-seedg.is-soaked { transform: scale(1); }
.vl-coat-l, .vl-coat-r { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .5s; }
.vl-coat.is-peeled .vl-coat-l { transform: translate(-100px, 92px) scale(.42) rotate(-24deg); }
.vl-coat.is-peeled .vl-coat-r { transform: translate(100px, 92px) scale(.42) rotate(24deg); }
.vl-slide.is-in { animation: vl-slidein .45s ease-out; }
@keyframes vl-slidein { from { transform: translateX(-40px); opacity: .2; } to { transform: none; opacity: 1; } }
.vl-sum { padding: 10px 12px; border-radius: 10px; border: 2px solid var(--correct); background: var(--correct-bg); }
.vl-sum[hidden] { display: none; }
.vl-sum ul { margin: 4px 0; padding-left: 20px; }
.vl-sum p { margin: 4px 0; }
.vl-h { margin: 0 0 6px; font: 600 16px/1.3 "Lexend", sans-serif; color: var(--heading); }
.vl-obs { display: flex; flex-direction: column; gap: 8px; }
.vl-rows { display: flex; flex-direction: column; gap: 8px; }
.vl-orow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--paper-deep); border: 2px solid transparent; }
.vl.is-wide .vl-orow { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; }
.vl-orow.is-ok { border-color: var(--correct); }
.vl-orow.is-no { border-color: var(--hint-line); }
.vl-oname { margin: 0; font-weight: 600; align-self: center; }
.vl-ofield { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-soft); min-width: 0; }
.vl-ofield select { min-height: 44px; width: 100%; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; }
.vl-ofb { margin: 0; grid-column: 1 / -1; font-size: 14px; }
.vl-orow.is-ok .vl-ofb { color: var(--correct); font-weight: 600; }
.vl-obs-sum { margin: 0; font-weight: 600; }
.vl-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vl-tab:focus-visible, .vl-b:focus-visible, .vl-focus input:focus-visible, .vl-ofield select:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .vl-img, .vl-seedg, .vl-coat-l, .vl-coat-r { transition: none; }
  .vl-slide.is-in { animation: none; }
}
/* ---------------------------------------------------- checkerboard builder (Science Ch 8, T02-V9; initCb in site.js) */
.cb { display: flex; flex-direction: column; gap: 12px; min-width: 0; font-size: 15px; }
.cb-seg { display: inline-flex; align-self: flex-start; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.cb-m { min-height: 44px; min-width: 100px; padding: 6px 14px; border: 0; background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; cursor: pointer; }
.cb-m[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.cb-sel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cb-lab { font-weight: 600; }
.cb-tsel { min-height: 44px; width: 100%; max-width: 420px; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; }
.cb-pars { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 600px) { .cb-pars { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.cb-par { margin: 0; padding: 8px 10px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--paper-deep); min-width: 0; }
.cb-par > legend { padding: 0 4px; font-weight: 600; }
.cb-gene { margin: 0; padding: 0; border: 0; min-width: 0; }
.cb-gene + .cb-gene { margin-top: 6px; }
.cb-gene > legend { padding: 0; font-size: 13px; color: var(--ink-soft); }
.cb-rs { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-r { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 10px 4px 6px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); cursor: pointer; font-size: 14px; }
.cb-r input { width: 20px; height: 20px; margin: 0; accent-color: var(--acc); }
.cb-r:has(input:checked) { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; font-weight: 600; }
.cb-quick, .cb-acts { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cb-b { min-height: 44px; min-width: 44px; max-width: 100%; padding: 6px 12px; border-radius: var(--r); border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.cb-acts .cb-b { background: var(--heading); color: var(--paper); }
.cb-b[disabled] { opacity: .45; cursor: not-allowed; }
.cb-msg { margin: 0; padding: 8px 10px; border-radius: 8px; border-left: 4px solid var(--hint-line); background: var(--hint-bg); font-weight: 600; }
.cb-msg[hidden], .cb-gam[hidden], .cb-boardw[hidden], .cb-res[hidden], .cb-err[hidden] { display: none; }
.cb-gam { display: flex; flex-direction: column; gap: 8px; }
.cb-gp p { margin: 0; }
.cb-gh { font-weight: 600; }
.cb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 !important; }
.cb-chip { display: inline-block; min-width: 40px; padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--card); text-align: center; font: 600 16px "Lexend", sans-serif; letter-spacing: .02em; }
.cb-gn { font-size: 14px; color: var(--ink-soft); }
.cb-boardw { min-width: 0; }
@media (max-width: 599.98px) { .cb-boardw { margin-left: -13px; margin-right: -13px; } }   /* the board uses the page width: viewport - 2 x 16 px */
.cb-board { border-collapse: separate; border-spacing: 2px; margin: -2px; table-layout: fixed; font-family: "Lexend", sans-serif; }
.cb-board caption { caption-side: top; text-align: left; padding: 0 2px 6px; font-size: 13px; color: var(--ink-soft); }
.cb-board th { padding: 4px 0; text-align: center; font-size: 16px; font-weight: 600; color: var(--ink); }
.cb-board td.cb-box { position: relative; box-sizing: border-box; height: 78px; padding: 17px 6px 6px; vertical-align: middle; text-align: center; border: 1.5px solid var(--dg-cb-line); border-radius: 6px; background: var(--card); color: var(--ink); overflow: hidden; }
.cb-box.cb-empty { border-style: dashed; background: transparent; }
.cb-l { display: block; font-size: 15px; font-weight: 600; line-height: 1.2; }
.cb-w { display: block; font-size: 11px; line-height: 1.25; margin-top: 2px; }
.cb-gm { position: absolute; top: 2px; right: 3px; min-width: 15px; padding: 0 2px; border-radius: 4px; border: 1px solid var(--ink); background: var(--card); font-size: 11px; font-weight: 600; line-height: 14px; }
.cb-g-A { background: var(--dg-cb-a) !important; }
.cb-g-B { background: repeating-linear-gradient(45deg, var(--dg-cb-b) 0 6px, var(--dg-cb-b-pat) 6px 8px) !important; }
.cb-g-C { background: radial-gradient(circle, var(--dg-cb-c-pat) 1.6px, transparent 2px) 0 0 / 8px 8px, var(--dg-cb-c) !important; }
.cb-g-D { background: repeating-linear-gradient(45deg, transparent 0 6px, var(--dg-cb-d-pat) 6px 8px), repeating-linear-gradient(-45deg, var(--dg-cb-d) 0 6px, var(--dg-cb-d-pat) 6px 8px) !important; }
.cb-box .cb-l, .cb-box .cb-w { position: relative; padding: 0 2px; border-radius: 3px; background: color-mix(in srgb, var(--card) 72%, transparent); display: inline-block; }
.cb-box .cb-w { display: block; width: fit-content; margin: 2px auto 0; }
.cb-nowords td.cb-box { height: 54px; }
.cb-res { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--border); background: var(--paper-deep); outline: none; }
.cb-res:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.cb-res p { margin: 0; }
.cb-tab { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: auto; }
.cb-tab th, .cb-tab td { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.cb-tab th { font-size: 13px; font-weight: 600; }
.cb-sw { display: inline-block; min-width: 18px; margin-right: 6px; border-radius: 4px; border: 1px solid var(--ink); text-align: center; font-size: 11px; font-weight: 600; line-height: 16px; }
.cb-fr { font-size: 14px; }
.cb-ratio { font-weight: 600; font-size: 16px; }
.cb-note { font-size: 13px; color: var(--ink-soft); }
.cb-mkd summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--heading); }
.cb-mkd ul { margin: 4px 0; padding-left: 20px; columns: 2; }
@media (max-width: 399.98px) {
  .cb-res.has-exp .cb-tab thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cb-res.has-exp .cb-tab, .cb-res.has-exp .cb-tab tbody, .cb-res.has-exp .cb-tab tr, .cb-res.has-exp .cb-tab td { display: block; width: auto; }
  .cb-res.has-exp .cb-tab tr { margin-bottom: 8px; padding: 6px 10px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); }
  .cb-res.has-exp .cb-tab td { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 0; padding: 3px 0; }
  .cb-res.has-exp .cb-tab td::before { content: attr(data-h); font-size: 13px; color: var(--ink-soft); }
}
.cb-tot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cb-tot label { font-weight: 600; }
.cb-n { width: 104px; min-height: 44px; padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; }
.cb-n[aria-invalid="true"] { border-color: var(--wrong); }
.cb-err { flex-basis: 100%; margin: 0; color: var(--wrong); font-weight: 600; font-size: 14px; }
.cb-reset { align-self: flex-start; }
.cb-m:focus-visible, .cb-b:focus-visible, .cb-tsel:focus-visible, .cb-n:focus-visible, .cb-mkd summary:focus-visible, .cb-r:has(input:focus-visible) { outline: 3px solid var(--acc); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .cb-box.cb-new { animation: cb-pop .35s ease-out; }
  @keyframes cb-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
}

/* ---- heights-and-distances explorer (Maths Ch 9, T03-V5; initHd) */
.hd { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.hd-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.hd-seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; max-width: 100%; }
.hd-seg button { flex: 1 1 auto; min-height: 44px; padding: 6px 12px; border: 0; background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; cursor: pointer; }
.hd-seg button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.hd-st { display: flex; align-items: center; gap: 6px; }
.hd-stl { font-size: 14px; font-weight: 600; }
.hd-st button { width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 20px "Lexend", sans-serif; cursor: pointer; }
.hd-st button:disabled { opacity: .45; cursor: default; }
.hd-st output { min-width: 50px; text-align: center; font: 600 16px "Lexend", sans-serif; }
.fig-art .hd-svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0; overflow: visible; touch-action: none; }
.hd-ob { cursor: grab; touch-action: none; outline: none; }
.hd-ob .hd-ring { stroke: transparent; }
.hd-ob:focus .hd-ring, .hd-ob:hover .hd-ring { stroke: var(--acc); }
.hd-hint { margin: 0; font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; color: var(--ink-soft); }
.hd-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hd-pick[hidden] { display: none; }
.hd-pl { min-width: 64px; font-size: 14px; font-weight: 600; }
.hd-pick button { min-width: 56px; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 15px "Lexend", sans-serif; cursor: pointer; }
.hd-pick button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; border-color: var(--acc-fill); }
.hd-note { margin: 0; padding: 7px 10px; border-radius: 8px; border: 1.5px dashed var(--wrong); background: var(--wrong-bg); font-size: 14px; font-weight: 600; }
.hd-note[hidden] { display: none; }
.hd-note::before { content: "! "; color: var(--wrong); }
.hd-work { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; overflow-x: auto; }
.hd-l { white-space: nowrap; font-size: 16px; line-height: 2.1; }
.hd-l .mx { font-size: 1.05em; }
.hd-l0 .katex { font-size: 1.05em; }
.hd-l .gx-fr { font-size: .95em; }
.hd-ans { font-weight: 600; }
.hd-cap { margin: 0; font-size: 14px; color: var(--ink-soft); }
.hd-other { margin-top: 6px; color: var(--ink); font-weight: 600; }
.hd button:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.hd, .hd * { transition: none; animation: none; }
/* static first view (no JS): Topic 3 shows the one-observer picture, Topic 4 the two-positions picture */
.dg .hd-v2 { display: none; }
.fig[data-block-id*="-T04."] .dg .hd-v1 { display: none; }
.fig[data-block-id*="-T04."] .dg .hd-v2 { display: inline; }

/* ---- defect-and-correction explorer (Science Ch 10, T02-V5; initEy in site.js) */
.ey { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; margin-bottom: 4px; }
.ey-model { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.ey-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.ey-objs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ey-seg button { min-height: 44px; padding: 6px 8px; border: 0; border-left: 1px solid var(--border); background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; cursor: pointer; }
.ey-seg button:first-child { border-left: 0; }
.ey-seg button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 599px) {
  .ey-eyes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ey-eyes button:nth-child(3) { border-left: 0; }
  .ey-eyes button:nth-child(n+3) { border-top: 1px solid var(--border); }
  .fig--ey .ey-art { margin: 0 -13px; }
  .fig-art > svg.ey-svg { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: same 358 px */
}
.ey-lens { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ey-sw { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 6px 8px; border-radius: 999px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.ey-sw:disabled { opacity: .45; cursor: not-allowed; }
.ey-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--border); flex: none; }
.ey-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--ink); transition: left .15s; }
.ey-sw[aria-checked="true"] .ey-track { background: var(--acc-fill); }
.ey-sw[aria-checked="true"] .ey-knob { left: 21px; }
.ey-ln { font-size: 14px; font-weight: 600; color: var(--ink); }
.fig-art .ey-svg.ey-live { max-width: 560px; }
.ey-note { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.ey-read { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--paper-deep); }
.ey-read b { font-family: "Kalam", cursive; font-weight: 700; font-size: 17px; }
.ey-read span:empty { display: none; }
.ey-how { margin-top: 6px; font-size: 14px; }
.ey-how summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--heading); }
.ey-num { margin: 0 0 6px; line-height: 1.7; }
.ey-seg button:focus-visible, .ey-sw:focus-visible, .ey-how summary:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ey-knob { transition: none; } }
/* ---- tangent explorer (Maths Ch 10, T02-V6; initTe in site.js) */
.dg .te-v2 { display: none; }
.fig[data-block-id*="-T04."] .dg .te-v1 { display: none; }
.fig[data-block-id*="-T04."] .dg .te-v2 { display: inline; }
.fig-art > svg.te-svg0 { max-width: 640px; }
.te { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.fig-art .te-svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0; overflow: visible; touch-action: none; }
@media (max-width: 599px) {
  .fig--te .te-art { margin: 0 -13px; }
  .fig-art > svg.te-svg0 { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: same 358 px */
}
.te-p { cursor: grab; outline: none; touch-action: none; }
.te.is-drag .te-p { cursor: grabbing; }
.te-dot { fill: var(--acc); }
.te-ring { stroke: transparent; }
.te-p:focus .te-ring, .te-p:hover .te-ring { stroke: var(--acc); }
.te-p:focus-visible .te-ring { stroke-dasharray: 3 3; }
.te-hint { margin: 0; font-family: "Kalam", cursive; font-weight: 700; font-size: 16px; color: var(--ink-soft); }
.te-snap { display: flex; flex-wrap: wrap; gap: 6px; }
.te-snap button { min-width: 64px; min-height: 44px; padding: 4px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 15px "Lexend", sans-serif; cursor: pointer; }
.te-snap button .mx { font-size: 1.05em; }
.te-snap button:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.te-read { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; overflow-x: auto; min-height: 3em; }
.te-l { margin: 0; font-size: 16px; line-height: 1.9; white-space: nowrap; }
.te-l .mx { font-size: 1.05em; }
.te-msg { font-weight: 600; white-space: normal; line-height: 1.5; }
.te-gap { display: inline-block; width: 16px; }
.te-ang { white-space: normal; }
.te-ang .mx { white-space: nowrap; }
.te-sum { font-weight: 600; }
.te, .te * { transition: none; animation: none; }
/* ---- circuit virtual lab (Science Ch 11, T03-V8; initCv in site.js) */
.dg .cv-v2, .dg .cv-v3 { display: none; }                         /* static / no-JS view: the page's own variant */
.fig[data-block-id*="-T05."] .dg .cv-v1, .fig[data-block-id*="-WRAPUP."] .dg .cv-v1 { display: none; }
.fig[data-block-id*="-T05."] .dg .cv-v2, .fig[data-block-id*="-WRAPUP."] .dg .cv-v3 { display: inline; }
.dg .cv-sl { paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.fig-art > svg.cv-svg { max-width: 560px; }
.cv { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; margin-bottom: 4px; }
.cv-model { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.cv-eqs { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: center; font-size: 15px; color: var(--ink); }
.cv-ctl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cv-lbl { font: 600 14px "Lexend", sans-serif; color: var(--heading); }
.cv-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.cv-seg button { min-height: 44px; min-width: 44px; padding: 6px 8px; border: 0; border-left: 1px solid var(--border); background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; line-height: 1.25; cursor: pointer; }
.cv-seg button:first-child { border-left: 0; }
.cv-seg button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.cv-rs { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.cv-rs > .cv-ctl { flex: 1 1 200px; }
.cv-rs > .cv-ctl[hidden] { display: none; }
.cv-acts { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.cv-acts button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.cv-acts .cv-add { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; }
.cv-acts button:disabled { opacity: .45; cursor: not-allowed; }
.fig-art .cv-art svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.cv-read { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: var(--paper-deep); font-size: 15px; }
.cv-read b { font-weight: 600; }
.cv-read span:empty { display: none; }
.cv-msg { font-size: 14px; color: var(--ink-soft); }
.cv-n { font-family: "KaTeX_Main", "Times New Roman", serif; font-size: 1.08em; }
.cv-note { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.cv-seg button:focus-visible, .cv-acts button:focus-visible { outline: 3px solid var(--acc); outline-offset: -3px; }
.cv-new { animation: cv-pop .25s ease-out; transform-origin: center; transform-box: fill-box; }
@keyframes cv-pop { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 599px) {
  .fig--cv .cv-art { margin: 0 -13px; }
  .fig-art > svg.cv-svg { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: 358 px */
}
@media (prefers-reduced-motion: reduce) { .cv-new { animation: none; } }
/* drawings inside a worked-example or solution step (Ch 11: svg.dg-bleed): on a phone the figure card moves over the
   empty badge column and the drawing spans the card's padding, so its 14-unit labels stay at least 12 px */
@media (max-width: 599px) {
  .step-body > .fig--drawn:has(svg.dg-bleed) { margin-left: -48px; }
  .step-body > .fig--drawn .fig-art > svg.dg-bleed { width: calc(100% + 24px); max-width: none; margin: 0 -12px; }
}
/* ---- sector and segment explorer (Maths Ch 11, T02-V6; initSe in site.js) */
.dg .se-v2 { display: none; }                                      /* static / no-JS view: the page's own mode */
.fig[data-block-id*="-T03."] .dg .se-v1 { display: none; }
.fig[data-block-id*="-T03."] .dg .se-v2 { display: inline; }
.fig-art > svg.se-svg0 { max-width: 640px; }
.se { display: flex; flex-direction: column; gap: 12px; min-width: 0; font-size: 15px; }
.fig-art .se-svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0; overflow: visible; }
@media (max-width: 599px) {
  .fig--se .se-art { margin: 0 -13px; }
  .fig-art > svg.se-svg0 { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: same 358 px */
}
.se-ctls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; min-width: 0; }
.se-ctl { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 240px; }
.se-lbl { font: 600 14px "Lexend", sans-serif; color: var(--heading); }
.se-lbl .mx, .se-hint .mx { font-size: 1.1em; }
.se-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.se-seg button { min-height: 44px; min-width: 44px; padding: 6px 8px; border: 0; border-left: 1px solid var(--border); background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; line-height: 1.25; cursor: pointer; }
.se-seg button:first-child { border-left: 0; }
.se-seg button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.se-range { width: 100%; min-height: 44px; margin: 0; accent-color: var(--acc); cursor: pointer; }
.se-hint, .se-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.se-note { font-size: 14px; }
.se-pi { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.se-pi[aria-pressed="true"] { background: var(--heading); color: var(--paper); }
.se-seg button:focus-visible, .se-pi:focus-visible { outline: 3px solid var(--acc); outline-offset: -3px; }
.se-pi:focus-visible { outline-offset: 2px; }
.se-range:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.se-eqs { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-size: 15px; color: var(--ink); min-width: 0; }
.se-eq { white-space: nowrap; }
.se-read { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); min-width: 0; }
.se-l { margin: 0; font-size: 15px; line-height: 1.5; padding: 3px 0; overflow-wrap: anywhere; }
.se-k { font-weight: 600; }
.se-l .mx { font-size: 1.06em; }
.se-fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; margin: 0 2px; font-size: .92em; }
.se-fr .se-fn { border-bottom: 1.2px solid currentColor; padding: 0 2px; }
.se-fr .se-fd { padding: 0 2px; }
.se-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.se, .se * { transition: none; animation: none; }
/* ---- direction-rule trainer (Science Ch 12, T02-V9; initDr in site.js) */
.dg .dr-v2, .dg .dr-v3 { display: none; }                         /* static / no-JS view: the page's own question */
.fig[data-block-id*="-T04."] .dg .dr-v1, .fig[data-block-id*="-WRAPUP."] .dg .dr-v1 { display: none; }
.fig[data-block-id*="-T04."] .dg .dr-v2, .fig[data-block-id*="-WRAPUP."] .dg .dr-v3 { display: inline; }
.fig-art > svg.dr-svg { max-width: 420px; }
.fig--dr .fig-art--full[hidden] { display: none; }
.dr { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; margin-bottom: 4px; }
.dr-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.dr-seg button { min-height: 44px; min-width: 44px; padding: 6px 8px; border: 0; border-left: 1px solid var(--border); background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; line-height: 1.25; cursor: pointer; }
.dr-seg button:first-child { border-left: 0; }
.dr-seg button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.dr-art svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.dr-q { margin: 0; font-weight: 600; line-height: 1.5; color: var(--ink); }
.dr-ans-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dr-ans-grid button { min-height: 44px; min-width: 0; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; line-height: 1.25; cursor: pointer; overflow-wrap: anywhere; }
.dr-ans-grid button[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-fill); color: #FFFFFF; font-weight: 600; }
.dr-ans-grid button:disabled { cursor: default; opacity: .6; }
.dr-ans-grid button.is-right { opacity: 1; border-color: var(--correct); background: var(--correct-bg); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--correct); }
.dr-ans-grid button.is-wrong { opacity: 1; border-color: var(--wrong); background: var(--wrong-bg); color: var(--ink); text-decoration: line-through; }
.dr-sym { font-family: "KaTeX_Main", "Times New Roman", serif; font-size: 20px; line-height: 1; vertical-align: -2px; }
.dr-acts { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.dr-acts button { min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.dr-acts .dr-check { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; }
.dr-acts button:disabled { opacity: .45; cursor: not-allowed; }
.dr-live-region { padding: 8px 10px; border-radius: 10px; background: var(--paper-deep); }
.dr-fb { margin: 0; line-height: 1.5; }
.dr-fb:empty { display: none; }
.dr-fb.is-right { color: var(--correct); font-weight: 600; }
.dr-fb.is-wrong { color: var(--wrong); font-weight: 600; }
.dr-score { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }
.dr-seg button:focus-visible, .dr-ans-grid button:focus-visible, .dr-acts button:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.dr-seg button:focus-visible { outline-offset: -3px; }
.dr-live .dr-ans { animation: dr-pop .25s ease-out; transform-origin: center; transform-box: fill-box; }
@keyframes dr-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 599px) {
  .fig--dr .dr-art { margin: 0 -13px; }
  .fig--dr .dr-art svg { max-width: none; }
  .fig-art > svg.dr-svg { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: 358 px */
}
@media (prefers-reduced-motion: reduce) { .dr-live .dr-ans { animation: none; } }
/* ---- solid builder (Maths Ch 12, T02-V9; initSb in site.js; also uses the .se-* panel and control styles) */
.dg .sb-v2 { display: none; }                                      /* static / no-JS view: the page's own mode */
.fig[data-block-id*="-T03."] .dg .sb-v1, .fig[data-block-id*="-T04."] .dg .sb-v1 { display: none; }
.fig[data-block-id*="-T03."] .dg .sb-v2, .fig[data-block-id*="-T04."] .dg .sb-v2 { display: inline; }
.fig-art > svg.sb-svg0 { max-width: 640px; }
.fig-art .sb-svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0; overflow: visible; }
@media (max-width: 599px) {
  .fig--sb .sb-art { margin: 0 -13px; }
  .fig-art > svg.sb-svg0 { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: same 358 px */
}
.sb-ctls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; min-width: 0; }
.sb-ctl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb-ctl[hidden] { display: none; }
.sb-sel { min-height: 44px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; }
.sb-mode { min-height: 44px; display: grid; grid-template-columns: 1fr 1fr; padding: 0; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; cursor: pointer; }
.sb-mode span { display: flex; align-items: center; justify-content: center; min-height: 41px; padding: 4px 8px; }
.sb-mode span + span { border-left: 1px solid var(--border); }
.sb-mode[aria-checked="false"] .sb-mj, .sb-mode[aria-checked="true"] .sb-mc { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.sb-mode:disabled { cursor: not-allowed; opacity: .6; }
.sb-hint, .sb-btns { grid-column: 1 / -1; }
.sb-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.sb-again { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.sb-sel:focus-visible, .sb-mode:focus-visible, .sb-again:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.sb-eq { font-size: 15px; }
.sb-read sub { font-size: .72em; }
.sb-why { font-weight: 600; color: var(--heading); }
/* ---- energy-flow explorer (Science Ch 13, T03-V9; initEf in site.js) */
.dg .ef-v2 { display: none; }                                      /* static / no-JS view: the page's own case */
.fig[data-block-id*="-WRAPUP."] .dg .ef-v1 { display: none; }
.fig[data-block-id*="-WRAPUP."] .dg .ef-v2 { display: inline; }
.fig-art > svg.ef-svg { max-width: 420px; }
.ef { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; margin-bottom: 4px; }
.ef-ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ef-lbl { font: 600 14px "Lexend", sans-serif; color: var(--ink-soft); }
.ef-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 4px; }
.ef-seg button { min-height: 44px; min-width: 44px; padding: 6px 6px; border: 0; border-left: 1px solid var(--border); background: var(--card); color: var(--ink); font: 14px "Lexend", sans-serif; line-height: 1.25; cursor: pointer; }
.ef-seg button:first-child { border-left: 0; }
.ef-seg button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.ef-in { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 10px; align-items: end; }
.ef-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ef-num, .ef-unit { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); font: 16px "Lexend", sans-serif; }
.ef-num[aria-invalid="true"] { border-color: var(--wrong); }
.ef-err { margin: 0; font-size: 14px; font-weight: 600; color: var(--wrong); }
.ef-err:empty { display: none; }
.ef-art svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.ef-art svg.is-wide { max-width: none; }
.ef-acts { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.ef-acts button { min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.ef-acts .ef-step { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; }
.ef-acts button:disabled { opacity: .45; cursor: not-allowed; }
.ef-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.ef-out { padding: 8px 10px; border-radius: 10px; background: var(--paper-deep); }
.ef-say { margin: 0; font-weight: 600; line-height: 1.5; color: var(--ink); }
.ef-say:empty { display: none; }
.ef-read { margin: 4px 0 0; padding-left: 1.5em; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.ef-read:empty { display: none; }
.ef-read .ef-nv, .ef-read .ef-lv { white-space: nowrap; }
.ef-read .ef-note { color: var(--ink-soft); }
.ef-read .ef-r-back { color: var(--ink-soft); }
.ef-read .ef-ok { list-style: none; margin-left: -1.5em; color: var(--correct); font-weight: 600; }
.ef-seg button:focus-visible, .ef-acts button:focus-visible, .ef-num:focus-visible, .ef-unit:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.ef-seg button:focus-visible { outline-offset: -3px; }
.ef-live .ef-card.is-new { animation: ef-pop .3s ease-out; transform-origin: center; transform-box: fill-box; }
@keyframes ef-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 599px) {
  .fig--ef .ef-art { margin: 0 -13px; }
  .fig--ef .ef-art svg { max-width: none; }
  .fig-art > svg.ef-svg { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: 358 px */
}
@media (prefers-reduced-motion: reduce) { .ef-live .ef-card.is-new { animation: none; } }

/* ---------------------------------------------------- grouped-data explorer (Maths Ch 13, T02-V5; initGd) */
.dg .gd-v2, .dg .gd-v4, .dg .gd-v5 { display: none; }                  /* static / no-JS view: the page's own table */
.fig[data-block-id*="-T03."] .dg .gd-v1, .fig[data-block-id*="-T04."] .dg .gd-v1, .fig[data-block-id*="-T05."] .dg .gd-v1 { display: none; }
.fig[data-block-id*="-T03."] .dg .gd-v2, .fig[data-block-id*="-T04."] .dg .gd-v4, .fig[data-block-id*="-T05."] .dg .gd-v5 { display: inline; }
.gd { gap: 10px; }
.gd-src { margin: 0; font-size: 14px; color: var(--ink-soft); }
.gd-ctls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; min-width: 0; }
.gd.is-wide .gd-ctls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gd-ctl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gd-num, .gd-a, .gd-f { box-sizing: border-box; min-height: 44px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--ink); font: 16px "Lexend", sans-serif; }
.gd-num, .gd-a { width: 100%; min-width: 0; padding: 6px 10px; }
.gd-f { width: 60px; min-width: 44px; padding: 6px 6px; text-align: center; -moz-appearance: textfield; }
.gd-f::-webkit-inner-spin-button, .gd-f::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gd-num[aria-invalid="true"], .gd-f[aria-invalid="true"] { border-color: var(--wrong); }
.gd-kbtns { display: flex; align-items: center; gap: 6px; }
.gd-kbtns button { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 20px "Lexend", sans-serif; line-height: 1; cursor: pointer; }
.gd-kbtns button:disabled { opacity: .4; cursor: not-allowed; }
.gd-k { min-width: 24px; text-align: center; font: 600 16px "Lexend", sans-serif; }
.gd-err { color: var(--wrong); font-weight: 600; }
.gd-tw table.gd-table { width: auto; min-width: 100%; font-size: 15px; }
.gd-tw .gd-table th, .gd-tw .gd-table td { min-width: 0; padding: 6px 10px; text-align: center; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid var(--border-soft); }
.gd-tw .gd-table thead th { font-size: 14px; }
.gd-tw .gd-table tbody th { background: transparent; font-weight: 400; text-align: left; }
.gd-tw .gd-table tfoot th, .gd-tw .gd-table tfoot td { background: var(--dg-m-shade); font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.gd-tw .gd-table td.gd-sf { text-align: center; }
.gd-table tr.is-modal > * { background: var(--dg-m-opp-bg); }
.gd-table tr.is-median > * { background: var(--dg-m-adj-bg); }
.gd-table tr.is-modal.is-median > * { background: linear-gradient(180deg, var(--dg-m-opp-bg) 50%, var(--dg-m-adj-bg) 50%); }
.gd-table tr.is-modal > th, .gd-table tr.is-median > th { font-weight: 700; }
.gd-tag { display: block; }
.gd-tag:empty { display: none; }
.gd-t { display: block; font-size: 12.5px; line-height: 1.3; }
.gd-t-mode { color: var(--dg-m-opp); }
.gd-t-med { color: var(--dg-m-adj); }
.gd-panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.gd.is-wide .gd-panels { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.gd-p { min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); border-left: 5px solid var(--border); }
.gd-p-mode { border-left-color: var(--dg-m-opp); }
.gd-p-med { border-left-color: var(--dg-m-adj); }
.gd-ph { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font: 700 16px "Lexend", sans-serif; color: var(--heading); }
.gd-sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--ink-soft); }
.gd-sw-mode { background: var(--dg-m-opp-bg); }
.gd-sw-med { background: var(--dg-m-adj-bg); }
.gd-pb p { margin: 0; padding: 2px 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.gd-pb .gd-big { font-size: 17px; font-weight: 700; }
.gd-pb .gd-k2 { font-size: 14px; color: var(--ink-soft); }
.gd-pb .gd-k2 b { color: var(--ink); }
.gd-pb .gd-tex, .gd-pb .gd-l { overflow-x: auto; overflow-y: hidden; overflow-wrap: normal; white-space: nowrap; scrollbar-width: thin; }
.gd-pb .mx { font-size: 1.06em; }
.gd-pb .gd-same { font-size: 14px; color: var(--correct); font-weight: 600; }
.gd-pb .gd-msg { font-weight: 600; }
.gd-pb .gd-refuse { color: var(--wrong); }
.gd-xbar i { text-decoration: overline; }
.gd-num:focus-visible, .gd-a:focus-visible, .gd-f:focus-visible, .gd-kbtns button:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
@media (max-width: 599px) {
  .fig-art > svg[data-gd] { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: 358 px */
}

/* ---------------------------------------------------- sample-space explorer (Maths Ch 14, T05-V10; initSs in site.js) */
.dg .ss-v3 { display: none; }                                      /* static / no-JS view: the page's own start */
.fig[data-block-id*="-T03."] .dg .ss-v5 { display: none; }
.fig[data-block-id*="-T03."] .dg .ss-v3 { display: inline; }
.ss { gap: 10px; }
.ss-src { margin: 0; font-size: 14px; color: var(--ink-soft); }
.ss-ctls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; min-width: 0; }
.ss.is-wide .ss-ctls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ss-ctl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ss-ctl[hidden] { display: none; }
.ss-c-show { grid-column: 1 / -1; }
.ss-show button { padding: 6px 4px; font-size: 14px; overflow-wrap: normal; word-break: keep-all; }
.ss-sel, .ss-num { box-sizing: border-box; min-height: 44px; min-width: 44px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--ink); font: 16px "Lexend", sans-serif; padding: 6px 10px; }
.ss-ctl .ss-sel, .ss-ctl .ss-num { width: 100%; min-width: 0; }
.ss-k1, .ss-k2 { width: 76px; text-align: center; }
.ss-num[aria-invalid="true"] { border-color: var(--wrong); }
.ss-err { color: var(--wrong); font-weight: 600; }
.ss-rule { margin: 0; padding: 10px 12px; border: 1.5px solid var(--border-soft); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ss-rule legend { padding: 0 4px; }
.ss-rrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.ss-rrow .ss-sel { flex: 1 1 150px; max-width: 100%; }
.ss-rrow [hidden] { display: none; }
.ss-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.ss.is-wide .ss-main { grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); align-items: start; }
.ss-tw { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.ss-pie[hidden] { display: none; }
.ss-pie svg { display: block; width: 152px; height: 152px; }
.ss-sec { fill: var(--card); stroke: var(--border); stroke-width: 1.2; }
.ss-sec.is-fav { fill: var(--dg-m-adj-bg); stroke: var(--dg-m-adj); stroke-width: 2.4; }
.ss-st { font: 600 14px "Lexend", sans-serif; fill: var(--ink); }
.ss-rim { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.ss-tiles { display: grid; gap: 4px; width: 100%; min-width: 0; }
.ss-t-num { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.ss-t-coin { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.ss-t-grid { grid-template-columns: 22px repeat(6, minmax(44px, 56px)); justify-content: center; gap: 3px; }
.ss-hd { display: flex; align-items: center; justify-content: center; font: 600 15px "Lexend", sans-serif; color: var(--heading); }
.ss-corner { color: var(--ink-soft); }
.ss-tile { box-sizing: border-box; min-width: 44px; min-height: 44px; padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  border: 1.5px solid var(--border); border-radius: 9px; background: var(--card); color: var(--ink); font: 16px "Lexend", sans-serif; line-height: 1.15; cursor: pointer; }
.ss-t-coin .ss-tile { letter-spacing: .08em; font-weight: 600; }
.ss-tile[aria-pressed="true"] { background: var(--dg-m-adj-bg); border-color: var(--dg-m-adj); box-shadow: inset 0 0 0 2px var(--dg-m-adj); font-weight: 700; }
.ss-tile:focus-visible, .ss-sel:focus-visible, .ss-num:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.ss-pr { font-size: 12px; color: var(--ink-soft); letter-spacing: .04em; font-weight: 400; }
.ss-pr-big { font-size: 14px; color: var(--ink); }
.ss-v { font-size: 16px; }
.ss-panel { min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); border-left: 5px solid var(--dg-m-adj); }
.ss-l { margin: 0; padding: 3px 0; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.ss-l .mx { font-size: 1.06em; }
.ss-l .se-fr { font-size: .95em; }
.ss-one { color: var(--correct); font-weight: 600; }
.ss-msg { font-weight: 700; color: var(--heading); }
.ss-msg[hidden] { display: none; }
.fig-art > svg[data-ss] { max-width: 420px; }
@media (max-width: 599px) {
  .fig-art > svg[data-ss] { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: 358 px */
}

/* Maths Ch 14, Topic 5: the 6 × 6 sums table fits a phone without sideways scrolling (that table only) */
.table-wrap[data-block-id="C10-MATH-CH14-T05.3-two-dice-36-outcomes.4"] th,
.table-wrap[data-block-id="C10-MATH-CH14-T05.3-two-dice-36-outcomes.4"] td { min-width: 0; padding: 8px 4px; text-align: center; }

/* ---- MP: map-points trainer (History Ch 2, T07-V12; initMp in site.js) */
.fig-art > svg.mp-svg0 { max-width: 420px; }
.mp { display: flex; flex-direction: column; gap: 10px; min-width: 0; font-size: 15px; }
.mp-cluebar { position: sticky; top: 4px; z-index: 5; padding: 8px 12px; border-radius: 12px; background: var(--raised); border: 1.5px solid var(--border);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .08); }
.mp-out { display: flex; flex-direction: column; gap: 8px; width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; background: var(--paper-deep);
  border-left: 5px solid var(--acc); scroll-margin-top: 110px; scroll-margin-bottom: 16px; }
.mp-out[hidden] { display: none; }
.mp-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.mp-modes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.mp-modes button { min-height: 44px; min-width: 76px; padding: 6px 12px; border: 0; border-left: 1px solid var(--border); background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; cursor: pointer; }
.mp-modes button:first-child { border-left: 0; }
.mp-modes button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.mp-listbtn, .mp-acts button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.mp-listbtn[aria-pressed="true"] { background: var(--heading); color: var(--paper); }
.mp-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-acts:not(:has(button:not([hidden]))) { display: none; }
.mp-acts .mp-next, .mp-acts .mp-again { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; }
.mp-acts button[hidden] { display: none; }
.mp-clue { margin: 0; font-weight: 600; line-height: 1.45; color: var(--ink); }
.mp-clue:focus { outline: none; }
.mp-clue:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.mp-cn { display: inline-block; margin-right: 4px; padding: 0 8px; border-radius: 999px; background: var(--tint); color: var(--heading); font-size: 13px; }
.mp-fb:empty { display: none; }
.mp-fb p { margin: 0 0 4px; line-height: 1.5; }
.mp-card { font-size: 15px; }
.mp-when { font-weight: 600; }
.mp-ok { color: var(--correct); font-weight: 700; }
.mp-no { color: var(--wrong); font-weight: 700; }
.mp-score { font-size: 16px; color: var(--heading); }
.mp-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.mp-stage > .mp-out { margin: 0 13px; width: auto; align-self: stretch; }
.mp-stage[hidden], .mp-list[hidden] { display: none; }
.mp-mapw { position: relative; width: 100%; min-width: 0; }
.mp-mapw > svg { display: block; width: 100%; height: auto; }
.mp-mainw { max-width: 520px; margin-left: auto; margin-right: auto; }   /* the map svg is capped at 520 px (.fig-art svg): its box too, so the point buttons stay on the dots (fix, Geography Ch 4: 768 px portrait) */
.mp-insw { margin: 0 auto; border-radius: 8px; scroll-margin-top: 110px; }
.mp-insw.is-focus { outline: 3px dashed var(--acc); outline-offset: 3px; }
.mp-instl { position: absolute; left: 8px; top: 4px; margin: 0; font: 600 14px "Lexend", sans-serif; color: var(--ink); pointer-events: none; }
.mp-pt, .mp-gbox { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink); }
.mp-gbox { border-radius: 10px; }
.mp-ring { position: absolute; inset: 9px; border-radius: 50%; border: 2px solid transparent; }
.mp-gbox .mp-ring { inset: 6px 12px; border-radius: 6px; border: 2px dashed var(--acc); }
.mp-pt:hover .mp-ring { border-color: var(--acc); }
.mp-pt:focus-visible, .mp-gbox:focus-visible { outline: 3px solid var(--acc); outline-offset: 0; }
.mp-pt.is-sel .mp-ring, .mp-pt.is-right .mp-ring { border: 3px solid var(--correct); background: rgba(0, 0, 0, 0); }
.mp-pt.is-wrong .mp-ring { border: 3px dashed var(--wrong); }
.mp-mark { position: absolute; right: -4px; top: -6px; font: 700 16px "Lexend", sans-serif; }
.mp-pt.is-right .mp-mark { color: var(--correct); }
.mp-pt.is-wrong .mp-mark { color: var(--wrong); }
.mp-lab:empty { display: none; }
.mp-lab { position: absolute; left: 38px; top: 50%; transform: translateY(-50%); padding: 1px 7px; border-radius: 8px; white-space: nowrap; background: var(--raised);
  border: 1.5px solid var(--correct); font: 600 14px "Lexend", sans-serif; color: var(--ink); pointer-events: none; z-index: 2; }
.mp-mainw .mp-pt[data-k="calcutta"] .mp-lab { left: auto; right: 38px; }
.mp-list { display: flex; flex-direction: column; gap: 8px; }
.mp-listhd { margin: 0; font-weight: 600; }
.mp-lbtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mp-lb { min-height: 44px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--ink); font: 15px "Lexend", sans-serif; cursor: pointer; text-align: left; }
.mp-lb:disabled { cursor: default; opacity: .75; }
.mp-lb.is-right { opacity: 1; border: 2.5px solid var(--correct); font-weight: 700; }
.mp-lb.is-right::before { content: "✔ "; color: var(--correct); }
.mp-lb.is-wrong { opacity: 1; border: 2.5px dashed var(--wrong); }
.mp-lb.is-wrong::before { content: "✘ "; color: var(--wrong); }
.mp-modes button:focus-visible, .mp-listbtn:focus-visible, .mp-acts button:focus-visible, .mp-lb:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.mp-attr { margin: 0; font-size: 13px; color: var(--ink-soft); }
.mp-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* generic options (Geography Ch 1 T07-V14 soil trainer: kind "choose"); unused by the History Ch 2 model */
.mp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mp-prog { font-weight: 400; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.mp-ex { color: var(--ink-soft); }
.mp-choose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; box-sizing: border-box; align-self: stretch; }
.mp-choose[hidden] { display: none; }
.mp-ch { min-height: 48px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); font: 600 15px "Lexend", sans-serif; cursor: pointer; }
.mp-ch:disabled { cursor: default; opacity: .75; }
.mp-ch.is-right { opacity: 1; border: 2.5px solid var(--correct); }
.mp-ch.is-right::before { content: "✔ "; color: var(--correct); }
.mp-ch.is-wrong { opacity: 1; border: 2.5px dashed var(--wrong); }
.mp-ch.is-wrong::before { content: "✘ "; color: var(--wrong); }
.mp-ch:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.mp-pt.is-cur { z-index: 3; }
.mp-pt.is-cur .mp-ring { inset: 1px; border: 4px solid var(--ink); box-shadow: 0 0 0 2px var(--card), inset 0 0 0 2px var(--card); animation: mp-pulse 1.6s ease-in-out infinite; }
.mp-pt.is-cur.is-right .mp-ring { border: 4px solid var(--correct); }
.mp-pt.is-cur.is-wrong .mp-ring { border: 4px dashed var(--wrong); }
@keyframes mp-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@media (orientation: landscape) and (min-width: 560px) {     /* landscape: the answer buttons beside the map */
  .mp--choose .mp-stage { flex-direction: row; align-items: center; }
  .mp--choose .mp-mainw { flex: 1 1 0; min-width: 0; }
  .mp--choose .mp-choose { flex: 0 0 210px; width: 210px; grid-template-columns: 1fr; }
}
@media (orientation: portrait), (max-width: 559px) {
  .mp--choose .mp-stage { flex-direction: column; }
}
@media (min-width: 720px) {
  .mp-stage { flex-direction: row; align-items: flex-start; }
  .mp-mainw { flex: 1 1 0; min-width: 0; }
  .mp-insw { flex: 0 0 auto; width: var(--iw, 290px); margin: 0; }
}
@media (max-width: 599px) {
  .fig--mp .mp-stage { margin: 0 -13px; }
  .fig-art > svg.mp-svg0 { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: 358 px */
  .fig--mp .mp--choose .mp-choose { padding: 0 13px; }
}
/* generic options (Geography Ch 2 T03-V8 tiger-reserve trainer: one map, clue -> tap a point); unused by the earlier models */
.mp-pt--l .mp-lab { left: auto; right: 38px; }
.mp-pt:disabled { cursor: default; }
.mp-pt.is-trim { pointer-events: none; }
.mp-hit { position: absolute; inset: 0; border-radius: 50%; pointer-events: auto; }
@media (orientation: landscape) and (min-width: 560px) {     /* landscape, one map: the card beside the map */
  .mp--one .mp-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 36%); align-items: start; gap: 14px; }
  .mp--one .mp-stage > .mp-out { position: sticky; top: 76px; margin: 0; width: auto; align-self: start; }
}
/* generic option side: true (Geography Ch 3 T07-V16 dam trainer: an inset, clue -> tap a point); unused by the earlier models */
@media (orientation: landscape) and (min-width: 560px) {     /* landscape: main map left; the enlarged box and the card right */
  .mp--side .mp-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 36%); grid-template-rows: auto 1fr; align-items: start; gap: 14px; }
  .mp--side .mp-stage[hidden] { display: none; }
  .mp--side .mp-stage > .mp-mainw { grid-column: 1; grid-row: 1 / span 2; }
  .mp--side .mp-stage > .mp-insw { grid-column: 2; grid-row: 1; width: 100%; margin: 0; justify-self: start; }
  .mp--side .mp-stage > .mp-out { grid-column: 2; grid-row: 2; position: sticky; top: 76px; margin: 0; width: auto; align-self: start; }
}
/* generic option showLoc: true (Geography Ch 4 T08-V16 crop-state trainer: the crop clue shown in Test); unused by the earlier models */
.mp-loc { font-weight: 400; }
/* generic options insets + sets (Geography Ch 5 T08-V22 map-points trainer: several enlarged boxes, Test by group); unused by the earlier models */
.mp-ask { display: block; font-weight: 400; font-size: 14px; color: var(--ink-soft); }
.mp-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-sets[hidden] { display: none; }
.mp-set { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.mp-set[aria-pressed="true"] { background: var(--heading); border-color: var(--heading); color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }
.mp-bxw { display: flex; flex-direction: column; gap: 8px; width: 100%; box-sizing: border-box; min-width: 0; }
.mp-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mp-tab { min-height: 44px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--ink); font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.mp-tab[aria-pressed="true"] { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; text-decoration: underline; text-underline-offset: 4px; }
.mp-bxhint { margin: 0; font-size: 14px; color: var(--ink-soft); }
.mp-bxhint[hidden], .mp-box[hidden] { display: none; }
.mp-box { margin: 0 auto; border-radius: 8px; scroll-margin-top: 110px; }
.mp-box:focus { outline: none; }
.mp-rbox { position: absolute; transform: translate(-50%, -50%); padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; z-index: 1; }
.mp-rbox .mp-ring { inset: 0; border-radius: 6px; border: 2px dashed var(--acc); }
.mp-rbox:hover .mp-ring { border-style: solid; }
.mp-rbox[aria-pressed="true"] .mp-ring { border: 3px solid var(--acc); }
.mp-set:focus-visible, .mp-tab:focus-visible, .mp-rbox:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
@media (max-width: 599px) { .fig--mp .mp-bxw > .mp-tabs, .fig--mp .mp-bxw > .mp-bxhint { margin: 0 13px; } }   /* the stage runs edge to edge on phones; the tabs keep the card's padding */
@media (min-width: 720px) { .mp-stage > .mp-bxw { flex: 0 0 auto; width: var(--iw, 330px); } }   /* beside the main map, as the single inset (the side layout overrides it) */
@media (prefers-reduced-motion: reduce) { .mp-insw.is-focus { outline-style: solid; } .mp-pt.is-cur .mp-ring { animation: none; } }
/* ---- END-MP */
/* ---- NS: three roads sorter (History Ch 1, T08-V12; reused by History Ch 3, WRAPUP-V14; initNs in site.js) */
.fig-art > svg.ns-svg0 { max-width: 420px; }
.ns { display: flex; flex-direction: column; gap: 12px; min-width: 0; font-size: 15px; }
.ns-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.ns-modes button { min-height: 44px; padding: 6px 10px; border: 0; border-left: 1px solid var(--border); background: var(--card); color: var(--ink);
  font: 15px/1.25 "Lexend", sans-serif; cursor: pointer; }
.ns-modes button:first-child { border-left: 0; }
.ns-modes button[aria-pressed="true"] { background: var(--acc-fill); color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.ns-help { margin: 0; color: var(--ink-soft); line-height: 1.45; }
.ns-hd { margin: 0; font: 600 17px "Lexend", sans-serif; color: var(--heading); }
.ns-mode1 { margin: 0; padding: 2px 0 2px 10px; border-left: 4px solid var(--acc); color: var(--heading); font: 600 16px/1.3 "Lexend", sans-serif; }
.ns-why.is-right { color: var(--correct); }
.ns-why.is-right b { color: var(--correct); }
.ns-trayw { padding: 10px; border-radius: 12px; border: 1.5px dashed var(--border); background: var(--paper-deep); }
.ns-trayw.is-over { border-color: var(--acc); border-style: solid; }
.ns-trayhd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ns.is-empty .ns-trayhd { margin-bottom: 0; }
.ns-traytl { color: var(--heading); }
.ns-back, .ns-acts button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--heading); background: var(--card); color: var(--heading);
  font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.ns-back[hidden] { display: none; }
.ns-tray { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ns-tray:empty { display: none; }
.ns.is-wide .ns-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ns-item { min-width: 0; }
.ns-card { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 8px 30px 8px 4px; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--ink); font: 15px/1.35 "Lexend", sans-serif; text-align: left;
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.ns-grip { flex: 0 0 auto; align-self: stretch; width: 26px; min-height: 28px; border-radius: 6px; cursor: grab; touch-action: none;
  background-image: radial-gradient(var(--ink-soft) 1.6px, transparent 1.8px); background-size: 7px 7px; background-position: center; background-repeat: space; opacity: .7; }
.ns-txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ns-card:hover { border-color: var(--acc); }
.ns-card.is-held { border: 2.5px solid var(--acc); box-shadow: 0 0 0 3px var(--tint); }
.ns-card.is-dragging { opacity: .45; }
.ns-card.is-right { border: 2.5px solid var(--correct); }
.ns-card.is-wrong { border: 2.5px dashed var(--wrong); }
.ns-mark { position: absolute; right: 8px; top: 8px; font: 700 17px "Lexend", sans-serif; }
.ns-card.is-right .ns-mark { color: var(--correct); }
.ns-card.is-wrong .ns-mark { color: var(--wrong); }
.ns-why { margin: 4px 2px 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.ns-why.is-wrong { color: var(--ink); padding: 6px 8px; border-radius: 8px; background: var(--wrong-bg); }
.ns-why b { color: var(--wrong); }
.ns-lanes { display: flex; flex-direction: column; gap: 12px; }
.ns-lane { position: relative; padding: 8px 10px 10px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--tint); }
.ns-lhd { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin: 0 0 6px; }
.ns-lname { margin: 0; font: 600 16px "Lexend", sans-serif; color: var(--heading); }
.ns-ends { display: flex; gap: 6px; font-size: 13.5px; color: var(--ink-soft); }
.ns-ends span + span::before { content: "→ "; }
.ns-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.ns-slot { min-width: 0; border-radius: 10px; }
.ns-slot.is-over { outline: 3px solid var(--acc); outline-offset: 1px; }
.ns-empty { width: 100%; min-height: 44px; border: 1.5px dashed var(--border); border-radius: 10px; background: var(--card); color: var(--ink-soft);
  font: 600 14px "Lexend", sans-serif; cursor: pointer; }
.ns.is-holding .ns-empty { border-color: var(--acc); background: var(--raised); }
.ns.is-wide .ns-slots { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
.ns.is-wide .ns-slot .ns-card { align-items: flex-start; padding-right: 26px; font-size: 14px; }
.ns.is-wide .ns-slot .ns-grip { width: 18px; }
.ns.is-wide .ns-empty { min-height: 72px; }
.ns:not(.is-wide) .ns-ends span:first-child::after { content: " (top)"; }
.ns:not(.is-wide) .ns-ends span + span::before { content: "↓ "; }
.ns-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ns-acts .ns-check { background: var(--acc-fill); border-color: var(--acc-fill); color: #FFFFFF; }
.ns-out { padding: 10px 12px; border-radius: 12px; background: var(--paper-deep); border-left: 5px solid var(--acc); scroll-margin-bottom: 16px; }
.ns-out[hidden] { display: none; }
.ns-out p { margin: 0 0 4px; line-height: 1.45; }
.ns-score { font-size: 16px; color: var(--heading); }
.ns-modes button:focus-visible, .ns-acts button:focus-visible, .ns-back:focus-visible, .ns-card:focus-visible, .ns-empty:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.ns-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ns-ghost { position: fixed; z-index: 1000; pointer-events: none; margin: 0; opacity: .95; box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 30px 8px 4px; box-sizing: border-box; border: 2.5px solid var(--acc); border-radius: 10px;
  background: var(--card); color: var(--ink); font: 15px/1.35 "Lexend", sans-serif; text-align: left; }
.ns-ghost .ns-grip { width: 26px; align-self: stretch; background-image: radial-gradient(var(--ink-soft) 1.6px, transparent 1.8px); background-size: 7px 7px; }
.ns-ghost .ns-mark { display: none; }
@media (max-width: 599px) {
  .fig-art > svg.ns-svg0 { width: calc(100% + 26px); max-width: none; margin: 0 -13px; }   /* static / no-JS view: 358 px */
}
@media (prefers-reduced-motion: reduce) { .ns-card, .ns-ghost { transition: none; } }
/* ---- END-NS */
/* ------------------------------------------------------------ info pages (About, Report, Privacy) */
.info-page { max-width: 720px; margin: 0 auto; padding-top: 8px; }
.info-title { margin: 8px 0 4px; color: var(--heading); }
.info-sec ul, .info-sec ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.info-sec p { margin: 0; }
.foot-links a { color: var(--foot-ink); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

/* ------------------------------------------------------------ Social Science accent */
:root { --tint-social: #FBEBD6; }
html[data-subject="social"] { --acc: var(--acc-social); --tint: var(--tint-social); --acc-fill: #A15C07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tint-social: rgba(242, 178, 92, .14); } }
:root[data-theme="dark"] { --tint-social: rgba(242, 178, 92, .14); }
.ch-row .ch-soon { white-space: normal; text-align: right; max-width: 42%; }
.foot-note a { color: var(--foot-ink); text-decoration: underline; text-underline-offset: 3px; }
