/* langapp: the one stylesheet (brief 2), from design E (mockups/e, prototype
   styling, S4-4). Tokens first. Two themes from one set of custom
   properties: each colour token holds its light and its dark value,
   light-dark(light, dark), and the theme is the page's color-scheme, which
   follows prefers-color-scheme. No inline styles anywhere (CSP). */

@font-face {
  font-family: "Jost";
  src: url("/static/f0e770ca9d/jost.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- the theme switch ---------- */
:root { color-scheme: light; --dark: 0; }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --dark: 1; }
}

/* ---------- tokens ---------- */
:root {
  /* ground and surfaces: light-dark(light, dark) */
  --ground: light-dark(#FFFFFF, #0B1230);   /* the page: pure white, or C's night */
  --surface: light-dark(#FFFFFF, #161F48);  /* keys: options, pieces, the order line's slots */
  --edge: light-dark(#CDD3E1, #33407A);     /* a key's border and the edge under it; the order line */
  --line: light-dark(#E3E7F0, #2A3566);     /* radar axes, chart rules, the level path's rail ahead */
  --grid: light-dark(#B9C0D3, #3D4A8A);     /* the radar's dotted rings */

  /* text */
  --ink: light-dark(#1D2340, #F1F3FA);
  --ink-2: light-dark(#4B5272, #A9B2D6);
  --off: light-dark(#9AA1B9, #6F7AAE);      /* text of a disabled button (exempt from contrast) */
  --err: light-dark(#C23B1F, #FF8FA3);      /* the letters that were wrong, and their wavy line */
  --on-lvl: #0A0F26;                        /* text on a level colour, both themes */
  --toast: light-dark(#1D2340, #222C5E);    /* the undo toast: ink in light, a raised night in dark */
  --on-toast: light-dark(#FFFFFF, #F1F3FA);

  /* one colour per level, the same in both themes: 3.2:1 or more on white
     and on the night ground as a line, 5.3:1 or more under --on-lvl */
  --a1: #24A157;   /* green */
  --a2: #1798A5;   /* teal */
  --b1: #4F86F7;   /* blue */
  --b2: #A070F0;   /* violet */
  --c1: #E5598F;   /* rose */
  --c2: #BD8112;   /* amber */
  --lvl: var(--a1);

  /* type: one family (Jost, 400 to 600), five sizes */
  --font: "Jost", system-ui, sans-serif;
  --fs-1: 0.875rem;    /* 14: notes, labels, dates */
  --fs-2: 1.0625rem;   /* 17: body */
  --fs-3: 1.375rem;    /* 22: German on keys, pieces and in feedback */
  --fs-4: 1.625rem;    /* 26: the sentence, titles (32 on desktop) */
  --fs-5: 2.5rem;      /* 40: level up (52 on desktop) */

  /* space: 4-based */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;

  /* corners: one small scale, never half an element's height */
  --r-1: 4px;    /* marks inside text, the focus ring */
  --r-2: 8px;    /* pieces, the gap, the toast */
  --r-3: 12px;   /* keys and buttons (48 to 64 px tall) */
  --lift: 4px;   /* the edge under anything you can press */

  /* motion */
  --t-press: 90ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);   /* the radar's keySplines */
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}
/* browsers without light-dark() (Safari before 17.5, Chrome before 123):
   the same tokens, light, and dark by the media query */
@supports not (color: light-dark(#fff, #000)) {
  :root {
    --ground: #FFFFFF;
    --surface: #FFFFFF;
    --edge: #CDD3E1;
    --line: #E3E7F0;
    --grid: #B9C0D3;
    --ink: #1D2340;
    --ink-2: #4B5272;
    --off: #9AA1B9;
    --err: #C23B1F;
    --toast: #1D2340;
    --on-toast: #FFFFFF;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --ground: #0B1230;
      --surface: #161F48;
      --edge: #33407A;
      --line: #2A3566;
      --grid: #3D4A8A;
      --ink: #F1F3FA;
      --ink-2: #A9B2D6;
      --off: #6F7AAE;
      --err: #FF8FA3;
      --toast: #222C5E;
      --on-toast: #F1F3FA;
    }
  }
}
.lvl-a1 { --lvl: var(--a1); }
.lvl-a2 { --lvl: var(--a2); }
.lvl-b1 { --lvl: var(--b1); }
.lvl-b2 { --lvl: var(--b2); }
.lvl-c1 { --lvl: var(--c1); }
.lvl-c2 { --lvl: var(--c2); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  font-family: var(--font); font-size: var(--fs-2); line-height: 1.45;
  color: var(--ink); background: var(--ground);
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 500; font-style: normal; line-height: 1.2; }
p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
b, strong { font-weight: 600; }
[hidden] { display: none !important; }
time { font-variant-numeric: tabular-nums lining-nums; }
.nw { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: var(--r-1); }
.visually-hidden, .sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* words for screen readers inside visible text: drawn from the attribute,
   so they are read but never copied with the text around them */
.sr::before { content: attr(data-sr); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; height: 56px; max-width: 592px; margin: 0 auto; padding: 0 var(--s-1); }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none; padding: 0;
  border: 0; border-radius: var(--r-2); background: none; color: var(--ink-2); cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.back { display: inline-flex; align-items: center; gap: var(--s-1); min-height: 48px; padding: 0 var(--s-3) 0 var(--s-1); font-weight: 500; text-decoration: none; color: var(--ink-2); }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .icon-btn:hover, .back:hover { color: var(--ink); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3);
  min-height: 56px; padding: 0 var(--s-5); margin-bottom: var(--lift);
  border: 0; border-radius: var(--r-3);
  font-size: 1.125rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform var(--t-press) ease-out, box-shadow var(--t-press) ease-out;
}
.btn-primary {
  background: var(--lvl); color: var(--on-lvl);
  box-shadow: 0 var(--lift) 0 color-mix(in srgb, var(--lvl) 62%, #000);
}
.btn-primary:active { transform: translateY(var(--lift)); box-shadow: 0 0 0 transparent; }
.btn-primary:disabled {
  background: var(--surface); color: var(--off); box-shadow: inset 0 0 0 2px var(--edge);
  transform: none; cursor: default;
}
.btn-wide { width: 100%; }
.btn-sub { font-weight: 400; }
.link {
  display: inline-flex; align-items: center; min-height: 48px; font-weight: 500;
  text-decoration: underline 1px var(--ink-2); text-underline-offset: 6px;
}

/* ---------- layout ---------- */
.page { max-width: 480px; margin: 0 auto; padding: 0 var(--s-4) var(--s-6); }
.stage { max-width: 592px; margin: 0 auto; padding: 0 var(--s-4) var(--s-5); }

/* ---------- the radar (classes from build/radar_mock.py) ---------- */
.radar { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.radar .ring { stroke: var(--grid); stroke-width: 1.5; stroke-dasharray: 0.1 6; stroke-linecap: round; }
.radar .ring-edge { stroke: var(--lvl); stroke-width: 1.5; }
.radar .axis { stroke: var(--line); stroke-width: 1.25; }
.radar .axis-uncertain { stroke: var(--ink-2); stroke-width: 1.5; }
.radar .shape { stroke: var(--lvl); stroke-width: 2.5; stroke-linejoin: round; fill-opacity: calc(0.5 + 0.12 * var(--dark)); }
/* the mastered mark: the edge ring lit around the axis, with a soft glow */
.radar .arc { stroke: var(--lvl); stroke-width: 5; }
.radar .arc-glow { stroke: var(--lvl); stroke-width: 7; opacity: calc(0.45 + 0.45 * var(--dark)); }
.radar .label { font-size: 21px; font-weight: 450; fill: var(--ink-2); }
.radar .label.is-mastered { font-weight: 600; fill: var(--ink); }
.radar-note { margin-top: var(--s-1); text-align: center; font-size: var(--fs-1); color: var(--ink-2); }

/* the star: in a sentence, it keys the lit arc */
.star { width: 0.95em; height: 0.95em; flex: none; margin-right: 0.4em; vertical-align: -0.08em; fill: var(--lvl); }

/* ---------- the level path: six levels, yours on a thick rail ---------- */
.path { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; font-size: var(--fs-1); color: var(--ink-2); }
.path li { padding-top: 10px; border-top: 2px solid var(--line); }
.path .is-now, .path .is-past { padding-top: var(--s-2); border-top: 4px solid var(--lvl); }
.path .is-now { color: var(--ink); font-weight: 600; }

/* ---------- home ---------- */
.home { padding-top: var(--s-3); }
.home-radar { margin: 0 calc(-1 * var(--s-2)); }
.home-side { margin-top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.path-note { margin-top: var(--s-3); font-size: var(--fs-1); color: var(--ink-2); }
.path-note strong { color: var(--ink); }
.strength { font-size: 1.125rem; }
/* home's line can be hidden for the week: the cross sits at its first line's end */
.home .strength { display: flex; align-items: flex-start; gap: var(--s-1); }
.home .strength p { flex: 1; padding-top: 11px; }
.home .strength .icon-btn { margin: 0 calc(-1 * var(--s-2)) 0 0; }
.ahead { margin-top: calc(-1 * var(--s-3)); font-size: var(--fs-1); color: var(--ink-2); }
.start { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); margin-top: var(--s-2); }
.start form { width: 100%; }
/* the session length, above Start: three choices, the chosen one underlined
   in the level's colour (as the journey's legend); the radios stay in the
   page, invisible, for the keyboard and without JavaScript. The time sits
   under its name on a phone, beside it on a desktop. */
.length { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); min-width: 0; margin: 0 0 var(--s-2); padding: 0; border: 0; }
.length input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.length label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: var(--s-1); border-radius: var(--r-2); cursor: pointer; color: var(--ink-2); line-height: 1.25;
}
.len-t { font-size: var(--fs-1); color: var(--ink-2); }
.length input:checked + label { color: var(--ink); }
.length input:checked + label .len-n { font-weight: 600; text-decoration: underline 2px var(--lvl); text-underline-offset: 7px; }
.length input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: -3px; }
@media (hover: hover) { .length label:hover { color: var(--ink); } }

/* ---------- items ---------- */
.item, .answer { display: flex; flex-direction: column; gap: var(--s-5); }
.item { padding-top: var(--s-2); }
.prompt { font-weight: 500; color: var(--ink-2); }
.sentence-row { display: flex; align-items: flex-start; gap: var(--s-2); }
.sentence { flex: 1; font-size: var(--fs-4); font-weight: 500; line-height: 1.55; }
.sentence-row .report { margin: 0 -10px 0 0; }
/* words you can look up: they answer a pointer in the level's colour */
.w { display: inline; padding: 0; margin: 0; border: 0; background: none; font: inherit; color: inherit; line-height: inherit; cursor: pointer; border-radius: var(--r-1); }
@media (hover: hover) { button.w:hover { color: var(--lvl); } }
button.w:focus-visible { color: var(--lvl); }
/* the gap holds the base form, in small type */
.gap {
  display: inline-block; min-width: 4.2em; padding: 0 0.4em; text-align: center;
  border: 2px dashed var(--edge); border-radius: var(--r-2); line-height: 1.35;
}
.gap .cue { font-size: 0.7em; font-weight: 400; color: var(--ink-2); }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.opt, .piece, .play {
  position: relative; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r-3);
  box-shadow: 0 var(--lift) 0 var(--edge); margin-bottom: var(--lift);
  font-weight: 500;
  transition: transform var(--t-press) ease-out, box-shadow var(--t-press) ease-out, border-color 120ms;
}
.opt, .play { min-height: 64px; padding: var(--s-2) var(--s-3); font-size: var(--fs-3); }
/* the highlight: the level's colour on the border and the edge */
@media (hover: hover) { button.opt:hover, button.piece:hover, .play:hover { border-color: var(--lvl); box-shadow: 0 var(--lift) 0 var(--lvl); } }
.opt.is-picked { border-color: var(--lvl); }
.opt:active, .opt.is-picked, .piece:active, .play:active { transform: translateY(var(--lift)); box-shadow: 0 0 0 var(--lvl); }
/* keys 1-4 work everywhere; their numbers show only once the keyboard is in use */
.key-hint { display: none; position: absolute; top: 6px; left: 10px; font-size: 0.8125rem; line-height: 1; color: var(--ink-2); }
.options:has(:focus-visible) .key-hint, .pool:has(:focus-visible) .key-hint { display: block; }
/* I don't know: small and quiet, still a full 44 px target */
.dont-know {
  align-self: center; min-height: 44px; padding: 0 var(--s-4);
  border: 0; background: none; cursor: pointer;
  font-size: 0.9375rem; font-weight: 500; color: var(--ink-2);
  text-decoration: underline 1px; text-underline-offset: 5px;
}
@media (hover: hover) { .dont-know:hover { color: var(--ink); } }
.answer > .dont-know { margin-top: calc(-1 * var(--s-3)); }

/* order */
.sentence-en { font-weight: 500; }
.line {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
  min-height: 72px; padding: var(--s-2) 0 var(--s-3); border-bottom: 2px solid var(--edge);
}
.fixed { font-size: var(--fs-3); font-weight: 500; }
.pool { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); }
.piece, .slot { min-height: 48px; padding: var(--s-2) var(--s-4); border-radius: var(--r-2); font-size: 1.25rem; line-height: 28px; }
.piece .key-hint { top: 3px; left: 5px; }
.slot { border: 2px dashed var(--edge); color: transparent; margin-bottom: var(--lift); user-select: none; }
.line .piece { animation: land 280ms var(--ease-out); }
@keyframes land { from { transform: translateY(10px); } }
.note { font-size: var(--fs-1); color: var(--ink-2); }

/* ---------- feedback ---------- */
.feedback { display: flex; flex-direction: column; gap: var(--s-4); }
.verdict { font-size: var(--fs-4); font-weight: 600; }
.said { display: grid; gap: 2px; }
.tag { font-size: var(--fs-1); color: var(--ink-2); }
.said .de { font-size: var(--fs-3); font-weight: 500; line-height: 1.5; }
mark { background: none; color: inherit; }
/* what you chose: a wavy line under the word, the letters that were wrong in --err */
mark.err { text-decoration: underline wavy var(--err) 1.5px; text-underline-offset: 6px; text-decoration-skip-ink: none; }
mark.err .d { color: var(--err); font-weight: 600; }
/* the answer: semibold on the level's line, the letters that arrived in the level's colour */
mark.ok { font-weight: 600; border-bottom: 2.5px solid var(--lvl); }
strong.ok { font-weight: 600; text-decoration: underline 2.5px var(--lvl); text-underline-offset: 6px; }
mark.ok .n > span { color: var(--lvl); }
/* the change, in real type: the wrong letters leave, the shared ones slide
   together as the gap closes, the missing ones arrive. Final state by default. */
.morph .x, .morph .n { display: inline-grid; grid-template-columns: 0fr; }
.morph .n { grid-template-columns: 1fr; }
.morph .x > span, .morph .n > span { min-width: 0; overflow-x: clip; }
.morph .x > span { color: var(--err); opacity: 0; }
/* the leaving letters are drawn, not text: a copied answer is the right word */
.morph .x > span::before { content: attr(data-t); }
.js .morph .x { animation: e-shut 320ms var(--ease-io) 650ms both; }
.js .morph .x > span { animation: e-leave 320ms var(--ease-io) 650ms both; }
.js .morph .n { animation: e-open 360ms var(--ease-out) 900ms both; }
.js .morph .n > span { animation: e-arrive 420ms var(--ease-out) 900ms both; }
@keyframes e-shut { from { grid-template-columns: 1fr; } }
@keyframes e-leave { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(0.4em); } }
@keyframes e-open { from { grid-template-columns: 0fr; } }
@keyframes e-arrive { from { opacity: 0; transform: translateY(-0.4em); } }
.rule b { font-weight: 600; }
/* Why?: the explanation behind one control. After a wrong answer on a rule,
   and on a study card, it is a button that asks the server for the rule */
.why summary, .why-btn {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px;
  list-style: none; cursor: pointer; font-weight: 500;
}
.why-btn { min-height: 48px; padding: 0; border: 0; background: none; }
.why-form { display: grid; justify-items: start; }
.why summary::-webkit-details-marker { display: none; }
.why summary::after, .why-btn::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.why[open] summary::after, .why-btn[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
/* one more sentence, or a study card's two: the German, its English under it */
.examples { display: grid; gap: var(--s-5); }
.ex { display: grid; gap: var(--s-1); }
.en { color: var(--ink-2); }
/* the explanation: one colour throughout, German terms by weight alone;
   its points (why_text split at " | ") each on their own, behind a dot */
.why-body { display: grid; gap: var(--s-4); max-width: 36em; padding-top: var(--s-1); font-size: var(--fs-2); line-height: 1.55; }
.points { display: grid; gap: var(--s-3); }
.points li { position: relative; padding-left: 1.1em; }
.points li::before {
  content: ""; position: absolute; left: 0.2em; top: 0.7em;
  width: 0.3em; height: 0.3em; border-radius: 50%; background: var(--ink-2);
}
/* the example: the German line and its English under it, on the level's rule */
.example { display: grid; gap: 2px; padding-left: var(--s-4); border-left: 4px solid var(--lvl); }
.example [lang="de"] { font-size: 1.1875rem; font-weight: 500; }
.example [lang="en"] { color: var(--ink-2); }
/* Next stays in reach while the explanation is read; so does a study
   card's Continue */
.next, .item-study > .answer {
  position: sticky; bottom: 0; z-index: 1;
  margin: var(--s-2) calc(-1 * var(--s-4)) 0; padding: var(--s-3) var(--s-4); background: var(--ground);
}
.next::before, .item-study > .answer::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--s-5);
  background: linear-gradient(color-mix(in srgb, var(--ground) 0%, transparent), var(--ground)); pointer-events: none;
}

/* ---------- an answered tap or order item: it stays, its keys lie flat ---------- */
.is-answered .opt {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  text-align: center; cursor: default; color: var(--ink-2);
  transform: translateY(var(--lift)); box-shadow: none;
}
.is-answered .options.one .opt { justify-content: space-between; text-align: left; }
/* the word stays centred, where it was before the answer: an option with a
   tick or a cross carries the mark's width on its left too, so the mark
   sits to the word's right without pushing it */
.is-answered .opt.is-right::before, .is-answered .opt.is-picked-right::before, .is-answered .opt.is-picked-wrong::before { content: ""; width: 22px; flex: none; }
.is-answered .options.one .opt::before { content: none; }
/* what an option means, for whoever asks: a dotted line under the word
   says there is something (as under a word to look up); pointing at it,
   tapping it or reaching it by keyboard shows the meaning on the option's
   lower edge. Nothing moves, and nothing is there unasked. */
.is-answered .opt[data-meaning] { cursor: help; }
.is-answered .opt[data-meaning] > span:first-child { text-decoration: underline dotted 1.5px var(--ink-2); text-underline-offset: 6px; }
.opt .meaning {
  position: absolute; inset: auto var(--s-2) 3px; text-align: center;
  font-size: var(--fs-1); font-weight: 400; line-height: 1.2; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity 120ms;
}
.opt[data-meaning]:hover .meaning, .opt[data-meaning]:focus .meaning { opacity: 1; }
.is-answered .opt[data-meaning]:hover > span:first-child, .is-answered .opt[data-meaning]:focus > span:first-child { transform: translateY(-7px); }
.is-answered .opt[data-meaning] > span:first-child { transition: transform 120ms; }
.is-answered .opt[data-meaning]:focus-visible { outline: 2px solid var(--lvl); outline-offset: 2px; }
.is-answered .opt[data-meaning]:focus:not(:focus-visible) { outline: none; }
.is-answered .opt.is-right, .is-answered .opt.is-picked-right { border-color: var(--lvl); color: var(--ink); font-weight: 600; }
.is-answered .opt.is-picked-wrong { border-color: var(--err); color: var(--ink); }
.opt .d { color: var(--err); font-weight: 600; }
/* right and wrong by shape too: the level's colour can be close to --err */
.mark-icon { width: 22px; height: 22px; flex: none; fill: none; stroke-width: 2.75; stroke-linecap: round; stroke-linejoin: round; }
.is-right .mark-icon, .is-picked-right .mark-icon { stroke: var(--lvl); }
.is-picked-wrong .mark-icon { stroke: var(--err); }
.mark-icon path { stroke-dasharray: 30; }
.js .is-answered .mark-icon path { animation: e-draw 360ms var(--ease-out) 120ms both; }
@keyframes e-draw { from { stroke-dashoffset: 30; } }
/* order: the line as answered, the pieces out of place on a wavy line */
.line .chip {
  display: inline-block; min-height: 48px; padding: var(--s-2) var(--s-4); margin-bottom: var(--lift);
  border: 2px solid var(--edge); border-radius: var(--r-2); background: var(--surface);
  font-size: 1.25rem; font-weight: 500; line-height: 28px; text-align: center; transform: translateY(var(--lift));
}
.line .chip.is-moved { border-color: var(--err); }
/* the closing stop stays with the last piece */
.line .tail { display: inline-flex; align-items: center; gap: var(--s-2); }
.line.is-right { border-bottom-color: var(--lvl); }
.report-form { display: contents; }
/* brought into view clear of the Next bar */
.is-answered .verdict { scroll-margin-bottom: 128px; }
.js .is-answered .feedback { animation: e-appear 420ms var(--ease-out) both; }

/* ---------- session end ---------- */
.end { padding-top: var(--s-7); }
.end-title { font-size: 1.375rem; font-weight: 400; text-align: center; margin-bottom: var(--s-3); }
.end-radar { margin: 0 calc(-1 * var(--s-2)); }
.end-side { margin-top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-5); }
.new-mastered { display: flex; align-items: center; justify-content: center; font-size: 1.125rem; }
/* the new arc lights once the shape has reached the ring; its sentence comes with it */
.radar .arc-new { stroke-dasharray: 108 108; }
.js .radar[data-animate] .arc-new { animation: e-light 700ms var(--ease-out) 1450ms both; }
.js .end .new-mastered { animation: e-appear 500ms var(--ease-out) 1650ms both; }
@keyframes e-light { from { stroke-dashoffset: 108; opacity: 0.4; } }
@keyframes e-appear { from { opacity: 0; transform: translateY(6px); } }

/* ---------- level up ---------- */
.levelup { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: var(--s-7); }
.lu-stage { position: relative; align-self: stretch; margin: 0 calc(-1 * var(--s-2)); aspect-ratio: 484 / 358; }
.lu-stage > div { position: absolute; inset: 0; transform-origin: 50% 50%; }
.lu-old { visibility: hidden; }
.lu-text { display: grid; width: 100%; margin-top: var(--s-5); max-width: 30rem; }
.lu-text > * { grid-area: 1 / 1; }
.lu-was { font-size: var(--fs-4); font-weight: 500; opacity: 0; }
.lu-now { display: grid; justify-items: center; gap: var(--s-3); }
.lu-now h1 { font-size: var(--fs-5); font-weight: 500; }
.lu-now p { color: var(--ink-2); }
.lu-now .btn { margin-top: var(--s-3); width: 100%; }
/* the moment, under 3 s: the lit arcs, as on home (0 to 0.4 s), close
   into one ring (to 1.1 s); it pulses once (to 1.7 s); then it shrinks into
   the centre while the next level's ring opens around it, with the progress
   already made there (1.75 to 2.65 s); the words follow (to 2.85 s) */
.js .lu-old { visibility: visible; animation: lu-old 2.6s var(--ease-io) both; }
.js .lu-old .arc { animation: lu-close 700ms var(--ease-io) 400ms both; }
.js .lu-old .arc-glow { animation: lu-close 700ms var(--ease-io) 400ms both, lu-glow 600ms var(--ease-io) 1100ms both; }
.js .lu-old .label { animation: lu-fade 250ms linear 1450ms both; }
.js .lu-new { animation: lu-new 900ms var(--ease-out) 1750ms both; }
.js .lu-was { animation: lu-was 2000ms linear both; }
.js .lu-now { animation: e-appear 500ms var(--ease-out) 2350ms both; }
/* each arc is drawn over its whole share of the ring, 100 long, and shows
   home's lit part by its own dash (radar_svg, `lit_close`) */
@keyframes lu-close { to { stroke-dasharray: 100 0; stroke-dashoffset: 0; } }
@keyframes lu-glow { 50% { opacity: 1; stroke-width: 12; } }
@keyframes lu-old {
  0%, 42% { transform: none; opacity: 1; }
  54% { transform: scale(1.04); opacity: 1; }
  66% { transform: none; opacity: 1; }
  100% { transform: scale(0.18); opacity: 0; }
}
@keyframes lu-new { from { transform: scale(1.6); opacity: 0; } }
@keyframes lu-fade { to { opacity: 0; } }
@keyframes lu-was { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- journey ---------- */
.journey { display: grid; gap: var(--s-6); }
.journey h1 { font-size: var(--fs-4); font-weight: 500; text-wrap: balance; }
.trend { display: grid; gap: var(--s-3); }
/* seven names do not fit one row beside the side column: the rows are
   balanced (four and three), not six and one left over */
.legend { display: block; text-wrap: balance; margin-inline: -6px; }
.legend button { display: inline-block; }
.legend button {
  min-height: 44px; min-width: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer;
  font-size: 0.9375rem; color: var(--ink-2);
}
.legend button[aria-pressed="true"] { color: var(--ink); font-weight: 600; text-decoration: underline 2px var(--lvl); text-underline-offset: 7px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.chart text { font-size: 12px; fill: var(--ink-2); }
.chart .band-label { font-weight: 600; }
.chart .rule { stroke: var(--line); }
.chart .brk { stroke: var(--ink-2); fill: none; stroke-width: 1.25; }
.chart .trend-line { fill: none; stroke: var(--lvl); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .skill-line { display: none; }
.chart .skill-line.is-shown { display: inline; }
.chart.is-skill .overall, .chart.is-skill .dots { display: none; }
.chart .levelup-mark { stroke: var(--ink-2); stroke-dasharray: 3 3; }
.chart .levelup-text { fill: var(--ink); font-weight: 600; }
.chart .dot { cursor: pointer; }
.chart .dot .hit { fill: transparent; }
.chart .dot .d { fill: var(--ground); stroke: var(--ink-2); stroke-width: 1.75; }
.chart .dot.is-on .d { fill: var(--ink); stroke: var(--ink); }
@media (hover: hover) { .chart .dot:hover .d { fill: var(--ink); stroke: var(--ink); } }
.chart .dot:focus-visible { outline: none; }
.chart .dot:focus-visible .d { stroke-width: 3; stroke: var(--ink); }
.chart-hint { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-1); color: var(--ink-2); }
.chart-hint svg { width: 12px; height: 12px; flex: none; fill: var(--ground); stroke: var(--ink-2); stroke-width: 1.75; }
.err-cards { display: grid; gap: var(--s-5); }
.err-cards.is-single .err-card:not(.is-shown) { display: none; }
.err-card { display: grid; gap: var(--s-3); }
.err-row { display: grid; grid-template-columns: 3.5rem 1fr; gap: var(--s-3); align-items: baseline; }
.err-row time { font-size: var(--fs-1); color: var(--ink-2); }
.err-row .de { font-size: var(--fs-3); line-height: 1.45; }
.err-ctx { font-size: var(--fs-1); color: var(--ink-2); }
/* the right column, kept light: the path and four dates */
.j-side { display: grid; gap: var(--s-4); align-content: start; }
.j-side h2 { margin-top: var(--s-3); font-size: var(--fs-2); font-weight: 500; }
.miles { display: grid; gap: var(--s-2); font-size: 0.9375rem; }
.miles li { display: grid; grid-template-columns: 3.5rem 1fr; gap: var(--s-3); }
.miles time { color: var(--ink-2); }
/* the recap's skills: the names' column is as wide as the longest name */
.week { display: grid; grid-template-columns: max-content max-content; justify-content: start; gap: var(--s-2) var(--s-4); font-size: 0.9375rem; }
.week li { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; }
@media (max-width: 639px) { .chart .x-odd { display: none; } }

/* ---------- the report toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: var(--s-5); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-1) 0 var(--s-4);
  border-radius: var(--r-2); background: var(--toast); color: var(--on-toast); font-size: 0.9375rem;
}
.toast button { min-height: 44px; padding: 0 var(--s-3); border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- app pages beyond the mockup ---------- */
/* home's one way to the account */
.home { position: relative; }
.account-link { position: absolute; top: var(--s-1); right: 0; z-index: 1; }
.account-link svg { stroke-width: 1.8; }
/* forms: login, invitation, reset, account */
.narrow { max-width: 420px; margin: 0 auto; padding: var(--s-6) var(--s-4) var(--s-7); display: grid; gap: var(--s-5); }
.narrow h1 { font-size: var(--fs-4); }
.narrow h2 { font-size: 1.25rem; margin-top: var(--s-3); }
.narrow p { color: var(--ink-2); }
.narrow .brand { font-weight: 600; color: var(--ink); }
.fields { display: grid; gap: var(--s-4); }
.field { display: grid; gap: var(--s-1); }
.field > span { font-size: var(--fs-1); color: var(--ink-2); }
fieldset.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.field input, .field select {
  min-height: 48px; padding: 0 var(--s-3); font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r-2);
}
.field input:focus-visible, .field select:focus-visible { outline: none; border-color: var(--lvl); }
.check { display: flex; gap: var(--s-3); align-items: flex-start; color: var(--ink-2); }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--lvl); }
.error { color: var(--err); font-weight: 500; }
.saved { color: var(--ink); font-weight: 500; }
.choices { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.choices label { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3); border: 2px solid var(--edge); border-radius: var(--r-2); cursor: pointer; }
.choices input { accent-color: var(--lvl); }
.choices label:has(:checked) { border-color: var(--lvl); }
.btn-quiet { background: none; color: var(--ink); box-shadow: inset 0 0 0 2px var(--edge); margin-bottom: 0; }
.danger { color: var(--err); }
.prose { display: grid; gap: var(--s-3); color: var(--ink); }
.prose p { color: var(--ink); }
/* items beyond the sentence: a word card, a situation */
.word { font-size: var(--fs-4); font-weight: 500; }
.word .article { color: var(--ink-2); font-weight: 400; }
.situation { font-size: 1.125rem; color: var(--ink); }
.cue-en { font-weight: 500; }
/* the German word's class, beside its English: 'watch (noun)' */
.cue-en .class { color: var(--ink-2); font-weight: 400; }
/* the situation has the row, the report its end */
.sentence-row .situation { flex: 1; }
/* a sentence with its English under it (grammar_gap_en) */
.sentence-row .ex { flex: 1; }
/* a translation reads at the size of the German in feedback: what it
   means is not a footnote (user decision, 2026-11-10) */
.sentence-row .ex .en, .said .en, .word-en { font-size: var(--fs-3); line-height: 1.45; }
.en b.hl { color: var(--ink); }
b.hl { font-weight: 600; text-decoration: underline 2.5px var(--lvl); text-underline-offset: 6px; }
.opt[lang="en"] { font-size: 1.125rem; }
.options.three { grid-template-columns: repeat(3, 1fr); }
.options.one { grid-template-columns: 1fr; }
.options.one .opt { font-size: 1.125rem; text-align: left; padding: var(--s-3) var(--s-4); }
/* a mode's first use (demo.html) */
.demo { padding: var(--s-3) var(--s-4); border-left: 4px solid var(--lvl); color: var(--ink-2); font-size: 0.9375rem; }
.demo strong { color: var(--ink); }
/* the report's first use (report_explain.html) */
.explain {
  position: fixed; left: var(--s-3); right: var(--s-3); bottom: var(--s-3); z-index: 5;
  max-width: 560px; margin: 0 auto; display: grid; gap: var(--s-3); padding: var(--s-4);
  border: 2px solid var(--edge); border-radius: var(--r-3); background: var(--surface);
}
.explain .row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.explain .btn { min-height: 48px; font-size: 1rem; }
/* verdicts */
.verdict.is-right, .verdict.is-almost { color: var(--ink); }
.said .de .ok-word { font-weight: 600; }
.slip { font-size: var(--fs-2); color: var(--ink); }
/* session end beyond practice: placement, a level check not passed */
.end-text { text-align: center; color: var(--ink-2); }
@media (min-width: 900px) { .end-text { text-align: left; } }
.msg { max-width: 480px; margin: 0 auto; padding: var(--s-7) var(--s-4); display: grid; gap: var(--s-4); }
.msg h1 { font-size: var(--fs-4); }
.msg p { color: var(--ink-2); }
.draft { padding: var(--s-2) var(--s-3); border-left: 4px solid var(--err); color: var(--ink); }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  :root { --fs-4: 2rem; --fs-5: 3.25rem; }
  .page { max-width: 1120px; padding: 0 var(--s-7) var(--s-7); }
  .home, .end {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: var(--s-7);
    align-items: center; align-content: center; min-height: 100vh; min-height: 100svh; padding-top: 0;
  }
  .home-radar, .end-radar { margin: 0; max-width: 560px; justify-self: center; width: 100%; }
  .home-side { margin-top: 0; max-width: 420px; }
  .length label { flex-flow: row wrap; align-content: center; align-items: baseline; gap: 0.35em; }
  .end { grid-template-areas: "radar title" "radar side"; }
  .end-radar { grid-area: radar; }
  .end-title { grid-area: title; align-self: end; text-align: left; margin: 0; font-size: 1.75rem; }
  .end-side { grid-area: side; align-self: start; max-width: 420px; }
  .new-mastered { justify-content: flex-start; }
  .end-side .btn { width: auto; min-width: 240px; align-self: flex-start; }
  .stage { padding-top: var(--s-6); }
  .item, .answer { gap: var(--s-6); }
  .options { gap: var(--s-4); }
  .levelup { padding-top: var(--s-5); }
  .lu-stage { align-self: center; width: 500px; margin: 0; }
  .lu-now .btn { width: auto; min-width: 240px; }
  .top.wide { max-width: 1120px; padding: 0 var(--s-6); }
  .journey { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); column-gap: var(--s-7); row-gap: var(--s-5); align-items: start; }
  .journey h1 { grid-column: 1 / -1; }
  .trend { grid-column: 1; }
  .j-side { grid-column: 2; padding-top: 56px; max-width: 320px; }
  .chart text { font-size: 8px; }
}

