:root {
    --bg: #f9f9fb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #4f46e5;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.qs-scroll-lock{
    position: fixed;
    width: 100%;
    overflow: hidden;
}

.map-page {
    --qs-map-pad-top: 10px;
    --qs-map-pad-x: 20px;

    display: flex;
    height: calc(100vh - 80px);
    margin-top: 10px;
    padding: 10px 20px 20px;
    gap: 16px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}


.map-sidebar {
    --qs-sidebar-pad: 16px;

    position: relative;

    width: 400px;
    max-width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;

    /* ÄNDERUNG (NEU): Sidebar soll die volle Höhe des Containers nutzen */
    height: 100%;
}

.sidebar-inner {
    overflow: hidden;

    display: flex;
    flex-direction: column;
    height: 100%;

    /* ÄNDERUNG (NEU): wichtig bei verschachteltem flex + overflow */
    min-height: 0;
}

.search-section {
    padding: 18px 72px 16px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 2;
}

.search-block + .search-block {
    margin-top: 12px;
}

.search-block label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;        /* kann bleiben */
    display: flex;
    flex-direction: column;
}

.input-wrapper input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.suggestions {
    position: static;          /* statt absolute -> nimmt Platz im Layout ein */
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 6px;
    max-height: 230px;
    overflow-y: auto;
    z-index: auto;             /* z-index ist hier egal, weil nicht mehr overlay */
}

/* Wichtig: wenn leer, soll es keinen Platz wegnehmen */
.suggestions:empty {
    display: none;
}

/* Suggestion item (Bild + Text) */
.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 14px;

    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: rgba(79, 70, 229, 0.08);
}

.suggestion-thumb {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 auto;
}

.suggestion-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.suggestion-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-meta {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.results-section {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 20px;

    /* ÄNDERUNG (NEU): wichtig, damit der Scrollbereich nicht "klemmt" */
    min-height: 0;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.results-header h2 {
    margin: 0;
    font-size: 18px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    background: var(--card);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.result-card:hover,
.result-card.active {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: rgba(79, 70, 229, 0.35);
}

.result-thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.result-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.result-name {
    font-weight: 700;
    font-size: 15px;
    margin: 0;
    line-height: 1.2;
    color: var(--text);
}

.result-category {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.result-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Detail-Vorschläge Separator */
.results-separator {
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.settings-placeholder{
    flex: 0 0 auto;
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(8, 34, 68, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(244,249,255,0.98) 100%);
}

.map-sidepanel-card{
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(10, 60, 120, 0.10);
    background: rgba(255,255,255,0.92);
    box-shadow: 0 14px 36px rgba(8, 34, 68, 0.08);
}

.map-sidepanel-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 148, 255, 0.16);
    background: rgba(0, 148, 255, 0.08);
    color: #0b3b73;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.settings-placeholder h3 {
    margin: 10px 0 6px;
    font-size: 18px;
    line-height: 1.2;
}

.settings-placeholder p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.map-sidepanel-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:14px;
}

.map-sidepanel-btn{
    min-height: 44px;
    flex: 1 1 160px;
    padding: 12px 14px;
    border-radius: 14px;
    justify-content:center;
    font-weight:800;
    box-shadow:none;
}

.map-sidepanel-btn--primary{
    background:#0b3b73;
    border-color:#0b3b73;
    color:#fff;
}

.map-sidepanel-btn--primary:hover{
    filter:brightness(0.98);
}

.map-main {
    height: 100%;
    min-height: 0;
    flex: 1;
    min-height: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#map {
    height: 100%;
    width: 100%;
}

/* Leaflet Popup */
.leaflet-popup-content {
    margin: 8px;
    max-width: 300px;
}

/* Popup: Grundlayout */
.popup-wrap {
    min-width: 240px;
    max-width: 300px;
    box-sizing: border-box;
}

/* Header: Avatar links, Text Mitte, Icons rechts */
.popup-header {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

/* Avatar */
.popup-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.10);
}

/* Textblock (Name + Kategorie) */
.popup-header-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* Titel */
.popup-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kategorie: nur so breit wie Inhalt */
.popup-category {
    display: inline-flex;
    align-self: flex-start;
    max-width: 100%;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #312e81;
    background: rgba(79, 70, 229, 0.12);
    border-radius: 999px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Icon-Leiste */
.popup-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.popup-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    text-decoration: none;
}

.popup-icon-btn:hover {
    box-shadow: var(--shadow);
}

.popup-icon {
    width: 16px;
    height: 16px;
    display: block;
}

/* Body: Info/Location getrennt */
.popup-line {
    font-size: 14px;
    color: var(--text);
    padding: 8px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.popup-location {
    color: var(--muted);
}

/* Popup Footer CTA */
.popup-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.popup-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.popup-cta:hover {
    filter: brightness(0.95);
    box-shadow: var(--shadow);
}

/* Leaflet eigenes X ausblenden (weil close.png genutzt wird) */
.leaflet-popup-close-button {
    display: none;
}

/* Marker */
.stand-marker .marker-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

.stand-marker .marker-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow);
}

