/* =====================================================================
   Lernplattform – Gestaltung „Linienplan“
   Der Lernweg als Liniennetzplan: Fachbereich = farbige Linie (Kennung wie „N2“),
   Lerneinheit = Station, Thema = Umsteigepunkt, Klausur = eckige Station.
   Nur Variablen aus tokens.css; die Linienfarbe einer Seite kommt als --c.
   Aufbau: 1 Grundlagen · 2 Seitenrahmen · 3 Typografie · 4 Linienplan
           5 Formulare & Knöpfe · 6 Tabellen & Kennzahlen · 7 Lerneinheit
           8 Klausuren & Prüfungsmodus · 9 Labor · 10 Admin · 11 Hilfsklassen
   ===================================================================== */

/* ---------- 1 Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper) radial-gradient(var(--dot) 1.2px, transparent 1.3px) 0 0 / 22px 22px;
  color: var(--ink);
  font: var(--text-base) / var(--leading-body) var(--font-sans);
}
img { max-width: 100%; }
a { color: inherit; text-decoration-thickness: var(--line-thin); text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.skip-link { position: absolute; left: -9999px; top: var(--space-2); background: var(--surface); padding: var(--space-2) var(--space-3); border: var(--line-thin) solid var(--rule-strong); border-radius: var(--radius-1); z-index: 100; }
.skip-link:focus { left: var(--space-4); }

/* ---------- 2 Seitenrahmen ---------- */
.page, main.dashboard, main.module-page, main.auth-page, main.landing {
  max-width: var(--page-max); margin: 0 auto; padding-inline: var(--gutter);
}
main { display: block; padding-bottom: var(--space-8); }

/* Kopf: weiße Leiste mit Liniennetz-Marke und Reitern */
.masthead { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: var(--line-thin) solid var(--rule); }
.masthead-in { max-width: var(--page-max); margin: 0 auto; padding-inline: var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); font: 800 var(--text-md) / 1 var(--font-display); letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { flex: none; color: var(--ink); }
.mainnav { display: flex; gap: var(--space-5); flex: 1; align-self: stretch; }
.mainnav a { display: flex; align-items: center; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: var(--line-mark) solid transparent; padding-top: var(--line-mark); }
.mainnav a:hover { color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.masthead-tools { display: flex; align-items: center; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); color: var(--muted); }
.masthead-tools form { display: inline; }
.masthead .who { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.linkish:hover { color: var(--ink); text-decoration: underline; }
.theme-toggle { border: var(--line-thin) solid var(--rule); border-radius: var(--radius-pill); padding: 3px 12px; background: var(--paper-2); }
.theme-toggle:hover { text-decoration: none; background: var(--paper-3); }
.admin-nav { border-top: var(--line-thin) solid var(--rule); background: var(--paper-2); }
.admin-nav-in { max-width: var(--page-max); margin: 0 auto; padding: var(--space-2) var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); }
.admin-nav a { color: var(--muted); text-decoration: none; padding: 2px 0; }
.admin-nav a:hover { color: var(--ink); }
.admin-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.admin-nav .kicker { margin-right: var(--space-1); }

/* Brotkrümel */
.crumbs { margin: var(--space-5) 0 0; font-size: var(--text-sm); color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
.crumbs li + li::before { content: "—"; margin-right: var(--space-2); color: var(--rule); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }

/* Frühere Marginalspalte: jetzt eine Zeile über dem Inhalt */
.row { display: block; }
.margin { font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--space-2); }
.margin .num { font: 800 var(--text-md) / 1 var(--font-display); color: var(--accent); margin-right: var(--space-2); }
.section { padding: var(--space-6) 0; }
.section + .section { border-top: var(--line-thin) solid var(--rule); }

.site-foot { max-width: var(--page-max); margin: 0 auto; padding: var(--space-4) var(--gutter) var(--space-6); border-top: var(--line-thin) solid var(--rule); font-size: var(--text-sm); color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); }

/* Karten: nur, wo etwas als eigenes Objekt gelesen werden soll */
.karte { background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); }

/* ---------- 3 Typografie ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: var(--leading-tight); text-wrap: balance; margin: 0; hyphens: auto; overflow-wrap: break-word; }
h1 { font-weight: 800; font-size: var(--text-3xl); letter-spacing: var(--tracking-display); }
h2 { font-weight: 800; font-size: var(--text-xl); letter-spacing: -0.015em; }
h3 { font-weight: 700; font-size: var(--text-lg); letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-4); }
.lede { font-size: var(--text-md); line-height: 1.5; color: var(--muted); max-width: 62ch; }
.kicker, .mono { font: 500 var(--text-xs) / 1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }
.text-dim { color: var(--muted); }
.opening, .hero { padding: var(--space-6) 0 var(--space-5); }
.hero .kicker { display: block; margin-bottom: var(--space-2); }
.hero h1, .opening h1 { margin-bottom: var(--space-3); }
.section-title { font-size: var(--text-lg); margin: var(--space-6) 0 var(--space-3); }
.subsection-title { font-size: var(--text-md); margin: var(--space-5) 0 var(--space-3); }
.lead { color: var(--muted); }
.empty-state, .pending { color: var(--muted); }
.hint { color: var(--muted); font-size: var(--text-sm); max-width: var(--measure); }
.hint-list { margin: 0; padding-left: 1.2em; }
.sum { font: 500 var(--text-xs) var(--font-mono); letter-spacing: 0.04em; color: var(--muted); font-variant-numeric: tabular-nums; }
.desc { color: var(--muted); max-width: 62ch; }

/* ---------- 4 Linienplan ---------- */
/* Linienkennung */
.kennung { display: inline-grid; place-items: center; flex: none; min-width: 36px; height: 24px; padding: 0 7px; border-radius: var(--radius-1); background: var(--c); color: var(--on-line); font: 800 var(--text-sm) / 1 var(--font-display); letter-spacing: 0.01em; }
.kennung[data-farbe="gelb"] { color: var(--on-line-hell); }
.zeile { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

/* Übersicht: Weitermachen und Stand */
.oben { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--space-5); margin-bottom: var(--space-6); }
.weiter { padding: var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.weiter .zeile { font-weight: 700; font-size: var(--text-sm); }
.weiter h2 { font-size: var(--text-xl); line-height: 1.18; }
.weiter p { margin: 0; }
.weiter .btn { align-self: flex-start; }
.zahlen { padding: var(--space-5); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-4); align-content: space-between; }
.zahl { border-left: var(--line-mark) solid var(--c); padding-left: var(--space-3); min-width: 0; }
.zahl strong { display: block; font: 800 2.1rem / 1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.zahl span { color: var(--muted); font-size: var(--text-sm); }
.zahl.breit { grid-column: 1 / -1; }
.zahl.breit strong { font-size: var(--text-md); letter-spacing: 0; line-height: 1.35; font-weight: 700; }

/* Hauptkategorie mit ihren Linien */
.bereich { margin-top: var(--space-6); }
.bereich-kopf { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.bereich-kopf h2 { font-size: var(--text-lg); }
.bereich-kopf h2 a { text-decoration: none; }
.bereich-kopf h2 a:hover { text-decoration: underline; color: var(--ink); }
.linien { padding: var(--space-1) 0; }
.linien .leer { padding: var(--space-4) var(--space-5); margin: 0; color: var(--ink); }
.linie { display: grid; grid-template-columns: minmax(0, 290px) minmax(0, 1fr) 72px; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-top: var(--line-thin) solid var(--rule); }
.linie:first-child { border-top: 0; }
.linie-name { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; min-width: 0; }
.linie-name strong { display: block; font-weight: 700; line-height: 1.3; }
.linie-name small { display: block; color: var(--muted); font-size: var(--text-sm); }
.linie-name:hover strong { text-decoration: underline; }
.stand { font: 500 var(--text-sm) var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Waagerechte Strecke mit Haltestellen */
.strecke { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 26px; min-width: 0; }
.strecke::before { content: ""; position: absolute; inset-inline: 0; height: var(--track); border-radius: 3px; background: var(--rule); }
.strecke .fahrt { position: absolute; left: 0; height: var(--track); border-radius: 3px; background: var(--c); }
.halt { position: relative; display: block; flex: none; width: var(--stop); height: var(--stop); border-radius: 50%; background: var(--surface); border: 3px solid var(--rule); transition: transform var(--dur-fast) var(--ease); }
.halt.erledigt { background: var(--c); border-color: var(--c); }
.halt.aktuell { width: var(--stop-here); height: var(--stop-here); border-color: var(--c); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent); }
.halt.klausur { border-radius: 4px; }
a.halt:hover { transform: scale(1.25); }
.legende { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--text-sm); color: var(--muted); margin: var(--space-3) 0 var(--space-4); }
.legende span { display: inline-flex; align-items: center; gap: var(--space-2); }
.legende i { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 3px solid var(--ink); }
.legende i.voll { background: var(--ink); }
.legende i.eckig { border-radius: 3px; }
.legende i.hier { box-shadow: 0 0 0 4px var(--paper-3); }

/* Fachbereich- und Themenseite: Kopf mit Ring */
.fach-kopf { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-5); align-items: end; padding: var(--space-5) 0 var(--space-5); }
.fach-kopf h1 { margin: var(--space-3) 0 var(--space-2); font-size: var(--text-3xl); }
.fach-kopf .lede { margin: 0; }
.ring { width: 104px; height: 104px; }
.ring text { font: 600 15px var(--font-mono); fill: var(--ink); }

