/* Kürsli Rafeldt · shared styles for the public ZAP2 practice area (/ueben).
   Editorial brand base (cream · forest · gold) warmed up for ~14-year-olds:
   per-chapter accent colour, soft cards, streak + progress, gentle motion. */
:root {
  --bg: #f2efe4; --bg-2: #ebe7d7; --paper: #fbf9f2;
  --ink: #111813; --ink-soft: #2c332d; --ink-mute: #6a6355;
  --rule: #d9d3c3; --rule-2: #c8c1ac;
  --forest: #1a3a2e; --forest-2: #2c5a45; --forest-dk: #0f2a20;
  --tan: #b08a57; --gold: #c9a961; --gold-dk: #a8872c; --claret: #6e2a2a;
  --terracotta: #b0613a; --terracotta-2: #cf7a4f;   /* K3 / Werkstatt · design/brand/tokens.css */

  /* Per-chapter accent (overridden per page below); defaults to forest. */
  --accent: #1a3a2e; --accent-2: #2c5a45; --accent-soft: rgba(26, 58, 46, .10);
  /* --accent faerbt Flaechen, Raender, Balken und Ringe (3:1 genuegt),
     --accent-ink faerbt TEXT (4.5:1 auf --bg und auf --paper). Vorher trug
     --accent beides: auf K2 fielen damit 14 Textstellen durch. */
  --accent-ink: #1a3a2e;
  /* Fokusring. War golden mit 1.95:1 gegen den Cremegrund, wo WCAG 3:1
     verlangt; auf dunklen Flaechen bleibt Gold richtig (6.80:1). */
  --focus: var(--forest);
  /* Rand eines Bedienelements, 3:1 auf --paper (WCAG 1.4.11). --rule
     misst 1.42:1, --rule-2 1.71:1 · beide zu schwach fuer ein Feld. */
  --rule-3: #968963;

  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(26, 42, 30, .05), 0 8px 24px -10px rgba(26, 42, 30, .16);
  --shadow-lift: 0 4px 10px rgba(26, 42, 30, .08), 0 22px 44px -14px rgba(26, 42, 30, .24);
  /* Schriften · eine Rolle je Token (Durchsicht 2026-10-30)
     --font-display  Fraunces · Ueberschriften, Marke, grosse Zahlen
     --font-body     Source Serif 4 · Lesetext, Aufgaben, Rueckmeldungen
     --font-ui       Source Sans 3 · Bedienelemente: Navigation, Knoepfe,
                     Beschriftungen, Reiter, Tabellenkoepfe, Seitenfuss
     --font-mono     JetBrains Mono · nur wo die Zeichen selbst zaehlen:
                     Ausdruckskachel, Antwortfeld, Tasten, code, Zahlentabellen */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-ui: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* Each chapter page gets a body class (set in page.js); the hub colours its
   own cards individually further down. */
body.ch-k1 { --accent: #1a3a2e; --accent-2: #2c5a45; --accent-soft: rgba(26, 58, 46, .10); --accent-ink: #1a3a2e; }
body.ch-k2 { --accent: #a8872c; --accent-2: #c9a961; --accent-soft: rgba(168, 135, 44, .12); --accent-ink: #836a22; }
body.ch-zap1 { --accent: #1a3a2e; --accent-2: #2c5a45; --accent-soft: rgba(26, 58, 46, .10); --accent-ink: #1a3a2e; }
body.ch-k3 { --accent: var(--terracotta); --accent-2: var(--terracotta-2); --accent-soft: rgba(176, 97, 58, .12); --accent-ink: #a25a36; }

* { box-sizing: border-box; }
/* Sprungmarke · sie sitzt ausserhalb des Bildes und kommt herein, sobald sie
   den Tastaturfokus bekommt. Kein display:none und kein visibility:hidden:
   beides nimmt sie auch der Tastatur weg. */
.kr-skip {
  position: absolute; left: 12px; top: -200px; z-index: 1000;
  padding: 11px 18px; border-radius: 0;
  background: var(--forest); color: var(--paper);
  font-family: var(--font-ui); font-weight: 600; font-size: 14px;
  letter-spacing: .01em; text-decoration: none;
  transition: top .12s ease;
}
.kr-skip:focus { top: 12px; outline: 3px solid var(--gold); outline-offset: 2px; }
/* Der Inhaltsbereich bekommt den Fokus, zeichnet dafuer aber keinen Rahmen:
   der Sprung ist schon durch den Seitenwechsel sichtbar. */
#root:focus, main[tabindex]:focus { outline: none; }
/* Die Sprungmarke landet unter dem klebenden Kopf, nicht dahinter. */
#root, main[tabindex] { scroll-margin-top: calc(var(--head-h, 128px) + 4px); }

html { scroll-behavior: smooth; }
html, body { background: var(--bg); color: var(--ink); margin: 0; font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-underline-offset: 3px; }

/* Site head */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 32px; border-bottom: 1px solid var(--rule); background: var(--paper); flex-wrap: wrap; position: sticky; top: 0; z-index: 50; }
.site-head .brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.kr-mark { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--forest); color: var(--paper); font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; }
.site-head .nm { font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.site-head .nm em { color: var(--forest); font-style: italic; }
.site-head nav { display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--font-ui); font-weight: 500; font-size: 12px; letter-spacing: .02em; }
.site-head nav a { color: var(--ink-mute); text-decoration: none; padding-bottom: 4px; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.site-head nav a:hover, .site-head nav a.cur { color: var(--accent-ink); border-bottom-color: var(--accent); }
/* Der Weg zurueck zur Weiche (/ueben). Steht in beiden Produkt-Navs an letzter
   Stelle und ist bewusst leiser als die Lernbereiche daneben: es ist kein
   Kapitel, sondern die Frage "welche Pruefung schreibe ich eigentlich". */
.site-head nav a.nav-switch { color: var(--ink-mute); opacity: .78;
  margin-left: 6px; padding-left: 20px; border-left: 1px solid var(--rule); }
.site-head nav a.nav-switch:hover { opacity: 1; color: var(--accent-ink); }

/* Main shell */
.sb-main { max-width: 1000px; margin: 0 auto; padding: clamp(40px, 8vh, 88px) 24px 96px; }
.sb-head { text-align: center; margin-bottom: 40px; }
.sb-head .eyebrow { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--accent-ink); margin-bottom: 14px; }
.sb-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 5.2vw, 3.6rem); line-height: .98; letter-spacing: -.035em; margin: 0 0 14px; color: var(--ink); }
.sb-head h1 em { font-style: normal; color: var(--accent-ink); }
.sb-head .lede { font-family: var(--font-display); font-size: 19px; line-height: 1.45; color: var(--ink-soft); max-width: 60ch; margin: 0 auto; }

/* Auf dem Telefon war der Themenkopf ein Buchdeckel: die Lede lief zentriert
   über elf bis vierzehn Zeilen, und zentrierter Mehrzeiler liest sich schlecht,
   weil jede Zeile woanders anfängt. Linksbündig, eine Spur kleiner, engerer
   Titel · derselbe Text, rund 200 px weniger über der Aufgabe. */
@media (max-width: 700px) {
  .sb-head { text-align: left; margin-bottom: 26px; }
  .sb-head h1 { font-size: clamp(1.9rem, 7.4vw, 2.4rem); letter-spacing: -.025em; }
  .sb-head .lede { font-size: 16.5px; line-height: 1.5; margin: 0; }
  .sb-main { padding-top: clamp(24px, 4vh, 40px); }
}

.sb-section { margin-top: 48px; scroll-margin-top: calc(var(--head-h, 100px) - 4px); }
.sb-section[hidden] { display: none; } /* one topic per view: attribute beats any display rule */

/* Topic pager (one topic per view) */
.topic-pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--rule); }
.topic-pager .pg-meta { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); }
.topic-pager .pg-meta b { color: var(--accent-ink); font-weight: 500; }
.btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.btn.ghost:disabled { background: transparent; }
.sb-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 20px; margin-bottom: 22px; }
.sb-section-head .eyebrow { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--accent-ink); }
.sb-section-head .exam-pts { display: inline-block; margin-left: 10px; padding: 1px 8px; border: 1px solid var(--rule-2); border-radius: 999px; color: var(--ink-mute); letter-spacing: .02em; text-transform: none; white-space: nowrap; }
.sb-section h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.05; letter-spacing: -.02em; margin: 4px 0 0; }
.sb-section h2 em { font-style: normal; color: var(--accent-ink); }
.sb-section .sub { font-family: var(--font-display); font-size: 17px; color: var(--ink-soft); margin: 8px 0 0; max-width: 64ch; }

/* Scoreboard: streak chip + progress bar + counters */
.scoreboard { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; font-family: var(--font-ui); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; color: var(--ink-mute); }
.scoreboard b { color: var(--accent-ink); font-weight: 500; }
.scoreboard .streak { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); letter-spacing: .02em; transition: background .2s, color .2s; }
.scoreboard .streak[hidden] { display: none; } /* attribute must beat the display rule above */
.scoreboard .streak b { color: var(--ink); }
.scoreboard .streak.hot { background: rgba(201, 169, 97, .20); color: var(--gold-dk); }
.scoreboard .streak.hot b { color: var(--gold-dk); }
.scoreboard .progress { display: inline-flex; align-items: center; gap: 8px; }
.scoreboard .bar { width: 92px; height: 7px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.scoreboard .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .45s cubic-bezier(.2, .7, .2, 1); }
.scoreboard .pl { letter-spacing: .02em; }

/* ----- two-row transparency panel (per topic) ----- */
.scoreboard.sb2 { flex-direction: column; align-items: flex-start; gap: 6px; max-width: 100%; }
.sb2-row { display: inline-flex; align-items: center; gap: 9px; }
/* the «Sitzt» row wraps «Runden 34 · Bestserie 14» onto a line of its own
   instead of pushing the page sideways (it made /ueben/deutsch1 401px wide on
   a 390px phone); the Stufe row keeps its buttons beside the chip */
.sb2-row:has(> .sb2-meta) { flex-wrap: wrap; row-gap: 4px; max-width: 100%; }
.sb2-lb { min-width: 56px; color: var(--ink-mute); }
.sb2 .dots { display: inline-flex; gap: 3px; align-items: center; }
.sb2 .dot { width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box; flex: 0 0 auto; }
.sb2 .dot.d-ok { background: var(--accent); }
.sb2 .dot.d-no { background: transparent; border: 1.5px solid var(--claret); }
.sb2 .dot.d-half { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); border: 1.5px solid var(--accent); }
.sb2 .dot.d-empty { background: var(--rule); opacity: .5; }
.sb2 .sb2-ratio { color: var(--accent-ink); min-width: 30px; }
.sb2 .sb2-p { color: var(--ink); white-space: nowrap; }
/* the Gemischt readout («Kapitel 1 · 0 von 30 Sternen · …») wraps: it made /ueben/k1#mix 524px wide on a 390px phone */
.sb2 .sb2-p[id$="-chread"] { white-space: normal; min-width: 0; }
.sb2-row:has(> [id$="-chread"]) { max-width: 100%; }
.sb2 .sb2-meta { color: var(--ink-mute); letter-spacing: .02em; }
.sb2 .streak { margin-left: 2px; }

