/* kids-home.css: owned by area A, Home (tools/kids/CONTRACT.md section 0), then by area N of the fun and navigation round (section 16b). Class prefix kh-.
 * The home (the hello, the Play card, the three game cards, the path strip: one screen), Today (#today), My path (#map), the end of Today, a game's own page (#play-<mode>), the old book (#book).
 * The tab bar, the Leave key, the Games screen and My sky are kids-nav.css (kn-). Light theme only. Tap targets follow the reader's band (--kids-target: 64px Little ones, 56px Readers, 44px Big readers).
 * Colours are the --kx-* tokens of kids-fx.css (text on a colour or its tint is --ink or the colour's -deep). */

/* ============================================================ shared bits */
.kh-h { margin: 0 0 var(--s3); font: 700 var(--t-h2)/1.2 var(--font-display); }
.kh-kicker { display: flex; align-items: center; gap: 6px; margin: 0; font: 700 var(--t-sm)/1.2 var(--font-body); color: var(--l-ink); }
.kh-kicker .icon { width: 16px; height: 16px; }
.kh-count { margin: 0; text-align: center; font: 700 var(--t-sm)/1.2 var(--font-body); color: var(--ink-soft); }
/* "2 of 3" for a child who cannot read it: that many dots, this one filled */
.kh-count:has(.kh-cdot) { display: flex; justify-content: center; flex-wrap: nowrap; max-width: 100%; gap: clamp(3px, 1.2vw, 10px); }
.kh-cdot { flex: 0 1 18px; min-width: 6px; width: auto; aspect-ratio: 1; height: auto; border-radius: 50%; border: 3px solid var(--rule); box-sizing: border-box; }   /* 18 dots (the signs) shrink on one row instead of widening the page at 390 px */
.kh-cdot.is-past { background: var(--l-fill); border-color: var(--l-ink); }
.kh-cdot.is-now { background: var(--action); border-color: var(--action); }
.kh-turn[hidden], .kh-nav[hidden], .kh-donebar[hidden], .kh-play__end[hidden] { display: none !important; }
.kh-oops { margin: 0; padding: var(--s4); text-align: center; font: 600 var(--t-body)/1.4 var(--font-body); color: var(--ink-soft); }

/* a session's tile: the app's khatam star in the level's colour (the colour comes from [data-lesson] on the svg) */
.kh-tile { display: block; flex: none; width: 56px; height: 56px; overflow: visible; }
.kh-tile--head { width: 64px; height: 64px; }
.kh-tile--card { width: 76px; height: 76px; }
.kh-tile--big { width: 150px; height: 150px; }
.kh-tile--mini { width: 100%; height: auto; aspect-ratio: 1; }
.kh-tile__face { fill: none; }
.kh-tile__rim { fill: none; stroke: var(--rule); stroke-width: 3.5; stroke-linejoin: round; }
.kh-tile__n { font: 700 40px/1 var(--font-display); fill: var(--ink-soft); }
.kh-tile.is-done .kh-tile__face { fill: var(--l-fill); }
.kh-tile.is-done .kh-tile__rim { stroke: var(--l-ink); stroke-width: 4.5; }
.kh-tile.is-done .kh-tile__n { fill: var(--l-ink); }
.kh-tile.is-here .kh-tile__face, .kh-tile.is-open .kh-tile__face { fill: var(--l-wash); }
.kh-tile.is-here .kh-tile__rim, .kh-tile.is-open .kh-tile__rim { stroke: var(--l-ink); stroke-width: 5; }
.kh-tile.is-here .kh-tile__n, .kh-tile.is-open .kh-tile__n { fill: var(--l-ink); }
.kh-tile.is-started .kh-tile__face { fill: color-mix(in oklab, var(--l-wash), var(--l-fill) 60%); }
.kh-tile.is-locked .kh-tile__rim { stroke: var(--edge); stroke-width: 3; stroke-dasharray: 7 6; }
.kh-tile.is-locked .kh-tile__n { fill: var(--edge); }

/* the seven dots of the week: nothing here is ever lost, and no day has a name */
.kh-week { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0; }
.kh-week__t { font: 700 var(--t-sm)/1.2 var(--font-body); color: var(--ink-soft); }
.kh-week__dots { display: flex; flex-wrap: wrap; gap: 8px; }
.kh-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rule); background: transparent; box-sizing: border-box; }
.kh-dot.is-on { background: var(--action); border-color: var(--action); }
html[data-band="little"] .kh-dot { width: 20px; height: 20px; }
html[data-band="little"] .kh-week__t { display: none; }      /* a word the child cannot read */

