/* Padub: Stitch And Bloom. One construction (cut paper with thickness, stitched borders, parts that lift)
   and the Ukrainian ornament kit: its palette, light and dark, its border and its drawn shapes. */

@font-face { font-family: "Fixel Text"; src: url("../fonts/FixelText-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fixel Text"; src: url("../fonts/FixelText-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fixel Text"; src: url("../fonts/FixelText-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fixel Text"; src: url("../fonts/FixelText-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fixel Display"; src: url("../fonts/FixelDisplay-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fixel Display"; src: url("../fonts/FixelDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fixel Display"; src: url("../fonts/FixelDisplay-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Zakon"; src: url("../fonts/Zakon-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zakon"; src: url("../fonts/Zakon-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---- the kit's colours. Light first, then dark twice: once for a device set to dark, once for a chosen theme.
   --p is the kit's red as an ornament; --link is the same red as text, lifted in dark so it reads on a card.
   tests/test_contrast.py checks every pairing used. */
:root {
  color-scheme: light;
  --ground: #EFE6D3; --ground2: #E6DAC2; --paper: #FCF8EE; --edge: #CDBF9F; --line: #D9CCB0;
  --ink: #241F2C; --muted: #655C4E; --thread: #A2957B;
  --p: #B3261E; --p-deep: #7C160F; --s: #E3A21A; --s-deep: #B67A08; --l: #1E5B45; --l-deep: #123C2D; --c: #7C160F;
  --cta-bg: #B3261E; --cta-fg: #FFF8EC; --cta-edge: #7C160F; --sel: #B3261E;
  --ok-bg: #1E5B45; --ok-fg: #FFFDF6; --bad-bg: #F6DAD2; --bad-fg: #8A1A13; --bad-edge: #D9A79C;
  --sheet-ok: #DCEBDC; --sheet-ok-fg: #154634;
  --node-face: #B3261E; --node-edge: #7C160F; --node-stitch: #F6C9B8; --node-flower: #FFF4E0;
  --lock-face: #E7DCC5; --lock-edge: #C8B994; --lock-line: #8D8068;
  --shadow: 70, 42, 18; --hi: rgba(255, 255, 255, 0.55); --weave: rgba(70, 42, 18, 0.035);
  --wm-l: #1E5B45; --wm-b: #B3261E; --link: #B3261E;
  --grain: url("../img/grain-light.svg"); --band: url("../img/band-light.svg");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0F1F19; --ground2: #0A1712; --paper: #1D382E; --edge: #08130F; --line: #35594B;
    --ink: #F5EDDB; --muted: #AEBBAE; --thread: #6D8979;
    --p: #EA6249; --p-deep: #9C2D1B; --s: #F2BB43; --s-deep: #F2BB43; --l: #74C8A0; --l-deep: #2F7C5C; --c: #9C2D1B;
    --cta-bg: #F2BB43; --cta-fg: #1B1505; --cta-edge: #A9790F; --sel: #F2BB43;
    --ok-bg: #74C8A0; --ok-fg: #0A1A13; --bad-bg: #4C211B; --bad-fg: #FFD3C8; --bad-edge: #2C100C;
    --sheet-ok: #1F4D3B; --sheet-ok-fg: #E6F6EB;
    --node-face: #E65A41; --node-edge: #9C2D1B; --node-stitch: #FFD2C2; --node-flower: #FFF4E0;
    --lock-face: #1D382E; --lock-edge: #08130F; --lock-line: #7C998A;
    --shadow: 0, 0, 0; --hi: rgba(255, 255, 255, 0.07); --weave: rgba(255, 255, 255, 0.018);
    --wm-l: #74C8A0; --wm-b: #EA6249; --link: #F2836C;
    --grain: url("../img/grain-dark.svg"); --band: url("../img/band-dark.svg");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0F1F19; --ground2: #0A1712; --paper: #1D382E; --edge: #08130F; --line: #35594B;
  --ink: #F5EDDB; --muted: #AEBBAE; --thread: #6D8979;
  --p: #EA6249; --p-deep: #9C2D1B; --s: #F2BB43; --s-deep: #F2BB43; --l: #74C8A0; --l-deep: #2F7C5C; --c: #9C2D1B;
  --cta-bg: #F2BB43; --cta-fg: #1B1505; --cta-edge: #A9790F; --sel: #F2BB43;
  --ok-bg: #74C8A0; --ok-fg: #0A1A13; --bad-bg: #4C211B; --bad-fg: #FFD3C8; --bad-edge: #2C100C;
  --sheet-ok: #1F4D3B; --sheet-ok-fg: #E6F6EB;
  --node-face: #E65A41; --node-edge: #9C2D1B; --node-stitch: #FFD2C2; --node-flower: #FFF4E0;
  --lock-face: #1D382E; --lock-edge: #08130F; --lock-line: #7C998A;
  --shadow: 0, 0, 0; --hi: rgba(255, 255, 255, 0.07); --weave: rgba(255, 255, 255, 0.018);
  --wm-l: #74C8A0; --wm-b: #EA6249; --link: #F2836C;
  --grain: url("../img/grain-dark.svg"); --band: url("../img/band-dark.svg");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: "Fixel Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 1rem; line-height: 1.45;
  background-color: var(--ground);
  background-image: var(--grain), repeating-linear-gradient(0deg, var(--weave) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, var(--weave) 0 1px, transparent 1px 3px);
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: none; }

/* ---- Ukrainian text, in the learner's chosen face. The heights are measured from each font, for the stress mark. */
.uk { font-family: "Zakon", Georgia, serif; font-weight: 400; --sb: 0.765; --lo: 0.512; --tall: 0.717; --cap: 0.72; --capdots: 0.906; }
.face-fixel .uk { font-family: "Fixel Display", "Fixel Text", sans-serif; font-weight: 600; font-size: 0.92em; --sb: 0.855; --lo: 0.531; --tall: 0.736; --cap: 0.7; --capdots: 0.89; }
.uk.big { font-size: 1.375rem; line-height: 1.2; }
.face-fixel .uk.big { font-size: 1.1875rem; }

/* The stressed vowel is coloured and its mark is drawn here, never by the font. */
.stress { position: relative; display: inline-block; line-height: 1; color: var(--p); --x: var(--lo); }
.stress.s-tall { --x: var(--tall); }
.stress.s-cap { --x: var(--cap); }
.stress.s-capdots { --x: var(--capdots); }
.stress::after {
  content: ""; position: absolute; left: 50%; width: 0.17em; height: 0.17em; margin-left: -0.118em;
  top: calc((var(--sb) - var(--x) - 0.05 - 0.17) * 1em); background: currentColor;
  clip-path: polygon(0 100%, 26% 100%, 100% 8%, 66% 0);
}
.stress.s-wide::after { left: 68%; }      /* ю: over the round part */

/* ---- the name */
.wordmark { display: inline-flex; align-items: center; gap: 0.5rem; font-family: "Zakon", Georgia, serif; font-weight: 700; font-size: 2rem; line-height: 1; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; }
.wordmark svg { width: 2.5rem; height: 2.5rem; flex: none; }

/* ---- pages outside the app: sign in, register and the rest */
.band-top { max-width: 30rem; margin: 0 auto; padding: 2rem 1.25rem 0; }
.band-top::after { content: ""; display: block; height: 27px; margin-top: 0.875rem; background: var(--band) repeat-x center; }
.page { max-width: 30rem; margin: 0 auto; padding: 1.125rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.page > * { margin: 0; }
.foot { max-width: 30rem; margin: 0 auto; padding: 1rem 1.25rem 2rem; font-size: 0.875rem; color: var(--muted); text-align: center; }

/* ---- the app frame: tabs along the bottom on a phone, down the side from a tablet up */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.column { flex: 1 1 auto; min-width: 0; padding-bottom: 7rem; }
.app .page { padding-top: 1.75rem; }
.app .p-top + .page { padding-top: 0.5rem; }
.p-top { max-width: 30rem; margin: 0 auto; padding: 1rem 1.25rem 0; min-height: 4.125rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.me-dot { margin-left: auto; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--l); color: var(--paper); font-family: "Fixel Display", sans-serif; font-weight: 700; font-size: 1.0625rem; display: grid; place-items: center; text-decoration: none; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--line), 0 6px 10px -4px rgba(var(--shadow), 0.5); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); padding: 0.5rem 0.625rem calc(0.625rem + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--line), 0 -14px 24px -14px rgba(var(--shadow), 0.4); }
.tabs::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; background: radial-gradient(circle at 8px 9px, var(--paper) 7.5px, transparent 8px) 0 0 / 16px 8px repeat-x; }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1875rem; min-height: 3.5rem; border-radius: 0.875rem; color: var(--muted); font-size: 0.78125rem; font-weight: 600; text-decoration: none; }
.tab[aria-current="page"] { color: var(--sel); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0.0625rem; left: 50%; width: 3.375rem; height: 2rem; margin-left: -1.6875rem; border-radius: 1rem; background: currentColor; opacity: 0.14; }
.rail-only { display: none; }

@media (min-width: 46.5rem) {
  .shell { flex-direction: row; }
  .tabs { position: sticky; top: 0; bottom: auto; flex: none; width: 13.5rem; height: 100vh; display: flex; flex-direction: column; gap: 0.375rem; padding: 2rem 0.875rem 1.75rem; box-shadow: 1px 0 0 var(--line), 14px 0 24px -18px rgba(var(--shadow), 0.4); }
  .tabs::before { left: auto; right: -8px; top: 0; bottom: 0; width: 8px; height: auto; background: radial-gradient(circle at -1px 8px, var(--paper) 7.5px, transparent 8px) 0 0 / 8px 16px repeat-y; }
  .rail-only { display: inline-flex; padding: 0 0.5rem 1.5rem; }
  .rail-hide { visibility: hidden; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 0.75rem; padding: 0 0.875rem; font-size: 1rem; }
  .tab[aria-current="page"]::before { inset: 0; width: auto; height: auto; margin: 0; border-radius: 0.875rem; }
  .column { padding-bottom: 2.5rem; }
  .app .page { padding-top: 2.5rem; }
  .p-top { padding-top: 1.5rem; }
}

/* ---- type */
h1, h2, h3 { font-family: "Fixel Display", "Fixel Text", sans-serif; }
h1 { font-size: 1.875rem; font-weight: 800; line-height: 1.2; margin: 0; }
h2 { font-size: 1.125rem; font-weight: 700; line-height: 1.25; margin-top: 0.5rem; }
h3 { font-size: 1.09375rem; font-weight: 700; line-height: 1.25; margin: 0; }
.eyebrow, h2.eyebrow { font-family: "Fixel Text", sans-serif; font-size: 0.875rem; font-weight: 600; color: var(--link); margin: 0.25rem 0 0; }
h2.eyebrow { color: var(--muted); }
ul { padding-left: 1.25rem; }
li { margin: 0.125rem 0; }
a { color: var(--link); text-underline-offset: 0.2em; }
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.strong { font-weight: 600; }
.center { text-align: center; }
.hint { font-size: 0.84375rem; color: var(--muted); margin: 0; }
.error { font-size: 0.875rem; font-weight: 600; color: var(--bad-fg); margin: 0; }
.back { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.9375rem; font-weight: 600; text-decoration: none; }
.back::before { content: "\2039\00a0"; font-size: 1.25em; line-height: 1; }
.blooms { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.blooms li { position: relative; padding-left: 1.5rem; margin: 0; }
.blooms li::before { content: ""; position: absolute; left: 0.25rem; top: 0.4375rem; width: 0.5625rem; height: 0.5625rem; border-radius: 0.125rem; background: var(--p); transform: rotate(45deg); }

/* ---- the band: the kit's embroidered border */
.band { display: block; height: 27px; background: var(--band) repeat-x center; }

/* ---- cards: cut paper with a visible edge */
.card { position: relative; background: var(--paper); border-radius: 1.25rem; padding: 0.875rem 1.125rem; font-size: 0.9375rem; box-shadow: 0 1px 0 var(--hi) inset, 0 3px 0 var(--edge), 0 14px 22px -12px rgba(var(--shadow), 0.45), 0 3px 6px -2px rgba(var(--shadow), 0.25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { box-shadow: 0 1px 0 var(--hi) inset, 0 0 0 1px var(--line) inset, 0 3px 0 var(--edge), 0 16px 24px -12px rgba(0, 0, 0, 0.7); } }
:root[data-theme="dark"] .card { box-shadow: 0 1px 0 var(--hi) inset, 0 0 0 1px var(--line) inset, 0 3px 0 var(--edge), 0 16px 24px -12px rgba(0, 0, 0, 0.7); }
.card p { margin: 0 0 0.375rem; }
.card p:last-child { margin: 0; }
.card.empty { padding: 1.125rem; }
.card.has-dec { overflow: hidden; padding-right: 6.5rem; min-height: 6.5rem; }
.dec { position: absolute; right: -0.375rem; bottom: -0.75rem; width: 6.875rem; height: 6.875rem; pointer-events: none; }
.dec .lf, .bq .lf { color: var(--l); }
.dec .b1, .bq .b1 { color: var(--p); }
.bq .b2 { color: var(--s); }
.card.notice { display: flex; gap: 0.625rem; align-items: flex-start; }
.card.notice .icon { color: var(--l); margin-top: 0.125rem; }
.card.samples .sample { font-size: 1.5rem; line-height: 1.3; margin: 0 0 0.75rem; }
.sample-z { font-family: "Zakon", Georgia, serif; font-weight: 400; --sb: 0.765; --lo: 0.512; --tall: 0.717; --cap: 0.72; --capdots: 0.906; }
.sample-f { font-family: "Fixel Display", sans-serif; font-weight: 600; --sb: 0.855; --lo: 0.531; --tall: 0.736; --cap: 0.7; --capdots: 0.89; }
.card.samples .sample-f { font-size: 1.3125rem; }
.note { border-radius: 0.875rem; padding: 0.625rem 0.875rem; font-size: 0.9375rem; font-weight: 600; }
.note.good { background: var(--sheet-ok); color: var(--sheet-ok-fg); }
.pill { font-size: 0.78125rem; font-weight: 600; border-radius: 999px; padding: 0.125rem 0.5rem; background: var(--sheet-ok); color: var(--sheet-ok-fg); }

/* ---- rows: a card of lines, parted by a running stitch */
.rows.card { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem 0.75rem 1.125rem; min-height: 3.5rem; border-bottom: 1.5px dashed var(--line); color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 600; margin: 0; }
.row:last-child { border-bottom: 0; }
.row .value { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 400; font-size: 0.9375rem; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.row.danger { color: var(--bad-fg); }
.row.tall { font-weight: 400; min-height: 4rem; }
.row.tall > .icon, .row .value .icon { color: var(--muted); }
.row.word { font-weight: 400; }
.row .grow { flex: 1 1 auto; min-width: 0; }
.row.did > .icon { color: var(--l); }
.hint.state-done { color: var(--l); font-weight: 700; }
.row form { flex: none; }

/* ---- forms */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.375rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.90625rem; font-weight: 600; }
.label-row a { font-weight: 600; }
legend { font-size: 0.90625rem; font-weight: 600; padding: 0; margin-bottom: 0.375rem; }
.input-wrap { position: relative; }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; min-height: 3.375rem; border-radius: 0.875rem; border: 0; background: var(--paper); color: var(--ink); padding: 0 0.875rem; font-size: 1.0625rem; font-family: inherit;
  box-shadow: 0 2px 3px rgba(var(--shadow), 0.22) inset, 0 0 0 1.5px var(--line) inset;
}
.has-toggle input { padding-right: 4.75rem; }
input[aria-invalid=true] { box-shadow: 0 2px 3px rgba(var(--shadow), 0.22) inset, 0 0 0 2px var(--bad-fg) inset; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, .segment input:focus-visible + span { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.show { position: absolute; right: 0.3125rem; top: 0.3125rem; height: 2.75rem; min-width: 3.75rem; border: 0; border-radius: 0.6875rem; background: var(--paper); color: var(--link); font-size: 0.90625rem; font-weight: 600; font-family: inherit; cursor: pointer; box-shadow: 0 0 0 1.5px var(--line) inset, 0 2px 0 var(--edge); }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }
input.code-box { min-height: 3.75rem; padding: 0; text-align: center; font-family: "Fixel Display", sans-serif; font-size: 1.625rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.segments { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.segments.three { grid-template-columns: repeat(3, 1fr); }
.segment { position: relative; display: block; }
.segment input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segment span { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 3.25rem; padding: 0 0.5rem; border-radius: 0.875rem; background: var(--paper); font-weight: 600; box-shadow: 0 0 0 1.5px var(--line) inset, 0 3px 0 var(--edge); }
.segment input:checked + span { box-shadow: 0 0 0 2.5px var(--sel) inset, 0 3px 0 var(--sel); }
.segment input:checked + span::after { content: ""; position: absolute; inset: 5px; border-radius: 0.5625rem; border: 1.5px dashed var(--sel); opacity: 0.7; pointer-events: none; }
.check { display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; font-weight: 600; }
.check input { width: 1.375rem; height: 1.375rem; accent-color: var(--p); }

/* The main button is raised and sewn round the inside; it sinks when pressed. */
.button { position: relative; top: 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3.375rem; padding: 0 1.375rem; border-radius: 1rem; border: 0; background: var(--cta-bg); color: var(--cta-fg); font-family: "Fixel Display", "Fixel Text", sans-serif; font-size: 1.09375rem; font-weight: 600; text-decoration: none; cursor: pointer; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 4px 0 var(--cta-edge), 0 12px 18px -8px rgba(var(--shadow), 0.55); }
.button::after { content: ""; position: absolute; inset: 5px; border-radius: 0.6875rem; border: 1.5px dashed currentColor; opacity: 0.38; pointer-events: none; }
.button:active { top: 3px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 1px 0 var(--cta-edge), 0 4px 8px -4px rgba(var(--shadow), 0.5); }
.button.wide { display: flex; width: 100%; }
.button.ghost, .button.danger { background: var(--paper); color: var(--ink); min-height: 3.125rem; font-size: 1rem; box-shadow: 0 0 0 1.5px var(--line) inset, 0 3px 0 var(--edge), 0 8px 12px -8px rgba(var(--shadow), 0.4); }
.button.ghost::after, .button.danger::after { display: none; }
.button.ghost:active, .button.danger:active { top: 2px; box-shadow: 0 0 0 1.5px var(--line) inset, 0 1px 0 var(--edge); }
.button.danger { color: var(--bad-fg); box-shadow: 0 0 0 1.5px var(--bad-fg) inset, 0 3px 0 var(--bad-edge), 0 8px 12px -8px rgba(var(--shadow), 0.4); }
.button.small { min-height: 2.75rem; padding: 0 0.875rem; font-size: 0.9375rem; white-space: nowrap; border-radius: 0.8125rem; }
.button:disabled { background: var(--ground2); color: var(--muted); box-shadow: 0 0 0 1.5px var(--line) inset; cursor: default; }
.button:disabled::after { display: none; }

.switch { flex: none; position: relative; width: 3.625rem; height: 2.125rem; border-radius: 999px; border: 0; background: var(--ground2); cursor: pointer; padding: 0; box-shadow: 0 2px 3px rgba(var(--shadow), 0.3) inset, 0 0 0 1.5px var(--line) inset; }
.switch span { position: absolute; top: 0.1875rem; left: 0.1875rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--paper); box-shadow: 0 2px 0 var(--edge), 0 4px 6px -2px rgba(var(--shadow), 0.5), 0 0 0 1.5px var(--line) inset; }
.switch span::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1.5px dashed var(--thread); }
.switch[aria-checked="true"] { background: var(--p); }
.switch[aria-checked="true"] span { transform: translateX(1.5rem); }

/* ---- the name card on Me and on the public page */
.namecard { padding: 0; overflow: hidden; }
.namecard .in { display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.125rem 1.25rem; }
.namecard .in > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-family: "Fixel Display", sans-serif; font-size: 1.75rem; font-weight: 700; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.initial { position: relative; flex: none; width: 5.25rem; height: 5.25rem; border-radius: 50%; background: var(--p); color: var(--cta-fg); display: grid; place-items: center; font-family: "Fixel Display", sans-serif; font-size: 2.125rem; font-weight: 800; border: 0.5625rem solid var(--paper); box-shadow: 0 0 0 1.5px var(--line), 0 3px 0 1.5px var(--edge), 0 10px 14px -8px rgba(var(--shadow), 0.5); }
.initial::after { content: ""; position: absolute; inset: -0.375rem; border-radius: 50%; border: 2px dashed var(--p); opacity: 0.8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .initial { color: #1B1505; } }
:root[data-theme="dark"] .initial { color: #1B1505; }

/* ---- the path */
.unit { display: flex; flex-direction: column; gap: 1.5rem; }
.unit-card { display: block; padding: 0; overflow: hidden; color: var(--ink); text-decoration: none; }
.unit-body { position: relative; display: flex; flex-direction: column; padding: 0.625rem 1.125rem 0.875rem; padding-right: 8.75rem; }
.unit-title { font-family: "Fixel Display", sans-serif; font-weight: 700; font-size: 1.6875rem; line-height: 1.15; margin: 0.0625rem 0 0.1875rem; }
.unit-sub { font-size: 0.875rem; color: var(--muted); }
.unit-prog { display: flex; align-items: center; flex-wrap: wrap; gap: 0.375rem 0.625rem; margin-top: 0.625rem; font-size: 0.84375rem; font-weight: 600; }
.dots { display: flex; gap: 0.3125rem; }
.dots i { width: 0.6875rem; height: 0.6875rem; border-radius: 0.1875rem; transform: rotate(45deg); box-shadow: 0 0 0 1.5px var(--thread) inset; }
.bq { position: absolute; right: 0.125rem; top: 1.25rem; width: 9.375rem; height: 8.125rem; pointer-events: none; }

.trail { list-style: none; margin: 0; padding: 0; }
.trail > li { margin: 0; }
.stop { position: relative; z-index: 1; display: flex; align-items: center; gap: 0.75rem; }
.stop:nth-child(4n+3) { flex-direction: row-reverse; text-align: right; }
.medal-link { flex: none; display: block; width: 7rem; height: 7.5rem; border-radius: 1.5rem; }
.medal { display: block; width: 7rem; height: 7.5rem; overflow: visible; }
.medal .face { fill: var(--node-face); }
.medal .side { fill: var(--node-edge); }
.medal .st { fill: none; stroke: var(--node-stitch); stroke-width: 1.8; stroke-dasharray: 5 4.5; stroke-linecap: round; }
.medal .fl { color: var(--node-flower); }
.medal .halo { fill: none; stroke: var(--p); stroke-width: 2.5; opacity: 0; }
.medal .shadow { fill: rgba(var(--shadow), 0.28); filter: blur(5px); }
.locked .medal .face { fill: var(--lock-face); }
.locked .medal .side { fill: var(--lock-edge); }
.locked .medal .st { stroke: var(--lock-line); opacity: 0.75; }
.locked .medal .fl { color: var(--lock-line); }
.opencard { flex: 1 1 auto; min-width: 0; padding: 0.75rem 0.875rem 0.875rem; border-radius: 1.125rem; }
.opencard::before { content: ""; position: absolute; left: -0.4375rem; top: 50%; width: 1rem; height: 1rem; margin-top: -0.5rem; background: var(--paper); transform: rotate(45deg); border-radius: 0.1875rem; box-shadow: -2px 2px 0 -1px var(--edge); }
.lrows { list-style: none; padding: 0; margin: 0.5rem 0 0.625rem; }
.lrows li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); min-height: 1.6875rem; margin: 0; }
.lrows li.next { color: var(--ink); font-weight: 600; }
.lrows .icon { color: var(--thread); }
.lrows li.next .icon { color: var(--p); }
.opencard .button { display: flex; width: 100%; min-height: 2.875rem; font-size: 0.96875rem; border-radius: 0.875rem; }
.nlabel { min-width: 0; }
.nlabel h3 { font-weight: 600; color: var(--muted); }
.nlabel .meta { display: flex; align-items: center; gap: 0.375rem; font-size: 0.84375rem; color: var(--muted); margin: 0.1875rem 0 0; }
.stop:nth-child(4n+3) .nlabel .meta { justify-content: flex-end; }

/* The vine runs from one node's middle to the next, as a row of stitches with two leaves. */
.vine-row { position: relative; height: 3rem; margin: -1.25rem 0 -1rem; }
.vine { position: absolute; left: 3.5rem; right: 3.5rem; top: 0; width: calc(100% - 7rem); height: 100%; overflow: visible; }
.vine .base { fill: none; stroke: var(--thread); stroke-width: 3.6; stroke-dasharray: 0.1 9; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.vine-row:nth-child(4n) .vine { transform: scaleX(-1); }
.vine-leaf { position: absolute; width: 1.375rem; height: 1.875rem; color: var(--l); }
.vine-leaf.a { left: 36%; top: 0; transform: rotate(-58deg); }
.vine-leaf.b { left: 58%; top: 0.875rem; transform: rotate(122deg); }
.vine-row:nth-child(4n) .vine-leaf { color: var(--thread); }
.vine-row:nth-child(4n) .vine-leaf.a { left: 58%; transform: rotate(58deg); }
.vine-row:nth-child(4n) .vine-leaf.b { left: 36%; transform: rotate(-122deg); }

.path-end { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding-top: 0.5rem; }
.pathpal { flex: none; width: 7rem; height: 4.4375rem; overflow: visible; }

/* ---- a lesson: full screen, one question at a time */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dots i.on { background: var(--p); box-shadow: none; }
.lrows li.did { color: var(--ink); }
.lrows li.did .icon { color: var(--l); }
.opencard form { margin: 0; }
.stop.done .nlabel h3 { color: var(--ink); }
.vine-row.grown .vine .base { stroke: var(--l); }
.iconbtn { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 0.875rem; display: grid; place-items: center; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1.5px var(--line) inset, 0 2px 0 var(--edge); }
.lesson { position: relative; max-width: 30rem; margin: 0 auto; height: 100vh; height: 100dvh; min-height: 34rem; overflow: hidden; }
/* The question fills the screen. When it is taller than the screen, as on a short window or once the answer sheet is
   up, it scrolls: nothing is squeezed, the page moves up. */
.q { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.q::-webkit-scrollbar { display: none; }

/* Before the first question: the unit's character, full length, says what the lesson covers. */
.start, .summary { scrollbar-width: none; }             /* like the question: they scroll when they must, with no bar drawn */
.start::-webkit-scrollbar, .summary::-webkit-scrollbar { display: none; }
.start { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 1rem 1.25rem 1.75rem; }
.start[hidden] { display: none; }
.start .iconbtn { align-self: flex-start; }
.host { flex: none; margin: 0.25rem 0 0; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.host .actor { width: 6.75rem; cursor: pointer; }
.start.brief .host .actor { width: 10rem; }
.host figcaption { font-family: "Zakon", Georgia, serif; font-weight: 700; font-size: 1.5rem; line-height: 1; }
.me-dot.pic { background: var(--ground2); overflow: hidden; }
.me-dot.pic img { display: block; width: 100%; height: 100%; }
.starts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.start-card { margin: 0; padding: 0.875rem 0.5rem 0.75rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.start-card .figure { display: block; width: 100%; max-width: 6.5rem; height: auto; }
.start-card .button { width: 100%; padding: 0 0.5rem; }
/* The picker: the avatar stays at the top while the rows of choices scroll under it. */
.pick-top { position: sticky; top: 0.5rem; z-index: 5; display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; }
.pick-full { flex: none; display: block; width: 4.25rem; height: auto; }
.pick-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.pick-side form { margin: 0; }
.pick-side .hint { margin: 0; }
.pick-circles { display: flex; align-items: flex-end; gap: 0.625rem; }
.pick-circles img { display: block; border-radius: 50%; background: var(--ground2); box-shadow: 0 0 0 1.5px var(--line); }
.pick-circles .s56 { width: 3.5rem; height: 3.5rem; } .pick-circles .s36 { width: 2.25rem; height: 2.25rem; } .pick-circles .s24 { width: 1.5rem; height: 1.5rem; }
.pick-tabs { display: flex; gap: 0.375rem; margin: 1rem -1.25rem 0; padding: 0.25rem 1.25rem 0.5rem; overflow-x: auto; scrollbar-width: none; }
.pick-tabs::-webkit-scrollbar { display: none; }
.pick-tabs a { flex: none; display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.875rem; border-radius: 0.875rem; font-size: 0.9375rem; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--paper); box-shadow: 0 0 0 1.5px var(--line) inset, 0 2px 0 var(--edge); }
.pick-tabs a[aria-current] { box-shadow: 0 0 0 2.5px var(--sel) inset, 0 2px 0 var(--sel); }
.pick-row { scroll-margin-top: 9rem; }
.pick-row h2 { font-size: 1rem; margin: 1rem 0 0.5rem; }
.pick-tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pick-tile { flex: none; display: block; padding: 0.3125rem; border-radius: 0.875rem; background: var(--paper); box-shadow: 0 0 0 1.5px var(--line) inset, 0 2px 0 var(--edge); }
.pick-tile img { display: block; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--ground2); }
.pick-tile.v-full img { width: 3.25rem; height: 7.125rem; border-radius: 0.5rem; background: none; }
.pick-tile.v-torso img { height: 4rem; border-radius: 0.5rem; background: none; }
.pick-tile.v-lower img { width: 3.75rem; height: 5rem; border-radius: 0.5rem; background: none; }
.pick-tile.v-feet img { width: 4.0625rem; height: 2.8125rem; border-radius: 0.5rem; background: none; }
.pick-tile[aria-current] { box-shadow: 0 0 0 2.5px var(--sel) inset, 0 2px 0 var(--sel); }
/* On a wide screen the picker uses the room: the avatar large on the left, staying in place, and bigger tiles
   in a column on the right. */
@media (min-width: 60rem) {
  .page:has(> #picker) { max-width: 64rem; }
  #picker { display: grid; grid-template-columns: 17rem minmax(0, 1fr); column-gap: 2.5rem; align-items: start; }
  #picker > * { grid-column: 2; }
  #picker > .pick-top { grid-column: 1; grid-row: 1 / span 80; top: 2.5rem; flex-direction: column; gap: 1.25rem; padding: 1.5rem 1.25rem; }
  .pick-full { width: 12rem; }
  .pick-side { flex: none; align-items: center; gap: 0.75rem; }
  .pick-circles { align-items: center; }
  .pick-side .button { min-width: 9rem; }
  .pick-tabs { margin: 0; padding: 0 0 0.5rem; flex-wrap: wrap; overflow: visible; }
  .pick-row { scroll-margin-top: 2rem; }
  .pick-row h2 { font-size: 1.125rem; margin: 1.25rem 0 0.625rem; }
  .pick-tiles { gap: 0.75rem; }
  .pick-tile { padding: 0.4375rem; border-radius: 1rem; }
  .pick-tile img { width: 5.5rem; height: 5.5rem; }
  .pick-tile.v-full img { width: 5rem; height: 10.9375rem; }
  .pick-tile.v-torso img { width: 5.5rem; height: 6.375rem; }
  .pick-tile.v-lower img { width: 5.625rem; height: 7.5rem; }
  .pick-tile.v-feet img { width: 6.5rem; height: 4.5rem; }
  .pick-name { max-width: 6.5rem; font-size: 0.75rem; }
}
/* For an account that reviews the choices: the generator's name under each tile, a dotted ring on a choice that is
   not approved and a solid gold ring on one that is held. */
.pick-tile.is-unapproved { outline: 2px dotted var(--link); outline-offset: -0.375rem; }
.pick-tile.is-held { outline: 2px solid var(--s); outline-offset: -0.375rem; }
.pick-name { display: block; max-width: 4.25rem; margin-top: 0.25rem; font-size: 0.625rem; line-height: 1.2; text-align: center; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.pick-tile { text-decoration: none; }

/* The avatar's scene, on Me and the public page: a garden at the time of day on the learner's clock, with the
   animated figure standing in it and the name underneath. With no avatar an outline stands in the figure's place.
   The garden's colours are in its drawing (padub/avatar/scene.py), the same in the light and dark themes. */
.scene { position: relative; overflow: hidden; padding: 0; }
.scene .band { position: relative; z-index: 3; }
.scene .view { position: relative; height: 15rem; margin-top: -1px; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.scene .garden { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene .actor { position: absolute; left: 39%; bottom: 0.15rem; width: 6.1rem; z-index: 2; }
.actor .fig { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 3px 2px rgba(20, 20, 10, 0.35)); }
.scene .actor.empty { left: 41%; width: 5.2rem; height: 11.5rem; bottom: 0.45rem; color: #FFFDF6; fill: rgba(255, 253, 246, 0.78); filter: drop-shadow(0 0 1px rgba(20, 20, 10, 0.5)) drop-shadow(0 2px 3px rgba(20, 20, 10, 0.3)); }
.scene .greet { position: absolute; left: 0.7rem; top: 0.7rem; z-index: 3; font-family: "Zakon", Georgia, serif; font-weight: 700; font-size: 1.1875rem; line-height: 1; padding: 0.4rem 0.7rem 0.45rem; border-radius: 0.8rem; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1.5px var(--line) inset, 0 2px 0 var(--edge), 0 6px 10px -4px rgba(20, 20, 10, 0.4); }
.scene .under { display: flex; flex-direction: column; align-items: flex-start; gap: 0.625rem; padding: 0.8rem 1rem 0.95rem; }
.scene .who { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.scene .who .lead { font-size: 0.875rem; color: var(--muted); }
.scene .under .button { flex: none; padding: 0 0.75rem; font-size: 0.875rem; }
.band-top.plain::after { display: none; }
/* The lesson summary when the learner has an avatar: it cheers beside the wreath. */
.stage { position: relative; flex: none; width: 100%; max-width: 22rem; height: 21.5rem; margin-top: 1rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stage .wreath { position: absolute; left: -0.4rem; top: 0.4rem; width: 15.5rem; height: 15.5rem; margin: 0; }
.stage .wreath .num { font-size: 2.2rem; }
.stage .actor { position: absolute; right: 0.2rem; bottom: 0.2rem; width: 8.4rem; }
.stage .pal { position: absolute; left: 2.4rem; bottom: 0.3rem; width: 5rem; height: 3.2rem; }
.drift { position: absolute; top: 0; width: 0.8rem; height: 1.1rem; color: var(--p); opacity: 0; z-index: 1; }
.drift.d0 { left: 14%; } .drift.d1 { left: 34%; color: var(--s); } .drift.d2 { left: 52%; } .drift.d3 { left: 68%; color: var(--s); } .drift.d4 { left: 82%; } .drift.d5 { left: 92%; color: var(--l); }
/* A drawn figure or cast picture lifts off the page with a soft shadow. */
.cut { filter: drop-shadow(0 3px 2px rgba(var(--shadow), 0.4)); }
.says { width: 100%; margin-top: 1.25rem; padding: 1rem 1.125rem 1.125rem; }
.says::before { content: ""; position: absolute; left: 50%; top: -0.4375rem; width: 1rem; height: 1rem; margin-left: -0.5rem; background: var(--paper); transform: rotate(45deg); border-radius: 0.1875rem; }
.says h1 { font-size: 1.625rem; margin: 0.0625rem 0 0.375rem; }
.says h2 { font-size: 1rem; margin: 0.875rem 0 0.375rem; }
.says .eyebrow { margin: 0; }
.start .button { flex: none; margin-top: auto; }
.start .says + .button { margin-top: 1.5rem; }
.q[hidden], .pop[hidden], .summary[hidden], .sheet[hidden] { display: none; }
.q-top { flex: none; padding: 1rem 1rem 0; display: flex; align-items: center; gap: 0.625rem; }
.stitches { flex: 1; min-width: 0; height: 2.125rem; border-radius: 0.6875rem; background: var(--paper); box-shadow: 0 2px 3px rgba(var(--shadow), 0.28) inset, 0 0 0 1.5px var(--line) inset; display: flex; align-items: center; justify-content: space-between; padding: 0 0.5625rem; }
.stitches svg { flex: 1 1 0; min-width: 0; max-width: 1.5rem; height: 1.125rem; }
.stitches .hole { fill: var(--thread); opacity: 0.8; }
.stitches .leaf { color: var(--l); opacity: 0; transform-box: fill-box; transform-origin: center; }
.stitches .done .leaf { opacity: 1; }
.stitches .again .leaf { color: var(--s-deep); }
.stitches .done .hole { opacity: 0; }
.wcard { flex: 1 0 auto; min-height: 9rem; margin: 1rem 1rem 0; padding: 0; display: flex; flex-direction: column; border-radius: 1.5rem; overflow: hidden; }
.ask { font-family: "Fixel Display", sans-serif; font-weight: 600; font-size: 1.125rem; line-height: 1.25; padding: 0.875rem 1.125rem 0; margin: 0; }
.wc-mid { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0.5rem 1rem 0; }
.wcard .word { margin: auto 0; }
/* The unit's character with the buttons to hear her at her side. In the word popup she is full length and small. */
.speaker { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 0.75rem; margin-top: 0.5rem; }
.speaker .actor { flex: none; width: 5.25rem; }
.speaker .says-row { margin: 0 0 1.5rem; }
/* In the question card on a phone she is seen from the waist up, in the middle of the card. `.half` is a window on
   the full-length figure; the embroidered band lies over its lower edge, so her legs are behind the band. */
.wcard .speaker { align-self: stretch; margin-top: 0; }
.half { flex: none; width: 10.5rem; height: 12.4rem; overflow: hidden; }
.speaker .half .actor { width: 10.5rem; }
.wcard .speaker .says-row { position: absolute; left: calc(50% + 4.4rem); bottom: 3.5rem; margin: 0; flex-direction: column; gap: 0.5rem; }
.wcard .orn { display: none; }
/* On a wide screen she stands full length beside the question instead; see the wide rules below. */
.teacher { display: none; }
.tname { margin: 0.4rem 0 0; font-family: "Zakon", Georgia, serif; font-weight: 700; font-size: 1.5rem; line-height: 1; }
.pop-card .speaker { margin-top: 0.75rem; }
.pop-card .speaker .actor { width: 3.75rem; }
.pop-card .speaker + .button { margin-top: 1rem; }
.word { margin: 0; font-weight: 700; line-height: 1.1; text-align: center; color: var(--ink); overflow-wrap: anywhere; }
.word.en { font-family: "Fixel Display", sans-serif; }
.word.uk, .face-fixel .word.uk { font-weight: 700; }
.word.w1, .big.w1 { font-size: min(5.5rem, 22vw); }
.word.w2, .big.w2 { font-size: min(4.25rem, 17vw); }
.word.w3, .big.w3 { font-size: min(3.5rem, 14vw); }
.word.w4, .big.w4 { font-size: min(2.875rem, 11.5vw); }
.word.w5, .big.w5 { font-size: 2.25rem; }
.word.w6 { font-size: 1.75rem; line-height: 1.2; }           /* a sentence */
.word { text-wrap: balance; }                                /* a sentence on two lines breaks evenly */
.orn { display: flex; align-items: center; justify-content: center; gap: 0.375rem; margin-top: 0.625rem; color: var(--l); }
.orn svg { width: 1.375rem; height: 1.375rem; }
.orn svg.mid { width: 1.875rem; height: 1.875rem; color: var(--p); }
.orn i { width: 2.75rem; height: 0; border-top: 2px dashed var(--thread); }
.wcard .band { position: relative; z-index: 2; flex: none; height: calc(27px + 1.1rem); margin: -0.6rem 0 0; background-color: var(--paper); box-shadow: 0 -1.5px 0 var(--line); }
.tray { flex: none; padding: 0.875rem 0.875rem 0; }
.tiles { position: relative; display: flex; flex-wrap: wrap; gap: 0.875rem 0.625rem; align-content: center; justify-content: center; padding: 1.375rem 0.5rem 1.5rem; border-radius: 1.625rem; background: var(--ground2); box-shadow: 0 3px 6px rgba(var(--shadow), 0.22) inset, 0 0 0 1.5px var(--line) inset; }
.tiles::before { content: ""; position: absolute; inset: 7px; border-radius: 1.25rem; border: 1.5px dashed var(--thread); opacity: 0.55; pointer-events: none; }
.tile { position: relative; min-height: 3.5rem; padding: 0 1.125rem; border: 0; border-radius: 0.9375rem; background: var(--paper); color: var(--ink); font-family: inherit; font-size: 1.125rem; font-weight: 600; cursor: pointer; box-shadow: 0 0 0 1.5px var(--line) inset, 0 1px 0 var(--hi) inset, 0 4px 0 var(--edge), 0 10px 14px -8px rgba(var(--shadow), 0.45); }
.tile.uk, .face-fixel .tile.uk { font-size: 1.3125rem; font-weight: 700; }
.face-fixel .tile.uk { font-size: 1.125rem; font-weight: 600; }
.tile::after { content: ""; position: absolute; inset: 5px; border-radius: 0.625rem; border: 1.5px dashed var(--thread); opacity: 0.5; pointer-events: none; }
.tile:active { transform: translateY(3px); box-shadow: 0 0 0 1.5px var(--line) inset, 0 1px 0 var(--edge); }
.tile .bloom { position: absolute; right: -0.5625rem; top: -0.6875rem; width: 1.6875rem; height: 1.6875rem; color: var(--sel); transform: scale(0) rotate(-90deg); pointer-events: none; }
.tile.sel { transform: translateY(-5px) rotate(-1.6deg); box-shadow: 0 0 0 2.5px var(--sel) inset, 0 5px 0 var(--sel), 0 18px 20px -10px rgba(var(--shadow), 0.6); }
.tile.sel::after { border-color: var(--sel); opacity: 0.9; }
.tile.sel .bloom { transform: scale(1) rotate(0); }
.tile:disabled { cursor: default; }
.tile.ok { background: var(--ok-bg); color: var(--ok-fg); transform: translateY(-5px); box-shadow: 0 5px 0 var(--l-deep), 0 18px 20px -10px rgba(var(--shadow), 0.6); }
.tile.ok::after { border-color: var(--ok-fg); opacity: 0.6; }
.tile.ok .bloom { color: #FFF8EC; transform: scale(1.2) rotate(0); }
.tile.bad { background: var(--bad-bg); color: var(--bad-fg); transform: none; box-shadow: 0 0 0 1.5px var(--bad-edge) inset, 0 2px 0 var(--bad-edge); }
.tile.bad::after { border-color: var(--bad-fg); opacity: 0.45; }
.tile.bad span { text-decoration: line-through; text-decoration-thickness: 2px; }
.tile.dim { opacity: 0.7; }
/* "Tiles: sentences": the line the learner builds, above the tray. A tile tapped in the tray goes up into the line
   and leaves its place empty; a tap on it in the line sends it back. */
.built { display: flex; flex-wrap: wrap; gap: 0.625rem 0.5rem; align-items: center; justify-content: center; min-height: 4.5rem; margin: 0 0.25rem 0.75rem; padding: 0.5rem 0.25rem 0.75rem; border-bottom: 2px dashed var(--thread); }
.built[hidden] { display: none; }
.tray.building .tile { min-height: 3rem; padding: 0 0.875rem; }
.tray.building .tiles { gap: 0.75rem 0.5rem; padding: 1.125rem 0.5rem 1.25rem; }
.tile.used { visibility: hidden; }
.built .tile.bad span { text-decoration: none; }
/* "Spell": the field the word is typed into, Padub's own Ukrainian keyboard under it, and, after a wrong answer,
   the note that sets what was typed against the word. */
.tiles[hidden], .board[hidden], .spell-note[hidden] { display: none; }
.spell { display: flex; flex-direction: column; align-items: stretch; gap: 0.625rem; }
.spell-field { width: 100%; min-height: 3rem; padding: 0 1rem; border: 0; border-radius: 0.9375rem; background: var(--paper); color: var(--ink); font-size: 1.5rem; font-weight: 700; text-align: center; box-shadow: 0 2px 3px rgba(var(--shadow), 0.28) inset, 0 0 0 1.5px var(--line) inset; }
.spell-field:focus { outline: none; box-shadow: 0 2px 3px rgba(var(--shadow), 0.28) inset, 0 0 0 2.5px var(--ink) inset; }
.spell-field.bad { box-shadow: 0 0 0 2.5px var(--bad-edge) inset; }
.spell-field.ok { background: var(--ok-bg); color: var(--ok-fg); box-shadow: none; opacity: 1; -webkit-text-fill-color: var(--ok-fg); }
.board { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.5rem 0.375rem; border-radius: 1.125rem; background: var(--ground2); box-shadow: 0 3px 6px rgba(var(--shadow), 0.22) inset, 0 0 0 1.5px var(--line) inset; }
.keys { display: flex; justify-content: center; gap: 0.25rem; }
.key { display: grid; place-items: center; line-height: 1; flex: 1 1 0; min-width: 0; max-width: 2.75rem; height: 2.5rem; padding: 0; border: 0; border-radius: 0.5rem; background: var(--paper); color: var(--ink); font-family: inherit; font-size: 1.1875rem; font-weight: 600; cursor: pointer; box-shadow: 0 0 0 1.5px var(--line) inset, 0 2px 0 var(--edge); touch-action: manipulation; }
.key:active { transform: translateY(2px); box-shadow: 0 0 0 1.5px var(--line) inset; }
.key.wide { flex-grow: 1.6; max-width: 4rem; }
.key.space { flex-grow: 6; max-width: 14rem; font-size: 0.875rem; color: var(--muted); }
.kb-switch { align-self: center; padding: 0.375rem 0.5rem; border: 0; background: none; color: var(--muted); font-family: inherit; font-size: 0.875rem; text-decoration: underline; cursor: pointer; }
.spell-note { padding: 0.625rem 0.875rem; border-radius: 0.9375rem; background: var(--bad-bg); color: var(--bad-fg); }
.spell-note p { margin: 0 0 0.375rem; font-size: 0.9375rem; line-height: 1.35; font-weight: 600; }
.diff-row { display: flex; align-items: baseline; gap: 0.75rem; }
.diff-name { flex: none; width: 4.75rem; font-size: 0.8125rem; }
.diff-letters { font-size: 1.375rem; font-weight: 700; letter-spacing: 0.08em; }
.diff-letters .off { text-decoration: underline; text-decoration-thickness: 2.5px; text-underline-offset: 0.2em; }
.diff-row:last-child .diff-letters { color: var(--ink); }
/* In Spell the answer sheet lies over the keyboard, which is no longer needed, so nothing moves when it opens. */
.q.spelling.fb .sheet-room { display: none; }
.q.spelling.fb .q-actions { display: flex; visibility: hidden; }
.q.spelling .tray { padding-top: 0.75rem; }
.pop-list { list-style: none; margin: 0.75rem 1.375rem 0; padding: 0; text-align: left; }
.pop-list[hidden], .pop-card .orn[hidden] { display: none; }
.pop-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.125rem; border-bottom: 1.5px dashed var(--thread); }
.pop-list li:last-child { border-bottom: 0; }
.pop-list .uk { font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.pop-list li span + span { color: var(--muted); text-align: right; }
.q-actions { flex: none; height: 6.25rem; padding: 1rem 1rem 0; display: flex; align-items: flex-start; gap: 0.75rem; }
.q.fb .q-actions { display: none; }
.q-actions .hintbtn { flex: none; min-height: 3.375rem; }
.q-actions .submit { flex: 1; }
/* The answer sheet lies over the foot of the lesson. The question gets room for it underneath (.sheet-room, as tall
   as the sheet) and moves up once, so the tiles end just above the sheet. */
.sheet-room { display: none; flex: none; height: calc(var(--sheet, 10.5rem) + 0.75rem); }
.q.fb .sheet-room { display: block; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; min-height: 10.375rem; padding: 1rem 1.25rem 1.25rem; background: var(--sheet-ok); color: var(--sheet-ok-fg); transform: translateY(120%); box-shadow: 0 -16px 26px -14px rgba(var(--shadow), 0.5); }
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 10px; background: radial-gradient(circle at 9px 10px, var(--sheet-ok) 8.5px, transparent 9px) 0 0 / 18px 10px repeat-x; }
.sheet.bad { background: var(--bad-bg); color: var(--bad-fg); }
.sheet.bad::before { background-image: radial-gradient(circle at 9px 10px, var(--bad-bg) 8.5px, transparent 9px); }
.sheet.is-on { transform: none; }
.sh-row { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; min-height: 3.125rem; }
.sheet .seal { flex: none; width: 3rem; height: 3rem; color: var(--p); }
.sheet.bad .seal { display: none; }
.sheet h2 { font-size: 1.25rem; line-height: 1.2; margin: 0; }
.sheet p { font-size: 0.9375rem; line-height: 1.35; margin: 0.0625rem 0 0; }
.sheet.bad .button { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1.5px var(--bad-edge) inset, 0 4px 0 var(--bad-edge); }
.petal { position: absolute; width: 1.125rem; height: 1.5rem; margin: -0.75rem 0 0 -0.5625rem; pointer-events: none; z-index: 5; opacity: 0; }
.petal.p-p { color: var(--p); }
.petal.p-s { color: var(--s); }

.pop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1.25rem; background: rgba(20, 14, 10, 0.55); opacity: 0; }
.pop.is-on { opacity: 1; }
.pop-card { width: 100%; max-width: 21rem; padding: 0 0 1.375rem; overflow: hidden; text-align: center; border-radius: 1.625rem; }
.pop-card .tag { font-size: 0.875rem; font-weight: 600; color: var(--muted); margin: 1.125rem 0 0; }
.pop-card .big { font-weight: 700; line-height: 1.15; color: var(--ink); margin: 0.75rem 0 0; padding: 0.35em 0.75rem 0; }
.face-fixel .pop-card .big { font-weight: 700; }
.pop-card .orn { margin: 0.75rem 0 0.5rem; }
/* Hear it again, and slowly: beside a Ukrainian word wherever there is a clip for it. */
.says-row { display: flex; align-items: center; justify-content: center; gap: 0.625rem; }
.says-row[hidden] { display: none; }
.slowbtn { min-height: 2.75rem; padding: 0 0.875rem; border: 0; border-radius: 0.875rem; font: inherit; font-size: 0.9375rem; font-weight: 600; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1.5px var(--line) inset, 0 2px 0 var(--edge); cursor: pointer; }
.saybtn { border: 0; cursor: pointer; }
.pop-card .en { font-family: "Fixel Display", sans-serif; font-weight: 600; font-size: 1.6875rem; line-height: 1.2; color: var(--ink); margin: 0; padding: 0 1rem; }
.pop-card .button { width: calc(100% - 2.75rem); margin: 1.25rem 1.375rem 0; }
.pop-card .leave-q { font-family: "Fixel Display", sans-serif; font-size: 1.5rem; margin: 1.5rem 0 0.25rem; }
.pop-card .leave-q ~ .button + .button { margin-top: 0.875rem; }

.summary { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 2.5rem 1.25rem 1.75rem; text-align: center; }
.summary .sub { font-size: 0.96875rem; color: var(--muted); margin: 0.25rem 0 0; }
.wreath { position: relative; flex: none; width: 18.75rem; height: 18.75rem; margin-top: 1.5rem; }
.wreath .w { width: 100%; height: 100%; overflow: visible; }
.wreath .lf { color: var(--l); }
.fl-ok { color: var(--p); }
.fl-again { color: var(--s); }
.wreath .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wreath .num { font-family: "Fixel Display", sans-serif; font-weight: 800; font-size: 2.75rem; line-height: 1; margin: 0; }
.wreath .cap { font-size: 0.9375rem; font-weight: 600; color: var(--muted); margin: 0.375rem 0 0; }
.key { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.375rem 1rem; font-size: 0.84375rem; color: var(--muted); margin: 1.25rem 0 0; }
.key span { display: inline-flex; align-items: center; gap: 0.3125rem; }
.key svg { width: 1.125rem; height: 1.125rem; }
.stat { width: 100%; margin-top: 1.25rem; padding: 0.875rem 1rem; text-align: left; }
.stat b { display: block; font-family: "Fixel Display", sans-serif; font-weight: 700; font-size: 1.3125rem; line-height: 1.2; }
.stat span { display: block; font-size: 0.84375rem; color: var(--muted); margin-top: 0.125rem; }
.summary .button { margin-top: auto; flex: none; }
.summary .stat + .button { margin-top: 1.5rem; }

/* A narrow phone: she moves to the left so the buttons to hear her still fit beside her. */
@media (max-width: 22.4rem) {
  .wcard .speaker { justify-content: flex-start; }
  .wcard .speaker .says-row { left: auto; right: 0; }
}
/* A phone of middling height: she is a little smaller, so the tiles keep their room. */
@media (max-height: 50rem) {
  .half { width: 7.5rem; height: 8.9rem; }
  .speaker .half .actor { width: 7.5rem; }
  .wcard .speaker .says-row { left: calc(50% + 3.2rem); bottom: 2.2rem; }
  .tiles { padding: 1.125rem 0.5rem 1.25rem; }
}
/* A short screen: she leaves the question card, and the card gives up its band, so the word and the tiles keep
   their room. She is still on the start screen and in the word popup. */
@media (max-height: 42rem) {
  .wcard .band, .half { display: none; }
  .wcard { min-height: 7.5rem; }
  .wcard .speaker { justify-content: center; }
  .wcard .speaker .says-row { position: static; flex-direction: row; margin: 0.25rem 0 0.75rem; }
  .pop-card .speaker .actor { width: 3.25rem; }
  .host .actor, .start.brief .host .actor { width: 5rem; }
  .tiles { gap: 0.625rem 0.5rem; padding: 1rem 0.5rem 1.125rem; }
  .tile { min-height: 3rem; }
  .q-actions { height: 5.25rem; padding-top: 0.75rem; }
}

/* Spell on a phone: the keyboard needs the room, so she is smaller and the word shown is set smaller. While a word
   is being typed again after a wrong answer the card keeps only the English, to make room for the note; on a phone
   of middling height she leaves the card. */
.q.spelling .half { width: 7rem; height: 8.3rem; }
.q.spelling .speaker .half .actor { width: 7rem; }
.q.spelling .wcard .speaker .says-row { left: calc(50% + 3rem); bottom: 2rem; }
.q.spelling .word.w1, .q.spelling .word.w2, .q.spelling .word.w3 { font-size: 3rem; }
.q.spelling.retype .wcard .speaker, .q.spelling.retype .wcard .band, .q.spelling.retype .wcard .orn { display: none; }
.q.spelling.retype .wcard { min-height: 0; }
.q.spelling.retype .wc-mid { padding-bottom: 0.75rem; }
@media (max-height: 50rem) {
  .q.spelling .half, .q.spelling .wcard .band { display: none; }
  .q.spelling .wcard { min-height: 7.5rem; }
  .q.spelling .wcard .speaker { justify-content: center; }
  .q.spelling .wcard .speaker .says-row { position: static; flex-direction: row; margin: 0.25rem 0 0.75rem; }
  .q.spelling .q-actions { height: 5.25rem; padding-top: 0.75rem; }
}
/* Spell on a short phone: the buttons to hear her go beside the word, and the keys are a little lower. */
@media (max-height: 42rem) {
  .q.spelling .wc-mid { flex-direction: row; gap: 0.625rem; padding: 0.25rem 0.75rem 0.5rem; }
  .q.spelling .wcard { min-height: 0; }
  .q.spelling .wcard .speaker { align-self: center; }
  .q.spelling .wcard .speaker .says-row { margin: 0; }
  .q.spelling .wc-mid .word.en { font-size: 1.625rem; }
  .q.spelling .key { height: 2.25rem; }
  .q.spelling .spell { gap: 0.375rem; }
  .q.spelling .kb-switch { padding: 0.125rem 0.5rem; font-size: 0.8125rem; }
  .q.spelling.retype .wcard { display: none; }           /* the note names the word; the card gives up its room */
}

/* A wide screen (a tablet or a laptop): two columns. The unit's character stands full length on the left, as tall
   as the screen allows, and the question, the tiles and the buttons are on the right. */
@media (min-width: 44rem) {
  .lesson { max-width: none; }
  .start, .summary { max-width: 30rem; margin-left: auto; margin-right: auto; }
  .q { display: grid; grid-template-columns: clamp(11rem, 30vw, 24rem) minmax(0, 34rem); grid-template-rows: auto 1fr auto auto auto; justify-content: center; column-gap: 1.5rem; padding: 0 1.5rem; }
  .q-top { grid-column: 1 / -1; padding: 1.25rem 0 0; }
  /* The foot of the right column is kept as tall as the answer sheet, with Hint and Submit at its top. The sheet
     comes up over exactly that space, so nothing on the screen moves or scrolls when it opens. She stands beside
     the card and the tiles, above where the sheet comes, and is sized to fit there on any height of window. */
  .teacher { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; grid-column: 1; grid-row: 2 / span 2; padding: 1rem 0 0.5rem; min-height: 0; }
  .teacher .actor { width: min(100%, calc(min(70vh, 38rem, 100vh - 19.5rem) * 0.4557)); }
  .q-actions { height: auto; min-height: 11.25rem; }
  .q.fb .q-actions { display: flex; visibility: hidden; }
  .sheet-room { height: max(0px, calc(var(--sheet, 10.5rem) + 0.75rem - 11.25rem)); }
  .q.spelling .q-actions { height: 6.25rem; min-height: 0; }
  .q.spelling .teacher { padding-bottom: 5.5rem; }      /* in Spell the sheet comes higher, over the keyboard: she stands clear of it */
  .q.spelling .wcard { min-height: 9rem; }
  .q.spelling.retype .wcard { min-height: 6.5rem; }
  .q.spelling .wcard .orn { display: none; }
  .wcard, .tray, .q-actions { grid-column: 2; }
  .wcard { grid-row: 2; }                              /* each in its own row, so one that is hidden leaves the others where they are */
  .tray { grid-row: 3; }
  .q-actions { grid-row: 4; }
  .sheet-room { grid-column: 1 / -1; grid-row: 5; }
  .wcard { margin: 1.25rem 0 0; align-self: stretch; min-height: 16rem; }
  .wc-mid { justify-content: center; padding-bottom: 0.5rem; }
  .wcard .word { margin: 0; }
  .wcard .orn { display: flex; }
  .wcard .band { display: block; height: 27px; margin: 0 0 0.75rem; box-shadow: none; }
  .half { display: none; }
  .wcard .speaker { justify-content: center; }
  .wcard .speaker .says-row { position: static; flex-direction: row; margin: 0.5rem 0; }
  .tray { padding: 0.875rem 0 0; }
  .q-actions { padding: 1rem 0 0; }
  .sheet { padding-left: max(1.25rem, calc(50% - 29rem)); padding-right: max(1.25rem, calc(50% - 29rem)); }
  .sheet .button, .sheet .sh-row { max-width: 34rem; margin-left: auto; }
}
/* An upright tablet: the question, tiles and buttons sit together a little above the middle of the screen, and she
   stands beside them, rather than at the foot of a tall page. */
@media (min-width: 44rem) and (orientation: portrait) {
  .q { grid-template-rows: auto 1fr auto auto auto 1.4fr; }
  .teacher { grid-row: 3 / span 3; justify-content: center; padding: 1.25rem 0 0; }
  .teacher .actor { width: min(100%, calc(min(70vh, 38rem) * 0.4557)); }
  .q-actions { height: 6.25rem; min-height: 0; }
  .sheet-room { height: calc(var(--sheet, 10.5rem) + 0.75rem); }
  .wcard { grid-row: 3; height: 26rem; }
  .tray { grid-row: 4; }
  .q-actions { grid-row: 5; }
  .sheet-room { grid-row: 6; }                     /* in the empty row below, so nothing moves when there is room already */
  .q.spelling .teacher { padding-bottom: 0; }
}
/* Wide but short (a small laptop window, a phone on its side): the card gives up height. */
@media (min-width: 44rem) and (max-height: 42rem) {
  .q.spelling .wcard { min-height: 0; margin-top: 0.75rem; }
  .q.spelling .wc-mid .word.en { font-size: 2rem; }
  .q.spelling .q-top { padding-top: 0.75rem; }
  .q.spelling .key { height: 2rem; font-size: 1.0625rem; }
  .q.spelling .board { gap: 0.25rem; padding: 0.375rem; }
  .q.spelling .q-actions { height: 4.5rem; padding-top: 0.625rem; }
  .q.spelling .teacher { padding-bottom: 7rem; }
  .q.spelling .tray { padding-top: 0.5rem; }
  .wcard { min-height: 9rem; }
  .wcard .orn, .wcard .band { display: none; }
  .wc-mid { flex-direction: row; gap: 1.25rem; padding-bottom: 0.75rem; }      /* the buttons to hear her go beside the word */
  .wcard .speaker { align-self: center; }
  .wcard .speaker .says-row { margin: 0; }
}

/* The summary on a short window: the wreath and the avatar are smaller so the whole screen fits. */
@media (max-height: 44rem) {
  .summary { padding-top: 1.25rem; padding-bottom: 1.25rem; }
  .stage { height: 15.5rem; max-width: 17.5rem; margin-top: 0.5rem; }
  .stage .wreath { width: 11.5rem; height: 11.5rem; }
  .stage .wreath .num { font-size: 1.75rem; }
  .stage .wreath .cap { font-size: 0.8125rem; }
  .stage .actor { width: 6rem; }
  .stage .pal { width: 3.75rem; height: 2.4rem; left: 1.75rem; }
  .summary .key { margin-top: 0.75rem; }
  .summary .stat { margin-top: 0.75rem; padding: 0.625rem 1rem; }
  .summary .stat + .button { margin-top: 1rem; }
}
/* Spell on a wide window that is not tall: while a word is typed again the card gives its room to the note. */
@media (min-width: 44rem) and (max-height: 50rem) {
  .q.spelling.retype .wcard { display: none; }
  .q.spelling.retype .tray { padding-top: 1.25rem; }
}

/* ---- motion, only when the viewer allows it */
@media (prefers-reduced-motion: no-preference) {
  .button, .show, .segment span { transition: top 0.08s, box-shadow 0.12s, background-color 0.2s, color 0.2s; }
  .switch, .switch span { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s; }
  .unit-card, .row { transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1); }
  a.unit-card:hover { transform: translateY(-2px); }
  a.unit-card:active { transform: translateY(2px); }
  .medal .lift { transition: transform 0.12s; }
  a.medal-link:active .lift { transform: translateY(5px); }
  .open .medal .lift { animation: bob 3.6s ease-in-out infinite; }
  @keyframes bob { 50% { transform: translateY(-4px); } }
  .open .medal .halo { transform-box: fill-box; transform-origin: center; animation: halo 3.6s ease-out infinite; }
  @keyframes halo { 0% { opacity: 0.55; transform: rotate(45deg) scale(1); } 70%, 100% { opacity: 0; transform: rotate(45deg) scale(1.32); } }
  .bq .bl { transform-box: fill-box; transform-origin: center; animation: bloom 0.7s cubic-bezier(0.34, 1.7, 0.5, 1) both; }
  .bq .d1 { animation-delay: 0.15s; } .bq .d2 { animation-delay: 0.28s; } .bq .d3 { animation-delay: 0.4s; } .bq .d4 { animation-delay: 0.52s; }
  @keyframes bloom { from { opacity: 0; transform: scale(0) rotate(-90deg); } }
  .dec { transform-origin: 80% 90%; animation: sway 6s ease-in-out infinite; }
  @keyframes sway { 50% { transform: rotate(4deg); } }
  .pathpal .head { transform-box: fill-box; transform-origin: 30% 80%; animation: nod 4.6s ease-in-out infinite; }
  @keyframes nod { 0%, 62%, 100% { transform: rotate(0); } 70% { transform: rotate(9deg); } 80% { transform: rotate(-3deg); } }
  .pathpal .wing { transform-box: fill-box; transform-origin: 90% 30%; animation: flap 4.6s ease-in-out infinite; }
  @keyframes flap { 0%, 20%, 100% { transform: rotate(0); } 8% { transform: rotate(-14deg); } 14% { transform: rotate(4deg); } }
  .tile { transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, background-color 0.2s, color 0.2s, opacity 0.25s; }
  .tile:active { transition-duration: 0.06s; }
  .tile .bloom { transition: transform 0.42s cubic-bezier(0.34, 1.7, 0.5, 1) 0.05s; }
  .sheet { transition: transform 0.5s cubic-bezier(0.3, 1.35, 0.5, 1); }
  .pop { transition: opacity 0.25s; }
  .stitches .done .leaf { animation: leafsew 0.5s cubic-bezier(0.34, 1.7, 0.5, 1) both; }
  @keyframes leafsew { from { opacity: 0; transform: scale(0.2) rotate(-70deg); } }
  .stitches .hole { transition: opacity 0.2s; }
  .start .says { animation: wordin 0.5s cubic-bezier(0.3, 1.45, 0.5, 1) 0.15s both; }
  .deal .tile { animation: deal 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both; animation-delay: calc(var(--i) * 55ms + 160ms); }
  @keyframes deal { from { opacity: 0; transform: translateY(26px) rotate(calc((var(--i) - 3) * 2deg)) scale(0.92); } }
  .wcard .word { animation: wordin 0.6s cubic-bezier(0.3, 1.45, 0.5, 1) both; }
  @keyframes wordin { from { opacity: 0; transform: scale(0.72) translateY(14px); } }
  .tile.ok { animation: land 0.62s cubic-bezier(0.3, 1.6, 0.5, 1); }
  @keyframes land { 0% { transform: translateY(-5px) scale(1); } 35% { transform: translateY(-16px) scale(1.12) rotate(2deg); } 70% { transform: translateY(-2px) scale(0.97); } 100% { transform: translateY(-5px); } }
  .tile.bad { animation: shake 0.5s ease-in-out; }
  @keyframes shake { 15% { transform: translateX(-9px) rotate(-2deg); } 35% { transform: translateX(8px) rotate(2deg); } 55% { transform: translateX(-6px); } 75% { transform: translateX(4px); } }
  .tile.ok.shown { animation: reveal 1.5s ease-in-out 0.35s 2 both; }
  @keyframes reveal { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(-10px) scale(1.05); } }
  .petal.fly { animation: fly 0.85s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
  @keyframes fly { 0% { opacity: 1; transform: rotate(var(--a)) translateY(-8px) scale(0.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(1.15); } }
  .sheet.is-on .seal { animation: seal 0.6s cubic-bezier(0.3, 1.7, 0.5, 1) 0.18s both; }
  @keyframes seal { from { transform: scale(0) rotate(-120deg); } }
  .pop.is-on .pop-card { animation: popin 0.62s cubic-bezier(0.26, 1.5, 0.5, 1) both; }
  @keyframes popin { from { opacity: 0; transform: translateY(70px) scale(0.8) rotate(-4deg); } }
  .wreath .wf { transform-box: fill-box; transform-origin: center; animation: bloom 0.6s cubic-bezier(0.34, 1.7, 0.5, 1) both; animation-delay: calc(var(--i) * 90ms + 250ms); }
  .wreath .lf { animation: leafin 0.5s ease-out both; }
  @keyframes leafin { from { opacity: 0; } }
  .garden .rays { animation: turn 60s linear infinite; }
  @keyframes turn { to { transform: rotate(360deg); } }
  .garden .cloud.c1 { animation: cloud 46s linear infinite; } .garden .cloud.c2 { animation: cloud 64s linear infinite reverse; }
  @keyframes cloud { 0%, 100% { transform: translateX(-30px); } 50% { transform: translateX(46px); } }
  .garden .smoke circle { animation: smoke 5s ease-in infinite; } .garden .smoke circle:nth-child(2) { animation-delay: 1.6s; } .garden .smoke circle:nth-child(3) { animation-delay: 3.2s; }
  @keyframes smoke { 0% { opacity: 0; transform: translate(0, 10px) scale(0.6); } 30% { opacity: 0.8; } 100% { opacity: 0; transform: translate(-10px, -22px) scale(1.25); } }
  .garden .sunflower { transform-box: fill-box; transform-origin: 50% 100%; animation: sunsway 5.5s ease-in-out infinite; } .garden .sunflower.f1 { animation-duration: 6.6s; animation-delay: -2s; } .garden .sunflower.f2 { animation-duration: 4.8s; animation-delay: -1s; }
  @keyframes sunsway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(3deg); } }
  .garden .star { animation: twinkle 3.4s ease-in-out infinite; } .garden .star.s1 { animation-delay: -1s; } .garden .star.s2 { animation-delay: -2s; } .garden .star.s3 { animation-delay: -2.7s; }
  @keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
  .garden .firefly { animation: firefly 7s ease-in-out infinite; } .garden .firefly.ff1 { animation-delay: -2s; animation-duration: 9s; } .garden .firefly.ff2 { animation-delay: -4s; } .garden .firefly.ff3 { animation-delay: -1s; animation-duration: 8s; } .garden .firefly.ff4 { animation-delay: -5s; } .garden .firefly.ff5 { animation-delay: -3s; animation-duration: 10s; }
  @keyframes firefly { 0%, 100% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 50% { opacity: 0.9; transform: translate(14px, -12px); } 80% { opacity: 0.6; transform: translate(-8px, -20px); } }
  .garden.g-evening .window rect:first-child, .garden.g-night .window rect:first-child { animation: lamp 4s ease-in-out infinite; }
  @keyframes lamp { 0%, 100% { opacity: 1; } 50% { opacity: 0.82; } }
  .scene .actor, .stage .actor { animation: walkin 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) 0.15s both; }
  @keyframes walkin { from { transform: translateY(30px); opacity: 0; } }
  .drift { animation: drift 9s linear infinite; } .drift.d1 { animation-delay: 1.6s; animation-duration: 11s; } .drift.d2 { animation-delay: 3.1s; } .drift.d3 { animation-delay: 4.9s; animation-duration: 12s; } .drift.d4 { animation-delay: 6.2s; } .drift.d5 { animation-delay: 7.4s; animation-duration: 10s; }
  @keyframes drift { 0% { opacity: 0; transform: translateY(0) rotate(0); } 8% { opacity: 0.9; } 80% { opacity: 0.8; } 100% { opacity: 0; transform: translate(-26px, 19rem) rotate(300deg); } }
}