/* ----- chapter-header course strip (all 21 subjects) ----- */
.course-head { margin-top: 16px; display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.course-head[hidden] { display: none; }
.cs-strip { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; padding: 0 1px; }
.cs-strip .seg { width: 6px; min-height: 2px; border-radius: 2px; opacity: .26;
  transition: height .45s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.cs-strip .seg.mine { opacity: 1; }
.cs-read { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); }
.cs-read b { color: var(--ink); font-weight: 500; }
.cs-read .cs-course b { color: var(--accent-ink); }

/* ----- milestone toast (self-dismissing, never auto-advances) ----- */
.ms-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px); z-index: 60;
  background: var(--forest); color: var(--paper); font-family: var(--font-display); font-size: 15px;
  padding: 12px 22px; border-radius: 999px; box-shadow: 0 12px 30px -10px rgba(15, 42, 32, .5);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; display: flex; gap: 16px; max-width: 90vw; }
.ms-toast[hidden] { display: none; }
.ms-toast.in { opacity: 1; transform: translateX(-50%) translateY(0); }
.ms-toast span { white-space: nowrap; }
/* auf dem Handy darf ein langer Satz umbrechen, statt am Rand abzubrechen (telefon T10) */
@media (max-width: 600px) { .ms-toast { border-radius: 18px; } .ms-toast span { white-space: normal; } }

/* ----- hub "Dein Kurs" overview panel ----- */
.course-overview { margin: 0 0 34px; padding: 22px 24px; border: 1px solid var(--rule); border-radius: var(--radius, 14px); background: var(--bg-2, #ebe7d7); }
.course-overview[hidden] { display: none; }
.co-eyebrow { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--gold-dk); margin-bottom: 14px; }
.co-empty { font-family: var(--font-body); font-size: 15px; line-height: 1.55; color: var(--ink-soft); margin: 0; max-width: 60ch; }
.co-empty b { color: var(--forest); }
.co-top { display: flex; align-items: center; gap: 22px; }
.co-num { display: flex; flex-direction: column; line-height: 1; flex: 0 0 auto; }
.co-num b { font-family: var(--font-display); font-size: 44px; font-weight: 500; color: var(--forest); }
.co-num span { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--ink-mute); margin-top: 6px; }
.co-bar { position: relative; flex: 1 1 auto; height: 12px; border-radius: 999px; background: rgba(26, 58, 46, .10); }
.co-bar i { display: block; height: 100%; border-radius: 999px; background: var(--forest); transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.co-peak { position: absolute; top: -3px; width: 2px; height: 18px; background: var(--gold); border-radius: 2px; transform: translateX(-1px); }
.co-canopy { display: flex; align-items: flex-end; gap: 4px; height: 42px; margin: 18px 0 12px; }
.co-seg { width: 8px; min-height: 2px; border-radius: 2px; transition: height .5s cubic-bezier(.2, .7, .2, 1); }
.co-read { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); }
.co-read b { color: var(--ink); font-weight: 500; }
.co-note { font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin: 12px 0 0; max-width: 66ch; }
.ch-pct { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--accent-ink); margin-left: 10px; }
@media (max-width: 620px) { .co-top { flex-direction: column; align-items: flex-start; gap: 10px; } .co-bar { width: 100%; } .co-num b { font-size: 36px; } }

/* Theory blocks */
.theory { margin-bottom: 22px; }
.theory-fold { scroll-margin-top: calc(var(--head-h, 100px) - 4px); }
.def { background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 18px; margin: 12px 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.def .lb { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--accent-ink); margin-bottom: 6px; }
.def .lb em { font-style: normal; color: var(--gold-dk); letter-spacing: 0; text-transform: none; }
.def b { color: var(--accent-ink); }
.formula { text-align: center; padding: 6px 0; color: var(--ink); }
.formula .katex { font-size: 1.2em; color: var(--ink); }
.formrow { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: center; padding: 6px 0; }
.formrow .formula { padding: 2px 0; }
.wex { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 14px 18px; margin: 12px 0; background: var(--paper); }
.wex .hd { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--gold-dk); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.wex .hd .nm { font-family: var(--font-display); font-style: normal; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--forest); }
.wex .q { font-family: var(--font-body); font-size: 15px; line-height: 1.5; margin-bottom: 6px; }
.wex .s { font-family: var(--font-body); font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); padding-left: 12px; border-left: 1px solid var(--gold); margin-top: 4px; }
.wex .s b { color: var(--forest); }
.wex .res { font-family: var(--font-display); font-size: 15px; font-weight: 500; margin-top: 8px; color: var(--forest); }

/* Trainer card */
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 36px); display: flex; flex-direction: column; gap: 22px; align-items: center; }
/* min(…, 100%): the prompt never grows past the card (a wide table scrolls in .fig-table, review 2026-10-26) */
.prompt { font-family: var(--font-display); font-size: 19px; line-height: 1.45; color: var(--ink); text-align: center; max-width: min(62ch, 100%); }
.prompt .expr { display: inline-block; margin-top: 6px; font-family: var(--font-mono); font-size: 22px; color: var(--forest); background: var(--bg-2); padding: 6px 16px; border: 1px solid var(--rule); border-radius: var(--radius-sm); letter-spacing: .02em; }
.prompt .katex { font-size: 1.15em; }
/* Das fett gesetzte Wort im Satz (Deutsch: «Welche Wortart hat das fett
   gedruckte Wort?») steht wie in der Prüfung in einem grauen Kasten. Die
   Mathematik setzt in .expr kein <b>. */
.prompt .expr b { font-weight: 700; color: var(--ink); background: var(--rule); box-shadow: inset 0 0 0 1px var(--rule-2);
  padding: 0 .22em; border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.prompt figure { margin: 10px 0 0; }
/* docs/FIGUREN.md §2: a figure takes the whole width of its card. Outside .prompt (the task figures of the exam pages, the worked
   solutions in the feedback panels) the browser's default figure margin of 40 px a side made a figure 80 px narrower: 190 px
   instead of 270 px on a 360 px phone, and every label in it a third smaller. */
.card figure { margin-left: 0; margin-right: 0; }
/* Ein Lesetext (Figuren charakterisieren): linksbündig in der Schrift des Fliesstexts, wie ein Textblatt */
.prompt .expr.lt { display: block; text-align: left; font-family: var(--font-body); font-size: 18px; line-height: 1.5; letter-spacing: 0; color: var(--ink); padding: 10px 16px; }
/* Typen-Spec §4.2: die Zeile «Ähnlich wie Aufnahmeprüfung …», gedämpft über der Aufgabe,
   im Thema, in Gemischt und in der Stafette; ein Etikett in der Bedienschrift (ONLINE R), kein Mono: kein Zeichen zählt */
.prompt .src-tag, .stf-prompt .src-tag { font-family: var(--font-ui); font-size: 12px; line-height: 1.35; color: var(--ink-mute); margin: 0 0 6px; }
.input-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: center; max-width: calc(100% + 32px); }
/* nie über die Karte (telefon T5: das Feld der ZAP 1 ragte bei 360 px hinaus und machte die Seite bei 320 px breiter), aber auf jeder
   Seite bis 16 px in ihren Innenabstand (mindestens 20 px), wie live bei 390 und 412 px: auf den Inhalt der Karte begrenzt, brach der
   Hinweis im Feld ab, «Ausdruck aus der Liste» bei 390 px (Prüfung des Nachtrags, texte F1) */
