:root {
  --bg: #f4f5f2;
  --flaeche: #ffffff;
  --flaeche-2: #f9faf8;
  --text: #1d2521;
  --text-2: #5b6660;
  --linie: #dfe3de;
  --akzent: #1f5c4d;
  --akzent-hell: #e3efea;
  --warn: #9a4a0b;
  --warn-hell: #fdf0e3;
  --fehler: #9b1c1c;
  --fehler-hell: #fbe9e9;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(20, 30, 25, .06), 0 2px 8px rgba(20, 30, 25, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --flaeche: #1a201d;
    --flaeche-2: #1f2622;
    --text: #e6ebe7;
    --text-2: #9aa59f;
    --linie: #2e3732;
    --akzent: #7cc4ad;
    --akzent-hell: #1f3530;
    --warn: #f0b27a;
    --warn-hell: #3a2a1a;
    --fehler: #f19999;
    --fehler-hell: #3a1f1f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 72px;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 0 0 .4rem; }
.leise { color: var(--text-2); font-size: .88em; }
.nowrap { white-space: nowrap; }

/* Kopf und Navigation */
.kopf {
  background: var(--flaeche); border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 20;
}
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.marke { font-weight: 700; color: var(--text); letter-spacing: .01em; white-space: nowrap; }
.marke span { color: var(--akzent); }
.nav-oben { display: none; gap: 4px; flex: 1; }
.nav-oben a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav-oben a.aktiv, .nav-oben a:hover { background: var(--akzent-hell); color: var(--akzent); text-decoration: none; }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.nav-unten {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--flaeche);
  border-top: 1px solid var(--linie); display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-unten a { text-align: center; padding: 8px 2px 9px; font-size: .72rem; color: var(--text-2); }
.nav-unten a b { display: block; font-size: 1.15rem; line-height: 1.2; font-weight: 400; }
.nav-unten a.aktiv { color: var(--akzent); font-weight: 600; }
.nav-unten a.plus b { background: var(--akzent); color: var(--flaeche); border-radius: 50%; width: 28px; height: 28px;
  line-height: 28px; margin: 0 auto 1px; }
@media (min-width: 900px) {
  .nav-oben { display: flex; }
  .nav-unten { display: none; }
  body { padding-bottom: 0; }
}

main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }

/* Karten, Raster */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 14px; margin-bottom: 14px; }
.karte-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.raster-2 { display: grid; gap: 14px; }
@media (min-width: 900px) { .raster-2 { grid-template-columns: 1fr 1fr; } .raster-detail { grid-template-columns: 1.5fr 1fr; } }

