/* The logo's serif, kept in the app instead of loaded from Google Fonts (works offline). */
@font-face{font-family:"Fraunces";font-style:normal;font-weight:100 900;font-display:swap;src:url(../assets/fonts/fraunces-latin-standard-normal.woff2) format("woff2-variations"),url(../assets/fonts/fraunces-latin-standard-normal.woff2) format("woff2")}
@font-face{font-family:"Capital I";font-style:normal;font-weight:100 500;font-display:swap;unicode-range:U+0049;src:url(../assets/fonts/andika-capital-i-400.woff2) format("woff2")}
@font-face{font-family:"Capital I";font-style:normal;font-weight:501 900;font-display:swap;unicode-range:U+0049;src:url(../assets/fonts/andika-capital-i-700.woff2) format("woff2")}   /* capital I with its top and bottom bars (Andika, as in the book), so I and l never look alike */

/* ============================================================================
   Saram.Phonics — design tokens
   Every design value lives here, and only here. Change one line and it changes
   everywhere. The other style sheets only refer to these names.
   docs/DESIGN.md explains what each group is for; design/styleguide.html shows
   them all. tools/check-design.mjs fails if a raw colour, font size, radius or
   shadow appears anywhere else.

   Groups: colour · type · spacing · radius · borders · shadows · layers ·
   motion · layout · components · stage (the lesson card, which scales).
   ========================================================================== */

