:root {
  --bg: #f4f5f3;
  --flaeche: #ffffff;
  --flaeche-2: #eceeeb;
  --text: #1a1d1c;
  --text-2: #545c59;
  --rand: #d3d8d4;
  --akzent: #0e6a6a;
  --akzent-text: #ffffff;
  --akzent-weich: #dcefee;
  --ich: #e3edf7;
  --ich-text: #13283d;
  --gut: #2f6b3a;
  --gut-weich: #e2f0e4;
  --stopp: #a3271f;
  --stopp-weich: #fbe5e2;
  --aus: #b9b1a6;
  --bot: #6b4fa0;
  --bot-weich: #ece6f6;
  --radius: 12px;
  --schatten: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 16px rgb(0 0 0 / 0.05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131615;
    --flaeche: #1c201f;
    --flaeche-2: #262b29;
    --text: #eaefec;
    --text-2: #a9b3af;
    --rand: #353c39;
    --akzent: #5cc8bf;
    --akzent-text: #0b1b1a;
    --akzent-weich: #173533;
    --ich: #1f3347;
    --ich-text: #dbe9f7;
    --gut: #7cc78a;
    --gut-weich: #1f3324;
    --stopp: #f08a80;
    --stopp-weich: #3d1f1c;
    --aus: #5a534a;
    --bot: #b9a2e6;
    --bot-weich: #2b2438;
    --schatten: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #131615;
  --flaeche: #1c201f;
  --flaeche-2: #262b29;
  --text: #eaefec;
  --text-2: #a9b3af;
  --rand: #353c39;
  --akzent: #5cc8bf;
  --akzent-text: #0b1b1a;
  --akzent-weich: #173533;
  --ich: #1f3347;
  --ich-text: #dbe9f7;
  --gut: #7cc78a;
  --gut-weich: #1f3324;
  --stopp: #f08a80;
  --stopp-weich: #3d1f1c;
  --aus: #5a534a;
  --bot: #b9a2e6;
  --bot-weich: #2b2438;
  --schatten: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0.2em 0 0.4em; }
h2 { font-size: 1.25rem; margin: 0 0 0.6em; }
p { margin: 0.4em 0; }
h3 { font-size: 1.05rem; margin: 0.8em 0 0.4em; }
a { color: var(--akzent); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.klein { font-size: 0.88rem; color: var(--text-2); }
.lead { color: var(--text-2); max-width: 62ch; }
.fehler { color: var(--stopp); font-size: 0.92rem; }
.gut { color: var(--gut); }
.zeile { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.zeile.rechts { justify-content: flex-end; }
.zeile.weit { justify-content: space-between; }
.stapel > * + * { margin-top: 1rem; }

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

.kopf {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.6rem 16px; border-bottom: 1px solid var(--rand); background: var(--flaeche);
}
.marke {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem;
}
.kopf nav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.kopf nav a { font-size: 0.9rem; }
main { max-width: 1100px; margin: 0 auto; padding: 1.2rem 16px 3rem; }

/* ---------- Elemente ---------- */

button {
  font: inherit; cursor: pointer; border: 1px solid var(--akzent);
  background: var(--akzent); color: var(--akzent-text);
  padding: 0.5rem 1rem; border-radius: 8px; font-weight: 600;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.zweit { background: transparent; color: var(--akzent); }
button.gefahr { background: transparent; color: var(--stopp); border-color: var(--stopp); }
button.link {
  background: none; border: none; padding: 0; color: var(--akzent);
  font-weight: 500; text-decoration: underline; text-underline-offset: 2px;
}
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--akzent); outline-offset: 2px;
}
input, textarea, select {
  font: inherit; color: var(--text); background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: 8px; padding: 0.5rem 0.7rem; min-width: 0;
}
textarea { width: 100%; resize: vertical; }
label { font-weight: 600; }

.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--schatten);
}
.hinweis {
  background: var(--akzent-weich); border-radius: 8px; padding: 0.7rem 0.9rem;
  margin: 0.8rem 0; font-size: 0.95rem;
}
.hinweis.ki { background: var(--bot-weich); }
.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 0.1rem 0.55rem;
  border-radius: 999px; background: var(--flaeche-2); color: var(--text-2); vertical-align: middle;
}
.badge.an { background: var(--akzent-weich); color: var(--akzent); }
.badge.bot { background: var(--bot-weich); color: var(--bot); }
.badge.stopp { background: var(--stopp-weich); color: var(--stopp); }
.badge.gut { background: var(--gut-weich); color: var(--gut); }

/* ---------- Start ---------- */

.start { max-width: 600px; margin: 1rem auto; padding: 1.5rem; }
.start h1 { text-align: center; }
.logo { display: block; margin: 0 auto 0.5rem; }
.formular { margin-top: 1rem; }
.formular label { display: block; margin-bottom: 0.3rem; }
.formular input { flex: 1; }
.code-feld { text-transform: uppercase; letter-spacing: 0.05em; }
.wahl { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 1rem; }