/* Kennzahlen */
.kennzahlen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 700px) { .kennzahlen { grid-template-columns: repeat(4, 1fr); } }
.kz { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--schatten); color: var(--text); }
a.kz:hover { text-decoration: none; border-color: var(--akzent); }
.kz .wert { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kz .etikett { font-size: .8rem; color: var(--text-2); }
.kz.hervor { border-color: var(--warn); background: var(--warn-hell); }
.kz.hervor .wert { color: var(--warn); }

/* Status-Plaketten */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.s-grau { background: #eceeec; color: #4a524e; }
.s-blau { background: #e2ecfa; color: #1f4f8f; }
.s-tuerkis { background: #daf1f0; color: #11645f; }
.s-hellgruen { background: #e5f4dc; color: #3c6b1f; }
.s-gruen { background: #cdebd3; color: #1b6331; }
.s-dunkelgruen { background: #1f6b3a; color: #fff; }
.s-violett { background: #ece5f8; color: #5a3a92; }
.s-gold { background: #f6e7b0; color: #6b4d00; border-color: #d9b949; }
.s-rot { background: #f8e0e0; color: #9b1c1c; }
.s-orange { background: #fde8d4; color: #94470c; }
.s-dunkelgrau { background: #5b635f; color: #fff; }
@media (prefers-color-scheme: dark) {
  .s-grau { background: #2f3532; color: #c5cbc7; }
  .s-blau { background: #1d2e45; color: #9cc1f2; }
  .s-tuerkis { background: #173a39; color: #8ad8d2; }
  .s-hellgruen { background: #233820; color: #b3dd96; }
  .s-gruen { background: #1b3a24; color: #8fd6a2; }
  .s-violett { background: #2e2540; color: #c7b3ec; }
  .s-rot { background: #3e2020; color: #f2a5a5; }
  .s-orange { background: #3d2a18; color: #f3b57c; }
  .s-gold { background: #3a3014; color: #ecd27a; border-color: #7a6420; }
}
.chip { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--flaeche-2); border: 1px solid var(--linie); font-size: .78rem; color: var(--text-2); }

/* Tabellen und Listen */
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--linie); }
.tabelle td { padding: 8px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 699px) {
  .tabelle.stapeln thead { display: none; }
  .tabelle.stapeln tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--linie); }
  .tabelle.stapeln tr:last-child { border-bottom: 0; }
  .tabelle.stapeln td { display: block; border: 0; padding: 2px 0; }
  .tabelle.stapeln td[data-l]::before { content: attr(data-l) ": "; color: var(--text-2); font-size: .8rem; }
}
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { padding: 10px 0; border-bottom: 1px solid var(--linie); }
.liste > li:last-child { border-bottom: 0; }
.zwei-status { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.zwei-status .leise { font-size: .72rem; }

/* Nachhaken */
.nachhak { display: grid; gap: 8px; }
.nachhak-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.kontakt { display: flex; flex-wrap: wrap; gap: 8px; }
.knopf-kontakt { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--akzent); color: var(--akzent); font-weight: 600; background: var(--flaeche); min-height: 42px; }
.knopf-kontakt:hover { background: var(--akzent-hell); text-decoration: none; }
.wv-ueberfaellig { color: var(--fehler); font-weight: 600; }
.wv-heute { color: var(--warn); font-weight: 600; }
.stufe { font-size: .75rem; padding: 1px 6px; border-radius: 6px; background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }
.hinweis { background: var(--warn-hell); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: .88rem; }

/* Formulare */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); min-height: 42px;
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: var(--akzent); }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.feld { margin-bottom: 12px; }
.feld .hilfe { font-size: .78rem; color: var(--text-2); margin-top: 2px; }
.feld .fehler, .errorlist { color: var(--fehler); font-size: .82rem; margin: 2px 0 0; padding: 0; list-style: none; }
.formraster { display: grid; gap: 0 14px; }
@media (min-width: 700px) { .formraster { grid-template-columns: repeat(2, 1fr); } .formraster .breit { grid-column: 1 / -1; } }
.checkliste ul, .checkliste div { list-style: none; padding: 0; margin: 0; }
.checkliste label { display: flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text); }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--akzent); background: var(--akzent); color: var(--flaeche); font-weight: 600; cursor: pointer; min-height: 42px; text-decoration: none; }
.knopf:hover { filter: brightness(1.08); text-decoration: none; }
.knopf.zweit { background: var(--flaeche); color: var(--akzent); }
.knopf.klein { padding: 5px 10px; min-height: 34px; font-size: .85rem; }
.knopf.warn { background: var(--flaeche); color: var(--warn); border-color: var(--warn); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form select, .inline-form input { width: auto; min-width: 0; flex: 1 1 160px; }
details.aufklapp > summary { cursor: pointer; color: var(--akzent); font-weight: 600; list-style: none; padding: 4px 0; }
details.aufklapp > summary::-webkit-details-marker { display: none; }
details.aufklapp > summary::before { content: "▸ "; }
details.aufklapp[open] > summary::before { content: "▾ "; }

/* Filter */
.filter { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.filter .breit { grid-column: 1 / -1; }
@media (min-width: 900px) { .filter { grid-template-columns: 2fr repeat(5, 1fr) auto auto; align-items: end; } .filter .breit { grid-column: auto; } }
.filter label { font-size: .74rem; }
.filter-status { margin: -4px 0 12px; font-size: .85rem; }

/* Logbuch */
.logbuch { list-style: none; margin: 0; padding: 0; }
.logbuch li { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linie); }
.logbuch li:last-child { border-bottom: 0; }
.logbuch .zeit { font-size: .78rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.logbuch .kopfzeile { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; }
.logbuch .art { font-weight: 600; }
.logbuch .inhalt { white-space: pre-line; margin-top: 2px; }

/* Meldungen */
.meldungen { list-style: none; padding: 0; margin: 0 0 14px; }
.meldungen li { padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; background: var(--akzent-hell); color: var(--akzent); }
.meldungen li.warning, .meldungen li.info { background: var(--warn-hell); color: var(--warn); }
.meldungen li.error { background: var(--fehler-hell); color: var(--fehler); }

.eckdaten { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin: 0; }
@media (min-width: 700px) { .eckdaten { grid-template-columns: repeat(4, 1fr); } }
.eckdaten dt { font-size: .74rem; color: var(--text-2); }
.eckdaten dd { margin: 0; font-weight: 600; }
.zuordnung-block { border-top: 1px solid var(--linie); padding: 12px 0; }
.zuordnung-block:first-of-type { border-top: 0; padding-top: 4px; }
.leer { color: var(--text-2); padding: 12px 0; }
.anmelden { max-width: 380px; margin: 10vh auto; }
.demo-hinweis { background: var(--warn-hell); color: var(--warn); text-align: center; font-size: .8rem; padding: 3px 8px; }

.tabelle.fest { table-layout: fixed; }
.tabelle.fest td { overflow-wrap: anywhere; }
.anlass { font-size: .8rem; font-weight: 600; color: var(--warn); }
.knopf-kontakt.neben { border-color: var(--linie); color: var(--text-2); font-weight: 500; }
@media (max-width: 699px) {
  .nur-breit { display: none; }
  .kopf-innen { gap: 10px; padding: 8px 16px; }
  .knopf-kontakt { padding: 7px 10px; min-height: 40px; font-size: .9rem; }
  .kontakt { gap: 6px; }
  main { padding: 12px 16px; }
  .kz .wert { font-size: 1.35rem; }
}
section[id] { scroll-margin-top: 70px; }
.qr { display: flex; justify-content: center; margin: 8px 0 12px; }
.qr svg { width: 220px; height: 220px; border-radius: 8px; }
.schluessel { font-family: ui-monospace, Consolas, monospace; font-size: 1rem; letter-spacing: .05em; word-break: break-all; background: var(--flaeche-2); padding: 8px; border-radius: 8px; }
.schritte { padding-left: 20px; margin: 8px 0; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; margin: 12px 0 16px; }
.codes li { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 6px; padding: 6px; text-align: center; }
