/* Ported from the owner's Little Reciters app (tools/kids/source/little-reciters.css, 15 Nov 2026).
 * Hand-kept from now on: edit this file directly. Never re-run tools/kids/split_source.py over it.
 * Fonts: KFGQPC Hafs (the site's own file) for letters and words, Karla for text, Lora for headings.
 * Light theme only. The plan and the contract: tools/kids/PLAN.md, tools/kids/CONTRACT.md. */
/* ---- fonts: the site's own, self-hosted (PLAN D7). Karla and Lora come from /fonts/fonts.css; the Qur'anic font is the KFGQPC
   Hafs v2.0 file, unmodified, with its licence (/fonts/files/KFGQPC-HAFS-LICENSE.txt): font-display block, no unicode-range ---- */
@font-face { font-family: 'KFGQPC Hafs'; font-style: normal; font-weight: 400; font-display: block;
  src: url('/fonts/files/kfgqpc-hafs-uthmanic-v2.0.ttf') format('truetype'); }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---- 00-tokens.css ---- */
/* 00-tokens.css — Little Reciters v5 design tokens (final-spec 2, 3, 9). Light theme only: the owner's dark blocks were
 * removed on the port (PLAN D10), and this file is hand-kept from now on.
 * Lesson colours (--l-fill / --l-ink / --l-wash) live ONLY on [data-lesson] elements (and on .scr / .lr-layer as the letters fallback), never on :root. */

:root{
  color-scheme: light;
  --desk:#EAF1EC; --paper:#FFFDF7; --raised:#FFFFFF;
  --ink:#1A1F1C; --ink-soft:#4A5751; --rule:#C9D5CE; --edge:#7A8A82;
  --cover:#14503F; --on-cover:#F6E7B8;
  --action:#14503F; --on-action:#FFFFFF; --action-lip:#0A3328;
  --gold:#C99A35; --gold-ink:#7D5C0E; --on-gold:#2A1E05;
  --lapis:#24508F;
  --pointer:#FFE14D; --pointer-soft:#FFF3B8; --pointer-ring:#7A6200;
  --ok:#1B7A4B; --ok-wash:#E3F4EA;
  --sun-wash:#FBF1D6; --sun-ink:#6A560A; --moon-wash:#ECEFFD; --moon-ink:#3C5590;
  --tj-silent:#6B7570; --tj-stretch:#C42B2B;
  --scrim:rgb(12 21 18 / .45);
  --scrim-soft:rgb(12 21 18 / .3);
  --float:0 12px 32px -12px rgb(12 21 18 / .35);
  --band:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Crect x='1' y='1' width='46' height='46' fill='none' stroke='%237D5C0E'/%3E%3Crect x='15' y='15' width='18' height='18' fill='none' stroke='%237D5C0E'/%3E%3Cg fill='%2324508F'%3E%3Cpath d='M24 3l5 5-5 5-5-5z'/%3E%3Cpath d='M24 35l5 5-5 5-5-5z'/%3E%3Cpath d='M3 24l5-5 5 5-5 5z'/%3E%3Cpath d='M35 24l5-5 5 5-5 5z'/%3E%3C/g%3E%3Cg fill='%23C99A35' stroke='%237D5C0E' stroke-width='.8'%3E%3Cg id='k'%3E%3Crect x='3.5' y='3.5' width='9' height='9'/%3E%3Crect x='3.5' y='3.5' width='9' height='9' transform='rotate(45 8 8)'/%3E%3C/g%3E%3Cuse href='%23k' x='32'/%3E%3Cuse href='%23k' y='32'/%3E%3Cuse href='%23k' x='32' y='32'/%3E%3C/g%3E%3Cg fill='%2324508F'%3E%3Ccircle cx='8' cy='8' r='1.8'/%3E%3Ccircle cx='40' cy='8' r='1.8'/%3E%3Ccircle cx='8' cy='40' r='1.8'/%3E%3Ccircle cx='40' cy='40' r='1.8'/%3E%3C/g%3E%3Cg fill='%23C99A35'%3E%3Ccircle cx='24' cy='8' r='1.4'/%3E%3Ccircle cx='24' cy='40' r='1.4'/%3E%3Ccircle cx='8' cy='24' r='1.4'/%3E%3Ccircle cx='40' cy='24' r='1.4'/%3E%3C/g%3E%3C/svg%3E");
  --band-gold:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Crect x='1' y='1' width='46' height='46' fill='none' stroke='%237D5C0E'/%3E%3Crect x='15' y='15' width='18' height='18' fill='none' stroke='%237D5C0E'/%3E%3Cg fill='%237D5C0E'%3E%3Cpath d='M24 3l5 5-5 5-5-5z'/%3E%3Cpath d='M24 35l5 5-5 5-5-5z'/%3E%3Cpath d='M3 24l5-5 5 5-5 5z'/%3E%3Cpath d='M35 24l5-5 5 5-5 5z'/%3E%3C/g%3E%3Cg fill='%23C99A35' stroke='%237D5C0E' stroke-width='.8'%3E%3Cg id='k'%3E%3Crect x='3.5' y='3.5' width='9' height='9'/%3E%3Crect x='3.5' y='3.5' width='9' height='9' transform='rotate(45 8 8)'/%3E%3C/g%3E%3Cuse href='%23k' x='32'/%3E%3Cuse href='%23k' y='32'/%3E%3Cuse href='%23k' x='32' y='32'/%3E%3C/g%3E%3Cg fill='%237D5C0E'%3E%3Ccircle cx='8' cy='8' r='1.8'/%3E%3Ccircle cx='40' cy='8' r='1.8'/%3E%3Ccircle cx='8' cy='40' r='1.8'/%3E%3Ccircle cx='40' cy='40' r='1.8'/%3E%3C/g%3E%3Cg fill='%23C99A35'%3E%3Ccircle cx='24' cy='8' r='1.4'/%3E%3Ccircle cx='24' cy='40' r='1.4'/%3E%3Ccircle cx='8' cy='24' r='1.4'/%3E%3Ccircle cx='40' cy='24' r='1.4'/%3E%3C/g%3E%3C/svg%3E");
  /* reader (profile) colours: light inks of letters, fathah, kasrah, dhammah, tanween, hamzah */
  --pc-0:#2C5397; --pc-1:#89334B; --pc-2:#056454; --pc-3:#4C4A95; --pc-4:#883C04; --pc-5:#823564; --on-pc:#FFFFFF;
  /* derived interaction colours (theme-aware because they mix tokens) */
  --hover-mix:color-mix(in oklab, var(--raised), var(--ink) 5%);
  --action-hover:color-mix(in oklab, var(--action), black 6%);

  /* ---- type families (3.1) ---- */
  --font-ar:'KFGQPC Hafs',serif;
  --font-dots:'Amiri Quran','Amiri',serif; /* kept on purpose: KFGQPC Hafs draws a final or lone Yaa without its two dots, and a child learning the letters must see them; Amiri Quran is self-hosted (/fonts/fonts.css) */
  --font-body:'Karla','Segoe UI',system-ui,-apple-system,sans-serif;
  --font-display:'Lora','Karla',Georgia,serif;

  /* ---- Latin scale (3.2) ---- */
  --t-cap:.8125rem; --t-sm:.9375rem; --t-body:1.0625rem; --t-btn:1.0625rem; --t-btn-kid:1.25rem;
  --t-translit:1.375rem; --t-meaning:1.0625rem;
  --t-h3:1.25rem; --t-h2:1.5rem; --t-h1:1.75rem;
  --t-num:1.125rem; --t-num-big:2.5rem;
  --t-display:clamp(2.25rem, 7vw, 3.5rem);

  /* ---- Arabic scale (3.3): <600 values; container queries below raise them ---- */
  --ar-inline:1.35em;
  --ar-chip:2rem; --ar-word:2.5rem; --ar-read:2.75rem; --ar-wbw:2.25rem;
  --ar-mushaf:2.125rem; --lh-mushaf:2.3;
  --ar-letter:3rem; --ar-title:2.25rem; --ar-sign:4rem;
  --lh-ar:1.9;

  /* ---- space, shape (3.4) ---- */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px; --s7:48px; --s8:64px;
  --r-paper:3px; --r-chip:10px; --r-key:14px; --r-panel:16px; --r-bar:18px; --r-sheet:20px; --r-pill:999px;
  --gutter:16px;
  --read-col:46rem; --margin-col:18rem;

  /* ---- motion (9) ---- */
  --dur-press:120ms; --dur-ui:200ms; --dur-gild:420ms; --dur-shine:600ms;
  --ease:cubic-bezier(.2,.7,.2,1); --ease-pop:cubic-bezier(.2,1.4,.4,1);

  /* ---- layers (3.4) ---- */
  /* the reading bar sits ABOVE the page rail (and every other sticky strip): when a short or zoomed screen makes them
     meet, Next, Say it and Meaning must never be covered (a11y A2); still under the top bar, sheets and toasts */
  --z-rail:30; --z-rbar:35; --z-top:40; --z-scrim:50; --z-sheet:60; --z-toast:70; --z-big:80;

  /* ---- zoom (Aa popover; set on the root element by LR.store) and the sticky offsets derived from it ---- */
  --content-zoom:1; --topbar-zoom:1;
  --topbar-base:56px;
  /* height of the top bar in main's own (zoomed) coordinates: use for sticky `top` inside main */
  --topbar-h:calc((var(--topbar-base) * var(--topbar-zoom) + env(safe-area-inset-top, 0px)) / var(--content-zoom));
  --rbar-space:0px;
  /* the reading bar and the page rail are chrome, not words: with the words zoomed past 125% they stay at 125%
     (zoom: var(--chrome-k) inside main), so on a phone the zoomed words keep the room between them (V2-11) */
  --chrome-zoom:min(var(--content-zoom), 1.25);
  --chrome-k:calc(var(--chrome-zoom) / var(--content-zoom));
}
@media (min-width:600px){ :root{ --topbar-base:64px; } }


/* ---- container-driven sizes (3.3, 3.4): main.cq is `container: app / inline-size`; its screens read these ---- */
@container app (min-width:600px){
  .cq > *{
    --ar-chip:2.25rem; --ar-word:3rem; --ar-read:3.25rem; --ar-wbw:2.75rem;
    --ar-mushaf:2.5rem; --lh-mushaf:2.25;
    --ar-letter:3.5rem; --ar-title:2.5rem; --ar-sign:4.5rem;
    --t-h2:1.875rem; --t-h1:2.25rem;
    --gutter:24px;
  }
}
@container app (min-width:1000px){
  .cq > *{
    --ar-word:3.5rem; --ar-read:3.75rem; --ar-wbw:3rem; --ar-mushaf:2.875rem;
    --ar-letter:4rem; --ar-title:3rem; --ar-sign:5rem;
    --t-body:1.125rem;
    --gutter:32px;
  }
}
@container app (min-width:1400px){
  .cq > *{
    --ar-chip:2.5rem; --ar-word:4rem; --ar-read:4.25rem; --ar-wbw:3.5rem; --ar-mushaf:3.25rem;
  }
}

