/* Two faces with two jobs (SPEC 5.5; CR-145 round 2, CR-152, CR-153 rounds 1 to 3, CR-154 round 1,
   CR-157), each served from the repository with its OFL.txt beside it; the unicode ranges let a
   browser take only the file a line needs (a face nothing uses is not fetched), and index.php
   preloads these very URLs.
   What is learned (the word, the translation, the meanings, the written letters; --font-card): the
   game's font, Source Sans 3, one family across both scripts, SIL OFL 1.1, its Latin and Cyrillic
   variable files (weights 200 to 900, so 400, 600 and 700 are real) as published in
   @fontsource-variable/source-sans-3 5.3.1.
   Where the app speaks (the level 1 questions, the lines under the cards, the captions of Find the
   mistakes and the rescue card, the yellow notes; --font-hand): Shantell Sans, a hand font, SIL OFL
   1.1, its Latin and Cyrillic variable files (weights 300 to 800) as published in
   @fontsource-variable/shantell-sans 5.3.0. */
@font-face {
  font-family: "Source Sans 3";
  src: url(fonts/source-sans-3/source-sans-3-latin-wght-normal.woff2) format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  src: url(fonts/source-sans-3/source-sans-3-cyrillic-wght-normal.woff2) format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Shantell Sans";
  src: url(fonts/shantell-sans/shantell-sans-latin-wght-normal.woff2) format("woff2-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Shantell Sans";
  src: url(fonts/shantell-sans/shantell-sans-cyrillic-wght-normal.woff2) format("woff2-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  /* The page's type, the system stack; and the hand font of the lines where the app speaks
     (CR-145 round 2, CR-153 round 3: the level 1 questions, the hint row and the continue line, the
     captions of Find the mistakes and the rescue card; a sticker's title through --font-note-title),
     the page's stack after it, so a device without the files shows the app's type rather than a
     system script face. var(--font-card) puts these lines in the cards' face. */
  --font-page: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Shantell Sans", var(--font-page);
  /* The face of what is learned, the game's font (CR-152, CR-153 round 3, CR-154 round 1,
     CR-157): the word with its article and transliteration, the translation, the tiles' words
     and captions, Match's cards and pair cards, the letters in Type's slots, the chunks on Build the
     word's line, the written letters of Trace the word and Find the mistakes, the New stamp's word,
     the rescue's rising letters: Source Sans 3. var(--font-page) puts the cards back in the page's
     type. modes/common.js waits for it (and for --font-hand) before the first card. */
  --font-card: "Source Sans 3", var(--font-page);
  /* What is written on a yellow note's paper (CR-154): a note is the app speaking, so by hand, as
     its title: the text, the note under it, the tour's rows, the pill and the offer's second button,
     on every sticker (by the "?", the tour, the flower's, the offer of the easy levels, the notice
     before the rescue card) and the note for a phone on its side. A note must not look like a card.
     var(--font-card) puts the text and the buttons in the cards' face (CR-153 round 3). */
  --font-note: var(--font-hand);
  /* A note's title and the line of the note for a phone on its side (set in the title's type): by
     hand like the rest of the note (CR-153 round 3, CR-154). var(--font-note) keeps the title with
     its text whatever that is set to. */
  --font-note-title: var(--font-hand);
  /* The meanings the cards screen shows, on a card or on the page (CR-153).
     var(--font-page) puts the meanings back in the page's type and leaves the cards as they are. */
  --font-meaning: var(--font-card);
  /* The x-height the two faces are drawn at, as a share of the font size (CR-153 round 1):
     font-size-adjust beside every family set from the tokens above, so a face stands level with the
     page's type at the same font size (on an iPhone about 0.52). Source Sans 3's own "x" is 0.49 of
     the size, Shantell Sans's about 0.52 as the browser reads it: 0.52 draws Source Sans 3 about 6%
     larger than its own size and Shantell Sans at its own. A larger number draws them
     larger; none draws each face at its own size. */
  --hand-adjust: 0.52;
  /* The weight and the levelling of what the player writes on the typing and the building boards
     (CR-155): the letters in Type's slots and the chunks on Build the word's line,
     one pair of knobs for both. The values are Andrey's from the phone (CR-155 round 1): 600 and
     0.56, a little larger than the rest of the game's font, taken down to 0.55 because at 0.56 the
     descender of "ç" came 0.89 px over a slot's 1 px underline (1.01 px at 0.55). A heavier or a
     larger letter is tried here. */
  --written-weight: 600;
  --written-adjust: 0.55;
  /* The room under the last line of a box that clips a text in one of the two faces (a two- or
     three-line clamp of a tile or a caption), so its descenders are drawn whole. Source Sans 3's
     glyph box is 1.42 em, far taller than its lines, but its ink is what a clip can cut: "p" reaches
     0.21 em under the baseline, at --hand-adjust about 0.05 em short of the bottom of a line of
     1.2 em, so the room is a margin for the marks under a letter and for the hand font. Such a box
     takes the room as its own padding and gives it back in its margin, so nothing around it moves
     (round 1). */
  --hand-room: 0.12em;
  /* The page (CR-63 round 3): a light blue-grey of the accent's hue family, OKLCH L 0.75,
     C 0.023, H 266. A new light page stays in the family: hue 255 to 270, chroma 0.02 to 0.03,
     lightness 0.72 to 0.78. */
  --bg: #a8afbe;
  /* Text and icons that lie on the page itself, not on a card: --page-text for what must be read,
     --page-muted for the secondary. --text, --muted and --accent are for cards (the surfaces).
     --page-muted is darker than the cards' --muted, which gives only 2.2:1 on this page. */
  --page-text: #1c1f24;
  --page-muted: #3c4049;
  /* Verdict colours for text on the page (Type's finished and revealed letters, CR-63 round 4):
     the cards' green and red darkened to read on it. On cards --ok and --bad stay. */
  --page-ok: color-mix(in oklab, var(--ok), black 35%);
  --page-bad: color-mix(in oklab, var(--bad), black 35%);
  /* The sheet (CR-64): the words screen lies on a dark base of the page's family (OKLCH L 0.41,
     C 0.05, H 266, CR-64 round 1), over a glass that blurs the page (CR-66 round 13), the one sharp
     thing on the screen. Everything on it derives from --sheet-bg; the page's and the cards'
     tokens never appear on it. */
  --sheet-bg: #3e4c70;
  /* The sheet's 1 px light edge, with its shadow. */
  --sheet-edge: rgba(255, 255, 255, 0.12);
  /* The separators between the rows of the list's group. */
  --sheet-line: rgba(255, 255, 255, 0.08);
  /* The base of the rows, the search field and the tabs' track. */
  --sheet-surface: color-mix(in srgb, white 14%, var(--sheet-bg));
  --sheet-text: rgba(255, 255, 255, 0.92);
  --sheet-muted: rgba(255, 255, 255, 0.62);
  /* Far fainter than muted, which lights the passed flowers: the unlit flowers of a learned row's
     ladder (CR-89 round 1). */
  --sheet-dim: rgba(255, 255, 255, 0.12);
  /* GLASS_BLUR (CR-66 round 13): the radius of the blur under an open sheet, the knob if it feels
     too strong or too weak. */
  --glass: 14px;
  /* The hint sticker's glass (CR-109, SPEC 5.34): lighter than the sheets', so the screen the
     sticker explains stays readable under it. */
  --glass-hint: 3px;
  /* The hint sticker's paper (CR-109): a post-it yellow, the one colour outside the palette, on
     the stickers and nothing else (DESIGN.md "Colour"). Round 5: the note's yellow with the cards'
     light, from the top left as --surface-plain; the button stays flat on --hint-button. Round 6:
     the light's span halved, so the button stays darker than the paper on a tall note. */
  --hint-bg-from: #fffad0;
  --hint-bg-to: #fdefa6;
  --hint-bg: linear-gradient(135deg, var(--hint-bg-from), var(--hint-bg-to));
  /* The note's yellow deepened (CR-109 round 1): the stickers' button alone, in the note's own
     palette, since the blue pill fought the yellow. */
  --hint-button: #f1cf5c;
  /* A state's tint over the sheet surface, the chosen tab's alone (CR-64 round 2): 22%, because 10%
     vanishes on a dark base (the knob). */
  --sheet-tint: 22%;
  /* The state colours lightened for text and borders on the dark base. */
  --sheet-learned: color-mix(in oklab, var(--flower-10), white 25%);
  --sheet-known: color-mix(in oklab, var(--known), white 30%);
  --sheet-learning: color-mix(in oklab, var(--flower-2), white 20%);
  /* The sheet as a window (CR-66 round 1): the title bar a shade darker than the sheet with a
     darker line under it; a section's head plate, lighter than the sheet, darker than the surface;
     a text field sunk into the sheet with a light border all round. Since CR-66 round 3 the bar is
     the sheet's own colour with a light hairline, as platform sheets have it: a darker fill with a
     dark line read as a bevel. */
  --sheet-bar: var(--sheet-bg);
  --sheet-bar-line: var(--sheet-line);
  --sheet-plate: color-mix(in srgb, white 7%, var(--sheet-bg));
  --sheet-field: color-mix(in srgb, black 18%, var(--sheet-bg));
  --sheet-field-edge: rgba(255, 255, 255, 0.22);
  --sheet-field-focus: rgba(255, 255, 255, 0.45);
  /* The light sheets' body (the acknowledgment, the install sheet; CR-100 round 2): white with the
     page colour at 20%, a card's lower-corner tone, since plain white was harsh. The knob. */
  --sheet-light-bg: color-mix(in oklch, var(--surface), var(--bg) 20%);
  /* The accent lightened for the dark base, as --sheet-known is: on a sheet it means a link,
     tappable; and a link row's fill. The only way the accent reaches a sheet. */
  --sheet-accent: color-mix(in oklab, var(--accent), white 35%);
  --sheet-link: color-mix(in srgb, var(--accent) 14%, var(--sheet-surface));
  /* The list tier (CR-66 round 2): the lists are quieter than the buttons. Buttons and cards on
     --sheet-surface (white 14%), lists on --sheet-surface-low (10%), plates on --sheet-plate (7%);
     the rows' primary text and kind icons at white 80%. The home screen does not use
     --sheet-surface-low (CR-139): its rows of lists are on --sheet-plate, its buttons on
     --home-tile. */
  --sheet-surface-low: color-mix(in srgb, white 10%, var(--sheet-bg));
  /* The home screen's buttons (CR-129 round 1, CR-139): the open tile of the tiles row (the idle
     ones are on --sheet-surface, CR-139 round 1) and the idle half of the tabs. A section's head
     has no surface and its picture no tile (CR-139). */
  --home-tile: color-mix(in srgb, white 10%, var(--sheet-surface));
  /* An empty row of the Catalog, dimmed whole: it cannot be had (CR-137 round 1). */
  --home-dim: 0.4;
  /* The strength of the gradient under the words that wait for a review, the faded tail of a
     progress stretch (CR-144, DESIGN.md); Andrey tunes it. */
  --home-progress-faded: 0.35;
  /* The home screen's lists (CR-139 round 2, DESIGN.md): every row a card of its own. Its radius on
     all four corners, the tiles' radius. */
  --home-list-radius: 10px;
  /* The gap between two rows, where the base shows through instead of a line; wide enough to part
     the cards, narrow enough to keep them one list. */
  --home-list-gap: 3px;
  /* The pinned stack (CR-140, SPEC 5.1): the tabs pin this far under the body's visible top, the
     levels row and the tiles this far under the part above them; the backing reaches the same gap
     under the lowest pinned part. The tabs' and the levels row's heights are fixed, so the sticky
     tops below are sums of these. */
  --home-pin-top: 8px;
  --home-pin-gap: 12px;
  --home-tabs-h: 44px;
  --home-levels-h: 48px;
  /* A window that opens from the stack (the languages panel, the levels editor) over the lists: a
     drop shadow under it and at its sides, none above its top edge (the head row and the tabs over
     it stay as they are), so it parts from tiles of its own tone. */
  --home-window-shadow: 0 12px 16px -4px rgba(0, 0, 0, 0.3);
  --sheet-text-low: rgba(255, 255, 255, 0.8);
  /* The statuses, by ticket systems and messengers: Sent grey (quieter than the excerpt), Viewed
     the accent's blue (the two ticks), Replied lilac (answered, mentioned), In progress the
     learning orange, Done the learned green. The Delete strip in the cards' red, as the words
     screen's strips keep the cards' colours. */
  --sheet-faint: rgba(255, 255, 255, 0.5);
  --sheet-replied: color-mix(in oklab, color-mix(in oklch, var(--accent), var(--flower-1) 35%), white 30%);
  --sheet-delete: var(--bad);
  /* Red text and borders on the dark base: destructive actions (the report view's Delete). */
  --sheet-bad: color-mix(in oklab, var(--bad), white 25%);
  /* White at 90% over the page, opaque; the level tints mix over it. */
  --surface: #f6f7f9;
  /* The light on every card (CR-84, CR-85; DESIGN.md): from the top left, as the shadow falls
     down. A card that carries no state is on --surface-plain itself; a card that shows a state
     has its level tint laid over it. Buttons stay on the flat --surface. */
  --surface-plain-from: #f5f6f8;
  --surface-plain-to: #e2ebff;
  --surface-plain: linear-gradient(135deg, var(--surface-plain-from), var(--surface-plain-to));
  --text: #1c1f24;
  --muted: #6b7280;
  /* The empty place of the picture card (SPEC 5.43, CR-145): the cards' muted grey at half
     strength, the one dashed line of the app, "bring it here". */
  --slot-line: color-mix(in srgb, var(--muted) 50%, transparent);
  --line: rgba(20, 30, 50, 0.12);
  --accent: #2f6fde;
  --accent-text: #ffffff;
  --shadow: 0 8px 24px rgba(20, 30, 50, 0.12), 0 2px 6px rgba(20, 30, 50, 0.08);
  --shadow-soft: 0 4px 12px rgba(20, 30, 50, 0.06), 0 1px 3px rgba(20, 30, 50, 0.04);
  /* A taped note's shadow (CR-151): its upper edge lies flat, stuck down, its lower
     edge a little in the air, so the shadow shows under the lower edge only (the negative spread
     keeps it inside the outline at the top and the sides). The first length is how far down, the
     third with its minus how narrow. The word's card; --shadow-note-soft the same for the small
     cards: the tiles, the options, Match's cards. A card in the hand casts the full --shadow
     (.drag-ghost). Both are composed in the rule beside the notes' (".paper-card, ..." under the
     tokens), where a note's own --lift is read. */
  /* How much the depth of a note's shadow differs from note to note (CR-156), as a
     share of today's: a note's --lift (-1 to 1, RTW.paper.lay) times this makes every length of
     its shadow 1 + lift * range of today's and every alpha 1 - lift * range / 2, so a note further
     off the page casts a longer, softer shadow. 0 gives every note today's shadow. */
  --lift-range: 0.3;
  /* The place a dragged card left (CR-151): fainter and thinner than --slot-line, which says
     "bring it here". */
  --place-line: color-mix(in srgb, var(--page-text) 22%, transparent);
  /* Half the soft shadow's spread and blur: Type's hint button, present but not calling. */
  --shadow-hint: 0 2px 6px rgba(20, 30, 50, 0.04), 0 1px 2px rgba(20, 30, 50, 0.03);
  --ok: #1f9d55;
  --bad: #d7263d;
  --arrow: 48px;
  /* The widest deck, in the modes that take the full width; the bottom row matches it. */
  --deck-wide: 520px;
  /* The board's widest (CR-112): the home screen's column (SPEC 5.1), so a tablet shows the
     phone's layout centred; on a phone the stage is narrower and the board takes all of it. */
  --board-max: 520px;
  --bottom: 56px;
  /* The learned pocket's size while a card flies into it (SPEC 5.22); "/ <count>" steps aside
     by half the extra width it gives. */
  --pocket-grow: 1.5;
  /* The pocket's height at rest (64 shows the stitches and the lens best; 56 was the first size),
     its width from the drawing's 480 x 494. Its number, "/ <count>" and the Undo chip derive
     from the height. */
  --pocket-height: 64px;
  --pocket-width: calc(var(--pocket-height) * 480 / 494);
  /* The drawing's greys overridden by id (CR-63 round 4): a denim of the page's hue, darker than
     the page, a touch bluer; the number on the lid white; the creases' stop colour darker than the
     lid (their opacities stay as drawn). Option B of the sheet; the other letters as knobs:
     A #9aa5bc / #8c98b1 / #4a5670 (the number dark), C #6a7a9a / #5a6b8e / #2e3a52,
     D #7384a6 / #5f739b / #33425f (back / lid / line). */
  --pocket-back: #7d8ba8;
  --pocket-lid: #6e7e9d;
  --pocket-line: #3a4660;
  --pocket-count: #ffffff;
  --pocket-crease: #1f2838;
  --gap: 6px;
  --pad: 12px;
  /* The size of a card's word; Type's translation and Pick's captions derive from it. */
  --word-size: clamp(1.6rem, 7vw, 2.4rem);
  /* The Pick tiles' padding: their content's distance from the tile's edge (modes/pick.css). */
  --pick-pad: 12px;
  /* The board inset (SPEC 5.5, CR-147): how far a board that is not crowded starts under the
     stage's top, half a tile of Pick the word by translation (modes/pick-reverse.css), about
     48 px on a 390 px phone. Each board takes it from its spare height only. */
  --board-top: calc(1.2 * var(--word-size) + var(--pick-pad));
  /* The stored side of a word's image; mirrors IMAGE_SIZE in config.php. */
  --image-side: 512px;
  /* The health flower (SPEC 5.21): one base colour per level, red through yellow to green;
     every other colour of the flower and the card's tint is mixed from these. Ten rows, as
     HEALTH_MAX in config-gameplay.php. */
  --flower-1: #F05617;
  --flower-2: #F3831F;
  --flower-3: #F5A325;
  --flower-4: #F7BF2A;
  --flower-5: #F8D72F;
  --flower-6: #F7E130;
  --flower-7: #E4DD2C;
  --flower-8: #C0D524;
  --flower-9: #8CCA19;
  --flower-10: #47BA09;
  /* The level's strength on the word's card (10% before CR-150). */
  --flower-tint: 15%;
  /* Every card a taped note (CR-150): the numbers to turn on
     dev. The corners of every card, tile and note. */
  --card-radius: 5px;
  /* The corners of a picture on a card or a tile, and of the frame drawn for one. */
  --picture-radius: 5px;
  /* The level's strength on a candidate (data-tone, set by the shell). */
  --candidate-tint: 8%;
  /* The largest turn of the word's card, either way. */
  --tilt-card: 1.5deg;
  /* The largest turn of a candidate, either way. */
  --tilt-candidate: 3deg;
  /* The largest turn of a pair card in Match and Match the translations, either way (CR-152). */
  --tilt-pair: 1deg;
  /* The tape's colour, the hint sticker's own. */
  --tape: rgba(255, 255, 255, 0.45);
  /* The hairline around a strip of tape, so it reads over a white card as over the page (CR-155);
     transparent takes it away. */
  --tape-edge: color-mix(in srgb, var(--page-text) 12%, transparent);
  /* The tape of the word's card: its width, its height and how far it stands over the top edge. */
  --tape-card-width: 84px;
  --tape-card-height: 19px;
  --tape-card-over: 9px;
  /* The tape of a candidate: its width, its height and how far it stands over the top edge. */
  --tape-small-width: 46px;
  --tape-small-height: 13px;
  --tape-small-over: 6px;
  /* A word's card that stands still on its board is held by two short tapes, near each quarter of
     its width (CR-154, CR-161 round 1; which boards is pair in PAPER, modes/common.js): each one's
     width and height; they stand --tape-card-over above the top edge as the one tape does. */
  --tape-pair-width: 56px;
  --tape-pair-height: 16px;
  /* By how much a strip may be shorter than its full length (CR-161): each strip is shorter than
     its full width (--tape-card-width, --tape-small-width, --tape-pair-width) by its own share of
     this (RTW.paper.lay, salts 8 and 9 of lib/tilt.js), never longer; 0% gives every strip its full
     length. Its height does not vary: tape from one roll has one width. */
  --tape-length-range: 25%;
  /* The largest turn of a strip against its card, either way (CR-156): a strip turns by its
     --tape-tilt (-1 to 1) times this, about its middle. 0deg lays every strip level. */
  --tape-turn-max: 5deg;
  /* The furthest a strip stands left or right of its place (the card's middle; a quarter and three
     quarters on a card held by two), by its --tape-shift (-1 to 1) times this (CR-156); less on a
     card too narrow beside its corner marks. 0px puts every strip in its place. */
  --tape-shift-max: 8px;
  /* Derived, not to turn: the most a word card's tape can rise above the card's top edge (its
     over, half its width at --tape-turn-max about its middle, the card's turn at its far end,
     --tape-shift-max off the middle), and a candidate's. A card that stands right under the top
     bar moves down by it (CR-150 8). */
  --tape-card-room: calc(var(--tape-card-over) + var(--tape-card-width) / 2 * sin(var(--tape-turn-max)) + (var(--tape-card-width) / 2 + var(--tape-shift-max)) * sin(var(--tilt-card)) + 1px);
  --tape-small-room: calc(var(--tape-small-over) + var(--tape-small-width) / 2 * sin(var(--tape-turn-max)) + (var(--tape-small-width) / 2 + var(--tape-shift-max)) * sin(var(--tilt-candidate)) + 1px);
  /* The level scale of the home screen's Catalog (CR-129, DESIGN.md "Colour"): the flower's palette
     read as a path from beginner to mastery, one fixed colour per level. */
  --level-a1: var(--flower-1);
  --level-a2: var(--flower-3);
  --level-b1: var(--flower-5);
  --level-b2: var(--flower-8);
  --level-c1: var(--flower-9);
  --level-c2: var(--flower-10);
  /* Known words: the learned green shifted toward the accent's blue; the words screen and later
     the sets screen. Not the accent, which means tappable or selected (DESIGN.md, Colour). */
  --known: color-mix(in oklch, var(--flower-10) 45%, var(--accent));
  /* How strong the blue of --known lies over a card, a tile or a button that is aimed at or
     selected (CR-155; 12% while a frame went with it). */
  --aim-tint: 20%;
  --known-tint: color-mix(in srgb, var(--known) var(--aim-tint), transparent);
  /* The verdict drawn on a note (CR-164, RTW.marks): the cross's colours (those inside
     icons/validate-no.svg), named so its ring and Match's miss tint share them; the white contour
     round a mark; the strength a mark rests at after its drawing; the most a sign is turned; how
     strong the cross's red lies over a missed Match card while the cross is lit (0% leaves the
     cross alone). */
  --mark-bad-from: #C8102E;
  --mark-bad-mid: #E0331F;
  --mark-bad-to: #F05617;
  --mark-halo: #fff;
  --mark-rest: 60%;
  --mark-fade: 1300ms;
  --mark-turn-max: 6deg;
  --miss-tint: 40%;
  /* The flower at rest is mixed this much of itself with the surface; its overlay is full. */
  --flower-dim: 60%;
  --flower: 44px;
  --flower-grow: 2;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

/* The body is 100% of html, the initial containing block: the whole screen. The insets
   are the body's padding, counted once; nothing below the body takes a viewport-based
   height. In the app installed on iOS the height is the window's, measured by app.js into
   --app-height (CR-66 round 5): WebKit's viewport units have been wrong there in two opposite
   ways, one status bar short with the translucent bar (301108, which the large viewport
   unit once worked around) and one status bar too tall without it (316008, the footer below the edge). app.js
   sets the standalone class only when navigator.standalone is true, so a browser tab, Android
   and desktop keep 100%. */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

html.standalone,
html.standalone body {
  height: var(--app-height, 100%);
}

/* No scrollbar anywhere (SPEC 5.5, CR-102): every scrolling area is touch-scrolled and scrolls
   silently; iOS draws no bar at rest, Android Chrome draws an overlay one that sits inside a
   card like a crack. Chrome honours scrollbar-width before the WebKit pseudo-element, so the
   debug panel (5.17), which keeps its bars for a desktop, is left out of both rules. */
* {
  scrollbar-width: none;
}

:not(.debug, .debug *)::-webkit-scrollbar {
  display: none;
}

.debug,
.debug * {
  scrollbar-width: auto;
}

/* The status-bar plate (CR-66 round 14, as round 3 made it): on the installed app iOS blurs the top
   of the page (the icons' top halves) unless an opaque fixed element lies in the page's top pixels
   (at least 6 px tall, most of the width, at the very edge); the plate is that element. It has
   nothing to do with the status bar's colour, which is the page's anyway. Always shown, no dimmed
   state; under the sheets (9, later in the document), the hint stickers (10) and the modals (11). */
.statusbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top) + 6px);
  z-index: 9;
  background: var(--bg);
  pointer-events: none;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-page);
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Every picture is the game's (CR-158, SPEC 5.5): a long press on it is a press on the card, the
   tile or the button that holds it. iOS otherwise lifts the picture for its own drag and opens
   its menu, and the touch it took never ends for the page. The markup and the scripts also give
   each one draggable="false". */
img {
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Screens: each fills the viewport as a column so only inner parts can scroll. */

.cards,
.sets {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* The containing block of the undo chip, which stands over the footer. */
.cards {
  position: relative;
}

/* Sign-in screen (SPEC 12.4): one centred card in the Cards look. The landing has more text
   than a phone shows at once, so the column scrolls (the page still does not, 5.5). A card
   that fits stays centred; a taller one starts at the top: safe centring where supported,
   the card's auto margins elsewhere. */

.signin {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.signin > .signin-card {
  flex: none;
  margin: auto 0;
}

.signin-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.signin-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.signin-line {
  margin: 0 0 8px;
  color: var(--muted);
}

/* A link drawn as the app's primary pill (the acknowledgment's Agreed). */
.signin-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

/* The removed "Already invited?" heading's 8 px stays above the Google button (12.4); the
   maintenance card's retry button follows a .signin-line and keeps its place. */
.signin-text + .signin-button {
  margin-top: 8px;
}

.signin-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.signin-error {
  margin: 0;
  font-size: 14px;
  color: var(--bad);
}

/* The landing's text sits left inside the centred card; the title and the button stay centred. */
.signin-list {
  margin: 0;
  padding: 0 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}

/* The short dash marker of the landing's lists, shared with the acknowledgment's (5.20). */
.signin-dashes,
.ack-list {
  list-style: none;
}

.signin-dashes > li::before,
.ack-list > li::before {
  content: "-";
  display: inline-block;
  width: 20px;
  margin-left: -20px;
}

/* Dark and bold since CR-101: the muted grey read as whispers next to the text. */
.signin-heading {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

/* A platform's steps under their own heading, when the request's platform is unknown (12.4). */
.signin-subheading {
  margin-top: 8px;
}

.signin-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}

.signin-muted {
  color: var(--muted);
}

.signin-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.signin-install {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Already installed: the steps have nothing to say. The class only matters after a sign-out
   inside the installed app, where the media query applies as well. */
@media (display-mode: standalone) {
  .signin-install {
    display: none;
  }
}

html.standalone .signin-install {
  display: none;
}

/* The home screen (SPEC 5.1, 5.5, DESIGN.md "The home screen"): the sheets' look edge to edge,
   no panel and no bar (CR-97 round 1: a home is not a window). The dark base is the body's own
   colour while it is shown, under the safe areas too, and the status-bar plate's, so the installed
   app's bar is dark with it (app.js puts a fresh plate in at every switch, the layer iOS
   re-samples on, CR-97 round 3); the switch is a jump between screens, never an animation. */
html[data-screen="home"] body,
html[data-screen="home"] .statusbar {
  background: var(--sheet-bg);
}

.home {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* The logo's row (CR-129 round 1): the two corner buttons at its sides, scrolling with the body,
   so nothing rides over the content; they are not part of the pinned stack (CR-140). The buttons stand 10 px
   from the top and the sides at the top of the scroll, as when they lay over the corners: the
   negative margins undo the rest of the body's padding (24 px top, 16 px sides). */
.home-top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: start;
}

/* A pair: 28 px drawings in 44 px hit areas, in the link card's colour (tappable on the dark
   base): the Acknowledgment's document at the left, the circled "?" at the right (the circled
   glyph fills its circle, so it is drawn larger than the bar's open ones). A document, not an
   "i": beside the "?" an "i" reads as a second help. */
.home-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sheet-accent);
}

.home-ack {
  margin-left: -6px;
}

.home-help {
  margin-right: -6px;
  justify-self: end;
}

.home-corner svg {
  display: block;
  width: 28px;
  height: 28px;
}

.home-corner:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

/* The one scrollable area, the logo, the tabs and the account row scrolling with the lists; the
   Catalog's footer stays at the bottom. The 24 px over the logo are the content's, not the body's:
   the body has no top padding, so the sticky tops of the pinned stack count from its visible top
   in every engine (CR-140). The backings reach past its sides and are clipped there, so it never
   scrolls sideways. */
.home-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* At most 520 px of content, centred on a wider page; the footer's box counts its padding. */
.home-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding-top: 24px;
}

.home-footer {
  width: 100%;
  max-width: calc(520px + 32px);
  margin: 0 auto;
}

/* The logo was drawn for the light page; it keeps its colours here. */
.home-logo {
  display: block;
  height: 96px;
  width: auto;
  margin: 0 auto;
}

/* The app's state said once, close under the logo, not baked into the drawing. */
.home-preview {
  margin: 4px 0 20px;
  color: var(--sheet-text-low);
  font-size: 14px;
  text-align: center;
}

.home-status {
  flex: 1;
  justify-content: center;
  color: var(--sheet-muted);
}

.home-status .status-text {
  font-size: 15px;
}

.home-retry {
  border-color: var(--sheet-accent);
  color: var(--sheet-accent);
}

.home-empty {
  margin: 0;
  padding: 24px;
  color: var(--sheet-muted);
  font-size: 15px;
  text-align: center;
}

/* The languages group: the settings sheet's rows; the flag where the timer rows have their icon.
   A flag keeps its own colours (DESIGN.md). */
.home-flag {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

/* The screen's control (CR-129 round 1, CR-139): the languages group with its levels row lies on
   --sheet-surface, a tone of its own between the lists' plate and the buttons' tile (DESIGN.md).
   Since CR-140 the group is two elements, so the levels row can pin: this head part (the head row,
   the group's top corners, the separator at its bottom) and the levels row below (.home-levels, the
   bottom corners); together they draw the group of 0.134.2. The group is .sheet-group too, so the
   rule names the pair to win over it. The head row is clipped to the corners by .home-langs-rows,
   not by the part, so the languages panel (absolute, inside it) is not clipped. z-index 4: over the
   levels row (2), which hides the upward reach of its backing under the head row while it is not
   pinned; under the tabs (5), under which it leaves. */
.sheet-group.home-langs {
  position: relative;
  z-index: 4;
  overflow: visible;
  border-bottom: 1px solid var(--sheet-line);
  border-radius: 14px 14px 0 0;
  background: var(--sheet-surface);
}

.home-langs-rows {
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.home-lang:active,
.home-lang-list .settings-row:active {
  background: color-mix(in srgb, white 4%, var(--sheet-surface));
}

/* One head row in two halves, "I learn" and "I speak", a line between them; the caption small
   above the chosen language. 68 px, the levels editor's height (CR-131 round 1): the group is as
   high with the editor as without. The row sets it, since settings.css comes later and gives
   .settings-row its own minimum. */
.home-lang-heads {
  display: flex;
  height: 68px;
}

.home-lang {
  flex: 1 1 0;
  min-width: 0;
}

.home-lang + .home-lang {
  border-left: 1px solid var(--sheet-line);
}

/* The half whose languages are open in the panel is lit, a step lighter, the tiles' pair (CR-139
   round 2): the list is seen to be its list. The panel clips it to its corner. */
.home-langs-panel .home-lang[aria-expanded="true"] {
  background: var(--home-tile);
}

.home-langs-panel .home-lang[aria-expanded="true"]:active {
  background: color-mix(in srgb, white 4%, var(--home-tile));
}

.home-lang-caption {
  color: var(--sheet-muted);
  font-size: 13px;
}

.home-lang-name {
  color: var(--sheet-text-low);
  font-size: 16px;
}

/* The languages under the panel's head row, full width, read as its children: indented 14 px
   more than the halves, the group's separators. */
.home-lang-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--sheet-line);
  list-style: none;
}

.home-lang-list .settings-row {
  padding-left: 28px;
}

.home-lang-list li + li .settings-row {
  border-top: 1px solid var(--sheet-line);
}

/* The languages panel (CR-140, SPEC 5.1): a window with the group's corners over the content,
   pushing nothing: the head row (the open half lit), that half's list, the levels row last. Inside
   the head part (its top edge on the group's) or, opened from the compact row, inside the levels
   row (its top edge on the row's). The list scrolls inside when the window would reach under the
   body's visible bottom (app.js sets --panel-lists-max). It fades in and out as the levels editor
   does (--panel-swap-ms, from app.js); visibility follows the fade, so a hidden panel takes no
   tap and no focus. */
.home-langs-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--sheet-surface);
  box-shadow: var(--home-window-shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--panel-swap-ms, 120ms) ease-in, visibility 0s linear var(--panel-swap-ms, 120ms);
}