/* ---------- Gruppe ---------- */

.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--rand); margin: 1rem 0; flex-wrap: wrap; }
.tabs button {
  background: none; color: var(--text-2); border: none; border-bottom: 3px solid transparent;
  border-radius: 0; padding: 0.5rem 0.8rem;
}
.tabs button[aria-selected="true"] { color: var(--akzent); border-bottom-color: var(--akzent); }
.zwei { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.feld { margin-bottom: 0.9rem; }
.feld label { display: block; }
.feld .klein { margin: 0.1rem 0 0.3rem; }
.vorschau {
  white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem;
  background: var(--flaeche-2); border-radius: 8px; padding: 0.7rem; max-height: 320px; overflow: auto; margin: 0.4rem 0;
}
.quote { display: grid; grid-template-columns: 3.2rem 1fr 4.5rem; gap: 0.5rem; align-items: center; margin: 0.35rem 0; }
.quote .spur { height: 1.1rem; background: var(--flaeche-2); border-radius: 4px; overflow: hidden; }
.quote .spur > span { display: block; height: 100%; background: var(--akzent); }
.quote .wert { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.liste { padding-left: 1.2rem; margin: 0.4rem 0; }
.liste li + li { margin-top: 0.3rem; }
details.verlauf-box { border: 1px solid var(--rand); border-radius: 8px; padding: 0.5rem 0.8rem; margin: 0.5rem 0; background: var(--flaeche); }
details.verlauf-box summary { cursor: pointer; font-weight: 600; }
.tipp { border-left: 4px solid var(--akzent); padding: 0.4rem 0.8rem; margin: 0.6rem 0; background: var(--flaeche-2); border-radius: 0 8px 8px 0; }

/* ---------- Lehrperson ---------- */

.phasen { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.phasen button { background: var(--flaeche); color: var(--text); border-color: var(--rand); }
.phasen button[aria-current="true"] { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.kennzahlen { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 1rem 0; }
.kennzahlen .karte strong { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.tabelle-wrap { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabelle th, .tabelle td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.dialog {
  border: none; border-radius: var(--radius); padding: 1.2rem; max-width: 640px; width: calc(100% - 32px);
  background: var(--flaeche); color: var(--text);
}
.dialog::backdrop { background: rgb(0 0 0 / 0.5); }
.schmal { max-width: 440px; margin: 2rem auto; }

/* ---------- Beamer ---------- */

body.beamer main { max-width: 1400px; }
.beamer-seite { font-size: 1.35rem; }
.beamer-seite h1 { font-size: 2.4rem; }
.beamer-seite h2 { font-size: 1.7rem; }
.beamer-seite .quote { grid-template-columns: minmax(8rem, 14rem) 1fr 6rem; }
.beamer-seite .quote .spur { height: 1.8rem; }
.wolke { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; align-items: baseline; }
.wolke span { font-weight: 700; color: var(--akzent); }
.wolke.bot span { color: var(--bot); }
.spalten { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.gross-zahl { font-size: 3.2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }

.text-seite { max-width: 720px; }

@media (max-width: 820px) {
  .zwei { grid-template-columns: minmax(0, 1fr); }
  .beamer-seite { font-size: 1.1rem; }
}
.voll { width: 100%; }
.sr-reset { border: 0; padding: 0; margin: 0; min-width: 0; }
.abstand-oben { margin-top: 0.6rem; }
.knopf-link {
  display: inline-block; background: var(--akzent); color: var(--akzent-text); padding: 0.5rem 1rem;
  border-radius: 8px; text-decoration: none; font-weight: 600;
}
.untertitel { text-align: center; font-weight: 600; color: var(--akzent); margin-top: -0.3rem; }
.beamer-seite .klein, .beamer-seite .quote .wert, .beamer-seite .tabs button { font-size: 0.9em; }
.schalter { display: flex; gap: 0.4rem; align-items: flex-start; font-weight: 400; margin: 0.2rem 0 0.6rem; }
.schalter input { margin-top: 0.1rem; width: 1.3rem; height: 1.3rem; flex: none; accent-color: var(--akzent); cursor: pointer; }
.gut-box { background: var(--gut-weich); }
.warn-box { background: var(--stopp-weich); }
.warn-box q { font-style: italic; }
.start-warnung { background: var(--akzent); color: var(--akzent-text); font-size: 1.05rem; }
.start-warnung .gross-text { font-size: 1.4rem; font-weight: 800; margin: 0; }
.start-warnung button { background: var(--akzent-text); color: var(--akzent); border-color: var(--akzent-text); }
.start-warnung button.zweit { background: transparent; color: var(--akzent-text); }

/* ---------- Promptmeischter ---------- */

.knopf-zeile { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0; }
.vorschlaege { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.8rem; }
.vorschlaege button {
  background: var(--flaeche); color: var(--text); border: 1px solid var(--rand);
  font-weight: 500; font-size: 0.9rem; padding: 0.3rem 0.7rem; border-radius: 999px; text-align: left;
}
.vorschlaege button:hover { border-color: var(--akzent); }

.antworten { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 1rem 0; }
.antwort {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 0.8rem 1rem; box-shadow: var(--schatten); min-width: 0;
}
.antwort-kopf { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
.antwort-kopf strong { font-size: 1.05rem; }
.antwort.warte { color: var(--text-2); }
.antwort.ohne { border-left: 5px solid var(--aus); }
.antwort.mit { border-left: 5px solid var(--akzent); }
.ki-marke { font-size: 0.75rem; color: var(--bot); font-weight: 700; letter-spacing: 0.02em; }

.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 0.6em; }
.md ul { margin: 0 0 0.6em; padding-left: 1.3rem; }
.md .md-titel { font-weight: 700; }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--flaeche-2); padding: 0 0.2em; border-radius: 4px; }
.md hr { border: none; border-top: 1px solid var(--rand); }

.hinweise { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.hinweise li { font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--flaeche-2); color: var(--text-2); }
.hinweise li.ok { background: var(--gut-weich); color: var(--gut); }
.hinweise li.nein { background: var(--stopp-weich); color: var(--stopp); }

.skala { margin-top: 0.7rem; border-top: 1px solid var(--rand); padding-top: 0.6rem; }
.kriterium { margin-bottom: 0.5rem; }
.kriterium .name { font-weight: 600; font-size: 0.92rem; }
.stufen { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.2rem; }
.stufen button {
  background: var(--flaeche); color: var(--text); border: 2px solid var(--rand);
  min-width: 2.6rem; padding: 0.3rem 0.5rem; font-variant-numeric: tabular-nums;
}
.stufen button[aria-pressed="true"] { border-color: var(--akzent); background: var(--akzent); color: var(--akzent-text); }
.stufe-text { font-size: 0.8rem; color: var(--text-2); min-height: 1.2em; }

.diff { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--flaeche-2); border-radius: 8px; padding: 0.7rem; font-size: 0.92rem; }
.diff ins { background: var(--gut-weich); color: var(--gut); text-decoration: none; border-radius: 3px; padding: 0 0.1em; font-weight: 600; }
.diff del { background: var(--stopp-weich); color: var(--stopp); border-radius: 3px; padding: 0 0.1em; }
.legende { font-size: 0.8rem; color: var(--text-2); }
.legende ins, .legende del { font-size: 0.8rem; }

.prompt-feld { min-height: 9rem; font-size: 0.95rem; }
.feld-fuss { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: var(--text-2); }

.tipp-karte { border-left: 5px solid var(--akzent); }
.tipp-karte h2 { margin-bottom: 0.2rem; }
.aufgabe-text { background: var(--flaeche-2); border-radius: 8px; padding: 0.6rem 0.8rem; margin: 0.4rem 0; white-space: pre-wrap; }
.kriterien-liste { margin: 0.3rem 0 0; padding-left: 1.2rem; font-size: 0.92rem; }
.kriterien-liste li + li { margin-top: 0.3rem; }

.fortschritt { height: 10px; border-radius: 5px; background: var(--flaeche-2); overflow: hidden; margin: 0.5rem 0; }
.fortschritt > span { display: block; height: 100%; background: var(--akzent); transition: width 0.4s; }
@media (prefers-reduced-motion: reduce) { .fortschritt > span { transition: none; } }

.streu { width: 100%; max-width: 520px; height: auto; display: block; margin: 0.4rem 0; }
.streu text { fill: var(--text); font: 14px system-ui, sans-serif; }
.streu .achse { stroke: var(--rand); stroke-width: 1; }
.streu .punkt-o { fill: var(--aus); }
.streu .punkt-m { fill: var(--akzent); }
.streu .mittel { stroke: var(--text); stroke-width: 2.5; }
.zahlen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0.5rem 0; }
.zahlen .karte strong { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.vorschlag { border-left: 5px solid var(--akzent); }

.urteil-wahl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0.3rem 0 0.8rem; }
.urteil-wahl button { background: var(--flaeche); color: var(--text); border: 2px solid var(--rand); padding: 0.7rem 0.3rem; }
.urteil-wahl button[aria-pressed="true"][data-u="hilft"] { background: var(--gut); border-color: var(--gut); color: #fff; }
.urteil-wahl button[aria-pressed="true"][data-u="egal"] { background: var(--text-2); border-color: var(--text-2); color: var(--bg); }
.urteil-wahl button[aria-pressed="true"][data-u="schadet"] { background: var(--stopp); border-color: var(--stopp); color: #fff; }
.urteil-wahl button[aria-pressed="true"][data-u="nichtmessbar"] { background: #4a5a78; border-color: #4a5a78; color: #fff; }

/* Runde 2 und Häkchen */
.runde2-karte { border-left: 5px solid var(--akzent); }
.haken-liste { border: 0; padding: 0; margin: 0.5rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.haken-liste legend { font-weight: 700; margin-bottom: 0.3rem; padding: 0; }
.haken { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 400; cursor: pointer; }
.haken input { width: 1.1rem; height: 1.1rem; }

/* Poster (Beamer und Kartenvorschau) */
.poster { background: #fff; color: #1a1d1c; border-radius: var(--radius); padding: 1.5rem 1.5rem 1rem; }
.poster h1 { text-align: center; font-size: 2.6rem; margin: 0 0 0.2rem; }
.poster .unter { text-align: center; color: #545c59; margin: 0 0 1rem; }
.poster-spalten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.poster-kopf { color: #fff; text-align: center; font-weight: 800; font-size: 1.5rem; border-radius: 10px; padding: 0.3rem; margin-bottom: 0.7rem; }
.poster-kopf.hilft, .pk.hilft { background: #2f6b3a; }
.poster-kopf.egal, .pk.egal { background: #5f6662; }
.poster-kopf.schadet, .pk.schadet { background: #a3271f; }
.poster-kopf.nichtmessbar, .pk.nichtmessbar { background: #4a5a78; }
.pkarte { border: 2px solid #c9cfcb; border-radius: 10px; padding: 0.7rem 0.8rem 0.7rem 1rem; margin-bottom: 0.7rem; position: relative; background: #fff; }
.pkarte::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 5px; border-radius: 3px; background: var(--pk-farbe, #5f6662); }
.pkarte.hilft { --pk-farbe: #2f6b3a; }
.pkarte.egal { --pk-farbe: #5f6662; }
.pkarte.schadet { --pk-farbe: #a3271f; }
.pkarte.nichtmessbar { --pk-farbe: #4a5a78; border-style: dashed; }
.pkarte .u { font-weight: 700; color: #3b423f; font-size: 0.95rem; }
.pkarte .besser { border-top: 1px dashed #c9cfcb; margin-top: 0.45rem; padding-top: 0.4rem; font-size: 0.9rem; }
.poster-band { border-top: 2px dashed #4a5a78; margin-top: 0.8rem; padding-top: 0.6rem; }
.poster-band h2 { font-size: 1.1rem; color: #4a5a78; margin: 0 0 0.5rem; }
.poster-band .band-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; }
.poster-band .pkarte { margin-bottom: 0; }
.pkarte .t { font-weight: 800; font-size: 1.2rem; }
.pkarte .s { margin: 0.3rem 0; }
.pkarte .b { color: #545c59; font-size: 0.9rem; }
.pkarte .g { color: #545c59; font-size: 0.8rem; }
.pkarte .knoepfe { display: flex; gap: 0.3rem; margin-top: 0.4rem; flex-wrap: wrap; }
.pkarte .knoepfe button { padding: 0.15rem 0.5rem; font-size: 0.85rem; background: #fff; color: #0e6a6a; border-color: #0e6a6a; }
.pkarte.aus { opacity: 0.4; }
.poster-fuss { border-top: 3px solid #1a1d1c; margin-top: 1rem; padding-top: 0.5rem; text-align: center; font-weight: 800; font-size: 1.3rem; }
.beamer-seite .poster h1 { font-size: 3.2rem; }
.beamer-seite .pkarte .t { font-size: 1.5rem; }
.beamer-seite .pkarte .s { font-size: 1.25rem; }
@media (max-width: 820px) {
  .poster-spalten { grid-template-columns: minmax(0, 1fr); }
  .zahlen { grid-template-columns: minmax(0, 1fr); }
  .urteil-wahl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stand { font-size: 0.85rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--flaeche-2); white-space: nowrap; }
.stand.laeuft, .stand.bewerten { background: var(--akzent-weich); color: var(--akzent); }
.stand.ergebnis, .stand.karte { background: var(--gut-weich); color: var(--gut); }
.stand.gesperrt, .stand.zuteilen { background: var(--stopp-weich); color: var(--stopp); }
.tabelle select { max-width: 13rem; }
.code-anzeige { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: 0.08em; font-size: 1.1rem; }
.gross-code { font-size: 2rem; }
.dialog.breit { max-width: 1000px; }
.beamer-seite .pkarte .b { font-size: 1rem; }
.klassencode-zeile { margin: 0.2rem 0 1rem; }
