/* ═══════════════════════════════════════════════════════════
   Hamburg Wahl-Radar – style.css
   Phase 2: 3-Stage Cascade · Bottom Control Bar · Light Theme
   ═══════════════════════════════════════════════════════════ */

/* ── Local Inter Font (DSGVO) ────────────────────────────── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-300.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-300italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-500italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-600italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter/inter-v20-latin-700italic.woff2") format("woff2");
}

/* ── Reset & Tokens ──────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #e8e8e8;
  --accent: #15803d;
  --accent-dim: #166534;
  --accent-light: rgba(21, 128, 61, 0.08);
  --text: #1a1a1a;
  --text-muted: #64748b;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --cbar-h: 52px;
}

html,
body {
  font-family: var(--font);
  color: var(--text);
  overflow: hidden;
  height: 100%;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ── Loader ──────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg);
}
#loader p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}
.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Map ─────────────────────────────────────────────────── */
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.leaflet-container {
  background: #e8e8e8;
}
.leaflet-control-attribution {
  font-size: 9px !important;
  opacity: 0.5;
}
/* Top-right Leaflet control container: horizontal flex row for GPS + Geocoder */
.leaflet-top.leaflet-right {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 12px 0 0;
  z-index: 1300;
}
.leaflet-top.leaflet-right .leaflet-control {
  margin: 0 !important;
  float: none !important;
}
.leaflet-control-geocoder {
  width: 44px;
  height: 44px;
  border-radius: 8px !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  overflow: hidden;
  transition: width 0.25s ease;
}
.leaflet-control-geocoder.leaflet-control-geocoder-expanded {
  width: 260px;
  height: auto;
}
.leaflet-control-geocoder .leaflet-control-geocoder-icon {
  width: 44px;
  height: 44px;
  background-size: 18px;
  background-position: center;
  border-radius: 8px;
  cursor: pointer;
}
.leaflet-control-geocoder .leaflet-control-geocoder-form input {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  height: 44px;
  padding: 0 8px;
}

/* ══════════════════════════════════════════════════════════
   TOP BAR BUTTONS
   ══════════════════════════════════════════════════════════ */

/* Top nav row – flex container for back + breadcrumb */
.top-nav {
  position: absolute;
  z-index: 1100;
  top: 12px;
  left: 12px;
  right: 120px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.top-nav > * {
  pointer-events: auto;
}

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px 8px 10px;
  flex-shrink: 0;
  min-height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(21, 128, 61, 0.3);
  transition: transform 0.15s;
}
.btn-back:active {
  transform: scale(0.97);
}
.btn-back.hidden {
  display: none;
}

/* GPS button – inside Leaflet top-right flex row */
.btn-gps {
  position: static;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    transform 0.15s,
    background 0.2s;
}
.btn-gps:hover {
  background: var(--accent-light);
}
.btn-gps:active {
  transform: scale(0.95);
}
.btn-gps.locating {
  color: var(--text-muted);
  pointer-events: none;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}
.bc-level {
  color: var(--text-muted);
}
.bc-level.bc-active {
  color: var(--text);
  font-weight: 700;
}
.bc-home {
  cursor: pointer;
}
.bc-home:hover {
  color: var(--accent);
}
.bc-sep {
  color: var(--text-muted);
  margin: 0 2px;
  font-size: 10px;
}