.home-langs-panel.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--panel-swap-ms, 150ms) ease-out, visibility 0s;
}

.home-langs-panel > .home-lang-heads {
  flex: none;
}

.home-langs-panel-lists {
  flex: 0 1 auto;
  min-height: 0;
  max-height: var(--panel-lists-max, none);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* Named with the panel, so it wins over .home-levels-toggle's border, later in this file. */
.home-langs-panel .home-langs-panel-levels {
  flex: none;
  height: calc(var(--home-levels-h) + 1px);
  border-top: 1px solid var(--sheet-line);
}

/* The tabs (CR-129): the words sheet's segmented control (.sheet-tabs); on the home screen the
   chosen half filled with the accent and captioned in the base, the corner "?"'s pair (CR-137
   round 1; the accent tint read as nearly the other half), since these tabs are places, not states.
   The idle half is a button, on --home-tile with its caption in --sheet-text-low (CR-139); the
   track takes the same tone so no other edge shows at the corners. The first thing under the
   logo's line, at the same place on both tabs (CR-131 round 1). */
.sheet-tabs.home-tabs {
  margin: 0;
  background: var(--home-tile);
}

/* The pinned stack (CR-140, SPEC 5.1, DESIGN.md): the tabs' holder, the levels row and (on a
   screen at least 500 px high) the tiles are sticky in the home body; each carries a piece of the
   backing, an opaque strip in the screen's colour from --pin-above over it to --home-pin-top under
   it, reaching past the body's sides (clipped there), so what scrolls passes under the stack and
   the stack's top pixels are the base's, never a control's (iOS takes the status bar's colour from
   them, PROJECT-INSTRUCTIONS). The strip is the holder's own pseudo-element at z-index -1: under
   the holder's children, over what scrolls. No pinned part changes its height. */
.home-pin {
  position: sticky;
}

.home-pin::before,
.home-tiles::before,
#home-section > .home-section-head::before,
.home-mine-block > .home-section-head::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--pin-above));
  bottom: calc(-1 * var(--home-pin-top));
  left: -100vw;
  right: -100vw;
  z-index: -1;
  background: var(--sheet-bg);
  pointer-events: none;
}

/* The tabs pin first, on both tabs; over everything else of the stack (5), so the head row leaves
   under them. */
.home-tabs-pin {
  top: var(--home-pin-top);
  z-index: 5;
  --pin-above: var(--home-pin-top);
}

/* In the Catalog the tabs' backing reaches down to the compact row's place, the whole gap
   (round 1): the head part, which stops inside that gap at the rest position, never shows a line
   or an edge between the tabs and the pinned row. The head row still leaves under the tabs. */
.home-main[data-tab="catalog"] .home-tabs-pin::before {
  bottom: calc(-1 * var(--home-pin-gap));
}

/* At least 24 px between the content and the account row, which the content column pushes to the
   body's bottom while the content is short (.home-account). */
.home-main {
  margin-bottom: 24px;
}

.sheet-tab.home-tab {
  background: var(--home-tile);
  color: var(--sheet-text-low);
}

.home-tab.is-on {
  background: var(--sheet-accent);
  color: var(--sheet-bg);
}

/* A keyboard ring on the accent fill is drawn in the base, so it stays visible. */
.home-tab.is-on:focus-visible {
  outline: 2px solid var(--sheet-bg);
  outline-offset: -4px;
}

.home-panel {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.home-panel[hidden] {
  display: none;
}

/* My lists (CR-131 round 2): a block per section, 28 px apart (CR-139 round 1) so a head belongs
   to the group under it, each the Catalog's open section (.home-section, its head shared) with rows that
   are the user's lists, each row at least 48 px: the title, the progress line, the levels, the bin;
   the language's flag first when the languages are several, 10 px before the title. The start
   sheet's list is a .home-mine too. */
/* The blocks are 28 px apart; the space is the upper block's own content (round 1), an in-flow
   spacer, since a sticky box stops at its block's content box and padding would not count: so a
   block reaches the next one's head and its pinned head is pushed away by that head, not 28 px
   early. */
.home-mine-blocks {
  display: flex;
  flex-direction: column;
}

.home-mine-block:not(:last-child)::after {
  content: "";
  flex: none;
  height: 28px;
}

/* A block's head pins 12 px under the tabs while its lists pass under it (round 1), on every
   screen: sticky inside its block, so the next head pushes it up and away. Its backing reaches up
   only to the tabs' (4 px; so it never covers the head above it as that one leaves) and down over
   the 8 px above its rows. The picture pins with it; nothing in it changes. */
.home-mine-block > .home-section-head {
  position: sticky;
  top: calc(var(--home-pin-top) + var(--home-tabs-h) + var(--home-pin-gap));
  z-index: 2;
  --pin-above: calc(var(--home-pin-gap) - var(--home-pin-top));
}

.home-mine-blocks[hidden] {
  display: none;
}

.home-mine {
  margin: 0;
  padding: 0;
  border-radius: 14px;
  list-style: none;
  overflow: hidden;
}

/* The home screen's three lists as cards (CR-139 rounds 1 and 2, DESIGN.md): the list has no
   surface of its own; every row is a card on the plate, one radius on every corner, clipping its
   content, the base showing in the gaps between rows, no lines. The start sheet's list (a .home-mine outside a block) stays one group with lines. */
.home-mine-block .home-mine,
.sheet-group.home-overview,
.home-section-lists {
  display: flex;
  flex-direction: column;
  gap: var(--home-list-gap);
  border-radius: 0;
  background: none;
  overflow: visible;
}

.home-mine-block .home-mine-row,
.home-overview-item,
.home-list {
  border-radius: var(--home-list-radius);
  background: var(--sheet-plate);
  overflow: hidden;
}

.home-mine-block .home-mine-row + .home-mine-row,
.home-overview-item + .home-overview-item,
.home-list + .home-list {
  border-top: 0;
}

/* The row's control takes the row's shape, so the pressed look and the keyboard ring follow it. */
.home-overview-row,
.home-list-row {
  border-radius: inherit;
}

.home-mine-row {
  display: flex;
  align-items: center;
}

.home-mine-row + .home-mine-row {
  border-top: 1px solid var(--sheet-line);
}

.home-mine-row > a {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  text-decoration: none;
}

.home-mine-row > a:active {
  background: color-mix(in srgb, white 4%, var(--sheet-surface-low));
}

/* On My lists the link and the bin are one surface (CR-139 round 1): the row is pressed and
   ringed whole while its link is. */
.home-mine-block .home-mine-row > a:active {
  background: none;
}

.home-mine-block .home-mine-row:has(> a:active) {
  background: color-mix(in srgb, white 4%, var(--sheet-plate));
}

.home-mine-block .home-mine-row > a:focus-visible {
  outline: none;
}

.home-mine-block .home-mine-row:has(> a:focus-visible) {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

.home-mine-row > a:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

/* The flag's gap is the row's 12 px less 2. */
.home-mine-flag {
  margin-right: -2px;
}

/* The title with the progress line and the list's levels under it; it takes the room up to the
   bin. */
.home-mine-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.home-mine-title {
  color: var(--sheet-text-low);
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The start sheet's count at the right of a row. */
.home-mine-line {
  flex: none;
  color: var(--sheet-muted);
  font-size: 14px;
}

/* The bin of a list's Remove button, with a 44 px hit area. */
.home-remove {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--sheet-muted);
  -webkit-mask: url(icons/bin.svg) center / 20px no-repeat;
  mask: url(icons/bin.svg) center / 20px no-repeat;
}

.home-remove:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

/* The progress line (CR-131 round 2, SPEC 5.1, DESIGN.md): a track 3 px high, 1.5 px corners, in
   the levels rail's tone, 6 px under the title's line; on it the flower's gradient lying over the
   whole track (the gradient is the track's width, 100cqw of it), uncovered from the left as far
   as --done (app.js) and at least 4 px; nothing with no learned word. The words waiting for a
   review are the stretch's right end, --wait of it (app.js) and at least 2 px: a cover in the
   track's tone lets the gradient show at --home-progress-faded there (CR-144). At its right, 10 px away, the
   number, 13 px, tabular figures, its width kept for five digits and the slash so the tracks of a
   block end on one line. */
.home-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.home-progress-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 3px;
  border-radius: 1.5px;
  background: var(--sheet-field);
  overflow: hidden;
  container-type: inline-size;
}

.home-progress-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: max(4px, calc(var(--done, 0) * 100%));
  overflow: hidden;
}

.home-progress.is-empty .home-progress-fill {
  display: none;
}

.home-progress-gradient {
  display: block;
  width: 100cqw;
  height: 100%;
  background: linear-gradient(to right, var(--flower-1) 5%, var(--flower-2) 15%, var(--flower-3) 25%, var(--flower-4) 35%,
    var(--flower-5) 45%, var(--flower-6) 55%, var(--flower-7) 65%, var(--flower-8) 75%, var(--flower-9) 85%, var(--flower-10) 95%);
}

.home-progress-tail {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: max(2px, calc(var(--wait, 0) * 100%));
  background: var(--sheet-field);
  opacity: calc(1 - var(--home-progress-faded));
}

.home-progress-number {
  flex: none;
  min-width: 6ch;
  color: var(--sheet-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
  text-align: right;
}

/* No list yet: two lines, centred. */
.home-mine-empty {
  padding: 24px 16px 8px;
  text-align: center;
}

.home-mine-empty[hidden] {
  display: none;
}

.home-mine-empty-title {
  margin: 0;
  color: var(--sheet-text-low);
  font-size: 16px;
  font-weight: 600;
}

.home-mine-empty-line {
  margin: 6px 0 0;
  color: var(--sheet-faint);
  font-size: 14px;
  white-space: pre-line;
}

/* The levels row (CR-131, SPEC 5.1): the languages group's last row, under the head part's
   separator, on its surface: the toggle, the caption "Word levels" at the left, the six levels as
   small chips at the right (the range lit in its level colours) and a chevron. It says "Word
   levels", not "My level": it filters words. Since CR-140 it is an element of its own and pins
   12 px under the tabs; pinned, it is the compact row: a bar with the group's corners on all four
   sides (app.js sets is-pinned), the two flags in the caption's place, a 150 ms cross-fade, none
   under reduced motion. Its height never changes. z-index 2, under the head part (4) while it is
   not pinned; 6 while a window it holds is open (is-open), over the tabs and the tiles; then its
   backing does not reach up over the head row. The windows are its children, so it does not clip. */
.home-levels {
  top: calc(var(--home-pin-top) + var(--home-tabs-h) + var(--home-pin-gap));
  z-index: 2;
  height: var(--home-levels-h);
  margin-bottom: var(--home-pin-gap);
  border-radius: 0 0 14px 14px;
  --pin-above: var(--home-pin-gap);
  --pin-swap-ms: 150ms;
}

.home-levels.is-pinned {
  border-radius: 14px;
}

.home-levels.is-open {
  z-index: 6;
}

.home-levels.is-open:not(.is-pinned)::before {
  top: 0;
}

.home-levels[hidden] {
  display: none;
}

/* The toggle on the group's surface: the row's own (its corners the row's), the panel's last row
   and the editor's lower line. */
.home-levels-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 8px 10px 8px 14px;
  border: 0;
  background: var(--sheet-surface);
  font: inherit;
  text-align: left;
}

.home-levels > .home-levels-toggle {
  height: 100%;
  border-radius: inherit;
}

/* The caption and the flags share the caption's place and cross-fade when the row pins or leaves;
   the hidden one takes no tap and is out of the accessibility tree (visibility follows the fade). */
.home-levels > .home-levels-toggle .home-levels-caption,
.home-levels-flags {
  transition: opacity var(--pin-swap-ms) ease-out, visibility 0s;
}

.home-levels.is-pinned > .home-levels-toggle .home-levels-caption,
.home-levels:not(.is-pinned) .home-levels-flags {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--pin-swap-ms) ease-in, visibility 0s linear var(--pin-swap-ms);
}

@media (prefers-reduced-motion: reduce) {
  .home-levels {
    --pin-swap-ms: 0ms;
  }
}

/* The compact row's flags (CR-140): the head row's flags, 24 px, 8 px apart, the first where the
   caption starts (14 px in); each button 32 px wide (4 px either side of the flag) and 44 px high,
   its hit area reaching 12 px further out on its outer side, so each is 44 px square and the two
   meet midway between the flags. Over the toggle, which takes the rest of the row. With room for
   both (app.js sets has-captions, round 1) each flag has its short caption 6 px after it inside its
   button, and the first button ends 8 px after its caption, so the caption and the second flag are
   12 px apart; without room neither caption shows. */