/* ---- lesson colours (2.2): on [data-lesson] only; .scr and .lr-layer fall back to the letters set ---- */
.scr, .lr-layer, [data-lesson="letters"]{--l-fill:#B8D2FE;--l-ink:#2C5397;--l-wash:#EEF4FE}
[data-lesson="fathah"]{--l-fill:#FFBCC9;--l-ink:#89334B;--l-wash:#FEEFF2}
[data-lesson="kasrah"]{--l-fill:#8DE5D0;--l-ink:#056454;--l-wash:#E3F9F3}
[data-lesson="dhammah"]{--l-fill:#C9CCFF;--l-ink:#4C4A95;--l-wash:#F1F2FE}
[data-lesson="connected"]{--l-fill:#FEBFB7;--l-ink:#8C352F;--l-wash:#FFEFED}
[data-lesson="sukoon"]{--l-fill:#85E3E6;--l-ink:#026264;--l-wash:#E1F9F9}
[data-lesson="madd"]{--l-fill:#DCC5FE;--l-ink:#63418B;--l-wash:#F6F1FE}
[data-lesson="tanween"]{--l-fill:#FFC1A2;--l-ink:#883C04;--l-wash:#FFF0E9}
[data-lesson="shaddah"]{--l-fill:#8AE0F9;--l-ink:#055F73;--l-wash:#E3F8FE}
[data-lesson="hamzatul_wassl"]{--l-fill:#EFBDF3;--l-ink:#753A7A;--l-wash:#FCEEFD}
[data-lesson="laam_tareef"]{--l-fill:#B8DFA3;--l-ink:#356312;--l-wash:#ECF8E7}
[data-lesson="rules_stopping"]{--l-fill:#A4D8FE;--l-ink:#035B88;--l-wash:#EAF5FE}
[data-lesson="hamzah"]{--l-fill:#FDBADF;--l-ink:#823564;--l-wash:#FFEEF7}
[data-lesson="mushaf_signs"]{--l-fill:#A0E3B8;--l-ink:#03663B;--l-wash:#E7F9ED}
[data-lesson="ayat"]{--l-fill:#E8CE99;--l-ink:#6F530A;--l-wash:#FAF3E5}

/* ---- 05-base.css ---- */
/* 05-base.css — base elements, layout shell and every shared component of final-spec section 5.
 * Tokens only (00-tokens.css). Feature CSS scopes itself under its screen root (.scr-<name>).
 * Gallery-only forced states: .is-hover / .is-focus / .is-active mirror :hover / :focus-visible / :active. */

/* ============================================================ base */
:root { --khatam-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-56 -56 112 112'%3E%3Cpath d='M0 -50 L14.65 -35.36 L35.36 -35.36 L35.36 -14.65 L50 0 L35.36 14.65 L35.36 35.36 L14.65 35.36 L0 50 L-14.65 35.36 L-35.36 35.36 L-35.36 14.65 L-50 0 L-35.36 -14.65 L-35.36 -35.36 L-14.65 -35.36Z'/%3E%3C/svg%3E"); } /* alpha mask for the tile shine (not a colour) */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* scroll padding keeps focus and scrollIntoView clear of the sticky top bar and of the sticky reading bar, whose height
   (plus its 12px offset) LR.reader keeps in --rbar-space (A1, WCAG 2.4.11) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-base) * var(--topbar-zoom) + 8px); scroll-padding-bottom: calc(var(--rbar-space, 0px) + 16px); }
body {
  margin: 0; background: var(--desk); color: var(--ink);
  font-family: var(--font-body); font-size: var(--t-body); line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-wrap: break-word;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); text-wrap: balance; }
h1, .h1 { font: 800 var(--t-h1)/1.1 var(--font-display); }
h2, .h2 { font: 700 var(--t-h2)/1.15 var(--font-display); }
h3, .h3 { font: 700 var(--t-h3)/1.2 var(--font-display); }
p { margin: 0 0 var(--s3); max-width: 62ch; }
a { color: var(--lapis); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
::selection { background: var(--pointer-soft); color: var(--ink); }

/* focus ring (all components): lapis ring + paper halo */
:focus-visible, .is-focus { outline: 3px solid var(--lapis); outline-offset: 2px; box-shadow: 0 0 0 2px var(--paper); }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
/* screen headings receive focus on route change (for screen readers); they never show a ring */
.scr :is(h1, h2)[tabindex="-1"]:focus, main:focus { outline: none; box-shadow: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 8px; top: -100px; z-index: var(--z-big); background: var(--raised); color: var(--ink);
  padding: 10px 14px; border-radius: var(--r-chip); border: 2px solid var(--edge); font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }

/* ============================================================ type utilities */
.t-cap { font: 700 var(--t-cap)/1.3 var(--font-body); }
.t-sm { font-size: var(--t-sm); line-height: 1.45; }
.t-body { font-size: var(--t-body); line-height: 1.55; }
.t-btn-kid { font: 700 var(--t-btn-kid)/1.1 var(--font-display); }
.t-display { font: 800 var(--t-display)/1.05 var(--font-display); }
.num, .t-num { font-family: var(--font-body); font-weight: 700; font-variant-numeric: tabular-nums; }
.t-num { font-size: var(--t-num); line-height: 1; }
.t-num-big { font: 700 var(--t-num-big)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-soft); }
.eyebrow { font-size: var(--t-sm); color: var(--ink-soft); margin: 0 0 var(--s2); }
.tl { direction: ltr; unicode-bidi: isolate; } /* transliteration / English inside Arabic containers */

/* ============================================================ Arabic */
.ar {
  font-family: var(--font-ar); font-weight: 400; font-style: normal; font-synthesis: none;
  line-height: var(--lh-ar); padding-block: .1em; unicode-bidi: isolate;
  letter-spacing: 0; word-spacing: normal; text-transform: none; overflow-wrap: normal;
}
/* The KFGQPC face has a 1.76em content area: an .ar block with line-height L below 1.76 needs padding-block >= (1.76 - L) / 2 em,
   otherwise its marks overflow the box (nothing is clipped, but the build check flags it). The scale classes below follow that rule. */
.ar-dots { font-family: var(--font-dots); }
.ar-inline { font-size: var(--ar-inline); line-height: 1; padding-block: 0; }
.has-ar { line-height: 1.8; }
.ar .key, span.key { color: var(--l-ink); }
.ar-word { font-size: var(--ar-word); }
.ar-read { font-size: var(--ar-read); line-height: 2; }
.ar-chip { font-size: var(--ar-chip); line-height: 1.6; padding-block: .1em; }
.ar-letter { font-size: var(--ar-letter); line-height: 1.5; padding-block: .14em; }
.ar-title { font-size: var(--ar-title); line-height: 1.8; }
.ar-sign { font-size: var(--ar-sign); line-height: 1.4; padding-block: .19em; }
.ar-mushaf { font-size: var(--ar-mushaf); line-height: var(--lh-mushaf); }
.ar-wbw { font-size: var(--ar-wbw); }

/* coloured runs made by LR.ui.arabic / fillArabic (row-letter and sign keys, the sun/moon laam) are
   span.ar-seg with colour only: no font settings of their own, so the word is shaped across them exactly as without colour
   and every ligature of the face stays (mark ligatures included). Never switch ligatures off on Arabic. Letters the face
   fuses into one glyph share one run (fuseColours in 10-ui.js). */

/* the sun-laam grey (the only tajweed colour this page draws: PLAN D5) */
.tj-silent { color: var(--tj-silent); }

/* ============================================================ icons */
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon--fill { fill: currentColor; stroke: none; }
.icon--sm { width: 18px; height: 18px; }
.icon--20 { width: 20px; height: 20px; }
.lr-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* rosette (beads, star counter, surah-index numbers) and khatam star */
.rosette { overflow: visible; flex: none; }
.rosette .ros-petal, .rosette .ros-disc { fill: var(--gold); stroke: var(--gold-ink); stroke-width: 5; }
.rosette .ros-ring { fill: none; stroke: var(--gold-ink); stroke-width: 3; }
.khatam { overflow: visible; flex: none; }
.khatam .kh-star { fill: var(--gold); stroke: var(--gold-ink); stroke-width: 5; }
.khatam .kh-disc { fill: var(--paper); }

/* ============================================================ layout shell */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: var(--z-top);
  zoom: var(--topbar-zoom); height: var(--topbar-base);
  background: var(--cover); color: var(--on-cover); border-bottom: 3px double var(--gold);
  container: bar / inline-size;
}
.tb-in { height: 100%; display: flex; align-items: center; gap: 6px; padding-inline: 16px; max-width: 120rem; margin-inline: auto; }
.topbar :focus-visible, .topbar .is-focus { outline-color: var(--on-cover); box-shadow: 0 0 0 2px var(--cover); }
.tb-brand {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; min-height: 44px;
  color: var(--on-cover); text-decoration: none; border-radius: var(--r-chip); padding-inline: 2px;
}
.tb-logo { width: 28px; height: 28px; }
.tb-word { font: 700 1.25rem/1.1 var(--font-display); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tb-title { font: 700 1.0625rem/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: none; }
/* a lesson's title on phones: the full title where it fits, its short name (meta.short) on the narrowest phones */
.tb-title__short { display: none; }
@container bar (max-width: 599px) {
  .topbar.has-title .tb-word { display: none; }
  .topbar.has-title .tb-title { display: block; }
}
.tb-right { display: flex; align-items: center; gap: 6px; flex: none; }
.tb-btn {
  appearance: none; background: transparent; color: var(--on-cover); border: 0; margin: 0;
  min-width: 44px; height: 44px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-chip); font: 700 var(--t-sm)/1 var(--font-body); white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .tb-btn:hover { background: color-mix(in oklab, var(--on-cover) 12%, transparent); } }
.tb-btn .icon { width: 22px; height: 22px; }
/* the top bar holds three things (the fun round, area N): the name, the reader's disc and Grown-ups. Lessons, the Aa key and the stars chip are gone from it
   (22-nav.js removes them; the book is on My path and in the Grown-ups sheet, the text size in the reader menu, the stars on My sky). */
.tb-reader { padding: 0 4px; gap: 8px; }
.tb-reader__name { display: none; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; font: 700 var(--t-sm)/1 var(--font-body); }
@container bar (min-width: 600px) { .tb-reader__name { display: inline; } .tb-reader { padding-inline: 4px 10px; } }
/* phones: the mark (or the Leave key) + the name or lesson title (flex, min 0) + the reader and Grown-ups; nothing wraps, the title truncates (last resort) */
@container bar (max-width: 419px) {
  .tb-word, .tb-title { font-size: 1rem; }
  .tb-right { gap: 4px; }
}
/* a narrow phone: the short lesson name, a slimmer wordmark */
@container bar (max-width: 359px) {
  .tb-in { gap: 4px; }
  .tb-brand { gap: 6px; padding-inline: 0; }
  .tb-word, .tb-title { font-size: .9375rem; }
  .tb-title__full { display: none; }
  .tb-title__short { display: inline; }
  .tb-right { gap: 2px; }
  .tb-logo { width: 24px; height: 24px; }
}

main.cq { display: block; container: app / inline-size; zoom: var(--content-zoom); min-height: 60vh; outline: none; }
.scr { display: block; padding: var(--s4) var(--gutter) var(--s7); max-width: 84rem; margin-inline: auto; }
.scr > h1:first-child, .scr-title { margin-bottom: var(--s3); }

/* reading column + margin column (3.4): the margin column appears when the container is 1000px or wider */
.cols { display: block; }
.col-margin { display: none; }
@container app (min-width: 1000px) {
  /* the two columns sit in the middle of the screen once there is room to spare (a 1920px projector), like home and the
     certificate; anything on the desk above them (the surah's controls) lines up with them (V3-09) */
  .cols { display: grid; grid-template-columns: minmax(0, var(--read-col)) var(--margin-col); gap: 2rem; align-items: start; justify-content: center; }
  .scr:has(> .cols) > :not(.cols) { max-width: calc(var(--read-col) + var(--margin-col) + 2rem); margin-inline: auto; }
  .col-margin { display: block; position: sticky; top: calc(var(--topbar-h) + 8px); }
  .only-narrow { display: none !important; }
}
@container app (max-width: 999px) { .only-wide { display: none !important; } }
@container app (max-width: 599px) { .hide-phone { display: none !important; } }
@container app (min-width: 600px) { .only-phone { display: none !important; } }

.stack { display: flex; flex-direction: column; gap: var(--s3); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.row-rtl { display: flex; flex-wrap: wrap; direction: rtl; gap: var(--s2); }
.spacer { flex: 1 1 auto; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); }
.center { text-align: center; }

/* ============================================================ 5.1 keycaps */
:where(button, a, label, summary).key {
  appearance: none; -webkit-appearance: none; margin: 0; position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px;
  background: var(--raised); color: var(--ink);
  border: 2px solid var(--edge); border-bottom-width: 5px; border-radius: var(--r-key);
  font: 700 var(--t-btn)/1.1 var(--font-body); text-decoration: none; text-align: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent; user-select: none; touch-action: manipulation;
  transition: transform var(--dur-press) var(--ease), background-color var(--dur-press) var(--ease);
}
:where(button, a, label, summary).key .icon { width: 20px; height: 20px; }
@media (hover: hover) { :where(button, a, label, summary).key:not(:disabled):not([aria-disabled="true"]):hover { background: var(--hover-mix); } }
:where(button, a, label, summary).key.is-hover { background: var(--hover-mix); }
:where(button, a, label, summary).key:not(:disabled):not([aria-disabled="true"]):active,
:where(button, a, label, summary).key.is-active,
:where(button, a, label, summary).key[aria-pressed="true"] { transform: translateY(2px); border-bottom-width: 3px; padding-bottom: 2px; }
:where(button, a, label, summary).key[aria-pressed="true"] { background: var(--l-wash); border-color: var(--l-ink); }
:where(button, a, label, summary).key:disabled,
:where(button, a, label, summary).key[aria-disabled="true"] { opacity: .45; border-bottom-width: 2px; cursor: not-allowed; }
.key.primary { background: var(--action); color: var(--on-action); border-color: var(--action-lip); }
@media (hover: hover) { .key.primary:not(:disabled):not([aria-disabled="true"]):hover { background: var(--action-hover); } }
.key.primary.is-hover { background: var(--action-hover); }
.key.kid { min-height: 64px; font: 700 var(--t-btn-kid)/1.1 var(--font-display); padding: 0 20px; }
.key.kid .icon { width: 24px; height: 24px; }
.key.big { min-height: 72px; }
.key.icon { width: 48px; min-width: 48px; padding: 0; }
.key.icon .icon { width: 22px; height: 22px; }
.key.block { display: flex; width: 100%; }
.key .key__sub { display: block; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.key.primary .key__sub { color: inherit; }
.kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1.5px solid var(--edge); border-bottom-width: 3px;
  border-radius: 6px; font: 700 var(--t-cap)/1 var(--font-body); color: var(--ink-soft); background: var(--raised); }

/* very narrow containers (a phone with the words at 150-200%): a key or chip label wraps inside its key instead of pushing
   the page sideways */
@container app (max-width: 340px) {
  :where(button, a, label, summary).key { padding-inline: 10px; gap: 6px; max-width: 100%; }
  .key.kid { font-size: var(--t-btn); }
  .key :is(.key__label, .key__text), .chip > span { min-width: 0; overflow-wrap: break-word; }
}

/* text button */
.quiet {
  appearance: none; background: none; border: 0; margin: 0; padding: 0 4px; min-height: 44px;
  display: inline-flex; align-items: center; gap: 6px; color: var(--lapis);
  font: 700 var(--t-btn)/1.2 var(--font-body); text-decoration: none; cursor: pointer; border-radius: 6px;
}
@media (hover: hover) { .quiet:hover { text-decoration: underline; } }
.quiet.is-hover { text-decoration: underline; }
.quiet .icon { width: 20px; height: 20px; }

/* the grown-up "Mark as finished" key: one press asks "Are you sure? Press again", the second confirms (no hold since 23 Nov 2026) */
.key.hold.is-armed { background: var(--action); color: var(--on-action); }
.key.hold.is-done { background: var(--action); color: var(--on-action); }

/* ============================================================ 5.2 chips, tabs, segmented, toggle, input */
.chip {
  appearance: none; margin: 0; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: var(--r-chip);
  border: 1.5px solid var(--edge); background: var(--paper); color: var(--ink);
  font: 700 var(--t-sm)/1.2 var(--font-body); text-decoration: none; cursor: pointer; max-width: 100%; text-align: start;
  -webkit-tap-highlight-color: transparent;
}
.rail .chip, .chip.nowrap { white-space: nowrap; }
/* a tab is never wider than the rail: a long Read-alone label ends in "…" (its accessible name keeps the full text) */
.rail .chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .chip:hover { background: var(--l-wash); } }
.chip.is-hover { background: var(--l-wash); }
.chip[aria-pressed="true"], .chip[aria-current="page"], .chip.is-selected {
  background: var(--l-fill); border: 2px solid var(--l-ink); padding-inline: 13.5px; color: var(--ink);
}
.chip .icon { width: 20px; height: 20px; }
.chip.is-dim { opacity: .4; }
.tab.is-read::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.tab.gild::before { animation: lr-dot-gild var(--dur-ui) var(--ease); }

/* the segments fill the pill edge to edge as plain rectangles, so every point inside the 44px pill hits a segment (B5;
   hit testing follows border-radius, so the label itself has none); the pill look is drawn by ::before, 3px inside */
.seg { display: inline-flex; flex-wrap: wrap; align-items: stretch; gap: 0; min-height: 44px; padding: 0;
  border: 1.5px solid var(--edge); border-radius: var(--r-pill); background: var(--paper); max-width: 100%; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg label { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 41px; padding: 0 17px; color: var(--ink-soft); font: 700 var(--t-sm)/1.1 var(--font-body); cursor: pointer; text-align: center; }
.seg label::before { content: ""; position: absolute; inset: 3px; z-index: -1; border-radius: var(--r-pill); }
.seg label .icon { width: 18px; height: 18px; }
.seg input:checked + label { color: var(--paper); }
.seg input:checked + label::before { background: var(--ink); }
.seg input:focus-visible + label::before { outline: 3px solid var(--lapis); outline-offset: 2px; box-shadow: 0 0 0 2px var(--paper); }
@media (hover: hover) { .seg input:not(:checked) + label:hover { color: var(--ink); } .seg input:not(:checked) + label:hover::before { background: var(--l-wash); } }

.switch { appearance: none; background: none; border: 0; margin: 0; padding: 4px 0; min-height: 44px;
  display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-align: start;
  font: 400 var(--t-body)/1.3 var(--font-body); cursor: pointer; }
.switch:focus-visible { outline: none; box-shadow: none; }
.switch__track { position: relative; flex: none; width: 52px; height: 32px; border-radius: var(--r-pill);
  background: var(--rule); box-shadow: inset 0 0 0 1px var(--edge); transition: background-color var(--dur-ui) var(--ease); }
.switch__knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--edge); transition: transform var(--dur-ui) var(--ease); }
.switch[aria-checked="true"] .switch__track { background: var(--action); box-shadow: none; }
.switch[aria-checked="true"] .switch__knob { transform: translateX(20px); }
.switch:focus-visible .switch__track, .switch.is-focus .switch__track { outline: 3px solid var(--lapis); outline-offset: 2px; }
.switch.is-focus { outline: none; box-shadow: none; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field__label { font: 700 var(--t-sm)/1.3 var(--font-body); color: var(--ink); }
.input { display: block; width: 100%; height: 52px; padding: 0 14px; background: var(--raised); color: var(--ink);
  border: 2px solid var(--edge); border-radius: var(--r-chip); font: 400 1.125rem/1 var(--font-body); }
.input::placeholder { color: var(--ink-soft); opacity: 1; }
.input--line { height: 44px; background: transparent; border: 0; border-bottom: 2px solid var(--edge); border-radius: 0; padding: 0 4px; }

/* ============================================================ 5.3 paper and folio */
.page {
  background: var(--paper); color: var(--ink); border-radius: var(--r-paper); border: 1px solid var(--rule);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--l-ink);
  padding: 12px;
}
@container app (min-width: 600px) { .page { padding: 20px; } }
@container app (min-width: 1000px) { .page { padding: 28px; } }
.page.gold { box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--gold-ink); }
.page.rule-only { box-shadow: none; }
.page-title { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0 0 var(--s3); }
.folio {
  background: var(--paper); color: var(--ink);
  border: 16px solid transparent; border-image: var(--band) 16 round;
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--gold-ink);
  padding: 20px;
}
.folio.band-gold { border-image-source: var(--band-gold); box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--lapis); }
@container app (max-width: 479px) { .folio { border-width: 12px; padding: 14px; } }
.folio.thin { border-width: 12px; }

/* ============================================================ 5.4 cartouche */
.cartouche { display: flex; align-items: center; container: cart / inline-size; margin-block: var(--s2) var(--s3); }
.cart-cap { position: relative; z-index: 1; flex: none; width: 44px; height: 44px; }
.cart-cap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cart-cap .kh-star { fill: var(--l-fill); stroke: var(--l-ink); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.cart-cap .kh-disc { fill: var(--paper); }
.cart-field {
  flex: 1 1 auto; min-width: 0; margin-inline: -6px; padding: 8px 20px; min-height: 64px;
  background: var(--l-wash); border-block: 4px double var(--l-ink);
  display: flex; align-items: center; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap;
}
.cart-title { font: 700 var(--t-h2)/1.15 var(--font-display); margin: 0; color: var(--ink); min-width: 0; }
.cart-sub { display: block; font: 400 var(--t-sm)/1.3 var(--font-body); color: var(--ink-soft); margin-top: 2px; }
/* the Arabic name sits at the field's end (right). The span is dir="rtl", so a logical margin would resolve on its own
   (right-to-left) side; the field itself is always left-to-right, so the push to the end is a physical left margin. */
.cart-ar { font-size: var(--ar-title); line-height: 1.8; padding-block: 0; color: var(--l-ink); margin-left: auto; margin-right: 0; }
.cart-title { overflow-wrap: anywhere; }
@container cart (max-width: 420px) {
  .cart-field { flex-direction: column; align-items: stretch; padding-inline: 16px; }
  .cart-ar { align-self: flex-end; line-height: 1.6; padding-block: .1em; }
}
/* very narrow cartouches (a phone with the words at 150-200%): smaller caps, then none, so the title never breaks mid-word */
@container cart (max-width: 300px) { .cart-cap { width: 28px; height: 28px; } .cart-field { padding-inline: 12px; } }
@container cart (max-width: 230px) { .cart-cap { display: none; } .cart-field { margin-inline: 0; padding-inline: 10px; } }
.cartouche.mini .cart-cap { width: 28px; height: 28px; }
.cartouche.mini .cart-field { min-height: 44px; padding: 4px 16px; border-block-width: 3px; }
.cartouche.mini .cart-title { font: 700 var(--t-h3)/1.2 var(--font-display); }
.cartouche.mini .cart-ar { font-size: var(--ar-chip); line-height: 1.6; padding-block: .1em; }
.cartouche.gold .cart-cap .kh-star { fill: var(--gold); stroke: var(--gold-ink); }
.cartouche.gold .cart-field { background: color-mix(in oklab, var(--gold) 20%, var(--paper)); border-block-color: var(--gold-ink); }

/* ============================================================ 5.5 word on paper: button.w */
.w {
  appearance: none; -webkit-appearance: none; margin: 0; border: 0; background: transparent; color: var(--ink);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: min(64px, 100%); min-height: 64px; padding: 4px 8px 14px; border-radius: var(--r-chip);
  position: relative; cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--dur-press) var(--ease), box-shadow var(--dur-press) var(--ease);
  scroll-margin-top: calc(var(--topbar-h) + 72px); scroll-margin-bottom: 12px; /* the bar is cleared by html scroll-padding-bottom */
}
.w > .ar { display: block; font-size: var(--w-size, var(--ar-word)); line-height: 1.9; white-space: nowrap; }
.w .w__cap { display: block; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.w--read { --w-size: var(--ar-read); }
.w--read > .ar { line-height: 2; }
.w--wbw { --w-size: var(--ar-wbw); border: 1px solid var(--rule); padding: 8px 10px 14px; }
.w--chip { --w-size: var(--ar-chip); min-height: 56px; }
@media (hover: hover) { .w:hover { background: var(--l-wash); } }
.w.is-hover { background: var(--l-wash); }
.w.is-pointed { background: var(--pointer); box-shadow: 0 0 0 3px var(--pointer-ring); }
.w.is-pointed::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 9px solid var(--pointer-ring);
  transform: translateX(-50%); animation: lr-pen var(--dur-press) var(--ease);
}
.w.seen::before {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 1px var(--gold-ink);
}
.w.is-pointed.seen::before { display: none; }
.w.wide { grid-column: span 2; }
.w.is-done::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 6px; height: 3px; border-radius: 2px; background: var(--ok); width: auto; margin: 0; box-shadow: none; }
/* running mushaf text: no pen tip, soft pointer */
.w--run { display: inline; min-width: 0; min-height: 0; padding: 0 .08em; border-radius: 8px; vertical-align: baseline; line-height: inherit; }
.w--run > .ar { display: inline; font-size: inherit; line-height: inherit; padding: 0; }
.w--run.is-pointed { background: var(--pointer-soft); box-shadow: 0 0 0 2px var(--pointer-ring); }
.w--run.is-pointed::after, .w--run.seen::before { display: none; }

/* ============================================================ letter chip (row key, sun/moon letters) */
/* 44px rounded square; the glyph is an inline run on a 44px line, nudged so tails (ح ع ج) stay inside */
.lchip { display: inline-block; flex: none; min-width: 44px; height: 44px; padding: 0 6px; border-radius: var(--r-chip); vertical-align: middle;
  background: var(--l-fill); box-shadow: inset 0 0 0 1.5px var(--l-ink); color: var(--ink); text-align: center; white-space: nowrap;
  font-family: var(--font-ar); font-size: var(--ar-chip); line-height: 44px; }
.lchip > .ar { display: inline; font-size: inherit; line-height: inherit; padding: 0; position: relative; top: -.03em; }
.lchip--lg { min-width: 48px; height: 48px; line-height: 48px; }
.lchip--plain { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge); }

/* reader colour disc */
.disc { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--pc, var(--pc-0)); color: var(--on-pc); font: 800 1rem/1 var(--font-display); text-transform: uppercase; }
.disc[data-pc="0"] { --pc: var(--pc-0); } .disc[data-pc="1"] { --pc: var(--pc-1); } .disc[data-pc="2"] { --pc: var(--pc-2); }
.disc[data-pc="3"] { --pc: var(--pc-3); } .disc[data-pc="4"] { --pc: var(--pc-4); } .disc[data-pc="5"] { --pc: var(--pc-5); }
.disc--lg { width: 48px; height: 48px; font-size: 1.5rem; }
.disc--sm { width: 26px; height: 26px; font-size: .8125rem; }
.topbar .disc { box-shadow: 0 0 0 2px var(--cover), 0 0 0 3px color-mix(in oklab, var(--on-cover) 55%, transparent); }

/* ============================================================ 5.6 lesson tile */
.tile {
  appearance: none; background: none; border: 0; margin: 0; padding: 4px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; border-radius: var(--r-chip);
  -webkit-tap-highlight-color: transparent;
}
.tile__badge { position: relative; display: grid; place-items: center; width: min(104px, 100%); aspect-ratio: 1; container-type: inline-size;
  transition: transform var(--dur-press) var(--ease); }
.tile__star { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tile__rim { transform: scale(1.12); fill: var(--gold); stroke: var(--gold-ink); stroke-width: 1.5; }
.tile__face { fill: var(--paper); stroke: var(--edge); stroke-width: 3; stroke-dasharray: 6 5; }
.tile__gw { position: relative; font-size: 33cqi; line-height: 1; padding-top: .22em; white-space: nowrap; }
.tile__glyph { display: inline; line-height: inherit; padding: 0; color: var(--ink-soft); }
.tile__num-in { position: relative; font: 700 .8125rem/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.tile.is-new .tile__rim, .tile.is-started .tile__rim { display: none; }
.tile.is-started .tile__face { fill: var(--l-wash); stroke: var(--l-ink); stroke-width: 4; stroke-dasharray: none; }
.tile.is-started .tile__glyph, .tile.is-started .tile__num-in { color: var(--l-ink); }
.tile.is-earned .tile__face { fill: var(--l-fill); stroke: var(--gold-ink); stroke-width: 2; stroke-dasharray: none; }
.tile.is-earned .tile__glyph, .tile.is-earned .tile__num-in { color: var(--ink); }
.tile__name { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 4px; direction: ltr; unicode-bidi: isolate; text-align: center; max-width: 100%; overflow-wrap: anywhere;
  font: 700 var(--t-sm)/1.25 var(--font-body); color: var(--ink); }
.tile__name .num { color: var(--ink-soft); }
.tile__name .icon { width: 16px; height: 16px; color: var(--ok); stroke-width: 3; }
.tile .pips { margin-top: 2px; }
.tile.is-new .pips, .tile.is-earned .pips { display: none; }
.tile__here { position: absolute; top: 0; inset-inline-start: 0; width: 26px; height: 26px; font-size: .8125rem; box-shadow: 0 0 0 2px var(--paper); z-index: 1; }
@media (hover: hover) { .tile:hover .tile__badge { transform: scale(1.04); } }
.tile.is-hover .tile__badge { transform: scale(1.04); }
.tile:active .tile__badge { transform: translateY(1px); }
.tile--mini { padding: 0; }
.tile--mini .tile__badge { width: 36px; }
.tile--mini .tile__here { width: 16px; height: 16px; font-size: .5625rem; top: -4px; }
.tile--micro { padding: 0; pointer-events: none; }
.tile--micro .tile__badge { width: 16px; }
.tile--big .tile__badge { width: 120px; }
.tile-ayat .tile__gw { font-size: 38cqi; padding-top: .12em; }

/* ============================================================ 5.7 beads and pips */
.beads { display: flex; flex-wrap: wrap; direction: rtl; gap: 4px; align-items: center; }
.bead { width: 20px; height: 20px; flex: none; overflow: visible; }
.bead--sm { width: 14px; height: 14px; }
.bead--lg { width: 40px; height: 40px; }
.bead .ros-petal, .bead .ros-disc { fill: var(--paper); stroke: var(--edge); stroke-width: 4; }
.bead .ros-ring { fill: none; stroke: var(--edge); stroke-width: 3; }
.bead.is-current .ros-petal, .bead.is-current .ros-disc, .bead.is-current .ros-ring { stroke: var(--l-ink); stroke-width: 6; }
.bead.is-done .ros-petal, .bead.is-done .ros-disc { fill: var(--gold); stroke: var(--gold-ink); }
.bead.is-done .ros-ring { stroke: var(--gold-ink); }
.bead.is-retry .ros-petal, .bead.is-retry .ros-disc { fill: var(--l-fill); stroke: var(--l-ink); }
.bead.is-retry .ros-ring { stroke: var(--l-ink); }
.bead.gilding .ros-petal { animation: lr-petal var(--dur-gild) var(--ease) both; animation-delay: calc(var(--k, 0) * 40ms); }
.bead.gilding .ros-disc { animation: lr-petal 120ms var(--ease) 320ms both; }
.bead__label { position: absolute; inset: 0; display: grid; place-items: center; font: 700 var(--t-sm)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.bead-num { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; }
.bead-num .bead { position: absolute; inset: 0; width: 100%; height: 100%; }
.bead-num .bead__label { color: var(--ink); }
.bead-num.is-done .bead__label { color: var(--on-gold); }
.pips { display: inline-flex; direction: rtl; gap: 6px; align-items: center; }
.pip { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--edge); flex: none; }
.pip.is-done { background: var(--l-ink); border-color: var(--l-ink); }

/* ============================================================ 5.8 page rail */
.rail {
  position: sticky; top: var(--topbar-h); z-index: var(--z-rail);
  display: flex; direction: rtl; gap: 8px; align-items: center;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
  background: var(--desk); border-bottom: 1px solid var(--rule); padding-block: 8px; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; scroll-snap-align: start; direction: ltr; }
/* chrome keeps its own size when the words are zoomed past 125% (--chrome-k, 00-tokens.css); its sticky offset is then
   in its own zoom, so the top bar height is divided by that zoom instead of the words' zoom */
main.cq .rail, main.cq .rbar { zoom: var(--chrome-k); }
/* when the tabs do not fit (V2-03): phones swipe them (spec 5.8); from 600px two arrow keys sit on the rail's ends, over a
   fade, so a mouse or a teacher sees that more pages (and Games) are there and can reach them. Each arrow is stuck to its
   end of the scroller and takes no room (negative margin); it shows only when there is more to see on that side.
   They are pointer helpers only: keyboard users Tab through the tabs, which scroll into view. */
.rail__arrow { display: none; }
@container app (min-width: 600px) {
  .rail > .rail__arrow {
    display: inline-flex; position: sticky; z-index: 1; align-self: stretch; align-items: center; justify-content: center;
    flex: none; width: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; color: var(--ink);
    cursor: pointer; scroll-snap-align: none; -webkit-tap-highlight-color: transparent;
  }
  .rail > .rail__arrow .icon { width: 22px; height: 22px; }
  .rail > .rail__arrow--start { right: 0; margin-left: -44px; background: linear-gradient(to left, var(--desk) 62%, transparent); }
  .rail > .rail__arrow--end { left: 0; margin-right: -44px; background: linear-gradient(to right, var(--desk) 62%, transparent); }
  /* the arrow sticks to the scroller's content edge: a band of desk covers the rail's padding beyond it as well */
  .rail > .rail__arrow::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40px; background: var(--desk); pointer-events: none; }
  .rail > .rail__arrow--start::after { left: 100%; }
  .rail > .rail__arrow--end::after { right: 100%; }
  .rail > .rail__arrow.is-off { visibility: hidden; pointer-events: none; }
  @media (hover: hover) { .rail > .rail__arrow:hover { color: var(--lapis); } }
}
main.cq .rail { top: calc((var(--topbar-base) * var(--topbar-zoom) + env(safe-area-inset-top, 0px)) / var(--chrome-zoom)); }
/* short screens (a phone on its side, or the words zoomed up on a small phone: html.lr-short from LR.store): a strip stuck
   under the top bar would leave no room between it and the reading bar, so the page rail (and the lesson's rail row, the
   surah's legend strip) scroll with the page there (A2, V2-11) */
@media (max-height: 500px) {
  main.cq .scr :is(.rail, .ls-railrow) { position: relative; top: auto; }
}
html.lr-short main.cq .scr :is(.rail, .ls-railrow) { position: relative; top: auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding-block: var(--s3); }

/* ============================================================ 5.9 reading bar */
.rbar {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: var(--z-rbar);
  margin-top: var(--s4); padding: 8px; background: var(--raised); color: var(--ink);
  border: 2px solid var(--edge); border-radius: var(--r-bar); box-shadow: var(--float);
  container: rbar / inline-size;
}
.rbar__progress { position: absolute; top: 0; left: 14px; right: 14px; height: 3px; border-radius: 0 0 3px 3px; overflow: hidden; pointer-events: none; }
.rbar__progress > span { position: absolute; top: 0; right: 0; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--l-ink);
  transition: width var(--dur-ui) var(--ease); }
/* the counter sits on the bar's top edge (half in, half out), so it never covers the page's last line when the bar rests
   under the paper, and only a sliver of it (inside the words' scroll margin) floats over the page when the bar is stuck */
.rbar__count { display: none; position: absolute; top: calc(-.5 * (var(--t-cap) * 1.2 + 4px) - 1px); inset-inline-end: 14px; padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--raised); box-shadow: 0 0 0 1.5px var(--edge); color: var(--ink-soft);
  font: 700 var(--t-cap)/1.2 var(--font-body); font-variant-numeric: tabular-nums; }
@container app (min-width: 600px) { .rbar__count { display: block; } .rbar { margin-top: var(--s5); } }
.rbar__answers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rbar__answers:empty { display: none; }
@container app (min-width: 480px) { .rbar__answers { flex-direction: row; } .rbar__answers > .plate { flex: 1 1 0; } }
.plate { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: var(--r-panel);
  background: var(--l-wash); color: var(--ink); transform-origin: top; animation: lr-unfold 180ms var(--ease); }
.plate .icon { width: 18px; height: 18px; color: var(--l-ink); }
.plate--say { font: 700 var(--t-translit)/1.25 var(--font-body); }
.plate--mean { font: 400 var(--t-meaning)/1.4 var(--font-body); }
.plate.is-empty { color: var(--ink-soft); font: 400 var(--t-sm)/1.3 var(--font-body); }
.rbar__row { display: flex; align-items: stretch; gap: 6px; direction: ltr; flex-wrap: wrap; }
.rbar__next { flex: 1 1 104px; min-width: 104px; }
.rbar__next .key__label { white-space: normal; line-height: 1.05; }
.key__label, .key__text { overflow-wrap: normal; }
.rbar__say, .rbar__mean { flex: none; }
.rbar__back { flex: none; }
.rbar .l-short { display: none; }
/* Read-alone pages: the "No help" line shares the row with Next and Back (it wraps inside; the keys stay on one row).
   It never shrinks below about two words: in a narrow bar it takes its own line above the keys (A3) */
.rbar__alone { flex: 1 1 10ch; min-width: min(10ch, 100%); align-self: center; padding: 2px 4px; font: 600 var(--t-sm)/1.3 var(--font-display); color: var(--ink); }
@container app (min-width: 480px) { .rbar__alone { font-size: var(--t-body); padding-inline: 8px; } }
.rbar--alone .rbar__row { flex-wrap: nowrap; align-items: center; }
.rbar--alone .rbar__next { flex: 0 1 auto; }
@container rbar (max-width: 347px) {
  .rbar__next { flex-basis: 96px; min-width: 96px; padding: 0 8px; gap: 6px; }
  .rbar .l-full { display: none; }
  .rbar .l-short { display: inline; }
  .rbar__say, .rbar__mean { padding: 0 10px; gap: 4px; }
  .rbar__say .icon, .rbar__mean .icon { width: 18px; height: 18px; }
  .rbar__next.is-finish .icon { display: none; }
}
@container rbar (max-width: 327px) { .rbar__say .icon, .rbar__mean .icon { display: none; } }
/* a very narrow column (a phone with the words zoomed up): Next on its own row, then Say · Mean · Back, shorter keys */
@container rbar (max-width: 299px) {
  .rbar--alone .rbar__row { flex-wrap: wrap; }
  .rbar--alone .rbar__alone { flex: 1 1 100%; order: -1; padding-block: 0 4px; }
  .rbar--alone .rbar__next { flex: 1 1 auto; min-width: 0; }
}
@container rbar (max-width: 279px) {
  .rbar:not(.rbar--alone) .rbar__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .rbar:not(.rbar--alone) .rbar__next { grid-column: 1 / -1; min-width: 0; min-height: 52px; }
  .rbar:not(.rbar--alone) :is(.rbar__say, .rbar__mean, .rbar__back) { width: auto; min-width: 0; min-height: 44px; padding: 0 2px; font-size: var(--t-sm); }
}
/* a phone on its side: a slimmer bar, so the word being read and its answers both fit between the top bar and the bar */
@media (max-height: 500px) {
  .rbar { padding: 6px; }
  .rbar .key { min-height: 44px; }
  .rbar .key.kid { min-height: 52px; }
  .rbar__answers { gap: 4px; margin-bottom: 6px; }
  .plate { min-height: 40px; padding: 4px 12px; }
}
/* one-word view */
.oneword { display: grid; gap: var(--s2); }
.oneword__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; font-size: var(--t-sm); color: var(--ink-soft); }
.oneword__head .num { color: var(--ink); }
.oneword__card { display: grid; width: 100%; justify-items: center; align-content: center; gap: var(--s2); padding-block: var(--s4) var(--s5); touch-action: pan-y; min-height: 16rem; }
.oneword__card .beads { justify-content: center; max-width: 100%; }
.oneword__cap { font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); min-height: 1.3em; }
.oneword__word { max-width: 100%; text-align: center; white-space: nowrap; line-height: 1.9; }
.oneword__word.enter-next { animation: lr-in-left 160ms var(--ease); }
.oneword__word.enter-back { animation: lr-in-right 160ms var(--ease); }
.is-oneword .plate--say { font-size: 2rem; }
.is-oneword .plate--mean { font-size: 1.5rem; }

/* ============================================================ 5.10 example card (wordCard) with peek slots */
.wcard { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 12px; text-align: center; min-width: 0; }
.wcard__ar { font-size: var(--ar-word); line-height: 1.9; max-width: 100%; }
.wcard__pos { font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.wcard__peeks { display: grid; gap: 8px; width: 100%; }
.refchip { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 2px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--rule); color: var(--ink-soft); font: 700 var(--t-cap)/1.3 var(--font-body); text-decoration: none; font-variant-numeric: tabular-nums; }
a.refchip { color: var(--lapis); border-color: color-mix(in oklab, var(--lapis) 40%, transparent); }
a.refchip::before { content: ""; position: absolute; inset: -8px -4px; }
.peek {
  appearance: none; margin: 0; width: 100%; min-height: 44px; padding: 6px 12px; border-radius: var(--r-chip);
  border: 1.5px dashed var(--l-ink); background: var(--l-wash); color: var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: 700 var(--t-btn)/1.2 var(--font-body); -webkit-tap-highlight-color: transparent; text-align: center;
}
.peek .icon { width: 20px; height: 20px; color: var(--l-ink); }
@media (hover: hover) { .peek:hover { border-style: solid; } }
.peek.is-hover { border-style: solid; }
.peek[aria-expanded="true"] { border-style: solid; justify-content: space-between; text-align: start; }
.peek__ans { flex: 1 1 auto; min-width: 0; transform-origin: top; animation: lr-unfold 180ms var(--ease); }
.peek__ans--say { font: 700 1.125rem/1.25 var(--font-body); }
.peek__ans--mean { font: 400 1rem/1.35 var(--font-body); }
.peek__hide { flex: none; color: var(--ink-soft); }
.peek__hide .icon { width: 16px; height: 16px; color: var(--ink-soft); }

/* ============================================================ 5.11 sheets, dialogs, popovers, toast */
.lr-layers { position: relative; z-index: var(--z-scrim); }
.lr-sheet-wrap { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; align-items: flex-end; justify-content: center; }
.lr-scrim { position: absolute; inset: 0; background: var(--scrim); animation: lr-fade var(--dur-ui) var(--ease); }
.sheet {
  position: relative; width: 100%; max-height: 85vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); color: var(--ink); box-shadow: var(--float);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: lr-sheet-up var(--dur-ui) var(--ease);
}
.sheet__grab { width: 36px; height: 4px; border-radius: 2px; background: var(--rule); margin: 0 auto 8px; }
.sheet__head { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s3); }
.sheet__title { flex: 1 1 auto; min-width: 0; font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0; }
.sheet__foot { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
@media (min-width: 600px) {
  .lr-sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; max-height: calc(100vh - 48px); border-radius: var(--r-sheet); padding: 20px 24px 24px; animation: lr-pop var(--dur-ui) var(--ease); }
  .sheet__grab { display: none; }
  .sheet--wide { max-width: 720px; }
}
.lr-pop-wrap { position: fixed; inset: 0; z-index: var(--z-sheet); }
.lr-pop-wrap > .lr-scrim { background: transparent; animation: none; }
.pop {
  position: fixed; width: min(var(--pop-w, 360px), calc(100vw - 32px)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r-panel); box-shadow: var(--float);
  padding: 14px 16px 16px; animation: lr-pop var(--dur-ui) var(--ease); transform-origin: top right;
}
.pop .sheet__head { margin-bottom: var(--s2); }
/* scrollBody layers (long lists such as the Lessons contents): the grab bar, title, Close and the actions stay put and
   only the body scrolls; its small inner padding keeps a focused row's ring inside the scroller (V3-05) */
:is(.sheet, .pop).has-scrollbody { display: flex; flex-direction: column; }
:is(.sheet, .pop).has-scrollbody > * { flex: none; }
:is(.sheet, .pop).has-scrollbody > .sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin-inline: -6px; padding: 6px; scroll-padding-block: 6px; }
:is(.sheet, .pop).has-scrollbody > .sheet__foot { margin-top: var(--s2); }
.menu { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.menu__item { appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px;
  border: 0; border-radius: var(--r-chip); background: transparent; color: var(--ink); text-align: start; text-decoration: none;
  font: 700 var(--t-body)/1.2 var(--font-body); cursor: pointer; }
.menu__item .icon { width: 22px; height: 22px; color: var(--ink-soft); }
@media (hover: hover) { .menu__item:hover { background: var(--l-wash); } }
.menu__sep { height: 1px; background: var(--rule); margin: 6px 0; }
.lr-toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--rbar-space, 0px)); z-index: var(--z-toast);
  transform: translateX(-50%); max-width: calc(100vw - 32px); width: max-content;
  background: var(--ink); color: var(--paper); border-radius: var(--r-pill); padding: 12px 20px; box-shadow: var(--float);
  font: 600 var(--t-body)/1.3 var(--font-display); text-align: center; pointer-events: none;
  animation: lr-toast-in var(--dur-ui) var(--ease);
}
.lr-toast.is-leaving { opacity: 0; transition: opacity var(--dur-ui) var(--ease); }
/* while a sheet, dialog or popover is open the toast moves to the top, over the scrim, never over the layer's keys */
html.has-layer .lr-toast { bottom: auto; top: calc(16px + env(safe-area-inset-top, 0px)); }

/* ============================================================ confirm inline */
.confirm { display: grid; gap: var(--s3); padding: var(--s3); border-radius: var(--r-chip); background: var(--l-wash); }
.confirm__text { margin: 0; font-weight: 700; }

/* ============================================================ 5.14 notes */
.note { margin-block: var(--s4); }
.note__title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font: 700 var(--t-h3)/1.2 var(--font-display); }
.note__title .icon { width: 20px; height: 20px; color: var(--l-ink); }
.note__title .ar { font-size: 1.15em; }
.note__title > span { min-width: 0; overflow-wrap: anywhere; } /* long titles at 200% words wrap instead of overflowing */
.note__text { margin: 0; max-width: 62ch; font-size: var(--t-body); line-height: 1.55; }
.note__text.has-ar { line-height: 1.8; }
details.disclosure > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer;
  font: 700 var(--t-btn)/1.2 var(--font-body); color: var(--lapis); border-radius: 6px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon { width: 20px; height: 20px; transition: transform var(--dur-ui) var(--ease); }
details.disclosure[open] > summary .icon { transform: rotate(180deg); }

