/* Lernpfad Mathematik 9
   Mobile first, keine externen Schriften oder Bibliotheken. */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1b2430;
  --dim: #667085;
  --line: #dfe3e8;
  /* Rand von Bedienelementen (Felder, Knoepfe, Chips). --line ist nur fuer
     Trennlinien gedacht: mit 1,3:1 waeren Eingabefelder auf Beamer und
     einfachen Displays kaum zu finden. #858f9f erreicht die fuer
     Bedienelemente noetigen 3:1 auf Weiss und auf --bg (WCAG 1.4.11). */
  --rand-bedien: #858f9f;
  --accent: #2563eb;
  --ok: #15803d;
  --ok-bg: #eefaf1;
  --no: #b42318;
  --no-bg: #fdf1f0;
  --tip: #8a5a00;
  --tip-bg: #fff8e8;
  /* Weisse Schrift braucht 4,5:1 - das hellere #16a34a schaffte nur 3,3:1. */
  --l1: #15803d;
  --l2: #2563eb;
  --l3: #9333ea;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* Muss vor allen display-Regeln stehen: eigene Klassen wie .btn setzen
   display und wuerden das hidden-Attribut sonst aushebeln. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

main {
  max-width: 940px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.25; }

/* ------------------------------------------------------------------ Kopf */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 600; text-decoration: none; color: var(--ink);
}
.brand-mark { color: var(--accent); font-size: 1.3rem; }
.brand-logo { height: 26px; width: auto; display: block; }
.who { display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.pseudo {
  background: #eef2ff; color: #3730a3;
  padding: .15rem .55rem; border-radius: 999px; font-weight: 600;
}
.logout { color: var(--dim); }
.foot {
  text-align: center; color: var(--dim);
  font-size: .8rem; padding: 1rem; border-top: 1px solid var(--line);
}

.page-title { margin: .6rem 0 .2rem; font-size: 1.6rem; }
.lead { color: var(--dim); margin: .2rem 0 1.2rem; }
/* Brotkrumen als Leiste: auf dem Schuelergeraet der Weg zurueck zur Karte,
   frueher in .85rem grau kaum zu finden. Randfarbe = Modulfarbe (--modul). */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem;
  font-size: .95rem; font-weight: 600; color: var(--ink);
  margin: .9rem 0 1.2rem; padding: .5rem .9rem;
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--modul, var(--accent)); border-radius: var(--radius);
}
.crumbs a { text-decoration: none; }
.crumbs a:hover, .crumbs a:focus-visible { text-decoration: underline; }
.modul-zurueck { margin-top: 1.4rem; }
/* Wo hakt es? - lange Zellen brechen um, damit nichts rechts herausragt. */
table.grid td.umbruch { white-space: normal; vertical-align: top; }
table.hakt td { vertical-align: top; }
table.grid.hakt th { white-space: normal; vertical-align: bottom; }
table.hakt td.aufgabe { min-width: 15rem; }
table.hakt td:first-child { min-width: 8rem; max-width: 11rem; }
.fehlerbild { display: block; margin-top: .3rem; font-size: .85rem; line-height: 1.35; }
.fehler-zahl { font-weight: 700; color: var(--no); }
.klein { font-size: .8rem; }
.klassenwahl { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .8rem; }
.fehlerliste li { margin: .3rem 0; }
.pin-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: -.6rem 0 1.2rem; }
.dim { color: var(--dim); }
.error { color: var(--no); font-weight: 600; }
.loading { color: var(--dim); }

/* ---------------------------------------------------------------- Karten */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem;
}

.modules { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .modules { grid-template-columns: 1fr 1fr; } }

.module-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  transition: transform .12s ease, box-shadow .12s ease;
}
.module-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,30,50,.09); }
.mc-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.mc-head h2 { margin: 0; font-size: 1.15rem; }
.hours { font-size: .78rem; color: var(--dim); white-space: nowrap; }
.mc-sub { color: var(--dim); margin: .3rem 0 .8rem; font-size: .92rem; }
.mc-progress { font-size: .82rem; color: var(--dim); margin: .4rem 0 0; }

.bar { display: block; height: 8px; background: #eceff3; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.hint-box {
  background: #fff; border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1.4rem;
}
.hint-box h3 { margin-top: 0; }
.hint-box ul { list-style: none; padding: 0; margin: .5rem 0; }
.hint-box li { margin: .35rem 0; }

/* ------------------------------------------------------------- Stationen */

