/* Vorlesungsbogen – eigenes, schlankes CSS (keine Bibliothek).
   Aufbau: Schriften · Farben/Variablen · Grundlagen · Rahmen (Dozent/Studierende) · Komponenten · Hilfsklassen.
   Klassennamen sind deutsch; Varianten mit „--“, Teile mit „__“. Keine Inline-Styles (CSP!). */

/* ---------- Schriften (lokal, SIL OFL) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }

/* ---------- Variablen ---------- */
:root {
  --hintergrund: #F3F5F8;
  --flaeche: #FFFFFF;
  --text: #16202E;
  --leise: #55627A;
  --linie: #D9DFE8;
  --linie-stark: #8793A8;
  --linie-hell: #C9D2DF;
  --primaer: #1F4E8C;
  --primaer-dunkel: #163A69;
  --primaer-hell: #EAF0F8;
  --marke: #E2001A;
  --kopf: #16202E;
  --ok-bg: #E5F3EC;   --ok-text: #14522F;   --ok-voll: #1E6B45;
  --warn-bg: #FBF0D9; --warn-text: #6B4500; --warn-voll: #C98A12;
  --spaet-bg: #FBE9EA; --spaet-text: #8A1A23;
  --neutral-bg: #EEF1F5;
  --ki-rand: #5B3FA8; --ki-bg: #F1EDFB; --ki-text: #44298A; --ki-inhalt: #2B1C5C;
  --fokus: #1F4E8C;
  --radius: 8px;
  --radius-gross: 10px;
  --schrift: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --schrift-titel: "Space Grotesk", Inter, system-ui, sans-serif;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hintergrund); color: var(--text); font-family: var(--schrift); font-size: 16px; line-height: 1.45; }