/* ============================================================ the home: one screen (the fun and navigation round, FUN.md section 2) */
/* the hello, one big coloured Play card, a row of three game cards, a slim path strip: no scroll on a tablet, a little on a phone */
.scr-home .kh-hm { display: grid; gap: var(--s3); align-content: start; grid-template-columns: minmax(0, 1fr); max-width: 44rem; margin-inline: auto; }
.scr-home .kh-hm > * { min-width: 0; }
.kh-hm__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); }
.scr-home .kh-hm .home-hello { margin: 0; font: 800 1.5rem/1.15 var(--font-display); }
.scr-home .kh-hm .home-hello--little { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.scr-home .kh-hm .home-hello__disc { width: 56px; height: 56px; font-size: 1.75rem; }
.scr-home .kh-hm .home-hello__name { font-size: 1.75rem; min-width: 0; overflow-wrap: anywhere; }
.scr-home .kh-hm .home-addname { margin: 0; }
.kh-hm__main, .kh-hm__side { display: grid; gap: var(--s3); align-content: start; min-width: 0; }
/* the screen is filled, not just used: the Home is as tall as the window under the bars (never taller: no scroll on a tablet; never more than 56rem), and the spare height goes to the Play card and the game cards */
.scr-home .kh-hm { min-height: min(56rem, calc(100svh / var(--content-zoom) - var(--topbar-h) - (var(--kn-bar-h) + 34px) / var(--content-zoom))); grid-template-rows: auto 1fr; }
.kh-hm__main { align-content: stretch; grid-template-rows: minmax(0, 1fr); }
.kh-hm__main > .kh-playcard { align-content: space-evenly; }
.kh-hm__side { grid-template-rows: minmax(0, 1fr) auto; align-content: stretch; }
.kh-hm__foot { display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@container app (min-width: 560px) { .kh-hm__foot:has(.kh-hm__surahs) { grid-template-columns: minmax(0, 1fr) auto; } }
.kh-hm__games { grid-template-rows: auto minmax(0, 1fr); }
html[data-band="little"] .kh-hm__games { grid-template-rows: minmax(0, 1fr); }              /* no head row for Little ones: the cards take the column */
.kh-hm__row { align-items: stretch; }
@container app (min-width: 860px) {
  .scr-home .kh-hm { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); column-gap: var(--s5); row-gap: var(--s2); max-width: 70rem; }
  .scr-home .kh-hm > .kh-hm__top { grid-column: 1 / -1; }
  .scr-home .kh-hm > .home-nostore { grid-column: 1 / -1; }
  /* on a wide screen the three games are three wide cards, one under the other, so they fill the column beside the Play card (Little ones: a 2 x 2 of square picture tiles, below) */
  html:not([data-band="little"]) .scr-home .kh-hm__row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr 1fr; justify-items: start; align-items: center; text-align: start; column-gap: 16px; row-gap: 0; min-height: 0; padding: 8px 18px 8px 12px; }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__pic { grid-row: 1 / span 2; width: clamp(96px, 15vh, 144px); height: 100%; --kx-art-size: clamp(80px, 12.5vh, 124px); }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__t { align-self: end; font-size: clamp(1.25rem, 2.6vh, 1.65rem); }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__sub, html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__new, html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__best { align-self: start; }
  /* Little ones (KIDS-N-6): the column beside the Play card is a 2 x 2 of big square picture tiles (the three games and All games, all the same size), the pictures growing with the window's height:
     three thin strips with a small picture each left the screen empty and the pictures a fifth of their cards */
  html[data-band="little"] .scr-home .kh-hm__row { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px; }
  html[data-band="little"] .scr-home .kh-hm__row .kn-gcard--sm { grid-template-rows: minmax(0, 1fr) auto; align-content: stretch; padding: 10px 8px; }
  html[data-band="little"] .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__pic { height: 100%; max-height: none; --kx-art-size: clamp(96px, 19vh, 176px); }
  html[data-band="little"] .scr-home .kh-hm__row .kh-hm__more > .kh-hm__all--pic { flex: 1 1 auto; width: 100%; gap: 8px; --kx-art-size: clamp(96px, 19vh, 176px); }
  html[data-band="little"] .scr-home .kh-hm__row .kh-hm__all--pic .icon { width: 26px; height: 26px; }
}
@container app (max-width: 859px) {
  .scr-home .kh-hm { grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .kh-hm__side { grid-template-rows: auto auto; }
  .kh-hm__games, html[data-band="little"] .kh-hm__games { grid-template-rows: auto; }
}
@media (min-width: 860px) and (max-height: 820px) {
  .scr-home .kh-hm .home-hello { font-size: 1.375rem; }
  .scr-home .kh-hm .home-hello__disc { width: 48px; height: 48px; font-size: 1.5rem; }
  .scr-home .kh-hm .home-hello__name { font-size: 1.5rem; }
}

/* the Play card: today's session in its level's colour: its number, its letters large, one huge Play key, the week */
.kh-playcard {
  display: grid; gap: var(--s3); padding: var(--s4); background: var(--kx-c-tint); color: var(--ink);
  border: 3px solid var(--kx-c); border-bottom: 8px solid var(--kx-c-deep); border-radius: 28px;
}
.kh-playcard__head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.kh-playcard__t { display: grid; min-width: 0; }
.kh-playcard .kh-kicker { color: var(--kx-c-deep); font-size: var(--t-sm); }
.kh-playcard__h { margin: 0; font: 800 1.75rem/1.1 var(--font-display); color: var(--kx-c-deep); }
.kh-playcard__sub { margin: 2px 0 0; font: 700 var(--t-body)/1.25 var(--font-body); color: var(--ink); overflow-wrap: anywhere; }
.kh-playcard__glyphs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 22px; margin: 0; line-height: 1.9; }
.kh-glyph { color: var(--kx-c-deep); font-size: 3.25rem; line-height: 1.9; }
.kh-glyph--word, .kh-glyph--surah { font-size: 2.25rem; }
.kh-glyph--sign { font-size: 2.75rem; }
@container app (min-width: 560px) { .kh-glyph { font-size: 4rem; } .kh-glyph--word, .kh-glyph--surah { font-size: 2.75rem; } .kh-glyph--sign { font-size: 3.25rem; } }
.kh-playcard .key.primary.kh-start {
  width: 100%; min-height: 72px; font-size: 1.5rem; background: var(--kx-c-deep); color: var(--kx-on-deep, #fff); border-color: color-mix(in oklab, var(--kx-c-deep), #000 28%);
}
.kh-playcard .key.primary.kh-start .icon { width: 30px; height: 30px; }
@media (hover: hover) { .kh-playcard .key.primary.kh-start:not(:disabled):hover { background: color-mix(in oklab, var(--kx-c-deep), #000 12%); } }
.kh-playcard__note { margin: 0; font: 600 var(--t-body)/1.4 var(--font-body); color: var(--ink); }
.kh-playcard__check { margin: 0; }
.kh-playcard__check .quiet { min-height: var(--kids-target); text-align: start; }
.kh-playcard .kh-week { gap: var(--s2) var(--s3); }
.kh-playcard .kh-week__t { color: var(--ink); }
.kh-playcard .kh-dot { border-color: var(--kx-c-deep); }
.kh-playcard .kh-dot.is-on { background: var(--kx-c-deep); border-color: var(--kx-c-deep); }
html[data-band="little"] .kh-playcard { padding: var(--s4); }
html[data-band="little"] .kh-playcard .key.primary.kh-start { min-height: 84px; }
html[data-band="little"] .kh-playcard .key.primary.kh-start .icon { width: 44px; height: 44px; }
/* Little ones: the tile and the letters share a row (no words to put between them), and the Play key is the biggest thing on the screen */
html[data-band="little"] .kh-playcard { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 14px; }
html[data-band="little"] .kh-playcard > * { grid-column: 1 / -1; }
html[data-band="little"] .kh-playcard > .kh-playcard__head { grid-column: 1; grid-row: 1; }
html[data-band="little"] .kh-playcard > .kh-playcard__glyphs { grid-column: 2; grid-row: 1; gap: 0 14px; }
html[data-band="little"] .kh-glyph { font-size: 3.5rem; }
html[data-band="little"] .kh-glyph--word, html[data-band="little"] .kh-glyph--surah { font-size: 2.5rem; }
html[data-band="little"] .kh-playcard .kh-tile--card { width: 84px; height: 84px; }
@container app (min-width: 560px) { html[data-band="little"] .kh-glyph { font-size: 4.5rem; } html[data-band="little"] .kh-glyph--word, html[data-band="little"] .kh-glyph--surah { font-size: 3.25rem; } }
/* on a wide screen the letters grow with the window's height (the Play card has the room: the Home fills the screen) */
/* Little ones on a tablet, upright or on its side (KIDS-N-6): the tile and the letters take the Play card's spare height (no empty bands above and below), and the letters and the Play key grow
   with the window's height: the Play key is the biggest thing on the screen */
@container app (min-width: 600px) {
  html[data-band="little"] .kh-hm__main > .kh-playcard { grid-template-rows: minmax(0, 1fr) auto auto; align-content: stretch; }
  html[data-band="little"] .kh-glyph { font-size: clamp(4.5rem, 13vh, 7.5rem); }
  html[data-band="little"] .kh-glyph--word, html[data-band="little"] .kh-glyph--surah { font-size: clamp(3.25rem, 9vh, 5rem); }
  html[data-band="little"] .kh-playcard .key.primary.kh-start { min-height: clamp(84px, 15vh, 140px); }
  html[data-band="little"] .kh-playcard .key.primary.kh-start .icon { width: clamp(44px, 7vh, 72px); height: clamp(44px, 7vh, 72px); }
}
@container app (min-width: 860px) {
  html:not([data-band="little"]) .kh-glyph { font-size: clamp(3.25rem, 9vh, 5.5rem); }
  html:not([data-band="little"]) .kh-glyph--word, html:not([data-band="little"]) .kh-glyph--surah { font-size: clamp(2.5rem, 7vh, 4rem); }
  html:not([data-band="little"]) .kh-glyph--sign { font-size: clamp(2.75rem, 8vh, 4.5rem); }
}
/* a short window gives up some air before it scrolls: the gaps shrink a little (Little ones' tile too; their letters and key follow the window's height above) */
@media (max-height: 860px) and (min-width: 860px) {
  .kh-playcard { gap: var(--s2); padding: var(--s3) var(--s4); }
  html:not([data-band="little"]) .kh-playcard .key.primary.kh-start { min-height: 72px; }
  html[data-band="little"] .kh-playcard .kh-tile--card { width: 76px; height: 76px; }
}

/* Play a game: three big picture cards and All games */
.kh-hm__games { display: grid; gap: var(--s2); }
.kh-hm__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.kh-hm__head .kh-h { margin: 0; font-size: 1.25rem; }
.kh-hm__all { display: inline-flex; align-items: center; gap: 2px; min-height: var(--kids-target); padding: 0 6px; font: 800 var(--t-sm)/1.2 var(--font-body); color: var(--lapis); text-decoration: none; border-radius: var(--r-chip); }
.kh-hm__all .icon { width: 18px; height: 18px; }
.kh-hm__all--pic { min-width: var(--kids-target); min-height: var(--kids-target); justify-content: center; padding: 4px; background: var(--kx-rose-tint); border: 2px solid var(--kx-rose); border-bottom: 5px solid var(--kx-rose-deep); border-radius: 18px; --kx-art-size: 44px; }
.kh-hm__row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kh-hm__row > li { display: flex; min-width: 0; }
html[data-band="little"] .kh-hm__row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: stretch; }
html[data-band="little"] .kh-hm__row .kh-hm__more > .kh-hm__all--pic { flex-direction: column; justify-content: center; gap: 6px; padding: 8px 6px; min-width: 64px; --kx-art-size: 42px; }
@container app (max-width: 359px) { .kh-hm__row { gap: 6px; } }

/* the path strip: the level, a dot for each of its sessions, a way to My path */
.kh-hm__path {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; box-sizing: border-box; color: var(--ink); text-decoration: none;
  background: var(--kx-c-tint); border: 2px solid var(--kx-c); border-bottom: 5px solid var(--kx-c-deep); border-radius: 22px;
}
@media (hover: hover) { .kh-hm__path:hover, .kh-hm__surahs:hover { background: color-mix(in oklab, var(--kx-c-tint), var(--kx-c) 28%); } }
.kh-hm__path:focus-visible, .kh-hm__surahs:focus-visible, .kh-hm__all:focus-visible { outline: 3px solid var(--lapis); outline-offset: 3px; }
.kh-hm__lv { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--kx-c); color: var(--ink); font: 800 1.25rem/1 var(--font-display); }
.kh-hm__pt { display: grid; gap: 6px; flex: 1 1 auto; min-width: 0; }
.kh-hm__pname { font: 800 var(--t-body)/1.2 var(--font-display); color: var(--kx-c-deep); overflow-wrap: anywhere; }
.kh-hm__dots, .kh-level__dots { display: flex; flex-wrap: wrap; gap: 6px; }
.kh-hm__path > .icon, .kh-hm__surahs > .icon { flex: none; width: 22px; height: 22px; color: var(--kx-c-deep); }
.kh-pdot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--kx-c-deep); background: transparent; box-sizing: border-box; flex: none; }
.kh-pdot.is-done { background: var(--kx-c-deep); }
.kh-pdot.is-open { background: var(--kx-c); }
.kh-pdot.is-here { background: var(--raised); border-width: 3px; box-shadow: 0 0 0 3px var(--kx-c); }
.kh-pdot.is-locked { border-color: color-mix(in oklab, var(--kx-c-deep) 40%, transparent); }
html[data-band="little"] .kh-pdot { width: 20px; height: 20px; }
html[data-band="little"] .kh-hm__lv { width: 52px; height: 52px; font-size: 1.5rem; }
html[data-band="little"] .kh-hm__path { min-height: 80px; }
.kh-hm__surahs {
  display: flex; align-items: center; gap: 12px; min-height: var(--kids-target); padding: 8px 14px; box-sizing: border-box; color: var(--ink); text-decoration: none; font: 800 var(--t-body)/1.2 var(--font-display);
  background: var(--kx-c-tint); border: 2px solid var(--kx-c); border-bottom: 5px solid var(--kx-c-deep); border-radius: 22px;
}
.kh-hm__surahs > span { flex: 1 1 auto; color: var(--kx-c-deep); }
.scr-home .kh-hm .home-nostore { margin: 0; }