/* ============================================================ 5.15 size controls */
.size-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-block: 4px; }
.size-row__label { flex: 1 1 6rem; font: 700 var(--t-body)/1.2 var(--font-body); }
.size-row__val { min-width: 4.5ch; text-align: center; font: 700 var(--t-num)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.size-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s3); }
.size-hint { margin-top: var(--s3); font-size: var(--t-cap); color: var(--ink-soft); }

/* ============================================================ lessons sheet (5.13) */
.lessons-list { display: grid; margin: 0; padding: 0; list-style: none; }
.lrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; min-height: 56px; padding: 6px 8px;
  border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; border-radius: 0; }
.lrow.is-current { background: var(--l-wash); }
@media (hover: hover) { .lrow:hover { background: var(--l-wash); } }
.lrow__main { min-width: 0; display: grid; gap: 4px; }
.lrow__title { font: 700 var(--t-body)/1.2 var(--font-body); }
.lrow__title .num { color: var(--ink-soft); margin-inline-end: 4px; }
.lrow__status { font: 700 var(--t-cap)/1 var(--font-body); color: var(--ink-soft); margin-inline-start: 6px; }
.lrow__status.is-done { color: var(--ok); }
.lrow__ar { font-size: 1.75rem; line-height: 1.6; padding-block: .1em; color: var(--l-ink); text-align: end; }
.segs { display: flex; direction: rtl; gap: 2px; height: 6px; max-width: 12rem; }
.segs > i { flex: 1 1 0; border-radius: 2px; background: var(--rule); }
.segs > i.is-on { background: var(--l-ink); }
.lrow-surahs { display: grid; gap: 0; margin: 0 0 4px; padding: 0 0 0 56px; list-style: none; }
.lrow-surahs a { display: flex; justify-content: space-between; gap: 12px; min-height: 44px; align-items: center; padding: 0 8px;
  color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--rule); font-size: var(--t-sm); }
.lrow-surahs .num { color: var(--ink-soft); font-weight: 700; }
.lessons-foot { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s3); }
.has-scrollbody > .lessons-foot { margin-top: 0; padding-top: var(--s1); border-top: 1px solid var(--rule); }

