/* Layout: Kopfband mit Variantenleiste und Reitern, darunter Tafel (links) und Prüfpanels (rechts). */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #141c27;
  --muted: #5a6575;
  --line: #d9dfe8;
  --line-strong: #aeb8c6;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #e3eafc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --ok: #1d7a46;
  --ok-soft: #e1f4e8;
  --hl: #ffe27a;
  --c-sprachen: #2a78d6;
  --c-mint: #eb6834;
  --c-gsw: #1baf7a;
  --c-kunst: #eda100;
  --c-wahl: #e87ba4;
  --c-uebrige: #8b95a5;
  --font-ui: 'Archivo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-num: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f131a;
    --surface: #161c25;
    --surface-2: #1d2430;
    --ink: #e6ebf2;
    --muted: #9aa5b5;
    --line: #2a3340;
    --line-strong: #46515f;
    --accent: #7d9bff;
    --accent-ink: #0f131a;
    --accent-soft: #1f2a48;
    --bad: #ff7b6e;
    --bad-soft: #3a1c1a;
    --warn: #f2b14c;
    --warn-soft: #362a12;
    --ok: #5ccf8b;
    --ok-soft: #15301f;
    --hl: #6b5a12;
    --c-sprachen: #3987e5;
    --c-mint: #d95926;
    --c-gsw: #199e70;
    --c-kunst: #c98500;
    --c-wahl: #d55181;
    --c-uebrige: #6b7584;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f131a;
  --surface: #161c25;
  --surface-2: #1d2430;
  --ink: #e6ebf2;
  --muted: #9aa5b5;
  --line: #2a3340;
  --line-strong: #46515f;
  --accent: #7d9bff;
  --accent-ink: #0f131a;
  --accent-soft: #1f2a48;
  --bad: #ff7b6e;
  --bad-soft: #3a1c1a;
  --warn: #f2b14c;
  --warn-soft: #362a12;
  --ok: #5ccf8b;
  --ok-soft: #15301f;
  --hl: #6b5a12;
  --c-sprachen: #3987e5;
  --c-mint: #d95926;
  --c-gsw: #199e70;
  --c-kunst: #c98500;
  --c-wahl: #d55181;
  --c-uebrige: #6b7584;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
}
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
kbd {
  font-family: var(--font-num);
  font-size: 0.85em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  background: var(--surface);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons und Felder */
button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 6px 11px;
  cursor: pointer;
  line-height: 1.2;
}
button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
button.primaer { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primaer:hover { color: var(--accent-ink); filter: brightness(1.08); }
button.gefahr { background: var(--bad); border-color: var(--bad); color: var(--surface); }
button.gefahr:hover { color: var(--surface); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.klein { padding: 3px 8px; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="text"], input[type="number"], select, textarea {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 6px 8px;
  min-width: 0;
}
input[type="number"] { font-family: var(--font-num); width: 5.5em; }
textarea { width: 100%; font-family: var(--font-num); font-size: 12px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

/* Kopf */
.kopf { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.kopf-inner, .tabs-inner, .inhalt {
  max-width: 1480px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.kopf-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 12px; }
.marke { display: flex; align-items: center; gap: 12px; }
.marke h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.marke p { margin: 0; color: var(--muted); font-size: 12.5px; }
.logo { display: grid; grid-template-columns: repeat(2, 11px); grid-template-rows: repeat(2, 11px); gap: 3px; }
.logo i { display: block; border-radius: 2px; }
.logo i:nth-child(1) { background: var(--c-sprachen); }
.logo i:nth-child(2) { background: var(--c-mint); }
.logo i:nth-child(3) { background: var(--c-gsw); }
.logo i:nth-child(4) { background: var(--c-wahl); }
.variantenleiste { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.variantenleiste select { max-width: 260px; font-weight: 600; }
.lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.btn-gruppe { display: flex; gap: 4px; flex-wrap: wrap; }
.sync-knopf { display: inline-flex; align-items: center; gap: 6px; }
.sync-knopf i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.sync-ok i { background: var(--ok); }
.sync-laeuft i { background: var(--accent); animation: puls 1s ease-in-out infinite alternate; }
.sync-fehler i, .sync-anmelden i { background: var(--warn); }
@keyframes puls { from { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .sync-laeuft i { animation: none; } }
.tabs { border-top: 1px solid var(--line); }
.tabs-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.tab {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 10px 14px 8px;
  white-space: nowrap;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab:hover:not(:disabled) { border-color: transparent; border-bottom-color: var(--line-strong); color: var(--ink); }
.tab.active, .tab.active:hover { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.badge {
  font-family: var(--font-num);
  font-size: 11px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
}
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.hinweis-leiste { background: var(--warn-soft); color: var(--warn); padding: 8px max(16px, env(safe-area-inset-left, 0px)); text-align: center; }

/* Inhalt */
.inhalt { padding-block: 20px 48px; }
.spf-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 20px; margin-bottom: 16px; }
.eyebrow { margin: 0 0 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.spf-kopf h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
.kennchips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-bad::before { content: "✕"; }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-warn::before { content: "!"; font-weight: 800; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-ok::before { content: "✓"; }
.chip-neutral { background: var(--surface-2); color: var(--muted); font-family: var(--font-num); font-weight: 500; }
.chip-accent { background: var(--accent-soft); color: var(--accent); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.haupt { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.seite { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel h3 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
details.panel.klapp { display: block; }
details.panel.klapp > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px -6px;
  padding: 4px 6px;
  border-radius: 6px;
}
details.panel.klapp > summary::-webkit-details-marker { display: none; }
details.panel.klapp > summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
  flex: none;
}
details.panel.klapp[open] > summary::before { transform: rotate(45deg); }
details.panel.klapp > summary:hover { background: var(--surface-2); }
details.panel.klapp > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
details.panel.klapp > summary h3 { flex: 1; }
details.panel.klapp .panel-body { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; min-width: 0; }
.panel-sub { margin: 0; color: var(--muted); font-size: 12.5px; }
.panel.breit { margin-top: 20px; }

/* Werkzeugleiste */
.werkzeug {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 50px;
}
.werkzeug.leer { background: var(--surface); color: var(--muted); }
.wz-titel { display: flex; flex-direction: column; min-width: 160px; }
.wz-titel span { font-size: 12px; color: var(--muted); }
.wz-steuer { display: flex; align-items: center; gap: 4px; }
.wz-steuer input { width: 4em; text-align: center; }
.werkzeug .ghost { margin-left: auto; }

/* Stundentafel */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.tafel { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.tafel th, .tafel td { padding: 0; height: 30px; border-bottom: 1px solid var(--line); }
.tafel thead th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 6px; }
.tafel thead th.jahr { color: var(--ink); border-left: 1px solid var(--line-strong); }
.tafel th.sem { font-family: var(--font-num); font-weight: 500; }
.tafel th.sem.hl { background: var(--hl); color: var(--ink); }
.fach-kopf { text-align: left; }
.tafel tbody th, .tafel tfoot th {
  text-align: left;
  font-weight: 500;
  padding: 0 10px;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  min-width: 210px;
}
.tafel td { text-align: center; font-family: var(--font-num); min-width: 42px; }
.tafel td.ja, .tafel th.ja { border-left: 1px solid var(--line-strong); }
.tafel td.tot { font-weight: 600; border-left: 1px solid var(--line-strong); min-width: 52px; }
.tafel td.tot.bad { color: var(--bad); }
.tafel td.soll, .tafel th.soll { color: var(--muted); font-size: 12px; min-width: 64px; }
.tafel tr.grp th, .tafel tr.grp td { background: var(--surface-2); height: 34px; color: var(--muted); font-size: 12px; }
.tafel tr.grp th { color: var(--ink); font-weight: 700; font-size: 13px; }
.tafel tr.grp th small, .tafel tr.subgrp th small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; line-height: 1.1; margin-top: -1px; }
.tafel tr.grp th { padding-block: 4px; }
.tafel tr.subgrp th { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.tafel tr.subgrp td { border-bottom-color: var(--line); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.c-sprachen { background: var(--c-sprachen); fill: var(--c-sprachen); }
.c-mint { background: var(--c-mint); fill: var(--c-mint); }
.c-gsw { background: var(--c-gsw); fill: var(--c-gsw); }
.c-kunst { background: var(--c-kunst); fill: var(--c-kunst); }
.c-wahl { background: var(--c-wahl); fill: var(--c-wahl); }
.c-uebrige, .c-weitere, .c-sport { background: var(--c-uebrige); fill: var(--c-uebrige); }

.tafel td.c { cursor: pointer; font-size: 14px; user-select: none; position: relative; }
.tafel td.c:hover { background: var(--accent-soft); }
.tafel td.c.verb.ja + td.c.verb { box-shadow: inset 1px 0 0 var(--surface); }
.tafel td.c.st-muss { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.tafel td.c.st-soll { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.tafel td.c.st-info { text-decoration: underline dotted var(--muted); }
.tafel td.c.hl { background: var(--hl); color: var(--ink); }
.tafel td.c.sel { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.tafel td.c.drop { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); }
.tafel td.c.ziehen { opacity: 0.5; }
.tafel tr.row.rs-muss th.fach { box-shadow: inset 3px 0 0 var(--bad); }
.tafel tr.row.rs-soll th.fach { box-shadow: inset 3px 0 0 var(--warn); }
.tafel tr.hlrow th.fach { background: var(--hl); }
.semtag {
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 6px;
  vertical-align: 1px;
}
.tafel tfoot th, .tafel tfoot td { background: var(--surface-2); }
.tafel tr.sum th, .tafel tr.sum td { font-weight: 700; border-top: 2px solid var(--line-strong); height: 34px; }
.tafel tr.sum2 td, .tafel tr.sum2 th { color: var(--muted); font-size: 12.5px; }
.tafel td.over { color: var(--warn); background: var(--warn-soft); }
.mar-hinweis { font-family: var(--font-ui) !important; font-size: 11.5px; text-align: left !important; padding-left: 10px !important; }
.fussnote { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 90ch; }
.aktionen-unten { display: flex; gap: 8px; flex-wrap: wrap; }

/* Prüfbericht */
.befunde { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.befund {
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
  padding: 6px 10px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.befund .gruppe { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.befund.st-muss { border-left-color: var(--bad); }
.befund.st-soll { border-left-color: var(--warn); }
.befund.aktiv { background: var(--hl); color: var(--ink); }
.befund:hover { color: var(--ink) !important; background: var(--accent-soft); }
.bef-titel { margin-top: 4px; }
.bef-titel.st-muss { color: var(--bad) !important; }
.bef-titel.st-soll { color: var(--warn) !important; }
.befunde-info summary { cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 2px 0 6px; }
.alles-ok { margin: 0; color: var(--ok); font-weight: 600; }

/* MAR */
.mar-zeile { display: grid; grid-template-columns: 96px minmax(0, 1fr) 72px; align-items: center; gap: 10px; }
.mar-label { font-size: 12.5px; white-space: nowrap; }
.mar-bar { position: relative; height: 10px; background: var(--surface-2); border-radius: 5px; }
.mar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.mar-min { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.mar-wert { text-align: right; font-family: var(--font-num); font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.mar-wert small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.mar-wert.bad { color: var(--bad); }

/* Diagramm */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .limit { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 3; }
.chart text { font-family: var(--font-num); fill: var(--muted); }
.chart .ax { font-size: 10px; }
.chart .val { font-size: 10.5px; fill: var(--ink); font-weight: 600; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.legende .swatch { margin-right: 5px; }
.legende .strich { display: inline-block; width: 14px; border-top: 2px dashed var(--ink); margin-right: 5px; vertical-align: 3px; }

/* SPF-Einstellungen */
.feldgruppe { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.feldgruppe:first-of-type { border-top: 0; padding-top: 0; }
.feld-inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.feld-inline input { width: 4.2em; }
.feld { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.feld input, .feld textarea, .feld select { color: var(--ink); }
.feld input[type="text"] { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.check.gross { align-items: flex-start; gap: 10px; }
.check.gross input { margin-top: 3px; }
.check.gross small { display: block; color: var(--muted); font-size: 12px; }
.iu-karte { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; }
.iu-kopf { display: flex; gap: 6px; align-items: center; }
.iu-kopf input { flex: 1; }
.iu-faecher { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.iu-karte small { color: var(--muted); font-size: 11.5px; }

/* Prüfungen */
.pruef { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pruef li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.pruef select { flex: 1; min-width: 0; }
.vorz { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Vergleich */
.cmp-leiste { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 14px; }
.cmp-wahl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cmp-wahl select { max-width: 240px; }
.cmp-tag { font-family: var(--font-num); font-weight: 700; font-size: 12px; border-radius: 4px; padding: 2px 7px; }
.cmp-a { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
.cmp-b { background: var(--accent); color: var(--accent-ink); }
.vergleichstafel td.d { background: var(--accent-soft); white-space: nowrap; padding: 0 4px; }
.vergleichstafel .va { color: var(--muted); text-decoration: line-through; }
.vergleichstafel .pfeil { color: var(--muted); font-size: 10px; margin: 0 2px; }
.vergleichstafel .vb { color: var(--accent); font-weight: 700; }
.vergleichstafel td.delta { min-width: 44px; font-weight: 600; }
.delta.plus { color: var(--ok); }
.delta.minus { color: var(--bad); }
.kz { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.kz th, .kz td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.kz th[scope="row"] { text-align: left; font-weight: 500; color: var(--muted); }
.kz td { font-family: var(--font-num); }
.kz tr.diff td { background: var(--accent-soft); font-weight: 600; }
.matrix { border-collapse: collapse; width: 100%; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.matrix thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.matrix th[scope="row"] { white-space: nowrap; }
.matrix th small { color: var(--muted); font-weight: 400; }
.matrix-zelle { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; width: 100%; text-align: left; border-color: var(--line); }
.matrix-zelle small { flex-basis: 100%; color: var(--muted); font-family: var(--font-num); font-size: 11.5px; }

/* Einstellungen und Regeln */
.einst-grid, .regel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) {
  .einst-grid, .regel-grid { grid-template-columns: minmax(0, 1fr); }
}
.feld-reihe { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.feld-reihe input[type="number"] { width: 100%; }
.einst-tab { border-collapse: collapse; width: 100%; }
.einst-tab th, .einst-tab td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.einst-tab thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.einst-tab th[scope="row"] { font-weight: 500; }
.einst-tab input.geaendert { border-color: var(--accent); background: var(--accent-soft); }
.regelliste { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; max-width: 70ch; }
.regelliste li { font-size: 13px; }

/* Modal und Toast */
.modal-hg {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.45);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: min(520px, 100%);
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.modal h3 { font-size: 17px; }
.modal p { margin: 0; }
.modal-inhalt { display: flex; flex-direction: column; gap: 10px; }
.modal-aktionen { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.modal.breit { width: min(860px, 100%); }
.gen-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.gen-start { justify-content: flex-start; }
.gen-balken { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.gen-balken i { display: block; height: 100%; background: var(--accent); transition: width 0.1s linear; }
.gen-scroll { overflow-x: auto; }
.gen-tabelle { border-collapse: collapse; width: 100%; font-size: 13px; }
.gen-tabelle th, .gen-tabelle td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.gen-tabelle thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.gen-tabelle tbody th { font-weight: 600; }
.gen-tabelle td .badge { margin-right: 4px; }
.gen-basis { background: var(--surface-2); }
.gen-kz { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; font-family: var(--font-num); margin-top: 2px; }
.gen-knoepfe { display: flex; gap: 6px; justify-content: flex-end; }
.optionen { border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 10px; }
.optionen legend { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.fehler { color: var(--bad); }
.toast {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 8px;
  z-index: 60;
  max-width: calc(100% - 32px);
}

@media (max-width: 640px) {
  .spf-kopf h2 { font-size: 21px; }
  .tafel tbody th, .tafel tfoot th { min-width: 150px; white-space: normal; line-height: 1.2; }
  .kopf { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .kopf, .seite, .werkzeug, .aktionen-unten, .fussnote { display: none !important; }
  .layout { display: block; }
  body { background: #fff; color: #000; }
}