/* Sidebar Toggle Button */
.map-sidebar {
    position: relative; /* für den Button-Anker */
}

.sidebar-toggle {
    display: none; /* nur auf kleinen Geräten */
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Hamburger Icon (3 Striche) */
.sidebar-toggle-hamburger {
    display: none;
    width: 18px;
    height: 14px;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-toggle-hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 999px;
}

.sidebar-toggle-close {
    display: none;
    width: 16px;
    height: 16px;
}

/* Mobile/Tablet Drawer Verhalten (<=1024px) */


/* ===== FINAL: Desktop Sidebar Toggle + Map expand (NUR am Ende ergänzen) ===== */

/* Desktop: Sidebar schiebbar + Map nimmt Platz ein */


.map-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.18);
  z-index: 1400; /* over map, under sidebar */
  display: none;
  transition: opacity 160ms ease;
}
/* =========================================================
   SIDEBAR OPEN (Hamburger) + SIDEBAR CLOSE (X)
   Hamburger: immer über der Map, aber UNTER der Sidebar
   Close: immer oben rechts IN der Sidebar, ÜBER allem
   ========================================================= */

/* Sidebar bleibt über dem Hamburger */
.map-sidebar { z-index: 2000; }
.map-main { position: relative; z-index: 1; }

/* --- Hamburger Button (immer links oben über der Map) --- */
.sidebar-open-btn{
  position: absolute;
  top: calc(var(--qs-map-pad-top, 0px) + 12px);
  left: calc(var(--qs-map-pad-x, 0px) + 12px);
  width: 48px;
  height: 48px;
  border-radius: 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  padding: 0;
  margin: 0;
  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  z-index: 1500; /* UNTER der Sidebar (2000), ÜBER der Map */
}

.sidebar-open-btn img{
  width: 22px;
  height: 22px;
  display: block;
  margin: 0; /* Icon wird per Flex zentriert */
}
.sidebar-open-btn:hover{
  filter: brightness(0.98);
}

.sidebar-open-btn:active{
  transform: translateY(1px);
}

.sidebar-open-btn:focus-visible{
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}


/* --- Close Button (immer rechts oben in Sidebar) --- */
.sidebar-close-btn{
  position: absolute;
  top: var(--qs-sidebar-pad, 16px);
  right: var(--qs-sidebar-pad, 16px);
  width: 44px;
  height: 44px;
  border-radius: 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  padding: 0;
  margin: 0;
  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  z-index: 3000; /* ÜBER Sidebar-Inhalt */
}

.sidebar-close-btn img{
  width: 20px;
  height: 20px;
  display: block;
}
.sidebar-close-btn:hover{
  filter: brightness(0.98);
}

.sidebar-close-btn:active{
  transform: translateY(1px);
}

.sidebar-close-btn:focus-visible{
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}


/* Toggle visibility based on sidebar state */
.map-page.sidebar-open .sidebar-open-btn{ display: none; }
.map-page:not(.sidebar-open) .sidebar-close-btn{ display: none; }


