/* Deutsch: a Reclam study booklet, read with a pencil and a highlighter.
   Yellow is the one loud thing: the cover, and the marker on the line you're hearing. */

:root {
  --paper: #ffffff;
  --paper-2: #f2f2ef;      /* photocopy grey */
  --ink: #000000;          /* the printed German */
  --graphite: #696969;     /* the pencilled decoding */
  --rule: #d5e0ea;         /* Schulheft ruling */
  --margin: #e9a6a6;       /* Schulheft margin line */
  --reclam: #f7c600;       /* Reclam Universal-Bibliothek yellow */
  --on-reclam: #000000;
  --marker: #ffe94d;       /* highlighter */
  --rotstift: #c8102e;     /* teacher's red pen */
  --ok: #1d6b3a;
  --focus: #1f5fbf;
  --kuli: #2346b5;         /* the learner's blue ballpoint: words circled for help */

  --serif: "Vollkorn", Georgia, serif;
  --sans: "Fira Sans Condensed", "Arial Narrow", sans-serif;
  --display: "Fira Sans Extra Condensed", "Fira Sans Condensed", "Arial Narrow", sans-serif;

  --col: 44rem;
  --gutter: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1a19;
    --paper-2: #252524;
    --ink: #f1f0ea;
    --graphite: #a3a29c;
    --rule: #2f3740;
    --margin: #6b3434;
    --marker: #6b5a00;
    --rotstift: #ff6b6b;
    --ok: #6fcf8f;
    --focus: #8ab4ff;
    --kuli: #8fa8ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--sans);
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--col); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Cover (the Reclam booklet) ---------- */

.cover {
  background: var(--reclam);
  color: var(--on-reclam);
  padding: 14px 0 22px;
}
.cover .back {
  display: inline-block;
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  padding: 8px 0;
}
.cover .back:hover { text-decoration: underline; }
.cover .bar { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.cover .out {
  margin-left: auto; padding: 8px 0; border: 0; background: none; color: inherit;
  font: 600 1rem/1 var(--sans); cursor: pointer;
}
.cover .out:hover { text-decoration: underline; }
.cover .kicker { font: 500 1.0625rem/1.2 var(--sans); margin: 18px 0 0; }
.cover h1 {
  font: 900 clamp(3.4rem, 14vw, 6.5rem)/0.86 var(--display);
  letter-spacing: -0.01em;
  margin: 0;
  padding-top: 0.12em;
  hyphens: manual;
}
.cover .sub { font: 400 1.25rem/1.3 var(--serif); font-style: italic; margin: 10px 0 0; }
.cover .credit { font: 400 0.9375rem/1.3 var(--sans); margin: 14px 0 0; }
.cover .credit a { text-underline-offset: 2px; }

/* ---------- Steps (a real sequence, so numbers are earned) ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 2px solid var(--ink);
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 6px 10px 0;
  background: none;
  border: 0;
  border-bottom: 5px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  text-align: left;
}
.steps .num { font: 800 1.6rem/1 var(--display); }
.steps .name { font: 500 0.9375rem/1.15 var(--sans); }
.steps button[aria-current="step"] { border-bottom-color: var(--reclam); }
.steps button:disabled { color: var(--graphite); cursor: not-allowed; }
.steps button:disabled .num::after { content: " \1F512"; font-size: 0.7em; vertical-align: 0.15em; filter: grayscale(1); opacity: .6; }
.steps .done .num::after { content: " \2713"; font-size: 0.75em; color: var(--ok); }

/* ---------- Panel copy ---------- */

.panel { padding: 22px 0 64px; }
.lede { font: 400 1.125rem/1.5 var(--serif); max-width: 36em; margin: 0 0 18px; }
.lede + .lede { margin-top: -8px; }
.small { font-size: 0.9375rem; color: var(--graphite); }
h2 { font: 800 2rem/1 var(--display); margin: 40px 0 12px; }
h3 { font: 600 1.125rem/1.2 var(--sans); margin: 24px 0 8px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  border: 2px solid var(--ink); border-radius: 2px;
  background: var(--paper); color: var(--ink);
  font: 600 1rem/1.1 var(--sans);
  cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--ink); color: var(--paper); }
