/* ==========================================================================
   Tamil Thinnai (தமிழ்த் திண்ணை) — visual system
   Peacock blue-green · Kanchipuram zari gold & silk magenta · turmeric/marigold ·
   kumkum temple red · banana-leaf green · temple sandstone on a warm jasmine-white ground.
   Tamil leads; English supports.
   ========================================================================== */

:root {
  --text-scale: 1;

  /* Surfaces & ink */
  --ground: #FFF8EE;
  --ground-2: #F9ECD8;
  --surface: #FFFFFF;
  --surface-2: #FFF5E6;
  --ink: #2B1514;
  --ink-2: #5C3F37;
  --ink-3: #785A4F;
  --line: #F0DEC4;
  --line-2: #DEC199;

  /* Brand */
  --peacock: #0A6B73;          /* மயில் — peacock blue-green: links, main buttons */
  --peacock-deep: #07434C;
  --peacock-soft: #DAF0EE;
  --on-peacock: #FFFFFF;
  --zari: #D9A21B;             /* ஜரிகை — Kanchipuram zari gold */
  --zari-deep: #875C00;
  --zari-soft: #FCEBC2;
  --marigold: #F5A30F;         /* சாமந்தி / மஞ்சள் — marigold & turmeric */
  --marigold-deep: #A65E00;
  --on-marigold: #2B1500;
  --kumkum: #B81D24;           /* குங்குமம் — temple red */
  --kumkum-deep: #8C1119;
  --kumkum-soft: #FBE0DC;
  --silk: #B3136B;             /* பட்டு — Kanchipuram silk magenta */
  --silk-deep: #7E0C4B;
  --silk-soft: #FBE2EF;
  --leaf: #276E2B;             /* வாழை இலை — banana leaf */
  --leaf-soft: #E0F2DA;
  --sandstone: #D8B88A;
  --sky: #BFE3EA;
  --panel: #0B4A52;            /* deep peacock panels (footer, lesson box) */

  /* Aliases kept for older code and other stylesheets (old names from the first version) */
  --teal: var(--peacock); --teal-deep: var(--peacock-deep); --teal-soft: var(--peacock-soft);
  --gold: var(--zari); --gold-deep: var(--zari-deep); --gold-soft: var(--zari-soft);
  --red: var(--kumkum); --red-soft: var(--kumkum-soft);

  --ring-track: #F2E4CE;
  --ring-fill: var(--peacock);
  --focus: #1F6FD1;
  --guide: #F5E7D0;
  --guide-line: #C9A36A;
  --ink-trace: #0A6B73;

  /* Kolam motif (rice-flour white on the threshold) */
  --kolam-ink: var(--zari);

  /* Scene: village morning */
  --sky-1: #8ED2DF; --sky-2: #FCEBCB; --sky-3: #FFC98C;
  --sun: #FFC247; --sun-glow: #FFE09A; --star: transparent;
  --cloud: #FFFFFF;
  --hill-far: #AFC6C3; --hill-mid: #8DB497; --mist: #FFF1DA;
  --gopuram: #E9CDA2; --gopuram-shade: #CFA877; --gopuram-line: #A67B4E; --gopuram-far: #EFD9B8; --gopuram-far-line: #CDAE85;
  --kalasam: #E0A51C; --niche-1: #4C9BC0; --niche-2: #D9557A; --niche-3: #5DA35A;
  --madil-red: #C23B2E; --madil-white: #FFF5E6;
  --earth: #D29A62; --earth-2: #B97D48; --lane: #E5B988;
  --field-1: #93C956; --field-2: #6DAE3A; --field-row: #B5DE72; --bund: #87A44A;
  --tank-1: #86CBCB; --tank-2: #2F8088; --tank-step: #DDC197; --tank-step-shade: #B8976A;
  --house-wall: #FFF7EA; --house-band: #B8432F; --house-roof: #B8552B; --house-roof-2: #92401D;
  --house-pillar: #6B3F22; --house-door: #5A2E14; --house-win: #3B2412; --thinnai: #C0623F; --thinnai-top: #D98A62;
  --thoranam: #3D8A2E; --kolam: #FFFFFF;
  --palmyra-trunk: #4A3326; --palmyra-leaf: #2F6B3E; --palmyra-near: #1C4A2A; --palmyra-dry: #A0804C; --palmyra-fruit: #2A1C14;
  --banana: #2E7A38; --banana-vein: #62A55C;
  --cart: #7A4A26; --cart-hood: #D9B77A; --bull: #F4EFE6; --bull-shade: #CFC4B4; --horn: #C23B2E;
  --ripple: rgba(255,255,255,.6); --sun-trail: rgba(255,236,190,.75);
  --bird: #4A3B36;
  --lamp-on: 0; --lamp-flame: #FFB23E; --win-light: #3B2412;

  /* Type */
  --f-display: "Baloo Thambi 2", "Noto Sans Tamil", system-ui, sans-serif;
  --f-ml: "Noto Sans Tamil", "Baloo Thambi 2", sans-serif;
  --f-ui: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Shape & motion */
  --r-sm: 12px; --r-md: 20px; --r-lg: 28px; --r-xl: 40px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(43,21,20,.06), 0 4px 14px rgba(43,21,20,.06);
  --shadow-2: 0 2px 6px rgba(43,21,20,.06), 0 16px 40px rgba(43,21,20,.12);
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --gutter: clamp(16px, 4vw, 40px);
  --rail-w: 244px;
  --top-h: 64px;
  --tab-h: 72px;
  color-scheme: light;
}

/* Moonlight: the temple at night, lit by oil lamps */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #150E1B; --ground-2: #1D1424; --surface: #231829; --surface-2: #2B1F32;
    --ink: #FBF0E2; --ink-2: #DCC9B8; --ink-3: #B09C90; --line: #3A2B40; --line-2: #4E3B55;
    --peacock: #56D0CB; --peacock-deep: #A2EAE4; --peacock-soft: #12383C; --on-peacock: #062326;
    --zari: #F0C35A; --zari-deep: #F7D68C; --zari-soft: #33260F;
    --marigold: #FFB23E; --marigold-deep: #FFC874; --kumkum: #FF8C80; --kumkum-deep: #FFB2A8; --kumkum-soft: #3E1A1D;
    --silk: #F287C0; --silk-deep: #F8B4D8; --silk-soft: #3A1731; --leaf: #87D38B; --leaf-soft: #193620; --sandstone: #6E5A48; --panel: #0F3136;
    --ring-track: #3A2B40; --focus: #7FB6FF; --guide: #2B1F32; --guide-line: #7E6A5C; --ink-trace: #56D0CB;
    --sky-1: #0A0D2A; --sky-2: #1F1846; --sky-3: #4A2C5A; --sun: #FFF3D6; --sun-glow: #9C8FD6; --star: #FFF3D0; --cloud: #3F3A66;
    --hill-far: #28284A; --hill-mid: #1D2634; --mist: #2B2550;
    --gopuram: #5C4B5C; --gopuram-shade: #473848; --gopuram-line: #2E2331; --gopuram-far: #3E3350; --gopuram-far-line: #2E2640;
    --kalasam: #F0C35A; --niche-1: #33506A; --niche-2: #5E3048; --niche-3: #2F4A36;
    --madil-red: #6A2530; --madil-white: #7E7084;
    --earth: #3C2A2A; --earth-2: #2E2022; --lane: #4A3634;
    --field-1: #1E3A26; --field-2: #16301F; --field-row: #2A4A30; --bund: #22301E;
    --tank-1: #22335A; --tank-2: #0C1530; --tank-step: #4E4050; --tank-step-shade: #3A2F3E;
    --house-wall: #8E8292; --house-band: #4E1E1C; --house-roof: #4E2418; --house-roof-2: #36170F;
    --house-pillar: #2A1A10; --house-door: #FFB23E; --house-win: #FFC766; --thinnai: #5A2E28; --thinnai-top: #6E3A32;
    --thoranam: #1E3A1A; --kolam: #F6EBDA;
    --palmyra-trunk: #150E12; --palmyra-leaf: #14261C; --palmyra-near: #0A140F; --palmyra-dry: #3A2E22; --palmyra-fruit: #0A0808;
    --banana: #0F2616; --banana-vein: #1E3E24;
    --cart: #2A1A12; --cart-hood: #5A4A34; --bull: #9E96A4; --bull-shade: #716A78; --horn: #6A2530;
    --ripple: rgba(200,190,255,.35); --sun-trail: rgba(255,236,200,.45);
    --bird: #B8B0D0; --lamp-on: 1; --win-light: #FFC766;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #150E1B; --ground-2: #1D1424; --surface: #231829; --surface-2: #2B1F32;
  --ink: #FBF0E2; --ink-2: #DCC9B8; --ink-3: #B09C90; --line: #3A2B40; --line-2: #4E3B55;
  --peacock: #56D0CB; --peacock-deep: #A2EAE4; --peacock-soft: #12383C; --on-peacock: #062326;
  --zari: #F0C35A; --zari-deep: #F7D68C; --zari-soft: #33260F;
  --marigold: #FFB23E; --marigold-deep: #FFC874; --kumkum: #FF8C80; --kumkum-deep: #FFB2A8; --kumkum-soft: #3E1A1D;
  --silk: #F287C0; --silk-deep: #F8B4D8; --silk-soft: #3A1731; --leaf: #87D38B; --leaf-soft: #193620; --sandstone: #6E5A48; --panel: #0F3136;
  --ring-track: #3A2B40; --focus: #7FB6FF; --guide: #2B1F32; --guide-line: #7E6A5C; --ink-trace: #56D0CB;
  --sky-1: #0A0D2A; --sky-2: #1F1846; --sky-3: #4A2C5A; --sun: #FFF3D6; --sun-glow: #9C8FD6; --star: #FFF3D0; --cloud: #3F3A66;
  --hill-far: #28284A; --hill-mid: #1D2634; --mist: #2B2550;
  --gopuram: #5C4B5C; --gopuram-shade: #473848; --gopuram-line: #2E2331; --gopuram-far: #3E3350; --gopuram-far-line: #2E2640;
  --kalasam: #F0C35A; --niche-1: #33506A; --niche-2: #5E3048; --niche-3: #2F4A36;
  --madil-red: #6A2530; --madil-white: #7E7084;
  --earth: #3C2A2A; --earth-2: #2E2022; --lane: #4A3634;
  --field-1: #1E3A26; --field-2: #16301F; --field-row: #2A4A30; --bund: #22301E;
  --tank-1: #22335A; --tank-2: #0C1530; --tank-step: #4E4050; --tank-step-shade: #3A2F3E;
  --house-wall: #8E8292; --house-band: #4E1E1C; --house-roof: #4E2418; --house-roof-2: #36170F;
  --house-pillar: #2A1A10; --house-door: #FFB23E; --house-win: #FFC766; --thinnai: #5A2E28; --thinnai-top: #6E3A32;
  --thoranam: #1E3A1A; --kolam: #F6EBDA;
  --palmyra-trunk: #150E12; --palmyra-leaf: #14261C; --palmyra-near: #0A140F; --palmyra-dry: #3A2E22; --palmyra-fruit: #0A0808;
  --banana: #0F2616; --banana-vein: #1E3E24;
  --cart: #2A1A12; --cart-hood: #5A4A34; --bull: #9E96A4; --bull-shade: #716A78; --horn: #6A2530;
  --ripple: rgba(200,190,255,.35); --sun-trail: rgba(255,236,200,.45);
  --bird: #B8B0D0; --lamp-on: 1; --win-light: #FFC766;
}
:root[data-contrast="high"] {
  --ink: #000; --ink-2: #1A1A1A; --ink-3: #333; --line: #555; --line-2: #222;
  --peacock: #004A52; --peacock-deep: #00303A; --zari-deep: #634300; --marigold-deep: #8A4F00; --kumkum: #8A0F14; --silk: #7E0C4B; --leaf: #1B5E22; --focus: #0040C0; --panel: #00303A;
  --ground: #FFFFFF; --ground-2: #F2F2F2; --surface: #FFFFFF; --surface-2: #F7F7F7;
}
:root[data-theme="dark"][data-contrast="high"] { --ink: #FFF; --ink-2: #EEE; --ink-3: #DDD; --line: #AAA; --ground: #000; --surface: #0A0A0A; --surface-2: #111; --peacock: #8FF0EA; --zari-deep: #FFE2A0; --kumkum: #FFB0A6; --focus: #9CC8FF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-contrast="high"] { --ink: #FFF; --ink-2: #EEE; --ink-3: #DDD; --line: #AAA; --ground: #000; --surface: #0A0A0A; --surface-2: #111; --peacock: #8FF0EA; --zari-deep: #FFE2A0; --kumkum: #FFB0A6; --focus: #9CC8FF; }
}

/* ---- Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(100% * var(--text-scale)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.55 var(--f-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; margin: 0; text-wrap: balance; font-weight: 700; }
p { margin: 0; }
a { color: var(--peacock); }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
.ml, [lang="ta"] { font-family: var(--f-ml); line-height: 1.6; }
h1 .ml, h2 .ml, .ml.big-inline, .ltile-glyph, .ls-glyph, .hero-title, .intro-glyph, .bubble, .tile, .now-letter, .done-glyph, .trace-demo, .try-letter, .fl, .eq-part, .eq-word, .lesson-glyph, .pl-glyph, .match-word, .slot .tile, .vocab-ml { font-family: var(--f-display); }
.en { color: var(--ink-2); }
.hide-translit .translit { display: none !important; }
.hide-english .en, .hide-english .vocab-en, .hide-english .pick-en { visibility: hidden; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.select { user-select: all; font-weight: 600; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-2); }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }
.icon { width: 1.35em; height: 1.35em; flex: none; }

/* ---- Buttons & controls --------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 48px; padding: .6em 1.25em; border-radius: var(--r-pill); border: 2px solid transparent; background: var(--peacock); color: var(--on-peacock); font: 600 1rem/1.2 var(--f-ui); text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--primary { background: var(--marigold); color: var(--on-marigold); box-shadow: 0 3px 0 var(--marigold-deep); }
.btn--primary:hover { box-shadow: 0 4px 0 var(--marigold-deep), 0 10px 24px rgba(245,163,15,.3); }
.btn--ghost { background: transparent; color: var(--peacock); border-color: var(--line-2); }
.btn--glass { background: rgba(255,255,255,.72); color: var(--peacock-deep); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: rgba(255,255,255,.8); }
.btn--big { min-height: 58px; padding: .7em 1.6em; font-size: 1.08rem; }
.btn--small { min-height: 40px; padding: .4em .95em; font-size: .92rem; }
.btn--block { width: 100%; }
.btn .ml { font-weight: 700; font-size: 1.12em; line-height: 1; padding-top: .12em; }
.btn-sep { opacity: .45; }
.btn--say { background: var(--zari-soft); color: var(--ink); border-color: var(--zari); }
.is-rec { background: var(--kumkum) !important; color: #fff !important; border-color: var(--kumkum) !important; animation: pulse 1s infinite; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: var(--ground-2); color: var(--ink); }
.link, .link-btn { color: var(--peacock); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: .2em .7em; border-radius: var(--r-pill); background: var(--ground-2); color: var(--ink-2); font: 600 .78rem/1.5 var(--f-ui); white-space: nowrap; vertical-align: middle; }
.chip .icon { width: 1.1em; height: 1.1em; }
.chip--good { background: var(--leaf-soft); color: var(--leaf); }
.chip--warn { background: var(--zari-soft); color: var(--zari-deep); }
.chip--here { background: var(--marigold); color: var(--on-marigold); }
.chip--teacher { background: var(--peacock-soft); color: var(--peacock); }
.soon { font: 700 .62rem/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; padding: .35em .55em; border-radius: var(--r-pill); background: var(--zari-soft); color: var(--zari-deep); }
.eyebrow { font: 700 .78rem/1.3 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--zari-deep); margin-bottom: .5rem; }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; }
.h-en { font-family: var(--f-ui); font-weight: 600; font-size: .55em; color: var(--ink-2); letter-spacing: 0; }

/* Speaker */
.speaker { position: relative; display: inline-grid; place-items: center; border-radius: 50%; border: 0; cursor: pointer; background: transparent; color: var(--marigold-deep); transition: transform .2s var(--spring), color .2s; vertical-align: middle; flex: none; }
.speaker:hover { transform: scale(1.12); color: var(--marigold); }
.speaker .icon { filter: drop-shadow(0 1px 0 rgba(0,0,0,.08)); }
.speaker--sm { width: 36px; height: 36px; } .speaker--sm .icon { width: 24px; height: 24px; }
.speaker--md { width: 48px; height: 48px; } .speaker--md .icon { width: 30px; height: 30px; }
.speaker--lg { width: 64px; height: 64px; } .speaker--lg .icon { width: 40px; height: 40px; }
.speaker--glass { background: rgba(255,255,255,.8); color: var(--peacock-deep); box-shadow: 0 6px 20px rgba(7,67,76,.18); backdrop-filter: blur(8px); }
.speaker-waves { position: absolute; inset: 0; pointer-events: none; }
.speaker-waves i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--marigold); opacity: 0; }
.is-playing .speaker-waves i, .speaker.is-playing .speaker-waves i { animation: wave 1.4s var(--ease) infinite; }
.speaker-waves i:nth-child(2) { animation-delay: .35s !important; } .speaker-waves i:nth-child(3) { animation-delay: .7s !important; }
@keyframes wave { from { transform: scale(1); opacity: .6; } to { transform: scale(1.9); opacity: 0; } }