.input-row input[type="text"] { max-width: 100%; box-sizing: border-box; }
.input-row input[type="text"] { min-width: 260px; padding: 13px 16px; font-family: var(--font-mono); font-size: 19px; text-align: center; background: var(--paper); border: 2px solid var(--rule-3); border-radius: var(--radius-sm); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.input-row input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
/* Ganze Sätze (engine.js item.multiline): drei Zeilen, linksbündig, in der
   Schrift des Fliesstexts. Enter prüft, ein Zeilenumbruch entsteht nie. */
.input-row.ml-row { width: 100%; max-width: 64ch; }
.input-row textarea.ml { flex: 1 1 100%; width: 100%; min-width: 0; padding: 11px 14px; font-family: var(--font-body);
  font-size: 18px; line-height: 1.45; text-align: left; resize: vertical; background: var(--paper); border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.input-row textarea.ml:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input-row textarea.ml:disabled { background: var(--bg-2); }
/* Ein Text, der im Feld korrigiert wird (item.prefill): so hoch wie der
   Text, wo der Browser das kann; die Lösung markiert jede korrigierte Stelle. */
.input-row textarea.pf { field-sizing: content; }
.feedback b.korr { font-weight: 700; background: var(--accent-soft); box-shadow: inset 0 -2px 0 currentColor; padding: 0 .12em; border-radius: 2px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.btn { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; padding: 12px 20px; border: 1px solid var(--forest); background: var(--forest); color: var(--paper); border-radius: var(--radius-sm); cursor: pointer; transition: transform .12s ease, background .15s, box-shadow .15s, border-color .15s; }
.btn:hover { background: var(--forest-2); border-color: var(--forest-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--accent-ink); border-color: var(--rule-2); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
/* an unbroken input quoted in a message wraps inside the box (telefon T13); break-word for older Safari */
.feedback { font-family: var(--font-body); font-size: 15px; line-height: 1.45; padding: 13px 16px; border-left: 3px solid var(--rule); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--ink-soft); max-width: 64ch; width: 100%; overflow-wrap: break-word; overflow-wrap: anywhere; }
.feedback.good { border-left-color: var(--forest-2); color: #1f4a39; background: rgba(44, 90, 69, 0.10); border-left-width: 4px; }
.feedback.bad { border-left-color: var(--claret); color: var(--claret); background: rgba(110, 42, 42, 0.06); border-left-width: 4px; }
.feedback.win { border-left-color: var(--gold-dk); color: var(--gold-dk); background: rgba(201, 169, 97, 0.16); }
.feedback strong { font-family: var(--font-display); font-weight: 500; }
.feedback code, .prompt code, .sub code, .def code { font-family: var(--font-mono); background: rgba(255,255,255,.55); padding: 1px 6px; border: 1px solid var(--rule); border-radius: 5px; }
.feedback.pop { animation: fbpop .26s ease both; }
/* Q3: the verdict scrolls into view clear of the sticky head and the phone tab bar; --head-h = the head's
   measured height (engine.js syncHead, 100 px on a phone, up to 122 px on a laptop; telefon N1) */
.card .feedback { scroll-margin: calc(var(--head-h, 100px) + 4px) 0 84px; }
/* the button a question names comes into view with it (ONLINE N.7) and stays under the finger: 84 px clear of the phone tab
   bar where it shows (kplus-shell.js data-kp-tabs, under 900 px), otherwise only clear of the edge. With 84 px everywhere
   it rose about 70 px on a visitor's phone, and a second tap on the same spot hit «Lösung zeigen». */
.card .pf-btns .btn { scroll-margin: calc(var(--head-h, 100px) + 4px) 0 calc(12px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 899px) {
  :root[data-kp-tabs="on"] .card .pf-btns .btn { scroll-margin-bottom: 84px; }
}
/* the tip before the first check stands under the buttons, so field, keys and «Prüfen» stay together (telefon T6) */
.card > .feedback.intro { order: 1; }
.card { scroll-margin-top: calc(var(--head-h, 100px) - 4px); }
/* FIGUREN §4: a figure label on a light grid line has a halo in the colour of its ground (figures.js: var(--fig-halo)). The card is
   paper; every tinted panel that can show a figure (feedback, the answer lines of the relay and the exam) sets its own opaque
   ground, its tint over the paper. */
.card { --fig-halo: #fbf9f2; }
.feedback { --fig-halo: #ebe7d7; }
.feedback.good { --fig-halo: #e6e9e1; }
.feedback.bad, .sim-res-bad { --fig-halo: #f3ede6; }
.feedback.win { --fig-halo: #f3ecdb; }
.sim-res-ok { --fig-halo: #ebece4; }
/* Q10 a: video, Lernbaum and a real exam part under every topic */
.topic-links { margin: 14px 2px 0; font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; line-height: 1.9; color: var(--ink-mute); }
.topic-links a { color: var(--accent-ink); text-decoration: none; }
.topic-links a:hover { text-decoration: underline; }
.topic-links .tl-src { font-weight: 400; }
@keyframes fbpop { 0% { transform: scale(.985) translateY(2px); opacity: .35; } 60% { transform: scale(1.004) translateY(0); } 100% { transform: scale(1) translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .feedback.pop { animation: none; }
  .btn:hover, .hub-card:hover { transform: none; }
  .scoreboard .bar i { transition: none; }
}

/* Hub (index) */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; margin-top: 30px; }
.hub-card { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .2s; }
.hub-card.k1 { --accent: #1a3a2e; --accent-ink: #1a3a2e; } .hub-card.k2 { --accent: #a8872c; --accent-ink: #836a22; } .hub-card.k3 { --accent: var(--terracotta); --accent-ink: #a25a36; }
/* Deutsch ist ein eigenes Fach neben den drei Mathematikkapiteln · eigene Akzentfarbe. */
.hub-card.deutsch { --accent: #4a5d7e; --accent-ink: #4a5d7e; --accent-soft: rgba(74, 93, 126, .14); }
.hub-card:hover { border-color: var(--rule); border-top-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.hub-card .ch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hub-card .ch { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--accent-ink); }
.hub-card .glyph { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-size: 17px; font-weight: 500; }
.hub-card.k2 { --accent-soft: rgba(168, 135, 44, .14); } .hub-card.k3 { --accent-soft: rgba(176, 97, 58, .14); }
.hub-card h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.7rem; line-height: 1.05; margin: 12px 0 8px; }
.hub-card h2 em { font-style: normal; color: var(--accent-ink); }
.hub-card p { font-family: var(--font-body); font-size: 15px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 14px; }
.hub-card ul { list-style: none; margin: 0; padding: 0; }
.hub-card li { font-family: var(--font-ui); font-size: 12.5px; letter-spacing: .01em; color: var(--ink-mute); padding: 4px 0; border-top: 1px dotted var(--rule); }
.hub-card li::before { content: '\2192\00a0'; color: var(--accent-ink); }
.hub-card::after { content: 'Üben \2009\2192'; margin-top: auto; padding-top: 18px; font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--accent-ink); transition: letter-spacing .15s; }
.hub-card:hover::after { letter-spacing: .06em; }

.site-foot { border-top: 1px solid var(--rule); background: var(--paper); padding: 28px 32px; margin-top: 80px; }
.site-foot .wrap { max-width: 1000px; margin: 0 auto; font-family: var(--font-body); font-size: 13px; color: var(--ink-mute); }
/* Der Fuss wirft seinen Schatten nach oben, wie auf der Startseite (Lars, 2026-11-05: «Apply the footer shadow
   everywhere»): die Oberkante in Gold, darueber ein Schatten aus Schwarz und Gold (45 % und 55 %), der nach oben in den
   Abstand ueber dem Fuss auslaeuft. position: relative ohne z-index, damit feste Leisten (die Formel-Tasten, die
   Tab-Leiste) darueber bleiben; pointer-events: none laesst jeden Klick durch. */
.site-foot { position: relative; border-top-color: rgba(201, 169, 97, .95); }
.site-foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 1px);
  height: 34px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(111, 93, 53, .55), rgba(111, 93, 53, .32) 18%, rgba(168, 135, 44, .16) 48%, rgba(168, 135, 44, .05) 78%, rgba(168, 135, 44, 0));
}

@media (max-width: 600px) {
  .site-head { padding: 12px 16px; gap: 12px; }
  .site-head nav { gap: 12px; font-size: 11px; }
  .prompt .expr { font-size: 18px; }
  .prompt .expr.lt { font-size: 17px; padding: 8px 12px; }
  .input-row input[type="text"] { min-width: 180px; font-size: 17px; }
  .input-row textarea.ml { font-size: 17px; }
  .scoreboard { font-size: 10.5px; gap: 10px; }
  .scoreboard .bar { width: 70px; }
}

/* ----- unified student nav: one row, horizontal scroll on small screens ----- */
@media (max-width: 860px) {
  .site-head nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 4px;
    /* Snap points settle a link boundary at the left edge after a swipe. The
       right edge is no longer masked: the mask would have faded out the pinned
       "Prüfung wechseln" below together with the links, and that item is the
       one thing on this row that must never be faded. */
    padding-right: 0; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
    -webkit-mask-image: none; mask-image: none; }
  .site-head nav::-webkit-scrollbar { display: none; }
  .site-head nav a { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }
  /* Der Weg zurueck zur Weiche darf auf dem Handy nicht der letzte Eintrag
     einer 890 px breiten Zeile in einem 358 px breiten Kasten sein: seit die
     Produktwahl nur noch auf /ueben steht, ist er fuer jemanden, der auf dem
     falschen Hub gelandet ist, der einzige sichtbare Ausweg · und er war ohne
     bewussten Seitwaerts-Wisch gar nicht zu sehen. Er klebt deshalb am rechten
     Rand des Scrollstreifens und bleibt in JEDER Scrollposition sichtbar. Die
     Kapitel laufen unter seinem Verlauf hindurch; dieser Verlauf ersetzt
     zugleich die frueher maskierte Kante als Hinweis, dass die Zeile
     weitergeht. */
  .site-head nav a.nav-switch {
    position: sticky; right: 0; z-index: 1; opacity: 1;
    /* Das margin-left verlaengert den SCROLL-INHALT um die Breite des
       angehefteten Punktes. Ohne das endet die Zeile genau dort, wo der Punkt
       klebt · der letzte echte Link (Archiv) laege dann ganz rechts unter
       seinem Verlauf und waere nie vollstaendig lesbar. */
    margin-left: 48px; padding-left: 34px; padding-right: 2px;
    border-left: 0; scroll-snap-align: end;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, var(--paper) 26px); }
}

/* ----- topic tab strip (chapter pages; the site-head keeps the site links) -- */
.topic-tabs { display: flex; gap: 18px; padding: 10px 32px; background: var(--paper); border-bottom: 1px solid var(--rule);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  font-family: var(--font-ui); font-weight: 500; font-size: 12px; letter-spacing: .02em; }
.topic-tabs::-webkit-scrollbar { display: none; }
.topic-tabs a { flex: 0 0 auto; white-space: nowrap; color: var(--ink-mute); text-decoration: none;
  padding: 2px 0 5px; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.topic-tabs a:hover, .topic-tabs a.cur { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 600px) { .topic-tabs { padding: 9px 16px; gap: 14px; font-size: 11px; } }
/* Am Desktop gibt es kein Wischen: die Themen (Deutsch hat 12 und 14)
   brechen in eine zweite Zeile um, statt rechts unsichtbar weiterzulaufen.
   Auf dem Handy bleibt die Leiste wischbar, page.js holt das aktive Thema
   in den sichtbaren Bereich. */
@media (min-width: 861px) { .topic-tabs { flex-wrap: wrap; row-gap: 8px; overflow-x: visible; } }

/* ===== dashboard-a · HUBS (2026-09-27) · Hubs als Übungseinstieg ===== */
/* /ueben/zap2 und /zap1 tragen zwei Köpfe in einer Seite. kplus-shell.js
   setzt <html data-kp-sess> synchron im <head>, also wählt dieser Block den
   Kopf vor dem ersten Paint: abgemeldet, wartend oder abgelaufen die
   Landeseite (.hub-anon, mit dem Angebot für die Eltern), mit aktivem Abo
   der Übungseinstieg (.hub-sub). Ohne Shell gibt es kein Attribut, und die
   Landeseite steht · der sichere Stand für eine Anzeigen-Landeseite. Die
   alten Regeln des Start-Dashboards darunter bleiben bis zum Aufräumen
   nach dem Merge von math-rendering stehen (SPEC dashboard-a §8.3). */
.hub-sub { display: none; }
:root[data-kp-sess="active"] .hub-sub { display: block; }
:root[data-kp-sess="active"] .hub-anon { display: none; }
:root[data-kp-sess="konto"] .hub-offer-login { display: none; }
:root[data-kp-sess="active"] .hub-cat:not(.keep) { display: none; }
.hub-next { display: none; }
.hub-next.has-progress, :root[data-kp-sess="active"] .hub-next { display: flex; }
.hub-next[hidden] { display: none !important; }

/* Kopf: Landeseite (Text und Angebot nebeneinander ab 900 px) und Übungseinstieg */
.hub-hero { margin: 0 0 24px; }
.hub-hero.hub-anon { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.hub-hero-tx { min-width: 0; }
.hub-eb { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); margin-bottom: 12px; }
.hub-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.04; letter-spacing: -.03em; margin: 0 0 14px; color: var(--ink); }
.hub-hero h1 em { font-style: normal; color: var(--forest); }
/* Kursiv ist wieder eine Entscheidung: <em class="kur"> setzt sie, die
   Stellung im Satz nicht mehr. Regel: genau ein Wort oder ein Name, der
   gegen den Rest absticht · nie ein Funktionswort, nie ein Wortteil, nie
   die ganze Ueberschrift, hoechstens eine je Kartengruppe. */
h1 em.kur, h2 em.kur, h3 em.kur { font-style: italic !important; }

.hub-lede { font-family: var(--font-display); font-size: 17px; line-height: 1.45; color: var(--ink-soft); margin: 0 0 18px; max-width: 52ch; }
.hub-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
a.btn.hub-start { display: inline-block; text-decoration: none; }
.hub-offer { min-width: 0; background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px 16px; }
.hub-offer-eb { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--gold-dk); margin-bottom: 8px; }
.hub-offer h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 8px; color: var(--ink); }
.hub-offer h2 em { font-style: normal; color: var(--forest); }
.hub-offer p { font-family: var(--font-body); font-size: 15px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 12px; }
.hub-offer p.hub-offer-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 0; }
.hub-offer-login a { color: var(--forest); }
.hub-offer-links .hub-go, .hub-offer-login a { display: inline-block; padding: 8px 0; }
@media (min-width: 900px) {
  .hub-hero.hub-anon { grid-template-columns: 1.1fr .9fr; gap: 28px; }
}

/* Hinweis, wenn das Konto zum anderen Programm gehört */
.hub-other { font-family: var(--font-body); font-size: 14px; line-height: 1.5; color: var(--ink-soft); border-left: 3px solid var(--rule-2); padding: 2px 0 2px 12px; margin: 0 0 12px; }
.hub-other[hidden] { display: none; }
.hub-other a { color: var(--forest); }

/* Weiter üben: eine Zeile */
.hub-next { align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; padding: 13px 20px; background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--gold); border-radius: var(--radius-sm); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.hub-next-eb { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--gold-dk); }
.hub-next-name { font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--forest); }
.hub-next-stars { font-size: 14px; letter-spacing: .04em; color: var(--gold-dk); white-space: nowrap; }
.hub-next-stars:empty { display: none; }
.hub-next-ch { font-family: var(--font-body); font-size: 14.5px; color: var(--ink-mute); }
.hub-next-go { margin-left: auto; font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--forest); white-space: nowrap; }
.hub-next:hover .hub-next-name { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }

/* Themen: Kapitelkarten mit ihren Themenzeilen (Sterne, Stufe) */
.hub-themen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.hub-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hub-themen.z1 { grid-template-columns: 2fr 1fr; }
/* .db.hub-ch: dieser Block steht ÜBER den Regeln für .hub-card.db, darum eine Klasse mehr */
.hub-card.db.hub-ch { min-width: 0; padding: 20px 20px 18px; }
.hub-card.db.hub-ch::after { content: none; }
.hub-card.db.hub-ch:hover { transform: none; box-shadow: var(--shadow); }
.hub-card.db.hub-ch h3 { margin-bottom: 10px; }
.hub-ch-stars { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--ink-mute); white-space: nowrap; }
.hub-rows { margin: 0 0 14px; }
.hub-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px dotted var(--rule); text-decoration: none; color: var(--ink); }
.hub-row:last-child { border-bottom: 0; }
.hub-row:hover .hub-row-name { color: var(--forest); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.hub-row.last { background: rgba(201, 169, 97, .14); padding-left: 6px; padding-right: 6px; margin: 0 -6px; border-radius: 6px; }
.hub-row-name { font-family: var(--font-body); font-size: 15px; line-height: 1.25; min-width: 0; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.hub-row-last { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--ink-mute); white-space: nowrap; }
.hub-row-stars { font-size: 13px; letter-spacing: .04em; color: var(--gold-dk); white-space: nowrap; }
.hub-row-stars.none { color: var(--rule-2); }
.hub-row-lvl { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-soft); white-space: nowrap; min-width: 54px; text-align: right; }
.hub-row-lvl b { font-weight: 500; }
.hub-row-lvl.none { color: var(--ink-mute); }
.hub-go { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--accent-ink); text-decoration: none; }
.hub-go:hover { text-decoration: underline; text-underline-offset: 3px; }
.hub-card.db.hub-ch .hub-go { margin-top: auto; align-self: flex-start; padding-top: 4px; }
/* Q10 e: the Winkelpuzzle under the K3 rows, its own count in this browser */
.hub-tool { align-self: flex-start; margin: -4px 0 14px; font-family: var(--font-body); font-size: 15px; color: var(--accent-ink); text-decoration: none; }
.hub-tool:hover { text-decoration: underline; text-underline-offset: 3px; }
.hub-legend { font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--ink-mute); margin: 12px 2px 0; }
@media (min-width: 700px) {
  .hub-rows.two { columns: 2; column-gap: 24px; }
  .hub-rows.two .hub-row { break-inside: avoid; }
}
@media (max-width: 899px) {
  .hub-themen, .hub-themen.z1 { grid-template-columns: minmax(0, 1fr); }
  .hub-col { display: contents; }
  .hub-themen .hub-ch.k1 { order: 1; }
  .hub-themen .hub-ch.k2 { order: 2; }
  .hub-themen .hub-ch.k3 { order: 3; }
  .hub-themen .hub-ch.deutsch { order: 4; }
}
/* Handy: der Countdown bricht in zwei Zeilen (dann eine Karte statt einer Pille),
   und der Startknopf bleibt einzeilig. */
@media (max-width: 600px) {
  .hub-hero .hub-zap { border-radius: var(--radius-sm); }
  a.btn.hub-start { padding: 12px 16px; }
}
/* ===== /dashboard-a · HUBS ===== */

/* ----- /ueben Start-Dashboard ----- */
.db-main { padding-top: clamp(30px, 5vh, 56px); }
.db-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 30px; align-items: stretch; margin-bottom: 28px; }
.db-date { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); margin-bottom: 12px; }
.db-greet { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 12px; color: var(--ink); }
.db-greet em { font-style: normal; color: var(--forest); }
.db-lede { font-family: var(--font-display); font-size: 17px; line-height: 1.45; color: var(--ink-soft); margin: 0 0 18px; max-width: 46ch; }
.db-zap { display: inline-flex; align-items: baseline; gap: 7px; font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--forest); background: rgba(26, 58, 46, .08); border: 1px solid rgba(26, 58, 46, .18); padding: 8px 14px; border-radius: 999px; }
.db-zap b { font-size: 15px; font-weight: 500; }

.db-prog { padding: 20px 22px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.db-eb { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--gold-dk); margin-bottom: 12px; }
.db-prog-top { display: flex; align-items: flex-end; gap: 20px; }
.db-num { display: flex; flex-direction: column; line-height: 1; flex: 0 0 auto; }
.db-num b { font-family: var(--font-display); font-size: 46px; font-weight: 500; color: var(--forest); }
.db-num span { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--ink-mute); margin-top: 6px; }
.db-canopy { display: flex; align-items: flex-end; gap: 4px; height: 44px; flex: 1 1 auto; min-width: 0; }
.db-canopy i { flex: 1 1 0; max-width: 10px; min-height: 2px; border-radius: 2px; transition: height .5s cubic-bezier(.2, .7, .2, 1); }
.db-read { font-family: var(--font-ui); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; color: var(--ink-mute); margin-top: 14px; min-height: 15px; }
.db-read b { color: var(--ink); font-weight: 500; }
.db-note { font-family: var(--font-body); font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin: 10px 0 0; }

.db-next { display: block; margin: 0 0 8px; padding: 20px 24px; border: 1px solid var(--gold); border-left: 4px solid var(--gold); border-radius: var(--radius); background: rgba(201, 169, 97, .10); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .2s; }
.db-next:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.db-next-eb { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--gold-dk); margin-bottom: 8px; }
.db-next-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.db-next-name { font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--forest); }
.db-next-ch { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); margin: 5px 0 0; }
.db-next-why { font-family: var(--font-body); font-size: 14.5px; color: var(--ink-soft); margin: 6px 0 0; }
.db-next-go { flex: 0 0 auto; font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--forest); transition: letter-spacing .15s; }
.db-next:hover .db-next-go { letter-spacing: .06em; }

.db-sec { margin-top: 42px; }
.db-sec-hd { display: flex; align-items: center; gap: 14px; font-family: var(--font-ui); font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--ink-mute); margin: 0 0 16px; }
.db-sec-hd::after { content: ''; flex: 1 1 auto; border-top: 1px solid var(--rule); }
.db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
/* Überblick auf dem Hub: Kacheln (Aufgaben, Themen, Prüfungen) und die
   Themenkarte mit Balken, Sternen und Stufen-Leiter je Thema. Identität
   kommt aus Gruppe und Beschriftung, die Kapitelfarbe ist nur die Markierung. */