/* ============================================================ where the sound comes from (the strip of five places; PLAN D8) */
.places { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.places__chip { --pl-fill: #E3F9F3; --pl-ink: #056454; display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px;
  border-radius: var(--r-pill); border: 2px solid transparent; background: var(--paper); color: var(--ink-soft);
  font: 700 var(--t-cap)/1.2 var(--font-body); box-shadow: inset 0 0 0 1.5px var(--rule); }
.places__chip[data-place="throat"] { --pl-fill: #FFBCC9; --pl-ink: #89334B; }
.places__chip[data-place="tongue"] { --pl-fill: #8DE5D0; --pl-ink: #056454; }
.places__chip[data-place="lips"] { --pl-fill: #FEBFB7; --pl-ink: #8C352F; }
.places__chip[data-place="nose"] { --pl-fill: #C9CCFF; --pl-ink: #4C4A95; }
.places__chip[data-place="mouth-space"] { --pl-fill: #85E3E6; --pl-ink: #026264; }
.places__chip:not(.is-active) { background: color-mix(in oklab, var(--pl-fill), var(--paper) 78%); }
.places__chip.is-active { background: var(--pl-fill); color: var(--pl-ink); border-color: var(--pl-ink); box-shadow: none; }

/* ============================================================ ayah medallion (gilded when ticked) */
/* In right-to-left text the KFGQPC medallion (any ayah number) is about .71em wide and .88em tall, centred across its
   advance and its ink centre .04em below the middle of its line box, at every line-height (the gold sits a hair lower still, under the heavier bottom scroll). The gold is a pseudo-element of that shape
   under the glyph: it covers the whole ring, so a ticked medallion reads in --on-gold on gold in both themes, and it
   grows from the centre (9: gilding). --medal-* are the geometry, shared with the one-shot shine. */
.medal {
  --medal-rx: .39em; --medal-ry: .47em; --medal-cy: calc(50% + .065em);
  position: relative; isolation: isolate; display: inline-block; vertical-align: baseline;
  color: var(--gold-ink); background: none; transition: color var(--dur-gild) var(--ease);
}
.medal::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: calc(50% - var(--medal-rx)); top: calc(var(--medal-cy) - var(--medal-ry));
  width: calc(2 * var(--medal-rx)); height: calc(2 * var(--medal-ry)); border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 1px var(--gold-ink);
  transform: scale(0); opacity: 0; transition: transform var(--dur-gild) var(--ease-pop), opacity var(--dur-ui) var(--ease);
}
.medal.is-ticked { color: var(--on-gold); }
.medal.is-ticked::before { transform: none; opacity: 1; }
button.medal { appearance: none; border: 0; margin: 0; padding: 0 .06em; font: inherit; line-height: inherit; cursor: pointer; border-radius: 50%; }
/* one shine across a medallion that has just been gilded (celebrate('medal') or .is-shining); never sparks (calm zone) */
.medal.is-shining::after {
  content: ""; position: absolute; pointer-events: none; border-radius: 50%;
  left: calc(50% - var(--medal-rx)); top: calc(var(--medal-cy) - var(--medal-ry));
  width: calc(2 * var(--medal-rx)); height: calc(2 * var(--medal-ry));
  background: linear-gradient(115deg, transparent 30%, color-mix(in oklab, var(--paper) 80%, transparent) 50%, transparent 70%) no-repeat;
  background-size: 300% 100%; background-position: 100% 0;
  animation: lr-sweep var(--dur-shine) var(--ease) var(--dur-gild) both;
}
/* one shine sweeping across a gilded shape (medallion; the surah cartouche in 60-ayat.css) */
@keyframes lr-sweep { from { background-position: 100% 0; opacity: 1; } 85% { opacity: 1; } to { background-position: 0 0; opacity: 0; } }

/* ============================================================ celebrate (9): gilding, tile earned, star pop */
.lr-celebrate { position: fixed; inset: 0; z-index: var(--z-toast); display: grid; place-items: center; padding: 16px; background: var(--scrim-soft);
  animation: lr-fade var(--dur-ui) var(--ease); cursor: pointer; }
.lr-celebrate__card { display: grid; justify-items: center; gap: 10px; max-width: min(28rem, 100%); padding: 24px 28px 22px; text-align: center;
  background: var(--paper); color: var(--ink); border-radius: var(--r-sheet); box-shadow: var(--float); animation: lr-pop var(--dur-ui) var(--ease); }
.lr-celebrate__card:focus, .lr-celebrate__card:focus-visible { outline: none; box-shadow: var(--float); } /* focused for screen readers only */
.lr-celebrate .tile { pointer-events: none; }
.lr-celebrate .tile__badge { width: 140px; animation: lr-tile-pop var(--dur-gild) var(--ease-pop) both; }
.lr-celebrate .tile__rim { animation: lr-rim var(--dur-gild) var(--ease-pop) both; }
.lr-celebrate .tile__face { animation: lr-face var(--dur-gild) var(--ease) both; }
.lr-shine { position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  -webkit-mask: var(--khatam-mask) center / 100% 100% no-repeat; mask: var(--khatam-mask) center / 100% 100% no-repeat; }
.lr-shine::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(115deg, transparent 35%, color-mix(in oklab, var(--paper) 75%, transparent) 50%, transparent 65%);
  animation: lr-shine var(--dur-shine) var(--ease) 200ms both; }
.lr-spark { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; pointer-events: none;
  animation: lr-spark 700ms var(--ease) 180ms both; }
.lr-spark .kh-star { fill: var(--gold); stroke: var(--gold-ink); stroke-width: 8; }
.lr-celebrate__title { font: 800 var(--t-display)/1.05 var(--font-display); margin: 4px 0 0; }
.lr-celebrate__line { font: 600 var(--t-body)/1.4 var(--font-display); color: var(--ink-soft); margin: 0; max-width: 32ch; }
.lr-celebrate__hint { font-size: var(--t-cap); color: var(--ink-soft); }
.lr-fly { position: fixed; left: 0; top: 0; z-index: var(--z-toast); pointer-events: none; color: var(--gold); display: grid; place-items: center;
  font: 800 1rem/1 var(--font-display); }
.lr-fly .icon { width: 16px; height: 16px; stroke: var(--gold-ink); stroke-width: 1; }
.lr-fly--text { color: var(--ink); background: var(--raised); border: 1.5px solid var(--gold-ink); border-radius: var(--r-pill); padding: 3px 8px; }

/* ============================================================ coming soon (route fallback) */
.soon { display: grid; gap: var(--s4); justify-items: start; padding-block: var(--s6); }

/* ============================================================ keyframes */
@keyframes lr-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lr-pop { from { opacity: 0; transform: scale(.96) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes lr-sheet-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes lr-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes lr-unfold { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes lr-pen { from { transform: translate(-50%, -6px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes lr-in-left { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lr-in-right { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lr-bump { 0% { transform: scale(1); } 45% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes lr-dot-gild { from { background: var(--gold); transform: scale(1.8); } to { background: var(--ok); transform: scale(1); } }
@keyframes lr-petal { from { fill: var(--paper); stroke: var(--edge); } to { fill: var(--gold); stroke: var(--gold-ink); } }
@keyframes lr-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes lr-nudge { 0%, 50%, 100% { transform: scale(1); } 25%, 75% { transform: scale(1.06); } }
@keyframes lr-tile-pop { from { transform: scale(1.6); } to { transform: scale(1); } }
@keyframes lr-rim { from { transform: scale(.9); opacity: .2; } to { transform: scale(1.12); opacity: 1; } }
@keyframes lr-face { from { fill: var(--l-wash); } to { fill: var(--l-fill); } }
@keyframes lr-shine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@keyframes lr-spark { from { transform: translate(var(--sx), var(--sy)) scale(.6); opacity: 1; } to { transform: translate(var(--ex), var(--ey)) scale(1); opacity: 0; } }
@keyframes lr-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.shake { animation: lr-shake 240ms var(--ease); }
.nudge { animation: lr-nudge 240ms var(--ease); }
.draw-check { stroke-dasharray: 24; animation: lr-check 250ms var(--ease) both; }

/* ============================================================ reduced motion (9) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .lr-scrim, .lr-toast, .lr-celebrate, .medal, .medal::before, .plate, .peek__ans { transition-duration: 120ms !important; }
  .medal::before { transform: none !important; }
  .medal.is-shining::after { display: none !important; }
  :where(button, a, label, summary).key:active, :where(button, a, label, summary).key[aria-pressed="true"],
  .tile:active .tile__badge, .tile:hover .tile__badge { transform: none !important; }
  .lr-spark, .lr-shine { display: none !important; }
  .shake { animation: none !important; outline: 2px solid var(--ink-soft); outline-offset: 2px; }
}

/* ---- 30-home.css ---- */
/* 30-home.css — feature A: home journey (.scr-home), readers gate + Readers (.scr-readers), certificate (.scr-cert),
 * Big screen (.scr-big + the .lr-big overlay), settings and help sheets (.lr-settings, .lr-help). Tokens only. */

/* ============================================================ 6.2 home */
.scr-home .home {
  display: grid; gap: var(--s5); align-items: start;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "side" "main" "foot";
}
.scr-home .home-side { grid-area: side; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); min-width: 0; }
.scr-home .home-main { grid-area: main; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); min-width: 0; }
.scr-home .home-foot { grid-area: foot; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); min-width: 0; justify-items: start; }
@container app (min-width: 1200px) {
  .scr-home .home {
    grid-template-columns: 22rem minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "side main" "foot main"; column-gap: var(--s6); row-gap: var(--s5);
  }
  .scr-home .home-main { padding-top: 4px; }
}
.scr-home .home-hello { margin: 0 0 var(--s2); }
.scr-home .home-addname { justify-self: start; margin-top: calc(var(--s2) * -1); }

/* Continue card: a keycap panel in the lesson's colours */
.scr-home .home-cont {
  display: grid; gap: var(--s3); padding: var(--s4); min-width: 0;
  background: var(--l-wash); color: var(--ink);
  border: 2px solid var(--l-ink); border-bottom-width: 5px; border-radius: var(--r-panel);
  cursor: pointer; transition: background-color var(--dur-press) var(--ease);
}
@media (hover: hover) { .scr-home .home-cont:hover { background: color-mix(in oklab, var(--l-wash), var(--l-fill) 35%); } }
.scr-home .home-cont__eyebrow { display: flex; align-items: center; gap: 6px; margin: 0; font: 700 var(--t-sm)/1.2 var(--font-body); color: var(--l-ink); }
.scr-home .home-cont__eyebrow .icon { width: 16px; height: 16px; }
.scr-home .home-cont__head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: center; }
.scr-home .home-cont .tile { padding: 0; cursor: inherit; }
.scr-home .home-cont .tile__badge { width: 64px; }
.scr-home .home-cont__titles { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-width: 0; }
.scr-home .home-cont__tt { display: grid; min-width: 0; }
.scr-home .home-cont__n { font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-home .home-cont__title { font: 700 1.5rem/1.15 var(--font-display); margin: 0; overflow-wrap: anywhere; }
.scr-home .home-cont__ar { font-size: var(--ar-chip); line-height: 1.6; padding-block: .1em; color: var(--l-ink); margin-left: auto; }
.scr-home .home-cont__line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; font: 700 var(--t-body)/1.3 var(--font-body); }
.scr-home .home-cont__line .pip { width: 10px; height: 10px; }
.scr-home .home-cont__go { width: 100%; }

.scr-home .home-play { justify-self: start; }
.scr-home .home-alldone { display: flex; align-items: flex-start; gap: 10px; margin: 0; font: 600 var(--t-body)/1.4 var(--font-display); }
.scr-home .home-alldone .khatam { width: 24px; height: 24px; margin-top: 2px; }

.scr-home .home-sum > .num { min-width: 0; }

/* tile board */
.scr-home .home-tiles__head { display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s3); }
.scr-home .home-tiles__head .cartouche { flex: 0 1 15rem; min-width: 0; margin: 0; }
.scr-home .home-count { margin-inline-start: auto; font: 700 var(--t-sm)/1.2 var(--font-body); color: var(--ink-soft); white-space: nowrap; }
.scr-home .home-board-page { padding-block: 16px; }
@container app (min-width: 1000px) { .scr-home .home-board-page { padding-inline: 14px; } .scr-home .home-board { column-gap: 6px; } }
.scr-home .home-board {
  list-style: none; margin: 0; padding: 0;
  display: grid; direction: rtl; gap: 8px; align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@container app (min-width: 600px) { .scr-home .home-board { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 12px; } }
@container app (min-width: 900px) { .scr-home .home-board { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.scr-home .home-board > li { display: flex; justify-content: center; min-width: 0; direction: ltr; }
.scr-home .home-board .tile { width: 100%; padding-inline: 0; }
/* tile names: the number stays with the first word ("11 Laam" / "Ta'reef"), long names take two balanced lines */
.scr-home .home-board .tile__name { display: block; text-wrap: balance; overflow-wrap: normal; hyphens: none; }
.scr-home .home-board .tile__name .num { margin-inline-end: .3em; }
/* a hyphenated name ("Hamzat-Wassl") never breaks at its hyphen; fitTileNames() sizes it to the cell (to the --t-cap floor)
   and adds .is-split only when even that cannot fit */
.scr-home .home-board .tile__name .nowrap { white-space: nowrap; }
.scr-home .home-board .tile__name .nowrap.is-split { white-space: normal; }
.scr-home .home-board .tile__name .icon { vertical-align: -3px; margin-inline-start: 3px; }
/* very narrow (a phone with the words at 150-200%): the card's tile goes above the titles, the board has 2 columns */
@container app (max-width: 340px) {
  .scr-home .home-cont { padding: var(--s3); }
  .scr-home .home-cont__head { grid-template-columns: minmax(0, 1fr); }
  .scr-home .home-cont .tile__badge { width: 48px; }
  .scr-home .home-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scr-home .home-cert > .icon:first-child { display: none; }
}

/* Read Real Ayat stop: a thin folio with a gold cartouche */
.scr-home a.home-ayat {
  display: grid; gap: var(--s2); color: var(--ink); text-decoration: none; min-width: 0;
  transition: background-color var(--dur-press) var(--ease);
}
@media (hover: hover) { .scr-home a.home-ayat:hover { background-color: color-mix(in oklab, var(--paper), var(--gold) 8%); } }
.scr-home a.home-ayat .cartouche { margin: 0 0 var(--s1); }
.scr-home .home-ayat__line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font: 700 var(--t-body)/1.3 var(--font-body); }
.scr-home .home-ayat__line .icon { color: var(--lapis); }
.scr-home .home-ayat .beads { gap: 6px; justify-content: flex-start; }

/* totals, certificate, grown-ups */
.scr-home .home-sum { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 var(--t-body)/1.3 var(--font-body); }
.scr-home .home-sum .rosette { width: 22px; height: 22px; }
.scr-home .home-cert { max-width: 100%; }
.scr-home .home-cert .icon:first-child { color: var(--ink-soft); }
.scr-home .home-cert.is-ready .icon:first-child { color: var(--gold); stroke: var(--gold-ink); }
.scr-home .home-grown { width: 100%; border-top: 1px solid var(--rule); padding-top: var(--s4); }
.scr-home .home-grown h2 { margin: 0 0 var(--s1); }
.scr-home .home-grown__links { display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
.scr-home .home-nostore, .scr-readers .rp-nostore { color: var(--ink-soft); font-size: var(--t-sm); margin: 0; }

/* ============================================================ 6.1 readers gate + Readers */
.scr-readers .rp { display: grid; gap: var(--s3); max-width: 72rem; }
.scr-readers .rp-title { margin: 0; }
.scr-readers .rp-lead { margin: 0; color: var(--ink-soft); }
.scr-readers .rp-plates {
  list-style: none; margin: var(--s2) 0 0; padding: 0;
  display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch;
}
@container app (min-width: 600px) { .scr-readers .rp-plates { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } }
@container app (min-width: 1000px) { .scr-readers .rp-plates { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.scr-readers .rp-plate { position: relative; display: grid; min-width: 0; min-height: 132px; padding: 0; }
.scr-readers .rp-plate--wide { grid-column: 1 / -1; padding: var(--s4); justify-self: start; width: 100%; max-width: 54rem; }
@container app (min-width: 600px) { .scr-readers .rp-plate--wide { padding: var(--s5); } }
.scr-readers .rp-pick {
  appearance: none; margin: 0; border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer;
  width: 100%; min-height: 132px; padding: 16px 10px 18px; border-radius: var(--r-paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .scr-readers .rp-plate:not(.rp-new):has(.rp-pick:hover) { background: var(--l-wash); } }
.scr-readers .rp-pick:active .disc { transform: translateY(1px); }
.scr-readers .rp-belongs { display: flex; align-items: center; gap: 6px; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-readers .rp-belongs .khatam { width: 12px; height: 12px; }
.scr-readers .rp-belongs .kh-star { fill: var(--l-fill); stroke: var(--l-ink); stroke-width: 9; }
.scr-readers .rp-pick .disc { margin-block: 4px 2px; }
.scr-readers .rp-name { font: 700 1.375rem/1.15 var(--font-display); max-width: 100%; overflow-wrap: anywhere; }
.scr-readers .rp-meta { font-size: var(--t-sm); line-height: 1.3; color: var(--ink-soft); }
@container app (max-width: 479px) {
  .scr-readers .rp-belongs .khatam { display: none; }
  .scr-readers .rp-pick { padding-inline: 6px; }
}
.scr-readers .rp-legacy { justify-self: center; margin: -6px 10px 14px; min-height: 40px; font-size: var(--t-cap); }
.scr-readers .rp-new { border: 2px dashed var(--edge); border-radius: var(--r-paper); }
.scr-readers .rp-new__btn { font: 700 var(--t-h3)/1.2 var(--font-display); gap: 10px; }
@media (hover: hover) { .scr-readers .rp-new:has(.rp-pick:hover) { background: var(--raised); border-color: var(--ink-soft); } }
.scr-readers .rp-plus { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--edge); color: var(--ink); }
.scr-readers .rp-plus .icon { width: 26px; height: 26px; }

/* the new-reader form and rename (inline) */
.scr-readers .rp-rename { display: grid; gap: var(--s4); max-width: 34rem; min-width: 0; }
.scr-readers .rp-form { display: grid; gap: var(--s4); min-width: 0; }
.scr-readers .rp-form__fields { display: grid; gap: var(--s4); min-width: 0; max-width: 34rem; }
.scr-readers .rp-preview {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 14px 10px 16px; border-radius: var(--r-paper); background: var(--l-wash); box-shadow: inset 0 0 0 1px var(--rule);
}
.scr-readers .rp-preview .disc { margin-block: 4px 2px; transition: background-color var(--dur-ui) var(--ease); }
.scr-readers .rp-preview__name { min-height: 1.15em; }
.scr-readers .rp-preview__name.is-empty { color: var(--ink-soft); font-weight: 600; }
@container app (min-width: 600px) {
  .scr-readers .rp-form { grid-template-columns: minmax(12rem, 16rem) minmax(0, 34rem); align-items: start; gap: var(--s5); }
  .scr-readers .rp-preview { min-height: 180px; position: sticky; top: calc(var(--topbar-h) + 12px); }
}
.scr-readers .rp-form__title { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 var(--t-h3)/1.2 var(--font-display); }
.scr-readers .rp-form__title .icon { color: var(--l-ink); }
.scr-readers .rp-cols { border: 0; margin: 0; padding: 0; min-width: 0; }
.scr-readers .rp-cols__legend { padding: 0; margin-bottom: 8px; font: 700 var(--t-sm)/1.3 var(--font-body); }
.scr-readers .rp-cols__row { display: flex; flex-wrap: wrap; gap: 10px; }
.scr-readers .rp-col { position: relative; display: inline-flex; }
.scr-readers .rp-col input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.scr-readers .rp-cols__row { gap: 8px; }
.scr-readers .rp-col label { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.scr-readers .rp-col .disc { width: 44px; height: 44px; font-size: 1.25rem; transition: box-shadow var(--dur-press) var(--ease); }
.scr-readers .rp-col input:checked + label .disc { box-shadow: inset 0 0 0 3px var(--paper), 0 0 0 2px var(--ink); }
.scr-readers .rp-col input:focus-visible + label { outline: 3px solid var(--lapis); outline-offset: 2px; }
.scr-readers .rp-form__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }
.scr-readers .rp-err { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--ink-soft); }
.scr-readers .rp-err .icon { width: 20px; height: 20px; }
.scr-readers .rp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); margin-top: var(--s2); }

/* Readers view: one row per reader (a teacher's glance) */
.scr-readers .rp-listpage { padding-block: 9px; }
.scr-readers .rp-list { list-style: none; margin: 0; padding: 0; }
.scr-readers .rp-row + .rp-row { border-top: 1px solid var(--rule); }
.scr-readers .rp-row__in {
  display: grid; align-items: center; gap: 6px 12px; min-height: 64px; padding: 12px 8px; border-radius: var(--r-chip);
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas: "disc name" "strip strip" "stats stats" "acts acts";
}
.scr-readers .rp-row__in > .disc { grid-area: disc; }
.scr-readers .rp-row__name { grid-area: name; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.scr-readers .rp-row__nm { font: 700 1.25rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.scr-readers .rp-now { display: inline-flex; align-items: center; gap: 3px; font: 700 var(--t-cap)/1.2 var(--font-body); color: var(--ok); }
.scr-readers .rp-pick .rp-now { margin-top: 2px; }
.scr-readers .rp-now .icon { width: 14px; height: 14px; stroke-width: 3; }
.scr-readers .rp-strip { grid-area: strip; display: flex; flex-wrap: wrap; direction: rtl; gap: 4px; justify-content: flex-end; }
.scr-readers .rp-strip .tile--micro .tile__badge { width: 16px; }
.scr-readers .rp-stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: var(--t-sm); line-height: 1.35; color: var(--ink-soft); }
.scr-readers .rp-stats .num { color: var(--ink); }
.scr-readers .rp-acts { grid-area: acts; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.scr-readers .rp-row__in > .confirm { grid-column: 1 / -1; grid-row: 1 / -1; }
.scr-readers .rp-row__in.is-editing { grid-template-areas: "disc edit"; }
.scr-readers .rp-row__in.is-editing > .rp-rename { grid-column: 2; }
@container app (min-width: 600px) {
  .scr-readers .rp-row__in {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas: "disc name acts" "disc strip acts" "disc stats acts";
  }
  .scr-readers .rp-strip { justify-content: flex-end; direction: rtl; width: max-content; max-width: 100%; }
}
@container app (min-width: 1200px) {
  .scr-readers .rp-row__in {
    grid-template-columns: 48px 12rem 17.5rem minmax(0, 1fr) 15rem;
    grid-template-areas: "disc name strip stats acts"; column-gap: 20px;
  }
}
.scr-readers .rp-row.is-current .rp-row__in { background: var(--l-wash); }
.scr-readers .rp-addpage { max-width: 40rem; }

/* ============================================================ 6.10 certificate */
.scr-cert .cert { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--s4); }
.scr-cert .cert-lock { justify-self: stretch; display: grid; gap: var(--s2); max-width: 46rem; }
.scr-cert .cert-lock h1 { margin: 0; }
.scr-cert .cert-lock__text { margin: 0; }
.scr-cert .cert-lock__h { margin: var(--s2) 0 0; }
.scr-cert .cert-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.scr-cert .cert-card {
  width: 100%; max-width: 960px; min-width: 0;
  /* one column that never grows past the card: a long name or line wraps instead of widening the folio */
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: var(--s3); text-align: center;
}
.scr-cert .cert-card > * { max-width: 100%; min-width: 0; }
@container app (min-width: 600px) {
  .scr-cert .cert-card { aspect-ratio: 4 / 3; padding: 28px 40px; gap: var(--s3); }
}
.scr-cert .cert-card.is-locked { opacity: .5; }
.scr-cert .cert-card .cartouche { width: min(100%, 34rem); margin: 0 0 var(--s1); }
.scr-cert .cert-card .cart-field { justify-content: center; text-align: center; }
.scr-cert .cert-card p { margin: 0 auto; }
.scr-cert .cert-given { font: 400 1.125rem/1.4 var(--font-body); color: var(--ink-soft); text-wrap: balance; }
.scr-cert .nowrap { white-space: nowrap; }
.scr-cert .cert-credit { text-wrap: balance; }
.scr-cert .cert-name-wrap { width: 100%; max-width: none; }
.scr-cert .cert-name { display: inline-block; max-width: 100%; font: 800 var(--t-display)/1.1 var(--font-display); white-space: nowrap; color: var(--ink); padding-bottom: 4px; border-bottom: 2px solid var(--gold); }
/* a name too long for one line at the smallest fitted size: two balanced lines (set by fitCertName in 30-home.js) */
.scr-cert .cert-name.is-wrap { white-space: normal; text-wrap: balance; overflow-wrap: anywhere; }
.scr-cert .cert-line2 { font: 400 1.125rem/1.45 var(--font-body); max-width: 44ch; text-wrap: balance; }
@container app (max-width: 599px) {
  .scr-cert .cert-card { gap: 10px; }
  .scr-cert .cert-seal .khatam { width: 40px; height: 40px; }
  .scr-cert .cert-sign { gap: 6px; margin-top: 0; }
}
@container app (min-width: 600px) { .scr-cert .cert-given, .scr-cert .cert-line2 { font-size: 1.25rem; } }
/* very narrow (a phone with the words at 150-200%): a smaller title so "Certificate" never breaks mid-word, bigger frieze tiles */
@container app (max-width: 340px) {
  .scr-cert .cert-card .cart-title { font-size: 1.0625rem; }
  .scr-cert .cert-card .cart-field { padding-inline: 6px; }
  .scr-cert .cert-frieze { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.scr-cert .cert-frieze {
  list-style: none; margin: var(--s1) 0 0; padding: 0; width: 100%; max-width: 52rem;
  display: grid; direction: rtl; gap: 4px; grid-template-columns: repeat(7, minmax(0, 1fr));
}
@container app (min-width: 600px) { .scr-cert .cert-frieze { grid-template-columns: repeat(13, minmax(0, 1fr)); } }
.scr-cert .cert-frieze > li { display: flex; justify-content: center; min-width: 0; direction: ltr; }
.scr-cert .cert-frieze .tile { padding: 0; cursor: default; width: 100%; }
.scr-cert .cert-frieze .tile__badge { width: min(64px, 100%); }
/* phones (7 + 6): tiles of about 40px; the badge glyph grows inside its star so it stays readable (spec 6.10) */
@container app (max-width: 599px) { .scr-cert .cert-frieze { gap: 2px; } }
@container (max-width: 56px) { .scr-cert .cert-frieze .tile__gw { font-size: 46cqi; padding-top: .2em; } }
.scr-cert .cert-seal { display: inline-flex; align-items: center; gap: 10px; font: 700 var(--t-h3)/1.2 var(--font-display); color: var(--gold-ink); }
.scr-cert .cert-seal .khatam { width: 48px; height: 48px; }
.scr-cert .cert-ayat { font: 700 var(--t-body)/1.3 var(--font-body); }
.scr-cert .cert-sign { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); width: 100%; max-width: 40rem; margin-top: var(--s2); }
@container app (min-width: 600px) { .scr-cert .cert-sign { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); } }
.scr-cert .cert-sign__item { display: grid; gap: 2px; justify-items: stretch; align-content: end; min-width: 0; }
.scr-cert .cert-sign__label { font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-cert .cert-sign__val { display: flex; align-items: flex-end; justify-content: center; min-height: 44px; padding: 0 4px 6px;
  border-bottom: 2px solid var(--edge); font: 700 1.125rem/1.2 var(--font-body); }
.scr-cert .cert-teacher { text-align: center; font: 700 1.125rem/1 var(--font-body); color: var(--ink); }
.scr-cert .cert-teacher:disabled { cursor: not-allowed; }
.scr-cert .cert-credit { font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-cert .cert-shot { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); text-align: center; }

/* ============================================================ 6.9 Big screen (overlay outside main: main is a layout-contained container) */
.lr-big {
  position: fixed; inset: 0; z-index: var(--z-big);
  display: grid; grid-template-rows: minmax(0, 1fr);
  background: var(--paper); color: var(--ink);
  border: 10px solid var(--cover);
  /* clear of notches and rounded corners (phone landscape): the frame may run under them, the content never does */
  padding: max(18px, calc(env(safe-area-inset-top, 0px) - 10px)) max(24px, calc(env(safe-area-inset-right, 0px) - 10px))
           max(16px, calc(env(safe-area-inset-bottom, 0px) - 10px)) max(24px, calc(env(safe-area-inset-left, 0px) - 10px));
  overflow-y: auto; overscroll-behavior: contain;
  font-family: var(--font-body);
}
.lr-big::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold); pointer-events: none; }
.lr-big :focus-visible { outline: 3px solid var(--lapis); outline-offset: 2px; box-shadow: 0 0 0 2px var(--paper); }
.lr-big .big-stage:focus, .lr-big .big-title:focus { outline: none; box-shadow: none; }
.lr-big .big-in { position: relative; display: grid; grid-template-rows: auto minmax(10rem, 1fr) auto; height: 100%; min-height: 0; gap: 8px; }
.lr-big .big-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; }
.lr-big .big-title { margin: 0; font: 700 1.25rem/1.3 var(--font-body); color: var(--ink-soft); min-width: 0; }
.lr-big .big-count { font: 700 1.25rem/1.3 var(--font-body); font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
.lr-big .big-stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; min-height: 0; outline: none; }
.lr-big .big-cap { min-height: 1.6rem; font: 700 1.25rem/1.3 var(--font-body); color: var(--ink-soft); text-align: center; }
.lr-big .big-host { display: grid; place-items: center; width: 100%; min-height: 40dvh; min-width: 0; }   /* third review KIDS3-1: never collapse to the height of the text drawn in it */
.lr-big .big-word { display: inline-block; white-space: nowrap; line-height: 1.9; padding-block: 0; color: var(--ink); }
.lr-big .big-word.big-enter { animation: lr-in-left 160ms var(--ease); }
.lr-big .big-ans { display: grid; justify-items: center; align-content: start; gap: 2px; min-height: 7.5rem; width: 100%; text-align: center; }
.lr-big .big-say { margin: 0; max-width: none; font: 700 3rem/1.25 var(--font-body); color: var(--ink); animation: lr-unfold 180ms var(--ease); transform-origin: top; }
.lr-big .big-mean { margin: 0; max-width: 40ch; font: 400 2rem/1.35 var(--font-body); color: var(--ink); animation: lr-unfold 180ms var(--ease); transform-origin: top; }
.lr-big .big-empty { color: var(--ink-soft); font-size: 1.25rem; }
/* ayah mode: running text, pointer in --pointer-soft */
.lr-big .big-ayah { display: block; width: 100%; text-align: center; line-height: 2.1; padding-block: 0; color: var(--ink); text-wrap: balance; }
.lr-big .big-ayah .w--run { padding-inline: .06em; line-height: 1.55; vertical-align: baseline; }
.lr-big .big-ayah .medal { font-family: var(--font-ar); }
.lr-big .big-ayah .medal:focus-visible { outline-offset: 0; }
/* control strip */
.lr-big .big-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 6px; transition: opacity 400ms var(--ease); }
.lr-big .big-strip .key { min-height: 64px; padding: 0 13px; gap: 7px; }
/* height:auto undoes the svg rule `.icon{height:24px}` that also matches an icon keycap, so it stretches with its row */
.lr-big .big-strip .key.icon { width: 64px; min-width: 64px; height: auto; }
.lr-big .big-strip .kbd { margin-inline-start: 2px; }
.lr-big .big-strip .key.primary .kbd { background: transparent; color: inherit; border-color: currentColor; }
.lr-big .big-next { min-width: 8.5rem; font-size: 1.25rem; }
.lr-big .big-k-pick .key__label { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1399px) { .lr-big .big-strip .key.big-k-pick .icon:last-child { display: none; } }
.lr-big.is-idle .big-strip { opacity: 0; pointer-events: none; }
.lr-big.is-idle { cursor: none; }
.lr-big.is-blank > * { visibility: hidden; }
.lr-big .big-blanknote { position: absolute; bottom: max(14px, env(safe-area-inset-bottom, 0px)); left: 0; right: 0; margin: 0; max-width: none; text-align: center;
  font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); visibility: hidden; }
.lr-big.is-blank > .big-blanknote { visibility: visible; }
.lr-big.is-blank { cursor: none; }
@media (max-width: 1099px) { .lr-big .big-strip .kbd { display: none; } }
@media (max-width: 899px) {
  .lr-big {
    padding: max(14px, calc(env(safe-area-inset-top, 0px) - 10px)) max(14px, calc(env(safe-area-inset-right, 0px) - 10px))
             max(12px, calc(env(safe-area-inset-bottom, 0px) - 10px)) max(14px, calc(env(safe-area-inset-left, 0px) - 10px));
  }
  /* icon-only keys on small screens: the label stays as the key's accessible name (visually hidden, not display:none) */
  .lr-big .big-strip .key:not(.big-next) .key__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .lr-big .big-strip .key:not(.big-next) { width: 56px; min-width: 56px; padding: 0; min-height: 56px; }
  .lr-big .big-strip .key.big-k-pick .icon:last-child { display: none; }
  .lr-big .big-next { min-height: 56px; }
  .lr-big .big-title, .lr-big .big-count, .lr-big .big-cap { font-size: 1rem; }
  .lr-big .big-say { font-size: 2rem; }
  .lr-big .big-mean { font-size: 1.375rem; }
  .lr-big .big-ans { min-height: 5rem; }
}
@media (max-width: 479px) { .lr-big .big-strip { gap: 6px; } .lr-big .big-strip .key:not(.big-next) { width: 48px; min-width: 48px; min-height: 52px; } .lr-big .big-next { flex: 1 1 100%; } }
/* page / ayah picker and key map */
.lr-big .big-panel {
  position: absolute; z-index: 1; left: 50%; bottom: 100px; transform: translateX(-50%);
  width: min(560px, calc(100% - 32px)); max-height: calc(100% - 140px); overflow-y: auto;
  background: var(--raised); color: var(--ink); border: 2px solid var(--edge); border-radius: var(--r-panel); box-shadow: var(--float);
  padding: 12px 16px 16px; animation: lr-pop var(--dur-ui) var(--ease);
}
.lr-big .big-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.lr-big .big-panel__title { margin: 0; font: 700 var(--t-h3)/1.2 var(--font-display); }
.lr-big .big-picks { display: flex; flex-wrap: wrap; gap: 8px; }
@media (prefers-reduced-motion: reduce) {
  .lr-big .big-strip { transition: none; }
  .lr-big .big-word.big-enter { animation: none; }
}

/* ============================================================ key tables (Big screen key map, Help) */
.lr-big .keys-table, .lr-help .keys-table { width: 100%; border-collapse: collapse; font-size: var(--t-body); }
.lr-big .keys-table th, .lr-help .keys-table th { text-align: start; font-weight: 400; padding: 8px 12px 8px 0; vertical-align: top; white-space: nowrap; width: 1%; }
.lr-big .keys-table td, .lr-help .keys-table td { padding: 8px 0; vertical-align: top; line-height: 1.4; }
.lr-big .keys-table tr + tr > *, .lr-help .keys-table tr + tr > * { border-top: 1px solid var(--rule); }
.lr-big .keys-table .kbd, .lr-help .keys-table .kbd { min-width: 28px; height: 28px; font-size: var(--t-sm); margin-block: 1px; }
.lr-big .keys-or, .lr-help .keys-or { display: inline-block; width: 4px; }
@media (max-width: 479px) { .lr-help .keys-table th { white-space: normal; width: 40%; } }

/* ============================================================ 6.11 settings and help sheets */
.lr-settings .set-sec, .lr-help .help-sec { padding-block: var(--s3); }
.lr-settings .set-sec + .set-sec, .lr-help .help-sec + .help-sec { border-top: 1px solid var(--rule); }
.lr-settings .set-h, .lr-help .set-h { margin: 0 0 var(--s2); font: 700 var(--t-h3)/1.2 var(--font-display); }
.lr-settings .set-note, .lr-help .set-note { margin: -4px 0 var(--s2); font-size: var(--t-sm); color: var(--ink-soft); }
.lr-settings .set-toggles { display: grid; gap: 2px; }
.lr-settings .set-tip { margin-block: var(--s3) 0; padding-top: var(--s3); border-top: 1px solid var(--rule); }
.lr-help .help-sec p { margin: 0 0 var(--s2); }
.lr-help .help-ext { width: 16px; height: 16px; margin-inline-start: 2px; }

/* ---- 40-lesson.css ---- */
/* 40-lesson.css — feature B: lesson screen (final-spec 6.3), letters lesson (6.5), Reading the Mushaf (6.6).
 * Tokens only. Every rule is scoped under .scr-lesson (the screen) or .ls-sheet (the letter sheet in #lr-layers).
 * Layout switches are @container app queries (main.cq), so word zoom reflows instead of overflowing. */

/* ============================================================ header */
.scr-lesson .ls-col { min-width: 0; }
.scr-lesson .ls-head { margin-bottom: var(--s2); }
.scr-lesson .ls-eyebrow { margin: 0; }
.scr-lesson .ls-head .cartouche { margin-block: var(--s2) var(--s3); }
.scr-lesson .ls-goal { margin: 0 0 var(--s2); font-size: var(--t-body); line-height: 1.55; }
.scr-lesson .ls-goal.has-ar, .scr-lesson .ls-goal:has(.ar) { line-height: 1.8; }
.scr-lesson .ls-notes { margin-bottom: var(--s1); }
.scr-lesson .ls-notes > summary .icon { color: var(--lapis); }
.scr-lesson .ls-notes__body { padding-bottom: var(--s2); }
.scr-lesson .ls-notes__body > .note:first-child { margin-top: var(--s2); }
.scr-lesson .ls-spotcard { max-width: 20rem; margin-top: var(--s3); }
.scr-lesson .ls-anchor { height: 0; }
/* the goal: a header line from 480px (below 1000), the first "Today" note inside Lesson notes below 480px */
.scr-lesson .ls-notes .ls-note--goal { display: none; }

/* phones (spec 6.3 phone sketch; "Arabic is the hero"): a one-line cartouche (title at the start, Arabic name at the end),
   the goal folded into the notes and the view toggle on the rail row, so a page opens with its first rows of words in view */
@container app (max-width: 479px) {
  .scr-lesson .ls-head { margin-bottom: 0; }
  .scr-lesson .ls-head > .ls-goal { display: none; }
  .scr-lesson .ls-notes .ls-note--goal { display: block; }
  .scr-lesson .ls-head .cartouche { margin-block: 2px var(--s1); }
  .scr-lesson .ls-head .cart-cap { width: 32px; height: 32px; }
  .scr-lesson .ls-head .cart-field {
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
    min-height: 52px; padding: 2px 14px; gap: 0 12px; border-block-width: 3px;
  }
  .scr-lesson .ls-head .cart-title { font-size: 1.375rem; line-height: 1.15; flex: 0 1 auto; }
  .scr-lesson .ls-head .cart-ar { align-self: center; font-size: 1.75rem; line-height: 1.6; padding-block: .1em; }
  .scr-lesson .ls-notes > summary { min-height: 44px; }
}

/* ============================================================ rail row: page tabs (+ the view toggle on phones) */
/* The row is the sticky strip on lesson screens (the page rail inside it scrolls sideways). It is chrome like the rail
   (05-base.css): with the words zoomed past 125% it stays at 125% (--chrome-k), so its sticky offset and its edge-to-edge
   margins are written in its own zoom.
   From a 600px column the page toolbar ([Page | One word], Big screen, "Break them up") sits under the rail, on the desk
   (spec 5.8), so the tabs get the column's whole width (V3-03); below 600px the toggle shares the rail's line so the
   words start higher. 40-lesson.js moves the toolbar by reading --ls-split. */
.scr-lesson .ls-col { --ls-split: 0; }
@container app (min-width: 600px) { .scr-lesson .ls-col { --ls-split: 1; } }
.scr-lesson .ls-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding-top: var(--s3); }
.scr-lesson .ls-toolbar > .ls-tools { margin-inline-start: 0; padding-block: 0; flex-wrap: wrap; }
@container app (max-width: 599px) { .scr-lesson .ls-toolbar { padding-top: var(--s2); } }
.scr-lesson .ls-railrow {
  position: sticky; z-index: var(--z-rail); zoom: var(--chrome-k);
  top: calc((var(--topbar-base) * var(--topbar-zoom) + env(safe-area-inset-top, 0px)) / var(--chrome-zoom));
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s3); margin-top: var(--s1);
  background: var(--desk); border-bottom: 1px solid var(--rule);
}
.scr-lesson .ls-railrow > .rail { position: static; top: auto; z-index: auto; zoom: 1; flex: 1 1 22rem; min-width: 0; border-bottom: 0; }
.scr-lesson .ls-tools { flex: none; display: flex; align-items: center; gap: var(--s2); margin-inline-start: auto; padding-block: 8px; }
@container app (max-width: 999px) {
  .scr-lesson .ls-railrow { --row-g: calc(var(--gutter) / var(--chrome-k)); margin-inline: calc(var(--row-g) * -1); padding-inline: 0 var(--row-g); }
  .scr-lesson .ls-railrow > .rail { padding-inline: var(--row-g) 0; }
  .scr-lesson .ls-railrow:not(:has(.ls-tools)) { padding-inline: 0; }
  .scr-lesson .ls-railrow:not(:has(.ls-tools)) > .rail { padding-inline: var(--row-g); }
}
/* phones: the toggle stays on the tabs' row and the tabs scroll beside it; only when the tabs would get too narrow
   (words zoomed up) does the toggle drop to a second line */
@container app (max-width: 599px) {
  .scr-lesson .ls-railrow { gap: 0 var(--s2); }
  .scr-lesson .ls-railrow > .rail { flex: 1 1 9rem; }
  .scr-lesson .ls-view label { padding-inline: 10px; }
}
.scr-lesson .ls-tools2 { display: flex; align-items: center; }

/* ============================================================ page intro (lead / info notes): a teaser on phones */
/* Below 480px the intro shows a teaser (the first note's title and first sentence) ending in "More"; the full intro
   unfolds in place, with "Less" under it. Nothing is clamped or clipped (spec 3.3 rule 2; QR3-03): the folded part is
   simply not displayed. From 480px the full intro shows and neither key is displayed. */
.scr-lesson .ls-introwrap { position: relative; margin-bottom: var(--s3); }
.scr-lesson .ls-intro > :last-child { margin-bottom: 0; }
.scr-lesson .ls-teaser, .scr-lesson .ls-less { display: none; }
.scr-lesson .ls-teaser { margin: 0; }
.scr-lesson .ls-teaser.note { margin-block: 0; }
/* "More" runs on at the end of the teaser's last line; its hit area is taller than the line (44px) */
.scr-lesson .ls-more { position: relative; display: inline-flex; align-items: center; gap: 2px; min-height: 0; padding: 0 2px; vertical-align: baseline; white-space: nowrap; }
.scr-lesson .ls-more::before { content: ""; position: absolute; inset: -12px -8px; }
.scr-lesson :is(.ls-more, .ls-less) .icon { width: 18px; height: 18px; transition: transform var(--dur-ui) var(--ease); }
.scr-lesson .ls-less { align-items: center; gap: 4px; margin-top: 2px; padding: 0 2px; }
.scr-lesson .ls-less .icon { transform: rotate(180deg); }
@container app (max-width: 479px) {
  .scr-lesson .ls-intro, .scr-lesson .ls-teaser { font-size: var(--t-body); line-height: 1.55; }
  .scr-lesson .ls-teaser.has-ar, .scr-lesson .ls-teaser .note__text.has-ar { line-height: 1.8; }
  .scr-lesson .ls-introwrap.has-teaser:not(.is-open) > .ls-intro { display: none; }
  .scr-lesson .ls-introwrap.has-teaser:not(.is-open) > .ls-teaser { display: block; }
  .scr-lesson .ls-introwrap.has-teaser.is-open > .ls-less { display: inline-flex; }
}

/* ============================================================ the page (paper) */
.scr-lesson .ls-page { margin-top: var(--s3); }
@container app (max-width: 479px) { .scr-lesson .ls-page { margin-top: var(--s2); } }
.scr-lesson .ls-page__title { margin: 0 0 var(--s2); }
.scr-lesson .ls-page__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin-bottom: var(--s2); }
.scr-lesson .ls-page__head .ls-page__title { margin: 0; flex: 1 1 14rem; min-width: 0; }
.scr-lesson .ls-lead { margin: 0 0 var(--s3); max-width: 62ch; font-size: var(--t-body); line-height: 1.55; }
.scr-lesson .ls-lead.has-ar { line-height: 1.8; }
.scr-lesson .ls-pnote { margin-block: 0 var(--s4); }
.scr-lesson .ls-page > .ls-pnote:first-child { margin-top: 0; }
.scr-lesson .ls-tail { margin-top: var(--s4); padding-top: var(--s1); border-top: 1px solid var(--rule); }
.scr-lesson .ls-tail .note { margin-block: var(--s3) 0; }
.scr-lesson .ls-page__foot { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.scr-lesson .ls-subh { font: 700 var(--t-h3)/1.2 var(--font-display); margin: var(--s5) 0 var(--s2); }

/* ---- words inside grids/lists: centred in their cell ---- */
.scr-lesson .ls-page .w { max-width: 100%; }

/* ============================================================ grid page */
.scr-lesson .ls-grid { --key-col: 0px; display: grid; }
@container app (min-width: 480px) { .scr-lesson .ls-grid { --key-col: 56px; } }
.scr-lesson .ls-caps, .scr-lesson .ls-row {
  display: grid; direction: rtl; grid-template-columns: var(--key-col) repeat(var(--cols, 3), minmax(0, 1fr));
  align-items: center; justify-items: center; gap: 4px;
}
.scr-lesson .ls-caps { padding-bottom: 2px; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); text-align: center; }
.scr-lesson .ls-caps > span { direction: ltr; unicode-bidi: isolate; min-width: 0; }
/* Rows are as tight as the words allow (V3-08): the word's own box keeps its Arabic line (1.9) and the pen-tip padding,
   the row adds only 2px. On reading pages a word's .ar needs no extra padding: at line-height 1.9 (2 for Read alone) the
   line box is taller than the face's 1.76em content area, so every mark is inside it (05-base.css, spec 3.3). */
.scr-lesson .ls-row { padding-block: 2px; border-top: 1px solid var(--rule); }
.scr-lesson .ls-page .w > .ar { padding-block: 0; }
.scr-lesson .ls-grid > .ls-row:first-child { border-top: 0; }
.scr-lesson .ls-caps { order: -1; }
.scr-lesson .ls-key { display: flex; flex-direction: column; align-items: center; gap: 2px; direction: ltr; min-width: 0; }
.scr-lesson .ls-key__name { font: 700 var(--t-cap)/1.2 var(--font-body); color: var(--ink-soft); text-align: center; overflow-wrap: normal; word-break: keep-all; max-width: 72px; }
.scr-lesson .ls-empty { display: block; min-height: 1px; }
.scr-lesson .ls-poscap { display: none; }
@container app (max-width: 479px) {
  .scr-lesson .ls-caps > .ls-caps__key { display: none; }
  .scr-lesson .ls-caps, .scr-lesson .ls-row { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
  .scr-lesson .ls-key { grid-column: 1 / -1; justify-self: start; flex-direction: row; gap: 8px; direction: rtl; padding-top: 2px; }
  /* a row with a word too wide for its column (40-lesson.js stackWideRows; V3-10): its words flow right to left at their
     own widths, each with its position caption under it, so no word lands under another column's caption */
  .scr-lesson .ls-grid:not(.ls-grid--pairs) .ls-caps { order: var(--caps-at, -1); }
  .scr-lesson .ls-grid:not(.ls-grid--pairs) > .ls-row--stack { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: flex-end; column-gap: var(--s2); }
  .scr-lesson .ls-grid:not(.ls-grid--pairs) > .ls-row--stack > .ls-key { flex: 1 1 100%; justify-content: flex-start; }
  .scr-lesson .ls-grid:not(.ls-grid--pairs) > .ls-row--stack > .ls-empty { display: none; }
  .scr-lesson .ls-row--stack .ls-poscap { display: block; margin-top: -2px; }
}
/* one word per letter (kasrah, dhammah): ruled rows of letter units (the key with its word), as on the other grid pages
   (no boxes, spec 14.8), two units a line on phones and three from a 600px column (V3-08). Phones: the key above its
   word, as in the 3-column grid; from 480px: the key beside its word. A unit with a word too wide for it takes two. */
.scr-lesson .ls-grid--pairs { --pc: 2; direction: rtl; grid-template-columns: repeat(var(--pc), minmax(0, 1fr)); column-gap: var(--s3); }
@container app (min-width: 600px) { .scr-lesson .ls-grid--pairs { --pc: 3; column-gap: var(--s4); } }
.scr-lesson .ls-grid--pairs > .ls-row {
  display: flex; flex-direction: column; align-items: stretch; gap: 0; direction: rtl; min-width: 0;
  padding: 4px 0 2px; border-top: 1px solid var(--rule);
}
.scr-lesson .ls-grid--pairs > .ls-row:nth-child(-n+2) { border-top: 0; }
.scr-lesson .ls-grid--pairs > .ls-row:has(.w.wide) { grid-column: span 2; }
.scr-lesson .ls-grid--pairs .ls-key { grid-column: auto; flex: none; flex-direction: row; align-self: flex-start; gap: 8px; direction: rtl; padding-top: 2px; }
.scr-lesson .ls-grid--pairs .ls-row > .w { align-self: center; }
@container app (min-width: 480px) {
  .scr-lesson .ls-grid--pairs > .ls-row { flex-direction: row; align-items: center; gap: var(--s2); padding: 2px 0; }
  .scr-lesson .ls-grid--pairs .ls-key { flex-direction: column; gap: 2px; width: 56px; align-self: center; padding-top: 0; }
  .scr-lesson .ls-grid--pairs .ls-row > .w { flex: 0 1 auto; min-width: 0; margin-inline: auto; }
}
@container app (min-width: 600px) {
  .scr-lesson .ls-grid--pairs > .ls-row:nth-child(3) { border-top: 0; }
}

/* ============================================================ wordlist page */
.scr-lesson .ls-wl__group + .ls-wl__group { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.scr-lesson .ls-wl__head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s1); }
.scr-lesson .ls-wl__name { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0; }
.scr-lesson .ls-wl__words { display: grid; direction: rtl; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 4px; justify-items: center; align-items: center; }
/* "Break them up" (joining lesson) */
.scr-lesson .w.is-broken { justify-content: flex-start; gap: 0; }
.scr-lesson .w > .ls-pieces { display: block; font-size: var(--ar-chip); line-height: 1.9; white-space: nowrap; }
.scr-lesson .ls-piece { display: inline-block; }
.scr-lesson .ls-piece + .ls-piece { margin-inline-start: .35em; }
.scr-lesson .w > .ls-joined { display: block; font-size: 1.5rem; line-height: 1.9; color: var(--ink-soft); white-space: nowrap; }
.scr-lesson .oneword__word.ls-pieces .ls-piece + .ls-piece { margin-inline-start: .3em; }

/* ============================================================ warm-up page */
.scr-lesson .ls-warm__label { font: 700 1.0625rem/1.2 var(--font-display); color: var(--ink-soft); margin: var(--s4) 0 var(--s1); }
.scr-lesson .ls-warm__label:first-child { margin-top: 0; }
.scr-lesson .ls-warm__grid { display: grid; direction: rtl; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; justify-items: center; align-items: center; }
@container app (min-width: 600px) { .scr-lesson .ls-warm__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

/* ============================================================ read-alone page */
.scr-lesson .ls-alone { display: flex; flex-wrap: wrap; direction: rtl; justify-content: flex-start; align-items: center; column-gap: 1.1em; row-gap: 4px; }

/* ============================================================ sun & moon page */
/* Sun on the left, Moon on the right, as on the Sun & Moon game's two keys (and Sun first when stacked) */
.scr-lesson .ls-sms { display: grid; gap: var(--s3); }
@container app (min-width: 600px) { .scr-lesson .ls-sms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scr-lesson .ls-sm { direction: ltr; min-width: 0; padding: var(--s3); border-radius: var(--r-chip); }
.scr-lesson .ls-sm--sun { background: var(--sun-wash); }
.scr-lesson .ls-sm--moon { background: var(--moon-wash); }
.scr-lesson .ls-sm__head { display: flex; align-items: center; gap: 10px; }
.scr-lesson .ls-sm__icon { width: 40px; height: 40px; }
.scr-lesson .ls-sm--sun .ls-sm__icon { color: var(--sun-ink); }
.scr-lesson .ls-sm--moon .ls-sm__icon { color: var(--moon-ink); }
.scr-lesson .ls-sm__title { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0; }
.scr-lesson .ls-sm__line { margin: var(--s1) 0 var(--s3); }
.scr-lesson .ls-sm__letters { display: flex; flex-wrap: wrap; direction: rtl; gap: 6px; }
.scr-lesson .ls-sm__exlabel { margin: var(--s3) 0 0; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-lesson .ls-sm__words { display: flex; flex-wrap: wrap; direction: rtl; justify-content: center; gap: 4px; margin-top: var(--s1); }
.scr-lesson .ls-sm .w:not(.is-pointed):hover { background: color-mix(in oklab, var(--paper) 60%, transparent); }
/* a longer caption ("the laam is quiet: it hides in the joined shape") wraps under its word instead of widening it */
.scr-lesson .ls-sm .w .w__cap { max-width: 11rem; white-space: normal; text-align: center; }

/* ============================================================ rules (stopping) page */
.scr-lesson .ls-rule + .ls-rule { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.scr-lesson .ls-rule__text { margin: 0 0 var(--s1); }
.scr-lesson .ls-rule__row { display: flex; direction: rtl; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s2) var(--s4); }
.scr-lesson .ls-rule__arrow { display: inline-grid; place-items: center; color: var(--ink-soft); }
.scr-lesson .ls-rule__arrow .icon { width: 28px; height: 28px; }

/* ============================================================ end-of-page panel */
.scr-lesson .ls-end { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--rule); border-radius: 0;
  scroll-margin-top: calc(var(--topbar-h) + 64px); scroll-margin-bottom: calc(var(--rbar-h, 140px) + 24px); } /* clear of the rail and the sticky reading bar */
.scr-lesson .ls-end__q { margin: 0 0 var(--s3); font: 600 1.125rem/1.35 var(--font-display); }
.scr-lesson .ls-end__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.scr-lesson .ls-end__hint { margin: var(--s2) 0 0; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-lesson .ls-end__done { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s3); font: 600 1.125rem/1.35 var(--font-display); }
.scr-lesson .ls-end__tick { flex: none; width: 30px; height: 30px; padding: 4px; border-radius: 50%; color: var(--ok); background: var(--ok-wash); stroke-width: 3; }
.scr-lesson .ls-end__done.is-just .ls-end__tick { animation: lr-pop var(--dur-gild) var(--ease-pop); }
.scr-lesson #ls-next-page.is-arming { animation: lr-fade var(--dur-ui) var(--ease); }
@container app (max-width: 479px) { .scr-lesson .ls-end__row > .key { flex: 1 1 100%; } }

/* ============================================================ games page + finish line */
.scr-lesson .ls-games { display: grid; gap: var(--s5); padding-top: var(--s3); }
.scr-lesson .ls-h2 { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0 0 var(--s3); }
.scr-lesson .ls-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@container app (min-width: 600px) { .scr-lesson .ls-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.scr-lesson .ls-mode { justify-content: flex-start; min-width: 0; padding-inline: 10px 8px; text-align: start; gap: 8px; }
.scr-lesson .ls-mode > .icon { width: 26px; height: 26px; color: var(--l-ink); }
@container app (min-width: 600px) { .scr-lesson .ls-mode { padding-inline: 14px 10px; gap: 12px; } .scr-lesson .ls-mode > .icon { width: 28px; height: 28px; } }
.scr-lesson .ls-mode .key__text { display: grid; gap: 2px; min-width: 0; }
.scr-lesson .ls-mode .key__text > span:first-child { font: 700 1.0625rem/1.15 var(--font-display); }

.scr-lesson .ls-finish { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2) var(--s5); align-items: start; padding-block: var(--s5); }
@container app (min-width: 520px) {
  .scr-lesson .ls-finish { grid-template-columns: auto minmax(0, 1fr); }
  .scr-lesson .ls-finish__tile { grid-row: 1 / span 8; }
}
.scr-lesson .ls-finish__h { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0; color: var(--ink-soft); }
.scr-lesson .ls-finish__tile { display: grid; justify-items: center; padding: 8px 4px; }
.scr-lesson .ls-finish__tile .tile { pointer-events: none; }
.scr-lesson .ls-finish__badge { margin: 0; font: 700 1.5rem/1.15 var(--font-display); }
.scr-lesson .ls-finish__earned { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; color: var(--ok); }
.scr-lesson .ls-finish__earned .icon { width: 20px; height: 20px; stroke-width: 3; }
.scr-lesson .ls-finish__praise { margin: 0; font: 600 1.0625rem/1.4 var(--font-display); color: var(--ink-soft); }
.scr-lesson .ls-finish__best { margin: 0; font-size: var(--t-sm); color: var(--ink-soft); }
.scr-lesson .ls-finish__act { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); margin-top: var(--s2); }
@container app (max-width: 519px) { .scr-lesson .ls-finish__act > .key { align-self: stretch; } }
/* the grown-up "Mark as finished" key: its label may wrap to two lines on a phone, so it gets room and reads from the start (V3-12) */
.scr-lesson .ls-finish .key.hold { min-height: 64px; padding-block: 10px; justify-content: flex-start; text-align: start; line-height: 1.25; gap: 10px; }
.scr-lesson .ls-finish .key.hold .icon { flex: none; }
.scr-lesson .ls-steps { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 8px; }
.scr-lesson .ls-step { display: flex; align-items: flex-start; gap: 10px; }
.scr-lesson .ls-step__mark { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -1px; border-radius: 50%; border: 2px solid var(--edge); background: var(--paper); }
.scr-lesson .ls-step.is-done .ls-step__mark { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); }
.scr-lesson .ls-step__mark .icon { width: 16px; height: 16px; stroke-width: 3; }
.scr-lesson .ls-games__foot { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); }

/* ============================================================ margin column (container ≥ 1000) */
/* The notes column is part of the page: no inner scroller hiding Practise and Your tile. When it is taller than the
   window it scrolls with the page until its end is in view, then sticks there (--ls-mh = its height, set by 40-lesson.js),
   so everything in it is reachable by scrolling the page. The letter panel (Alphabet page) keeps a capped inner scroller
   so its title and its Next/Previous keys stay in view. */
@container app (min-width: 1000px) {
  .scr-lesson .ls-margin { top: min(calc(var(--topbar-h) + 8px), calc(100vh / var(--content-zoom) - var(--ls-mh, 0px) - 16px)); padding: 2px 2px 16px; }
  .scr-lesson .ls-margin.has-panel {
    top: calc(var(--topbar-h) + 8px);
    max-height: calc(100vh / var(--content-zoom) - var(--topbar-h) - 24px); overflow-y: auto; overscroll-behavior: contain;
    padding: 2px 6px 16px 2px;
  }
  .scr-lesson .ls-cols--abc { grid-template-columns: minmax(0, var(--read-col)) 26rem; }
}
.scr-lesson .ls-margin > .note:first-child { margin-top: 0; }
.scr-lesson .ls-margin .note { margin-block: 0 var(--s4); }
/* a compact example card in the 18rem column: smaller Arabic, the two peeks side by side */
.scr-lesson .ls-margin .ls-spotcard { max-width: none; padding: 8px; }
.scr-lesson .ls-margin .ls-spotcard .wcard__ar { font-size: var(--ar-chip); line-height: 1.9; }
.scr-lesson .ls-margin .ls-spotcard .wcard__peeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 6px; }
.scr-lesson .ls-status { display: grid; gap: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--rule); }
.scr-lesson .ls-mh { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0 0 var(--s2); }
.scr-lesson .ls-mlist { display: grid; gap: 6px; }
.scr-lesson .ls-mkey { justify-content: flex-start; width: 100%; gap: 10px; padding-inline: 12px; }
.scr-lesson .ls-mkey > .icon { color: var(--l-ink); }
.scr-lesson .ls-mkey__t { flex: 1 1 auto; min-width: 0; text-align: start; }
.scr-lesson .ls-mkey__b { flex: none; font: 700 var(--t-cap)/1.2 var(--font-body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.scr-lesson .ls-mtile__row { display: flex; align-items: center; gap: var(--s3); }
.scr-lesson .ls-mtile__row .tile--mini { padding: 0; }
.scr-lesson .ls-mtile__row .tile--mini .tile__badge { width: 48px; }
.scr-lesson .ls-mtile__txt { display: grid; gap: 6px; }
.scr-lesson .ls-mtile__state { font: 700 var(--t-sm)/1.25 var(--font-body); }
.scr-lesson .ls-mbig { margin-top: var(--s4); width: 100%; }

/* ============================================================ Reading the Mushaf: sign rows (6.6) and mushaf notes (6.5) */
.scr-lesson .ls-signs { display: grid; }
.scr-lesson .ls-sign {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "well head" "well body";
  align-items: start; gap: var(--s1) var(--s4); padding-block: var(--s4); border-top: 1px solid var(--rule);
}
.scr-lesson .ls-signs > .ls-sign:first-child { border-top: 0; padding-top: var(--s2); }
.scr-lesson .ls-sign__well {
  grid-area: well; display: grid; place-items: center; min-width: 88px; min-height: 88px; padding: 2px 8px;
  border-radius: var(--r-chip); background: var(--l-wash); color: var(--ink);
}
@container app (min-width: 600px) { .scr-lesson .ls-sign__well { min-width: 104px; min-height: 104px; } }
.scr-lesson .ls-sign__glyph { white-space: nowrap; }
.scr-lesson .ls-sign__glyph.is-mid { font-size: calc(var(--ar-sign) * .78); }
.scr-lesson .ls-sign__glyph.is-long { font-size: calc(var(--ar-sign) * .5); }
.scr-lesson .ls-sign__head { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s3); min-width: 0; padding-top: 4px; }
.scr-lesson .ls-sign__name { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0; }
.scr-lesson .ls-sign__ar { font-size: 1.75rem; line-height: 1.6; padding-block: .1em; color: var(--l-ink); }
.scr-lesson .ls-sign__body { grid-area: body; min-width: 0; }
.scr-lesson .ls-sign__body > p { margin: 0 0 var(--s2); }
.scr-lesson .ls-sign__looks.has-ar, .scr-lesson .ls-sign__rule, .scr-lesson .ls-sign__text { line-height: 1.6; }
.scr-lesson .ls-sign__rule { font-weight: 700; }
.scr-lesson .ls-sign__k { font-weight: 700; }
@container app (max-width: 479px) {
  .scr-lesson .ls-sign { grid-template-areas: "well head" "body body"; row-gap: var(--s2); }
  .scr-lesson .ls-sign__head { align-self: center; }
}
/* compact example cards (signs, mushaf notes): the same Arabic size, less padding, the two peeks side by side */
:is(.scr-lesson, .ls-sheet) .wcard.ls-cardc { padding: 8px 8px 10px; gap: 6px; }
:is(.scr-lesson, .ls-sheet) .wcard.ls-cardc .wcard__peeks { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); gap: 6px; }
.scr-lesson .ls-another { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-top: 2px; }
.scr-lesson .ls-another .icon { width: 18px; height: 18px; transition: transform var(--dur-ui) var(--ease); }
.scr-lesson .ls-another[aria-expanded="true"] .icon { transform: rotate(180deg); }
.scr-lesson .ls-cards--more { margin-top: var(--s1); }
.scr-lesson .ls-cards, .ls-sheet .ls-cards { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); align-items: start; margin-top: var(--s3); }
.scr-lesson .ls-links { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-top: var(--s3); }

/* ---- pause marks: the ladder (5 steps, Must stop → Don't stop here; icons + words, never traffic lights) ---- */
.scr-lesson .ls-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.scr-lesson .ls-step5 {
  display: grid; grid-template-columns: 2.75rem auto minmax(0, 1fr); align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s3); border-radius: var(--r-chip); color: var(--ink);
  background: color-mix(in oklab, var(--l-fill) calc(100% - var(--k, 0) * 25%), var(--l-wash));
}
.scr-lesson .ls-step5__icons { position: relative; display: inline-flex; justify-content: center; gap: 0; color: var(--ink); }
.scr-lesson .ls-step5__icons .icon { width: 26px; height: 26px; }
.scr-lesson .ls-step5__icons .icon + .icon { margin-inline-start: -6px; }
.scr-lesson .ls-step5__icons.is-light .icon { opacity: .55; }
.scr-lesson .ls-step5__icons.is-strike::after {
  content: ""; position: absolute; inset: -2px -4px; pointer-events: none;
  background: linear-gradient(to top right, transparent calc(50% - 1.5px), var(--ink) calc(50% - 1px), var(--ink) calc(50% + 1px), transparent calc(50% + 1.5px));
}
.scr-lesson .ls-step5__well { display: grid; place-items: center; min-width: 56px; min-height: 56px; padding: 0 6px; border-radius: var(--r-chip); background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }
.scr-lesson .ls-step5__glyph { font-size: 2.75rem; line-height: 1.4; padding-block: .19em; }
.scr-lesson .ls-step5__txt { display: grid; gap: 2px; min-width: 0; }
.scr-lesson .ls-step5__label { font: 700 1.0625rem/1.2 var(--font-display); }
.scr-lesson .ls-step5__name { font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink); } /* --ink: AA on the filled steps in dark */
.scr-lesson .ls-step5__rule { font-size: var(--t-sm); line-height: 1.4; }
/* each step's rule: inside the step on phones; a start-aligned list under the scale from 600px */
.scr-lesson .ls-ladder__rules { display: none; margin: var(--s3) 0 0; }
.scr-lesson .ls-ladder__rule { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s1) var(--s3); padding-block: 6px; border-top: 1px solid var(--rule); }
.scr-lesson .ls-ladder__rule:first-child { border-top: 0; }
.scr-lesson .ls-ladder__rule dt { font: 700 var(--t-body)/1.4 var(--font-body); }
.scr-lesson .ls-ladder__rule dd { margin: 0; font-size: var(--t-body); line-height: 1.5; max-width: 62ch; }
@container app (min-width: 600px) {
  .scr-lesson .ls-ladder { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .scr-lesson .ls-step5 { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; justify-items: center; text-align: center; align-items: start; padding: var(--s3) var(--s2); gap: var(--s2); }
  .scr-lesson .ls-step5__txt { justify-items: center; }
  .scr-lesson .ls-step5__rule { display: none; }
  .scr-lesson .ls-ladder__rules { display: block; }
}
@container app (min-width: 600px) and (max-width: 759px) { .scr-lesson .ls-ladder__rule { grid-template-columns: minmax(0, 1fr); } }
.scr-lesson .ls-cards--ladder .wcard__pos { order: -1; }

/* ============================================================ letters lesson: alphabet (6.5) */
.scr-lesson .ls-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s3); }
/* 4 columns on phones, 5 on tablets, 7 when the paper is wide (the letters box is its own size container) */
.scr-lesson .ls-letters { container: lsabc / inline-size; }
.scr-lesson .ls-abc { display: grid; direction: rtl; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@container lsabc (min-width: 520px) { .scr-lesson .ls-abc { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@container lsabc (min-width: 660px) { .scr-lesson .ls-abc { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.scr-lesson .ls-abc__cell { position: relative; min-width: 0; direction: ltr; }
.scr-lesson .ls-abc__tile {
  appearance: none; margin: 0; position: relative; width: 100%; height: 100%; min-height: 88px; padding: 4px 4px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r-chip); cursor: pointer;
  font: inherit; -webkit-tap-highlight-color: transparent;
  transition: opacity var(--dur-ui) var(--ease), background-color var(--dur-press) var(--ease);
}
@media (hover: hover) { .scr-lesson .ls-abc__tile:hover { background: var(--l-wash); } }
.scr-lesson .ls-abc__glyph { display: block; transition: opacity var(--dur-ui) var(--ease); }
.scr-lesson .ls-abc__name { font: 700 var(--t-sm)/1.15 var(--font-body); text-align: center; overflow-wrap: normal; }
/* the caption line keeps clear of the family dot in the bottom right corner (narrow tiles at 360px included) */
.scr-lesson .ls-abc__sub { font: 700 var(--t-cap)/1.2 var(--font-body); color: var(--ink-soft); text-align: center; padding: 0 16px 0 4px; }
@container lsabc (max-width: 419px) { .scr-lesson .ls-abc__name { font-size: var(--t-cap); } }
.scr-lesson .ls-abc__heavy { position: absolute; top: 6px; left: 6px; width: 16px; height: 3px; border-radius: 2px; background: var(--ink); }
.scr-lesson .ls-abc__fam { position: absolute; bottom: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--l-fill); box-shadow: 0 0 0 1px var(--l-ink); }
.scr-lesson .ls-abc__tile.is-match { background: var(--l-wash); border-color: var(--l-ink); box-shadow: inset 0 0 0 1px var(--l-ink); }
/* not matching a filter: the glyph and marks fade (never hidden); the name stays readable (AA) in --ink-soft */
.scr-lesson .ls-abc__tile.is-dim :is(.ls-abc__glyph, .ls-abc__fam, .ls-abc__heavy) { opacity: .5; }
.scr-lesson .ls-abc__tile.is-dim :is(.ls-abc__name, .ls-abc__sub) { color: var(--ink-soft); }
.scr-lesson .ls-abc__tile.is-open { border-color: var(--l-ink); box-shadow: 0 0 0 3px var(--l-ink); }
.scr-lesson .ls-abc__bang {
  position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: var(--ink); color: var(--paper); font: 800 .75rem/18px var(--font-body); text-align: center; cursor: pointer;
}
.scr-lesson .ls-abc__bang::before { content: ""; position: absolute; inset: -13px; }
/* each legend item keeps its swatch beside its own words (the words may wrap inside the item, never away from it) */
.scr-lesson .ls-abc__keyi { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.scr-lesson .ls-abc__keyi > span:last-child { min-width: 0; }
.scr-lesson .ls-abc__key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: var(--s3) 0 0; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); max-width: none; }
.scr-lesson .ls-abc__keyh { display: inline-block; flex: none; width: 16px; height: 3px; border-radius: 2px; background: var(--ink); }
.scr-lesson .ls-abc__keyd { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--l-fill); box-shadow: 0 0 0 1px var(--l-ink); }

/* lookalike families */
.scr-lesson .ls-fams { display: grid; }
.scr-lesson .ls-fam { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s2) var(--s4); padding-block: var(--s3); border-top: 1px solid var(--rule); }
.scr-lesson .ls-fams > .ls-fam:first-child { border-top: 0; }
.scr-lesson .ls-fam__letters { display: flex; flex-wrap: wrap; direction: rtl; gap: 6px; }
.scr-lesson .ls-fam__b {
  appearance: none; margin: 0; display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 0 6px 6px;
  background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r-chip); cursor: pointer; font: inherit;
}
@media (hover: hover) { .scr-lesson .ls-fam__b:hover { background: var(--l-wash); } }
.scr-lesson .ls-fam__n { direction: ltr; font: 700 var(--t-cap)/1.2 var(--font-body); color: var(--ink-soft); }
.scr-lesson .ls-fam__tip { margin: 0; }
@container app (max-width: 479px) { .scr-lesson .ls-fam { grid-template-columns: minmax(0, 1fr); } }
/* letters with a shape of their own: a grid of small cards (letter, then its tip), two a line on phones, not one per row */
.scr-lesson .ls-fams--single { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: var(--s3); }
.scr-lesson .ls-fams.ls-fams--single > .ls-fam {
  grid-template-columns: minmax(0, 1fr); align-content: start; justify-items: stretch; gap: var(--s2);
  padding: var(--s2); border: 1px solid var(--rule); border-radius: var(--r-chip);
}
.scr-lesson .ls-fams--single .ls-fam__tip { font-size: var(--t-sm); line-height: 1.45; }
.scr-lesson .ls-fams--single .ls-fam__tip.has-ar { line-height: 1.8; }
@container app (min-width: 600px) { .scr-lesson .ls-fams--single { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); } }