.audio-controls { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); }
.audio-btn { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 .9em; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font: 600 .9rem var(--f-ui); cursor: pointer; }
.audio-btn:hover { background: var(--ground-2); color: var(--ink); }
.audio-btn--main { background: var(--peacock); color: var(--on-peacock); }
.audio-btn--main:hover { background: var(--peacock-deep); color: #fff; }
:root[data-theme="dark"] .audio-btn--main, :root[data-theme="dark"] .audio-btn--main:hover { color: #06231F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .audio-btn--main, :root:not([data-theme="light"]) .audio-btn--main:hover { color: #06231F; } }
.audio-controls.is-playing .audio-btn--main { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(10,107,115,.35); } 50% { box-shadow: 0 0 0 8px rgba(10,107,115,0); } }

/* Pictures */
.picture { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 42%, var(--surface) 0 38%, var(--zari-soft) 70%); position: relative; max-width: 100%; }
.picture svg, .picture img { width: 82%; height: 82%; object-fit: contain; border-radius: 18%; }
.picture-emoji { font-size: 3.6rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.12)); }
.picture--xs { width: 48px; } .picture--xs .picture-emoji { font-size: 1.7rem; }
.picture--sm { width: 84px; } .picture--sm .picture-emoji { font-size: 2.6rem; }
.picture--md { width: 128px; }
.picture--lg { width: 168px; } .picture--lg .picture-emoji { font-size: 5rem; }
.picture-text { font: 800 3rem/1 var(--f-display); color: var(--peacock-deep); letter-spacing: -.02em; }
.picture--xs .picture-text { font-size: 1.3rem; } .picture--sm .picture-text { font-size: 2rem; } .picture--lg .picture-text { font-size: 4.4rem; }

/* Rings, stars, medals */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring circle:last-child { transition: stroke-dashoffset 1s var(--ease); }
.ring-label { font: 700 .82rem var(--f-ui); color: var(--ink-2); }
.stars { display: inline-flex; gap: 4px; }
.stars .icon { width: 40px; height: 40px; stroke-width: 1.2; }
.stars .on { color: var(--marigold); stroke: var(--marigold-deep); }
.stars .off { color: var(--line); stroke: var(--line-2); }
.medal { position: relative; display: grid; place-items: center; flex: none; }
.medal--sm { width: 40px; height: 40px; } .medal--md { width: 76px; height: 76px; } .medal--lg { width: 104px; height: 104px; }
.medal-bloom { position: absolute; inset: 0; } .medal-bloom svg { width: 100%; height: 100%; }
.medal.is-earned .medal-bloom { animation: spin 60s linear infinite; }
.medal-core { position: relative; display: grid; place-items: center; width: 52%; height: 52%; border-radius: 50%; background: var(--surface); color: var(--peacock); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.medal-core .icon { width: 58%; height: 58%; }
.medal.is-locked .medal-core { color: var(--ink-3); }
.medal.is-locked { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts & petals */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; width: min(520px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; padding: 14px 18px; border-radius: 18px; background: var(--ink); color: var(--ground); box-shadow: var(--shadow-2); font-weight: 500; animation: toastIn .35s var(--spring); }
.toast .link-btn { color: inherit; }
.toast--good { background: var(--panel); color: #fff; }
.toast--warn { background: #5A3B0C; color: #FFF3DD; }
.toast.out { opacity: 0; transform: translateY(10px); transition: .35s; }
.toast-badge { display: flex; align-items: center; gap: 12px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 95; }
.petals i { position: absolute; width: 10px; height: 16px; border-radius: 60% 40% 60% 40%; animation: petal 1.2s var(--ease) forwards; }
@keyframes petal { to { transform: translate(var(--dx), calc(var(--dy) + 60px)) rotate(var(--r)); opacity: 0; } }

/* ---- Shell ---------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-text { display: grid; line-height: 1.05; }
.brand-mark { display: grid; place-items: center; flex: none; }
.brand-ml { font: 800 1.22rem/1.2 var(--f-display); color: var(--silk-deep); padding-top: .1em; }
.brand-en { font: 700 .7rem/1.2 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--peacock); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--ground) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--top-h); padding-inline: var(--gutter); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.userchip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; min-height: 44px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--zari-soft); font-size: 1.2rem; box-shadow: inset 0 0 0 2px var(--zari); flex: none; }
.userchip-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shell { min-height: 100vh; }
.main { width: 100%; min-width: 0; max-width: 1120px; margin: 0 auto; padding: 24px var(--gutter) calc(var(--tab-h) + 40px + env(safe-area-inset-bottom, 0px)); outline: none; }
.main--wide { max-width: 1240px; }
.rail { display: none; }
.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(43,21,20,.06); }
.tab-link { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 58px; border-radius: 16px; border: 0; background: none; color: var(--ink-3); text-decoration: none; cursor: pointer; }
.tab-link .icon { width: 26px; height: 26px; }
.tab-link .nav-label { display: grid; justify-items: center; line-height: 1.1; }
.tab-link .nav-label .ml { font-size: .78rem; font-weight: 600; }
.tab-link .nav-label .en { display: none; }
.tab-link .soon { display: none; }
.tab-link.is-active { color: var(--peacock); background: var(--peacock-soft); }
@media (min-width: 960px) {
  .shell:not(.shell--guest) { display: grid; grid-template-columns: var(--rail-w) 1fr; grid-template-rows: auto 1fr; }
  .shell:not(.shell--guest) .topbar { grid-column: 1 / -1; }
  .rail { display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; border-right: 1px solid var(--line); }
  .rail-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; color: var(--ink-2); text-decoration: none; }
  .rail-link:hover { background: var(--ground-2); color: var(--ink); }
  .rail-link.is-active { background: var(--peacock-soft); color: var(--peacock-deep); }
  .rail-link .nav-label { display: grid; line-height: 1.2; flex: 1; }
  .rail-link .nav-label .ml { font-weight: 600; font-size: .98rem; }
  .rail-link .nav-label .en { font-size: .78rem; }
  .tabbar { display: none; }
  .main { padding-bottom: 64px; }
}
.guest-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; padding: 12px 18px; margin-bottom: 20px; border-radius: 18px; background: var(--zari-soft); color: var(--ink); font-weight: 500; }
.shell--guest .main { padding-bottom: 64px; }

/* Sheets */
.sheet { border: 0; padding: 0; border-radius: 28px 28px 0 0; width: 100%; max-width: 560px; margin: auto auto 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); max-height: 88vh; }
@media (min-width: 700px) { .sheet { border-radius: 28px; margin: auto; } }
.sheet::backdrop { background: rgba(30,12,16,.45); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheetIn .35s var(--spring); }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 18px 6px 24px; }
.sheet-head h2 { font-size: 1.35rem; }
.settings, .account { display: grid; gap: 18px; padding: 8px 24px 28px; }
.account { gap: 12px; }
.seg { border: 0; padding: 0; margin: 0; }
.seg legend { font-weight: 600; margin-bottom: 8px; }
.seg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; }
.seg-opt span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 2px solid var(--line); cursor: pointer; font-weight: 600; }
.seg-opt input:checked + span { border-color: var(--peacock); background: var(--peacock-soft); color: var(--peacock-deep); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.settings-note { font-size: .9rem; color: var(--ink-2); padding: 12px 14px; background: var(--surface-2); border-radius: 14px; }
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 8px 20px 28px; }
.more-link { display: grid; gap: 2px; padding: 16px; border-radius: 20px; background: var(--surface-2); text-decoration: none; color: var(--ink); position: relative; }
.more-link .icon { color: var(--peacock); width: 28px; height: 28px; margin-bottom: 6px; }
.more-link .ml { font-weight: 600; } .more-link .en { font-size: .85rem; }
.more-link .soon { position: absolute; top: 12px; right: 12px; }

/* ---- Kolam motif ------------------------------------------------------- */
/* A chain kolam: two lines weaving around a row of rice-flour dots. Drawn as a mask so it takes any colour. */
:root {
  --kolam-chain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32' viewBox='0 0 64 32'%3E%3Cpath d='M0 16C8 3 24 3 32 16S56 29 64 16M0 16C8 29 24 29 32 16S56 3 64 16' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='2.8'/%3E%3Ccircle cx='48' cy='16' r='2.8'/%3E%3Ccircle cx='32' cy='4' r='1.7'/%3E%3Ccircle cx='32' cy='28' r='1.7'/%3E%3C/svg%3E");
  --kolam-flower: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M24 24C18 16 18 8 24 4 30 8 30 16 24 24 32 18 40 18 44 24 40 30 32 30 24 24 30 32 30 40 24 44 18 40 18 32 24 24 16 30 8 30 4 24 8 18 16 18 24 24Z'/%3E%3Ccircle cx='24' cy='24' r='15' stroke-dasharray='3 5'/%3E%3C/g%3E%3Cg%3E%3Ccircle cx='24' cy='24' r='2.4'/%3E%3Ccircle cx='13' cy='13' r='2'/%3E%3Ccircle cx='35' cy='13' r='2'/%3E%3Ccircle cx='13' cy='35' r='2'/%3E%3Ccircle cx='35' cy='35' r='2'/%3E%3C/g%3E%3C/svg%3E");
}
.kolam-divider { height: 22px; margin: 0 auto; max-width: 1160px; background: var(--kolam-ink); opacity: .75;
  -webkit-mask: var(--kolam-chain) repeat-x center / 44px 22px; mask: var(--kolam-chain) repeat-x center / 44px 22px; }
.kolam-divider--peacock { background: var(--peacock); } .kolam-divider--silk { background: var(--silk); }
.kolam-loader { display: inline-block; width: 48px; height: 48px; background: var(--kolam-ink, var(--zari));
  -webkit-mask: var(--kolam-flower) center / contain no-repeat; mask: var(--kolam-flower) center / contain no-repeat; animation: kolamSpin 2.4s var(--ease) infinite; }
.kolam-loader--sm { width: 24px; height: 24px; }
@keyframes kolamSpin { 0% { transform: rotate(0) scale(.9); opacity: .6; } 50% { transform: rotate(45deg) scale(1); opacity: 1; } 100% { transform: rotate(90deg) scale(.9); opacity: .6; } }
/* Kanchipuram silk border: magenta body between two zari lines */
.silk-border { height: 10px; background: linear-gradient(var(--zari) 0 2px, var(--silk) 2px 8px, var(--zari) 8px 10px); }

