/* ==========================================================================
   FreiParken – design system
   Glass surfaces over a full-bleed map, emerald→cyan brand, Inter + Space
   Grotesk. Dark is the default theme; [data-theme="light"] flips tokens.
   ========================================================================== */

@font-face {
  font-family: 'InterVar';
  src: url('/vendor/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SpaceGroteskVar';
  src: url('/vendor/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-ui: 'InterVar', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'SpaceGroteskVar', 'InterVar', -apple-system, sans-serif;

  --brand-1: #34d399;
  --brand-2: #22d3ee;
  --brand-grad: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --danger-1: #fb7185;
  --danger-2: #f43f5e;

  --type-foot: #ff5c7a;
  --type-car: #ffaa1f;
  --type-tow: #a78bfa;

  --bg: #0b0f14;
  --surface: rgba(16, 22, 30, 0.72);
  --surface-strong: rgba(13, 18, 25, 0.9);
  --surface-inset: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef3f8;
  --text-dim: rgba(238, 243, 248, 0.6);
  --text-faint: rgba(238, 243, 248, 0.38);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 6px 24px rgba(0, 0, 0, 0.35);
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --marker-ring: #0b0f14;
  --on-brand: #052e22;
}

[data-theme='light'] {
  --bg: #e9edf2;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --surface-inset: rgba(15, 23, 42, 0.05);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0e1726;
  --text-dim: rgba(14, 23, 38, 0.62);
  --text-faint: rgba(14, 23, 38, 0.4);
  --shadow: 0 12px 40px rgba(30, 41, 59, 0.18), 0 2px 8px rgba(30, 41, 59, 0.1);
  --shadow-soft: 0 6px 24px rgba(30, 41, 59, 0.14);
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --marker-ring: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* `hidden` must always win, even over components with their own display */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 12px;
}

svg { display: block; }

/* ==========================================================================
   Map
   ========================================================================== */

#map {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 0;
}
.leaflet-container { background: var(--bg); font-family: var(--font-ui); }

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.22) 100%);
}
[data-theme='light'] .vignette {
  background: radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(30, 41, 59, 0.12) 100%);
}

.leaflet-control-attribution {
  background: var(--surface) !important;
  color: var(--text-faint) !important;
  font-size: 9.5px !important;
  padding: 2px 8px !important;
  border-radius: 8px 0 0 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.leaflet-control-attribution a { color: var(--text-dim) !important; text-decoration: none; }

/* ==========================================================================
   Glass primitives
   ========================================================================== */

.glass {
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), var(--edge-light);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface-inset); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.subtle { width: 32px; height: 32px; border-radius: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 620;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, filter 0.2s;
  user-select: none;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--brand-grad);
  color: var(--on-brand);
  box-shadow: 0 6px 20px rgba(45, 212, 191, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost {
  background: var(--surface-inset);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.ghost:hover { background: var(--surface-inset); border-color: var(--border-strong); }
.btn.danger {
  background: linear-gradient(135deg, var(--danger-1), var(--danger-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4);
}
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn.big { width: 100%; padding: 15px 20px; font-size: 16px; border-radius: 16px; }
.btn.grow { flex: 1; }
.btn:disabled { opacity: 0.55; pointer-events: none; }

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 30;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.topbar-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  padding: 8px 10px 8px 12px;
  border-radius: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-radius: 14px;
}
.brand-mark { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 4px 14px rgba(34, 211, 238, 0.35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 10px;
  font-weight: 560;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.brand-city {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--brand-2);
  border: 1px solid color-mix(in srgb, var(--brand-2) 40%, transparent);
  background: color-mix(in srgb, var(--brand-2) 12%, transparent);
  padding: 3px 7px;
  border-radius: 999px;
  margin-left: 2px;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.status-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-1);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: livePulse 2.4s ease-out infinite;
}
.live-dot.alerting { background: var(--danger-2); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.5); }
.live-dot.offline { background: var(--text-faint); animation: none; box-shadow: none; }
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Menu popover */
.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  border-radius: 18px;
  padding: 6px;
  z-index: 40;
  transform-origin: top right;
  animation: popIn 0.18s cubic-bezier(0.32, 0.72, 0, 1);
  /* .topbar disables pointer events so the map stays draggable around the
     pill – the popover must explicitly opt back in or clicks fall through */
  pointer-events: auto;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  transition: background 0.15s;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-inset); }
