/* Einsatzplan – Oberfläche für Bauleiter */
:root {
  --navy: #1f2a44;
  --navy-2: #2a3859;
  --amber: #f2a900;
  --amber-soft: #fff4c2;
  --auf-akzent: #1f2a44;   /* Textfarbe auf Akzentflächen */
  --fokus: #8fb4ee; --fokus-rand: #6d9de6;
  --menue-text: #dfe6f5; --menue-muted: #9fb0d0; --menue-rand: #36466b;
  --zoom: 1;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2a44;
  --muted: #5b6575;
  --linie: #d8dde6;
  --linie-2: #e8ebf0;
  --ok: #1e8e3e;
  --ok-bg: #ddf2e3;
  --warn: #8a4b00;
  --warn-bg: #ffd8a8;
  --gelb: #6b5a00;
  --gelb-bg: #fff4c2;
  --rot: #b3261e;
  --btn-rot: #c62828; --btn-rot-2: #a31f1f; --btn-gruen: #1e7e34; --btn-gruen-2: #17622a; --btn-gelb: #b45f06; --btn-gelb-2: #8f4a04;
  --rot-bg: #f6cfcb;
  --violett: #6a2c91;
  --violett-bg: #e4d2f2;
  --grau: #6f7888;
  --grau-bg: #eef0f3;
  --feiertag: #fff2a8;
  --flaeche: #ffffff; --eingabe: #ffffff; --flaeche-2: #f4f6f9; --flaeche-3: #e6eaf1; --hover: #f4f8ff; --hover-2: #f1f4f9;
  --blau-bg: #eaf2ff; --blau-rand: #b5cdf5; --blau: #2b6cdf; --neutral-bg: #eef2f8; --neutral-2: #e5e7eb; --ferien: #eaf3ff; --link: #1a5fb4;
  --gelb2-bg: #ffe9a6; --gelb2: #8a6100; --zelle-abw: #b892e0; --zelle-krank: #e57a72;
  --hw-bg: #fff7e0; --hw-rand: #efd27a; --hr-bg: #fdecea; --hr-rand: #efb4af; --hr-text: #7d1a14; --hok-bg: #eaf6ee; --hok-rand: #b7dfc4;
  --feiertag-2: #fffbea; --heiss-g: #d7f0df; --heiss-y: #fff0b8; --heiss-r: #f6cfcb;
  --h1: #e4d2f2; --h2: #c9a4e6; --h3: #a46ad0; --h4: #6a2c91; --h1-t: #1f2a44; --h2-t: #1f2a44;
  --abwk-bg: #6a2c91; --geaendert: #fff3b0; --geaendert-rand: #e6c200; --geaendert-text: #5a4600; --btn-hover: #f1f4f9; --punkt: #d9480f;
  --wochenende: #eef0f3;
  --kopf-we: #5f6b7a;
  --radius: 8px;
  --schatten: 0 1px 2px rgba(31, 42, 68, .08), 0 2px 8px rgba(31, 42, 68, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 1.4; color: var(--text); background: var(--bg);
}
h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Grundgerüst ---------- */
#app { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh / var(--zoom)); }
#nav { background: var(--navy); color: #fff; padding: 14px 10px 20px; position: sticky; top: 0; height: calc(100vh / var(--zoom)); overflow-y: auto; }
#nav .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; font-weight: 700; font-size: 17px; letter-spacing: .02em; }
#nav .logo i { width: 30px; height: 30px; border-radius: 8px; background: var(--amber); display: grid; place-items: center; color: var(--auf-akzent); }
#nav .logo img { width: 30px; height: 30px; border-radius: 8px; display: block; }
#nav .gruppe { margin: 14px 10px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--menue-muted); }
#nav a.punkt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--menue-text); text-decoration: none; cursor: pointer;
}
#nav a.punkt:hover { background: var(--navy-2); }
#nav a.punkt.aktiv { background: var(--amber); color: var(--auf-akzent); font-weight: 600; }
#nav a.punkt svg { flex: none; width: 18px; height: 18px; }
#nav .standort-wahl { display: grid; gap: 4px; margin: 10px 0 4px; padding: 8px 10px; border: 1px solid var(--menue-rand); border-radius: 8px; font-size: 12px; color: var(--menue-muted); }
#nav .standort-wahl strong { color: #fff; font-size: 14px; }
#nav .standort-wahl select { width: 100%; color: var(--text); background: var(--eingabe); }   /* sonst erbt es die helle Menüschrift und ist auf Weiß nicht lesbar */
#nav .standort-wahl select option { color: var(--text); background: var(--eingabe); }
#nav .standort-wahl select:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
#nav .standort-wahl.hinweisbox { color: inherit; }
.standort-chip { white-space: nowrap; }
#nav .unten { margin-top: 18px; padding: 12px 4px 0; font-size: 12px; color: var(--menue-muted); border-top: 1px solid var(--menue-rand); display: grid; gap: 8px; }
#nav .unten .btn { justify-content: center; }
#nav .unten-zeile { display: flex; gap: 8px; }
#nav .unten-zeile .btn { flex: 1; }
#nav .benutzer-knopf { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--menue-rand); border-radius: 8px; background: var(--navy-2); color: #fff; cursor: pointer; text-align: left; font: inherit; }
#nav .benutzer-knopf:hover { border-color: var(--amber); }
#nav .benutzer-knopf svg { flex: none; width: 22px; height: 22px; }
#nav .benutzer-text { display: grid; min-width: 0; }
#nav .benutzer-text strong, #nav .benutzer-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav .benutzer-text strong { font-size: 13px; font-weight: 600; }
#nav .benutzer-text small { font-size: 11px; color: var(--menue-muted); }
#nav .version { text-align: center; font-size: 11px; opacity: .7; padding-top: 2px; }
.konto-liste { display: grid; gap: 8px; }
.konto-eintrag { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--linie); border-radius: 8px; background: var(--card); color: inherit; cursor: pointer; text-align: left; font: inherit; }
.konto-eintrag:hover { border-color: var(--amber); }
.konto-eintrag svg { flex: none; width: 20px; height: 20px; }
.konto-eintrag span { display: grid; }
.konto-eintrag small { font-size: 12px; }
main { min-width: 0; display: flex; flex-direction: column; }
#kopf {
  display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
#kopf .titel { flex: 1; min-width: 200px; }
#kopf .titel small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 2px; }
#kopf .aktionen { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.undobox { display: inline-flex; gap: 4px; }
.undobox .btn[disabled] { opacity: .4; cursor: default; }
#inhalt { padding: 20px 24px 60px; }
#menuknopf { display: none; }