/* ---- Scene ------------------------------------------------------------- */
.tn-scene { display: block; width: 100%; height: 100%; }
.tn-scene .sun { fill: var(--sun); }
.tn-scene .star { fill: var(--star); }
.tn-scene .cloud { fill: var(--cloud); opacity: .85; } .tn-scene .cloud.soft { opacity: .6; }
.tn-scene .hill-far { fill: var(--hill-far); } .tn-scene .hill-mid { fill: var(--hill-mid); }
/* gopuram */
.tn-scene .g-body { fill: var(--gopuram); } .tn-scene .g-shade { fill: var(--gopuram-shade); opacity: .55; }
.tn-scene .g-ledge { fill: var(--gopuram-shade); } .tn-scene .g-line { stroke: var(--gopuram-line); stroke-width: 1.4; opacity: .5; fill: none; }
.tn-scene .g-door { fill: var(--house-door); }
.tn-scene .g-crown { fill: var(--gopuram); stroke: var(--gopuram-shade); stroke-width: 2; } .tn-scene .g-horn { fill: var(--gopuram-shade); }
.tn-scene .g-niche { opacity: .8; } .tn-scene .n1 { fill: var(--niche-1); } .tn-scene .n2 { fill: var(--niche-2); } .tn-scene .n3 { fill: var(--niche-3); }
.tn-scene .kalasam { fill: var(--kalasam); }
.tn-scene .gopuram .lamps { fill: var(--lamp-flame); opacity: var(--lamp-on); filter: drop-shadow(0 0 3px var(--lamp-flame)); }
.tn-scene .gopuram.far .g-body, .tn-scene .gopuram.far .g-crown, .tn-scene .gopuram.far .g-ledge { fill: var(--gopuram-far); stroke: none; }
.tn-scene .gopuram.far .g-shade, .tn-scene .gopuram.far .g-horn { fill: var(--gopuram-far-line); opacity: .5; }
.tn-scene .gopuram.far .g-line { stroke: var(--gopuram-far-line); }
.tn-scene .m-white { fill: var(--madil-white); } .tn-scene .m-red { fill: var(--madil-red); } .tn-scene .m-cap { fill: var(--gopuram-shade); }
/* ground, fields, lane */
.tn-scene .fld-1 { fill: var(--field-1); } .tn-scene .fld-2 { fill: var(--field-2); }
.tn-scene .fld-row { fill: none; stroke: var(--field-row); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.tn-scene .bund { fill: none; stroke: var(--bund); stroke-width: 5; stroke-linecap: round; }
.tn-scene .lane, .tn-scene .road { fill: var(--lane); } .tn-scene .yard { fill: var(--earth); }
/* house with its thinnai */
.tn-scene .house-wall { fill: var(--house-wall); } .tn-scene .house-band { fill: var(--house-band); }
.tn-scene .house-win { fill: var(--house-win); } .tn-scene .house-bars { stroke: var(--house-pillar); stroke-width: 2; }
.tn-scene .house-door { fill: var(--house-door); } .tn-scene .house-frame { fill: none; stroke: var(--house-pillar); stroke-width: 3; }
.tn-scene .thinnai { fill: var(--thinnai); } .tn-scene .thinnai-top { fill: var(--thinnai-top); } .tn-scene .house-step { fill: var(--thinnai-top); }
.tn-scene .house-pillar { fill: var(--house-pillar); }
.tn-scene .house-roof { fill: var(--house-roof); } .tn-scene .house-tiles { stroke: var(--house-roof-2); stroke-width: 2.4; fill: none; opacity: .75; }
.tn-scene .house-eave { stroke: var(--house-roof-2); stroke-width: 4; stroke-linecap: round; }
.tn-scene .thoranam-string { fill: none; stroke: var(--house-pillar); stroke-width: 1.2; } .tn-scene .thoranam { fill: var(--thoranam); }
.tn-scene .g-kolam .k-line { stroke: var(--kolam); stroke-width: 2.8; }
.tn-scene .g-kolam .k-dots { fill: var(--kolam); }
.tn-scene .agal .clay { fill: var(--house-band); } .tn-scene .agal .flame { fill: var(--lamp-flame); transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.6s ease-in-out infinite alternate; }
.tn-scene .agal .glow { fill: var(--lamp-flame); opacity: calc(var(--lamp-on) * .28); }
.tn-scene .flowers .fl-leaf { fill: none; stroke: var(--banana); stroke-width: 3; stroke-linecap: round; }
.tn-scene .flowers .mg { fill: var(--marigold); } .tn-scene .flowers .jm { fill: #FFFDF5; }
/* palmyra palms */
.tn-scene .palmyra .trunk { fill: var(--palmyra-trunk); }
.tn-scene .palmyra .ring { fill: none; stroke: rgba(0,0,0,.25); stroke-width: 1.5; }
.tn-scene .palmyra .dry { fill: var(--palmyra-dry); }
.tn-scene .palmyra .fans { fill: var(--palmyra-leaf); } .tn-scene .palmyra .stalk { fill: none; stroke: var(--palmyra-leaf); stroke-width: 2.4; stroke-linecap: round; }
.tn-scene .palmyra .fruit { fill: var(--palmyra-fruit); }
.tn-scene .palmyra.far { opacity: .55; }
.tn-scene .palmyra.near .trunk { fill: var(--palmyra-fruit); } .tn-scene .palmyra.near .fans { fill: var(--palmyra-near); } .tn-scene .palmyra.near .stalk { stroke: var(--palmyra-near); stroke-width: 5; }
.tn-scene .banana path { fill: var(--banana); } .tn-scene .banana .vein { fill: none; stroke: var(--banana-vein); stroke-width: 3; } .tn-scene .banana .stem { fill: var(--palmyra-trunk); }
/* temple tank */
.tn-scene .tk-step { fill: var(--tank-step); } .tn-scene .tk-shade { fill: var(--tank-step-shade); }
.tn-scene .sun-trail rect { fill: var(--sun-trail); }
.tn-scene .ripples path { fill: none; stroke: var(--ripple); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 34 26; animation: ripple 7s linear infinite; }
/* bullock cart */
.tn-scene .b-body { fill: var(--bull); } .tn-scene .bull.far .b-body, .tn-scene .bull.far .b-leg { fill: var(--bull-shade); }
.tn-scene .b-leg { fill: var(--bull-shade); } .tn-scene .b-horn { fill: var(--horn); } .tn-scene .b-tail { fill: none; stroke: var(--bull-shade); stroke-width: 2.5; stroke-linecap: round; }
.tn-scene .c-yoke { stroke: var(--cart); stroke-width: 5; stroke-linecap: round; }
.tn-scene .c-bed { fill: var(--cart); } .tn-scene .c-hood { fill: var(--cart-hood); } .tn-scene .c-weave { fill: none; stroke: var(--cart); stroke-width: 2; opacity: .45; }
.tn-scene .c-wheel circle { fill: none; stroke: var(--cart); stroke-width: 4; } .tn-scene .c-wheel path { stroke: var(--cart); stroke-width: 2.5; } .tn-scene .c-wheel .hub { fill: var(--cart); }
.tn-scene .birds path { fill: none; stroke: var(--bird); stroke-width: 2.5; stroke-linecap: round; }
/* motion */
.tn-scene .layer { transition: transform .1s linear; will-change: transform; }
.tn-scene .sway { transform-box: view-box; animation: sway 7s ease-in-out infinite alternate; }
.tn-scene .drift { animation: drift 140s linear infinite; }
.tn-scene .cart-drift { animation: cart 90s ease-in-out infinite alternate; }
.tn-scene .bird-drift { animation: birds 60s linear infinite; }
@keyframes sway { from { transform: rotate(-1.4deg); } to { transform: rotate(1.6deg); } }
@keyframes drift { from { transform: translateX(-120px); } to { transform: translateX(160px); } }
@keyframes cart { from { transform: translateX(120px); } to { transform: translateX(-260px); } }
@keyframes birds { from { transform: translateX(-500px); } to { transform: translateX(1200px); } }
@keyframes ripple { to { stroke-dashoffset: -120; } }

/* ---- Landing ------------------------------------------------------------- */
.landing { background: var(--ground); }
.hero { position: relative; min-height: clamp(640px, 100svh, 940px); display: grid; grid-template-rows: auto 1fr; overflow: hidden; isolation: isolate; }
.hero-scene { position: absolute; inset: 0; z-index: -3; }
.float-layer { position: absolute; inset: 0 0 14% 0; z-index: -1; pointer-events: none; }
.fl { position: absolute; left: 0; top: 0; font-weight: 700; line-height: 1; color: rgba(255,255,255,.95); text-shadow: 0 2px 0 rgba(217,162,27,.6), 0 10px 30px rgba(179,19,107,.22); user-select: none; will-change: transform; }
.fl--near { pointer-events: auto; cursor: pointer; }
.fl--pop { animation: flpop .6s var(--spring); }
@keyframes flpop { 50% { color: var(--marigold); scale: 1.3; } }
.hero-veil { position: absolute; inset: 0; z-index: -2; background: radial-gradient(ellipse 58% 72% at 22% 48%, rgba(255,248,238,.9), rgba(255,248,238,.5) 52%, rgba(255,248,238,0) 76%); pointer-events: none; }
:root[data-theme="dark"] .hero-veil { background: radial-gradient(ellipse 64% 70% at 26% 46%, rgba(21,14,27,.78), rgba(21,14,27,.35) 55%, transparent 76%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-veil { background: radial-gradient(ellipse 64% 70% at 26% 46%, rgba(21,14,27,.78), rgba(21,14,27,.35) 55%, transparent 76%); } }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: max(18px, env(safe-area-inset-top)) var(--gutter) 0; }
.hero-top .brand-ml { color: var(--silk-deep); }
.hero-content { align-self: center; padding: 20px var(--gutter) 128px; max-width: 900px; display: grid; gap: 16px; justify-items: start; animation: rise 1s var(--ease) both; }
.hero-eyebrow { font: 700 .8rem/1.2 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--kumkum-deep); background: rgba(255,255,255,.72); padding: 8px 14px; border-radius: var(--r-pill); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(217,162,27,.35); }
.hero-title-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-title { font-size: clamp(3.2rem, 1.8rem + 6vw, 6.6rem); font-weight: 800; line-height: 1.1; color: var(--silk-deep); letter-spacing: 0; text-shadow: 0 2px 0 rgba(255,255,255,.7), 0 12px 40px rgba(255,236,200,.95); padding-top: .12em; }
.hero-title::after { content: ""; display: block; height: 12px; width: 62%; margin-top: 2px; background: var(--zari); -webkit-mask: var(--kolam-chain) repeat-x left center / 24px 12px; mask: var(--kolam-chain) repeat-x left center / 24px 12px; }
.hero-sub { display: grid; gap: 0; font: 700 clamp(1.35rem, 1.05rem + 1.1vw, 1.9rem)/1.35 var(--f-display); color: var(--peacock-deep); }
.hero-sub .en { font: 600 1rem/1.4 var(--f-ui); color: var(--ink-2); }
.hero-lines { display: flex; flex-wrap: wrap; gap: 2px 14px; font: 700 clamp(1.1rem, .95rem + .6vw, 1.4rem)/1.3 var(--f-display); color: var(--ink); }
.hero-lines span:nth-child(2) { color: var(--kumkum); } .hero-lines span:nth-child(3) { color: var(--peacock); }
.hero-school { display: flex; gap: 10px; align-items: flex-start; max-width: 54ch; padding: 10px 14px; border-radius: 18px; background: rgba(255,255,255,.66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--ink-2); font-size: .98rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.8); }
.hero-school .icon { color: var(--silk); margin-top: 2px; } .hero-school b { color: var(--ink); } .hero-school .ml { font-weight: 700; color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero-skills { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; list-style: none; padding: 0; margin: 4px 0 0; }
.hero-skills li { display: flex; align-items: center; gap: 6px; }
.hero-skills .dot { color: var(--kumkum); font-weight: 700; }
.skill-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px 4px 10px; border-radius: var(--r-pill); border: 1px solid rgba(255,255,255,.8); background: rgba(255,255,255,.72); backdrop-filter: blur(8px); cursor: pointer; color: var(--peacock-deep); }
.skill-pill .icon { color: var(--silk); }
.skill-pill .ml { font-weight: 700; font-size: 1.05rem; line-height: 1; padding-top: .15em; }
.skill-pill .en { font-size: .8rem; }
.hero-kolam { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: var(--ground); }
.hero-kolam::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; background: linear-gradient(var(--zari) 0 2px, var(--silk) 2px 8px, var(--zari) 8px 10px); }
.hero-kolam::after { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 22px; background: var(--kolam-ink); opacity: .8; -webkit-mask: var(--kolam-chain) repeat-x center / 44px 22px; mask: var(--kolam-chain) repeat-x center / 44px 22px; }
:root[data-theme="dark"] :is(.hero-eyebrow, .skill-pill, .btn--glass, .hero-school) { background: rgba(21,14,27,.62); color: var(--ink); border-color: rgba(255,255,255,.16); box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.hero-eyebrow, .skill-pill, .btn--glass, .hero-school) { background: rgba(21,14,27,.62); color: var(--ink); border-color: rgba(255,255,255,.16); box-shadow: none; } }
:root[data-theme="dark"] :is(.hero-eyebrow) { color: var(--zari-deep); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-eyebrow { color: var(--zari-deep); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@media (max-width: 640px) {
  .hero-content { align-self: start; padding-top: 22px; gap: 12px; }
  .hero-skills .dot { display: none; }
  .hero-eyebrow { letter-spacing: .06em; font-size: .7rem; }
  .skill-pill { min-height: 40px; padding: 2px 12px 2px 8px; }
  .hero-cta .btn { width: 100%; }
  .hero-veil { background: linear-gradient(rgba(255,248,238,.88), rgba(255,248,238,.62) 55%, rgba(255,248,238,0) 80%); }
  .hero-top .btn { display: none; }
  .hero-school { font-size: .9rem; padding: 8px 12px; }
  .hero-eyebrow { letter-spacing: .03em; font-size: .66rem; padding: 7px 12px; }
  .hero-title-row { flex-wrap: nowrap; gap: 10px; }
  .hero-title { font-size: clamp(2.6rem, 1rem + 9vw, 3.4rem); }
  .hero-title-row .speaker--lg { width: 52px; height: 52px; } .hero-title-row .speaker--lg .icon { width: 32px; height: 32px; }
  .hero-lines { font-size: 1.02rem; gap: 0 10px; }
  .hero-cta .btn--big { font-size: 1rem; padding-inline: 1em; min-height: 54px; }
  .hero-content { padding-bottom: 150px; }
  .hero-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .hero-skills .skill-pill { width: 100%; padding-inline: 8px; gap: 5px; }
  .hero-skills .skill-pill .icon { width: 1.1em; height: 1.1em; }
  .hero-skills .skill-pill .ml { font-size: .94rem; }
  .hero-skills .skill-pill .en { font-size: .72rem; }
  /* show the scene at a size where the house, kolam and gopuram all fit */
  .hero-scene { background: linear-gradient(var(--sky-1), var(--sky-2) 70%, var(--sky-3)); }
  .hero-scene .tn-scene { position: absolute; bottom: 0; left: 50%; width: 250%; min-width: 900px; height: auto; transform: translateX(calc(-50% - 90px)); }
}
@media (max-width: 640px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-veil { background: linear-gradient(rgba(21,14,27,.82), rgba(21,14,27,.55) 62%, transparent 88%); } }
@media (max-width: 640px) { :root[data-theme="dark"] .hero-veil { background: linear-gradient(rgba(21,14,27,.82), rgba(21,14,27,.55) 62%, transparent 88%); } }

.band { padding-block: clamp(56px, 8vw, 104px); }
.band-inner { max-width: 1160px; margin: 0 auto; padding-inline: var(--gutter); }
.band h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); margin-bottom: 14px; }
.band--try { background: var(--ground); }
.try { display: grid; gap: 40px; align-items: center; }
@media (min-width: 880px) { .try { grid-template-columns: 1fr 1.1fr; } }
.try-copy { display: grid; gap: 14px; justify-items: start; }
.try-copy h2 { color: var(--silk-deep); }
.try-stage { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 28px; border-radius: var(--r-xl); background: var(--panel); background-image: radial-gradient(circle at 18% 28%, rgba(217,162,27,.3), transparent 50%), radial-gradient(circle at 92% 90%, rgba(179,19,107,.35), transparent 45%); overflow: hidden; isolation: isolate; box-shadow: inset 0 -10px 0 -4px rgba(217,162,27,.9); }
.try-stage::before { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; z-index: -1; opacity: .14; background: #fff; -webkit-mask: var(--kolam-flower) center / contain no-repeat; mask: var(--kolam-flower) center / contain no-repeat; }
@media (max-width: 560px) { .try-stage { grid-template-columns: 1fr; justify-items: center; } }
.try-letter { width: 160px; height: 160px; border-radius: 42px; border: 0; background: var(--zari-soft); color: var(--silk-deep); font-size: 5.4rem; line-height: 1; font-weight: 800; cursor: pointer; box-shadow: 0 6px 0 var(--zari), 0 20px 40px rgba(0,0,0,.25); transition: transform .25s var(--spring); padding-top: .15em; }
:root[data-theme="dark"] .try-letter { background: #FCEBC2; color: #7E0C4B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .try-letter { background: #FCEBC2; color: #7E0C4B; } }
.try-letter:hover { transform: rotate(-4deg) scale(1.04); }
.try-letter:active { transform: scale(.94); }
.try-words { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.try-word { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border: 0; border-radius: 24px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; transition: background .2s, transform .2s var(--spring); animation: rise .7s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 200ms); }
.try-word:hover { background: rgba(255,255,255,.16); transform: translateY(-3px); }
.try-word .ml { font-size: 1.3rem; font-weight: 700; } .try-word .en { color: rgba(255,255,255,.8); font-size: .85rem; }
.try-word .picture { background: radial-gradient(circle, #fff 0 40%, #FCEBC2 72%); }

.band--journey { position: relative; padding-top: 0; background: linear-gradient(var(--ground), var(--peacock-soft) 30%, var(--ground)); }
.band--journey > .kolam-divider { margin-bottom: clamp(40px, 6vw, 72px); }
.band--journey .lede { margin-bottom: 8px; }
.river { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 18px; position: relative; }
.river::before { content: ""; position: absolute; left: 31px; top: 20px; bottom: 20px; width: 6px; border-radius: 6px; background: repeating-linear-gradient(var(--peacock) 0 14px, transparent 14px 24px); opacity: .4; }
.river-stop { position: relative; display: grid; grid-template-columns: 68px 1fr; gap: 18px; align-items: start; }
.river-num { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--surface); border: 3px solid var(--zari); font: 800 1.9rem/1 var(--f-display); color: var(--silk-deep); box-shadow: var(--shadow-1), 0 0 0 6px color-mix(in srgb, var(--zari) 18%, transparent); padding-top: .12em; }
.river-ml { font: 700 1.5rem/1.3 var(--f-display); color: var(--peacock-deep); }
.river-en { font-weight: 700; color: var(--zari-deep); font-size: .9rem; letter-spacing: .02em; }
.river-sum { color: var(--ink-2); max-width: 58ch; }
@media (min-width: 900px) {
  .river { grid-template-columns: repeat(5, 1fr); gap: 20px; }
  .river::before { left: 34px; right: 34px; top: 31px; bottom: auto; width: auto; height: 6px; background: repeating-linear-gradient(90deg, var(--peacock) 0 14px, transparent 14px 24px); }
  .river-stop { grid-template-columns: 1fr; }
  .river-stop:nth-child(even) { margin-top: 40px; }
}

.band--child { background: var(--ground); }
.child { display: grid; gap: 36px; align-items: center; }
@media (min-width: 880px) { .child { grid-template-columns: 1.1fr 1fr; } }
.skill-sample { display: grid; gap: 14px; padding: 28px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-2); border: 1px solid var(--line); border-top: 6px solid var(--silk); }
.ss-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; }
.ss-name { display: grid; line-height: 1.2; } .ss-name .ml { font-weight: 700; font-size: 1.15rem; } .ss-name .en { font-size: .82rem; }
.ss-track, .sl-track { display: inline-flex; gap: 6px; }
.ss-track i, .sl-track i { width: 22px; height: 22px; border-radius: 50%; background: var(--ring-track); position: relative; }
.ss-track i.on, .sl-track i.on { background: var(--zari); box-shadow: inset 0 0 0 5px var(--marigold); }
.ss-lv, .sl-lv { font: 700 .85rem var(--f-ui); color: var(--ink-2); min-width: 4.6em; text-align: right; }
.site-foot { position: relative; background: var(--panel); color: #EAF4F2; padding-block: 48px 40px; background-image: radial-gradient(circle at 95% 10%, rgba(179,19,107,.35), transparent 40%); }
.site-foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: linear-gradient(var(--zari) 0 2px, var(--silk) 2px 8px, var(--zari) 8px 10px); }
.site-foot .brand, .site-foot .brand-ml, .site-foot .brand-en { color: #fff; }
.site-foot a { color: #FFE2A0; }
.foot { display: grid; gap: 14px; }
.foot-quote { display: grid; gap: 2px; padding-left: 14px; border-left: 3px solid var(--zari); }
.foot-quote .ml { font: 700 1.35rem/1.4 var(--f-display); color: #FFE2A0; } .foot-quote span:last-child { font-size: .9rem; color: rgba(234,244,242,.85); }

/* ---- Login --------------------------------------------------------------- */
.login { min-height: 100svh; display: grid; }
.login-scene { position: fixed; inset: 0; z-index: -1; }
.login-panel { align-self: center; justify-self: center; width: min(480px, calc(100% - 32px)); margin-block: 32px; padding: 24px clamp(20px, 5vw, 36px) 32px; border-radius: 32px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow-2); display: grid; gap: 18px; animation: rise .6s var(--ease) both; }
.login-head { display: flex; justify-content: space-between; align-items: center; }
.login-title { display: grid; gap: 2px; } .login-title .ml { font-size: 2.4rem; color: var(--peacock-deep); } .login-title .en { font: 600 1rem var(--f-ui); }
.login-form { display: grid; gap: 14px; }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 20px; background: var(--ground-2); }
.role-tab { display: grid; gap: 0; justify-items: center; padding: 8px 4px; min-height: 56px; border: 0; border-radius: 16px; background: none; cursor: pointer; color: var(--ink-2); }
.role-tab .ml { font-weight: 700; font-size: .98rem; } .role-tab .en { font-size: .75rem; }
.role-tab[aria-selected="true"] { background: var(--surface); color: var(--peacock-deep); box-shadow: var(--shadow-1); }
.field { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.field input, .field select, .export { font: 500 1.05rem var(--f-ui); min-height: 52px; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }
.field input:focus, .field select:focus { border-color: var(--peacock); outline: none; box-shadow: 0 0 0 4px var(--peacock-soft); }
.field input.ml { font-family: var(--f-ml); font-size: 1.2rem; }
.form-error { color: var(--kumkum); font-weight: 600; min-height: 1.2em; }
.demo { display: grid; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.demo-title { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.demo-list { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; min-height: 44px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.demo-chip .avatar { width: 30px; height: 30px; font-size: 1rem; }
.demo-hint, .login-note { font-size: .85rem; color: var(--ink-3); }

/* ---- Page heads & sections ---------------------------------------------------- */
.page-head { display: grid; gap: 6px; margin: 8px 0 24px; }
.page-head h1 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.3rem); }
.page-head h1 .ml { color: var(--peacock-deep); }
.sec-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.3rem; margin-bottom: 14px; }
.sec-title .ml { color: var(--peacock-deep); }
.sec-title .icon { color: var(--zari-deep); }
.sec-sub { color: var(--ink-3); font-size: .92rem; margin: -8px 0 14px; }
.sec-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sec-row .sec-sub { margin: 0 0 14px; }
.empty { color: var(--ink-3); padding: 18px; border-radius: 18px; background: var(--surface-2); }
.empty-page { display: grid; gap: 16px; justify-items: start; padding: 48px var(--gutter); }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; min-height: 44px; }

/* ---- Student dashboard ------------------------------------------------------ */
.greet { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 270px; display: grid; align-items: end; box-shadow: var(--shadow-2); isolation: isolate; }
.greet-scene { position: absolute; inset: 0; z-index: -1; }
.greet-scene .tn-scene { height: 100%; }
.greet-body { display: flex; gap: 18px; align-items: flex-end; padding: 80px 28px 26px; background: linear-gradient(transparent, color-mix(in srgb, var(--surface) 90%, transparent) 55%); }
.greet-avatar { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; font-size: 2.8rem; background: var(--zari-soft); box-shadow: inset 0 0 0 4px var(--zari), var(--shadow-1); flex: none; }
.greet-title { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.7rem); color: var(--ink); }
.greet-title .ml { color: var(--peacock-deep); }
.wave { display: inline-block; animation: wave-hand 2.4s ease-in-out 1; transform-origin: 70% 80%; }
@keyframes wave-hand { 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } 50% { transform: none; } }
.greet-sub { font-size: 1.1rem; color: var(--ink-2); margin: 2px 0 14px; }
.greet-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.level-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); }
.level-pill b { color: var(--zari-deep); } .level-pill .ml { font-weight: 600; } .level-pill .en { font-size: .85rem; }
@media (max-width: 560px) { .greet-body { flex-direction: column; align-items: flex-start; padding: 110px 20px 22px; } .greet-avatar { width: 64px; height: 64px; font-size: 2.1rem; } }