.db-map { margin-top: 34px; }
.db-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.db-tile { display: flex; flex-direction: column; gap: 4px; padding: 13px 15px 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-sm); box-shadow: var(--shadow); min-width: 0; }
.db-tile b { font-family: var(--font-display); font-weight: 500; font-size: 27px; line-height: 1; color: var(--forest); letter-spacing: -.02em; }
.db-tile b small { font-size: 15px; color: var(--ink-mute); font-weight: 400; margin-left: 2px; }
.db-tile span { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--ink-mute); }
.db-tile i { font-style: normal; font-family: var(--font-body); font-size: 13px; color: var(--ink-soft); line-height: 1.35; }
.db-map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.dm-col { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 10px; min-width: 0; }
.dm-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.dm-hd b { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.dm-hd span { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); white-space: nowrap; }
.dm-row { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(44px, .7fr) auto auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dotted var(--rule); text-decoration: none; color: inherit; }
.dm-row:last-child { border-bottom: 0; }
.dm-row:hover .dm-name { color: var(--forest); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.dm-name { font-family: var(--font-body); font-size: 13.5px; line-height: 1.2; color: var(--ink); min-width: 0; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.dm-meter { position: relative; height: 6px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.dm-meter i { display: block; height: 100%; border-radius: 4px; background: var(--forest); min-width: 0; }
.dm-stars { font-size: 12px; letter-spacing: .05em; color: var(--gold-dk); white-space: nowrap; min-width: 36px; text-align: right; }
.dm-stars.none { color: var(--rule-2); }
.dm-lvl { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.dm-lvl i { display: block; width: 9px; height: 9px; border-radius: 2px; border: 1px solid var(--rule-2); background: transparent; box-sizing: border-box; }
.dm-lvl i.on { background: var(--forest); border-color: var(--forest); }
.dm-lvl i.exam { border-color: var(--gold-dk); }
.dm-lvl i.on.exam { background: var(--gold-dk); border-color: var(--gold-dk); }
.dm-lvl i.beyond { border-style: dashed; }
.dm-lvl b { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-soft); margin-left: 3px; min-width: 8px; }
.dm-lvl.none b { color: var(--ink-mute); font-weight: 400; }
.db-map-legend { font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--ink-mute); margin: 12px 2px 0; }
.db-map-empty { font-family: var(--font-body); font-size: 14px; color: var(--ink-soft); margin: 0 0 8px; }
@media (max-width: 560px) {
  .dm-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name stars lvl" "meter meter meter"; row-gap: 5px; }
  .dm-name { grid-area: name; }
  .dm-meter { grid-area: meter; }
  .dm-stars { grid-area: stars; }
  .dm-lvl { grid-area: lvl; }
}
.db-grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.hub-card.db { padding: 22px 20px; }
.hub-card.db h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; line-height: 1.08; margin: 11px 0 7px; }
.hub-card.db h3 em { font-style: normal; color: var(--accent-ink); }
.hub-card.db p { font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.hub-card.db::after { content: attr(data-cta) " \2192"; margin-top: 0; padding-top: 12px; }
.hub-card.plus { --accent: #a8872c; --accent-ink: #836a22; --accent-soft: rgba(201, 169, 97, .16); }
.db-mini { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 12px; border-top: 1px dotted var(--rule); font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); min-height: 26px; }
.db-mini .bar { width: 62px; height: 6px; flex: 0 0 auto; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.db-mini .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.db-mini b { color: var(--accent); font-weight: 500; }

@media (max-width: 860px) {
  .db-hero { grid-template-columns: 1fr; gap: 20px; }
  .db-num b { font-size: 38px; }
  .db-next-name { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .db-next:hover { transform: none; }
  .db-canopy i, .db-mini .bar i { transition: none; }
}

/* KaTeX-Displayformeln auf dem Handy (Audit-Blocker) ------------------------
 * Das mitgelieferte katex.min.css setzt
 *   .katex-display        { display:block; text-align:center }
 *   .katex-display>.katex { display:block; text-align:center; white-space:nowrap }
 * also ohne overflow-Regel. Eine breite Formel lief damit auf 390 px aus dem
 * Viewport (k2 §Grössen: "Volumen : 1000", k3 §Symmetrie: die Spiegelregeln)
 * und war nicht zu erreichen: zentrierter Text ragt links UND rechts heraus,
 * seitwärts scrollen ging nicht (scrollLeft blieb 0).
 * Fix: die Formel scrollt in ihrer eigenen Box statt die Seite zu sprengen.
 * width:max-content + margin:auto zentriert, solange die Formel passt, und
 * rückt sie bündig nach links, sobald sie breiter ist · so wird nichts mehr
 * links abgeschnitten. */
.katex-display { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding-bottom: 4px; }
.katex-display > .katex { display: block; width: -webkit-max-content; width: max-content; margin: 0 auto; text-align: initial; }

/* ===========================================================================
   Adaptive Stufen, mehrschrittige Aufgaben, Zeichenfeld-Aufgaben, Mix
   (ONLINE-CONTRACT §1.8, §2, §3, §4). Ergänzt die bestehenden Regeln, ersetzt
   keine · alles bleibt im gleichen Editorial-Grundton.
   ========================================================================= */

/* ----- Stufen-Chip im Panel (dritte Zeile der .scoreboard.sb2) ----- */
.sb-panel { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lvl-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--rule); color: var(--ink-soft); letter-spacing: .02em;
  white-space: nowrap; cursor: help; }
.lvl-chip b { color: var(--accent-ink); font-weight: 500; }
.lvl-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lvl-chip.l3 { background: var(--accent-soft); border-color: var(--accent); }
/* Stufe 4 „Über Prüfungsniveau“: anderer Farbton, GLEICHES Gewicht wie l3 ·
   kein Abzeichen, kein Glanz, keine Grössenänderung (DIFFICULTY §3.2). */
.lvl-chip.l4 { background: rgba(176, 138, 87, .12); border-color: var(--tan); }
.lvl-chip.l4 b { color: var(--tan); }
/* Die eine ehrliche Zeile unter der Stufen-Zeile, solange Stufe 4 gehalten
   wird (§3.4). Sie sitzt als weiteres Kind IN der .scoreboard.sb2 (Spalte,
   linksbuendig), muss deren Bedienschrift also zuruecksetzen. Leiser als der
   Fliesstext, schmal genug, dass der Kopf der Sektion nicht auseinanderfaellt,
   und nie ein Banner. */
.l4-note { margin: 2px 0 0; max-width: 34ch; font-family: var(--font-body); font-weight: 400;
  font-size: 12.5px; line-height: 1.5; letter-spacing: 0; text-transform: none;
  text-align: left; color: var(--ink-mute); }
.lvl-set { display: inline-flex; gap: 4px; }
.lvl-btn { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 14px; line-height: 1; padding: 0;
  background: var(--paper); color: var(--accent); border: 1px solid var(--rule-2); border-radius: 7px;
  cursor: pointer; transition: background .15s, border-color .15s; }
.lvl-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.lvl-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Auf schmalen Geräten gibt es kein Hover · dort steht die Erklärung offen
   als aufklappbarer Text unter dem Panel. */
.lvl-help { display: none; max-width: 46ch; font-family: var(--font-body); font-size: 13px;
  line-height: 1.55; color: var(--ink-soft); }
.lvl-help summary { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--accent-ink); cursor: pointer; }
.lvl-help p { margin: 8px 0 0; }
@media (hover: none), (max-width: 720px) {
  .lvl-help { display: block; }
  .sb-panel { align-items: flex-start; }
}
/* Die Stufen-Zeile passt aufs Handy (vor dem Deploy, P-C): auf 390 px war sie in der ZAP 1 auf Stufe 4 24 px zu
   breit und «+» lag ausserhalb, auf 360 px in jedem Fach. Auf dem Handy rückt der Chip enger zusammen (in der
   ZAP 1 11 px statt 12 px) und bricht seine Wörter um, wo die Zeile sonst nicht passt; die Knöpfe bleiben neben
   dem Chip. Auf dem Desktop bleibt alles, wie es war. */
@media (max-width: 600px) {
  .sb2-row[id$="-lvlrow"] { gap: 6px; max-width: 100%; }
  .lvl-chip { padding: 4px 8px; letter-spacing: .01em; white-space: normal; }
  :root[data-kp-product="zap1"] .lvl-chip { font-size: 11px; }
}

/* ----- Stufen-Toast (Auf-/Abstieg) · dieselbe .ms-toast, andere Farbe ----- */
.ms-toast.up { background: var(--forest); }
.ms-toast.down { background: var(--tan); color: #1b1206; }
.ms-toast.stack { flex-direction: column; align-items: flex-start; gap: 8px; }
.ms-toast.up span, .ms-toast.down span, .ms-toast.stack span { white-space: normal; }
.ms-toast.stack { max-width: min(90vw, 46ch); font-size: 14.5px; line-height: 1.45; }

/* ----- Hilfe-Karte nach drei Fehlversuchen (nie modal, nie fokusraubend) ----- */
.topic-notes:empty { display: none; }
/* Begleitwerkzeug im Thema (das Bruch-Spiel unter ZAP1 · Brüche & Anteile):
   ein ruhiger Kasten unter Aufgabe und Regel, kein eigener Hub-Eintrag. */
.topic-tool { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 0 0 18px; padding: 16px 20px; scroll-margin-top: calc(var(--head-h, 100px) - 4px); background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.topic-tool .tt-eb { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--accent-ink); margin-bottom: 4px; }
.topic-tool h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.2; }
.topic-tool h3 em { font-style: normal; color: var(--accent-ink); }
.topic-tool p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-soft); max-width: 560px; }
.topic-tool .btn { flex: none; text-decoration: none; display: inline-block; }
.help-card { margin-top: 18px; padding: 16px 20px; border: 1px solid var(--rule); border-left: 3px solid var(--gold-dk);
  border-radius: var(--radius-sm); background: rgba(201, 169, 97, .10);
  /* like the feedback: clear of the sticky head and of the subscribers' tab bar on a phone (telefon T4) */
  scroll-margin: calc(var(--head-h, 100px) + 4px) 0 84px; }
.help-card p { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  color: var(--ink-soft); max-width: 64ch; }
.hc-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px;
  font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; }
.hc-row a { color: var(--accent-ink); }
.hc-row .btn { padding: 8px 14px; }
/* Dieselbe Karte, andere Farbe: die Stufe-4-Einladung ist kein Hinweis auf
   einen Fehler, sondern eine Frage. Beide Antworten sind gleichwertig · das
   „Nein“ steht als vollwertiger Knopf daneben, nicht als Kleingedrucktes. */
.help-card.offer { border-left-color: var(--forest); background: var(--accent-soft); }
.bored-line { margin: 14px 0 0; font-family: var(--font-body); font-size: 14.5px;
  line-height: 1.55; color: var(--ink-mute); max-width: 64ch; }

/* ----- Mix: das Thema steht erst NACH der Lösung ----- */
.mix-tag { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--rule); font-family: var(--font-ui); font-weight: 600;
  font-size: 11.5px; letter-spacing: .02em; color: var(--ink-mute); }

/* ----- Mehrschrittige Aufgaben (a, b, c, d) ----- */
.steps { display: flex; flex-direction: column; gap: 4px; width: 100%; max-width: 64ch; }
.step { padding: 14px 0; border-top: 1px dotted var(--rule); }
.step:first-child { border-top: 0; padding-top: 4px; }
.step .input-row { justify-content: flex-start; margin-top: 10px; }
/* nach einer richtigen Teilaufgabe kommt die Zeile der nächsten ins Bild (engine.js unlockStep): angemeldet über der Tab-Leiste des Handys
   (68 px, kplus-shell.js), sonst lagen Feld und «Prüfen» darunter (Prüfung Runde 3, telefon N3). Nur wo die Leiste steht (unter 900 px, wie
   kplus-shell.js und .pf-btns, ONLINE N.7): Auf dem Laptop hielt die Zeile 72 px Abstand zu einer Leiste, die es nicht gibt, und die Figur rückte
   unter den Kopf (Prüfung Runde 4, telefon und figuren-k1 N4) */
@media (max-width: 899px) {
  :root[data-kp-tabs="on"] .step .input-row { scroll-margin-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
.step .input-row input[type="text"] { min-width: 180px; font-size: 17px; text-align: left; }
.step-q { display: flex; align-items: baseline; gap: 9px; font-family: var(--font-display);
  font-size: 17px; line-height: 1.45; color: var(--ink); }
.step-lb { font-family: var(--font-mono); font-size: 13px; color: var(--gold-dk); flex: 0 0 auto; }
.step.locked { opacity: .45; }
.step.locked input, .step.locked textarea, .step.locked .btn { pointer-events: none; }
.step.done .step-q { color: var(--ink-soft); }
.step .feedback { margin-top: 10px; font-size: 14px; padding: 9px 13px; }
.step .feedback[hidden] { display: none; }

/* ----- Zeichenfeld-Aufgaben (kind:'embed') ----- */
.embed-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.embed-chip { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--ink-mute); background: var(--paper); white-space: nowrap; }
.embed-chip.ok { color: var(--forest); border-color: var(--forest); background: rgba(26, 58, 46, .07); }
.embed-frame { width: 100%; border: 1.5px solid var(--rule); border-radius: 12px; background: #fcfbf6; }

/* ----- Tabellen-Figuren (FIG.table) · scrollen in sich, nie die Seite ----- */
.fig-table { overflow-x: auto; margin: 10px 0 0; max-width: 100%; }
.fig-table table { border-collapse: collapse; font-family: var(--font-mono); font-size: 15px; }
.fig-table caption { font-family: var(--font-body); font-size: 14px; color: var(--ink-mute);
  text-align: left; padding-bottom: 6px; }
.fig-table th, .fig-table td { border: 1px solid var(--rule); padding: 7px 14px; text-align: center; white-space: normal; }
/* Auf dem Handy passt jede Tabelle ohne Wischen (telefon T1: sonst lagen Spalten, die die Aufgabe braucht, unsichtbar rechts daneben) */
@media (max-width: 560px) {
  .prompt .fig-table, .stf-prompt .fig-table { margin-left: -16px; margin-right: -16px; max-width: calc(100% + 32px); }
  .fig-table table { font-size: 13px; margin: 0 auto; }
  .fig-table th, .fig-table td { padding: 6px 4px; }
}
.fig-table th { background: var(--bg-2); color: var(--accent); font-weight: 500; }
.fig-table td.blank { background: rgba(201, 169, 97, .16); color: var(--gold-dk); }

/* ----- Zahlenstrahl-Figuren (FIG.numberline) ----- */
/* Die viewBox wird in CSS-Pixeln vermessen (figures.js), damit die Skala auf
   dem Telefon nicht mitschrumpft; hier bleibt nur der Rahmen. */
.fig-numberline { margin: 10px 0 0; max-width: 100%; overflow-x: auto; }
.fig-numberline svg { max-width: 100%; }

/* ===========================================================================
   Prüfungs-Layout · aus dem <style>-Block von pruefung.html hierher gezogen,
   damit pruefung.html, /zap1/pruefung und die Stafette EINE Kopie teilen
   (ONLINE-CONTRACT §4.1). Unverändert übernommen, kein visueller Unterschied.
   ========================================================================= */
.sim-timer { position: sticky; top: 74px; z-index: 40; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.sim-timer-note { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
.sim-timer .pill { font-family: var(--font-mono); font-size: 15px; letter-spacing: .12em; padding: 9px 22px; background: var(--forest); color: var(--paper); border-radius: 999px; box-shadow: var(--shadow); }
.sim-timer .pill.warn { background: var(--claret); }
/* schmal: eine Zeile, der Hinweis gibt nach (telefon T11: bei 360 px brach die Zeile der Stafette ZAP 1 um und deckte eine Zeile der Aufgabe zu) */
@media (max-width: 400px) {
  .sim-timer { flex-wrap: nowrap; gap: 6px; }
  .sim-timer-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; letter-spacing: .06em; padding: 5px 8px; }
  .sim-timer .pill { flex: none; padding: 9px 14px; }
}
.sim-task { margin-top: 26px; }
.sim-task .tag { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--accent, var(--forest)); margin-bottom: 6px; }
.sim-input { min-width: 240px; padding: 11px 14px; font-family: var(--font-mono); font-size: 17px; background: var(--paper); border: 2px solid var(--rule-3); border-radius: 9px; color: var(--ink); outline: none; }
.sim-input:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(26,58,46,.10); }
.sim-res-ok { border-left: 3px solid var(--forest); background: rgba(26,58,46,.07); padding: 8px 12px; border-radius: 8px; }
.sim-res-bad { border-left: 3px solid var(--claret); background: rgba(110,42,42,.06); padding: 8px 12px; border-radius: 8px; }
.sim-lock { text-align: center; max-width: 52ch; margin: 0 auto; }
.probe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 6px; }
.probe-card { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; text-align: left; padding: 16px 18px;
  background: var(--paper); border: 1.5px solid var(--rule); border-radius: 12px; cursor: pointer;
  transition: transform .12s ease, border-color .15s, box-shadow .15s; }