.mi-icon { width: 17px; height: 17px; color: var(--text-dim); flex: none; }
.menu-footer {
  padding: 9px 12px 7px;
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  line-height: 1.45;
}

/* ==========================================================================
   Proximity alert banner
   ========================================================================== */

.alert-banner {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 62px);
  left: 12px;
  right: 12px;
  z-index: 29;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.alert-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  max-width: 560px;
  padding: 11px 12px;
  border-radius: 18px;
  border-color: color-mix(in srgb, var(--danger-2) 45%, transparent);
  background: color-mix(in srgb, var(--danger-2) 16%, var(--surface));
  animation: alertIn 0.45s cubic-bezier(0.32, 0.72, 0, 1);
  cursor: pointer;
  transition: transform 0.15s;
}
.alert-inner:active { transform: scale(0.985); }
.alert-chev { width: 18px; height: 18px; flex: none; color: var(--text-faint); }
@keyframes alertIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.alert-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--danger-1), var(--danger-2));
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.45);
  animation: alertThrob 1.6s ease-in-out infinite;
}
.alert-icon svg { width: 20px; height: 20px; }
@keyframes alertThrob {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.alert-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.alert-body strong { font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-body span { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   Bottom action bar
   ========================================================================== */

.bottombar {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s;
}
.bottombar.hidden-down { transform: translate(-50%, 120px); opacity: 0; pointer-events: none; }

.round-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: var(--text);
  transition: transform 0.15s, background 0.2s;
}
.round-btn svg { width: 22px; height: 22px; }
.round-btn:active { transform: scale(0.92); }
.round-btn.active { color: var(--brand-2); }

.badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--danger-1), var(--danger-2));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.5);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.badge.bump { transform: scale(1.35); }