.dash-grid { display: grid; gap: 28px 24px; margin-top: 28px; }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: repeat(12, 1fr); }
  .now { grid-column: span 7; } .stats { grid-column: span 5; } .notes { grid-column: span 7; } .week { grid-column: span 5; }
  .skills { grid-column: span 6; } .badges { grid-column: span 6; }
  .dash-grid > .notes:only-child { grid-column: 1 / -1; }
}
.now-card { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 18px 22px 18px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1); transition: transform .2s var(--ease), box-shadow .2s; }
.now-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.now-letter { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; background: var(--peacock-deep); color: var(--zari-soft); font-size: 3.1rem; font-weight: 800; line-height: 1; padding-top: .14em; box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); }
:root[data-theme="dark"] .now-letter { background: var(--peacock-soft); color: var(--zari); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .now-letter { background: var(--peacock-soft); color: var(--zari); } }
.now-title { font: 700 1.25rem var(--f-display); }
.now-meta { color: var(--ink-3); font-size: .9rem; }
.now-next { margin-top: 4px; font-weight: 600; color: var(--peacock); }
@media (max-width: 480px) { .now-card { grid-template-columns: auto 1fr; } .now-card .ring { display: none; } .now-letter { width: 76px; height: 76px; font-size: 2.5rem; } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-content: start; }
.stats--wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 28px; }
.stat { display: grid; gap: 2px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.stat-icon { color: var(--zari-deep); }
.stat-num { font: 800 2.1rem/1.1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-num small { font: 600 .9rem var(--f-ui); color: var(--ink-3); }
.stat-label { display: grid; line-height: 1.25; } .stat-label .ml { font-weight: 600; font-size: .92rem; } .stat-label .en { font-size: .8rem; }
.stat--lamp { background: linear-gradient(160deg, var(--zari-soft), var(--surface-2)); }
.lamp { width: 72px; height: 50px; }
.lamp-metal { fill: var(--zari); }
.lamp .wick path { fill: var(--line-2); transform-box: fill-box; transform-origin: 50% 100%; }
.lamp .wick.on path { fill: var(--marigold); animation: flicker 1.8s ease-in-out infinite alternate; filter: drop-shadow(0 0 3px rgba(245,163,15,.8)); }
@keyframes flicker { 50% { transform: scaleY(1.15) scaleX(.9); } }

.notes { display: grid; gap: 10px; align-content: start; }
.note { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.note > .icon { color: var(--marigold-deep); margin-top: 3px; }
.note--hw { border-left: 0; background: linear-gradient(90deg, var(--zari-soft), var(--surface) 60%); }
.note-title { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-title.ml { font-family: var(--f-display); font-size: 1.15rem; }
.note-text { color: var(--ink-2); } .note-meta { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }

.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.wb { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; height: 100%; }
.wb-count { font: 700 .8rem var(--f-ui); color: var(--ink-2); min-height: 1.2em; }
.wb-bar { align-self: end; width: 100%; max-width: 30px; border-radius: 10px 10px 6px 6px; background: var(--ring-track); }
.wb-bar.has { background: linear-gradient(var(--marigold), var(--zari)); }
.wb-day { font-size: .78rem; font-weight: 600; color: var(--ink-3); }
.wb.is-today .wb-day { color: var(--peacock); }

.skill-levels { list-style: none; margin: 0; padding: 16px 18px; display: grid; gap: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.sl { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; }
.sl-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--peacock-soft); color: var(--peacock); }
.sl-name { display: grid; line-height: 1.2; } .sl-name .ml { font-weight: 600; } .sl-name .en { font-size: .78rem; }
.sl-track i { width: 16px; height: 16px; } .sl-track i.on { box-shadow: inset 0 0 0 4px var(--marigold); }
@media (max-width: 420px) { .sl { grid-template-columns: auto 1fr auto; } .sl-track { display: none; } }

.badge-row, .badge-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.badge-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px; }
.badge-item { display: grid; justify-items: center; text-align: center; gap: 4px; }
.badge-ml { font-weight: 700; font-size: .92rem; line-height: 1.35; }
.badge-en { font-size: .8rem; color: var(--ink-2); } .badge-desc { font-size: .78rem; color: var(--ink-3); }
.badge-item.locked .badge-ml { color: var(--ink-3); }
.me-head { display: flex; gap: 16px; align-items: center; }

/* Journey page */
.path-river { display: grid; gap: 22px; position: relative; }
.path-level { position: relative; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 14px; }
.path-level.is-mine { border: 2px solid var(--marigold); box-shadow: 0 0 0 6px color-mix(in srgb, var(--marigold) 18%, transparent); }
.pl-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.pl-head > div { flex: 1; min-width: 200px; }
.pl-head h2 { display: grid; font-size: 1.6rem; } .pl-head h2 .en { font: 700 .88rem var(--f-ui); color: var(--zari-deep); }
.pl-head p { color: var(--ink-2); }
.pl-num { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--peacock-deep); color: var(--zari-soft); font: 800 1.7rem/1 var(--f-display); padding-top: .12em; flex: none; }
.pl-focus { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .85rem; color: var(--ink-3); }
.pl-modules { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.path-module { padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.pm-title { display: grid; line-height: 1.25; margin-bottom: 10px; } .pm-title .ml { font-weight: 700; } .pm-title .en { font-size: .82rem; }
.pm-lessons { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-soon { font-size: .85rem; color: var(--ink-3); }
.path-lesson { display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 18px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); min-height: 52px; }
.path-lesson.is-open { border-color: var(--zari); }
.path-lesson.is-open:hover { background: var(--zari-soft); }
.pl-glyph { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--peacock-soft); color: var(--peacock-deep); font-size: 1.25rem; font-weight: 800; line-height: 1; padding-top: .14em; }
.path-lesson.is-soon { opacity: .6; } .path-lesson.is-soon .pl-glyph { background: var(--ground-2); color: var(--ink-3); }
.pl-en { font-size: .85rem; font-weight: 600; }

/* ---- Alphabet explorer ---------------------------------------------------- */
.explorer-head { position: relative; padding: 28px 0 8px; overflow: visible; }
.explorer-head h1 { font-size: clamp(2.8rem, 2rem + 4vw, 4.6rem); }
.explorer-bloom { position: absolute; right: -40px; top: -30px; width: 220px; opacity: .32; pointer-events: none; animation: spin 120s linear infinite; z-index: -1; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 10px 0 0; font-size: .85rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.lg { margin-top: 26px; }
.lg-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 1.45rem; margin-bottom: 14px; }
.lg-title .ml { color: var(--peacock-deep); } .lg-title .en { font: 600 .9rem var(--f-ui); }
.letter-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
.ltile { position: relative; display: grid; justify-items: center; align-content: center; gap: 0; aspect-ratio: 1; border-radius: 28px; background: var(--surface); border: 2px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .25s var(--spring), box-shadow .2s, border-color .2s; animation: pop .5s var(--spring) both; animation-delay: calc(var(--i) * 18ms); }
.ltile:hover { transform: translateY(-4px) rotate(-2deg); box-shadow: var(--shadow-2); border-color: var(--peacock); }
.ltile:active { transform: scale(.94); }
.ltile-glyph { font-size: clamp(2.3rem, 1.8rem + 1.6vw, 2.9rem); font-weight: 700; line-height: 1.2; padding-top: .08em; }
.ltile-tr { font: 600 .78rem var(--f-ui); color: var(--ink-3); margin-top: .15em; }
.ltile.has-lesson { background: linear-gradient(160deg, var(--zari-soft), var(--surface) 70%); border-color: var(--zari); box-shadow: 0 4px 0 var(--zari); }
.ltile.has-lesson .ltile-glyph { color: var(--peacock-deep); }
.ltile-flag { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--marigold); color: var(--on-marigold); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.ltile-flag .icon { width: 16px; height: 16px; }
.ltile.is-learned .ltile-flag, .ltile-flag.is-done { background: var(--leaf); color: #fff; }
.ltile-dot { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--peacock); }
.ltile-flag.demo, .ltile-dot.demo { position: static; flex: none; }
.ltile-dot.demo { display: inline-block; }
@keyframes pop { from { opacity: 0; transform: scale(.8) translateY(10px); } }

/* Letter page */
.letter-stage { position: relative; display: grid; gap: 20px; align-items: center; justify-items: center; text-align: center; padding: 20px 0 32px; isolation: isolate; }
@media (min-width: 820px) { .letter-stage { grid-template-columns: auto 1fr; text-align: left; justify-items: start; } }
.ls-bloom { position: absolute; left: 50%; top: 50%; width: min(420px, 90vw); translate: -50% -50%; opacity: .28; z-index: -1; pointer-events: none; animation: spin 90s linear infinite; }
@media (min-width: 820px) { .ls-bloom { left: 170px; } }
.ls-glyph { width: clamp(220px, 40vw, 300px); aspect-ratio: 1; display: grid; place-items: center; border: 0; border-radius: 64px; background: var(--surface); box-shadow: 0 10px 0 var(--zari), var(--shadow-2); color: var(--peacock-deep); font-size: clamp(6.6rem, 17vw, 9.4rem); font-weight: 800; line-height: 1; padding-top: .14em; cursor: pointer; transition: transform .3s var(--spring); }
.ls-glyph:hover { transform: rotate(-3deg) scale(1.02); } .ls-glyph:active { transform: scale(.95); }
.ls-info { display: grid; gap: 14px; justify-items: inherit; max-width: 52ch; }
.ls-tr { font-size: 1.15rem; } .ls-tr .translit { font: 800 1.6rem var(--f-display); color: var(--zari-deep); } .ls-sound { color: var(--ink-2); }
.ls-intro { color: var(--ink-2); font-size: 1.05rem; }
.lesson-box { padding: 22px; border-radius: var(--r-lg); background: var(--panel); color: #EAF5F1; display: grid; gap: 16px; margin-bottom: 36px; background-image: radial-gradient(circle at 90% 10%, rgba(217,162,27,.28), transparent 45%); }
.lesson-box .eyebrow { color: #FFD98A; } .lesson-box h2 { font-size: 1.6rem; color: #fff; } .lesson-box h2 .ml { color: #FFE2A0; }
:root[data-theme="dark"] .lesson-box { background-color: #123A3E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lesson-box { background-color: #123A3E; } }
.lb-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; } .lb-head > div { flex: 1; min-width: 200px; }
.lesson-box .ring { --ring-track: rgba(255,255,255,.18); --ring-fill: #FFD98A; } .lesson-box .ring-label { color: #fff; }
.act-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.act-chip { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; min-height: 52px; border-radius: 18px; background: rgba(255,255,255,.08); color: #fff; text-decoration: none; transition: background .2s; }
.act-chip:hover { background: rgba(255,255,255,.16); }
.act-chip .ml { display: block; font-weight: 600; line-height: 1.3; } .act-chip .en { display: block; color: rgba(255,255,255,.7); font-size: .8rem; }
.act-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); font-weight: 700; flex: none; }
.act-chip.is-done .act-n { background: #7FCB82; color: #0C2A12; }
.word-garden { margin-bottom: 32px; }
.vocab-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.letter-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; }
.letter-nav .ml { font-size: 1.5rem; line-height: 1; padding-top: .15em; }

/* Vocabulary card */
.vocab { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 14px 14px; border-radius: 32px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s var(--spring), box-shadow .2s; }
.vocab:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.vocab.tone-1 .picture { background: radial-gradient(circle at 50% 42%, var(--surface) 0 38%, var(--peacock-soft) 70%); }
.vocab.tone-2 .picture { background: radial-gradient(circle at 50% 42%, var(--surface) 0 38%, var(--leaf-soft) 70%); }
.vocab.tone-3 .picture { background: radial-gradient(circle at 50% 42%, var(--surface) 0 38%, var(--kumkum-soft) 70%); }
.vocab.tone-4 .picture { background: radial-gradient(circle at 50% 42%, var(--surface) 0 38%, #E4EEF8 70%); }
.vocab > .audio-controls { margin-top: auto; }
.vocab-pic { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; transition: transform .25s var(--spring); }
.vocab-pic:hover { transform: scale(1.05) rotate(-3deg); } .vocab-pic:active { transform: scale(.95); }
.vocab-body { display: grid; gap: 0; }
.vocab-ml { font-size: 1.9rem; font-weight: 700; line-height: 1.3; color: var(--ink); }
.vocab-translit { font: 600 .9rem var(--f-ui); color: var(--zari-deep); font-style: italic; }
.vocab-en { font-weight: 600; color: var(--ink-2); }
.vocab.is-heard::after { content: "✓"; position: absolute; top: 12px; right: 14px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--leaf); color: #fff; font-weight: 800; font-size: .85rem; }
.vocab-example { width: 100%; text-align: left; font-size: .92rem; border-top: 1px dashed var(--line-2); padding-top: 8px; }
.vocab-example summary { cursor: pointer; font-weight: 600; color: var(--peacock); min-height: 32px; display: flex; align-items: center; }
.vocab-example p.ml { font-size: 1.05rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vocab-note { font-size: .82rem; color: var(--ink-3); }

/* ---- Lesson player ------------------------------------------------------- */
.lesson { min-height: 100svh; background: radial-gradient(ellipse at 50% -10%, var(--zari-soft), transparent 60%), var(--ground); }
.lesson-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px var(--gutter); background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lesson-dots { flex: 1; display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; justify-content: center; flex-wrap: wrap; }
.ldot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ring-track); color: var(--ink-3); font: 700 .8rem var(--f-ui); text-decoration: none; transition: transform .2s var(--spring); }
.ldot .icon { width: 18px; height: 18px; }
.ldot.is-done { background: var(--leaf); color: #fff; }
.ldot.is-current { background: var(--marigold); color: var(--on-marigold); transform: scale(1.15); box-shadow: 0 0 0 4px color-mix(in srgb, var(--marigold) 30%, transparent); }
.lesson-glyph { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--peacock-deep); color: var(--zari-soft); font-size: 1.4rem; font-weight: 800; line-height: 1; padding-top: .16em; }
.lesson-main { max-width: 980px; margin: 0 auto; padding: 12px var(--gutter) 64px; outline: none; }
.act-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; text-align: center; margin: 8px 0 22px; }
.act-title .ml { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.4rem); color: var(--peacock-deep); }
.act-title .en { flex-basis: 100%; font: 600 1rem var(--f-ui); }
.stage { animation: rise .45s var(--ease) both; }
.act { display: grid; gap: 20px; }
.act-lede { font-size: 1.1rem; text-align: center; color: var(--ink-2); }
.big-inline { font-size: 1.6em; color: var(--peacock-deep); vertical-align: -0.12em; }
.act-foot { display: flex; justify-content: center; padding-top: 6px; }
.feedback { text-align: center; font-weight: 600; min-height: 1.6em; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.feedback .icon { color: var(--leaf); }
.round-count { text-align: center; font: 700 .85rem var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

.result, .done { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 36px 20px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-2); }
.result-ml { font: 800 2.4rem var(--f-display); color: var(--peacock-deep); display: flex; align-items: center; gap: 10px; }
.result-en { color: var(--ink-2); font-size: 1.1rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.done-glyph { font-size: 7rem; line-height: 1; font-weight: 800; color: var(--zari-deep); padding-top: .12em; animation: pop .7s var(--spring); }
.done h2 { font-size: 2.2rem; color: var(--peacock-deep); display: flex; align-items: center; gap: 10px; }
.done-badge { display: grid; justify-items: center; gap: 6px; padding: 14px 22px; border-radius: 24px; background: var(--zari-soft); }
.guest-inline { padding: 10px 16px; border-radius: 14px; background: var(--zari-soft); }

/* Intro */
.intro-stage { display: grid; gap: 24px; align-items: center; justify-items: center; text-align: center; }
@media (min-width: 760px) { .intro-stage { grid-template-columns: auto 1fr; text-align: left; justify-items: start; } }
.intro-glyph { width: clamp(200px, 36vw, 260px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 56px; background: var(--surface); box-shadow: 0 8px 0 var(--zari), var(--shadow-2); font-size: clamp(6rem, 15vw, 8.2rem); font-weight: 800; line-height: 1; color: var(--peacock-deep); padding-top: .14em; overflow: hidden; }
.intro-glyph .draw { display: inline-block; clip-path: inset(0 100% 0 0); animation: draw 1.6s .2s var(--ease) forwards; }
@keyframes draw { to { clip-path: inset(0 0 0 0); } }
.intro-copy { display: grid; gap: 12px; justify-items: inherit; }
.intro-ml { font: 700 1.7rem/1.4 var(--f-display); color: var(--peacock-deep); }
.intro-en { font-size: 1.1rem; color: var(--ink-2); max-width: 48ch; }
.tip { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 16px; border-radius: 16px; background: var(--zari-soft); color: var(--ink); max-width: 48ch; }
.tip .icon { color: var(--zari-deep); margin-top: 2px; }
.intro-word { display: flex; justify-content: center; }
.intro-word-btn { display: flex; align-items: center; gap: 16px; padding: 10px 26px 10px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; box-shadow: var(--shadow-1); }
.intro-word-btn .picture { width: 72px; } .intro-word-btn .picture-emoji { font-size: 2.3rem; }
.intro-word-btn .ml { font: 700 2rem var(--f-display); } .hl { color: var(--marigold-deep); }
.say-row { display: grid; justify-items: center; gap: 6px; }
.say-count { font-weight: 600; color: var(--leaf); min-height: 1.4em; }

/* Gallery meter */
.meter-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.meter { width: min(320px, 100%); height: 14px; border-radius: 10px; background: var(--ring-track); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--zari), var(--marigold)); border-radius: 10px; transition: width .4s var(--ease); }
.meter-label { font-weight: 600; color: var(--ink-2); }

/* Listen & choose */
.listen-bar { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.big-listen { display: inline-flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 28px; border-radius: var(--r-pill); border: 0; background: var(--peacock); color: var(--on-peacock); font: 700 1.15rem var(--f-ui); cursor: pointer; box-shadow: 0 5px 0 var(--peacock-deep); }
.big-listen .icon { width: 30px; height: 30px; }
.big-listen:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--peacock-deep); }
:root[data-theme="dark"] .big-listen { color: #06231F; }
.listen-bar .audio-btn { border: 1px solid var(--line); background: var(--surface); }
.listen-bar .round-count { flex-basis: 100%; }
.hint-row { display: flex; justify-content: center; align-items: center; gap: 12px; }
.reveal { font: 700 1.8rem var(--f-display); color: var(--peacock-deep); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 560px; margin: 0 auto; width: 100%; }
@media (min-width: 760px) { .choices { grid-template-columns: repeat(4, 1fr); max-width: none; } }
.choice { position: relative; display: grid; place-items: center; padding: 16px; border-radius: 32px; border: 3px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .2s var(--spring), border-color .2s; min-height: 150px; }
.choice:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--peacock); }
.choice .picture { width: min(128px, 100%); }
.choice.is-right { border-color: var(--leaf); background: var(--leaf-soft); }
.choice.is-wrong { border-color: var(--kumkum); background: var(--kumkum-soft); opacity: .7; }
.choice-mark, .pick-mark, .match-mark { position: absolute; top: 10px; right: 10px; }
.choice-mark .icon, .pick-mark .icon, .match-mark .icon { width: 28px; height: 28px; padding: 4px; border-radius: 50%; color: #fff; stroke-width: 3; }
.is-right .icon, .is-matched .match-mark .icon { background: var(--leaf); }
.is-wrong .choice-mark .icon, .is-wrong .pick-mark .icon { background: var(--kumkum); }

/* Starts with */
.pick-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .pick-grid { grid-template-columns: repeat(4, 1fr); } }
.pick { position: relative; display: grid; justify-items: center; }
.pick-btn { position: relative; width: 100%; display: grid; justify-items: center; gap: 2px; padding: 14px 10px 44px; border-radius: 28px; border: 3px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .2s var(--spring), border-color .2s, background .2s; }
.pick-btn:hover { transform: translateY(-2px); }
.pick-ml { font: 700 1.6rem/1.3 var(--f-display); }
.pick-ml.starts { text-decoration: underline wavy var(--marigold); text-underline-offset: 6px; }
.pick-en { font-size: .85rem; color: var(--ink-2); }
.pick > .speaker { position: absolute; bottom: 8px; }
.pick.is-chosen .pick-btn { border-color: var(--marigold); background: var(--zari-soft); }
.pick.is-chosen .pick-btn::before { content: "✓ picked"; position: absolute; top: 8px; left: 12px; font: 700 .72rem var(--f-ui); color: var(--marigold-deep); }
.pick.is-right .pick-btn { border-color: var(--leaf); }
.pick.is-wrong .pick-btn { border-color: var(--kumkum); }

/* Find the letter */
.find-head { display: grid; justify-items: center; gap: 10px; }
.tally { display: flex; gap: 8px; justify-content: center; }
.tally i { width: 20px; height: 20px; border-radius: 50%; background: var(--ring-track); transition: background .3s, transform .3s var(--spring); }
.tally i.on { background: var(--marigold); transform: scale(1.2); }
.bubbles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 520px; margin: 0 auto; width: 100%; }
.bubble { position: relative; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--line); background: var(--surface); font-size: clamp(2.4rem, 8vw, 3.4rem); font-weight: 700; line-height: 1; padding-top: .16em; cursor: pointer; color: var(--ink); animation: pop .5s var(--spring) both; animation-delay: calc(var(--i) * 30ms); transition: transform .2s var(--spring); }
.bubble:hover { transform: scale(1.06); }
.bubble.is-found { background: var(--zari-soft); border-color: var(--zari); color: var(--peacock-deep); }
.bubble-mark { position: absolute; top: -4px; right: -4px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--leaf); color: #fff; }
.bubble-mark .icon { width: 16px; height: 16px; stroke-width: 3; }