.home-levels-flags {
  position: absolute;
  top: calc((var(--home-levels-h) - 44px) / 2);
  left: 10px;
  z-index: 1;
  display: flex;
}

.home-levels-flag {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
}

/* Out of the flow and unseen until both fit; it keeps its width there, so app.js can measure it. */
.home-levels-flag-caption {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  color: var(--sheet-muted);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}

.home-levels-flags.has-captions .home-levels-flag-caption {
  position: static;
  visibility: inherit;
}

.home-levels-flags.has-captions .home-levels-flag:first-child {
  padding-right: 8px;
}

.home-levels-flag::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.home-levels-flag:first-child::before {
  left: -12px;
}

.home-levels-flag:last-child::before {
  right: -12px;
}

.home-levels-flag:focus {
  outline: none;
}

.home-levels-flag:focus-visible .home-flag {
  outline: 2px solid var(--sheet-accent);
  outline-offset: 2px;
}

.home-levels-toggle:active {
  background: color-mix(in srgb, white 4%, var(--sheet-surface));
}

.home-levels-toggle:focus {
  outline: none;
}

.home-levels-toggle:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

.home-levels-caption {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--sheet-muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-levels-chips {
  flex: none;
  display: flex;
  gap: 2px;
}

/* A chip: 11 px letters, 5 px corners; in the range its colour in full with the cards' dark text,
   outside the sunken field's fill with the faint text (DESIGN.md, the level scale). */
.home-levels-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 20px;
  border-radius: 5px;
  background: var(--sheet-field);
  color: var(--sheet-faint);
  font-size: 11px;
  font-weight: 600;
}

.home-levels-chip.is-lit {
  background: var(--level);
  color: var(--text);
  font-weight: 700;
}

/* A chip is a way in to its level (CR-135): its hit area is the row's full height (48 px, the chip
   20 px in its middle) and reaches half way to its neighbours (the 2 px gap), its look unchanged. */
.home-levels-chip::before {
  content: "";
  position: absolute;
  top: -14px;
  bottom: -14px;
  left: -1px;
  right: -1px;
}

.home-levels-chevron {
  flex: none;
  width: 18px;
  height: 18px;
  background-color: var(--sheet-faint);
  -webkit-mask: url(icons/chevron-right.svg) center / contain no-repeat;
  mask: url(icons/chevron-right.svg) center / contain no-repeat;
  transition: rotate var(--levels-swap-ms, 120ms) ease-out;
}

/* Every level's colour, one place: the chips, the editor's buttons, the rows' letters, the remove
   dialog's levels. */
[data-scale="a1"] { --level: var(--level-a1); }
[data-scale="a2"] { --level: var(--level-a2); }
[data-scale="b1"] { --level: var(--level-b1); }
[data-scale="b2"] { --level: var(--level-b2); }
[data-scale="c1"] { --level: var(--level-c1); }
[data-scale="c2"] { --level: var(--level-c2); }

/* The levels editor (CR-131 round 1, SPEC 5.1, MOTION.md 16): since CR-140 a window that opens
   downward from the levels row, its top edge on the row's, as wide, with the group's corners, over
   the tiles and the lists, pushing nothing. Its upper part holds the level buttons and the track
   (68 px, as before); under a separator its lower part is the levels row's own line: the caption,
   All levels where the chips were, the chevron turned up. Over the compact row it covers the flags.
   It fades in over 150 ms and out over 120 ms (app.js sets --levels-swap-ms, 0 for reduced motion
   and a quiet close); visibility follows the fade, so a hidden editor takes no tap and no focus. */
.levels-editor {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: calc(68px + 1px + var(--home-levels-h));
  border-radius: 14px;
  background: var(--sheet-surface);
  box-shadow: var(--home-window-shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--levels-swap-ms, 120ms) ease-in, visibility 0s linear var(--levels-swap-ms, 120ms);
}

.home-levels.is-editing .levels-editor {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--levels-swap-ms, 150ms) ease-out, visibility 0s;
}

.levels-editor-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--home-levels-h) + 1px);
  border-top: 1px solid var(--sheet-line);
}

.levels-editor-line > .home-levels-toggle {
  height: 100%;
  border-radius: 0 0 14px 14px;
}

.levels-editor-line .home-levels-chevron {
  rotate: -90deg;
}

/* The buttons are hit areas larger than what is seen, drawn by ::before, 28 px high. No ring after
   a tap: :focus-visible alone draws it. */
.home-level-all,
.home-level-button {
  isolation: isolate;
  height: 44px;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.home-level-all::before,
.home-level-button::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  bottom: 8px;
  z-index: -1;
}

.home-level-all:focus-visible,
.home-level-button:focus-visible {
  outline: none;
}

.home-level-all:focus-visible::before,
.home-level-button:focus-visible::before {
  outline: 2px solid var(--sheet-accent);
  outline-offset: 1px;
}

/* All levels: a pill, 28 px high, where the chips are (the chevron's 18 px, the gap and the row's
   10 px right of it); on (the full stretch), the tabs' chosen look; off, a 1 px border in the muted
   tone and the muted text. Over the toggle, which takes the rest of the row. */
.home-level-all {
  position: absolute;
  top: 50%;
  right: 34px;
  z-index: 1;
  translate: 0 -50%;
  padding: 0 12px;
  color: var(--sheet-muted);
}

.home-level-all::before {
  border: 1px solid color-mix(in srgb, var(--sheet-muted) 60%, transparent);
  border-radius: 14px;
}

.home-level-all[aria-pressed="true"] {
  color: var(--sheet-accent);
  font-weight: 700;
}

.home-level-all[aria-pressed="true"]::before {
  border-color: transparent;
  background: color-mix(in srgb, var(--sheet-accent) var(--sheet-tint), var(--sheet-surface));
}

/* The six levels sharing the row, 4 px apart, seen 6 px under the group's top; their hit areas run
   from 8 px over the group's edge to midway to the thumbs (44 px). The letter is centred on the
   drawn box, not on the hit area: the 12 px top padding is the box's offset less its bottom inset
   (round 2). In the range its colour in full
   with the cards' dark text, bold; outside the sunken field's fill with the faint text. */
.levels-buttons {
  position: absolute;
  top: -8px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
}

.home-level-button {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 0 0;
  color: var(--sheet-faint);
}

.home-level-button::before {
  top: 14px;
  bottom: 2px;
  border-radius: 7px;
  background: var(--sheet-field);
}

.home-level-button[aria-pressed="true"] {
  color: var(--text);
  font-weight: 700;
}

.home-level-button[aria-pressed="true"]::before {
  background: var(--level);
}

/* The track under the buttons: its hit area from midway under them down to the levels row (32 px);
   the rail 4 px in the sunken field's tone, the stretch between the thumbs in --sheet-accent; the
   thumbs 22 px discs in --sheet-text with a 2 px --sheet-accent edge, 6 px over the levels row,
   in 44 px wide hit areas, at the six levels' centres (the rail runs from the first button's
   centre to the last's). A dragged thumb follows the finger; released, it snaps to its level in
   120 ms. */
.levels-track {
  position: absolute;
  top: 36px;
  left: calc(14px + (100% - 48px) / 12);
  right: calc(14px + (100% - 48px) / 12);
  height: 32px;
  touch-action: none;
}

.levels-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 13px;
  height: 4px;
  border-radius: 2px;
  background: var(--sheet-field);
}

.levels-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--from, 0) * 100%);
  right: calc((1 - var(--to, 1)) * 100%);
  border-radius: 2px;
  background: var(--sheet-accent);
}

.levels-thumb {
  position: absolute;
  top: 0;
  left: calc(var(--at, 0) * 100% - 22px);
  width: 44px;
  height: 32px;
  transition: left 120ms ease-out;
  cursor: grab;
}

.levels-thumb.is-dragging {
  transition: none;
  cursor: grabbing;
}

.levels-thumb::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  border: 2px solid var(--sheet-accent);
  border-radius: 50%;
  background: var(--sheet-text);
}

.levels-thumb:focus {
  outline: none;
}

.levels-thumb:focus-visible::before {
  outline: 2px solid var(--sheet-accent);
  outline-offset: 2px;
}

/* The Catalog's tiles (CR-131): one row of equal tiles, 6 px apart, the round 1 tile (the picture
   fitted, 10 px corners; idle on --sheet-surface, the controls' tone, the open one a step lighter
   on --home-tile, CR-139 round 1), no captions; a row wraps when the sections are more
   than fit at 40 px each. The open tile has a 2 px --sheet-accent ring outside its edge; the
   ticked look stands inside it. The tiles never reorder. */
.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 6px;
  margin: 0 0 12px;
  padding: 2px;
}

/* The tiles pin under the compact row (CR-140, SPEC 5.1) on a screen at least 500 px high, every
   phone held upright, the small ones and a Safari tab included (round 2: under 700 px a tab of
   about 660 px left the tiles half scrolled under the compact row). The threshold is only the guard
   for a phone on its side (about 390 px high), where the stack and the footer would leave the list
   one row: there they scroll away with the lists. The one place of the value is the media query
   below (a media query takes no custom property). z-index 3: over the levels row's lower
   backing, so the open tile's ring and the focus ring are never cut. Without the pin the backing
   strip is not drawn. */
.home-tiles::before {
  display: none;
}

/* The open section's head (round 1): pinned under the tiles, 8 px under them, on the same screens;
   its top waits for the tiles' height, which app.js keeps in --home-tiles-h (it depends on the
   width and the number of sections). Its backing reaches up to the tiles' and down over the 8 px
   above its rows. z-index 2: under the tiles (3), so the open tile's ring and the focus ring are not
   cut. Its look and height are those of the flow. */
#home-section > .home-section-head::before {
  display: none;
}

@media (min-height: 500px) {
  #home-section > .home-section-head {
    position: sticky;
    top: calc(var(--home-pin-top) + var(--home-tabs-h) + var(--home-pin-gap) * 2 + var(--home-levels-h) + var(--home-tiles-h, 0px) + var(--home-pin-top));
    z-index: 2;
    --pin-above: var(--home-pin-top);
  }

  #home-section > .home-section-head::before {
    display: block;
  }

  .home-tiles {
    position: sticky;
    top: calc(var(--home-pin-top) + var(--home-tabs-h) + var(--home-pin-gap) * 2 + var(--home-levels-h));
    z-index: 3;
    --pin-above: var(--home-pin-gap);
  }

  .home-tiles::before {
    display: block;
  }
}

.home-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-width: 0;
  margin: 0;
  padding: 1px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--sheet-surface);
  color: var(--sheet-muted);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
}

.home-tile.is-chosen {
  border-color: var(--sheet-learned);
  background: color-mix(in srgb, var(--flower-10) var(--sheet-tint), var(--sheet-surface));
}

.home-tile.is-open {
  background: var(--home-tile);
  box-shadow: 0 0 0 2px var(--sheet-accent);
}

/* The ticked look of the open tile, mixed over its own lighter ground. */
.home-tile.is-open.is-chosen {
  background: color-mix(in srgb, var(--flower-10) var(--sheet-tint), var(--home-tile));
}

.home-tile:focus {
  outline: none;
}

.home-tile:focus-visible {
  outline: 2px solid var(--sheet-text);
  outline-offset: 5px;
}

/* A section's progress on its tile (CR-135, DESIGN.md): a track 3 px high, 6 px in from the tile's
   sides and 5 px over its bottom edge (the 2 px border counted), 1.5 px corners, the list's
   gradient uncovered from the left as far as --done (app.js); none with nothing learned. It lies
   over the picture, so the tile's size and the picture's place never change. */
.home-tile-progress {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 3px;
  border-radius: 1.5px;
  background: var(--sheet-field);
  overflow: hidden;
  container-type: inline-size;
  pointer-events: none;
}