.probe-card:hover { border-color: var(--forest); transform: translateY(-1px); box-shadow: var(--shadow); }
.probe-name { font-family: var(--font-display); font-size: 19px; color: var(--forest); }
.probe-meta { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); }
.probe-last { font-family: var(--font-body); font-size: 13px; color: var(--ink-soft); }
.probe-last b { color: var(--forest); }
.probe-last.neu { color: var(--ink-mute); }
.probe-part { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.probe-part + .probe-part { border-top: 1px dotted var(--rule); }
.probe-plabel { font-family: var(--font-mono); font-size: 13px; color: var(--gold-dk); }
.probe-pts { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-mute); white-space: nowrap; }
.probe-intro { margin: 0; font-family: var(--font-body); font-size: 14.5px; color: var(--ink-soft); border-left: 2px solid var(--gold); padding-left: 10px; }
.probe-schema { border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; background: rgba(201,169,97,.07); }
.probe-schema-hd { display: block; font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .02em; color: var(--gold-dk); margin-bottom: 7px; }
.probe-rule { display: flex; gap: 10px; font-family: var(--font-body); font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.probe-rule b { color: var(--gold-dk); font-family: var(--font-mono); font-size: 12px; white-space: nowrap; padding-top: 2px; }
.probe-remark { margin-top: 6px; font-family: var(--font-body); font-size: 13px; color: var(--ink-mute); }
.probe-steps { font-family: var(--font-body); font-size: 14px; color: var(--ink-soft); }
.probe-steps summary { cursor: pointer; font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--forest); }
.probe-step { padding: 3px 0 3px 12px; border-left: 1px solid var(--gold); margin-top: 4px; }
.probe-step { overflow-x: auto; overflow-y: hidden; } /* Welle 2: a long formula scrolls in its own row and never widens the page; overflow-y, or a lone fraction («x = 73/812») got a vertical scroll bar */
.probe-ovr { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-soft); }
.probe-ovr-in { width: 74px; padding: 7px 9px; font-family: var(--font-mono); font-size: 15px; border: 1.5px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--forest); }
.probe-ovr-in:focus { border-color: var(--forest); outline: none; }
.probe-ovr-max { color: var(--ink-mute); }
/* Konstruktionsteile: eingebettete Werkstatt + Status-Chip */
.sim-kt { width: 100%; height: 620px; border: 1.5px solid var(--rule); border-radius: 12px; background: #fcfbf6; }
.sim-ktrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sim-ktchip { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em;
  padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-mute); background: var(--paper); white-space: nowrap; }
.sim-ktchip.ok { color: var(--forest); border-color: var(--forest); background: rgba(26,58,46,.07); }
.sim-kthint { font-family: var(--font-body); font-size: 13px; color: var(--ink-mute); }
/* Startdialog: Zeitoption (Nachteilsausgleich) */
.sim-opts { border: 1px solid var(--rule); border-radius: 12px; padding: 10px 16px 14px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sim-opts legend { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--gold-dk); padding: 0 6px; }
.sim-opts-hint { margin: 0 0 6px; font-family: var(--font-body); font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.sim-opt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-family: var(--font-body); font-size: 15px; color: var(--ink); }
.sim-opt:hover { background: rgba(26,58,46,.05); }
.sim-opt:focus-within { outline: 2px solid var(--forest); outline-offset: 1px; }
.sim-opt input { accent-color: var(--forest); width: 18px; height: 18px; margin: 0; flex: none; }
.sim-opt b { font-family: var(--font-display); font-weight: 500; }
.sim-opt span { font-family: var(--font-ui); font-size: 11px; letter-spacing: .01em; color: var(--ink-mute); }
.sim-time-line { margin: 0; font-family: var(--font-body); font-size: 14.5px; color: var(--ink-soft); }
.sim-time-line b { color: var(--forest); }
/* Nachteilsausgleich frei einstellbar (Prozent oder Minuten) */
.sim-na { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 2px 0 4px 34px; padding: 10px 12px; border: 1px dashed var(--rule-2); border-radius: 10px; background: rgba(201,169,97,.07); }
.sim-na[hidden] { display: none; }
.sim-na > label { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); }
.sim-na input[type="number"] { width: 84px; padding: 8px 10px; font-family: var(--font-mono); font-size: 16px; border: 1.5px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--forest); }
.sim-na input[type="number"]:focus { border-color: var(--forest); outline: none; }
.sim-na select { padding: 8px 10px; font-family: var(--font-ui); font-size: 15px; border: 1.5px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); }
.sim-na-max { font-family: var(--font-ui); font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); }
.sim-na-total { flex-basis: 100%; margin: 2px 0 0; font-family: var(--font-body); font-size: 14.5px; color: var(--ink-soft); }
@media (max-width: 560px) { .sim-na { margin-left: 0; } }
/* Nur für Screenreader (Labels der Antwortfelder) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ----- Stafette · 10 Fragen in 15 Minuten (§4.1) ----- */
.stf-note { margin: 0; font-family: var(--font-body); font-size: 14px;
  color: var(--ink-mute); line-height: 1.55; max-width: 66ch; }
.stf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 6px; }
.stf-q { margin-top: 22px; padding-top: 16px; border-top: 1px dotted var(--rule); }
.stf-q:first-child { border-top: 0; }
.stf-hd { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-ui); font-weight: 600;
  font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); margin-bottom: 8px; }
.stf-hd b { color: var(--accent); font-weight: 500; }
.stf-prompt { font-family: var(--font-display); font-size: 17px; line-height: 1.45; color: var(--ink); }
.stf-weak { display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--font-body); font-size: 15px; }

/* ---- Kürsli+ App · Installationshinweis und Update-Hinweis (PWA-CONTRACT §6.3)
   Die Regeln stehen hier und nicht in einem <style>-Tag aus pwa.js: injizierte
   Styles kommen nach dem ersten Paint und lassen die Karte ins Layout springen.
   Der Hinweis liegt im normalen Textfluss als erstes Kind von <main> · kein
   Overlay, kein Backdrop, nichts, was eine Aufgabe verdeckt. */
.kp-hint {
  max-width: 720px; margin: 0 0 22px; padding: 15px 17px;
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--rule);
  border-left: 3px solid var(--gold); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(26,42,30,.05), 0 8px 24px -12px rgba(26,42,30,.16);
}
.kp-hint-mark {
  flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--forest); color: var(--paper);
  font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em;
  border-radius: 9px; position: relative;
}
.kp-hint-mark::after { content: ""; position: absolute; inset: 10%; border: 1px solid rgba(255,255,255,.25); border-radius: 5px; }
.kp-hint-body { flex: 1; min-width: 0; }
.kp-hint-hd {
  font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; color: var(--gold-dk); margin: 1px 0 5px;
}
.kp-hint-tx {
  font-family: var(--font-body); font-size: 14.5px; line-height: 1.55;
  color: var(--ink-soft); margin: 0; max-width: 60ch;
}
.kp-hint-row { margin-top: 11px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* Zusagen und Absagen sind gleich gross und gleich gewichtet · kein
   ausgegrautes Nein, keine zweite Nachfrage (keine Dark Patterns). */
.kp-hint-btn, .kp-hint-link {
  font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--forest); background: var(--forest); color: var(--paper);
}
.kp-hint-btn:hover, .kp-hint-link:hover { background: var(--forest-2); border-color: var(--forest-2); }
.kp-hint-btn.sec {
  background: transparent; color: var(--ink-soft); border-color: var(--rule-2);
}
.kp-hint-btn.sec:hover { background: transparent; border-color: var(--forest); color: var(--forest); }
.kp-hint-btn:focus-visible, .kp-hint-link:focus-visible, .kp-hint-x:focus-visible {
  outline: 2px solid var(--forest); outline-offset: 2px;
}
.kp-hint-steps {
  margin: 11px 0 0; padding: 11px 13px; background: rgba(26,58,46,.05);
  border-radius: 9px; font-family: var(--font-body);
  font-size: 14px; line-height: 1.6; color: var(--ink-soft); max-width: 60ch;
}
.kp-hint-x {
  flex: none; background: none; border: none; cursor: pointer;
  font-size: 15px; line-height: 1; color: var(--ink-mute); padding: 4px 5px; border-radius: 6px;
}
.kp-hint-x:hover { color: var(--ink); }
@media (max-width: 560px) {
  .kp-hint { padding: 13px 14px; gap: 11px; }
  .kp-hint-mark { width: 34px; height: 34px; font-size: 19px; }
}

/* Update-Hinweis · unten LINKS, damit er nie unter dem «Prüfen»-Knopf sitzt.
   Er blockiert keine Eingabe und erscheint nie auf einer Prüfungsseite. */
.kp-toast {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 90; max-width: 380px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; background: var(--paper);
  border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: 12px;
  box-shadow: 0 2px 4px rgba(26,42,30,.06), 0 12px 30px -12px rgba(26,42,30,.28);
}
.kp-toast-tx {
  font-family: var(--font-body); font-size: 14px; color: var(--ink-soft);
}
.kp-toast-btn {
  font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--forest); background: var(--forest); color: var(--paper);
}
.kp-toast-btn:hover { background: var(--forest-2); border-color: var(--forest-2); }
.kp-toast-btn.sec { background: transparent; color: var(--ink-soft); border-color: var(--rule-2); }
.kp-toast-btn.sec:hover { background: transparent; border-color: var(--forest); color: var(--forest); }
.kp-toast-btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
@media (max-width: 560px) { .kp-toast { left: 12px; right: 12px; max-width: none; } }

/* ---- Kürsli+ App · Standalone-Chrome (PWA-CONTRACT §9.2) --------------------
   Gesetzt vom Inline-Snippet im <head>, nicht von ?app=1: ein geteilter Link
   mit ?app=1 sieht im Browser exakt aus wie jede andere Seite. In der
   installierten App fehlt die Adressleiste, also darf die Kopfzeile nicht auch
   noch den Wortmarken-Platz beanspruchen · das Signet bleibt und führt weiter
   zum Produkt-Hub, die Navigation bleibt vollständig. */