/* Picture match */
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; max-width: 620px; margin: 0 auto; width: 100%; }
.match-col { display: grid; gap: 12px; }
.match { position: relative; display: grid; place-items: center; min-height: 104px; padding: 10px; border-radius: 26px; border: 3px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .2s var(--spring), border-color .2s, background .2s; }
.match:hover:not(:disabled) { border-color: var(--peacock); }
.match-word { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 700; line-height: 1.3; padding-top: .1em; }
.match.is-selected { border-color: var(--marigold); background: var(--zari-soft); transform: scale(1.03); }
.match.is-matched { border-style: solid; cursor: default; }
.match.pair-1 { border-color: var(--leaf); background: var(--leaf-soft); } .match.pair-2 { border-color: var(--peacock); background: var(--peacock-soft); }
.match.pair-3 { border-color: var(--zari); background: var(--zari-soft); } .match.pair-4 { border-color: #7C8CD6; background: #E8ECFA; }
:root[data-theme="dark"] .match.pair-4 { background: #1E2644; }

/* Build the word */
.build-card { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.build-en { font: 700 1.4rem var(--f-display); margin-bottom: 8px; }
.slots { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.slot { display: grid; place-items: center; min-width: 92px; height: 104px; padding: 6px; border-radius: 26px; border: 3px dashed var(--line-2); background: var(--surface-2); }
.slots.is-built .slot { border-style: solid; border-color: var(--leaf); background: var(--leaf-soft); }
.tray { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 100px; padding: 14px; border-radius: 28px; background: var(--ground-2); }
.tile { min-width: 80px; height: 88px; padding: 0 16px; border-radius: 22px; border: 0; background: var(--surface); box-shadow: 0 5px 0 var(--zari), var(--shadow-1); font-size: 2.6rem; font-weight: 700; line-height: 1; padding-top: .16em; color: var(--peacock-deep); cursor: grab; touch-action: none; user-select: none; transition: transform .2s var(--spring); }
.tile:hover { transform: translateY(-3px); }
.tile.is-lifted { opacity: .35; }
.tile--ghost { position: fixed; z-index: 99; pointer-events: none; transform: translate(-50%, -60%) rotate(-4deg) scale(1.08); box-shadow: 0 16px 30px rgba(0,0,0,.2); }
.slot .tile { box-shadow: none; background: transparent; }
.equation { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; animation: pop .6s var(--spring); }
.eq-part { font-size: 2.2rem; font-weight: 700; padding: 4px 16px; border-radius: 16px; background: var(--zari-soft); line-height: 1.3; }
.eq-op { font: 800 1.8rem var(--f-ui); color: var(--ink-3); }
.eq-word { font-size: 3rem; font-weight: 800; color: var(--peacock-deep); line-height: 1.2; }

/* Trace */
.act-trace { grid-template-columns: 1fr; justify-items: center; }
@media (min-width: 820px) { .act-trace { grid-template-columns: 1fr auto; align-items: start; } }
.trace-side { display: grid; justify-items: center; gap: 14px; }
.trace-demo { width: 150px; height: 150px; display: grid; place-items: center; border-radius: 32px; background: var(--surface); box-shadow: var(--shadow-1); font-size: 4.6rem; font-weight: 800; line-height: 1; color: var(--peacock-deep); padding-top: .14em; overflow: hidden; }
.trace-demo span { clip-path: inset(0 100% 0 0); animation: draw 2.4s var(--ease) infinite; }
.trace-demo.still span { clip-path: none; animation: none; }
.trace-pad { display: grid; gap: 12px; justify-items: center; }
.trace-canvas { border-radius: 36px; background: var(--surface); box-shadow: inset 0 0 0 3px var(--line), var(--shadow-1); touch-action: none; cursor: crosshair; max-width: 100%; height: auto !important; aspect-ratio: 1; }
.trace-tools { display: flex; gap: 12px; }

/* ---- Staff (teacher & admin) ---------------------------------------------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 24px; }
.kpi { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
a.kpi:hover { border-color: var(--peacock); }
.kpi-n { font: 800 1.9rem/1.15 var(--f-display); font-variant-numeric: tabular-nums; }
.kpi-l { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.panel { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: 20px; }
.panel--help { background: linear-gradient(120deg, var(--zari-soft), var(--surface) 70%); }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.help-list li { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.help-list a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.help-list span:last-child { color: var(--ink-2); font-size: .9rem; }
.class-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.class-tab { padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.class-tab[aria-selected="true"] { background: var(--peacock); border-color: var(--peacock); color: var(--on-peacock); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.roster { width: 100%; border-collapse: collapse; font-size: .93rem; }
.roster th, .roster td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.roster thead th { font: 700 .75rem var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.roster tbody th { font-weight: 600; }
.roster .num { text-align: right; font-variant-numeric: tabular-nums; }
.roster td.ml, .roster th.ml { font-size: 1.15rem; }
.stu { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.stu .avatar, .help-list .avatar, .roster .avatar { width: 30px; height: 30px; font-size: 1rem; }
.mini-bar { display: inline-block; width: 70px; height: 8px; border-radius: 6px; background: var(--ring-track); overflow: hidden; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: var(--peacock); border-radius: 6px; }
.as-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.as-list li { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.as-list li > div:not(.ring) { flex: 1; } .as-list p { color: var(--ink-2); font-size: .9rem; }
.as-list li > .icon { color: var(--marigold-deep); }
.form-card { display: grid; gap: 16px; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: 20px; justify-items: start; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); width: 100%; }
.span-2 { grid-column: 1 / -1; }
.pic-pick { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-opt { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 1.4rem; cursor: pointer; }
.emoji-opt:hover { border-color: var(--peacock); }
.studio-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.studio-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--line); font-weight: 600; color: var(--ink-3); }
.studio-tab.is-on { background: var(--peacock); border-color: var(--peacock); color: var(--on-peacock); }
.studio-list { display: grid; gap: 8px; }
.studio-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 18px; background: var(--surface-2); }
.sr-word { display: grid; justify-items: start; line-height: 1.3; } .sr-word b.ml { font-size: 1.3rem; font-family: var(--f-display); } .sr-word span { color: var(--ink-2); font-size: .88rem; }
.sr-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 900px) { .studio-row { grid-template-columns: auto minmax(160px, 1fr) auto auto auto; } .sr-actions { grid-column: auto; } }
.edit-box { margin-top: 14px; } .edit-box summary { cursor: pointer; font-weight: 600; color: var(--peacock); min-height: 40px; display: flex; align-items: center; }
.skill-edit { display: grid; gap: 14px; margin-top: 10px; justify-items: start; }
.skill-edit-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); width: 100%; }
.activity-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.activity-log li { display: flex; gap: 14px; } .activity-log time { color: var(--ink-3); min-width: 9.5em; font-variant-numeric: tabular-nums; }
.level-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.level-bars li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.lvb-meta { color: var(--ink-2); font-size: .9rem; }
.sys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 16px; }
.sys dt { font-weight: 600; color: var(--ink-2); } .sys dd { margin: 0; }
@media (max-width: 560px) { .sys { grid-template-columns: 1fr; } .sys dd { margin-bottom: 8px; } }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.export { font: 400 .8rem/1.4 ui-monospace, monospace; min-height: 200px; }
.tree, .tree ul, .tree-acts { list-style: none; margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.tree { padding-left: 0; }
.tree details > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; min-height: 44px; }
.tree details > summary:hover { background: var(--surface-2); }
.tree details > p { padding-left: 12px; }
.tree-kind { font: 700 .65rem var(--f-ui); letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--peacock-soft); color: var(--peacock); }
.tree-acts li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 10px; font-size: .92rem; }
.tree code { font-size: .78rem; background: var(--ground-2); padding: 2px 6px; border-radius: 6px; }

/* ---- Soon pages ---------------------------------------------------------- */
.soon-page { border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.soon-scene { height: 220px; }
.soon-body { display: grid; gap: 10px; justify-items: start; padding: 26px; margin-top: -40px; position: relative; }
.soon-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 24px; background: var(--marigold); color: var(--on-marigold); box-shadow: var(--shadow-2); }
.soon-icon .icon { width: 36px; height: 36px; }
.soon-body h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.soon-body .h-en { font-size: 1.1rem; }
.soon-items { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 4px 0 10px; }
.soon-items li { padding: 8px 14px; border-radius: var(--r-pill); background: var(--zari-soft); font-weight: 600; }

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

@media (max-width: 420px) { .brand-en { display: none; } .level-pill { flex-wrap: wrap; row-gap: 0; } }
.sr-only { left: 0; top: 0; }
.tab-link { min-width: 0; }
.tab-link .nav-label { max-width: 100%; }
.tab-link .nav-label .ml { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.explorer, .letter-page { overflow-x: clip; }
@media (max-width: 600px) {
  .studio-row { grid-template-columns: auto 1fr auto; }
  .rec-state { grid-column: 1 / -1; }
}
:root[data-theme="dark"] .hero-title { color: var(--zari-deep); text-shadow: 0 0 28px rgba(255,178,62,.35), 0 4px 30px rgba(0,0,0,.45); }
:root[data-theme="dark"] .speaker--glass { background: rgba(21,14,27,.6); color: var(--ink); }
:root[data-theme="dark"] .fl { color: rgba(255,236,200,.92); text-shadow: 0 0 18px rgba(255,178,62,.55), 0 0 2px rgba(255,178,62,.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-title { color: var(--zari-deep); text-shadow: 0 0 28px rgba(255,178,62,.35), 0 4px 30px rgba(0,0,0,.45); }
  :root:not([data-theme="light"]) .speaker--glass { background: rgba(21,14,27,.6); color: var(--ink); }
  :root:not([data-theme="light"]) .fl { color: rgba(255,236,200,.92); text-shadow: 0 0 18px rgba(255,178,62,.55), 0 0 2px rgba(255,178,62,.6); }
}
.lesson-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 16px; background: var(--peacock-soft); color: var(--ink); max-width: 60ch; margin: 0 auto; }
.lesson-note .icon { color: var(--zari-deep); margin-top: 2px; }
.ls-info .lesson-note { margin: 0; }
.ltile.is-learned { background: linear-gradient(160deg, var(--leaf-soft), var(--surface) 70%); border-color: var(--leaf); }
.ltile.is-started { border-color: var(--zari); }
.ltile.is-started .ltile-dot { background: var(--marigold); }
.now-glyph { font-family: var(--f-display); font-size: 1.3rem; color: var(--peacock-deep); vertical-align: middle; }
.voice-row { display: flex; gap: 8px; align-items: center; }
.voice-row select { flex: 1; min-width: 0; font: 500 .95rem var(--f-ui); min-height: 44px; padding: 8px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.fit { display: inline-block; white-space: nowrap; line-height: 1; }

/* ---- Translator ----------------------------------------------------------- */
.tr-box { display: grid; gap: 14px; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.tr-dir { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--ground-2); justify-self: start; flex-wrap: wrap; }
.tr-dir-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tr-dir-btn .icon { width: 1.1em; height: 1.1em; }
.tr-dir-btn[aria-checked="true"] { background: var(--surface); color: var(--peacock-deep); box-shadow: var(--shadow-1); }
#tr-input { font: 500 1.2rem/1.5 var(--f-ui); padding: 14px 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; min-height: 100px; width: 100%; }
#tr-input.ml { font-family: var(--f-ml); font-size: 1.3rem; }
#tr-input:focus { border-color: var(--peacock); outline: none; box-shadow: 0 0 0 4px var(--peacock-soft); }
.tr-hint { font-size: .9rem; color: var(--ink-3); margin-top: -6px; }
.tr-hint:empty { display: none; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tr-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-chip { min-height: 40px; padding: 4px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 500; color: var(--ink-2); }
.tr-chip.ml { font-family: var(--f-ml); }
.tr-chip:hover { border-color: var(--peacock); color: var(--ink); }
.tr-out { margin-top: 22px; display: grid; gap: 12px; }
.tr-card { display: grid; gap: 8px; justify-items: start; padding: 26px; border-radius: var(--r-xl); background: linear-gradient(160deg, var(--zari-soft), var(--surface) 70%); border: 1px solid var(--line); }
.tr-ml { font: 700 clamp(1.8rem, 1.3rem + 2vw, 2.6rem)/1.45 var(--f-display); color: var(--peacock-deep); }
.tr-translit { font: 600 1.1rem var(--f-ui); color: var(--zari-deep); font-style: italic; }
.tr-en, .tr-from { font-size: 1.15rem; display: grid; gap: 2px; }
.tr-from { margin-bottom: 10px; color: var(--ink-2); }
.tr-label { font: 700 .72rem var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.tr-note { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); color: var(--ink-2); }
.tr-small { font-size: .85rem; color: var(--ink-3); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }

/* ==========================================================================
   Word World · Let's Read · Let's Speak · Story World
   ========================================================================== */
.hue-gold { --h1: var(--zari-soft); --h2: var(--marigold); --hi: var(--zari-deep); }
.hue-red  { --h1: var(--kumkum-soft);  --h2: #E0703A;         --hi: var(--kumkum); }
.hue-teal { --h1: var(--peacock-soft); --h2: var(--peacock);     --hi: var(--peacock-deep); }
.hue-leaf { --h1: var(--leaf-soft); --h2: var(--leaf);     --hi: var(--leaf); }
.hue-sky  { --h1: #E2F1F6;          --h2: #3E8FB0;         --hi: #226A87; }
:root[data-theme="dark"] .hue-sky { --h1: #16323D; --hi: #8CCBE3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hue-sky { --h1: #16323D; --hi: #8CCBE3; } }

/* Module heads */
.mod-head { position: relative; padding: 26px 26px 26px; border-radius: var(--r-xl); background: linear-gradient(135deg, var(--h1), var(--surface) 75%); border: 1px solid var(--line); overflow: hidden; }
.mod-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mod-head h1 .ml { color: var(--hi); }
.mod-emoji { position: absolute; right: 18px; top: 50%; translate: 0 -50%; font-size: clamp(4rem, 3rem + 5vw, 7.5rem); line-height: 1; opacity: .9; filter: drop-shadow(0 8px 14px rgba(0,0,0,.12)); pointer-events: none; }
.mod-head .lede { max-width: 52ch; position: relative; }
@media (max-width: 560px) { .mod-emoji { top: 18px; translate: 0; font-size: 3.2rem; opacity: .85; } .mod-head .lede, .mod-head h1 { padding-right: 0; } .mod-head .eyebrow { padding-right: 64px; } }

/* Explore strip on the student home */
.explore { margin-top: 28px; }
.explore-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 860px) { .explore-grid { grid-template-columns: repeat(3, 1fr); } }
.explore-card { position: relative; display: grid; gap: 2px; align-content: end; min-height: 150px; padding: 16px 16px 14px; border-radius: 28px; text-decoration: none; color: var(--ink); background: linear-gradient(160deg, var(--h1), var(--surface) 80%); border: 1px solid var(--line); box-shadow: var(--shadow-1); overflow: hidden; transition: transform .25s var(--spring), box-shadow .25s; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.explore-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-2); }
.explore-emoji { position: absolute; top: 10px; right: 12px; font-size: 3rem; line-height: 1; transition: transform .3s var(--spring); }
.explore-card:hover .explore-emoji { transform: scale(1.15) rotate(-8deg); }
.explore-ml { font: 800 1.35rem/1.25 var(--f-display); color: var(--hi); padding-right: 52px; }
.explore-en { font-weight: 700; }
.explore-note { font-size: .88rem; color: var(--ink-2); }

/* Word World */
.place-grid { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.place-card { position: relative; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 22px 14px 18px; border-radius: 30px; text-decoration: none; color: var(--ink); background: radial-gradient(circle at 50% 30%, var(--h1) 0 45%, var(--surface) 75%); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s var(--spring), box-shadow .25s; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.place-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.place-emoji { font-size: 3.8rem; line-height: 1.1; transition: transform .3s var(--spring); }
.place-card:hover .place-emoji { transform: scale(1.12) rotate(-6deg); }
.place-ml { font: 800 1.4rem/1.3 var(--f-display); color: var(--hi); }
.place-en { font-weight: 700; color: var(--ink-2); }
.place-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; font-size: .85rem; color: var(--ink-3); }
.place-meter { width: 70%; height: 8px; border-radius: 6px; background: var(--ring-track); overflow: hidden; margin-top: 4px; }
.place-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--zari), var(--marigold)); border-radius: 6px; }
.place-hero { display: flex; align-items: center; gap: 18px; padding: 20px 24px; border-radius: var(--r-xl); background: linear-gradient(135deg, var(--h1), var(--surface) 80%); border: 1px solid var(--line); margin-bottom: 18px; }
.place-hero h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.place-hero h1 .ml { color: var(--hi); }
.place-hero .h-en { font-size: 1.05rem; }
.place-hero-emoji { font-size: clamp(3.4rem, 2.5rem + 4vw, 5.5rem); line-height: 1; animation: pop .5s var(--spring) both; }
.place-intro { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 6px; font-size: 1.05rem; }
.place-intro .en { font-size: .95rem; }
@media (max-width: 560px) { .place-hero { flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; } }
.world-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; padding: 6px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.world-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font-weight: 700; cursor: pointer; }
.world-tab .ml { font-size: 1.02rem; }
.world-tab .en { font-size: .85rem; color: inherit; opacity: .8; }
.world-tab[aria-selected="true"] { background: var(--peacock); color: var(--on-peacock); box-shadow: 0 3px 0 var(--peacock-deep); }
:root[data-theme="dark"] .world-tab[aria-selected="true"] { color: #06231F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .world-tab[aria-selected="true"] { color: #06231F; } }
@media (max-width: 520px) { .world-tabs { width: 100%; } .world-tab { flex: 1; justify-content: center; padding: 0 8px; } .world-tab .en { display: none; } }
.world-stage > .act-lede, .read-stage .act-lede { text-align: center; margin-bottom: 16px; color: var(--ink-2); }

/* Tappable Tamil text */
.rt { display: grid; gap: 4px; }
.rt-line { margin: 0; font-family: var(--f-display); font-weight: 700; color: var(--ink); line-height: 1.7; text-wrap: pretty; }
.rt--md .rt-line, .rt-line.rt--md { font-size: 1.3rem; }
.rt--lg .rt-line, .rt-line.rt--lg { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.rt--xl .rt-line, .rt-line.rt--xl { font-size: clamp(2.6rem, 2rem + 3vw, 4rem); line-height: 1.4; }
.rt-word { font: inherit; color: inherit; background: none; border: 0; padding: 0 .06em; margin: 0; border-radius: 10px; cursor: pointer; transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.rt-word:hover { background: var(--zari-soft); }
.rt-word.is-playing, .rt-word.is-reading { background: var(--marigold); color: var(--on-marigold); box-shadow: 0 0 0 3px var(--marigold); }
.rt-line.is-playing { text-decoration: underline wavy var(--marigold) 2px; text-underline-offset: 8px; }
.rt-translit { font-size: .95rem; font-style: italic; color: var(--zari-deep); font-weight: 600; }
.rt-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rt-controls .audio-btn { border: 1px solid var(--line); background: var(--surface); }
.rt-controls .audio-btn--main { border-color: transparent; background: var(--peacock); }
.rt-controls .audio-btn[aria-pressed="true"] { background: var(--zari-soft); border-color: var(--zari); color: var(--zari-deep); }

/* Let's Read */
.ladder { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 22px; counter-reset: rung; }
.rung { position: relative; padding: 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.rung + .rung::before { content: ""; position: absolute; left: 44px; top: -24px; width: 4px; height: 24px; background: repeating-linear-gradient(var(--zari) 0 6px, transparent 6px 10px); }
.rung-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.rung-n { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 18px; background: var(--zari-soft); font-size: 1.7rem; }
.rung h2 { font-size: 1.5rem; display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; }
.rung h2 .ml { color: var(--peacock-deep); }
.rung h2 .en { font: 600 .95rem var(--f-ui); }
.rung-about { color: var(--ink-2); }
.set-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.set-card { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .2s var(--spring), border-color .2s; }
.set-card:hover { transform: translateY(-2px); border-color: var(--peacock); }
.set-card > .icon { margin-left: auto; color: var(--peacock); }
.set-card .chip { margin-left: auto; }
.set-card.is-done { background: var(--leaf-soft); }
.set-pic { font-size: 1.9rem; line-height: 1; }
.set-text { display: grid; }
.set-text .ml { font-weight: 700; font-size: 1.08rem; }
.set-text .en { font-size: .88rem; }
.read-pick { justify-items: center; }
.pick-text { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 22px 26px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); min-width: min(100%, 360px); }
.pick-text .link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.choices--3 { max-width: 640px; }
@media (min-width: 760px) { .choices--3 { grid-template-columns: repeat(3, 1fr); } }
.choices--3 .choice:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 8px); }
@media (min-width: 760px) { .choices--3 .choice:last-child:nth-child(odd) { grid-column: auto; width: auto; justify-self: stretch; } }
.pic-emoji { display: grid; place-items: center; min-height: 118px; font-size: clamp(2.8rem, 2rem + 3vw, 4rem); line-height: 1.1; letter-spacing: .04em; }
.pick-meaning { min-height: 1.5em; font-weight: 700; color: var(--peacock-deep); text-align: center; }
.passage-card { display: grid; gap: 18px; padding: 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
@media (min-width: 860px) { .passage-card { grid-template-columns: 280px 1fr; align-items: start; } .passage-card .rt-controls { grid-column: 2; } }
.passage-text { display: grid; gap: 12px; }
.passage-line { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: start; padding: 6px 10px; border-radius: 16px; transition: background .2s; }
.passage-line.is-reading { background: var(--zari-soft); }
.passage-line .passage-en { grid-column: 1 / -1; }
.passage-en, .page-en { color: var(--ink-2); font-size: 1rem; }
.passage .act-foot { margin-top: 20px; }
.passage .quiz { margin-top: 24px; }

/* Quiz */
.quiz { display: grid; gap: 16px; padding: 22px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.quiz-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.quiz-head .sec-title { margin: 0; }
.quiz-ml { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 800 clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem)/1.5 var(--f-display); color: var(--peacock-deep); }
.quiz-opts { display: grid; gap: 10px; }
@media (min-width: 760px) { .quiz-opts { grid-template-columns: repeat(3, 1fr); } }
.quiz-opt { position: relative; display: grid; gap: 2px; justify-items: start; text-align: left; padding: 14px 44px 14px 18px; min-height: 64px; border-radius: 20px; border: 3px solid var(--line); background: var(--surface-2); cursor: pointer; transition: transform .2s var(--spring), border-color .2s; }
.quiz-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--peacock); }
.quiz-opt-ml { font: 700 1.2rem/1.5 var(--f-display); }
.quiz-opt-en { font-size: .88rem; }
.quiz-opt.is-right { border-color: var(--leaf); background: var(--leaf-soft); }
.quiz-opt.is-wrong { border-color: var(--kumkum); background: var(--kumkum-soft); opacity: .75; animation: shake .4s; }
.quiz-opt .choice-mark { top: 50%; translate: 0 -50%; }
.is-right .choice-mark .icon { background: var(--leaf); }

/* Scenes */
.scene { position: relative; overflow: hidden; border-radius: 26px; aspect-ratio: 16 / 9; isolation: isolate; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); --sky-a: #BFE3EA; --sky-b: #FFF4DE; --gnd: #9CCB7A; --gnd-b: #7DB35E; }
.scene-size--sm { aspect-ratio: 4 / 3; border-radius: 20px; }
.scene-size--lg { max-height: 340px; width: 100%; }
.scene-sky { position: absolute; inset: 0; background: linear-gradient(var(--sky-a), var(--sky-b)); z-index: -2; }
.scene-ground { position: absolute; left: -5%; right: -5%; bottom: -14%; height: 42%; border-radius: 50% 50% 0 0 / 40% 40% 0 0; background: linear-gradient(var(--gnd), var(--gnd-b)); z-index: -1; }
.scene-art { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2%; padding: 0 6% 9%; }
.scene-e { font-size: clamp(2.2rem, 7vw, 4.2rem); line-height: 1; filter: drop-shadow(0 6px 6px rgba(0,0,0,.14)); }
.scene-e.is-star { font-size: clamp(3rem, 11vw, 6.2rem); }
.scene-size--sm .scene-e { font-size: 2.2rem; } .scene-size--sm .scene-e.is-star { font-size: 3.4rem; }
.scene-e.bob { animation: bob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
.scene--hot { --sky-a: #FFC960; --sky-b: #FFF0C8; --gnd: #E7C58E; --gnd-b: #D9AE6C; }
.scene--river { --sky-a: #A6D7E2; --sky-b: #EAF6F2; --gnd: #6FB3C4; --gnd-b: #3E8F9F; }
.scene--lake { --sky-a: #FBD9A5; --sky-b: #CDEBEE; --gnd: #5AA7B6; --gnd-b: #2F7E8E; }
.scene--rain { --sky-a: #7E90A2; --sky-b: #C3CFD6; --gnd: #6E9A74; --gnd-b: #4F7F57; }
.scene--night { --sky-a: #1B2A55; --sky-b: #3F4F82; --gnd: #22442F; --gnd-b: #16301F; }
.scene--home { --sky-a: #F7E4C8; --sky-b: #F1D5AC; --gnd: #C99A6B; --gnd-b: #A97C50; }
.scene--forest { --sky-a: #CDE8C3; --sky-b: #F0F7E4; --gnd: #5A9A4E; --gnd-b: #3F7A36; }
.scene--festival { --sky-a: #FFE3A8; --sky-b: #FFD3DD; --gnd: #93C46C; --gnd-b: #6FA64B; }
.scene--river .scene-ground, .scene--lake .scene-ground { border-radius: 0; height: 36%; bottom: 0; background: linear-gradient(var(--gnd), var(--gnd-b)); box-shadow: 0 -10px 0 -2px #7DB35E; }
.scene--home .scene-ground { border-radius: 0; height: 30%; bottom: 0; }
.scene-rain { position: absolute; inset: -20% 0 0; z-index: -1; background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(255,255,255,.55) 14px 16px); background-size: 60px 60px; animation: rain .7s linear infinite; opacity: .7; }
@keyframes rain { to { background-position: -20px 60px; } }
.scene-stars { position: absolute; inset: 0; z-index: -1; background: radial-gradient(1.5px 1.5px at 20% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 70% 12%, #fff, transparent), radial-gradient(2px 2px at 45% 30%, #FFF3C4, transparent), radial-gradient(1.5px 1.5px at 85% 35%, #fff, transparent), radial-gradient(1.5px 1.5px at 10% 40%, #fff, transparent); }

/* Let's Speak */
.conv-grid { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.conv-card { position: relative; display: grid; gap: 2px; padding: 20px 18px 16px; min-height: 150px; align-content: end; border-radius: 28px; text-decoration: none; color: var(--ink); background: linear-gradient(150deg, var(--h1), var(--surface) 75%); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s var(--spring), box-shadow .25s; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.conv-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.conv-emoji { position: absolute; top: 14px; right: 16px; font-size: 2.8rem; line-height: 1; }
.conv-ml { font: 800 1.35rem/1.3 var(--f-display); color: var(--hi); padding-right: 50px; }
.conv-en { font-weight: 700; }
.conv-with { font-size: .88rem; color: var(--ink-2); }
.conv-card .chip { position: absolute; top: 14px; left: 16px; }
.phrasebook { margin-top: 8px; }
.phrase-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.phrase { position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 12px 14px; min-height: 68px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .2s var(--spring), border-color .2s; }
.phrase:hover { transform: translateY(-2px); border-color: var(--marigold); }
.phrase-pic { grid-row: 1 / 3; font-size: 1.9rem; line-height: 1; }
.phrase-ml { font: 700 1.15rem/1.4 var(--f-display); }
.phrase-en { grid-column: 2; font-size: .86rem; }
.phrase-spk { grid-column: 3; grid-row: 1 / 3; color: var(--marigold-deep); }
.phrase.is-playing { border-color: var(--marigold); background: var(--zari-soft); }
.conv-hero { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--r-xl); background: linear-gradient(135deg, var(--h1), var(--surface) 80%); border: 1px solid var(--line); margin-bottom: 18px; }
.conv-hero h1 { font-size: clamp(1.9rem, 1.5rem + 2vw, 2.6rem); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.conv-hero h1 .ml { color: var(--hi); }
.conv-hero .h-en { font-size: 1.05rem; }
.conv-hero-emoji { font-size: 3.6rem; line-height: 1; }
.conv-stage { display: grid; gap: 16px; max-width: 760px; margin: 0 auto; }
.chat { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.chat:empty { display: none; }
.bubble-row { display: flex; gap: 10px; align-items: flex-end; animation: pop .35s var(--spring) both; }
.bubble-row.from-you { flex-direction: row-reverse; }
.bubble-av { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-size: 1.7rem; }
.chat-bubble { position: relative; display: grid; gap: 2px; max-width: min(560px, 82%); padding: 12px 16px 10px; border-radius: 24px 24px 24px 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.from-you .chat-bubble { border-radius: 24px 24px 8px 24px; background: var(--peacock-soft); border-color: transparent; }
.bubble-name { font: 700 .78rem var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.bubble-en { font-size: .92rem; }
.bubble-tools { position: absolute; right: 4px; top: 2px; }
.chat-bubble .rt { padding-right: 32px; }
.chat-dock { position: sticky; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
@media (min-width: 960px) { .chat-dock { bottom: 16px; } }
.dock-wait { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 14px; color: var(--ink-2); font-weight: 600; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { transform: translateY(-5px); opacity: .5; } }
.turn, .conv-intro, .talk-done { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 20px; border-radius: var(--r-xl); background: var(--surface); border: 3px solid var(--marigold); box-shadow: var(--shadow-2); }
.conv-intro, .talk-done { border-color: var(--line); border-width: 1px; }
.turn-label { font: 800 1.05rem var(--f-ui); color: var(--marigold-deep); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.turn-label .ml { font-family: var(--f-display); font-size: 1.3rem; }
.turn-line .rt { justify-items: center; }
.turn-hidden { font-weight: 600; color: var(--ink-2); padding: 8px 0; }
.turn-en { font-weight: 600; color: var(--ink-2); }
.turn-tip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px; border-radius: var(--r-pill); background: var(--zari-soft); color: var(--zari-deep); font-weight: 700; font-size: .9rem; }
.turn-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.conv-setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font: 700 1.2rem/1.5 var(--f-display); }
.conv-cast { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 6px 0; }
.cast { display: inline-flex; align-items: center; gap: 10px; text-align: left; padding: 8px 14px 8px 8px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); }
.cast-av { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); font-size: 1.7rem; }
.cast-vs { font-size: 1.5rem; }
.challenge { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.challenge input { width: 22px; height: 22px; accent-color: var(--peacock); }

/* Story World */
.shelf { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.book { display: grid; height: 100%; border-radius: 26px; overflow: hidden; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s var(--spring), box-shadow .25s; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.book:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: var(--shadow-2); }
.book-cover .scene { border-radius: 0; aspect-ratio: 16 / 9; }
.book-cover .scene-e.is-star { font-size: 4.2rem; }
.book-body { display: grid; gap: 4px; align-content: start; padding: 14px 18px 18px; }
.book-ml { font: 800 1.45rem/1.3 var(--f-display); color: var(--peacock-deep); }
.book-en { font-weight: 700; }
.book-blurb { color: var(--ink-2); font-size: .95rem; }
.book-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.book-meta .stars .icon { width: 22px; height: 22px; }
.story { max-width: 900px; margin: 0 auto; }
.story-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.story-top-title { font: 800 1.2rem var(--f-display); color: var(--peacock-deep); flex: 1; min-width: 0; }
.page-dots { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.pdot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); cursor: pointer; padding: 0; }
.pdot.is-seen { background: var(--zari-soft); border-color: var(--zari); }
.pdot.is-current { background: var(--marigold); border-color: var(--marigold-deep); transform: scale(1.1); }
.story-cover, .page { display: grid; gap: 18px; }
.cover-body { display: grid; gap: 10px; justify-items: start; }
.cover-body h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cover-body h1 .ml { color: var(--peacock-deep); }
.cover-body .sec-title { margin: 8px 0 0; font-size: 1.15rem; }
.story-words { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sw { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px 6px 8px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.sw:hover { border-color: var(--marigold); }
.sw.is-playing { background: var(--zari-soft); }
.sw-pic { font-size: 1.6rem; line-height: 1; }
.sw .ml { font-weight: 700; font-size: 1.08rem; }
.sw .en { font-size: .85rem; }
.sw-spk { color: var(--marigold-deep); }
.cover-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.page { animation: pageIn .45s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateX(24px); } }
.page-text { display: grid; gap: 12px; padding: 20px 22px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.page-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-count { font-weight: 700; color: var(--ink-3); }
.the-end { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 30px 20px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-2); }
.end-title { font: 800 3rem var(--f-display); color: var(--peacock-deep); display: flex; align-items: center; gap: 10px; }
.moral { display: grid; justify-items: center; gap: 8px; padding: 18px 22px; border-radius: 24px; background: var(--zari-soft); max-width: 560px; }
.moral .rt { justify-items: center; }

@media (prefers-reduced-motion: reduce) {
  .scene-e.bob, .scene-rain, .typing i { animation: none; }
  .explore-card, .place-card, .conv-card, .book, .page, .bubble-row { animation: none; }
}
:root[data-motion="reduced"] .scene-e.bob, :root[data-motion="reduced"] .scene-rain { animation: none; }

/* Refinements */
.pic-emoji, .scene-e, .place-emoji, .explore-emoji, .mod-emoji, .conv-emoji, .phrase-pic, .sw-pic, .set-pic, .place-hero-emoji, .conv-hero-emoji, .bubble-av, .cast-av {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pic-emoji { white-space: nowrap; font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); }
.choices--3 .choice { width: 100%; overflow: hidden; }
@media (min-width: 700px) { .mod-head { padding-right: clamp(150px, 20vw, 210px); } }
@media (max-width: 560px) { .explore-emoji { font-size: 2.2rem; top: 8px; right: 8px; } .explore-card { min-height: 140px; padding-top: 44px; } .explore-ml { padding-right: 0; font-size: 1.2rem; } }
.passage-card .scene { align-self: start; height: auto; }
@media (min-width: 860px) { .passage-card .scene { aspect-ratio: 4 / 3; } }
.cover-body .h-en { font-size: 1.15rem; }
.book { grid-template-columns: minmax(0, 1fr); align-content: start; }
@media (max-width: 560px) { .conv-hero { flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px; } .conv-hero-emoji { font-size: 2.6rem; } }
.pic-emoji--1 { font-size: clamp(3.4rem, 2.6rem + 3vw, 4.6rem); }
.pic-emoji--2 { font-size: clamp(2.6rem, 2rem + 2vw, 3.4rem); }
.pic-emoji--3 { font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.5rem); letter-spacing: 0; }
@media (max-width: 520px) { .world-tabs { flex-wrap: nowrap; gap: 4px; padding: 4px; } .world-tab { min-width: 0; gap: 4px; padding: 0 6px; } .world-tab .icon { display: none; } .world-tab .ml { font-size: .92rem; white-space: nowrap; } }
@media (max-width: 560px) { .story-top { row-gap: 4px; } .page-dots { order: 3; width: 100%; } .pdot { width: 24px; height: 24px; } }
@media (max-width: 700px) { .chat-dock { position: static; } .turn { padding: 16px 12px; } .turn .rt--lg .rt-line { font-size: 1.45rem; } }

/* Playing audio buttons: tap again to stop */
.ab-icon { display: inline-flex; }
.audio-btn.is-active:not(.audio-btn--main) { background: var(--zari-soft); color: var(--zari-deep); }
.audio-btn.is-active .icon { width: 1.1em; height: 1.1em; }

/* ==========================================================================
   Games · My Tamil Nadu
   ========================================================================== */
.game-grid { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.game-card { position: relative; display: grid; gap: 4px; align-content: start; min-height: 190px; padding: 22px 20px 18px; border-radius: 30px; text-decoration: none; color: var(--ink); background: linear-gradient(160deg, var(--h1), var(--surface) 78%); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s var(--spring), box-shadow .25s; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.game-card:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: var(--shadow-2); }
.game-emoji { font-size: 3.4rem; line-height: 1.1; transition: transform .3s var(--spring); }
.game-card:hover .game-emoji { transform: scale(1.15) rotate(-8deg); }
.game-ml { font: 800 1.4rem/1.3 var(--f-display); color: var(--hi); }
.game-en { font-weight: 700; }
.game-about { color: var(--ink-2); font-size: .92rem; }
.game-card .chip { justify-self: start; margin-top: 4px; }
.group-pick { display: grid; gap: 8px; margin-bottom: 20px; }
.group-pick-label { font-weight: 700; color: var(--ink-2); }
.group-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.group-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.group-chip .ml { font-size: 1rem; }
.group-chip[aria-pressed="true"] { background: var(--peacock); color: var(--on-peacock); border-color: transparent; }
:root[data-theme="dark"] .group-chip[aria-pressed="true"] { color: #06231F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .group-chip[aria-pressed="true"] { color: #06231F; } }

/* Memory */
.game-memory { justify-items: center; }
.mem-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 560px); }
@media (min-width: 700px) { .mem-board { grid-template-columns: repeat(4, 1fr); width: min(100%, 720px); } }
.mem-card { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; perspective: 800px; }
.mem-back, .mem-front { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 22px; backface-visibility: hidden; transition: transform .45s var(--ease); }
.mem-back { background: radial-gradient(circle at 50% 40%, var(--marigold), var(--marigold-deep)); box-shadow: 0 4px 0 var(--zari-deep); font-size: 2.2rem; }
.mem-front { background: var(--surface); border: 3px solid var(--line); transform: rotateY(180deg); padding: 6px; }
.mem-card.is-up .mem-back { transform: rotateY(180deg); }
.mem-card.is-up .mem-front { transform: rotateY(0); }
.mem-card.is-matched .mem-front { border-color: var(--leaf); background: var(--leaf-soft); }
.mem-front .picture { width: min(84px, 80%); }
.mem-word { font: 700 clamp(1.1rem, .9rem + 1vw, 1.5rem)/1.3 var(--f-ml); text-align: center; overflow-wrap: anywhere; }

/* Bubbles */
.pond { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; padding: 24px 10px; border-radius: var(--r-xl); background: linear-gradient(#DDF1F6, #BFE3EA); min-height: 260px; align-content: center; }
:root[data-theme="dark"] .pond { background: linear-gradient(#123840, #0C2A30); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pond { background: linear-gradient(#123840, #0C2A30); } }
.bubble-btn { display: grid; place-items: center; width: clamp(120px, 28vw, 160px); aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); cursor: pointer; color: var(--ink); background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.95) 0 8%, rgba(255,255,255,.55) 18%, rgba(190,227,234,.55) 55%, rgba(120,190,210,.55)); box-shadow: inset -6px -10px 18px rgba(10,107,115,.18), 0 8px 18px rgba(43,21,20,.12); animation: float 3.4s ease-in-out infinite; animation-delay: calc(var(--d) * -1); transition: transform .2s var(--spring), opacity .3s; }
.bubble-btn .ml { font: 700 clamp(1.15rem, 1rem + .8vw, 1.5rem)/1.3 var(--f-ml); padding: 8px; overflow-wrap: anywhere; }
.bubble-btn:hover:not(:disabled) { transform: scale(1.06); }
.bubble-btn.is-popped { animation: popb .5s var(--ease) forwards; }
.bubble-btn.is-wrong { opacity: .45; animation: shake .4s; }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes popb { 40% { transform: scale(1.25); } to { transform: scale(0); opacity: 0; } }

/* Missing piece */
.game-missing { justify-items: center; }
.missing-board { display: grid; justify-items: center; gap: 10px; padding: 22px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); min-width: min(100%, 360px); }
.missing-word { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.missing-part, .missing-gap { display: grid; place-items: center; min-width: 64px; min-height: 72px; padding: 4px 10px; border-radius: 16px; font: 700 clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem)/1.3 var(--f-ml); background: var(--surface-2); border: 2px solid var(--line); }
.missing-gap { border-style: dashed; border-color: var(--marigold); color: var(--marigold-deep); background: var(--zari-soft); }
.missing-part.is-new { background: var(--leaf-soft); border-color: var(--leaf); animation: pop .4s var(--spring); }
.missing-opts, .scr-tray { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.tile.is-right { border-color: var(--leaf); background: var(--leaf-soft); }
.tile.is-wrong { opacity: .45; }

/* Sentence scramble */
.game-scramble { justify-items: center; }
.scr-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.scr-top .audio-btn { border: 1px solid var(--line); background: var(--surface); }
.scr-en { font-weight: 700; color: var(--ink-2); text-align: center; font-size: 1.1rem; }
.scr-line { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 18px; min-height: 96px; width: min(100%, 760px); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.scr-slot { display: grid; place-items: center; min-width: 72px; min-height: 58px; padding: 2px 12px; border-radius: 14px; border: 2px dashed var(--line-2); font: 700 clamp(1.3rem, 1.1rem + 1vw, 1.8rem)/1.4 var(--f-ml); }
.scr-slot.is-filled { border-style: solid; border-color: var(--leaf); background: var(--leaf-soft); animation: pop .3s var(--spring); }
.tile.shake { animation: shake .4s; }

/* My Tamil Nadu cards */
.k-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin: 18px 0 26px; align-items: start; }
.k-grid--journey { counter-reset: none; }
.k-card { position: relative; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); overflow: hidden; transition: box-shadow .25s; }
.k-card.is-open { box-shadow: var(--shadow-2); border-color: var(--zari); }
.k-face { position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; text-align: left; padding: 16px 18px; border: 0; background: none; cursor: pointer; color: var(--ink); }
.k-emoji { grid-row: 1 / 3; font-size: 2.8rem; line-height: 1; transition: transform .3s var(--spring); }
.k-card.is-open .k-emoji { transform: scale(1.12) rotate(-6deg); }
.k-ml { font: 800 1.35rem/1.3 var(--f-ml); color: var(--peacock-deep); }
.k-en { font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.k-num { position: absolute; top: 8px; right: 12px; font: 800 .8rem var(--f-ui); color: var(--zari-deep); background: var(--zari-soft); border-radius: var(--r-pill); padding: 2px 8px; }
.k-body { display: none; gap: 8px; padding: 0 18px 18px; animation: rise .35s var(--ease); }
.k-card.is-open .k-body { display: grid; }
.k-say { display: flex; align-items: flex-start; gap: 6px; padding: 10px 12px; border-radius: 16px; background: var(--zari-soft); }
.k-say .rt { flex: 1; }
.k-say .rt-line { font-size: 1.15rem; }
.k-sayen { font-size: .92rem; }
.k-fact { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: .95rem; }
.k-fact .icon { color: var(--marigold-deep); flex: none; margin-top: 2px; }
.k-quiz { display: grid; justify-items: center; margin: 10px 0 20px; }
.k-quiz .quiz { width: 100%; }
@media (prefers-reduced-motion: reduce) { .bubble-btn, .game-card { animation: none; } .mem-back, .mem-front { transition: none; } }
@media (min-width: 700px) { .mem-board { width: min(100%, 600px); } }
.scr-tray .tile { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem); min-height: 60px; padding: 6px 16px; }
.missing-opts .tile { min-width: 72px; }

/* ==========================================================================
   The Thinnai Journey (கற்றல் பயணம்)
   ========================================================================== */
.pathway .h-en, .stage-hero .h-en { font-size: .5em; }
.stage-river { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 16px; }
@media (min-width: 900px) { .stage-river { grid-template-columns: repeat(5, 1fr); } }
.stage-card { position: relative; display: grid; gap: 4px; align-content: start; height: 100%; padding: 20px 18px 18px; border-radius: 28px; text-decoration: none; color: var(--ink); background: linear-gradient(170deg, color-mix(in srgb, var(--stage) 16%, var(--surface)), var(--surface) 70%); border: 1px solid var(--line); border-top: 6px solid var(--stage); box-shadow: var(--shadow-1); transition: transform .25s var(--spring), box-shadow .25s; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.stage-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.stage-card.is-mine { outline: 3px solid var(--marigold); outline-offset: 3px; }
.stage-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--stage); color: #fff; font: 800 1.3rem var(--f-display); }
.stage-ml { font: 800 1.9rem/1.3 var(--f-ml); color: var(--stage); margin-top: 6px; }
:root[data-theme="dark"] .stage-ml { color: color-mix(in srgb, var(--stage) 55%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stage-ml { color: color-mix(in srgb, var(--stage) 55%, #fff); } }
.stage-en { font-weight: 800; }
.stage-grades { font-size: .88rem; font-weight: 700; color: var(--zari-deep); }
.stage-sum { font-size: .9rem; color: var(--ink-2); margin-top: 4px; }
.stage-meta { font-size: .82rem; color: var(--ink-3); margin-top: 6px; }
.stage-card .chip { justify-self: start; margin-top: 6px; }

.stage-hero { display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; border-radius: var(--r-xl); background: linear-gradient(135deg, color-mix(in srgb, var(--stage) 18%, var(--surface)), var(--surface) 75%); border: 1px solid var(--line); border-left: 8px solid var(--stage); margin-bottom: 20px; }
.stage-hero h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.stage-hero h1 .ml { color: var(--stage); }
:root[data-theme="dark"] .stage-hero h1 .ml { color: color-mix(in srgb, var(--stage) 55%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stage-hero h1 .ml { color: color-mix(in srgb, var(--stage) 55%, #fff); } }
.stage-hero-num { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--stage); color: #fff; font: 800 1.8rem var(--f-display); }
.stage-hero .chip { margin-top: 8px; }
@media (max-width: 560px) { .stage-hero { flex-direction: column; gap: 8px; padding: 18px; } .stage-hero-num { width: 48px; height: 48px; font-size: 1.4rem; } }
.stage-goals { margin-bottom: 26px; }
.can-do { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.can-do li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.can-do .icon { color: var(--marigold-deep); flex: none; margin-top: 2px; }
.stage-year { padding: 20px; border-radius: var(--r-xl); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 22px; }
.stage-year.is-mine { border: 2px solid var(--marigold); }
.year-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.year-head h2 { font-size: 1.5rem; }
.year-label { font: 700 .95rem var(--f-ui); color: var(--zari-deep); margin-left: 6px; }
.year-focus { color: var(--ink-2); margin: 4px 0 12px; }
.term-name { font: 800 .85rem var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 10px; }
.unit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.unit-list--one { grid-template-columns: 1fr; }
.unit { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.unit.is-done { background: color-mix(in srgb, var(--leaf-soft) 55%, var(--surface)); }
.unit.is-current { border: 2px solid var(--marigold); }
.unit-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.unit-head > div { flex: 1; min-width: 0; }
.unit-ml { font: 800 1.2rem/1.35 var(--f-ml); color: var(--peacock-deep); }
.unit-en { font-weight: 700; font-size: .92rem; }
.unit-cover { font-size: .9rem; color: var(--ink-2); }
.unit-letters { display: flex; flex-wrap: wrap; gap: 6px; }
.unit-letter { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--peacock-soft); color: var(--peacock-deep); font: 700 1.3rem var(--f-ml); text-decoration: none; border: 2px solid transparent; }
.unit-letter:hover { border-color: var(--peacock); }
.unit-letter.is-done { background: var(--leaf-soft); color: var(--leaf); border-color: var(--leaf); }
.unit-links { display: grid; gap: 6px; }
.unit-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.unit-link:hover { border-color: var(--peacock); }
.unit-link > span { display: grid; line-height: 1.25; }
.unit-link .ml { font-weight: 700; }
.unit-link .en { font-size: .8rem; }
.unit-link .icon { color: var(--peacock); }
.unit-link.is-done { background: var(--leaf-soft); }
.unit-link.is-done .icon { color: var(--leaf); }
.unit-soon { display: flex; gap: 6px; align-items: flex-start; font-size: .84rem; color: var(--zari-deep); background: var(--zari-soft); padding: 8px 10px; border-radius: 12px; }
.unit-soon .icon { flex: none; width: 1.1em; height: 1.1em; margin-top: 2px; }
.year-strands { margin-top: 14px; }
.year-strands summary { cursor: pointer; font-weight: 700; color: var(--peacock); min-height: 44px; display: flex; align-items: center; }
.year-strands dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 0; }
.year-strands dt { font-weight: 700; color: var(--peacock-deep); }
.year-strands dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { .year-strands dl { grid-template-columns: 1fr; } .year-strands dd { margin-bottom: 6px; } }
.stage-foot { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin-bottom: 18px; }
.stage-foot h3 { display: flex; align-items: center; gap: 6px; font-size: 1.1rem; margin-bottom: 6px; }

/* Student home: my path */
.my-path { margin-top: 28px; }
.my-path-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.my-path-body { display: grid; gap: 14px; align-items: start; }
@media (min-width: 860px) { .my-path-body { grid-template-columns: 240px 1fr; } .my-path-go { grid-column: 2; justify-self: start; } }
.my-stage { display: grid; gap: 4px; padding: 18px; border-radius: 24px; text-decoration: none; color: var(--ink); background: linear-gradient(170deg, color-mix(in srgb, var(--stage) 18%, var(--surface)), var(--surface) 80%); border: 1px solid var(--line); border-top: 6px solid var(--stage); }
.my-stage-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--stage); color: #fff; font: 800 1.2rem var(--f-display); }
.my-stage-ml { font: 800 1.8rem/1.3 var(--f-ml); color: var(--stage); }
:root[data-theme="dark"] .my-stage-ml { color: color-mix(in srgb, var(--stage) 55%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .my-stage-ml { color: color-mix(in srgb, var(--stage) 55%, #fff); } }
.my-stage-en { font-weight: 800; }
.my-stage-meta { font-size: .85rem; color: var(--ink-2); }
.my-stage .meter { width: 100%; }
a.level-pill { text-decoration: none; color: inherit; }

/* ---------- Voice check (teachers) ---------- */
.vc-how summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.vc-how ol { margin: 12px 0 8px; padding-left: 1.3em; display: grid; gap: 6px; }
.vc-hint { color: var(--ink-3); font-size: .85rem; }
.vc-bar { display: grid; gap: 10px; margin: 18px 0 10px; }
.vc-search { width: 100%; min-height: 46px; padding: 0 16px; border-radius: var(--r-pill); border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.vc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vc-chip { min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); font: 600 .88rem/1 var(--f-ui); cursor: pointer; }
.vc-chip[aria-pressed="true"] { border-color: var(--peacock); background: var(--peacock-soft); color: var(--peacock-deep); }
.vc-summary { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.vc-stats { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vc-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.vc-row { padding: 10px 12px; border-radius: 18px; background: var(--surface-2); border: 2px solid transparent; display: grid; gap: 8px; }
.vc-row.is-ok { border-color: var(--leaf-soft); }
.vc-row.is-fixed { border-color: var(--peacock-soft); }
.vc-main { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.vc-play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--peacock-soft); color: var(--peacock-deep); display: grid; place-items: center; cursor: pointer; }
.vc-play .icon { width: 24px; height: 24px; }
.vc-text { display: grid; min-width: 0; }
.vc-ml { font-size: 1.35rem; font-weight: 700; overflow-wrap: anywhere; }
.vc-meta { color: var(--ink-3); font-size: .82rem; }
.vc-state { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.vc-state:empty { display: none; }
.vc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.vc-empty { padding: 24px; text-align: center; color: var(--ink-3); }
.vc-fixer { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.vc-fixer .field input { font-size: 1.25rem; }
.vc-fixer .seg legend { font-size: .9rem; }
.vc-fixer .seg-opt span { min-height: 38px; font-size: .9rem; }
.vc-fixer-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vc-rec-have { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (min-width: 760px) {
  .vc-row { grid-template-columns: 1fr auto; align-items: center; }
  .vc-main { grid-template-columns: auto minmax(0, 1fr) auto; }
  .vc-state { grid-column: auto; }
  .vc-fixer { grid-column: 1 / -1; }
}

/* ---------- Unit lessons (#/unit/…) ---------- */
.unit-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.unit-step { width: 100%; min-height: 64px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 8px 4px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font-weight: 700; }
.unit-step .ml { font-size: .98rem; }
.unit-step .en { font-size: .75rem; opacity: .8; }
.unit-step-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .8rem; }
.unit-step-num .icon { width: 16px; height: 16px; }
.unit-step.is-done .unit-step-num { background: var(--leaf); color: #fff; }
.unit-step[aria-selected="true"] { border-color: var(--peacock); background: var(--peacock-soft); color: var(--peacock-deep); }
.unit-panel { display: grid; gap: 16px; }
.unit-panel > .unit-next { justify-self: center; margin-top: 8px; }
.say-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.say-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.say-card > .audio-controls, .say-card > :last-child { grid-column: 2; }
.say-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--zari-soft); color: var(--zari-deep); font-weight: 800; }
.say-body .en { margin: 4px 0 0; color: var(--ink-3); }
.say-tip { display: flex; align-items: center; gap: 6px; justify-content: center; color: var(--ink-2); font-weight: 600; }
.rhyme-card { display: grid; gap: 14px; padding: 22px 24px; border-radius: 28px; background: linear-gradient(160deg, var(--zari-soft), var(--surface) 75%); border: 1px solid var(--line); }
.rhyme-line .en { margin: 2px 0 0; color: var(--ink-3); font-size: .92rem; }
.rhyme-line .rt-translit { margin: 0; }
.rhyme-actions { display: flex; justify-content: center; }
.unit-stars { display: grid; justify-items: center; gap: 4px; }
.unit-notes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.unit-note { margin: 0; }
.unit-note h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 1.05rem; }
.unit-note p { margin: 0; }
.unit-more { display: grid; gap: 10px; }
@media (max-width: 640px) {
  .unit-steps { grid-auto-columns: minmax(62px, 1fr); gap: 5px; overflow-x: auto; max-width: calc(100vw - 2 * var(--gutter)); overscroll-behavior-x: contain; padding-bottom: 4px; }
  .unit-step .en { display: none; }
  .unit-step .ml { font-size: .72rem; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
  .lab-grid { min-width: 0; }
  .lab-grid th { padding: 6px 2px; font-size: 1rem; }
  .lab-cell { font-size: 1.2rem; min-height: 44px; padding: 0; }
  .lab-show { font-size: 2.6rem; }
  .say-card { padding: 12px; }
  .rhyme-card { padding: 16px; }
}

/* Read-it-yourself tiles */
.read-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.read-tile { width: 100%; min-height: 150px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 14px; border-radius: 24px; border: 2px dashed var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.read-ml { font-family: var(--f-ml); font-weight: 800; font-size: clamp(2rem, 1.6rem + 1.5vw, 2.6rem); line-height: 1.2; }
.read-tile.is-open { border-style: solid; border-color: var(--leaf); background: var(--leaf-soft); }
.read-back { display: grid; justify-items: center; gap: 4px; }
.read-back[hidden] { display: none; }
.read-en { font-weight: 700; color: var(--ink-2); }

.read-tiles--long { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.read-tiles--long .read-ml { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.8rem); text-align: center; }

/* Letter lab: vowel signs, chillu and joined letters */
.lab-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.lab-card { width: 100%; display: grid; justify-items: center; gap: 4px; padding: 16px 10px; border-radius: 24px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.lab-card.is-open { border-color: var(--peacock); background: var(--peacock-soft); }
.lab-show { font-family: var(--f-ml); font-weight: 800; font-size: 3.2rem; line-height: 1.1; color: var(--peacock-deep); }
.lab-from { font-size: 1rem; color: var(--ink-3); }
.lab-word { font-family: var(--f-ml); font-weight: 800; font-size: 1.5rem; }
.lab-en { font-size: .85rem; color: var(--ink-3); }
.lab-grid-wrap { overflow-x: auto; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.lab-grid { border-collapse: collapse; width: 100%; min-width: 420px; }
.lab-grid th { padding: 8px; font-family: var(--f-ml); font-size: 1.2rem; color: var(--ink-3); background: var(--surface-2); }
.lab-grid td { padding: 3px; text-align: center; }
.lab-cell { width: 100%; min-height: 52px; border: 0; border-radius: 12px; background: transparent; font-family: var(--f-ml); font-weight: 700; font-size: 1.6rem; color: var(--ink); cursor: pointer; }
.lab-cell:hover { background: var(--zari-soft); }
.lab-cell.is-open { background: var(--peacock-soft); color: var(--peacock-deep); }

/* ---------- Word a Day & word generator ---------- */
.wad-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.wad-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 16px; border-radius: var(--r-pill); border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 700; text-decoration: none; }
.wad-tab .en { font-size: .82rem; opacity: .8; }
.wad-tab[aria-current="page"] { background: var(--peacock); border-color: var(--peacock); color: var(--on-peacock); }
.wad-today { display: grid; gap: 14px; justify-items: center; }
.wad-today > .btn { justify-self: center; }
.wad-date { display: flex; align-items: center; gap: 12px; justify-content: center; }
.wad-date p { margin: 0; }
.wcard { width: 100%; display: grid; gap: 16px; padding: 20px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.wcard-top { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.wcard-pic { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 24px; }
.wcard-word { display: grid; gap: 4px; justify-items: start; }
.wcard-ml { margin: 0; font-family: var(--f-ml); font-weight: 800; font-size: clamp(2.4rem, 1.8rem + 3vw, 3.6rem); line-height: 1.2; color: var(--ink); }
.wcard-tr { margin: 0; font-size: 1.05rem; }
.wcard-en { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--ink-2); }
.wcard-note { margin: 0; color: var(--ink-3); }
.wcard-use, .wcard-turn { display: grid; gap: 6px; padding: 14px 16px; border-radius: 20px; }
.wcard-use { background: var(--peacock-soft); }
.wcard-turn { background: var(--zari-soft); }
.wcard-use h3, .wcard-turn h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 1rem; }
.wcard-use .en, .wcard-turn .en { margin: 0; color: var(--ink-2); }
.wcard-turn p { margin: 0; }
.wad-week, .wad-more { margin-top: 28px; }
.wad-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.wad-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.wad-chip .ml { font-weight: 700; }
.wad-chip .en { color: var(--ink-3); font-size: .85rem; }
.wad-more { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.wad-more .explore-card { --i: 0; }
.wad-setup { display: grid; gap: 14px; }
.wad-setup > .btn { justify-self: start; }
.wad-options { display: grid; gap: 14px; }
.wad-options .field select { max-width: 360px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--peacock); }
.wad-run { display: grid; gap: 14px; }
.wad-run-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wad-dots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.wad-dots li { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.wad-dots li.is-seen { background: var(--peacock); }
.wad-dots li.is-current { background: var(--marigold); transform: scale(1.3); }
.wad-run .page-nav { margin-top: 12px; }
.gen-out { display: grid; gap: 14px; margin-top: 8px; }
.gen-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gen-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.gen-item { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.gen-n { font-weight: 800; color: var(--ink-3); min-width: 1.4em; text-align: right; }
.gen-pic { border: 0; padding: 0; background: none; cursor: pointer; }
.gen-word { min-width: 0; }
.gen-ml { margin: 0; font-family: var(--f-ml); font-weight: 800; font-size: 1.4rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gen-meta { margin: 0; color: var(--ink-3); font-size: .9rem; }
.gen-ex { grid-column: 2 / -1; font-size: .92rem; }
.gen-ex summary { cursor: pointer; color: var(--peacock-deep); font-weight: 700; }
.gen-ex p { margin: 4px 0 0; }
.gen-spin { display: grid; place-items: center; min-height: 180px; border-radius: 28px; background: linear-gradient(160deg, var(--sky-soft, var(--peacock-soft)), var(--surface)); }
.gen-reel { margin: 0; font-family: var(--f-ml); font-weight: 800; font-size: 3rem; }
.gen-empty { color: var(--ink-3); }
.today-word { margin: 0 0 24px; }
.today-word-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 24px; text-decoration: none; color: var(--ink); background: linear-gradient(120deg, var(--zari-soft), var(--surface) 70%); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.tw-body { display: grid; gap: 2px; min-width: 0; }
.tw-eyebrow { font-size: .82rem; font-weight: 700; color: var(--zari-deep); }
.tw-ml { font-family: var(--f-ml); font-weight: 800; font-size: 1.7rem; line-height: 1.2; }
.tw-en { color: var(--ink-3); }
.tw-go .icon { width: 28px; height: 28px; color: var(--peacock); }
@media (max-width: 560px) {
  .wcard { padding: 14px; }
  .wcard-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .wcard-word { justify-items: center; }
  .wad-tab .en { display: none; }
}
@media print {
  .topbar, .rail, .tabbar, .wad-tabs, .no-print, .gen-actions, .mod-head .lede, .speaker, .gen-pic { display: none !important; }
  .gen-item { break-inside: avoid; box-shadow: none; }
  .gen-ex { display: block; }
  .gen-ex summary { display: none; }
}

/* Grammar tables, quizzes and writing in unit lessons */
.lab-table-wrap { overflow-x: auto; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.lab-table { border-collapse: collapse; width: 100%; }
.lab-table th { text-align: left; padding: 10px 14px; font-size: .85rem; color: var(--ink-3); background: var(--surface-2); }
.lab-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.lab-table td.ml { font-family: var(--f-ml); font-weight: 700; font-size: 1.15rem; }
.lab-table td:first-child.ml { font-size: 1.35rem; color: var(--peacock-deep); }
.lab-row { cursor: pointer; }
.lab-row:hover, .lab-row:focus-visible { background: var(--zari-soft); outline: none; }
.lab-row.is-open { background: var(--peacock-soft); }
.write-starters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.write-starter { display: grid; gap: 2px; text-align: left; padding: 8px 14px; border-radius: 16px; border: 2px dashed var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.write-starter .ml { font-family: var(--f-ml); font-weight: 700; }
.write-starter .en { font-size: .8rem; color: var(--ink-3); }
.write-starter:hover { border-color: var(--peacock); }
.write-area { width: 100%; min-height: 180px; padding: 16px; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--f-ml); font-size: 1.25rem; line-height: 1.7; resize: vertical; }
.write-area:focus { border-color: var(--peacock); outline: none; box-shadow: 0 0 0 4px var(--peacock-soft); }
.write-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.write-status { margin: 0; color: var(--leaf); font-weight: 600; min-height: 1.2em; }
.write-tip { margin: 0; color: var(--ink-3); font-size: .88rem; display: flex; gap: 6px; align-items: flex-start; }
@media (max-width: 640px) { .lab-table td, .lab-table th { padding: 8px; } .lab-table td.ml { font-size: 1rem; } }
.lab-show--long { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); overflow-wrap: anywhere; }
.lab-word--long { font-size: 1.05rem; line-height: 1.5; }
.lab-card { align-content: start; }
@media (max-width: 560px) {
  .lab-table thead { display: none; }
  .lab-table, .lab-table tbody { display: block; }
  .lab-table tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; padding: 10px 12px; border-top: 1px solid var(--line); }
  .lab-table td { border: 0; padding: 0; }
  .lab-table td:nth-child(3) { grid-column: 1 / -1; color: var(--ink-2); }
}

/* Long Tamil unit/letter names in the prev/next bar wrap instead of pushing the page sideways */
.letter-nav { gap: 10px; }
.letter-nav .btn { min-width: 0; max-width: 100%; text-align: center; }
.letter-nav .btn .ml { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .letter-nav .btn { flex: 1 1 0; padding-inline: .8em; } }