.stations { list-style: none; padding: 0; margin: 1rem 0 0; }
.station-row { margin-bottom: .6rem; }
.station-row > a {
  display: flex; align-items: flex-start; gap: .8rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem .9rem;
  text-decoration: none; color: inherit;
}
.station-row > a:hover { border-color: var(--accent); }
.station-row.is-done > a { background: var(--ok-bg); border-color: #bfe6cb; }
.dot {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: #eef2f7; color: var(--dim);
}
.is-done .dot { background: var(--ok); color: #fff; }
.sr-body { flex: 1 1 auto; display: block; }
.sr-body strong { display: block; }
.kind {
  display: inline-block; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--dim); margin: .1rem 0;
}
.sr-lead { display: block; font-size: .85rem; color: var(--dim); }
.levels { display: flex; gap: .25rem; flex: 0 0 auto; }

.lvl {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
  font-size: .78rem; font-weight: 700; color: #fff; opacity: .35;
}
.lvl.reached { opacity: 1; }
.lvl-1 { background: var(--l1); }
.lvl-2 { background: var(--l2); }
.lvl-3 { background: var(--l3); }
.hint-box .lvl { opacity: 1; margin-right: .4rem; }

/* --------------------------------------------------------------- Station */

.levelbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  margin: 1rem 0 .8rem;
}
.lb-label { font-size: .85rem; color: var(--dim); margin-right: .2rem; }
.lvlbtn {
  border: 1px solid var(--rand-bedien); background: #fff; color: var(--dim);
  border-radius: 999px; padding: .3rem .75rem; font-size: .85rem;
  cursor: pointer; font-weight: 600;
}
.lvlbtn.active.lvl-1 { background: var(--l1); border-color: var(--l1); color: #fff; }
.lvlbtn.active.lvl-2 { background: var(--l2); border-color: var(--l2); color: #fff; }
.lvlbtn.active.lvl-3 { background: var(--l3); border-color: var(--l3); color: #fff; }
.streak { margin-left: auto; font-size: .82rem; color: var(--dim); }
.dots { letter-spacing: .15em; color: var(--ok); }

.task {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem;
}
.task-title { font-size: 1.05rem; margin: 0 0 .4rem; color: var(--dim); font-weight: 600; }
.task-text { margin: 0 0 .8rem; }
.figure-box { margin: .6rem 0 1rem; text-align: center; }
.figure { width: 100%; max-width: 440px; height: auto; }

.answer { margin-top: .6rem; }
.field { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.field label { min-width: 4.5rem; font-weight: 600; }
input.num, .freetext, input[type=text] {
  font: inherit; padding: .5rem .6rem;
  border: 1px solid var(--rand-bedien); border-radius: 8px; background: #fff;
}
input.num { width: 8rem; }
input.num[aria-invalid="true"] { border-color: var(--no); box-shadow: 0 0 0 1px var(--no); }
.freetext { width: 100%; }
.unit { color: var(--dim); }

/* Termaufgaben (Antworttyp "term"): breites Feld, Tasten, Vorschau */
.field-term { flex-wrap: wrap; }
.field-term label { white-space: nowrap; }
input.num.term-eingabe { width: auto; flex: 1 1 12rem; min-width: 0; max-width: 26rem; }
.term-tasten { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 .3rem; }
.term-tasten .btn.tiny { min-width: 2.4rem; font-size: .95rem; }
.term-vorschau { margin: .2rem 0 .6rem; min-height: 1.4em; color: var(--dim); font-size: .95rem; }
.term-vorschau.ist-fehler { color: var(--tip); }

.option {
  display: flex; gap: .6rem; align-items: flex-start;
  border: 1px solid var(--rand-bedien); border-radius: 10px;
  padding: .6rem .7rem; margin: .4rem 0; background: #fff; cursor: pointer;
}
.option:hover { border-color: var(--accent); }
.option input { margin-top: .25rem; }

.slot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.slot-name { min-width: 5.5rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  border: 1px solid var(--rand-bedien); background: #fff; color: var(--ink);
  border-radius: 999px; padding: .3rem .8rem; font: inherit; font-size: .9rem; cursor: pointer;
}
.chip.picked { background: var(--accent); border-color: var(--accent); color: #fff; }

ol.order { padding-left: 1.2rem; margin: .5rem 0; }
ol.order li {
  display: flex; gap: .6rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: .55rem .7rem; margin: .4rem 0;
}
.step-text { flex: 1 1 auto; }
.step-btns { display: flex; flex-direction: column; gap: .2rem; }

/* -------------------------------------------------------------- Feedback */

.feedback { margin: .8rem 0; padding: 0; border-radius: var(--radius); }
.feedback:not(:empty) { padding: .8rem 1rem; border: 1px solid var(--line); background: #fff; }
.feedback.ok  { background: var(--ok-bg);  border-color: #bfe6cb; }
.feedback.no  { background: var(--no-bg);  border-color: #f3c6c2; }
.feedback.tip { background: var(--tip-bg); border-color: #f0dcae; }
.fb-msg { margin: 0; font-weight: 600; }
.feedback.ok .fb-msg { color: var(--ok); }
.feedback.no .fb-msg { color: var(--no); }
.fb-sol, .fb-felder { margin: .5rem 0 0; }
.fb-sample { margin-top: .6rem; }
.fb-sample p { margin: .3rem 0 0; font-style: italic; }
.fb-steps { margin-top: .6rem; font-size: .95rem; }
.fb-steps summary { cursor: pointer; font-weight: 600; }
.fb-steps ol { margin: .4rem 0; padding-left: 1.3rem; }
.fb-steps li { margin: .2rem 0; }
.hints .hint { margin: .3rem 0; }

/* -------------------------------------------------------------- Knoepfe */

.controls { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 .4rem; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--rand-bedien); background: #fff; color: var(--ink);
  border-radius: 10px; padding: .55rem 1rem; text-decoration: none; display: inline-block;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--dim); }
.btn.tiny { padding: .25rem .6rem; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
.adjust { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }

/* Auf Touchgeraeten mindestens 44 px hohe Ziele (WCAG 2.5.5). Mit der Maus
   bleibt die kompakte Darstellung - dort trifft man auch kleinere Knoepfe. */
@media (pointer: coarse) {
  .lvlbtn, .chip, .btn.tiny { min-height: 44px; }
  .step-btns .btn.tiny { min-width: 44px; }
  .top .who a { display: inline-block; padding: .7rem .2rem; }
}
.bp { font-size: .75rem; color: var(--dim); }

/* --------------------------------------------------------- Buchbezug */

.buchbezug {
  background: #f2f5f9; border: 1px solid var(--line);
  border-radius: 10px; padding: .5rem .8rem; margin: 0 0 1rem;
  font-size: .88rem;
}
.buch-icon { margin-right: .2rem; }
.buch-hinweis { display: block; color: var(--dim); margin-top: .2rem; }
.sr-buch { display: block; font-size: .78rem; color: #475569; margin: .1rem 0; }

/* -------------------------------------------------------- Heftaufgaben */

.heft-block { margin-top: 2rem; }
.heft-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; }
.heft-icon { color: #b45309; }

.heft-card {
  background: #fffdf7; border: 1px solid #ecdcb8;
  border-left: 5px solid #d97706;
  border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.heft-card.is-done { background: var(--ok-bg); border-color: #bfe6cb; border-left-color: var(--ok); }
.heft-card header { margin-bottom: .6rem; }
.heft-card h3 { margin: .3rem 0 0; font-size: 1.05rem; }
.heft-nr {
  display: inline-block; background: #b45309; color: #fff;   /* 5,0:1; #d97706 nur 3,2:1 */
  font-weight: 700; font-size: .95rem; letter-spacing: .02em;
  padding: .15rem .6rem; border-radius: 6px;
}
.is-done .heft-nr { background: var(--ok); }
.heft-art {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim); margin-left: .5rem;
}
.heft-material { font-size: .88rem; color: var(--dim); margin: .2rem 0 .6rem; }
.heft-text ol, .heft-text ul { padding-left: 1.3rem; margin: .4rem 0; }
.heft-text li { margin: .25rem 0; }
.heft-text blockquote {
  margin: .6rem 0; padding: .6rem .9rem; background: #fff;
  border-left: 3px solid var(--line); border-radius: 6px;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: .9rem;
}
table.heft-tab { border-collapse: collapse; margin: .6rem 0; font-size: .9rem; }
table.heft-tab th, table.heft-tab td {
  border: 1px solid var(--line); padding: .3rem .8rem; min-width: 5.5rem; height: 1.9rem;
}
table.heft-tab th { background: #f2f5f9; }
/* Wertetabellen im Aufgabentext: Werte stehen schon da, Schreibplatz ist
   nicht noetig. Schmalere Zellen, und wenn es trotzdem nicht passt, scrollt
   die Tabelle fuer sich - nicht die ganze Seite. */
table.heft-tab { display: block; max-width: 100%; overflow-x: auto; }
.task table.heft-tab th, .task table.heft-tab td { min-width: 2.6rem; padding: .3rem .5rem; text-align: center; }

.heft-loesung { margin: .8rem 0; }
.heft-loesung summary { cursor: pointer; font-weight: 600; color: var(--dim); }
.heft-schritte { margin: .6rem 0; padding-left: 1.3rem; }
.heft-schritte li { margin: .3rem 0; }

.heft-fuss { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; }
.heft-btn[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.heft-zeit { font-size: .8rem; color: var(--dim); }

.heft-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .75rem; color: #b45309; background: #fff7ea;
  border: 1px solid #ecdcb8; border-radius: 999px; padding: .05rem .5rem;
  white-space: nowrap;
}
.heft-badge.voll { color: var(--ok); background: var(--ok-bg); border-color: #bfe6cb; }

/* Heft-Matrix im Dashboard */
table.matrix { border-collapse: collapse; font-size: .82rem; }
table.matrix th, table.matrix td {
  border: 1px solid var(--line); padding: .25rem .4rem; text-align: center;
}
table.matrix th.name { text-align: left; white-space: nowrap; position: sticky; left: 0; background: #fff; }
table.matrix thead th { background: #f2f5f9; font-weight: 600; }
table.matrix td.ja { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
table.matrix td.nein { color: #d0d5dd; }
table.matrix td.summe { font-weight: 700; white-space: nowrap; }

/* ---------------------------------------------------------- Merkkaesten */

.info-unit { display: grid; gap: 1rem; }
.merk {
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius); padding: .9rem 1.1rem;
}
.merk-alt { border-left-color: #94a3b8; }
.merk h3 { margin-top: 0; }
.formel {
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  background: #eef2ff; padding: .1rem .4rem; border-radius: 6px; font-size: 1.02em;
}
.hinweis { color: var(--dim); font-size: .9rem; }

table.verh { border-collapse: collapse; margin: .6rem 0; }
table.verh td { padding: .2rem .45rem; vertical-align: middle; }
table.verh .br { display: table-cell; }
table.verh .br span {
  display: block; text-align: center; padding: 0 .3rem; font-size: .95em;
}
table.verh .br span:first-child { border-bottom: 1.5px solid var(--ink); }

/* -------------------------------------------------------------- Applets */

.applet {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem; margin-bottom: 1rem;
}
.applet-wrap { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .applet-wrap { grid-template-columns: 1.1fr 1fr; align-items: start; } }
/* Beim Ziehen darf sich die Beschriftung nicht markieren lassen. */
.applet-svg {
  width: 100%; height: auto;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
/* min-width: 0 erlaubt dem Rasterfeld, schmaler zu werden als sein Inhalt -
   sonst schiebt eine breite Tabelle die ganze Seite auseinander. */
.applet-side { display: grid; gap: .6rem; align-content: start; min-width: 0; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.applet-table, .applet-log { width: 100%; border-collapse: collapse; font-size: .85rem; }
.applet-table th, .applet-table td, .applet-log th, .applet-log td {
  border: 1px solid var(--line); padding: .3rem .4rem; text-align: center;
}
.applet-table th, .applet-log th { background: #f2f5f9; font-weight: 600; }
.applet-table .hl, .applet-log .hl { background: #fff6da; }
.applet-table .fnrow td { background: #eef2ff; font-size: .78rem; }

/* Potenztreppe: die beiden Richtungen sind farblich getrennt. Nach oben
   (mal a) baut man die Potenz auf, nach unten (geteilt durch a) entstehen
   die negativen Hochzahlen. Die Startzeile a⁰ = 1 bleibt neutral - sie ist
   der Anker, von dem aus beide Richtungen abgehen. */
.applet-table .auf td { background: #eef7ee; }
.applet-table .ab td { background: #f3eefb; }
.applet-table .start td { background: #fff6da; font-weight: 700; }
.applet-table .auf td:nth-child(4) { color: #15803d; font-weight: 600; }
.applet-table .ab td:nth-child(4) { color: #7c3aed; font-weight: 600; }

/* Spalte "gesamt von 1 ausgehend": jeder Faktor ein eigenes Kaestchen.
   Abzaehlen der Kaestchen ergibt die Hochzahl - deshalb linksbuendig und
   nicht umbrechend, damit die Reihe als Reihe lesbar bleibt. */
.applet-table td.kette { text-align: left; white-space: nowrap; }
.applet-table .k-start { font-weight: 700; }
.applet-table .k-auf, .applet-table .k-ab {
  display: inline-block; padding: 0 .28rem; border-radius: 5px; margin-left: .1rem;
}
.applet-table .k-auf { background: #cfe8d4; color: #14532d; }
.applet-table .k-ab { background: #e4d8f7; color: #4c1d95; }
.btn.stufe-auf { border-color: #15803d; color: #15803d; }
.btn.stufe-ab { border-color: #7c3aed; color: #7c3aed; }
.applet-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.applet-hint { font-size: .85rem; color: var(--dim); margin: 0; }
.sliders { display: grid; gap: .4rem; margin-top: .4rem; }
.sliders label { font-size: .88rem; display: grid; gap: .2rem; }
.sliders input[type=range] { width: 100%; }
.sliders output { font-weight: 700; color: var(--accent); }

/* Plotter: Term ueber der Wertetabelle, festgehaltene Graphen als Liste. */
.plterm { margin: 0; font-size: 1.15rem; font-weight: 600; }
.plterm output { white-space: nowrap; }
.radikand { border-top: 1.5px solid currentColor; padding-top: 1px; }
.plspur { margin: 0; padding-left: 1.1rem; font-size: .85rem; color: #64748b; }
.plspur:empty { display: none; }

/* SVG-Klassen */
.fshape, .tri { fill: rgba(37,99,235,.09); stroke: #1f3d7a; stroke-width: 2; stroke-linejoin: round; }
.fline { stroke: #1f3d7a; stroke-width: 2; fill: none; }
.fdiag { stroke: #b45309; stroke-width: 2.2; fill: none; }
.fhelp { stroke: #64748b; stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.fhidden { stroke: #94a3b8; stroke-width: 1.4; stroke-dasharray: 4 4; fill: none; }
.fwall { stroke: #475569; stroke-width: 6; stroke-linecap: round; }
.fground { stroke: #475569; stroke-width: 4; stroke-linecap: round; }
.fright { stroke: #1f3d7a; stroke-width: 2; fill: none; }
.farc { stroke: #64748b; stroke-width: 2; fill: none; }
.farc.mark { stroke: #b45309; stroke-width: 3; }
.flabel { font: 600 15px system-ui, sans-serif; fill: #1b2430; text-anchor: middle; }
.flabel.mark { fill: #b45309; }
.flabel.diag { fill: #b45309; }
.fvertex { font: 700 15px system-ui, sans-serif; fill: #475569; text-anchor: middle; }
.fshape.base { fill: rgba(37,99,235,.05); }
.fgitter { stroke: #e3e8ef; stroke-width: 1; fill: none; }
.fachse { stroke: #64748b; stroke-width: 1.6; fill: none; }
.fpunkt { fill: #b45309; stroke: #fff; stroke-width: 1.5; }

/* Funktionsgraphen (Fig::graph, Applet plotter). Jede Kurve unterscheidet
   sich in Farbe UND Linienart - lesbar auch ohne Farbsehen und im Druck. */
.fkurve { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.fkurve.k0 { stroke: #1f3d7a; }
.fkurve.k1 { stroke: #b45309; stroke-dasharray: 9 6; stroke-linecap: butt; }
.fkurve.k2 { stroke: #15803d; stroke-dasharray: .1 6; stroke-width: 3.6; }
.fkurve.k3 { stroke: #7c3aed; stroke-dasharray: 12 5 2 5; stroke-linecap: butt; }
.fkurve.spur { stroke: #94a3b8; stroke-width: 2; stroke-dasharray: none; }
.fkname { font: 700 15px system-ui, sans-serif; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.fkname.k0 { fill: #1f3d7a; }
.fkname.k1 { fill: #b45309; }
.fkname.k2 { fill: #15803d; }
.fkname.k3 { fill: #7c3aed; }
.fachszahl { font: 500 11px system-ui, sans-serif; fill: #475569; text-anchor: middle; }
.fachszahl.end { text-anchor: end; }
.fasym { stroke: #64748b; stroke-width: 1.4; stroke-dasharray: 6 5; fill: none; }
.fziel { stroke: #b45309; stroke-width: 1.8; fill: none; }
.fpfeil { fill: #64748b; }

/* Vektorpfeile im Schraegbild (Fig::raum, mathe10) - Farben wie die Kurven. */
.fvek { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.fvek.k0 { stroke: #1f3d7a; } .fvspitze.k0 { fill: #1f3d7a; }
.fvek.k1 { stroke: #b45309; } .fvspitze.k1 { fill: #b45309; }
.fvek.k2 { stroke: #15803d; } .fvspitze.k2 { fill: #15803d; }
.fvek.k3 { stroke: #7c3aed; } .fvspitze.k3 { fill: #7c3aed; }

/* Binomialverteilung (mathe10, Kapitel V): Histogramm, Baumdiagramm, Gluecksrad. */
.fsaeule { fill: rgba(37,99,235,.16); stroke: #1f3d7a; stroke-width: 1.2; }
.fsaeule.mark { fill: rgba(180,83,9,.42); stroke: #92400e; }
.fsaeule.leer { fill: none; stroke: #15803d; stroke-width: 2; stroke-dasharray: 5 3; }
.fmu { stroke: #15803d; stroke-width: 2; stroke-dasharray: 6 4; fill: none; }
.fmu.fest { stroke-dasharray: none; }
.fmutext { font: 700 13px system-ui, sans-serif; fill: #15803d; text-anchor: middle; }
.fmutext.start, .fachszahl.start { text-anchor: start; }
.fmutext.end { text-anchor: end; }
.fast { stroke: #1f3d7a; stroke-width: 1.6; fill: none; }
.fast.mark { stroke: #b45309; stroke-width: 3.2; }
.fastzahl { font: 600 13px system-ui, sans-serif; fill: #475569; text-anchor: middle; }
.frad { stroke: #1b2430; stroke-width: 1.6; }
.frad.weiss { fill: #fff; }
.frad.grau { fill: #6b7280; }
.frad.blau { fill: #93c5fd; }
.frad.gelb { fill: #fde68a; }
.flabel.hell { fill: #fff; }
.fzeiger { fill: #b45309; stroke: #fff; stroke-width: 1; }

/* Vektor als Spalte eintippen (Zahlfelder mit 'vek'). */
.vek-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: .5rem 0; }
.vek-gruppe { display: flex; align-items: center; gap: .4rem; }
.vek-gruppe > .vek-name { font-weight: 600; white-space: nowrap; }
.vek-spalte { display: flex; flex-direction: column; gap: .25rem; padding: .2rem .45rem;
  border-left: 2px solid currentColor; border-right: 2px solid currentColor; border-radius: .7rem; }
.vek-spalte input.num, .vek-reihe input.num { width: 4.6rem; text-align: center; }
.vek-reihe { display: flex; align-items: center; gap: .3rem; }
.vek-trenn { color: var(--dim); }

/* Applet Wachstum: Kreis = linear, Quadrat = exponentiell - Form und Farbe. */
.wa-pl { fill: #1f3d7a; stroke: #fff; stroke-width: 1.2; }
.wa-pe { fill: #b45309; stroke: #fff; stroke-width: 1.2; }
.wa-l { color: #1f3d7a; }
.wa-e { color: #b45309; }
.applet-legende { margin: 0; font-size: .88rem; }
.fpunkt.offen { fill: #fff; stroke: #b45309; stroke-width: 2; }
.flabel.start { text-anchor: start; }

.sq { stroke: #1f3d7a; stroke-width: 1.5; }
.sq-a { fill: rgba(22,163,74,.20); }
.sq-b { fill: rgba(37,99,235,.20); }
.sq-c { fill: rgba(234,88,12,.22); }
.sqtext { font: 700 15px system-ui, sans-serif; fill: #1b2430; text-anchor: middle; }
.leglabel { font: 600 13px system-ui, sans-serif; fill: #1b2430; text-anchor: middle; }
.leglabel.mark { fill: #b45309; }
.leglabel.end { text-anchor: end; }
.leglabel.start { text-anchor: start; }
.handle { fill: #2563eb; stroke: #fff; stroke-width: 3; cursor: grab; }
.handle:active { cursor: grabbing; }

/* ------------------------------------------------------------ Dashboard */

.flash {
  background: var(--ok-bg); border: 1px solid #bfe6cb; color: var(--ok);
  border-radius: var(--radius); padding: .7rem 1rem; font-weight: 600; margin: 0 0 1rem;
}
.demo .controls { margin-top: .8rem; }
.demo form { display: inline; }

/* -------------------------------------------------- Autorenoberflaeche */

.autorform .card { margin-bottom: 1rem; }
.autorform label { display: grid; gap: .25rem; font-weight: 600; font-size: .88rem; }
.autorform label.voll { margin: .6rem 0; }
.autorform input, .autorform select, .autorform textarea {
  font: inherit; font-weight: 400; padding: .45rem .6rem;
  border: 1px solid var(--rand-bedien); border-radius: 8px; background: #fff; width: 100%;
}
.autorform textarea { resize: vertical; }
.feldreihe { display: flex; flex-wrap: wrap; gap: .8rem; }
.feldreihe label { flex: 1 1 12rem; }

table.felder { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.felder th { text-align: left; font-weight: 600; color: var(--dim); padding: .2rem .3rem; }
table.felder td { padding: .2rem .3rem; }
table.felder input { width: 100%; }

.option-zeile { display: flex; gap: .6rem; align-items: center; margin: .4rem 0; flex-wrap: wrap; }
.option-zeile .radio { display: flex; align-items: center; gap: .3rem; flex: 0 0 auto; font-size: .78rem; color: var(--dim); }
.option-zeile .radio input { width: auto; }
.option-zeile input[type=text], .option-zeile input:not([type]) { flex: 1 1 12rem; }

.checkzeile { display: flex; gap: .6rem; align-items: flex-start; margin: .5rem 0; font-weight: 400; }
.checkzeile input { width: auto; margin-top: .25rem; }
.checkzeile.frei {
  background: #f0f7ff; border: 1px solid #cfe0f7; border-radius: 10px;
  padding: .7rem .9rem; margin-top: .9rem;
}

.error-box {
  background: var(--no-bg); border: 1px solid #f3c6c2; color: var(--no);
  border-radius: var(--radius); padding: .7rem 1rem; font-weight: 600; margin: 0 0 1rem;
}

table.beitraege td { white-space: normal; }
table.beitraege .aktionen { white-space: nowrap; }
table.beitraege .aktionen a, .linkbtn {
  font-size: .82rem; margin-right: .5rem;
  color: var(--accent); background: none; border: 0; padding: 0;
  font-family: inherit; cursor: pointer; text-decoration: underline;
}
form.inline { display: inline; }
.tag {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .45rem;
}
.tag.ok { color: var(--ok); border-color: #bfe6cb; background: var(--ok-bg); }
.tag.frei { color: #3730a3; border-color: #c7d2fe; background: #eef2ff; }
.heft-nr.klein { font-size: .78rem; padding: .05rem .4rem; }

/* Stand einer Aufgabe - ein Klick schaltet zwischen Entwurf und veroeffentlicht */
table.beitraege td.stand form { display: inline; }
.standknopf {
  display: inline-flex; align-items: center; gap: .35rem;
  font: inherit; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid var(--line); background: #fff; color: var(--dim);
  border-radius: 999px; padding: .12rem .6rem; cursor: pointer; white-space: nowrap;
}
.standknopf:hover { border-color: var(--accent); color: var(--accent); }
.standknopf .punkt {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: #cbd2dc; flex: 0 0 auto;
}
.standknopf.ist-offen { color: var(--ok); border-color: #bfe6cb; background: var(--ok-bg); }
.standknopf.ist-offen .punkt { background: var(--ok); }
.standknopf.ist-offen:hover { border-color: var(--ok); }
.option.richtig { border-color: var(--ok); background: var(--ok-bg); }

/* ---------------------------------------------------- Klassenverwaltung */

.klassen { display: grid; gap: .9rem; grid-template-columns: 1fr; margin: .8rem 0; }
@media (min-width: 640px) { .klassen { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }
.klasse {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem .9rem; background: #fff;
}
.klasse.archiviert { background: #f7f8fa; opacity: .75; }
.klasse header { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; }
.klasse h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.klasse .jahr { font-weight: 400; font-size: .8rem; color: var(--dim); margin-left: .3rem; }
.klasse .tag {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .45rem;
}
.beitritt { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 .5rem; }
.klasse .code {
  background: #eef2ff; color: #3730a3; font-weight: 700;
  padding: .15rem .5rem; border-radius: 6px; font-size: .95rem;
}
.qr { width: 128px; max-width: 100%; }
.qr-svg { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 6px; }
.beitrittslink { font-size: .7rem; word-break: break-all; margin: .35rem 0 .5rem; }

.druckreihe { display: flex; gap: .6rem; flex-wrap: wrap; margin: .2rem 0 .6rem; font-size: .82rem; }

.neue-klasse { margin: 1rem 0 .5rem; }
.neue-klasse summary { cursor: pointer; font-weight: 600; }
.klasse-form {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin: .8rem 0 .4rem;
}
.klasse-form label { display: grid; gap: .2rem; font-size: .85rem; font-weight: 600; }
.klasse-form input { font: inherit; font-weight: 400; padding: .45rem .6rem; border: 1px solid var(--rand-bedien); border-radius: 8px; }

.codes { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .8rem; }
.codes code {
  background: #eef2ff; padding: .15rem .5rem; border-radius: 6px; font-weight: 700;
}
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.grid th, table.grid td {
  border-bottom: 1px solid var(--line); padding: .45rem .5rem; text-align: left; white-space: nowrap;
}
table.grid th { color: var(--dim); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

/* Sortierbare Tabellen (sortieren.js) */
.sortknopf {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
}
.sortknopf:hover, .sortknopf:focus-visible { color: var(--ink); text-decoration: underline; }
.sortknopf::after { content: " \2195"; opacity: .35; }
th[aria-sort="ascending"] .sortknopf::after { content: " \25B2"; opacity: 1; }
th[aria-sort="descending"] .sortknopf::after { content: " \25BC"; opacity: 1; }
th[aria-sort] { color: var(--ink); }
.table-wrap.hoch { max-height: 32rem; overflow-y: auto; }
.table-wrap.hoch thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }

/* Zeitraumwahl ueber den Auswertungen */
.zeitraum { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: 0 0 .9rem; font-size: .9rem; }
.zeitraum a {
  padding: .2rem .65rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--ink);
}
.zeitraum a:hover { border-color: var(--accent); }
.zeitraum a.aktiv { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* Einzelansicht eines Lernenden (views/lernender.php) */
.zurueck { margin: 0 0 .4rem; font-size: .9rem; }
.kennzahlen {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: .6rem; margin: 0 0 1rem;
}
.kennzahlen > div { border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .75rem; }
.kennzahlen dt { font-size: .78rem; color: var(--dim); }
.kennzahlen dd { margin: .1rem 0 0; font-size: 1.5rem; font-weight: 700; }
.kennzahlen dd.ok { color: var(--ok); }
.kennzahlen dd.mid { color: var(--tip); }
.kennzahlen dd.low { color: var(--no); }
.tagesbalken {
  list-style: none; padding: 0; margin: .4rem 0 0;
  display: grid; grid-template-columns: repeat(var(--spalten), minmax(0, 1fr)); gap: 2px;
  height: 8rem; align-items: end; max-width: 48rem;
}
.tagesbalken li { position: relative; height: 6.5rem; display: flex; align-items: flex-end; }
.tagesbalken li.we { background: #f2f4f7; }
.tagesbalken .saeule { display: block; width: 100%; min-height: 1px; background: var(--accent); border-radius: 3px 3px 0 0; }
.tagesbalken .datum {
  position: absolute; top: 100%; left: 0; margin-top: .2rem;
  font-size: .7rem; color: var(--dim); white-space: nowrap;
}
.heftliste { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.heftliste li {
  min-width: 2.6rem; text-align: center; padding: .15rem .4rem; font-size: .85rem;
  border: 1px solid var(--rand-bedien); border-radius: 6px; color: var(--dim);
}
.heftliste li.an { background: var(--ok-bg); border-color: #bfe6cb; color: var(--ok); font-weight: 700; }
table.diagnose th { width: 16rem; vertical-align: top; text-transform: none; font-size: .9rem; color: var(--ink); }
table.diagnose td { white-space: normal; word-break: break-all; }
table.diagnose code { font-size: .85rem; }

td.ok { color: var(--ok); font-weight: 700; }
td.mid { color: var(--tip); font-weight: 700; }
td.low { color: var(--no); font-weight: 700; }

ul.niveau { list-style: none; padding: 0; }
ul.niveau li { display: flex; align-items: center; gap: .6rem; margin: .4rem 0; }
ul.niveau .bar { flex: 1 1 auto; max-width: 320px; }

ul.texte { list-style: none; padding: 0; }
ul.texte li { border-top: 1px solid var(--line); padding: .6rem 0; }
ul.texte .meta { font-size: .82rem; color: var(--dim); }
ul.texte p { margin: .25rem 0 0; }

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

.login { max-width: 460px; margin: 2rem auto; }
.login h1 { font-size: 1.3rem; margin-top: 0; }
.stack { display: grid; gap: .8rem; }
.stack label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }
/* Eingabefelder der Anmeldung: dieselbe Form wie in der Autorenoberflaeche.
   input[type=text] weiter oben greift hier nicht, weil die Felder gar kein
   type-Attribut tragen - sie saehen sonst wie Browservorgaben aus. */
.stack input, .stack select {
  font: inherit; font-weight: 400; width: 100%; padding: .45rem .6rem;
  border: 1px solid var(--rand-bedien); border-radius: 8px; background: #fff; color: var(--ink);
}
.stack input:focus, .stack select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.stack select:disabled { background: #f7f8fa; color: var(--dim); }
.teacher-login, .probe-login { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.teacher-login summary, .probe-login summary { cursor: pointer; color: var(--dim); font-size: .9rem; }
.teacher-login form, .probe-login form { margin-top: .8rem; }

/* Erklaerung unter einem Eingabefeld - normalgewichtig, damit sie nicht
   mit der Feldbezeichnung konkurriert. */
.feldhilfe { font-weight: 400; font-size: .82rem; color: var(--dim); }

/* --------------------------------------------------------- Impressum u. a. */

/* Laufender Text, keine Bedienoberflaeche: etwas schmaler als die Karte sonst,
   damit die Zeilen lesbar kurz bleiben. */
.rechtstext { max-width: 42rem; }
.rechtstext h1 { margin-bottom: 1.2rem; }
.rechtstext h2 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dim); margin: 1.6rem 0 .4rem;
}
.rechtstext p { margin: 0 0 .7rem; }

/* Fuenf Ziffern: Zeichenabstand macht das Nachzaehlen leicht. */
.pin-feld { letter-spacing: .35em; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; }

/* ------------------------------------------------- Anmeldefenster, Freigabe */

.fenster { margin: .4rem 0 .6rem; font-size: .82rem; }
.fenster form { display: inline; }
.fenster .offen { color: var(--ok); font-weight: 700; }
.fenster .zu { color: var(--dim); }
.fenster .rest { color: var(--dim); }

.namenstand { font-size: .8rem; color: var(--dim); margin: .2rem 0 .5rem; }
.namenstand.dringend { color: #b45309; }

/* ------------------------------------------------- Erste Schritte, Anleitung */

/* Fortschrittsliste im Dashboard. Ist alles erledigt, schrumpft die Karte auf
   eine Zeile - sie soll nicht dauerhaft Platz beanspruchen. */
.card.start.fertig { padding: .7rem 1.1rem; }
.start-fertig { margin: 0; font-size: .9rem; color: var(--dim); }
ol.startliste { list-style: none; padding: 0; margin: .8rem 0; }
ol.startliste li {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .3rem 0; color: var(--dim);
}
ol.startliste li.ist-fertig { color: var(--ok); }
ol.startliste .haken {
  flex: 0 0 1.2rem; text-align: center; font-weight: 700;
  color: #cbd2dc;
}
ol.startliste li.ist-fertig .haken { color: var(--ok); }

.anleitung h2 {
  font-size: 1.05rem; margin: 0 0 .6rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--line);
}
.anleitung p { margin: 0 0 .7rem; }
.anleitung .wichtig {
  background: var(--tip-bg); border: 1px solid #f0dcae;
  border-radius: 10px; padding: .7rem .9rem; color: var(--ink);
}
ol.schritte { margin: .8rem 0 1rem; padding-left: 1.4rem; }
ol.schritte li { margin: 0 0 .8rem; padding-left: .2rem; }
ul.liste { margin: .6rem 0 .8rem; padding-left: 1.2rem; }
ul.liste li { margin: 0 0 .5rem; }
.anleitung table.grid td { vertical-align: top; }

.kuerzel-form { display: flex; gap: .4rem; align-items: center; margin: .2rem 0 .6rem; }
.kuerzel-form input {
  font: inherit; font-size: .85rem; padding: .3rem .5rem; width: 7rem;
  border: 1px solid var(--rand-bedien); border-radius: 8px;
}

ul.freigabe { list-style: none; padding: 0; margin: .6rem 0; }
ul.freigabe li {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: .5rem 0;
}
ul.freigabe .kuerzel { font-weight: 700; }
ul.freigabe .klar { color: var(--dim); }
ul.freigabe .wo { color: var(--dim); font-size: .82rem; }
ul.freigabe form { display: inline; margin-left: auto; }
ul.freigabe form + form { margin-left: .4rem; }

/* Band ueber dem Testzugang: es muss jederzeit klar sein, dass diese Daten
   verschwinden - sonst arbeitet jemand eine Stunde lang ins Leere. */
.probe-band {
  background: #fff7ea; border-bottom: 1px solid #ecdcb8; color: #b45309;
  font-size: .85rem; text-align: center; padding: .4rem 1rem;
}
.probe-band strong { color: #92400e; }

/* Schuelersicht der Lehrkraft: bleibt erhalten, daher blau statt Warnfarbe -
   der Weg zurueck muss aber auf jeder Seite sichtbar sein. */
.sicht-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1rem;
  background: #eef2ff; border-bottom-color: #c7d2fe; color: #3730a3; margin: 0;
}
.sicht-band strong { color: #312e81; }
.sicht-band .btn { padding: .3rem .8rem; font-size: .85rem; }

.sr-only, .sr-body.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Formeln
   Wurzeln kommen als MathML (src/Formel.php). Die Mathematikschrift liegt auf
   dem eigenen Server: ohne Schrift mit MATH-Tabelle - auf ChromeOS und Android
   ist meist keine installiert - wird der Wurzelstrich unsauber gesetzt.
   Geladen wird sie nur auf Seiten, die tatsaechlich eine Formel enthalten. */
@font-face {
  font-family: "Lernpfad Math";
  src: url("fonts/fira-math.otf") format("opentype");
  font-display: swap;
}
math {
  font-family: "Lernpfad Math", "Cambria Math", "STIX Two Math", math;
  font-size: 1.05em;
}

/* Ersatz fuer Browser ohne MathML-Satz, erkannt von assets/formel.js. Nicht
   schoen, aber eindeutig: Wurzelzeichen plus Strich ueber dem Radikanden. */
.ohne-mathml math { font-family: inherit; font-size: 1em; white-space: nowrap; }
.ohne-mathml msqrt, .ohne-mathml mroot { display: inline-flex; align-items: flex-end; }
.ohne-mathml msqrt::before, .ohne-mathml mroot::before { content: "\221A"; order: -1; }
.ohne-mathml msqrt > mrow, .ohne-mathml mroot > mrow:first-child {
  border-top: .08em solid currentColor; padding: 0 .1em; line-height: 1.25;
}
.ohne-mathml mroot > mrow:last-child { order: -2; font-size: .65em; align-self: flex-start; margin-right: -.3em; }
.ohne-mathml msup > mrow:last-child { font-size: .75em; vertical-align: .5em; }

/* -------------------------------------------- Namen auf diesem Geraet */
/* Die Namen setzt assets/namen.js aus einer Datei der Lehrkraft ein. */
.klarname { color: var(--dim); font-weight: 400; font-size: .9em; margin-left: .25rem; }
.klarname::before { content: "\00b7\00a0"; }
.klarname[data-praefix]::before { content: none; }
.page-title .klarname { font-size: .6em; }
.namen-geraet .namen-stand { margin: .2rem 0 .7rem; }
.namen-geraet .controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.namen-oeffnen { position: relative; cursor: pointer; }
.namen-oeffnen input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.namen-oeffnen:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.namen-merken { display: flex; gap: .45rem; align-items: center; margin: .8rem 0 .2rem; font-size: .92rem; }
.namen-meldung { margin: .4rem 0; font-size: .92rem; color: var(--ok); }
.namen-meldung:empty { display: none; }
.namen-meldung.fehler { color: var(--no); }

/* ------------------------------------------------- Klassenarbeit bearbeiten */
/* views/arbeit_wahl.php, arbeit.php - Teilaufgaben wie auf dem Papier (arbeit_teil.php) */
.arbeitform .feldreihe.ankreuzen { align-items: center; margin-bottom: .5rem; }
.arbeitform .feldname { font-weight: 600; font-size: .88rem; }
.arbeitform label.haken { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; flex: 0 0 auto; }
.arbeitform label.haken input { width: auto; }
.arbeit-export { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: -.2rem 0 .8rem; }
.arbeit-export[hidden] { display: none; }
.arbeit-export label { font-weight: 600; font-size: .9rem; }
.arbeit-export select {
  font: inherit; width: auto; padding: .45rem .6rem;
  border: 1px solid var(--rand-bedien); border-radius: 8px; background: #fff; color: var(--ink);
}
.arbeit-export select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.kapitelwahl { border: 1px solid var(--line); }
.kapitelwahl legend { font-weight: 700; padding: 0 .4rem; }
.kapitelwahl .controls.klein { margin: 0 0 .4rem; }
table.abschnitte { width: 100%; border-collapse: collapse; }
table.abschnitte th, table.abschnitte td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
table.abschnitte th { font-size: .82rem; color: var(--dim); font-weight: 600; }
table.abschnitte td:nth-child(2) { width: 7rem; }
table.abschnitte td:nth-child(3), table.abschnitte th:nth-child(3) { width: 5rem; text-align: right; }
table.abschnitte label { font-weight: 400; font-size: 1rem; display: inline; }
table.abschnitte input[type=number] { width: 5rem; }
table.abschnitte tr.vertiefung td:first-child { color: var(--dim); font-style: italic; }
table.meine-arbeiten td:nth-child(2), table.meine-arbeiten td:nth-child(3) { width: auto; text-align: left; }
table.meine-arbeiten th:nth-child(3) { text-align: left; }
table.meine-arbeiten .aktionen { white-space: nowrap; text-align: right; }
.abschnitt-titel { margin: 1.4rem 0 .6rem; font-size: 1.25rem; }
.arbeit-aufgabe .aufgabe-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.arbeit-aufgabe .aufgabe-kopf h2 { margin: 0 0 .4rem; }
.aufgabe-knoepfe, .teil-knoepfe { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.teil-werkzeug {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end;
  margin-top: .9rem; padding: .5rem .6rem; background: #f6f8fb; border-radius: 8px 8px 0 0;
  border: 1px solid var(--line); border-bottom: 0;
}
.teil-werkzeug label { flex: 1 1 18rem; }
.teil-werkzeug label.punkte { flex: 0 0 6rem; }
.papier-vorschau { border: 1px solid var(--line); border-radius: 0 0 8px 8px; padding: .6rem .9rem; background: #fff; }
.eh-vorschau summary { cursor: pointer; color: var(--dim); font-size: .88rem; margin-top: .4rem; }
.eh-vorschau .eh { font-size: .92rem; }

.teil-kopf { display: flex; gap: .5rem; align-items: baseline; }
.teil-kopf .buchst { font-weight: 700; }
.teil-kopf .teil-text { flex: 1; min-width: 0; }
.teil-kopf .pkt { color: var(--dim); font-size: .85rem; white-space: nowrap; }
.papier .felder { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: .4rem 0 .2rem 1.4rem; }
.papier .luecke { display: inline-block; min-width: 5rem; border-bottom: 1px solid #1b2430; vertical-align: baseline; height: 1.1em; }
.papier .luecke.kurz { min-width: 1.6rem; margin-right: .5rem; }
.papier .anweisung { margin: .3rem 0 .2rem 1.4rem; font-size: .88rem; color: var(--dim); }
.papier .wahl, .papier .schritte-liste { list-style: none; margin: .2rem 0 .2rem 1.4rem; padding: 0; }
.papier .wahl li, .papier .schritte-liste li { display: flex; gap: .4rem; align-items: baseline; margin: .2rem 0; }
.papier .kasten { display: inline-block; width: .9em; height: .9em; border: 1px solid #1b2430; flex: 0 0 auto; }
.papier .wahl-bst { font-weight: 600; }
.papier .reihe { margin: .3rem 0 0 1.4rem; }
.papier table.zuordnung { border-collapse: collapse; margin: .4rem 0 .2rem 1.4rem; }
.papier table.zuordnung th, .papier table.zuordnung td { border: 1px solid var(--line); padding: .25rem .7rem; text-align: center; }
.papier .linien span { display: block; height: 1.7rem; border-bottom: 1px solid #c9ced6; margin-left: 1.4rem; }
