:root {
  /* CD-konforme Primärfarben */
  --magenta:     #c6007e;
  --magenta-dk:  #691340;
  --magenta-lt:  #f4e6ef;
  --black:       #1d1d1b;
  --white:       #ffffff;
  --grey-light:  #f4f1f6;
  --grey-mid:    #E8E0EE;
  --grey-text:   #666666;
  --border:      #E5DDE9;

  /* CD-Sekundärfarben als Kategoriefarben (6 Kategorien) */
  --c-bauobjekte:   #691340;
  --c-baubetreuung:   #5B7BB3;
  --c-erschliessung:  #3D8B6E;
  --c-events:         #eb7d27;
  --c-ereignisse:     #9B59B6;
  --c-projekte:       #4a90a4;

  --sidebar-w: clamp(400px, 25vw, 600px);
}

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

html, body {
  height: 100%;
  font-family: 'Montserrat', sans-serif;
  background: var(--white);
  color: var(--black);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.app {
  display: grid;
  grid-template-rows: auto auto 1fr;
  height: 100vh;
  height: 100dvh;
}

/* ── HEADER ── */
header {
  background: var(--white);
  height: 60px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--magenta);
  z-index: 1000;
}
.brand-logo { height: 52px; width: auto; display: block; }
.header-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.6rem;
}
.jubilee-badge {
  background: var(--magenta); color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 1.05rem;
  letter-spacing: 0.04em; padding: 0.2rem 0.7rem; border-radius: 2px;
  text-transform: uppercase;
}
.jubilee-label {
  font-size: 0.7rem; font-weight: 500; color: var(--grey-text);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.header-right {
  font-size: 0.7rem; color: var(--grey-text);
  text-align: right; line-height: 1.4;
}

/* ── DAS BAND (CD-Gestaltungselement) ── */
.das-band {
  position: relative;
  height: 18px;
  overflow: hidden;
  z-index: 999;
  flex-shrink: 0;
}
.das-band svg {
  position: absolute;
  top: -8px;
  left: -2%;
  width: 104%;
  height: 34px;
}

/* ── MAIN LAYOUT ── */
.main-content {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  overflow: hidden;
  transition: grid-template-columns 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* ── SIDEBAR ── */
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--white);
  overflow: hidden;
  position: relative;
}

.sidebar-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--black); margin-bottom: 0.6rem;
}
.sidebar-subtitle {
  font-size: 0.75rem; color: var(--grey-text); margin-bottom: 0.7rem;
}
.onboarding-hint {
  font-size: 0.72rem; color: var(--grey-text); margin-bottom: 0.5rem;
  font-style: italic; opacity: 0.8;
  transition: opacity 0.3s ease, max-height 0.3s ease;
  max-height: 2rem; overflow: hidden;
}
.onboarding-hint.hidden {
  opacity: 0; max-height: 0; margin: 0;
}
.empty-state {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--grey-text);
  font-size: 0.82rem;
  line-height: 1.6;
}
.empty-state-icon { font-size: 1.5rem; margin-bottom: 0.5rem; opacity: 0.5; }

/* Filter wrapper + toggle (mobile accordion) */
.filter-wrap { position: relative; }
.filter-toggle { display: none; }