.report-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 26px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--brand-grad);
  color: var(--on-brand);
  font-weight: 680;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  box-shadow:
    0 10px 30px rgba(34, 211, 238, 0.38),
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.report-pill svg { width: 21px; height: 21px; }
.report-pill:hover { filter: brightness(1.05); box-shadow: 0 12px 36px rgba(34, 211, 238, 0.5), 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.report-pill:active { transform: scale(0.96); }

/* ==========================================================================
   Placement mode
   ========================================================================== */

.placement-pin {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 24;
  pointer-events: none;
  transform: translate(-50%, -100%);
}
.placement-pin svg {
  width: 44px;
  height: 57px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  transform-origin: 50% 100%;
  animation: pinDrop 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes pinDrop {
  from { transform: translateY(-18px) scale(0.85); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.placement-pin .pin-body { fill: url(#lg); }
.placement-pin .pin-shadow {
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 12px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  transition: transform 0.2s, opacity 0.2s;
}
.placement.lifted .placement-pin svg { transform: translateY(-10px); }
.placement.lifted .pin-shadow { transform: translateX(-50%) scale(1.5); opacity: 0.55; }

.placement-card {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 26;
  width: calc(100% - 24px);
  max-width: 440px;
  border-radius: 24px;
  padding: 14px;
  animation: sheetUp 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.seg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.seg-btn svg { width: 21px; height: 21px; }
.seg-btn:active { transform: scale(0.95); }
.seg-btn.active { background: var(--surface-strong); color: var(--text); box-shadow: var(--shadow-soft), var(--edge-light); }
.seg-btn[data-type='foot'].active { color: var(--type-foot); }
.seg-btn[data-type='car'].active { color: var(--type-car); }
.seg-btn[data-type='tow'].active { color: var(--type-tow); }
.seg-btn.active span { color: var(--text); }

.placement-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 4px 12px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.placement-hint #placementArea { font-weight: 650; color: var(--text); }
.hint-sep { color: var(--text-faint); }

.placement-actions { display: flex; gap: 10px; }
.placement-actions .btn { flex: 1; }

/* ==========================================================================
   Sheets (detail + feed)
   ========================================================================== */

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 27;
  width: 100%;
  max-width: 460px;
  padding: 0 12px max(12px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.sheet-card {
  pointer-events: auto;
  border-radius: 26px;
  padding: 10px 16px 16px;
  animation: sheetUp 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}
.sheet.closing .sheet-card { animation: sheetDown 0.25s ease-in forwards; }
@keyframes sheetDown {
  to { opacity: 0; transform: translateY(40px); }
}
.sheet-grip {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
  margin: 2px auto 10px;
}

.detail-head { display: flex; align-items: center; gap: 12px; }
.type-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 15px;
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.type-avatar svg { width: 24px; height: 24px; }
.type-avatar.foot { background: linear-gradient(135deg, #ff7a92, #f43f5e); }
.type-avatar.car { background: linear-gradient(135deg, #ffc14d, #f59e0b); }
.type-avatar.tow { background: linear-gradient(135deg, #b9a0ff, #8b5cf6); }
.detail-titles { flex: 1; min-width: 0; }
.detail-titles h2 {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
}
.detail-titles p { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }

.freshness { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.freshness-track {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-inset);
  overflow: hidden;
}
.freshness-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand-grad);
  transition: width 0.6s ease;
}
.freshness-fill.low { background: linear-gradient(90deg, #f59e0b, var(--danger-2)); }
.freshness-label {
  font-size: 11.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail-stats {
  display: flex;
  gap: 8px;
  margin: 12px 0 14px;
  flex-wrap: wrap;
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.stat-chip svg { width: 13px; height: 13px; }
.stat-chip.good { color: var(--brand-1); border-color: color-mix(in srgb, var(--brand-1) 35%, transparent); }
.stat-chip.warn { color: #f59e0b; border-color: color-mix(in srgb, #f59e0b 40%, transparent); }

.detail-actions { display: flex; gap: 10px; }

/* Feed */
.feed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2px 2px 10px;
}
.feed-head h2 { font-family: var(--font-display); font-size: 18px; font-weight: 640; letter-spacing: -0.01em; }
.feed-head p { font-size: 12px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }

.feed-list {
  list-style: none;
  max-height: min(46vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 10px;
  border-radius: 16px;
  text-align: left;
  transition: background 0.15s, transform 0.15s;
  animation: feedIn 0.3s ease both;
}
@keyframes feedIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.feed-item:hover { background: var(--surface-inset); }
.feed-item:active { transform: scale(0.98); }
.feed-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  color: #fff;
}
.feed-avatar svg { width: 19px; height: 19px; }
.feed-body { flex: 1; min-width: 0; }
.feed-body strong { display: block; font-size: 14px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-body span { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.feed-go { color: var(--text-faint); flex: none; }
.feed-go svg { width: 16px; height: 16px; }

.feed-empty { text-align: center; padding: 26px 12px 18px; color: var(--text-dim); font-size: 13.5px; }
.feed-empty-art { font-size: 26px; margin-bottom: 8px; }

/* ==========================================================================
   Onboarding modal
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 8, 12, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}
[data-theme='light'] .modal-backdrop { background: rgba(226, 232, 240, 0.5); }
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 28px;
  padding: 26px 24px 22px;
  background: var(--surface-strong);
  overflow: hidden;
  animation: modalIn 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.modal-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.22), transparent);
  pointer-events: none;
}
.modal-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.modal-mark { width: 52px; height: 52px; border-radius: 15px; box-shadow: 0 8px 24px rgba(34, 211, 238, 0.4); }
.modal-brand h1 { font-family: var(--font-display); font-size: 23px; font-weight: 660; letter-spacing: -0.02em; }
.modal-brand p { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

.steps { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.steps li { display: flex; gap: 13px; align-items: flex-start; }
.step-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-2) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-2) 30%, transparent);
  color: var(--brand-2);
}
.step-icon svg { width: 19px; height: 19px; }
.steps strong { display: block; font-size: 14.5px; font-weight: 640; margin-bottom: 2px; letter-spacing: -0.01em; }
.steps p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 15px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 560;
  margin-bottom: 14px;
  cursor: pointer;
}
.switch { position: relative; flex: none; width: 44px; height: 26px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .knob {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--border-strong);
  transition: background 0.25s, border-color 0.25s;
}
.switch .knob::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.switch input:checked + .knob { background: var(--brand-grad); border-color: transparent; }
.switch input:checked + .knob::after { transform: translateX(18px); }

.disclaimer {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-faint);
  text-align: center;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 76px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--surface-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 580;
  text-align: center;
  max-width: 100%;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.95); } }
.toast.error { border-color: color-mix(in srgb, var(--danger-2) 45%, transparent); }

/* ==========================================================================
   Map markers
   ========================================================================== */

.fp-marker { position: relative; }
.fp-marker .dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  border: 2.5px solid var(--marker-ring);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s;
}
/* Drop-in plays only for newly created markers, not on periodic refreshes */
.fp-marker.spawn .dot { animation: markerIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1); }
@keyframes markerIn {
  from { transform: translate(-50%, -50%) scale(0); }
  to { transform: translate(-50%, -50%) scale(1); }
}
.fp-marker .dot svg { width: 17px; height: 17px; }
.fp-marker.foot .dot { background: linear-gradient(135deg, #ff7a92, #f43f5e); }
.fp-marker.car .dot { background: linear-gradient(135deg, #ffc14d, #f59e0b); }
.fp-marker.tow .dot { background: linear-gradient(135deg, #b9a0ff, #8b5cf6); }
.fp-marker:hover .dot { transform: translate(-50%, -50%) scale(1.12); }

/* Pulse ring: transform/opacity only – stays on the GPU compositor and
   never forces repaints while the map is panning or zooming. */
.fp-marker .halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}
.fp-marker.foot .halo { background: rgba(244, 63, 94, 0.4); }
.fp-marker.car .halo { background: rgba(245, 158, 11, 0.4); }
.fp-marker.tow .halo { background: rgba(139, 92, 246, 0.4); }
.fp-marker.fresh .halo { animation: halo 2.2s ease-out infinite; }
@keyframes halo {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

/* Age fading: --age goes 0 (new) → 1 (about to expire) */
.fp-marker .dot { opacity: calc(1 - var(--age, 0) * 0.45); }

/* Unverified reports: visibly muted, dashed ring, no attention-grabbing pulse */
.fp-marker.unverified .dot {
  opacity: calc(0.55 - var(--age, 0) * 0.2);
  border-style: dashed;
  filter: saturate(0.75);
}
.fp-marker.unverified .halo { display: none; }
.feed-item.unverified { opacity: 0.65; }

/* Cluster badges – count tinted by the dominant type inside */
.fp-cluster {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--s, 38px);
  height: var(--s, 38px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 640;
  font-size: calc(var(--s, 38px) * 0.36);
  font-variant-numeric: tabular-nums;
  border: 2.5px solid var(--marker-ring);
  transition: transform 0.15s;
  animation: markerIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.fp-cluster:hover { transform: translate(-50%, -50%) scale(1.1); }
.fp-cluster span { line-height: 1; }
.fp-cluster.foot {
  background: linear-gradient(135deg, #ff7a92, #f43f5e);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 6px rgba(244, 63, 94, 0.18);
}
.fp-cluster.car {
  background: linear-gradient(135deg, #ffc14d, #f59e0b);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 6px rgba(245, 158, 11, 0.18);
}
.fp-cluster.tow {
  background: linear-gradient(135deg, #b9a0ff, #8b5cf6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 6px rgba(139, 92, 246, 0.18);
}

/* Parked car (Auto-Wache) */
.fp-car-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #04343c;
  background: var(--brand-grad);
  border: 2.5px solid var(--marker-ring);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(34, 211, 238, 0.16);
  animation: markerIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.fp-car-pin svg { width: 20px; height: 20px; }

.car-shield {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  color: var(--brand-1);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}
.car-shield svg { width: 100%; height: 100%; }
.round-btn.active { color: var(--brand-2); }

.type-avatar.car-avatar { background: var(--brand-grad); color: #04343c; }
.type-avatar.sub-avatar { background: var(--brand-grad); color: #04343c; }

.sub-text { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 12px 2px 14px; }

.icon-btn { position: relative; }
.sub-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-grad);
  box-shadow: 0 0 0 2px var(--surface-strong);
}
.icon-btn.subscribed { color: var(--brand-2); }

.placement-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 640;
  text-align: center;
  padding: 6px 4px 2px;
  letter-spacing: -0.01em;
}

/* Search panel */
.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border-radius: 18px;
  padding: 8px;
  z-index: 41;
  pointer-events: auto;
  animation: popIn 0.18s cubic-bezier(0.32, 0.72, 0, 1);
  transform-origin: top center;
}
.search-row { display: flex; align-items: center; gap: 8px; }
.search-icon { width: 17px; height: 17px; color: var(--text-faint); flex: none; margin-left: 6px; }
#searchInput {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  padding: 9px 0;
}
#searchInput::placeholder { color: var(--text-faint); }
.search-results { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.search-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 12px;
  transition: background 0.15s;
}
.search-item:hover { background: var(--surface-inset); }
.search-item strong { font-size: 14px; font-weight: 620; }
.search-item span { font-size: 12px; color: var(--text-dim); }
.search-none { padding: 12px; font-size: 13px; color: var(--text-dim); text-align: center; }

/* Kontrollzeiten (patterns) */
.patterns-body { padding: 4px 2px 2px; }
.pattern-hours {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 96px;
  padding: 4px 2px 16px;
}
.ph-col {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.ph-col b {
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  background: var(--brand-grad);
  opacity: 0.85;
  min-height: 2px;
  transition: height 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}
.ph-col i {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 9.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.pattern-days { display: flex; gap: 6px; margin: 10px 0 4px; }
.pd-chip {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 620;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--brand-2) calc(var(--heat, 0) * 32%), var(--surface-inset));
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.patterns-note { padding: 10px 4px 2px; font-size: 12px; color: var(--text-dim); text-align: center; }

.fp-user {
  position: relative;
}
.fp-user .u-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-grad);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.fp-user .u-dot::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.4);
  z-index: -1;
  animation: userPulse 3s ease-out infinite;
}
@keyframes userPulse {
  0% { transform: scale(1); opacity: 0.8; }
  70%, 100% { transform: scale(3); opacity: 0; }
}

/* Custom zoom control (desktop only) */
.fp-zoom {
  position: fixed;
  right: 16px;
  bottom: 110px;
  z-index: 20;
  display: none;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
}
.fp-zoom button {
  width: 42px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 19px;
  font-weight: 500;
  transition: background 0.15s;
}
.fp-zoom button:hover { background: var(--surface-inset); }
.fp-zoom button + button { border-top: 1px solid var(--border); }

@media (min-width: 900px) and (pointer: fine) {
  .fp-zoom { display: flex; }
}

/* ==========================================================================
   Responsive & motion
   ========================================================================== */

@media (max-width: 480px) {
  .brand-sub { display: none; }
  .brand-city { display: none; }
  .report-pill { padding: 0 22px; font-size: 15px; }
}

/* Keep the (required) attribution clear of the bottom action bar on phones */
@media (max-width: 700px) {
  .leaflet-bottom.leaflet-right {
    margin-bottom: calc(max(14px, env(safe-area-inset-bottom)) + 62px);
  }
}

/* Touch devices: lighter glass blur – heavy backdrop-filter competes with the
   map for GPU time and makes panning/zooming stutter on phones. */
@media (pointer: coarse) {
  .glass {
    backdrop-filter: blur(14px) saturate(1.35);
    -webkit-backdrop-filter: blur(14px) saturate(1.35);
  }
  .toast {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