:root[data-kp-display="standalone"] body { overscroll-behavior-y: contain; }
:root[data-kp-display="standalone"] .site-head {
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
}
:root[data-kp-display="standalone"] .site-head .brand .nm { display: none; }
:root[data-kp-display="standalone"] .site-foot { display: none; }
:root[data-kp-display="standalone"] .sb-main,
:root[data-kp-display="standalone"] .db-main {
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 640px) {
  :root[data-kp-display="standalone"] .site-head {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
}


/* ===========================================================================
   Kürsli+ Review (Sept 2026): Sterne, Tagesziel, App-Shell auf allen Seiten,
   Theorie-Faltung, Zwischenstand, Illustrationen, ZAP1-Schriftgrad.
   ========================================================================= */

/* ----- Sterne: die lesbare Form der Mastery (progress.js starsOf) ----- */
.stars { font-family: var(--font-display); font-size: 1.15em; letter-spacing: .04em; white-space: nowrap; color: var(--rule-2); line-height: 1; }
.stars b { color: var(--gold-dk); font-weight: 400; }
.stars.big { font-size: 1.5em; }

/* ----- Hub-Illustrationen (SVG im Glyph-Kreis) ----- */
.hub-card .glyph svg { width: 22px; height: 22px; display: block; }
.hub-card .glyph.txt { font-size: 18px; }

/* ----- Theorie eingeklappt, sobald ein Thema schon geübt wurde ----- */
details.theory-fold { margin-bottom: 18px; }
details.theory-fold > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; color: var(--accent-ink);
  padding: 6px 0 10px; }
details.theory-fold > summary::-webkit-details-marker { display: none; }
details.theory-fold > summary::before { content: '\25B8'; font-size: 13px; }
details.theory-fold[open] > summary::before { content: '\25BE'; }
details.theory-fold > summary .sum-note { font-family: var(--font-body); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink-mute); }
details.theory-fold[open] > summary .sum-note { display: none; }

/* ----- Zwischenstand nach zehn Aufgaben (nie modal, nie automatisch weiter) ----- */
.session-card { margin-top: 18px; padding: 16px 20px; border: 1px solid var(--rule); border-left: 3px solid var(--forest);
  border-radius: var(--radius-sm); background: var(--paper); box-shadow: var(--shadow); }
.session-card .sc-hd { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--gold-dk); margin-bottom: 8px; }
.session-card .sc-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 8px; }
.session-card .sc-stat b { font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--forest); display: block; line-height: 1.1; }
.session-card .sc-stat span { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); }
.session-card p { margin: 6px 0 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55; color: var(--ink-soft); max-width: 64ch; }
.session-card .hc-row { margin-top: 12px; }

/* ----- Tagesziel-Ring (Kürsli+ Heute und die Hubs) ----- */
.kp-goal { display: flex; align-items: center; gap: 18px; }
.kp-ring { width: 84px; height: 84px; flex: none; }
.kp-ring circle { fill: none; stroke-width: 7; }
.kp-ring .track { stroke: var(--bg-2, #ebe7d7); }
.kp-ring .fill { stroke: var(--forest); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s cubic-bezier(.2,.7,.2,1); }
.kp-ring.met .fill { stroke: var(--gold-dk); }
.kp-ring text { font-family: var(--font-display); font-size: 22px; fill: var(--forest); text-anchor: middle; }
.kp-goal-tx { min-width: 0; }
.kp-goal-tx b { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--forest); display: block; line-height: 1.2; }
.kp-goal-tx span { font-family: var(--font-body); font-size: 14px; color: var(--ink-soft); }
.kp-week { display: flex; gap: 6px; margin-top: 10px; }
.kp-week i { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-2, #ebe7d7); display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-style: normal; font-weight: 600; font-size: 11.5px; color: var(--ink-mute); }
.kp-week i.on { background: var(--forest); color: var(--paper); }
.kp-week i.today { box-shadow: 0 0 0 2px var(--gold); }
.kp-streak { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; font-family: var(--font-display); font-size: 20px; color: var(--forest); }
.kp-streak small { font-family: var(--font-body); font-size: 13.5px; color: var(--ink-soft); }
.kp-streak.risk { color: var(--tan); }
.kp-goal-set { font-family: var(--font-body); font-size: 13px; color: var(--ink-mute); margin-top: 8px; }
.kp-goal-set select { font-family: var(--font-ui); font-size: 12px; padding: 3px 6px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 6px; }

/* ----- Regal: erreichte Meilensteine ----- */
.kp-shelf { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.kp-trophy { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--paper); font-family: var(--font-body); font-size: 13.5px; color: var(--ink-soft); }
.kp-trophy i { font-style: normal; color: var(--gold-dk); font-size: 14px; }
.kp-trophy.new { border-color: var(--gold); background: rgba(201,169,97,.12); }

/* ----- Kürsli+ App-Shell: Tab-Leiste (alle Übungsseiten für AbonnentInnen) ----- */
.kp-tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 900; display: none;
  background: var(--paper); border-top: 1px solid var(--rule);
  padding: 3px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  box-shadow: 0 -10px 28px -14px rgba(26,42,30,.35); }
.kp-tabbar-inner { display: flex; justify-content: space-around; max-width: 560px; margin: 0 auto; }
.kp-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px;
  background: none; border: none; cursor: pointer; text-decoration: none; color: var(--ink-mute); position: relative; font: inherit; }
.kp-tab svg { width: 23px; height: 23px; display: block; }
.kp-tab .kp-lbl { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; }
.kp-tab.on { color: var(--forest); }
.kp-tab.on::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 1px;
  width: 26px; height: 3px; border-radius: 2px; background: var(--gold); }
@media (max-width: 899px) {
  body.kp-tabs-on .kp-tabbar { display: block; }
  body.kp-tabs-on .sb-main, body.kp-tabs-on .db-main { padding-bottom: 104px; }
  body.kp-tabs-on .site-foot { padding-bottom: 84px; }
}
/* Im Kürsli+ selbst gilt die Leiste auf jeder Breite: auf dem Desktop als
   ruhige Tab-Zeile oben im Inhalt statt als schwebende Leiste unten. */
@media (min-width: 900px) {
  body.kp-tabs-all .kp-tabbar { display: block; position: static; box-shadow: none; border-top: 0; border-bottom: 1px solid var(--rule);
    background: transparent; padding: 0; margin: 0 0 28px; }
  body.kp-tabs-all .kp-tabbar-inner { max-width: none; justify-content: flex-start; gap: 4px; }
  body.kp-tabs-all .kp-tab { flex: 0 0 auto; flex-direction: row; gap: 9px; padding: 12px 16px; }
  body.kp-tabs-all .kp-tab svg { width: 18px; height: 18px; }
  body.kp-tabs-all .kp-tab .kp-lbl { font-size: 12.5px; letter-spacing: .02em; }
  body.kp-tabs-all .kp-tab.on::after { left: 0; transform: none; width: 100%; bottom: -1px; height: 2px; border-radius: 0; }
}

/* ----- ZAP1 (6. Klasse): eine Spur grösser ----- */
:root[data-kp-product="zap1"] .prompt { font-size: 21px; }
:root[data-kp-product="zap1"] .prompt .expr { font-size: 24px; }
:root[data-kp-product="zap1"] .input-row input[type="text"] { font-size: 21px; }
:root[data-kp-product="zap1"] .sim-input { font-size: 19px; }
:root[data-kp-product="zap1"] .stf-prompt { font-size: 19px; }
:root[data-kp-product="zap1"] .feedback { font-size: 16.5px; }
:root[data-kp-product="zap1"] .def, :root[data-kp-product="zap1"] .wex .q, :root[data-kp-product="zap1"] .wex .s { font-size: 16.5px; }
:root[data-kp-product="zap1"] .sb-section .sub { font-size: 18px; }
:root[data-kp-product="zap1"] .hub-card.db p { font-size: 15.5px; }
:root[data-kp-product="zap1"] .hub-card li { font-size: 13px; }
:root[data-kp-product="zap1"] .scoreboard { font-size: 12px; }
:root[data-kp-product="zap1"] .db-lede { font-size: 18px; }
:root[data-kp-product="zap1"] .btn { font-size: 12px; }

/* ---- Formel-Tasten unter dem Antwortfeld (keypad.js) ----
   Eine Leiste, die beim Fokus hinter die .input-row des aktiven Feldes wandert.
   Tasten mindestens 44 px hoch (Tablet-Daumen), Mono wie das Feld selbst. */
.kr-keypad { width: 100%; max-width: 640px; align-self: center; display: flex; flex-direction: column; gap: 6px; margin: -8px 0 0; }
.kr-keypad.kr-left { align-self: flex-start; }
.kr-keypad:not(.open) { align-items: center; margin-top: -12px; }
.kr-keypad.kr-left:not(.open) { align-items: flex-start; }
/* In einer Teilaufgabe (.step) ist die Spalte kein Flex mit gap: Die negativen Ränder oben legten die Tasten und «Formel-Tasten einblenden» auf «Prüfen» und auf die Rückmeldung. */
.step .kr-keypad, .step .kr-keypad:not(.open) { margin-top: 6px; }
/* Ebenso in der Stafette (.stf-q, kein gap, telefon T2) und in der Probeprüfung (.probe-part, gap 8 px, telefon T7) */
.stf-q .kr-keypad, .stf-q .kr-keypad:not(.open) { margin-top: 6px; }
.probe-part .kr-keypad, .probe-part .kr-keypad:not(.open) { margin-top: 0; }
.kr-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.kr-left .kr-row { justify-content: flex-start; }
.kr-k { min-width: 44px; height: 44px; padding: 0 11px; font-family: var(--font-mono); font-size: 18px; line-height: 1; color: var(--ink); background: var(--paper); border: 1.5px solid var(--rule); border-radius: 9px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.kr-k:hover { border-color: var(--forest); }
.kr-k:active { background: var(--bg-2); border-color: var(--forest); transform: translateY(1px); }
.kr-k:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.kr-u { font-size: 15px; }
.kr-sp { background: var(--bg-2); color: var(--ink-soft); }
.kr-foot { display: flex; justify-content: flex-end; }
.kr-tog { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--ink-mute); background: transparent; border: 0; padding: 6px 4px; cursor: pointer; }
.kr-tog:hover { color: var(--forest); text-decoration: underline; }
/* Auf dem Telefon brachen die drei gedachten Tastenreihen in sechs gemalte um
   (eine Reihe mit 8 Tasten braucht 362 px, verfuegbar sind 342), das Tastenfeld
   wurde 314 px hoch, und mit Kopf und Bildschirmtastatur blieben rund 6 px fuer
   Aufgabe, Feld und «Pruefen». Die Tasten teilen sich die Breite deshalb dort, wo
   das Zeilen spart: ab 381 px Bildschirm fasst das Tastenfeld (90 px schmaler als
   der Bildschirm) die 8 Tasten einer ZAP-2-Reihe mit 32 px je Taste (291 px), das
   Feld wird 220 px hoch, ab 418 px passt auch die Reihe mit 9 Tasten (173 px).
   Schmaler, und mit den 10 und 11 Tasten der ZAP 1 (365 und 402 px) auf jedem
   Telefon, spart das Teilen nichts: die Reihen brechen ohnehin um und das Feld
   bleibt 317 px hoch, nur staenden dann «°» und «>» allein, ← getrennt von →,
   und jede Taste waere schmaler. Dort bleiben es 40 px je Taste. Umbrechen duerfen
   die Reihen ueberall, sonst wird die Seite breiter als der Bildschirm und Tasten
   liegen ausserhalb. Ein Browser ohne :has() bleibt bei den 40 px. Die Mindestbreite
   32 px bleibt ueber dem, was ein Daumen trifft, und die Tastenhoehe von 42 px
   bleibt unangetastet. */