/* Drill-down button in briefing */
.drill-btn {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  min-height: 44px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.drill-btn:hover {
  background: var(--accent-dim);
  color: #fff;
}
.drill-btn:active {
  transform: scale(0.98);
}

/* ══════════════════════════════════════════════════════════
   BOTTOM CONTROL BAR
   ══════════════════════════════════════════════════════════ */
.control-bar {
  position: fixed;
  z-index: 1100;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
  padding: 8px 12px calc(8px + var(--safe-b));
}

.cbar-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.cbar-main {
  min-height: 36px;
}

.cbar-select {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: auto;
}
/* Overlay select: visible by default, hidden via .hidden when deactivated */

.cbar-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.cbar-btn.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Filter panel (collapsible) */
.cbar-filters {
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cbar-filters.hidden {
  display: none;
}

.cbar-slider {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.cbar-slider strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.filter-counter {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.cbar-slider input[type="range"] {
  width: 100%;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Legend (inside control bar) */
.cbar-legend {
  margin-top: 6px;
}
.cbar-legend h4 {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.legend-bar {
  height: 10px;
  border-radius: 3px;
  margin-bottom: 2px;
}
.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.party-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.party-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
}
.party-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR / BOTTOM-SHEET
   ══════════════════════════════════════════════════════════ */
#sidebar {
  position: absolute;
  z-index: 1200;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 70vh;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#sidebar.open {
  transform: translateY(0);
}

.sidebar-inner {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 20px;
  -webkit-overflow-scrolling: touch;
}

.sheet-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  cursor: grab;
  flex-shrink: 0;
}
.sheet-handle span {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.15);
}

.sheet-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sidebar-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
  padding: 32px 0;
}
.placeholder-icon {
  font-size: 40px;
  opacity: 0.4;
}
#sidebar-placeholder p {
  font-size: 14px;
  line-height: 1.5;
  max-width: 260px;
}
#sidebar-placeholder small {
  color: var(--text-muted);
  font-size: 11px;
}

#sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
#sidebar-content.hidden {
  display: none;
}

/* ══════════════════════════════════════════════════════════
   BRIEFING COMPONENTS
   ══════════════════════════════════════════════════════════ */
#briefing-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
#briefing-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
#briefing-header .sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 600;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.bar-label {
  width: 90px;
  flex-shrink: 0;
  font-weight: 500;
  text-align: right;
  padding-right: 10px;
}
.bar-track {
  flex: 1;
  height: 20px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.bar-value {
  width: 52px;
  flex-shrink: 0;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  padding-left: 8px;
  font-variant-numeric: tabular-nums;
}

.highlight-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.highlight-card {
  flex: 1;
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  border-left: 3px solid var(--border);
}
.highlight-card.positive {
  border-left-color: #15803d;
}
.highlight-card.negative {
  border-left-color: #dc2626;
}
.highlight-card .hl-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.highlight-card .hl-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.demo-card {
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}
.demo-card .value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.demo-card .label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.strategy-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.6;
}

.stadtteil-summary {
  margin-bottom: 4px;
}
.stadtteil-summary .stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.stadtteil-summary .stat-row:last-child {
  border-bottom: none;
}
.stadtteil-summary .stat-label {
  color: var(--text-muted);
}
.stadtteil-summary .stat-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════
   MOBILE OFF-CANVAS DRAWER (<= 767px)
   ══════════════════════════════════════════════════════════ */

/* Trigger tab – fixed right edge, Wikipedia-style */
#briefing-trigger-tab {
  display: none; /* hidden by default; shown on mobile via MQ */
  position: fixed;
  right: 0;
  top: 40%;
  z-index: 1040;
  background: var(--accent);
  color: #fff;
  min-height: 44px;
  min-width: 44px;
  padding: 25px 15px;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 1px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 767px) {
  /* Show trigger tab only on mobile */
  #briefing-trigger-tab {
    display: block;
  }

  /* Sidebar becomes a right-side off-canvas drawer */
  #sidebar {
    position: fixed;
    top: 10px;
    right: -100%;
    left: auto;
    bottom: calc(var(--cbar-h) + 10px);
    width: 90%;
    max-height: none;
    border-radius: 12px 0 0 12px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transform: none;
    transition: right 0.3s ease-in-out;
  }

  /* Neutralise base .open transform on mobile (drawer uses right, not transform) */
  #sidebar.open {
    transform: none;
  }

  /* Hide sheet-handle on mobile (bottom-sheet concept, not relevant for side drawer) */
  .sheet-handle {
    display: none;
  }

  /* Open state: slide in from the right */
  #sidebar.drawer-open {
    right: 0;
  }

  /* Hide trigger tab when drawer is open (toggled via JS) */
  #briefing-trigger-tab.hidden {
    display: none !important;
  }

  /* Hide breadcrumbs on mobile */
  .breadcrumb {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════
   DESKTOP  (>= 768px)
   ══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  #sidebar {
    top: 16px;
    left: 16px;
    bottom: 16px;
    right: auto;
    width: 400px;
    max-height: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: none;
    border: 1px solid var(--border);
  }
  #sidebar.open {
    transform: none;
  }
  .sidebar-inner {
    padding: 24px;
  }
  .sheet-handle {
    display: none;
  }
  .sheet-close {
    display: none;
  }

  .control-bar {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: 320px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 12px;
  }

  .top-nav {
    left: 430px;
    right: 120px;
  }
}