:root{
  color-scheme:light dark;

  /* ── Colour ─────────────────────────────────────────────────────────────
     The app's palette (measured from the Claude app), plus one blue for the
     letters being taught. Dark values are in the media query below. */
  --color-bg:#FFFFFF;          /* page (the same as Saram OS) */
  --color-side:#FAFAFA;        /* sidebar, outline (Saram OS) */
  --color-hover:#F3F3F3;       /* hover, quiet fills (lighter than selected) */
  --color-on:#EAEAEA;          /* selected item: one look everywhere (sidebar, outline, settings; Saram OS) */
  --color-ink:#141413;         /* primary text, primary buttons, marks, answers */
  --color-text:#52514E;        /* secondary text, menu items, icons */
  --color-soft:#6B6963;        /* labels, hints (5.3:1, WCAG AA) */
  --color-ui:#8A8782;          /* status graphics: dots, piles, rings, tracks (3:1 non-text) */
  --color-line:#E8E8E8;        /* borders, dividers (Saram OS) */
  --color-sep:#C9C7C1;         /* the breadcrumb's / (light grey) */
  --color-panel:#FFFFFF;       /* raised surfaces: teacher panel, chips, buttons */
  --color-tint:#F5F5F5;        /* library cards for listening lessons and reviews */
  --color-row:#F3F3F3;         /* teacher panel main box; settings row lines */
  --color-active:var(--color-on);   /* settings: selected tab (same as every selected item) */
  --color-divider:#E4E4E3;     /* settings: panel divider, segmented ring */
  --color-seg:#F3F3F3;         /* settings: segmented control track */
  --target:#0066CC;            /* Apple blue: ONLY the letters being taught */
  /* Writing card only. Stroke order: 1 blue, 2 orange, 3 dark purple, 4 light teal (they differ in lightness too, not
     just hue); the same colour for a stroke, its badge, its arrow and its tracer */
  --color-story-fill:#FAEEDA; --color-story-line:#EFD2A0; --color-story-ink:#854F0B;   /* a Story lesson's card on the home screen */
  --color-warn-fill:#FDF3E1; --color-warn-ink:#7A4A0A;   /* the Today card: what to watch for (the teacher's note) */
  --color-topic-fill:#EEEDFE; --color-topic-ink:#3C3489;   /* where a topic starts: the tag on that lesson's card */
  --color-stroke-1:#2350C8; --color-stroke-2:#E8792B; --color-stroke-3:#5B2A86; --color-stroke-4:#4FC3AE;
  --color-wl-ghost:#ECEEF2;                       /* the whole letter as a light track, before it is written */
  --color-wl-start:#2E9B5B;                       /* where the pen starts */
  --color-wl-sky:#EAF2FB; --color-wl-grass:#E9F4E3; --color-wl-ground:#F7F0E4;
  --color-wl-top:#A9BBCF; --color-wl-base:#E0857A; /* the book's top line and the red baseline (as in the children's notebooks) */
  --color-wl-dot:#7C8799; --color-wl-dot-light:#C3CAD5;
  --color-wrong:#EE8A7E;       /* a wrong pick, the extra 으, a wrong tap: a clear red that still reads calm ("Clear" palette, 2026-11-12: strong enough for a classroom TV) */
  --color-wrong-fill:#FDE9E6;  /* a chosen answer that is wrong: soft red fill, line and ink */
  --color-wrong-ink:#B3261E;
  /* Beat boxes: one grey box per beat (bas|ket). Strong beat dark, weak beat light, a Korean syllable in between (all the same). */
  --color-beat-strong:#C4C2B9;
  --color-beat-weak:#E8E6DF;
  --color-beat-even:#DAD8D0;
  --color-beat-line:color-mix(in srgb,var(--color-ink) 22%,transparent);         /* a beat's scoop */
  --color-beat-line-strong:color-mix(in srgb,var(--color-ink) 55%,transparent);  /* the stressed beat's scoop */
  --color-right:#6FC48A;       /* a chosen answer that is right: green fill, line and ink ("Clear" palette) */
  --color-right-fill:#E3F4E7;
  --team-now:var(--color-ink);       /* the team game (lessons 1–5): the team whose turn it is */
  --team-wait:var(--color-ui);       /* …and the team waiting, quiet grey */
  --team-fill:var(--color-hover);    /* the soft pill behind each team */
  --color-right-ink:#1F7A3D;
  --color-odd-fill:#E9E8E4;    /* the silly word in a sentence, once shown: a grey pill */
  --odd-pad:.2em;              /* room either side of the silly word inside its pill */
  --color-pill-on:#EAF0FB;     /* the outline's current card: the soft blue pill (as in Saram OS) */
  --color-pill-on-line:#B9CBEE;
  --color-pill-on-ink:#2F55A4;
  --color-heart-fill:#FCE4EC;  /* the inside of a ♥ box: the part learned by heart */
  --color-later-fill:#F1F0EC;
  --color-heart-later-line:color-mix(in srgb,var(--color-heart) 45%,transparent);   /* ♡ (by heart for now): its box's dashed line */  /* the inside of a box whose sound is taught later (its tag says when) */
  --img-heart:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%23FF6B81'/><stop offset='1' stop-color='%23E3123B'/></linearGradient></defs><path d='M50 88C22 66 3 50 3 28 3 13 15 2 29 2c9 0 17 5 21 12C54 7 62 2 71 2c14 0 26 11 26 26 0 22-19 38-47 60z' fill='url(%23g)'/><ellipse cx='27' cy='22' rx='11' ry='7' transform='rotate(-35 27 22)' fill='white' opacity='.55'/></svg>");   /* the glossy ♥ sticker (our own drawing) */
  --img-heart-later:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 112 102'><path d='M50 88C22 66 3 50 3 28 3 13 15 2 29 2c9 0 17 5 21 12C54 7 62 2 71 2c14 0 26 11 26 26 0 22-19 38-47 60z' fill='none' stroke='%23C2255C' stroke-width='9'/></svg>");   /* ♡: taught later, in a word (review, graduation) */
  --color-heart:#C2255C;       /* the ♥ over a heart word's tricky part (not blue: blue is today's letters; not red: nothing is wrong) */
  --color-logo-dot:#8FA693;    /* the sage dot in the wordmark */
  --color-brand-ink:#1D1D1F;   /* the wordmark "Saram", and the page's default text colour */
  --color-brand-soft:#6E6E73;  /* "Phonics" beside the wordmark */
  --color-scrim:rgba(0,0,0,.4);           /* behind the settings window */
  --color-scrim-soft:rgba(20,20,19,.32);  /* behind the sidebar on a phone */
  --color-on-ink-tag:rgba(255,255,255,.18); /* a tag on the dark (current) teacher chip */
  /* derived (mixes of the colours above) */
  --color-selection:color-mix(in srgb,var(--color-ink) 16%,transparent);
  --color-card-hover:color-mix(in srgb,var(--color-soft) 55%,var(--color-line));
  --color-scoop:color-mix(in srgb,var(--color-ink) 32%,transparent);    /* curve under a phrase */
  --color-box-empty:color-mix(in srgb,var(--color-ink) 50%,transparent);
  --color-box-split:color-mix(in srgb,var(--color-ink) 35%,transparent);
  --color-box-silent:color-mix(in srgb,var(--color-ink) 45%,transparent);
  --color-bracket:color-mix(in srgb,var(--color-ink) 40%,transparent);
  /* old names, kept as aliases so nothing that still uses them breaks */
  --sh-bg:var(--color-bg); --sh-side:var(--color-side); --sh-hover:var(--color-hover); --sh-on:var(--color-on);
  --sh-ink:var(--color-ink); --sh-text:var(--color-text); --sh-soft:var(--color-soft); --sh-ui:var(--color-ui);
  --sh-line:var(--color-line); --sh-panel:var(--color-panel); --sh-tint:var(--color-tint);
  --st-row:var(--color-row); --st-active:var(--color-active); --st-line:var(--color-divider); --st-seg:var(--color-seg);
  --rust:var(--color-wrong); --sage-logo:var(--color-logo-dot);

  /* ── Type ─────────────────────────────────────────────────────────────── */
  --font-display:"Capital I", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --img-again:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 12a8 8 0 1 0 2.6-5.9'/><path d='M4 4v5h5'/></svg>");   /* ↺ start again (footer) */
  --font-emoji:"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;   /* the system emoji (Apple's on a Mac, iPad or iPhone) */
  --em-face:1.5em;   /* the faces on a sentence card */
  --font-capI:-apple-system, BlinkMacSystemFont, Georgia, "Times New Roman", serif;   /* a lone capital I (the word I): the app's own font with its serifed I (ss06 on a Mac), so it never reads as l; Georgia elsewhere */
  --font-body:-apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --font-logo:"Fraunces", Georgia, "Times New Roman", serif;   /* kept in the app (assets/fonts, SIL Open Font License): no internet needed */
  /* UI sizes (chrome, teacher panel) */
  --text-2xs:10px;
  --text-xs:11px;
  --text-sm:12px;
  --text-md:13px;
  --text-base:14px;
  --text-lg:15px;
  --text-xl:16px;
  --text-2xl:17px;
  --text-step:18px;            /* the stage footer's step button */
  --text-3xl:19px;
  --text-lead:20px;            /* the teacher panel's top line */
  --text-instr-en:clamp(17px, 1.95vh, 22px);   /* its English line under it: grows with it (21px at 1080), about 6/10 of its size */
  --text-instr:clamp(26px, 3.2vh, 36px);   /* the children's instruction in the stage footer: bigger on a big TV (34px at 1080) */
  --text-say:30px;             /* the teacher panel's word to say now */
  --text-4xl:21px;
  --text-5xl:22px;
  --text-6xl:24px;
  --text-7xl:28px;
  --text-8xl:34px;
  /* library card letters (fluid with the window) */
  --text-library-big:clamp(46px, 7vw, 74px);
  --text-library-md:clamp(28px, 4.8vw, 48px);
  --text-library-sm:clamp(21px, 3.5vw, 34px);
  --weight-regular:400;
  --weight-medium:500;
  --weight-semibold:600;
  --weight-bold:700;
  /* line heights, tightest to loosest */
  --leading-display:.92;   /* library card letters */
  --leading-hole:.95;      /* the ? hole in a sorting word */
  --leading-none:1;
  --leading-main:1.05;     /* the card's main words */
  --leading-display-sm:1.08;
  --leading-tight:1.1;
  --leading-button:1.15;
  --leading-chip:1.2;
  --leading-snug:1.25;
  --leading-line:1.3;      /* a child-facing line */
  --leading-lead:1.35;     /* the teacher panel's top line */
  --leading-toast:1.4;
  --leading-note:1.45;     /* teacher notes and tips */
  --leading-body:1.47;     /* page default */
  --leading-relaxed:1.5;
  /* letter spacing, tightest to loosest */
  /* Anything a child reads (words, letters, sentences, answer labels) is never squeezed: 0.
     Only the teacher's small interface text keeps a slight negative tracking (body, lead). */
  --tracking-display:0;
  --tracking-display-md:0;
  --tracking-main:0;
  --tracking-tight:0;
  --tracking-body:-.01em;
  --tracking-lead:-.005em;
  --tracking-none:0;
  --tracking-caps:.06em;   /* small uppercase labels */

  /* ── Spacing: --space-N is N × 2px ─────────────────────────────────────── */
  --space-half:1px;
  --space-1:2px;
  --space-2:4px;
  --space-3:6px;
  --space-4:8px;
  --space-5:10px;
  --space-6:12px;
  --space-7:14px;
  --space-8:16px;
  --space-9:18px;
  --space-10:20px;
  --space-11:22px;
  --space-12:24px;
  --space-13:26px;
  --space-14:28px;
  --space-15:30px;
  --space-16:32px;
  --space-20:40px;
  --space-22:44px;
  --space-32:64px;

  /* ── Radius ──────────────────────────────────────────────────────────── */
  --radius-hair:1px;
  --radius-xs:2px;
  --radius-sm:4px;
  --radius-md:8px;
  --radius-lg:10px;
  --radius-xl:12px;
  --radius-2xl:14px;
  --radius-3xl:16px;
  --radius-pill:999px;
  --radius-round:50%;
  /* on the stage, relative to the text they round (scale with the card) */
  --radius-mark:.03em;       /* the split marker in "where does it split?" */
  --radius-underline:.05em;  /* the bar under the word being sounded out */
  --radius-tap:.08em;        /* tappable letters and words */
  --radius-saying:.2em;      /* the ring round the word or letter being said, in step with its size */
  --radius-letter:.1em;      /* a tappable letter (silent letters) */
  --radius-hole:var(--box-radius);       /* the hole where a hidden letter goes */
  --radius-box:var(--box-radius);        /* a dictation box */
  --radius-slot:var(--box-radius);       /* an answer slot, the picture box */
  --radius-beat:.12em;       /* a beat box */
  /* THE box on the stage (warm-up, dictation, build it, word chain, word order, ? slots): one look.
     Empty: a thin dashed outline. Filled: grey, no outline (the same grey as a letter tile). */
  --box-line:var(--border-md) dashed var(--color-ui);
  --box-radius:var(--radius-beat);
  --box-fill:var(--color-row);
  --radius-flash:.14em;
  --radius-pile:.3em;        /* a sorting pile's card (of the pile's text) */      /* the flashcard around a letter and its key word (of the letter's size) */
  /* THE tile you tap (a letter, a word, a cell): grey, no outline, corners that grow with it.
     The one in play adds the blue tint and outline (--color-pill-on / -line). */
  --tile-fill:var(--color-row);
  --tile-radius:var(--radius-tile);
  /* THE picture: a white frame with a light line (like the flashcard); still hidden, the dashed box. */
  --pic-line:var(--border-md) solid var(--color-line);
  --pic-radius:var(--radius-picture);
  /* THE small tag (a sound /s/, a letter's name, 한): a grey pill. */
  --tag-fill:var(--color-row);
  --beat-gap:.1em;           /* between two beat boxes */
  --vi-bar-h:.22em;          /* the voicing card's length bars */
  --vi-bar-long:2.2em;
  --vi-bar-short:.8em;
  --beat-pad:.1em;           /* a beat box's room either side of its letters */
  --beat-scoop-room:.33em;   /* room under a beat for its scoop: just below the tails of g, p, y */
  --beat-scoop-h:.18em;
  --radius-beat-scoop:0 0 50% 50% / 0 0 100% 100%;   /* a round arc, however wide the beat */
  --beat-scoop-w:.045em;
  --beat-scoop-w-strong:.075em;
  --radius-picture:.16em;
  --radius-frame:.22em;      /* the frame around a hidden or odd word */
  --radius-ghost:.25em;      /* the extra 으 */
  --radius-tile:.28em;       /* a word tile */
  --radius-chip-stage:.6em;  /* a small chip on the stage */
  --radius-picture-sign:8%;  /* the empty picture box's sign */
  --radius-scoop:0 0 1em 1em;     /* the curve under a phrase */
  --radius-bracket:0 0 .4em .4em; /* the bracket under a blend */

  /* ── Borders ─────────────────────────────────────────────────────────── */
  --border-hair:1px;
  --border-thin:1.5px;
  --border-md:2px;
  --border-thick:3px;
  --border-chevron:1.5px;
  --focus-width:2px;
  --focus-offset:2px;
  --focus-offset-stage:.07em;   /* on the stage the ring sits clear of big letters, below p and g too */
  --focus-width-thumb:3px;
  --focus-offset-thumb:4px;

  /* ── Shadows ─────────────────────────────────────────────────────────── */
  --shadow-focus-halo:0 0 0 4px var(--color-panel);   /* around the focus ring */
  --shadow-seg-on:0 0 0 1px var(--color-divider);     /* the selected segment (settings) */
  --shadow-pop:0 8px 24px rgb(0 0 0 / .12), 0 2px 6px rgb(0 0 0 / .08);   /* the top bar's card list, floating over the stage */
  --text-shadow-hidden:0 0 0 transparent;             /* a hidden answer */

  /* ── Layers (z-index) ────────────────────────────────────────────────── */
  --z-ambient:0;
  --z-sticky:1;        /* sticky outline headings; a picture over its box */
  --z-shell:2;         /* the page content */
  --z-overlay-panel:3; /* outline / teacher panel over the stage on a phone */
  --z-lesson:5;
  --z-topbar:15;
  --z-scrim:19;
  --z-sidebar:20;
  --z-modal:40;

  /* ── Motion ──────────────────────────────────────────────────────────── */
  --ease:cubic-bezier(.32,.72,0,1);
  --ease-plain:ease;
  --t-view:.5s;           /* a view fading in */
  --dur-color:.12s;
  --dur-tap:.15s;         /* a tile press, a chevron, hover borders */
  --dur-panel:.2s;        /* panels sliding, progress, toasts */
  --dur-reveal:.28s;      /* 보기: an answer filling in where it stands */
  --reveal-stagger:90ms;  /* …one box after another */
  --dur-reveal:.25s;      /* stage reveals */
  --dur-drop:.3s;         /* a word dropping into a pile */
  --dur-join:.35s;        /* a word's letters joining */
  --dur-reduced:.001s;    /* reduced motion */

  /* ── Layout ──────────────────────────────────────────────────────────── */
  --sb-w:288px;           /* sidebar */
  --cls-menu-w:360px;     /* the class picker's list (top row) */
  --tb-h:48px;            /* library top bar */
  --lv-top:48px;          /* lesson top bar */
  --lv-num-max:320px;     /* room for the footer's card name and step; it gives way first when the stage is narrow */
  --lv-foot:clamp(88px, 10.4vh, 116px);         /* the stage footer and the teacher panel's bottom row: one line across the screen (both grow together when an instruction wraps) */
  --lo-w:256px;           /* lesson outline */
  --dd-w:400px;           /* the top bar's card list */
  --part-dot:24px;        /* top bar: a part's numbered circle */
  --part-pill-h:32px;     /* top bar: the part the class is in */
  --part-seg-w:12px;      /* top bar: one step mark of the card */
  --tp-w:320px;           /* teacher panel */
  --tp-section-gap:var(--space-10);  /* teacher panel: between its sections */
  --tp-item-gap:var(--space-6);      /* teacher panel: between lines inside a section */
  --say-box-h:88px;                  /* the teacher panel's say-now box (Hold to see) */
  --lo-indent:34px;       /* outline rows line up with the stage name */
  --sq-ghost-gap:.18em;
  --em-ghost:.5em;      /* the 으 box: half the word's size, big enough to see and tap on a TV */  /* the 으 card: room between the word's last letter and the 으 box */
  --pill-pad-y:4px;       /* a heading pill in the side panels (You say, Practise) */
  --pill-pad-x:10px;
  --lo-head-h:26px;       /* an outline stage's name row */
  --lo-pill-h:26px;       /* an outline card pill */
  --lo-kind-dim:.7;       /* the activity name inside an Introduce pill */
  --library-col:184px;    /* narrowest library card column */
  --library-card-h:168px;
  --library-card-h-unit:140px;   /* a lesson card in a unit row (five across) */
  --unit-head-w:112px;           /* the unit's name and lessons, left of its row */
  --settings-w:1030px;
  --settings-h:800px;
  --settings-nav-w:212px;
  --toast-w:420px;
  --os-pad:80px 22px 124px;        /* the page (the library overrides the top) */
  --os-pad-narrow:80px 12px 124px;
  --view-rise:8px;                 /* a view rises this far as it fades in */

  /* ── Components (css/components.css) ─────────────────────────────────── */
  /* buttons: one family, sizes s / m in the app's chrome, l on the stage (scales with the card) */
  --btn-primary-bg:var(--color-ink);
  --btn-primary-fg:var(--color-panel);
  --btn-secondary-bg:var(--color-panel);
  --btn-secondary-fg:var(--color-ink);
  --btn-secondary-border:var(--color-line);
  --btn-ghost-fg:var(--color-text);
  --btn-hover-bg:var(--color-hover);
  --btn-pressed-bg:var(--color-on);
  --btn-icon-ring:var(--color-ui);       /* the round ▶ on a card */
  --btn-radius-ui:var(--radius-md);
  --btn-radius-stage:var(--radius-pill);
  --btn-h-s:32px;                        /* small icon button (settings close) */
  --btn-h-m:40px;                        /* icon button */
  --btn-icon-s:var(--icon-lg);           /* icon inside an icon button */
  --btn-h-l:2.8em;                       /* stage buttons: 2.8 × their text */
  --btn-pad-l:0 1.3em;
  --btn-gap-l:.4em;
  --btn-dim:.4;                          /* a used-up button on a card */
  --btn-h-foot:48px;                     /* the stage footer: ‹, ▶ and the step button */
  --btn-min-foot:132px;
  --btn-pad-foot:0 22px;
  --btn-radius-foot:var(--radius-xl);
  /* rows: sidebar, menus, settings tabs, outline */
  --row-h:40px;
  /* chips, pills and tags */
  --chip-pad:5px 10px;
  --chip-radius:var(--radius-md);
  --tag-pad:1px 7px;
  --peek-pad:7px 12px;
  --crumb-pad:5px 8px;
  --dd-indent:18px;   /* the lesson menu: Learn's cards under their sound's heading */
  --seg-pad:3px;
  --seg-item-pad:3px 8px;
  --seg-box-item-pad:5px 14px;
  --review-pad:8px 12px;
  --toast-pad:8px 12px;
  --toast-radius:var(--radius-lg);
  /* library card */
  --library-card-pad:18px 19px 17px;
  --library-card-radius:var(--radius-3xl);
  /* icon sizes */
  --icon-xs:14px;
  --icon-sm:16px;
  --icon-md:18px;
  --icon-lg:20px;
  --chip-h:36px;       /* outline chip */
  --settings-row-h:56px;
  --progress-h:2px;    /* the lesson's progress line (along the top bar's bottom edge) */
  --underline-offset:3px;
  --nudge:3px;         /* small optical shifts: a chip's tag, a fold's definition */
  --chevron-lift:-2px;
  /* The stage: the card in the middle, the footer (with the children's instruction) at the
     bottom. The card's sizes are measured against the stage less the footer and --stage-room,
     the same box as before the footer, so a card is never smaller than it was. */
  --stage-side:32px;              /* stage padding left and right */
  --stage-room:13px;              /* under the card, above the footer */
  --stage-side-phone:14px;
  --stage-room-phone:5px;
  --toast-bottom-phone:76px;
  --toast-clear:260px;            /* the toast never reaches under the teacher's controls */
  --toast-rise:6px;
  /* Practise board: minimum sizes so the bar stays usable when the card shrinks */
  --bb-edge:14px;
  --bb-dot-gap:5px;
  --bb-dot:8px;
  --bb-beat:2px;
  --bb-track:44px;
  --bb-rail:3px;
  --bb-thumb:28px;
  /* Pictures: one size for a single picture that is the card's main thing, and one for two side by side. */
  --pic-main:40cqmin;
  --pic-pair:32cqmin;
  --nw-pic-max:var(--pic-main);   /* the New Words picture (the word sits under it) */
  /* opacity */
  --opacity-faint:.3;   /* the thumb not picked */
  --opacity-dim:.35;    /* a listen-and-pick choice that wasn't it */
  --opacity-quiet:.55;  /* the full-screen pill at rest; the empty picture sign */
  --opacity-muted:.6;   /* a lesson card that is opening; separators in example words */
  --opacity-label:.7;   /* a label on the dark current chip */
  --dot-sm:6px;
  --dot-md:7px;
  --step-dot:18px;     /* numbered step in the teacher panel */
  --stage-num:20px;    /* outline stage number */
  --avatar:26px;

  /* ── Stage (the lesson card) ─────────────────────────────────────────────
     The stage is a size container: 1cqmin = 1% of its shorter side. These are
     the ranges; css/cards.css multiplies them by --k (set on the stage when a
     card has to shrink to fit) as --t-xl … --g-l. */
  --stage-xl:clamp(64px,30cqmin,300px);   /* one letter or sound */
  --stage-l:clamp(42px,17cqmin,150px);    /* one word, or a pair */
  --stage-m:clamp(28px,11cqmin,110px);    /* several words: a set of 2–6 tiles, or a list's rows */
  --stage-s:clamp(20px,5.5cqmin,48px);    /* dense */
  --stage-text:clamp(18px,3.8cqmin,34px); /* support text, read from across a classroom */
  --stage-text-min:16px;
  --stage-label:clamp(13px,2.5cqmin,20px);
  --stage-label-min:13px;
  --stage-gap-s:clamp(6px,1.4cqmin,14px);
  --stage-gap-m:clamp(10px,2.8cqmin,28px);
  --stage-gap-l:clamp(18px,5cqmin,48px);
  --stage-sentence:var(--stage-m);  /* a sentence: the size of a set of words (long ones wrap between phrases and still fit) */
  --stage-boxes:var(--stage-m);     /* dictation and build-a-word boxes: the letters at the word-set size */
  --stage-box-one:calc(var(--stage-l) * 1.35);   /* one box alone (a single letter): bigger than a word's boxes, but a box at the full letter size would fill the stage */
  --stage-readback:clamp(36px,8cqmin,96px);  /* dictation read-back: six words, a little under a set of words */
  /* floors: stage text never smaller than these (readable from the back of a room) */
  --stage-min-xs:12px;
  --stage-min-sm:13px;
  --stage-min-lg:18px;
  /* proportions on the stage (of the text they sit in) */
  --em-same:1em;       /* the size of the text it sits in (scaled by --sn-f on a long sentence) */
  --em-joiner:.5em;    /* the arrow (and ✕) between words */
  --jn-stroke:.108em;   /* the arrow and plus between letters or words: line width, against the text around them */
  --jn-stroke-min:3px;  /* …and never thinner than this, so a small one still reads on a classroom TV */
  --em-plus:.45em;     /* the plus and arrow in a blend */
  --em-small:.55em;    /* small marks beside a word: 으, the silent-letter note, + */
  --em-ss-plus:.6em;
  --em-slot:.7em;      /* the +e slot in magic e */
  --em-multi:.78em;    /* two letters in one dictation box */
  --em-sw:.5;
  --em-lm:.3;       /* the Today card: its text, against --stage-m */
  --em-lm-big:1.15em;  /* the Today card: the lesson's title */
  --em-lm-k:.85em;  /* the Today card: what each part holds, and its number */
  --em-lm-sound:2.8em;  /* the Today card: today's new sound, big */
  --em-lm-sound-s:1.9em;  /* …a longer one (scr spr str) */
  --em-lm-sound-xs:1.4em; /* …a pattern (he go ba·by) */
  --em-lm-nk:.9em;   /* the Today card: a teacher note's label */
  --sw-odd-pad:.3em;   /* Sentences: the silly word's pill, its side padding */   /* Sentences: one sentence on the wall, against a sentence on its own */
  --em-sq-caption:.4;  /* No extra 으: the Korean way under the word, against the word's size */
  --em-lt-sound:.78em; /* a Letters sound card: the sound, against the card's letter size */
  --em-lt-spk:.42em;   /* a Letters card: the speaker under the letter */
  --em-ko:.8em;        /* the Korean word beside the English */
  --em-star:1.2em;
  --em-heart:.42em;           /* the ♥ over a heart word's part, against the word's size */
  --em-heart-small:.3em;      /* the ♥ over a review word (its word is bigger) */
  --em-heart-box:.56em;        /* (box) the ♥ sticker on a sound box's top edge */
  --em-shh:.4em;              /* the 🤫 sticker over a silent letter, against the word's size */
  --em-shh-box:.5em;          /* (box) the 🤫 sticker on a silent box's top edge */
  --img-shush:url("../assets/images/ui/shush.webp");   /* 🤫 (Noto Color Emoji, Apache 2.0), drawn once so it looks the same on every screen */
  --hw-scale:1.4;              /* sound boxes (heart word, dictation) against --stage-boxes */
  --stage-boxes-room:90cqw;    /* a long word's sound boxes shrink to fit this much of the stage's width */
  --radius-heart-box:var(--box-radius);
  --color-heart-shadow:rgba(0,0,0,.18);
  --em-pile:1.6em;     /* pile label, beats in a pile */
  --em-sound:1.7em;    /* the sound over an -ed column */
  --em-symbol:2em;     /* the sound beside "do you hear…?" */
  --bw-tile-scale:1;
  --sd-scale:.62;        /* Sounds → letters: the grid against the card's main size */
  --em-tag-n:.24em;      /* the small number in a Sounds → letters card */
  --em-sd-alt:.34em;     /* the other spellings under an answer */   /* Build it: the letter tiles against the sound boxes */
  --em-listen:.5em;    /* the sound to listen for, above the hidden word (hands up) */
  --em-old:.42em;      /* earlier steps of a growing sentence */
  --em-tag:.16em;      /* the "voiced" tag after a sound */
  --em-stamp:.34em;    /* the sound written under a chunk */
  --vh-size:min(64cqh,46cqw);   /* Vowel hand: the hand picture's height (it reads from the back of the room) */
  --vh-l-size:62cqi;            /* the letter on a fingertip, against the fingertip */
  --vh-scale:.5;         /* Vowel hand: the vowel and its word beside the hand, against the card's main size */
  --em-vh-big:1.5em;     /* the vowel beside the hand */
  --em-vh-word:.62em;    /* its key word under it */
  --wc-scale:.62;        /* Word chain: the boxes against the card's main size */
  --wc-trail-scale:.32;  /* Word chain: the chain so far, over the boxes */
  --sy-pic-w:min(46cqw,52cqh);   /* Story: the picture (4:3), as big as leaves room for the sentence */
  --sy-scale:.46;        /* Story: a page's sentence against the card's main size */
  --sy-title-scale:.62;  /* Story: the title */
  --sy-all-scale:.38;    /* Story: the whole story on the last screen */
  --sy-small-scale:.2;   /* Story: the question number and the page an answer is on */
  --ws-w:9;              /* Write a sentence: the card's width, in main sizes */
  --sr-fit-h:calc(100cqh / 9.4);   /* Speed read: the letter size that fits four rows, the round marks and the gaps down the stage */
  --sr-cell-pad:.32em;   /* Speed read: room above and below the word in a box */
  --sr-gap:.24em;        /* Speed read: between boxes */
  --sr-round-h:.14em;    /* Speed read: the three round marks, a thin bar as wide as the grid */
  --radius-sr-cell:.22em; /* Speed read: a box's corners, in step with its size */
  --lt-max-w:92cqw;      /* Letters: never wider than the stage (cq units: the stage's own size, not a parent's) */
  --wu-pic:var(--pic-main);   /* Sound warm-up: a picture */
  --wu-ear:calc(var(--pic-main) * .7);   /* Sound warm-up: the speaker, in the picture's place */
  --box-h:1.35;          /* a box that holds words or letters: its height against the words' size (warm-up sound boxes, answer piles) */
  --wu-box-gap:var(--stage-gap-s);
  --tk-pic:var(--pic-main);   /* Talk time: the picture */
  --wl-air-h:74cqh;      /* Writing: the letter in the air, a share of the stage's height */
  --lt-match-h:54cqh;    /* Letters: the matching game's height, a share of the stage's */
  --lt-match-gap:.3em;   /* Letters: between the matching boxes */
  --wc-tile-scale:.38;   /* Word chain: the letter tiles under the boxes */
  --wc-from-em:.58;      /* Word chain: the old word, small and grey, beside the new word */
  --wc-all-scale:.42;    /* Word chain: the whole chain at the end */
  --wc-to-em:.6;         /* Word chain: the arrow from the old word to the new */
  --wo-scale:.4;         /* Word order: the words against the card's main size */
  --rm-scale:.4;         /* Read and match: the words against the card's main size */
  --rm-pic:19cqmin;      /* Read and match: one picture (seven in two rows of four and three) */
  --em-rm-cap:.55em;     /* the word under a matched picture */
}