/* Senkrechter Linienplan */
.plan { padding: var(--space-3) 0 var(--space-4); }
.plan .leer { margin: 0 var(--space-5) var(--space-3) 64px; color: var(--muted); }
.abschnitt, .halte { display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.schiene { position: relative; }
.schiene::before { content: ""; position: absolute; left: 29px; top: 0; bottom: 0; width: var(--track); background: var(--seg, var(--rule)); }
.plan > :first-child .schiene::before { top: 50%; }
.umstieg { position: relative; display: block; margin: 12px 0 12px 18px; width: 28px; height: 16px; border-radius: 8px; background: var(--surface); border: 3px solid var(--ink); z-index: 1; }
.abschnitt { align-items: center; }
.abschnitt h2 { font: 500 var(--text-xs) / 1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); padding: var(--space-3) var(--space-5) var(--space-3) 0; }
.abschnitt h2 a { color: var(--ink); text-decoration: none; }
.abschnitt h2 a:hover { text-decoration: underline; }
.halte-liste { list-style: none; margin: 0; padding: 0; }
.halte .halt { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); z-index: 1; }
.halte .inhalt { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4) var(--space-3) var(--space-2); margin-right: var(--space-3); border-radius: var(--radius-1); text-decoration: none; min-width: 0; }
.halte .inhalt:hover { background: var(--paper-2); color: var(--ink); }
.halte .inhalt:hover strong { text-decoration: underline; }
.halte .titel { min-width: 0; order: 1; }
.halte .marken { order: 2; }
.halte .n { display: block; font: 500 var(--text-xs) / 1.4 var(--font-mono); color: var(--muted); letter-spacing: 0.04em; }
.fach-kopf .sum { display: block; margin-top: var(--space-3); }
.zahl .progress { margin-top: var(--space-3); max-width: none; }
.halte strong { display: block; font-weight: 600; }
.halte small { display: block; color: var(--muted); font-size: var(--text-sm); margin-top: 2px; max-width: 62ch; }
.marken { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); flex: none; }
.marken .p { font: 500 var(--text-xs) var(--font-mono); color: var(--muted); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-pill); padding: 2px 10px; white-space: nowrap; }
.halte.done .marken .p { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tag { font: 500 var(--text-xs) var(--font-mono); letter-spacing: 0.04em; color: var(--ink); border: var(--line-thin) solid var(--c, var(--rule)); border-radius: var(--radius-pill); padding: 2px 10px; }

/* Hauptkategorie-Seite: eine Karte je Linie */
.linien-karten { display: grid; gap: var(--space-4); }
.linie-karte { padding: var(--space-5); display: grid; gap: var(--space-3); }
.linie-karte-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.linie-karte-kopf h2 { font-size: var(--text-lg); }
.linie-karte-kopf h2 a { text-decoration: none; }
.linie-karte-kopf h2 a:hover { text-decoration: underline; color: var(--ink); }
.linie-karte .desc { margin: 0; }
.umstiege { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.umstiege li { display: inline-flex; align-items: center; gap: var(--space-2); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-pill); padding: 4px 6px 4px 12px; font-size: var(--text-sm); }
.umstiege a { text-decoration: none; font-weight: 600; }
.umstiege a:hover { text-decoration: underline; }
.umstiege .p { font: 500 var(--text-xs) var(--font-mono); color: var(--muted); background: var(--paper-2); border-radius: var(--radius-pill); padding: 1px 8px; }
.umstiege li.done .p { color: var(--ok); background: var(--ok-soft); }

/* Frühere Verzeichnisse (Kategorieseiten, Startseite für Gäste) */
.part { padding: var(--space-5); margin-bottom: var(--space-4); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); }
.part-num { font: 800 var(--text-xl) / 1 var(--font-display); color: var(--accent); }
.part-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); margin: var(--space-1) 0 var(--space-2); }
.part-head h2 { font-size: var(--text-lg); }
.part-head h2 a { text-decoration: none; }
.part-head h2 a:hover { text-decoration: underline; }
.part-head .n { font: 500 var(--text-md) var(--font-mono); color: var(--accent); }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { display: flex; align-items: baseline; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: var(--line-thin) solid var(--rule); }
.toc li:last-child { border-bottom: 0; }
.toc .n { font: 500 var(--text-sm) var(--font-mono); color: var(--accent); min-width: 2.8em; }
.toc a, .toc .t { font-weight: 600; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .dots { flex: 1; min-width: var(--space-5); }
.toc .p { font: 500 var(--text-sm) var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.toc .done .p, .toc .check { color: var(--ok); }
.toc li.locked .t { color: var(--muted); }
.units li { flex-wrap: wrap; }
.units .d { flex-basis: 100%; margin: 0 0 0 calc(2.8em + var(--space-3)); font-size: var(--text-sm); color: var(--muted); max-width: 60ch; }
.units .tag { color: var(--muted); }
@media (max-width: 560px) {
  .toc li { flex-wrap: wrap; }
  .toc .p { margin-left: auto; }
  .units .d { margin-left: 0; }
}

.progress { height: var(--bar-height); background: var(--rule); border-radius: 3px; max-width: 36em; margin: var(--space-4) 0 0; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 3px; transition: width var(--dur) var(--ease); }
.progress-line { display: flex; align-items: center; gap: var(--space-3); font: 500 var(--text-sm) var(--font-mono); color: var(--muted); max-width: 44em; margin-top: var(--space-4); }
.progress-line .progress { flex: 1; margin: 0; }

/* „Weitermachen bei …“ (ältere Seiten) */
.resume { margin-top: var(--space-5); padding: var(--space-4) var(--space-5); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3) var(--space-5); }
.resume strong { font-weight: 700; font-size: var(--text-md); }
.go { font-weight: 700; }
a.go:not(.btn) { color: var(--accent); text-underline-offset: 0.25em; }

/* Hinweis- und Merkkästen */
.note { background: var(--paper-2); border-left: var(--line-mark) solid var(--c, var(--accent)); border-radius: 0 var(--radius-1) var(--radius-1) 0; padding: var(--space-4) var(--space-5); margin: var(--space-5) 0; max-width: var(--measure); }
.note p:last-child { margin-bottom: 0; }
.note strong { font-size: var(--text-md); }

/* Schritte „Lernen → Üben → Klausur“ */
.steps { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.steps li { padding: var(--space-4) var(--space-5); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); }
.steps .n { display: inline-grid; place-items: center; min-width: 32px; height: 24px; padding: 0 6px; border-radius: var(--radius-1); background: var(--ink); color: var(--paper); font: 800 var(--text-sm) / 1 var(--font-display); margin-bottom: var(--space-3); }
.steps li:nth-child(1) .n { background: var(--l-blau); color: var(--on-line); }
.steps li:nth-child(2) .n { background: var(--l-gruen); color: var(--on-line); }
.steps li:nth-child(3) .n { background: var(--l-violett); color: var(--on-line); }
.steps h3 { font-size: var(--text-md); margin-bottom: var(--space-1); }
.steps p { color: var(--muted); font-size: var(--text-sm); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- 5 Formulare & Knöpfe ---------- */
label { display: block; font-weight: 600; margin: var(--space-4) 0 var(--space-1); }
.field-hint { display: block; font-size: var(--text-sm); color: var(--muted); margin: 0 0 var(--space-2); max-width: 44em; }
input[type=text], input[type=password], input[type=search], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; max-width: 32em; font: inherit; color: var(--ink); background: var(--surface);
  border: var(--line-thin) solid var(--rule); border-radius: var(--radius-1); padding: var(--space-2) var(--space-3); min-height: var(--touch);
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; border-color: var(--focus); }
textarea { max-width: 100%; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 16em)); gap: 0 var(--space-4); }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: 700 var(--text-base) var(--font-sans); line-height: 1.2; text-decoration: none; cursor: pointer;
  border: var(--line-thin) solid var(--rule); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); padding: var(--space-2) var(--space-5); min-height: var(--touch);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--paper-2); color: var(--ink); border-color: var(--muted); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); opacity: 0.86; }
.btn-secondary { background: var(--surface); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-danger { border-color: var(--bad); color: var(--bad); background: var(--surface); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.btn-small { font-size: var(--text-sm); min-height: var(--touch-small); padding: var(--space-1) var(--space-4); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.inline-form { display: inline; }
.error { background: var(--bad-soft); color: var(--bad); border-left: var(--line-mark) solid var(--bad); border-radius: 0 var(--radius-1) var(--radius-1) 0; padding: var(--space-3) var(--space-4); max-width: 36em; }

/* Anmelden / Registrieren */
main.auth-page { padding-top: var(--space-6); }
.auth-card { max-width: 34em; background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); padding: var(--space-6) var(--space-6) var(--space-5); box-shadow: var(--shadow); }
.auth-card h1 { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
.auth-card .btn-primary { margin-top: var(--space-5); }
.switch-link { margin-top: var(--space-4); color: var(--muted); }
@media (max-width: 560px) { .auth-card { padding: var(--space-5) var(--space-4); } }

/* ---------- 6 Tabellen & Kennzahlen ---------- */
.table-scroll { overflow-x: auto; margin-bottom: var(--space-5); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); }
.table-scroll > table { margin: 0; }
table, .admin-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.admin-table th, table th { font: 500 var(--text-xs) var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); text-align: left; padding: var(--space-3) var(--space-4); border-bottom: var(--line-thin) solid var(--rule); vertical-align: bottom; }
.admin-table td, table td { padding: var(--space-3) var(--space-4); border-bottom: var(--line-thin) solid var(--rule); vertical-align: baseline; }
.admin-table tbody tr:last-child td, table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: var(--paper-2); }
td.num, .num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .inline-form { margin-left: var(--space-2); }
.nowrap { white-space: nowrap; }
.link-cell a { font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.stat-tile { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); }
.stat-label { font: 500 var(--text-xs) var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }
.stat-value { font: 800 var(--text-xl) var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value.small { font-size: var(--text-md); }
.stat-sub { font-size: var(--text-sm); color: var(--muted); }

.progress-bar { height: var(--bar-height); background: var(--rule); border-radius: 3px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--c, var(--accent)); }
.progress-bar.small { max-width: 220px; margin-bottom: var(--space-1); }

/* Noten- und Statusmarken */
.result-grade, .badge, .exam-badge, .hidden-badge, .status {
  display: inline-block; font: 500 var(--text-xs) var(--font-mono); letter-spacing: 0.02em;
  padding: 2px 10px; border: var(--line-thin) solid currentColor; border-radius: var(--radius-pill); white-space: nowrap;
}
.grade-1, .grade-2, .badge.ok, .status.ok { color: var(--ok); }
.grade-3, .grade-4 { color: var(--warn); }
.grade-5, .grade-6, .badge.bad, .status.bad, .exam-badge.warn { color: var(--bad); }
.badge.open, .status.open { color: var(--muted); }
.badge.done { color: var(--accent); }
.badge.run { color: var(--warn); }
.badge.wait { color: var(--accent); }
.badge.ok { background: var(--ok-soft); border-color: transparent; }
.exam-badge { color: var(--accent); }
.hidden-badge { color: var(--warn); }

/* ---------- 7 Lerneinheit ---------- */
.unit-head { padding: var(--space-5) 0 var(--space-4); }
.unit-head h1 { font-size: var(--text-2xl); margin: var(--space-3) 0 var(--space-3); max-width: 30ch; }
.unit-head .module-desc { color: var(--muted); max-width: 62ch; font-size: var(--text-md); }
.category-tag { font: 500 var(--text-xs) var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.module-content { max-width: var(--measure); font-size: var(--text-base); padding: var(--space-4) 0; }
.module-content h1, .module-content h2 { font-size: var(--text-xl); margin: var(--space-6) 0 var(--space-3); }
.module-content h3 { font-size: var(--text-lg); margin: var(--space-5) 0 var(--space-2); }
.module-content h4 { font-size: var(--text-md); margin: var(--space-4) 0 var(--space-2); }
.module-content ul, .module-content ol { padding-left: 1.3em; margin: 0 0 var(--space-4); }
.module-content li { margin-bottom: var(--space-1); }
.module-content blockquote { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-left: var(--line-mark) solid var(--c, var(--accent)); background: var(--paper-2); border-radius: 0 var(--radius-1) var(--radius-1) 0; }
.module-content code { font: 0.9em var(--font-mono); background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }
.module-content pre { font: var(--text-sm) / 1.55 var(--font-mono); background: var(--paper-2); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-1); padding: var(--space-3) var(--space-4); overflow-x: auto; max-width: 100%; }
.module-content pre code { background: none; padding: 0; }
.module-content table { display: block; overflow-x: auto; margin: var(--space-4) 0; }
.module-content hr { border: 0; border-top: var(--line-thin) solid var(--rule); margin: var(--space-6) 0; }
.module-content details { border-top: var(--line-thin) solid var(--rule); border-bottom: var(--line-thin) solid var(--rule); padding: var(--space-3) 0; margin: var(--space-4) 0; }
.module-content details > summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.module-content details.karte { background: var(--paper-2); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-1); padding: var(--space-3) var(--space-4); margin: var(--space-2) 0; }
.module-content details.karte > summary { color: var(--ink); }
.module-content details.karte > summary::after { content: " ↻"; color: var(--accent); }
.module-content .karteikarten { display: grid; gap: var(--space-2); }

