[hidden] { display: none !important; }
:root {
  color-scheme: light dark;
  --bg: light-dark(#f4f2ec, #121613);
  --flaeche: light-dark(#ffffff, #1c221e);
  --ink: light-dark(#1b1f1c, #e8ece6);
  --leise: light-dark(#5f675f, #9aa59b);
  --linie: light-dark(#d9d6cc, #2e3630);
  --gruen: #2f6b45;
  --gruen-hell: light-dark(#e3efe5, #1f3527);
  --gelb: #e2b33c;
  --rot: #b4382b;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; padding-bottom: env(safe-area-inset-bottom); }
h1 { font-size: 26px; margin: 0 0 12px; }
h2 { font-size: 20px; margin: 24px 0 10px; }
h3 { font-size: 17px; margin: 0 0 8px; }

.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: #1f3a2b; color: #fff; }
.marke { font-size: 19px; letter-spacing: .3px; } .marke b { color: var(--gelb); }
nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
nav a { color: #dfe9e1; text-decoration: none; padding: 10px 14px; border-radius: 10px; white-space: nowrap; }
nav a.aktiv { background: rgba(255,255,255,.16); color: #fff; }
.leise { background: none; border: 0; color: inherit; opacity: .75; font: inherit; padding: 10px; cursor: pointer; }
body:not(.buero) .nur-buero { display: none !important; }

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
.voll { max-width: none; padding: 0; }

.karte-box { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
label { display: block; font-size: 14px; color: var(--leise); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg); border: 1px solid var(--linie); border-radius: 10px; padding: 11px 12px; min-height: 48px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--gelb); outline-offset: 1px; }
button { font: inherit; cursor: pointer; }
.haupt, .zweit, .gefahr { min-height: 52px; border-radius: 12px; padding: 12px 20px; border: 0; font-weight: 600; }
.haupt { background: var(--gruen); color: #fff; }
.zweit { background: var(--gruen-hell); color: var(--ink); border: 1px solid var(--linie); }
.gefahr { background: transparent; color: var(--rot); border: 1px solid var(--rot); }
.gross { width: 100%; font-size: 20px; min-height: 64px; }
.klein { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.zeile { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.zeile > * { flex: 1 1 140px; }
.zeile > .fix { flex: 0 0 auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 52px; padding: 10px 18px; border-radius: 26px; border: 1px solid var(--linie); background: var(--bg); color: var(--ink); font-size: 17px; }
.chip.an { background: var(--gruen); border-color: var(--gruen); color: #fff; }

.status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--gelb); color: #222; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.kz { background: var(--gruen-hell); border-radius: 12px; padding: 12px 14px; }
.kz b { display: block; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kz span { font-size: 14px; color: var(--leise); }

table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-size: 13px; color: var(--leise); font-weight: 600; }
td.z, th.z { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.inaktiv td { opacity: .5; }
.neg { color: var(--rot); font-weight: 600; }
.scroll { overflow-x: auto; }
.hinweis { color: var(--leise); }
.fehler { color: var(--rot); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

#map { height: calc(100vh - 64px); height: calc(100dvh - 64px); }
.kartenleiste { position: absolute; z-index: 999; top: 76px; right: 12px; background: var(--flaeche); border-radius: 12px; padding: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.25); max-width: 260px; font-size: 15px; }
.kartenleiste select { min-height: 40px; padding: 6px; }
.legende div { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.legende i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.schild { background: var(--flaeche); color: var(--ink); border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 13px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.3); }

.overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(15,25,18,.75); display: grid; place-items: center; padding: 16px; }
.overlay .karte-box { width: min(380px, 100%); display: grid; gap: 12px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1b1f1c; color: #fff; padding: 12px 18px; border-radius: 12px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 3000; max-width: 90vw; }
#toast.zeigen { opacity: 1; }

.gps { border: 0; border-radius: 20px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; }
.gps.an { background: #59c27a; color: #0d2414; }
.gps.schwach { background: var(--gelb); color: #222; }
.gps.aus { background: var(--rot); color: #fff; }
.warnung { background: light-dark(#fdf0d2, #3a2f12); border-left: 4px solid var(--gelb); padding: 10px 12px; border-radius: 8px; }
.s-lauf { background: var(--gelb); color: #222; }
.s-offen { background: #ef8a3c; color: #fff; }
.s-frei { background: var(--gruen); color: #fff; }
.s-pause { background: #4ea8de; color: #fff; }
.s-manuell { background: var(--linie); color: var(--ink); }
.knopf { display: inline-grid; place-items: center; text-decoration: none; }
.rechts { text-align: right; }
.kurz { margin: 8px 0; }
.spur { width: min(900px, 100%) !important; }
#spurKarte { height: min(70vh, 600px); border-radius: 10px; }

.gast-marke { width: 18px; height: 18px; border: 2px solid #000; border-radius: 4px; transform: rotate(45deg); }
.einheit-feld { display: inline-flex; align-items: center; gap: 6px; }
.einheit-feld input { max-width: 130px; }
.pflicht-fehlt { border-color: var(--rot) !important; outline: 2px solid var(--rot); }
.qr-karte { width: min(420px, 100%) !important; }
.qr { background: #fff; border-radius: 12px; padding: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
code.link { display: block; font-size: 13px; overflow-wrap: anywhere; color: var(--leise); }

@media (max-width: 600px) {
  .marke { display: none; }
  table.stack thead { display: none; }
  table.stack tr { display: grid; padding: 8px 0; border-bottom: 1px solid var(--linie); }
  table.stack td { border: 0; padding: 2px 0; text-align: left; }
  table.stack td[data-l]::before { content: attr(data-l) ": "; color: var(--leise); font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
