:root {
  --hg: #f4f4f2; --flaeche: #ffffff; --text: #1d1d1b; --leise: #66655f; --linie: #e0dfda;
  --akzent: #1d1d1b; --gelb: #fff07f; --gelb-text: #1a1a1a;
  --a: #2e7d4f; --b: #2f5d8a; --c: #9a6b12; --x: #8a8a85;
  --dringend: #b3261e; --bald: #b26a00; --ok: #2e7d4f;
  /* Menüleiste (in beiden Modi dunkel) */
  --leiste: #4a4a4a; --leiste-gruppe: #3b3b3b; --leiste-logo: #232323; --leiste-rand: #555; --leiste-text: #d9d9d6;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hg: #161615; --flaeche: #222220; --text: #ecebe7; --leise: #a8a6a0; --linie: #383734;
    --akzent: #ecebe7; --a: #6cc08f; --b: #7fa9d4; --c: #e0b25a; --x: #8f8e89;
    --dringend: #f08a82; --bald: #f0b35a; --ok: #6cc08f;
    --leiste: #2e2e2d; --leiste-gruppe: #252524; --leiste-logo: #121212; --leiste-rand: #444;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--hg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--akzent); text-decoration-color: var(--c); text-underline-offset: 2px; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }

/* Menüleiste: dunkle, abgerundete Leiste mit Logo-Kachel, Reiter-Kacheln und gelbem Hauptknopf */
.kopf { position: sticky; top: 0; z-index: 2; padding: 12px 16px 4px; background: linear-gradient(var(--hg) 75%, transparent); }
.leiste { display: flex; align-items: stretch; gap: 8px; max-width: max-content; margin: 0 auto; padding: 8px; background: var(--leiste); border-radius: 20px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.logo { display: grid; place-items: center; min-width: 52px; padding: 0 12px; border-radius: 12px; background: var(--leiste-logo); color: #e8e8e6; font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: -.02em; }
.reiter { display: flex; gap: 6px; padding: 6px; background: var(--leiste-gruppe); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.reiter::-webkit-scrollbar { display: none; }
.reiter a { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--leiste-rand); border-radius: 10px; color: var(--leiste-text); text-decoration: none; white-space: nowrap; font-size: .92rem; }
.reiter a:hover { border-color: #777; color: #fff; }
.reiter a[aria-current] { border-color: var(--gelb); color: var(--gelb); }
.cta { display: grid; place-items: center; padding: 0 20px; border-radius: 12px; background: var(--gelb); color: var(--gelb-text); font-weight: 700; text-decoration: none; white-space: nowrap; }
.cta:hover { filter: brightness(1.04); }
.cta[aria-current] { box-shadow: inset 0 0 0 2px var(--gelb-text); }
.tage a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--leise); white-space: nowrap; }
.tage a[aria-current] { background: var(--flaeche); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--linie); }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.karte header { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; }
.karte .titel { flex: 1 1 220px; min-width: 0; }
.karte h3 { margin: 0; font-size: 1rem; overflow-wrap: break-word; hyphens: auto; }
.karte .titel p { margin: 2px 0 0; color: var(--leise); font-size: .9rem; }
.stufe { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--x); font-size: .8rem; }
.stufe-A { background: var(--a); } .stufe-B { background: var(--b); } .stufe-C { background: var(--c); }
.frist { flex: none; font-size: .8rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor; color: var(--leise); }
.frist-dringend { color: var(--dringend); } .frist-bald { color: var(--bald); }
.bezug { margin: 10px 0 0; font-size: .925rem; }
.grund { margin: 8px 0 0; font-size: .875rem; color: var(--leise); font-style: italic; }
.fakten { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 10px 0 0; font-size: .875rem; }
.fakten dt { color: var(--leise); } .fakten dd { margin: 0; overflow-wrap: anywhere; }
details { margin-top: 10px; font-size: .875rem; }
summary { cursor: pointer; color: var(--akzent); }
table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .875rem; }
th, td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--linie); vertical-align: top; overflow-wrap: break-word; hyphens: auto; }
tr.st-nicht_nachgewiesen td:last-child { color: var(--dringend); font-weight: 600; }
tr.st-erfuellt td:last-child { color: var(--ok); }
.karte footer { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linie); font-size: .875rem; }
.quelle { color: var(--leise); }
.status { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
input, select, button { font: inherit; font-size: .875rem; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--linie); background: var(--hg); color: var(--text); }
button { background: var(--gelb); color: var(--gelb-text); border-color: transparent; font-weight: 600; cursor: pointer; }
button:hover { filter: brightness(1.04); }
.leer, .hinweis { color: var(--leise); }
.login { max-width: 360px; margin-top: 15vh; }
.login form { display: grid; gap: 12px; margin-top: 16px; }
.login label { display: grid; gap: 4px; }
.fehler { color: var(--dringend); }
.berichte { display: grid; grid-template-columns: 160px 1fr; gap: 16px; }
.tage { display: flex; flex-direction: column; gap: 2px; }
.bericht { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 8px 20px; overflow-wrap: anywhere; min-width: 0; }
.tabzeile { display: block; font-size: .8rem; white-space: pre-wrap; }
.protokolltabelle th, .protokolltabelle td { hyphens: manual; }
.protokolltabelle td:first-child { min-width: 11rem; }
.protokolltabelle td:nth-child(2), .protokolltabelle td:nth-child(3), .protokolltabelle td:nth-child(4), .protokolltabelle td:nth-child(5) { white-space: nowrap; }
.uebersicht { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 8px 12px; margin: 16px 0 0; }
.protokolltabelle td:last-child { word-break: break-word; font-size: .8rem; color: var(--leise); }
.protokoll li.fehl { color: var(--dringend); }
@media (max-width: 640px) {
  .berichte { grid-template-columns: 1fr; }
  .tage { flex-direction: row; overflow-x: auto; }
  .status { margin-left: 0; }
  .kopf { padding: 8px 8px 2px; }
  .leiste { max-width: 100%; gap: 6px; padding: 6px; border-radius: 16px; }
  .logo { min-width: 40px; padding: 0 8px; font-size: 1.1rem; }
  .reiter { flex: 1; min-width: 0; padding: 4px; }
  .reiter a { padding: 6px 9px; font-size: .85rem; }
  .cta { padding: 0 12px; font-size: .9rem; }
}