/* a wide window that is not tall (a 7-inch tablet: 1024 x 600, or a laptop's short browser window): the hello goes (the reader's disc is in the bar) and the pictures are a little smaller,
   so the whole Home is still on the screen (N-4: the path strip was 70 to 90 px under the bar there) */
@media (max-height: 640px) and (min-width: 860px) and (min-height: 521px) {
  .scr-home .kh-hm > .kh-hm__top { display: none; }
  .kh-hm__path, html[data-band="little"] .kh-hm__path { min-height: max(var(--kids-target), 56px); padding-block: 6px; }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__pic { width: 76px; --kx-art-size: 58px; }
  html[data-band="little"] .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__pic, html[data-band="little"] .scr-home .kh-hm__row .kh-hm__more > .kh-hm__all--pic { --kx-art-size: 88px; }
}

/* ============================================================ a short window (a phone on its side, a small tablet): Home on the first screen (N-4, KIDS-N-2)
   The two bars take about 140 px of a 390 px window, so Home becomes two columns without the hello (the reader's disc is in the bar): the Play card as one row (its number, its letters, the Play key)
   and the three games in a row with the path strip under them. All games is the Games tab, one tap away in the bar below. Every key keeps its band's target. */
@media (max-height: 520px) and (min-width: 560px) {
  .scr-home .kh-hm { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: auto; min-height: 0; column-gap: var(--s3); row-gap: var(--s2); max-width: 70rem; align-content: start; }
  .scr-home .kh-hm > .kh-hm__top { display: none; }
  .scr-home .kh-hm > .home-nostore { grid-column: 1 / -1; }
  .kh-hm__main, .kh-hm__side { align-content: start; grid-template-rows: auto; gap: var(--s2); }
  .kh-hm__main > .kh-playcard { align-content: center; }
  .kh-hm__side { grid-template-rows: auto auto; }
  /* the Play card: its number and its letters in one row, the Play key under them; the words that would go between (Today, Session N, the note, the week) wait for a taller window */
  .scr-home .kh-hm__main > .kh-playcard { padding: 10px 14px; gap: 8px; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; border-bottom-width: 6px; }
  .scr-home .kh-hm__main > .kh-playcard > * { grid-column: 1 / -1; }
  .scr-home .kh-hm__main > .kh-playcard > .kh-playcard__head { grid-column: 1; grid-row: 1; }
  .scr-home .kh-hm__main > .kh-playcard > .kh-playcard__glyphs { grid-column: 2; grid-row: 1; gap: 0 12px; }
  .kh-playcard__t, .kh-playcard__note { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .kh-playcard .kh-week, .kh-playcard__check { display: none; }
  .kh-playcard .kh-tile--card, html[data-band="little"] .kh-playcard .kh-tile--card { width: 56px; height: 56px; }
  html .kh-glyph, html[data-band="little"] .kh-glyph, html:not([data-band="little"]) .kh-glyph { font-size: clamp(2.25rem, 11vh, 3rem); }
  html .kh-glyph--word, html .kh-glyph--surah, html[data-band="little"] .kh-glyph--word, html[data-band="little"] .kh-glyph--surah,
  html:not([data-band="little"]) .kh-glyph--word, html:not([data-band="little"]) .kh-glyph--surah { font-size: clamp(1.75rem, 8.5vh, 2.25rem); }
  html .kh-glyph--sign, html:not([data-band="little"]) .kh-glyph--sign { font-size: clamp(2rem, 9.5vh, 2.5rem); }
  .kh-playcard .key.primary.kh-start, html[data-band="little"] .kh-playcard .key.primary.kh-start { min-height: max(var(--kids-target), 56px); font-size: 1.375rem; }
  .kh-playcard .key.primary.kh-start .icon, html[data-band="little"] .kh-playcard .key.primary.kh-start .icon { width: 30px; height: 30px; }
  /* the games: a row of three, each a picture over its name (Little ones: a picture over a star, no word); All games is the Games tab below */
  .kh-hm__head, .kh-hm__more, .kh-hm__games .kh-hm__all { display: none; }
  .kh-hm__games, html[data-band="little"] .kh-hm__games { grid-template-rows: auto; }
  html:not([data-band="little"]) .scr-home .kh-hm__row, html[data-band="little"] .scr-home .kh-hm__row { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; gap: 8px; }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm, html[data-band="little"] .scr-home .kh-hm__row .kn-gcard--sm {
    grid-template-columns: none; grid-template-rows: auto auto; align-content: start; justify-items: center; align-items: start; text-align: center; column-gap: 0; row-gap: 2px; min-height: 0; padding: 8px 6px; }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__pic, html[data-band="little"] .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__pic { grid-row: auto; width: 100%; height: clamp(52px, 14vh, 66px); max-height: none; --kx-art-size: clamp(48px, 13vh, 62px); }
  html[data-band="little"] .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__pic { height: clamp(60px, 17vh, 78px); --kx-art-size: clamp(56px, 16vh, 74px); }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__t { align-self: auto; font-size: var(--t-body); }
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__sub, html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__new,
  html:not([data-band="little"]) .scr-home .kh-hm__row .kn-gcard--sm .kn-gcard__best { align-self: auto; }
  /* the path strip: one slim row (Little ones' stays a full target) */
  .kh-hm__path, html[data-band="little"] .kh-hm__path { min-height: var(--kids-target); padding: 6px 12px; gap: 10px; border-radius: 18px; }
  html[data-band="little"] .kh-hm__lv { width: 44px; height: 44px; font-size: 1.25rem; }
  .kh-hm__foot { gap: var(--s2); }
}

/* the old book (#book): the same keycap panels it always had, on a page of its own */
.kh-bookpage { display: grid; gap: var(--s4); max-width: 72rem; margin-inline: auto; }
.kh-bookpage__h { margin: 0; }
.kh-bookpage .kh-lead { margin: 0; }
.kh-bookpage__body { min-width: 0; }

/* ============================================================ Today */
.kh-today { display: grid; gap: var(--s4); max-width: 46rem; margin-inline: auto; }
.kh-td__head { display: flex; align-items: center; gap: 14px; }
.kh-td__titles { display: grid; min-width: 0; }
.kh-td__h { margin: 0; font: 700 1.75rem/1.15 var(--font-display); }
.kh-td__sub { margin: 2px 0 0; font: 600 var(--t-body)/1.3 var(--font-body); color: var(--ink-soft); overflow-wrap: anywhere; }
.kh-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.kh-steps li { min-width: 0; }
.kh-step {
  position: relative; display: grid; place-items: center; min-width: var(--kids-target); min-height: var(--kids-target); padding: 0;
  background: var(--raised); color: var(--ink-soft); border: 2px solid var(--rule); border-radius: var(--r-key); cursor: pointer;
}
.kh-step .icon { width: 24px; height: 24px; }
.kh-step .icon--fill { width: 22px; height: 22px; }
.kh-step__n { position: absolute; top: 0; inset-inline-end: 4px; font: 700 .8125rem/1.2 var(--font-body); color: var(--ink-soft); }
.kh-step.is-past { color: var(--l-ink); border-color: var(--l-fill); background: var(--l-wash); }
.kh-step.is-now { color: var(--on-action); background: var(--action); border-color: var(--action-lip); }
.kh-step.is-now .kh-step__n { color: inherit; }
.kh-step[aria-disabled="true"] { opacity: .55; cursor: default; }
@media (hover: hover) { .kh-step:not(.is-now):not([aria-disabled="true"]):hover { background: var(--hover-mix); } }

.kh-say { display: flex; align-items: center; gap: var(--s3); min-height: 0; }
.kh-say:empty { display: none; }
.kh-say__t { margin: 0; font: 600 var(--t-body)/1.4 var(--font-body); }
.kh-say .key.kh-say__btn { flex: none; width: var(--kids-target); min-width: var(--kids-target); height: var(--kids-target); min-height: var(--kids-target); padding: 0; }
html[data-band="little"] .kh-say__t { font-size: 1.25rem; }

.kh-stage { display: grid; gap: var(--s4); justify-items: center; min-height: 12rem; align-content: start; }
.kh-stage > * { max-width: 100%; }
.kh-stage > div, .kh-stage > p { width: 100%; }
.kh-q, .kh-echo, .kh-sign, .kh-ayah, .kh-listen, .kh-list, .kh-read, .kh-play { display: grid; gap: var(--s4); justify-items: center; min-width: 0; }
.kh-hear { min-width: 12rem; }
.kh-info { margin: 0; max-width: 40rem; font: 500 var(--t-body)/1.5 var(--font-body); }

/* the warm-up: hear it, then find it among two or three cards */
.kh-q__opts { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--kids-gap); }
.kh-opt {
  display: block; min-width: var(--kids-target); min-height: var(--kids-target); padding: 0; margin: 0; background: transparent; border: 0;
  border-radius: var(--r-panel); cursor: pointer; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
}
.kh-opt.is-right { outline: 5px solid var(--ok); outline-offset: 3px; }
.kh-opt.is-wrong { outline: 3px dashed var(--ink-soft); outline-offset: 3px; opacity: .6; }
.kh-opt.is-dim { opacity: .55; }
.kh-q__fb { margin: 0; min-height: 1.5em; text-align: center; font: 700 var(--t-h3)/1.2 var(--font-display); }
.kh-q__fb .icon { width: 32px; height: 32px; color: var(--ink-soft); }
.kh-q__fb.is-ok .icon { color: var(--ok); }
.kh-nothing { display: grid; gap: var(--s4); justify-items: center; }