/* ============================================================ letter detail: sheet (.ls-sheet) and desktop panel (.ls-lpanel) */
:is(.scr-lesson, .ls-sheet) .ls-lt { display: grid; gap: var(--s4); }
:is(.scr-lesson, .ls-sheet) .ls-lt p { margin: 0; }
:is(.scr-lesson, .ls-sheet) .ls-lt__hero { display: flex; align-items: center; gap: var(--s4); }
:is(.scr-lesson, .ls-sheet) .ls-lt__well { flex: none; display: grid; place-items: center; min-width: 8.5rem; padding: 0 12px; border-radius: var(--r-chip); background: var(--l-wash); }
:is(.scr-lesson, .ls-sheet) .ls-lt__glyph { font-size: 6rem; line-height: 1.5; padding-block: .14em; }
@media (min-width: 600px) { .ls-sheet .ls-lt__glyph { font-size: 8rem; } .ls-sheet .ls-lt__well { min-width: 10.5rem; } }
.scr-lesson .ls-lpanel .ls-lt__glyph { font-size: 7rem; }
:is(.scr-lesson, .ls-sheet) .ls-lt__id { display: grid; gap: 2px; min-width: 0; }
:is(.scr-lesson, .ls-sheet) .ls-lt__name { font: 700 var(--t-h2)/1.15 var(--font-display); }
:is(.scr-lesson, .ls-sheet) .ls-lt__arname { font-size: 2rem; line-height: 1.6; padding-block: .1em; color: var(--l-ink); justify-self: start; }
:is(.scr-lesson, .ls-sheet) .ls-lt__says { font-size: var(--t-body); line-height: 1.45; }
:is(.scr-lesson, .ls-sheet) .ls-lt__small { font-size: var(--t-sm); line-height: 1.5; color: var(--ink-soft); max-width: 62ch; }
:is(.scr-lesson, .ls-sheet) .ls-lt__small.has-ar { line-height: 1.8; }
:is(.scr-lesson, .ls-sheet) .ls-lt__sec { display: grid; gap: var(--s2); }
:is(.scr-lesson, .ls-sheet) .ls-lt__h { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0; }
:is(.scr-lesson, .ls-sheet) .ls-lt__mouth { display: grid; align-items: start; gap: var(--s3); }
:is(.scr-lesson, .ls-sheet) .ls-lt__mtext { display: grid; gap: 4px; min-width: 0; }
:is(.scr-lesson, .ls-sheet) .ls-lt__zone { font: 700 var(--t-body)/1.3 var(--font-body); }
:is(.scr-lesson, .ls-sheet) .ls-lt__tip { font-size: var(--t-sm); line-height: 1.45; }
:is(.scr-lesson, .ls-sheet) .ls-lt__forms { display: grid; direction: rtl; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
:is(.scr-lesson, .ls-sheet) .ls-lt__form { display: grid; justify-items: center; align-content: start; padding: 2px 2px 8px; min-width: 0; }
:is(.scr-lesson, .ls-sheet) .ls-lt__form .ar-letter { font-size: 2.75rem; }
:is(.scr-lesson, .ls-sheet) .ls-lt__flabel { direction: ltr; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
:is(.scr-lesson, .ls-sheet) .ls-lt__joins { display: flex; align-items: center; gap: 10px; font-weight: 700; }
:is(.scr-lesson, .ls-sheet) .ls-lt__joins > .icon { width: 22px; height: 22px; color: var(--l-ink); }
:is(.scr-lesson, .ls-sheet) .ls-door { display: inline-flex; align-items: flex-end; gap: 6px; flex: none; }
:is(.scr-lesson, .ls-sheet) .ls-door i { display: block; width: 9px; height: 16px; border: 2px solid var(--l-ink); border-radius: 2px; }
:is(.scr-lesson, .ls-sheet) .ls-lt__fam { display: flex; flex-wrap: wrap; direction: rtl; gap: 10px; }
:is(.scr-lesson, .ls-sheet) .ls-lt__famb {
  appearance: none; margin: 0; display: grid; place-items: center; min-width: 72px; min-height: 64px; padding: 0 8px;
  background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r-chip); cursor: pointer;
}
@media (hover: hover) { :is(.scr-lesson, .ls-sheet) .ls-lt__famb:hover { background: var(--l-wash); } }
/* the current letter's ring is drawn inside its key, so nothing pokes out beside the sticky footer as it scrolls under it (V3-11) */
:is(.scr-lesson, .ls-sheet) .ls-lt__famb.is-current { border-color: var(--pointer-ring); box-shadow: inset 0 0 0 3px var(--pointer-ring); cursor: default; }
:is(.scr-lesson, .ls-sheet) .ls-lt__famg { font-size: 3rem; line-height: 1.5; padding-block: .14em; }
:is(.scr-lesson, .ls-sheet) .ls-lt__dots { font-size: var(--t-body); }
:is(.scr-lesson, .ls-sheet) .ls-lt__heavy { display: flex; align-items: flex-start; gap: var(--s3); }
:is(.scr-lesson, .ls-sheet) .ls-hbadge { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--rule); color: var(--ink); font: 800 1.125rem/1 var(--font-display); }
:is(.scr-lesson, .ls-sheet) .ls-lt__hname { font-weight: 700; margin-bottom: 2px; }
:is(.scr-lesson, .ls-sheet) .ls-lt__mnote { margin: 0; }
:is(.scr-lesson, .ls-sheet) .ls-lt__ex { max-width: 20rem; }
:is(.scr-lesson, .ls-sheet) .ls-lt__foot {
  position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  margin-top: var(--s1); padding-block: var(--s2) var(--s1); background: var(--paper); border-top: 1px solid var(--rule);
}
/* the scroller (sheet / panel) has bottom padding, and a sticky footer stops at its padding edge: a solid band of the
   footer's own ground below it covers that strip, so nothing scrolls into view under the keys */
.ls-sheet .ls-lt__foot { box-shadow: 0 calc(20px + env(safe-area-inset-bottom, 0px)) 0 var(--paper); }
@media (min-width: 600px) { .ls-sheet .ls-lt__foot { box-shadow: 0 24px 0 var(--paper); } }
/* the footer spans the sheet's whole width (its side padding too), so content scrolling under it never shows at its ends */
.ls-sheet .ls-lt__foot { margin-inline: -16px; padding-inline: 16px; }
@media (min-width: 600px) { .ls-sheet .ls-lt__foot { margin-inline: -24px; padding-inline: 24px; } }
.scr-lesson .ls-lpanel .ls-lt__foot { margin-inline: -2px -6px; padding-inline: 2px 6px; }
/* swipe (← next / → previous) on touch: the sheet keeps vertical scrolling, the sideways pan is ours (no history swipe) */
.ls-lsheet { overscroll-behavior: contain; }
.ls-lsheet .sheet__body, .scr-lesson .ls-lpanel { touch-action: pan-y; }
:is(.scr-lesson, .ls-sheet) .ls-lt__count { font-size: var(--t-cap); color: var(--ink-soft); }
@media (max-width: 379px) { .ls-sheet .ls-lt__hero { flex-wrap: wrap; } }

/* desktop panel: lives in the margin column on the Alphabet page */
.scr-lesson .ls-lpanel { display: grid; gap: var(--s3); }
.scr-lesson .ls-lpanel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.scr-lesson .ls-lpanel__title { font: 700 var(--t-h2)/1.15 var(--font-display); margin: 0; }
.scr-lesson .ls-lpanel .ls-lt__mtext { flex: 1 1 0; }
.scr-lesson .ls-lpanel .ls-lt__foot { background: var(--desk); box-shadow: 0 16px 0 var(--desk); }

/* the dotted Yaa uses Amiri (.ar-dots), whose content area is about 2.1em (KFGQPC: 1.76em): pad it so nothing overflows,
   and draw it at .85 (Hafs draws about 15% smaller than Amiri at the same size, spec 3.3) so it matches its neighbours */
:is(.scr-lesson, .ls-sheet) .ar.ar-dots:not(.ar-inline) { padding-block: .14em .5em; zoom: .85; }


/* bare pause marks in wells: a zero-height inline run (exempt from the line-box check), ink centred by JS from the font metrics */
/* the well becomes a plain block (a grid would blockify the run) with no strut; the run's zero-height line sits at mid-height */
.scr-lesson :is(.ls-sign__well, .ls-step5__well):has(> .is-bare) { display: block; font-size: 0; line-height: 0; text-align: center; }
.scr-lesson .ls-sign__well:has(> .is-bare) { height: 88px; padding: 44px 8px 0; }
@container app (min-width: 600px) { .scr-lesson .ls-sign__well:has(> .is-bare) { height: 104px; padding-top: 52px; } }
.scr-lesson .ls-step5__well:has(> .is-bare) { height: 56px; padding: 28px 6px 0; }
.scr-lesson .ar.is-bare { display: inline; position: relative; line-height: 0; padding: 0; font-size: 6.5rem; white-space: nowrap; }
.scr-lesson .ls-step5__glyph.is-bare { font-size: 4.25rem; }