.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
button.zweitrangig { background: var(--flaeche); color: var(--text); border-color: var(--text); font-weight: 500; }
button:disabled { opacity: .6; cursor: wait; }
.meldung { background: var(--flaeche); border: 1px solid var(--linie); border-left: 5px solid var(--gelb); border-radius: 12px; padding: 8px 12px; margin: 16px 0 0; }

.einstellungen fieldset { border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; background: var(--flaeche); }
.einstellungen legend { font-weight: 600; padding: 0 4px; }
.einstellungen .anbieter { border-top: 1px solid var(--linie); padding: 8px 0; }
.einstellungen .anbieter:first-of-type { border-top: 0; }
.einstellungen h3 { margin: 4px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.einstellungen .links { margin: 4px 0 8px; font-size: .9rem; }
.einstellungen .felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.einstellungen .felder label { display: grid; gap: 4px; font-size: .9rem; }
.einstellungen .haken { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; white-space: nowrap; }
.einstellungen small { color: var(--leise); }
.status-ok, .status-aus { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.status-ok { color: var(--ok); } .status-aus { color: var(--leise); }

.fuss { max-width: 960px; margin: 24px auto 0; padding: 12px 16px 24px; color: var(--leise); font-size: .8rem; border-top: 1px solid var(--linie); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fuss a { color: var(--leise); }

.protokolltabelle tr.laeuft-jetzt td { background: var(--flaeche); font-weight: 600; color: var(--b); }
.protokolltabelle tr[data-status="laeuft"] td:nth-child(2) { color: var(--b); font-weight: 600; }

.fortschritt { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 8px 14px; margin: 12px 0 0; max-height: 280px; overflow-y: auto; font-size: .875rem; }
.fortschritt p { margin: 4px 0; display: flex; gap: 12px; align-items: center; }
.fortschritt ol { margin: 4px 0; padding-left: 22px; }
.fortschritt li { margin: 2px 0; overflow-wrap: anywhere; }
.fortschritt li.ok { color: var(--ok); } .fortschritt li.fehl { color: var(--dringend); } .fortschritt li.aktiv { color: var(--b); font-weight: 600; }

.zahl { display: inline-block; min-width: 1.5em; padding: 0 .45em; border-radius: 999px; background: #555; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.55; color: #f0f0ee; }
.reiter a[aria-current] .zahl { background: var(--gelb); color: var(--gelb-text); }
.zahl-null { background: transparent; color: #9a9a96; font-weight: 400; }
.zahl-dringend, .reiter a[aria-current] .zahl-dringend { background: #e5484d; color: #fff; }

/* ===== Formensprache der Menüleiste auf alle Bereiche übertragen (1.19) ===== */
:root { --kachel: #f4f4f2; --kachel-rand: #e3e2dd; --dunkel-kachel: #2b2b2a; --dunkel-text: #f0f0ee; }
@media (prefers-color-scheme: dark) { :root { --kachel: #2a2a28; --kachel-rand: #3a3a38; --dunkel-kachel: #111110; } }

/* Abschnittsüberschriften als dunkle Kacheln */
main > h2, main > h3, .einstellungen > h2 { display: flex; width: fit-content; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 12px; background: var(--leiste-gruppe); color: var(--dunkel-text); font-size: 1rem; margin: 1.5rem 0 .75rem; }
main > h3 { font-size: .9rem; padding: 5px 12px; background: var(--leiste); }

/* Karten: äußerer Rahmen + innere Kacheln */
.karte { padding: 8px; border-radius: 20px; display: grid; gap: 8px; border-color: var(--kachel-rand); box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.karte header { background: var(--kachel); border-radius: 14px; padding: 10px 12px; align-items: center; }
.karte-inhalt { padding: 4px 12px 6px; }
.karte-inhalt .bezug { margin-top: 4px; }
.karte footer { margin-top: 0; padding: 8px; border-top: 0; background: var(--kachel); border-radius: 14px; }
.karte footer > a, .karte footer > span { padding: 0 4px; }
.stufe { width: 40px; height: 40px; border-radius: 11px; background: var(--dunkel-kachel); font-size: 1.05rem; font-weight: 800; }
.stufe-A { background: var(--dunkel-kachel); color: #7fdba0; } .stufe-B { background: var(--dunkel-kachel); color: #9cc7f0; } .stufe-C { background: var(--dunkel-kachel); color: #f2c66d; }
.stufe-x, .stufe-aussortiert { background: var(--dunkel-kachel); color: #aaa; }
.frist { border-radius: 10px; padding: 6px 10px; background: var(--flaeche); border-width: 1px; }
.frist-dringend { border-color: var(--dringend); } .frist-bald { border-color: var(--bald); }
summary { font-weight: 600; color: var(--text); }
details[open] summary { margin-bottom: 6px; }

/* Tabellen mit abgerundetem Rahmen und dunkler Kopfzeile */
.tabellenrahmen { border: 1px solid var(--kachel-rand); border-radius: 14px; overflow: hidden; overflow-x: auto; background: var(--flaeche); margin: 8px 0; }
.tabellenrahmen table { margin: 0; }
.tabellenrahmen thead th { background: var(--leiste-gruppe); color: var(--dunkel-text); font-weight: 600; border-bottom: 0; padding: 7px 10px; }
.tabellenrahmen td { padding: 6px 10px; }
.tabellenrahmen tbody tr:last-child td { border-bottom: 0; }
.tabellenrahmen tbody tr:nth-child(even) td { background: var(--kachel); }

/* Hinweis-, Übersichts- und Fortschrittskästen */
.uebersicht, .meldung, .fortschritt { border-radius: 16px; border-color: var(--kachel-rand); }
.uebersicht { background: var(--kachel); }

/* Einstellungen: Rahmen wie Karten, Legende als dunkle Kachel */
.einstellungen fieldset { border-radius: 20px; padding: 14px 16px 16px; border-color: var(--kachel-rand); }
.einstellungen legend { background: var(--leiste-gruppe); color: var(--dunkel-text); padding: 5px 12px; border-radius: 10px; font-size: .92rem; }
.einstellungen .anbieter { background: var(--kachel); border: 0; border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.einstellungen h3 { margin-top: 0; }
.status-ok, .status-aus { border-radius: 8px; }

/* Berichte: Tagesliste als Kacheln, Bericht als großer Rahmen */
.tage { background: var(--leiste); padding: 6px; border-radius: 16px; gap: 4px; align-self: start; }
.tage a { color: var(--leiste-text); border: 1px solid var(--leiste-rand); border-radius: 10px; }
.tage a[aria-current] { background: transparent; color: var(--gelb); border-color: var(--gelb); box-shadow: none; }
.bericht { border-radius: 20px; padding: 12px 24px; border-color: var(--kachel-rand); }
.bericht h2 { display: inline-block; background: var(--leiste-gruppe); color: var(--dunkel-text); padding: 5px 12px; border-radius: 10px; font-size: 1rem; }

/* Anmeldung */
.login { background: var(--flaeche); border: 1px solid var(--kachel-rand); border-radius: 20px; padding: 16px 20px 20px; }
.login-kopf { display: flex; align-items: center; gap: 12px; background: var(--leiste); border-radius: 14px; padding: 8px; }
.login-kopf h1 { color: var(--dunkel-text); font-size: 1.05rem; }
.login-kopf .logo { min-height: 44px; }

/* Eingabefelder und Nebenknöpfe etwas kräftiger gerahmt */
input, select { background: var(--flaeche); border-color: var(--kachel-rand); }
.karte footer input, .karte footer select { background: var(--flaeche); }

@media (max-width: 640px) {
  .karte { border-radius: 16px; padding: 6px; }
  .tage { padding: 4px; }
  .bericht { padding: 8px 14px; }
}

.einstellungen .felder select, .einstellungen .felder input { width: 100%; min-width: 0; }
.einstellungen .felder label { min-width: 0; }

/* 1.20: Zahnrad-Knopf statt Logo; Protokoll/Berichte als Links in den Einstellungen */
.zahnrad { display: grid; place-items: center; min-width: 52px; padding: 0 12px; border-radius: 12px; background: var(--gelb); color: var(--gelb-text); text-decoration: none; }
.zahnrad:hover { filter: brightness(1.04); }
.zahnrad[aria-current] { box-shadow: inset 0 0 0 2px var(--gelb-text); }
.unterseiten { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 0 0 12px; }
.unterseiten a { display: grid; gap: 2px; padding: 12px 16px; background: var(--flaeche); border: 1px solid var(--kachel-rand); border-radius: 16px; text-decoration: none; color: var(--text); }
.unterseiten a strong::after { content: ' →'; color: var(--leise); }
.unterseiten a span { font-size: .85rem; color: var(--leise); }
.unterseiten a:hover { border-color: var(--text); }
.zurueck { margin: 4px 0 0; font-size: .9rem; }
@media (max-width: 640px) { .zahnrad { min-width: 44px; padding: 0 8px; } }

/* 1.22: Menüleiste so breit wie der Inhalt, Schriftzug statt „S.“, keine Zahnrad-Animation */
.leiste { width: 100%; max-width: 1040px; }
main { max-width: 1072px; }
.fuss { max-width: 1072px; }
@media (max-width: 1100px) and (min-width: 641px) {
  .logo { padding: 0 12px; font-size: .95rem; }
  .reiter a { padding: 6px 9px; font-size: .86rem; gap: 4px; }
}
.reiter { flex: 1; min-width: 0; }
.reiter a { flex: 1 0 auto; justify-content: center; }
.logo { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; padding: 0 16px; }
.logo-kurz { display: none; }
@media (max-width: 900px) {
  .logo-lang { display: none; }
  .logo-kurz { display: inline; font-size: 1.1rem; }
}
@media (max-width: 640px) {
  .reiter a { flex: 0 0 auto; }
}

/* 1.23: Bildmarke (Dokument mit Person + Handschlag) im Logo */
.logo { display: flex; align-items: center; gap: 10px; color: #e6e6e3; }
.logo-symbol { flex: none; display: block; }
.login-kopf .logo { padding: 0 8px; }
@media (max-width: 900px) { .logo { padding: 0 8px; } .logo-symbol { width: 30px; height: 30px; } }

/* 1.25: Logo als Bild (schwarzer Grund) */
.logo { background: #000; }
.logo-symbol { width: 36px; height: 36px; border-radius: 6px; }
.login-kopf .logo { padding: 4px; }
.login-kopf .logo-symbol { width: 44px; height: 44px; }
@media (max-width: 900px) { .logo-symbol { width: 32px; height: 32px; } }
.einrichten-titel { display: flex; align-items: center; gap: 12px; }
.einrichten-titel img { border-radius: 10px; background: #000; }