/* Filter chips */
.filter-row {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.4rem 0.8rem; border-radius: 100px;
  border: 1.5px solid var(--border);
  font-family: 'Montserrat', sans-serif; font-size: 0.7rem; font-weight: 500;
  cursor: pointer; background: var(--white); color: var(--grey-text);
  transition: all 0.15s ease; user-select: none;
  letter-spacing: 0.02em;
}
.chip:active { transform: scale(0.96); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.chip[data-cat="bauobjekte"]  .chip-dot { background: var(--c-bauobjekte); }
.chip[data-cat="baubetreuung"]  .chip-dot { background: var(--c-baubetreuung); }
.chip[data-cat="erschliessung"] .chip-dot { background: var(--c-erschliessung); }
.chip[data-cat="events"]        .chip-dot { background: var(--c-events); }
.chip[data-cat="ereignisse"]    .chip-dot { background: var(--c-ereignisse); }
.chip[data-cat="projekte"]      .chip-dot { background: var(--c-projekte); }
.chip.active[data-cat="bauobjekte"]  { background: var(--c-bauobjekte);  border-color: var(--c-bauobjekte);  color: white; }
.chip.active[data-cat="baubetreuung"]  { background: var(--c-baubetreuung);  border-color: var(--c-baubetreuung);  color: white; }
.chip.active[data-cat="erschliessung"] { background: var(--c-erschliessung); border-color: var(--c-erschliessung); color: white; }
.chip.active[data-cat="events"]        { background: var(--c-events);        border-color: var(--c-events);        color: white; }
.chip.active[data-cat="ereignisse"]    { background: var(--c-ereignisse);    border-color: var(--c-ereignisse);    color: white; }
.chip.active[data-cat="projekte"]      { background: var(--c-projekte);      border-color: var(--c-projekte);      color: white; }
.chip.active .chip-dot { background: rgba(255,255,255,0.5); }
.chip-check {
  width: 12px; height: 12px;
  display: none;
  flex-shrink: 0;
}
.chip.active .chip-check { display: inline-block; }
.chip.active .chip-dot { display: none; }

/* ── CARD LIST VIEW ── */
.sidebar-views {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.card-list-view,
.detail-view {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s ease;
}
.card-list-view {
  transform: translateX(0);
  opacity: 1;
}
.sidebar.show-detail .card-list-view {
  transform: translateX(-30px);
  opacity: 0;
  pointer-events: none;
}
.detail-view {
  transform: translateX(30px);
  opacity: 0;
  pointer-events: none;
}
.sidebar.show-detail .detail-view {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

/* ── STATION CARDS ── */
.station-card {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  align-items: flex-start;
}
.station-card:hover { background: var(--grey-light); }
.station-card.active { background: var(--magenta-lt); }

.card-color-bar {
  width: 8px;
  min-height: 40px;
  border-radius: 3px;
  flex-shrink: 0;
  align-self: stretch;
}
.card-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  text-align: center;
  padding-top: 0.1rem;
}
.card-icon img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.card-content { flex: 1; min-width: 0; }
.card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 0.88rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--black); line-height: 1.2;
  margin-bottom: 0.15rem;
}
.card-subtitle {
  font-size: 0.75rem; color: var(--grey-text);
  line-height: 1.3; font-weight: 400;
}
.card-thumb {
  width: 96px; height: 72px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  align-self: center;
}

/* ── DETAIL VIEW ── */
.detail-back {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.78rem; font-weight: 600; color: var(--magenta);
  text-transform: uppercase; letter-spacing: 0.06em;
  transition: background 0.15s;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
}
.detail-back:hover { background: var(--grey-light); }
.detail-back svg { width: 16px; height: 16px; }