/* ---------- reduced motion: every page arrives at its final state ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .lu-old { visibility: hidden; }
}
.toast form { display: contents; }
.toast span { white-space: nowrap; }
/* a looked-up word, under the sentence (lookup.html) */
.lookup { padding: var(--s-2) var(--s-3); border-left: 4px solid var(--lvl); font-size: var(--fs-2); }
.lookup span { color: var(--ink-2); margin-left: var(--s-2); }
button.w { text-decoration: underline dotted var(--ink-2) 2px; text-underline-offset: 6px; }
/* typed answers (stage 7): the box, the letter keys, the word bank */
.typed {
  width: 100%; min-height: 56px; padding: var(--s-3) var(--s-4); font: inherit; font-size: var(--fs-3); font-weight: 500;
  color: var(--ink); background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r-3);
}
textarea.typed { min-height: 112px; resize: vertical; line-height: 1.4; }
.typed:focus-visible { outline: none; border-color: var(--lvl); }
.keys { display: flex; gap: var(--s-2); margin-top: calc(-1 * var(--s-3)); }
.key {
  min-width: 48px; min-height: 48px; padding: 0 var(--s-3); cursor: pointer; font-size: var(--fs-3); font-weight: 500; color: var(--ink);
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r-2);
  box-shadow: 0 var(--lift) 0 var(--edge); margin-bottom: var(--lift);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.key:active { transform: translateY(var(--lift)); box-shadow: 0 0 0 var(--edge); }
@media (hover: hover) { .key:hover { border-color: var(--lvl); } }
.bank { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bank li { padding: var(--s-1) var(--s-3); border: 2px solid var(--line); border-radius: var(--r-2); font-size: var(--fs-2); }
mark.near { text-decoration: underline dotted var(--ink-2) 2px; text-underline-offset: 6px; }
/* listening: one key plays the recording from its start, or stops it. A key
   as an option is; while it plays, the level's colour on its border and the
   square in place of the triangle. Without JavaScript the browser's own
   player stands in its place */
.player { flex: 1; display: grid; }
.play { display: flex; align-items: center; justify-content: center; gap: var(--s-3); }
.play svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.play.is-playing { border-color: var(--lvl); box-shadow: 0 var(--lift) 0 var(--lvl); }
.play .i-stop, .play.is-playing .i-play { display: none; }
.play.is-playing .i-stop { display: inline; }
.player audio { width: 100%; }
/* a dialogue: its two turns one under the other; once answered, each with
   its English under it */
.turns { flex: 1; display: grid; gap: var(--s-3); }
.js .player audio, html:not(.js) .play { display: none; }
.chart .trend-point { fill: var(--lvl); }