/* Lernfenster (eingebettete Einheit) mit Vollbild */
.embed-wrap { position: relative; border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); overflow: hidden; margin: var(--space-4) 0 var(--space-5); background: var(--surface); box-shadow: var(--shadow); }
.embed-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-4); border-bottom: var(--line-thin) solid var(--rule); font-size: var(--text-sm); color: var(--muted); background: var(--paper-2); }
.embed-toolbar strong { color: var(--ink); font-weight: 600; }
.embed-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.embed-wrap iframe { display: block; width: 100%; height: min(85vh, 1100px); min-height: 520px; border: 0; background: var(--embed-bg); }
.embed-wrap:fullscreen { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; margin: 0; background: var(--paper); }
.embed-wrap:fullscreen iframe { flex: 1; height: auto; min-height: 0; }
.embed-wrap.is-max { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; margin: 0; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--paper); }
.embed-wrap.is-max iframe { flex: 1; height: auto; min-height: 0; }
/* Vollbild ohne Leiste: nur ein kleiner Reiter oben in der Mitte bleibt stehen */
.embed-wrap.bar-hidden .embed-toolbar { display: none; }
.embed-bar-show {
  position: absolute; z-index: 5; left: 50%; transform: translateX(-50%);
  top: env(safe-area-inset-top, 0px);
  min-height: var(--touch-small); padding: var(--space-1) var(--space-3);
  font: 500 var(--text-xs) var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--ink); background: var(--surface);
  border: var(--line-thin) solid var(--rule); border-top: 0; border-radius: 0 0 var(--radius-1) var(--radius-1);
  cursor: pointer;
}
.embed-bar-show:hover { color: var(--accent); }
body.embed-max-open { overflow: hidden; }

.materials { margin: var(--space-5) 0; padding: var(--space-4) var(--space-5); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); max-width: var(--measure); }
.materials h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.materials ul { list-style: none; margin: 0; padding: 0; }
.materials li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: var(--line-thin) solid var(--rule); }
.materials li:last-child { border-bottom: 0; }

/* Verständnisquiz */
.quiz { margin: var(--space-6) 0; padding: var(--space-5); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); max-width: var(--measure); }
.quiz h2 { margin-bottom: var(--space-3); }
.quiz-question { padding: var(--space-4) 0; border-bottom: var(--line-thin) solid var(--rule); }
.quiz-question > p { font-weight: 600; font-size: var(--text-md); margin-bottom: var(--space-2); }
.quiz-option { display: flex; gap: var(--space-3); align-items: flex-start; font-weight: 400; margin: var(--space-1) 0; padding: var(--space-2) var(--space-3); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-1); cursor: pointer; }
.quiz-option:hover { background: var(--paper-2); border-color: var(--muted); }
.quiz-option input { margin-top: 0.3em; accent-color: var(--c, var(--accent)); width: var(--check-size); height: var(--check-size); }
.quiz-feedback { margin-left: var(--space-2); font-weight: 700; }
.quiz-feedback.ok { color: var(--ok); }
.quiz-feedback.fail { color: var(--bad); }
#quiz-submit { margin-top: var(--space-4); }
#quiz-result { margin-top: var(--space-3); font-weight: 700; }

/* Vor/Zurück als Nachbarstationen, dazwischen „erledigt“ */
.unit-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-4); align-items: stretch; margin-top: var(--space-6); }
.unit-foot .prev, .unit-foot .next { text-decoration: none; display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); min-width: 0; }
.unit-foot .prev:hover, .unit-foot .next:hover { border-color: var(--c, var(--ink)); color: var(--ink); }
.unit-foot .next { text-align: right; }
.unit-foot .prev span, .unit-foot .next span { font-weight: 600; color: var(--ink); }
.complete-bar { display: flex; align-items: center; justify-content: center; text-align: center; }
.completed-msg { color: var(--ok); background: var(--ok-soft); border-radius: var(--radius-pill); padding: var(--space-2) var(--space-4); font-weight: 700; margin: 0; }
@media (max-width: 760px) {
  .unit-foot { grid-template-columns: minmax(0, 1fr); }
  .unit-foot .next { text-align: left; }
  .complete-bar { justify-content: flex-start; order: -1; }
}

/* ---------- 8 Klausuren & Prüfungsmodus ---------- */
.exams { padding: var(--space-2) var(--space-5); margin: 0 0 var(--space-4); }
.exams h2 { font-size: var(--text-lg); margin: var(--space-3) 0; }
.exam-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4); padding: var(--space-3) 0; border-top: var(--line-thin) solid var(--rule); }
.exams .exam-row:first-child, .exams h2 + .exam-row { border-top: 0; }
.exam-row .t { font-weight: 600; text-decoration: none; }
.exam-row a.t:hover { text-decoration: underline; }
.exam-row .meta { font-size: var(--text-sm); color: var(--muted); grid-column: 1; }
.exam-row .badge { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
/* Klausur als Station im senkrechten Plan */
.halte.exam-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); padding: 0; border: 0; gap: 0; }
.halte.exam-row .badge { grid-row: auto; grid-column: auto; }
.halte.exam-row .inhalt { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "titel marken" "meta marken" "hid marken"; gap: 2px var(--space-4); }
.halte.exam-row .titel { grid-area: titel; }
.halte.exam-row .meta { grid-area: meta; display: block; color: var(--muted); font-size: var(--text-sm); }
.halte.exam-row .marken { grid-area: marken; align-self: center; }
.halte.exam-row .hidden-badge { grid-area: hid; justify-self: start; margin-top: var(--space-1); }
@media (max-width: 860px) {
  .halte.exam-row .inhalt { grid-template-columns: minmax(0, 1fr); grid-template-areas: "titel" "meta" "marken" "hid"; }
  .halte.exam-row .marken { justify-content: flex-start; }
}

.release-banner, .exam-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  border-left: var(--line-mark) solid var(--warn); background: var(--warn-soft); border-radius: 0 var(--radius-1) var(--radius-1) 0; padding: var(--space-3) var(--space-4); margin: var(--space-4) 0;
}
.release-banner.is-released { border-left-color: var(--ok); background: var(--ok-soft); }
.exam-banner { border-left-color: var(--bad); background: var(--bad-soft); display: block; }
.exam-banner.admin { border-left-color: var(--accent); background: var(--accent-soft); }
.exam-note { color: var(--muted); font-style: italic; }
body.exam-mode { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.exam-watermark { position: fixed; inset: -50%; display: flex; flex-wrap: wrap; gap: 60px 90px; align-content: flex-start; transform: rotate(-24deg); pointer-events: none; z-index: 50; opacity: 0.07; font: 700 var(--text-sm) var(--font-mono); color: var(--ink); }
.exam-cover { display: none; position: fixed; inset: 0; z-index: 200; background: var(--paper); align-items: center; justify-content: center; text-align: center; padding: var(--space-5); }
.exam-cover strong { font: 800 var(--text-xl) var(--font-display); color: var(--bad); }
.exam-cover p { color: var(--muted); max-width: 420px; }
body.exam-verdeckt .exam-cover { display: flex; }
body.exam-verdeckt main { filter: blur(16px); }
/* Im Vollbild nur unscharf, nicht unsichtbar: Ein unsichtbares iframe verliert den Tastaturfokus – danach kämen
   Eingaben in der Konsole nicht mehr an. */
body.exam-verdeckt .embed-wrap:fullscreen iframe { filter: blur(16px); }

/* ---------- 9 Labor (echte Konsole) ---------- */
.lab-wrap { background: var(--surface); }
.lab-term { height: min(65vh, 720px); min-height: 360px; background: var(--terminal-bg); padding: var(--space-1) var(--space-2); }
.embed-wrap:fullscreen .lab-term, .embed-wrap.is-max .lab-term { flex: 1; height: auto; min-height: 0; }
.lab-state { margin-left: var(--space-2); font: 500 var(--text-xs) var(--font-mono); padding: 1px var(--space-2); border: var(--line-thin) solid currentColor; border-radius: var(--radius-pill); color: var(--muted); }
.lab-state.ok { color: var(--ok); } .lab-state.bad { color: var(--bad); } .lab-state.busy { color: var(--warn); }
.lab-confirm { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); background: var(--bad-soft); border-bottom: var(--line-thin) solid var(--rule); }
.lab-keys { color: var(--muted); font-size: var(--text-sm); margin: 0 0 var(--space-5); }
.lab-keys kbd, .lab-keys code { font: var(--text-xs) var(--font-mono); background: var(--paper-2); border: var(--line-thin) solid var(--rule); border-radius: 4px; padding: 0 5px; }
.lab-tasks { padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); }
.lab-tasks-head { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: baseline; justify-content: space-between; }
.lab-task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 var(--space-5); margin-top: var(--space-3); }
.lab-task { padding: var(--space-3) 0; border-top: var(--line-thin) solid var(--rule); }
.lab-task h3 { font-size: var(--text-md); margin-bottom: var(--space-2); }
.lab-task ol { margin: 0 0 var(--space-2); padding-left: 1.2em; color: var(--muted); font-size: var(--text-sm); }
.lab-goals { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: var(--text-sm); }
.lab-goals li { display: flex; gap: var(--space-2); align-items: flex-start; }
.lab-goals .ic { flex: none; width: 1.4em; height: 1.4em; display: inline-grid; place-items: center; font-weight: 700; font-size: var(--text-xs); border: var(--line-thin) solid var(--rule); border-radius: 50%; color: var(--muted); }
.lab-goals li.yes .ic { color: var(--ok); border-color: var(--ok); }
.lab-goals li.no .ic { color: var(--bad); border-color: var(--bad); }

