
        @keyframes blink {
            0%, 100% { opacity: 1; }
            50%       { opacity: 0.2; }
        }

        /* ── LEYENDA DINÁMICA (oculto — navegación movida al sidebar) ── */
        #map-legend-btn { display: none !important; }

        /* ── FAB Transport (movido al sidebar) ────────────────────── */
        #map-transport-fab { display: none !important; }

        /* ── FAB Bar flotante vertical: CUADERNOS / BUSCAR / AYUDA ── */
        .map-fab {
            position: fixed;
            right: 10px;
            z-index: 1001;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 7px;
            padding: 0 11px;
            height: 38px;
            min-width: 38px;
            background: #1B3B6F;
            color: #fff !important;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            box-shadow: 0 2px 12px rgba(0,0,0,0.22);
            text-decoration: none !important;
            transition: box-shadow 0.2s, transform 0.15s;
            white-space: nowrap;
        }
        .map-fab .fab-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
        .map-fab .fab-lbl {
            font-family: Arial Black, Arial, sans-serif;
            font-weight: 900;
            letter-spacing: 1px;
            font-size: 11px;
        }
        .map-fab:hover {
            box-shadow: 0 5px 18px rgba(0,0,0,0.28);
            transform: translateY(-1px);
        }
        #map-cuaderno-fab   { bottom: 194px; }
        #mapita-locality-fab { bottom: 146px; }
        #mapita-map-watermark { bottom: 98px; }

        /* ── Candado de acceso restringido ────────────────────────── */
        .restricted-lock-badge {
            font-size: 11px;
            vertical-align: middle;
            opacity: 0.7;
            margin-left: 2px;
            pointer-events: none;
        }

        /* ── Modal PIN restringido ─────────────────────────────────── */
        #restricted-pin-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.55);
            z-index: 99999;
            align-items: center;
            justify-content: center;
        }
        #restricted-pin-overlay.open { display: flex; }
        #restricted-pin-box {
            background: #fff;
            border-radius: 16px;
            padding: 32px 28px 24px;
            max-width: 360px;
            width: 90%;
            box-shadow: 0 8px 32px rgba(0,0,0,0.22);
            text-align: center;
            position: relative;
        }
        #restricted-pin-box h2 {
            margin: 0 0 6px;
            font-size: 1.1rem;
            color: #1b3b6f;
        }
        #restricted-pin-box p {
            font-size: 13px;
            color: #64748b;
            margin: 0 0 20px;
        }
        #restricted-pin-input {
            width: 100%;
            padding: 10px 14px;
            border: 2px solid #cbd5e1;
            border-radius: 9px;
            font-size: 15px;
            text-align: center;
            letter-spacing: 2px;
            outline: none;
            transition: border-color .2s;
        }
        #restricted-pin-input:focus { border-color: #3b82f6; }
        #restricted-pin-error {
            color: #dc2626;
            font-size: 12px;
            font-weight: 700;
            margin-top: 8px;
            min-height: 18px;
        }
        #restricted-pin-actions {
            display: flex;
            gap: 10px;
            margin-top: 18px;
            justify-content: center;
        }
        .rp-btn {
            padding: 9px 22px;
            border-radius: 8px;
            border: none;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: opacity .15s;
        }
        .rp-btn:hover { opacity: .85; }
        .rp-btn-confirm { background: #1b3b6f; color: #fff; }
        .rp-btn-cancel  { background: #f1f5f9; color: #475569; }

        /* ── FAB UBICARME: desactivado — función disponible en el panel de localidad ── */
        #map-ubicarme-fab { display: none !important; }

        #map-legend {
            position: absolute;
            bottom: 118px;
            right: 10px;
            z-index: 1001;
            background: rgba(255,255,255,0.97);
            border-radius: 12px;
            padding: 14px 16px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.18);
            max-width: 240px;
            min-width: 190px;
            max-height: 60vh;
            overflow-y: auto;
            display: none;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            animation: legendFadeIn 0.2s ease;
        }
        @keyframes legendFadeIn {
            from { opacity:0; transform:translateY(6px); }
            to   { opacity:1; transform:translateY(0);   }
        }
        #map-legend h4 { margin: 0 0 8px; font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
        .legend-item { display:flex; align-items:center; gap:8px; padding:3px 0; font-size:12px; color:#374151; }
        .legend-rel-line { width:22px; height:0; flex-shrink:0; }
        hr.legend-divider { border:none; border-top:1px solid #e5e7eb; margin:8px 0; }

        /* ── TEMPORAL BADGES ────────────────────────────────────────── */
        .mapita-temporal-wrapper { position:relative; display:inline-block; }
        .mapita-temporal-badge {
            position: absolute;
            top: -5px;
            right: -6px;
            background: #e74c3c;
            color: white;
            border-radius: 7px;
            padding: 1px 5px;
            font-size: 8px;
            font-weight: 800;
            line-height: 14px;
            white-space: nowrap;
            border: 1.5px solid white;
            box-shadow: 0 1px 4px rgba(0,0,0,0.3);
            pointer-events: none;
            letter-spacing: 0.3px;
        }
        .mapita-temporal-badge.urgent { background:#e74c3c; animation:badgePulse 1.4s infinite; }
        .mapita-temporal-badge.soon   { background:#f39c12; }
        .mapita-temporal-badge.info   { background:#667eea; }
        @keyframes badgePulse {
            0%, 100% { transform:scale(1); opacity:1; }
            50%      { transform:scale(1.12); opacity:0.85; }
        }

        /* ── MINI HOVER CONTEXT PANEL ───────────────────────────────── */
        #map-ctx-panel {
            position: fixed;
            z-index: 1100;
            background: rgba(15,23,42,0.91);
            color: white;
            border-radius: 10px;
            padding: 9px 13px;
            font-size: 12px;
            pointer-events: none;
            max-width: 210px;
            box-shadow: 0 4px 18px rgba(0,0,0,0.32);
            transition: opacity 0.15s;
            opacity: 0;
            line-height: 1.5;
        }
        #map-ctx-panel.visible { opacity: 1; }
        #map-ctx-panel .ctx-name { font-weight:700; font-size:13px; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        #map-ctx-panel .ctx-type { font-size:10px; color:rgba(255,255,255,0.6); margin-bottom:4px; }
        #map-ctx-panel .ctx-badge {
            display:inline-block;
            background:rgba(255,255,255,0.14);
            border-radius:5px;
            padding:1px 6px;
            font-size:10px;
            margin:2px 2px 0 0;
        }

        /* Variables locales del mapa — Aceternity / Magic UI Dark Theme */
        :root {
            --success:     #10b981;
            --warning:     #f59e0b;
            --danger:      #ef4444;
            --info:        #0ea5e9;
            --bg-base:     #030914;
            --bg-surface:  rgba(10, 15, 30, 0.6);
            --bg-card:     rgba(15, 23, 42, 0.7);
            --border-glow: rgba(102, 126, 234, 0.4);
            --border-light:rgba(255, 255, 255, 0.08);
            --text-pri:    #f8fafc;
            --text-sec:    #cbd5e1;
            --text-muted:  #64748b;
            --primary:     #667eea;
            --primary-dark:#5a6fd1;
        }

        * { box-sizing: border-box; }
        body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; display: flex; flex-direction: row; height: 100vh; background: var(--bg-base); }

        /* ── Sidebar (Bento Grid / Glassmorphism) ────────────────────────────── */
        #sidebar {
            width: var(--sidebar-width);
            padding: 16px;
            background: var(--bg-surface);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            color: var(--text-pri);
            overflow-y: auto;
            border-right: 1px solid var(--border-light);
            box-shadow: none;
            transition: transform var(--transition-base), left var(--transition-base);
            z-index: var(--z-fixed);
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        #sidebar::-webkit-scrollbar { width: 6px; }
        #sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
        #sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
        
        #togglePanel {
            display: none;
            position: fixed;
            top: 56px;
            left: 8px;
            z-index: 1100;
            background: var(--primary, #1B3B6F);
            color: white;
            border: none;
            border-radius: 8px;
            width: 36px; height: 36px;
            font-size: 18px; line-height: 1;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0,0,0,.3);
        }

        #togglePanel:hover {
            background: var(--primary-dark, #0d2247);
            transform: translateY(-1px);
        }
        
        #map {
            flex: 1;
            height: 100%;
            min-height: 0; /* fix flex child height in some browsers */
        }
        
        /* ── RESPONSIVE: Tablet (≤768px) ────────────────────────── */
        @media (max-width: 768px) {
            #sidebar {
                position: fixed;
                top: 44px; left: -260px;
                width: 260px;
                height: calc(100vh - 44px);
                border-right: none;
                box-shadow: 2px 0 12px rgba(0,0,0,0.15);
                z-index: 900;
            }
            #sidebar.active { left: 0; }

            #togglePanel {
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }

        /* ── RESPONSIVE: Mobile (≤480px) ────────────────────────── */
        @media (max-width: 480px) {
            #sidebar { width: 75vw; max-width: 260px; left: -75vw; }
            #sidebar.active { left: 0; }
        }

        /* ── Backdrop (overlay real click-to-close) ───────────────── */
        #sidebar-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.45);
            z-index: 850;
            touch-action: none;
        }
        #sidebar-backdrop.active { display: block; }

        /* ── Botón de cierre dentro del sidebar ───────────────────── */
        #sidebar-close-btn {
            display: none;
            width: 30px;
            height: 30px;
            flex-shrink: 0;
            margin-left: 4px;
            border: 1.5px solid #dde2f0;
            border-radius: 8px;
            background: white;
            cursor: pointer;
            color: #667eea;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
            padding: 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.08);
            font-size: 16px;
            font-weight: 700;
            line-height: 1;
        }
        #sidebar-close-btn:hover {
            background: #e74c3c;
            color: white;
            border-color: #e74c3c;
            box-shadow: 0 2px 8px rgba(231,76,60,0.3);
        }
        @media (max-width: 768px) {
            #sidebar-close-btn { display: flex; }
        }

        /* ── Floating selector / ver-selector — oculto (nav N/C/D está en nav_mapas.php) ── */
        #ver-selector { display: none !important; }

        /* ── Botones icono de capas (🚛 ✈️ 💹) ──────────────────────── */
        .capa-btn {
            flex: 1; padding: 7px 4px; border: 1px solid var(--border-light); border-radius: 12px;
            font-size: 18px; cursor: pointer; background: rgba(255,255,255,0.04); text-align: center;
            transition: all .2s ease; line-height: 1;
            backdrop-filter: blur(4px);
        }
        .capa-btn.capa-off {
            background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); opacity: .7;
            filter: grayscale(1);
        }
        .capa-btn:hover { border-color: var(--primary); background: rgba(102, 126, 234, 0.1); transform: translateY(-2px); }

        /* ── Sidebar Bento Cards ─────────────────────────── */
        .sidebar-card {
            background: var(--bg-card); border-radius: 1.25rem; padding: 14px 16px;
            margin-bottom: 0; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
            border: 1px solid var(--border-light);
            transition: all 0.2s ease;
        }
        .sidebar-card:hover { border-color: var(--border-glow); }
        .sidebar-card-label {
            font-size: 10px; font-weight: 700; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.8px;
            margin-bottom: 10px; display: block;
        }
        .home-contact-card {
            display: inline-flex; align-items: center; gap: 6px;
            background: linear-gradient(135deg, #1B3B6F, #2E5FA3);
            border-radius: 20px; padding: 6px 14px 6px 10px;
            margin-bottom: 8px; text-decoration: none;
            font-size: 12px; font-weight: 700; color: #fff;
            letter-spacing: 0.3px; white-space: nowrap;
            box-shadow: 0 4px 12px rgba(27, 59, 111, 0.4);
            transition: all 0.2s;
        }
        .home-contact-card:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5); }
        
        .quickstart-panel {
            border-left: 4px solid var(--primary);
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(15, 23, 42, 0.4) 100%);
            border-radius: 12px;
            padding: 12px;
        }
        .quickstart-panel__title {
            margin: 0 0 8px; font-size: 14px; color: var(--text-pri); font-weight: 800;
            background: linear-gradient(90deg, #fff, #cbd5e1);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
        }
        .quickstart-panel__intro { margin: 0 0 8px; font-size: 12px; color: var(--text-sec); line-height: 1.45; }
        .quickstart-panel__list { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text-sec); line-height: 1.5; }
        
        .section-header {
            font-size: 10px; font-weight: 700; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.8px;
            padding: 8px 4px 4px; margin: 0;
        }
        #stats { font-size: 11px; font-weight: 700; color: var(--primary); }

        /* ── Shimmer & Glow Effects (Magic UI Style) ───────────────── */
        .shimmer-btn {
            position: relative; overflow: hidden;
            background: rgba(102, 126, 234, 0.15); border: 1px solid rgba(102, 126, 234, 0.4);
            color: #fff; border-radius: 12px;
            transition: all 0.2s ease;
        }
        .shimmer-btn::before {
            content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
            transform: rotate(45deg); animation: shimmer 2.5s infinite;
        }
        @keyframes shimmer { 0% { transform: translateX(-100%) rotate(45deg); } 100% { transform: translateX(100%) rotate(45deg); } }
        .shimmer-btn:hover { background: rgba(102, 126, 234, 0.3); box-shadow: 0 0 15px rgba(102, 126, 234, 0.4); }

        /* ── Animated List Items (Aceternity Style) ────────────────── */
        #lista .negocio, #lista .marca {
            border-radius: 12px; padding: 12px; margin-bottom: 8px;
            border: 1px solid var(--border-light);
            background: rgba(255, 255, 255, 0.03);
            color: var(--text-pri);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            cursor: pointer; transition: all 0.2s ease;
            line-height: 1.45; word-break: break-word; overflow-wrap: break-word;
            opacity: 0; transform: translateY(10px);
            animation: staggerIn 0.3s forwards ease-out;
        }
        @keyframes staggerIn { to { opacity: 1; transform: translateY(0); } }
        #lista .negocio:hover, #lista .marca:hover { 
            box-shadow: 0 8px 24px rgba(0,0,0,0.2); 
            border-color: var(--border-glow);
            transform: translateY(-2px) scale(1.01);
            background: rgba(255, 255, 255, 0.06);
        }
        #lista .marca { background: rgba(139, 92, 246, 0.08); border-color: rgba(139, 92, 246, 0.2); }
        #lista .marca:hover { border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.15); }

        /* ── Responsive: sidebar item spacing on mobile ──────────── */
        @media (max-width: 768px) {
            #lista .negocio, #lista .marca {
                padding: 9px 10px;
                line-height: 1.5;
            }
            #lista .negocio strong, #lista .marca strong {
                display: block;
                font-size: 13px;
                line-height: 1.3;
                margin-bottom: 2px;
                white-space: normal;
            }
            #lista .negocio span, #lista .marca span {
                display: block;
                font-size: 11.5px;
                line-height: 1.35;
                margin-top: 2px;
            }
            #lista .negocio small, #lista .marca small {
                display: block;
                font-size: 11px;
                line-height: 1.3;
                margin-top: 2px;
            }
            /* Sidebar auth buttons: prevent emoji+text wrap */
            .sidebar-card button {
                line-height: 1.35;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            /* Accordion labels: better wrapping */
            .accordion-content label {
                line-height: 1.4;
                padding: 5px 4px;
            }
        }

        /* ── Generic inputs/buttons reset (solo sidebar) ─────────── */
        #sidebar select, #sidebar input[type="text"], #sidebar input[type="range"] {
            width: 100%; padding: 10px 12px; margin-bottom: 10px; font-size: 13px;
            background: rgba(255,255,255,0.05); border: 1px solid var(--border-light);
            color: var(--text-pri); border-radius: 8px;
            transition: all 0.2s ease;
        }
        #sidebar select option { background: var(--bg-card); color: var(--text-pri); }
        #sidebar input[type="text"]:focus, #sidebar select:focus {
            outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
        }

        /* (ver-selector responsive ya definido arriba) */

        /* ── Selector / Consultar: comportamiento estándar igual al resto de secciones ─── */
        .selector-mobile-notice { display: none; }

        /* ── Open/Closed badge ─────────────────────── */
        .badge-open   { background: #d4edda; color: #155724; border-radius: 20px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
        .badge-closed { background: #f8d7da; color: #721c24; border-radius: 20px; padding: 2px 8px; font-size: 11px; font-weight: 600; }

        /* ── Section info panels ────────────────────── */
        .sb-info-panel {
            background: rgba(102, 126, 234, 0.1);
            border-left: 3px solid var(--primary);
            border-radius: 0 8px 8px 0;
            padding: 10px 12px;
            font-size: 12px;
            color: var(--text-sec);
            line-height: 1.5;
            margin-bottom: 10px;
        }
        .sb-info-btn {
            background: rgba(255,255,255,0.08);
            border: 1px solid var(--border-light);
            color: var(--text-sec);
            cursor: pointer;
            font-size: 12px;
            line-height: 1;
            padding: 4px 6px;
            border-radius: 6px;
            transition: all 0.15s;
            flex-shrink: 0;
        }
        .sb-info-btn:hover { background: rgba(102, 126, 234, 0.2); color: #fff; }

        /* ── Location mode toggle ────────────────────── */
        .loc-mode-row {
            display: flex; gap: 6px;
            background: rgba(0,0,0,0.2);
            border-radius: 10px; padding: 4px;
        }
        .loc-mode-btn {
            flex: 1; padding: 8px 10px; border: none; border-radius: 8px;
            font-size: 12px; font-weight: 600; cursor: pointer;
            background: transparent; color: var(--text-sec);
            transition: all 0.2s;
        }
        .loc-mode-btn--active {
            background: var(--primary); color: white;
            box-shadow: 0 2px 10px rgba(102,126,234,0.4);
        }

        /* ── Accordion filters (Bento dark mode) ──────────────────────── */
        .accordion-item { border-bottom: 1px solid var(--border-light); }
        .accordion-item:last-child { border-bottom: none; }
        .accordion-btn {
            width: 100%; text-align: left; padding: 14px 16px;
            background: transparent; border: none; cursor: pointer;
            font-weight: 600; font-size: 12px; text-transform: uppercase;
            color: var(--text-pri); letter-spacing: 0.5px;
            transition: all 0.2s; display: flex; justify-content: space-between; align-items: center;
            line-height: 1.4;
        }
        .accordion-btn:hover { background: rgba(255,255,255,0.03); }
        .accordion-btn.active { background: rgba(102, 126, 234, 0.15); color: #fff; border-radius: 8px; }

        .accordion-content {
            padding: 0; max-height: 0; overflow: hidden;
            transition: max-height 0.3s ease, padding 0.3s ease;
            background: transparent;
        }
        .accordion-content.active {
            max-height: 500px; padding: 14px 16px;
        }

        /* Checkboxes profesionales */
        .accordion-content input[type="checkbox"],
        .accordion-content input[type="radio"] {
            width: 18px; height: 18px; min-width: 18px; min-height: 18px;
            margin-right: 10px; margin-top: 1px; cursor: pointer;
            accent-color: var(--primary); flex-shrink: 0;
            background: rgba(255,255,255,0.1); border: 1px solid var(--border-light);
        }

        /* Labels con mejor espaciado y alineación */
        .accordion-content label {
            display: flex;
            align-items: center; justify-content: flex-start;
            margin-bottom: 9px; font-size: 13px; color: var(--text-sec);
            cursor: pointer; padding: 6px 8px; border-radius: 6px;
            transition: all 0.2s ease; line-height: 1.5; user-select: none;
        }
        .accordion-content label:hover {
            background-color: rgba(255,255,255,0.05); color: #fff;
        }
        .accordion-content label:last-child { margin-bottom: 0; }
        .filter-radius-slider {
            width: 100%;
            margin: 10px 0;
            cursor: pointer;
            accent-color: #667eea;
            height: 6px;
        }
        .filter-location-autocomplete {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid #d0d5dd;
            border-radius: 6px;
            margin-bottom: 10px;
            font-size: 13px;
            font-family: inherit;
            color: #374151;
            transition: all 0.2s ease;
        }
        .filter-location-autocomplete:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        .filter-location-autocomplete::placeholder {
            color: #9ca3af;
        }

        /* ── MAPITA brand typography (shared by toggle + watermark) ── */
        .mapita-wordmark {
            font-family: Arial Black, Arial, sans-serif;
            font-weight: 900;
            letter-spacing: 1.5px;
            font-size: 11px;
        }

        #mapita-map-watermark {
            user-select: none;
        }
        #mapita-map-watermark:hover {
            box-shadow: 0 5px 18px rgba(0,0,0,0.28) !important;
            transform: translateY(-1px);
        }
        #mapita-map-watermark:focus-visible {
            outline: 2px solid #fff;
            outline-offset: 2px;
        }

        #mapita-home-panel {
            position: fixed;
            bottom: 250px; right: 10px; z-index: 1002;
            width: min(340px, calc(100vw - 24px)); max-height: min(70vh, 520px);
            overflow-y: auto; display: none;
            border-radius: 1.25rem;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
            background: var(--bg-card);
            backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--border-light);
            border-left: 4px solid var(--primary);
            padding: 16px;
            color: var(--text-pri);
        }
        #mapita-home-panel.is-open { display: block; animation: modalIn 0.3s ease-out forwards; }
        @keyframes modalIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
        .mapita-home-panel__header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
        }
        .mapita-home-panel__close {
            margin: 0;
            border: none;
            width: 26px;
            height: 26px;
            border-radius: 999px;
            background: #e9ecfb;
            color: #1B3B6F;
            font-weight: 800;
            cursor: pointer;
            line-height: 1;
            padding: 0;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }
        .mapita-home-panel__close:hover {
            background: #d9dffa;
        }
        #mapita-home-panel .quickstart-panel__list li {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 8px;
        }
        .quickstart-help-btn {
            border: 1px solid #c8d0f2;
            background: #eef2ff;
            color: #1B3B6F;
            width: 20px;
            height: 20px;
            border-radius: 999px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 800;
            line-height: 1;
            flex: 0 0 20px;
            margin-top: 1px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }
        .quickstart-help-btn:hover {
            background: #e2e8ff;
        }
        .quickstart-help-btn:focus-visible {
            outline: 2px solid #1B3B6F;
            outline-offset: 2px;
        }
        .quickstart-help-modal {
            position: fixed;
            inset: 0;
            z-index: 1200;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(15, 23, 42, 0.45);
            padding: 16px;
        }
        .quickstart-help-modal.is-open {
            display: flex;
        }
        .quickstart-help-modal__dialog {
            width: min(440px, calc(100vw - 24px));
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 12px 30px rgba(0,0,0,0.25);
            padding: 16px 16px 14px;
            position: relative;
        }
        .quickstart-help-modal__dialog h4 {
            margin: 0 28px 8px 0;
            font-size: 16px;
            color: #1B3B6F;
        }
        .quickstart-help-modal__dialog p {
            margin: 0;
            color: #334155;
            font-size: 13px;
            line-height: 1.5;
        }
        .quickstart-help-modal__close {
            position: absolute;
            top: 10px;
            right: 10px;
            margin: 0;
            border: none;
            width: 26px;
            height: 26px;
            border-radius: 999px;
            background: #e9ecfb;
            color: #1B3B6F;
            font-weight: 800;
            cursor: pointer;
            line-height: 1;
            padding: 0;
        }
        .quickstart-help-modal__close:hover {
            background: #d9dffa;
        }
        .quickstart-help-modal__close:focus-visible {
            outline: 2px solid #1B3B6F;
            outline-offset: 2px;
        }

        /* ── HOME PANEL responsive overrides ────────────────────────── */
        @media (max-width: 480px) {
            #mapita-home-panel {
                width: calc(100vw - 20px);
                max-height: min(54vh, 360px);
                padding: 10px 10px 10px;
                right: 10px;
                bottom: 120px;
            }
            .mapita-home-panel__header {
                margin-bottom: 5px;
            }
            /* Hide redundant overline label; the h3 already identifies the panel */
            #mapita-home-panel .sidebar-card-label {
                display: none;
            }
            .mapita-home-panel__close {
                width: 34px;
                height: 34px;
                flex: 0 0 34px;
                font-size: 14px;
            }
            .quickstart-panel__title {
                font-size: 13px;
            }
            .quickstart-panel__intro {
                font-size: 11px;
                margin-bottom: 5px;
            }
            .quickstart-panel__list {
                font-size: 11px;
                padding-left: 14px;
            }
            #mapita-home-panel .quickstart-panel__list li {
                gap: 8px;
                padding: 3px 0;
            }
            .quickstart-help-btn {
                width: 34px;
                height: 34px;
                flex: 0 0 34px;
                font-size: 14px;
            }
        }



        /* ── MULTITUDES float panel ─────────────────────────────────── */
        #mt-float-panel {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 5000;
            background: #fff;
            border-radius: 14px;
            box-shadow: 0 8px 32px rgba(79,70,229,0.28);
            display: none;
            flex-direction: column;
            width: 400px;
            max-width: calc(100vw - 32px);
            max-height: 80vh;
            overflow: hidden;
            font-family: inherit;
        }
        #mt-float-panel.is-minimized { width: 300px; border-radius: 8px; }
        #mt-float-panel.is-minimized .mt-panel-body { display: none; }
        #mt-float-panel-header {
            background: linear-gradient(135deg, #2d47a5, #d20c0c);
            color: white;
            padding: 11px 14px;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: move;
            user-select: none;
            min-width: 0;
            flex-shrink: 0;
        }
        #mt-float-panel-title {
            flex: 1;
            font-size: 13px;
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }
        .mt-panel-btn {
            background: rgba(255,255,255,0.18);
            border: none;
            color: white;
            cursor: pointer;
            border-radius: 4px;
            width: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
            transition: background 0.15s;
        }
        .mt-panel-btn:hover { background: rgba(255,255,255,0.32); }
        .mt-panel-body {
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
        }
        .mt-panel-desc {
            margin: 0;
            padding: 10px 14px 4px;
            font-size: 12px;
            color: #6b7280;
            border-bottom: 1px solid #ede9fe;
            flex-shrink: 0;
        }
        /* Sort tabs */
        .mt-sort-tabs {
            display: flex;
            gap: 6px;
            padding: 8px 14px;
            border-bottom: 1px solid #ede9fe;
            flex-shrink: 0;
            background: #f5f3ff;
        }
        .mt-sort-tab {
            padding: 4px 11px;
            border: 1px solid #c4b5fd;
            border-radius: 20px;
            background: #fff;
            color: #4f46e5;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            transition: all .15s;
        }
        .mt-sort-tab:hover { background: #ede9fe; }
        .mt-sort-tab.mt-tab-active { background: #4f46e5; color: #fff; border-color: #3730a3; }
        /* Items list */
        .mt-items-list {
            overflow-y: auto;
            padding: 8px 10px;
            flex: 1;
        }
        .mt-item {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 10px 12px;
            background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
            border: 1px solid #c4b5fd;
            border-radius: 8px;
            margin-bottom: 7px;
            cursor: pointer;
            transition: box-shadow 0.15s, transform 0.15s;
            text-decoration: none;
        }
        .mt-item:hover { box-shadow: 0 4px 14px rgba(79,70,229,0.22); transform: translateY(-1px); }
        .mt-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
        .mt-item-body { flex: 1; min-width: 0; }
        .mt-item-title { font-size: 13px; font-weight: 700; color: #1e1b4b; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .mt-item-meta  { font-size: 11px; color: #6b7280; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
        .mt-item-desc  { font-size: 11px; color: #7c3aed; }
        .mt-item-arrow { font-size: 14px; color: #7c3aed; align-self: center; flex-shrink: 0; }
        .mt-item-yt-badge { display:inline-block; background:#ff0000; color:#fff; font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; margin-left:6px; vertical-align:middle; letter-spacing:.3px; }
        /* Empty state */
        .mt-empty { padding: 20px; text-align: center; color: #9ca3af; font-size: 13px; }

        /* ── YouTube Floating Video Panel ── */
        /* Panel is fixed-size floating window; map behind it stays fully interactive */
        #yt-float-panel {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 10500;
            width: 420px;
            height: 276px; /* 40px header + 236px body (16:9 of 420px) */
            min-width: 280px;
            min-height: 40px;
            background: #111;
            border-radius: 10px;
            box-shadow: 0 8px 40px rgba(0,0,0,0.65);
            display: none;
            flex-direction: column;
            overflow: hidden;
            font-family: inherit;
        }
        /* Minimized: only show header */
        #yt-float-panel.is-minimized { height: auto; }
        #yt-float-panel.is-minimized #yt-float-body { display: none; }
        /* Drag handle / header */
        #yt-float-header {
            background: linear-gradient(135deg, #1e1b4b, #312e81);
            color: #fff;
            padding: 7px 10px;
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: move;
            user-select: none;
            flex-shrink: 0;
            min-height: 40px;
        }
        #yt-float-title {
            flex: 1;
            font-size: 12px;
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }
        .yt-float-btn {
            background: rgba(255,255,255,0.18);
            border: none;
            color: #fff;
            cursor: pointer;
            border-radius: 4px;
            width: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            flex-shrink: 0;
            transition: background 0.15s;
            line-height: 1;
        }
        .yt-float-btn:hover        { background: rgba(255,255,255,0.32); }
        .yt-float-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
        /* Video body: fills remaining height */
        #yt-float-body {
            flex: 1;
            background: #000;
            overflow: hidden;
            position: relative;
            min-height: 0;
        }
        #yt-video-iframe {
            width: 100%;
            height: 100%;
            border: none;
            display: block;
        }
        /* Bottom-right corner drag-to-resize handle */
        #yt-float-resize {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 20px;
            height: 20px;
            cursor: nwse-resize;
            z-index: 1;
            /* visual triangle indicator */
            background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.28) 50%);
            border-radius: 0 0 10px 0;
        }
        /* Autoplay button: highlight when active */
        #yt-float-auto-btn.is-active { background: rgba(99,102,241,0.55); }
        /* Share popover – appended to body, positioned via JS */
        #yt-share-popover {
            display: none;
            position: fixed;
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 6px 24px rgba(0,0,0,0.28);
            padding: 5px;
            z-index: 10600;
            min-width: 190px;
            flex-direction: column;
        }
        #yt-share-popover.is-open { display: flex; }
        .yt-share-option {
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 8px 12px;
            color: #1e1b4b;
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            border-radius: 7px;
            border: none;
            background: none;
            cursor: pointer;
            width: 100%;
            text-align: left;
            transition: background 0.12s;
        }
        .yt-share-option:hover { background: #f5f3ff; color: #4f46e5; }
        /* Toast notification for "link copied" */
        #yt-copy-toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%) translateY(12px);
            background: #1e1b4b;
            color: #fff;
            padding: 7px 18px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.25s, transform 0.25s;
            z-index: 10700;
        }
        #yt-copy-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
        /* Sidebar pill */
        .mt-sidebar-item {
            padding: 9px 11px;
            background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
            border-radius: 7px;
            margin-bottom: 7px;
            cursor: pointer;
            transition: all .18s;
            border: 1px solid #c4b5fd;
        }
        .mt-sidebar-item:hover { box-shadow: 0 3px 10px rgba(79,70,229,0.2); transform: translateY(-1px); }
        .mt-sidebar-title { font-size: 13px; font-weight: 700; color: #1e1b4b; margin: 0 0 2px; }
        .mt-sidebar-sub   { font-size: 11px; color: #6b7280; margin: 0; }

        /* ── Zoom buttons: bottom-center on mobile ── */
        @media (max-width: 768px) {
            .leaflet-control-zoom {
                position: fixed !important;
                bottom: 24px !important;
                left: 50% !important;
                transform: translateX(-50%) !important;
                top: auto !important;
                display: flex !important;
                flex-direction: row !important;
                gap: 0 !important;
                z-index: 1000 !important;
                box-shadow: 0 2px 10px rgba(0,0,0,0.25) !important;
                border-radius: 8px !important;
            }
            .leaflet-control-zoom a {
                border-radius: 0 !important;
                border-bottom: none !important;
                border-right: 1px solid #ccc !important;
                width: 36px !important;
                height: 36px !important;
                line-height: 36px !important;
                font-size: 18px !important;
            }
            .leaflet-control-zoom-in  { border-radius: 8px 0 0 8px !important; }
            .leaflet-control-zoom-out { border-radius: 0 8px 8px 0 !important; border-right: none !important; }
        }

        /* ─── Ajustes de Contraste para el Panel Lateral ─── */
        #sidebar .bento-card {
            background: rgba(15, 23, 42, 0.5) !important;
            border-color: rgba(255, 255, 255, 0.15) !important;
            color: #f8fafc !important;
        }
        #sidebar .bento-card [style*="color:var(--text-muted)"], 
        #sidebar .bento-card [style*="color: var(--text-muted)"] {
            color: #cbd5e1 !important; 
        }
        #sidebar .capa-btn {
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            justify-content: center !important;
            gap: 6px !important;
            padding: 10px 4px !important;
            background: rgba(255, 255, 255, 0.1) !important;
            color: #f8fafc !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
            line-height: 1 !important;
        }
        #sidebar .capa-btn.capa-off {
            background: rgba(15, 23, 42, 0.6) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
            filter: grayscale(1) opacity(0.6) !important;
        }
        #sidebar .sb-search-wrap input {
            background: rgba(15, 23, 42, 0.5) !important;
            color: #f8fafc !important;
            border-color: rgba(255,255,255,0.2) !important;
        }
        #sidebar .sb-search-wrap input::placeholder {
            color: #cbd5e1 !important;
            opacity: 1 !important;
        }
    