:root {
  --blau: #1f4e8c; --blau-hell: #e8eff9; --rot: #c62828; --rot-hell: #fdecea;
  --orange: #b35c00; --orange-hell: #fff3e0; --gruen: #2e7d32;
  --text: #1c1c1e; --grau: #6e6e73; --linie: #e2e2e7; --bg: #f2f2f7; --karte: #fff;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --text: #f2f2f7; --grau: #a1a1a6; --linie: #38383a; --bg: #000; --karte: #1c1c1e;
    --blau-hell: #16253a; --rot-hell: #3a1614; --orange-hell: #3a2610; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--karte);
  border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; width: 100%; }

.login { max-width: 340px; margin: 18vh auto; padding: 0 20px; text-align: center; }
.login img { border-radius: 16px; }
.login h1 { font-size: 22px; }
.login button { margin-top: 12px; }
.err { color: var(--rot); min-height: 1.2em; }

.btn, .login button { display: block; width: 100%; padding: 12px; border-radius: 12px;
  background: var(--blau); color: #fff; font-weight: 600; text-align: center; }
.btn.zweit { background: var(--blau-hell); color: var(--blau); }
.btn.gefahr { background: var(--rot-hell); color: var(--rot); }
@media (prefers-color-scheme: dark) { .btn.zweit { color: #9cc2ff; } }

.top { position: sticky; top: 0; z-index: 10; background: var(--karte);
  padding: calc(var(--safe-t) + 8px) 12px 6px; border-bottom: 1px solid var(--linie); }
.ev { font-weight: 700; font-size: 17px; padding: 2px 0; text-align: left; }
.tage { display: flex; gap: 6px; margin: 8px 0 4px; overflow-x: auto; }
.tage button { flex: 1 0 auto; padding: 6px 10px; border-radius: 10px; background: var(--bg);
  font-size: 14px; line-height: 1.15; }
.tage button small { display: block; color: var(--grau); font-size: 11px; }
.tage button.on { background: var(--blau); color: #fff; }
.tage button.on small { color: #d8e4f5; }
.stats { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.chip { padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--grau); }
.chip.rot { background: var(--rot-hell); color: var(--rot); }
.chip.orange { background: var(--orange-hell); color: var(--orange); }
button.chip.on { outline: 2px solid currentColor; }

main#view { padding: 10px 10px calc(80px + var(--safe-b)); }
.bereich { background: var(--karte); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.bereich > h2 { margin: 0; padding: 10px 12px 6px; font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.bereich > h2 .nr { color: var(--blau); min-width: 1.4em; }
.bereich > h2 .kt { margin-left: auto; font-size: 11px; font-weight: 500; }
.hinweis { margin: 0 12px 8px; padding: 6px 8px; font-size: 13px; color: var(--grau);
  background: var(--bg); border-radius: 8px; }
.posten { border-top: 1px solid var(--linie); padding: 6px 12px 8px; }
.posten .pn { font-size: 13px; color: var(--grau); display: flex; justify-content: space-between; align-items: center; }
.posten .pn button { color: var(--blau); font-size: 22px; line-height: 1; padding: 0 4px; }
.schicht { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 7px 0; }
.schicht + .schicht { border-top: 1px dashed var(--linie); }
.schicht .zeit { font-variant-numeric: tabular-nums; font-size: 14px; min-width: 96px; }
.schicht .zeit small { display: block; color: var(--grau); font-size: 11px; }
.schicht .wer { flex: 1; font-weight: 600; }
.schicht .wer small { display: block; font-weight: 400; color: var(--grau); font-size: 12px; }
.wer.offen { color: var(--rot); }
.wer.folgt { color: var(--orange); }
.warn { color: var(--rot); font-size: 12px; font-weight: 600; }
.leer { color: var(--grau); font-size: 13px; padding: 4px 0; }

.liste { background: var(--karte); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.liste h3 { margin: 0; padding: 10px 12px 4px; font-size: 13px; color: var(--grau); text-transform: uppercase; }
.zeile { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 12px;
  border-top: 1px solid var(--linie); align-items: center; }
.zeile .rechts { margin-left: auto; color: var(--grau); font-variant-numeric: tabular-nums; }
.zeile small { display: block; color: var(--grau); font-size: 12px; }
.suche { margin-bottom: 10px; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; z-index: 20;
  background: var(--karte); border-top: 1px solid var(--linie); padding-bottom: var(--safe-b); }
.tabbar button { flex: 1; padding: 6px 0 8px; font-size: 11px; color: var(--grau); }
.tabbar button span { display: block; font-size: 20px; }
.tabbar button.on { color: var(--blau); }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; display: none; }
.sheet-bg.on { display: flex; align-items: flex-end; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; margin: 0 auto; max-height: 92vh;
  overflow-y: auto; border-radius: 16px 16px 0 0; padding: 14px 14px calc(16px + var(--safe-b)); }
.sheet h2 { margin: 0 0 2px; font-size: 18px; }
.sheet .sub { color: var(--grau); font-size: 13px; margin-bottom: 12px; }
.sheet label { display: block; font-size: 13px; color: var(--grau); margin: 10px 0 4px; }
.reihe { display: flex; gap: 8px; }
.reihe > * { flex: 1; }
.wahl { background: var(--karte); border-radius: 12px; max-height: 38vh; overflow-y: auto; margin-top: 6px; }
.wahl button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-top: 1px solid var(--linie); }
.wahl button:first-child { border-top: 0; }
.wahl button.on { background: var(--blau-hell); font-weight: 600; }
.wahl small { display: block; color: var(--grau); font-size: 12px; font-weight: 400; }
.wahl small.warn { color: var(--rot); }
.knoepfe { display: grid; gap: 8px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translateX(-50%);
  background: #333; color: #fff; padding: 8px 14px; border-radius: 99px; font-size: 14px;
  opacity: 0; transition: opacity .2s; z-index: 40; pointer-events: none; }
.toast.on { opacity: .95; }
.posten.ruhig { padding-bottom: 6px; }
.posten.ruhig .pn span { opacity: .6; }
