:root {
  --bg: #F4F1EA;
  --surface: #FFFFFF;
  --surface-2: #FAF8F3;
  --ink: #16150F;
  --muted: #5B574D;
  --line: #E2DCCF;
  --brand: #F2B233;
  --sos: #C21A2E;
  --open: #12784A;
  --open-bg: #DDF2E6;
  --closed: #6F6A60;
  --closed-bg: #ECE8DF;
  --c-sleep: #3446A3;
  --c-food: #B04A14;
  --c-med: #C0273A;
  --c-help: #0F6D72;
  --c-drugs: #6B3794;
  --c-hygiene: #1B66A6;
  --c-street: #845400;
  --c-all: #16150F;
  --radius: 14px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 18px; height: 18px; }
.ico.lg { width: 28px; height: 28px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; height: 100%; height: 100dvh; }

.top {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 8px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; background: var(--brand); color: var(--ink);
  display: grid; place-items: center; flex: none;
}
.brand-text { min-width: 0; overflow: hidden; }
.brand-name { font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; letter-spacing: -0.01em; line-height: 1.1; }
.brand-tag { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-btn {
  height: 44px; min-width: 44px; padding: 0 11px; border-radius: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 15px; border: 1.5px solid var(--line); background: var(--surface);
}
.top-btn.sos { background: var(--sos); border-color: var(--sos); color: #fff; }

/* ---------- Filter chips ---------- */
.filters { background: var(--surface); border-bottom: 1px solid var(--line); z-index: 4; }
.cats {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px 6px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cats::-webkit-scrollbar, .toggles::-webkit-scrollbar, .days::-webkit-scrollbar { display: none; }
.cat {
  flex: none; width: 74px; min-height: 66px; padding: 8px 4px 6px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 650; line-height: 1.15; text-align: center;
  color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line);
}
.cat .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--cc, var(--ink)); }
.cat[aria-pressed="true"] { background: var(--cc, var(--ink)); border-color: var(--cc, var(--ink)); color: #fff; }
.cat[aria-pressed="true"] .dot { background: rgba(255,255,255,0.22); }
.toggles { display: flex; gap: 6px; overflow-x: auto; padding: 0 10px 8px; scrollbar-width: none; }
.tog {
  flex: none; height: 36px; padding: 0 12px; border-radius: 18px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 650; border: 1.5px solid var(--line); background: var(--surface);
}
.tog[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tog .live { width: 9px; height: 9px; border-radius: 50%; background: var(--open); }
.tog[aria-pressed="true"] .live { background: #7CE3A8; }

/* ---------- Views ---------- */
.views { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.on { display: block; }
#map { position: absolute; inset: 0; background: #E9E6DF; }
.scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px 24px; }

.fab {
  position: absolute; right: 12px; bottom: 34px; z-index: 3;
  height: 52px; padding: 0 18px 0 14px; border-radius: 26px; background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.map-count {
  position: absolute; left: 12px; bottom: 40px; z-index: 3; background: var(--surface); border-radius: 18px;
  padding: 6px 12px; font-size: 14px; font-weight: 650; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.map-note { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 3; background: var(--surface); padding: 12px; border-radius: 12px; font-weight: 600; }

/* Markers */
.mk {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--cc, var(--ink)); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  position: relative; cursor: pointer;
}
.mk.dim { opacity: 0.8; }
.mk .n {
  position: absolute; top: -7px; right: -9px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff;
}
.mk .o { position: absolute; bottom: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: #1FB36B; border: 2.5px solid #fff; }
.me-dot { width: 20px; height: 20px; border-radius: 50%; background: #1A73E8; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(26,115,232,0.22); }

/* ---------- Cards ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px 10px; }
.list-head .cnt { font-weight: 700; color: var(--muted); font-size: 15px; }
.near-btn {
  height: 44px; padding: 0 14px; border-radius: 22px; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; background: var(--ink); color: #fff;
}
.card {
  display: flex; gap: 12px; width: 100%; text-align: start; padding: 12px; margin-bottom: 8px;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line);
}
.card .sq { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--cc, var(--ink)); flex: none; }
.card .body { flex: 1; min-width: 0; }
.card .name { font-weight: 750; font-size: 17px; line-height: 1.25; }
.card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.card .svs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; color: var(--muted); }
.card .dist { font-weight: 750; font-size: 15px; color: var(--ink); white-space: nowrap; align-self: flex-start; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 13.5px; font-weight: 750; white-space: nowrap;
}
.pill.open { background: var(--open-bg); color: var(--open); }
.pill.open::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--open); }
.pill.closed { background: var(--closed-bg); color: var(--closed); }
.pill.who { background: #FBEFD5; color: #6B4500; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); font-weight: 600; }
.empty .ico { width: 40px; height: 40px; margin-bottom: 8px; }
.empty button { margin-top: 12px; }
.foot { margin: 18px 4px 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.foot a { color: var(--muted); }
.foot .priv { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 8px; }

/* ---------- Calendar ---------- */
.days { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.day {
  flex: none; width: 62px; height: 66px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 650; font-size: 13px; gap: 2px;
}
.day b { font-size: 22px; line-height: 1; }
.day[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ev { display: flex; gap: 10px; margin-bottom: 8px; }
.ev .tm { width: 58px; flex: none; text-align: end; padding-top: 12px; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.ev .tm small { display: block; font-weight: 600; font-size: 13px; color: var(--muted); }
.ev .card { margin: 0; }
.cal-tip { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 0 2px 12px; }

/* ---------- Bottom nav ---------- */
.nav {
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); z-index: 5;
}
.nav button {
  flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.nav button[aria-current="page"] { color: var(--ink); }
.nav button[aria-current="page"] .ico { stroke-width: 2.6; }
.nav button[aria-current="page"]::after { content: ""; display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--brand); margin-top: 1px; }

/* ---------- Sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15,14,10,0.45); z-index: 20; opacity: 0; pointer-events: none; transition: opacity .18s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88vh; max-height: 88dvh;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
  transform: translateY(105%); transition: transform .22s ease-out; display: flex; flex-direction: column;
  max-width: 640px; margin: 0 auto;
}
.sheet.on { transform: none; }
.sheet-bar { display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px 16px; }
.sheet-bar .grab { position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; border-radius: 2px; background: var(--line); transform: translateX(-50%); }
.sheet-bar h2 { flex: 1; margin: 0; font-size: 19px; font-weight: 800; line-height: 1.25; padding-top: 6px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }

.d-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.d-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.act {
  height: 56px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 17px; text-decoration: none; background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
}
.act.primary { background: var(--open); border-color: var(--open); color: #fff; }
.act.wide { grid-column: 1 / -1; }
.d-addr { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.d-svs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-bottom: 14px; }
.sv { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--surface-2); font-size: 12.5px; font-weight: 650; text-align: center; line-height: 1.15; }
.sv .ico { color: var(--cc, var(--ink)); }
.d-tags { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.tag { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; padding: 8px 10px; border-radius: 10px; background: #FBEFD5; color: #4A3000; }
.hours { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 15px; }
.hours th { text-align: start; font-weight: 700; padding: 7px 8px; width: 64px; vertical-align: top; }
.hours td { padding: 7px 8px; font-variant-numeric: tabular-nums; }
.hours tr { border-bottom: 1px solid var(--line); }
.hours tr.now { background: #FFF6DF; }
.hours .none { color: var(--muted); }
.d-h { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 4px 0 6px; display: flex; align-items: center; gap: 6px; }
.d-src { font-size: 13px; color: var(--muted); }
.d-src a { color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; height: 40px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }

/* SOS */
.sos-list { display: flex; flex-direction: column; gap: 8px; }
.sos-item {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; text-decoration: none;
  background: var(--surface-2); border: 1.5px solid var(--line);
}
.sos-item.big { background: var(--sos); border-color: var(--sos); color: #fff; }
.sos-item .sq { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: #fff; flex: none; }
.sos-item.big .sq { background: rgba(255,255,255,0.2); }
.sos-item .tx { flex: 1; min-width: 0; }
.sos-item .tx b { display: block; font-size: 17px; }
.sos-item .tx span { font-size: 15px; font-variant-numeric: tabular-nums; }
.sos-item .tx small { display: block; font-size: 13px; opacity: .8; }
.sos-item.big .tx b { font-size: 22px; }
.wa { height: 40px; padding: 0 12px; border-radius: 20px; background: #128C4A; color: #fff; display: inline-flex; align-items: center; font-weight: 750; font-size: 14px; text-decoration: none; }

/* Languages */
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lang-btn { height: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); font-weight: 750; font-size: 17px; }
.lang-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 20px; font-weight: 650; font-size: 15px; z-index: 30; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; }

/* Map attribution compact */
.maplibregl-ctrl-attrib { font-size: 11px; }

[dir="rtl"] .fab { right: auto; left: 12px; }
[dir="rtl"] .map-count { left: auto; right: 12px; }

@media (min-width: 900px) {
  .scroll { padding: 16px max(16px, calc(50% - 340px)) 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .scrim, .toast { transition: none; }
}

.ev.past { opacity: .5; }
@media (max-width: 359px) {
  #langCode { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .top { gap: 8px; }
}

/* SCHLUESSELKINDER: Original-Layout, klare Kontraste und das originale Schlüsselzeichen. */
:root { --bg:#e8e3d9; --surface:#f2eee5; --surface-2:#e9e4da; --ink:#151514; --muted:#57534d; --line:#bcb7ae; --brand:#b92e35; --sos:#ac2632; --radius:3px; }
.top { background:#121211; color:#f0ece3; border-bottom:3px solid var(--brand); }
.brand-mark { width:30px; height:52px; border-radius:0; background:#eee9df; mask-image:url('/brand/grinning-key-original.png'); mask-repeat:no-repeat; mask-size:279.37% 154.28%; mask-position:50.05% 50.16%; aspect-ratio:1740 / 4051; }
.brand-name { font-family:Impact,'Arial Narrow',sans-serif; font-size:25px; font-weight:700; letter-spacing:.015em; }
.brand-tag { color:#c8c3b9; }
.top-btn { border-radius:3px; background:#242422; color:#f0ece3; border-color:#6c6861; }
.top-btn.sos { background:var(--sos); }
.filters { border-bottom:1px solid var(--ink); }
.cat { border-radius:3px; border-color:#aaa59c; min-height:68px; }
.cat[aria-pressed=true] { box-shadow:inset 0 -4px 0 var(--brand); }
.tog { border-radius:3px; min-height:42px; }
.card { border-radius:3px; border-left:4px solid var(--cc); box-shadow:none; }
.card .sq { border-radius:2px; }.card h3 { font-weight:800; }
.nav { background:#121211; color:#eee9df; border-top:3px solid var(--brand); }
.nav button { color:#c7c2b8; }.nav button[aria-current=page] { color:#fff; }
.nav button[aria-current=page]::after { width:42px; height:4px; border-radius:0; }
.fab,.near-btn,.lang-btn,.act { border-radius:3px; }
.sheet { border-radius:4px 4px 0 0; }.sheet-bar { border-bottom:2px solid #161615; }
.hours tr.now { background:#e8d2cf; }
.data-notice { margin:0; padding:7px 12px; font-size:12px; line-height:1.4; background:#e3d6d1; border-bottom:1px solid #a89590; color:#302120; }
.map-consent { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px; text-align:center; background:#1b1b19; color:#f0ece3; }
.map-consent h1 { font:clamp(28px,5vw,46px)/1 Impact,'Arial Narrow',sans-serif; margin:12px 0 0; letter-spacing:.025em; }
.map-consent p { margin:10px 0 16px; }.map-consent .map-privacy { max-width:470px; font-size:13px; color:#c7c2b8; line-height:1.5; }
.map-consent button { display:flex; align-items:center; gap:12px; padding:15px 24px; min-height:52px; background:#b92e35; color:#fff; font-weight:800; border:1px solid #e8878c; }
.consent-key { width:36px; height:70px; background:#e8e3d9; mask-image:url('/brand/grinning-key-original.png'); mask-repeat:no-repeat; mask-size:279.37% 154.28%; mask-position:50.05% 50.16%; }
@media(max-width:359px) { .brand-mark{width:23px;height:45px}.brand-name{font-size:22px}.top{padding:8px}.data-notice{font-size:11px}.map-consent{padding:14px}.map-consent h1{font-size:28px}.consent-key{display:none} }
@media(max-width:480px) { .brand-name { font-size:20px; } .brand-mark { width:25px;height:48px; } }