.detail-img {
  width: 100%; height: 240px;
  object-fit: cover; display: block;
}
.detail-img-placeholder {
  width: 100%; height: 240px;
  background: linear-gradient(135deg, var(--grey-light) 0%, var(--grey-mid) 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.detail-img-placeholder img { opacity: 0.35; }
.detail-img-placeholder .placeholder-text {
  position: absolute; bottom: 0.6rem; right: 0.6rem;
  font-size: 0.62rem; color: var(--grey-text); opacity: 0.5;
}
.detail-cat-strip { height: 3px; }
.detail-body { padding: 1.2rem 1.25rem 2rem; }
.detail-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem;
}
.detail-badge-dot { width: 7px; height: 7px; border-radius: 50%; }
.detail-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: clamp(1rem, 3.5vw, 1.4rem); line-height: 1.15;
  color: var(--black); text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 0.1rem;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
.detail-subtitle {
  font-size: 0.82rem; color: var(--grey-text); margin-bottom: 0.2rem;
}
.detail-year {
  font-size: 0.78rem; color: var(--grey-text); margin-bottom: 0.9rem;
}
.detail-status {
  display: inline-block; font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.12rem 0.45rem; border-radius: 3px; margin-left: 0.4rem;
}
.detail-status.abgeschlossen { background: #dcfce7; color: #166534; }
.detail-status.laufend       { background: #dbeafe; color: #1e40af; }
.detail-status.geplant       { background: #fef3c7; color: #92400e; }
.detail-divider {
  width: 36px; height: 3px; background: var(--magenta);
  margin-bottom: 0.9rem; border-radius: 2px;
}
.detail-text {
  font-size: 0.85rem; line-height: 1.7; color: #333; margin-bottom: 0.9rem;
  font-weight: 400;
}
.detail-facts {
  background: var(--grey-light); border-left: 3px solid var(--magenta);
  padding: 0.6rem 0.9rem; font-size: 0.78rem; color: var(--black);
  line-height: 1.5; margin-bottom: 1rem; border-radius: 0 4px 4px 0;
}
.detail-section-label {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--grey-text); margin-bottom: 0.2rem;
}
.detail-partners {
  font-size: 0.75rem; color: var(--grey-text); line-height: 1.5; margin-bottom: 1rem;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  background: var(--grey-light); color: var(--grey-text);
  font-size: 0.68rem; font-weight: 500;
  padding: 0.2rem 0.55rem; border-radius: 3px; border: 1px solid var(--border);
}

/* ── MAP ── */
.map-container {
  position: relative;
  overflow: hidden;
  background: #f0ede8;
}
#map { width: 100%; height: 100%; }

/* Reduced, editorial map style */
.leaflet-tile {
  filter: brightness(1.04) contrast(0.95) saturate(0.9);
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important;
  border-radius: 6px !important; overflow: hidden;
}
.leaflet-control-zoom a {
  width: 40px !important; height: 40px !important;
  line-height: 40px !important;
  background: white !important; color: var(--black) !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 1.3rem !important; font-weight: 300 !important;
}
.leaflet-control-zoom a:hover { background: var(--grey-light) !important; }
.leaflet-control-attribution { font-size: 0.55rem !important; }

/* ── CUSTOM MARKER ── */
.pin-wrap {
  position: relative; width: 40px; height: 48px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
  transform-origin: bottom center;
}
.pin-wrap:hover, .pin-wrap.active {
  transform: scale(1.25) translateY(-4px);
}
.pin-head {
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 3px 12px rgba(0,0,0,0.25), 0 1px 4px rgba(0,0,0,0.15);
  position: absolute; top: 0; left: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-icon {
  transform: rotate(45deg);
  font-size: 1rem;
  line-height: 1;
  margin-top: -1px;
}

/* Hover tooltip */
.pin-tooltip {
  position: absolute;
  bottom: 56px; left: 50%;
  transform: translateX(-50%);
  background: rgba(29,29,27,0.9);
  color: white;
  padding: 0.35rem 0.7rem;
  border-radius: 5px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.pin-tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(29,29,27,0.9);
}
.pin-wrap:hover .pin-tooltip { opacity: 1; }

/* Active marker pulse animation */
.pin-wrap.active .pin-head {
  box-shadow: 0 0 0 6px rgba(198,0,126,0.3), 0 3px 12px rgba(0,0,0,0.25);
  animation: marker-pulse 1.5s ease-in-out infinite;
}
@keyframes marker-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(198,0,126,0.3), 0 3px 12px rgba(0,0,0,0.25); }
  50% { box-shadow: 0 0 0 10px rgba(198,0,126,0.1), 0 3px 12px rgba(0,0,0,0.25); }
}

/* ── CLUSTER ICONS ── */
.cluster-icon {
  width: 36px;
  height: 36px;
  background: var(--magenta);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 0 3px rgba(198,0,126,0.2);
}

/* ── LOADING OVERLAY ── */
.loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1500;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity 0.5s ease;
}
.loading-overlay.loaded {
  opacity: 0;
  pointer-events: none;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--grey-mid);
  border-top-color: var(--magenta);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  color: var(--grey-text);
  font-weight: 500;
}

/* ── "ALLE" CHIP ── */
.chip[data-cat="alle"] {
  font-weight: 700;
}
.chip.active[data-cat="alle"] {
  background: var(--magenta);
  border-color: var(--magenta);
  color: white;
}

/* ── WIFAM-ECK (CD-Gestaltungselement) ── */
.wifam-eck {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 120px 120px;
  border-color: transparent transparent var(--magenta) transparent;
  z-index: 700;
  opacity: 0.85;
  pointer-events: none;
}

