/* Lerncoach im Design-System „Dämmerung“ von Endlich Feierabend (KI-Fortbildung/Marketing/DESIGN-SYSTEM.md, ef.css;
   claude.ai: Design System „Endlich Feierabend“). Mobil zuerst, Hell/Dunkel automatisch.
   Farben der Quelle exakt; abgeleitet sind nur --warn (dunkleres Gold, damit Text 4,5:1 erreicht) und der Dunkelmodus,
   den die Quelle nicht vorgibt. Schriften liegen lokal in /static/fonts (SIL OFL), kein Aufruf bei Google. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/bricolage-grotesque-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600.woff2") format("woff2"); }
:root {
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --bg: #faf7f1;          /* paper */
  --surface: #ffffff;     /* surface */
  --surface-2: #f1ebdf;   /* paper-2 (Sand) */
  --text: #1b2430;        /* text (Tinte) */
  --muted: #5a6573;       /* text-soft */
  --line: #e7dfcf;        /* line */
  --ink: #0b2240;         /* Nacht-Blau: Überschriften, dunkle Flächen */
  --amber: #ce8a2c;       /* Abendgold: nur als Funke (Linien, Zeichen) */
  --primary: #1a6b3c;     /* Wald-Grün: Aktion */
  --primary-strong: #155a32;
  --on-primary: #ffffff;
  --primary-soft: #e7f1ea;
  --ok: #1a6b3c;
  --ok-soft: #e7f1ea;
  --warn: #8a5a14;        /* abgeleitet: Gold dunkel genug für Text (5,1:1 auf amber-soft) */
  --warn-soft: #f6ecdb;   /* amber-soft */
  --bad: #cc1a1a;         /* Signal-Rot: nur Negatives */
  --bad-soft: #fbe9e9;
  --shadow: 0 1px 2px rgba(11, 34, 64, .05), 0 2px 8px rgba(11, 34, 64, .05);
  --radius: 20px;
  --mark-bg: #0b2240;    /* Zeichen: Gold auf Nacht-Blau */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #081a31;        /* ink-deep */
    --surface: #0b2240;   /* ink */
    --surface-2: #12305a;
    --text: #eaf1f8;      /* on-dark */
    --muted: #a9b8c9;
    --line: #2a4266;
    --ink: #eaf1f8;
    --primary: #7be0a4;   /* Grün auf dunklen Flächen wie in ef.css (.section--dark .tick) */
    --primary-strong: #9be8b8;
    --on-primary: #081a31;
    --primary-soft: #17402c;
    --ok: #7be0a4;
    --ok-soft: #17402c;
    --warn: #e0a24a;
    --warn-soft: #3d2c12;
    --bad: #ff8f86;
    --bad-soft: #4a1f24;
    --mark-bg: #12305a;  /* auf dunklem Kopf sonst unsichtbar */
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 var(--font-body);
}
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); letter-spacing: -.02em; }
h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin: .4rem 0 1rem; }
h2 { font-size: 1.3rem; font-weight: 700; line-height: 1.2; margin: 2rem 0 .75rem; }
h3 { font-weight: 700; line-height: 1.25; }
p { margin: .5rem 0 1rem; }
small, .muted { color: var(--muted); }
code { font-size: 1em; background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; }

/* ---- Kopf ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 64rem; margin: 0 auto; padding: .6rem 1rem;
  display: flex; align-items: center; gap: .25rem .75rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 2rem; height: 2rem; border-radius: 10px; background: var(--mark-bg); color: var(--amber);
  display: grid; place-items: center; font-size: 1.1rem; line-height: 1;
}
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: .1rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a, .linklike {
  color: var(--muted); text-decoration: none; padding: .4rem .55rem; border-radius: 999px; font: inherit;
  background: none; border: 0; cursor: pointer;
}
.topbar nav a:hover, .linklike:hover { background: var(--surface-2); color: var(--text); }
.topbar .who { color: var(--muted); font-size: .9rem; margin-right: .25rem; display: none; }
@media (min-width: 40rem) { .topbar .who { display: inline; } }

/* ---- Seite ---- */
main { max-width: 34rem; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
main.wide { max-width: 64rem; }
.back { display: inline-block; margin-bottom: .25rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--primary); }