@media (prefers-color-scheme:dark){
  :root{
    --color-story-fill:#3A3125; --color-story-line:#6B5330; --color-story-ink:#F0C98A;
    --color-warn-fill:#33291C; --color-warn-ink:#F0C98A;
    --color-topic-fill:#33304F; --color-topic-ink:#CECBF6;
    /* Writing and the letter cards in the dark: the same pictures, each colour lifted or dimmed to read on a dark page */
    --color-stroke-1:#7392F2; --color-stroke-2:#F09A52; --color-stroke-3:#B58AE0; --color-stroke-4:#5FD3BE;
    --color-wl-ghost:#3A3936; --color-wl-start:#4CC27E;
    --color-wl-sky:#26303B; --color-wl-grass:#27332A; --color-wl-ground:#3A332A;
    --color-wl-top:#5B6B80; --color-wl-base:#B8675E;
    --color-wl-dot:#9AA3B2; --color-wl-dot-light:#5A6270;
    --color-bg:#262624;
    --color-side:#1F1E1D;
    --color-hover:#2A2927;
    --color-on:#3A3936;
    --color-ink:#F5F4EF;
    --color-text:#C2C0B6;
    --color-soft:#A9A69E;
    --color-ui:#827F77;
    --color-line:#3A3936;
    --color-sep:#5E5C57;
    --color-panel:#30302E;
    --color-tint:#2D2C29;
    --color-row:#33322F;
    --color-active:var(--color-on);
    --color-divider:#3A3936;
    --color-seg:#262624;
    --target:#2997FF;
    --color-wrong:#E07A6E;
    --color-wrong-fill:#3A2624;
    --color-wrong-ink:#F7B4AA;
    --color-beat-strong:#5E5D58;
    --color-beat-weak:#383735;
    --color-beat-even:#4A4945;
    --color-right:#5FAF78;
    --color-right-fill:#243126;
    --color-right-ink:#A8E0B7;
    --color-heart:#F06595;
    --color-odd-fill:#3D3C39;
    --color-pill-on:#1E2A40;
    --color-pill-on-line:#3B5585;
    --color-pill-on-ink:#A9C2F2;
    --color-heart-fill:#3A1A26;
    --color-later-fill:#2A2926;
    --img-heart-later:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 112 102'><path d='M50 88C22 66 3 50 3 28 3 13 15 2 29 2c9 0 17 5 21 12C54 7 62 2 71 2c14 0 26 11 26 26 0 22-19 38-47 60z' fill='none' stroke='%23F06595' stroke-width='9'/></svg>");
    --color-brand-ink:#F5F5F7;
    --color-brand-soft:#98989D;
  }
}
/* Increased contrast (an OS setting): "Phonics" beside the wordmark gets darker. */
@media (prefers-contrast:more){
  :root{--color-brand-soft:#3A3A3C}
  @media (prefers-color-scheme:dark){:root{--color-brand-soft:#EBEBF0}}
}

/* The teacher panel's type, 20% smaller than the rest of the app (it is read up close, beside the stage). */
.lv-teacher{--text-2xs:10px;--text-xs:10px;--text-sm:10px;--text-md:10px;--text-base:11px;--text-lg:12px;--text-xl:13px;--text-2xl:14px;--text-3xl:15px;--text-lead:16px;--text-say:24px;--text-4xl:17px;--text-5xl:18px;--text-6xl:19px;--text-7xl:22px;--text-8xl:27px}