/* ============================================================ very narrow columns (phones with the words zoomed up) */
.scr-lesson .ls-mode .key__text { min-width: 0; overflow-wrap: anywhere; }
@container app (max-width: 339px) {
  .scr-lesson .ls-modes { grid-template-columns: minmax(0, 1fr); }
  .scr-lesson .ls-sign { grid-template-columns: minmax(0, 1fr); grid-template-areas: "well" "head" "body"; }
  .scr-lesson .ls-sign__well { justify-self: start; }
  .scr-lesson .ls-step5 { grid-template-columns: auto minmax(0, 1fr); }
  .scr-lesson .ls-step5__txt { grid-column: 1 / -1; }
  .scr-lesson .ls-fam__letters { flex-wrap: wrap; }
  .scr-lesson .ls-end__row > .key, .scr-lesson .ls-games__foot > .key { flex: 1 1 100%; }
  .scr-lesson .ls-page__head > .key { flex: 1 1 100%; }
}
/* One word view: the card is the page; notes and the lead line wait in Page view */
.scr-lesson .ls-page.is-oneword :is(.ls-introwrap, .ls-lead, .ls-pnote, .ls-tail) { display: none; }
.scr-lesson .ls-page.is-oneword .oneword__head { justify-content: flex-end; }
@container app (max-width: 419px) { .scr-lesson #ls-check > .icon { display: none; } }

/* a lone Yaa key/chip in the dotted face (Amiri draws larger and lower than Hafs): size and seat it like its neighbours */
.scr-lesson .lchip > .ar.ar-dots { font-size: .82em; top: -.2em; }

/* ---- 50-practice.css ---- */
/* 50-practice.css — feature C: practice games (final-spec 6.4), results and rewards.
 * Everything is scoped under .scr-practice (the router's screen root) and uses the spec tokens only.
 * The game column is the one centred layout of the app (max 640px): a game is one focus. */

.scr-practice { padding-bottom: var(--s4); }
.scr-practice .pr { max-width: 640px; margin-inline: auto; display: flex; flex-direction: column; gap: var(--s3); }

/* ---------------------------------------------------------------- header row: ‹ Lesson · title · beads · close */
.scr-practice .pr-head {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: center; gap: var(--s1) var(--s3);
  grid-template-areas: "back . close" "title title title" "beads beads beads";
}
.scr-practice .pr-back { grid-area: back; justify-self: start; max-width: 100%; } /* no negative margin: Chrome then sizes the track 4px short and the name gets an ellipsis */
.scr-practice .pr-back > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.scr-practice .pr-close { grid-area: close; justify-self: end; }
.scr-practice .pr-title { grid-area: title; margin: 0; font: 700 var(--t-h2)/1.15 var(--font-display); min-width: 0; }
.scr-practice .pr-beads { grid-area: beads; min-height: 20px; justify-content: flex-end; } /* RTL row, sitting under the title */
@container app (min-width: 600px) {
  /* room for the title and the beads side by side under the back / close row */
  .scr-practice .pr-head { grid-template-areas: "back . close" "title title beads"; }
  .scr-practice .pr-beads { justify-content: flex-start; }
}
.scr-practice .pr--chooser .pr-head { grid-template-areas: "back . ." "title title title"; }

/* ---------------------------------------------------------------- stage: one card at a time */
.scr-practice .pr-stage { display: grid; min-width: 0; outline: none; }
.scr-practice .pr-stage:focus, .scr-practice .pr-stage:focus-visible { outline: none; box-shadow: none; }
.scr-practice .pr-stage > * { min-width: 0; }
.scr-practice .pr-enter { animation: lr-in-left 160ms var(--ease); }
.scr-practice .pr-leave { animation: pr-leave 120ms var(--ease) forwards; pointer-events: none; }
@keyframes pr-leave { to { transform: translateX(12px); opacity: 0; } } /* stays inside the 16px phone gutter: no sideways scroll */

/* ---------------------------------------------------------------- cards (paper with the lesson rule) */
.scr-practice .pr-card { display: grid; justify-items: center; align-content: start; gap: var(--s3); text-align: center; padding-block: var(--s5); min-width: 0; container-type: inline-size; }
.scr-practice .pr-card--check { box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--gold-ink); }
.scr-practice .pr-card__top { justify-self: stretch; display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.scr-practice .pr-cap { margin: 0; font: 400 var(--t-sm)/1.45 var(--font-body); color: var(--ink-soft); text-align: start; max-width: none; }
.scr-practice .pr-prompt .pr-cap { text-align: center; }
.scr-practice .pr-count { font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* the word to read: fitted (LR.ui.fit), never clipped, always --ink */
.scr-practice .pr-wordbox { justify-self: stretch; display: grid; place-items: center; min-height: 9rem; min-width: 0; }
.scr-practice .pr-wordbox--sm { min-height: 6rem; }
.scr-practice .pr-word { max-width: 100%; line-height: 1.9; text-align: center; color: var(--ink); }
.scr-practice .pr-wcard .pr-word .key { color: inherit; }
.scr-practice .pr-wcard.is-revealed .pr-word .key { color: var(--l-ink); }

/* answers under a gold-ink rule, inside the card */
.scr-practice .pr-reveal { justify-self: stretch; display: grid; gap: var(--s2); border-top: 1px solid var(--gold-ink); padding-top: var(--s3); }
/* keeping answers clear of the sticky top bar and keys after they change is done in JS (Frame.reveal, measured on screen) */
.scr-practice .pr-plate { text-align: start; }
.scr-practice .pr-plate > span { min-width: 0; overflow-wrap: anywhere; }
.scr-practice .pr-plate.plate--say { font-size: clamp(1.25rem, 9cqi, 1.75rem); }
.scr-practice .pr-plate.plate--mean { font-size: 1.1875rem; }
.scr-practice .pr-nobr { white-space: nowrap; }
/* Rules of Stopping: before ← after (before on the right), the ending that changes in the lesson ink, as on the Rules page */
.scr-practice .pr-stoprow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 var(--s3); direction: rtl;
  font-size: clamp(1.75rem, 10cqi, var(--ar-word)); }
.scr-practice .pr-stopw { display: grid; justify-items: center; min-width: 0; }
.scr-practice .pr-stopw__ar { font-size: 1em; line-height: 1.9; padding-block: .1em; color: var(--ink); }
.scr-practice .pr-stopw__ar .key { color: var(--l-ink); }
.scr-practice .pr-stopw__cap { font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); margin-top: -.25rem; }
.scr-practice .pr-stoprow__arrow { display: grid; place-items: center; color: var(--ink-soft); }
.scr-practice .pr-stoprow__arrow .icon { width: 28px; height: 28px; }
/* a narrow card (a phone with words at 160% or more): the big word above is the "reading on" form, so only the stopped form
   is shown here rather than a row that wraps with its arrow pointing at nothing */
@container (max-width: 259px) {
  .scr-practice .pr-stopw--before, .scr-practice .pr-stoprow__arrow { display: none; }
}
.scr-practice .pr-signname { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font: 700 var(--t-sm)/1.4 var(--font-body); }
.scr-practice .pr-signname .icon { width: 18px; height: 18px; color: var(--l-ink); }

/* grown-up check: the gold header band and the answer for grown-ups */
.scr-practice .pr-band {
  justify-self: stretch; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px var(--s3);
  min-height: 48px; padding: var(--s2) var(--s4); margin-top: calc(-1 * var(--s2));
  background: color-mix(in oklab, var(--gold) 20%, var(--paper)); border-block: 4px double var(--gold-ink); color: var(--ink);
}
.scr-practice .pr-band__title { display: inline-flex; align-items: center; gap: 6px; font: 700 var(--t-h3)/1.2 var(--font-display); }
.scr-practice .pr-band__title .icon { width: 20px; height: 20px; color: var(--gold-ink); stroke-width: 2.5; }
.scr-practice .pr-band__text { font: 400 var(--t-sm)/1.35 var(--font-body); text-wrap: balance; }
.scr-practice .pr-ansrow { justify-self: stretch; display: grid; justify-items: center; gap: var(--s2); }
.scr-practice .pr-ans { width: 100%; }
.scr-practice .pr-ans .plate--say { font-size: 1.25rem; }

/* ---------------------------------------------------------------- intro */
.scr-practice .pr-intro { gap: var(--s4); padding-block: var(--s6); }
.scr-practice .pr-intro__icon {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: var(--l-wash); box-shadow: inset 0 0 0 2px var(--l-ink); color: var(--l-ink);
}
.scr-practice .pr-intro__icon .icon { width: 36px; height: 36px; }
.scr-practice .pr-how { margin: 0 auto; max-width: 34ch; font: 400 1.125rem/1.5 var(--font-body); color: var(--ink); text-wrap: balance; }
.scr-practice .pr-meta { margin: 0; font: 700 var(--t-sm)/1.4 var(--font-body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.scr-practice .pr-note { margin: 0 auto; max-width: 42ch; font: 400 var(--t-sm)/1.5 var(--font-body); color: var(--ink-soft); }
.scr-practice .pr-note--sm { display: flex; align-items: center; gap: 10px; color: var(--ink); text-align: start; }
.scr-practice .pr-note--sm .icon { width: 28px; height: 28px; flex: none; }
.scr-practice .pr-note--sun .icon { color: var(--sun-ink); }
.scr-practice .pr-note--moon .icon { color: var(--moon-ink); }
.scr-practice .pr-label { margin: 0; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-practice .pr-sources { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }

/* ---------------------------------------------------------------- actions: sticky at the bottom, 64px keycaps */
.scr-practice .pr-actions {
  position: sticky; bottom: 0; z-index: var(--z-rbar);
  display: flex; flex-wrap: wrap; gap: var(--s2);
  padding: var(--s2) 0 calc(var(--s3) + env(safe-area-inset-bottom, 0px)); background: var(--desk);
}
.scr-practice .pr-actions > .key { flex: 1 1 0; min-height: 64px; min-width: min(9rem, 100%); }
.scr-practice .pr-actions > .key.primary { flex-grow: 1.4; }
/* two answer keys (I read it · Not yet): each starts at its own width, the primary takes most of what is left, so labels stay on one line */
.scr-practice .pr-actions.is-pair { flex-wrap: nowrap; }
.scr-practice .pr-actions.is-pair > .key { flex: 1 1 auto; min-width: 0; }
.scr-practice .pr-actions.is-pair > .key.primary { flex-grow: 3; }
.scr-practice .pr-actions.is-pair .key__label { white-space: nowrap; }
@container app (max-width: 419px) { .scr-practice .pr-actions > .key { padding-inline: 12px; } }
@container app (max-width: 399px) {
  /* small phones (360): a slightly smaller kid label keeps "Read it right" and "Not yet" on one line each */
  .scr-practice .pr-actions.is-pair > .key { padding-inline: 10px; gap: 6px; font-size: 1.125rem; }
}
@container app (max-width: 329px) {
  /* big words zoom on a phone: the two keys stack, full width */
  .scr-practice .pr-actions.is-pair { flex-wrap: wrap; }
  .scr-practice .pr-actions.is-pair > .key { flex: 1 1 100%; }
  .scr-practice .pr-actions.is-pair .key__label { white-space: normal; }
}
.scr-practice .pr-actions .key__label { white-space: normal; }
@container app (max-width: 479px) {
  /* results on phones: Play again above Back to the lesson, both full width */
  .scr-practice .pr-actions.is-results { display: grid; grid-template-columns: minmax(0, 1fr); }
}
@container app (max-width: 599px) {
  /* phones: the keys sit at the bottom of the screen, under the thumb */
  .scr-practice .pr { min-height: calc(100svh / var(--content-zoom) - var(--topbar-h) - 2 * var(--s4)); }
  .scr-practice .pr-actions { margin-top: auto; }
}

/* keyboard hints (desktop only) */
.scr-practice .pr-kbd { position: static; margin-inline-start: 4px; pointer-events: none; }
.scr-practice .pr-opt .pr-kbd, .scr-practice .pr-sort .pr-kbd { position: absolute; top: 6px; right: 6px; margin: 0; }
.scr-practice .key.primary .pr-kbd { background: color-mix(in oklab, var(--on-action) 18%, var(--action)); color: var(--on-action); border-color: color-mix(in oklab, var(--on-action) 55%, var(--action)); }
@media (hover: none), (pointer: coarse) { .scr-practice .pr-kbd { display: none; } }
@container app (max-width: 599px) { .scr-practice .pr-kbd { display: none; } }

/* ---------------------------------------------------------------- choice rounds: Sound Match, Letter Hunt, Join Up */
.scr-practice .pr-round { display: grid; gap: var(--s3); min-width: 0; }
.scr-practice .pr-opts { display: grid; gap: var(--s2); direction: rtl; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scr-practice .pr-opts.is-stacked, .scr-practice .pr-opts--say { grid-template-columns: minmax(0, 1fr); }
@container app (max-width: 479px) { .scr-practice .pr-opts--ar { grid-template-columns: minmax(0, 1fr); } }
.scr-practice .pr-opt { min-width: 0; color: var(--ink); }
.scr-practice .pr-opts--ar .pr-opt { min-height: 96px; padding: 4px 14px; }
.scr-practice .pr-opt__ar { font-size: min(var(--ar-word), 3rem); line-height: 1.9; white-space: nowrap; }
/* stacked options are full width: a long phrase (a sign example such as a sajdah ayah end) may then wrap instead of overflowing */
.scr-practice .pr-opts.is-stacked .pr-opt__ar { white-space: normal; }
@container app (max-width: 479px) { .scr-practice .pr-opts--ar .pr-opt__ar { white-space: normal; } }
.scr-practice .pr-opts--say .pr-opt { min-height: 64px; direction: ltr; padding: 6px 44px; font: 700 1.25rem/1.25 var(--font-body); }
.scr-practice .pr-opt__say { overflow-wrap: break-word; min-width: 0; }
.scr-practice .pr-opts--letters .pr-opt { min-height: 104px; padding: 0 8px; }
.scr-practice .pr-opt__letter { font-size: var(--ar-letter); line-height: 1.5; padding-block: .14em; }
/* the dotted Yaa (Amiri Quran, so a letter game shows its two dots) draws ~15% larger with a taller content area */
.scr-practice .pr-opt__letter.ar-dots { font-size: calc(var(--ar-letter) * .8); line-height: 2.25; padding-block: .1em; }
.scr-practice .pr-word.ar-dots { line-height: 2.3; }
/* after answering: right = ok wash + drawn check; the right one gets an ok ring. Wrong (owner's rule, QR3-01): only the key's
   chrome changes (dashed edge, desk face, again icon) and the Arabic is never moved, dimmed or recoloured; a word quoted from
   the Qur'an gets no wrong mark at all (JS). Only sound options (English) dim the ones not chosen. */
.scr-practice .pr-opts.is-answered .pr-opt { cursor: default; }
.scr-practice .pr-opts .pr-opt.is-right { background: var(--ok-wash); border-color: var(--ok); }
.scr-practice .pr-opts .pr-opt.is-wrong { background: var(--desk); border-style: dashed; border-color: var(--edge); }
.scr-practice .pr-opts .pr-opt.is-answer { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok); }
.scr-practice .pr-opts--say.is-answered .pr-opt:not(.is-right):not(.is-wrong):not(.is-answer) { opacity: .55; }
.scr-practice .pr-opt .pr-tick, .scr-practice .pr-opt .pr-again { position: absolute; left: 8px; bottom: 6px; width: 22px; height: 22px; }
.scr-practice .pr-opt .pr-tick { color: var(--ok); stroke-width: 3; }
.scr-practice .pr-opt .pr-again { color: var(--ink-soft); }
.scr-practice .pr-feedback { flex: 1 1 100%; margin: 0; padding-block: 2px var(--s1); text-align: center; font: 600 var(--t-body)/1.4 var(--font-display); max-width: none; }
.scr-practice .pr-feedback > span { display: inline-flex; align-items: center; gap: 8px; }
.scr-practice .pr-feedback .icon { width: 22px; height: 22px; flex: none; }
.scr-practice .pr-feedback__yes .icon { color: var(--ok); stroke-width: 3; }
.scr-practice .pr-feedback__no .icon { color: var(--ok); stroke-width: 3; }

/* Sound Match prompt: the sound, big and left-to-right */
.scr-practice .pr-say { margin: 0; font: 700 min(2.5rem, 14cqi)/1.2 var(--font-body); color: var(--ink); overflow-wrap: break-word; max-width: 100%; }
.scr-practice .pr-say.is-long { font-size: min(1.875rem, 9cqi); }

/* Letter Hunt prompt */
.scr-practice .pr-find { margin: 0; font: 700 var(--t-h2)/1.2 var(--font-display); }
.scr-practice .pr-find strong { font-weight: 800; color: var(--ink); } /* not the lesson blue: it would read as a link (V3-16) */
.scr-practice .pr-hint { margin: 0 auto; max-width: 40ch; font: 400 var(--t-sm)/1.5 var(--font-body); color: var(--ink-soft); }

/* Join Up: letters apart (RTL, .5em), a door after letters that never join on, then they slide together */
.scr-practice .pr-joinbox { justify-self: stretch; display: grid; place-items: center; min-height: 6.5rem; min-width: 0; }
.scr-practice .pr-join { position: relative; font-size: var(--ar-letter); line-height: 1.9; }
.scr-practice .pr-pieces { display: inline-flex; align-items: center; column-gap: .5em; direction: rtl; }
.scr-practice .pr-piece { display: inline-block; line-height: 1.9; white-space: nowrap; }
.scr-practice .pr-door { display: inline-block; flex: none; width: 0; height: 1.05em; margin-inline: .12em; border-inline-start: 2px dashed var(--edge); }
.scr-practice .pr-joined { position: absolute; inset: 0; display: grid; place-items: center; white-space: nowrap; opacity: 0; }
/* the transitions live on the joined state only: LR.ui.fit changes the font size to measure, and an animated .5em gap would be measured mid-way */
.scr-practice .pr-join.is-joined .pr-pieces { column-gap: 0; opacity: 0; transition: column-gap 300ms var(--ease), opacity 200ms var(--ease) 300ms; }
.scr-practice .pr-join.is-joined .pr-door { margin-inline: 0; opacity: 0; transition: margin 300ms var(--ease), opacity 200ms var(--ease); }
.scr-practice .pr-join.is-joined .pr-joined { opacity: 1; transition: opacity 200ms var(--ease) 300ms; }
.scr-practice .pr-saythis { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 700 1.25rem/1.3 var(--font-body); }
.scr-practice .pr-saythis .icon { width: 20px; height: 20px; color: var(--l-ink); flex: none; }

/* ---------------------------------------------------------------- Sun and Moon */
.scr-practice .pr-actions.is-sort { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scr-practice .pr-actions .pr-sort { min-height: 120px; flex-direction: column; gap: 6px; padding: 8px; font: 700 var(--t-btn-kid)/1.1 var(--font-display); }
.scr-practice .pr-actions .pr-sort .icon { width: 40px; height: 40px; }
.scr-practice .pr-actions .pr-sort--sun { background: var(--sun-wash); border-color: var(--sun-ink); }
.scr-practice .pr-actions .pr-sort--sun .icon { color: var(--sun-ink); }
.scr-practice .pr-actions .pr-sort--moon { background: var(--moon-wash); border-color: var(--moon-ink); }
.scr-practice .pr-actions .pr-sort--moon .icon { color: var(--moon-ink); }
@media (hover: hover) {
  .scr-practice .pr-actions .pr-sort--sun:not(:disabled):hover { background: color-mix(in oklab, var(--sun-wash), var(--sun-ink) 10%); }
  .scr-practice .pr-actions .pr-sort--moon:not(:disabled):hover { background: color-mix(in oklab, var(--moon-wash), var(--moon-ink) 10%); }
}
.scr-practice .pr-explain { justify-self: stretch; display: grid; justify-items: center; gap: var(--s2); border-top: 1px solid var(--rule); padding-top: var(--s3); }
.scr-practice .pr-verdict { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 700 1.125rem/1.3 var(--font-display); }
.scr-practice .pr-verdict .icon { width: 22px; height: 22px; flex: none; }
.scr-practice .pr-verdict.is-right .icon { color: var(--ok); stroke-width: 3; }
.scr-practice .pr-verdict.is-wrong .icon { color: var(--ink-soft); }
.scr-practice .pr-why { display: inline-flex; align-items: center; gap: 10px; margin: 0; max-width: 40ch; text-align: start; font: 400 var(--t-body)/1.8 var(--font-body); }
.scr-practice .pr-why .icon { width: 26px; height: 26px; flex: none; }
.scr-practice .pr-why .ar-inline { font-size: 1.6em; }
.scr-practice .pr-why--sun .icon { color: var(--sun-ink); }
.scr-practice .pr-why--moon .icon { color: var(--moon-ink); }

/* ---------------------------------------------------------------- Reading Race */
.scr-practice .pr-race { display: grid; gap: var(--s3); min-width: 0; }
.scr-practice .pr-racebar {
  position: sticky; top: var(--topbar-h); z-index: var(--z-rail);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3);
  padding-block: var(--s2); background: var(--desk); border-bottom: 1px solid var(--rule);
}
.scr-practice .pr-racebar__time { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; }
.scr-practice .pr-time { font: 700 var(--t-num-big)/1 var(--font-body); font-variant-numeric: tabular-nums; min-width: 4.4ch; }
.scr-practice .pr-racebest { font: 700 var(--t-sm)/1.2 var(--font-body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.scr-practice .pr-racebar__btns { display: flex; gap: var(--s2); }
@container app (max-width: 479px) {
  .scr-practice .pr-racebar__btns .key { width: 48px; padding: 0; }
  .scr-practice .pr-racebar__btns .key__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* the ghost track: the reader's disc and a gold rosette at their best pace, both moving right to left */
.scr-practice .pr-ghost { position: relative; flex: 1 1 100%; height: 28px; margin-inline: 2px; }
.scr-practice .pr-ghost__track { position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 3px; background: var(--rule); }
.scr-practice .pr-ghost__best { position: absolute; top: 4px; width: 20px; height: 20px; right: calc(var(--f, 0) * (100% - 20px)); }
.scr-practice .pr-ghost__me { position: absolute; top: 1px; right: calc(var(--f, 0) * (100% - 26px)); box-shadow: 0 0 0 2px var(--desk);
  transition: right var(--dur-ui) var(--ease); }
.scr-practice .pr-raceplate { padding-block: var(--s4); }
.scr-practice .pr-racewords { display: flex; flex-wrap: wrap; direction: rtl; justify-content: center; gap: var(--s2) var(--s3); }
.scr-practice .pr-racewords .w { padding-bottom: 24px; }
.scr-practice .pr-racewords .w.is-done::before { bottom: 15px; }
.scr-practice .pr-racewords .w[aria-disabled="true"] { cursor: default; }
@media (hover: hover) { .scr-practice .pr-racewords .w[aria-disabled="true"]:hover { background: transparent; } }
/* "Just time it": the words are only for reading aloud, not keys; a tap must not take focus from Start / Stop (Space) */
.scr-practice .pr-racewords.is-simple .w { pointer-events: none; }
.scr-practice .pr-done { position: absolute; left: 50%; bottom: 0; margin-left: -8px; width: 16px; height: 16px; display: grid; place-items: center; color: var(--ok); }
.scr-practice .pr-done .icon { width: 16px; height: 16px; stroke-width: 3; }
.scr-practice .pr-racehint { margin: 0 auto; text-align: center; font: 400 var(--t-sm)/1.45 var(--font-body); color: var(--ink-soft); }
.scr-practice .pr-simple { justify-self: stretch; display: grid; justify-items: start; gap: 2px; padding-top: var(--s3); border-top: 1px solid var(--rule); text-align: start; }
.scr-practice .pr-simple__help { margin: 0; font: 400 var(--t-cap)/1.4 var(--font-body); color: var(--ink-soft); max-width: 46ch; }

/* reduced motion: the base rule shortens durations; the join cross-fade must not wait either */
@media (prefers-reduced-motion: reduce) {
  .scr-practice .pr-pieces, .scr-practice .pr-joined, .scr-practice .pr-door, .scr-practice .pr-ghost__me { transition-delay: 0ms !important; }
}

/* ---------------------------------------------------------------- results */
.scr-practice .pr-res { display: grid; justify-items: center; gap: var(--s3); text-align: center; padding-block: var(--s4) var(--s5); }
.scr-practice .pr-res__title { margin: 0; font: 800 var(--t-h1)/1.1 var(--font-display); }
.scr-practice .pr-res__title:focus { outline: none; box-shadow: none; }
.scr-practice .pr-res__earned { margin: 0; font: 700 var(--t-sm)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-practice .pr-res__beads .bead { width: 26px; height: 26px; }
.scr-practice .pr-res__beads .beads { justify-content: center; gap: 6px; }
.scr-practice .pr-res__score { margin: 0; font: 700 var(--t-num-big)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.scr-practice .pr-res__newbest { margin: 0; font: 800 var(--t-display)/1.05 var(--font-display); }
.scr-practice .pr-res__stars { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 700 1.25rem/1.2 var(--font-body); font-variant-numeric: tabular-nums; }
.scr-practice .pr-res__stars .icon { width: 28px; height: 28px; color: var(--gold); stroke: var(--gold-ink); stroke-width: 1.5; }
.scr-practice .pr-res__praise { margin: 0; max-width: 32ch; font: 600 1.1875rem/1.4 var(--font-display); text-wrap: balance; }
.scr-practice .pr-res__best { margin: 0; font: 700 var(--t-sm)/1.3 var(--font-body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.scr-practice .pr-res__more { display: grid; justify-items: center; gap: 0; }
.scr-practice .pr-res__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--s4); }
.scr-practice .pr-res__next { margin: 0; }

/* ---------------------------------------------------------------- game chooser (a mode that is not in this lesson) */
.scr-practice .pr-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@container app (min-width: 600px) { .scr-practice .pr-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.scr-practice .pr-mode { justify-content: flex-start; text-align: start; font-family: var(--font-display); }
.scr-practice .pr-mode .icon { color: var(--l-ink); }

/* ---- 60-ayat.css ---- */
/* 60-ayat.css — feature D: Read Real Ayat list (.scr-ayat, spec 6.7), surah (.scr-surah, spec 6.8) and the ayah sheet
 * (.sheet.ay-sheet, a layer outside main). Tokens only; every rule is scoped under those roots.
 * Calm zone: nothing here moves Qur'anic text; only medallion backgrounds, beads and the cartouche gild. */

/* ============================================================ shared bits (both screens) */
.scr-ayat .ay-col, .scr-surah .ay-col { min-width: 0; }
.scr-ayat .ay-h2, .scr-surah .ay-h2 { font: 700 var(--t-h3)/1.2 var(--font-display); margin: 0; }
.scr-ayat .ay-attrib, .scr-surah .ay-attrib, .sheet.ay-sheet .ay-attrib { margin: var(--s2) 0 0; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-ayat .ay-disc__body, .scr-surah .ay-disc__body, .sheet.ay-sheet .ay-disc__body { padding: var(--s1) 0 var(--s2); }
.scr-ayat .ay-meaning__p, .scr-surah .ay-meaning__p, .sheet.ay-sheet .ay-meaning__p { margin: 0 0 var(--s2); font-size: var(--t-body); line-height: 1.5; }
.scr-ayat .ay-margin, .scr-surah .ay-margin { display: none; }
@container app (min-width: 1000px) {
  .scr-ayat .ay-margin, .scr-surah .ay-margin { display: grid; gap: var(--s5); align-content: start; }
  .scr-ayat .ay-margin .note, .scr-surah .ay-margin .note { margin: 0; }
}

/* ============================================================ #ayat: list */
.scr-ayat .ay-head { margin-bottom: var(--s3); }
.scr-ayat .ay-head .eyebrow { margin-bottom: 0; }
.scr-ayat .ay-lede { margin: 0; font-size: var(--t-body); max-width: 52ch; }
.scr-ayat .ay-notes { margin-top: var(--s2); }
.scr-ayat .ay-notes .note:first-child { margin-top: var(--s1); }

/* finale (all ayat ticked) */
.scr-ayat .ay-finale { display: grid; justify-items: start; gap: var(--s2); margin-top: var(--s4); }
.scr-ayat .ay-finale .cartouche { width: 100%; margin-block: 0; }

/* before you read */
.scr-ayat .ay-before { margin-top: var(--s5); }
.scr-ayat .ay-before__intro { margin: var(--s1) 0 var(--s3); }
.scr-ayat .ay-before__lines { display: grid; justify-items: center; text-align: center; }
.scr-ayat .ay-line__cap { margin: var(--s2) 0 0; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.scr-ayat .ay-line__cap:first-child { margin-top: 0; }
.scr-ayat .ay-line { margin: 0; max-width: none; text-align: center; }
.scr-ayat .ay-line .w--run { line-height: 1.95; padding-inline: .1em; }
.scr-ayat .ay-line .w--run > .ar { line-height: inherit; }
.scr-ayat .ay-meaning { margin-top: var(--s2); border-top: 1px solid var(--rule); padding-top: var(--s1); }

/* surah index: a ruled fihris on gold-ruled paper */
.scr-ayat .ay-index { margin-top: var(--s6); }
.scr-ayat .ay-index__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--s4); margin-bottom: var(--s3); }
.scr-ayat .ay-index__sum { margin: 0; font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); }
.scr-ayat .ay-index__page { padding-block: 6px; }
.scr-ayat .ay-list { list-style: none; margin: 0; padding: 0; }
.scr-ayat .ay-list > li + li { border-top: 1px solid var(--rule); }
.scr-ayat .ay-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto;
  grid-template-areas: "num names ar" "num why why" "num prog prog";
  column-gap: var(--s3); row-gap: 2px; align-items: center;
  min-height: 72px; padding: var(--s3) var(--s2); margin-inline: -4px;
  color: var(--ink); text-decoration: none; border-radius: var(--r-chip);
}
@media (hover: hover) { .scr-ayat .ay-row:hover { background: var(--l-wash); } .scr-ayat .ay-row:hover .ay-row__name { text-decoration: underline; text-underline-offset: 3px; } }
/* index rosettes are 48px (not the 40px default) so a 3-digit number (103-114) sits inside the disc at the --t-cap floor
   size instead of running onto the petals; one size for every row keeps the column even */
.scr-ayat .ay-num { grid-area: num; align-self: start; margin-top: 0; width: 48px; height: 48px; }
.scr-ayat .ay-num.is-3 .bead__label { font-size: var(--t-cap); letter-spacing: -.02em; }
.scr-ayat .ay-num.is-3 .ros-ring { display: none; }
.scr-ayat .ay-row__names { grid-area: names; display: grid; min-width: 0; }
.scr-ayat .ay-row__name { font: 700 var(--t-body)/1.25 var(--font-body); }
.scr-ayat .ay-row__en { font-size: var(--t-sm); line-height: 1.3; color: var(--ink-soft); }
.scr-ayat .ay-row__ar { grid-area: ar; justify-self: end; font-size: var(--ar-chip); line-height: 1.6; padding-block: .1em; color: var(--ink); white-space: nowrap; }
.scr-ayat .ay-row__why { grid-area: why; font-size: var(--t-sm); line-height: 1.4; color: var(--ink-soft); margin-top: 2px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.scr-ayat .ay-row__prog { grid-area: prog; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); margin-top: 6px; font-size: var(--t-cap); }
.scr-ayat .ay-row__count { color: var(--ink-soft); }
.scr-ayat .ay-row__done { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--ok); }
.scr-ayat .ay-row__done .icon { width: 16px; height: 16px; stroke-width: 3; }
@container app (min-width: 600px) {
  .scr-ayat .ay-row { grid-template-columns: 48px minmax(0, 1fr) auto; padding-inline: var(--s3); }
  .scr-ayat .ay-row__why { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* "you" box in the margin column */
.scr-ayat .ay-you { display: flex; align-items: center; gap: var(--s3); }
.scr-ayat .ay-you .tile { flex: none; width: 104px; cursor: default; }
.scr-ayat .ay-you__text p { margin: 0; }
.scr-ayat .ay-you__big { font-size: var(--t-h3); line-height: 1.2; }
.scr-ayat .ay-you__sm { font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.35; }

/* ============================================================ #s-<n>: surah */
/* controls row (desk; wraps) */
.scr-surah .ay-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-bottom: var(--s3); }
.scr-surah .ay-back { margin-inline-start: -4px; }
.scr-surah .ay-controls__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.scr-surah .ay-listen .icon { width: 20px; height: 20px; }
@container app (max-width: 599px) {
  .scr-surah .ay-back { flex-basis: 100%; }
  .scr-surah .ay-controls { row-gap: var(--s2); }
  .scr-surah .ay-controls__tools { column-gap: var(--s2); }
  .scr-surah .ay-listen > .icon:first-child { display: none; }
  .scr-surah .ay-big { width: 48px; min-width: 48px; padding: 0; }
  .scr-surah .ay-big .key__label { display: none; }
}

/* mushaf page */
.scr-surah .ay-folio .cartouche { margin-block: 0 var(--s2); }
.scr-surah .ay-bism { margin: 0; max-width: none; text-align: center; }
.scr-surah .ay-run { margin: 0; max-width: none; text-align: center; }
@container app (min-width: 600px) { .scr-surah .ay-run { text-align: justify; text-align-last: center; } }
.scr-surah .ay-end, .sheet.ay-sheet .ay-end { white-space: nowrap; }
/* the soft pointer hugs the word instead of filling the whole 2.3 line */
.scr-surah .ay-run .w--run { line-height: 1.95; padding-inline: .1em; }
.scr-surah .ay-run .w--run > .ar { line-height: inherit; }
/* running text: a short word (two letters) is still a 44px-wide target. The extra area is a pseudo-element behind the
 * words (z-index -1 inside the isolated line), so it only catches taps in the gaps and never moves the mushaf spacing.
 * The line itself (its spaces) takes no taps, or the spaces would catch them first; every button in it still does. */
.scr-surah .ay-run, .scr-ayat .ay-line { isolation: isolate; pointer-events: none; }
.scr-surah .ay-run button, .scr-ayat .ay-line button { pointer-events: auto; }
.scr-surah .ay-run .w--run::before, .scr-ayat .ay-line .w--run::before {
  content: ""; display: block; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; right: auto;
  width: max(100%, 44px); height: auto; margin: 0; transform: translateX(-50%);
  background: none; box-shadow: none; border-radius: 0; pointer-events: auto;
}
/* medallion: a 44px target that keeps its place in the line (gilding and its shine: .medal in 05-base.css) */
.scr-surah .ay-run .ay-medal { min-width: 1.25em; padding-inline: .08em; }
@media (hover: hover) { .scr-surah .ay-medal:not(.is-ticked):hover { background-color: var(--l-wash); } }

/* one gold shine across the cartouche when a surah is finished; never on the words */
.scr-surah .cartouche.is-shining .cart-field { position: relative; }
.scr-surah .cartouche.is-shining .cart-field::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, color-mix(in oklab, var(--paper) 70%, transparent) 50%, transparent 65%) no-repeat;
  background-size: 300% 100%; background-position: 100% 0;
  animation: lr-sweep 900ms var(--ease) 200ms both;
}

/* tick chips under the folio */
.scr-surah .ay-ticks { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s4); }
.scr-surah .ay-ticks__label { font: 700 var(--t-body)/1.2 var(--font-body); }
.scr-surah .ay-ticks__row { display: flex; flex-wrap: wrap; direction: rtl; gap: var(--s2); }
.scr-surah .ay-tick {
  appearance: none; margin: 0; direction: ltr; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 14px 0 10px; border-radius: var(--r-pill);
  border: 1.5px solid var(--edge); background: var(--paper); color: var(--ink);
  font: 700 var(--t-btn)/1 var(--font-body); font-variant-numeric: tabular-nums; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-ui) var(--ease), border-color var(--dur-ui) var(--ease);
}
@media (hover: hover) { .scr-surah .ay-tick:hover { background: var(--l-wash); } }
.scr-surah .ay-tick__box { position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--edge); flex: none; }
.scr-surah .ay-tick__box .icon { width: 18px; height: 18px; stroke-width: 3; color: var(--ok); opacity: 0; }
.scr-surah .ay-tick[aria-pressed="true"] { background: var(--ok-wash); border: 2px solid var(--ok); padding-inline: 9.5px 13.5px; }
.scr-surah .ay-tick[aria-pressed="true"] .ay-tick__box { border-color: transparent; }
.scr-surah .ay-tick[aria-pressed="true"] .ay-tick__box .icon { opacity: 1; stroke-dasharray: 24; animation: lr-check 250ms var(--ease) both; }
.scr-surah .ay-tick--long { font-size: var(--t-sm); }

/* surah finished */
.scr-surah .ay-done { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-top: var(--s5); }
.scr-surah .ay-done__ros { width: 48px; height: 48px; }
.scr-surah .ay-done__ros .bead__label .icon { width: 20px; height: 20px; stroke-width: 3; color: var(--on-gold); }
.scr-surah .ay-done__main { flex: 1 1 14rem; min-width: 0; }
.scr-surah .ay-done__text { margin: 0; font: 700 var(--t-h3)/1.25 var(--font-display); }
.scr-surah .ay-done__praise { margin: 4px 0 0; font: 600 var(--t-body)/1.4 var(--font-display); color: var(--ink-soft); }
.scr-surah .ay-done__tile { display: flex; align-items: center; gap: var(--s2); }
.scr-surah .ay-done__tile .tile { width: 72px; flex: none; }
.scr-surah .ay-done__tilename { margin: 0; font: 700 var(--t-sm)/1.3 var(--font-body); }

.scr-surah .ay-about { margin-block: var(--s5) 0; }
.scr-surah .ay-whole { margin-top: var(--s4); }
.scr-surah .ay-trans { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.scr-surah .ay-trans li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: baseline; }
.scr-surah .ay-trans p { margin: 0; }
.scr-surah .ay-trans__n { color: var(--ink-soft); }
.scr-surah .ay-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s5); }

