/* WSI Academy – Design-System (docs/05_DESIGN.md D-TOKENS, D-LAYOUT, D-KOMP)
   Variablen stehen in tokens.css (unverändert aus design/tokens.css) und werden VOR dieser Datei geladen.
   Keine Inline-Styles in Templates (CSP): Zustände über Klassen, aria-* und Datenattribute. */

/* ---------- Schrift (selbst gehostet, kein CDN) ---------- */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-300-normal.57cc7a45b4db.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-ext-300-normal.72fab3c7aaa9.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-400-normal.4279528ce0e7.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-ext-400-normal.5aabe8157d61.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-400-italic.edbbd00269c1.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-ext-400-italic.ba8dada281c4.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-500-normal.55cfeb5304f0.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-ext-500-normal.3a24e2af79df.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-700-normal.10a07810f28f.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/roboto-woff2/roboto-latin-ext-700-normal.57ef729e27c0.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--schrift);
  font-size: var(--groesse-basis);
  line-height: var(--zeilenhoehe);
  color: var(--text);
  background: var(--flaeche-hell);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4 { margin: 0; font-weight: var(--gewicht-mittel); color: var(--text-ueberschrift); line-height: 1.2; }
h1 { font-size: var(--groesse-h1); }
h2 { font-size: var(--groesse-h2); }
h3 { font-size: var(--groesse-xl); }
h4 { font-size: var(--groesse-l); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--wsi-blau); }
a:hover { color: var(--wsi-blau-dunkel); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--linie-hell); margin: var(--abstand-5) 0; }
strong { font-weight: var(--gewicht-mittel); }
code, kbd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
kbd { border: 1px solid var(--linie-eingabe); border-bottom-width: 2px; border-radius: var(--radius-knopf); padding: 0 .35em; background: var(--flaeche); }

/* Sichtbarer Fokus (WCAG 2.4.7): Linie + Halo; auf dunklem Grund hellblau (Kontrast ≥ 3:1) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--fokus-linie, var(--wsi-blau));
  outline-offset: 2px;
  box-shadow: var(--fokus);
}
.leiste, .kopf, .fuss, .karte--dunkel, .karte--glas, .flaeche-dunkel, .toast, .modal--dunkel { --fokus-linie: var(--wsi-akzent-hell); }

/* Hinweis unter einem Knopf, der in einem neuen Tab öffnet (WCAG 3.2.5 / G201) – steht auch als Beschreibung am Knopf */
.live-neuer-tab { display: block; margin: var(--abstand-1) 0 0; font-size: var(--groesse-xs); }