.home-tile img,
.home-section-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The open section and a My lists block (CR-139): a head that takes no taps on the screen's base,
   no surface, then the card of its rows 8 px under it. In the Catalog the head has no picture (the
   open tile above is the picture; the markup's tile is hidden), on My lists it has one with no
   tile under it. */
.home-section {
  display: flex;
  flex-direction: column;
}

.home-section[hidden] {
  display: none;
}

.home-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.home-section-tile {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 2px;
  border-radius: 12px;
  color: var(--sheet-muted);
  font-size: 26px;
  font-weight: 700;
  overflow: hidden;
}

.home-section-tile[hidden] {
  display: none;
}

/* A section without a picture shows its letter on a tile, the buttons' tone (CR-139). */
.home-section-tile.is-letter {
  background: var(--home-tile);
}

.home-section-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-section-title {
  color: var(--sheet-text);
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* One height in both its forms: one line at a fixed line height, fitted down to 11 px by the
   script (RTW.fitText) when it is too long, cut at the end only below that. */
.home-section-line {
  color: var(--sheet-muted);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A section's picture in the ticked look, as a ticked tile of the row, mixed over the overview
   row's plate: the one state in which a picture takes a tile outside the tiles row (CR-139). */
.home-section-tile.is-chosen {
  border: 2px solid var(--sheet-learned);
  padding: 0;
  background: color-mix(in srgb, var(--flower-10) var(--sheet-tint), var(--sheet-plate));
}

/* A head over its card (CR-139): on the base, its content 4 px in from the card's left edge, the
   card 8 px under it. */
.home-section > .home-section-head {
  margin-bottom: 8px;
  padding: 0 4px;
}

/* An overview row's names line (CR-136, DESIGN.md): the section's lists by their short names,
   three lines at most with an ellipsis beyond. */
.home-section-names {
  display: -webkit-box;
  color: var(--sheet-muted);
  font-size: 13px;
  line-height: 18px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* The progress line in a section's head: the list's, 4 px under the line. */
.home-section-text > .home-progress {
  margin-top: 4px;
}

/* The Catalog's overview (CR-135, SPEC 5.1, DESIGN.md): one block, a row per section, each the open
   section's head as a button with a chevron at its right in --sheet-muted; rows at least 84 px,
   each row a card on --sheet-plate (CR-139 round 2, above), the head inside it transparent
   so the pressed look reaches it. */
.home-catalog-view[hidden] {
  display: none;
}

.home-overview {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-overview-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 84px;
  margin: 0;
  padding: 0 12px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.home-overview-row > .home-section-head {
  flex: 1 1 auto;
  min-width: 0;
  align-items: flex-start;
  background: transparent;
}

.home-overview-row:active {
  background: color-mix(in srgb, white 4%, var(--sheet-plate));
}

.home-overview-row:focus {
  outline: none;
}

.home-overview-row:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

.home-overview-chevron {
  flex: none;
  width: 18px;
  height: 18px;
  background-color: var(--sheet-muted);
  -webkit-mask: url(icons/chevron-right.svg) center / contain no-repeat;
  mask: url(icons/chevron-right.svg) center / contain no-repeat;
}

/* The change of view is a swap in place: the view coming in fades in (app.js sets
   --catalog-swap-ms); nothing under reduced motion. */
.home-catalog-view.is-entering {
  animation: home-view-in var(--catalog-swap-ms, 150ms) ease-out;
}

@keyframes home-view-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-catalog-view.is-entering {
    animation: none;
  }
}

/* The chosen numbers of a line and a ticked row's words: the learned green. */
.home-chosen {
  color: var(--sheet-learned);
}

/* The open section's rows: each a card (CR-139 round 2, above). */
.home-section-lists {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Positioned, so the row's hidden checkbox (.sheet-check, absolute) lies in the row and scrolls in
   the body: with .home as its containing block it lay outside the scrolling body, and focusing it
   on a tap scrolled the page itself, moving the whole screen, the pinned stack with it (CR-140). */
.home-list-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  cursor: pointer;
}

/* A pressed row: white 4% over the plate (CR-139). */
.home-list-row:active {
  background: color-mix(in srgb, white 4%, var(--sheet-plate));
}

.home-list-row .sheet-box {
  margin-top: 1px;
}

.home-list-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.home-list-title {
  color: var(--sheet-text-low);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.home-list-count {
  color: var(--sheet-muted);
  font-size: 13px;
}

/* The words an add would bring, the number the range changes: in the title's colour, the rest
   of the count muted (CR-138); ticked it is .home-chosen. */
.home-list-free {
  color: var(--sheet-text-low);
}

/* The row's number semibold in both its states, so a tick does not change the line's width
   (CR-138 round 1); the green numbers of the section lines keep their weight. */
.home-list-count > .home-list-free,
.home-list-count > .home-chosen {
  font-weight: 600;
}

.home-list-description {
  display: -webkit-box;
  margin: 2px 0 0;
  color: var(--sheet-faint);
  font-size: 12px;
  line-height: 16px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* The six levels of a row (a list's and, ticked, the range's), letters alone, 12 px, 6 px apart,
   no fill: a lit one in its level colour, semibold; the rest in --sheet-faint. 5 px under the
   description; the same under a My lists title. */
.home-levels-line {
  display: flex;
  gap: 6px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 14px;
}

/* A My lists row's review count (CR-144, DESIGN.md): the review mark, 12 px, and the waiting
   words, 4 px apart, at the right end of the levels' line, so its right edge is the progress
   number's above it; --sheet-muted with words waiting, --sheet-faint at 0. */
.home-review {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--sheet-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.home-review.is-zero {
  color: var(--sheet-faint);
}

.home-review-mark {
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask: url(icons/review.svg) center / 12px no-repeat;
  mask: url(icons/review.svg) center / 12px no-repeat;
}

.home-levels-letter {
  color: var(--sheet-faint);
}

.home-levels-letter.is-lit {
  color: var(--level);
  font-weight: 600;
}

/* An added or empty row takes no taps; the box disabled. An empty row is dimmed whole, its box
   included, on the row's content, so its surface stays (CR-137 round 1): it
   cannot be had. An added row is a state, not a control (CR-129 round 1): the brushed check without its
   box, the title in the learned green, nothing dimmed. */
.home-list.is-dim .home-list-row,
.home-list.is-added .home-list-row {
  cursor: default;
}

.home-list.is-added .sheet-check + .sheet-box {
  border-color: transparent;
}

.home-list.is-added .home-list-title {
  color: var(--sheet-learned);
}

.home-list.is-added .home-list-count {
  color: var(--sheet-muted);
}

/* The end of an added row's accessible name, not shown. */
.home-list-added {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.home-list.is-dim .home-list-row > * {
  opacity: var(--home-dim);
}

/* The Catalog's footer: a line that keeps its height, and Start learning, the feedback sheet's
   Send at 48 px, full width, on the sheet surface, in the learned green. */
.home-footer[hidden] {
  display: none;
}

.home-start-line {
  height: 18px;
  margin: 0 0 8px;
  color: var(--sheet-muted);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-start-line.is-error {
  color: var(--sheet-bad);
}

.home-start {
  width: 100%;
  height: 48px;
}

/* The account row, the screen's bottom line (CR-131 round 1): the content column fills the body's
   height, so the auto margin puts the row at the body's bottom while the content is short; once it
   is longer, the row is the last thing in the scroll. Never pinned. */
.home-account {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: auto 0 0;
  padding: 0 0 0 14px;
}

.home-account-name {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--sheet-muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The version right after the name; the note takes the room up to the button. Five taps on it
   open the reset page (SPEC 5.19), a hidden way in, so it does not look tappable. */
.home-account-version {
  flex: none;
  cursor: default;
  color: var(--sheet-faint);
  font-size: 13px;
}

.home-account-note {
  flex: 1;
  color: var(--sheet-bad);
  font-size: 14px;
  text-align: right;
}

.home-account-button {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--sheet-accent);
  font-size: 16px;
  font-weight: 600;
}

.home-account-button:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

/* The start sheet (CR-129, SPEC 5.1): a bottom sheet over the home screen, since its opener is at
   the bottom: 10 px in from the sides and the bottom, as tall as its content, its list scrolling
   inside when the lists are many. Its rows are the My lists rows without the bin. */
.start.sheet {
  top: auto;
  bottom: calc(10px + env(safe-area-inset-bottom));
  max-height: calc(100% - var(--sheet-top, 10px) - 20px - env(safe-area-inset-bottom));
}

.start-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.start-note {
  margin: 8px 0 0;
  color: var(--sheet-faint);
  font-size: 13px;
  text-align: center;
}

/* Header */

/* The top bar (SPEC 5.5, CR-66 round 3): 44 px, 24 px side padding, no background, no line; the
   body's safe-area padding stays above it. */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 24px;
}

/* The side blocks share the row's width equally, whatever they hold (one button at the left, the
   voice and the bug at the right since CR-65), so the centre of the row is the centre of the screen. */
.header-left,
.header-right {
  flex: 1 1 0;
  display: flex;
  align-items: center;
}

.header-right {
  justify-content: flex-end;
}

/* The "?" (CR-109 round 1) with the actions at the right. Round 5: the glyphs 24 px apart between
   the "?" and the gear and 16 px between the gear and the bug, the "?" at one and a half of the
   gear's distance from the bug; the last two hit areas overlap 4 px, a tap going to the nearer. */
.topbar-help {
  margin-right: 4px;
}

.topbar-settings {
  margin-right: -4px;
}

/* The session timer's chip (SPEC 5.29, timer.css). */
.header-centre {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The top bar's four buttons: Andrey's solid drawings (icons/topbar/, inline SVG, filled in
   currentColor, the hollows real holes, the bug's legs a 1.6 px stroke of their own; CR-66 round 15)
   at 24 px in a 44 x 44 hit area, in the pocket's outline colour, as topbar.md asks. */
.topbar-button {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pocket-line);
}

.topbar-button svg {
  display: block;
  width: 24px;
  height: 24px;
  overflow: visible;
}

.topbar-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The badge, a circle in bug.svg (11 px): shown while a report has something unread (4.10), in
   the attention orange ringed in the page colour, which cuts the bug's back under it. It pops
   in once when it appears, then breathes while the news is unread, slow enough to be seen from
   the corner of the eye without pulling at it during a card (CR-112); it goes when the report
   with the news is opened. */
.topbar-feedback .badge {
  display: none;
  fill: var(--flower-2);
  stroke: var(--bg);
}

.topbar-feedback.has-news .badge {
  display: block;
  transform-box: fill-box;
  transform-origin: center;
  animation: badge-pop 150ms ease-out both, badge-pulse 1.6s ease-in-out 150ms infinite;
}

@keyframes badge-pop {
  from { transform: scale(0.6); }
  to { transform: scale(1); }
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-feedback.has-news .badge {
    animation: none;
  }
}

.retry {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

/* Stage */

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--pad);
  touch-action: none;
  perspective: 1200px;
  /* The containing block of the copy of the previous card (.board-ghost). */
  position: relative;
}

.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--page-text);
  text-align: center;
}

.status-text {
  margin: 0;
  font-size: 1.1rem;
}

/* The board (SPEC 5.5): the mode's section, the attempts row and the hint row, everything
   between the header and the pager row. It is on the page colour, opaque, so it covers the
   previous card while it enters and is invisible once it lands; no size in pixels. It is the
   block that enters and the block that is copied under the entering one (SPEC 5.4). At most
   --board-max wide, centred by the stage (CR-112); its height stays the stage's. */
.board {
  /* The containing block of the health flower's overlays (RTW.flower). */
  position: relative;
  flex: 1 1 auto;
  max-width: var(--board-max);
  background: var(--bg);
  align-self: stretch;
  min-height: 0;
  /* The stage's width, never its content's (CR-153 round 3): the hint row's lines stay on one line
     at 16 px until they are fitted, which is only when the row shows, and a long one (Russian "tap
     or swipe to go on") made the whole board wider than the stage, 31 px in round 2's face and
     50 px in Shantell Sans, the cards past the screen's edges. */
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* The entry of the next card (SPEC 5.4, DESIGN.md): it comes from beyond the right edge
     turned and enlarged and settles flat, as a card laid on the pile from the viewer's side.
     The turned and scaled board's leftmost point lies 1.5 * (w + h) / (2 * sqrt 2), under
     0.54 * (100vw + 100vh), left of its centre, which sits at 50vw; 104vw + 54vh therefore
     starts it wholly beyond the right edge at every viewport. The duration, 350ms, is
     ENTRY_MS in app.js. */
  --entry-turn: 45deg;
  --entry-scale: 1.5;
  --entry-x: calc(104vw + 54vh);
}

/* The space the bottom row and the hint row leave, with the mode's section centred in it,
   as the stage centred it before the board. */
.deck {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The boards whose card starts at the stage's top (the typing modes and the rescue card) stand
   the card's tape room lower (CR-150): their rows share what is left, as they share the stage. */
.deck[data-mode="type"],
.deck[data-mode="dictation"],
.deck[data-mode="syllable-type"],
.deck[data-mode="syllable-dictation"],
.deck[data-mode="path-type"],
.deck[data-mode="path-dictation"],
.deck[data-mode="mistake-type"],
.deck[data-mode="mistake-review"] {
  padding-top: var(--tape-card-room);
}

/* The transform and will-change exist only while the class is on, so the 3D flips inside
   the board get the stage's perspective again once the card has landed. */
/* Rounded only while it enters, so the corner that shows first is a card's corner. */
.board.is-entering {
  border-radius: 20px;
  position: relative;
  z-index: 1;
  will-change: transform;
  pointer-events: none;
  animation: board-enter 350ms ease-out;
}

@keyframes board-enter {
  from { transform: translateX(var(--entry-x)) rotate(var(--entry-turn)) scale(var(--entry-scale)); }
  to { transform: none; }
}

/* A card out of the pocket (SPEC 5.22, CR-79): after the entry the board takes no input until the
   card has flown out and its flower's arrival has ended. */
.board.is-arriving {
  pointer-events: none;
}

/* The still copy of the previous card under the entering one: the whole board, its deck
   keeps data-mode, so the mode layouts apply to it. */
.stage > .board.board-ghost {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .board.is-entering {
    animation: none;
  }
}

/* The undo chip of a Skip (SPEC 5.16): at the bottom of the cards screen, 5 px above the
   footer's pager row (the body's padding already holds the safe-area inset). Above the learned
   block (7) and below the modals (10), so a tap reaches the chip and not the pocket under it.
   Outside the board, so the entry's pointer-events do not reach it. The fade, 500ms, is
   UNDO_FADE_MS in app.js. */
.undo {
  position: absolute;
  left: 50%;
  /* The footer's bottom padding, the pocket's height (the pager row's), the gap. */
  bottom: calc(4px + var(--pocket-height) + 5px);
  transform: translateX(-50%);
  /* Over the sheets (9, earlier in the document) and the glass (8), under the modals (CR-66 round 13). */
  z-index: 9;
  height: 54px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.undo[hidden] {
  display: none;
}

.undo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.undo.is-fading {
  opacity: 0;
  transition: opacity 500ms ease-out;
}

.undo-icon {
  flex: none;
  width: 27px;
  height: 27px;
  background-color: currentColor;
  -webkit-mask: url(icons/undo.svg) center / 27px no-repeat;
  mask: url(icons/undo.svg) center / 27px no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .undo.is-fading {
    transition: none;
  }
}

.arrow {
  flex: none;
  width: var(--arrow);
  height: var(--arrow);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--page-text);
  font-size: 2.4rem;
  line-height: 1;
  padding: 0 0 4px;
}

.arrow.is-hidden {
  visibility: hidden;
}

/* The footer arrow is the swipe of a mouse (SPEC 5.4): on a touch device it never shows. */
@media not ((hover: hover) and (pointer: fine)) {
  .pager > .arrow {
    visibility: hidden;
  }
}

/* Flip card faces, used by every mode's card */

.face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-note);
  text-align: center;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.face-front {
  flex-direction: column;
  font-weight: 700;
  font-size: var(--word-size);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.face-back {
  flex-direction: column;
  /* Room under the last line; inside the scrolling area where a back scrolls. */
  padding-bottom: 24px;
  font-size: clamp(1.05rem, 4.5vw, 1.3rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.translation {
  font-size: clamp(1.3rem, 6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.25;
}

.divider {
  width: 60%;
  margin: 14px auto;
  border: 0;
  border-top: 1px solid var(--line);
}

.divider[hidden] {
  display: none;
}

.meaning.is-empty {
  color: var(--muted);
}

/* The meanings the cards screen shows, on a card or on the page (CR-153): the
   Cards and Pick backs' meaning and the translation's, the "no meaning" line, Pick the word's
   card text (and the review card's), Listen and type's card, the meaning under the slots of the
   typing modes, the level 1 cards' meaning (round 1; the translation's meaning of Pick the word by
   translation is in modes/pick-reverse.css). Never a sheet's. Sizes, weights and colours are each one's own. */
.meaning,
.meaning-text,
.dictation-meaning,
.type-meaning,
.picture-text {
  font-family: var(--font-meaning);
  font-size-adjust: var(--hand-adjust);
}

/* An element RTW.fit sizes (modes/common.js, SPEC 5.5): it breaks between words only, so a word
   too wide overflows and the fit shrinks it; below the floor is-tight lets it break inside, at a
   hyphenation point of its language (its lang, RTW.setWord) where it has one, anywhere else. The
   class counts three times, so it wins over a mode's own overflow-wrap on the element. Never
   wider than its box: a centred flex item would otherwise take its longest word's width and
   never overflow. */
.is-fitted.is-fitted {
  max-width: 100%;
}

.is-fitted.is-fitted:not(.is-tight) {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.is-fitted.is-fitted.is-tight {
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: anywhere;
}

/* Word card buttons, used by every mode's card */

.speak {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--muted);
  -webkit-mask: url(icons/speaker.svg) center / 24px no-repeat;
  mask: url(icons/speaker.svg) center / 24px no-repeat;
}

.speak:active {
  background-color: var(--accent);
}

/* The big speaker of the cards that ask by ear (Listen and pick, Listen and type). */
.speak-large {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--text);
  -webkit-mask: url(icons/speaker.svg) center / 48px no-repeat;
  mask: url(icons/speaker.svg) center / 48px no-repeat;
}

.speak-large:active {
  background-color: var(--accent);
}

/* The health flower (SPEC 5.21): petal k is passed (its full colour) when the card's
   data-health is k or more, pale otherwise; the centre and the pale petals' strokes take the
   current level's colour. The petal is one symbol in index.php; a display-none SVG is not a
   safe home for a referenced symbol in every browser, so its holder is only sized away. */
.flower-defs {
  position: absolute;
  width: 0;
  height: 0;
}

.flower {
  position: absolute;
  left: 8px;
  top: 8px;
  width: var(--flower);
  height: var(--flower);
  /* The replay arrow (below) lies around the petals, beyond the grid of the flower. */
  overflow: visible;
  pointer-events: none;
  stroke-width: 10;
  stroke-linejoin: round;
}

/* The replay arrow of the card in review (SPEC 5.21, CR-79): Andrey's drawing around the flower
   (+tools/flower-arrow-svg.php), its ring at about 1.4 times the petals' reach, so at 44 px it
   stays inside the face's rounded corner. Its gradients are its own: never dimmed, no look of a
   level. Shown only while the card element (or the overlay) carries data-review="1"; never on
   Match's pair cards, whose row is too short. */
.flower-arrow {
  display: none;
}

[data-review="1"] .flower-arrow {
  display: inline;
}

/* A card on its way out of the pocket and arriving (CR-79 round 1): the arrival brings the arrow,
   so the small flower shows none until it has ended. */
[data-review="1"].is-arrow-pending .flower-arrow {
  display: none;
}

.match-pair[data-review] .flower-arrow {
  display: none;
}

/* Petal k counted among the petals only: the replay arrow comes first in the flower (CR-79 round 2). */
.flower-petal:nth-child(1 of .flower-petal) {
  --petal: var(--flower-1);
}

.flower-petal:nth-child(2 of .flower-petal) {
  --petal: var(--flower-2);
}

.flower-petal:nth-child(3 of .flower-petal) {
  --petal: var(--flower-3);
}

.flower-petal:nth-child(4 of .flower-petal) {
  --petal: var(--flower-4);
}

.flower-petal:nth-child(5 of .flower-petal) {
  --petal: var(--flower-5);
}

.flower-petal:nth-child(6 of .flower-petal) {
  --petal: var(--flower-6);
}

.flower-petal:nth-child(7 of .flower-petal) {
  --petal: var(--flower-7);
}

.flower-petal:nth-child(8 of .flower-petal) {
  --petal: var(--flower-8);
}

.flower-petal:nth-child(9 of .flower-petal) {
  --petal: var(--flower-9);
}

.flower-petal:nth-child(10 of .flower-petal) {
  --petal: var(--flower-10);
}

[data-health="0"] {
  --level: var(--flower-1);
}

[data-health="1"] {
  --level: var(--flower-1);
}

[data-health="2"] {
  --level: var(--flower-2);
}

[data-health="3"] {
  --level: var(--flower-3);
}

[data-health="4"] {
  --level: var(--flower-4);
}

[data-health="5"] {
  --level: var(--flower-5);
}

[data-health="6"] {
  --level: var(--flower-6);
}

[data-health="7"] {
  --level: var(--flower-7);
}

[data-health="8"] {
  --level: var(--flower-8);
}

[data-health="9"] {
  --level: var(--flower-9);
}

[data-health="10"] {
  --level: var(--flower-10);
}

/* Every look below sets --flower-fill and --flower-stroke; the dim is applied once, here. By
   colour, never by opacity: the flower shares a face with a blended picture (CR-52 round 4). */
.flower-petal,
.flower-centre,
.flower-wipe {
  fill: color-mix(in srgb, var(--flower-fill) var(--flower-dim), var(--surface));
  stroke: color-mix(in srgb, var(--flower-stroke) var(--flower-dim), var(--surface));
}

.flower-petal {
  --flower-fill: color-mix(in srgb, var(--petal) 20%, var(--surface));
  --flower-stroke: color-mix(in srgb, var(--level) 50%, var(--surface));
}

[data-health="1"] .flower-petal:nth-child(-n+1 of .flower-petal),
[data-health="2"] .flower-petal:nth-child(-n+2 of .flower-petal),
[data-health="3"] .flower-petal:nth-child(-n+3 of .flower-petal),
[data-health="4"] .flower-petal:nth-child(-n+4 of .flower-petal),
[data-health="5"] .flower-petal:nth-child(-n+5 of .flower-petal),
[data-health="6"] .flower-petal:nth-child(-n+6 of .flower-petal),
[data-health="7"] .flower-petal:nth-child(-n+7 of .flower-petal),
[data-health="8"] .flower-petal:nth-child(-n+8 of .flower-petal),
[data-health="9"] .flower-petal:nth-child(-n+9 of .flower-petal),
[data-health="10"] .flower-petal:nth-child(-n+10 of .flower-petal) {
  --flower-fill: var(--petal);
  --flower-stroke: color-mix(in srgb, var(--petal) 88%, black);
}

.flower-centre {
  --flower-fill: var(--level);
  --flower-stroke: color-mix(in srgb, var(--level) 88%, black);
}

[data-health="0"] .flower-centre {
  --flower-fill: color-mix(in srgb, var(--level) 20%, var(--surface));
  --flower-stroke: color-mix(in srgb, var(--level) 50%, var(--surface));
}

/* The review ladder (SPEC 5.21, CR-96 and round 1): in the top right corner of the card in
   review, its centre line on the flower's, out of reach of the grown flower and its arrow; one
   small flower per REVIEW_DAYS entry, the reviews passed lit (is-lit, RTW.flower.set) as the
   flower at HEALTH_MAX, the rest in its unpassed look, petal by petal; never the card's level (a
   lapse puts the row out while the card goes to 9). Its looks go through --flower-fill and
   --flower-stroke, so the flower's dim applies; these rules come after the petals' level rules,
   which they meet at the same specificity. The big flower's stroke of 10 vanishes at 16 px.
   Never on the overlay: it stays small on the card. */
.flower-ladder {
  display: none;
  position: absolute;
  right: 8px;
  top: calc(8px + var(--flower) / 2 - 8px);
  gap: 4px;
  pointer-events: none;
}

[data-review="1"] .flower-ladder {
  display: flex;
}

.flower-ladder .flower {
  position: static;
  width: 16px;
  height: 16px;
  stroke-width: 20;
}

.flower-ladder .flower .flower-arrow {
  display: none;
}

[data-review="1"] .flower-ladder .flower .flower-petal {
  --flower-fill: color-mix(in srgb, var(--petal) 20%, var(--surface));
  --flower-stroke: color-mix(in srgb, var(--petal) 50%, var(--surface));
}

[data-review="1"] .flower-ladder .flower .flower-centre {
  --flower-fill: color-mix(in srgb, var(--flower-10) 20%, var(--surface));
  --flower-stroke: color-mix(in srgb, var(--flower-10) 50%, var(--surface));
}

[data-review="1"] .flower-ladder .flower.is-lit .flower-petal {
  --flower-fill: var(--petal);
  --flower-stroke: color-mix(in srgb, var(--petal) 88%, black);
}

[data-review="1"] .flower-ladder .flower.is-lit .flower-centre {
  --flower-fill: var(--flower-10);
  --flower-stroke: color-mix(in srgb, var(--flower-10) 88%, black);
}

/* Full from the answer's play start until the card is left (round 2): the change is seen in the
   colours the big flower plays in. */
.is-ladder-live .flower-ladder .flower {
  --flower-dim: 100%;
}

/* The level colour is registered so a change of level transitions it, and the gradient over
   it follows (CR-85); a gradient cannot transition by itself. */
@property --level {
  syntax: "<color>";
  inherits: true;
  initial-value: #f6f7f9;
}

/* The card's surface in the current level's colour, faintly. A card without data-health
   (New) stays on the plain surface. --rest-bg is the flat resting fill; --rest-surface the
   level at --flower-tint laid over the plain gradient (the same as mixing it into both stops,
   and it fades with --surface-plain in a swipe), for an aim or a selection to tint over. */
[data-health] .face,
.type-card[data-health],
.picture-card[data-health],
.match-picture[data-health],
.match-pair[data-health] {
  --rest-bg: color-mix(in srgb, var(--level) var(--flower-tint), var(--surface));
  --level-tint: color-mix(in srgb, var(--level) var(--flower-tint), transparent);
  --rest-surface: linear-gradient(var(--level-tint), var(--level-tint)), var(--surface-plain);
  background: var(--rest-surface);
}

/* The candidates' tone (CR-150): the level the shell writes on the mode's section
   as data-tone, at --candidate-tint over the plain gradient, built as a card's --rest-surface is,
   so a selection and the drop target tint over it. Before the frames, which win. Match's
   picture cards keep their own level (above). */
[data-tone="1"] { --tone: var(--flower-1); }
[data-tone="2"] { --tone: var(--flower-2); }
[data-tone="3"] { --tone: var(--flower-3); }
[data-tone="4"] { --tone: var(--flower-4); }
[data-tone="5"] { --tone: var(--flower-5); }
[data-tone="6"] { --tone: var(--flower-6); }
[data-tone="7"] { --tone: var(--flower-7); }
[data-tone="8"] { --tone: var(--flower-8); }
[data-tone="9"] { --tone: var(--flower-9); }
[data-tone="10"] { --tone: var(--flower-10); }

[data-tone] .pick-face,
[data-tone] .picture-tile-face,
[data-tone] .match-word,
[data-tone] .meaning-option {
  --tone-tint: color-mix(in srgb, var(--tone) var(--candidate-tint), transparent);
  --rest-surface: linear-gradient(var(--tone-tint), var(--tone-tint)), var(--surface-plain);
  background: var(--rest-surface);
}

/* Frames (SPEC 5.5, CR-71): the verdict frame of what is pressed, the 2 px border and a 14 px
   glow in --ok or --bad: the Yes and No buttons, Pick the word's options. The verdict on a note (a
   tile of the Pick boards and Recall the picture, a card of the Match boards) and on a word's own
   card (the typing boards, Pick the word's card, CR-165) is drawn on it, never framed (RTW.marks,
   the marks block below, CR-164); its 2 px border stays transparent. The modes' stylesheets give these states no
   border colour or shadow of their own. A frame is a verdict; a tint is an aim or a selection
   (CR-155): the selection (Match, Match the translations), a
   drop target (Match, Pick the word, the Pick boards, Recall the picture) and a pressed Yes or No
   wear no frame, only the --aim-tint of --known (not the accent, so it is neither a verdict's
   colour nor the Undo chip's) as a layer over the resting fill (a picture card's level tint, a
   candidate's tone), the drop shadow kept, never a glow; their 2 px borders stay transparent, so
   no box changes size. A verdict comes after it and takes its place. */
.match-word.is-selected,
.match-picture.is-selected,
.match-word.is-drop,
.match-picture.is-drop,
.meaning-card.is-drop .face-front,
.pick-tile.is-drop .pick-face,
.pick-card.is-drop .face-front,
.picture-tile.is-drop .picture-tile-face,
.picture-card.is-drop,
.validate-answer:not(.is-answered) .validate-button:active {
  background: linear-gradient(var(--known-tint), var(--known-tint)), var(--rest-surface, var(--surface-plain));
}

.validate-button.is-right,
.meaning-option.is-right {
  border-color: var(--ok);
  box-shadow: 0 0 14px var(--ok);
}

.validate-button.is-wrong,
.meaning-option.is-wrong {
  border-color: var(--bad);
  box-shadow: 0 0 14px var(--bad);
}

/* The marks (SPEC 5.5, CR-164; MOTION 22): the verdict drawn on a note, cloned from #mark-template
   by RTW.marks (modes/common.js), which writes only the classes and the boxes: --mark-w, --mark-h,
   --mark-right and --mark-bottom (the mark's box inside the host's border), --sign-w and --sign-h
   (the sign, centred in it), --mark-turn (-1 to 1, salt 11). The base style of every part is the
   finished mark; the drawing runs from the hidden state (animation-fill-mode: backwards), so
   animation: none shows a whole mark. The times are MARK_STROKE_MS (170), MARK_CHECK_MS (350),
   MARK_RING_MS (350) of modes/common.js, and the rest's --mark-fade, the ink drying from the end of
   the drawing (CR-166 round 1); Match's .is-quick marks
   MARK_QUICK_STROKE_MS (120) and MARK_QUICK_CHECK_MS (200) (CR-165). Only the mark fades, never
   the card, a face or a picture. */
.mark {
  position: absolute;
  right: var(--mark-right, 5px);
  bottom: var(--mark-bottom, 5px);
  z-index: 2;
  width: var(--mark-w, 0px);
  height: var(--mark-h, 0px);
  pointer-events: none;
  filter: drop-shadow(0 0 1.5px var(--mark-halo)) drop-shadow(0 0 1.5px var(--mark-halo));
  transition: opacity var(--mark-fade) ease-out;
}

.mark.is-rest {
  opacity: var(--mark-rest);
}

.mark-sign {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--sign-w, 0px);
  height: var(--sign-h, 0px);
  translate: -50% -50%;
  rotate: calc(var(--mark-turn, 0) * var(--mark-turn-max));
}

/* A reveal is a wipe on the stroke's own element: stroke a (top left to bottom right) from its
   left end, then stroke b (top right to bottom left) from its right end; the check from its left. */
.mark-stroke {
  position: absolute;
  inset: 0;
  background: center / 100% 100% no-repeat;
  clip-path: inset(0 0 0 0);
}

.mark-stroke-a {
  background-image: url(icons/marks/cross-a.svg);
  animation: mark-wipe-right 170ms ease-out backwards;
}

.mark-stroke-b {
  background-image: url(icons/marks/cross-b.svg);
  animation: mark-wipe-left 170ms ease-out 170ms backwards;
}

.mark.is-check .mark-stroke-a {
  background-image: url(icons/validate-yes.svg);
  animation-duration: 350ms;
}

.mark.is-quick .mark-stroke-a {
  animation-duration: 120ms;
}

.mark.is-quick .mark-stroke-b {
  animation-duration: 120ms;
  animation-delay: 120ms;
}

.mark.is-quick.is-check .mark-stroke-a {
  animation-duration: 200ms;
}

.mark.is-check .mark-stroke-b {
  display: none;
}

@keyframes mark-wipe-right {
  from {
    clip-path: inset(0 100% 0 0);
  }
}

@keyframes mark-wipe-left {
  from {
    clip-path: inset(0 0 0 100%);
  }
}

/* The ring of a cross: the whole grid of one ring (-30 -30 860 860, the sign's place at its
   centre) as a mask over the cross's gradient, revealed clockwise from where its stroke starts
   (--ring-from) by a conic mask on the element round it, after the cross. Not turned. Rings 3 and
   8 go round more than once; their inner line comes with the outer one. */
@property --ring-sweep {
  syntax: "<angle>";
  inherits: false;
  initial-value: 360deg;
}

.mark-ring {
  position: absolute;
  inset: 0;
  display: none;
  --ring-sweep: 360deg;
  -webkit-mask-image: conic-gradient(from var(--ring-from, 0deg), #000 var(--ring-sweep), transparent 0);
  mask-image: conic-gradient(from var(--ring-from, 0deg), #000 var(--ring-sweep), transparent 0);
  animation: mark-ring 350ms linear 340ms backwards;
}

.mark.has-ring .mark-ring {
  display: block;
}

.mark-ring-ink {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, var(--mark-bad-from), var(--mark-bad-mid) 55%, var(--mark-bad-to));
  -webkit-mask: var(--ring-file) center / 100% 100% no-repeat;
  mask: var(--ring-file) center / 100% 100% no-repeat;
}

@keyframes mark-ring {
  from {
    --ring-sweep: 0deg;
  }
}

/* Each ring's file and where its stroke starts when drawn clockwise, about the grid's centre
   (computed from the outlines). */
.mark[data-ring="0"] .mark-ring { --ring-file: url(icons/marks/ring0.svg); --ring-from: -37deg; }
.mark[data-ring="1"] .mark-ring { --ring-file: url(icons/marks/ring1.svg); --ring-from: -111deg; }
.mark[data-ring="2"] .mark-ring { --ring-file: url(icons/marks/ring2.svg); --ring-from: 34deg; }
.mark[data-ring="3"] .mark-ring { --ring-file: url(icons/marks/ring3.svg); --ring-from: -70deg; }
.mark[data-ring="4"] .mark-ring { --ring-file: url(icons/marks/ring4.svg); --ring-from: 153deg; }
.mark[data-ring="5"] .mark-ring { --ring-file: url(icons/marks/ring5.svg); --ring-from: 127deg; }
.mark[data-ring="6"] .mark-ring { --ring-file: url(icons/marks/ring6.svg); --ring-from: 127deg; }
.mark[data-ring="7"] .mark-ring { --ring-file: url(icons/marks/ring7.svg); --ring-from: -134deg; }
.mark[data-ring="8"] .mark-ring { --ring-file: url(icons/marks/ring8.svg); --ring-from: 5deg; }

/* Match's miss (modes/match.css has the card's fill): the cross drawn over MISS_DRAW_MS (240),
   lit for MISS_HOLD_MS (200), then out once over MISS_OUT_MS (850), at MISS_MS (1290) removed
   (modes/match.js; CR-166 round 1). */
.mark.is-miss {
  animation: mark-out 850ms ease-in-out 440ms forwards;
}

@keyframes mark-out {
  to {
    opacity: 0;
  }
}

/* A twin (RTW.marks, CR-165: Pick the word's front face, turned away while its back's mark is
   drawn), and the copy of the board under the next card (app.js copyBoard): its marks whole and
   still at the strength they had (copyBoard sets each copy's opacity from its live mark, which may
   be drying); a miss's cross never. The twin goes pale with its mark. */
.mark.is-still * {
  animation: none;
}

.board-ghost .mark,
.board-ghost .mark * {
  animation: none;
  transition: none;
}

.board-ghost .mark.is-miss {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .mark,
  .mark.is-miss,
  .mark * {
    animation: none;
    transition: none;
  }
}

/* The tint moves with the changing petal: the 300 ms are FLOWER_FILL_MS in modes/common.js.
   The level colour transitions (@property --level) and the gradient follows it. Match's cards
   keep their own transitions (modes/match.css). A card shown at a new level takes it at once
   (is-flower-still, RTW.flower.set). */
[data-health] .face,
.type-card[data-health],
.picture-card[data-health] {
  transition: --level 300ms ease;
}

.is-flower-still .face,
.type-card.is-flower-still,
.picture-card.is-flower-still {
  transition: none;
}

/* A card that has shown its result keeps its flower full until the next show (SPEC 5.21);
   the property inherits to the flower. */
.is-flower-full {
  --flower-dim: 100%;
}

/* The small flower while its overlay plays over it; the ladder under it stays. */
.is-flower-covered .flower {
  visibility: hidden;
}

.is-flower-covered .flower-ladder .flower {
  visibility: visible;
}

/* The overlay: a copy of the small flower on the board, placed over it by RTW.flower (its
   left, top, width and height are the one geometry the script sets inline, with its rotate, the
   turn of the card it lies on, CR-163). It grows and
   shrinks about its centre over FLOWER_GROW_MS and FLOWER_SHRINK_MS (200 ms each). */
.flower.flower-overlay {
  --flower-dim: 100%;
  z-index: 5;
  transform-origin: center;
  transition: transform 200ms ease-out;
}

.flower-overlay.is-grown {
  transform: scale(var(--flower-grow));
}

.flower-overlay.is-shrinking {
  transition-timing-function: ease-in;
}

/* Held grown for the flower sticker (CR-109 round 2, SPEC 5.21): over the sticker's glass (10), so
   it stays sharp in its place. RTW.flower moves it to the body for the pause (#stage's perspective
   is a stacking context), fixed at the viewport spot it had. */
.flower.flower-overlay.is-lifted {
  position: fixed;
  z-index: 11;
}

/* The centre blinks twice, FLOWER_BLINK_MS = 2 x 250 ms, ending on its own fill. */
.flower-overlay.is-blinking .flower-centre {
  animation: flower-blink 250ms ease-in-out 2;
}

@keyframes flower-blink {
  50% {
    fill: color-mix(in srgb, var(--level) 20%, var(--surface));
  }
}

/* The colours move to the new level over FLOWER_SWITCH_MS. */
.flower-overlay.is-switching .flower-petal,
.flower-overlay.is-switching .flower-centre {
  transition: fill 150ms ease, stroke 150ms ease;
}

/* The ladder's changing flowers blink with the overlay's centre and switch with its colours on
   the card (CR-96); is-ladder-switching lasts from the blink to the play's end. */
.flower-ladder .flower.is-blinking .flower-petal,
.flower-ladder .flower.is-blinking .flower-centre {
  animation: flower-blink 250ms ease-in-out 2;
}

.is-ladder-switching .flower-ladder .flower .flower-petal,
.is-ladder-switching .flower-ladder .flower .flower-centre {
  transition: fill 150ms ease, stroke 150ms ease;
}

/* The changing petal keeps the pale look under the wipe, a copy of it in the passed look of
   its own row that fills from the base or drains from the tip over FLOWER_FILL_MS. The inset
   is in the petal's own coordinates, where the tip is up, whatever its turn. */
.flower-row-1 {
  --petal: var(--flower-1);
}

.flower-row-2 {
  --petal: var(--flower-2);
}

.flower-row-3 {
  --petal: var(--flower-3);
}

.flower-row-4 {
  --petal: var(--flower-4);
}

.flower-row-5 {
  --petal: var(--flower-5);
}

.flower-row-6 {
  --petal: var(--flower-6);
}

.flower-row-7 {
  --petal: var(--flower-7);
}

.flower-row-8 {
  --petal: var(--flower-8);
}

.flower-row-9 {
  --petal: var(--flower-9);
}

.flower-row-10 {
  --petal: var(--flower-10);
}

.flower-overlay .flower-petal.is-wiping {
  --flower-fill: color-mix(in srgb, var(--petal) 20%, var(--surface));
  --flower-stroke: color-mix(in srgb, var(--level) 50%, var(--surface));
}

.flower-wipe {
  --flower-fill: var(--petal);
  --flower-stroke: color-mix(in srgb, var(--petal) 88%, black);
}

.flower-wipe.is-gain {
  clip-path: inset(100% 0 0 0);
}

.flower-overlay.is-filling .flower-wipe {
  animation: flower-fill 300ms ease-out forwards;
}

.flower-overlay.is-draining .flower-wipe {
  animation: flower-drain 300ms ease-in forwards;
}

@keyframes flower-fill {
  from {
    clip-path: inset(100% 0 0 0);
  }

  to {
    clip-path: inset(0);
  }
}

@keyframes flower-drain {
  from {
    clip-path: inset(0);
  }

  to {
    clip-path: inset(100% 0 0 0);
  }
}

/* The arrival of a card out of the pocket (RTW.flower.arrive, CR-79, rounds 1, 3 and 4), the
   failed review's departure backwards: when the overlay has grown the arrow comes out from under
   the petals already spinning. It turns FLOWER_SPIN_TURNS times (4, --flower-spin-turns) over
   --flower-arrow-ms (FLOWER_ARROW_SPIN_MS, 950 ms), fast at first and slowing into its drawn
   position (the departure's curve reversed), while over the first --flower-arrow-grow-ms
   (FLOWER_ARROW_GROW_MS, 300 ms) it grows from opacity 0 and FLOWER_ARROW_FROM (0.2, a ring about
   the centre's size) to opaque and full, ease-out. All three are set by the script. The growth
   and the spin are two animations on the individual scale and rotate, so each has its own curve. Until the growth starts the arrow
   waits at the start values. The <use> turns about 0 0 of the flower's grid, which is the centre.
   The overlay stands on the board, outside the card and its blended picture, so it may fade. */
.flower-overlay .flower-arrow {
  transform-box: view-box;
  transform-origin: 0 0;
}

.flower-overlay.is-arriving .flower-arrow {
  opacity: 0;
  scale: 0.2;
}

.flower-overlay.is-arriving.is-spinning .flower-arrow {
  animation:
    flower-arrow-in var(--flower-arrow-grow-ms) ease-out forwards,
    flower-arrow-spin var(--flower-arrow-ms) cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes flower-arrow-in {
  from {
    opacity: 0;
    scale: 0.2;
  }

  to {
    opacity: 1;
    scale: 1;
  }
}

@keyframes flower-arrow-spin {
  from {
    rotate: calc(var(--flower-spin-turns) * 360deg);
  }

  to {
    rotate: 0deg;
  }
}

/* The answer on a card in review (CR-79 rounds 1, 3 and 4): from the blink to the end of the petal
   step (--flower-arrow-ms, FLOWER_BLINK_MS + FLOWER_SWITCH_MS + FLOWER_FILL_MS, 950 ms, set by the
   script) the arrow spins FLOWER_SPIN_TURNS turns on the arrival's curve reversed, slow to fast.
   Failed: clockwise, and over the last --flower-arrow-grow-ms (300 ms, the petal step) it fades and
   shrinks to FLOWER_ARROW_FROM under the petals, ease-in, gone after it. Passed:
   counter-clockwise as at the arrival, opaque and full, at rest at the end. */
.flower-overlay.is-arrow-out .flower-arrow {
  animation:
    flower-arrow-out var(--flower-arrow-ms) cubic-bezier(0.8, 0, 0.8, 0.3),
    flower-arrow-dive var(--flower-arrow-grow-ms) ease-in calc(var(--flower-arrow-ms) - var(--flower-arrow-grow-ms)) forwards;
}

.flower-overlay.is-arrow-again .flower-arrow {
  animation: flower-arrow-again var(--flower-arrow-ms) cubic-bezier(0.8, 0, 0.8, 0.3);
}

@keyframes flower-arrow-out {
  from {
    rotate: 0deg;
  }

  to {
    rotate: calc(var(--flower-spin-turns) * 360deg);
  }
}

@keyframes flower-arrow-dive {
  from {
    opacity: 1;
    scale: 1;
  }

  to {
    opacity: 0;
    scale: 0.2;
  }
}

@keyframes flower-arrow-again {
  from {
    rotate: 0deg;
  }

  to {
    rotate: calc(var(--flower-spin-turns) * -360deg);
  }
}

/* Cards (SPEC 5.3, RTW.flower.follow): the overlay follows the swipe's pull, 0 at rest to 1 at
   the threshold, with no transition while the finger drives it; the petal's wipe fills with it.
   It drains back over the swipe's spring (BACK_MS, 200 ms) and shrinks away with the flight
   (FLY_MS, 300 ms), its colours moving to the new level in the first 150 ms of it. */
.flower-overlay.is-pulled {
  transform: scale(calc(1 + (var(--flower-grow) - 1) * var(--pull)));
  transition: none;
}

.flower-overlay.is-pulled .flower-wipe {
  clip-path: inset(calc((1 - var(--pull)) * 100%) 0 0 0);
}

.flower-overlay.is-pulled.is-returning {
  transition: transform 200ms ease-out;
}

.flower-overlay.is-pulled.is-returning .flower-wipe {
  transition: clip-path 200ms ease-out;
}

.flower-overlay.is-pulled.is-flying {
  transform: none;
  transition: transform 300ms ease-in;
}

.flower-overlay.is-pulled.is-flying .flower-petal,
.flower-overlay.is-pulled.is-flying .flower-centre {
  transition: fill 150ms ease, stroke 150ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .flower,
  .flower *,
  [data-health] .face,
  .type-card[data-health],
  .picture-card[data-health],
  .match-picture[data-health],
  .match-pair[data-health] {
    transition: none;
    animation: none;
  }
}

/* The wrong-answer shake moves the whole screen. */
.cards.is-shaking {
  animation: shake 400ms ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  14% { transform: translateX(-8px); }
  28% { transform: translateX(8px); }
  42% { transform: translateX(-6px); }
  57% { transform: translateX(6px); }
  71% { transform: translateX(-3px); }
  85% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .cards.is-shaking {
    animation: none;
  }
}

/* The word's level in the upper right corner of the New card and of both Cards faces (SPEC
   5.16, CR-135): the meaning's quiet type, over the face's padding, so it moves nothing and takes
   no taps. The zipf under it is the debug flag's only. */
.card-level {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25;
  text-align: right;
  pointer-events: none;
}

.card-level[hidden] {
  display: none;
}

.card-level-zipf {
  font-size: 12px;
}

/* The Cards back, shared by Cards and the New card (SPEC 5.3, 5.16, CR-134): a head row at the
   top (the picture as a memory anchor, the word beside it), the meaning under it across the face
   (word and meaning are one entry in the learned language), the rule at half the face (CR-138
   round 1: two equal halves, the rule in one place on every card), then the translation with its
   own meaning under it (the explanation in the user's language, CR-138), one group centred both
   ways in the lower half; the translation is centred, its meaning aligned as the meaning above the
   rule (CR-138 round 4).
   The room the upper part leaves is empty over the rule; when the upper part is taller than its
   half, the body gives way and the rule moves down.

   The face is a size container. Its top and bottom paddings are equal (.face, .face-back,
   .new-face), so half the whole face lies 50cqh under the content box's top, and the body, from
   under the rule to the content box's bottom, is 50cqh less half the rule. */
.face:has(> .card-back-rule) {
  container-type: size;
  --back-gap: 12px;
  --back-rule: 2px;
  --back-meaning-size: 17px;
  --back-meaning-lh: 1.45;
  /* The picture's room (SPEC 5.3): the upper half's content less the gap under the row, two lines
     of the meaning at its full size, the gap over the rule and half the rule. One per screen. */
  --back-thumb-room: calc(50cqh - 2 * var(--back-gap) - 2 * var(--back-meaning-size) * var(--back-meaning-lh) - var(--back-rule) / 2);
}

.card-back-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* About the size of a Pick tile's picture: 40% of the face's inner width, smaller only where the
   upper half has no room for it (a short screen), never under 56 px. */
.card-thumb {
  flex: none;
  width: max(56px, min(40%, 160px, var(--back-thumb-room)));
  aspect-ratio: 1 / 1;
  border-radius: var(--picture-radius);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.card-back-body {
  flex: 0 1 calc(50cqh - var(--back-rule) / 2);
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--back-gap);
  width: 100%;
  text-align: center;
}

/* The meaning under the head row, left-aligned with the picture's edge, never nearer to the rule
   than the gap; fitted from 17 down to 14 px while it takes more than three lines or pushes the
   rule under half the face (modes/common.js). An empty one is hidden and the rule keeps its place. */
.card-back-meaning {
  flex: none;
  width: 100%;
  margin: var(--back-gap) 0;
  color: var(--muted);
  font-size: var(--back-meaning-size);
  line-height: var(--back-meaning-lh);
  text-align: left;
}

/* Without a picture the word, its line and the meaning are centred, and as one block centred in
   the height above the rule: the head's auto margin shares the free space with the rule's, and
   the gap under the meaning is matched over the head. The translation's meaning is centred then
   too: the two meanings of a card are always aligned alike (CR-138 round 4). */
.card-back-head:has(> .card-thumb[hidden]) > .card-back-word,
.card-back-head:has(> .card-thumb[hidden]) + .card-back-meaning,
.card-back-head:has(> .card-thumb[hidden]) ~ .card-back-body > .card-back-native {
  text-align: center;
}

.card-back-head:has(> .card-thumb[hidden]) {
  margin-top: auto;
}

.card-back-head:has(> .card-thumb[hidden]):has(+ .card-back-meaning:not([hidden])) {
  padding-top: var(--back-gap);
}

/* The translation is the answer, in the word's size, the one large thing under the rule. */
.card-back-body > .translation {
  flex: none;
  font-size: var(--word-size);
}

/* One rule, between the thing (picture, word) and what it means. It fades out at both
   ends, so it marks the border without cutting the card into bands. Its auto margin takes the
   room the upper part leaves, so it stands at half the face. */
.card-back-rule {
  flex: none;
  width: 100%;
  height: var(--back-rule);
  margin: auto 0 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line) 50%, transparent);
}

/* "No meaning yet" when the card has neither, and the translation's meaning under the
   translation (SPEC 5.3): the meaning's type, bounded by the body's height so its fit
   (RTW.flipCard.fitNative) sees the room the translation leaves. */
.card-back-body > .meaning {
  color: var(--muted);
  font-size: var(--back-meaning-size);
  line-height: var(--back-meaning-lh);
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

/* The translation's meaning keeps one line at least: on a short face its fit cuts it to that line
   (RTW.flipCard.fitNative) rather than letting the body squeeze it to nothing; with no room for
   that line it is left out.
   Across the face's inner width and aligned as the meaning above the rule (CR-138 round 4): on
   the left with a picture, one line included; centred without one (the rule above). */
.card-back-body > .card-back-native {
  min-height: 1lh;
  text-align: left;
}

/* Not even that line fits: left out, the translation alone as without it. */
.card-back-body > .card-back-native.is-unfit {
  display: none;
}

/* While the translation's meaning shows, the group is centred above the speaker's top edge: the
   speaker's 8 px inset and 44 px height (.speak) less the face's 24 px bottom padding. */
.card-back-body:has(> .card-back-native:not([hidden], .is-unfit)) {
  padding-bottom: 28px;
}

/* At the floor a fitted text is cut to the whole lines its box holds (RTW.fit's clamp). */
.is-fitted.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--fit-lines);
  line-clamp: var(--fit-lines);
  overflow: hidden;
}

/* The size is the stylesheet's at most; the mode fits it down to 18 px before a word may
   break. */
.card-back-word {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: var(--word-size);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.card-back-word.is-tight {
  overflow-wrap: anywhere;
}

/* The picture card (SPEC 5.43), the card of Recall the picture, Check the picture and Check the
   translation (modes/picture.js, RTW.pictureCard): one face, no flip, the upper half of the New
   card. A head row with the values of the Cards back's (the slot at the left, the word's column
   beside it: the word and the translation line under it), the block under the row (the meaning,
   or the translation in question); the Cards back's own rules above stay as they are. The section
   it stands in is a size container, so the slot's side reads its width. The card's height is set
   by the script for its state after the answer or the state shown, the taller; the block takes
   what the row leaves. Every change after the answer is a Web Animation of the script: no
   transition here. */
.picture-card {
  /* The slot's side: 40% of the inner width, at most 160 px; modes/picture.js sets a smaller one
     inline (56 px at least) when the stage is too low for the card. */
  --picture-side: min(160px, calc(0.4 * (100cqw - 32px)));
  /* The room of the speaker in the lower right corner (.speak: 8 px in, 44 px wide) beyond the
     card's 16 px padding, kept clear by the last line. */
  --picture-speaker-room: 36px;
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 16px;
  border-radius: var(--card-radius);
  background: var(--surface-plain);
  box-shadow: var(--shadow-note);
  /* No clip of its own since CR-150 (its tape stands over the top edge): the block below clips
     what the card clipped. */
}

/* Over the slot's corner: the slot is positioned and comes later. */
.picture-card > .flower {
  z-index: 1;
}

.picture-card > .speak {
  z-index: 1;
}

.picture-head {
  flex: none;
  display: flex;
  align-items: center;
  width: 100%;
}

/* The slot (SPEC 5.43): empty, a dashed frame with no fill; filled, the picture; closed, no width
   but its height, so the row keeps it. The gap to the word is the slot's margin, so a closed slot
   leaves none. Its opening (5.45) is the script's: the picture uncovered from the left by a clip,
   never by opacity (a blended picture, DESIGN.md). */
.picture-slot {
  position: relative;
  flex: none;
  width: var(--picture-side);
  height: var(--picture-side);
  margin-right: 16px;
}

.picture-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed var(--slot-line);
  border-radius: var(--picture-radius);
  pointer-events: none;
}

.picture-slot:has(> .picture-slot-image:not([hidden]))::before {
  display: none;
}

.picture-slot-image {
  display: block;
  width: var(--picture-side);
  max-width: none;
  height: var(--picture-side);
  border-radius: var(--picture-radius);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.picture-slot-image[hidden] {
  display: none;
}

.picture-slot-image:not([src]) {
  visibility: hidden;
}

.picture-card.is-closed .picture-slot {
  width: 0;
  margin-right: 0;
}

.picture-card.is-closed .picture-slot::before,
.picture-card.is-closed .picture-slot-image {
  visibility: hidden;
}

/* A record without a picture where a mode takes one (5.45): no slot, the row as high as the
   column. */
.picture-card.is-no-picture .picture-slot {
  display: none;
}

/* The word's column, vertically centred in the row: the word, then 4 px under it the translation
   line (TRANSLATION_GAP in modes/picture.js). Left-aligned beside the slot; centred in the card's
   width while the slot is closed or absent, and in the card that opens its slot after the answer
   (the word moves right with the slot). */
.picture-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.picture-card.is-centred .picture-column,
.picture-card.is-no-picture .picture-column {
  text-align: center;
}

/* The word as on the Cards back: the word's type size at most, bold; RTW.fit shrinks it to 18 px
   before a word may break. */
.picture-word {
  font-size: var(--word-size);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.picture-word.is-tight {
  overflow-wrap: anywhere;
}

/* The translation (CR-145 round 2): the word's size at a regular weight, the pair read together
   and the word the one bold thing; RTW.fit shrinks it to 18 px before a word may break, two lines
   at most. The translation line under the word, and the translation in question in the block
   before the answer of 5.45, in the same look. An empty line takes no room; a pending one (the
   record's translation before the answer of 5.43 and 5.44) keeps its room unseen. */
.picture-translation,
.picture-shown {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: var(--text);
  font-size: var(--word-size);
  font-weight: 400;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.picture-translation {
  margin-top: 4px;
}

.picture-translation:empty {
  display: none;
}

.picture-translation.is-pending {
  visibility: hidden;
}

.picture-shown {
  flex: none;
  width: 100%;
  padding: 0 var(--picture-speaker-room);
  text-align: center;
}

.picture-shown[hidden] {
  display: none;
}

/* Without a picture the column stands clear of the flower and of the speaker. */
.picture-card.is-no-picture .picture-head {
  padding-inline: var(--picture-speaker-room);
}

/* Without a meaning under the row the column keeps clear of the speaker under it. */
.picture-card.is-no-text .picture-column {
  padding-right: var(--picture-speaker-room);
}

/* The block, 12 px under the row across the card's inner width, taking what the row leaves of the
   card's set height. It holds the meaning, at its top; before the answer of 5.45 the translation
   in question instead, centred both ways. */
.picture-block {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  /* The card's clip, moved here (CR-150): reaching through the card's bottom padding, so it cuts
     where the card's edge cut before, and nothing above the block needs one. */
  margin-bottom: -16px;
  padding-bottom: 16px;
  overflow: hidden;
}

.picture-card.is-asking .picture-block {
  justify-content: center;
}

.picture-card.is-no-text .picture-block {
  display: none;
}

/* The meaning (5.43): the meaning's type, its end clear of the speaker, fitted 17 down to 14 px
   while it takes more than four lines, cut beyond four at the floor (RTW.fit's clamp);
   left-aligned beside a slot, centred on a card without one. */
.picture-text {
  flex: none;
  width: 100%;
  padding-right: var(--picture-speaker-room);
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
  text-align: left;
}

.picture-card.is-no-picture .picture-text {
  padding-left: var(--picture-speaker-room);
  text-align: center;
}

.picture-card .picture-text[hidden] {
  display: none;
}

/* The question of the level 1 modes (SPEC 5.43 to 5.45, CR-145 round 1): one line between the card
   and the choices, centred in the free height (its auto margins; the card's and the choices' 12 px
   are the least), in the hand font, quieter than the cards: the page's text mixed with the page
   colour, never an opacity. RTW.fit shrinks it from --question-size to 18 px before it wraps, two
   lines at most. It takes no pointer, so a drag passes over it to the card.
   Andrey tunes the two tokens here: --question-size (the size) and --question-strength (the share
   of --page-text in the mix with --bg). */
.level-question {
  --question-size: 24px;
  --question-strength: 70%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  flex: none;
  width: 100%;
  margin: auto 0;
  padding: 0 var(--pad);
  overflow: hidden;
  color: color-mix(in srgb, var(--page-text) var(--question-strength), var(--bg));
  font-family: var(--font-hand);
  font-size-adjust: var(--hand-adjust);
  font-size: var(--question-size);
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
  pointer-events: none;
}

/* The board inset of the level 1 cards (SPEC 5.5, 5.43, CR-147): the card's wrapper stands
   --board-top under the section's top while the free height allows it. modes/picture.js sets
   --board-room on the section: what the free height can spare with the question keeping its
   height and 24 px over and under it, after the slot's shrink. */
.picture-swipe,
.validate-swipe {
  margin-top: min(var(--board-top), var(--board-room, 0px));
}

/* Swipes (SPEC 5.4): modes/common.js moves .swipe-target with the finger. A card in the hand
   keeps its ink, --swipe-fade at 0% (CR-155); only a card that flies away for good
   (New into its button, Cards and the continue swipe off the stage) fades, --swipe-fade going to
   100% over its flight. The card's surface and text fade toward the page colour through the colour
   variables of its child, never through opacity (a blended picture would show its white square in
   Safari). */
@property --swipe-fade {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

.swipe-target {
  --swipe-surface: var(--surface);
  --swipe-plain: var(--surface-plain);
  --swipe-text: var(--text);
  --swipe-muted: var(--muted);
}

.swipe-target > * {
  --surface: color-mix(in srgb, var(--swipe-surface), var(--bg) var(--swipe-fade));
  /* The gradient fades under a layer of the page colour at the same strength. */
  --surface-plain: linear-gradient(var(--swipe-veil), var(--swipe-veil)), var(--swipe-plain);
  --swipe-veil: color-mix(in srgb, var(--bg) var(--swipe-fade), transparent);
  --text: color-mix(in srgb, var(--swipe-text), var(--bg) var(--swipe-fade));
  --muted: color-mix(in srgb, var(--swipe-muted), var(--bg) var(--swipe-fade));
  color: var(--text);
}

.swipe-target.is-dragging {
  will-change: transform;
}

.swipe-target.is-flying {
  transition: transform 300ms ease-in, --swipe-fade 300ms ease-in;
}

.swipe-target.is-returning {
  transition: transform 200ms ease-out, --swipe-fade 200ms ease-out;
}

/* The shadow goes with the surface during the flight only, so a card that ends under its
   button leaves no shadow around it; a card in the hand keeps casting one. The same for a card
   flying into the learned pocket (pocket.js), whose flip cards cast theirs from .face; scoped
   to the deck. */
.swipe-target.is-flying .face,
.board .deck .is-pocketing .face {
  box-shadow: none;
  transition: box-shadow 300ms ease-in;
}

/* The place a swiped card left (CR-155): what a dragged note leaves (.paper-card
   .is-lifted below), a 1 px dashed outline in the taped card's box at rest, at its turn and with
   its corners. modes/common.js (RTW.swipe) lays it before the swipe's target, under the moved card,
   while the card is away; it takes no pointer and moves nothing. A card flying away for good takes
   its place with it: the outline fades by its colour over the flight (300 ms, FLY_MS). */
.swipe-place {
  position: absolute;
  left: 0;
  top: 0;
  border: 1px dashed var(--place-line);
  border-radius: var(--card-radius);
  pointer-events: none;
}

.swipe-place.is-leaving {
  border-color: transparent;
  transition: border-color 300ms ease-in;
}

@media (prefers-reduced-motion: reduce) {
  .swipe-target.is-flying,
  .swipe-target.is-flying .face,
  .swipe-target.is-returning {
    transition: none;
  }
}

/* A card flying into the learned pocket (SPEC 5.22). The individual transform properties, not
   transform: the flip cards are turned through transform and the swipe sets it inline; these
   compose with it, applied before it, so a flipped card flies flipped. 300ms is POCKET_FLY_MS
   in pocket.js, the swipe's FLY_MS. No fade: the card goes into the pocket. Scoped to the
   board's deck so it outweighs the modes' own transitions on their cards (the flip's
   .meaning-card, .pick-card, the tint's .match-pair[data-health]), which the flight replaces.
   z-index 6: over everything on the board (the attempts row's masked faces, the flower overlay's
   5), under the learned block's 7. */
.board .deck .is-pocketing {
  z-index: 6;
  pointer-events: none;
  transition: translate 300ms ease-in, rotate 300ms ease-in, scale 300ms ease-in;
}

/* The cards that cast their shadow themselves: the Type card and Match's pair card. */
.board .deck .match-pair.is-pocketing {
  position: relative;
}

.board .deck .type-card.is-pocketing,
.board .deck .match-pair.is-pocketing {
  box-shadow: none;
  transition: translate 300ms ease-in, rotate 300ms ease-in, scale 300ms ease-in, box-shadow 300ms ease-in;
}

/* The card is left during its flight (RTW.pocket.cancel): it stands at its end at once. */
.board .deck .is-pocketing.is-cut,
.board .deck .is-pocketing.is-cut .face,
.board .deck .type-card.is-pocketing.is-cut,
.board .deck .match-pair.is-pocketing.is-cut {
  transition: none;
}

/* The landed card is invisible (it fits the pocket at rest, but nothing of it shows while the
   pocket settles), in the board's copy too; a cut flight's card as well; and a card given to the
   pocket (pocket.js give) until it flies out. Visibility, not opacity: a card may hold a blended
   picture. */
.board .deck .is-pocketed,
.board .deck .is-pocketing.is-cut {
  visibility: hidden;
}

/* A card taken out of the pocket (pocket.js give, CR-79): it stands at a landed card's values
   with no transition (is-still), then moves to its place over 300ms ease-out, POCKET_FLY_MS, over
   everything on the board, as the flight in does. */
.board .deck .is-unpocketing {
  z-index: 6;
  pointer-events: none;
  transition: translate 300ms ease-out, rotate 300ms ease-out, scale 300ms ease-out;
}

.board .deck .match-pair.is-unpocketing,
.board .deck .match-picture.is-unpocketing {
  position: relative;
}

.board .deck .is-unpocketing.is-still {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .board .deck .is-pocketing,
  .board .deck .is-pocketing .face,
  .board .deck .type-card.is-pocketing,
  .board .deck .match-pair.is-pocketing,
  .board .deck .is-unpocketing {
    transition: none;
  }
}

/* Every card a taped note (CR-150; the numbers
   are the tokens at the top and the constants at the top of modes/common.js). RTW.paper.lay marks
   the word's card paper-card and the candidates paper-candidate and writes each one's --tilt and
   --tape-tilt (-1 to 1): the card lies turned by up to --tilt-card, a candidate by up to
   --tilt-candidate (times the board's --tilt-scale, where a board needs room). The individual
   rotate property: the flips, the swipe, the shake and the pocket's flight keep their own
   transform and compose with it (the pocket sets rotate inline for its flight). A still look:
   reduced motion keeps it. */

/* The notes' two shadows (CR-151; the depth by note, CR-156): composed on the root
   with no lift, today's, and again on every note with its own --lift (-1 to 1, RTW.paper.lay and
   Match's pair cards; salt 5 of lib/tilt.js), so the faces inside a note inherit its depth. Every
   length (how far down, the blur, the negative spread, in both layers) is times --lift-depth,
   every alpha times --lift-fade (--lift-range in the tokens). The top offset of a layer's blur,
   down by (y + spread - blur) times the depth, stays under the upper edge at any lift. */
:root,
.paper-card,
.paper-candidate {
  --lift-depth: calc(1 + var(--lift, 0) * var(--lift-range));
  --lift-fade: calc(1 - var(--lift, 0) * var(--lift-range) / 2);
  --shadow-note:
    0 calc(14px * var(--lift-depth)) calc(16px * var(--lift-depth)) calc(-10px * var(--lift-depth)) rgba(20, 30, 50, calc(0.28 * var(--lift-fade))),
    0 calc(4px * var(--lift-depth)) calc(6px * var(--lift-depth)) calc(-4px * var(--lift-depth)) rgba(20, 30, 50, calc(0.14 * var(--lift-fade)));
  --shadow-note-soft:
    0 calc(9px * var(--lift-depth)) calc(10px * var(--lift-depth)) calc(-7px * var(--lift-depth)) rgba(20, 30, 50, calc(0.22 * var(--lift-fade))),
    0 calc(3px * var(--lift-depth)) calc(4px * var(--lift-depth)) calc(-3px * var(--lift-depth)) rgba(20, 30, 50, calc(0.1 * var(--lift-fade)));
}

.paper-card {
  --tape-width: var(--tape-card-width);
  --tape-height: var(--tape-card-height);
  --tape-over: var(--tape-card-over);
  rotate: calc(var(--tilt, 0) * var(--tilt-card));
}

.paper-candidate {
  --tape-width: var(--tape-small-width);
  --tape-height: var(--tape-small-height);
  --tape-over: var(--tape-small-over);
  rotate: calc(var(--tilt, 0) * var(--tilt-candidate) * var(--tilt-scale, 1));
}

/* The strip of tape: on the upper edge, standing --tape-over above it, turned against its card by
   its --tape-tilt times --tape-turn-max either way about its middle, and standing its --tape-shift
   times --tape-shift-max off the card's middle (CR-156); on from the first frame. Narrower on a
   card too narrow for it beside the corner marks (the flower, the ladder, the level, the speaker:
   40 px a side), and shifted only as far as that room allows (--tape-room), down to none. Its length
   is its own (CR-161): its full width less its --tape-cut (0 to --tape-length-range, RTW.paper.lay),
   capped where a card above needs it (--tape-cap, RTW.paper.narrow). Over the
   card's faces (in a card that turns in 3D, a pixel in front of them, --tape-z), inside the card's
   own stacking: nothing of the shell goes under it. It takes no pointer. Off (tape-off), it
   shrinks along itself to its left end, at its turn, over 120 ms ease-in; on, it grows back over
   200 ms ease-out, the hint tape's: TAPE_OFF_MS and TAPE_ON_MS in modes/common.js. The shrink is in
   transform (about the left end in the strip's own frame), the turn in rotate (about its middle). */
.paper-card::after,
.paper-candidate::after,
.paper-card.tape-pair:not(.is-lifted)::before {
  --tape-turn: calc(var(--tape-tilt, 0) * var(--tape-turn-max));
  --tape-len: min(calc(var(--tape-width) * (1 - var(--tape-cut, 0))), var(--tape-cap, var(--tape-width)));
  --tape-w: min(var(--tape-len), calc(100% - 80px));
  --tape-room: max(0px, (100% - 80px - var(--tape-w)) / 2);
  content: "";
  position: absolute;
  z-index: 3;
  top: calc(-1 * var(--tape-over));
  left: calc(50% - var(--tape-w) / 2 + clamp(-1 * var(--tape-room), var(--tape-shift, 0) * var(--tape-shift-max), var(--tape-room)));
  width: var(--tape-w);
  height: var(--tape-height);
  background: var(--tape);
  /* The hairline (--tape-edge, CR-155), inside the strip's own box: its size does not change, and
     it shrinks and grows with the strip. */
  box-shadow: inset 0 0 0 1px var(--tape-edge);
  rotate: var(--tape-turn);
  transform: translateZ(var(--tape-z, 1px)) translateX(-50%) scaleX(var(--tape-scale, 1)) translateX(50%);
  transform-origin: center;
  pointer-events: none;
  transition: transform 200ms ease-out var(--tape-delay, 0ms);
}

/* Two short tapes on a word's card that stands still on its board (CR-161 round 1, pair in PAPER,
   tape-pair from RTW.paper.lay): their centres at a quarter and three quarters of the card's width,
   both stepped toward the middle by --tape-pair-in where a corner mark needs it, each its own turn (--tape-tilt-2 for the
   second, drawn by the card's ::before; a lifted card's ::before is its place's outline, and draws
   no tape then anyway). Whatever the one tape does, both do: off, on, the turned side, the drag, a
   board with no card tape. But not as one (CR-163): one strip leads and the other follows by its
   --tape-delay, the card's --tape-lag (the first strip) or --tape-lag-2 (the second), one of them
   0, the other TAPE_LAG_MIN_MS to TAPE_LAG_MAX_MS (RTW.paper.lay in modes/common.js). */
.paper-card.tape-pair {
  --tape-width: var(--tape-pair-width);
  --tape-height: var(--tape-pair-height);
}

/* Each strip its own shift off its quarter (--tape-shift, --tape-shift-2) and its own length
   (--tape-cut, --tape-cut-2), kept clear of the marks by pairs() in modes/common.js, which decides
   the two tapes and --tape-pair-in with the shifts and the lengths counted in. */
.paper-card.tape-pair::after,
.paper-card.tape-pair:not(.is-lifted)::before {
  width: var(--tape-len);
}

.paper-card.tape-pair::after {
  --tape-delay: var(--tape-lag, 0ms);
  left: calc(25% + var(--tape-pair-in, 0px) - var(--tape-len) / 2 + var(--tape-shift, 0) * var(--tape-shift-max));
}

.paper-card.tape-pair:not(.is-lifted)::before {
  --tape-delay: var(--tape-lag-2, 0ms);
  --tape-turn: calc(var(--tape-tilt-2, 0) * var(--tape-turn-max));
  --tape-len: min(calc(var(--tape-width) * (1 - var(--tape-cut-2, 0))), var(--tape-cap, var(--tape-width)));
  left: calc(75% - var(--tape-pair-in, 0px) - var(--tape-len) / 2 + var(--tape-shift-2, 0) * var(--tape-shift-max));
}

.tape-off::after,
.tape-pair.tape-off:not(.is-lifted)::before {
  --tape-scale: 0;
  transition: transform 120ms ease-in var(--tape-delay, 0ms);
}

/* A new card: the tape is on at once. */
.tape-still::after,
.tape-pair.tape-still:not(.is-lifted)::before {
  transition: none;
}

/* A turned card is seen from behind, its tape too: a pixel behind the card's plane is in front of
   the face turned up, and the turn's mirror is undone on the tape's own turn. Cards turns about
   the vertical axis: the tape's left edge is on the right of the screen, so it grows from there.
   Pick's card turns top over bottom: its own top is at the bottom of the screen, so the tape
   moves to that edge, which shows as the upper one. Changed while the tape is off (RTW.paper.turn).
   Its shift is mirrored with the card (CR-156): it was taken off and stuck on again. */
.card.is-flipped::after,
.card.tape-pair.is-flipped:not(.is-lifted)::before {
  --tape-z: -1px;
  rotate: calc(-1 * var(--tape-turn));
}

/* Pick the word's card turns as Pick's does, top over bottom (CR-154). */
.pick-card.is-flipped::after,
.pick-card.tape-pair.is-flipped:not(.is-lifted)::before,
.meaning-card.is-flipped::after,
.meaning-card.tape-pair.is-flipped:not(.is-lifted)::before {
  --tape-z: -1px;
  top: auto;
  bottom: calc(-1 * var(--tape-over));
  rotate: calc(-1 * var(--tape-turn));
}

/* A board with more candidates than TAPE_MAX_CANDIDATES has no tape on them; a board whose PAPER
   says tape: false has none on its card either (CR-153; no board since New is taped, CR-161). */
.no-tape .paper-candidate::after,
.no-card-tape .paper-card::after,
.no-card-tape .paper-card.tape-pair:not(.is-lifted)::before {
  display: none;
}

/* A dragged note (CR-151, RTW.dragTo): the copy is the card, and its turn and its tape are the
   ghost's (the script turns it through its transform; the ghost carries paper-card or
   paper-candidate for the tape, which comes off as it follows). The part copied inside stands
   straight in it and draws no tape of its own. */
.drag-ghost.paper-card,
.drag-ghost.paper-candidate,
.drag-ghost .paper-card,
.drag-ghost .paper-candidate {
  rotate: none;
}

.drag-ghost .paper-card::after,
.drag-ghost .paper-candidate::after,
.drag-ghost .paper-card.tape-pair::before {
  display: none;
}

/* The place a lifted note left: nothing of it shows (surface, shadow, text, picture, flower,
   tape: the whole note hidden), only a faint 1 px dashed outline in its box, at its own turn and
   with its corners. Never opacity; the box stays, so nothing on the board moves. The syllable
   tiles keep their own lifted look (modes/syllable-type.css). */
.paper-card.is-lifted,
.paper-candidate.is-lifted {
  visibility: hidden;
}

.paper-card.is-lifted::before,
.paper-candidate.is-lifted::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed var(--place-line);
  border-radius: var(--card-radius);
  visibility: visible;
  pointer-events: none;
}

/* A wrong candidate after a right answer (RTW.paper.drop): its tape off, it falls straight down
   until wholly under the viewport's bottom edge (--fall-y, measured), turning on by --fall-turn
   the way it leans, over --fall-ms with a weight's ease-in (FALL_MS and FALL_TURN in
   modes/common.js), over the candidates below it, taking no pointer; then it is hidden and keeps
   its place. Never opacity: the tiles hold blended pictures. */
.paper-candidate.is-falling {
  z-index: 4;
  translate: 0 var(--fall-y, 0px);
  rotate: calc(var(--tilt, 0) * var(--tilt-candidate) * var(--tilt-scale, 1) + var(--fall-turn, 0deg));
  pointer-events: none;
  transition: translate var(--fall-ms, 450ms) cubic-bezier(0.55, 0, 1, 0.45), rotate var(--fall-ms, 450ms) cubic-bezier(0.55, 0, 1, 0.45);
}

.paper-candidate.is-fallen {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .paper-card::after,
  .paper-candidate::after,
  .paper-card.tape-pair:not(.is-lifted)::before {
    transition: none;
  }
}

/* The copy of a dragged tile or card (SPEC 5.9, RTW.dragTo in modes/common.js), in Pick,
   Listen, Match and Pick the word: drawn whole above everything with the card's shadow, never
   faded. The script sets its size, the source's measured sizes on the copy and its transform. */
.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  pointer-events: none;
}

.drag-ghost > * {
  box-shadow: var(--shadow);
}

/* A note in the hand (CR-151): the full --shadow over the small cards' own soft one, which their
   rules give with the weight of this selector's first half; the syllable tiles keep theirs. */
.drag-ghost > .drag-note {
  box-shadow: var(--shadow);
}

.drag-ghost.is-flying {
  transition: transform 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .drag-ghost.is-flying {
    transition: none;
  }
}

/* The Enter button of Build the word, Listen and build and Find the mistakes (SPEC 5.30, 5.41),
   in the middle row of each: here because three modes use it. The Enter key's shape (an ISO
   Enter: a wide top, a leg down the right) at 1.5 keys, hung from the middle row's top at its
   right edge. The shape is the cards' gradient clipped to the L by RTW.drawEnter
   (modes/common.js) from the measured size; the shadow follows the L. */
.syllable-enter {
  position: absolute;
  top: 4px;
  right: 0;
  width: calc(1.5 * var(--type-key-w));
  height: calc(1.5 * var(--type-key-h));
  padding: 0;
  border: 0;
  background: none;
  /* --shadow-soft's two shadows; a drop-shadow's blur is half a box-shadow's. */
  filter: drop-shadow(0 4px 6px rgba(20, 30, 50, 0.06)) drop-shadow(0 1px 1.5px rgba(20, 30, 50, 0.04));
}

.syllable-enter-shape {
  position: absolute;
  inset: 0;
  background: var(--surface-plain);
}

.syllable-enter:active:not(.is-idle) .syllable-enter-shape {
  filter: brightness(0.9);
}

/* Over the leg (the right two thirds) and in the top part (44% of the height). */
.syllable-enter-icon {
  position: absolute;
  left: calc(100% * 2 / 3 - 17px);
  top: calc(22% - 17px);
  width: 34px;
  height: 34px;
  background-color: var(--text);
  -webkit-mask: url(icons/enter.svg) center / contain no-repeat;
  mask: url(icons/enter.svg) center / contain no-repeat;
}

/* Nothing on the line yet: the hint's grey, and a press does nothing. */
.syllable-enter.is-idle .syllable-enter-icon {
  background-color: color-mix(in srgb, var(--text) 50%, var(--surface));
}

/* Bottom row: the attempts, inside the board under the deck. It has its height only in the
   modes that show attempts, so the faces stay put there; elsewhere it collapses and the deck
   gets the space. app.js mirrors the deck's data-mode on it. */

.bottom {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(calc(var(--deck-wide) + 2 * var(--pad)), 100%);
  height: 0;
  margin: 0 auto;
  padding: 0 var(--pad);
  overflow: hidden;
}

.bottom[data-mode="type"],
.bottom[data-mode="match"],
.bottom[data-mode="match-reverse"],
.bottom[data-mode="meaning"],
.bottom[data-mode="dictation"],
.bottom[data-mode="path-type"],
.bottom[data-mode="path-dictation"],
.bottom[data-mode="mistake-type"],
.bottom[data-mode="mistake-review"] {
  height: var(--bottom);
  overflow: visible;
}

/* Pick the word with one life shows no faces (RTW.attempts.hide), so the row collapses as in
   Pick and the deck gets the space (SPEC 5.13). */
.bottom[data-mode="meaning"]:not(:has(> .attempts.is-on)) {
  height: 0;
  overflow: hidden;
}

/* The faces: a smiling face per attempt left, a sad one per attempt lost. The lost face
   is faded red, lighter than the full red of a wrong answer; the thin outline needs more
   than the 25% the filled heart had. Invisible unless a mode shows them. */
.attempts {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.attempts:not(.is-on) {
  visibility: hidden;
}

.attempt {
  width: 24px;
  height: 24px;
  background-color: var(--ok);
  -webkit-mask: url(icons/smile.svg) center / 24px no-repeat;
  mask: url(icons/smile.svg) center / 24px no-repeat;
}

.attempt.is-lost {
  background-color: var(--bad);
  opacity: 0.4;
  -webkit-mask-image: url(icons/frown.svg);
  mask-image: url(icons/frown.svg);
}

/* Footer */

.footer {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 6 px at the sides puts each arrow box's centre 30 px from the edge, under the centre
     of the outermost header button (8 px header padding plus half of 44 px): back on the
     left, the voice selector on the right. Nothing on top: the board ends at the pager row. */
  padding: 0 6px 4px;
}

/* "Tap or swipe to continue" or, in Cards, "Tap to turn" over "Swipe once remembered": the shell's,
   the board's last row, above the pager in every mode; its margins are the footer's old top
   padding and its old gap to the pager, so the hint and the pager keep their places. The row is always laid out, so the hint showing moves
   nothing; Cards' first line stands above the row, where the bottom row is in the modes with
   attempts and nothing is in Cards, so the stage keeps its height (SPEC 5.3, 5.5). */
.hint {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  /* Never wider than the board (CR-153 round 3): a line of it, min-width 0, then has the board's
     room, which its fit (app.js) shrinks it to. */
  max-width: 100%;
  height: 24px;
  margin: var(--pad) 0 4px;
  /* Andrey's value (CR-145 round 3): the hand font's stroke is far heavier than the old italic's,
     so the page's text at full strength read as black at the pulse's peak; the icons follow the
     text's colour (.hint-icon). */
  color: color-mix(in srgb, var(--page-text) 40%, var(--bg));
  /* The hand font, upright: it has no italic and a synthetic slant is not wanted (CR-145 round 2).
     Each line is fitted from 16 down to 12 px before it wraps (app.js). */
  font-family: var(--font-hand);
  font-size-adjust: var(--hand-adjust);
  font-size: 16px;
  font-style: normal;
  line-height: 1.25;
  visibility: hidden;
}

/* The lines beside their icons: a line may narrow, so its fit sees the room the row leaves. It
   stays on one line while the fit (app.js, 16 down to 12 px) finds a size that fits the row's
   width, and may wrap only at the floor (is-tight). */
.hint-tap,
.hint-swipe,
.hint-turn > [data-label] {
  min-width: 0;
}

.hint-tap:not(.is-tight),
.hint-swipe:not(.is-tight),
.hint-turn > [data-label]:not(.is-tight) {
  white-space: nowrap;
}

.hint.is-on {
  visibility: visible;
  /* A slow pulse in the page's text colour so the eye finds it. */
  animation: hint-pulse 1.6s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

.hint-icon {
  flex: none;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: url(icons/tap.svg) center / 18px no-repeat;
  mask: url(icons/tap.svg) center / 18px no-repeat;
}

/* The continue hint shows the tap and the swipe icons; Cards' line shows the swipe icon alone. */
.hint-icon-swipe,
.hint[data-kind="swipe"] > .hint-icon-tap {
  -webkit-mask-image: url(icons/swipe.svg);
  mask-image: url(icons/swipe.svg);
}

.hint[data-kind="swipe"] > .hint-icon-swipe,
.hint[data-kind="swipe"] .hint-tap,
.hint:not([data-kind="swipe"]) .hint-swipe,
.hint:not([data-kind="swipe"]) .hint-turn {
  display: none;
}

/* As wide as its own line, centred on the row (the row is only as wide as the line in it), at most
   the viewport less the page padding, so the fit sees the room there is (CR-145 round 2). */
.hint-turn {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  width: max-content;
  max-width: calc(100vw - 2 * var(--pad));
  bottom: calc(100% + 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .hint.is-on {
    animation: none;
    opacity: 1;
  }
}

/* The pager: an empty arrow box, the learned pocket with "/ <count>" beside it, the next
   arrow. The row is as high as the pocket (--pocket-height, 64 px since CR-63 round 4), so the
   pocket sits 4 px above the footer's bottom; the 48 px arrow boxes are centred on it. */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-self: stretch;
}

/* The learned pocket and "/ <count>" (SPEC 5.22). Laid out always, so the footer keeps its
   height while there is no set state; above the flying card's 6, so the card goes under the
   lid, and above the entering board's sweep. */
.learned {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 7;
  visibility: hidden;
}

.learned.is-on {
  visibility: visible;
}

/* --pocket-height high, the drawing's 480 x 494 giving the width. The shadow is --shadow as two drop
   shadows (a drop-shadow blur is a standard deviation, half a box-shadow's), so it follows the
   dome. A tap does nothing yet. */
.pocket {
  position: relative;
  display: block;
  flex: none;
  height: var(--pocket-height);
  width: var(--pocket-width);
  padding: 0;
  border: 0;
  background: none;
  filter: drop-shadow(0 8px 12px rgba(20, 30, 50, 0.12)) drop-shadow(0 2px 3px rgba(20, 30, 50, 0.08));
  transform-origin: center;
}

.pocket:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The drawing and the number together, so the shake (below) turns them as one about the
   pocket's bottom centre while the button grows about its own centre. */
.pocket-body {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 50% 100%;
}

.pocket .pocket-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pocket-svg .is-off {
  display: none;
}

/* The drawing's greys recoloured (CR-63 round 4): a CSS fill or stroke outweighs the SVG's
   presentation attributes. Prefix selectors, so the state layers need no listing; the lenses'
   linear gradients stay as drawn, and pocket.js's visibility rule is untouched. */
.pocket-svg [id^="pocket-folder-back"] {
  fill: var(--pocket-back);
  stroke: var(--pocket-line);
}

.pocket-svg [id^="pocket-lid-"] {
  fill: var(--pocket-lid);
}

.pocket-svg [id^="pocket-outline-"] {
  stroke: var(--pocket-line);
}

.pocket-svg [id^="pocket-stitch-"] {
  stroke: var(--pocket-line);
}

.pocket-svg [id^="pocket-radialGradient-"] stop {
  stop-color: var(--pocket-crease);
}

/* It grows with the flight, 300ms as POCKET_FLY_MS in pocket.js, and settles back once the
   card has landed, 200ms as POCKET_SETTLE_MS. */
.pocket.is-taking {
  transform: scale(var(--pocket-grow));
  transition: transform 300ms ease-out;
}

.pocket.is-settling {
  transform: scale(1);
  transition: transform 200ms ease-in;
}

/* "/ <count>" steps aside by half the pocket's extra width while it is grown, so the two never
   overlap; 300ms is POCKET_FLY_MS and 200ms POCKET_SETTLE_MS in pocket.js, as the pocket's. */
.pocket.is-taking + .pocket-total {
  translate: calc(var(--pocket-width) * (var(--pocket-grow) - 1) / 2) 0;
  transition: translate 300ms ease-out;
}

.pocket.is-settling + .pocket-total {
  translate: 0 0;
  transition: translate 200ms ease-in;
}

/* A card taken out of the pocket (pocket.js give) and a review failed (lose), CR-79: the pocket
   grows over POCKET_SHAKE_MS (350 ms, the entry's ENTRY_MS) while its drawing and number shake
   three times about the bottom centre, to POCKET_SHAKE_DEG (6) either way, lifted by
   POCKET_SHAKE_LIFT_PX (3) at every extreme; "/ <count>" steps aside as in the flight in. It
   settles with is-settling. */
.pocket.is-shaking {
  transform: scale(var(--pocket-grow));
  transition: transform 350ms ease-out;
}

.pocket.is-shaking .pocket-body {
  animation: pocket-shake 350ms ease-in-out;
}

.pocket.is-shaking + .pocket-total {
  translate: calc(var(--pocket-width) * (var(--pocket-grow) - 1) / 2) 0;
  transition: translate 350ms ease-out;
}

@keyframes pocket-shake {
  0% { transform: none; }
  14.29% { transform: translateY(-3px) rotate(6deg); }
  28.57% { transform: translateY(-3px) rotate(-6deg); }
  42.86% { transform: translateY(-3px) rotate(6deg); }
  57.14% { transform: translateY(-3px) rotate(-6deg); }
  71.43% { transform: translateY(-3px) rotate(6deg); }
  85.71% { transform: translateY(-3px) rotate(-6deg); }
  100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pocket.is-taking,
  .pocket.is-settling,
  .pocket.is-shaking,
  .pocket.is-taking + .pocket-total,
  .pocket.is-settling + .pocket-total,
  .pocket.is-shaking + .pocket-total {
    transition: none;
  }

  .pocket.is-shaking .pocket-body {
    animation: none;
  }
}

/* Over the lid, which runs from y 209 to 439 of the drawing's 494. The sizes were 17 and 13 px
   at 56 px high and scale with the pocket. */
.pocket-count {
  position: absolute;
  left: 0;
  right: 0;
  top: 42.3%;
  height: 46.6%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pocket-count);
  font-size: calc(var(--pocket-height) * 17 / 56);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
}

.pocket-count.is-wide {
  font-size: calc(var(--pocket-height) * 13 / 56);
}

/* On the number's line, not the pocket's middle: 0.656 of the pocket's height is the centre of
   .pocket-count's box (its top 42.3% plus half its height 46.6%), half of it the middle; if
   .pocket-count's top or height ever change, this changes with them. A top, not a translate:
   round 1's step aside during the growth is the translate, and the two compose. */
.pocket-total {
  position: relative;
  top: calc(var(--pocket-height) * 0.656 - var(--pocket-height) / 2);
  color: var(--page-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.pocket-total b {
  font-weight: 600;
}

/* The sheets (CR-64, shared since CR-65, windows since CR-66 round 1, anchored to their openers
   since round 2): the words screen (words.css) and the feedback sheet (feedback.css) are one box
   over the cards screen, header included, 10 px in from the sides, on the sheet's dark base; above
   the learned block (7), under the hint stickers (10) and the modals (11). Each sets the edge it grows from, 10 px inside the
   cards block (which sits inside the body's safe-area padding): the words sheet its bottom, a
   bottom sheet out of the pocket; the feedback sheet its top, a top sheet out of the bug button.
   A flex column as tall as its content and at most the block less 20 px: the bar stays, the body
   under it shrinks and scrolls inside.
   It grows out of its opener (--sheet-origin-x and -y, the opener's centre in its box) and goes
   back into it. The rounded corners clip the content, always, the bar's corners too. Each sheet
   maps its own variables onto these. The two are never open together: the top bar, which holds
   the other's opener, is inert while one is open. z-index 9: over the glass (8), which follows
   #cards in the body; #cards makes no stacking context, so the two compare at the root. */
.sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  max-height: calc(100% - 20px);
  z-index: 9;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--sheet-bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform-origin: var(--sheet-origin-x, 50%) var(--sheet-origin-y, 100%);
}

/* A top sheet (CR-68, the feedback sheet's rules of CR-66 rounds 2 and 4, shared with the
   settings sheet): its top at the top bar's bottom edge since CR-89 (sheet.js sets --sheet-top from the header's box
   on every opening), the icons sharp and inert above the glass (CR-66 round 13), as a popover from
   its button; growing downward with its view, so the nested views change its height downward and
   its top edge never moves; at most down to 10 px above the cards block's bottom. Grown out of its
   button (sheet.js sets --sheet-origin-x and -y, the button's centre in its box, on the section)
   and going back into it. */
.sheet.sheet-top {
  top: var(--sheet-top, 10px);
  bottom: auto;
  max-height: calc(100% - var(--sheet-top, 10px) - 10px);
}

/* The sheet's 1 px light edge runs under the bar only (CR-66 round 2): drawn as the sheet's own
   border it lies over the bar's top and sides, since overflow clips the bar to the padding box,
   inside the border, and reads as a light plate fading upward. Over the content, not taking
   pointer events. */
.sheet::after {
  content: "";
  position: absolute;
  inset: 40px 0 0;
  border: 1px solid var(--sheet-edge);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  pointer-events: none;
}

/* A centred sheet (the goal card of SPEC 5.29; shared with the intro card of CR-103, gone in CR-109): its
   own size in the cards screen's middle, as tall as its content; it grows out of its opener and
   goes back into it with the sheets' drop (sheet.js), the transform composing with the centring
   translate. */
.sheet.sheet-centred {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(320px, 100% - 40px);
  max-height: none;
  translate: -50% -50%;
  padding: 24px;
}

/* No bar: the light edge runs all round. */
.sheet-centred::after {
  inset: 0;
  border-top: 1px solid var(--sheet-edge);
  border-radius: 20px;
}

/* The glass (CR-66 round 13): under an open sheet the page is not dimmed but blurred, from 8 px
   above the top bar's bottom edge (--glass-top, in viewport pixels, set by words.js and feedback.js
   on every opening; the icons end 10 px above it, so they stay off the glass) to the screen's
   bottom. Its top edge is feathered (round 14): the mask takes the blur from nothing at the top to
   full over those 8 px (CR-89; 32 px before), so the blur is full from the bar's bottom edge, where
   the sheets start, and no sharp strip of the card shows over them; the feather never reaches
   the page's top pixels; the page keeps its colour, so nothing at the top or in the status
   bar has to follow. The top bar stays sharp and live above it: its buttons switch sheets or
   leave (CR-69). A tap on it closes the sheet. The two top sheets share one, #sheet-glass, which
   stays shown through a switch. It follows #cards in the body, so its fixed box is the viewport whatever #cards
   does (the shake's transform); z-index 8, under the sheets (9), the Undo chip (9, later), the hint
   stickers (10) and the modals (11). */
.sheet-scrim {
  position: fixed;
  top: calc(var(--glass-top) - 8px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  background: transparent;
  -webkit-backdrop-filter: blur(var(--glass));
  backdrop-filter: blur(var(--glass));
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 8px);
  mask-image: linear-gradient(to bottom, transparent 0, black 8px);
}

/* The blur grows from nothing with the sheet's drop and clears with its return: WORDS_OPEN_MS and
   FEEDBACK_OPEN_MS (350 ms) in, WORDS_CLOSE_MS and FEEDBACK_CLOSE_MS (250 ms) out; the glass is
   hidden when the closing ends; the feather is static, only the radius moves. Reduced motion: the
   full blur at once. */
.sheet-scrim.is-opening {
  animation: glass-in 350ms ease-out both;
}

.sheet-scrim.is-closing {
  animation: glass-out 250ms ease-in both;
}

@keyframes glass-in {
  from { -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
  to { -webkit-backdrop-filter: blur(var(--glass)); backdrop-filter: blur(var(--glass)); }
}

@keyframes glass-out {
  from { -webkit-backdrop-filter: blur(var(--glass)); backdrop-filter: blur(var(--glass)); }
  to { -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
}

/* A drop at the opener, taller before wider, its corners settling to the sheet's 20 px as it
   fills the area, its text fading in (no pictures on a sheet, so opacity is allowed):
   WORDS_OPEN_MS and FEEDBACK_OPEN_MS, and back into the opener, WORDS_CLOSE_MS and
   FEEDBACK_CLOSE_MS. */
.sheet.is-opening,
.sheet.is-closing {
  pointer-events: none;
  will-change: transform;
}

.sheet.is-opening {
  animation: sheet-open 350ms ease-out both;
}

.sheet.is-closing {
  animation: sheet-close 250ms ease-in both;
}

@keyframes sheet-open {
  0% { transform: scale(0.06, 0.06); border-radius: 28px; opacity: 0; }
  60% { transform: scale(0.6, 0.9); border-radius: 20px; opacity: 1; }
  100% { transform: scale(1, 1); border-radius: 20px; opacity: 1; }
}

@keyframes sheet-close {
  0% { transform: scale(1, 1); border-radius: 20px; opacity: 1; }
  40% { transform: scale(0.6, 0.9); border-radius: 20px; opacity: 1; }
  100% { transform: scale(0.06, 0.06); border-radius: 28px; opacity: 0; }
}

/* The title bar of every sheet: 40 px, darker than the sheet with a darker line under it, the
   title centred, the cross at the right; the back chevron at the left only where a view has a
   parent, otherwise hidden in its place (is-off) so the title stays centred. Its fill reaches the
   sheet's outer edge, rounded by the sheet's corners; the light edge starts under it (.sheet::after),
   so nothing lighter lies above or beside it (CR-66 round 2). The 44 px buttons stand 2 px over the
   row above and below; they have no fill. */
.sheet-bar {
  flex: none;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 40px;
  margin: 0;
  padding: 0 3px;
  background: var(--sheet-bar);
  border-bottom: 1px solid var(--sheet-bar-line);
  overflow: visible;
}

.sheet-title {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  color: var(--sheet-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 40px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-back,
.sheet-close {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.sheet-back {
  grid-column: 1;
}

.sheet-close {
  grid-column: 3;
}

.sheet-back::before,
.sheet-close::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--sheet-text);
}

.sheet-back::before {
  -webkit-mask: url(icons/arrow-back.svg) center / 24px no-repeat;
  mask: url(icons/arrow-back.svg) center / 24px no-repeat;
}

.sheet-close::before {
  -webkit-mask: url(icons/clear.svg) center / 22px no-repeat;
  mask: url(icons/clear.svg) center / 22px no-repeat;
}

.sheet-back:active,
.sheet-close:active {
  background: var(--sheet-line);
}

.sheet-back.is-off,
.sheet-close.is-off {
  visibility: hidden;
}

.sheet-back:focus-visible,
.sheet-close:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

/* A section on a sheet: a divider line before it, then a lighter plate heading the group, the
   caption bold at the left (the centred text is the window's title alone); the group right under
   the plate keeps only its bottom corners. */
.sheet-divider {
  height: 1px;
  margin: 12px 0;
  border: 0;
  background: var(--sheet-line);
}

.sheet-caption {
  height: 32px;
  margin: 0;
  padding: 0 16px;
  border-radius: 12px 12px 0 0;
  background: var(--sheet-plate);
  color: var(--sheet-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 32px;
}

.sheet-caption + .feedback-group {
  border-radius: 0 0 14px 14px;
}

/* The sheets' segmented control (the words sheet's Learned and Known, the home screen's My lists
   and Catalog, CR-129): a track on the sheet surface, the unchosen caption muted; each screen tints
   the chosen half. */
.sheet-tabs {
  flex: none;
  display: flex;
  height: 44px;
  border-radius: 12px;
  background: var(--sheet-surface);
}

.sheet-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--sheet-muted);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.sheet-tab.is-on {
  font-weight: 700;
}

/* A list's group (the words list, My reports): the list tier, quieter than the buttons' surface;
   its rows' primary text in the rows' text tier. */
.sheet-group {
  background: var(--sheet-surface-low);
}

/* A text field sunk into the sheet, one rule for every sheet's field (the words search, the
   feedback comment): darker than the sheet, a light border all round, brighter on focus, no
   outline, no inner line. */
.sheet-field {
  border: 1px solid var(--sheet-field-edge);
  border-radius: 12px;
  background: var(--sheet-field);
  background-clip: padding-box;
  box-shadow: none;
  color: var(--sheet-text);
  caret-color: var(--sheet-text);
  outline: none;
}

.sheet-field::placeholder {
  color: var(--sheet-muted);
}

.sheet-field:focus,
.sheet-field:focus-visible {
  border-color: var(--sheet-field-focus);
  outline: none;
}

/* A learned word or its translation on a card (CR-152): the card's face, its
   article and transliteration inheriting it. The words sheet and the home screen keep the page's. */
.word,
.translation,
.picture-word,
.picture-translation,
.picture-shown {
  font-family: var(--font-card);
  font-size-adjust: var(--hand-adjust);
}

/* The article before a learned word (SPEC 5.36, DESIGN.md Type): the word's size, a regular
   weight, the muted tone of the surface it stands on, --muted on a card or a tile by default; a
   page or a sheet sets --article-muted to its own (words.css). The word stays the bold thing. */
.word-article {
  color: var(--article-muted, var(--muted));
  font-size: inherit;
  font-weight: 400;
}

/* The rise of a word (modes/common.js, RTW.rise; MOTION.md 3 and 19): the rescue's word line and
   New's stamp on Learn. A character of the line waits for its copy to land. */
.rise-char {
  visibility: hidden;
}

.rise-char.is-landed {
  visibility: visible;
}

/* A character's copy on its way from beyond the screen to the line, over everything on its
   layer; RTW.rise sets its size, its weight and its colour, those of its landing character. */
.rise-copy {
  position: absolute;
  font-family: var(--font-card);
  font-size-adjust: var(--hand-adjust);
  z-index: 4;
  color: var(--text);
  line-height: 1.2;
  white-space: pre;
  pointer-events: none;
  transform-origin: 50% 50%;
}

/* The transliteration under a learned word (SPEC 5.37, DESIGN.md Type): a line of its own inside
   the word's element (modes/common.js, RTW.showWord), so it follows the word's fitted size and
   alignment; three quarters of the word's size (0.7 on a tight board), never under 12 px, a
   regular weight, the muted tone of the surface, as the article. It is out of the layout while
   RTW.fitText measures the word, and never widens it. A tight board shows it on every word card
   or on none (RTW.translitBoard). */
.word-translit {
  display: block;
  color: var(--article-muted, var(--muted));
  font-size: max(12px, calc(var(--translit-scale, 0.75) * 1em));
  font-weight: 400;
  overflow-wrap: anywhere;
  hyphens: none;
}

.is-fitting-word > .word-translit,
.is-translit-off .word-translit {
  display: none;
}

.is-translit-board {
  --translit-scale: 0.7;
}

/* A sheet's switch (CR-132, DESIGN.md "The settings sheet"): the platform's, at the right of a
   row that is the switch (role="switch", the row carries aria-checked). Off a sunken track with
   the field's edge, on the sheet's colour of a chosen thing; the white thumb slides. */
.sheet-switch {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  border: 1px solid var(--sheet-field-edge);
  border-radius: 15px;
  background: var(--sheet-field);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.sheet-switch::after {
  content: "";
  position: absolute;
  /* 2 px from the track's outer edge, inside its 1 px border. */
  top: 1px;
  left: 1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 150ms ease;
}

[aria-checked="true"] > .sheet-switch {
  border-color: var(--sheet-accent);
  background: var(--sheet-accent);
}

[aria-checked="true"] > .sheet-switch::after {
  transform: translateX(20px);
}

@media (prefers-reduced-motion: reduce) {
  .sheet-switch,
  .sheet-switch::after {
    transition: none;
  }
}

/* A sheet's button (the feedback sheet's Send and a report's actions, the goal card's Another
   round): 44 px, a 2 px border and text in the learned green on the buttons' surface; the feedback
   report's buttons change the colour. */
.sheet-button {
  height: 44px;
  padding: 0 12px;
  border: 2px solid var(--sheet-learned);
  border-radius: 12px;
  background: var(--sheet-surface);
  color: var(--sheet-learned);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.sheet-button:disabled {
  border-color: color-mix(in srgb, var(--sheet-muted) 50%, transparent);
  background: transparent;
  color: color-mix(in srgb, var(--sheet-muted) 50%, transparent);
  cursor: default;
}

/* The sheet's footer slot, under the scrolling body: what must stay reachable however long the
   list is (the feedback sheet's Archive card). */
.sheet-footer {
  flex: none;
  padding: 8px 16px 16px;
}

/* The sheets' link card (the feedback sheet's Archive card, the home panel's Acknowledgment): not a
   row of a group but a card of its own in the footer, 8 px under the group or pinned at the bottom
   when the list overflows; a bluer fill, the text and the icons in the lightened accent. Each
   screen gives the icon its mask. */
.sheet-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--sheet-link);
  color: var(--sheet-accent);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.sheet-link:active {
  background: color-mix(in srgb, black 12%, var(--sheet-link));
}

.sheet-link:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: -2px;
}

.sheet-link-title {
  flex: 1 1 auto;
  min-width: 0;
}

.sheet-link-icon,
.sheet-chevron {
  flex: none;
  width: 22px;
  height: 22px;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

.sheet-link .sheet-link-icon,
.sheet-link .sheet-chevron {
  background-color: var(--sheet-accent);
}

.sheet-chevron {
  -webkit-mask-image: url(icons/chevron-right.svg);
  mask-image: url(icons/chevron-right.svg);
}

.sheet-chevron[hidden] {
  display: none;
}

/* The light sheets (CR-97 round 5, DESIGN.md "Colour"): the acknowledgment and the install sheet,
   long text that reads as dark on light. The body and the footer on --sheet-light-bg with the cards'
   text (CR-100 round 2: the cards' white was harsh; CR-97 round 6: the page colour read dull). The
   bar in --sheet-surface, lighter than the blurred dark home (CR-100 round 2: the sheets' own bar
   merged with it), with no line under it; the sheets' light edge goes round the bar's top and sides
   only, so the window has a silhouette against the dark and nothing lies on the light body. The
   box, shadow, mechanic and motion are the sheets'. */
.sheet.sheet-light {
  background: var(--sheet-light-bg);
}

.sheet.sheet-light::after {
  inset: 0 0 auto;
  height: 40px;
  border: 1px solid var(--sheet-edge);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
}

.sheet-light .sheet-bar {
  background: var(--sheet-surface);
  border-bottom: 0;
}

/* A sheet's checkbox (the words rows, the feedback's Word form): the input is there for the label
   and the keyboard, the box is drawn. */
.sheet-check {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.sheet-box {
  flex: none;
  position: relative;
  width: 22px;
  height: 22px;
  border: 2px solid color-mix(in srgb, var(--sheet-muted) 60%, transparent);
  border-radius: 6px;
  overflow: visible;
}

/* The box never fills: checked, the New card's Skip mark (Andrey's brushed check) lies over it
   in the learned green, 26 px wide by the shape's aspect, its centre 2 px right of and 2 px above
   the box's, spilling over the box's right and top edges like a tick put down by hand. */
.sheet-check:checked + .sheet-box {
  border-color: color-mix(in srgb, var(--sheet-muted) 60%, transparent);
  background: transparent;
}

.sheet-check:checked + .sheet-box::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 22.4px;
  left: calc(50% - 13px + 2px);
  top: calc(50% - 11.2px - 2px);
  background-color: var(--flower-10);
  -webkit-mask: url(icons/check-brush.svg) center / contain no-repeat;
  mask: url(icons/check-brush.svg) center / contain no-repeat;
}

.sheet-check:focus-visible + .sheet-box {
  outline: 2px solid var(--sheet-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sheet.is-opening,
  .sheet.is-closing,
  .sheet-scrim.is-opening,
  .sheet-scrim.is-closing {
    animation: none;
  }
}

/* The hint stickers (CR-109, SPEC 5.34, MOTION.md section 15): a sticky note over the screen,
   z-index 10 with its glass, over the sheets (9) and under the modals (11).
   The glass: the sheets' glass with a lighter blur (--glass-hint), from 8 px above its top edge
   (--hint-top, the top bar's bottom edge or the status-bar plate's on the home screen, set by
   hint.js on every opening) to the screen's bottom, the same feathered top; the bar above it stays
   sharp and live. A tap on it closes the sticker. */
.hint-glass {
  position: fixed;
  top: calc(var(--hint-top, 0px) - 8px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: transparent;
  -webkit-backdrop-filter: blur(var(--glass-hint));
  backdrop-filter: blur(var(--glass-hint));
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 8px);
  mask-image: linear-gradient(to bottom, transparent 0, black 8px);
}

/* The blur grows with the note and clears with it: HINT_OPEN_MS and HINT_CLOSE_MS in hint.js. */
.hint-glass.is-opening {
  animation: hint-glass-in 350ms ease-out both;
}

.hint-glass.is-closing {
  animation: hint-glass-out 250ms ease-in both;
}

@keyframes hint-glass-in {
  from { -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
  to { -webkit-backdrop-filter: blur(var(--glass-hint)); backdrop-filter: blur(var(--glass-hint)); }
}

@keyframes hint-glass-out {
  from { -webkit-backdrop-filter: blur(var(--glass-hint)); backdrop-filter: blur(var(--glass-hint)); }
  to { -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
}

/* The sticker's box: centred on the screen (round 1; centred under the top bar it sat low), by
   top and left at 50% and the individual translate, which composes with the motion's transform as
   the goal card's does; as tall as its content, at most 320 px wide (40 px less than the screen on
   a narrow one). It carries the motion only, about the "?" it came out of (--hint-origin-x and -y,
   the button's centre in its box, set by hint.js); the paper inside carries the look and its turn. */
.hint-sticker {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10;
  width: min(320px, 100% - 40px);
  /* --hint-shift: off the element the sticker explains, when that lies under its centre (hint.js). */
  translate: -50% calc(-50% + var(--hint-shift, 0px));
  transform-origin: var(--hint-origin-x, 50%) var(--hint-origin-y, 50%);
}

/* Out of the "?" with a turn, the card entry's spirit (MOTION.md 1): from 0.1 at the button's
   centre turned -25 degrees to its place (the paper's own degree added) over HINT_OPEN_MS, ease-out;
   back into it over HINT_CLOSE_MS, ease-in. The paper holds no picture, so it may fade in. */
.hint-sticker.is-opening,
.hint-sticker.is-closing {
  pointer-events: none;
  will-change: transform;
}

.hint-sticker.is-opening {
  animation: hint-open 350ms ease-out both;
}

.hint-sticker.is-closing {
  animation: hint-close 250ms ease-in both;
}

@keyframes hint-open {
  from { transform: scale(0.1) rotate(-26deg); opacity: 0; }
  30% { opacity: 1; }
  to { transform: none; opacity: 1; }
}

@keyframes hint-close {
  from { transform: none; opacity: 1; }
  70% { opacity: 1; }
  to { transform: scale(0.1) rotate(-26deg); opacity: 0; }
}

/* The note: the cards' text on the lit yellow, 12 px corners, turned a degree, the sheets' shadow. */
.hint-paper {
  position: relative;
  font-family: var(--font-note);
  font-size-adjust: var(--hand-adjust);
  padding: 24px 20px 20px;
  border-radius: var(--card-radius);
  background: var(--hint-bg);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  rotate: 1deg;
  text-align: left;
}

/* A strip of tape over the top edge, the translucent white of a real one. It sticks on from its
   left edge to its right once the note has landed (round 1: hint.js adds is-stuck at the open's
   end; 200 ms ease-out). */
.hint-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 96px;
  height: 22px;
  margin-left: -48px;
  background: var(--tape);
  /* The tape's hairline, as on the cards' strips (CR-155). */
  box-shadow: inset 0 0 0 1px var(--tape-edge);
  rotate: -3deg;
  transform: scaleX(0);
  transform-origin: left center;
}

.hint-sticker.is-stuck .hint-tape {
  animation: hint-tape-on 200ms ease-out both;
}

@keyframes hint-tape-on {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* The sticker's title over its text, a blank line (a line of the text) under it (round 5). */
.hint-title {
  /* Where the app speaks: by hand, as the text under it (CR-153 round 3, CR-154). */
  font-family: var(--font-note-title);
  font-size-adjust: var(--hand-adjust);
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

/* The labels' own line breaks, kept: a paragraph each (hint.js), 6 px apart. 18 px since round 5
   (17 read small on the phone). */
.hint-text {
  font-size: 18px;
  line-height: 1.4;
  white-space: pre-line;
}

.hint-text > p {
  margin: 0;
}

.hint-text > p + p {
  margin-top: 6px;
}

.hint-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-style: italic;
  line-height: 1.45;
  white-space: pre-line;
}

/* The tour: one row per button, its icon at the left in the top bar's colour. */
.hint-tour {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: normal;
}

.hint-tour-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hint-tour-icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--pocket-line);
}

.hint-tour-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* The gear inline in the words in progress' text, in the text's colour. */
.hint-gear {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* The bug's badge stays off, as in the bar at rest. */
.hint-tour-icon .badge {
  display: none;
}

/* The sticker's buttons, centred 24 px under the text in one column, so the easy levels offer's
   second button is as wide as the pill (SPEC 5.38). */
.hint-actions {
  display: grid;
  grid-template-columns: minmax(160px, max-content);
  justify-content: center;
  row-gap: 4px;
  margin-top: 24px;
}

/* A pill in the note's own palette (round 1: the blue primary pill fought the yellow). */
.hint-button {
  /* A number, not the button's normal: the cards' face's own spacing is 1.61 em (CR-153 round 3);
     1.2 is the page's type's normal. */
  line-height: 1.2;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--hint-button);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-note);
  font-size-adjust: var(--hand-adjust);
}

.hint-button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.hint-button:disabled,
.hint-second:disabled {
  opacity: 0.5;
}

/* The easy levels offer's (SPEC 5.38): 4 px under the pill a second button in plain text, as wide
   as the pill, so a refusal is as easy as a consent and does not look like the primary action. */
.hint-second {
  line-height: 1.2;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  font-family: var(--font-note);
  font-size-adjust: var(--hand-adjust);
}

.hint-second:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Its error line between the text and the pill, in the dialogs' error colour; in the layout only
   while shown (the hidden attribute). */
.hint-error {
  margin: 16px 0 0;
  color: var(--sheet-bad);
  font-size: 14px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .hint-sticker.is-opening,
  .hint-sticker.is-closing,
  .hint-glass.is-opening,
  .hint-glass.is-closing,
  .hint-sticker.is-stuck .hint-tape {
    animation: none;
  }

  .hint-tape {
    transform: none;
  }
}

/* The note on a phone turned on its side (CR-149, SPEC 5.5): the app is laid out for a phone held
   upright. Shown by html.is-sideways alone (app.js), with no motion: the turn is the motion. The
   glass covers the whole screen, the top bar too, with the sheets' blur, not the stickers': what
   lies under it is a broken layout and nothing on it is pressed. z-index 200: over the sheets, the
   stickers, the modals and a dragged copy (100). No status bar is drawn on a phone on its side. */
.rotate {
  display: none;
}

.is-sideways .rotate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: transparent;
  -webkit-backdrop-filter: blur(var(--glass));
  backdrop-filter: blur(var(--glass));
}

/* The hint sticker's paper and tape, the tape on from the start (no landing to wait for); the
   drawing and one line in the sticker's title type, centred. */
.rotate-paper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(320px, 100% - 40px);
  text-align: center;
}

.rotate-paper > .hint-tape {
  transform: none;
}

.rotate-icon {
  width: 48px;
  height: 48px;
  background-color: var(--pocket-line);
  -webkit-mask: url(icons/rotate-phone.svg) center / 48px no-repeat;
  mask: url(icons/rotate-phone.svg) center / 48px no-repeat;
}

.rotate-text {
  /* The sticker's title type, by hand (CR-153 round 3). */
  font-family: var(--font-note-title);
  font-size-adjust: var(--hand-adjust);
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

/* The dialogs (CR-131, SPEC 5.5, MOTION.md 16): the remove, the update and the tester dialog, one
   component in the sheets' look: a centred box on the sheet's dark base, its light edge all round
   and the sheets' shadow, the sheets' bar with the title (and the cross where the dialog may be
   dismissed), on the sheets' glass over the whole screen. Nothing dims the page under a dialog.
   z-index 11 and 12: over the hint stickers (10), so the update dialog covers one. The box at most
   360 px wide, 20 px corners; the body 16 px in --sheet-text-low; buttons 44 px, the sheets'
   outline button in --sheet-accent; a destructive one filled with --sheet-delete, its text white
   (CR-131 round 1: the red outline was hard to read on the blue). Yellow is the hint's alone. */
.dialog-glass {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: transparent;
  -webkit-backdrop-filter: blur(var(--glass));
  backdrop-filter: blur(var(--glass));
}

.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 12;
  display: flex;
  flex-direction: column;
  width: min(360px, 100% - 32px);
  max-height: calc(100% - 40px);
  translate: -50% -50%;
  border-radius: 20px;
  background: var(--sheet-bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.dialog:focus {
  outline: none;
}

/* The edge all round, over the bar too: the box has no sheet behind it to meet. */
.dialog::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--sheet-edge);
  border-radius: 20px;
  pointer-events: none;
}

/* A dialog's title may be long (the update's names the version): it wraps in the bar. */
.dialog .sheet-bar {
  height: auto;
  min-height: 40px;
}

.dialog .sheet-title {
  padding: 9px 0;
  line-height: 22px;
  white-space: normal;
}

/* Without a cross the title takes the bar's width. */
.dialog-bar-plain {
  grid-template-columns: 12px 1fr 12px;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}

.dialog-name {
  margin: 0;
  color: var(--sheet-text);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.dialog-text {
  margin: 0;
  color: var(--sheet-text-low);
  font-size: 16px;
  line-height: 1.45;
}

.dialog-button {
  width: 100%;
  border-color: var(--sheet-accent);
  color: var(--sheet-accent);
}

/* Delete is one button on the dark base (DESIGN.md): the feedback report's Delete is the same
   (feedback.css). Disabled, the other buttons' disabled outline, no fill. */
.dialog-button.is-bad {
  border-color: var(--sheet-delete);
  background: var(--sheet-delete);
  color: white;
}

.dialog-button:disabled,
.dialog-button.is-bad:disabled {
  border-color: color-mix(in srgb, var(--sheet-muted) 50%, transparent);
  background: transparent;
  color: color-mix(in srgb, var(--sheet-muted) 50%, transparent);
}

.dialog-button:focus {
  outline: none;
}

.dialog-button:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: 2px;
}

/* Kept in the layout while hidden, so the box does not grow when it shows. */
.dialog-error {
  min-height: 1lh;
  margin: -6px 0 0;
  color: var(--sheet-bad);
  font-size: 14px;
  text-align: center;
  visibility: hidden;
}

.dialog-error.is-on {
  visibility: visible;
}

.dialog-note {
  margin: -6px 0 0;
  color: var(--sheet-faint);
  font-size: 13px;
  text-align: center;
}

/* The language dialog (CR-131 round 1, SPEC 5.1): its two lines 15 px; the languages group's radio
   rows without the check, the flag and the name, 48 px, on --sheet-surface, a 1 px --sheet-line
   between them. */
.lang-dialog-text {
  font-size: 15px;
  white-space: pre-line;
}

.lang-dialog-list {
  flex: none;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  background: var(--sheet-surface);
  list-style: none;
  overflow: hidden;
}

.lang-dialog-list li + li .settings-row {
  border-top: 1px solid var(--sheet-line);
}

.lang-dialog-row:active {
  background: color-mix(in srgb, white 4%, var(--sheet-surface));
}

.lang-dialog-row:disabled .settings-row-text,
.lang-dialog-row:disabled .home-flag {
  opacity: 0.5;
}

/* The remove dialog's levels: the sheets' checkboxes in one wrapping row, each with its level as
   the caption, in its level colour. */
.remove-levels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remove-level {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}

.remove-level-name {
  color: var(--level);
  font-size: 15px;
  font-weight: 600;
}

.tester-password {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  /* 16 px: below it iOS zooms the page into the field. */
  font-size: 16px;
  user-select: text;
  -webkit-user-select: text;
}

/* Opens from the centre: scale 0.92 to 1 with the glass, 200 ms; closes in 150 ms. */
.dialog.is-opening {
  animation: dialog-open 200ms ease-out both;
}

.dialog.is-closing {
  pointer-events: none;
  animation: dialog-close 150ms ease-in both;
}

.dialog-glass.is-opening {
  animation: glass-in 200ms ease-out both;
}

.dialog-glass.is-closing {
  animation: glass-out 150ms ease-in both;
}

@keyframes dialog-open {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes dialog-close {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.92); opacity: 0; }
}

/* The loader (CR-131 and round 2, SPEC 5.35, MOTION.md 16): the health flower at 64 px in its own
   looks, the same on every background: three neighbouring petals passed (their own colour, the dark
   stroke) running round it (loader.js), the other seven unpassed (their colour at 20% over the
   cards' surface, a 50% stroke), the centre in the passed look of the first of the three; no
   fades. A status block in .is-loading shows nothing until loader.js adds .is-shown; the loading
   label shows only with the flower. On the dark base the word is --sheet-muted, on the page
   --page-muted, 14 px, 10 px under the flower. */
.loader {
  display: none;
}

.status.is-loading {
  gap: 10px;
  visibility: hidden;
}

.status.is-loading.is-shown {
  visibility: visible;
}

.status.is-loading .loader {
  display: block;
}

.status.is-loading .status-text {
  color: var(--page-muted);
  font-size: 14px;
}

.home-status.is-loading .status-text,
.words-status.is-loading .status-text,
.feedback-status.is-loading .status-text,
html[data-screen="home"] .switch-status.is-loading .status-text {
  color: var(--sheet-muted);
}

.loader .flower {
  position: static;
  display: block;
  width: 64px;
  height: 64px;
  stroke-width: 8;
}

.loader .flower .flower-arrow {
  display: none;
}

/* The centre's colour is the first passed petal's (loader.js sets its --petal); unpassed, the
   first petal's. */
.loader .flower .flower-centre {
  --petal: var(--flower-1);
}

.loader .flower .flower-petal,
.loader .flower .flower-centre {
  fill: color-mix(in srgb, var(--petal) 20%, var(--surface));
  stroke: color-mix(in srgb, var(--petal) 50%, var(--surface));
}

.loader .flower .flower-petal.is-lit,
.loader .flower .flower-petal.is-trail,
.loader .flower .flower-centre.is-lit {
  fill: var(--petal);
  stroke: color-mix(in srgb, var(--petal) 88%, black);
}

/* The glass of a change of screen (SPEC 5.35): it takes the taps at once and stays clear; with the
   loader (after its delay) it blurs in over 150 ms, the leaving screen under it; it goes at once
   when the next screen is shown. */
.switch-glass {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: -webkit-backdrop-filter 150ms ease-out, backdrop-filter 150ms ease-out;
}

.switch-glass[hidden] {
  display: none;
}

.switch-glass.is-on {
  -webkit-backdrop-filter: blur(var(--glass));
  backdrop-filter: blur(var(--glass));
}

/* Reduced motion: the editor's swap and the dialogs happen at once, the thumbs jump; the loader is
   the still flower with all ten petals and the centre unpassed (loader.js passes none). */
@media (prefers-reduced-motion: reduce) {
  .dialog.is-opening,
  .dialog.is-closing,
  .dialog-glass.is-opening,
  .dialog-glass.is-closing {
    animation: none;
  }

  .levels-thumb,
  .levels-editor,
  .home-level-all,
  .home-lang-heads,
  .home-levels-chips,
  .home-levels-chevron,
  .switch-glass {
    transition: none;
  }

}

/* The acknowledgment (SPEC 5.20, CR-97 round 2): a top sheet over the home screen, nearly the
   whole screen: its top 10 px under the status-bar plate (sheet.js's --sheet-top), its bottom 10 px
   above the safe-area inset. The text scrolls between the bar and the footer, so Agreed is always
   in view. The install sheet (5.32) has the same box. */
.ack.sheet-top,
.install.sheet-top {
  height: calc(100% - var(--sheet-top, 10px) - 10px - env(safe-area-inset-bottom));
  max-height: calc(100% - var(--sheet-top, 10px) - 10px - env(safe-area-inset-bottom));
}

.ack-body,
.install-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.ack-text,
.ack-list {
  flex: none;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}

.ack-heading {
  margin-bottom: -8px;
  color: var(--text);
  font-weight: 600;
}

.ack-list {
  padding: 0 0 0 20px;
}

.ack-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* Agreed: the app's primary pill (the sign-in button's), centred and sized by its text. */
.ack-footer {
  text-align: center;
}

.ack-agree {
  display: inline-block;
  min-width: 200px;
  width: auto;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
}

/* Under the button, its line kept while hidden so the button never moves. */
.ack-error {
  margin: 8px 0 0;
  color: var(--bad);
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  visibility: hidden;
}

.ack-error.is-on {
  visibility: visible;
}

/* The install sheet (SPEC 5.32, CR-100): the acknowledgment's text, then the platform's steps,
   each its semibold line over a picture tile with the pictures' corners and a hairline. The tile
   at most 280 px and hung under the step's text, after its number (round 1: at the body's width
   the pictures outweighed the lines). */
.install-text,
.install-after,
.install-steps {
  flex: none;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}

.install-steps {
  padding: 0;
  list-style: none;
}

.install-step {
  margin: 0 0 16px;
}

.install-step-line {
  margin: 0 0 8px;
  font-weight: 600;
}

.install-step-number {
  margin-right: 6px;
}

.install-step-picture {
  display: block;
  width: calc(100% - 28px);
  max-width: 280px;
  height: auto;
  margin-left: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.install-after {
  color: var(--muted);
}

/* Continue in browser: the secondary action, a text button (installing is the system's). */
.install-footer {
  text-align: center;
}

.install-continue {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
}

/* The primary button's colours: the acknowledgment's Agreed (the sign-in button has them too, on
   a link). */
.ack-agree {
  background: var(--accent);
  color: var(--accent-text);
}

.ack-agree:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Debug panel (SPEC 5.17): with the debug flag on a wide viewport, a column at the left of the
   page; the screens keep their layout and centring to its right. Testing only, so none of the
   card look applies. */
.debug {
  display: none;
}

@media (min-width: 1024px) {
  html.has-debug body {
    padding-left: calc(320px + env(safe-area-inset-left));
  }

  html.has-debug .debug:not([hidden]) {
    display: block;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 320px;
    overflow: auto;
    padding: 8px;
    background: var(--bg);
    border-right: 1px solid var(--line);
    color: var(--text);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: text;
    -webkit-user-select: text;
  }
}