/* ---------- 10 Admin ---------- */
.dashboard-header, .report-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-6) 0 var(--space-4); }
.dashboard-header h1, .report-head h1 { font-size: var(--text-2xl); }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
main.dashboard.wide { max-width: var(--page-max); }
.back-link { display: inline-block; margin-top: var(--space-5); font-size: var(--text-sm); color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); text-decoration: underline; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin: var(--space-3) 0 var(--space-5); padding: var(--space-4) var(--space-5); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); }
.filter-bar label { margin: 0 0 var(--space-1); font-size: var(--text-sm); }
.filter-bar select { min-width: 12em; }
.result-card { background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-1); margin-bottom: var(--space-2); padding: 0 var(--space-4); }
.result-card summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); padding: var(--space-3) 0; cursor: pointer; list-style-position: outside; }
.result-user { font-weight: 700; }
.result-module { font-weight: 500; flex: 1 1 18em; }
.result-score, .result-date { font: var(--text-sm) var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.result-breakdown { padding: 0 0 var(--space-4) var(--space-4); }
.breakdown-item { padding: var(--space-2) 0 var(--space-2) var(--space-3); border-left: var(--line-mark) solid var(--rule); margin: var(--space-2) 0; }
.breakdown-item.ok { border-left-color: var(--ok); }
.breakdown-item.fail { border-left-color: var(--bad); }
.breakdown-q { font-weight: 600; margin: 0 0 var(--space-1); }
.breakdown-answer, .breakdown-correct { font-size: var(--text-sm); margin: 0; color: var(--muted); }
.error-group { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-1); }
.error-group-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); font-weight: 700; padding-bottom: var(--space-1); border-bottom: var(--line-thin) solid var(--rule); }
.user-chip { color: var(--ink); }
.name-missing { color: var(--warn); font-style: italic; }

/* Dialoge für Admin-Formulare */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 300; background: var(--overlay); padding: var(--space-4); align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-card { background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); padding: var(--space-5); width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal-card h2 { margin-bottom: var(--space-3); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); }

/* Admin Klausur: Wertung umstellen */
.wertung-box { margin: var(--space-5) 0; padding: var(--space-4) var(--space-5); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); }
.wertung-form { display: grid; gap: var(--space-2); max-width: 36em; margin-bottom: var(--space-3); }
.wertung-form label { margin: 0; }
.wertung-form label.check { font-weight: 400; }
.wertung-form .btn { justify-self: start; }

/* Testkopie: dauerhaft sichtbarer Hinweis über dem Kopf */
.instance-banner { background: var(--warn-soft); color: var(--warn); border-bottom: var(--line-thin) solid var(--rule); padding: var(--space-2) var(--space-4); font-size: var(--text-sm); text-align: center; }

/* Admin: Einheiten planen und hochladen */
.einheiten-steps { margin-bottom: var(--space-6); }
.einheiten-block { margin: var(--space-6) 0; padding-top: var(--space-4); border-top: var(--line-thin) solid var(--rule); }
.einheiten-block h2 .kicker { display: block; margin-bottom: var(--space-1); }
.baukasten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.baukasten textarea, .baukasten select { max-width: 100%; }
.baukasten select { margin-bottom: var(--space-2); }
.baukasten-aktionen { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.baukasten-vorschau { position: sticky; top: 80px; }
.vorschau-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-2); }
#prompt-vorschau { max-height: 70vh; overflow: auto; margin: 0; padding: var(--space-4); background: var(--paper-2); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-1); font: var(--text-sm) / 1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
label.check { font-weight: 400; }
label.check input { margin-right: var(--space-2); }
label.check .text-dim { display: block; margin-left: calc(var(--space-2) + 1.1em); font-size: var(--text-sm); }
.code-area { font: var(--text-sm) / 1.5 var(--font-mono); }
.einheiten-page summary { cursor: pointer; }
.einheiten-page summary .inline-h { display: inline; }
.einheit-details td { padding-top: 0; }
.einheit-edit { display: grid; gap: var(--space-4); padding: var(--space-2) 0 var(--space-4); }
@media (max-width: 900px) {
  .baukasten { grid-template-columns: minmax(0, 1fr); }
  .baukasten-vorschau { position: static; }
}

/* Automatisches Speichern der Kursseiten (Status über dem Lernfenster, Übersicht für die Lehrkraft) */
.lernstand-status { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ok); font-weight: 600; }
.lernstand-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lernstand-status.is-error { color: var(--ink); background: var(--warn-soft); border-left: var(--line-mark) solid var(--warn); border-radius: 0 4px 4px 0; padding: 0 var(--space-2); font-weight: 400; }
.lernstand-status.is-error::before { display: none; }
.lernstand-info { border-left: var(--line-mark) solid var(--rule); background: var(--paper-2); border-radius: 0 var(--radius-1) var(--radius-1) 0; padding: var(--space-2) var(--space-4); margin: var(--space-3) 0 var(--space-4); font-size: var(--text-sm); }
.lernstand-info summary { cursor: pointer; }
.lernstand-info p { margin: var(--space-2) 0 0; }

/* ---------- 11 Hilfsklassen ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: var(--space-4); }
.flex-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-3); }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 860px) {
  :root { --gutter: var(--space-4); }
  .masthead-in { gap: var(--space-2) var(--space-4); padding-block: var(--space-2); }
  .mainnav { order: 3; flex-basis: 100%; gap: var(--space-5); }
  .mainnav a { padding-block: var(--space-2); }
  .masthead-tools { margin-left: auto; }
  .oben { grid-template-columns: minmax(0, 1fr); }
  .linie { grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-4); }
  .linie .strecke, .linie > .text-dim { grid-column: 1 / -1; grid-row: 2; }
  .fach-kopf { grid-template-columns: minmax(0, 1fr); }
  .ring { width: 84px; height: 84px; }
  .halte .inhalt { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .marken { justify-content: flex-start; }
}

@media print {
  .no-print, .masthead, .site-foot, .crumbs, .unit-foot { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Admin: Klausuren und Noten – Freigabe-Karten und Ergebnisgruppen */
.freigabe-liste { margin-bottom: var(--space-5); }
.freigabe-karte { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-3); }
.freigabe-karte > div { display: flex; flex-direction: column; flex: 1 1 18em; min-width: 0; }
.freigabe-karte a.t { text-decoration: none; }
.freigabe-karte a.t:hover { text-decoration: underline; }
.klausur-gesamt { display: block; margin: 0 0 var(--space-3); }
.klausur-gruppe { margin-top: var(--space-5); }
.klausur-gruppe .bereich-kopf h3 { font-size: var(--text-md); }
.filter-bar > div { display: flex; flex-direction: column; }
.filter-bar select { min-width: 10em; }
/* Impressum und Datenschutzerklärung */
.rechtstext-karte { padding: var(--space-5) var(--space-6) var(--space-6); max-width: 52em; }
.rechtstext-karte h2 { font-size: var(--text-lg); margin: var(--space-6) 0 var(--space-2); }
.rechtstext-karte h2:first-child, .rechtstext-karte .note + h2 { margin-top: var(--space-5); }
.rechtstext-karte p, .rechtstext-karte li { max-width: 72ch; }
.rechtstext-karte ul { padding-left: 1.3em; }
.rechtstext-karte .note { margin-top: 0; }
.rechtstext-karte .note ul { margin: var(--space-2) 0 0; }
.rechtstext mark.ph { background: var(--warn-soft); color: var(--ink); border: 1px dashed var(--warn); border-radius: 4px; padding: 0 4px; }
.rechtstext .stand { display: block; margin-top: var(--space-6); }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--ink); }
@media (max-width: 560px) { .rechtstext-karte { padding: var(--space-4); } }

/* Anwesenheit: Leiste unter der Kopfzeile für Lernende (views/partials/anwesenheit.ejs) */
.anw { background: var(--surface); border-bottom: var(--line-thin) solid var(--rule); }
.anw-in { max-width: var(--page-max); margin: 0 auto; padding: var(--space-2) var(--gutter); }
.anw-offen, .anw-laeuft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-5); }
.anw p, .anw form { margin: 0; }
.anw p { max-width: 62em; }
.anw-laeuft { font-size: var(--text-sm); color: var(--muted); }
.anw-laeuft strong { color: var(--ok); }
.anw-punkt { display: inline-block; width: 10px; height: 10px; margin-right: var(--space-2); border-radius: 50%; background: var(--ok); }
/* noch nicht gemeldet oder automatisch beendet: deutlich hervorgehoben */
.anw[data-art="neu"], .anw[data-art="automatisch"] { background: var(--warn-soft); border-bottom: var(--line-mark) solid var(--warn); }
.anw[data-art="neu"] .anw-in, .anw[data-art="automatisch"] .anw-in { padding-block: var(--space-4); }
.anw[data-art="neu"] #anw-titel, .anw[data-art="automatisch"] #anw-titel { display: block; font-size: var(--text-md); }
.anw[data-art="neu"] .btn, .anw[data-art="automatisch"] .btn { font-size: var(--text-md); padding-inline: var(--space-5); }
.anw-stern { color: var(--warn); font-weight: 700; text-decoration: none; cursor: help; margin-left: 2px; }

/* Passwort vergessen (views/passwort-status.ejs, Kasten in views/admin/users.ejs) */
.pw-code { font: 700 2.6rem/1.1 var(--font-mono); letter-spacing: 0.3em; margin: var(--space-4) 0; padding: var(--space-4) var(--space-5); text-align: center; background: var(--paper-2); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); font-variant-numeric: tabular-nums; }
.pw-code.klein { display: inline-block; font-size: var(--text-lg); letter-spacing: 0.2em; margin: 0; padding: 2px var(--space-3); }
.pw-frist { background: var(--warn-soft); color: var(--warn); border-left: var(--line-mark) solid var(--warn); border-radius: 0 var(--radius-1) var(--radius-1) 0; padding: var(--space-3) var(--space-4); }
.pw-anfragen { margin: var(--space-5) 0; padding: var(--space-4) var(--space-5); background: var(--warn-soft); border: var(--line-thin) solid var(--rule); border-left: var(--line-mark) solid var(--warn); border-radius: var(--radius-2); }
.pw-anfragen h2 { font-size: var(--text-lg); margin: 0 0 var(--space-2); }
.pw-anfragen p { max-width: var(--measure); }
.pw-anfragen .table-scroll { margin-bottom: 0; }
.nav-zahl { display: inline-block; min-width: 1.5em; padding: 0 0.4em; border-radius: 999px; background: var(--bad); color: var(--on-accent); font: 700 var(--text-xs)/1.5 var(--font-mono); text-align: center; }

/* ---------- 12 learningLive: Logo-Stil mit UI-Kit und Lernblau ----------
   Dunkle Plattenflächen, Knöpfe mit harter Unterkante, Fortschrittsröhren,
   Kacheln und Marken wie im UI-Kit 01 und 02. Nur Variablen aus tokens.css. */
