/* ============================================================
   OMEDYS CARTOGRAPHIE — Design System v2
   Langage : Glassmorphisme BP3
   Typo    : DM Sans (tout)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

/* ── Tokens ──────────────────────────────────────────────── */
:root {
    --primary:        #009597;
    --primary-glow:   rgba(0, 149, 151, 0.35);
    --primary-dim:    rgba(0, 149, 151, 0.15);

    /* Glass surfaces */
    --glass-bg:       rgba(255, 255, 255, 0.75);
    --glass-bg-deep:  rgba(255, 255, 255, 0.18);
    --glass-border:   rgba(255, 255, 255, 0.18);
    --glass-inset:    rgba(255, 255, 255, 0.08);
    --glass-blur:     blur(28px) saturate(180%);

    /* Shadows */
    --shadow-float:   0 24px 64px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,0.12);
    --shadow-sm:      0 8px 24px rgba(0, 0, 0, 0.12);

    /* Text */
    --text-primary:   rgba(0, 0, 0, 0.88);
    --text-secondary: rgba(0, 0, 0, 0.50);
    --text-muted:     rgba(0, 0, 0, 0.35);

    /* Item surfaces */
    --item-bg:        rgba(255, 255, 255, 0.52);
    --item-bg-hover:  rgba(255, 255, 255, 0.72);
    --item-border:    rgba(255, 255, 255, 0.10);

    /* Select */
    --select-bg:      rgba(255, 255, 255, 0.45);
    --select-border:  rgba(255, 255, 255, 0.20);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body, html {
    margin: 0; padding: 0; height: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-touch-callout: none;
    color-scheme: light dark;
}

.leaflet-container a { color: #fff; }
#map { height: 100vh; width: 100vw; z-index: 1; }

/* ============================================================
   BENTO WRAPPER
   ============================================================ */
.bento-wrapper {
    position: fixed; top: 20px; left: 20px; z-index: 1000;
    display: flex; flex-direction: column; gap: 10px;
    width: 400px; pointer-events: none;
    font-family: 'DM Sans', sans-serif;
}

/* Tuile glass de base — partagée par tous les composants */
.bento-tile {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow-float);
    padding: 14px 16px;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    /* Highlight supérieur façon BP3 */
    background-image: linear-gradient(
        180deg,
        rgba(255,255,255,0.10) 0%,
        transparent 60%
    );
}

/* En mode salles proches, on laisse la tile s'étendre naturellement */
.bento-stats.stats-nearest-mode {
    overflow: visible;
}