/* word by word */
.scr-surah .ay-folio--head .ay-bism { margin-top: var(--s1); }
.scr-surah .ay-wbw { display: grid; gap: var(--s4); margin-top: var(--s4); }
.scr-surah .ay-ayah__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s2); }
.scr-surah .ay-ayah__medal-wrap { flex: none; font-family: var(--font-ar); font-size: var(--ar-wbw); line-height: 1.9; }
.scr-surah .ay-ayah__medal-wrap .ay-medal { min-width: 44px; padding-inline: .05em; border-radius: 50%; }
.scr-surah .ay-ayah__title { flex: 1 1 auto; margin: 0; font: 700 var(--t-h3)/1.2 var(--font-display); }
.scr-surah .ay-words { display: flex; flex-wrap: wrap; direction: rtl; gap: var(--s2); }
.scr-surah .ay-words .w--wbw { flex: 0 1 auto; max-width: 100%; }
.scr-surah .ay-ayah .ay-meaning { margin-top: var(--s2); border-top: 1px solid var(--rule); padding-top: var(--s1); }
.scr-surah .ay-listen-ayah, .sheet.ay-sheet .ay-listen-ayah { font-size: var(--t-sm); }

/* margin column: your ayat */
.scr-surah .ay-prog { display: grid; gap: var(--s2); }
.scr-surah .ay-prog__beads { gap: 6px; justify-content: flex-end; }
.scr-surah .ay-prog__beads .bead { width: 26px; height: 26px; }
.scr-surah .ay-prog__count { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); }

/* ============================================================ ayah sheet (layer) */
.sheet.ay-sheet .ay-sheet__page { text-align: center; }
.sheet.ay-sheet .ay-sheet__ayah { margin: 0; max-width: none; text-align: center; }
.sheet.ay-sheet .ay-sheet__medal { padding-inline: .06em; }
.sheet.ay-sheet .ay-sheet__tickrow { display: grid; gap: 6px; margin-top: var(--s4); }
.sheet.ay-sheet .ay-sheet__note { margin: 0; font: 700 var(--t-cap)/1.3 var(--font-body); color: var(--ink-soft); }
.sheet.ay-sheet .ay-sheet__tick[aria-pressed="true"] { background: var(--ok-wash); color: var(--ink); border-color: var(--ok); }
.sheet.ay-sheet .ay-sheet__tick[aria-pressed="true"] .icon { color: var(--ok); stroke-width: 3; }
/* ticked and hovered: stay a light wash with --ink text (the primary key's dark hover would hide the label) */
@media (hover: hover) {
  .sheet.ay-sheet .ay-sheet__tick[aria-pressed="true"]:not(:disabled):hover { background: color-mix(in oklab, var(--ok-wash), var(--ink) 6%); color: var(--ink); }
}
.sheet.ay-sheet .ay-sheet__tick[aria-pressed="true"].is-hover { background: color-mix(in oklab, var(--ok-wash), var(--ink) 6%); color: var(--ink); }
.sheet.ay-sheet .ay-meaning { margin-top: var(--s3); }
.sheet.ay-sheet .ay-sheet__done { margin: var(--s2) 0 0; padding: 10px 14px; border-radius: var(--r-panel); background: var(--ok-wash); color: var(--ink);
  font: 600 var(--t-body)/1.35 var(--font-display); }
.sheet.ay-sheet .ay-sheet__done strong { font-weight: 700; }

/* ============================================================ tiny containers (a phone with words at 150-200%)
 * The container is then under 340 zoomed px: keep 16 real px of gutter, shrink the Arabic tokens a little and stack the
 * index rows (the cartouche drops its own caps when it is that narrow: 05-base.css), so nothing scrolls sideways. */
@container app (max-width: 340px) {
  .scr-ayat, .scr-surah { --gutter: 8px; --ar-mushaf: 1.75rem; --ar-wbw: 1.75rem; --ar-title: 1.75rem; --ar-chip: 1.75rem; }
  .scr-ayat .folio, .scr-surah .folio { padding: 6px; }
  .scr-ayat .page, .scr-surah .page { padding: 8px; }
  .scr-ayat .ay-row { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "num names" "num ar" "num why" "num prog"; }
}

/* ============================================================ the seven games in a host (LR.games.start; 50-practice.js, Little Reciters B2)
 * A hosted game is the same frame as the lesson route's (.pr), set inside Today or the class board: the bands set the targets
 * (--kids-target), a ▶ says the item (LR.audio), the sounds to choose from are ▶ keys for Little ones and Readers. */
.scr-practice.pr-host { padding-bottom: 0; }
.scr-practice.pr-host .pr { min-height: 0; }
.scr-practice .pr-head--host { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--s3); }
.scr-practice .pr-howkey { flex: none; }
.scr-practice .pr-howkey .key__label { white-space: nowrap; }
.scr-practice .pr-head--host .pr-beads { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; min-height: 16px; margin-left: auto; gap: 3px; }
.scr-practice .pr-head--host .bead { width: 16px; height: auto; aspect-ratio: 1; flex: 0 1 16px; min-width: 6px; }   /* ten beads shrink to fit a 390 px or 360 px phone: the page never widens */
.scr-practice.pr-host[data-class="1"] .pr-head--host .bead { width: 26px; flex-basis: 26px; }
.scr-practice .pr-howtext { margin: 0; font: 400 var(--t-sm)/1.45 var(--font-body); color: var(--ink-soft); text-align: center; text-wrap: balance; }
/* every control of a hosted game is at least the band's target (64 px Little ones, 56 Readers, 44 Big readers); a class screen: 64 px and more */
.scr-practice.pr-host button, .scr-practice.pr-host a.key { min-height: var(--kids-target, 56px); }
.scr-practice.pr-host .pr-hear { min-width: var(--kids-target, 56px); }
.scr-practice.pr-host .pr-hear--wide { min-width: 8rem; }
.scr-practice .pr-hear--big { min-height: 72px; min-width: 120px; font-size: 1.125rem; }
.scr-practice .pr-hear--big .icon { width: 32px; height: 32px; }
.scr-practice .pr-hear--wide { margin-inline: auto; }
.scr-practice.pr-host[data-band="little"] .pr-hear--big { min-width: 96px; min-height: 96px; border-radius: 50%; }
.scr-practice.pr-host[data-band="little"] .pr-hear--big .icon { width: 44px; height: 44px; }
.scr-practice .pr-hear.is-sounding { background: var(--l-wash); border-color: var(--l-ink); }
.scr-practice .pr-hear.is-sounding .icon { color: var(--l-ink); }
/* a cell: an option and its ▶ side by side (Join Up's words, Sound Match's sounds), one to a row so the Arabic keeps its room */
.scr-practice .pr-opts--cells, .scr-practice .pr-opts--sound { grid-template-columns: minmax(0, 1fr); direction: ltr; }
.scr-practice .pr-cell { display: flex; align-items: stretch; gap: var(--s2); min-width: 0; direction: ltr; }
.scr-practice .pr-cell > .pr-opt { flex: 1 1 auto; min-width: 0; }
.scr-practice .pr-cell > .pr-hear { flex: none; min-height: 0; align-self: stretch; }
.scr-practice .pr-cell > .pr-hear .icon { width: 28px; height: 28px; }
.scr-practice .pr-opts--cells .pr-cell > .pr-opt { direction: rtl; }
.scr-practice .pr-opts--sound .pr-cell > .pr-opt { min-height: 72px; font: 700 1.5rem/1 var(--font-display); gap: 10px; }
.scr-practice .pr-pick__n { font: 700 1.5rem/1 var(--font-body); font-variant-numeric: tabular-nums; }
.scr-practice .pr-opts--sound .pr-opt .pr-kbd { display: none; }
.scr-practice .pr-opts--sound.is-answered .pr-opt:not(.is-right):not(.is-wrong):not(.is-answer) { opacity: .6; }
/* Letter Hunt: fewer, bigger letters for the youngest */
.scr-practice .pr-opts--n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scr-practice .pr-opts--n3, .scr-practice .pr-opts--n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scr-practice.pr-host[data-band="little"] .pr-opts--letters .pr-opt { min-height: 136px; }
.scr-practice.pr-host[data-band="little"] .pr-opt__letter { font-size: calc(var(--ar-letter) * 1.25); }
.scr-practice.pr-host[data-band="little"] .pr-feedback { min-height: 24px; }
/* the class board: the teacher advances, so the targets are big */
.scr-practice.pr-host[data-class="1"] button, .scr-practice.pr-host[data-class="1"] a.key { min-height: 64px; }
.scr-practice.pr-host[data-class="1"] .pr { max-width: 960px; }
.scr-practice.pr-host[data-class="1"] .pr-opts--letters .pr-opt { min-height: 160px; }
.scr-practice.pr-host[data-class="1"] .pr-opts--ar .pr-opt { min-height: 120px; }
.scr-practice.pr-host[data-class="1"] .pr-opt__letter { font-size: calc(var(--ar-letter) * 1.3); }
.scr-practice.pr-host[data-class="1"] .pr-opts--cells .pr-opt__ar { font-size: min(var(--ar-word), 4rem); }
.scr-practice .pr-showans { min-height: var(--kids-target, 44px); }
.scr-practice .pr-end { padding-block: var(--s4); }
.scr-practice .pr-end .pr-res__praise { margin: 0; max-width: 34ch; text-wrap: balance; }

/* B2-FUN-BEGIN */
/* ============================================================ the fun layer of the hosted games (50-practice.js, area B2 of the fun round, 16 Nov 2026)
 * Letter Hunt, Flashcards, Sound Match, Join Up, Reading Race and Sun and Moon open on a scene (LR.fx.stage on .pr-host: .kx-stage + .kx-scene), keep their
 * progress in the trail (LR.fx.meter) and show the streak star (LR.fx.streak) from three in a row. The Quick check and the lesson routes keep the plain look.
 * Text never sits straight on a scene: every word and letter is on a white or tinted card of its own. Under prefers-reduced-motion the loops stand still
 * (kids-fx.css) and each animation below is a fade or nothing. The owner's rule QR3-01: an Arabic option is never moved, dimmed or marked when wrong. */
.scr-practice.pr-fun { padding: 10px 10px 0; min-height: min(600px, 86svh); }
.scr-practice.pr-fun .pr { gap: var(--s3); }
.scr-practice .pr-stagewrap { position: relative; display: grid; min-width: 0; }
/* the streak mark (LR.fx.streak) sits in the head, never over the trail, the how-to line or a card (B2E-3, B2C-5): it hangs above the pill in a strip the stage keeps for it (a phone, the class board,
   and any place the page's app container is not known), and on a wide screen it sits at the right end of the pill, where it keeps its room (the trail never changes length when it grows) */
.scr-practice .pr-head--host { position: relative; }
.scr-practice.pr-fun { padding-top: 40px; }
.scr-practice .pr-streakslot { position: absolute; right: 8px; bottom: calc(100% - 4px); z-index: 6; display: flex; justify-content: flex-end; pointer-events: none; }
.scr-practice .pr-streakslot[hidden] { display: none; }
.scr-practice .pr-streakslot .kx-streak { min-width: 0; min-height: 38px; padding: 2px 10px; }
@container app (min-width: 600px) {
  .scr-practice.pr-fun:not([data-class="1"]) { padding-top: 10px; }
  .scr-practice:not([data-class="1"]) .pr-streakslot { position: static; flex: none; min-width: 150px; }
  .scr-practice[data-band="little"]:not([data-class="1"]) .pr-streakslot { min-width: 128px; }
  .scr-practice:not([data-class="1"]) .pr-streakslot[hidden] { display: none; }
}
/* a tablet or a laptop: the scene reaches the bottom of the screen, not just the top 600 px of it; and the head (the how-to key, the trail) stays under the top bar when the page does scroll */
@container app (min-width: 600px) {
  .scr-practice.pr-fun:not([data-class="1"]) { min-height: max(min(600px, 86svh), calc(100svh / var(--content-zoom) - var(--topbar-h) - 8rem)); }
}
@media (min-height: 640px) {
  .scr-practice.pr-fun:not([data-class="1"]):not([data-game="race"]) .pr-head--host { position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 7; }
}

/* the class board: the game is a narrow column of a big board that fits it to the room it has (it zooms a taller game down), so the scene adds as little height as it can: no minimum height, the streak mark
   overlapping the corner of the pill instead of a strip above it, smaller rails and lanterns (B2E-4) */
.scr-practice.pr-host[data-class="1"].pr-fun { min-height: 0; padding-top: 22px; }
.scr-practice.pr-host[data-class="1"] .pr-streakslot { bottom: calc(100% - 18px); right: 6px; }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-lantern { min-height: 148px; }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-hang::after { height: calc(18px + var(--pr-drop, 0px)); }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-hang { padding-top: 18px; }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-opts--lanterns { row-gap: 8px; padding: 12px 2px 8px; }
.scr-practice.pr-host[data-class="1"] .pr-ghost--rails { height: 84px; }
.scr-practice.pr-host[data-class="1"] .pr-ghost--rails .pr-ghost__me { width: 60px; height: 60px; right: calc(var(--f, 0) * (100% - 68px)); }
.scr-practice.pr-host[data-class="1"] .pr-ghost--rails .pr-ghost__best { width: 50px; height: 50px; right: calc(var(--f, 0) * (100% - 58px)); }
.scr-practice.pr-host[data-class="1"] .pr-ghost--rails .pr-station .kx-art { width: 40px; height: 40px; }
.scr-practice.pr-host[data-class="1"] .pr-milestone { display: none; }

