/* D2D - für Smartphone gebaut (iPhone zuerst), große Tippflächen */
:root {
  --rot: #be1a2c; --rot-dunkel: #9a1422; --text: #1f2937; --grau: #6b7280; --hell: #f5f6f8;
  --rand: #e3e6ea; --gruen: #16a34a; --blau: #2563eb; --punkt-grau: #9ca3af; --punkt-rot: #dc2626;
  --sicher-unten: env(safe-area-inset-bottom, 0px); --sicher-oben: env(safe-area-inset-top, 0px);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 16px;
  color: var(--text); background: var(--hell); }
a { color: var(--rot); }
h1 { font-size: 22px; margin: 8px 0 14px; } h2 { font-size: 17px; margin: 22px 0 10px; }
.klein { font-size: 13px; color: var(--grau); }

/* Kopfzeile mit App-Umschalter */
.kopf { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--sicher-oben) + 6px) 10px 6px; background: var(--rot); color: #fff; height: calc(52px + var(--sicher-oben)); }
.kopf details > summary { list-style: none; cursor: pointer; } .kopf details > summary::-webkit-details-marker { display: none; }
.apps summary { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 18px; padding: 6px 8px; border-radius: 8px; }
.apps[open] summary, .menue[open] summary { background: rgba(255,255,255,.18); }
.apps-liste, .menue-liste { position: absolute; top: calc(50px + var(--sicher-oben)); background: #fff; color: var(--text);
  border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.2); padding: 6px; min-width: 200px; z-index: 1100; }
.apps-liste { left: 8px; } .menue-liste { right: 8px; }
.apps-liste a, .apps-liste span, .menue-liste a, .menue-liste button { display: block; padding: 12px 14px; border-radius: 8px;
  text-decoration: none; color: var(--text); font-size: 16px; background: none; border: 0; width: 100%; text-align: left; font-family: inherit; }
.apps-liste .aktiv { background: #fbe9eb; color: var(--rot); font-weight: 600; }
.apps-liste .bald { color: var(--grau); } .apps-liste small { font-size: 11px; border: 1px solid var(--rand); border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.menue-liste .wer { padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--rand); margin-bottom: 4px; }
.menue-liste .version { padding: 8px 14px 4px; font-size: 12px; color: var(--grau); }
.menue summary { font-size: 24px; padding: 2px 10px; border-radius: 8px; }
.kopf-nav { flex: 1; display: flex; gap: 4px; justify-content: center; }
.kopf-nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; opacity: .85; }
.kopf-nav a.aktiv { background: rgba(255,255,255,.2); opacity: 1; }