/* --- Sidebar Animation (Desktop) --- */

/* =========================================================
   RESPONSIVE MAP LAYOUT (Rework)
   - Mobile (<768): Drawer + Backdrop (tap on map closes)
   - Tablet (768–1024): Split View (Sidebar left, Map right), no backdrop
   - Desktop (>=1025): Existing behavior (sidebar can collapse), no backdrop
   ========================================================= */

/* Tablet: Split View */
@media (min-width: 768px) and (max-width: 1024px){
  .map-page{
    height: calc(100vh - 80px);
    padding: 10px 16px 16px;
    gap: 14px;
  }

  .map-sidebar{
    position: relative; /* in flow */
    flex: 0 0 360px;
    width: 360px;
    height: 100%;
    transform: translateX(0);
    transition: transform 240ms ease;
    z-index: 2000;
  }

  .map-main{
    flex: 1 1 auto;
    width: auto;
    height: 100%;
    transition: margin-left 240ms ease, width 240ms ease;
  }

  /* Closed state: slide sidebar away AND expand map so no empty stripe remains */
  .map-page:not(.sidebar-open) .map-sidebar{
    transform: translateX(-380px);
  }
  .map-page:not(.sidebar-open) .map-main{
    margin-left: -360px;
    width: calc(100% + 360px);
  }

  /* No backdrop on tablet */
  .map-backdrop{ display:none !important; }
}