@media (max-width: 480px) {
  .kr-k { min-width: 40px; height: 42px; padding: 0 8px; font-size: 17px; }
  .kr-u { font-size: 14px; }
}
@media (min-width: 381px) and (max-width: 480px) {
  .kr-row:not(:has(> :nth-child(10))) { gap: 5px; }
  .kr-row:not(:has(> :nth-child(10))) .kr-k { flex: 1 1 32px; min-width: 32px; max-width: 44px; padding: 0 4px; }
}
/* ===========================================================================
   mathfmt · gesetzte Brüche und Wurzeln (public/ueben/mathfmt.js, window.MF)
   Das Markup ist gewöhnliches HTML, also kein Render-Schritt und kein KaTeX.
   Es erbt die Schrift der Umgebung: in .expr die Mono, im Fliesstext
   Source Serif / Fraunces. Alle Masse in em, alle Striche in currentColor
   (Druck, Zoom, Kontrastmodus und die farbigen Feedback-Zeilen stimmen so
   von selbst).
   ========================================================================= */
.mf { position: relative; }
.mf-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; user-select: none; -webkit-user-select: none; }

/* Bruch · zwei gleich hohe Zeilen (1fr 1fr), der Strich ist die Oberkante des
   Nenners und liegt damit genau in der Mitte der Box. vertical-align: middle
   setzt diese Mitte auf Grundlinie + halbe x-Höhe, also auf die Höhe von
   Plus und Minus daneben. Im Fliesstext kompakt (.85em, so gross wie die
   Ziffern von KaTeX \tfrac daneben), in .expr und im Lösungskasten in voller
   Grösse (wie \dfrac), geschachtelt eine Stufe kleiner. */
.mf-frac > .mf-v { display: inline-grid; grid-template-rows: 1fr 1fr; vertical-align: middle;
  text-align: center; line-height: 1; margin: 0 .08em; white-space: nowrap; }
.mf-frac > .mf-v > .mf-n { align-self: end; padding: 0 .12em .06em; font-size: .85em; }
.mf-frac > .mf-v > .mf-d { align-self: start; padding: .08em .12em 0; font-size: .85em;
  border-top: .07em solid currentColor; }
.expr .mf-frac > .mf-v > .mf-n, .expr .mf-frac > .mf-v > .mf-d,
.mf-ans .mf-frac > .mf-v > .mf-n, .mf-ans .mf-frac > .mf-v > .mf-d,
.mf-dfrac > .mf-v > .mf-n, .mf-dfrac > .mf-v > .mf-d { font-size: 1em; }
.expr .mf-frac > .mf-v > .mf-d, .mf-ans .mf-frac > .mf-v > .mf-d, .mf-dfrac > .mf-v > .mf-d { border-top-width: .06em; }
.mf-frac .mf-frac > .mf-v > .mf-n, .mf-frac .mf-frac > .mf-v > .mf-d { font-size: .84em; }
/* In .expr: Luft neben dem Operator und über/unter dem Bruch (.25em), damit
   umbrochene Zeilen (360 px) klar getrennt sind; geschachtelt weniger. */
.expr .mf-frac > .mf-v, .mf-ans .mf-frac > .mf-v, .mf-dfrac > .mf-v { line-height: 1.12; }
.expr .mf-frac > .mf-v { margin: .25em .14em; }
.expr .mf-frac .mf-frac > .mf-v, .expr .mf-sqrt .mf-frac > .mf-v { margin: .06em .1em; }

/* Operator und rechter Operand (MF.op): die Zeile bricht vor dem Operator um,
   nie zwischen Operator und Bruch oder Wurzel. */
.mf-op { white-space: nowrap; }

/* Gemischte Zahl · Ganze und Bruch bleiben zusammen, der Bruchteil ist wie
   auf dem Prüfungsblatt kleiner als die Ganzen: .72em in .expr (22 bis 24 px),
   .8em im Fliesstext und im Lösungskasten, sonst wird er unleserlich klein. */
.mf-mixed > .mf-v { white-space: nowrap; }
.mf-mixed .mf-frac > .mf-v { margin: 0 .04em 0 .06em; line-height: 1; }
.mf-mixed .mf-frac > .mf-v > .mf-n, .mf-mixed .mf-frac > .mf-v > .mf-d { font-size: .8em; }
.expr .mf-mixed .mf-frac > .mf-v > .mf-n, .expr .mf-mixed .mf-frac > .mf-v > .mf-d { font-size: .72em; }
/* Steht die gemischte Zahl allein im Ausdruck („Schreibe als Dezimalzahl: 4 ⅗“),
   wirkt .72em neben den Ganzen zu klein: dort .8em wie im Fliesstext. */
.expr > .mf-mixed:only-child .mf-frac > .mf-v > .mf-n, .expr > .mf-mixed:only-child .mf-frac > .mf-v > .mf-d { font-size: .8em; }
.mf-mixed .mf-frac > .mf-v > .mf-d { border-top-width: .08em; }

/* Wurzel · Wurzelzeichen (SVG, Linien in em und %) plus Radikand mit
   border-top als Strich. Der Radikand bestimmt die Grundlinie
   (align-self: baseline), das Zeichen wird auf seine volle Höhe gestreckt. */
.mf-sqrt > .mf-v { display: inline-flex; align-items: stretch; white-space: nowrap; }
.mf-surd { position: relative; flex: none; width: .62em; }
.mf-surd svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; fill: none; }
.mf-surd line { stroke: currentColor; stroke-width: .06em; stroke-linecap: round; }
.mf-surd .mf-s2 { stroke-width: .1em; }
/* padding-top .16em: eine Hochzahl im Radikanden („(7a)²“) hält sichtbar
   Abstand zum Strich, so viel wie beim KaTeX-Wurzelzeichen im Tipp daneben. */
.mf-r { align-self: baseline; border-top: .06em solid currentColor; padding: .16em .08em 0 .04em; }
/* Wurzel über einem Bruch: etwas mehr Luft unter dem Strich. */
.mf-r > .mf-frac:first-child > .mf-v { margin-top: .08em; }
/* Wurzel in der Wurzel: die Striche nicht aufeinander, der äussere reicht
   rechts sichtbar über den inneren hinaus. */
.mf-r .mf-sqrt > .mf-v { margin: .12em .14em 0 0; }

/* Lösungskasten · derselbe Kasten wie bisher <code>, jetzt auch für gesetzte
   Lösungen. Mono wie das Eingabefeld. */
.mf-ans { display: inline-block; font-family: var(--font-mono); line-height: 1.35;
  background: rgba(255, 255, 255, .55); padding: 1px 6px; border: 1px solid var(--rule); border-radius: 5px; }

/* .expr sah bisher nur in .prompt wie ein Rechenausdruck aus. Die Stafette zeigt
   dieselben Aufgaben in .stf-prompt · dort stand .expr in Fraunces. */
.stf-prompt .expr { display: inline-block; margin-top: 6px; font-family: var(--font-mono); font-size: 20px;
  color: var(--forest); background: var(--bg-2); padding: 6px 14px; border: 1px solid var(--rule);
  border-radius: var(--radius-sm); letter-spacing: .02em; }
/* Nie breiter als die Karte: der Ausdruck bricht an seinen Leerzeichen um. */
.prompt .expr, .stf-prompt .expr { max-width: 100%; }
/* Keine Ligaturen, wo Mathematik in JetBrains Mono steht: die Schrift setzt «|-» als ein Zeichen «⊢»,
   Q(5|-3) las sich als «Q(5⊢3)», auch im Eingabefeld (Welle 2, Prüfung Telefon). */
.prompt .expr, .stf-prompt .expr, .input-row input[type="text"], .sim-input, .mf-ans, .feedback code, .prompt code, .sub code, .def code { font-variant-ligatures: none; }
@media (max-width: 600px) { .stf-prompt .expr { font-size: 17px; } }
/* Umgebrochener Ausdruck mit Bruch oder Wurzel (engine.js fitExprs, nur wenn
   er auch verkleinert nicht auf eine Zeile passt): Zeilen linksbündig und mit
   Luft über und unter jedem Bruch und jeder Wurzel, damit die Fortsetzung
   („· √8x“, „: a“) nie wie eine weitere Zeile des Bruchs aussieht oder am
   Radikanden darüber klebt. */
.expr.mf-wrap, .mf-ans.mf-wrap { text-align: left; }
.mf-wrap .mf-frac > .mf-v { margin-top: .6em; margin-bottom: .6em; }
/* Ein .expr mit Bruch mitten im Satz (engine.js markInline): Bruch kompakt
   wie im Fliesstext (.85em, wenig Luft), Kasten flacher. So bleibt der
   Zeilenabstand des Absatzes ruhig (ZAP1 brueche v5, zahlenstrahl). */
.expr.mf-inl { padding-top: 1px; padding-bottom: 1px; margin-top: 2px; vertical-align: middle; }
.expr.mf-inl .mf-frac > .mf-v { margin: .02em .1em; }
.expr.mf-inl .mf-frac > .mf-v > .mf-n, .expr.mf-inl .mf-frac > .mf-v > .mf-d { font-size: .85em; }
.expr.mf-inl .mf-mixed .mf-frac > .mf-v > .mf-n, .expr.mf-inl .mf-mixed .mf-frac > .mf-v > .mf-d { font-size: .72em; }
.mf-wrap .mf-frac .mf-frac > .mf-v, .mf-wrap .mf-sqrt .mf-frac > .mf-v { margin-top: .06em; margin-bottom: .06em; }
.mf-wrap > .mf-sqrt > .mf-v, .mf-wrap > .mf-op > .mf-sqrt > .mf-v { margin-top: .3em; margin-bottom: .2em; }
/* Satzzeichen nach einem Kasten (engine.js glue): bleibt beim Kasten. Der
   Kasten selbst bricht weiter um und lässt dem Zeichen Platz. */
.mf-glue { white-space: nowrap; }
/* Das Satzzeichen nach einer langen Formel steht in ihrem letzten Stück (engine.js fitExprs), in der Schrift des Texts. */
.katex .mf-tail { font-family: var(--font-body); font-size: .83em; font-style: normal; }
.mf-glue > .expr { white-space: normal; max-width: calc(100% - .6em); }
/* Schmale Handys: eine Wurzel oder ein Bruch bricht nie um. Der längste
   Radikand, den die Banken bauen (k1 potenz v6, 23 Zeichen wie
   „117u² + (−4u)² + (−6u)²“), ist bei 18 px Mono samt Wurzelzeichen 270 px
   breit; mit 16 px Rand im Kasten ragte er bei 320 px aus der Karte. Darum auf
   dem Handy: schmaler Rand im Kasten, keine Laufweite, und unter 360 px
   Breite wächst die Schrift mit der Breite mit (5vw: 360 px → 18 px,
   340 → 17, 320 → 16). Ab 360 px bleibt es bei 18 px. So passen bis 24
   Zeichen (Grenze „long“ in mf_audit.js) bei 320 px in die Karte;
   test_mathfmt.js rechnet das nach. */
@media (max-width: 600px) {
  .prompt .expr { font-size: min(18px, 5vw); padding-left: 8px; padding-right: 8px; letter-spacing: 0; }
  .stf-prompt .expr { font-size: min(17px, 4.7vw); padding-left: 8px; padding-right: 8px; letter-spacing: 0; }
}
/* ZAP1 zeigt .expr eine Spur grösser (24 px), die Regel oben gilt aber auch
   auf dem Handy und überstimmt dort die 18 px. Auf dem Handy 20 px, damit
   gemischte Zahlen und Brüche in die Karte passen. */
@media (max-width: 600px) { :root[data-kp-product="zap1"] .prompt .expr { font-size: 20px; } }