/* ---- Karten ---- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.25rem; margin: 0 0 1rem;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-top: 0; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
a.card-link { display: block; color: inherit; text-decoration: none; transition: transform .12s, border-color .12s; }
a.card-link:hover, a.card-link:focus-visible { transform: translateY(-2px); border-color: var(--primary); }
.card-link .icon { font-size: 1.8rem; line-height: 1; margin-bottom: .4rem; }
.card-link strong { display: block; font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; color: var(--ink); font-size: 1.15rem; }
.notice { background: var(--warn-soft); border: 1px solid transparent; border-radius: var(--radius); padding: .8rem 1.1rem; margin: 0 0 1rem; }
.notice p { margin: .25rem 0; }

/* ---- Formulare und Knöpfe ---- */
label { display: block; margin: 0 0 1rem; font-weight: 600; }
label small { font-weight: 400; display: block; margin-top: .25rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .7rem .85rem; font: inherit; font-weight: 400;
  color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--primary); outline-offset: 2px;
}
textarea { resize: vertical; }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px; padding: .7rem 1.3rem;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--line); text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { border-color: var(--primary); }
button.primary, .btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
button.primary:hover, .btn.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
button.big { width: 100%; padding: 1rem 1.2rem; font-size: 1.15rem; border-radius: 999px; }
.inline { display: inline; margin: 0; }
.inline button, button.small { padding: .2rem .75rem; font-size: .9rem; border-radius: 999px; }
.inline label { display: inline-block; margin: 0; }
.inline select { display: inline-block; width: auto; max-width: 100%; padding: .35rem .5rem; margin: 0 .3rem; }
.error { color: var(--bad); background: var(--bad-soft); padding: .6rem .9rem; border-radius: 12px; }

/* ---- Chips ---- */
.badge { white-space: nowrap; display: inline-block; padding: .1rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.good { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--primary-soft); color: var(--primary-strong); }