/* ── SIDEBAR TOGGLE ── */
.sidebar-toggle {
  position: absolute;
  top: 50%;
  left: var(--sidebar-w);
  transform: translateY(-50%);
  z-index: 900;
  width: 24px; height: 48px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 0 8px rgba(0,0,0,0.08);
  transition: left 0.35s cubic-bezier(0.4,0,0.2,1);
  color: var(--grey-text);
  font-size: 0.7rem;
  padding: 0;
}
.sidebar-toggle:hover { background: var(--grey-light); color: var(--magenta); }
.sidebar-toggle svg { width: 14px; height: 14px; transition: transform 0.35s ease; }

.main-content.sidebar-hidden {
  grid-template-columns: 0 1fr;
}
.main-content.sidebar-hidden .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}
.main-content.sidebar-hidden .sidebar-toggle {
  left: 0;
}
.main-content.sidebar-hidden .sidebar-toggle svg {
  transform: rotate(180deg);
}
.sidebar {
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* ── DRAG HANDLE (mobile only) ── */
.drag-handle {
  display: none;
}

/* ── COUNTER ── */
.counter-pill {
  position: absolute; bottom: 1.2rem; left: 1.2rem;
  background: white; border: 1.5px solid var(--border);
  border-radius: 100px; padding: 0.3rem 0.8rem;
  font-size: 0.7rem; font-weight: 600; color: var(--black);
  z-index: 700; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  pointer-events: none;
}
.counter-pill span { color: var(--magenta); }

/* ══════════════════════════════════════
   RESPONSIVE – Tablet (768px - 1024px)
   ══════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {

  /* ── NARROWER SIDEBAR ── */
  :root {
    --sidebar-w: clamp(260px, 30vw, 340px);
  }

  /* ── COMPACT HEADER ── */
  header {
    height: 48px;
    padding: 0 1rem;
  }
  .brand-logo {
    height: 40px;
  }
  .jubilee-badge {
    font-size: 0.85rem;
  }
  .jubilee-label {
    font-size: 0.6rem;
  }
  .header-right {
    font-size: 0.6rem;
  }

  /* ── BAND: slimmer ── */
  .das-band {
    height: 12px;
  }
  .das-band svg {
    top: -10px;
    height: 28px;
  }

  /* ── SIDEBAR: tighter spacing ── */
  .sidebar-header {
    padding: 0.6rem 0.9rem 0.5rem;
  }
  .sidebar-title {
    font-size: 0.95rem;
  }
  .chip {
    min-height: 44px;
    padding: 0.4rem 0.65rem;
    font-size: 0.65rem;
  }
  .station-card {
    padding: 0.7rem 0.9rem;
    gap: 0.5rem;
  }
  .card-title {
    font-size: 0.78rem;
  }
  .card-subtitle {
    font-size: 0.68rem;
  }
  .card-thumb {
    width: 72px;
    height: 54px;
  }

  /* ── DETAIL VIEW: compact ── */
  .detail-img {
    height: 180px;
  }
  .detail-title {
    font-size: 1.15rem;
  }
  .detail-body {
    padding: 0.9rem 0.9rem 1.5rem;
  }
  .detail-text {
    font-size: 0.8rem;
  }

  /* ── ZOOM CONTROLS: touch-friendly ── */
  .leaflet-control-zoom a {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
  }
}

/* ══════════════════════════════════════
   RESPONSIVE – Tablet Portrait (tall + medium width)
   ══════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {

  /* Portrait iPad: sidebar takes too much space, make it even narrower */
  :root {
    --sidebar-w: clamp(240px, 28vw, 300px);
  }

  /* Hide less important header elements */
  .jubilee-label {
    display: none;
  }
  .header-right {
    display: none;
  }

  /* ── FILTER ACCORDION (tablet portrait) ── */
  .filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--grey-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .filter-toggle-label { flex-shrink: 0; }
  .filter-toggle-dots {
    display: flex; gap: 4px; align-items: center; flex: 1;
  }
  .filter-toggle-dot {
    width: 8px; height: 8px; border-radius: 50%; transition: opacity 0.2s;
  }
  .filter-toggle-dot.inactive { opacity: 0.25; }
  .filter-toggle-chevron {
    width: 16px; height: 16px; flex-shrink: 0;
    transition: transform 0.25s ease; color: var(--grey-text);
  }
  .filter-wrap.open .filter-toggle-chevron { transform: rotate(180deg); }
  .filter-wrap .filter-row {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
  }
  .filter-wrap.open .filter-row { max-height: 200px; opacity: 1; }
}