/* the head: the how-to key, the trail, on one white pill */
.scr-practice.pr-fun .pr-head--host {
  background: rgb(255 255 255 / .93); border-radius: 24px; padding: 6px 10px 6px 8px; gap: 10px;
  box-shadow: 0 4px 0 rgb(20 40 60 / .12);
}
.scr-practice.pr-fun .pr-trail { flex: 1 1 auto; min-width: 0; }
.scr-practice.pr-fun .pr-trail[hidden] { display: none; }
.scr-practice.pr-fun .pr-trail .kx-meter { max-width: none; }
.scr-practice.pr-fun .pr-howtext { background: rgb(255 255 255 / .93); border-radius: 16px; padding: 6px 14px; color: var(--ink); max-width: none; }
@container app (max-width: 479px) {
  /* a phone: the how-to key is its picture (its words stay for a screen reader), so the trail has room */
  .scr-practice.pr-fun .pr-howkey { padding-inline: 0; min-width: var(--kids-target, 56px); }
  .scr-practice.pr-fun .pr-howkey .key__label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* the end panel is the whole screen */
.scr-practice.pr-host.is-ended .pr-head--host, .scr-practice.pr-host.is-ended .pr-howtext, .scr-practice.pr-host.is-ended .pr-streakslot { display: none; }

/* every card is white with a coloured rim, not the lesson paper */
.scr-practice.pr-fun .pr-card {
  background: #fff; border: 3px solid var(--kx-c, var(--kx-sky)); border-radius: 24px; box-shadow: 0 5px 0 rgb(20 40 60 / .14);
  padding: var(--s3);
}
.scr-practice.pr-fun .pr-prompt { gap: var(--s2); }
/* what the line under the options says sits on a card of its own */
.scr-practice.pr-fun .pr-actions { background: linear-gradient(0deg, rgb(255 255 255 / .55) 55%, rgb(255 255 255 / 0)); padding-top: var(--s3); }
.scr-practice.pr-fun .pr-feedback { flex: 1 1 100%; display: flex; justify-content: center; }
.scr-practice.pr-fun .pr-feedback > span { background: #fff; border-radius: 999px; padding: 6px 16px; box-shadow: 0 3px 0 rgb(20 40 60 / .14); }
.scr-practice.pr-fun .pr-feedback > span:only-child { padding: 6px 12px; }
.scr-practice.pr-fun .pr-feedback:empty { display: none; }
.scr-practice.pr-host[data-band="little"].pr-fun .pr-feedback .icon { width: 36px; height: 36px; }
/* the big ear is a coloured pill (round for the little ones) and breathes a little (kx-pulse) */
.scr-practice.pr-fun .pr-hear--big { border-radius: 999px; min-width: 88px; min-height: 88px; padding: 0 22px; background: var(--kx-c-tint); border-color: var(--kx-c-deep); border-bottom-width: 5px; color: var(--kx-c-deep); }
.scr-practice.pr-fun .pr-hear--big .icon { width: 40px; height: 40px; }
.scr-practice.pr-fun .pr-hear.is-sounding { background: var(--kx-c); border-color: var(--kx-c-deep); }

/* ---------------------------------------------------------------- Letter Hunt: a street at dusk, lanterns on the bunting */
.scr-practice.pr-fun .pr-huntprompt { justify-self: center; width: min(100%, 360px); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px var(--s3); padding: 10px 14px; }
.scr-practice.pr-fun .pr-huntprompt .pr-find { margin: 0; font-size: var(--t-h3); }
.scr-practice.pr-fun .pr-huntprompt .pr-hint { flex: 1 1 100%; }
.scr-practice.pr-host[data-band="little"].pr-fun .pr-huntprompt { width: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.scr-practice.pr-fun .pr-opts--lanterns {
  direction: ltr; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 12px; row-gap: 14px; align-items: start; justify-items: center;
  padding: 18px 2px 14px;
}
.scr-practice.pr-fun .pr-opts--lanterns.pr-opts--n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scr-practice.pr-fun .pr-hang { position: relative; width: 100%; max-width: 156px; padding-top: 24px; }
.scr-practice.pr-fun .pr-hang::before { content: ""; position: absolute; top: 0; left: -6px; right: -6px; border-top: 3px solid #8A6658; }
.scr-practice.pr-fun .pr-hang::after { content: ""; position: absolute; top: 0; left: 50%; width: 3px; height: calc(26px + var(--pr-drop, 0px)); margin-left: -1.5px; background: #8A6658; }
.scr-practice.pr-fun .pr-hang > .pr-lantern { margin-top: var(--pr-drop, 0px); }
.scr-practice.pr-fun .pr-lantern {
  width: 100%; min-height: 132px; padding: 14px 4px 12px; transform-origin: 50% 0;
  border: 3px solid var(--kx-c-deep); border-radius: 40px 40px 34px 34px / 46px 46px 38px 38px;
  background: linear-gradient(180deg, var(--kx-c-tint) 0%, #fff 78%); color: var(--ink);
  box-shadow: 0 5px 0 -1px var(--kx-c), inset 0 -12px 18px -12px var(--kx-c);
  transition: background-color 160ms var(--ease), box-shadow 220ms var(--ease);
}
.scr-practice.pr-fun .pr-lantern::before { content: ""; position: absolute; left: 50%; top: -8px; width: 34%; height: 12px; margin-left: -17%; border-radius: 5px 5px 8px 8px; background: var(--kx-c-deep); }
.scr-practice.pr-fun .pr-lantern::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 10px; height: 12px; margin-left: -5px; border-radius: 0 0 6px 6px; background: var(--kx-c-deep); }
.scr-practice.pr-fun .pr-lantern .pr-opt__letter { font-size: calc(var(--ar-letter) * 1.05); }
.scr-practice.pr-fun .pr-lantern .pr-opt__letter.ar-dots { font-size: calc(var(--ar-letter) * .84); line-height: 2.25; padding-block: .1em; }      /* the dotted Yaa (Amiri Quran) draws larger */
.scr-practice.pr-host[data-band="little"].pr-fun .pr-lantern { min-height: 150px; }
.scr-practice.pr-host[data-band="little"].pr-fun .pr-lantern .pr-opt__letter { font-size: calc(var(--ar-letter) * 1.35); }
.scr-practice.pr-host[data-band="little"].pr-fun .pr-lantern .pr-opt__letter.ar-dots, .scr-practice.pr-host[data-class="1"].pr-fun .pr-lantern .pr-opt__letter.ar-dots { font-size: calc(var(--ar-letter) * 1.08); }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-lantern { min-height: 168px; }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-lantern .pr-opt__letter { font-size: calc(var(--ar-letter) * 1.35); }
@media (hover: hover) { .scr-practice.pr-fun .pr-opts:not(.is-answered) .pr-lantern:hover { background: linear-gradient(180deg, var(--kx-c) 0%, var(--kx-c-tint) 80%); } }
/* lit: a warm glow behind the letter (the right one; and, after a miss, the one that was asked for) */
.scr-practice.pr-fun .pr-opts .pr-lantern.is-right, .scr-practice.pr-fun .pr-opts .pr-lantern.is-answer, .scr-practice.pr-fun .pr-opts.is-allit .pr-lantern {
  background: radial-gradient(circle at 50% 44%, #FFFBE0 0%, #FFE58A 58%, #FFC247 100%); border-color: #8A5A00; border-style: solid;
  box-shadow: 0 0 0 5px rgb(255 214 102 / .6), 0 0 34px 12px rgb(255 196 70 / .75);
}
.scr-practice.pr-fun .pr-opts .pr-lantern.is-wrong { box-shadow: none; }
.scr-practice.pr-fun .pr-opts .pr-lantern .pr-tick, .scr-practice.pr-fun .pr-opts .pr-lantern .pr-again { left: 50%; margin-left: -11px; bottom: 6px; }

/* ---------------------------------------------------------------- Flashcards: a night sky, a deck that empties, a pile of the cards you read, a card that turns over */
.scr-practice.pr-fun .pr-flashboard { display: grid; gap: var(--s3); min-width: 0; }
.scr-practice.pr-fun .pr-flashtop { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 10px 4px; }
.scr-practice .pr-stack { position: relative; flex: none; width: 56px; height: 76px; }
.scr-practice .pr-stack__edge {
  position: absolute; inset: 0; border-radius: 10px; border: 2.5px solid var(--kx-violet-deep); background: var(--kx-violet-tint);
  translate: calc(var(--k) * 4px) calc(var(--k) * -4px); z-index: calc(5 - var(--k));
  box-shadow: 0 2px 0 rgb(0 0 0 / .1);
}
.scr-practice .pr-stack--deck .pr-stack__edge:first-child { background: var(--kx-violet); }
.scr-practice .pr-stack--pile .pr-stack__edge { border-color: var(--kx-mint-deep); background: var(--kx-mint-tint); }
.scr-practice .pr-stack--pile .pr-stack__edge:first-child { background: var(--kx-mint); }
.scr-practice .pr-stack[data-n="0"] { border: 2.5px dashed rgb(255 255 255 / .85); border-radius: 10px; background: rgb(255 255 255 / .18); }
.scr-practice .pr-stack__n {
  position: absolute; z-index: 9; left: 50%; bottom: -10px; min-width: 30px; height: 26px; padding: 0 7px; box-sizing: border-box; margin-left: -15px;
  display: grid; place-items: center; border-radius: 999px; background: #fff; color: var(--ink); font: 800 1rem/1 var(--font-body); font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 0 rgb(20 40 60 / .2);
}
.scr-practice .pr-stack__tick { position: absolute; z-index: 8; left: 50%; top: 50%; width: 30px; height: 30px; margin: -22px 0 0 -15px; color: var(--kx-mint-deep); stroke-width: 3.4; }
.scr-practice .pr-stack[data-n="0"] .pr-stack__tick { color: #fff; }
.scr-practice .pr-flip { perspective: 1400px; min-width: 0; }
.scr-practice .pr-flip__inner { position: relative; display: grid; min-width: 0; transform-style: preserve-3d; transition: transform 560ms var(--ease); }
.scr-practice .pr-flip.is-flipped .pr-flip__inner { transform: rotateY(180deg); }
.scr-practice .pr-face {
  grid-area: 1 / 1; min-width: 0; min-height: 290px; display: grid; align-content: center; justify-items: center; gap: var(--s2); padding: var(--s3);
  background: #fff; border: 3px solid var(--kx-c, var(--kx-violet)); border-radius: 24px; box-shadow: 0 5px 0 rgb(20 40 60 / .14);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.scr-practice .pr-face--front { cursor: pointer; }
.scr-practice .pr-face--back { transform: rotateY(180deg); background: var(--kx-c-tint, var(--kx-violet-tint)); }
.scr-practice .pr-face .pr-card__top { align-self: start; }
.scr-practice .pr-face--front .pr-wordbox { align-self: center; }
.scr-practice .pr-flip__turn { position: absolute; right: 12px; bottom: 10px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--kx-c-tint); color: var(--kx-c-deep); }
.scr-practice .pr-flip__turn .icon { width: 22px; height: 22px; }
.scr-practice .pr-face--back .pr-hear { margin-inline: auto; }
.scr-practice .pr-face--back .pr-reveal, .scr-practice .pr-face--back .pr-plate { background: #fff; border-radius: 14px; }
.scr-practice .pr-flip.pr-draw { animation: pr-draw 420ms var(--ease) backwards; }
@keyframes pr-draw { from { translate: -36% -62%; scale: .42; rotate: -9deg; opacity: .25; } to { translate: 0 0; scale: 1; rotate: 0deg; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .scr-practice .pr-flip__inner { transition: none; transform: none !important; transform-style: flat; }
  .scr-practice .pr-face { backface-visibility: visible; -webkit-backface-visibility: visible; }
  .scr-practice .pr-face--back { transform: none; opacity: 0; visibility: hidden; }
  .scr-practice .pr-flip.is-flipped .pr-face--front { opacity: 0; visibility: hidden; }
  .scr-practice .pr-flip.is-flipped .pr-face--back { opacity: 1; visibility: visible; animation: kx-fade .3s linear; }
  .scr-practice .pr-flip.pr-draw { animation: kx-fade .3s linear backwards; }
}

/* a thing that has been answered wrongly stands still: nothing keeps swaying or floating under a wrong Arabic choice (QR3-01); once a round is answered every cloud rests */
.scr-practice.pr-fun .pr-lantern.is-wrong, .scr-practice.pr-fun .pr-bob.is-miss, .scr-practice.pr-fun .pr-opts.is-answered .pr-bob { animation-play-state: paused; }

/* ---------------------------------------------------------------- Sound Match and Join Up: cards in a sky, on hills */
.scr-practice.pr-fun .pr-matchprompt { justify-self: center; width: min(100%, 380px); }
.scr-practice.pr-fun .pr-matchprompt .pr-say { color: var(--ink); }
.scr-practice.pr-fun .pr-opts--ar, .scr-practice.pr-fun .pr-opts--sound, .scr-practice.pr-fun .pr-opts--say { padding: 6px 2px 4px; }
.scr-practice.pr-fun .pr-bob { min-width: 0; }
.scr-practice.pr-fun .pr-opts .pr-opt { border: 3px solid var(--kx-c-deep, var(--edge)); border-radius: 26px; background: linear-gradient(180deg, #fff 35%, var(--kx-c-tint, #fff)); box-shadow: 0 5px 0 -1px var(--kx-c, rgb(20 40 60 / .2)); color: var(--ink); }
.scr-practice.pr-fun .pr-cell > .pr-hear { background: var(--kx-c-tint); border: 3px solid var(--kx-c-deep); border-radius: 26px; color: var(--kx-c-deep); box-shadow: 0 5px 0 -1px var(--kx-c); }
.scr-practice.pr-fun .pr-cell > .pr-hear .icon { width: 30px; height: 30px; }
/* (a lantern is lit warm gold by its own rules above: :not(.pr-lantern) keeps these two, which are for the keys, from winning over them by coming later: B2E-1) */
.scr-practice.pr-fun .pr-opts .pr-opt:not(.pr-lantern):not(.pr-cloudkey):not(.pr-pick).is-right { background: radial-gradient(circle at 50% 50%, #fff 20%, var(--kx-mint-tint)); border-color: var(--kx-mint-deep); border-style: solid; box-shadow: 0 0 0 5px rgb(111 221 164 / .6), 0 0 26px 8px rgb(111 221 164 / .55); }
.scr-practice.pr-fun .pr-opts .pr-opt:not(.pr-lantern):not(.pr-cloudkey):not(.pr-pick).is-answer { border-color: var(--kx-mint-deep); box-shadow: 0 0 0 5px rgb(111 221 164 / .6), 0 0 26px 8px rgb(111 221 164 / .5); }
.scr-practice.pr-fun .pr-opts .pr-opt:not(.pr-cloudkey):not(.pr-pick).is-wrong { background: var(--desk); border: 3px dashed var(--edge); box-shadow: none; }
.scr-practice.pr-fun .pr-opts--sound .pr-cell > .pr-opt .icon { color: var(--kx-c-deep, var(--ink)); }
/* Join Up: the letters hang apart on tiles that drift a little, then slide together */
.scr-practice.pr-fun .pr-joinbox { min-height: 6rem; }
.scr-practice.pr-fun .pr-tile {
  display: inline-flex; align-items: center; justify-content: center; padding: 0 .12em; border-radius: .26em;
  background: linear-gradient(180deg, #fff 20%, var(--kx-c-tint)); border: .035em solid var(--kx-c-deep); box-shadow: 0 .05em 0 var(--kx-c);
}
.scr-practice.pr-fun .pr-join.is-joined .pr-tile { animation: none; }

/* ---------------------------------------------------------------- Sun and Moon: a sky with a sun and a moon; the word travels to the one chosen */
.scr-practice[data-game="sunmoon"] .kx-scene [data-focus="1"] { display: none; }          /* the scene's own small sun: this game has a big one */
.scr-practice.pr-fun .pr-sm { display: grid; gap: var(--s3); min-width: 0; }
.scr-practice.pr-fun .pr-smcard { justify-self: center; width: min(100%, 420px); }
.scr-practice.pr-fun .pr-sky { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; width: min(100%, 560px); justify-self: center; }
.scr-practice.pr-fun .pr-body {
  flex-direction: column; justify-content: flex-start; gap: 6px; min-height: 168px; padding: 6px 4px 8px; min-width: 0;
  background: transparent; border: 0; box-shadow: none; color: var(--ink); font: inherit; border-radius: 28px;
}
.scr-practice.pr-fun .pr-body:not(:disabled):not([aria-disabled="true"]):hover { background: radial-gradient(circle at 50% 36%, rgb(255 255 255 / .55), transparent 64%); }
.scr-practice.pr-fun .pr-body:active { transform: none; padding-bottom: 10px; border-bottom-width: 0; }
.scr-practice.pr-fun .pr-body__art { display: block; width: 88px; height: 88px; filter: drop-shadow(0 4px 8px rgb(20 40 60 / .22)); }
.scr-practice.pr-fun .pr-body__art .kx-art { width: 100%; height: 100%; }
.scr-practice.pr-fun .pr-body__label {
  background: #fff; border: 3px solid var(--kx-amber-deep); border-radius: 999px; padding: 5px 14px; font: 700 var(--t-body)/1.2 var(--font-display); color: var(--ink); box-shadow: 0 3px 0 rgb(20 40 60 / .14);
}
.scr-practice.pr-fun .pr-body--moon .pr-body__label { border-color: var(--kx-violet-deep); }
.scr-practice.pr-fun .pr-body.is-right .pr-body__art, .scr-practice.pr-fun .pr-body.is-answer .pr-body__art { filter: drop-shadow(0 0 16px rgb(255 214 102 / .95)) drop-shadow(0 0 4px #fff); }
.scr-practice.pr-fun .pr-body.is-wrong .pr-body__label { border-style: dashed; }
.scr-practice.pr-fun .pr-tray { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 6px; min-height: 40px; max-width: 100%; }
.scr-practice.pr-fun .pr-chip { display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; background: #fff; border: 2px solid var(--kx-amber-deep); box-shadow: 0 2px 0 rgb(20 40 60 / .14); }
.scr-practice.pr-fun .pr-body--moon .pr-chip { border-color: var(--kx-violet-deep); }
.scr-practice.pr-fun .pr-chip__ar { font-size: 1.2rem; line-height: 1.9; color: var(--ink); white-space: nowrap; }
.scr-practice.pr-fun .pr-explain { background: #fff; border: 3px solid var(--kx-c); border-radius: 22px; padding: var(--s3); box-shadow: 0 5px 0 rgb(20 40 60 / .14); }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-body { min-height: 240px; }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-body__art { width: 132px; height: 132px; }

/* ---------------------------------------------------------------- Reading Race: your train on the rails, a pale one at your best pace (B2C-9) */
/* the time and the rails sit together in one card that stays under the top bar while the words scroll; the rails run the whole width, the words are on a plate of their own below */
.scr-practice.pr-fun .pr-racetop { position: sticky; top: calc(var(--topbar-h) + 4px); z-index: var(--z-rail); display: grid; background: linear-gradient(180deg, #E3F3FF, var(--kx-mint-tint)); border: 3px solid var(--kx-c); border-radius: 24px; box-shadow: 0 4px 0 rgb(20 40 60 / .14); overflow: clip; }
.scr-practice.pr-fun .pr-racetop .pr-racebar { position: static; background: none; border: 0; box-shadow: none; padding: 6px 12px 0; gap: var(--s2) var(--s3); }
.scr-practice.pr-fun .pr-racetop .pr-time { font-size: 1.75rem; }
.scr-practice.pr-fun .pr-raceplate { background: #fff; border: 3px solid var(--kx-c); border-radius: 24px; box-shadow: 0 5px 0 rgb(20 40 60 / .14); justify-self: center; width: min(100%, 560px); }
.scr-practice.pr-fun .pr-racehint { background: #fff; border-radius: 14px; padding: 6px 12px; color: var(--ink); justify-self: center; }
.scr-practice.pr-fun .pr-simple { background: #fff; border-radius: 16px; padding: var(--s3); border: 0; }
.scr-practice .pr-ghost--rails { height: 110px; margin-inline: 0; flex: none; overflow: hidden; }
.scr-practice .pr-ghost--rails::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: linear-gradient(180deg, #CDB68E, #A98F66); }
.scr-practice .pr-ghost--rails .pr-ghost__track {
  left: 0; right: 0; top: auto; bottom: 14px; height: 9px; border-radius: 0; background: repeating-linear-gradient(90deg, #6E5A3E 0 9px, transparent 9px 24px);
  box-shadow: 0 -3px 0 #59635E, 0 3px 0 #59635E;
}
.scr-practice .pr-ghost--rails .pr-station { position: absolute; left: 6px; bottom: 26px; z-index: 1; }
.scr-practice .pr-ghost--rails .pr-station .kx-art { width: 52px; height: 52px; }
.scr-practice .pr-train { position: absolute; display: block; }
.scr-practice .pr-ghost--rails .pr-ghost__me { top: auto; bottom: 16px; width: 76px; height: 76px; box-shadow: none; z-index: 3; right: calc(var(--f, 0) * (100% - 84px)); transition: right 420ms var(--ease); }
.scr-practice .pr-ghost--rails .pr-ghost__best { top: auto; bottom: 16px; width: 62px; height: 62px; opacity: .55; z-index: 2; right: calc(var(--f, 0) * (100% - 70px)); transition: right 220ms linear; }
.scr-practice .pr-train .kx-art { width: 100%; height: 100%; }
/* a station sign every five words: a small board on a post, beside the rails (the train passes it as it reads that word) */
.scr-practice .pr-milestone { position: absolute; bottom: 24px; z-index: 1; right: calc(var(--f, 0) * (100% - 84px) + 28px); width: 26px; height: 40px; }
.scr-practice .pr-milestone::before { content: ""; position: absolute; left: 11px; bottom: 0; width: 4px; height: 20px; background: #6B7570; }
.scr-practice .pr-milestone b { position: absolute; left: 0; top: 0; width: 26px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--kx-mint-deep); color: var(--kx-on-deep, #fff); font: 800 .8125rem/1 var(--font-body); font-variant-numeric: tabular-nums; }
/* the smoke of a tap: a white puff that rises and thins out (a fade in place under reduced motion) */
.scr-practice .pr-puff { position: absolute; z-index: 4; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(20 40 60 / .18); pointer-events: none; animation: pr-puff 850ms ease-out forwards; }
@keyframes pr-puff { from { translate: 0 0; scale: .5; opacity: .95; } to { translate: -14px -30px; scale: 1.7; opacity: 0; } }
@keyframes pr-puff-fade { from { opacity: 0; } 30% { opacity: .85; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scr-practice .pr-train { transition: none !important; } .scr-practice .pr-puff { animation: pr-puff-fade 700ms linear forwards; } }

/* the race has its own bar: the head holds only the how-to key, with no pill around it */
.scr-practice.pr-fun .pr--race .pr-head--host { background: none; box-shadow: none; padding: 0; }
.scr-practice.pr-host[data-band="little"].pr-fun .pr-hear--big { border-radius: 50%; min-width: 104px; min-height: 104px; padding: 0; box-shadow: 0 0 0 8px rgb(255 255 255 / .85), 0 6px 0 8px rgb(20 40 60 / .14); }
.scr-practice.pr-host[data-band="little"].pr-fun .pr-hear--big .icon { width: 52px; height: 52px; }
/* the class board: the lanterns are bigger, three to a row when there are six */
.scr-practice.pr-host[data-class="1"].pr-fun .pr-hang { max-width: 230px; }
.scr-practice.pr-host[data-class="1"].pr-fun .pr-opts--lanterns { column-gap: 28px; }
/* a tablet or a laptop: every lantern hangs in ONE row (six, or four for Little ones), so the whole round (the question, the lanterns, the line under them) fits the screen and nothing scrolls (B2C-1) */
@container app (min-width: 600px) {
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--lanterns { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 8px; row-gap: 0; padding: 12px 2px 10px; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-hang { padding-top: 20px; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-hang::after { height: calc(22px + var(--pr-drop, 0px)); }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--lanterns.pr-opts--n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 18px; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-hang { max-width: 210px; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-lantern { padding-inline: 2px; min-height: 116px; }
  .scr-practice.pr-host[data-band="little"].pr-fun:not([data-class="1"]) .pr-lantern { min-height: 168px; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-lantern .pr-opt__letter { font-size: calc(var(--ar-letter) * .95); }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-lantern .pr-opt__letter.ar-dots { font-size: calc(var(--ar-letter) * .76); }
  .scr-practice.pr-host[data-band="little"].pr-fun:not([data-class="1"]) .pr-lantern .pr-opt__letter { font-size: calc(var(--ar-letter) * 1.5); }
  .scr-practice.pr-host[data-band="little"].pr-fun:not([data-class="1"]) .pr-lantern .pr-opt__letter.ar-dots { font-size: calc(var(--ar-letter) * 1.2); }
}
/* a tall tablet (768 x 1024 and up): there is height to spare, so the lanterns are big: Little ones' four in a 2 x 2 (230 px wide each), the others' six in 3 x 2 (B2C-8) */
@media (min-height: 900px) {
  @container app (min-width: 600px) {
    .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--lanterns { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 18px; row-gap: 14px; padding-bottom: 14px; }
    .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--lanterns.pr-opts--n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; }
    .scr-practice.pr-fun:not([data-class="1"]) .pr-hang { max-width: 200px; }
    .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--n4 .pr-hang { max-width: 236px; }
    .scr-practice.pr-fun:not([data-class="1"]) .pr-lantern { min-height: 150px; }
    .scr-practice.pr-host[data-band="little"].pr-fun:not([data-class="1"]) .pr-lantern { min-height: 196px; }
    .scr-practice.pr-fun:not([data-class="1"]) .pr-lantern .pr-opt__letter { font-size: calc(var(--ar-letter) * 1.2); }
    .scr-practice.pr-fun:not([data-class="1"]) .pr-lantern .pr-opt__letter.ar-dots { font-size: calc(var(--ar-letter) * .95); }
    .scr-practice.pr-host[data-band="little"].pr-fun:not([data-class="1"]) .pr-lantern .pr-opt__letter { font-size: calc(var(--ar-letter) * 1.7); }
    .scr-practice.pr-host[data-band="little"].pr-fun:not([data-class="1"]) .pr-lantern .pr-opt__letter.ar-dots { font-size: calc(var(--ar-letter) * 1.35); }
  }
}
/* Join Up on a tablet or a laptop: the three words side by side, each with its ▶ above it (one row instead of three: B2C-1) */
@container app (min-width: 600px) {
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--cells { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--cells .pr-cell { flex-direction: column; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--cells .pr-cell > .pr-hear { min-height: var(--kids-target, 56px); align-self: stretch; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--cells .pr-cell > .pr-opt { min-height: 104px; }
}
/* the line the card keeps for what is said after the answer is there from the start, invisible, so the card never grows (B2C-1) */
.scr-practice.pr-fun .pr-saythis { min-height: 60px; }
.scr-practice.pr-fun .pr-saythis.is-pending { visibility: hidden; display: inline-flex; }
/* the explanation of Sun and Moon sits in the sticky bar, above Next: one white card, the verdict and the reason side by side where there is room */
.scr-practice.pr-fun .pr-actions > .pr-explain { flex: 1 1 100%; min-width: 0; padding: var(--s2) var(--s3); gap: 2px; border-top-width: 3px; }
.scr-practice.pr-fun .pr-actions > .pr-explain .pr-why { line-height: 1.5; max-width: none; }
/* a tablet or a laptop: what is said about the answer and Next share one row, so the bar is as high as one key (the page scrolls less after each answer: B2C-1) */
@container app (min-width: 600px) {
  .scr-practice.pr-fun:not([data-class="1"]) .pr-actions { flex-wrap: nowrap; align-items: center; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-actions > .pr-feedback, .scr-practice.pr-fun:not([data-class="1"]) .pr-actions > .pr-explain { flex: 1 1 auto; min-width: 0; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-actions > .key { flex: 0 0 auto; width: auto; min-width: 11rem; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-actions > .pr-explain { grid-auto-flow: column; justify-content: center; align-items: center; column-gap: var(--s4); }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-join { font-size: calc(var(--ar-letter) * .85); }
}

/* a new round arrives: the card comes up first, the choices a moment later (a fade under reduced motion); the lanterns come in by themselves (kx-enter) */
.scr-practice.pr-fun .pr-round > .pr-card, .scr-practice.pr-fun .pr-sm > .pr-card { animation: pr-arrive 280ms var(--ease) backwards; }
.scr-practice.pr-fun .pr-round > .pr-opts:not(.pr-opts--lanterns), .scr-practice.pr-fun .pr-sm > .pr-sky { animation: pr-arrive 300ms var(--ease) 90ms backwards; }
@keyframes pr-arrive { from { translate: 0 16px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .scr-practice.pr-fun .pr-round > .pr-card, .scr-practice.pr-fun .pr-sm > .pr-card,
  .scr-practice.pr-fun .pr-round > .pr-opts:not(.pr-opts--lanterns), .scr-practice.pr-fun .pr-sm > .pr-sky { animation: kx-fade .3s linear backwards; }
}

/* ---------------------------------------------------------------- Sound Match: a sky; the sound is a round speaker and the choices are clouds tied to it by a rope (B2C-4) */
.scr-practice.pr-fun .pr-matchround { position: relative; display: grid; gap: var(--s3); align-items: start; align-content: start; justify-items: center; min-width: 0; min-height: 320px; }
.scr-practice.pr-fun .pr-matchround > .pr-card { position: relative; z-index: 1; justify-self: center; width: min(100%, 300px); }
.scr-practice.pr-fun .pr-matchround > .pr-opts { width: 100%; }
@container app (min-width: 600px) {
  .scr-practice.pr-fun:not([data-class="1"]) .pr-matchround { gap: var(--s4); min-height: 380px; }
}
/* the speaker: a big round key (as the ear of Letter Hunt), breathing a little; its words are for a screen reader */
.scr-practice.pr-fun .pr-hear--round { width: 108px; height: 108px; min-width: 108px; min-height: 108px; padding: 0; border-radius: 50%; border-bottom-width: 6px; box-shadow: 0 0 0 7px rgb(255 255 255 / .85), 0 0 0 12px var(--kx-c-tint); }
.scr-practice.pr-fun .pr-hear--round .icon { width: 52px; height: 52px; }
.scr-practice.pr-fun .pr-hear--round .key__label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.scr-practice.pr-fun .pr-matchprompt { padding: var(--s3) var(--s3) var(--s4); gap: var(--s3); }
.scr-practice.pr-fun .pr-matchprompt .pr-hear--round { margin-block: 6px 4px; }
/* a short window (a small phone): the speaker is a little smaller so the clouds come up the screen */
@media (max-height: 700px) {
  .scr-practice.pr-fun .pr-hear--round { width: 84px; height: 84px; min-width: 84px; min-height: 84px; box-shadow: 0 0 0 5px rgb(255 255 255 / .85), 0 0 0 9px var(--kx-c-tint); }
  .scr-practice.pr-fun .pr-hear--round .icon { width: 42px; height: 42px; }
  .scr-practice.pr-fun .pr-matchround { gap: var(--s2); min-height: 0; }
  .scr-practice.pr-fun .pr-matchprompt { padding-block: var(--s2) var(--s3); gap: var(--s2); }
}
/* the clouds: three choices at different heights, each its own colour, drifting; a phone has two and one */
.scr-practice.pr-fun .pr-opts--clouds { display: grid; direction: rtl; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; align-items: start; justify-items: center; padding: 4px 2px 18px; }
.scr-practice.pr-fun .pr-opts--clouds > :nth-child(3) { grid-column: 1 / -1; width: 50%; }
.scr-practice.pr-fun .pr-opts--clouds.is-stacked { grid-template-columns: minmax(0, 1fr); }
.scr-practice.pr-fun .pr-opts--clouds.is-stacked > :nth-child(3) { width: 100%; }
@container app (min-width: 600px) {
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--clouds { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--clouds > :nth-child(3) { grid-column: auto; width: 100%; }
  .scr-practice.pr-fun:not([data-class="1"]) .pr-opts--clouds.is-stacked { grid-template-columns: minmax(0, 1fr); }
}
.scr-practice.pr-fun .pr-cloud { position: relative; z-index: 1; width: 100%; max-width: 250px; aspect-ratio: 1.3; min-height: 124px; margin-top: var(--pr-lift, 0px); }
.scr-practice.pr-fun .pr-cloudart { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; filter: drop-shadow(0 5px 0 var(--kx-c)); transition: filter 220ms var(--ease); }
.scr-practice.pr-fun .pr-cloudart .cl-body { fill: #fff; stroke: var(--kx-c-deep); stroke-width: 3.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill 200ms var(--ease); }
/* the key IS the cloud: no chrome of its own, the Arabic sits in the body of the cloud (below the puffs) */
.scr-practice.pr-fun .pr-opts .pr-opt.pr-cloudkey { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; width: auto; min-height: 0; padding: 32% 8% 18%; background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--ink); }
.scr-practice.pr-fun .pr-cloudkey .pr-opt__ar { font-size: var(--pr-ar, 3.5rem); line-height: 1.7; white-space: nowrap; }
.scr-practice.pr-fun .pr-opts--clouds.is-stacked .pr-cloudkey .pr-opt__ar { white-space: nowrap; }
.scr-practice.pr-fun .pr-cloudkey .pr-opt__say { font: 700 1.5rem/1.2 var(--font-body); color: var(--ink); }
.scr-practice.pr-fun .pr-cloud .pr-tick, .scr-practice.pr-fun .pr-cloud .pr-again { left: auto; right: 11%; top: 28%; bottom: auto; margin: 0; }
@media (hover: hover) { .scr-practice.pr-fun .pr-opts:not(.is-answered) .pr-cloud:hover .pr-cloudart .cl-body { fill: var(--kx-c-tint); } }
.scr-practice.pr-fun .pr-cloud:has(.pr-opt:focus-visible) .pr-cloudart .cl-body { stroke-width: 6; }
/* a sound cloud (the round shows the word): a ▶ to listen and a round numbered key to choose, side by side */
.scr-practice.pr-fun .pr-cloudkeys { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24% 6% 6%; }
.scr-practice.pr-fun .pr-cloud--sound .pr-hear--opt, .scr-practice.pr-fun .pr-cloud--sound .pr-pick { flex: none; width: var(--kids-target, 56px); height: var(--kids-target, 56px); min-width: 0; min-height: 0; padding: 0; border-radius: 50%; }
.scr-practice.pr-fun .pr-cloud--sound .pr-hear--opt { background: var(--kx-c-tint); border: 3px solid var(--kx-c-deep); box-shadow: 0 4px 0 -1px var(--kx-c); color: var(--kx-c-deep); }
.scr-practice.pr-fun .pr-cloud--sound .pr-hear--opt .icon { width: 28px; height: 28px; }
.scr-practice.pr-fun .pr-opts .pr-opt.pr-pick { position: relative; display: grid; place-items: center; background: var(--kx-c); border: 3px solid var(--kx-c-deep); box-shadow: 0 4px 0 -1px var(--kx-c-deep); color: var(--ink); }
.scr-practice.pr-fun .pr-pick .pr-pick__n { font: 800 1.5rem/1 var(--font-body); }
.scr-practice.pr-fun .pr-opts--sound.pr-opts--clouds .pr-opt { opacity: 1; }
.scr-practice.pr-fun .pr-opts--sound.is-answered .pr-bob:not(.is-lit):not(.is-miss) { opacity: .7; }
.scr-practice.pr-fun .pr-cloud--sound .pr-tick, .scr-practice.pr-fun .pr-cloud--sound .pr-again { left: auto; right: 8%; top: 24%; bottom: auto; margin: 0; }
/* the states: the right cloud (and, after a miss, the one that was asked for) is lit mint; a wrong one has a dashed rim and a quiet face, its words untouched */
.scr-practice.pr-fun .pr-cloud.is-lit .pr-cloudart { filter: drop-shadow(0 0 12px rgb(111 221 164 / .95)) drop-shadow(0 0 3px #fff); }
.scr-practice.pr-fun .pr-cloud.is-lit .pr-cloudart .cl-body { fill: var(--kx-mint-tint); stroke: var(--kx-mint-deep); }
.scr-practice.pr-fun .pr-cloud.is-miss .pr-cloudart { filter: none; }
.scr-practice.pr-fun .pr-cloud.is-miss .pr-cloudart .cl-body { fill: var(--desk); stroke: var(--edge); stroke-dasharray: 9 7; }
/* the rope and the rings on the cloud's shoulder */
.scr-practice.pr-fun .pr-rope { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.scr-practice.pr-fun .pr-rope__line { stroke: var(--kx-rose-deep); stroke-width: 5; stroke-linecap: round; opacity: .9; }
.scr-practice.pr-fun .pr-linked { position: absolute; left: 18%; top: 20%; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 3; pointer-events: none; }
.scr-practice.pr-fun .pr-linked .kx-art { width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .scr-practice.pr-fun .pr-cloudart, .scr-practice.pr-fun .pr-cloudart .cl-body { transition: none; } }

/* a mouse over a choice that is still open: the card brightens (a tap needs nothing); the lanterns brighten by themselves above */
@media (hover: hover) {
  .scr-practice.pr-fun .pr-opts:not(.is-answered):not(.pr-opts--lanterns) .pr-opt:not(.pr-cloudkey):not(.pr-pick):hover { background: linear-gradient(180deg, #fff 0%, var(--kx-c-tint, #fff) 100%); box-shadow: 0 5px 0 -1px var(--kx-c, rgb(20 40 60 / .2)), 0 0 0 3px var(--kx-c, transparent); }
}
.scr-practice.pr-fun .pr-chip { min-width: 0; max-width: 100%; }
/* B2-FUN-END */

/* ============================================================ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scr-surah .cartouche.is-shining .cart-field::after { display: none; }
  .scr-surah .ay-tick[aria-pressed="true"] .ay-tick__box .icon { animation: none; stroke-dasharray: none; }
}


/* second review (KIDS2-1): fitAyah / fitWord measure straight after they set a font size; with Reduce Motion on, the 1 ms transition above left the OLD computed size to measure and the Big screen drew the ayah at 17 px. The text on the Big screen never animates its size. */
.lr-big .big-ayah, .lr-big .big-word, .lr-big .big-ayah .w, .lr-big .big-ayah .w--run, .lr-big .big-ayah .medal { transition: none !important; }
