        /* Ocultar elementos de base.html que rompen el layout fixed del mapa */
        .ticker { display:none !important; }
        .btn-donar-float { display:none !important; }
        .footer { display:none !important; }
        #separador-footer { display:none !important; }
        #cookie-banner { display:none !important; }
        :root { --dark: var(--texto); --panel-w: 380px; }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        html, body { height: 100%; font-family: 'Inter','Segoe UI',sans-serif; background: var(--crema); color: var(--texto); overflow: hidden; }

        /* Fix rayas entre tiles en Safari */
        .leaflet-tile {
            -webkit-transform: translate3d(0,0,0);
            transform: translate3d(0,0,0);
        }
        @supports (-webkit-hyphens:none) {
            .leaflet-tile { margin-bottom: -1px; margin-right: -1px; }
            .leaflet-tile-container { -webkit-transform: translateZ(0); transform: translateZ(0); }
        }

        /* ── HEADER ── */
        /* El mapa es full-screen: el header debe ser fixed (no sticky) para que
           el layout pueda usar position:fixed top:100px sin desplazarse */
        .header { position: fixed; top: 0; left: 0; right: 0; z-index: 600; }

        /* ── TICKER DEL MAPA ── */
        .ticker-wrap {
            position: fixed;
            top: 64px; left: 0; right: 0;
            z-index: 550;
            background: #324376;
            height: 40px;
            display: flex;
            align-items: center;
            overflow: hidden;
        }
        .ticker-lbl {
            flex-shrink: 0;
            padding: 0 16px 0 20px;
            font-size: .72rem;
            font-weight: 900;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: #ccff00;
            border-right: 1px solid rgba(255,255,255,.15);
            height: 100%;
            display: flex;
            align-items: center;
            white-space: nowrap;
            gap: 7px;
        }
        .ticker-lbl::before {
            content: '';
            display: inline-block;
            width: 6px; height: 6px;
            border-radius: 50%;
            background: #f76c5e;
            animation: ticker-pulse 1.2s ease-in-out infinite;
            flex-shrink: 0;
        }
        .ticker-inner { overflow: hidden; flex: 1; display: flex; }
        .ticker-track2 {
            display: flex;
            animation: ticker-scroll 40s linear infinite;
            will-change: transform;
        }
        .ticker-wrap:hover .ticker-track2 { animation-play-state: paused; }
        .t-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0 28px;
            font-size: .85rem;
            font-weight: 500;
            color: rgba(255,255,255,.75);
            white-space: nowrap;
            border-right: 1px solid rgba(255,255,255,.08);
        }
        .t-item b { color: white; font-weight: 800; }
        .t-item.urgente { color: #ccff00; }
        .t-item.urgente b { color: #ccff00; }
        .t-dot {
            width: 6px; height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        /* ── LAYOUT PRINCIPAL ── */
        .layout {
            position: fixed;
            top: 64px; left: 0; right: 0; bottom: 0;
            display: flex;
        }
        .con-ticker .layout { top: 104px; }
        @media (max-width: 768px) {
            .layout { top: 56px; }
            .ticker-wrap { top: 56px; display: none; }
            .con-ticker .layout { top: 56px; }
        }

        /* ── MAPA ── */
        #map {
            flex: 1;
            height: 100%;
            z-index: 1;
            transition: margin-right .3s ease;
        }
        .map-con-panel { margin-right: var(--panel-w); }
        .map-con-ficha { margin-left: var(--panel-w); }

        /* ── SKELETON DEL MAPA ── */
        #map-skeleton {
            position: absolute;
            inset: 0;
            z-index: 10;
            background: #e8e4de;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 14px;
            pointer-events: none;
            transition: opacity .4s ease;
        }
        #map-skeleton.oculto {
            opacity: 0;
            pointer-events: none;
        }
        .map-skeleton-pulse {
            width: 48px; height: 48px;
            border-radius: 50%;
            background: rgba(50,67,118,.12);
            display: flex; align-items: center; justify-content: center;
            animation: skeleton-pulse 1.6s ease-in-out infinite;
        }
        .map-skeleton-pulse svg { width: 22px; height: 22px; opacity: .45; }
        .map-skeleton-label {
            font-size: .88rem;
            font-weight: 600;
            color: rgba(31,34,64,.4);
            letter-spacing: .02em;
        }
        @keyframes skeleton-pulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.12); opacity: .6; }
        }

        /* ── BARRA DE FILTROS FLOTANTE ── */
        .filtros-bar {
            position: absolute;
            top: 16px; left: 50%;
            transform: translateX(-50%);
            z-index: 500;
            background: white;
            border-radius: 10px;
            padding: 6px 8px;
            display: flex;
            gap: 4px;
            box-shadow: 0 4px 24px rgba(22,22,43,.18);
            border: 1px solid var(--borde);
        }
        .filtro-pill {
            padding: 8px 18px; border-radius: 6px;
            font-size: .95rem; font-weight: 600;
            border: none; background: transparent;
            color: var(--texto-2); cursor: pointer;
            transition: all .15s; font-family: inherit;
        }
        .filtro-pill:hover { background: var(--crema); color: var(--texto); }
        .filtro-pill.activo { background: var(--texto); color: white; }
        .filtro-pill.cargando { opacity: .55; cursor: wait; pointer-events: none; }

        /* ── STATS FLOTANTES ── */
        .stats-flotantes {
            position: absolute;
            top: 78px; left: 24px;
            z-index: 500;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .stat-float {
            background: white;
            border-radius: 12px;
            padding: 10px 14px;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 4px 20px rgba(22,22,43,.14);
            border: 1px solid var(--borde);
            min-width: 170px;
        }
        .stat-float-icon {
            width: 32px; height: 32px; border-radius: 8px;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0;
        }
        .stat-float-icon svg { width: 14px; height: 14px; }
        .stat-float-num { font-size: 1.1rem; font-weight: 900; line-height: 1; }
        .stat-float-label { font-size: 1.05rem; color: var(--texto-2); margin-top: 2px; }

        /* ── LEYENDA FLOTANTE ── */
        .leyenda {
            position: absolute;
            bottom: 24px; left: 24px;
            z-index: 500;
            background: white;
            border-radius: 12px;
            padding: 12px 32px 12px 14px;
            box-shadow: 0 4px 20px rgba(22,22,43,.12);
            border: 1px solid var(--borde);
            font-size: .95rem;
        }
        .leyenda-con-panel { /* leyenda ya está a la izquierda, sin ajuste necesario */ }
        .leyenda.oculta-por-ficha { display: none !important; }
        .leyenda.oculta { display: none !important; }
        .leyenda-title {
            font-size: 1rem; font-weight: 700;
            text-transform: uppercase; letter-spacing: .7px;
            color: var(--texto); margin-bottom: 8px;
        }
        .leyenda-item { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: var(--texto-2); }
        .leyenda-item:last-child { margin-bottom: 0; }
        .dot-ley { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

        /* ── HINT CLICK ── */
        .hint-click {
            position: absolute;
            top: 72px; left: 50%;
            transform: translateX(-50%);
            z-index: 500;
            background: rgba(22,22,43,.75);
            color: white;
            font-size: .95rem;
            font-weight: 500;
            padding: 7px 16px;
            border-radius: 50px;
            pointer-events: none;
            opacity: 1;
            transition: opacity .5s;
            white-space: nowrap;
        }
        .hint-click.oculto { opacity: 0; }

        /* ── PANEL LATERAL DERECHO (comunidades) ── */
        .panel {
            position: fixed;
            top: 109px; right: 0; bottom: 0;
            width: var(--panel-w);
            background: white;
            border-left: 1px solid var(--borde);
            z-index: 600;
            display: flex;
            flex-direction: column;
            transform: translateX(100%);
            transition: transform .3s ease;
            box-shadow: -4px 0 24px rgba(22,22,43,.10);
        }
        .panel.abierto { transform: translateX(0); }

        /* ── FICHA ANIMAL (panel izquierdo) ── */
        .ficha-animal {
            position: fixed;
            top: 64px; left: 0; bottom: 0;
            width: var(--panel-w);
            background: white;
            border-right: 1px solid var(--borde);
            z-index: 600;
            display: flex;
            flex-direction: column;
            transform: translateX(-100%);
            transition: transform .3s ease;
            box-shadow: 4px 0 24px rgba(22,22,43,.10);
        }
        .ficha-animal.abierto { transform: translateX(0); }

        .ficha-foto-wrap {
            position: relative;
            flex-shrink: 0;
            height: 200px;
            background: var(--bg);
            overflow: hidden;
        }
        .ficha-foto-wrap.sin-foto { height: 0 !important; overflow: hidden !important; }
        .ficha-foto-wrap.sin-foto * { display: none !important; }
        .ficha-foto {
            width: 100%; height: 100%;
            object-fit: cover;
            object-position: center 20%;
        }
        .ficha-sin-foto {
            width: 100%; height: 100%;
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            gap: 8px; color: var(--texto-2);
            font-size: .95rem;
        }
        .ficha-sin-foto svg { width: 40px; height: 40px; opacity: .3; }
        .ficha-badge-estado {
            position: absolute; top: 10px; left: 10px;
            font-size: 1rem; font-weight: 800; text-transform: uppercase;
            letter-spacing: .5px; padding: 4px 10px; border-radius: 50px;
            background: var(--coral); color: white;
        }
        .ficha-btn-cerrar {
            position: absolute; top: 10px; right: 10px;
            width: 28px; height: 28px; border-radius: 7px;
            background: rgba(255,255,255,.9); border: 1px solid var(--borde);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            transition: background .15s; font-family: inherit;
        }
        .ficha-btn-cerrar:hover { background: white; }
        .ficha-btn-cerrar svg { width: 14px; height: 14px; }

        .ficha-body {
            flex: 1; min-height: 0; overflow-y: auto; padding: 18px;
        }
        .ficha-nombre {
            font-size: 1.25rem; font-weight: 900; color: var(--dark); margin-bottom: 4px;
        }
        .ficha-especie-row {
            display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
        }
        .ficha-divider {
            border: none; border-top: 1px solid var(--borde); margin: 14px 0;
        }
        .ficha-section-title {
            font-size: 1rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: .7px; color: var(--texto); margin-bottom: 10px;
        }
        .ficha-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
        }
        .ficha-dato {
            display: flex; flex-direction: column; gap: 2px;
        }
        .ficha-dato-label {
            font-size: 1rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: .5px; color: var(--texto-2);
        }
        .ficha-dato-valor {
            font-size: 1rem; font-weight: 600; color: var(--dark);
        }
        .ficha-descripcion {
            font-size: 1rem; color: var(--texto-2); line-height: 1.55;
        }
        .ficha-coords-row {
            display: flex; align-items: center; gap: 5px;
            font-size: 1.05rem; color: var(--texto-2); margin-top: 6px;
        }
        .ficha-coords-row svg { width: 11px; height: 11px; flex-shrink: 0; }

        /* ── UPDATES EN VIVO ── */
        .updates-live-dot {
            display: flex; align-items: center; gap: 6px;
            font-size: 1rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: .5px; color: var(--verde);
        }
        .live-pulse {
            display: inline-block; width: 7px; height: 7px;
            border-radius: 50%; background: var(--verde);
            box-shadow: 0 0 0 0 rgba(59,206,172,.5);
            animation: live-ring 1.8s ease-out infinite;
        }
        @keyframes live-ring {
            0%   { box-shadow: 0 0 0 0 rgba(59,206,172,.5); }
            70%  { box-shadow: 0 0 0 7px rgba(59,206,172,0); }
            100% { box-shadow: 0 0 0 0 rgba(59,206,172,0); }
        }
        .updates-feed { display: flex; flex-direction: column; gap: 10px; }
        .updates-vacio { font-size: 1rem; color: var(--texto-2); font-style: italic; }
        .update-item {
            display: flex; gap: 10px; align-items: flex-start;
            animation: slideIn .3s ease;
        }
        @keyframes slideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
        .update-icono {
            width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
        }
        .update-icono svg { width: 13px; height: 13px; }
        .update-contenido { flex: 1; min-width: 0; }
        .update-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 2px; gap: 6px;
        }
        .update-voluntario { font-size: .95rem; font-weight: 700; color: var(--dark); }
        .update-hora { font-size: 1.05rem; color: var(--texto-2); white-space: nowrap; }
        .update-mensaje { font-size: 1rem; color: var(--texto-2); line-height: 1.45; }
        .update-foto { margin-top: 6px; border-radius: 8px; max-width: 100%; max-height: 120px; object-fit: cover; }

        .ficha-footer {
            padding: 14px 18px;
            border-top: 1px solid var(--borde);
            flex-shrink: 0;
        }
        .btn-contactar {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            width: 100%;
            background: var(--texto); color: white;
            font-size: 1rem; font-weight: 700; text-decoration: none;
            padding: 11px; border-radius: 10px;
            box-shadow: 0 2px 12px rgba(88,107,164,.25);
            transition: background .15s, transform .1s;
            border: none; cursor: pointer; font-family: inherit;
        }
        .btn-contactar:hover { background: var(--texto); transform: translateY(-1px); }
        .btn-contactar svg { width: 15px; height: 15px; }
        /* Chat con la familia — acción secundaria, estilo diferenciado */
        .btn-contactar.btn-chat {
            background: transparent;
            color: var(--texto);
            border: 1.5px solid var(--borde);
            box-shadow: none;
            font-weight: 600;
            font-size: .95rem;
        }
        .btn-contactar.btn-chat:hover { background: var(--crema); border-color: var(--texto); transform: none; }
        /* Label separador entre acciones */
        .ficha-footer-label {
            font-size: .75rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: 1.2px; color: var(--texto-2); opacity: .5;
            text-align: center; margin: 10px 0 6px;
        }

        .btn-responder {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            width: 100%; margin-bottom: 8px;
            background: var(--coral); color: white;
            font-size: 1rem; font-weight: 700;
            padding: 11px; border-radius: 10px;
            box-shadow: 0 2px 12px rgba(247,108,94,.25);
            transition: background .15s, transform .1s;
            border: none; cursor: pointer; font-family: inherit;
        }
        .btn-responder:hover { background: var(--coral);filter:brightness(.88); transform: translateY(-1px); }
        .btn-responder:disabled { background: #ccc; cursor: default; transform: none; box-shadow: none; }
        .btn-responder svg { width: 15px; height: 15px; }
        .btn-responder.confirmado {
            background: var(--purpura);
            box-shadow: none;
            cursor: default;
            transform: none;
        }
        .btn-responder.confirmado:hover { background: var(--purpura); transform: none; }

        /* ── CONFIRMACIÓN VOY A BUSCARLE ── */
        .responder-confirm {
            display: none;
            background: #f0fdf4;
            border: 1px solid #bbf7d0;
            border-radius: 10px;
            padding: 12px 14px;
            margin-bottom: 8px;
            gap: 10px;
            align-items: flex-start;
        }
        .responder-confirm.visible { display: flex; }
        .responder-confirm-icon {
            width: 32px; height: 32px; border-radius: 50%;
            background: #dcfce7; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
        }
        .responder-confirm-icon svg { width: 16px; height: 16px; color: #16a34a; }
        .responder-confirm-title {
            font-size: .88rem; font-weight: 700; color: #15803d; margin-bottom: 2px;
        }
        .responder-confirm-sub {
            font-size: .85rem; color: #166534; line-height: 1.4;
        }

        /* ── COMPARTIR EN RRSS ── */
        .ficha-share-section { padding: 14px 18px; border-top: 1px solid var(--borde); }
        .ficha-share-title { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--texto); margin-bottom: 10px; }
        .ficha-share-native { display: none; width: 100%; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; margin-bottom: 10px; border-radius: 10px; font-weight: 700; font-size: .95rem; font-family: inherit; background: var(--texto); color: #fff; border: none; cursor: pointer; }
        .ficha-share-native:hover { opacity: .92; }
        .ficha-share-native svg { width: 17px; height: 17px; flex-shrink: 0; }
        .ficha-share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
        .share-btn { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--borde); background: white; color: var(--texto); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s; flex-shrink: 0; text-decoration: none; }
        .share-btn:hover { border-color: var(--texto); background: var(--bg); }
        .share-btn svg { width: 18px; height: 18px; }
        .share-btn.copied { border-color: #22c55e; color: #22c55e; }
        .ficha-share-feedback { display: block; font-size: .85rem; color: #22c55e; font-weight: 600; min-height: 1em; margin-top: 8px; }

        .panel-header {
            padding: 16px 18px;
            border-bottom: 1px solid var(--borde);
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            flex-shrink: 0;
        }
        .panel-titulo { font-size: 1.05rem; font-weight: 800; color: var(--dark); }
        .panel-subtitulo { font-size: 1rem; color: var(--texto-2); margin-top: 3px; }
        .btn-cerrar {
            width: 28px; height: 28px; border-radius: 7px;
            background: var(--bg); border: 1px solid var(--borde);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            flex-shrink: 0; transition: background .15s; font-family: inherit;
        }
        .btn-cerrar:hover { background: rgba(247,108,94,.08); border-color: var(--coral); }
        .btn-cerrar svg { width: 14px; height: 14px; }

        .panel-tabs {
            display: flex;
            border-bottom: 1px solid var(--borde);
            flex-shrink: 0;
        }
        .panel-tab {
            flex: 1; padding: 11px 8px;
            font-size: .95rem; font-weight: 600;
            color: var(--texto-2); border: none;
            background: transparent; cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all .15s; font-family: inherit;
        }
        .panel-tab:hover { color: var(--texto); }
        .panel-tab.activo { color: var(--texto); border-bottom-color: var(--texto); }

        .panel-body {
            flex: 1;
            overflow-y: auto;
            padding: 0;
        }

        /* Estado de carga */
        .panel-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 24px;
            gap: 12px;
            color: var(--texto-2);
            font-size: 1rem;
        }
        .spinner {
            width: 28px; height: 28px;
            border: 3px solid var(--borde);
            border-top-color: var(--texto);
            border-radius: 50%;
            animation: spin .8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        @keyframes pulso { 0%{transform:scale(1);opacity:.7} 100%{transform:scale(2.5);opacity:0} }

        /* Estado vacío */
        .panel-vacio {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 24px;
            gap: 10px;
            text-align: center;
        }
        .panel-vacio-icon {
            width: 52px; height: 52px; border-radius: 14px;
            background: var(--bg);
            display: flex; align-items: center; justify-content: center;
            margin-bottom: 4px;
        }
        .panel-vacio-icon svg { width: 24px; height: 24px; }
        .panel-vacio-titulo { font-size: 1.05rem; font-weight: 700; color: var(--dark); }
        .panel-vacio-texto { font-size: 1rem; color: var(--texto-2); line-height: 1.55; }

        /* Tarjeta de alerta */
        .alerta-card {
            padding: 14px 18px;
            border-bottom: 1px solid var(--borde);
            transition: background .15s;
            cursor: default;
        }
        .alerta-card:hover { background: var(--bg); }
        .alerta-card-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 6px;
        }
        .alerta-nombre { font-size: 1.05rem; font-weight: 700; color: var(--dark); }
        .alerta-especie-badge {
            font-size: 1rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: .4px;
            padding: 3px 8px; border-radius: 50px;
        }
        .badge-perro  { background: rgba(88,107,164,.08);  color: var(--texto); }
        .badge-gato   { background: rgba(59,206,172,.10); color: #3BCEAC; }
        .badge-otro   { background: rgba(245,221,144,.20); color: #1F2240; }
        .alerta-meta {
            font-size: 1rem; color: var(--texto-2);
            display: flex; align-items: center; gap: 10px; margin-bottom: 5px;
        }
        .alerta-meta-sep { opacity: .4; }
        .alerta-desc {
            font-size: 1rem; color: var(--texto-2);
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .alerta-coords {
            font-size: 1.05rem; color: var(--texto-2); margin-top: 6px;
            display: flex; align-items: center; gap: 4px; opacity: .7;
        }
        .alerta-coords svg { width: 10px; height: 10px; flex-shrink: 0; }

        /* Tarjeta de avistamiento */
        .avistamiento-card {
            padding: 13px 18px;
            border-bottom: 1px solid var(--borde);
            transition: background .15s;
        }
        .avistamiento-card:hover { background: var(--bg); }
        .avist-top {
            display: flex; align-items: center;
            justify-content: space-between; margin-bottom: 5px;
        }
        .avist-especie { font-size: 1rem; font-weight: 700; color: var(--dark); }
        .avist-fecha { font-size: 1.05rem; color: var(--texto-2); }
        .avist-comentario {
            font-size: 1rem; color: var(--texto-2); line-height: 1.5;
            margin-bottom: 5px;
        }
        .avist-coords {
            font-size: 1.05rem; color: var(--texto-2);
            display: flex; align-items: center; gap: 4px; opacity: .7;
        }
        .avist-coords svg { width: 10px; height: 10px; flex-shrink: 0; }

        /* Footer del panel */
        .panel-footer {
            padding: 14px 18px;
            border-top: 1px solid var(--borde);
            flex-shrink: 0;
        }
        .btn-alerta {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            width: 100%;
            background: var(--coral); color: white;
            font-size: 1rem; font-weight: 700; text-decoration: none;
            padding: 11px; border-radius: 10px;
            box-shadow: 0 2px 12px rgba(247,108,94,.25);
            transition: background .15s, transform .1s;
        }
        .btn-alerta:hover { background: var(--coral);filter:brightness(.88); transform: translateY(-1px); }
        .btn-alerta svg { width: 16px; height: 16px; }

        /* ── LEYENDA TOGGLE (móvil) ── */
        .leyenda-toggle {
            display: none;
            position: absolute;
            bottom: 24px; left: 24px;
            z-index: 500;
            background: white;
            border-radius: 12px;
            padding: 9px 14px;
            box-shadow: 0 4px 20px rgba(22,22,43,.12);
            border: 1px solid var(--borde);
            font-size: .95rem;
            font-weight: 700;
            color: var(--texto);
            cursor: pointer;
            align-items: center;
            gap: 6px;
            -webkit-tap-highlight-color: transparent;
        }
        .leyenda-toggle svg { width: 14px; height: 14px; }

        /* botón donar: sube para no tapar la barra lateral */
        .btn-donar-float { bottom: 160px; }
        @media (max-width: 768px) { .btn-donar-float { bottom: 100px; } }

        /* ── RESPONSIVE ── */
        @media (max-width: 768px) {
            :root { --panel-w: 100vw; }
            .activity-bar { display: none; }
            .layout { top: 56px; }
            .panel { top: 56px; }
            /* Tabs del panel: con el panel a 100vw, "Alertas activas" se iba a dos
               líneas en pantallas estrechas. Achicamos un poco para que quepa en
               una sin truncar (solo reduce tamaño, nunca provoca overflow). */
            .panel-tab { padding: 11px 4px; font-size: .88rem; }
            .ficha-animal { top: 56px; bottom: 0; height: auto; }
            .ficha-foto-wrap { max-height: 40vh; }
            .ficha-body { min-height: 0; }
            .filtros-bar {
                top: 10px;
                left: 8px; right: 8px;
                transform: none;
                justify-content: flex-start;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
                border-radius: 12px;
                scroll-padding: 8px;
            }
            .filtros-bar::-webkit-scrollbar { display: none; }
            /* Las pills no caben en móvil: scroll horizontal con desvanecido a la derecha como pista visual */
            .filtros-bar {
                gap: 3px; padding: 5px 8px;
                -webkit-mask-image: linear-gradient(to right, #000 90%, transparent);
                mask-image: linear-gradient(to right, #000 90%, transparent);
            }
            .filtro-pill { padding: 7px 12px; font-size: .95rem; white-space: nowrap; flex-shrink: 0; }
            .stats-flotantes { display: none; }
            .leyenda {
                display: none;
                bottom: auto;
                top: 70px;
                left: auto;
                right: 8px;
                max-width: calc(100vw - 32px);
            }
            .leyenda.visible { display: block; }
            .leyenda.oculta-por-ficha { display: none !important; }
            .leyenda-toggle {
                display: flex;
                bottom: auto;
                top: 70px;
                right: 8px;
            }
            .map-con-ficha { margin-left: 0; }
            .layout { top: 56px; }
            .header { height: 56px; }
        }
        @media (hover: none) and (pointer: coarse) {
            /* Dispositivos táctiles: hacer los botones más grandes */
            .filtro-pill { min-height: 40px; display: flex; align-items: center; }
            .btn-cerrar, .ficha-btn-cerrar { width: 36px; height: 36px; }
            .panel-tab { padding: 14px 8px; }
        }
        /* Panel de comunidades (esquina superior derecha) */
        .mapa-panel {
            position: absolute;
            top: 78px; right: 24px;
            z-index: 1000;
            width: 244px;
            background: white;
            border-radius: 12px;
            border: 1px solid var(--borde);
            box-shadow: 0 4px 20px rgba(22,22,43,.12);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            max-height: calc(100% - 140px);
        }
        .mapa-panel .panel-head {
            padding: 12px 14px;
            border-bottom: 1px solid var(--borde);
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }
        .panel-head-texts { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
        .panel-toggle {
            width: 28px; height: 28px; border-radius: 7px;
            background: var(--bg); border: 1px solid var(--borde);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            flex-shrink: 0; transition: background .15s; font-family: inherit; color: var(--texto);
        }
        .panel-toggle:hover { background: var(--borde); }
        .panel-toggle svg { width: 14px; height: 14px; transition: transform .2s ease; }
        .mapa-panel.minimizado .panel-toggle svg { transform: rotate(180deg); }
        .mapa-panel.minimizado .panel-head { border-bottom: none; }
        .mapa-panel.minimizado > :not(.panel-head) { display: none; }
        .panel-head-title {
            font-size: 1rem; font-weight: 700;
            text-transform: uppercase; letter-spacing: .7px;
            color: var(--texto);
        }
        .panel-head-badge {
            font-size: .88rem; font-weight: 600;
            color: var(--coral);
        }
        .mapa-panel .panel-row { padding: 9px 14px; border-bottom: 1px solid var(--borde); display: flex; align-items: center; gap: 9px; transition: background .15s; cursor: pointer; width: 100%; background: none; border-left: none; border-right: none; border-top: none; text-align: left; font: inherit; color: inherit; }
        .mapa-panel .panel-row:hover { background: var(--bg); }
        .mapa-panel .panel-row:last-of-type { border-bottom: none; }
        .pr-dot { width: 10px; height: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
        .pr-dot svg { width: 10px; height: 10px; }
        .pr-info { flex: 1; min-width: 0; }
        .pr-name { font-size: .95rem; font-weight: 600; color: var(--texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .pr-n { font-size: .85rem; font-weight: 800; padding: 2px 8px; border-radius: 50px; flex-shrink: 0; }
        .mapa-panel .panel-foot { padding: 10px 14px; border-top: 1px solid var(--borde); }
        .panel-cta {
            display: flex; align-items: center; justify-content: center; gap: 6px;
            font-size: .88rem; font-weight: 700;
            color: var(--texto-2);
            padding: 8px 12px;
            border-radius: 8px;
            background: var(--bg);
            border: 1px solid var(--borde);
            transition: background .15s, color .15s;
            text-decoration: none;
        }
        .panel-cta:hover { background: var(--borde); color: var(--texto); }
        .panel-cta svg { width: 13px; height: 13px; }
        /* Ocultar panel CCAA en móvil (la leyenda ya ocupa espacio) */
        @media (max-width: 640px) { .mapa-panel { display: none; } }

/* ══════════════════════════════════════════════════════════════
   F2 — clases extraídas de los style="" inline de mapa.html
   ══════════════════════════════════════════════════════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.stat-float-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.stat-float-rule { display: block; width: 18px; height: 2px; background: #ccff00; flex-shrink: 0; }
.stat-float-caption { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-2); }
.sfi-azul { background: rgba(50,67,118,.10); }
.sfi-amarillo { background: rgba(245,221,144,.15); }
.sfi-coral { background: rgba(247,108,94,.10); }
.sfi-naranja { background: rgba(246,142,95,.10); }
.sfn-azul { color: #324376; }
.sfn-azul2 { color: #586ba4; }
.sfn-coral { color: var(--coral); }
.sfn-naranja { color: #f68e5f; }
#leyendaCerrarBtn { position: absolute; top: 8px; right: 8px; background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--texto-2); line-height: 1; padding: 2px 6px; }
.dot-ley-perdido { background: #324376; border: 2px solid white; box-shadow: 0 1px 4px rgba(50,67,118,.4); }
.dot-ley-encontrado { background: white; border: 2px solid #586ba4; box-shadow: 0 1px 4px rgba(88,107,164,.25); }
.dot-ley-avistamiento { background: #f76c5e; border: 2px solid white; box-shadow: 0 1px 4px rgba(247,108,94,.35); }
.dot-ley-rrss { background: white; border: 2px solid #f68e5f; box-shadow: 0 1px 4px rgba(246,142,95,.25); }
.leyenda-title-org { margin-top: 10px; }
.dot-ley-org { background: #3BCEAC; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 8px; font-weight: 800; line-height: 1; }
.leyenda-apoyo { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--borde); text-align: center; }
.leyenda-apoyo-link { font-size: 11px; color: var(--texto); text-decoration: none; font-weight: 600; }
.pr-n { background: var(--purpura-06); color: var(--texto); }
.pr-n.pr-n-big { font-size: 1rem; padding: 3px 10px; }
.panel-sin-alertas { padding: 20px 16px; font-size: 1rem; color: var(--texto-2); text-align: center; }
#fichaBtnCerrar { position: absolute; top: 12px; right: 12px; z-index: 10; }
.ficha-updates-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ficha-section-title.mb0 { margin-bottom: 0; }
.ficha-cartel-btn { margin-top: 6px; border-color: #ccff00; color: var(--texto); }
.is-hidden { display: none; }