/* ══════════════════════════════════════════════════════════
   SCROLLBAR & MISC
   ══════════════════════════════════════════════════════════ */
.sidebar-inner::-webkit-scrollbar {
  width: 6px;
}
.sidebar-inner::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-inner::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.hidden {
  display: none !important;
}

/* Stadtteil label tooltip – multi-line, zoom-harmonised */
.stadtteil-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.9),
    0 0 8px rgba(255, 255, 255, 0.7);
  text-align: center;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.1;
}
.stadtteil-label::before {
  display: none;
}

/* ══════════════════════════════════════════════════════════
   FRAKTION VOR ORT – Badges & Cards
   ══════════════════════════════════════════════════════════ */
.fraktion-section h3 {
  margin-bottom: 12px;
}

.fraktion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fraktion-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
}
.fraktion-card .fc-info {
  min-width: 0;
}
.fraktion-card .fc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.fraktion-card .fc-funktion {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.fraktion-card .fc-stimmen {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.badge-wahlkreis {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-liste {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   VERNETZUNG – Demografische Zwillinge
   ══════════════════════════════════════════════════════════ */
.twins-intro {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.twins-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.twin-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  min-height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.twin-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}
.twin-btn:active {
  transform: scale(0.98);
}
.twin-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.twin-dist {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.twins-metrics {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

/* GPS error toast */
.gps-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 20px;
  background: #dc2626;
  color: #fff;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* GPS marker */
.gps-marker {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(21, 128, 61, 0.5);
}

/* ── Legal Footer (inside control-bar) ───────────────────── */
.legal-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}
.legal-footer a {
  font-size: 10px;
  color: #4a4a4a;
  font-weight: 500;
  text-decoration: none;
  margin: 0 5px;
  transition: color 0.2s;
}
.legal-footer a:hover {
  color: #000;
}

/* ── Legal Modal ─────────────────────────────────────────── */
.legal-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.legal-modal.hidden {
  display: none;
}
.legal-modal-content {
  background: #fff;
  color: #1a1a1a;
  padding: 30px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.legal-modal-content h2 {
  margin-top: 0;
  font-size: 1.25rem;
}
.legal-modal-content p,
.legal-modal-content li {
  font-size: 0.85rem;
  line-height: 1.6;
}
.legal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  line-height: 1;
}
.legal-close:hover {
  color: #000;
}

@media (max-width: 768px) {
  .legal-modal-content {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 20px;
  }
}

/* ── Map Labels (Center Aligned, Multiline) ──────────────── */
.stadtteil-label.leaflet-tooltip {
  /* Override leaflet defaults */
  white-space: normal !important;
  text-align: center;
  word-wrap: break-word;
  line-height: 1.1;

  /* Additional polish */
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text);
  font-weight: 600;
  text-shadow: 
    0 1px 2px rgba(255, 255, 255, 0.8),
    0 -1px 2px rgba(255, 255, 255, 0.8),
    1px 0 2px rgba(255, 255, 255, 0.8),
    -1px 0 2px rgba(255, 255, 255, 0.8);
}
.stadtteil-label.leaflet-tooltip::before {
  /* Hide the little triangle tail */
  display: none;
}