@media (hover: hover) {
  .btn:hover { background: var(--paper-2); }
  .btn.primary:hover { background: var(--ink); opacity: .88; }
  .btn[aria-pressed="true"]:hover { background: var(--marker); }
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.quiet { border-color: transparent; padding-left: 8px; padding-right: 8px; }
.btn[aria-pressed="true"] { background: var(--marker); }

.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; }
.seg .btn + .btn { border-left-width: 0; }

/* ---------- The interlinear text ---------- */

.text { position: relative; }
.line {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  column-gap: 10px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--rule);
}
.line::before {           /* Schulheft margin line */
  content: ""; position: absolute; top: 0; bottom: -1px; left: 34px;
  border-left: 1.5px solid var(--margin);
}
.line .sp {
  font: 500 0.875rem/2.1 var(--sans);
  color: var(--graphite);
  text-align: right;
  padding-right: 6px;
}
/* Word gaps are padding, not flex gaps, so the highlighter runs unbroken across the line. */
.il { display: flex; flex-wrap: wrap; row-gap: 6px; padding-left: 6px; --row: 1.95rem; }
.tok, .grp { display: inline-flex; flex-direction: column; }
.tok { padding-right: 0.55em; }
.grp { padding-right: 0.55em; }
.grp > .toks { display: flex; }
.grp > .toks > .tok:last-child { padding-right: 0; }
.de { font: 400 1.5rem/1.3 var(--serif); white-space: nowrap; }
.gl { font: 400 0.9375rem/1.2 var(--sans); color: var(--graphite); white-space: nowrap; margin-top: 1px; }
.real {
  position: relative;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1.5px solid var(--graphite);
  font: italic 400 0.9375rem/1.2 var(--serif);
  color: var(--graphite);
  text-align: center;
  white-space: nowrap;
}
.real::before, .real::after {   /* the bracket's ticks */
  content: ""; position: absolute; top: -6px; height: 5px; border-left: 1.5px solid var(--graphite);
}
.real::before { left: 0; }
.real::after { right: 0; }

.nogloss .gl, .nogloss .real { visibility: hidden; }
.nogerman .de { visibility: hidden; }
.plain .de { font-size: 1.375rem; }

/* the line you're hearing: a highlighter swipe across the German row */
.line.now .tok, .line.now .grp {
  background: linear-gradient(var(--marker), var(--marker)) 0 2px / 100% calc(var(--row) - 2px) no-repeat;
}
.line.now .plain-de, .plain .line.now .de {
  background: var(--marker);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  margin: 0 -3px; padding: 0 3px;
}
.line.loop .sp::after { content: "\21BB"; display: block; color: var(--ink); font-size: 1rem; line-height: 1; }
.tap .line { cursor: pointer; }
@media (hover: hover) {
  .tap .line:hover .sp { color: var(--ink); }
}

.en { font: italic 400 1.0625rem/1.4 var(--serif); color: var(--graphite); padding-left: 6px; margin-top: 6px; }

.star {
  align-self: start;
  width: 40px; height: 40px;
  border: 0; background: none; cursor: pointer;
  font-size: 1.35rem; line-height: 1; color: var(--graphite);
}
.marks { display: flex; flex-direction: column; align-items: center; align-self: start; }
.star[aria-pressed="true"] { color: var(--ink); }
.star[aria-pressed="true"]::before { content: "\2605"; }
.star[aria-pressed="false"]::before { content: "\2606"; }