/* ---- Tabellen ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: .6rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
fieldset.box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: .8rem 1.1rem; margin: 1rem 0; }
fieldset.box legend { font-weight: 700; padding: 0 .4rem; }

/* ---- Aufgabe ---- */
.task { padding: 1.25rem; }
.statement { font-size: 1.3rem; line-height: 2; margin: 0 0 1.25rem; }
.answer-row { display: flex; align-items: center; gap: .6rem; }
.answer-row input { font-size: 1.4rem; padding: .75rem 1rem; text-align: center; }
.unit { font-size: 1.2rem; color: var(--muted); }
.compare { border: 0; padding: 0; margin: 0 0 1.25rem; display: flex; gap: .75rem; }
.compare legend { font-weight: 600; margin-bottom: .6rem; padding: 0; width: 100%; }
.sym { flex: 1; margin: 0; text-align: center; }
.sym input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sym span {
  display: block; font-size: 2rem; line-height: 1; padding: 1rem 0; border: 2px solid var(--line);
  border-radius: 14px; background: var(--surface); cursor: pointer; font-weight: 500;
}
.sym input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.sym input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .2em; font-size: 1.2em; line-height: 1.2; }
.frac .num { border-bottom: 2px solid currentColor; padding: 0 .3em; }
.frac .den { padding: 0 .3em; }
.mixed { display: inline-flex; align-items: center; }
.mixed .whole { margin-right: .1em; font-size: 1.2em; }
.bar { display: block; width: 100%; max-width: 22rem; margin: .6rem 0; }
.bar rect { stroke: var(--text); stroke-width: 1.2; }
.bar .on { fill: var(--primary); }
.bar .off { fill: var(--surface); }
.result { border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1rem; border: 1px solid transparent; }
.result.ok { background: var(--ok-soft); color: var(--ok); }
.result.bad { background: var(--warn-soft); color: var(--warn); }
.result p { margin: .3rem 0; }
.result .head { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.result .detail { color: var(--text); }
.solution { font-weight: 700; }
.progress-line { color: var(--muted); font-size: .95rem; margin-bottom: .75rem; }

/* ---- Lernpfad ---- */
.path { list-style: none; margin: 0; padding: 0; }
.path li { display: flex; gap: .9rem; align-items: flex-start; padding: .65rem 0; position: relative; }
.path li:not(:last-child)::before {
  content: ""; position: absolute; left: 1.05rem; top: 2.6rem; bottom: -.6rem; width: 2px; background: var(--line);
}
.dot {
  flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; background: var(--surface-2); color: var(--muted); border: 2px solid var(--line);
}
.path .done .dot { background: var(--ok); color: var(--on-primary); border-color: var(--ok); }
.path .active .dot { background: var(--primary); color: var(--on-primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.path .body { flex: 1; min-width: 0; }
.path .body strong { display: block; line-height: 1.3; }
.path .open .body { color: var(--muted); }
.progress { background: var(--surface-2); border-radius: 999px; height: .5rem; margin-top: .4rem; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.path .done .progress > span { background: var(--ok); }

/* ---- Login ---- */
.login { max-width: 24rem; margin: 3rem auto 0; }
.login .brand-big { text-align: center; margin-bottom: 1.5rem; }
.login .brand-big .brand-mark { width: 3.4rem; height: 3.4rem; font-size: 1.8rem; border-radius: 16px; margin: 0 auto .6rem; }
.login h1 { text-align: center; margin: 0; }
.login .sub { text-align: center; color: var(--muted); margin: .2rem 0 0; }
.goal-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.goal-list button { width: 100%; text-align: left; padding: .9rem 1rem; }
.goal-list button small { display: block; font-weight: 400; margin-top: .15rem; }

/* ---- Lernkarten ---- */
.lesson { padding: 1.25rem 1.4rem; }
.lesson h1 { font-size: 1.5rem; margin-top: 0; }
.lesson-body { font-size: 1.08rem; line-height: 1.7; }
.lesson-body p { margin: .7rem 0; }
.lesson-body h2 { font-size: 1.1rem; margin: 1.4rem 0 .3rem; color: var(--primary-strong); }
.lesson-body ul, .lesson-body ol { padding-left: 1.3rem; }
.lesson-body li { margin: .6rem 0; line-height: 2.05; }
.lesson-body p { line-height: 1.9; }
.lesson-body .katex { line-height: 1.3; }
.lesson-body blockquote {
  margin: 1rem 0; padding: .7rem 1rem; background: var(--primary-soft); color: var(--text);
  border-left: 5px solid var(--primary); border-radius: 0 12px 12px 0;
}
.lesson-body blockquote p { margin: .3rem 0; }
.lesson-body .math.block { display: block; margin: .8rem 0; overflow-x: auto; text-align: center; }
.lesson-body .katex { font-size: 1.12em; }
.lesson-body .math:not(.rendered) { font-family: ui-monospace, monospace; background: var(--surface-2); border-radius: 6px; padding: 0 .3rem; }
.lesson-body .bar { margin: .3rem 0; }
.lesson-body strong { color: var(--text); }
.btn.big { width: 100%; text-align: center; padding: 1rem 1.2rem; font-size: 1.15rem; border-radius: 14px; margin-top: .5rem; }
.small-btn { padding: .35rem .8rem; font-size: .95rem; margin-bottom: .8rem; }
label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: 0 0 .7rem; }
label.check input { width: 1.3rem; height: 1.3rem; margin: .15rem 0 0; flex: none; accent-color: var(--primary); }

/* ---- Rückmeldung und Meldeknopf ---- */
.feedback { text-align: center; }
.feedback p { margin: 0 0 .6rem; }
.fb-row { margin: 0 0 .6rem; }
.feedback details { text-align: left; }
.feedback summary { cursor: pointer; text-align: center; padding: .4rem; color: var(--primary-strong); font-weight: 600; }

/* ---- Hervorhebung in Formeln ---- */
:root { --accent: #9a6418; --grid: rgba(11, 34, 64, .08); }  /* Gold für Text (tag--amber der Quelle), Karopapier in Nacht-Blau */
@media (prefers-color-scheme: dark) { :root { --accent: #e0a24a; --grid: rgba(234, 241, 248, .08); } }
.katex .hl { color: var(--accent); font-weight: 700; }

/* ---- Lücken-Rechenweg ---- */
.chain { margin: .2rem 0 .4rem; }
.crow { font-size: 1.1rem; line-height: 2.9; }
.crow .frac { margin: 0 .25em; }
input.gap {
  display: inline-block; width: 2.7em; min-width: 0; max-width: none; margin: .1rem .1rem;
  padding: .25rem .1rem; text-align: center; font-size: 1.05rem; border-radius: 10px; border-width: 2px;
}
.crow .num input.gap, .crow .den input.gap { width: 2.2em; padding: .1rem 0; }
.chain { overflow-x: auto; }
.gap.ok, .gap.bad { display: inline-block; padding: 0 .35rem; border-radius: 8px; font-weight: 700; line-height: 1.6; }
.gap.ok { background: var(--ok-soft); color: var(--ok); }
.gap.bad { background: var(--bad-soft); color: var(--bad); }
.gap.bad s { opacity: .8; }
.gap.bad b { color: var(--ok); background: var(--ok-soft); padding: 0 .25rem; border-radius: 6px; }

/* ---- Beispiele und gefüllte Lücken ---- */

.example { border-style: dashed; }
.gap.fixed { display: inline-block; padding: 0 .35rem; border-radius: 8px; font-weight: 700; background: var(--primary-soft); color: var(--primary-strong); }

/* ---- Fehlersuche ---- */
fieldset.rows { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
fieldset.rows legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }
label.rowpick { display: block; margin: 0; font-weight: 400; cursor: pointer; }
label.rowpick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rowbox { display: block; padding: .15rem .8rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
label.rowpick input:checked + .rowbox { border-color: var(--primary); background: var(--primary-soft); }
label.rowpick input:focus-visible + .rowbox { outline: 3px solid var(--primary); outline-offset: 2px; }
.result-rows { display: grid; gap: .4rem; margin: .6rem 0; }
.rowbox.is-error { border-color: var(--bad); background: var(--bad-soft); }
.rowbox.is-pick:not(.is-error) { border-style: dashed; border-color: var(--primary); }
.rowbox.is-fixed { border-color: var(--ok); background: var(--ok-soft); margin-bottom: .6rem; }
.rowtag { display: block; font-weight: 700; margin: -.4rem 0 .3rem; }
.rowtag.bad { color: var(--bad); }

/* ---- Figur zum Antippen ---- */
fieldset.figure { border: 0; padding: 0; margin: 0 0 1.2rem; }
fieldset.figure legend { padding: 0; margin-bottom: .6rem; font-size: .95rem; }
.cells { display: flex; flex-wrap: wrap; gap: 0; max-width: 24rem; }
fieldset.bar .cells { gap: 0; }
fieldset.dots .cells { gap: .5rem; }
.cell { margin: 0; line-height: 0; }
.cell input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cell span { display: block; cursor: pointer; background: var(--surface); border: 2px solid var(--text); box-sizing: border-box; }
fieldset.bar .cell span { width: 2.6rem; height: 3rem; margin: 0 -1px -1px 0; }
fieldset.dots .cell span { width: 2.4rem; height: 2.4rem; border-radius: 50%; border-color: var(--muted); }
.cell input:checked + span { background: var(--primary); border-color: var(--primary-strong); }
.cell input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; position: relative; z-index: 1; }
fieldset.done .cell span { cursor: default; }
@media (max-width: 30rem) { fieldset.bar .cell span { width: 2rem; height: 2.6rem; } fieldset.dots .cell span { width: 2rem; height: 2rem; } }

/* ---- KI-Labor ---- */
.ai-box { border-top: 1px dashed var(--line); margin-top: .8rem; padding-top: .8rem; }
.ai-box .badge, .badge.wrap { white-space: normal; border-radius: .6rem; line-height: 1.35; padding: .35rem .7rem; }
pre { white-space: pre-wrap; word-break: break-word; font-size: .85rem; background: var(--surface-2); padding: .6rem; border-radius: 10px; }
.stat { display: grid; gap: .15rem; align-content: start; }
.stat strong { font-size: 1.35rem; }
.chat { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.bubble { max-width: 92%; padding: .6rem .85rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); overflow-wrap: anywhere; }
.bubble.student { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.bubble.coach.k-hint { border-left: 4px solid var(--primary); }
.bubble.coach.k-reveal { border-left: 4px solid var(--amber); }
.bubble.coach.k-ok { border-left: 4px solid var(--ok); }
.bubble pre { margin: 0; background: transparent; padding: 0; color: inherit; }
.bubble .block { display: block; }
.hwimg { max-width: 100%; border-radius: 10px; display: block; }
.read-lines { margin: .4rem 0 0; padding-left: 1.6rem; font-family: var(--font-mono); font-weight: 500; font-size: .95rem; }
.read-lines li { margin: .2rem 0; }
.bubble.coach.k-read { border-left: 4px solid var(--primary); }
.modes { border: 0; padding: 0; margin: 0 0 1rem; }
label.radio { font-weight: 500; }
.card form { margin: 0 0 1rem; }
.card form.inline { display: inline-block; margin: 0 .5rem 1rem 0; }
.card form.inline button { padding: .6rem 1rem; font-size: 1rem; }

/* ---- Tafel-Erklärung (animiert, mit Ton) ---- */
.board-stage { min-height: 12rem; display: flex; flex-direction: column; gap: .4rem; padding: .4rem 0; }
.board-bar { max-width: 22rem; }
.board-bar rect { stroke: var(--text); stroke-width: 2.6; transition: fill .35s ease; }
.board-bar rect.frame { fill: none; stroke: var(--text); stroke-width: 2.6; }
.board-bar rect.on { fill: var(--primary); }
.board-bar rect.off { fill: var(--surface-2); }
.board-bar .cut { stroke: var(--accent, #e8590c); stroke-width: 1.4; stroke-dasharray: 36; }
.board-bar .cut.grow { stroke-dashoffset: 36; animation: board-grow .5s ease forwards; }
@keyframes board-grow { to { stroke-dashoffset: 0; } }
.board-line { text-align: left; overflow-x: auto; margin: .2rem 0; font-size: 1.15rem; }
.fade { animation: board-fade .6s ease both; }
@keyframes board-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.board-sub { background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; margin: .4rem 0; }
.board-step { margin: .4rem 0; }
.board-controls { display: flex; gap: .5rem; flex-wrap: wrap; }
.board-controls button { min-width: 3rem; font-size: 1.1rem; }
.board-controls button.primary { flex: 1; }
.board-options { display: flex; gap: 0 1.2rem; flex-wrap: wrap; margin-top: .8rem; }
/* Coach-Figur unten rechts (figure.js); Platz unten frei halten, damit sie nichts dauerhaft verdeckt */
.board-figure { position: fixed; right: 10px; bottom: 10px; width: 100px; z-index: 5; pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(11, 34, 64, .18)); }
.board-figure[hidden] { display: none; }
body.with-figure main { padding-bottom: 8.5rem; }
.figure-svg { display: block; width: 100%; height: auto; overflow: visible; }
.figure-arm { transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.figure-eyes { transform-origin: 60px 50px; transition: transform .08s; }
.figure-eyes.blink { transform: scaleY(.1); }
.figure-pupil { transition: transform .3s ease; }
.figure-brows { transition: transform .25s ease; }
.board-figure.pointing .figure-brows, .board-figure.talking .figure-brows { transform: translateY(-2.5px); }
.board-figure .figure-body { transform-origin: 60px 140px; animation: figure-breathe 4s ease-in-out infinite; }
.board-figure.talking .figure-head { animation: figure-nod 1.6s ease-in-out infinite; transform-origin: 60px 84px; }
@keyframes figure-breathe { 50% { transform: scale(1.015, .99); } }
@keyframes figure-nod { 30% { transform: rotate(-2deg); } 70% { transform: rotate(1.5deg); } }
.board-focus { outline: 3px solid var(--amber); outline-offset: 4px; border-radius: 8px; transition: outline-color .3s; }
/* breit: neben der Tafel statt in der Fensterecke, damit Blick und Zeigen zur Tafel gehören */
@media (min-width: 900px) {
  .board { position: relative; }
  .board-figure { position: absolute; width: 130px; right: -150px; bottom: 24px; }
  body.with-figure main { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .board-figure .figure-body, .board-figure.talking .figure-head { animation: none; }
  .figure-arm, .figure-pupil, .figure-brows { transition: none; }
}
.board-plot { display: block; width: 100%; max-width: 26rem; margin: .4rem 0; }
.board-plot .plot-bg { fill: var(--surface); }
.board-plot .plot-grid { stroke: var(--line); stroke-width: .6; }
.board-plot .plot-axis { stroke: var(--text); stroke-width: 1.2; }
.board-plot .plot-tick { fill: var(--muted, #5b6862); font-size: 9px; }
.board-plot .plot-curve { fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.board-plot .plot-curve.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: board-plot-draw 1.6s ease forwards; }
.board-plot .plot-point circle { fill: var(--accent, #e8590c); stroke: var(--surface); stroke-width: 1.5; }
.board-plot .plot-point text { fill: var(--text); font-size: 10px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
@keyframes board-plot-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .board-plot .plot-curve.draw { animation: none; stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .fade, .board-bar .cut.grow { animation: none; stroke-dashoffset: 0; } }

/* ---- Planvorschlag ---- */
.proposal-row p { margin: .2rem 0; }
.proposal-choice { display: flex; flex-wrap: wrap; gap: 0 1.2rem; margin-top: .4rem; }
.goal-pick { display: grid; gap: 0; margin: .4rem 0 .8rem; }
ul.misc { padding-left: 1.1rem; }
ul.misc li { margin: .4rem 0; }

/* ---- Coach: Warteanimation und Auswahl ---- */
.coach-wait { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; margin: .8rem 0;
  border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.coach-wait[hidden] { display: none; }
.coach-avatar { font-size: 1.9rem; line-height: 1; display: inline-block; animation: coach-bob 1.4s ease-in-out infinite; }
.coach-dots { display: inline-flex; gap: .22rem; margin-left: auto; }
.coach-dots i { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .25;
  animation: coach-dot 1.2s infinite; }
.coach-dots i:nth-child(2) { animation-delay: .2s; }
.coach-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes coach-bob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-4px) rotate(-6deg); }
  75% { transform: translateY(-2px) rotate(6deg); } }
@keyframes coach-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .coach-avatar, .coach-dots i { animation: none; } .coach-dots i { opacity: .7; } }
.coach-overlay { position: fixed; inset: auto 1rem 1rem 1rem; z-index: 50; box-shadow: var(--shadow); max-width: 36rem; margin: 0 auto; }
/* Figur aussuchen (figures.js zeichnet in [data-figure]; ohne JavaScript bleibt das Emoji) */
.avatar-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.avatar-opt input { position: absolute; opacity: 0; }
.avatar-opt > span { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem .2rem .3rem;
  border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.avatar-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.avatar-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.avatar-fig { display: block; width: 100%; max-width: 4.5rem; font-size: 2rem; text-align: center; line-height: 1.2; }
.avatar-name { font-size: .8rem; color: var(--muted); }
.avatar-opt input:checked + span .avatar-name { color: var(--text); font-weight: 600; }
.coach-preview { float: right; width: 6.5rem; margin: -.5rem 0 .2rem .8rem; font-size: 4rem; text-align: center; }
.coach-preview.hello .figure-svg { animation: coach-hello .7s ease; transform-origin: 50% 100%; }
@keyframes coach-hello { 30% { transform: translateY(-8px) rotate(-4deg); } 60% { transform: translateY(0) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .coach-preview.hello .figure-svg { animation: none; } }
.coach-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin: 0 0 1rem; }
.coach-form legend { font-weight: 700; padding: 0 .4rem; }
.coach-form label.choice { display: flex; gap: .6rem; align-items: flex-start; margin: .5rem 0; font-weight: 400; }
.coach-form label.choice input { width: 1.3rem; height: 1.3rem; margin: .15rem 0 0; flex: none; accent-color: var(--primary); }
.coach-form label.choice > span { flex: 1; }
.coach-form label.choice button { margin-left: .4rem; }
.avatar-opt { margin: 0; display: block; }
.coach-chip { display: inline-flex; align-items: center; gap: .35rem; }

/* ---- Rückfrage mit Antwortkarten ---- */
.ask-cards { display: grid; gap: .5rem; }
.ask-card { text-align: left; font-weight: 600; white-space: normal; padding: .7rem .9rem; line-height: 1.35; }
.ask-card small { display: block; font-weight: 400; margin-top: .25rem; }
.ask-chosen { margin-bottom: .3rem; }

/* Auswahlfelder mit langen Optionen nie breiter als der Platz (z. B. „Wer wählt den Zug?“ am Handy) */
select { max-width: 100%; }
form.inline label { white-space: normal; max-width: 100%; }

/* Freihand: Zeichenfläche und Bestätigung */
.hand { margin: .5rem 0; }
.hand-canvas canvas { display: block; max-width: 100%; border: 2px solid var(--line); border-radius: .5rem; background: #fff; touch-action: none; cursor: crosshair; }
.hand-bar { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
.hand-photo { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin: .5rem 0; }
.hand-line { display: grid; grid-template-columns: auto 1fr; gap: .2rem .6rem; align-items: center; margin: .5rem 0; }
.hand-line input[name="zeile"] { font: inherit; min-width: 0; padding: .5rem; }
.hand-line .hand-tex, .hand-line small { grid-column: 2; }
.hand-line.low input[name="zeile"] { border-color: var(--warn, #b45309); background: color-mix(in srgb, var(--warn, #b45309) 10%, transparent); }
.hand-final { font-size: .85rem; white-space: nowrap; }
.hand-result li.wrong { background: color-mix(in srgb, var(--warn, #b45309) 18%, transparent); border-radius: .3rem; padding: .1rem .4rem; }

/* Elternsicht „So lernt Ihr Kind“ */
.how-summary { padding-left: 1.2rem; }
.how-summary li { margin: .3rem 0; }
details.how { border-top: 1px solid var(--line); padding: .5rem 0; }
details.how summary { cursor: pointer; font-weight: 600; }
.how-row { display: grid; grid-template-columns: 7.5rem 1fr 6.5rem; gap: .5rem; align-items: center; margin: .3rem 0; font-size: .95rem; }
.how-bar { display: block; height: .7rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.how-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.how-stumble { background: var(--warn-soft); border-radius: 12px; padding: .5rem .8rem; margin: .5rem 0; }
.how-stumble p { margin: .2rem 0; }

/* Endgültig löschen (Schülerseite der Lehrkraft) */
.danger-zone { border: 2px solid var(--bad); background: var(--bad-soft); }
button.danger { background: var(--bad); color: var(--bg); border-color: var(--bad); }

/* Pilot: Einwilligung und Rückmeldungen in der App */
.pilot-text p { max-width: 65ch; }
.pilot-steps { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .9rem; margin: .4rem 0 .8rem; }
.pilot-steps dt { font-weight: 600; }
.pilot-steps dd { margin: 0; }
.pilot-check { display: flex; gap: .6rem; align-items: flex-start; margin: .6rem 0; font-weight: 400; }
.pilot-check input { width: 1.3rem; height: 1.3rem; flex: none; margin-top: .15rem; accent-color: var(--primary); }
.pilot-item { border: 0; padding: 0; margin: 0 0 1rem; }
.pilot-item legend { font-weight: 600; margin-bottom: .4rem; }
.pilot-scale { display: flex; gap: .4rem; flex-wrap: wrap; }
.pilot-scale label { margin: 0; }
.pilot-scale input { position: absolute; opacity: 0; }
.pilot-scale span { display: inline-flex; align-items: center; justify-content: center; min-width: 2.8rem; height: 2.8rem;
  border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 1.2rem; cursor: pointer; }
.pilot-scale input:checked + span { border-color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.pilot-scale input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.pilot-due .btn { margin-left: .4rem; }
.pilot-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: .6rem; }
.pilot-table td, .pilot-table th { white-space: nowrap; }