body {
  background: var(--paper) var(--glow) no-repeat;
  background-attachment: fixed;
  font-family: var(--font-sans);
}
::selection { background: var(--highlight); color: var(--on-highlight); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
a:hover { color: var(--highlight); }
:root[data-theme="light"] a:hover { color: var(--accent); }

/* Kopfzeile: Platte mit Lichtkante, Reiter als 3D-Kacheln */
.masthead { background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel-bottom) 100%); border-bottom: var(--line-thin) solid var(--panel-edge); box-shadow: inset 0 -1px 0 var(--panel-hi), 0 20px 40px -24px var(--panel-shadow); }
.masthead-in { min-height: 76px; gap: var(--space-2) var(--space-5); }
.brand { gap: var(--space-3); font-size: 1.7rem; letter-spacing: -0.04em; font-weight: 800; }
.brand-mark { width: 44px; height: 44px; transform: rotate(-8deg); transition: transform var(--dur) var(--ease); }
.brand:hover .brand-mark { transform: rotate(0deg) scale(1.07); }
.brand-name { line-height: 1; }
.brand-live { color: var(--brand); }
.mainnav { align-self: center; gap: var(--space-2); }
.mainnav a { font: 800 1.06rem / 1 var(--font-display); color: var(--muted); padding: 11px 16px; border: 0; border-radius: 10px; transition: color var(--dur-fast) var(--ease); }
.mainnav a:hover { color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--on-accent); background: linear-gradient(180deg, var(--brand-top), var(--accent)); box-shadow: 0 4px 0 var(--brand-under); }
.masthead-tools { gap: var(--space-2) var(--space-3); }
.masthead .who { font-family: var(--font-mono); font-weight: 700; color: var(--muted); }
.linkish { font-weight: 700; }
.linkish:hover { color: var(--ink); }
.theme-toggle { font: 700 0.8rem var(--font-mono); color: var(--highlight); background: var(--field-bg); border: var(--line-bold) solid var(--panel-edge); box-shadow: inset 0 2px 5px var(--field-inset); padding: 6px 14px; }
:root[data-theme="light"] .theme-toggle { color: var(--ink); }
.theme-toggle:hover { background: var(--field-bg); border-color: var(--highlight); color: var(--highlight); text-decoration: none; }
.admin-nav { background: var(--field-bg); border-top: 0; border-bottom: var(--line-thin) solid var(--panel-edge); }
.admin-nav a[aria-current="page"] { color: var(--ink); text-decoration-color: var(--highlight); }
.admin-nav .kicker { color: var(--highlight); }
:root[data-theme="light"] .admin-nav .kicker { color: var(--accent); }
.crumbs a:hover { color: var(--ink); }

/* Überschriften und Beschriftungen */
h1 { letter-spacing: var(--tracking-display); }
h2 { letter-spacing: -0.03em; }
.kicker, .mono { font-family: var(--font-mono); font-weight: 700; font-size: var(--text-xs); letter-spacing: var(--tracking-label); color: var(--muted); }
.margin .num { color: var(--brand); }
.lede { font-size: var(--text-lg); color: var(--muted); }
.margin .kicker, .hero .kicker, .opening .kicker { color: var(--highlight); }
:root[data-theme="light"] .margin .kicker, :root[data-theme="light"] .hero .kicker, :root[data-theme="light"] .opening .kicker { color: var(--accent); }
.sum, .stat-label, .abschnitt h2 { color: var(--muted); }

/* Plattenflächen: Verlauf, Lichtkante, tiefer Schatten */
.karte, .part, .resume, .stat-tile, .linie-karte, .steps li, .table-scroll, .auth-card, .zahlen, .linien-karten .karte, .weiter, .linien {
  background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel-bottom) 100%);
  border: var(--line-thin) solid var(--panel-edge);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow);
}
.weiter { background: linear-gradient(180deg, var(--pastel-2) 0%, var(--panel-bottom) 100%); border: var(--line-bold) solid var(--brand); box-shadow: 0 30px 50px -24px var(--panel-shadow), 0 0 50px -18px color-mix(in srgb, var(--brand) 70%, transparent); }
.auth-card { padding: var(--space-6); }
.auth-card h1 { font-size: var(--text-3xl); }
.zahl { border-left: 0; padding-left: 0; }
.zahl strong { color: var(--ink); }
.steps li:nth-child(1) { background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); }
.steps li:nth-child(2) { background: linear-gradient(180deg, var(--pastel-2), var(--panel-bottom)); border-color: var(--brand); }
.steps li:nth-child(3) { background: linear-gradient(180deg, var(--pastel-3), var(--panel-bottom)); border-color: color-mix(in srgb, var(--highlight) 50%, var(--panel-edge)); }
.steps li .n, .steps li:nth-child(n) .n { display: inline-grid; place-items: center; min-width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); color: var(--ink); border: var(--line-bold) solid var(--btn-edge); box-shadow: 0 5px 0 var(--btn-under); transform: rotate(-6deg); font: 800 var(--text-lg) / 1 var(--font-display); margin-bottom: var(--space-4); }
.steps li:nth-child(2) .n { background: linear-gradient(180deg, var(--brand-top), var(--brand)); color: var(--on-accent); border: 0; box-shadow: 0 5px 0 var(--brand-under); }
.steps li:nth-child(3) .n { background: linear-gradient(180deg, var(--pop-top), var(--highlight)); color: var(--on-highlight); border: 0; box-shadow: 0 5px 0 var(--pop-under); }
.stat-tile:nth-child(3n+2) { background: linear-gradient(180deg, var(--pastel-2), var(--panel-bottom)); }
.stat-tile:nth-child(3n+3) { background: linear-gradient(180deg, var(--pastel-3), var(--panel-bottom)); }
.stat-value { color: var(--ink); }

/* Linienplan: Kennungen als 3D-Kacheln, Stationen als Knoten */
.kennung { border-radius: 9px; min-width: 40px; height: 28px; padding: 0 10px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.55); transform: rotate(-4deg); font-weight: 800; }
.halt { background: var(--paper); border: 4px solid var(--btn-edge); }
.halt.erledigt { background: var(--c); border-color: var(--c); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.6); }
.halt.aktuell { background: var(--paper); border-color: var(--c); box-shadow: 0 0 0 5px var(--highlight), 0 0 18px color-mix(in srgb, var(--highlight) 55%, transparent); }
:root[data-theme="light"] .halt.aktuell { box-shadow: 0 0 0 5px var(--highlight); }
.strecke::before { background: var(--field-edge); }
.legende i { border-color: var(--ink); }
.legende i.voll { background: var(--ink); }
.stand { color: var(--ink); font-weight: 700; }
.linie { border-top-color: var(--panel-edge); }
.linie-name:hover strong, .halte .inhalt:hover strong { text-decoration: none; color: var(--highlight); }
:root[data-theme="light"] .linie-name:hover strong, :root[data-theme="light"] .halte .inhalt:hover strong { color: var(--accent); }
.halte .inhalt:hover { background: var(--paper-2); }

/* Fortschritt: Röhre mit Leuchtfüllung (ProgressTube) */
.progress, .progress-bar { height: var(--bar-height); border-radius: var(--radius-pill); background: var(--field-bg); border: var(--line-thin) solid var(--panel-edge); box-shadow: inset 0 2px 4px var(--field-inset); }
.progress span {
  border-radius: var(--radius-pill); height: 100%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--accent)) 55%, #fff) 0%, var(--c, var(--accent)) 60%, color-mix(in srgb, var(--c, var(--accent)) 72%, #000) 100%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c, var(--accent)) 60%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* Knöpfe: harte Unterkante, kippen beim Darüberfahren, sitzen beim Drücken */