/* Mobile: Drawer */
@media (max-width: 767px){
  /* Mobile: Drawer soll wie "Native App" wirken (Abstände + safe-area) */
  .map-page{
    --qs-map-pad-top: 0px;
    --qs-map-pad-x: 0px;

    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
    margin-top: 0;
    padding: 0;
    gap: 0;
  }

  .map-main{
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  /* Drawer: mit Luft oben/unten + rundum abgerundet */
  .map-sidebar{
    --qs-sidebar-pad: 12px;

    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    left: calc(10px + env(safe-area-inset-left));
    bottom: calc(10px + env(safe-area-inset-bottom));

    height: auto;
    width: min(90vw, 360px);
    max-width: 100%;

    transform: translateX(calc(-100% - 14px));
    transition: transform 220ms ease;

    z-index: 2000;
    border-radius: 18px;
    overflow: hidden;

    overscroll-behavior: contain;
  }

  .map-page.sidebar-open .map-sidebar{ transform: translateX(0); }

  /* Buttons: safe-area + sauber */
  .sidebar-open-btn{
    top: calc(var(--qs-map-pad-top, 0px) + 10px + env(safe-area-inset-top));
    left: calc(var(--qs-map-pad-x, 0px) + 10px + env(safe-area-inset-left));
  }

  /* Scroll fühlt sich "native" an */
  .results-section{
    -webkit-overflow-scrolling: touch;
    padding-bottom: 22px;
  }

  /* Wenn Sidebar zu ist: Zoom-Controls nicht unter Hamburger */
  .map-page:not(.sidebar-open) .map-main .leaflet-top.leaflet-left{
    top: calc(76px + env(safe-area-inset-top));
  }

  /* Map spacing when sidebar is CLOSED: map feels like a card (optical space for buttons) */
  .map-page:not(.sidebar-open){
    --qs-map-pad-top: 10px;
    --qs-map-pad-x: 10px;
  }

  .map-page:not(.sidebar-open) .map-main{
    margin: 10px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  /* When sidebar is open, map goes edge-to-edge */
  .map-page.sidebar-open .map-main{
    margin: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }


  .settings-placeholder{
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}





@media (min-width: 1025px){
  .map-sidebar{
    transition: transform 240ms ease;
  }

  .map-page:not(.sidebar-open) .map-sidebar{
    transform: translateX(-420px);
  }

  .map-main{
    transition: margin-left 240ms ease, width 240ms ease;
  }

  .map-page:not(.sidebar-open) .map-main{
    margin-left: -375px;
    width: calc(100% + 375px);
  }
}

/* --- Sidebar Drawer (Mobile) bleibt wie gehabt --- */

/* ----------------------------- */

/* =======================================================================
   RESPONSIVE-ERWEITERUNG (NEU) — nur unterhalb des bestehenden CSS
   Regeln: keine neuen Klassen/IDs, kein JS, kein Inline-CSS, Desktop unverändert
======================================================================= */

/* -----------------------------------------------------------------------
   MOBILE (NEU) — max-width: 480px
   Ziele: volle Breite ab 320px, Touch-Abstände, lesbare Schriftgrößen,
          kein horizontales Scrollen
----------------------------------------------------------------------- */
@media (max-width: 480px) {
  html, body {
    overflow-x: hidden;
  }

  .map-page{
    padding: 0;
    gap: 0;
    margin-top: 0;
  }

  /* Sidebar Drawer: etwas schmaler für sehr kleine Screens */
  .map-sidebar{
    width: min(90vw, 360px);
  }

  .search-section {
    padding: 14px;
    padding-right: 72px; /* Platz für Close */
  }

  .results-section {
    padding: 14px;
  }

  .input-wrapper input {
    font-size: 16px; /* iOS zoom prevention */
  }
}


/* -----------------------------------------------------------------------
   MOBILE (NEU) — max-width: 767px
   Ziele: volle Breite, angenehme Touch-Abstände, kein horizontales Scrollen
----------------------------------------------------------------------- */
@media (max-width: 767px) {

    .map-page {
        padding: 10px 14px 16px;
        gap: 14px;
    }

    .map-main {
        min-height: 360px;
    }

    .map-sidebar {
        width: min(88vw, 400px);
    }

    .search-section,
    .results-section {
        padding: 16px;
    }

    .input-wrapper input {
        font-size: 16px;
        padding: 12px 12px;
    }

    .suggestion-item {
        padding: 12px 12px;
    }

    .result-card {
        grid-template-columns: 46px 1fr auto;
    }

    /* Popup etwas kompakter */
    .leaflet-popup-content {
        max-width: 280px;
    }

    .popup-wrap {
        min-width: 220px;
        max-width: 280px;
    }

    .popup-cta {
        padding: 12px 12px;
    }

    /* Safe-area (iPhone Notch) + cleaner button placement */
    .sidebar-open-btn{
        top: calc(var(--qs-map-pad-top, 0px) + 10px + env(safe-area-inset-top));
        left: calc(var(--qs-map-pad-x, 0px) + 10px + env(safe-area-inset-left));
    }
    .sidebar-close-btn{
        top: calc(12px + env(safe-area-inset-top));
        right: calc(12px + env(safe-area-inset-right));
    }

    .map-sidebar{
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        overscroll-behavior: contain;
    }

    /* Leaflet controls: avoid hamburger overlap (incl. notch) */
    .map-main .leaflet-top.leaflet-left{
        top: calc(70px + env(safe-area-inset-top));
    }
}

/* -----------------------------------------------------------------------
   TABLET (NEU) — max-width: 1024px
   Ziele: Tablet wirkt nicht "gezoomt", stabile Proportionen,
          Desktop bleibt unverändert (nur <=1024 betroffen)
----------------------------------------------------------------------- */
@media (max-width: 1024px) {
    html, body {
        overflow-x: hidden;
    }

    .map-page {
        padding: 10px 18px 18px;
        gap: 16px;
    }

    .map-sidebar {
        border-radius: 16px;
    }

    .map-main {
        border-radius: 16px;
    }

    .search-section,
    .results-section {
        padding: 16px;
    }

    .input-wrapper input {
        font-size: 15px;
    }

    .result-card {
        padding: 12px;
    }

    .leaflet-popup-content {
        max-width: 300px;
    }

    .popup-wrap {
        min-width: 240px;
        max-width: 300px;
    }
}


/* Backdrop: auf Desktop aus */




/* When sidebar is closed, move Leaflet controls down so they don't overlap the hamburger */
.map-page:not(.sidebar-open) .map-main .leaflet-top.leaflet-left{ top: 76px; }



@media (max-width: 1024px){
  /* When sidebar is CLOSED on tablet, align hamburger to map card padding */
  .map-page:not(.sidebar-open){
    --qs-map-pad-top: 10px;
    --qs-map-pad-x: 20px;
  }
}

/* iPad Pro nudge (1024px range): hamburger a few px more inside the map card */
@media (min-width: 1000px) and (max-width: 1024px){
  .map-page:not(.sidebar-open){
    --qs-map-pad-x: 24px;
  }
}


/* =========================================================
   D2 hardening overrides
   - map controls clearer
   - sidepanel actions visible
   - mobile button positions cleaned up
   ========================================================= */

.map-sidepanel-card{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-sidepanel-card h3{
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.2;
    color: #0b2c52;
}

.map-sidepanel-card p{
    margin: 0;
    color: #53657c;
}

.map-sidepanel-actions{
    margin-top: 8px;
}

.map-sidepanel-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(11, 59, 115, 0.14);
    background: #ffffff;
    color: #0b2c52;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(8, 34, 68, 0.08);
}

.map-sidepanel-btn:hover{
    box-shadow: 0 14px 30px rgba(8, 34, 68, 0.12);
    transform: translateY(-1px);
}

.map-sidepanel-btn--primary{
    background: #0b3b73;
    border-color: #0b3b73;
    color: #ffffff;
}

.sidebar-open-btn{
    top: 18px;
    left: 18px;
    z-index: 1800;
}

.sidebar-close-btn{
    top: 14px;
    right: 14px;
    z-index: 3100;
}

.map-main .leaflet-top.leaflet-left{
    top: 18px;
    left: 18px;
}

.map-page:not(.sidebar-open) .map-main .leaflet-top.leaflet-left{
    top: 82px;
}

@media (max-width: 767px){
    .search-section{
        padding: 18px 72px 14px 14px;
    }

    .sidebar-open-btn{
        top: calc(12px + env(safe-area-inset-top));
        left: calc(12px + env(safe-area-inset-left));
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    .sidebar-close-btn{
        top: calc(12px + env(safe-area-inset-top));
        right: calc(12px + env(safe-area-inset-right));
    }

    .map-main .leaflet-top.leaflet-left{
        top: calc(84px + env(safe-area-inset-top));
        left: calc(12px + env(safe-area-inset-left));
    }

    .map-page.sidebar-open .map-main .leaflet-top.leaflet-left{
        top: calc(12px + env(safe-area-inset-top));
        left: calc(12px + env(safe-area-inset-left));
    }

    .map-sidepanel-actions{
        flex-direction: column;
    }

    .map-sidepanel-btn{
        width: 100%;
        flex: 1 1 auto;
    }
}

@media (min-width: 768px){
    .sidebar-open-btn{
        top: 18px;
        left: 18px;
    }

    .map-main .leaflet-top.leaflet-left{
        top: 18px;
        left: 18px;
    }
}


/* =========================================================
   E6 QA closure
   - map controls clearer and accessible
   - sidepanel actions stay visible
   - leaflet controls avoid button collisions
   ========================================================= */
.map-sidepanel-actions .map-sidepanel-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    color:var(--text);
}
.map-sidepanel-actions .map-sidepanel-btn:visited{
    color:inherit;
}
.map-sidepanel-btn--primary,
.map-sidepanel-btn--primary:visited{
    color:#fff;
}
.sidebar-open-btn,
.sidebar-close-btn{
    backdrop-filter:saturate(1.02) blur(10px);
}
.map-page .map-main .leaflet-top.leaflet-left{
    left: 14px;
    top: 90px;
    transition: top 180ms ease, left 180ms ease;
}
.map-page.sidebar-open .map-main .leaflet-top.leaflet-left{
    left: 14px;
    top: 14px;
}
@media (max-width: 1024px){
    .map-page .map-main .leaflet-top.leaflet-left{
        left: 12px;
        top: calc(84px + env(safe-area-inset-top));
    }
    .map-page.sidebar-open .map-main .leaflet-top.leaflet-left{
        top: calc(12px + env(safe-area-inset-top));
    }
}