/* ---------- Bausteine ---------- */
.karte { background: var(--card); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 16px 18px; }
.karte + .karte { margin-top: 16px; }
.karte > h2 { margin-bottom: 10px; }
.zeile { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.zeile.ende { justify-content: flex-end; }
.abstand { margin-top: 14px; }
.klein { font-size: 12.5px; } .muted { color: var(--muted); }
.fett { font-weight: 600; }
.leer { padding: 28px; text-align: center; color: var(--muted); }
.raster-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.raster-2 > .karte { margin-top: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
  border-radius: 7px; cursor: pointer; font-weight: 550; text-decoration: none; white-space: nowrap; max-width: 100%;
}
@media (max-width: 480px) { .btn { white-space: normal; text-align: left; } }
.btn:hover { background: var(--btn-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primaer { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primaer:hover { background: var(--navy-2); }
.btn.akzent { background: var(--amber); border-color: var(--amber); color: var(--auf-akzent); }
.btn.akzent:hover { background: color-mix(in srgb, var(--amber) 88%, #000); }
/* Farbcode: rot = löschen/kritisch, grün = bestätigen/anlegen, orange = Vorsicht (ändert viel, aber nichts geht verloren); Knöpfe nur mit Symbol sind weich gefärbt, damit Tabellenzeilen ruhig bleiben */
.btn.gefahr { background: var(--btn-rot); border-color: var(--btn-rot); color: #fff; }
.btn.gefahr:hover { background: var(--btn-rot-2); border-color: var(--btn-rot-2); }
.btn.ok { background: var(--btn-gruen); border-color: var(--btn-gruen); color: #fff; }
.btn.ok:hover { background: var(--btn-gruen-2); border-color: var(--btn-gruen-2); }
.btn.warn { background: var(--btn-gelb); border-color: var(--btn-gelb); color: #fff; }
.btn.warn:hover { background: var(--btn-gelb-2); border-color: var(--btn-gelb-2); }
.btn.nur-symbol.gefahr { background: var(--flaeche); color: var(--rot); border-color: #e6b3ae; }
.btn.nur-symbol.gefahr:hover { background: var(--rot-bg); }
.btn.nur-symbol.ok { background: var(--flaeche); color: var(--ok); border-color: var(--hok-rand); }
.btn.nur-symbol.ok:hover { background: var(--hok-bg); }
/* Gefahrenzone: abgesetzte Karte für Aktionen, die Daten löschen oder ersetzen */
.karte.gefahrenzone { border-color: var(--hr-rand); background: var(--hr-bg); }
.karte.gefahrenzone > h2 { color: var(--hr-text); }
.karte.gefahrenzone .muted { color: var(--hr-text); opacity: .85; }
.btn.klein { padding: 4px 9px; font-size: 13px; }
.btn.icon { padding: 5px 7px; }
.btn svg { width: 16px; height: 16px; }

input[type=text], input[type=number], input[type=date], input[type=password], input[type=email], input[type=time], select, textarea {
  padding: 7px 9px; border: 1px solid var(--linie); border-radius: 6px; background: var(--eingabe); min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--fokus); outline-offset: -1px; border-color: var(--fokus-rand); }
textarea { width: 100%; resize: vertical; }
.feld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.feld > label { font-weight: 600; font-size: 13px; }
.feld .hinweis { font-size: 12.5px; color: var(--muted); }
.feld.zeilig { flex-direction: row; align-items: center; gap: 10px; }
.formular-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.formular-raster .voll { grid-column: 1 / -1; }

.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.gelb { background: var(--gelb-bg); color: var(--gelb); }
.chip.rot { background: var(--rot-bg); color: var(--rot); }
.chip.grau { background: var(--grau-bg); color: var(--muted); }
.chip.violett { background: var(--violett-bg); color: var(--violett); }

.hinweisbox { padding: 10px 14px; border-radius: 7px; border: 1px solid var(--linie); background: var(--flaeche); margin-bottom: 14px; }
.hinweisbox.warn { background: var(--hw-bg); border-color: var(--hw-rand); }
.hinweisbox.rot { background: var(--hr-bg); border-color: var(--hr-rand); color: var(--hr-text); }
.hinweisbox.ok { background: var(--hok-bg); border-color: var(--hok-rand); }

/* ---------- Tabellen ---------- */
.tabelle-huelle { overflow: auto; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); }
table.t { border-collapse: collapse; width: 100%; }
table.t th, table.t td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--linie-2); vertical-align: top; }
table.t thead th { background: var(--navy); color: #fff; font-weight: 600; position: sticky; top: 0; z-index: 2; white-space: nowrap; }
table.t tbody tr:hover td { background: var(--hover); }
table.t td.r, table.t th.r { text-align: right; }
table.t td.m, table.t th.m { text-align: center; }
table.t td.aktionen { white-space: nowrap; text-align: right; }
table.t tr.inaktiv td { color: var(--grau); }
.filterleiste { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filterleiste input[type=text] { min-width: 220px; }
/* Modul „Projekte“: Fotogalerie, Bautagebuch, Unterschrift */
.abstand-links { margin-left: auto; }
.foto-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.foto-raster > .ladebalken, .foto-raster > p { grid-column: 1 / -1; }
.foto-kachel { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; text-align: left; cursor: pointer; color: var(--text); background: var(--card); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); font: inherit; }
.foto-kachel:hover { border-color: var(--amber); }
.foto-kachel img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--flaeche-3); }
.foto-kachel small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto-rubrik { position: absolute; top: 12px; left: 12px; }
.foto-gross { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto 14px; border-radius: 6px; background: var(--flaeche-3); }
.tagebuch { display: grid; gap: 12px; }
.tagebuch-eintrag { margin-top: 0; }
.tagebuch-text { margin: 8px 0 0; white-space: pre-wrap; }
.unterschrift-rahmen { margin-top: 6px; max-width: 420px; border: 1px solid var(--linie); border-radius: 6px; background: var(--flaeche); color: var(--text); }
.unterschrift { display: block; width: 100%; height: auto; }
.qr-rahmen { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); }
.qr-rahmen img { display: block; }
.handy-liste { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.handy-liste li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Reiter einer Seite (ui.js „tabs“); auf schmalen Bildschirmen wischbar statt umbrochen */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -2px 0 var(--linie); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs .tab { flex: none; background: none; border: none; padding: 9px 16px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs .tab:hover { color: var(--text); background: var(--flaeche-2); }
.tabs .tab.aktiv { color: var(--navy); border-bottom-color: var(--amber); }

/* ---------- Kennzahlen ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kachel { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--schatten); cursor: pointer; }
.kachel:hover { border-color: #aab6cc; }
.kachel .zahl { font-size: 30px; font-weight: 700; line-height: 1.1; }
.kachel .text { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kachel.ok .zahl { color: var(--ok); } .kachel.warn .zahl { color: #c26400; } .kachel.rot .zahl { color: var(--rot); }

/* ---------- Wochenraster (Einsätze, Monitor-Stil) ---------- */
.woche { --tage: 7; border: 1px solid var(--linie); border-radius: var(--radius); overflow: auto; background: var(--flaeche); max-height: calc(100vh - 170px); }
.woche .gitter { display: grid; grid-template-columns: 96px 120px repeat(7, minmax(150px, 1fr)); min-width: 1180px; }
.woche .z { border-bottom: 1px solid var(--linie-2); border-right: 1px solid var(--linie-2); padding: 5px 7px; min-height: 52px; position: relative; }
.woche .kopf { background: var(--navy); color: #fff; font-weight: 700; text-align: center; position: sticky; top: 0; z-index: 4; min-height: 40px; display: flex; flex-direction: column; justify-content: center; }
.woche .kopf small { font-weight: 400; font-size: 11px; }
.woche .kopf.we { background: var(--kopf-we); }
.woche .kopf.fe { background: #f2c200; color: var(--navy); }
.woche .kopf.heute { background: var(--amber); color: var(--auf-akzent); }
.woche .gr { background: var(--flaeche-3); font-size: 11.5px; font-weight: 700; position: sticky; left: 0; z-index: 3; }
.woche .ko { background: var(--flaeche-2); font-weight: 700; display: flex; align-items: center; position: sticky; left: 96px; z-index: 3; }
.woche .ecke { position: sticky; left: 0; z-index: 6; }
.woche .z.grenze { border-top: 2px solid var(--navy); }
.woche .zelle { cursor: cell; }
.woche .zelle:hover { background: var(--hover); }
.woche .zelle.we { background: var(--wochenende); }
.woche .zelle.fe { background: var(--feiertag); }
.woche .zelle.kf { background: var(--violett-bg); }
.woche .zelle.kfk { background: var(--rot-bg); }
.woche .zelle.auswahl { outline: 2px solid var(--blau); outline-offset: -2px; z-index: 1; }
.woche .zelle .txt { white-space: pre-wrap; word-break: break-word; }
.woche .zelle .txt.frei { color: var(--grau); }
.woche .zelle .crew { color: var(--muted); font-size: 12px; margin-top: 2px; }
.woche .zelle .vert { color: var(--violett); font-size: 12px; font-weight: 600; }
.woche .zelle textarea { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 70px; z-index: 5; border: 2px solid var(--blau); border-radius: 0; background: var(--eingabe); color: var(--text); padding: 5px 7px; resize: none; }
.woche .abw { background: var(--violett-bg); color: var(--violett); font-weight: 600; }
.woche .abwk { background: var(--abwk-bg); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; grid-column: 1 / 3; }
.vorschlaege { position: absolute; left: 0; top: 100%; min-width: 100%; z-index: 30; background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); box-shadow: var(--schatten); max-height: 220px; overflow: auto; }
.vorschlaege div { padding: 5px 9px; cursor: pointer; white-space: pre-wrap; }
.vorschlaege div.an, .vorschlaege div:hover { background: var(--amber-soft); }

/* ---------- Ampel-/Kontrollfarben ---------- */
.art-ok { background: var(--ok-bg); color: var(--ok); }
.art-frei { background: var(--grau-bg); color: var(--grau); }
.art-offen { background: var(--gelb-bg); color: var(--gelb); }
.art-warn { background: var(--warn-bg); color: var(--warn); }
.art-kf { background: var(--rot-bg); color: var(--rot); font-weight: 600; }
.art-vertretung { background: var(--gelb2-bg); color: var(--gelb2); }
.amp-G { background: var(--ok-bg); color: var(--ok); }
.amp-Y { background: var(--gelb2-bg); color: var(--gelb2); }
.amp-R { background: var(--rot-bg); color: var(--rot); font-weight: 700; }
.amp-O { background: var(--neutral-bg); color: var(--muted); }
.amp-F { background: var(--neutral-2); color: var(--muted); }
table.farbtab td { text-align: center; vertical-align: middle; white-space: pre-line; font-size: 12.5px; border-right: 1px solid var(--flaeche); }
table.farbtab th.tag { text-align: center; min-width: 88px; }
table.farbtab th.we { background: var(--kopf-we); }
table.farbtab th.fe { background: #f2c200; color: var(--navy); }
table.farbtab th.heute { background: var(--amber); color: var(--auf-akzent); }
table.farbtab td.gr { background: var(--flaeche-3); font-weight: 700; font-size: 12px; text-align: left; }
table.farbtab td.ko { background: var(--flaeche-2); font-weight: 700; text-align: left; white-space: nowrap; }
table.farbtab tr.grenze td { border-top: 2px solid var(--navy); }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; margin-top: 10px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }

/* Jahresplanung */
table.jahr { border-collapse: collapse; font-size: 11.5px; }
table.jahr th, table.jahr td { border: 1px solid var(--linie-2); padding: 3px 0; text-align: center; min-width: 27px; }
table.jahr thead th { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 2; }
table.jahr td.k, table.jahr th.k { text-align: left; padding: 3px 8px; white-space: nowrap; position: sticky; background: var(--flaeche); z-index: 1; }
table.jahr th.k { background: var(--navy); z-index: 3; }
table.jahr td.k1 { left: 0; background: var(--flaeche-3); font-weight: 700; font-size: 11px; max-width: 120px; }
table.jahr td.k2 { left: 0; font-weight: 600; background: var(--flaeche-2); }
table.jahr tr.summe td { font-weight: 700; border-top: 2px solid var(--navy); }

/* ---------- Dialog ---------- */
.schleier { position: fixed; inset: 0; background: rgba(20, 28, 48, .55); z-index: 100; display: grid; place-items: center; padding: 20px; overflow: auto; }
.dialog { background: var(--flaeche); color: var(--text); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.35); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.dialog.breit { width: min(860px, 100%); }
.dialog > header { padding: 14px 18px; border-bottom: 1px solid var(--linie); font-weight: 650; font-size: 16px; }
.dialog > .koerper { padding: 16px 18px; overflow: auto; }
.dialog > footer { padding: 12px 18px; border-top: 1px solid var(--linie); display: flex; justify-content: flex-end; gap: 8px; background: var(--flaeche-2); border-radius: 0 0 10px 10px; }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--schatten); animation: rein .15s ease-out; }
.toast.fehler { background: var(--rot); } .toast.warn { background: #b56400; } .toast.ok { background: #1f7a3a; }
@keyframes rein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Anmeldung ---------- */
.anmeldung { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy) 0%, #34477a 100%); padding: 20px; }
.anmeldung .box { width: min(420px, 100%); background: var(--flaeche); color: var(--text); border-radius: 12px; padding: 28px 28px 24px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.anmeldung h1 { margin-bottom: 4px; }
.anmeldung .logo-bild { display: block; width: 56px; height: 56px; border-radius: 13px; margin-bottom: 14px; }
.anmeldung .logo { width: 44px; height: 44px; border-radius: 11px; background: var(--amber); display: grid; place-items: center; margin-bottom: 14px; color: var(--auf-akzent); }

/* ---------- Sonstiges ---------- */
.pillen { display: flex; gap: 6px; flex-wrap: wrap; }
.kwwahl { display: flex; align-items: center; gap: 6px; }
.kwwahl .kwtext { min-width: 210px; text-align: center; font-weight: 650; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }
.ladebalken { padding: 40px; text-align: center; color: var(--muted); }
.kbd { font-family: Consolas, monospace; background: var(--grau-bg); border: 1px solid var(--linie); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }
.linkzeile { display: flex; gap: 8px; align-items: center; }
.linkzeile input { flex: 1; font-family: Consolas, monospace; font-size: 12.5px; }

@media (max-width: 980px) {
  #app { grid-template-columns: 1fr; }
  #nav { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  #nav.offen { transform: none; }
  #menuknopf { display: inline-flex; }
  #inhalt { padding: 14px 12px 50px; }
  .formular-raster { grid-template-columns: 1fr; }
}
@media print {
  #nav, #kopf .aktionen, .filterleiste, .btn, #toasts, .tabs, .skip { display: none !important; }
  #app { display: block; } body { background: #fff; }
  .woche { max-height: none; overflow: visible; }
  .karte { box-shadow: none; }
}

/* ---------- Hilfe ---------- */
.hilfe h1 { margin-bottom: 8px; }
.hilfe h2 { margin: 26px 0 8px; padding-top: 14px; border-top: 1px solid var(--linie-2); }
.hilfe h3 { margin: 16px 0 6px; }
.hilfe p { margin: 8px 0; }
.hilfe ul, .hilfe ol { margin: 6px 0 10px; padding-left: 24px; }
.hilfe li { margin: 4px 0; }

/* ---------- Urlaubskalender ---------- */
table.kalender th, table.kalender td { min-width: 0; padding: 0 1px; }
table.kalender td.kal { width: 11px; min-width: 11px; height: 20px; padding: 0; border: 1px solid var(--linie-2); }
table.kalender td.kal.ab { background: var(--zelle-abw); }
table.kalender td.kal.kr { background: var(--zelle-krank); }
table.kalender td.kal.we { background: var(--wochenende); }
table.kalender td.kal.fe { background: var(--feiertag); }
table.kalender td.k { padding: 3px 8px; }
.lg-ab { background: var(--zelle-abw); } .lg-kr { background: var(--zelle-krank); } .lg-we { background: var(--wochenende); } .lg-fe { background: var(--feiertag); }

/* ---------- Kalender ---------- */
.kal-werkzeug { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.kal-zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kal-nav { display: inline-flex; gap: 4px; }
.kal-titel { margin: 0; font-size: 20px; min-width: 220px; }
.segment { display: inline-flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; background: var(--flaeche); }
.segment .seg { border: 0; background: none; padding: 6px 12px; cursor: pointer; font: inherit; font-weight: 600; color: var(--muted); border-right: 1px solid var(--linie); }
.segment .seg:last-child { border-right: 0; }
.segment .seg:hover { background: var(--flaeche-2); }
.segment .seg.aktiv { background: var(--navy); color: #fff; }
.linkknopf { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-align: inherit; }
.linkknopf:hover { text-decoration: underline; }
.kal-koerper .nowrap { white-space: nowrap; }
.kal-koerper ul.schlicht { list-style: none; margin: 0; padding: 0; } .kal-koerper ul.schlicht li { padding: 3px 0; border-bottom: 1px solid var(--linie-2); }

table.kal { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--flaeche); color: var(--text); }
table.kal th, table.kal td { border-bottom: 1px solid var(--linie-2); border-right: 1px solid var(--linie-2); padding: 4px 6px; vertical-align: top; }
table.kal thead th { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 4; text-align: center; font-weight: 700; }
table.kal thead th small { display: block; font-weight: 400; font-size: 11px; }
table.kal thead th small.rot { color: #ffd0cc; }
table.kal thead th.we { background: var(--kopf-we); } table.kal thead th.fe { background: #f2c200; color: var(--navy); } table.kal thead th.heute { background: var(--amber); color: var(--auf-akzent); }
table.kal .kol { position: sticky; left: 0; z-index: 3; background: var(--flaeche-2); text-align: left; font-weight: 700; min-width: 110px; }
table.kal thead .kol { background: var(--navy); z-index: 6; }
table.kal tr.gruppe td { background: var(--flaeche-3); font-size: 11.5px; font-weight: 700; }
table.kal tr.zusatz td, table.kal tr.zusatz th { background: var(--flaeche-2); }
table.kal td.zelle { cursor: pointer; font-size: 13px; min-height: 44px; }
table.kal td.zelle:hover { outline: 2px solid var(--blau); outline-offset: -2px; }
table.kal td.zelle .text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
table.kal td.zelle small { display: block; text-align: right; opacity: .7; font-size: 10.5px; }
table.kal td.we, table.kal td.fe { background-image: linear-gradient(rgba(150,150,150,.14), rgba(150,150,150,.14)); }
table.kal td.fe { background-image: linear-gradient(rgba(242,194,0,.22), rgba(242,194,0,.22)); }
table.kal td.heute { box-shadow: inset 0 0 0 2px var(--amber); }
table.kal .chip { margin: 1px 2px 1px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.gitter { table-layout: fixed; }
table.gitter th.kwspalte { width: 56px; background: var(--flaeche-2); color: var(--muted); text-align: center; font-size: 12px; }
table.gitter td.tagzelle { height: 108px; cursor: pointer; padding: 4px 6px; }
table.gitter td.tagzelle:hover { background-color: var(--hover); }
table.gitter td.aussen { opacity: .45; }
table.gitter td.ferien { background-color: var(--ferien); }
table.gitter .tagkopf { display: flex; justify-content: space-between; align-items: center; }
table.gitter .feiertag { color: var(--gelb2); font-size: 11.5px; font-weight: 700; }
table.gitter .ev { font-size: 11.5px; background: var(--amber-soft); border-radius: 4px; padding: 0 5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.gitter .fuss { margin-top: 4px; }
table.heat { width: auto; }
table.heat td.heiss { min-width: 18px; height: 26px; padding: 0; cursor: pointer; background: var(--neutral-2); }
table.heat th.heisskopf { font-size: 10.5px; padding: 2px; writing-mode: vertical-rl; min-width: 18px; }
table.heat tr.summe th, table.heat tr.summe td { border-top: 2px solid var(--navy); }

.mini-monate { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.mini { background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 12px; }
.mini-titel { display: block; margin-bottom: 6px; }
.mini-raster { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-raster .kopf { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.mini-raster .tag { position: relative; border: 0; background: var(--flaeche-2); color: var(--text); border-radius: 4px; padding: 4px 0; font: inherit; font-size: 12px; cursor: pointer; }
.mini-raster .tag:hover { outline: 2px solid var(--blau); }
.mini-raster .tag.we { background: transparent; color: var(--muted); }
.mini-raster .tag.fe { background: #f2c200; color: var(--navy); }
.mini-raster .tag.ferien { box-shadow: inset 0 -3px 0 #7db1ff; }
.mini-raster .tag.heute { outline: 2px solid var(--amber); }
.mini-raster .tag.h1 { background: var(--h1); color: var(--h1-t); } .mini-raster .tag.h2 { background: var(--h2); color: var(--h2-t); }
.mini-raster .tag.h3 { background: var(--h3); color: #fff; } .mini-raster .tag.h4 { background: var(--h4); color: #fff; }
.mini-raster .punkt { position: absolute; right: 3px; top: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--punkt); }

.agenda { display: grid; gap: 10px; }
.agenda-tag { padding: 10px 14px; }
.agenda-tag h3 { margin: 0 0 6px; font-size: 15px; display: flex; gap: 10px; align-items: baseline; }
.agenda-tag h3 small { color: var(--muted); font-weight: 400; }
.agenda-tag.heute { border-color: var(--amber); }
.agenda-tag.fe { background: var(--feiertag-2); }

.kal-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kal-kachel { cursor: pointer; } .kal-kachel + .kal-kachel { margin-top: 0; }
.kal-kachel:hover { border-color: #aab6cc; }
.kal-kachel-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kal-kachel-kopf h3 { margin: 0; } .kal-kachel-kopf small { color: var(--muted); }
.kal-kachel-zahlen { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.kal-kachel .streifen { display: flex; flex-wrap: wrap; gap: 1px; margin: 6px 0 8px; }
.kal-kachel .streifen i { display: block; width: 7px; height: 12px; border-radius: 1px; }
@media (max-width: 760px) { .kal-titel { font-size: 17px; min-width: 0; } .segment .seg { padding: 5px 8px; } }

/* ---------- Besetzung (Personen ziehen) ---------- */
.besetzung { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.besetzung .spalte { background: var(--flaeche-2); border: 2px solid transparent; border-radius: var(--radius); padding: 8px; min-height: 120px; }
.besetzung .spalte.ohne { background: var(--hw-bg); }
.besetzung .spalte.ziel, .stammziel.ziel { border-color: var(--blau); background: var(--blau-bg); }
.besetzung .spaltenkopf { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.besetzung .spaltenkopf small { color: var(--muted); flex: 1; }
.besetzung .hinweise { font-size: 11.5px; color: var(--warn); margin-bottom: 6px; }
.besetzung .personen { display: grid; gap: 5px; }
.besetzung .person { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); border-radius: 6px; padding: 5px 8px; cursor: grab; box-shadow: var(--schatten); }
.besetzung .person:active { cursor: grabbing; }
.besetzung .person.kf { border-left: 4px solid var(--violett); }
.besetzung .person.zieht { opacity: .4; }
.besetzung .person.gewaehlt { outline: 3px solid var(--akzent, #2563eb); outline-offset: 1px; }
.besetzung .spalte, .besetzung .stammziel { cursor: pointer; }
.besetzung .person .pname { font-weight: 600; margin-right: auto; }
.stammziel { border: 2px dashed var(--linie); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; display: flex; gap: 12px; align-items: baseline; color: var(--muted); }
.kw-text { white-space: nowrap; }
table.kal td.zelle.gewaehlt { outline: 3px solid var(--blau); outline-offset: -3px; background-image: linear-gradient(rgba(43,108,223,.12), rgba(43,108,223,.12)); }
table.kal td.zelle.ziel { outline: 3px dashed #1e8e3e; outline-offset: -3px; }
table.kal td.zelle.zieht { opacity: .45; }
table.kal td.zelle[draggable=true] { cursor: grab; }
.auswahlleiste { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 8px; background: var(--blau-bg); border: 1px solid var(--blau-rand); border-radius: var(--radius); position: sticky; top: 0; z-index: 8; }

/* ---------- Baustellenakte, Qualifikationen, Geräte, Auslastung ---------- */
.zahlenzeile { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 10px; }
.zahlenzeile b { display: block; font-size: 26px; line-height: 1.1; }
.zahlenzeile small { color: var(--muted); }
.fortschrittsbalken { display: flex; height: 14px; background: var(--neutral-2); border-radius: 7px; overflow: hidden; margin: 6px 0 10px; }
.fortschrittsbalken .ist { background: #2e9e56; } .fortschrittsbalken .geplant { background: #5b9cf0; }
table.quali td.qzelle { cursor: pointer; text-align: center; white-space: nowrap; }
table.quali td.qzelle:hover { background: var(--hover); }
table.quali thead th { min-width: 90px; }
.auslast { font-variant-numeric: tabular-nums; text-align: center; }
table.kal td.auslast.h-gruen { background: var(--heiss-g); } table.kal td.auslast.h-gelb { background: var(--heiss-y); } table.kal td.auslast.h-rot { background: var(--heiss-r); }
table.belegung td { text-align: center; padding: 2px 3px; min-width: 70px; }
table.belegung td .chip { display: block; margin: 0; }
table.belegung td.leerfeld { cursor: pointer; color: var(--muted); } table.belegung td.leerfeld:hover { background: var(--blau-bg); }

/* ---------- Dunkelmodus (data-thema="dunkel"; „auto“ folgt Windows): überschreibt nur die Farbvariablen ---------- */
:root[data-thema="dunkel"] {
  --navy: #0e1424; --navy-2: #1a2336; --bg: #121722; --card: #1a2130; --text: #e5e9f1; --muted: #a3aec2;
  --linie: #313a4e; --linie-2: #272f41; --ok: #6fd28c; --ok-bg: #173a27; --warn: #ffc27a; --warn-bg: #4a3213;
  --gelb: #e8d56b; --gelb-bg: #3b3612; --rot: #ff9a92; --rot-bg: #4b201d; --violett: #d4a9f2; --violett-bg: #3a2550;
  --grau: #98a1b3; --grau-bg: #262c3a; --feiertag: #4a4311; --wochenende: #20263a; --kopf-we: #38425a; --amber-soft: #4a3a0c;
  --flaeche: #1a2130; --eingabe: #10151f; --flaeche-2: #1f2638; --flaeche-3: #262f45; --hover: #222c44; --hover-2: #262e42;
  --blau-bg: #1f2c48; --blau-rand: #35508a; --blau: #5a96ff; --neutral-bg: #262c3a; --neutral-2: #2c3345; --ferien: #1b2a44; --link: #8ab8ff;
  --gelb2-bg: #4a3d12; --gelb2: #f0d98a; --zelle-abw: #6b4a96; --zelle-krank: #9a403b;
  --hw-bg: #3a2f16; --hw-rand: #7a5a1f; --hr-bg: #4b201d; --hr-rand: #8a3a35; --hr-text: #ffb4ac; --hok-bg: #173a27; --hok-rand: #2c6b45;
  --feiertag-2: #3a3412; --heiss-g: #1d4a30; --heiss-y: #4a4012; --heiss-r: #5a2622;
  --h1: #3a2550; --h2: #54337a; --h3: #7a4aa8; --h4: #9a5fd0; --h1-t: #e5e9f1; --h2-t: #e5e9f1;
  --abwk-bg: #6b4a96; --geaendert: #3b3612; --geaendert-rand: #7a6a1f; --geaendert-text: #f0e3a0; --btn-hover: #2c3650; --punkt: #ff8a4c;
  --schatten: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}
:root[data-thema="dunkel"] .btn { background: #232b3c; border-color: var(--linie); }
:root[data-thema="dunkel"] .btn.primaer { background: var(--amber); border-color: var(--amber); color: var(--auf-akzent); }
:root[data-thema="dunkel"] .btn.akzent { background: var(--amber); border-color: var(--amber); color: var(--auf-akzent); }
:root[data-thema="dunkel"] .btn.gefahr { background: #b3342c; border-color: #b3342c; color: #fff; }
:root[data-thema="dunkel"] .btn.gefahr:hover { background: #cc4037; border-color: #cc4037; }
:root[data-thema="dunkel"] .btn.ok { background: #238636; border-color: #238636; color: #fff; }
:root[data-thema="dunkel"] .btn.ok:hover { background: #2ea043; border-color: #2ea043; }
:root[data-thema="dunkel"] .btn.warn { background: #b45f06; border-color: #b45f06; color: #fff; }
:root[data-thema="dunkel"] .btn.nur-symbol.gefahr { background: #232b3c; color: var(--rot); border-color: #7a3a35; }
:root[data-thema="dunkel"] .btn.nur-symbol.ok { background: #232b3c; color: var(--ok); border-color: var(--hok-rand); }
:root[data-thema="dunkel"] table.t thead th, :root[data-thema="dunkel"] table.kal thead th { background: #2a3550; color: #fff; }
:root[data-thema="dunkel"] table.kal thead th.we, :root[data-thema="dunkel"] table.t thead th.we { background: var(--kopf-we); }
:root[data-thema="dunkel"] table.kal thead th.fe, :root[data-thema="dunkel"] .woche .kopf.fe { background: #8a6f00; color: #fff; }
:root[data-thema="dunkel"] table.kal thead th.heute, :root[data-thema="dunkel"] .woche .kopf.heute { background: var(--amber); color: var(--auf-akzent); }
:root[data-thema="dunkel"] .woche .kopf { background: #2a3550; }
:root[data-thema="dunkel"] table.jahr thead th, :root[data-thema="dunkel"] table.jahr th.k { background: #2a3550; }
:root[data-thema="dunkel"] .segment .seg.aktiv { background: #2a3550; color: #fff; }
:root[data-thema="dunkel"] .tabs .tab.aktiv { color: var(--text); }
:root[data-thema="dunkel"] .mini-raster .tag.fe { background: #8a6f00; color: #fff; }
:root[data-thema="dunkel"] table.farbtab th.fe { background: #8a6f00; color: #fff; }
:root[data-thema="dunkel"] .kachel.warn .zahl { color: var(--warn); }
:root[data-thema="dunkel"] .toast { background: #2a3550; }
:root[data-thema="dunkel"] .toast.fehler { background: #8a2a24; } :root[data-thema="dunkel"] .toast.warn { background: #8a5200; } :root[data-thema="dunkel"] .toast.ok { background: #1f6a35; }
:root[data-thema="dunkel"] .schleier { background: rgba(0, 0, 0, .65); }
:root[data-thema="dunkel"] .anmeldung { background: linear-gradient(135deg, #0e1424 0%, #1e2a4a 100%); }
:root[data-thema="dunkel"] .art-vertretung, :root[data-thema="dunkel"] .amp-Y { color: var(--gelb2); }

/* ---------- Befehlspalette (Strg+K), Live-Hinweis, Kürzel ---------- */
.palette { width: min(640px, 100%); background: var(--flaeche); color: var(--text); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.35); overflow: hidden; align-self: start; margin-top: 8vh; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--linie); padding: 14px 16px; font-size: 16px; outline: none; background: transparent; }
.palette .treffer { max-height: 56vh; overflow: auto; }
.palette .gruppe-titel { padding: 6px 16px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.palette .eintrag { display: flex; gap: 10px; padding: 8px 16px; cursor: pointer; align-items: baseline; }
.palette .eintrag.an, .palette .eintrag:hover { background: var(--amber-soft); }
.palette .eintrag small { color: var(--muted); margin-left: auto; }
.live-hinweis { background: var(--geaendert); border: 1px solid var(--geaendert-rand); color: var(--geaendert-text); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 10px; display: flex; gap: 10px; align-items: center; }
.kuerzel-liste { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kuerzel-liste kbd { background: var(--grau-bg); border: 1px solid var(--linie); border-radius: 4px; padding: 1px 6px; font-family: inherit; font-size: 12px; }
.fav-stern { background: none; border: 0; cursor: pointer; font-size: 18px; color: var(--grau); padding: 2px 6px; }
.fav-stern.an { color: var(--amber); }
#nav .gruppe.fav { color: var(--amber); }

/* ---------- Handy und Tablet ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  main { padding: 0; }
  #kopf { flex-wrap: wrap; gap: 8px; }
  #kopf .aktionen { width: 100%; }
  .raster-2, .kal-kacheln, .mini-monate, .besetzung { grid-template-columns: 1fr; }
  .besetzung { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .formular-raster { grid-template-columns: 1fr; }
  .dialog { max-width: 100%; } .dialog.breit { width: 100%; }
  .btn { min-height: 38px; }
  .filterleiste input[type=text], .filterleiste input[type=search] { min-width: 0; flex: 1 1 100%; }
  table.t th, table.t td { padding: 6px 7px; }
  table.gitter td.tagzelle { height: 84px; padding: 2px 3px; }
  table.gitter .fuss .chip { font-size: 10.5px; padding: 0 5px; }
  .zahlenzeile { gap: 14px; }
  .palette { margin-top: 2vh; }
  .kal-werkzeug .segment { overflow-x: auto; max-width: 100%; }
}

/* ---------- Szenarien ---------- */
.szenarien-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.karte.szenario { cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.karte.szenario + .karte.szenario { margin-top: 0; }
.karte.szenario.aktiv { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber-soft); }
td.szenario-zelle { padding: 2px; min-width: 150px; }
td.szenario-zelle textarea { width: 100%; resize: vertical; border: 1px solid var(--linie-2); border-radius: 4px; padding: 3px 5px; font-size: 13px; }
td.szenario-zelle textarea.geaendert { background: var(--geaendert); border-color: var(--geaendert-rand); color: var(--geaendert-text); }
.szenario-banner { background: var(--geaendert); border: 1px solid var(--geaendert-rand); color: var(--geaendert-text); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Inhaltsverzeichnis (Hilfe, Was ist neu) ---------- */
.verzeichnis { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 14px; }
.verzeichnis ul { margin: 6px 0 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.verzeichnis li { margin: 2px 0; break-inside: avoid; }
@media (max-width: 760px) { .verzeichnis ul { columns: 1; } }

/* ---------- Handy: nichts über den Rand ---------- */
.kwwahl { flex-wrap: wrap; }
@media (max-width: 760px) {
  .kwwahl .kwtext { min-width: 0; flex: 1 1 140px; }
  .tabs .tab { padding: 8px 10px; }
  #kopf .aktionen > * { max-width: 100%; }
}

/* ---------- Bedienbarkeit: Tastatur, Bildschirmleser, Bewegung, „Nur lesen“ ---------- */
:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
#nav :focus-visible { outline-color: var(--amber); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: -1px; }
#inhalt:focus { outline: none; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 300; background: var(--amber); color: var(--auf-akzent); padding: 8px 14px; border-radius: 0 0 8px 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 0; }
.nur-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.nur-lesen [data-schreibt] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Übersicht: Widgets ---------- */
.wg-raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.wg-huelle { position: relative; min-width: 0; }
.wg-b1 { grid-column: span 1; } .wg-b2 { grid-column: span 2; } .wg-b3 { grid-column: span 3; }
.wg-titel { display: flex; align-items: center; gap: 4px; }
.wg-titel a { color: inherit; text-decoration: none; } .wg-titel a:hover { text-decoration: underline; }
.wg-gross { font-size: 34px; font-weight: 700; line-height: 1.1; }
.wg-zeile { padding: 4px 0; border-top: 1px solid var(--linie); } .wg-zeile:first-of-type { border-top: 0; }
.wg-kacheln { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.wg-anpassen { margin-bottom: 14px; }
.wg-frei { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.wg-raster.bearbeiten .wg-huelle { outline: 2px dashed var(--linie); outline-offset: 3px; border-radius: var(--radius); cursor: grab; }
.wg-raster.bearbeiten .wg-huelle.ziel { outline-color: #2a5db0; }
.wg-raster.bearbeiten .wg-huelle.zieht { opacity: .45; }
.wg-raster.bearbeiten .wg-huelle > :not(.wg-werkzeug) { pointer-events: none; }
.wg-werkzeug { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.wg-griff { font-weight: 600; user-select: none; }
@media (max-width: 900px) { .wg-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wg-b3 { grid-column: span 2; } }
@media (max-width: 600px) { .wg-raster { grid-template-columns: 1fr; } .wg-b1, .wg-b2, .wg-b3 { grid-column: span 1; } }
.wg-gross.wg-warn { color: #c26400; } .wg-gross.wg-ok { color: var(--ok); }
:root[data-thema="dunkel"] .wg-gross.wg-warn { color: var(--warn); }
.wg-balkenzeile { display: grid; grid-template-columns: minmax(70px, 1fr) 2fr 44px; gap: 8px; align-items: center; padding: 3px 0; }
.wg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.wg-prozent { text-align: right; font-variant-numeric: tabular-nums; }
.wg-balken { height: 10px; background: var(--flaeche, #eef1f6); border: 1px solid var(--linie); border-radius: 999px; overflow: hidden; }
.wg-balken-fuell { height: 100%; background: #2a5db0; }
.wg-huelle textarea { font: inherit; padding: 8px; border: 1px solid var(--linie); border-radius: 6px; background: var(--card); color: inherit; }

/* ---------- Darstellung (Mein Konto → Darstellung): Farbschemata, Textgröße, Dichte, schmales Menü ----------
   Ein Farbschema setzt nur Akzent, Menüfarben, Links und Fokus – hell und dunkel getrennt; Statusfarben bleiben überall gleich.
   Die Auswahl-Selektoren gelten auch für die kleinen Vorschauen im Dialog (.vs trägt data-farbe und ggf. data-thema). */
[data-farbe="standard"] { --amber: #f2a900; --amber-soft: #fff4c2; --auf-akzent: #1f2a44; --navy: #1f2a44; --navy-2: #2a3859; --link: #1a5fb4; --fokus: #8fb4ee; --fokus-rand: #6d9de6; --menue-text: #dfe6f5; --menue-muted: #9fb0d0; --menue-rand: #36466b; }
[data-farbe="standard"][data-thema="dunkel"] { --amber: #f2a900; --amber-soft: #4a3a0c; --auf-akzent: #1f2a44; --navy: #0e1424; --navy-2: #1a2336; --link: #8ab8ff; --fokus: #8fb4ee; --fokus-rand: #6d9de6; --menue-text: #dfe6f5; --menue-muted: #9fb0d0; --menue-rand: #36466b; }
[data-farbe="orange"] { --amber: #f76707; --amber-soft: #ffe8d6; --auf-akzent: #1f1a17; --navy: #2f3a45; --navy-2: #3d4a58; --link: #b34700; --fokus: #f4a26b; --fokus-rand: #e8590c; --menue-text: #e6ebf0; --menue-muted: #aebbc8; --menue-rand: #4a5866; }
[data-farbe="orange"][data-thema="dunkel"] { --amber: #ff8a3d; --amber-soft: #4a2a12; --auf-akzent: #1f1a17; --navy: #161c22; --navy-2: #222b34; --link: #ffa066; --fokus: #ff8a3d; --fokus-rand: #ff8a3d; --menue-text: #e6ebf0; --menue-muted: #a3b0bd; --menue-rand: #36424d; }
[data-farbe="gruen"] { --amber: #2f9e44; --amber-soft: #d8f5df; --auf-akzent: #0f1f14; --navy: #1c3a2c; --navy-2: #285040; --link: #1b7a35; --fokus: #8ad19a; --fokus-rand: #2f9e44; --menue-text: #e3f1e8; --menue-muted: #a5c4b2; --menue-rand: #3b5f4b; }
[data-farbe="gruen"][data-thema="dunkel"] { --amber: #51cf66; --amber-soft: #16381f; --auf-akzent: #0f1f14; --navy: #0f1f17; --navy-2: #1a3126; --link: #7fdc92; --fokus: #51cf66; --fokus-rand: #51cf66; --menue-text: #e3f1e8; --menue-muted: #9dbfaa; --menue-rand: #2c4a3a; }
[data-farbe="mint"] { --amber: #20c997; --amber-soft: #d3f9ec; --auf-akzent: #07262b; --navy: #0f3a46; --navy-2: #1a4e5c; --link: #00775c; --fokus: #7fdcc3; --fokus-rand: #12a57c; --menue-text: #e0f3f5; --menue-muted: #9fc7ce; --menue-rand: #2d5a66; }
[data-farbe="mint"][data-thema="dunkel"] { --amber: #63e6be; --amber-soft: #0f3a32; --auf-akzent: #07262b; --navy: #0a1f26; --navy-2: #142f38; --link: #7ff0d0; --fokus: #63e6be; --fokus-rand: #63e6be; --menue-text: #e0f3f5; --menue-muted: #95bcc4; --menue-rand: #24464f; }

/* Textgröße: Die Oberfläche ist in px gesetzt, daher zoom statt Schriftgröße (--zoom gleicht die Bildschirmhöhe aus) */
html[data-text="gross"] { zoom: 1.1; --zoom: 1.1; }
html[data-text="sehrgross"] { zoom: 1.25; --zoom: 1.25; }

/* Dichte der Listen, Tabellen und Karten (auf dem Handy bleibt es beim festen Abstand) */
@media (min-width: 761px) {
  html[data-dichte="kompakt"] table.t th, html[data-dichte="kompakt"] table.t td { padding: 3px 8px; }
  html[data-dichte="kompakt"] table.kal th, html[data-dichte="kompakt"] table.kal td { padding: 2px 4px; }
  html[data-dichte="kompakt"] .karte { padding: 10px 12px; }
  html[data-dichte="kompakt"] #inhalt { padding: 12px 16px 50px; }
  html[data-dichte="locker"] table.t th, html[data-dichte="locker"] table.t td { padding: 11px 12px; }
  html[data-dichte="locker"] table.kal th, html[data-dichte="locker"] table.kal td { padding: 7px 8px; }
  html[data-dichte="locker"] .karte { padding: 22px 24px; }
  html[data-dichte="locker"] #inhalt { padding: 28px 32px 70px; }
}

/* Dialog „Darstellung“ */
.darstellung .abschnitt { margin-bottom: 16px; }
.darstellung .abschnitt > h3 { margin-bottom: 6px; }
.darstellung .abschnitt > p { margin: 6px 0 0; }
.farbkarten { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.farbkarte { display: grid; gap: 4px; justify-items: start; padding: 10px; border: 2px solid var(--linie); border-radius: 10px; background: var(--card); color: inherit; cursor: pointer; text-align: left; font: inherit; }
.farbkarte:hover { border-color: var(--link); }
.farbkarte.aktiv { border-color: var(--link); box-shadow: 0 0 0 2px var(--link); }
.farbkarte .vorschau { display: flex; gap: 6px; margin-bottom: 4px; }
.farbkarte .vs { display: flex; gap: 3px; padding: 4px; border-radius: 6px; border: 1px solid var(--linie); background: #f4f6f9; }
.farbkarte .vs[data-thema="dunkel"] { background: #121722; }
.farbkarte .vs i { display: block; width: 22px; height: 22px; border-radius: 5px; }
.farbkarte .vs i.m { background: var(--navy); }
.farbkarte .vs i.a { background: var(--amber); }
.farbkarte small { font-size: 12px; }

/* Menü schmal: nur Symbole; beim Darüberfahren oder Tastaturfokus klappt das Menü über den Inhalt auf */
@media (min-width: 761px) {
  html[data-menue="schmal"] #app { grid-template-columns: 64px 1fr; }
  html[data-menue="schmal"] #nav { width: 64px; z-index: 40; overflow-x: hidden; transition: width .15s; }
  html[data-menue="schmal"] #nav:is(:hover, :has(:focus-visible), :has(select:focus)) { width: 236px; box-shadow: 6px 0 20px rgba(0, 0, 0, .35); }
  html[data-menue="schmal"] #nav:not(:hover):not(:has(:focus-visible)):not(:has(select:focus)) { padding-left: 8px; padding-right: 8px; }
  html[data-menue="schmal"] #nav:not(:hover):not(:has(:focus-visible)):not(:has(select:focus)) :is(.punkt-text, .logo-text, .benutzer-text, .btn > span) {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  html[data-menue="schmal"] #nav:not(:hover):not(:has(:focus-visible)):not(:has(select:focus)) :is(.gruppe, .version, .standort-wahl) { display: none; }
  html[data-menue="schmal"] #nav:not(:hover):not(:has(:focus-visible)):not(:has(select:focus)) :is(a.punkt, .benutzer-knopf, .logo) { justify-content: center; padding-left: 0; padding-right: 0; }
  html[data-menue="schmal"] #nav:not(:hover):not(:has(:focus-visible)):not(:has(select:focus)) .unten-zeile { flex-direction: column; }
}