.btn {
  border: var(--line-bold) solid var(--btn-edge); border-radius: var(--radius-btn);
  background: linear-gradient(180deg, var(--btn-top) 0%, var(--btn-bottom) 100%); color: var(--ink);
  box-shadow: 0 var(--press) 0 var(--btn-under), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font: 800 var(--text-base) / 1.2 var(--font-display); padding: 13px 24px; margin-bottom: var(--press);
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:hover { background: linear-gradient(180deg, var(--btn-top) 0%, var(--btn-bottom) 100%); color: var(--ink); border-color: var(--btn-edge); transform: translateY(-2px) rotate(-1.5deg); filter: brightness(1.1); }
.btn:active { transform: translateY(var(--press)); box-shadow: 0 1px 0 var(--btn-under); filter: none; }
.btn-primary, .btn-primary:hover {
  border: 0; color: var(--on-accent);
  background: linear-gradient(180deg, var(--brand-top) 0%, var(--accent) 100%);
  box-shadow: 0 var(--press) 0 var(--brand-under), 0 14px 28px -6px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  opacity: 1; padding: 15px 26px;
}
[data-bereich="einzelhandel"] .btn-primary { background: linear-gradient(180deg, var(--pop-top), var(--highlight)); box-shadow: 0 var(--press) 0 var(--pop-under), 0 14px 28px -6px rgba(215, 255, 58, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.btn-primary:active { transform: translateY(var(--press)); box-shadow: 0 1px 0 var(--brand-under), inset 0 2px 5px rgba(26, 0, 6, 0.35); }
.btn-secondary { }
.btn-ghost, .btn-ghost:hover { background: transparent; border: var(--line-bold) dashed var(--btn-edge); box-shadow: none; color: var(--highlight); margin-bottom: 0; }
:root[data-theme="light"] .btn-ghost, :root[data-theme="light"] .btn-ghost:hover { color: var(--accent); }
.btn-danger, .btn-danger:hover { background: var(--bad-soft); border: var(--line-bold) solid var(--brand); color: var(--bad); box-shadow: 0 var(--press) 0 var(--brand-dark); }
.btn-small { font-size: var(--text-sm); padding: 9px 16px; border-radius: 11px; box-shadow: 0 4px 0 var(--btn-under); margin-bottom: 4px; }
.btn-small.btn-primary, .btn-small.btn-primary:hover { box-shadow: 0 4px 0 var(--brand-under), inset 0 1px 0 rgba(255, 255, 255, 0.6); padding: 10px 17px; }
.btn[disabled], .btn[disabled]:hover { background: var(--panel-bottom); border: 0; color: var(--muted); opacity: 0.6; transform: none; filter: none; box-shadow: 0 var(--press) 0 var(--rule); cursor: not-allowed; }
.inline-form .btn, .row-actions .btn { margin-bottom: 4px; }

/* Felder: eingelassen, Lime-Rahmen mit Versatzschatten im Fokus */
label:not(.check):not(.option):not(.bestaetigung) { font: 700 var(--text-xs) / 1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
input[type=text], input[type=password], input[type=search], input[type=email], input[type=number], input[type=date], select, textarea {
  background: var(--field-bg); border: var(--line-bold) solid var(--field-edge); border-radius: 12px; color: var(--ink);
  box-shadow: inset 0 2px 6px var(--field-inset); min-height: 50px;
}
input::placeholder, textarea::placeholder { color: #6E6E84; }
input:hover, select:hover, textarea:hover { border-color: var(--btn-edge); }
input:focus, select:focus, textarea:focus, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--highlight); box-shadow: inset 0 2px 6px var(--field-inset), 4px 4px 0 var(--highlight);
}
:root[data-theme="light"] input:focus, :root[data-theme="light"] select:focus, :root[data-theme="light"] textarea:focus { border-color: var(--ink); box-shadow: inset 0 2px 6px var(--field-inset), 4px 4px 0 var(--ink); }
select { font-weight: 700; background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); box-shadow: 0 5px 0 var(--btn-under); }
input[type=checkbox], input[type=radio] {
  appearance: none; -webkit-appearance: none; margin: 0; width: var(--check-size); height: var(--check-size); flex: none;
  background: var(--field-bg); border: var(--line-bold) solid var(--field-edge); box-shadow: inset 0 2px 4px var(--field-inset);
  display: inline-grid; place-content: center; cursor: pointer; vertical-align: middle;
}
input[type=checkbox] { border-radius: 7px; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--highlight); border-color: var(--highlight); box-shadow: 0 3px 0 var(--pop-under), 0 0 14px color-mix(in srgb, var(--highlight) 40%, transparent); }
input[type=checkbox]:checked::after { content: ""; width: 5px; height: 10px; border: solid var(--on-highlight); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
input[type=radio]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-highlight); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Hinweise: Platten mit Versatzschatten, je Bedeutung eine Farbe */
.note, .error, .release-banner, .exam-banner, .pw-frist, .pw-anfragen, .anw {
  border-left-width: 0; border-radius: 16px;
}
.note { background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: var(--line-bold) solid var(--btn-edge); box-shadow: 4px 4px 0 var(--btn-under); }
.error, .exam-banner { background: linear-gradient(180deg, var(--pastel-2), var(--panel-bottom)); border: var(--line-bold) solid var(--brand); color: var(--ink); box-shadow: 4px 4px 0 var(--brand-dark); }
.error { color: var(--bad); }
.exam-banner.admin { background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.release-banner { background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: var(--line-bold) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.release-banner.is-released { background: linear-gradient(180deg, var(--pastel-3), var(--panel-bottom)); border-color: color-mix(in srgb, var(--highlight) 70%, #000); box-shadow: 4px 4px 0 var(--pop-under); }
.pw-frist { background: linear-gradient(180deg, var(--warn-soft), var(--panel-bottom)); border: var(--line-bold) solid var(--warn); color: var(--ink); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); }
.pw-anfragen { background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: var(--line-bold) solid var(--brand); box-shadow: 4px 4px 0 var(--brand-dark); }
.pw-code { background: var(--field-bg); border: var(--line-bold) solid var(--highlight); border-radius: 16px; color: var(--highlight); box-shadow: inset 0 2px 6px var(--field-inset), 4px 4px 0 var(--pop-under); }
:root[data-theme="light"] .pw-code { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 2px 6px var(--field-inset), 4px 4px 0 var(--ink); }
.anw { background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border-bottom: var(--line-thin) solid var(--panel-edge); border-radius: 0; }
.anw[data-art="neu"], .anw[data-art="automatisch"] { background: linear-gradient(180deg, var(--pastel-2), var(--panel-bottom)); border-bottom: var(--line-bold) solid var(--brand); }
.anw[data-art="neu"] .btn-primary, .anw[data-art="automatisch"] .btn-primary { background: linear-gradient(180deg, var(--pop-top), var(--highlight)); color: var(--on-highlight); box-shadow: 0 var(--press) 0 var(--pop-under), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.anw-laeuft strong { color: var(--ok); }
.instance-banner { background: var(--highlight); color: var(--on-highlight); border-bottom: 0; font-weight: 700; }
.nav-zahl { background: var(--brand); color: #fff; box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 70%, transparent); }

/* Marken, Zustände, Tabellen */
.badge, .tag, .marken .p, .umstiege li, .umstiege .p, .toc .p { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.06em; }
.badge { border-radius: 6px; border: var(--line-bold) solid var(--btn-edge); color: var(--muted); padding: 2px 9px; }
.badge.done, .badge.ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--highlight) 55%, #000); }
.badge.run { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.badge.wait { color: var(--bad); border-color: var(--brand); background: var(--bad-soft); }
.badge.bad { color: var(--bad); border-color: var(--brand); background: var(--bad-soft); }
.hidden-badge { border-radius: 6px; }
.tag, .marken .p { border-radius: 6px; border-width: var(--line-bold); }
.halte.done .marken .p, .umstiege li.done .p { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--highlight) 55%, #000); }
.exam-badge { background: var(--brand); color: var(--on-accent); border-radius: 6px; font-weight: 800; }
.admin-table th, table th { color: var(--muted); font-weight: 700; letter-spacing: 0.12em; background: var(--field-bg); }
.admin-table tbody tr:hover td { background: var(--paper-2); }
.table-scroll { overflow-x: auto; }
.toc .n, .part-head .n { color: var(--brand); }
a.go:not(.btn) { color: var(--highlight); }
:root[data-theme="light"] a.go:not(.btn) { color: var(--accent); }

/* Lernfenster und Kopf der Einheit */
.embed-wrap { border: var(--line-bold) solid var(--panel-edge); border-radius: var(--radius-2); box-shadow: var(--shadow); }
.embed-toolbar { background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border-bottom-color: var(--panel-edge); }
.unit-head h1 { color: var(--ink); }
.site-foot { border-top-color: var(--panel-edge); }

/* ---------- 13 Plastik: Icons, Banner, Spielelemente, Tüftler ----------
   Gold/Orange auf Nachtblau (Schild-Logo). Alles tokenbasiert; Bewegung nur ohne „reduce motion“. */
.ico { display: inline-block; flex: none; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35)); vertical-align: middle; }
.brand .ico-logo { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5)); transition: transform var(--dur) var(--ease); }
.brand:hover .ico-logo { transform: rotate(-6deg) scale(1.06); }
.brand-name { font-family: var(--font-display); font-weight: 800; letter-spacing: var(--tracking-display); color: var(--ink); }
.brand-live { color: var(--brand); text-shadow: 0 2px 0 var(--brand-dark); }

/* Kopfleiste und Banner als Platten mit Lichtkante und harter Unterkante */
.masthead { border-bottom: 4px solid var(--panel-edge); box-shadow: 0 6px 0 var(--btn-under), 0 18px 28px -14px rgba(0, 0, 0, 0.6); }
.hero, .fach-kopf {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 2px solid var(--panel-edge);
  border-radius: var(--radius-2);
  padding: var(--space-5);
  box-shadow: inset 0 2px 0 var(--panel-hi), 0 8px 0 var(--btn-under), 0 22px 36px -18px var(--panel-shadow);
}
.kopf-mit-icon { display: flex; align-items: center; gap: var(--space-4); }
.kopf-mit-icon h1 { margin: 0; }
.exam-banner, .release-banner, .instance-banner { border-radius: var(--radius-1); box-shadow: 0 5px 0 var(--btn-under), inset 0 1px 0 var(--panel-hi); border: 2px solid var(--panel-edge); }
.bereich-kopf h2 a { display: inline-flex; align-items: center; gap: var(--space-3); }
.linie-karte-kopf .ico { margin-inline: var(--space-1); }
.karte, .platte { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.karte:hover, .linie-karte:hover { transform: translateY(-2px); }

/* Chip in der Kopfzeile: Rang, XP, Serie */
.spielchip { display: inline-flex; align-items: center; gap: var(--space-2); padding: 4px 12px 4px 6px; border-radius: var(--radius-pill); text-decoration: none; color: var(--ink);
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); border: 2px solid var(--btn-edge); box-shadow: 0 4px 0 var(--btn-under); transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.spielchip:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--btn-under); }
.spielchip:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-under); }
.sc-text { display: grid; line-height: 1.1; }
.sc-text strong { font-size: var(--text-sm); }
.sc-text small { font: 600 var(--text-xs) var(--font-mono); color: var(--muted); }
.sc-serie { display: inline-flex; align-items: center; gap: 2px; font: 800 var(--text-sm) var(--font-mono); color: var(--muted); }
.sc-serie.an { color: #FFB066; }
.sc-serie:not(.an) .ico { filter: grayscale(1) opacity(0.5); }

/* Heute: Begrüßung, Serie, Rang, Tagesziel, Abzeichen */
.heute { margin: var(--space-5) 0; padding: var(--space-5); border-radius: var(--radius-2); border: 2px solid var(--panel-edge);
  background: radial-gradient(500px 200px at 90% 0, rgba(245, 184, 46, 0.14), transparent 70%), linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow: inset 0 2px 0 var(--panel-hi), 0 8px 0 var(--btn-under), 0 22px 36px -18px var(--panel-shadow); }
.heute[data-stimmung="feuer"] { border-color: #C47A35; }
.heute[data-stimmung="warnung"] { border-color: var(--warn); }
.heute-kopf { display: grid; grid-template-columns: 1fr auto; gap: var(--space-5); align-items: center; }
.gruss { margin: 0; font: 800 var(--text-xl) var(--font-display); letter-spacing: var(--tracking-display); color: var(--brand); display: flex; flex-wrap: wrap; }
.gruss span { display: inline-block; animation: gruss-hoch 0.7s var(--ease) both; animation-delay: calc(var(--i) * 28ms); }
@keyframes gruss-hoch { from { opacity: 0; transform: translateY(14px) rotate(-6deg); } to { opacity: 1; transform: none; } }
.heute-titel { margin: var(--space-2) 0; font-size: var(--text-lg); }
.serie-karte { display: grid; justify-items: center; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-2); background: var(--field-bg); border: 2px solid var(--field-edge); box-shadow: inset 0 3px 0 var(--field-inset); }
.serie-karte strong { font: 800 var(--text-2xl) var(--font-display); line-height: 1; }
.serie-karte > span { font: 700 var(--text-xs) var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }
.serie-karte:not(.an) .ico { filter: grayscale(1) opacity(0.45); }
.serie-karte.an .ico { animation: flamme 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flamme { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.woche { display: flex; gap: 6px; list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.woche li { display: grid; justify-items: center; gap: 2px; font: 600 0.62rem var(--font-mono); color: var(--muted); text-transform: uppercase; }
.woche i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--field-edge); background: var(--paper-2); }
.woche li.aktiv i { background: linear-gradient(var(--brand-top), var(--brand)); border-color: var(--brand-under); box-shadow: 0 2px 0 var(--brand-under); }
.woche li.heute i { outline: 2px solid var(--focus); outline-offset: 2px; }
.heute-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); margin-top: var(--space-5); }
.rang-karte, .ziel-karte, .wusstest-karte { display: flex; gap: var(--space-4); align-items: center; padding: var(--space-4); border-radius: var(--radius-1); border: 2px solid var(--panel-edge); background: var(--paper-2); box-shadow: 0 5px 0 var(--btn-under); }
.ziel-karte, .wusstest-karte { display: grid; gap: var(--space-2); align-content: center; }
.wusstest-karte p { margin: 0; }
.rang-text { display: grid; gap: 4px; min-width: 0; flex: 1; }
.rang-text strong, .ziel-karte strong { font: 800 var(--text-lg) var(--font-display); }
.rang-text small, .ziel-karte small { color: var(--muted); font-size: var(--text-xs); }
.roehre { height: 14px; border-radius: var(--radius-pill); background: var(--field-bg); border: 2px solid var(--field-inset); box-shadow: inset 0 2px 3px var(--field-inset); overflow: hidden; }
.roehre > span { display: block; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(var(--brand-top), var(--brand) 55%, #F58A1F); box-shadow: 0 0 12px rgba(245, 184, 46, 0.55); transition: width 0.8s var(--ease); }
.abzeichen { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.abzeichen li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: var(--radius-pill); border: 2px solid var(--panel-edge); background: var(--paper-2); font: 700 var(--text-xs) var(--font-sans); color: var(--muted); }
.abzeichen li .ico { filter: grayscale(1) opacity(0.4); }
.abzeichen li.erreicht { color: var(--ink); border-color: #C47A35; background: linear-gradient(var(--pastel-2), var(--paper-2)); }
.abzeichen li.erreicht .ico { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4)); }

/* Landingpage: Der Tüftler steht fest im Hintergrund, die Seite fährt darüber */
body.landing { background: var(--paper); }
.tueftler { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: flex; justify-content: flex-end; align-items: flex-end; padding-top: 72px; }
.tueftler svg { width: min(66vw, 1100px); height: auto; max-height: calc(100vh - 72px); }
body.landing .masthead, body.landing .site-foot, body.landing .landing-page { position: relative; z-index: 1; }
body.landing .masthead { position: sticky; top: 0; z-index: 5; }
.landing-page { background: transparent; }
.hero-sektion { min-height: min(78vh, 640px); display: flex; align-items: center; padding-block: var(--space-6); }
.hero-platte { max-width: 460px; padding: var(--space-6); border-radius: var(--radius-2); background: rgba(10, 14, 21, 0.82); backdrop-filter: blur(6px); border: 2px solid var(--panel-edge);
  box-shadow: inset 0 2px 0 var(--panel-hi), 0 8px 0 var(--btn-under), 0 28px 50px -20px #000; }
.hero-platte h1 { font-size: var(--text-3xl); margin: var(--space-2) 0 var(--space-3); }
.hero-platte .gold { color: var(--brand); text-shadow: 0 3px 0 var(--brand-dark); }
.hero-knoepfe { display: flex; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-4) 0; }
.hero-fakten { display: flex; flex-wrap: wrap; gap: var(--space-3); list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.hero-fakten li { display: inline-flex; align-items: center; gap: var(--space-2); font: 700 var(--text-sm) var(--font-sans); color: var(--muted); }
.platte-block { background: rgba(10, 14, 21, 0.84); backdrop-filter: blur(6px); border: 2px solid var(--panel-edge); border-radius: var(--radius-2); padding: var(--space-5); margin-bottom: var(--space-5);
  box-shadow: inset 0 2px 0 var(--panel-hi), 0 8px 0 var(--btn-under); }
.richtungen { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.richtung { display: flex; gap: var(--space-4); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius-1); border: 2px solid var(--panel-edge); background: var(--paper-2); box-shadow: 0 5px 0 var(--btn-under); }
.richtung h3 { margin: 0 0 4px; font-size: var(--text-md); }
.richtung .desc { margin: 0 0 var(--space-2); color: var(--muted); font-size: var(--text-sm); }
.richtung .sum { margin: 0; font: 700 var(--text-xs) var(--font-mono); color: var(--accent); }
.rangleiter { display: flex; flex-wrap: wrap; gap: var(--space-3); list-style: none; padding: 0; margin: var(--space-4) 0 0; }
.rangleiter li { display: grid; justify-items: center; gap: 2px; font: 700 var(--text-xs) var(--font-sans); color: var(--muted); }
body.landing .tueftler { transition: opacity var(--dur); }

/* Tüftler: Bewegung */
.t-gear { animation: t-dreh 40s linear infinite; }
.t-gear-b { animation-direction: reverse; animation-duration: 28s; }
@keyframes t-dreh { to { transform: rotate(360deg); } }
.t-bulbglow { animation: t-licht 2.6s ease-in-out infinite; transform-origin: 560px 150px; }
@keyframes t-licht { 0%, 100% { opacity: 0.55; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } }
.t-strahlen { animation: t-licht 2.6s ease-in-out infinite; transform-origin: 560px 150px; }
.t-cursor, .t-led { animation: t-blink 1s steps(2, start) infinite; }
@keyframes t-blink { 50% { opacity: 0.1; } }
.t-zeile { opacity: 1; animation: t-tippen 12s steps(1, end) infinite; }
.t-z1 { animation-delay: 0.2s; } .t-z2 { animation-delay: 1.2s; } .t-z3 { animation-delay: 2.4s; } .t-z4 { animation-delay: 3.4s; } .t-z5 { animation-delay: 4.6s; } .t-z6 { animation-delay: 5.6s; } .t-z7 { animation-delay: 6.8s; }
@keyframes t-tippen { 0%, 90% { opacity: 1; } 94% { opacity: 0.35; } 100% { opacity: 1; } }
.t-hitze { animation: t-glut 0.9s ease-in-out infinite; transform-origin: 776px 459px; }
@keyframes t-glut { 0%, 100% { opacity: 0.55; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }
.t-funken { animation: t-funke 0.8s ease-out infinite; transform-origin: 776px 459px; }
@keyframes t-funke { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(10px, -22px); } }
.t-rauch { animation: t-rauch 3s ease-out infinite; }
@keyframes t-rauch { 0% { opacity: 0; transform: translateY(8px); } 30% { opacity: 0.6; } 100% { opacity: 0; transform: translateY(-26px); } }
.t-kabel { animation: t-fluss 1.2s linear infinite; }
@keyframes t-fluss { to { stroke-dashoffset: -36; } }
.t-arm { animation: t-loeten 1.4s ease-in-out infinite; transform-origin: 606px 346px; }
@keyframes t-loeten { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(1.6deg); } }
.t-person { animation: t-atmen 3.2s ease-in-out infinite; transform-origin: 560px 470px; }
@keyframes t-atmen { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.t-auge { animation: t-blink 3s steps(2, start) infinite; }

@media (max-width: 900px) {
  .tueftler { opacity: 0.32; padding-top: 0; }
  .tueftler svg { width: 150vw; }
  .heute-kopf { grid-template-columns: 1fr; }
  .hero-platte { padding: var(--space-4); }
  .sc-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .t-gear, .t-bulbglow, .t-strahlen, .t-cursor, .t-led, .t-zeile, .t-hitze, .t-funken, .t-rauch, .t-kabel, .t-arm, .t-person, .t-auge, .gruss span, .serie-karte.an .ico { animation: none; }
  .t-zeile { opacity: 1; }
}
/* Lernassistent (Vorbereitung) */
.assistent-knopf { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 40; display: inline-flex; align-items: center; gap: var(--space-2); padding: 8px 16px 8px 8px; min-height: var(--touch);
  font: 800 var(--text-sm) var(--font-sans); color: var(--on-accent); cursor: pointer; border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--brand-top), var(--brand) 60%, #F58A1F); border: 2px solid var(--brand-top); box-shadow: 0 5px 0 var(--brand-under), 0 14px 24px -8px #000; transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.assistent-knopf:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--brand-under), 0 18px 28px -8px #000; }
.assistent-knopf:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--brand-under); }
.assistent-knopf span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--on-accent); color: var(--brand); font: 900 1.1rem var(--font-display); }
.assistent-panel { position: fixed; right: var(--space-4); bottom: 76px; z-index: 41; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 520px); display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3);
  border-radius: var(--radius-2); border: 2px solid var(--panel-edge); background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); box-shadow: inset 0 2px 0 var(--panel-hi), 0 8px 0 var(--btn-under), 0 30px 50px -20px #000; }