/* Meldungen */
.meldungen { padding: 8px 12px 0; }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 8px; background: #eef2ff; }
.flash.erfolg { background: #eafaf0; color: #166534; } .flash.fehler { background: #fdecec; color: #991b1b; }
.flash.hinweis { background: #fef3d6; color: #92400e; }
.passwort { font-family: ui-monospace, Menlo, monospace; font-size: 18px; user-select: all; }

/* Normale Seiten */
.seite { padding: 12px 14px calc(30px + var(--sicher-unten)); max-width: 720px; margin: 0 auto; }
.karte-form { background: #fff; border-radius: 14px; padding: 16px; display: grid; gap: 14px; border: 1px solid var(--rand); }
label { display: grid; gap: 6px; font-size: 14px; color: var(--grau); }
input, select, textarea { font-size: 16px; /* verhindert Zoom auf dem iPhone */ padding: 12px; border: 1px solid var(--rand);
  border-radius: 10px; background: #fff; color: var(--text); font-family: inherit; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
button { font-family: inherit; font-size: 16px; cursor: pointer; }
.haupt { background: var(--rot); color: #fff; border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 600; width: 100%; }
.haupt:active { background: var(--rot-dunkel); } .haupt:disabled { opacity: .5; }
.zweit { background: #fff; color: var(--text); border: 1px solid var(--rand); border-radius: 12px; padding: 12px 16px; width: 100%; }
.klein-knopf { background: #fff; border: 1px solid var(--rand); border-radius: 8px; padding: 6px 10px; font-size: 14px; margin: 2px 0; }
.tabelle { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; margin-bottom: 18px; font-size: 14px; }
.tabelle th, .tabelle td { padding: 10px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: top; }
.tabelle th { color: var(--grau); font-weight: 600; font-size: 12px; } .tabelle tr.inaktiv td { color: var(--grau); }
.tabelle .aktionen form { display: flex; flex-wrap: wrap; gap: 4px; }

/* Anmeldung */
.login { max-width: 420px; margin: 0 auto; padding: calc(40px + var(--sicher-oben)) 18px 30px; text-align: center; }
.login .logo { width: 220px; max-width: 70%; margin-bottom: 10px; } .login .karte-form { text-align: left; }

/* Zahlen */
.umschalter { display: flex; background: #e9ebef; border-radius: 12px; padding: 4px; gap: 4px; }
.umschalter button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 500; color: var(--grau); }
.umschalter button.an { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kachel { background: #fff; border-radius: 14px; padding: 14px; border: 1px solid var(--rand); display: grid; gap: 2px; }
.kachel b { font-size: 26px; } .kachel span { font-size: 13px; color: var(--grau); }

/* Karte */
body.seite-karte { overflow: hidden; height: 100dvh; }
#karte { position: absolute; top: calc(52px + var(--sicher-oben)); left: 0; right: 0; bottom: 0; }
.plus-knopf { position: fixed; right: 18px; bottom: calc(26px + var(--sicher-unten)); z-index: 900; width: 68px; height: 68px;
  border-radius: 50%; border: 0; background: var(--rot); color: #fff; font-size: 40px; line-height: 1; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.plus-knopf:active { transform: scale(.95); }
.rund-knopf { position: fixed; right: 26px; bottom: calc(108px + var(--sicher-unten)); z-index: 900; width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: #fff; color: var(--text); font-size: 26px; box-shadow: 0 3px 12px rgba(0,0,0,.25); }
.legende { position: fixed; left: 8px; bottom: calc(14px + var(--sicher-unten)); z-index: 900; background: rgba(255,255,255,.93);
  border-radius: 10px; padding: 6px 9px; font-size: 11px; display: grid; gap: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.punkt { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.punkt.grau { background: var(--punkt-grau); } .punkt.blau { background: var(--blau); } .punkt.gruen { background: var(--gruen); }
.punkt.rot { background: var(--punkt-rot); } .punkt.offen { background: #fff; border: 2px solid #555; box-shadow: none; }
.hinweis-leiste { position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + var(--sicher-oben)); z-index: 1400;
  background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 22px; font-size: 14px; max-width: 90vw; box-shadow: 0 4px 14px rgba(0,0,0,.3); }

/* Unteres Blatt */
.blatt-schleier { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 1200; }
.blatt { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300; background: #fff; border-radius: 18px 18px 0 0;
  max-height: 88dvh; display: flex; flex-direction: column; box-shadow: 0 -6px 30px rgba(0,0,0,.25); }
.blatt-griff { width: 42px; height: 5px; border-radius: 3px; background: #d1d5db; margin: 8px auto 0; flex: none; }
.blatt-zu { position: absolute; right: 8px; top: 6px; border: 0; background: #f1f2f4; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; color: var(--grau); }
.blatt-inhalt { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 16px calc(24px + var(--sicher-unten)); }
.blatt h3 { font-size: 20px; margin: 6px 44px 4px 0; } .blatt h4 { font-size: 15px; margin: 18px 0 8px; color: var(--grau); text-transform: uppercase; letter-spacing: .03em; }
.unterzeile { color: var(--grau); font-size: 14px; margin-bottom: 10px; }
.liste-knopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid var(--rand); background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 8px; color: var(--text); }
.liste-knopf .abstand { color: var(--grau); font-size: 13px; white-space: nowrap; }
.marke-klein { font-size: 12px; border-radius: 6px; padding: 2px 7px; background: #eef2ff; color: #3730a3; white-space: nowrap; }
.marke-klein.rot { background: #fdecec; color: #991b1b; } .marke-klein.gruen { background: #eafaf0; color: #166534; }
.marke-klein.gelb { background: #fef3d6; color: #92400e; }
.wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl button { border: 1px solid var(--rand); background: #fff; border-radius: 22px; padding: 10px 14px; font-size: 15px; color: var(--text); }
.wahl button.an { background: var(--rot); border-color: var(--rot); color: #fff; }
.wahl.gross button { flex: 1 1 45%; padding: 14px 10px; border-radius: 12px; font-weight: 500; }
.wahl.gross button[data-e="nicht_geoeffnet"] { flex-basis: 100%; }
.klingel { border: 1px solid var(--rand); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.klingel.gesperrt { background: #fff7f7; border-color: #f5c2c2; }
.klingel-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.klingel-name { font-weight: 600; font-size: 17px; } .klingel-lage { color: var(--grau); font-size: 13px; }
.letzter { font-size: 14px; color: var(--grau); margin: 6px 0 8px; }
.letzter .notiz { color: var(--text); font-style: italic; }
.zeile-knoepfe { display: flex; gap: 8px; margin-top: 8px; } .zeile-knoepfe > * { flex: 1; }
.neu-hinweis { background: #fef3d6; color: #92400e; border-radius: 10px; padding: 8px 10px; font-size: 14px; margin: 6px 0; }
.verlauf { font-size: 13px; color: var(--grau); margin: 6px 0 0; padding-left: 16px; } .verlauf li { margin-bottom: 4px; }
.feld-gruppe { display: grid; gap: 12px; margin: 10px 0; }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
details.mehr summary { color: var(--rot); font-size: 14px; padding: 6px 0; cursor: pointer; }
.typ-schalter { margin: 4px 0 10px; }
.sperre-hinweis { background: #fdecec; color: #991b1b; border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 15px; }
.mein-standort { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(26,115,232,.35); }