a { color: var(--primaer); }
a:hover { color: var(--primaer-dunkel); }
h1, h2, h3 { font-family: var(--schrift-titel); font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
.kopfzeile :focus-visible { outline-color: #FFFFFF; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Rahmen: Dozent ---------- */
.d-seite { font-size: 15px; min-height: 100vh; display: flex; flex-direction: column; }
.kopfzeile { background: var(--kopf); color: #FFFFFF; }
.kopfzeile__innen { max-width: 1200px; margin: 0 auto; padding: 0 24px; min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.marke { display: flex; align-items: center; gap: 10px; font-family: var(--schrift-titel); font-weight: 600; font-size: 16px; color: inherit; text-decoration: none; }
.marke:hover { color: inherit; }
.marke__zeichen { width: 12px; height: 12px; background: var(--marke); display: block; flex: none; }
.kurswahl { position: relative; }
.kurswahl > summary { list-style: none; cursor: pointer; height: 36px; padding: 0 12px; border: 1px solid var(--leise); border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; }
.kurswahl > summary::-webkit-details-marker { display: none; }
.kurswahl > summary::after { content: "▾"; }
.kurswahl__liste { position: absolute; z-index: 20; top: 42px; left: 0; min-width: 260px; background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(22, 32, 46, .18); padding: 6px; margin: 0; list-style: none; }
.kurswahl__liste button { width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.kurswahl__liste button:hover, .kurswahl__liste button[aria-current="true"] { background: var(--primaer-hell); }
.hauptnav { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-left: auto; align-items: center; }
.hauptnav a { color: var(--linie-hell); text-decoration: none; padding: 16px 0; border-bottom: 2px solid transparent; }
.hauptnav a:hover { color: #FFFFFF; }
.hauptnav a[aria-current="page"] { color: #FFFFFF; font-weight: 600; border-bottom-color: #FFFFFF; }
.hauptnav form { margin: 0; }
.hauptnav .knopf-link { color: var(--linie-hell); }
.inhalt { width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Rahmen: Studierende (Handy zuerst) ---------- */
.s-seite { min-height: 100vh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; }
.s-kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.s-kopf__zeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--leise); }
.s-kopf__zeile form { margin: 0; }
.s-kopf h1 { font-size: 24px; }
.s-inhalt { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.s-fuss { margin-top: auto; padding: 16px 20px 20px; font-size: 14px; color: var(--leise); }
.s-fuss--leiste { background: var(--flaeche); border-top: 1px solid var(--linie); position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; color: var(--text); }
.s-fuss--leiste .knopf { min-height: 48px; flex: 1 1 auto; max-width: 260px; }
/* feste Leisten (Student: Abgabe, Dozent: Bewertung) dürfen fokussierte Elemente nie verdecken */
html:has(.s-fuss--leiste) { scroll-padding-bottom: 96px; }
html:has(.bw-fuss) { scroll-padding-bottom: 150px; }
main:has(.s-fuss--leiste) { padding-bottom: 0; }
.s-inhalt > .s-fuss--leiste { margin: 8px -20px 0; }

/* ---------- Rahmen: Anmeldung ---------- */
.e-seite { min-height: 100vh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; }
.e-kopf { display: flex; align-items: center; gap: 10px; padding: 20px 20px 0; }
.e-kopf .marke { font-size: 17px; }
.e-kopf .marke__zeichen { width: 14px; height: 14px; }
.e-inhalt { padding: 56px 20px 0; display: flex; flex-direction: column; gap: 28px; }
.e-inhalt h1 { font-size: 30px; line-height: 1.15; }
.e-fuss { margin-top: auto; padding: 20px; font-size: 14px; color: var(--leise); display: flex; justify-content: space-between; gap: 12px; }

/* ---------- Seitenkopf innerhalb des Inhalts ---------- */
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.seitenkopf__titel { display: flex; flex-direction: column; gap: 6px; }
.seitenkopf__aktionen { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.brotkrumen { font-size: 13px; color: var(--leise); }
.untertitel { color: var(--leise); }
.titel-zusatz { font-size: 16px; color: var(--leise); font-weight: 500; }

/* ---------- Spaltenlayout ---------- */
.spalten { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.spalten__haupt { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.spalten__seite { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.spalten__nav { flex: 1 1 220px; min-width: 0; }
.stapel { display: flex; flex-direction: column; gap: 12px; }
.stapel--eng { gap: 6px; }
.stapel--weit { gap: 20px; }
.zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.zeile--verteilt { justify-content: space-between; }
.raster-kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; }

/* ---------- Karte ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.karte--gross { padding: 18px; gap: 12px; }
.karte--hervorgehoben { border: 2px solid var(--primaer); }
.karte--link { text-decoration: none; color: var(--text); }
.karte--link:hover { color: var(--text); border-color: var(--primaer-dunkel); }
.karte--grau { background: var(--hintergrund); border: 0; border-radius: var(--radius); padding: 12px 14px; }
.karte__kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.karte__titel { font-weight: 600; font-size: 17px; }
.uebertitel { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--leise); font-weight: 600; }

/* ---------- Schaltflächen ---------- */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--radius); border: 1.5px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.knopf--primaer { background: var(--primaer); color: #FFFFFF; border-color: var(--primaer); }
.knopf--primaer:hover { background: var(--primaer-dunkel); border-color: var(--primaer-dunkel); color: #FFFFFF; }
.knopf--sekundaer { background: var(--flaeche); color: var(--text); border-color: var(--linie-stark); font-weight: 500; }
.knopf--sekundaer:hover { border-color: var(--text); color: var(--text); }
.knopf--umriss { background: var(--flaeche); color: var(--primaer); border-color: var(--primaer); }
.knopf--umriss:hover { background: var(--primaer-hell); }
.knopf--still { background: transparent; color: var(--leise); font-weight: 400; }
.knopf--still:hover { color: var(--text); text-decoration: underline; }
.knopf--klein { min-height: 36px; padding: 0 12px; border-radius: 6px; }
.knopf--gross { min-height: 52px; width: 100%; font-size: 16px; }
.knopf[disabled], .knopf[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.knopf-link { background: none; border: 0; padding: 0; color: var(--primaer); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.umschalter { display: inline-flex; border: 1.5px solid var(--linie-stark); border-radius: var(--radius); overflow: hidden; }
.umschalter a, .umschalter button { min-height: 38px; padding: 0 14px; border: 0; background: var(--flaeche); color: var(--text); text-decoration: none; display: inline-flex; align-items: center; }
.umschalter [aria-current="page"], .umschalter [aria-pressed="true"] { background: var(--kopf); color: #FFFFFF; font-weight: 500; }

/* ---------- Status-Pillen ---------- */
.pille { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--neutral-bg); color: var(--leise); }
.pille--ok { background: var(--ok-bg); color: var(--ok-text); }
.pille--warn { background: var(--warn-bg); color: var(--warn-text); }
.pille--spaet { background: var(--spaet-bg); color: var(--spaet-text); }
.pille--neutral { background: var(--neutral-bg); color: var(--leise); }
.pille--individuell { background: var(--kopf); color: #FFFFFF; }
.text-ok { color: var(--ok-text); }
.text-warn { color: var(--warn-text); }
.text-spaet { color: var(--spaet-text); }

/* ---------- Formulare ---------- */
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld__label, .feld > label { font-weight: 600; font-size: 15px; }
.feld__hilfe { font-size: 14px; color: var(--leise); }
.feld__fehler { font-size: 14px; color: var(--spaet-text); font-weight: 500; }
.eingabe, .feld input[type="text"], .feld input[type="email"], .feld input[type="number"], .feld input[type="date"],
.feld input[type="datetime-local"], .feld input[type="time"], .feld select, .feld textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--linie-stark); border-radius: var(--radius); background: var(--flaeche); color: var(--text); line-height: 1.45;
}
.feld textarea, textarea.eingabe { resize: vertical; }
.eingabe--gross { min-height: 52px; padding: 0 14px; }
.eingabe--punkte { width: 64px; min-height: 40px; text-align: right; padding: 0 10px; font-variant-numeric: tabular-nums; }
[aria-invalid="true"] { border-color: var(--spaet-text) !important; }
fieldset.feld { border: 0; margin: 0; padding: 0; }
fieldset.feld > legend { font-weight: 600; line-height: 1.4; padding: 0 0 8px; }
.wahl { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 1.5px solid var(--linie-hell); border-radius: var(--radius); background: var(--flaeche); cursor: pointer; }
.wahl input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--primaer); }
.wahl:has(input:checked) { border: 2px solid var(--primaer); background: var(--primaer-hell); font-weight: 500; }
.skala { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 6px; }
.skala label { position: relative; }
.skala input { position: absolute; opacity: 0; inset: 0; }
.skala span { display: flex; align-items: center; justify-content: center; height: 48px; border: 1.5px solid var(--linie-hell); border-radius: var(--radius); background: var(--flaeche); cursor: pointer; }
.skala input:checked + span { border: 2px solid var(--primaer); background: var(--primaer-hell); font-weight: 600; }
.skala input:focus-visible + span { outline: 3px solid var(--fokus); outline-offset: 2px; }
.skala__beschriftung { display: flex; justify-content: space-between; font-size: 13px; color: var(--leise); padding-top: 6px; }
.upload { min-height: 64px; border: 1.5px dashed var(--linie-stark); border-radius: var(--radius); background: var(--hintergrund); color: var(--primaer); font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; }
.inline-form { display: inline; margin: 0; }

/* ---------- Tabellen ---------- */
.tabelle-box { position: relative; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); overflow-x: auto; }
.tabelle { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tabelle th { text-align: left; color: var(--leise); font-size: 13px; font-weight: 600; padding: 10px 14px; }
.tabelle td { padding: 12px 14px; border-top: 1px solid var(--linie); vertical-align: top; }
.tabelle .rechts { text-align: right; }
.tabelle tr[aria-current="true"] { background: var(--primaer-hell); }
.tabelle__zusatz { font-size: 13px; color: var(--leise); padding-top: 2px; }

/* ---------- Listen-Navigation (z. B. Abgaben links) ---------- */
.liste-nav { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.liste-nav__kopf { padding: 8px 10px; font-size: 13px; color: var(--leise); font-weight: 600; }
.liste-nav a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.liste-nav a:hover { background: var(--hintergrund); }
.liste-nav a[aria-current="true"], .liste-nav a[aria-current="page"] { background: var(--primaer-hell); font-weight: 600; }
.einfache-liste { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.einfache-liste li { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- Kennzahl ---------- */
.kennzahl__label { font-size: 13px; color: var(--leise); }
.kennzahl__wert { font-family: var(--schrift-titel); font-weight: 600; font-size: 24px; font-variant-numeric: tabular-nums; }
.kennzahl__wert--gross { font-size: 36px; }
.kennzahl__zusatz { font-size: 15px; color: var(--leise); font-weight: 500; }
.punkte { font-family: var(--schrift-titel); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zahl { font-variant-numeric: tabular-nums; }

/* ---------- Fortschritt ---------- */
.fortschritt { display: flex; gap: 4px; }
.fortschritt__teil { flex: 1; height: 6px; border-radius: 3px; background: var(--linie-hell); }
.fortschritt__teil--fertig { background: var(--primaer); }
.balken { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--linie-hell); }
.balken progress { display: none; }
.legende { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.legende__eintrag { display: flex; justify-content: space-between; gap: 8px; }
.legende__farbe { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; background: var(--linie-hell); }
.farbe-ok { background: var(--ok-voll); }
.farbe-warn { background: var(--warn-voll); }
.farbe-leer { background: var(--linie-hell); }
/* Breiten ohne Inline-Styles: Klassen b-0 … b-100 in 5er-Schritten */
.b-0{width:0}.b-5{width:5%}.b-10{width:10%}.b-15{width:15%}.b-20{width:20%}.b-25{width:25%}.b-30{width:30%}.b-35{width:35%}.b-40{width:40%}.b-45{width:45%}.b-50{width:50%}.b-55{width:55%}.b-60{width:60%}.b-65{width:65%}.b-70{width:70%}.b-75{width:75%}.b-80{width:80%}.b-85{width:85%}.b-90{width:90%}.b-95{width:95%}.b-100{width:100%}

/* ---------- KI-Block (violett gestrichelt) ---------- */
.ki-block { border: 1.5px dashed var(--ki-rand); background: var(--ki-bg); border-radius: var(--radius-gross); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ki-inhalt); }
.ki-block__kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ki-block__titel { font-weight: 600; color: var(--ki-text); }
.ki-block__hinweis { font-size: 13px; color: var(--ki-text); }
.ki-block__punkte { font-family: var(--schrift-titel); font-weight: 600; font-size: 20px; color: var(--ki-text); font-variant-numeric: tabular-nums; }
.ki-block__eintrag { background: var(--flaeche); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.ki-block__text { line-height: 1.5; white-space: pre-line; }
.ki-block--fehler { border-color: var(--spaet-text); background: var(--spaet-bg); color: var(--spaet-text); }
.ki-knopf { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1.5px dashed var(--ki-rand); border-radius: var(--radius); background: var(--ki-bg); color: var(--ki-text); font-weight: 600; cursor: pointer; }
.ki-knopf:hover { background: #E7E0F8; }
.ki-laeuft::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid var(--ki-rand); border-right-color: transparent; border-radius: 50%; animation: drehen 0.9s linear infinite; vertical-align: -1px; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ki-laeuft::before { animation: none; } }

/* ---------- Meldungen ---------- */
.meldung { border-radius: var(--radius); padding: 14px 16px; line-height: 1.45; font-size: 15px; background: var(--primaer-hell); color: var(--primaer-dunkel); }
.meldung--ok { background: var(--ok-bg); color: var(--ok-text); }
.meldung--warn { background: var(--warn-bg); color: var(--warn-text); }
.meldung--fehler { background: var(--spaet-bg); color: var(--spaet-text); }
.leer { border: 1.5px dashed var(--linie-hell); border-radius: var(--radius-gross); padding: 24px 16px; text-align: center; color: var(--leise); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.leer__titel { font-weight: 600; color: var(--text); }

/* ---------- Hilfsklassen ---------- */
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.mittel { font-size: 14px; }
.fett { font-weight: 600; }
.rechts { text-align: right; }
.trenner { border-top: 1px solid var(--linie); padding-top: 12px; }
.umbruch { white-space: pre-line; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.visuell-versteckt { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 640px) {
  .kopfzeile__innen { padding: 0 16px; gap: 4px 16px; }
  .hauptnav { margin-left: 0; gap: 2px 16px; }
  .hauptnav a { padding: 10px 0; }
  .inhalt { padding: 16px; }
  h1 { font-size: 24px; }
  .s-inhalt, .s-kopf { padding-left: 16px; padding-right: 16px; }
  .s-inhalt > .s-fuss--leiste { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

/* ---------- Druck ---------- */
@media print {
  .kopfzeile, .hauptnav, .knopf, .ki-block, .ki-knopf { display: none !important; }
  body { background: #FFFFFF; }
}

/* ---------- Stammdaten: Kurse, Studierende, Einstellungen (Bereich dozent.stamm, additiv) ---------- */
.raster-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.raster-kennzahlen--eng { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px 16px; }
.formular-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 16px; }
.karte--gefahr { border-color: var(--spaet-text); }
.knopf--gefahr { background: var(--spaet-text); color: #FFFFFF; border-color: var(--spaet-text); }
.knopf--gefahr:hover { background: #6B1119; border-color: #6B1119; color: #FFFFFF; }
.suche { flex: 1 1 260px; max-width: 420px; }
.tabelle caption { text-align: left; }
.tabelle th a { color: inherit; text-decoration: none; }
.tabelle th a:hover { text-decoration: underline; }
.tabelle th[aria-sort="ascending"] a::after { content: " ▲"; font-size: 11px; }
.tabelle th[aria-sort="descending"] a::after { content: " ▼"; font-size: 11px; }
.beispiel { margin: 0; padding: 10px 12px; background: var(--hintergrund); border-radius: var(--radius); font-size: 13px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.definitionen { margin: 0; display: grid; grid-template-columns: 1fr; gap: 2px; font-size: 14px; }
.definitionen dt { color: var(--leise); font-size: 13px; margin-top: 8px; }
.definitionen dd { margin: 0; font-weight: 500; }
.blaettern { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.knopf[disabled] { pointer-events: none; }
/* ===== Abschluss und Berichte (Präsentationen, Noten, Berichte) ===== */
.kriterium { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linie); }
.kriterium:last-child { border-bottom: 1px solid var(--linie); }
.kriterium__text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kriterium__eingabe { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rechnung { display: flex; flex-direction: column; gap: 8px; font-variant-numeric: tabular-nums; }
.rechnung__zeile { display: flex; justify-content: space-between; gap: 12px; }
.rechnung__summe { border-top: 1px solid var(--linie); padding-top: 8px; font-weight: 600; }
.note-gross { font-family: var(--schrift-titel); font-weight: 600; font-size: 32px; font-variant-numeric: tabular-nums; }
.tabelle--breit { min-width: 820px; }
.tabelle caption { text-align: left; }
.tabelle th a { color: inherit; text-decoration: none; }
.tabelle th a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .kriterium { align-items: flex-start; flex-direction: column; }
}
/* ===== Vorlesungstage und Fragen (Agent B2) – nur ergänzend ===== */
.tabelle td.aktionen { white-space: nowrap; text-align: right; }
.tabelle td.aktionen > * { vertical-align: middle; }
.titel-hoehe { min-height: 36px; display: flex; align-items: center; }
.auswahl-liste { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.option-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.option-zeile .pille { justify-self: end; }
.eingabe--schmal { width: auto; min-width: 80px; }
details.karte > summary { cursor: pointer; }
@media (max-width: 640px) {
  .option-zeile { grid-template-columns: minmax(0, 1fr); }
  .option-zeile .wahl { min-height: 40px; }
}

/* ===== Gestapelte Tabellen und Tippflächen auf schmalen Bildschirmen =====
   Jede Zelle trägt data-label (= Spaltenbeschriftung); unter 820 px (Tabellen) wird jede Zeile zur Karte, unter 640 px werden Tippflächen 44 px hoch. */
.spalten, .stapel, .karte, .inhalt > * { min-width: 0; }
/* break-word statt anywhere: sonst schrumpft die Textspalte am Desktop auf Buchstabenbreite */
.tabelle td, .tabelle th { overflow-wrap: break-word; }
.tabelle th { white-space: nowrap; }
.tabelle td.nowrap { overflow-wrap: normal; }
.tabelle td .umbruch { overflow-wrap: break-word; }
/* Textspalte behält Lesebreite; Aktionen brechen um, statt die Tabelle über den Kasten hinauszuschieben */
.tabelle td:has(> .umbruch) { min-width: 260px; }
.tabelle td.aktionen { white-space: normal; }
.tabelle td.aktionen > * { margin: 2px 0 2px 4px; }
@media (max-width: 820px) {
  .tabelle td, .tabelle td .umbruch { overflow-wrap: anywhere; }
  .tabelle-box { background: none; border: 0; border-radius: 0; overflow: visible; }
  .tabelle, .tabelle--breit { min-width: 0; display: block; }
  .tabelle caption { display: block; }
  .tabelle thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabelle tbody, .tabelle tfoot { display: block; }
  .tabelle tbody tr { display: block; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 2px 14px; margin-bottom: 10px; }
  .tabelle tbody tr[aria-current="true"] { background: var(--primaer-hell); }
  .tabelle td { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 12px; border-top: 1px solid var(--linie); padding: 9px 0; text-align: left; white-space: normal; }
  .tabelle td:first-child { border-top: 0; }
  .tabelle td[data-label] { grid-template-columns: minmax(84px, 32%) minmax(0, 1fr); align-items: start; }
  .tabelle td[data-label]::before { content: attr(data-label); color: var(--leise); font-size: 13px; font-weight: 600; padding-top: 2px; }
  .tabelle td.rechts, .tabelle td.aktionen { text-align: left; }
  .tabelle td.nowrap { white-space: normal; }
  .tabelle td:empty { display: none; }
  .tabelle td.aktionen, .tabelle td.aktionen[data-label] { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; white-space: normal; }
  .tabelle td.aktionen::before { display: none; }
  .tabelle td .zeile, .tabelle td .zeile.nowrap { gap: 8px; white-space: normal; }
  .tabelle td .pille { white-space: normal; }
  .tabelle td a:not(.knopf) { display: inline-flex; align-items: center; min-height: 44px; }
  .tabelle td .tabelle__zusatz a { min-height: 44px; }
  .tabelle tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 6px 14px; }
  .tabelle tfoot td { display: block; border: 0; padding: 4px 0; }
  .tabelle td input.eingabe, .tabelle td input.eingabe--punkte { width: 100%; text-align: left; }

}
@media (max-width: 640px) {
  /* Tippflächen: mindestens 44 px */
  .knopf, .knopf--klein { min-height: 44px; }
  .knopf--klein { min-width: 44px; }
  .knopf-link, .s-kopf__zeile a, .hauptnav a, .brotkrumen a { display: inline-flex; align-items: center; min-height: 44px; }
  .hauptnav a { padding: 0; }
  .brotkrumen a { min-height: 32px; }
  .kurswahl > summary { height: 44px; }
  .kurswahl__liste button { min-height: 44px; }
  .umschalter a, .umschalter button { min-height: 44px; }
  .ki-knopf { min-height: 44px; }
  .eingabe--punkte { min-height: 44px; }
  .liste-nav a { min-height: 44px; align-items: center; }
}
/* ---------- Fehlgeschlagenes Speichern (bogen.js) ---------- */
.speicher-meldung { position: sticky; top: 0; z-index: 50; }
.speicher-meldung:empty { display: none; }
.speicher-meldung .meldung { border-radius: 0; border-bottom: 2px solid var(--spaet-text); font-weight: 500; text-align: center; }
.nicht-gespeichert { outline: 2px solid var(--spaet-text); outline-offset: 2px; }
