:root {
  --bg: #16181c; --flaeche: #22252b; --flaeche2: #2c3038; --text: #eceef2; --leise: #9aa1ad;
  --akzent: #4da3ff; --wichtig: #ff9f2e; --ok: #4cc38a; --nein: #8a8f99; --rand: #3a3f48;
  --oben: env(safe-area-inset-top, 0px); --unten: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
button { font: inherit; color: var(--text); background: var(--flaeche2); border: 1px solid var(--rand);
  border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
button:active { filter: brightness(1.3); }
button.flach { background: none; border: none; color: var(--akzent); padding: 8px 4px; }
button.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
button.rund { width: 48px; height: 48px; border-radius: 50%; padding: 0; font-size: 20px; }
button.an { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.klein { font-size: 13px; color: var(--leise); }

#karte { position: absolute; inset: 0; background: #2a2d33; }
.leaflet-container { background: #2a2d33; font: inherit; }
.leaflet-control-attribution { font-size: 9px; background: rgba(0,0,0,.45) !important; color: #ccc; }
.leaflet-control-attribution a { color: #ccc; }

#oben { position: absolute; top: calc(var(--oben) + 8px); left: 8px; right: 8px; z-index: 1000;
  display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
#oben > * { pointer-events: auto; }
#status { background: rgba(22,24,28,.85); border-radius: 10px; padding: 6px 10px; font-size: 13px;
  display: flex; flex-direction: column; justify-content: center; }
#fortschritt { color: var(--leise); }
.knoepfe { display: flex; gap: 6px; }
.knoepfe button { background: rgba(34,37,43,.9); }

#rechts { position: absolute; right: 10px; top: calc(var(--oben) + 70px); z-index: 1000; display: flex;
  flex-direction: column; gap: 8px; }
#rechts button { background: rgba(34,37,43,.9); }

#leiste { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1001; background: var(--flaeche);
  border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.4); transition: height .25s;
  height: 46vh; display: flex; flex-direction: column; padding-bottom: var(--unten); }
#leiste.zu { height: calc(118px + var(--unten)); }
#griff { padding: 8px 0 4px; display: flex; justify-content: center; cursor: pointer; }
#griff span { width: 42px; height: 5px; border-radius: 3px; background: var(--rand); }
#liste-kopf { display: flex; justify-content: space-between; align-items: center; padding: 0 14px 6px; }
.schalter { font-size: 13px; color: var(--leise); display: flex; align-items: center; gap: 4px; }
#liste { overflow-y: auto; flex: 1; padding: 0 8px 8px; -webkit-overflow-scrolling: touch; }
.eintrag { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; }
.eintrag:active, .eintrag.aktiv { background: var(--flaeche2); }
.eintrag img, .eintrag .ohne { width: 72px; height: 44px; object-fit: cover; border-radius: 6px; flex: none;
  background: var(--flaeche2); }
.eintrag .text { flex: 1; min-width: 0; }
.eintrag .t1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.eintrag .t2 { font-size: 13px; color: var(--leise); }
.eintrag .dist { font-size: 14px; text-align: right; flex: none; min-width: 52px; }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.p-offen { background: var(--akzent); } .p-wichtig { background: var(--wichtig); }
.p-erledigt { background: var(--ok); } .p-geht_nicht { background: var(--nein); }

#detail { position: absolute; inset: 0; z-index: 1100; background: var(--bg); display: flex; flex-direction: column;
  padding-top: var(--oben); }
#detail[hidden], #menue[hidden], #bild-gross[hidden], #meldung[hidden] { display: none; }
.detail-kopf { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px;
  border-bottom: 1px solid var(--rand); }
#d-id { color: var(--leise); font-size: 14px; }
.detail-inhalt { overflow-y: auto; padding: 12px 14px calc(24px + var(--unten)); -webkit-overflow-scrolling: touch; }
.detail-inhalt h2 { margin: 0 0 8px; font-size: 20px; }
#d-weg { display: flex; align-items: center; gap: 12px; background: var(--flaeche); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 10px; }
#d-pfeil { font-size: 34px; width: 44px; text-align: center; color: var(--wichtig); transition: transform .3s; }
#d-dist { font-size: 22px; }
#d-bilder img { width: 100%; border-radius: 10px; display: block; margin-bottom: 8px; cursor: zoom-in; }
#d-was { font-size: 17px; }
.knopfreihe { display: flex; gap: 8px; margin: 10px 0; }
.knopfreihe button { flex: 1; padding: 10px 6px; }
.feld { display: block; margin: 10px 0; font-size: 13px; color: var(--leise); }
.feld input, .feld textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px; padding: 10px; }

#menue { position: absolute; inset: 0; z-index: 1200; background: rgba(0,0,0,.55); display: flex;
  align-items: flex-start; justify-content: center; padding: calc(var(--oben) + 20px) 14px 20px; overflow-y: auto; }
.menue-box { background: var(--flaeche); border-radius: 14px; padding: 16px; width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 8px; }
.menue-box h3 { margin: 0 0 4px; } .menue-box h4 { margin: 8px 0 0; }
.menue-box ul { margin: 0; padding-left: 18px; }

#bild-gross { position: absolute; inset: 0; z-index: 1300; background: #000; overflow: auto;
  -webkit-overflow-scrolling: touch; }
#bild-gross img { display: block; width: 100%; min-height: 100%; object-fit: contain; }
#bild-gross.gross img { width: 250%; min-height: 0; }

#meldung { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(140px + var(--unten));
  z-index: 1400; background: rgba(20,22,26,.95); border: 1px solid var(--rand); border-radius: 10px;
  padding: 10px 14px; max-width: 90vw; font-size: 14px; }

.ich { width: 18px; height: 18px; border-radius: 50%; background: var(--akzent); border: 3px solid #fff;
  box-shadow: 0 0 6px rgba(0,0,0,.6); }
.marke { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; color: #fff; font-size: 10px;
  font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.marke.offen { background: var(--akzent); } .marke.wichtig { background: var(--wichtig); }
.marke.erledigt { background: var(--ok); } .marke.geht_nicht { background: var(--nein); }
.marke.aktiv { outline: 3px solid #ffe14d; }