.nur-lesegeraet {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.ueberspringen {
  position: absolute; left: var(--abstand-4); top: -100px; z-index: 2000;
  background: var(--flaeche); color: var(--text); padding: var(--abstand-2) var(--abstand-4);
  border-radius: var(--radius-knopf); box-shadow: var(--schatten-overlay);
}
.ueberspringen:focus { top: var(--abstand-2); }

/* ---------- Layout ---------- */
.container { max-width: var(--inhalt-breite); margin: 0 auto; padding: 0 var(--abstand-5); }
.inhalt { padding-top: var(--abstand-6); padding-bottom: var(--abstand-6); }
.stapel { display: flex; flex-direction: column; gap: var(--abstand-4); }
.stapel--2 { gap: var(--abstand-2); }
.stapel--3 { gap: var(--abstand-3); }
.stapel--5 { gap: var(--abstand-5); }
.reihe { display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-3); list-style: none; }
.reihe--oben { align-items: flex-start; }
.reihe--zwischen { justify-content: space-between; }
.reihe--eng { gap: var(--abstand-2); }
.raster { display: grid; gap: var(--abstand-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.raster--seite { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: start; }
@media (max-width: 900px) { .raster--seite { grid-template-columns: minmax(0, 1fr); } }
.gedaempft { color: var(--text-gedaempft); }
.klein { font-size: var(--groesse-s); }
.mittig { text-align: center; }
.zahl { font-variant-numeric: tabular-nums; }
.abstand-oben { margin-top: var(--abstand-4); }

/* ---------- Obere Leiste (Service) ---------- */
.leiste { background: var(--wsi-schiefer); color: var(--text-auf-dunkel); font-size: var(--groesse-m); }
.leiste__innen {
  max-width: var(--inhalt-breite); margin: 0 auto; padding: var(--abstand-2) var(--abstand-5);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--abstand-2) var(--abstand-5);
}
.leiste a, .leiste__knopf { color: var(--text-auf-dunkel); text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; /* Zielgröße WCAG 2.5.8 */ }
.leiste a:hover, .leiste__knopf:hover { color: var(--text-auf-dunkel); text-decoration: underline; }
.leiste__links { display: flex; flex-wrap: wrap; gap: var(--abstand-4); align-items: center; }
.leiste__knopf { background: none; border: 0; padding: 0; font: inherit; }

/* ---------- Kopf mit Navigation ---------- */
.kopf { background: var(--wsi-anthrazit); color: #fff; }
.kopf__innen {
  max-width: var(--inhalt-breite); margin: 0 auto; padding: var(--abstand-3) var(--abstand-5);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-3) var(--abstand-6);
}
.marke { display: flex; align-items: center; gap: var(--abstand-3); text-decoration: none; }
.marke img { display: block; width: 170px; height: 34px; object-fit: contain; }
.marke__text {
  color: var(--wsi-akzent-hell); font-size: var(--groesse-s); font-weight: var(--gewicht-mittel);
  letter-spacing: var(--laufweite-label); text-transform: uppercase;
}
.nav { display: flex; flex-wrap: wrap; gap: var(--abstand-1) 28px; flex: 1 1 auto; }
.nav a { color: #fff; text-decoration: none; padding: var(--abstand-2) 0; border-bottom: 2px solid transparent; min-width: 24px; }
.nav a:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, .45); }
.nav a[aria-current="page"] { border-bottom-color: var(--wsi-akzent); }
.kopf__rechts { display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-pill);
  padding: 6px 12px; font-size: var(--groesse-m); font-weight: var(--gewicht-mittel); line-height: 1.3;
}
.pill--xp { background: var(--wsi-schiefer); color: #fff; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--wsi-blau); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: var(--gewicht-mittel); flex: none;
}
.burger {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  background: none; border: 1px solid rgba(255, 255, 255, .45); border-radius: var(--radius-knopf); color: #fff;
}
.burger .icon { width: 24px; height: 24px; }
@media (max-width: 860px) {
  .kopf__innen { column-gap: var(--abstand-3); }
  .marke { order: 1; }
  .kopf__rechts { order: 2; margin-left: auto; }
  .js .burger { display: inline-flex; }
  .nav { order: 3; flex-basis: 100%; flex-direction: column; gap: 0; }
  .nav a { padding: var(--abstand-3) 0; border-bottom: 1px solid rgba(255, 255, 255, .16); }
  .nav a[aria-current="page"] { border-bottom-color: var(--wsi-akzent); }
  .js .nav { display: none; }
  .js .nav[data-offen] { display: flex; }
  .marke img { width: 140px; height: 28px; }
}

/* ---------- Wartungsbanner ---------- */
.wartungsbanner {
  background: var(--wsi-gold-hell); color: var(--text); border-bottom: 2px solid var(--wsi-gold);
  padding: var(--abstand-3) 0; font-weight: var(--gewicht-mittel);
}
.wartungsbanner__innen {
  max-width: var(--inhalt-breite); margin: 0 auto; padding: 0 var(--abstand-5); display: flex; gap: var(--abstand-3); align-items: flex-start;
}
.wartungsbanner .icon { color: var(--wsi-gold-dunkel); flex: none; margin-top: 2px; }