/* Lueur d'ambiance dans le coin — comme bp3-header::before */
.bento-tile::before {
    content: '';
    position: absolute; top: -50px; right: -40px;
    width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

.bento-tile > * { position: relative; z-index: 1; }

.bento-row { display: flex; gap: 10px; }

/* ============================================================
   BOUTON HAMBURGER
   ============================================================ */
.bento-action {
    width: 54px; height: 54px; flex-shrink: 0;
    border: none; border-radius: 16px;
    background: var(--primary);
    background-image: linear-gradient(145deg, #00b3b5, #007a7c);
    box-shadow: 0 8px 24px rgba(0,149,151,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 5px;
    cursor: pointer; padding: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    /* pas de ::before hérité */
    overflow: visible;
    background-clip: padding-box;
}
.bento-action::before { display: none; }
.bento-action:hover  { transform: scale(1.04); box-shadow: 0 12px 32px rgba(0,149,151,0.55), inset 0 1px 0 rgba(255,255,255,0.30); }
.bento-action:active { transform: scale(0.95); }

.bar { width: 22px; height: 3px; background: #fff; border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease; }

#menu-btn { pointer-events: auto !important; cursor: pointer !important; }
#menu-btn.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#menu-btn.active .bar:nth-child(2) { opacity: 0; }
#menu-btn.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   STATS
   ============================================================ */
.bento-stats {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; gap: 2px;
    padding: 10px 14px;
    transition: padding 0.2s ease;
}

/* En mode liste, on désactive le centrage vertical */
.bento-stats.stats-nearest-mode {
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
}

.bento-stats small {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    text-transform: none;
}

#site-count {
    display: block;
    font-size: 28px; font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

/* ============================================================
   BARRE DE RECHERCHE
   ============================================================ */
.bento-search {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
}

/* Icône loupe via FA — injectée en JS dans ui.search.js */
.bento-search .fa-magnifying-glass {
    font-size: 15px;
    color: var(--text-secondary);
    flex-shrink: 0;
    position: relative; z-index: 1;
}

.bento-search input {
    flex: 1; border: none; background: transparent; outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    caret-color: var(--primary);
}
.bento-search input::placeholder { color: var(--text-muted); font-weight: 500; }

.inner-search-btn {
    background: rgba(255,255,255,0.35);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    width: 24px; height: 24px;
    font-size: 13px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: background 0.15s;
    flex-shrink: 0;
}
.inner-search-btn:hover { background: rgba(255,255,255,0.55); }

/* ============================================================
   PANNEAU FILTRES
   ============================================================ */
.bento-filters {
    display: none; opacity: 0; transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-height: 0; overflow: hidden;
    padding: 0;
}
.bento-filters.open {
    display: block !important; opacity: 1 !important;
    transform: translateY(0) !important;
    max-height: 620px !important;
    overflow: hidden;
    padding: 14px 16px;
}

.filter-list-wrapper {
    max-height: 590px; overflow-y: auto; overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.filter-list-wrapper::-webkit-scrollbar { width: 4px; }
.filter-list-wrapper::-webkit-scrollbar-track { background: transparent; }
.filter-list-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 4px; }

.filter-section { margin-bottom: 18px; }
.filter-section:last-child { margin-bottom: 0; }

/* Titre de section — style bp3-tile-label */
.section-title {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    margin: 0 0 10px 2px;
    display: flex; align-items: center; gap: 6px;
}

.section-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 6px;
    background: var(--primary-dim); border-radius: 6px;
    font-size: 11px; font-weight: 600; color: var(--primary);
}

.filters-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    margin: 14px 0;
}

.filters-grid { display: flex; flex-direction: column; gap: 6px; }

/* ── Item filtre coloré (checkbox) ── */
.filter-item.color-filter {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px;
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    border-radius: 12px;
    cursor: pointer; user-select: none;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.filter-item.color-filter:hover {
    background: var(--item-bg-hover);
    border-color: rgba(255,255,255,0.25);
}
.filter-item.color-filter.active {
    background: rgba(255,255,255,0.65);
    border-color: var(--primary);
}
.filter-item.color-filter:active { transform: scale(0.98); }

/* ── Item filtre toggle (switch) ── */
.filter-item.toggle-filter {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px;
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    border-radius: 12px;
    cursor: pointer; user-select: none;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.filter-item.toggle-filter:hover {
    background: var(--item-bg-hover);
    border-color: rgba(255,255,255,0.25);
}
.filter-item.toggle-filter.active {
    background: rgba(255,255,255,0.65);
    border-color: var(--primary);
}
.filter-item.toggle-filter:active { transform: scale(0.98); }

/* Dot couleur */
.filter-dot {
    width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
    transition: transform 0.15s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.filter-item.color-filter:hover .filter-dot { transform: scale(1.2); }

/* Contenu texte */
.filter-content { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.filter-label {
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-description {
    font-size: 11px; font-weight: 400;
    color: var(--text-secondary);
}
.filter-item.active .filter-label     { color: #0f766e; }
.filter-item.active .filter-description { color: #0d9488; }

/* Checkbox */
.filter-checkbox {
    width: 20px; height: 20px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.45);
    border: 1.5px solid rgba(255,255,255,0.40);
    border-radius: 6px;
    transition: background 0.15s, border-color 0.15s;
}
.filter-item.color-filter.active .filter-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}
.filter-checkbox::after {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: '\f00c';
    color: white; font-size: 10px;
    opacity: 0; transition: opacity 0.15s;
}
.filter-item.color-filter.active .filter-checkbox::after { opacity: 1; }

/* Toggle switch */
.toggle-switch {
    width: 38px; height: 22px; border-radius: 11px;
    background: rgba(255,255,255,0.30);
    border: 1px solid rgba(255,255,255,0.25);
    position: relative; flex-shrink: 0;
    display: flex; align-items: center;
    justify-content: flex-start; padding: 2px;
    transition: background 0.25s, border-color 0.25s;
}
.toggle-switch::after {
    content: ''; width: 18px; height: 18px;
    background: white;
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.filter-item.toggle-filter.active .toggle-switch {
    background: var(--primary);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(0,149,151,0.4);
}
.filter-item.toggle-filter.active .toggle-switch::after {
    transform: translateX(16px);
    box-shadow: 0 2px 8px rgba(0,149,151,0.35);
}

/* Select géo */
.filter-section select {
    width: 100%; padding: 10px 12px;
    background: var(--select-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--select-border);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px; font-weight: 600;
    color: var(--text-primary);
    cursor: pointer; outline: none;
    -webkit-appearance: none; appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    /* Flèche custom */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23009597' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.filter-section select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}
.filter-section select option { background: #fff; color: #1e293b; }

/* Bouton reset */
.filter-reset-btn {
    width: 100%; padding: 10px;
    background: rgba(255,255,255,0.20);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px; font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer; margin-top: 4px;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.02em;
}
.filter-reset-btn:hover {
    background: rgba(255,255,255,0.38);
    color: var(--text-primary);
}

/* ============================================================
   SUGGESTIONS RECHERCHE
   ============================================================ */
#suggestions {
    position: fixed; top: 72px; left: 20px; width: 400px;
    max-height: 340px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow-float);
    z-index: 2000;
    overflow-y: auto; overflow-x: hidden;
    padding: 6px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.3) transparent;
}
#suggestions:empty { display: none; }
#suggestions::-webkit-scrollbar { width: 4px; }
#suggestions::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 4px; }

.suggestion-item {
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer; user-select: none;
    transition: background 0.12s, transform 0.1s;
    border-bottom: none;
}
.suggestion-item:not(.empty):hover { background: rgba(255,255,255,0.55); }
.suggestion-item:active { background: rgba(255,255,255,0.7); transform: scale(0.99); }
.suggestion-item.empty {
    padding: 20px 16px; text-align: center;
    font-size: 13px; font-weight: 600;
    color: var(--text-muted); cursor: default;
}

.suggestion-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 3px;
}
.suggestion-city {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.suggestion-zip {
    font-size: 11px; font-weight: 600;
    color: var(--primary);
    background: var(--primary-dim);
    padding: 2px 8px; border-radius: 6px;
    flex-shrink: 0; margin-left: 8px;
}
.suggestion-meta { font-size: 11px; color: var(--text-secondary); font-weight: 400; }
.suggestion-province { word-break: break-word; }

/* ============================================================
   MARQUEUR CABINET — divIcon FA + halo pulsé
   ============================================================ */
.cabinet-marker {
    position: relative;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
}

.cabinet-pulse {
    position: absolute;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--cm-color);
    opacity: 0.35;
    animation: cabinet-pulse 2s ease-out infinite;
}

@keyframes cabinet-pulse {
    0%   { transform: scale(0.7); opacity: 0.45; }
    70%  { transform: scale(1.9); opacity: 0;    }
    100% { transform: scale(1.9); opacity: 0;    }
}

.cabinet-pin {
    position: relative; z-index: 1;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--cm-color);
    border: 2.5px solid rgba(255,255,255,0.9);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s;
}
.cabinet-pin i {
    font-size: 14px;
    color: #fff;
}
.cabinet-marker:hover .cabinet-pin { transform: scale(1.12); }
/* ============================================================
   MARQUEUR Salle — divIcon FA + halo pulsé
   ============================================================ */
.salle-marker {
    position: relative;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
}

.salle-pulse {
    position: absolute;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--cm-color);
    opacity: 0.35;
    animation: cabinet-pulse 2s ease-out infinite;
}

@keyframes sallet-pulse {
    0%   { transform: scale(0.7); opacity: 0.45; }
    70%  { transform: scale(1.9); opacity: 0;    }
    100% { transform: scale(1.9); opacity: 0;    }
}

.salle-pin {
    position: relative; z-index: 1;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--cm-color);
    border: 2.5px solid rgba(255,255,255,0.9);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s;
}
.salle-pin i {
    font-size: 10px;
    color: #fff;
}
.salle-marker:hover .salle-pin { transform: scale(1.12); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
#filter-list { animation: slideDown 0.25s ease-out; }

/* ============================================================
   DARK MODE — déclenché par data-theme="dark" sur <html>
   Fallback : @media prefers-color-scheme pour le mode "system"
   ============================================================ */

/* Tokens dark partagés en mixin via un sélecteur commun */
:root[data-theme="dark"],
:root[data-theme="system"]:not([data-theme]) /* jamais utilisé, sécurité */
{ /* vide — les règles sont ci-dessous */ }

/* Sélecteur unique pour dark forcé ET fallback system */
[data-theme="dark"],
@media (prefers-color-scheme: dark) { /* overridé si data-theme="light" */ }

/* ── Variables dark ────────────────────────────────────── */
[data-theme="dark"] {
    --glass-bg:       rgba(10, 18, 35, 0.52);
    --glass-bg-deep:  rgba(10, 18, 35, 0.68);
    --glass-border:   rgba(255, 255, 255, 0.10);
    --glass-inset:    rgba(255, 255, 255, 0.05);
    --shadow-float:   0 24px 64px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
    --text-primary:   rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.48);
    --text-muted:     rgba(255, 255, 255, 0.28);
    --item-bg:        rgba(255, 255, 255, 0.07);
    --item-bg-hover:  rgba(255, 255, 255, 0.12);
    --item-border:    rgba(255, 255, 255, 0.09);
    --select-bg:      rgba(255, 255, 255, 0.07);
    --select-border:  rgba(255, 255, 255, 0.12);
    --primary-glow:   rgba(0, 149, 151, 0.25);
    --primary-dim:    rgba(0, 149, 151, 0.18);
}

/* Fallback système (quand data-theme="system", JS pose dark ou light — mais
   au premier rendu avant JS, le CSS media query prend le relais) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --glass-bg:       rgba(10, 18, 35, 0.52);
        --glass-bg-deep:  rgba(10, 18, 35, 0.68);
        --glass-border:   rgba(255, 255, 255, 0.10);
        --glass-inset:    rgba(255, 255, 255, 0.05);
        --shadow-float:   0 24px 64px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
        --text-primary:   rgba(255, 255, 255, 0.92);
        --text-secondary: rgba(255, 255, 255, 0.48);
        --text-muted:     rgba(255, 255, 255, 0.28);
        --item-bg:        rgba(255, 255, 255, 0.07);
        --item-bg-hover:  rgba(255, 255, 255, 0.12);
        --item-border:    rgba(255, 255, 255, 0.09);
        --select-bg:      rgba(255, 255, 255, 0.07);
        --select-border:  rgba(255, 255, 255, 0.12);
        --primary-glow:   rgba(0, 149, 151, 0.25);
        --primary-dim:    rgba(0, 149, 151, 0.18);
    }
}

/* ── Règles dark (sélecteur réutilisable) ─────────────────── */
[data-theme="dark"] .bento-tile,
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bento-tile { } }

/* On utilise une classe utilitaire .is-dark injectée par theme.js sur <html>
   pour éviter les sélecteurs @media imbriqués non valides en CSS pur.
   → Voir ci-dessous : JS ajoute/retire .is-dark sur <html> */

html.is-dark .bento-tile {
    background-image: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 50%);
}
html.is-dark .filter-item.color-filter.active,
html.is-dark .filter-item.toggle-filter.active {
    background: rgba(0, 0, 0, 0.12); border-color: var(--primary);
}
html.is-dark .filter-item.active .filter-label      { color: #5eead4; }
html.is-dark .filter-item.active .filter-description { color: #2dd4bf; }
html.is-dark .filter-checkbox   { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
html.is-dark .toggle-switch     { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.10); }
html.is-dark .toggle-switch::after { background: rgba(255,255,255,0.80); }
html.is-dark .filter-item.toggle-filter.active .toggle-switch { background: var(--primary); }
html.is-dark .filters-divider   { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent); }
html.is-dark .filter-section select { background-color: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
html.is-dark .filter-section select option { background: #1e293b; color: #f1f5f9; }
html.is-dark .filter-reset-btn  { color: rgba(255,255,255,0.45); }
html.is-dark .filter-reset-btn:hover { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85); }
html.is-dark .suggestion-city   { color: rgba(255,255,255,0.92); }
html.is-dark .suggestion-zip    { background: rgba(0,149,151,0.20); color: #5eead4; }
html.is-dark .suggestion-item:not(.empty):hover { background: rgba(255,255,255,0.08); }
html.is-dark .bento-search input { color: rgba(255,255,255,0.92); }
html.is-dark .bento-search input::placeholder { color: rgba(255,255,255,0.30); }
html.is-dark .bento-search::before { color: rgba(255,255,255,0.40); }

/* Popup BP3 en dark */
html.is-dark .bp3-badge   { color: rgba(255,255,255,0.70); background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.08); }
html.is-dark .bp3-title   { color: rgba(255,255,255,0.92); }
html.is-dark .bp3         { background: rgba(10,18,35,0.55); border-color: rgba(255,255,255,0.08); }
html.is-dark .bp3-header  { border-bottom-color: rgba(255,255,255,0.06); }
html.is-dark .bp3-tile    { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.06); }
html.is-dark .bp3-tile:hover { background: rgba(255,255,255,0.13); }
html.is-dark .bp3-tile-label { color: rgba(255,255,255,0.48); }
html.is-dark .bp3-tile-value { color: rgba(255,255,255,0.88); }
html.is-dark .bp3-link    { color: #5eead4 !important; }
html.is-dark .bp3-link:hover { color: #99f6e4 !important; }
html.is-dark .bp3-btn--copy  { background: rgba(0,149,151,0.18); color: rgba(255,255,255,0.72); }
html.is-dark .bp3-btn--copy:hover { background: rgba(0,149,151,0.30); }
html.is-dark .bp3-mss     { color: rgba(255,255,255,0.65) !important; }
html.is-dark .bp3-pill-ouvert  { background: rgba(0,172,200,0.20); color: #7dd3fc; }
html.is-dark .bp3-pill-encours { background: rgba(255,202,111,0.25); color: #f59e0b; }
html.is-dark .bp3-pill-tele    { background: rgba(153,127,209,0.25); color: #c4b5fd; }
html.is-dark .bp3-pill-default { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.55); }
html.is-dark .bp3-pill-default .bp3-sdot { background: rgba(255,255,255,0.4); }

/* ============================================================
   THEME SWITCHER — intégré dans le panneau filtres
   ============================================================ */

.theme-section {
  margin-bottom: 0;
}

.theme-section .section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.theme-switcher-btns {
  display: flex;
  gap: 6px;
  width: 100%;
}

/* ── Bouton base ──
   On pose color directement ici — pas sur les enfants.
   Les i et span héritent. Plus de guerre de spécificité. */
.theme-btn {
  flex: 1;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  /* Couleur fixe — ne dépend PAS d'un token qui pourrait être blanc */
  color: rgba(0, 0, 0, 0.55);
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
}

.theme-btn:hover  { background: var(--item-bg-hover); }
.theme-btn:active { transform: scale(0.96); }

.theme-btn-icon  { font-size: 12px; }
.theme-btn-label { font-size: 11.5px; font-weight: 600; white-space: nowrap; }

/* ── Actif ── */
.theme-btn.active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Dark mode ── */
html.is-dark .theme-btn,
[data-theme="dark"] .theme-btn {
  color: rgba(255, 255, 255, 0.55);
}

html.is-dark .theme-btn.active,
[data-theme="dark"] .theme-btn.active {
  color: var(--primary);
  background: var(--primary-dim);
  border-color: var(--primary);
}

/* ── Responsive ── */
@media (max-width: 360px) {
  .theme-btn-label { display: none; }
  .theme-btn-icon  { font-size: 14px; }
  .theme-btn       { height: 36px; }
}





/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .bento-wrapper { width: calc(100% - 24px); left: 12px; top: 12px; }
    .bento-tile { border-radius: 16px; padding: 12px 14px; }
    .bento-action { width: 48px; height: 48px; }
    #site-count { font-size: 26px; }
    .bento-filters.open { max-height: 85vh !important; }
    #suggestions { top: 72px; left: 12px; width: calc(100% - 24px); }
}

@media (max-width: 480px) {
    .bento-wrapper { width: calc(100% - 20px); left: 10px; top: 10px; gap: 8px; }
    .bento-tile { border-radius: 14px; padding: 10px 12px; }
    .bento-action { width: 44px; height: 44px; }
    #site-count { font-size: 22px; }
    .bento-search input { font-size: 13px; }
    .filter-item.color-filter, .filter-item.toggle-filter { padding: 10px; gap: 8px; }
    .filter-label { font-size: 11px; }
    .filter-description { font-size: 10px; }
    .toggle-switch { width: 34px; height: 20px; }
    .toggle-switch::after { width: 16px; height: 16px; }
    .filter-item.toggle-filter.active .toggle-switch::after { transform: translateX(14px); }
    .bar { width: 18px; height: 2.5px; }
    #suggestions { top: 66px; left: 10px; width: calc(100% - 20px); }
}

@media (max-width: 360px) {
    .bento-wrapper { width: calc(100% - 16px); left: 8px; gap: 6px; }
    .bento-tile { border-radius: 12px; padding: 9px 11px; }
    #site-count { font-size: 20px; }
    .bp3 { width: 280px; }
    .bp3-popup .leaflet-popup-content { width: 280px !important; }
}
/* ════════════════════════════════════════════════════════════════
   SEARCH PIN — marker temporaire posé lors d'une recherche
   ════════════════════════════════════════════════════════════════ */

.search-pin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.search-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  background: var(--primary, #009597);
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0,149,151,.5);
  animation: pin-drop .35s cubic-bezier(.34,1.56,.64,1) both;
}

.search-pin-label {
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--primary, #009597);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,149,151,.35);
  animation: pin-label-in .25s .1s ease both;
}

@keyframes pin-drop {
  from { transform: rotate(-45deg) scale(0) translateY(-12px); opacity: 0; }
  to   { transform: rotate(-45deg) scale(1) translateY(0);     opacity: 1; }
}

@keyframes pin-label-in {
  from { opacity: 0; transform: translateY(4px) scale(.9); }
  to   { opacity: 1; transform: translateY(0)   scale(1);  }
}

/* ════════════════════════════════════════════════════════════════
   STATS TILE — mode "salles proches"
   ════════════════════════════════════════════════════════════════ */

.nearest-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.nearest-header i {
  color: var(--primary);
  font-size: 12px;
}

.nearest-header strong {
  color: var(--text-primary);
  font-weight: 700;
  text-transform: none;
}

.nearest-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.nearest-list::-webkit-scrollbar        { width: 4px; }
.nearest-list::-webkit-scrollbar-track  { background: transparent; }
.nearest-list::-webkit-scrollbar-thumb  { background: var(--glass-border); border-radius: 2px; }

.nearest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--item-bg, rgba(255,255,255,.08));
  cursor: pointer;
  transition: background .15s, transform .1s;
  border-bottom: none;
}

.nearest-item:hover {
  background: rgba(0,149,151,.12);
  transform: translateX(2px);
}

.nearest-rank {
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nearest-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

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

.nearest-city {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearest-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nearest-dist {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.nearest-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Dark mode — nearest items */
html.is-dark .nearest-item,
[data-theme="dark"] .nearest-item {
  background: rgba(255,255,255,.06);
}

html.is-dark .nearest-item:hover,
[data-theme="dark"] .nearest-item:hover {
  background: rgba(0,149,151,.18);
}