:root{
  --bg:#f3f5f6; --surface:#ffffff; --ink:#17222a; --muted:#5b6973; --line:#d9e0e4;
  --accent:#1f5f7a; --accent-ink:#ffffff; --warn-bg:#fff4dc; --warn-ink:#7a5300; --danger:#c8352b;
  --shadow:0 6px 24px rgba(10,25,35,.18);
  --f-body:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --f-mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#10171c; --surface:#18222a; --ink:#e3eaee; --muted:#93a3ad; --line:#2b3943;
    --accent:#5fb3d6; --accent-ink:#0c1a21; --warn-bg:#3a2e12; --warn-ink:#ffd27a; --danger:#f0736a;
    --shadow:0 6px 24px rgba(0,0,0,.5);
    color-scheme:dark;
  }
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.45;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
[hidden]{display:none!important}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 16px;border-radius:10px;border:1px solid var(--line);background:var(--surface);font-weight:600;cursor:pointer;text-decoration:none;color:var(--ink)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.danger{color:var(--danger)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn svg{width:20px;height:20px;flex:none}

/* ---------- kaartscherm ---------- */
#map{position:fixed;inset:0;z-index:0;background:#dfe7ea}
.topbar{position:fixed;z-index:500;top:calc(10px + env(safe-area-inset-top,0px));left:calc(10px + env(safe-area-inset-left,0px));right:calc(10px + env(safe-area-inset-right,0px));display:flex;flex-direction:column;gap:8px;pointer-events:none}
.topbar > *{pointer-events:auto}
.bar{display:flex;align-items:center;gap:8px;background:var(--surface);border-radius:12px;box-shadow:var(--shadow);padding:6px 6px 6px 14px}
.bar h1{font-size:1.05rem;margin:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar input{flex:1;min-width:0;border:0;background:transparent;height:40px;outline:none}
.iconbtn{width:44px;height:44px;border-radius:10px;border:0;background:transparent;display:grid;place-items:center;cursor:pointer;color:var(--ink)}
.iconbtn svg{width:22px;height:22px}
.chips{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);box-shadow:0 2px 8px rgba(0,0,0,.12);font-size:.88rem;cursor:pointer;white-space:nowrap}
.chip .dot{width:10px;height:10px;border-radius:50%}
.chip[aria-pressed="false"]{opacity:.55}
.chip b{font-variant-numeric:tabular-nums;font-weight:600}

.fabs{position:fixed;z-index:500;right:calc(12px + env(safe-area-inset-right,0px));bottom:calc(24px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:10px;transition:bottom .25s,opacity .2s}
.fabs.weg{opacity:0;pointer-events:none}
.sheet a:not(.btn){color:var(--accent);font-weight:600}
.fab{width:52px;height:52px;border-radius:50%;border:0;background:var(--surface);color:var(--ink);box-shadow:var(--shadow);display:grid;place-items:center;cursor:pointer}
.fab svg{width:24px;height:24px}
.fab.active{color:#1a73e8}

.menu{position:fixed;z-index:700;top:calc(64px + env(safe-area-inset-top,0px));right:calc(12px + env(safe-area-inset-right,0px));background:var(--surface);border-radius:12px;box-shadow:var(--shadow);min-width:220px;padding:6px;display:flex;flex-direction:column}
.menu a,.menu button{display:flex;align-items:center;min-height:44px;padding:0 12px;border:0;background:none;text-align:left;text-decoration:none;color:var(--ink);border-radius:8px;cursor:pointer}
.menu a:hover,.menu button:hover{background:var(--bg)}
.menu .who{padding:8px 12px;font-size:.85rem;color:var(--muted);border-bottom:1px solid var(--line);margin-bottom:4px}

/* marker */
.pin{filter:drop-shadow(0 2px 2px rgba(0,0,0,.35))}
.pin svg{display:block}
.me-dot{width:18px;height:18px;border-radius:50%;background:#1a73e8;border:3px solid #fff;box-shadow:0 0 0 2px rgba(26,115,232,.35),0 1px 4px rgba(0,0,0,.4)}

/* ---------- bottom sheet ---------- */
.sheet{position:fixed;z-index:600;left:0;right:0;bottom:0;max-height:calc(100% - 70px - env(safe-area-inset-top,0px));background:var(--surface);border-radius:18px 18px 0 0;box-shadow:0 -6px 30px rgba(0,0,0,.25);display:flex;flex-direction:column;transform:translateY(100%);transition:transform .28s cubic-bezier(.2,.8,.2,1);padding-bottom:env(safe-area-inset-bottom,0px)}
.sheet.open{transform:translateY(var(--sheet-y,0px))}
.sheet.dragging{transition:none}
@media (min-width:760px){.sheet{left:auto;right:16px;bottom:16px;width:420px;border-radius:18px;max-height:calc(100% - 100px)}}
.grab{flex:none;padding:10px 0 4px;display:grid;place-items:center;cursor:grab;touch-action:none}
.grab i{width:42px;height:5px;border-radius:3px;background:var(--line)}
.sheet-head{flex:none;display:flex;gap:12px;align-items:flex-start;padding:4px 16px 12px;touch-action:none}
.sheet-head .t{flex:1;min-width:0}
.sheet-head h2{margin:0;font-size:1.2rem;line-height:1.25;overflow-wrap:anywhere}
.sheet-head .code{font-family:var(--f-mono);font-size:.85rem;color:var(--muted)}
.badge{display:inline-flex;align-items:center;gap:6px;margin-top:6px;padding:3px 10px;border-radius:999px;font-size:.82rem;font-weight:600;color:#fff}
.sheet-body{overflow-y:auto;overscroll-behavior:contain;padding:0 16px 20px;display:flex;flex-direction:column;gap:16px}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.actions .btn{flex:1 1 140px}
.section h3{margin:0 0 6px;font-size:.75rem;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}
.statusset{display:flex;flex-wrap:wrap;gap:8px}
.statusset button{flex:1 1 auto;min-height:44px;padding:0 12px;border-radius:10px;border:2px solid var(--c);background:transparent;color:var(--ink);font-weight:600;display:inline-flex;align-items:center;gap:8px;justify-content:center;cursor:pointer}
.statusset button .dot{width:12px;height:12px;border-radius:50%;background:var(--c)}
.statusset button[aria-pressed="true"]{background:var(--c);color:#fff}
.statusset button[aria-pressed="true"] .dot{background:#fff}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0}
.kv dt{color:var(--muted);font-size:.88rem}
.kv dd{margin:0;overflow-wrap:anywhere}
.mono{font-family:var(--f-mono);font-variant-numeric:tabular-nums}
.pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
.code-box{display:flex;align-items:center;gap:10px}
.code-box .val{font-family:var(--f-mono);font-size:1.4rem;letter-spacing:.2em}
.safety{background:var(--warn-bg);color:var(--warn-ink);border-radius:10px;padding:12px 14px}
.safety h3{color:inherit}
.meta{font-size:.82rem;color:var(--muted)}

/* ---------- login ---------- */
.overlay{position:fixed;inset:0;z-index:900;background:var(--bg);display:grid;place-items:center;padding:24px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:24px;width:100%;max-width:380px;display:flex;flex-direction:column;gap:14px;box-shadow:var(--shadow)}
.card h1{margin:0;font-size:1.4rem}
.card p{margin:0;color:var(--muted)}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:.85rem;color:var(--muted)}
.field input,.field select,.field textarea{min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.field textarea{min-height:90px;resize:vertical}
.err{color:var(--danger);font-size:.9rem;min-height:1.2em;margin:0}

.toast{position:fixed;z-index:950;left:50%;transform:translateX(-50%);bottom:calc(90px + env(safe-area-inset-bottom,0px));background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:10px;font-size:.92rem;max-width:calc(100% - 32px);box-shadow:var(--shadow)}
.leaflet-control-attribution{font-size:10px}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