/* help marks, in the learner's blue ballpoint: a ? by the sentence, a ring round the word */
.helpbtn {
  width: 40px; height: 40px; padding: 0;
  border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.helpbtn::before {
  content: "?"; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--graphite); color: var(--graphite);
  font: 600 0.9375rem/1 var(--sans);
}
.helpbtn[aria-pressed="true"]::before { background: var(--kuli); border-color: var(--kuli); color: var(--paper); }
.tok .de, .pw { position: relative; }
.tok.helped .de::after, .pw.helped::after {
  content: ""; position: absolute; inset: 0 -0.28em -1px; pointer-events: none;
  border: 1.5px solid var(--kuli); border-radius: 50%; transform: rotate(-2deg);
}
.marking .line[data-help] .tok, .marking .line[data-help] .pw { cursor: pointer; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--paper); border-top: 2px solid var(--ink);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.dock .bar { flex-wrap: nowrap; justify-content: space-between; }
.dock .btn b { font-weight: 600; }
.dockmsg { font-size: 0.9375rem; line-height: 1.25; color: var(--kuli); }
.marking .dock { border-top-color: var(--kuli); }
body.has-dock { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

/* try-first mode */
.attempt { grid-column: 2 / 4; padding-left: 6px; margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.attempt input {
  flex: 1 1 9em; min-width: 0; min-height: 44px; padding: 6px 2px;
  border: 0; border-bottom: 1.5px solid var(--graphite); border-radius: 0;
  background: transparent; font: 400 1.0625rem/1.2 var(--sans); color: var(--graphite);
}
.attempt input::placeholder { color: var(--graphite); opacity: .6; }
.mine { grid-column: 2 / 4; padding-left: 6px; margin-top: 4px; font: 400 0.9375rem/1.3 var(--sans); color: var(--graphite); }
.mine b { font-weight: 500; color: var(--ink); }

/* step 1: decoding marked in red pen. Underlined German = a word you missed;
   once the line counts, the gloss for it shows in red too. */
.decode .tok[role="button"] { cursor: help; }
.nogloss .tok.peek .gl { visibility: visible; }
.decode .tok.miss .de { text-decoration: underline wavy var(--rotstift) 1.5px; text-underline-offset: 7px; }
.decode .tok.part .de { text-decoration: underline dotted var(--rotstift) 2px; text-underline-offset: 7px; }
.decode .tok.miss .gl, .decode .tok.part .gl { color: var(--rotstift); }
.score { display: block; font: 800 1rem/1 var(--display); letter-spacing: -0.01em; }
.score.ok { color: var(--ok); }
.score.no { color: var(--rotstift); }
.line > .verdict { grid-column: 2 / 4; padding-left: 6px; margin: 6px 0 0; font-weight: 500; }
.tally { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; font: 500 1rem/1.2 var(--sans); }
.tally > span { white-space: nowrap; }
.meter { flex: 1; height: 8px; background: var(--paper-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); }

/* ---------- Player ---------- */

.stage { position: sticky; top: 0; z-index: 5; background: var(--paper); padding: 10px 0 12px; border-bottom: 2px solid var(--ink); }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video iframe, .video > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.subcover {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--cover, 18%);
  background: #000;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  color: #777; font: 400 0.8125rem/1 var(--sans);
}
.stage .bar { margin-top: 10px; }
.passes { font: 500 1rem/1 var(--sans); margin-left: auto; white-space: nowrap; }
.passes b { font: 800 1.6rem/1 var(--display); vertical-align: -2px; }
.coverctl { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; color: var(--graphite); margin-top: 8px; }
.coverctl input { width: 120px; accent-color: var(--ink); }

.gate {
  margin-top: 28px; padding: 18px 0 0;
  border-top: 2px solid var(--ink);
}
.gate p { margin: 0 0 12px; max-width: 36em; }

/* ---------- Downloads ---------- */

.files { list-style: none; margin: 8px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.files li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.files .what { font: 800 1.6rem/1 var(--display); }
.files .how { grid-column: 1; font-size: 0.9375rem; color: var(--graphite); }
.files .btn { grid-row: 1 / 3; grid-column: 2; }

/* ---------- Activities ---------- */

.acts { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--rule); margin: 0 calc(-1 * var(--gutter)) 18px; padding: 0 var(--gutter); scrollbar-width: none; }
.acts button {
  flex: 0 0 auto; background: none; border: 0; border-bottom: 4px solid transparent;
  padding: 10px 12px 8px; margin-bottom: -1px; cursor: pointer;
  font: 500 1rem/1.1 var(--sans); color: var(--graphite);
}
.acts button:first-child { padding-left: 0; }
.acts button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.turn {
  height: 8px; background: var(--paper-2); margin: 12px 0 6px; overflow: hidden;
}
.turn i { display: block; height: 100%; width: 0; background: var(--ink); }
.turnlabel { font: 500 1rem/1.2 var(--sans); min-height: 1.2em; }

.card { padding: 16px 0; }
.card .de-big { font: 400 1.75rem/1.3 var(--serif); }
.card .counter { font: 500 0.9375rem/1 var(--sans); color: var(--graphite); margin-bottom: 10px; }

.dict input {
  width: 100%; min-height: 48px; padding: 8px 2px;
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent;
  font: 400 1.5rem/1.3 var(--serif);
}
.diff { font: 400 1.5rem/1.5 var(--serif); margin-top: 10px; }
.diff .bad { color: var(--rotstift); text-decoration: line-through 2px; margin-right: 0.3em; }
.diff .fix { color: var(--rotstift); border-bottom: 2px solid var(--rotstift); }
.diff .good { color: var(--ink); }
.verdict { font: 600 1rem/1.3 var(--sans); margin-top: 6px; }
.verdict.ok { color: var(--ok); }
.verdict.no { color: var(--rotstift); }

.level { font: 500 1rem/1 var(--sans); }

/* ---------- Assignments ---------- */

.tests li.passed .what::after { content: " \2713"; font-size: 0.7em; color: var(--ok); vertical-align: 0.1em; }
.tests .how b { display: block; margin-top: 2px; font-weight: 500; color: var(--ok); }
h2.tname { margin: 6px 0 14px; }
.quiz { padding: 14px 0 0; }
.quiz .text .line { border-bottom: 0; }
.qin {
  width: 100%; min-height: 48px; margin-top: 10px; padding: 8px 2px;
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent;
  font: 400 1.25rem/1.3 var(--sans);
}
.qin[lang="de"] { font: 400 1.5rem/1.3 var(--serif); }
.qin:disabled { opacity: .6; }
.prompt-en { font: italic 400 1.375rem/1.4 var(--serif); margin: 0 0 14px; }
.quiz .de-big { font: 400 1.75rem/1.3 var(--serif); margin: 14px 0 0; }

/* match: two columns of tiles */
.match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.mcol { display: flex; flex-direction: column; gap: 8px; }
.mtile {
  min-height: 52px; padding: 8px 10px;
  border: 2px solid var(--ink); border-radius: 2px; background: var(--paper);
  font: 500 1rem/1.2 var(--sans); text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.mtile[lang="de"] { font: 400 1.25rem/1.2 var(--serif); }
.mtile[aria-pressed="true"] { background: var(--marker); }
.mtile.ok, .mtile.ok:disabled { border-color: var(--rule); background: var(--paper-2); color: var(--graphite); cursor: default; }
.mtile.wrong { border-color: var(--rotstift); color: var(--rotstift); animation: shake .32s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* build the sentence: tiles move from the bank to the answer line */
.tiles { display: flex; flex-wrap: wrap; gap: 8px; min-height: 64px; padding: 10px 0; }
.tiles.answer { border-bottom: 2px solid var(--ink); align-content: flex-start; }
.tiles.bank { padding-top: 14px; }
.tile {
  min-height: 46px; padding: 6px 12px;
  border: 2px solid var(--ink); border-radius: 2px; background: var(--paper);
  font: 400 1.375rem/1.2 var(--serif); cursor: pointer;
}
.tile.used { visibility: hidden; }
.tile.ok { border-color: var(--ok); }
.tile.bad { border-color: var(--rotstift); color: var(--rotstift); }

/* fill the gap */
.blank { display: inline-block; min-width: 3.2em; border-bottom: 2px solid var(--ink); }
.blank.filled { min-width: 0; border-bottom-width: 0; }
.blank.ok { color: var(--ok); }
.blank.no { color: var(--rotstift); text-decoration: underline wavy var(--rotstift) 1.5px; text-underline-offset: 7px; }

.result { padding: 8px 0; }
.result .big { font: 900 3.4rem/1 var(--display); margin: 6px 0 10px; }

.trouble { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.trouble li { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.trouble .de { font-size: 1.375rem; white-space: normal; }
.trouble .n { margin-left: auto; font: 500 0.9375rem/1 var(--sans); color: var(--rotstift); }

/* ---------- Help list ---------- */

.hlist { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.hitem { padding: 14px 0 16px; border-bottom: 1px solid var(--rule); }
.hitem .text .line { border-bottom: 0; padding-top: 0; }
.hw { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.hw .de { white-space: normal; }
.hw .gl { white-space: normal; font-size: 1.0625rem; }
.why { margin: 8px 0 0; max-width: 36em; }
.why.part { color: var(--graphite); }
.why.part span { font-family: var(--serif); color: var(--ink); }
.ctx { margin: 10px 0 0; font: 400 1.1875rem/1.35 var(--serif); }
.ctx mark { background: none; color: inherit; border-bottom: 2px solid var(--kuli); }
.hitem .en { padding-left: 0; margin-top: 2px; font-size: 1rem; }
.tag { margin: 8px 0 10px; font-size: 0.875rem; color: var(--graphite); }
.wordnotes { margin-top: 10px; }
.wordnotes summary { cursor: pointer; font-weight: 500; min-height: 32px; }
.wordnotes dl { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.wordnotes dt { font: 400 1.0625rem/1.35 var(--serif); }
.wordnotes dd { margin: 0; font-size: 0.9375rem; }
.empty { font: italic 400 1.125rem/1.4 var(--serif); color: var(--graphite); }
.lessons .hc { display: block; margin-top: 4px; font-weight: 400; color: var(--kuli); }

/* ---------- Exams: the teacher's red pen comes out ---------- */

.lessons li.exam .n { color: var(--rotstift); font-size: 2.2rem; }
.lessons li.exam.passed .s::before { content: "\2713  "; color: var(--ok); }
.lessons li.locked .row {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0 14px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--rule); color: var(--graphite);
}
.lessons li.locked .n::after { content: " \1F512"; font-size: .4em; vertical-align: .6em; filter: grayscale(1); opacity: .6; }

.tests li.failed .what::after { content: " \2717"; font-size: 0.7em; color: var(--rotstift); vertical-align: 0.1em; }
.hint { margin: -6px 0 6px; }

.answer { margin-top: 6px; }
.answer .lbl { margin: 12px 0 0; font: 600 0.8125rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }
.answer .diff { margin-top: 4px; font-size: 1.375rem; }
.answer .why { margin-top: 10px; }
.diff.yours { color: var(--graphite); }
.diff .flag { background: linear-gradient(var(--marker), var(--marker)) 0 85% / 100% 45% no-repeat; }
.prompt-en.small-prompt { font-size: 1.0625rem; margin: 0 0 2px; }

.pattern { border-left: 3px solid var(--rotstift); padding: 2px 0 2px 14px; margin: 6px 0 14px; }
.pattern p { margin: 0 0 8px; max-width: 36em; }
.pattern .gnote { padding: 8px 0; }
.pattern .gnote .de { font-size: 1.25rem; white-space: normal; }
.pattern .gnote .gl { white-space: normal; }

/* the role-play is printed like a play: who speaks in the margin, the line beside it */
.script .say { padding-left: 6px; min-width: 0; }
.de-line { font: 400 1.375rem/1.35 var(--serif); margin: 0; overflow-wrap: anywhere; }
.script .line.tap { cursor: pointer; }
.script .line.now .de-line { background: var(--marker); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.script .line.ok .sp { color: var(--ok); }
.script .line.no .sp { color: var(--rotstift); }
.script .en { padding-left: 0; margin: 2px 0 0; font-size: 1rem; }
.script .answer .diff { font-size: 1.1875rem; }
.script .heard { margin: 2px 0 0; color: var(--ok); }
.script .answer { margin-top: 0; }
.script .answer .lbl:first-child { margin-top: 4px; }
.speak { padding-top: 6px; }
.cue {
  display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: baseline;
  margin-top: 8px; padding: 12px 0; border-top: 2px solid var(--ink);
}
.cue .sp { font: 600 0.875rem/1 var(--sans); text-align: right; padding-right: 6px; }
.cue p { margin: 0; padding-left: 6px; font: italic 400 1.25rem/1.4 var(--serif); }
.speak .small { margin: 10px 0 0; }
.btn.rec { min-width: 7.5em; }
.btn.rec.on { background: var(--rotstift); border-color: var(--rotstift); color: var(--paper); }
.typebox { width: 100%; }
.typebox .qin { margin-top: 0; }

.meform { display: grid; max-width: 26rem; }
.mefield { display: grid; gap: 4px; margin-top: 14px; }
.mefield span, .about span { font: 600 1rem/1.25 var(--sans); }
.mefield input, .mefield select {
  min-height: 48px; padding: 8px 2px;
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: var(--paper);
  font: 400 1.25rem/1.3 var(--sans);
}
.about { display: grid; gap: 6px; margin-top: 18px; }
.about textarea {
  width: 100%; min-height: 3.4em; padding: 8px 2px;
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent;
  font: 400 1.25rem/1.4 var(--serif); resize: vertical;
}

/* ---------- Grammar ---------- */

.grammar { border-top: 2px solid var(--ink); margin-top: 48px; }
.gnote { padding: 14px 0 16px; border-bottom: 1px solid var(--rule); }
.gnote .de { font-size: 1.375rem; white-space: normal; }
.gnote .gl { white-space: normal; font-size: 1rem; }
.gnote p { margin: 8px 0 0; max-width: 36em; }

/* ---------- Login ---------- */

.login { display: grid; gap: 6px; max-width: 22rem; }
.login label { font: 600 1rem/1.2 var(--sans); margin-top: 14px; }
.login input {
  min-height: 48px; padding: 8px 2px;
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent;
  font: 400 1.25rem/1.3 var(--sans);
}
.login .verdict { margin: 12px 0 0; }
.login .btn { justify-self: start; margin-top: 20px; }

/* ---------- Index ---------- */

.lessons { list-style: none; margin: 0; padding: 0; }
.lessons a {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0 14px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.lessons .n { font: 900 2.6rem/0.9 var(--display); }
.lessons .t { font: 400 1.5rem/1.15 var(--serif); }
.lessons .e { grid-column: 2; font-size: 0.9375rem; color: var(--graphite); }
.lessons .s { grid-row: 1 / 3; grid-column: 3; font: 500 0.9375rem/1.2 var(--sans); text-align: right; }
.lessons a:hover .t { text-decoration: underline; text-underline-offset: 4px; }

.foot { padding-top: 28px; padding-bottom: 40px; font-size: 0.875rem; color: var(--graphite); }

@media (max-width: 430px) {
  .steps .name { font-size: 0.8125rem; }
  .steps .num { font-size: 1.4rem; }
}

@media (min-width: 720px) {
  .cover { padding: 18px 0 34px; }
  .steps .name { font-size: 1.0625rem; }
  .de { font-size: 1.75rem; }
  .il { --row: 2.275rem; }
  .gl, .real { font-size: 1rem; }
  .line { grid-template-columns: 44px 1fr auto; }
  .line::before { left: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .mtile.wrong { animation: none; }
}
