/* E-Dienst – Start-App fürs iPhone. Sachlich-modern (Leon 05.12.: „ernster, nicht wie Kinderveranstaltung“):
   ruhige Flächen, dunkles Blau als Hauptfarbe, Farbe nur als schmaler Streifen, Strich-Symbole statt Emojis. Systemschrift, keine externen Schriften. */
:root {
  --nacht: #0f2238; --primaer: #1a3a5f; --primaer-hell: #e9eef4;
  --rot: #b3261e; --rot-hell: #fbecea; --gruen: #2e6b34; --gruen-hell: #edf5ee; --orange: #a65a00; --orange-hell: #fdf1e2;
  --grund: #eef1f4; --karte: #fff; --text: #14202e; --grau: #5f6c7b; --linie: #d9dfe6; --feld: #cbd3dc;
  --oben: env(safe-area-inset-top, 0px); --unten: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primaer); }
svg { display: block; }

/* ---------- Kopfzeile ---------- */
.kopf { position: sticky; top: 0; z-index: 10; background: var(--nacht); color: #fff; padding: calc(var(--oben) + 8px) 12px 8px; display: flex; align-items: center; gap: 10px; min-height: 54px; }
.kopf h1 { flex: 1; margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .zurueck, .kopf .knopf-kopf { color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.1); border: 0; border-radius: 8px; padding: 7px 11px; font-size: 15px; font-weight: 500; min-height: 38px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kopf .zahnrad { padding: 7px 9px; }
.kopf .zahnrad svg { width: 22px; height: 22px; }
.kopf .wer { font-size: 13.5px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.kopf .netz { width: 8px; height: 8px; border-radius: 50%; background: #5cc27a; flex: none; }
.kopf .netz.aus { background: #ff7b72; }
.kopf .gespeichert { font-size: 12.5px; opacity: 0.75; white-space: nowrap; }
.testband { background: #fff8e6; color: #6b4a00; text-align: center; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 10px; border-bottom: 1px solid #f0dfb0; }
.hinweis { background: var(--orange-hell); color: #6b3a00; padding: 8px 14px; font-size: 14px; border-bottom: 1px solid #f0d2a8; }

main { max-width: 680px; margin: 0 auto; padding: 8px 12px calc(var(--unten) + 40px); }
.leer { text-align: center; color: var(--grau); padding: 40px 10px; }
h3.zw { margin: 18px 2px 8px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--grau); }

/* ---------- Startseite ---------- */
.start { display: grid; gap: 8px; }
.kachel { --akzent: var(--primaer); --akzent-hell: var(--primaer-hell);
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; text-decoration: none; color: var(--text);
  background: var(--karte); border: 1px solid var(--linie); border-left: 4px solid var(--akzent); border-radius: 10px; padding: 14px 14px 14px 12px; min-height: 78px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }
.kachel:active { background: #f6f8fa; }
.kachel .ico { width: 44px; height: 44px; border-radius: 8px; background: var(--akzent-hell); color: var(--akzent); display: grid; place-items: center; }
.kachel .ico svg { width: 24px; height: 24px; }
.kachel .titel { display: block; font-size: 17.5px; font-weight: 650; }
.kachel .unter { display: block; font-size: 13.5px; color: var(--grau); margin-top: 1px; }
.kachel .info { font-size: 12.5px; font-weight: 650; color: var(--orange); background: var(--orange-hell); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.kachel.anruf { --akzent: #1f5c9e; --akzent-hell: #e9f0f8; }
.kachel.einsatz { --akzent: var(--rot); --akzent-hell: var(--rot-hell); }
.kachel.au { --akzent: #55478a; --akzent-hell: #eeecf5; }
.kachel.defekt { --akzent: #475766; --akzent-hell: #eceff2; }
.kachel.hygiene { --akzent: #0f766e; --akzent-hell: #e6f4f2; }
.kachel.lage { background: var(--nacht); border-color: var(--nacht); color: #fff; --akzent: #fff; --akzent-hell: rgba(255, 255, 255, 0.1); }
.kachel.lage .unter { color: rgba(255, 255, 255, 0.65); }
.kachel.lage .info { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* ---------- Listen ---------- */
.gross { display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; border: 0; border-radius: 10px; padding: 14px; font-size: 16.5px; font-weight: 600; color: #fff; background: var(--primaer); min-height: 52px; margin-top: 6px; }
.suche { width: 100%; margin: 10px 0 2px; padding: 10px 13px; font-size: 16px; border: 1px solid var(--feld); border-radius: 8px; background: #fff; }
.zeile { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; background: var(--karte); border: 1px solid var(--linie); border-left: 3px solid var(--linie); border-radius: 8px; padding: 11px 12px; margin-bottom: 6px; }
.zeile.offen { border-left-color: var(--orange); }
.zeile .zeit { flex: none; width: 50px; font-weight: 650; }
.zeile .zeit small { display: block; font-weight: 400; color: var(--grau); font-size: 12.5px; }
.zeile .txt { flex: 1; min-width: 0; }
.zeile .txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .txt span { color: var(--grau); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 4px; padding: 2px 6px; background: #eef1f4; color: var(--grau); }
.chip.orange { background: var(--orange-hell); color: var(--orange); }
.chip.gruen { background: var(--gruen-hell); color: var(--gruen); }
.chip.rot { background: var(--rot-hell); color: var(--rot); }
.chip.blau { background: var(--primaer-hell); color: var(--primaer); }

/* ---------- Formular ---------- */
.abschnitt { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 14px; margin: 10px 0; }
.abschnitt > h2 { margin: 0 0 12px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--grau); }
.f { display: block; margin-bottom: 12px; }
.f:last-child { margin-bottom: 0; }
.f > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--grau); margin-bottom: 4px; }
.f input, .f textarea, .f select, .eingabe { width: 100%; font-size: 16px; padding: 10px 12px; border: 1px solid var(--feld); border-radius: 8px; background: #fff; min-height: 44px; }
.f textarea { resize: vertical; min-height: 80px; }
.f input:focus, .f textarea:focus, .eingabe:focus, .suche:focus { outline: 2px solid var(--primaer); outline-offset: -1px; border-color: var(--primaer); }
.reihe { display: flex; gap: 8px; align-items: center; }
.reihe > input, .reihe > .eingabe { flex: 1; min-width: 0; }
.mini { flex: none; border: 1px solid var(--feld); background: #fff; border-radius: 8px; padding: 0 13px; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--primaer); }
.hilfe { font-size: 13px; color: var(--grau); margin: 4px 0 0; }
.wahl { display: flex; flex-wrap: wrap; gap: 6px; }
.wahl button { border: 1px solid var(--feld); background: #fff; border-radius: 8px; padding: 8px 12px; min-height: 40px; font-size: 15px; font-weight: 500; }
.wahl button[aria-pressed="true"] { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.wahl.gross-wahl { display: grid; grid-template-columns: 1fr; gap: 8px; }
.wahl.gross-wahl button { min-height: 58px; text-align: left; padding: 10px 14px; border-radius: 10px; }
.wahl.gross-wahl button b { display: block; font-size: 16.5px; font-weight: 650; }
.wahl.gross-wahl button small { display: block; font-size: 13px; color: var(--grau); }
.wahl.gross-wahl button[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.75); }
.haken { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-weight: 500; }
.haken input { width: 22px; height: 22px; accent-color: var(--primaer); flex: none; }

/* Zeit-Knöpfe beim Einsatz */
.stempel-titel { margin: 12px 0 6px; font-size: 13.5px; font-weight: 650; color: var(--text); }
.stempel-titel:first-of-type { margin-top: 0; }
.stempel-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stempel-raster.drei { grid-template-columns: 1fr 1fr 1fr; }
.stempel-raster.eins { grid-template-columns: 1fr; }
.stempel { border: 1px solid var(--feld); background: #fff; border-radius: 8px; padding: 10px 6px; min-height: 66px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.stempel b { font-size: 15px; font-weight: 650; }
.stempel small { color: var(--grau); font-size: 12px; line-height: 1.2; }
.stempel-raster.drei .stempel b { font-size: 14px; }
.stempel.gesetzt { border-color: var(--gruen); background: var(--gruen-hell); position: relative; }
.stempel.gesetzt input { border: 0; background: transparent; font-size: 18px; font-weight: 700; text-align: center; width: 100%; color: var(--gruen); min-height: 30px; padding: 0; }
.stempel .weg { position: absolute; top: 1px; right: 2px; border: 0; background: none; color: var(--grau); font-size: 17px; width: 30px; height: 30px; }
.stempel.ende.gesetzt { border-color: var(--text); background: #f1f3f5; }
.stempel.ende.gesetzt input { color: var(--text); }

/* Sonderrechte */
.sosi { border: 1px solid var(--linie); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.sosi:last-child { margin-bottom: 0; }
.sosi.an { border-color: #3b6fb6; background: #f3f7fc; }
.sosi-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sosi-kopf b { font-size: 15px; font-weight: 600; }
.sosi .f { margin: 10px 0 0; }

/* Fahrzeuge einbuchen */
.fz { border: 1px solid var(--linie); border-left: 4px solid var(--primaer); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.fz-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fz-kopf b { font-size: 15px; font-weight: 650; color: var(--grau); }
.fz-ruf { flex: 1; font-weight: 700; font-size: 17px; color: var(--primaer); }
.praefix { font-weight: 700; font-size: 17px; }
.eingabe.nr { flex: 0 0 84px; text-align: center; font-weight: 700; font-size: 17px; }
.fz .f { margin-bottom: 8px; }
pre.vorschau.klein { font-size: 13.5px; margin: 0 0 10px; background: #f6f8fa; }
.ende-knopf { background: var(--text); border-color: var(--text); color: #fff; }
.beendet { text-align: center; font-weight: 650; color: var(--gruen); background: var(--gruen-hell); border: 1px solid #cfe3d1; border-radius: 10px; padding: 12px; }
.beendet small { display: block; font-weight: 400; font-size: 12.5px; color: var(--grau); }

/* Gruppen */
.grp { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid #eef1f4; }
.grp b { font-size: 15px; font-weight: 600; }
.grp input[type="time"] { width: 92px; min-height: 40px; padding: 6px 8px; border: 1px solid var(--feld); border-radius: 8px; font-size: 16px; }
.grp .notiz { grid-column: 1 / -1; min-height: 40px; padding: 8px 10px; border: 1px solid var(--feld); border-radius: 8px; font-size: 16px; width: 100%; }
.x { border: 0; background: none; color: var(--grau); font-size: 19px; width: 40px; height: 40px; }

/* Protokoll */
.log { margin: 0 0 10px; padding: 0; list-style: none; }
.log li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid #eef1f4; font-size: 15px; }
.log li .t { flex: none; font-weight: 650; min-width: 44px; white-space: nowrap; }
.log li .v { flex: 1; white-space: pre-wrap; word-break: break-word; }
.log li .v small { display: block; color: var(--grau); font-size: 12px; }

.erledigt { width: 100%; border: 1px solid var(--feld); background: #fff; border-radius: 10px; min-height: 52px; font-size: 16.5px; font-weight: 600; color: var(--grau); }
.erledigt[aria-pressed="true"] { border-color: var(--gruen); background: var(--gruen-hell); color: var(--gruen); }

/* Knöpfe unten im Eintrag */
.aktionen { display: grid; gap: 8px; margin-top: 14px; }
.knopf { display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; border: 1px solid var(--feld); background: #fff; border-radius: 10px; padding: 12px; min-height: 50px; font-size: 16px; font-weight: 600; color: var(--primaer); }
.knopf.haupt { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.knopf.rahmen { border-color: var(--primaer); }
.knopf.rot { color: var(--rot); border-color: #ecc9c6; }
.knopf:disabled { opacity: 0.5; }
.wer-info { text-align: center; color: var(--grau); font-size: 12.5px; margin-top: 14px; }

/* Lagen */
.lagekarte { display: block; text-decoration: none; color: inherit; background: var(--karte); border: 1px solid var(--linie); border-left: 4px solid var(--primaer); border-radius: 10px; padding: 13px 14px; margin-bottom: 8px; }
.lagekarte.beendet { border-left-color: var(--linie); opacity: 0.85; }
.lagekarte .st { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--rot); }
.lagekarte.beendet .st, .lagekarte.geplant .st { color: var(--grau); }
.lagekarte h4 { margin: 3px 0; font-size: 17px; font-weight: 650; }
.lagekarte p { margin: 0; color: var(--grau); font-size: 14px; }
details.alt > summary { cursor: pointer; color: var(--grau); font-weight: 600; padding: 10px 2px; }

/* Einstellungen, Anmeldung */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 16px; margin: 10px 0; }
.karte h2 { margin: 0 0 10px; font-size: 16.5px; font-weight: 650; }
.karte p { margin: 0 0 10px; }
.karte .knopf { margin-top: 8px; }
.anmeldung { max-width: 420px; margin: 24px auto; }
.anmeldung h2 { font-size: 15px; color: var(--grau); font-weight: 600; margin: 0 0 12px; }
.marke { border-left: 4px solid var(--rot); padding: 2px 0 2px 12px; margin-bottom: 18px; }
.marke b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.2px; }
.marke small { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--grau); }
.fehler { color: var(--rot); font-weight: 600; margin: 8px 0 0; }
.ben { padding: 10px 0; border-top: 1px solid #eef1f4; }
.ben:first-of-type { border-top: 0; }
.ben .name { font-weight: 650; }
.ben .reihe { flex-wrap: wrap; margin-top: 6px; }
.ben .reihe .mini { min-height: 38px; font-size: 14px; }
.ben details { margin-top: 6px; }
.ben details summary { color: var(--primaer); font-weight: 600; font-size: 14px; cursor: pointer; }
pre.vorschau { background: #fff; border: 1px solid var(--linie); border-radius: 8px; padding: 12px; font: 13px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; }

.toast { position: fixed; left: 50%; bottom: calc(var(--unten) + 18px); transform: translateX(-50%); background: var(--nacht); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 500; font-size: 15px; z-index: 50; max-width: 90vw; text-align: center; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }

@media (min-width: 700px) {
  .start { grid-template-columns: 1fr 1fr; }
}

/* Protokoll (Admin) */
.prot { display: flex; gap: 10px; align-items: flex-start; background: var(--karte); border: 1px solid var(--linie); border-radius: 8px; padding: 9px 11px; margin-bottom: 5px; }
.prot .pt { flex: none; font-weight: 650; width: 44px; }
.prot .pv { flex: 1; min-width: 0; font-size: 14.5px; word-break: break-word; }
.prot .pv b { font-weight: 600; }
.prot .pv span { color: var(--text); }
.prot .pv small { display: block; color: var(--grau); font-size: 12.5px; margin-top: 1px; }

/* Logo (Einsatzleitdienst OV Wasserturm) */
.logo-bild { display: block; width: 132px; height: 132px; margin: 0 auto 14px; }
.kopf-logo { width: 32px; height: 32px; border-radius: 50%; flex: none; background: #fff; }

/* Zugangsdaten teilen */
.neu-zugang { border-color: #9fd0a8; background: #f4fbf5; }
.knopf.whatsapp { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.mini.rot-text { color: var(--rot); border-color: #ecc9c6; }

/* Hygiene-Helfer in der App (mit „‹ Start“ oben – auf dem iPhone gibt es in der Home-Bildschirm-App keinen Zurück-Knopf) */
.hyg-rahmen { display: block; width: 100%; height: calc(100dvh - 76px - var(--oben) - var(--unten)); border: 1px solid var(--linie); border-radius: 10px; background: #fff; margin-top: 4px; }

/* ---------- Dienstplanung (Tages-Dienstplan, ETB) ---------- */
.kachel.dienstplan { --akzent: #2f5d50; --akzent-hell: #e8f1ee; }
.dp-tabs { display: flex; gap: 4px; padding: 4px; background: #e2e7ed; border-radius: 10px; margin: 8px 0 4px; }
.dp-tabs button { flex: 1; border: 0; background: transparent; border-radius: 7px; min-height: 40px; font-size: 15px; font-weight: 600; color: var(--grau); }
.dp-tabs button[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }
.dp-heute { margin: 10px 2px 0; color: var(--grau); font-size: 14px; }
.dp-karte { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: inherit;
  background: var(--karte); border: 1px solid var(--linie); border-left: 4px solid #2f5d50; border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; min-height: 72px; }
.dp-karte.fehlt { border-left-color: var(--orange); background: #fffdf9; }
.dp-karte:active { background: #f6f8fa; }
.dp-tagbox { display: grid; place-content: center; text-align: center; width: 56px; height: 58px; border-radius: 8px; background: #eef1f4; line-height: 1.05; }
.dp-tagbox b { font-size: 22px; font-weight: 700; }
.dp-tagbox small { font-size: 11px; font-weight: 650; color: var(--grau); letter-spacing: 0.05em; }
.dp-karte .txt { min-width: 0; }
.dp-karte .titel { display: block; font-size: 16.5px; font-weight: 650; }
.dp-karte .unter { display: block; font-size: 13.5px; color: var(--grau); }
.dp-karte .pfeil { font-size: 24px; color: var(--grau); }
.dp-st { display: block; font-size: 12.5px; color: var(--gruen); margin-top: 2px; }
.dp-st.warn { color: var(--orange); font-weight: 600; }
.dp-stand { text-align: center; color: var(--grau); font-size: 12.5px; margin: 16px 0 0; }
.dp-filter { margin-top: 10px; }
.dp-pdf { background: #fff; border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; }
.dp-rahmen { display: block; width: 100%; height: calc(100dvh - 250px - var(--oben) - var(--unten)); min-height: 360px; border: 0; background: #f1f3f6; }
.dp-vorschau { display: block; width: 100%; height: 260px; border: 1px solid var(--linie); border-radius: 8px; background: #f1f3f6; margin-bottom: 8px; }
.dp-datei { margin: 0 0 8px; word-break: break-word; }
.dp-ausgabe { margin-top: 12px; }
.dp-hinweis { background: var(--orange-hell); border: 1px solid #f0d2a8; border-radius: 10px; padding: 12px; margin: 10px 0; font-size: 14.5px; word-break: break-word; }
.dp-hinweis.ok { background: var(--gruen-hell); border-color: #cfe3d1; color: var(--gruen); }
.dp-hinweis .haken { margin-top: 6px; }
.dp-meta h2 { font-size: 16px; }
.knopf .unsichtbar { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
label.knopf { position: relative; cursor: pointer; }
.dp-karte.eingang { border-left-color: var(--orange); }
.dp-karte.eingang .dp-tagbox { background: var(--orange-hell); color: var(--orange); }
ol.schritte { margin: 0; padding-left: 22px; }
ol.schritte li { margin-bottom: 10px; line-height: 1.45; }
ol.schritte .knopf { margin-top: 6px; }
code { font: 14px ui-monospace, Menlo, monospace; background: #eef1f4; border-radius: 4px; padding: 1px 5px; }
.schritte .hilfe { display: block; margin-top: 4px; }