.assistent-panel[hidden] { display: none; }
.assistent-panel header { display: flex; justify-content: space-between; align-items: center; }
.assistent-zu { background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; min-width: var(--touch-small); min-height: var(--touch-small); }
.assistent-kontext { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-1); background: var(--paper-2); font-size: var(--text-xs); color: var(--muted); }
.assistent-verlauf { overflow-y: auto; display: grid; gap: var(--space-2); align-content: start; min-height: 80px; }
.assistent-verlauf p { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-1); font-size: var(--text-sm); }
.assistent-system { background: var(--paper-2); }
.assistent-du { background: var(--pastel-2); justify-self: end; }
.assistent-form { display: grid; gap: var(--space-2); }
.assistent-form textarea { resize: vertical; }
/* ===== Zwei getrennte Fortschritte (Vorträge, Aufgaben) ===== */
.stand-zwei { display: grid; gap: var(--space-2); min-width: min(100%, 260px); align-self: end; }
.stand-zeile { display: grid; grid-template-columns: 5.6rem minmax(80px, 1fr) auto; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.stand-name { font-weight: 700; color: var(--ink); }
.stand-zahl { font: 600 var(--text-sm) var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.stand-zeile .progress { margin: 0; max-width: none; }
.stand-zwei.klein { margin-top: var(--space-3); }
.stand-zwei.klein .stand-zeile { grid-template-columns: 5rem minmax(60px, 1fr) auto; font-size: var(--text-xs); }
.stand-art { white-space: normal; }
.tag.art-aufgabe { border-color: var(--l-orange); }
.tag.art-vortrag { border-color: var(--l-blau); }
@media (max-width: 640px) { .fach-kopf { grid-template-columns: 1fr; } .stand-zwei { width: 100%; } }

/* ===== Fehler melden ===== */
.bug-knopf { position: fixed; left: var(--space-4); bottom: var(--space-4); z-index: 40; display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch); padding: 6px 14px 6px 8px;
  font: 700 var(--text-sm) var(--font-sans); color: var(--ink); cursor: pointer; border-radius: var(--radius-pill); border: 2px solid var(--panel-edge);
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); box-shadow: 0 4px 0 var(--btn-under), 0 12px 20px -8px #000; transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.bug-knopf:hover { transform: translateY(-2px); }
.bug-knopf:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-under); }
.bug-knopf span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bad); color: var(--paper); font: 900 1rem var(--font-display); }
@media (max-width: 520px) { .bug-knopf b { display: none; } .bug-knopf { padding: 6px; } }
body.bug-offen { overflow: hidden; }
.bug-overlay { position: fixed; inset: 0; z-index: 400; background: var(--overlay); display: grid; place-items: center; padding: var(--space-4); overflow-y: auto; }
.bug-overlay[hidden] { display: none; }
.bug-dialog { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: var(--space-2); padding: var(--space-5); border-radius: var(--radius-2); border: 2px solid var(--panel-edge);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); box-shadow: inset 0 2px 0 var(--panel-hi), 0 8px 0 var(--btn-under), 0 30px 50px -20px #000; }
.bug-dialog header { display: flex; justify-content: space-between; align-items: center; }
.bug-dialog h2 { margin: 0; font-size: var(--text-lg); }
.bug-zu { background: none; border: 0; color: var(--muted); font-size: 1.8rem; line-height: 1; cursor: pointer; min-width: var(--touch-small); min-height: var(--touch-small); }
.bug-hinweis { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.bug-dialog label, .bug-bildlabel { font-weight: 700; font-size: var(--text-sm); margin-top: var(--space-2); }
.bug-dialog textarea { resize: vertical; }
.bug-bildfeld { display: grid; gap: var(--space-2); }
.bug-ablage { display: grid; place-items: center; gap: var(--space-2); min-height: 96px; padding: var(--space-3); text-align: center; color: var(--muted); font-size: var(--text-sm);
  border: 2px dashed var(--panel-edge); border-radius: var(--radius-1); background: var(--field-bg); cursor: pointer; }
.bug-ablage:hover, .bug-ablage:focus-visible, .bug-ablage.zieh { border-color: var(--brand); color: var(--ink); }
.bug-ablage.hat-bild span { display: none; }
.bug-vorschau { max-width: 100%; max-height: 220px; border-radius: 8px; border: var(--line-thin) solid var(--rule); }
.bug-bildweg { justify-self: start; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: var(--text-sm); padding: 4px 0; }
.bug-fehler { margin: 0; color: var(--bad); font-weight: 700; }
.bug-ok { margin: 0; color: var(--ok); font-weight: 700; }
.bug-aktion { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* Admin: Reiter „Bugs“ */
.bug-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0; }
.bug-filter a { text-decoration: none; padding: 6px 14px; border-radius: var(--radius-pill); border: var(--line-bold) solid var(--rule); color: var(--ink); font-weight: 600; font-size: var(--text-sm); }
.bug-filter a[aria-current="page"] { border-color: var(--brand); background: var(--pastel-2); }
.bug-zahl { font: 600 var(--text-xs) var(--font-mono); color: var(--muted); margin-left: 4px; }
.bug { padding: var(--space-5); margin-bottom: var(--space-4); display: grid; gap: var(--space-3); }
.bug-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.bug-kopf h2 { margin: 0; font-size: var(--text-md); }
.bug-status { font: 700 var(--text-xs) var(--font-mono); padding: 3px 10px; border-radius: var(--radius-pill); border: var(--line-bold) solid var(--rule); white-space: nowrap; }
.bug-neu { border-color: var(--bad); color: var(--bad); }
.bug-in-arbeit { border-color: var(--warn); color: var(--warn); }
.bug-erledigt { border-color: var(--ok); color: var(--ok); }
.bug-meta { margin: 0; color: var(--muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.bug-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bug-bild img { max-width: min(100%, 560px); border-radius: 8px; border: var(--line-thin) solid var(--rule); display: block; }
.bug-form { display: grid; gap: var(--space-2); padding-top: var(--space-3); border-top: var(--line-thin) solid var(--rule); max-width: 34em; }
.bug-form label { font-weight: 700; font-size: var(--text-sm); }
.bug-aktionen { display: flex; gap: var(--space-2); }

/* Fußzeile bleibt lesbar hinter den schwebenden Knöpfen (Fehler melden, Lernassistent) */
.site-foot { padding-bottom: 76px; }


/* ===== Kursauswahl, Kopfmenü, Lernboard, Missionen, Medaillen ===== */
.menue { position: relative; display: inline-block; }
.menue-knopf { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 8px; min-height: var(--touch-small); color: inherit; font: inherit; font-weight: 700; cursor: pointer; border-radius: var(--radius-1); }
.menue-knopf:hover, .menue-knopf[aria-expanded="true"] { background: var(--paper-2); }
.menue-knopf.aktiv { box-shadow: inset 0 -3px 0 var(--brand); }
.menue-knopf .pfeil { font-size: .75em; transition: transform var(--dur-fast); }
.menue-knopf[aria-expanded="true"] .pfeil { transform: rotate(180deg); }
.menue-liste { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 230px; display: grid; padding: 6px; background: var(--surface); border: 2px solid var(--panel-edge); border-radius: var(--radius-1); box-shadow: 0 18px 30px -14px #000; }
.menue-liste[hidden] { display: none; }
.menue-liste a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.menue-liste a:hover, .menue-liste a:focus-visible { background: var(--paper-2); }
.menue-liste a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); background: var(--pastel-2); }
.admin-nav-in { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

.gruppen-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: var(--space-4); }
.gruppe-karte { display: grid; gap: var(--space-3); align-content: start; padding: var(--space-5); text-decoration: none; color: inherit; transition: transform var(--dur-fast), border-color var(--dur-fast); }
.gruppe-karte:hover, .gruppe-karte:focus-visible { transform: translateY(-3px); border-color: var(--brand); }
.gruppe-karte.versteckt { opacity: .7; border-style: dashed; }
.gruppe-icon { display: block; }
.gruppe-text { display: grid; gap: var(--space-2); }
.gruppe-name { font: 800 var(--text-lg) var(--font-display); letter-spacing: -.02em; }
.gruppe-desc { color: var(--muted); font-size: var(--text-sm); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: var(--text-xs); padding: 2px 10px; border-radius: var(--radius-pill); border: var(--line-thin) solid var(--rule); background: var(--paper-2); color: var(--ink); }
.medaillen { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.medaille { display: inline-flex; align-items: center; gap: 6px; font: 700 var(--text-xs) var(--font-mono); padding: 2px 10px 2px 6px; border-radius: var(--radius-pill); border: var(--line-bold) solid var(--rule); white-space: nowrap; }
.medaille i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.medaille.m-bronze i { background: #C47A35; box-shadow: 0 0 0 2px #6B3E12; }
.medaille.m-silber i { background: #C9D3E6; box-shadow: 0 0 0 2px #4A5675; }
.medaille.m-gold i { background: #F5B82E; box-shadow: 0 0 0 2px #8A5A00; }
.medaille.m-gold { border-color: #F5B82E; }
.vorbereitung { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.linie-karte.versteckt { border-style: dashed; opacity: .8; }

/* Dashboard: Missionen und Wochenziel */
.mission-karte, .woche-karte { padding: var(--space-4); border-radius: var(--radius-2); background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: 2px solid var(--panel-edge); display: grid; gap: var(--space-2); align-content: start; }
.mission-karte { grid-column: span 2; }
@media (max-width: 700px) { .mission-karte { grid-column: auto; } }
.missionen { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.missionen li { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) var(--space-3); border-radius: var(--radius-1); background: var(--paper-2); }
.missionen li.fertig { background: var(--ok-soft); }
.mi-haken { font-weight: 900; color: var(--muted); }
.missionen li.fertig .mi-haken { color: var(--ok); }
.mi-text { display: grid; font-weight: 600; font-size: var(--text-sm); }
.mi-text small { color: var(--muted); font-weight: 500; }
.woche-karte strong { font: 800 var(--text-lg) var(--font-display); }

/* Lernboard */
.board { margin-block: var(--space-6); }
.board-spalten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .board-spalten { grid-template-columns: 1fr; } }
.spalte { display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-2); background: var(--paper-2); border: var(--line-bold) solid var(--rule); align-content: start; min-height: 160px; }
.spalte h3 { margin: 0; display: flex; justify-content: space-between; align-items: center; font-size: var(--text-md); }
.zaehler { font: 700 var(--text-xs) var(--font-mono); background: var(--surface); border-radius: var(--radius-pill); padding: 2px 10px; border: var(--line-thin) solid var(--rule); }
.board-karte { display: grid; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-1); background: var(--surface); border: var(--line-thin) solid var(--rule); border-left: 6px solid var(--c, var(--accent)); }
.board-karte .titel { font-weight: 700; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.board-karte .titel:hover { text-decoration: underline; }
.board-karte small { color: var(--muted); }
.board-karte.vorschlag { border-style: dashed; border-left-style: solid; }
.board-karte.erledigt { opacity: .85; }
.board-karte .haken { color: var(--ok); font-weight: 900; }
.board-karte form { margin: 0; }
.spalte .leer { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.einplanen summary { cursor: pointer; font-weight: 700; padding: var(--space-2) 0; }
.einplanen form { display: grid; gap: var(--space-2); }
.einplanen select { width: 100%; }
.kurse-arbeit { display: grid; gap: var(--space-3); padding: var(--space-4); }
.kurs-zeile { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.4fr) auto; gap: var(--space-3); align-items: center; padding-bottom: var(--space-3); border-bottom: var(--line-thin) solid var(--rule); }
.kurs-zeile:last-child { border-bottom: 0; padding-bottom: 0; }
.kurs-name { display: flex; gap: var(--space-2); align-items: center; text-decoration: none; color: var(--ink); }
.kurs-name span { display: grid; }
.kurs-name small { color: var(--muted); }
@media (max-width: 700px) { .kurs-zeile { grid-template-columns: 1fr; } }
.kurse-link { margin-block: var(--space-5); }

/* Admin: Kategorien */
.kat-gruppe { padding: var(--space-5); margin-bottom: var(--space-4); }
.kat-gruppe.ist-aus { border-style: dashed; }
.kat-zeile { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.kat-zeile h2, .kat-zeile h3 { margin: 0; flex: 1 1 220px; }
.kat-zeile > span:first-child { flex: 1 1 220px; }
.kat-bereich { margin-top: var(--space-4); padding-top: var(--space-3); border-top: var(--line-thin) solid var(--rule); }
.kat-bereich.ist-aus { opacity: .75; }
.kat-kurse { list-style: none; margin: var(--space-2) 0 0; padding: 0 0 0 var(--space-4); display: grid; gap: var(--space-2); }
.umschalter { margin: 0; }

/* Plattform-Analyse (Admin) */
.analyse-sprung { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.analyse-sprung a { border: var(--line-thin) solid var(--rule); border-radius: var(--radius-pill); padding: 3px 12px; text-decoration: none; color: var(--muted); background: var(--surface); }
.analyse-sprung a:hover, .analyse-sprung a:focus-visible { color: var(--ink); border-color: var(--rule-strong); }
.analyse-bild { margin: var(--space-3) 0; padding: var(--space-3); background: var(--surface); border: var(--line-thin) solid var(--rule); border-radius: var(--radius-2); min-width: 0; }
.analyse-bild figcaption { font-weight: 600; margin-bottom: var(--space-2); }
.analyse-paar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--space-3); }
.diagramm { width: 100%; height: auto; display: block; }
.diagramm .gitter { stroke: var(--rule); stroke-width: 1; }
.diagramm .achse { fill: var(--muted); font-size: 11px; font-family: inherit; }
.diagramm .balken { fill: var(--accent); }
.rechtstext .copyright { font-size: var(--text-md, 1rem); }