:root {
  --sage: #a1be95; --honeydew: #e2dfa2; --bluebell: #92aac7; --raspberry: #ed5752;
  --bg: #f8f7ea; --flaeche: #fffffa; --flaeche2: #eef2e8; --rand: #d5dcc8;
  --text: #25302a; --leise: #5c675e; --dunkel: #1d2733;
  --ok: #4b6c3e; --ok-bg: #e5eedf; --fehler: #c63f39; --fehler-bg: #fde6e4; --info: #6f6a1f;
  --schatten: 0 1px 2px rgba(40,50,30,.06), 0 2px 8px rgba(40,50,30,.06);
  --code: Consolas, "Cascadia Mono", "DejaVu Sans Mono", Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--code); font-size: .92em; background: var(--flaeche2); padding: .05em .35em; border-radius: 4px; }
header.leiste { background: var(--flaeche); position: relative; padding: 12px 20px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
header.leiste::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, var(--sage) 0 25%, var(--honeydew) 25% 50%, var(--bluebell) 50% 75%, var(--raspberry) 75%); }
header.leiste .marke { display: inline-flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-weight: 700; font-size: 19px; }
header.leiste .marke a { text-decoration: none; color: inherit; }
header.leiste .marke a span { font-weight: 400; color: var(--leise); }
header.leiste .marke .hp { font-weight: 400; font-size: 14px; color: var(--leise); }
header.leiste .marke .hp:hover { color: var(--text); text-decoration: underline; }
header.leiste .marke .trenner { color: var(--rand); font-weight: 400; }
footer.fuss { max-width: 1150px; margin: 0 auto; padding: 0 20px 24px; font-size: 13px; color: var(--leise); }
footer.fuss a { color: var(--leise); }
header.leiste .rechts { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--leise); }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 14px; box-shadow: var(--schatten); padding: 20px; }
.knopf { border: 1px solid var(--rand); background: var(--flaeche); border-radius: 10px; padding: 9px 18px; font-weight: 700; color: var(--text); }
a.knopf { text-decoration: none; }
.knopf:hover { border-color: var(--leise); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.primaer { background: var(--raspberry); border-color: var(--raspberry); color: #fff; }
.knopf.blau { background: var(--bluebell); border-color: var(--bluebell); color: var(--dunkel); }
.knopf.gruen { background: var(--sage); border-color: var(--sage); color: var(--dunkel); }
.knopf.klein { padding: 4px 10px; font-size: 13px; font-weight: 600; }
.feld { width: 100%; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 10px; background: #fff; }
.feld:focus { outline: 2px solid var(--bluebell); border-color: var(--bluebell); }
.fehlertext { color: var(--fehler); font-weight: 600; min-height: 1.5em; }
pre.code { font-family: var(--code); font-size: 15px; line-height: 1.55; background: var(--dunkel); color: #eef2e8; padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 12px 0; white-space: pre; }

/* Antwortknöpfe im Kahoot-Stil */
.optionen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.option { --f: var(--raspberry); display: flex; align-items: center; gap: 12px; text-align: left; min-height: 72px; padding: 14px 16px;
  border: 0; border-radius: 12px; background: var(--f); color: var(--dunkel); font-weight: 700; font-size: 17px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
.option:nth-child(1) { --f: var(--raspberry); color: #fff; }
.option:nth-child(2) { --f: var(--bluebell); }
.option:nth-child(3) { --f: var(--honeydew); }
.option:nth-child(4) { --f: var(--sage); }
.option .form { font-size: 22px; width: 28px; text-align: center; flex: none; }
.option:disabled { cursor: default; }
.option.gedimmt { opacity: .35; }
.option.richtig { outline: 4px solid var(--ok); outline-offset: 2px; }
.option.gewaehlt { outline: 4px solid var(--dunkel); outline-offset: 2px; }
/* Multiple Choice mit mehreren richtigen Antworten: Ankreuzen */
.mehrfach-hinweis { font-weight: 700; margin: 4px 0 10px; }
.optionen.mehrfach .option .haken { margin-left: auto; flex: none; width: 26px; height: 26px; border: 3px solid currentColor; border-radius: 6px; display: grid; place-items: center; font-weight: 900; }
.optionen.mehrfach .option.gewaehlt .haken::after { content: "✓"; }
@media (max-width: 560px) { .optionen { grid-template-columns: 1fr; } .option { min-height: 58px; } }
/* Antwortoptionen mit Bild (hochgeladen oder Punktediagramm) */
.option-mit-bild { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.option-bild { display: block; width: 100%; max-width: 320px; border-radius: 8px; background: var(--bg, #fff); color: var(--text, #222); }
img.option-bild { height: auto; object-fit: contain; max-height: 240px; }
.option-bild .punkte-svg, .punkte-svg { width: 100%; height: auto; display: block; }
.punkte-svg:not(.klein) { max-width: 520px; margin: 10px 0; }
.optionen.mit-bildern .option { align-items: flex-start; }
.loesung-bild { max-width: 320px; margin-top: 6px; }

.zeitbalken { height: 10px; background: var(--flaeche2); border-radius: 99px; overflow: hidden; }
.zeitbalken > div { height: 100%; background: var(--sage); width: 100%; transition: width .25s linear; }
.zeitbalken.knapp > div { background: var(--raspberry); }

.meldungen { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 3px; font-size: 15px; }
.meldungen li::before { display: inline-block; width: 1.4em; font-weight: 700; }
.meldungen li.ok::before { content: "✓"; color: var(--ok); }
.meldungen li.fehler::before { content: "✗"; color: var(--fehler); }
.meldungen li.info::before { content: "i"; color: var(--info); font-style: italic; font-family: Georgia, serif; }

table.tab { border-collapse: collapse; width: 100%; font-size: 15px; }
table.tab th, table.tab td { padding: 7px 10px; border-bottom: 1px solid var(--rand); text-align: left; }
table.tab th { font-size: 13px; color: var(--leise); font-weight: 600; }
table.tab td.zahl, table.tab th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.ergebnis-wrap { overflow: auto; max-height: 300px; border: 1px solid var(--rand); border-radius: 10px; margin-top: 10px; }
.ergebnis-wrap table { border-collapse: collapse; font-size: 14px; width: max-content; min-width: 100%; }
.ergebnis-wrap th, .ergebnis-wrap td { padding: 5px 12px; border-bottom: 1px solid var(--rand); white-space: nowrap; text-align: left; }
.ergebnis-wrap th { position: sticky; top: 0; background: color-mix(in srgb, var(--bluebell) 30%, var(--flaeche)); font-family: var(--code); font-size: 13px; }
textarea.sql { width: 100%; min-height: 140px; font-family: var(--code); font-size: 15px; line-height: 1.55; padding: 12px; border: 1px solid var(--rand); border-radius: 10px; background: #fff; resize: vertical; }
textarea.sql:focus { outline: 2px solid var(--bluebell); }

/* Relationenmodell bei SQL-Aufgaben */
.relationenmodell { margin: 12px 0; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche2); padding: 8px 14px; font-family: var(--code); font-size: 14px; line-height: 1.6; }
.relationenmodell summary { cursor: pointer; font-family: system-ui, sans-serif; font-weight: 600; font-size: 14px; color: var(--leise); }
.relationenmodell[open] summary { margin-bottom: 4px; }
.rm-zeile { overflow-wrap: anywhere; }
.relationenmodell.klickbar .rm-zeile b, .relationenmodell.klickbar .rm-zeile span { cursor: pointer; border-radius: 4px; padding: 0 2px; }
.relationenmodell.klickbar .rm-zeile b:hover, .relationenmodell.klickbar .rm-zeile span:hover,
.relationenmodell.klickbar .rm-zeile b:focus-visible, .relationenmodell.klickbar .rm-zeile span:focus-visible { background: var(--honeydew); outline: none; }
.rm-pk { text-decoration: underline; text-underline-offset: 3px; }
.rm-fk { text-decoration: underline dashed; text-underline-offset: 3px; }
.rm-pkfk { text-decoration: underline; text-underline-offset: 2px; border-bottom: 1px dashed currentColor; padding-bottom: 1px; }

/* Reihenfolge-Aufgaben */
.sortier { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: platz; }
.sortier li { counter-increment: platz; display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 10px;
  border: 1px solid var(--rand); border-radius: 12px; background: var(--flaeche); box-shadow: var(--schatten);
  font: 700 18px var(--code); cursor: grab; touch-action: none; user-select: none; }
.sortier li::before { content: counter(platz) "."; color: var(--leise); font: 600 14px system-ui, sans-serif; width: 1.4em; text-align: right; }
.sortier .griff { color: var(--leise); font-size: 20px; }
.sortier .baustein { flex: 1; }
.sortier .pfeile { display: flex; gap: 4px; }
.sortier .pfeile button { width: 36px; height: 36px; border: 1px solid var(--rand); border-radius: 8px; background: var(--bg); font-size: 17px; }
.sortier li.zieht { cursor: grabbing; border-color: var(--bluebell); background: color-mix(in srgb, var(--bluebell) 18%, var(--flaeche)); box-shadow: 0 8px 22px rgba(40,50,30,.18); }
.sortier.gesperrt li { cursor: default; opacity: .75; }
.sortier.statisch li { cursor: default; touch-action: auto; }

/* Tabellenausschnitte bei Quizfragen */
.auszuege { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.auszug { border: 1px solid var(--rand); border-radius: 10px; overflow: hidden; background: var(--flaeche); max-width: 100%; overflow-x: auto; }
.auszug-name { font-size: 13px; font-weight: 600; color: var(--leise); padding: 5px 10px; background: var(--flaeche2); border-bottom: 1px solid var(--rand); }
.auszug table { border-collapse: collapse; font: clamp(15px, 0.5vw + 10px, 19px) var(--code); }
.auszug th, .auszug td { padding: 4px 10px; border-bottom: 1px solid var(--rand); text-align: left; white-space: nowrap; }
.auszug th { background: color-mix(in srgb, var(--bluebell) 25%, var(--flaeche)); font-size: 0.92em; }
.auszug tr:last-child td { border-bottom: 0; }

/* ---------- Coder Dojo ---------- */
.kata { margin: 10px 0 12px; border: 1px solid var(--rand); border-radius: 12px; background: var(--flaeche2); padding: 8px 14px; }
.kata summary { cursor: pointer; font-size: 17px; }
.kata .kata-stufe { font-size: 13px; color: var(--leise); margin-left: 6px; }
.kata p, .kata ul { margin: 8px 0; }
.kata-tab { border-collapse: collapse; font-size: 14px; margin: 6px 0; }
.kata-tab th, .kata-tab td { border: 1px solid var(--rand); padding: 3px 9px; text-align: center; background: var(--flaeche); }
.kata-pre { font-family: var(--code); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; padding: 6px 10px; display: inline-block; margin: 4px 0; }
.editor-rahmen { display: grid; grid-template-columns: auto 1fr; border: 1px solid var(--rand); border-radius: 10px; overflow: hidden; background: #fff; }
.editor-rahmen:focus-within { outline: 2px solid var(--bluebell); }
.ed-zeilen { margin: 0; padding: 12px 8px 12px 10px; background: var(--flaeche2); color: var(--leise); font: 15px/1.55 var(--code); text-align: right; user-select: none; overflow: hidden; min-width: 2.6em; }
.code-editor { border: 0; outline: none; resize: vertical; min-height: 300px; padding: 12px; font: 15px/1.55 var(--code); tab-size: 4; white-space: pre; overflow: auto; background: transparent; }
.code-editor[readonly] { background: color-mix(in srgb, var(--honeydew) 25%, #fff); }
.dojo-knoepfe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.gespeichert { font-size: 13px; color: var(--leise); margin-left: auto; }
.ausgabe-kopf { font-size: 13px; font-weight: 600; color: var(--leise); margin-top: 6px; }
pre.ausgabe { margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--dunkel); color: #eef2e8; font: 14px/1.5 var(--code); white-space: pre-wrap; }
pre.ausgabe.fehler { background: #3a1716; color: #ffd9d6; }
.tests-kopf { margin-top: 10px; font-weight: 700; padding: 6px 10px; border-radius: 8px; background: var(--fehler-bg); }
.tests-kopf.alle { background: var(--ok-bg); }
.tests { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.tests li { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--rand); background: var(--flaeche); font-size: 14px; }
.tests li::before { font-weight: 800; margin-right: 8px; }
.tests li.ok::before { content: "✓"; color: var(--ok); }
.tests li.nok::before { content: "✗"; color: var(--fehler); }
.t-ein { font-family: var(--code); }
.t-detail { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 4px; font-size: 13px; }
.t-detail span { color: var(--leise); }
.t-detail pre { margin: 0; font: 13px/1.4 var(--code); white-space: pre-wrap; }
.rolle { padding: 10px 14px; border-radius: 10px; background: var(--flaeche2); margin-bottom: 8px; font-size: 16px; }
.rolle.fahrer { background: color-mix(in srgb, var(--raspberry) 18%, var(--flaeche)); }
.rolle.beifahrer { background: color-mix(in srgb, var(--bluebell) 25%, var(--flaeche)); }
.regel { padding: 8px 14px; border-radius: 10px; background: var(--honeydew); margin-bottom: 8px; }
.lesen { padding: 8px 14px; border-radius: 10px; background: var(--honeydew); font-weight: 600; margin: 4px 0; }
.person { white-space: nowrap; font-weight: 700; }
pre.live-code { min-height: 200px; white-space: pre; }
.laden { color: var(--leise); }

/* ---------- Randori: Wechsel-Overlay ---------- */
.wechsel-wirt { position: relative; }
.wechsel-overlay { position: absolute; inset: 0; z-index: 20; display: grid; justify-items: center; align-items: start; padding: 12px;
  background: color-mix(in srgb, var(--dunkel) 55%, transparent); backdrop-filter: blur(1.5px); border-radius: inherit;
  animation: w-rein .25s ease-out; transition: opacity .35s; }
.wechsel-overlay.weg { opacity: 0; }
@keyframes w-rein { from { opacity: 0; } }
.w-karte { background: var(--flaeche, #fffffa); border-radius: 18px; padding: 18px 26px 16px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25);
  border-top: 8px solid var(--honeydew); max-width: 520px; width: 100%; animation: w-pop .35s cubic-bezier(.2,1.4,.4,1);
  position: sticky; top: max(16px, calc(50vh - 150px)); margin-top: min(12vh, 80px); }
@keyframes w-pop { from { transform: scale(.85); opacity: 0; } }
.w-titel { font-size: clamp(30px, 6vw, 52px); font-weight: 800; letter-spacing: .02em; color: var(--dunkel); line-height: 1.1; }
.w-ich { margin-top: 4px; font-weight: 700; color: var(--raspberry); font-size: 18px; }
.w-rollen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 10px; }
@media (max-width: 480px) { .w-rollen { grid-template-columns: 1fr; } }
.w-rolle { border-radius: 12px; padding: 10px; font-size: 20px; font-weight: 700; }
.w-rolle small { display: block; font-size: 13px; font-weight: 600; color: var(--leise); margin-bottom: 2px; }
.w-rolle.f { background: color-mix(in srgb, var(--raspberry) 18%, #fff); }
.w-rolle.b { background: color-mix(in srgb, var(--bluebell) 28%, #fff); }
.w-avatar { font-size: 30px; margin-right: 6px; vertical-align: middle; }
.w-ring { width: 64px; height: 64px; }
.w-ring circle { fill: none; stroke: var(--rand, #d5dcc8); stroke-width: 4; }
.w-ring .w-lauf { stroke: var(--sage); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 50% 50%; transition-property: stroke-dashoffset; transition-timing-function: linear; }
.w-ring .w-lauf.los { stroke-dashoffset: 119.4; }
.w-ring text { font: 800 15px system-ui, sans-serif; fill: var(--dunkel); }
/* Uhr kündigt den Wechsel an */
.uhr.bald, .timer.bald .zeitzahl { color: #9a8a1c; animation: w-puls 1s ease-in-out infinite; }
@keyframes w-puls { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .wechsel-overlay, .w-karte, .uhr.bald, .timer.bald .zeitzahl { animation: none; } }

/* SQL im Dojo */
.kata-stufen { margin: 6px 0 4px; padding-left: 22px; }
.kata-stufen li { margin: 2px 0; }
.sql-ergebnis { max-height: 340px; overflow: auto; }
.sql-ergebnis.fehler { color: var(--fehler, #c63f39); padding: 8px 10px; border-radius: 10px; background: var(--fehler-bg, #fde6e4); }
.t-detail.sql p { margin: 4px 0; }

/* Dojo-Editor: breiter auf großen Bildschirmen, „Editor groß“ */
.dojo-knoepfe .gross-knopf { margin-left: auto; }
body.dojo-editor main { max-width: 1100px; }
@media (min-width: 1500px) { body.dojo-editor main { max-width: 1400px; } }
body.dojo-editor.editor-gross main { max-width: min(1800px, 97vw); }
body.dojo-editor.editor-gross .code-editor { min-height: 62vh; }
body.dojo-editor.editor-gross .code-editor, body.dojo-editor.editor-gross .ed-zeilen { font-size: 18px; }

/* Dojo-Regeln (Lobby, Beamer) */
.verhalten { border: 1px solid var(--rand); border-left: 6px solid var(--sage); border-radius: 12px; background: var(--bg); padding: 12px 16px; text-align: left; }
.verhalten .vh-titel { font-weight: 800; font-size: 18px; margin-bottom: 6px; }
.verhalten ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 16px; line-height: 1.35; }
.mitte .verhalten { margin: 18px auto 0; max-width: 34rem; }
.ergebnis-box pre.code { text-align: left; }
.html-vorschau { width: 100%; min-height: 260px; border: 1px solid var(--rand); border-radius: 10px; background: #fff; }
.sql-ergebnis:has(.html-vorschau) { max-height: none; }

/* Lesbarkeit im Quiz (PF): Code zur Frage und Parsons-Bausteine groß genug für Beamer und zum Antippen auf dem Handy */
pre.frage-code { font-size: clamp(17px, 1.1vw + 9px, 26px); line-height: 1.5; }
#inhalt .pz-block { font-size: clamp(15px, 0.4vw + 11px, 18px); padding: 7px 8px 7px 10px; min-height: 42px; border-radius: 8px; }
#inhalt .pz-block .pz-k { width: 34px; height: 34px; font-size: 15px; border-radius: 7px; }
#inhalt .pz-liste, #inhalt .pz-vorrat { gap: 6px; padding: 6px; }
#inhalt .pz-titel { font-size: 15px; }

/* ---------- ERM-Aufgaben (erm.js) ---------- */
.erm-bild { margin: 10px 0; overflow-x: auto; }
.erm-bild svg { width: 100%; height: auto; display: block; font-family: var(--code); font-size: 12.5px; }
.erm-bild .e-l { stroke: var(--leise); stroke-width: 1.4; }
.erm-bild .e-e { fill: #dfe7f1; stroke: var(--dunkel); stroke-width: 1.6; }
.erm-bild .e-a { fill: var(--flaeche); stroke: var(--dunkel); stroke-width: 1.3; }
.erm-bild .e-r { fill: #f3efc4; stroke: var(--dunkel); stroke-width: 1.4; }
.erm-bild text { fill: var(--text); }
.erm-bild .e-k { font-weight: 700; font-size: 15px; font-family: system-ui, sans-serif; }
.erm-bild .e-k.offen { fill: var(--fehler); }
.ermb { display: grid; gap: 12px; }
.ermb-links { max-width: 460px; }
.frage-text.lang { font-size: 17px; font-weight: 400; line-height: 1.55; }
.ermb-tab { border-collapse: collapse; width: 100%; font-size: 15px; }
.ermb-tab th { font-size: 13px; color: var(--leise); text-align: left; padding: 3px 6px; }
.ermb-tab td { border-top: 1px solid var(--rand); padding: 3px 6px; }
.ermb-tab td.mitte { text-align: center; }
.ermb-tab .ermb-a { font-family: var(--code); font-size: 14px; overflow-wrap: anywhere; }
.ermb-tab select, .ermb-bez select { width: auto; padding: 3px 6px; font-size: 14px; }
.ermb-bez { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche2); font-size: 15px; }
.ermb-raute { background: #f3efc4; border: 1px solid var(--rand); border-radius: 6px; padding: 1px 8px; font-family: var(--code); font-size: 14px; }
.rmb { display: grid; gap: 10px; justify-items: start; }
.rmb-tab { border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche2); padding: 8px 10px; width: 100%; }
.rmb-kopf { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.rmb-name { max-width: 260px; padding: 5px 8px; font-family: var(--code); font-weight: 700; }
.rmb-spalten { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rmb-sp { display: inline-flex; align-items: center; gap: 2px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; padding: 2px 4px 2px 8px; }
.rmb-n { font-family: var(--code); font-size: 14px; margin-right: 4px; }
.rmb-t { border: 1px solid var(--rand); background: var(--flaeche); border-radius: 6px; font-size: 11px; font-weight: 700; padding: 1px 5px; color: var(--leise); }
.rmb-t.an { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.rmb-weg { border: 0; background: none; color: var(--leise); padding: 0 4px; }
.rmb-plus { width: auto; padding: 4px 6px; font-size: 14px; }
.rmb-text:empty { display: none; }
.rmb-lab { font-size: 13px; font-weight: 600; color: var(--leise); margin-bottom: -6px; }
.rmb-text, .rm-loesung { width: 100%; }
.qe-erm-vorschau { margin-top: 8px; }
.qe-erm-vorschau:empty { display: none; }
/* ERM aus Text – selbst bauen (erm.js bauWerkstatt) */
.ew { display: grid; gap: 10px; }
.ew-stifte { display: flex; flex-wrap: wrap; gap: 6px; }
.ew-stift { border: 2px solid var(--rand); background: var(--flaeche); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 14px; }
.ew-stift.an { border-color: var(--dunkel); background: var(--dunkel); color: #fff; }
.ew-text { text-align: left; hyphens: manual; line-height: 2; font-size: 16px; padding: 8px 12px; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); }
.ew-text .mk { cursor: pointer; border-radius: 4px; padding: 1px 2px; }
.ew-text .mk:hover, .ew-text .mk:focus-visible { background: var(--flaeche2); outline: none; }
.ew-text .mk.mk-e, .ew-text span.mk-e { background: #dfe7f1; box-shadow: inset 0 0 0 2px #5a7aa0; }
.ew-text .mk.mk-b, .ew-text span.mk-b { background: #f3efc4; box-shadow: inset 0 0 0 2px #b09a2c; }
.ew-text .mk.mk-a, .ew-text span.mk-a { background: #fff; box-shadow: inset 0 0 0 2px #6b8f5a; border-radius: 999px; padding: 1px 6px; }
.ew-text.statisch { line-height: 1.9; }
.ew-text span.mk-x { box-shadow: inset 0 0 0 1.5px var(--leise); border-radius: 4px; padding: 1px 2px; text-decoration: line-through; text-decoration-color: var(--leise); }
.ew-flaeche { position: relative; min-height: 540px; border: 1px solid var(--rand); border-radius: 12px; touch-action: none; overflow: hidden;
  background-color: var(--flaeche); background-image: radial-gradient(var(--rand) 1.2px, transparent 1.2px); background-size: 22px 22px; }
.ew-linien { position: absolute; inset: 0; width: 100%; height: 100%; }
.ew-l { stroke: var(--leise); stroke-width: 2.2; }
.ew-hit { stroke: transparent; stroke-width: 16; cursor: pointer; }
.ew-temp { stroke: var(--dunkel); stroke-width: 2; stroke-dasharray: 6 5; }
.ew-k { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; cursor: grab; user-select: none; touch-action: none;
  font-family: var(--code); font-size: 13px; font-weight: 600; background: var(--flaeche); padding: 2px 8px; line-height: 1.15; }
.ew-k:active { cursor: grabbing; }
.ew-k .ew-name { position: relative; z-index: 1; overflow-wrap: anywhere; pointer-events: none; }
.ew-k.ew-e { border: 2.5px solid #5a7aa0; border-radius: 4px; background: #dfe7f1; }
.ew-k.ew-a { border: 2px solid #6b8f5a; border-radius: 50%; font-size: 12px; }
.ew-k.ew-a.pk .ew-name { text-decoration: underline; text-underline-offset: 3px; }
.ew-k.ew-b { background: none; }
.ew-k.ew-b::before { content: ""; position: absolute; inset: 0; background: #f3efc4; border: 2px solid #b09a2c; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.ew-k.ew-b::after { content: ""; position: absolute; inset: 2.5px; background: #f3efc4; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.ew-k.ew-b::before { background: #b09a2c; }
.ew-anker { position: absolute; right: -11px; bottom: -11px; width: 30px; height: 30px; cursor: crosshair; z-index: 2; touch-action: none; }
.ew-anker::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; border: 2.5px solid var(--dunkel); }
.ew-pk { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); z-index: 2; font: 700 10px var(--code); padding: 2px 6px; border-radius: 999px;
  border: 1.5px solid var(--rand); background: var(--flaeche); color: var(--leise); }
.ew-pk.an { background: #6b8f5a; border-color: #6b8f5a; color: #fff; }
.ew-kard { position: absolute; transform: translate(-50%, -50%); z-index: 3; min-width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--dunkel);
  background: var(--flaeche); font: 700 14px var(--code); padding: 0 4px; }
.ew-kard.offen { border-style: dashed; color: var(--leise); }
.ew-meldung { min-height: 1.2em; font-size: 14px; color: var(--fehler); }
.ew-neu-gr { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: -4px; }
.ew-neu { border: 2px dashed #b09a2c; background: var(--flaeche); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 14px; }
.ew-neu-e { border-color: #5a7aa0; } .ew-neu-a { border-color: #6b8f5a; }
.ew-e .ew-frei { width: 104px; } .ew-a .ew-frei { width: 80px; }
.ew-frei { position: relative; z-index: 1; width: 64px; max-width: 70%; border: 0; border-bottom: 1px dashed #b09a2c; background: transparent; font: 600 12px var(--code); text-align: center; padding: 0; }
.ew-weg { position: absolute; top: -10px; right: -6px; z-index: 2; border: 0; background: none; color: var(--leise); font-size: 13px; padding: 2px 4px; }
.mark-plain .ew-text { margin: 8px 0; }

/* Punkte eintragen (Lernende klicken Punkte ins Diagramm) */
.wertetabelle { border-collapse: collapse; margin: 10px 0; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; max-width: 100%; }
.wertetabelle th, .wertetabelle td { border: 1px solid var(--rand); padding: 5px 10px; text-align: center; white-space: nowrap; }
.wertetabelle th { background: var(--flaeche); text-align: left; font-weight: 600; }
.punkte-eingabe { cursor: crosshair; max-width: 620px; background: var(--bg, #fff); border: 1px solid var(--rand); border-radius: 12px; padding: 6px; touch-action: none; user-select: none; }
.punkte-eingabe .punkte-svg { max-width: none; margin: 0; }
.punkte-eingabe:has(.zentren-svg) { cursor: default; touch-action: none; }
.zentren-zaehler { font-size: 15px; color: var(--leise); margin: 0 0 4px; }
.punkte-eingabe:has(.bandit-wege) { cursor: default; max-width: 820px; }
.bandit-kopf { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; margin-bottom: 8px; }
.bandit-paket b { font-size: 18px; }
.dreieck-bild { max-width: 620px; cursor: default; }
.korr-regler { display: flex; align-items: center; gap: 10px; max-width: 620px; margin-top: 8px; font-size: 14px; color: var(--leise); }
.korr-regler input { flex: 1; accent-color: #e08a1e; height: 28px; }
.korr-wert { font-size: 22px; margin: 6px 0 4px; } .korr-wert b { font-variant-numeric: tabular-nums; }
.korr-skala { width: 100%; max-width: 640px; height: auto; display: block; }
.ueber-bild { max-width: 620px; }
.ueber-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin: 6px 0; } .ueber-legende i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; } .ueber-legende i.x { width: auto; height: auto; color: #c0392b; font-style: normal; font-weight: 800; }
table.ueber-tab { border-collapse: collapse; font-size: 14px; margin: 6px 0; min-width: 320px; } table.ueber-tab th, table.ueber-tab td { padding: 3px 8px; text-align: left; border-bottom: 1px solid var(--rand); }
table.ueber-tab td { position: relative; min-width: 150px; white-space: nowrap; } table.ueber-tab tr.best { font-weight: 800; } table.ueber-tab tr.eigen td:first-child::after { content: " ← du"; color: #8e44ad; }
.ueber-balken { display: inline-block; height: 8px; border-radius: 4px; margin-right: 6px; vertical-align: middle; } .ueber-balken.tr { background: #2f6fa0; } .ueber-balken.te { background: #c0392b; }
.dreieck-gleichung { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 22px; font-weight: 700; margin: 10px 0 4px; }
.dreieck-gleichung .feld { width: 110px; font-size: 20px; text-align: center; }
.kb-vorrat { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; padding: 10px; border: 2px dashed var(--rand); border-radius: 12px; margin-bottom: 10px; }
.kb-koerbe { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 10px; }
.kb-korb { min-height: 110px; padding: 8px; border: 2px solid var(--rand); border-radius: 12px; background: var(--flaeche, #fff); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
.kb-name { width: 100%; overflow-wrap: anywhere; hyphens: auto; font-weight: 800; text-align: center; padding-bottom: 6px; border-bottom: 2px solid var(--rand); margin-bottom: 4px; }
.kb-karte { max-width: 100%; min-width: 0; overflow-wrap: anywhere; hyphens: auto; font: inherit; font-size: 15px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--bluebell, #92aac7); background: var(--bg, #fff); color: inherit; cursor: grab; text-align: left; }
.kb-karte.an { border-color: #e08a1e; box-shadow: 0 0 0 3px rgba(224, 138, 30, .3); }
.kb-statisch .kb-karte { cursor: default; }
.kb-leer { color: var(--leise); }
@media (max-width: 900px) { .kb-koerbe[style*="--n:3"], .kb-koerbe[style*="--n:4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* Kärtchen bleiben lesbar */
@media (max-width: 560px) { .kb-koerbe, .kb-koerbe[style*="--n:3"], .kb-koerbe[style*="--n:4"] { grid-template-columns: minmax(0, 1fr); } }
.punkte-eingabe:has(.ql-svg) { cursor: default; max-width: 820px; outline: none; }
.ql-kopf { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; margin-bottom: 8px; }
.ql-flaeche { display: grid; grid-template-columns: minmax(0, 420px) minmax(180px, 1fr); gap: 16px; align-items: start; }
.ql-svg { display: block; width: 100%; height: auto; }
.ql-legende { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 10px 0 0; font-size: 14px; }
.ql-legende li { display: flex; align-items: center; gap: 6px; }
.ql-sym { display: inline-grid; place-items: center; width: 24px; height: 24px; font-size: 18px; }
.ql-nebel { background: #4b5560; color: #c7ced5; font-weight: 700; border-radius: 3px; font-size: 15px; }
.ql-regal { background: #8a8f98 repeating-linear-gradient(180deg, transparent 0 5px, #5c636d 5px 7px); border-radius: 3px; }
.ql-start { display: grid; gap: 10px; }
.ql-ziel { margin: 0; font-size: 18px; padding: 8px 12px; border-left: 6px solid #e08a1e; background: var(--flaeche2, #eef2e8); border-radius: 0 10px 10px 0; }
.ql-start .ql-legende { font-size: 16px; margin: 0; }
.ql-ablauf { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.ql-start [data-los] { justify-self: start; font-size: 18px; }
.ql-steuer { display: grid; grid-template-columns: repeat(3, 56px); grid-template-areas: ". h ." "l . r" ". u ." "t t t" "a a a"; gap: 6px; justify-content: start; }
.ql-steuer [data-a] { font-size: 24px; height: 52px; border: 2px solid var(--rand); border-radius: 12px; background: var(--flaeche, #fff); cursor: pointer; }
.ql-steuer [data-a]:hover:not(:disabled) { border-color: var(--bluebell, #92aac7); }
.ql-steuer [data-a="0"] { grid-area: h; } .ql-steuer [data-a="3"] { grid-area: l; } .ql-steuer [data-a="1"] { grid-area: r; } .ql-steuer [data-a="2"] { grid-area: u; }
.ql-letzte { grid-area: t; font-size: 14px; margin: 6px 0 0; min-height: 2.6em; width: 200px; }
.ql-steuer [data-allein] { grid-area: a; }
@media (max-width: 640px) { .ql-flaeche { grid-template-columns: minmax(0, 1fr); } }
.bandit-paket.offen { font-weight: 700; color: #b5651d; }
.bandit-neu { animation: banditPuls 1.1s ease-in-out infinite; }
@keyframes banditPuls { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.bandit-wege.wahl .bandit-weg { border-color: #e9b06a; box-shadow: 0 0 0 3px rgba(224, 138, 30, .15); }
.bandit-wege.wahl .bandit-weg:hover { border-color: #e08a1e; box-shadow: 0 0 0 4px rgba(224, 138, 30, .3); }
@media (prefers-reduced-motion: reduce) { .bandit-neu { animation: none; } }
.bandit-karte { display: block; width: 100%; height: auto; margin-bottom: 10px; }
.bandit-wege { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.bandit-weg { display: grid; gap: 4px; text-align: left; padding: 12px; border: 2px solid var(--rand); border-radius: 12px; background: var(--flaeche, #fff); cursor: pointer; font: inherit; color: inherit; }
.bandit-weg:hover:not(:disabled) { border-color: var(--bluebell, #92aac7); }
.bandit-weg:disabled { cursor: default; opacity: .75; }
.bandit-weg.neu { border-color: #e08a1e; }
.bandit-name { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.bandit-rad { flex: none; }
.bandit-zahl { font-size: 20px; font-weight: 800; }
.bandit-info { font-size: 13px; color: var(--leise); }
.bandit-letzte { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.bandit-letzte i { font-style: normal; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--flaeche2, #eef2e8); }
.bandit-letzte i.neu { background: #e08a1e; color: #fff; }
.bandit-letzte i.bau { outline: 2px solid #c0392b; }
.bandit-baustelle { font-size: 14px; color: #8a4b12; }
.bandit-loesung { display: grid; gap: 6px; margin: 8px 0; text-align: left; }
.bandit-zeile { display: grid; grid-template-columns: minmax(130px, auto) 1fr auto auto auto; gap: 10px; align-items: center; }
.bandit-zeile.best { font-weight: 700; }
.bandit-balken { height: 12px; background: var(--flaeche2, #eef2e8); border-radius: 6px; overflow: hidden; }
.bandit-balken span { display: block; height: 100%; background: var(--bluebell, #92aac7); }
.bandit-zeile.best .bandit-balken span { background: #2e8b57; }
@media (max-width: 560px) { .bandit-zeile { grid-template-columns: 1fr auto; } .bandit-balken { grid-column: 1 / -1; } }
/* Regression: Fehler stapeln (breiteres Bild mit Stapel rechts), Lösungstext, Klassenansicht */
.punkte-svg.stapel-svg { max-width: 760px; }
.stapel-summe { margin-top: 8px; align-items: center; gap: 8px; }
.stapel-summe .feld { max-width: 140px; }
.punkte-loesung-text { margin: 4px 0 0; font-weight: 600; }
.klasse-legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; margin: 6px 0; }
.klasse-legende i { display: inline-block; width: 22px; height: 0; border-top: 3.5px solid #2f6fa0; vertical-align: middle; margin-right: 6px; }
.klasse-legende i.opt { border-top: 3.5px dashed #e08a1e; }
.klasse-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.klasse-raster > div { border: 2px solid var(--rand); border-radius: 8px; padding: 2px; font-size: 13px; text-align: center; }
.klasse-raster > div.ok { border-color: #2e8b57; }
.klasse-raster > div.nok { border-color: #c0392b; }
.punkte-eingabe:has(.stapel-svg) { max-width: 780px; }