.kh-turn { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 8px 18px; border-radius: var(--r-pill); background: var(--ok-wash); color: var(--ok); font: 700 var(--t-h3)/1.2 var(--font-display); }
.kh-surah-ar { margin: 0; font-size: 4.5rem; line-height: 1.9; text-align: center; }
.kh-surah-name { margin: 0; text-align: center; font: 600 var(--t-body)/1.3 var(--font-body); color: var(--ink-soft); }
.kh-list { gap: var(--s5); }
.kh-how { margin: 0; text-align: center; font: 600 var(--t-body)/1.4 var(--font-body); color: var(--ink-soft); max-width: 36rem; }
.kh-game { width: 100%; min-width: 0; }
.kh-game__title { margin: 0; font: 700 var(--t-h3)/1.2 var(--font-display); }
.kh-donebar { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font: 700 var(--t-h3)/1.2 var(--font-display); color: var(--ok); }

.kh-nav { display: flex; align-items: stretch; justify-content: space-between; gap: var(--s3); position: sticky; bottom: 0; padding: var(--s3) 0; background: linear-gradient(to top, var(--desk) 70%, transparent); z-index: 2; }
/* the bar scrolls with the page wherever the child answers or reads: a sticky bar would cover the last choice of a game, of a warm-up or the line under them */
.kh-today:has(.kh-stage:is([data-kind="read"], [data-kind="play"], [data-kind="warm"])) .kh-nav { position: static; }
/* a short landscape window (a laptop 1366x768 or 1280x720, a tablet on its side): the session's head, its steps and the line to hear share one row, so a warm-up card
   and the Back / Next bar fit on the first screen (the bar is static on these steps: a sticky one would cover the last choice) */