/* ---------- Fuß ---------- */
.fuss { background: var(--wsi-anthrazit); color: var(--text-auf-dunkel); font-size: var(--groesse-m); margin-top: var(--abstand-6); }
.fuss__innen {
  max-width: var(--inhalt-breite); margin: 0 auto; padding: var(--abstand-4) var(--abstand-5);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--abstand-2) var(--abstand-5);
}
.fuss a { color: var(--text-auf-dunkel); text-decoration: underline; display: inline-flex; align-items: center; min-height: 24px; /* Zielgröße WCAG 2.5.8 */ }
.fuss a:hover { color: #fff; }
.fuss__links { display: flex; flex-wrap: wrap; gap: var(--abstand-4); }

/* ---------- Icons ---------- */
.icon { width: 1.5em; height: 1.5em; flex: none; vertical-align: -.3em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--s { width: 16px; height: 16px; vertical-align: -.2em; }
.icon--m { width: 20px; height: 20px; }
.icon--l { width: 26px; height: 26px; }

/* ---------- Karten ---------- */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-karte);
  box-shadow: var(--schatten-karte); padding: var(--abstand-5);
}
.karte--kompakt { padding: 20px; }
.karte__titel { font-size: var(--groesse-xl); font-weight: var(--gewicht-mittel); color: var(--text-ueberschrift); }
.karte__titel--s { font-size: 20px; }
.karte__meta { font-size: var(--groesse-s); color: var(--text-gedaempft); }
.karte--dunkel { background: var(--wsi-anthrazit); border-color: var(--wsi-anthrazit); color: var(--text-auf-dunkel); }
.karte--dunkel .karte__titel, .karte--dunkel h2, .karte--dunkel h3 { color: var(--text-auf-dunkel); }
.karte--dunkel a { color: var(--wsi-akzent-hell); }
.karte--dunkel .karte__meta { color: #dfe5ec; }
.karte--glas {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius-karte);
  color: #fff; padding: 20px; box-shadow: none;
}
.karte--glas .karte__meta { color: #dfe5ec; }
.karte--gesperrt { background: var(--flaeche-grau); border-color: #dee2e6; box-shadow: none; color: var(--text-gedaempft); }
.karte--aktiv { border: 2px solid var(--wsi-blau); }

.flaeche-dunkel {
  background: linear-gradient(180deg, var(--wsi-nacht) 0%, var(--wsi-anthrazit) 100%); color: #fff;
  border-radius: var(--radius-karte); padding: var(--abstand-5);
}
.flaeche-dunkel h1, .flaeche-dunkel h2, .flaeche-dunkel h3 { color: #fff; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--abstand-2);
  min-height: 44px; padding: 12px 18px; border: 1px solid transparent; border-radius: var(--radius-knopf);
  font-size: var(--groesse-basis); font-weight: var(--gewicht-mittel); line-height: 1.5; text-decoration: none;
  background: var(--wsi-gruen); color: #fff; cursor: pointer;
  transition: background-color var(--uebergang), border-color var(--uebergang), color var(--uebergang);
}
.knopf:hover { background: var(--wsi-gruen-hover); color: #fff; }
.knopf--zweit { background: var(--wsi-blau); }
.knopf--zweit:hover { background: var(--wsi-blau-dunkel); }
.knopf--kontur { background: var(--flaeche); border-color: var(--linie-eingabe); color: var(--text); }
.knopf--kontur:hover { background: var(--flaeche-hell); border-color: var(--text-gedaempft); color: var(--text); }
.knopf--gefahr { background: var(--flaeche); border-color: var(--wsi-rot); color: var(--wsi-rot); }
.knopf--gefahr:hover { background: var(--wsi-rot-hell); color: var(--wsi-rot); }
.knopf--hell { background: transparent; border-color: rgba(255, 255, 255, .5); color: #fff; }
.knopf--hell:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.knopf--klein { padding: 8px 12px; font-size: var(--groesse-m); }
.knopf--block { display: flex; width: 100%; }
.knopf:disabled, .knopf[aria-disabled="true"] {
  background: var(--spur); border-color: var(--spur); color: var(--text-schwach); cursor: not-allowed;
}
.knopf--hell:disabled, .knopf--hell[aria-disabled="true"] { background: #4a5868; border-color: #4a5868; color: #dfe5ec; }

/* ---------- Pills und Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-knopf);
  padding: 4px 8px; font-size: var(--groesse-s); font-weight: var(--gewicht-mittel); line-height: 1.3;
  background: var(--spur); color: var(--text-gedaempft); border: 1px solid transparent; vertical-align: middle;
}
.badge--erfolg { background: var(--wsi-gruen-hell); color: var(--wsi-gruen); }
.badge--info { background: var(--wsi-info-hell); color: var(--wsi-blau); }
.badge--gold { background: var(--wsi-gold-hell); color: var(--wsi-gold-dunkel); border-color: var(--wsi-hinweis-gelb); }
.badge--fehler { background: var(--wsi-rot-hell); color: var(--wsi-rot); }
.badge--hell { background: #fff; color: var(--wsi-anthrazit); border-radius: 2px; }

/* ---------- Fortschritt ---------- */
.fortschritt {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0;
  border-radius: 3px; background: var(--spur); overflow: hidden; color: var(--wsi-blau);
}
.fortschritt::-webkit-progress-bar { background: var(--spur); border-radius: 3px; }
.fortschritt::-webkit-progress-value { background: var(--wsi-blau); border-radius: 3px; }
.fortschritt::-moz-progress-bar { background: var(--wsi-blau); border-radius: 3px; }
.fortschritt--block { color: var(--wsi-akzent); }
.fortschritt--block::-webkit-progress-value { background: var(--wsi-akzent); }
.fortschritt--block::-moz-progress-bar { background: var(--wsi-akzent); }
.fortschritt--dick { height: 8px; border-radius: 4px; }
@media (forced-colors: active) { /* erzwungene Farben: Spur und Füllung fielen sonst ganz weg – ein Rahmen und die Hervorhebungsfarbe tragen den Stand */
  .fortschritt { border: 1px solid CanvasText; background: Canvas; }
  .fortschritt::-webkit-progress-bar { background: Canvas; }
  .fortschritt::-webkit-progress-value, .fortschritt::-moz-progress-bar { background: Highlight; }
}

.segmente { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; }
.segment { width: 28px; height: 6px; border-radius: 3px; background: var(--spur); }
.segment--fertig { background: var(--wsi-schiefer); }
.segment--aktiv { background: var(--wsi-blau); }

/* ---------- Level-Ring ---------- */
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring__spur { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 10; }
.ring__bogen { fill: none; stroke: var(--wsi-akzent); stroke-width: 10; stroke-linecap: round; }
.ring__mitte { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.ring__zahl { font-size: 28px; font-weight: var(--gewicht-fett); line-height: 1; }
.ring__text { font-size: var(--groesse-xs); color: #dfe5ec; }

/* ---------- Antwortkarten (Prüfung, Drill, Lernkontrolle) ---------- */
.antworten { display: flex; flex-direction: column; gap: var(--abstand-2); list-style: none; }
.antwort {
  display: flex; align-items: center; gap: var(--abstand-3); width: 100%; text-align: left;
  padding: 12px 14px; border: 2px solid var(--linie-eingabe); border-radius: var(--radius-knopf);
  background: var(--flaeche); color: var(--text); font-size: 16px; cursor: pointer;
  transition: border-color var(--uebergang), background-color var(--uebergang);
}
.antwort:hover { border-color: var(--wsi-schiefer); }
.antwort__buchstabe {
  width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--wsi-schiefer); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--groesse-m); font-weight: var(--gewicht-mittel);
}
.antwort[aria-pressed="true"], .antwort--gewaehlt { border-color: var(--wsi-blau); background: var(--wsi-info-hell); }
.antwort--richtig, .antwort--richtig:hover { border-color: var(--wsi-gruen); background: var(--wsi-gruen-hell); }
.antwort--falsch, .antwort--falsch:hover { border-color: var(--wsi-rot); background: var(--wsi-rot-hell); }
.antwort:disabled { cursor: default; }
.antwort--dunkel { background: transparent; border-color: rgba(255, 255, 255, .4); color: #fff; }
.antwort--dunkel:hover { border-color: #fff; }
.antwort--dunkel .antwort__buchstabe { background: #fff; color: var(--wsi-anthrazit); }
.antwort--dunkel[aria-pressed="true"], .antwort--dunkel.antwort--gewaehlt { border-color: var(--wsi-akzent-hell); background: rgba(91, 192, 235, .16); }
.antwort--dunkel.antwort--richtig { border-color: #6fd08a; background: rgba(111, 208, 138, .16); }
.antwort--dunkel.antwort--falsch { border-color: #ff8a96; background: rgba(255, 138, 150, .16); }

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px var(--abstand-5); border-bottom: 1px solid var(--linie-hell); }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: var(--abstand-3) 2px; color: var(--text-gedaempft); font-weight: var(--gewicht-mittel);
}
.tab:hover { color: var(--wsi-schiefer); }
.tab[aria-selected="true"] { color: var(--wsi-schiefer); border-bottom-color: var(--wsi-akzent); }
.tab-panel { padding-top: var(--abstand-4); }
.tab-panel[hidden] { display: none; }
html:not(.js) .tab-panel[hidden] { display: block; }  /* ohne JavaScript gibt es keine Reiter: alle Bereiche stehen untereinander */
html:not(.js) .tabs[role="tablist"] { display: none; }

/* ---------- Hinweisboxen ---------- */
.hinweis {
  display: flex; gap: var(--abstand-3); align-items: flex-start; border: 2px solid var(--wsi-blau);
  background: var(--wsi-info-hell); border-radius: var(--radius-karte); padding: 16px 18px; color: var(--text);
}
.hinweis .icon { margin-top: 1px; color: var(--wsi-blau); }
.hinweis__titel { font-weight: var(--gewicht-mittel); color: var(--text-ueberschrift); font-size: var(--groesse-l); }
.hinweis--gold { border-color: var(--wsi-gold); background: var(--wsi-gold-hell); }
.hinweis--gold .icon { color: var(--wsi-gold-dunkel); }
.hinweis--erfolg { border-color: var(--wsi-gruen); background: var(--wsi-gruen-hell); }
.hinweis--erfolg .icon { color: var(--wsi-gruen); }
.hinweis--fehler { border-color: var(--wsi-rot); background: var(--wsi-rot-hell); }
.hinweis--fehler .icon { color: var(--wsi-rot); }

/* ---------- Toast ---------- */
.toast-bereich {
  position: fixed; right: var(--abstand-4); bottom: var(--abstand-4); z-index: 1100;
  display: flex; flex-direction: column; gap: var(--abstand-2); width: min(360px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; gap: var(--abstand-3); align-items: flex-start;
  background: var(--wsi-anthrazit); color: var(--text-auf-dunkel); border-left: 4px solid var(--wsi-akzent);
  border-radius: var(--radius-karte); box-shadow: var(--schatten-overlay), 0 0 0 1px rgb(255 255 255 / .32); padding: 12px 16px; /* heller Rand: Auf der dunklen Fußzeile verschmölze er sonst mit ihr */
  animation: toast-ein 200ms ease-out;
}
.toast--success { border-left-color: #6fd08a; }
.toast--warning { border-left-color: var(--wsi-hinweis-gelb); }
.toast--error { border-left-color: #ff8a96; }
.toast__text { flex: 1 1 auto; }
.toast__symbol { flex: none; width: 20px; height: 20px; color: var(--wsi-hinweis-gelb); }
@keyframes toast-ein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal (natives <dialog>: Fokusfalle und Esc inklusive) ---------- */
.modal {
  border: 0; padding: 0; border-radius: var(--radius-karte); box-shadow: var(--schatten-overlay);
  width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--flaeche); color: var(--text);
}
.modal::backdrop { background: rgba(10, 14, 20, .72); }
.modal[open] { animation: modal-ein 200ms ease-out; }
.modal__innen { padding: var(--abstand-5); display: flex; flex-direction: column; gap: var(--abstand-4); }
.modal__fuss { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--abstand-3); }
.modal--dunkel { background: var(--wsi-anthrazit); color: var(--text-auf-dunkel); }
.modal--dunkel h2, .modal--dunkel h3 { color: var(--text-auf-dunkel); }
@keyframes modal-ein { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .toast, .modal[open] { animation: none; }
}

/* ---------- Level-up-Overlay (P12.3, D-SPIEL): weiße Karte 420 px, Ring mit der neuen Zahl, „Weiter“; Konfetti auf eigener Leinwand ---------- */
.levelup { text-align: center; overflow: visible; }
.levelup__innen { align-items: center; }
.levelup__kopf { margin: 0; font-size: var(--groesse-s); font-weight: var(--gewicht-mittel); letter-spacing: var(--laufweite-label); text-transform: uppercase; color: var(--wsi-gold-dunkel); }
.levelup__ring.ring { width: 128px; height: 128px; }
.levelup__ring .ring__spur { stroke: var(--spur); }
.levelup__ring .ring__bogen { stroke-dashoffset: 0; animation: levelup-ring 900ms ease-out; }
.levelup__ring .ring__mitte { color: var(--text-ueberschrift); }
.levelup__ring .ring__zahl { font-size: 40px; }
.levelup__ring .ring__text { color: var(--text-gedaempft); }
.levelup__zahl--neu { animation: levelup-sprung 360ms ease-out; }
.levelup__titel { margin: 0; font-size: var(--groesse-xl); color: var(--text-ueberschrift); }
.levelup__punkte { margin: 0; font-size: var(--groesse-l); font-weight: var(--gewicht-fett); color: var(--wsi-gruen); }
.levelup .modal__fuss { justify-content: center; }
.levelup__konfetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@keyframes levelup-ring { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes levelup-sprung { from { transform: scale(.6); } 60% { transform: scale(1.2); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .levelup__ring .ring__bogen, .levelup__zahl--neu { animation: none; }
}

/* ---------- Datumskachel (Live) ---------- */
.datumskachel {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  width: 52px; height: 64px; background: var(--wsi-anthrazit); color: #fff; border-radius: var(--radius-karte);
  font-size: var(--groesse-xs); line-height: 1.25; text-transform: uppercase; text-align: center;
}
.datumskachel__tag { font-size: var(--groesse-xl); font-weight: var(--gewicht-mittel); line-height: 1.15; }
.datumskachel--hell { background: var(--spur); color: var(--wsi-anthrazit); }

/* ---------- Abzeichen ---------- */
.abzeichen { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: var(--groesse-xs); }
.abzeichen__kreis {
  width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--wsi-gold-hell); border: 2px solid var(--wsi-gold); color: var(--wsi-gold-dunkel);
}
.abzeichen__kreis .icon { width: 24px; height: 24px; }
.abzeichen--info .abzeichen__kreis { background: var(--wsi-info-hell); border-color: var(--wsi-blau); color: var(--wsi-blau-dunkel); }
.abzeichen--offen { color: var(--text-gedaempft); }
.abzeichen--offen .abzeichen__kreis { background: var(--flaeche-grau); border: 2px dashed var(--deaktiviert); color: var(--text-gedaempft); }

/* ---------- Brotkrumen ---------- */
.brotkrumen { display: flex; flex-wrap: wrap; gap: var(--abstand-2); list-style: none; font-size: var(--groesse-m); color: var(--text-gedaempft); }
.brotkrumen li + li::before { content: "/"; margin-right: var(--abstand-2); color: var(--text-schwach); }

/* ---------- Programmwahl (ADR-043): Leiste unter dem Kopf, nur bei mehreren Einschreibungen mit Zugang ---------- */
.programmwahl { background: var(--flaeche-grau); border-bottom: 1px solid var(--linie-hell); }
.programmwahl__innen {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-2) var(--abstand-3);
  padding-top: var(--abstand-3); padding-bottom: var(--abstand-3);
}
.programmwahl__label { font-weight: var(--gewicht-mittel); color: var(--text-ueberschrift); }
.programmwahl__auswahl { width: auto; min-width: 220px; max-width: 100%; flex: 0 1 380px; }
@media (max-width: 640px) { .programmwahl__auswahl { flex-basis: 100%; } }

/* ---------- Formulare ---------- */
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld__label { font-weight: var(--gewicht-mittel); color: var(--text); }
.feld__pflicht { color: var(--wsi-rot); }
[data-zielgruppe][hidden] { display: none !important; } /* Live-Formulare: nur das Feld der gewählten Zielgruppe (js/zielgruppe.js) */
.feld__hilfe { font-size: var(--groesse-s); color: var(--text-gedaempft); }
.feld__fehler { font-size: var(--groesse-m); color: var(--wsi-rot); font-weight: var(--gewicht-mittel); }
.eingabe {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--linie-eingabe);
  border-radius: var(--radius-knopf); background: var(--flaeche); color: var(--text);
}
textarea.eingabe { min-height: 96px; resize: vertical; }
.eingabe::placeholder { color: var(--text-gedaempft); opacity: 1; }
.eingabe:hover { border-color: var(--text-gedaempft); }
.eingabe[aria-invalid="true"] { border-color: var(--wsi-rot); }
.eingabe:disabled { background: var(--flaeche-grau); color: var(--text-gedaempft); cursor: not-allowed; }
.auswahl { display: flex; align-items: flex-start; gap: var(--abstand-3); }
.auswahl input { width: 24px; height: 24px; margin: 0; accent-color: var(--wsi-blau); flex: none; /* Zielgröße WCAG 2.5.8: mindestens 24 × 24 px */ }
.formular-fehler { border: 2px solid var(--wsi-rot); background: var(--wsi-rot-hell); border-radius: var(--radius-karte); padding: var(--abstand-3) var(--abstand-4); }
/* Karte mit Formular (Anmelden, Passwort): schmal und zentriert */
.formularkarte { max-width: 460px; margin: var(--abstand-6) auto 0; }

/* ---------- Tabellen ---------- */
.tabelle-rahmen { position: relative; /* hält `.nur-lesegeraet` (absolut) im Rahmen – sonst wächst die Seite seitlich */ overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--radius-karte); background: var(--flaeche); }
.tabelle { width: 100%; border-collapse: collapse; font-size: var(--groesse-m); }
.tabelle caption { text-align: left; padding: var(--abstand-3) var(--abstand-4); color: var(--text-gedaempft); }
.tabelle th, .tabelle td { padding: 10px var(--abstand-4); text-align: left; border-bottom: 1px solid var(--linie-hell); vertical-align: middle; }
.tabelle thead th {
  font-size: var(--groesse-s); font-weight: var(--gewicht-mittel); color: var(--text-gedaempft);
  border-bottom: 2px solid var(--linie-hell); white-space: nowrap; background: var(--flaeche-hell);
}
.tabelle tbody tr:last-child th, .tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle tbody tr:hover { background: var(--flaeche-hell); }
/* Links in Tabellen sind Klickziele, kein Fließtext: mindestens 24 px hoch (WCAG 2.5.8); der negative Rand hält die Zeilenhöhe */
.tabelle td a, .tabelle th a { display: inline-block; padding: 4px 0; margin: -4px 0; }
/* Links außerhalb von Fließtext (Brotkrumen, Rücklinks, Titel und Listen) sind mindestens 24 px hoch (WCAG 2.5.8, P14.7): ein `inline`-Link ignoriert `min-height`, darum `inline-flex`. */
.ziel-link, .brotkrumen a, .live-naechster__titel a, .live-zeile__titel a, .blockkarte__link, .pruefung__zeile > a { display: inline-flex; align-items: center; min-height: 24px; }
.tabelle .zahl-spalte { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle--fix th:first-child, .tabelle--fix td:first-child {
  position: sticky; left: 0; background: var(--flaeche); z-index: 1; border-right: 1px solid var(--linie-hell);
}
.tabelle--fix thead th:first-child { background: var(--flaeche-hell); }
.tabelle tr.zeile--hervor td, .tabelle tr.zeile--hervor th { background: var(--wsi-info-hell); }

/* ---------- Liste (Rangliste u. ä.) ---------- */
.rang { display: flex; flex-direction: column; gap: 6px; list-style: none; }
.rang li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-karte); background: var(--flaeche-hell); }
.rang li[aria-current="true"] { background: var(--wsi-info-hell); font-weight: var(--gewicht-fett); }
.rang__platz { width: 22px; font-weight: var(--gewicht-fett); color: var(--text-ueberschrift); }
.rang__name { flex: 1 1 auto; }
.rang__wert { color: var(--text-gedaempft); font-variant-numeric: tabular-nums; }

/* ---------- Nur für den Styleguide ---------- */
.farbprobe { padding: var(--abstand-2) var(--abstand-3); font-size: var(--groesse-m); color: #fff; }
.farbprobe--schiefer { background: var(--wsi-schiefer); }
.farbprobe--anthrazit { background: var(--wsi-anthrazit); }
.farbprobe--blau { background: var(--wsi-blau); }
.farbprobe--gruen { background: var(--wsi-gruen); }
.farbprobe--rot { background: var(--wsi-rot); }
.farbprobe--gold { background: var(--wsi-gold); color: var(--text); }
.farbprobe--akzent { background: var(--wsi-akzent); color: var(--text); }
.icon-liste { gap: var(--abstand-4); }
.icon-liste__eintrag { display: flex; flex-direction: column; align-items: center; gap: var(--abstand-1); width: 96px; }

/* ---------- Fehlerseiten (403/404/500) ---------- */
.fehlerseite { max-width: 560px; margin: var(--abstand-6) auto; text-align: center; align-items: center; }
.fehlerseite__code { font-size: 72px; font-weight: var(--gewicht-leicht); line-height: 1; color: var(--wsi-blau); }

/* D-KOMP: Der Titel einer Karte ist 22 px groß (nicht die 28 px, die ein h2 sonst hat); darunter 18 px und 15 px (P14.7) */
.karte h2 { font-size: var(--groesse-xl); }
.karte h3 { font-size: var(--groesse-l); }
.karte h4 { font-size: var(--groesse-basis); }