/* ══════════════════════════════════════
   RESPONSIVE – Mobile (< 768px)
   ══════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── COMPACT HEADER ── */
  header {
    height: 36px;
    padding: 0 0.75rem;
  }
  .brand-logo {
    height: 28px;
  }
  .header-center {
    position: static;
    transform: none;
    margin-left: 0.5rem;
  }
  .jubilee-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
  }
  .jubilee-label,
  .header-right {
    display: none;
  }

  /* ── BAND: hidden on mobile ── */
  .das-band {
    display: none;
  }

  /* ── APP LAYOUT: map takes full screen ── */
  .app {
    grid-template-rows: auto 1fr;
  }

  /* ── MAIN: single column, map fills space ── */
  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    position: relative;
  }
  .map-container {
    grid-row: 1;
    grid-column: 1;
  }

  /* ── SIDEBAR TOGGLE: hidden on mobile ── */
  .sidebar-toggle {
    display: none;
  }

  /* ── SIDEBAR as BOTTOM SHEET ── */
  .sidebar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: 100vh;
    height: 100dvh;
    z-index: 800;
    border-right: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    transform: translateY(0);
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
  }
  .sidebar.dragging {
    transition: none;
  }

  /* ── DRAG HANDLE ── */
  .drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
  }
  .drag-handle-bar {
    width: 36px;
    height: 4px;
    background: var(--grey-mid);
    border-radius: 2px;
  }

  /* ── SHEET STATES (controlled via data-sheet attribute) ── */
  .sidebar[data-sheet="peek"] {
    transform: translateY(calc(100% - 80px));
  }
  .sidebar[data-sheet="peek"] .filter-row,
  .sidebar[data-sheet="peek"] .onboarding-hint,
  .sidebar[data-sheet="peek"] .sidebar-views {
    opacity: 0;
    pointer-events: none;
  }

  .sidebar[data-sheet="half"] {
    transform: translateY(55%);
  }

  .sidebar[data-sheet="full"] {
    transform: translateY(8%);
  }

  /* ── SAFE AREA for notched devices ── */
  .sidebar[data-sheet="full"] .detail-view {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* ── SIDEBAR HEADER adjustments ── */
  .sidebar-header {
    padding: 0.5rem 1rem 0.5rem;
  }

  /* ── SIDEBAR VIEWS: fill remaining space ── */
  .sidebar-views {
    height: calc(100vh - 36px);
    overflow: hidden;
  }
  .card-list-view,
  .detail-view {
    height: 100%;
  }

  /* ── FILTER ACCORDION (mobile only) ── */
  .filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--grey-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .filter-toggle-label { flex-shrink: 0; }
  .filter-toggle-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
  }
  .filter-toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: opacity 0.2s;
  }
  .filter-toggle-dot.inactive {
    opacity: 0.25;
  }
  .filter-toggle-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: var(--grey-text);
  }
  .filter-wrap.open .filter-toggle-chevron {
    transform: rotate(180deg);
  }

  .filter-wrap .filter-row {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
  }
  .filter-wrap.open .filter-row {
    max-height: 200px;
    opacity: 1;
  }

  /* ── FILTER CHIPS: larger touch targets ── */
  .chip {
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    font-size: 0.72rem;
  }

  /* ── DETAIL BACK: larger tap area ── */
  .detail-back {
    min-height: 44px;
    padding: 1rem;
  }

  /* ── ZOOM CONTROLS: larger, left side ── */
  .leaflet-control-zoom a {
    width: 48px !important;
    height: 48px !important;
    line-height: 48px !important;
    font-size: 1.4rem !important;
  }

  /* ── ATTRIBUTION: minimal on mobile ── */
  .leaflet-control-attribution {
    font-size: 0 !important;
    padding: 2px 4px !important;
    max-width: 30px;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0.5;
    transition: all 0.2s;
  }
  .leaflet-control-attribution:active {
    font-size: 0.5rem !important;
    max-width: 300px;
    opacity: 1;
  }

  /* ── WIFAM ECK ── */
  .wifam-eck {
    border-width: 0 0 80px 80px;
  }
}