@media (min-width: 900px) and (max-height: 860px) {
  .kh-today { max-width: 62rem; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--s4); row-gap: var(--s3); }
  .kh-today > * { grid-column: 1 / -1; }
  .kh-today > .kh-td__head { grid-column: 1; grid-row: 1; }
  .kh-today > .kh-steps { grid-column: 2; grid-row: 1; }
  .kh-today > .kh-say { grid-column: 3; grid-row: 1; max-width: 22rem; }
  .kh-today > .kh-say:empty { display: none; }
}
.kh-stage { scroll-margin-top: var(--s3); }
.kh-nav .key { min-height: var(--kids-target); min-width: var(--kids-target); }
.kh-next { margin-inline-start: auto; }
html[data-band="little"] .kh-next { min-width: min(9rem, 56%); justify-content: center; }      /* a percentage floor: at the biggest words size on a phone the bar still fits its row */
html[data-band="little"] .kh-back { min-width: min(6.5rem, 38%); justify-content: center; }
.kh-today, .kh-today > * { min-width: 0; }

/* the end of Today: the session's tile settles in (nothing sounds, nothing covers the page) */
@media (prefers-reduced-motion: no-preference) {
  .kh-end__tile.is-earned { animation: kh-settle .7s ease-out both; }
  .kh-node.is-nudge { animation: kh-nudge .35s ease-in-out; }
}
@media (prefers-reduced-motion: reduce) { .kh-node.is-nudge { outline: 3px dashed var(--ink-soft); outline-offset: 2px; } }
@keyframes kh-settle { from { transform: scale(.82); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes kh-nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.kh-end__tile.is-earned .kh-tile { filter: drop-shadow(0 0 8px var(--l-fill)); }
/* the end of a Today is one panel (LR.fx.endPanel): on a window shorter than a tall phone the session's head steps aside so the three keys stay on the first screen */
.kh-end--panel { width: 100%; }
.kh-end--panel .kh-end__tile { display: grid; place-items: center; }
.kh-end--panel .kh-tile--big { width: 132px; height: 132px; }
.kh-end--panel .kh-week { justify-content: center; margin-bottom: var(--s2); }
.kh-end--panel .kn-skymini { margin-bottom: var(--s2); }
@media (max-height: 900px) { .kh-today:has(.kh-stage[data-kind="tile"] .kh-end--panel) .kh-td__head { display: none; } }
.kh-end { display: grid; gap: var(--s4); justify-items: center; text-align: center; }
.kh-end__h { margin: 0; font: 700 var(--t-h1)/1.2 var(--font-display); }
.kh-end__line { margin: 0; font: 600 var(--t-body)/1.4 var(--font-body); color: var(--ink-soft); }
.kh-end__keys { display: grid; gap: var(--s3); justify-items: stretch; width: 100%; max-width: 24rem; }
.kh-end__keys .key { min-height: var(--kids-target); justify-content: center; }
.kh-end .kh-week { justify-content: center; }
.kh-locked { display: grid; gap: var(--s4); justify-items: start; max-width: 32rem; margin-inline: auto; }
.kh-locked__t { margin: 0; font: 700 var(--t-h3)/1.3 var(--font-display); }

/* ============================================================ My path: the ten levels in their colours (the colour tokens of kids-fx.css) */
.kh-map { display: grid; gap: var(--s4); max-width: 44rem; margin-inline: auto; }
.kh-map__h { margin: 0; }
.kh-lead { margin: 0; font: 500 var(--t-body)/1.5 var(--font-body); color: var(--ink-soft); }
.kh-level { display: grid; gap: var(--s3); padding: var(--s3); background: color-mix(in oklab, var(--kx-c-tint), #fff 45%); border: 2px solid var(--kx-c); border-radius: 26px; }
.kh-level__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.kh-level__h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; flex: 1 1 auto; min-width: 0; margin: 0; padding: 6px 16px; border-radius: var(--r-pill); background: var(--kx-c); color: var(--ink); font: 800 var(--t-h3)/1.2 var(--font-display); }
.kh-level__name { font: 700 var(--t-body)/1.2 var(--font-body); overflow-wrap: anywhere; }
.kh-level__count { flex: none; font: 800 var(--t-sm)/1 var(--font-body); color: var(--kx-c-deep); }
.kh-level__cert { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--kids-target); min-width: var(--kids-target); padding: 2px 14px 2px 8px; border-radius: 18px; background: var(--raised); border: 2px solid var(--kx-rose-deep); color: var(--kx-rose-deep); text-decoration: none; font: 800 var(--t-sm)/1.2 var(--font-display); }
.kh-level__cert .kx-art { width: 30px; height: 30px; }
.kh-level[data-earned="1"] { border-color: var(--kx-c-deep); }
.kh-path { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.kh-path::before { content: ""; position: absolute; inset-block: 14px; left: 50%; border-left: 4px dotted var(--kx-c); opacity: .7; }
.kh-path__item { position: relative; display: flex; flex-wrap: wrap; min-width: 0; }
.kh-path__item[data-pos="s"] { justify-content: flex-start; }
.kh-path__item[data-pos="c"] { justify-content: center; }
.kh-path__item[data-pos="e"] { justify-content: flex-end; }
.kh-node {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: var(--kids-target); max-width: 100%; padding: 6px 18px 6px 6px; box-sizing: border-box;
  background: var(--raised); color: var(--ink); text-decoration: none; border: 2px solid var(--kx-c); border-bottom-width: 5px; border-radius: var(--r-pill); font: inherit; cursor: pointer; text-align: start;
}
.kh-node.is-done { border-color: var(--kx-c-deep); background: var(--kx-c-tint); }
.kh-node.is-open { border-color: var(--kx-c-deep); background: var(--raised); }
.kh-node.is-here { border-color: var(--kx-c-deep); border-width: 3px 3px 7px; background: var(--kx-c); padding-block: 8px; padding-inline: 8px 22px; }
.kh-node.is-here .kh-tile { width: 68px; height: 68px; }
.kh-node.is-here .kh-node__n { font-size: var(--t-h3); }
.kh-node.is-locked { color: var(--ink-soft); background: #F4F6F5; border: 2px dashed var(--edge); border-bottom-width: 4px; cursor: default; }
.kh-node.is-next { border-color: var(--kx-c-deep); color: var(--ink); background: var(--raised); }
html[data-band="little"] .kh-node { padding: 6px; }
html[data-band="little"] .kh-node.is-here { padding: 8px; }
.kh-node__flag { position: absolute; inset-inline-start: 6px; top: -30px; display: block; width: 34px; height: 34px; pointer-events: none; }
.kh-node__flag .kx-art { width: 100%; height: 100%; }
@media (hover: hover) { .kh-node:not(.is-locked):hover { background: color-mix(in oklab, var(--kx-c-tint), var(--kx-c) 30%); } }
.kh-node__text { display: grid; min-width: 0; }
.kh-node__n { font: 800 var(--t-body)/1.2 var(--font-display); }
.kh-node__t { font: 600 var(--t-sm)/1.25 var(--font-body); color: var(--ink-soft); overflow-wrap: anywhere; }
.kh-node.is-here .kh-node__t, .kh-node.is-done .kh-node__t { color: var(--ink); }
.kh-lock-say { flex-basis: 100%; margin: 6px 0 0; padding: 8px 14px; border-radius: var(--r-key); background: var(--sun-wash); color: var(--sun-ink); font: 700 var(--t-body)/1.3 var(--font-body); }
.kh-path__item[data-pos="c"] .kh-lock-say { text-align: center; }
.kh-map__foot { margin: var(--s2) 0 0; display: flex; justify-content: center; }
.kh-map__book { color: var(--ink-soft); min-height: var(--kids-target); min-width: var(--kids-target); }
html[data-band="little"] .kh-level__top { gap: 8px 14px; }
html[data-band="little"] .kh-level__n { font-size: 1.5rem; }

/* every tile (the path, Today's head, the sheet's session list, a certificate) takes the colour of its level */
.kh-tile[class*="kx-c-"] .kh-tile__rim { stroke: var(--kx-c-deep); }
.kh-tile[class*="kx-c-"].is-done .kh-tile__face { fill: var(--kx-c); }
.kh-tile[class*="kx-c-"].is-done .kh-tile__n { fill: var(--ink); }
.kh-tile[class*="kx-c-"].is-here .kh-tile__face, .kh-tile[class*="kx-c-"].is-open .kh-tile__face { fill: var(--kx-c-tint); }
.kh-tile[class*="kx-c-"].is-here .kh-tile__n, .kh-tile[class*="kx-c-"].is-open .kh-tile__n { fill: var(--kx-c-deep); }
.kh-tile[class*="kx-c-"].is-started .kh-tile__face { fill: color-mix(in oklab, var(--kx-c-tint), var(--kx-c) 55%); }
.kh-tile[class*="kx-c-"].is-locked .kh-tile__rim { stroke: var(--edge); }
.kh-node.is-here .kh-tile[class*="kx-c-"] .kh-tile__face { fill: var(--raised); }
@media (prefers-reduced-motion: no-preference) { .kh-node.is-here .kh-tile { animation: kx-pulse 2.4s ease-in-out infinite alternate; } }

/* N-3: the clear layer a page opened by a tap keeps over itself for 450 ms (65-sessions.js settle()): the second tap of a double tap lands on it, not on the first screen's answers */
.kh-veil { position: fixed; inset: 0; z-index: var(--z-toast); background: transparent; touch-action: manipulation; }

/* a game on its own page */
.kh-playpage { display: grid; gap: var(--s4); max-width: 46rem; margin-inline: auto; }
.kh-playpage > h1 { margin: 0; }
.kh-play__end { display: grid; gap: var(--s4); justify-items: center; }

@media (max-width: 420px) {
  .kh-todaycard__h, .kh-td__h { font-size: 1.5rem; }
  html[data-band="little"] .kh-todaycard__h { font-size: 2rem; }
  .kh-hear { min-width: 0; width: 100%; }
}

/* ============================================================ how long it takes (the section-times round: LR.time in 48-time.js; CONTRACT section 17)
   The site's one pill (platform/section-time.js builds it) in the portal's colours and sizes. Nothing optional is loaded before the portal draws (the runtime and the numbers come
   after it, 48-time.js), so this block does not lean on section-time.css: it gives the pill everything it needs. Only Readers and Big readers see it: Little ones see no Latin letters. */
.q-time.kh-time { display: inline-flex; align-items: center; box-sizing: border-box; margin: 6px 0 0; padding: 3px 12px 3px 9px; gap: 6px; max-width: 100%; justify-self: start; align-self: start;   /* no width: fit-content: it sizes a column by the pill's one-line width, and the words could not wrap */
  border-radius: 999px; border: 2px solid var(--rule); background: var(--raised); color: var(--ink-soft); font: 700 var(--t-sm)/1.25 var(--font-body); letter-spacing: 0; text-transform: none; vertical-align: middle; white-space: normal; }
.kh-time .q-time-ic { display: block; flex: none; width: 16px; height: 16px; }
/* the words may wrap: at the biggest text size on a 320 px phone the column beside a tile is about 65 px wide, and a nowrap pill pushed the page sideways (LR.time keeps "5 min" together) */
.kh-time .q-time-t { display: inline-block; min-width: 0; white-space: normal; }
/* the narrowest phones at the biggest text size (320 px, Aa 150%): beside the tile the column is about 80 px wide and "Session" alone is 150, so the text takes its own row under the tile
   (the heading made 20 px of sideways scroll there before the times, for Readers and Big readers; Little ones show no words). The text asks for 5rem, no more: only a column
   narrower than that drops under the tile, so on an ordinary phone at a bigger text size the text stays beside it and the card keeps its height (the Play key stays above the tab bar) */
html:not([data-band="little"]) .kh-playcard__head { flex-wrap: wrap; }
html:not([data-band="little"]) .kh-playcard__t { flex: 1 1 5rem; }
/* ...and the heading shrinks with the screen instead of running past the card's border at the biggest text size on a phone (360 px at Aa 150%, 340 px at Aa 140%: "Session" alone is wider than the column
   beside the tile, and the pill under it goes out with it): full size from about 340 px at ordinary text sizes; where cqw is not known the rule is ignored and the heading is as it was */
html:not([data-band="little"]) .kh-playcard__h { font-size: clamp(1.25rem, 8.2cqw, 1.75rem); }
/* in the kicker row (Today [about 6 min]): the pill is as tall as the line (13 px text, 1 px border, no padding above or below), so the card and the head keep their height (the Home fits one screen: smoke_kids_nav) */
.kh-kicker { flex-wrap: wrap; }   /* at the biggest text size the pill drops to its own line instead of widening the column */
.kh-kicker .q-time.kh-time { margin: 0 0 0 4px; padding: 0 9px 0 6px; gap: 4px; border-width: 1px; font-size: var(--t-cap); line-height: 1.25; align-self: center; }
.kh-kicker .kh-time .q-time-ic { width: 13px; height: 13px; }
.kh-playcard .q-time.kh-time { color: var(--kx-c-deep); border-color: var(--kx-c); }
/* My path: under the title, small. A finished or not yet open session is quieter by its fill and border, never by opacity: the words keep 4.5:1 (ink-soft on the level's tint 6.4 to 6.8, on the locked grey 7.0) */
.kh-node__text .q-time.kh-time { margin: 3px 0 0; padding: 1px 9px 1px 6px; gap: 4px; border-width: 1px; font-size: var(--t-cap); }
.kh-node__text .kh-time .q-time-ic { width: 13px; height: 13px; }
.kh-node.is-done .q-time.kh-time, .kh-node.is-locked .q-time.kh-time { background: transparent; border-color: transparent; }
/* a game's card: the clock and the words above its Best / New mark, no pill */
.kn-gcard__meta { display: grid; justify-items: inherit; align-content: start; align-self: start; gap: 4px; min-width: 0; }   /* it follows the card: centred, or at the start in the Home's wide row */
.kn-gcard__time { display: block; }
.kn-gcard__time:empty { display: none; }
.q-time.kh-time.kh-time--game { margin: 0; padding: 0; border: 0; background: none; width: auto; justify-self: auto; color: var(--ink-soft); font-weight: 700; font-size: var(--t-sm); }   /* (its own size whether section-time.css has arrived or not: that sheet's .q-time-inline says inherit) */
.kn-gcard--sm .q-time.kh-time.kh-time--game { font-size: var(--t-cap); }
.kn-gcard--sm .kh-time--game .q-time-ic { width: 13px; height: 13px; }
@media print { .q-time.kh-time { display: none !important; } }
