/* ══════════════════════════════════════════════════════════
   MOBILE APP NAV — barra tipo app nativa para < 768px
══════════════════════════════════════════════════════════ */

/* Ocultos en escritorio por defecto */
#mobile-nav-bar    { display: none; }
#mobile-status-bar { display: none; }
#drawer-overlay    { display: none; }
#drawer-menu       { display: none; }
.banner-hero-mobile        { display: none; }
.banner-checkpoint-mobile  { display: none; }

@media (max-width: 767px) {
    .vc-browser-vote-banner {
        align-items: flex-start;
        gap: 8px;
        padding: 9px 12px;
        font-size: 0.82rem;
        line-height: 1.28;
    }

    .vc-browser-vote-banner-icon {
        font-size: 1rem;
        padding-top: 1px;
    }

    .vc-browser-vote-banner-text {
        max-width: 100%;
        text-align: left;
    }

    .google-login-wrap,
    .google-login-button-slot {
        width: 100%;
    }
    .google-login-wrap-nav {
        align-items: stretch;
    }
    .google-login-wrap-nav .google-login-button-slot,
    .google-login-wrap-modal .google-login-button-slot {
        justify-content: center;
    }
    .google-login-status {
        width: 100%;
        padding: 0 6px;
    }

    /* Ocultar nav de escritorio y banner superior */
    #desktop-nav           { display: none !important; }
    #seccion-info-superior { display: none !important; }

    /* ── Barra de app móvil — fila única compacta ── */
    #mobile-nav-bar {
        display: flex;
        align-items: center;
        justify-content: space-around;
        background: var(--nav-bg);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        position: sticky;
        top: 0;
        z-index: 100;
        height: 62px;
        border-bottom: 1px solid var(--border);
        padding: 0 4px;
    }

    /* ── Botón base — todos los ítems de la barra ── */
    .mn-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-secondary);
        border-radius: 10px;
        height: 52px;
        min-width: 40px;
        padding: 4px 0 3px;
        position: relative; /* establece contexto de z-index */
        z-index: 1;         /* iconos siempre por encima del pill glassmorphism */
        transition: color 0.18s, background 0.15s, text-shadow 0.18s;
        font-family: inherit;
        -webkit-tap-highlight-color: transparent;
    }
    .mn-btn:active {
        color: var(--accent-cyan);
        background: rgba(6,182,212,0.08);
    }
    /* Sección activa resaltada (asignada por JS) — sin box-shadow propio;
       el pill glassmorphism es el indicador visual de selección */
    .mn-btn.nav-active {
        color: var(--accent-cyan);
    }

    /* ── Etiqueta debajo del icono (Inicio/Votar/Ranking/Opinión) ── */
    .mn-label {
        font-size: 9.5px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0.02em;
        color: inherit;
        text-transform: none;
        pointer-events: none;
        white-space: nowrap;
        transition: text-shadow 0.18s, color 0.18s, transform 0.18s;
    }
    /* Resalte neón del texto cuando el botón está activo */
    .mn-btn.nav-active .mn-label {
        font-weight: 800;
        text-shadow: 0 0 6px rgba(6,182,212,0.55), 0 0 1px rgba(6,182,212,0.9);
    }
    .mn-votar.nav-active .mn-label {
        text-shadow: 0 0 6px rgba(251,191,36,0.55), 0 0 1px rgba(251,191,36,0.9);
    }
    /* Botones sin etiqueta (hamburger / auth) mantienen icono centrado */
    .mn-ham, .mn-auth { gap: 0; padding: 0; }

    /* ── Votar: acento áureo solo cuando está activo o presionado ── */
    .mn-votar:active,
    .mn-votar.nav-active {
        color: var(--accent-gold);
        background: rgba(251,191,36,0.07);
    }

    /* ── Indicador deslizante glassmorphism (JS lo mueve vía setNavActive) ── */
    #nav-pill-indicator {
        position: absolute;
        pointer-events: none;
        z-index: 0; /* por debajo de los botones (z-index: 1) */
        top: 50%;
        transform: translateY(-50%);
        height: 48px;
        border-radius: 12px;
        background: rgba(255,255,255,0.07);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255,255,255,0.18);
        box-shadow: 0 1px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
        opacity: 0;
        transition: left 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                    width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.2s ease;
    }

    /* ── Auth: círculo glassmorphism (Google G / foto) ── */
    .mn-auth {
        flex: none;
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 50%;
        background: rgba(255,255,255,0.07);
        border: 1.5px solid rgba(255,255,255,0.18);
        overflow: hidden;
        padding: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        transition: transform 0.18s, background 0.18s, box-shadow 0.18s;
    }
    .mn-auth:active {
        transform: scale(0.9);
        background: rgba(255,255,255,0.12);
        box-shadow: none;
        color: var(--text-secondary);
    }
    .mn-auth.logged-in {
        border-color: rgba(212,175,55,0.7);
        box-shadow: 0 0 10px rgba(212,175,55,0.35), 0 2px 8px rgba(0,0,0,0.3);
    }
    .mn-auth img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        display: block;
    }

    /* ── Barra de estado dorada (sección/cantón activo) ── */
    #mobile-status-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--nav-bg);
        padding: 3px 16px 5px;
        position: sticky;
        top: 62px;
        z-index: 99;
        border-bottom: 2px solid var(--accent-gold);
    }
    #mobile-status-text {
        font-size: 0.68em;
        font-weight: 700;
        color: var(--text-muted);
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    /* ── Overlay del drawer ── */
    #drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 200;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    #drawer-overlay.open { opacity: 1; pointer-events: auto; }

    /* ── Drawer (menú lateral deslizante) ── */
    #drawer-menu {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 78vw;
        max-width: 290px;
        height: 100vh;
        height: 100dvh;
        background: var(--bg-surface);
        border-right: 1px solid var(--border-bright);
        z-index: 201;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        flex-direction: column;
        overflow-y: auto;
    }
    #drawer-menu.open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0,0,0,0.6);
    }

    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 18px 14px;
        border-bottom: 1px solid var(--border);
    }
    .drawer-logo {
        font-size: 0.95em;
        font-weight: 800;
        color: var(--accent-gold);
        letter-spacing: -0.01em;
    }
    .drawer-close {
        background: rgba(255,255,255,0.06);
        border: 1px solid var(--border);
        color: var(--text-secondary);
        cursor: pointer;
        padding: 5px 11px;
        border-radius: 8px;
        font-size: 1em;
        line-height: 1;
        transition: background 0.2s;
    }
    .drawer-close:active { background: rgba(255,255,255,0.12); }

    .drawer-links {
        display: flex;
        flex-direction: column;
        padding: 10px 0 6px;
    }
    .drawer-links a {
        color: var(--text-primary);
        text-decoration: none;
        padding: 14px 22px;
        font-size: 1.0em;
        font-weight: 600;
        border-left: 3px solid transparent;
        transition: background 0.18s, border-color 0.18s, color 0.18s;
        display: flex;
        align-items: center;
        gap: 14px;
    }
    .drawer-links a:active,
    .drawer-links a:hover {
        background: rgba(59,130,246,0.09);
        border-left-color: var(--accent-cyan);
        color: var(--accent-cyan);
    }

    .drawer-sep {
        height: 1px;
        background: var(--border);
        margin: 4px 18px;
    }

    .drawer-auth {
        margin-top: auto;
        border-top: 1px solid var(--border);
        padding: 18px 22px 32px;
    }
    .drawer-auth span {
        font-size: 0.9em;
        line-height: 1.5;
        color: var(--text-secondary);
    }
    .drawer-auth a {
        font-weight: 600;
        text-decoration: none;
    }
    /* Auth en drawer: botones full-width apilados (mejor para tap en móvil) */
    .drawer-auth .social-login-row {
        flex-direction: column;
        gap: 10px;
    }
    .drawer-auth .social-login-btn {
        padding: 13px 16px;
        font-size: 0.95em;
        min-height: 46px;
    }

    /* ── Botón mobile-nav: logo Google centrado (logged out, single-provider)
       Cuando hay sesión, se reemplaza por la foto del usuario via JS.
       NOTA: las clases .mn-auth-dual* siguen abajo para reactivar Facebook
       en el futuro sin reescribir CSS. */
    .mn-auth-solo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
    .mn-auth-solo svg {
        width: 19px;
        height: 19px;
        display: block;
        filter: drop-shadow(0 0 3px rgba(77,166,255,0.45))
                drop-shadow(0 0 1px rgba(255,255,255,0.4));
    }

    .mn-auth-dual {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        gap: 1.5px;
    }
    .mn-auth-dual::before {
        /* Separador diagonal sutil entre las dos marcas */
        content: '';
        position: absolute;
        top: 20%;
        bottom: 20%;
        left: 50%;
        width: 1px;
        background: linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.18) 100%);
        transform: translateX(-50%) rotate(18deg);
        pointer-events: none;
        opacity: 0.65;
    }
    .mn-auth-dual-g,
    .mn-auth-dual-f {
        flex: 1 1 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .mn-auth-dual-g svg,
    .mn-auth-dual-f svg {
        width: 14px;
        height: 14px;
        display: block;
        filter: drop-shadow(0 0 2px rgba(255,255,255,0.30));
    }
    .mn-auth:not(.logged-in) {
        border-color: rgba(96,165,250,0.55);
        box-shadow: 0 0 10px rgba(96,165,250,0.28), inset 0 0 6px rgba(77,166,255,0.15);
    }
}

/* ══════════════════════════════════════════════════════════
   PHASE 2 — Map condensation & Above-the-Fold layout
   Goal: all content visible without scroll on typical phones
   Applies to: 767px and below
══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* ─ Section padding: reduce top/bottom breathing room ─ */
    .seccion-mapa,
    .seccion-votar { padding: 4px 4px 10px; }

    /* ─ Inicio header: strip decoration, compact spacing ─ */
    .inicio-header      { padding: 4px 0 2px; }
    .inicio-emoji-badge { display: none; }
    .estrella-deco      { display: none; }
    .inicio-titulo      { font-size: 1.08rem; }
    .inicio-subtitulo   { display: none; }
    .inicio-titulo-row  { gap: 4px; }

    /* ─ Buscador: tight gap between header and map ─ */
    .buscador-gold-wrap { margin-top: 10px; }
    .buscador-gold      { padding: 9px 12px; border-radius: 10px; }

    /* ─ Map: contenedor de referencia para botones absolutos ─ */
    .mapa-neon-canvas {
        position: relative !important;
        margin-top: 6px;
        padding: 0.5rem 0.5rem 2.5rem;
        max-height: none;
        overflow: hidden;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
    }
    /* solo el SVG del mapa (hijo directo), NO los iconos de los botones */
    .mapa-neon-canvas > svg {
        width: min(100%, 175px);
        inline-size: min(100%, 175px);
        max-width: 175px;
        height: auto;
        max-height: 188px;
        aspect-ratio: 800 / 857;
        transform: none;
        display: block;
        margin: 0 auto;
    }

    /* ─ Iconos de botón: bloquear el tamaño antes de que el > svg los afecte ─ */
    .btn-geolocalizacion svg,
    .mapa-instruccion svg {
        width: 10px !important;
        height: 10px !important;
        display: inline !important;
        transform: none !important;
        max-width: none !important;
        flex-shrink: 0;
    }

    /* ─ Map controls: wrapper invisible, cada botón anclado a su esquina ─ */
    .mapa-controles-footer {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        display: block;
        pointer-events: none;
    }
    .btn-geolocalizacion {
        position: absolute !important;
        bottom: 15px !important;
        left: 15px !important;
        right: auto !important;
        width: auto !important;
        z-index: 50;
        pointer-events: auto !important;
        font-size: 11px !important;
        padding: 4px 10px !important;
        gap: 4px;
        border-radius: 999px !important;
    }
    .mapa-instruccion {
        position: absolute !important;
        bottom: 15px !important;
        right: 15px !important;
        left: auto !important;
        width: auto !important;
        z-index: 50;
        pointer-events: auto !important;
        font-size: 11px !important;
        padding: 4px 10px !important;
        gap: 4px;
        border-radius: 999px !important;
        pointer-events: auto !important;
    }

    /* ─ Legend and hint: tighten vertical space ─ */
    .mapa-legend    { margin-top: 5px; font-size: 0.74em; gap: 12px; }
    .mapa-neon-hint { margin-top: 3px; font-size: 0.7em; }

    /* ─ Popular cantons section: compact ─ */
    .cantones-populares        { margin-top: 8px; }
    .cantones-populares-titulo { margin-bottom: 6px; font-size: 0.72em; }
    .btn-explorar-pill         { margin-top: 8px; padding: 9px 16px; font-size: 0.82em; }

    /* ─ MAP SECTION: canton pills compactas (solo el grid del mapa) ─ */
    #mapa-view-contenido .cantones-cards-grid {
        display: flex;
        flex-direction: row;
        gap: 8px;
        max-width: 100%;
    }
    #mapa-view-contenido .canton-card-popular {
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 9px 10px;
        border-radius: 999px;
        min-height: 0;
        text-align: center;
    }
    #mapa-view-contenido .canton-card-badge  { display: none; }
    #mapa-view-contenido .canton-card-emoji  { font-size: 1.05em; flex-shrink: 0; }
    #mapa-view-contenido .canton-card-nombre { font-size: 0.8em; font-weight: 700; }
    #mapa-view-contenido .canton-card-sub    { display: none; }

    /* ─ SELECTION SECTIONS (Votar / Ranking): cards neon-gold gamificadas ─ */
    .seleccion-canton-wrap .cantones-cards-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-width: 100%;
        margin: 0;
    }
    .seleccion-canton-wrap .canton-seleccion-card {
        width: 100%;
        padding: 14px 14px 12px;
        border-radius: 16px;
        border: 1.5px solid rgba(212,175,55,0.48);
        background: linear-gradient(135deg, rgba(10,16,30,0.96) 0%, rgba(18,26,46,0.92) 100%);
        box-shadow:
            0 0 22px rgba(212,175,55,0.13),
            0 4px 22px rgba(0,0,0,0.55),
            inset 0 1px 0 rgba(255,255,255,0.05);
        transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .seleccion-canton-wrap .canton-seleccion-card.quito-card {
        border-color: rgba(0,229,255,0.35);
        box-shadow:
            0 0 22px rgba(0,229,255,0.1),
            0 4px 22px rgba(0,0,0,0.55),
            inset 0 1px 0 rgba(255,255,255,0.05);
    }
    .seleccion-canton-wrap .canton-seleccion-card:active {
        transform: scale(0.97);
        box-shadow:
            0 0 32px rgba(212,175,55,0.32),
            0 2px 12px rgba(0,0,0,0.5),
            inset 0 1px 0 rgba(255,255,255,0.08);
        border-color: rgba(212,175,55,0.78);
        transition-duration: 0.08s;
    }
    .seleccion-canton-wrap .canton-seleccion-card.quito-card:active {
        box-shadow:
            0 0 32px rgba(0,229,255,0.25),
            0 2px 12px rgba(0,0,0,0.5);
        border-color: rgba(0,229,255,0.65);
    }

    /* Badge visible en las selection cards */
    .seleccion-canton-wrap .canton-card-badge {
        display: inline-flex;
        align-items: center;
        font-size: 0.6em;
        padding: 2px 8px;
        margin-bottom: 8px;
    }
    /* Emoji: glow dorado / cyan según cantón */
    .seleccion-canton-wrap .canton-seleccion-emoji {
        font-size: 2em;
        filter: drop-shadow(0 0 10px rgba(212,175,55,0.55));
    }
    .seleccion-canton-wrap .quito-card .canton-seleccion-emoji {
        filter: drop-shadow(0 0 10px rgba(0,229,255,0.48));
    }
    /* Flecha: acento dorado / cyan */
    .seleccion-canton-wrap .canton-seleccion-arrow {
        font-size: 1.4em;
        color: rgba(212,175,55,0.68);
    }
    .seleccion-canton-wrap .quito-card .canton-seleccion-arrow {
        color: rgba(0,229,255,0.58);
    }

    /* Grid title: compacto en móvil */
    .seleccion-canton-wrap .seleccion-grid-titulo { margin: 14px 0 10px; }

    /* "← Volver al inicio" / "← Volver al Ranking" — pill dorado premium */
    .seleccion-canton-wrap .btn-explorar-pill {
        width: 100%;
        max-width: 100%;
        margin: 14px 0 0;
        padding: 12px 18px;
        border: 1.5px solid rgba(212,175,55,0.52);
        border-radius: 12px;
        font-size: 0.84em;
        font-weight: 700;
        color: #fbbf24;
        background: rgba(212,175,55,0.06);
        box-shadow: 0 0 16px rgba(212,175,55,0.14), inset 0 1px 0 rgba(255,255,255,0.04);
        letter-spacing: 0.04em;
        -webkit-tap-highlight-color: transparent;
    }
    .seleccion-canton-wrap .btn-explorar-pill:active {
        background: rgba(212,175,55,0.15);
        box-shadow: 0 0 26px rgba(212,175,55,0.32);
        transform: scale(0.97);
        transition-duration: 0.08s;
    }

    /* ─ Tighten map/legend spacing ─ */
    .mapa-legend    { margin-top: 4px; }
    .mapa-neon-hint { margin-top: 2px; margin-bottom: 2px; }

    /* ─ Banner ads 1 & 2: compact ad bars, shared style ─ */
    .banner-hero-mobile,
    .banner-checkpoint-mobile {
        display: flex;
        align-items: center;
        width: 100%;
        border-radius: 12px;
        overflow: hidden;
        position: relative; /* containing block para cualquier pseudo-elemento interno */
        margin-bottom: 6px;
        background: rgba(10,16,30,0.82);
        border: 1px dashed rgba(212,175,55,0.28);
        box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    }
    .banner-hero-mobile    { margin-bottom: 8px; }
    .banner-checkpoint-mobile { margin-bottom: 6px; }

    /* Reusar los estilos .promo-invitacion dentro de los banners mobile */
    .banner-hero-mobile .promo-invitacion,
    .banner-checkpoint-mobile .promo-invitacion {
        width: 100%;
        padding: 9px 12px;
        gap: 8px;
    }
    .banner-hero-mobile .promo-invitacion-texto strong,
    .banner-checkpoint-mobile .promo-invitacion-texto strong {
        font-size: 0.78em;
    }
    .banner-hero-mobile .promo-invitacion-btn,
    .banner-checkpoint-mobile .promo-invitacion-btn {
        font-size: 0.68em;
        padding: 4px 10px;
        white-space: nowrap;
    }

    /* ─ Banners inferiores 3 y 4: compactos y full-width en mobile ─ */
    #seccion-info-inferior,
    #seccion-info-inferior-2 {
        width: 100%;
        max-width: 100%;
        min-height: 0;
        padding: 0;
        margin: 0 0 6px 0;
        border-radius: 12px;
        background: rgba(10,16,30,0.82);
        border: 1px dashed rgba(212,175,55,0.28);
        box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    }
    #seccion-info-inferior .promo-invitacion,
    #seccion-info-inferior-2 .promo-invitacion {
        padding: 9px 12px;
        gap: 8px;
    }
    #seccion-info-inferior .promo-invitacion-texto strong,
    #seccion-info-inferior-2 .promo-invitacion-texto strong {
        font-size: 0.78em;
    }
    #seccion-info-inferior .promo-invitacion-btn,
    #seccion-info-inferior-2 .promo-invitacion-btn {
        font-size: 0.68em;
        padding: 4px 10px;
        white-space: nowrap;
    }
}

/* ── Ranking topbar: oculta en móvil (móvil usa su propio flujo de selección) ── */
@media (max-width: 860px) {
    .ranking-topbar { display: none; }
}

/* ══ TOAST — responsive mobile ══════════════════════════════ */
/* En móvil aparece arriba: el podio viral ocupa todo el espacio
   central + inferior con las opciones de compartir, y un toast
   abajo tapaba esos botones. Arriba queda libre y la alerta de
   "voto registrado" no obstruye nada. */
@media (max-width: 767px) {
    /* Toast en MÓVIL: aparece debajo del botón rojo "Cerrar" del podio
       viral, PEGADO al borde izquierdo. La posición vertical exacta la
       calcula JS leyendo getBoundingClientRect de #pv-btn-cerrar; el
       46vh es fallback si esa medición no llega a tiempo.
       COMPACTO: chip neón pequeño anclado a la izquierda, ancho
       ajustado al contenido (max 248px). Animación vertical suave. */
    #toast-voto {
        top: 46vh;
        bottom: auto;
        right: auto;
        left: 12px;
        width: max-content;
        max-width: calc(100vw - 24px);
        min-width: 0;
        gap: 8px;
        padding: 7px 13px 9px;
        border-radius: 12px;
        transform: translateY(-10px);
        transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    #toast-voto.toast-visible {
        opacity: 1;
        transform: translateY(0);
    }
    #toast-voto.toast-saliendo {
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.55s ease-in, transform 0.55s ease-in;
    }
    /* Texto e icono compactos pero aún legibles */
    #toast-voto-icono { font-size: 1.15em; line-height: 1; }
    #toast-voto-texto { gap: 1px; }
    #toast-voto-titulo { font-size: 0.74em; line-height: 1.2; }
    #toast-voto-candidato { font-size: 0.68em; }
    #toast-voto-barra { height: 2px; }
    /* Barra de progreso del toast — re-sincronizada a los 6s nuevos */
    #toast-voto.toast-visible #toast-voto-barra {
        animation-duration: 6s;
    }
}

/* ══ PODIO VIRAL — responsive mobile (rediseño compacto neón) ══
   Objetivo: tarjeta capturable más pequeña y proporcionada,
   nombres legibles sin aplastarse, botones/iconos ordenados,
   y botón Cerrar destacado en rojo elegante.
═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    #podio-viral-overlay {
        padding: 8px 6px;
        gap: 0;
    }
    .pv-dialog {
        gap: 8px;
        max-width: 100%;
    }

    /* ── Tarjeta capturable: aún más compacta, sin perder elegancia ── */
    #podio-viral-captura {
        padding: 12px 10px 9px;
        border-radius: 14px;
        max-width: 340px;
        margin: 0 auto;
    }
    #podio-viral-header { margin-bottom: 9px; }
    #podio-viral-logo-text { font-size: 0.88em; margin-bottom: 1px; }
    #podio-viral-subtitulo { font-size: 0.62em; letter-spacing: 0.08em; }

    /* ── Grid del podio: más apretado pero ordenado ── */
    #podio-viral-grid {
        gap: 6px;
        margin-bottom: 10px;
        padding: 3px 2px 0;
    }
    .pv-card {
        padding: 8px 4px 0;
        gap: 3px;
        border-radius: 11px;
        max-width: none;
    }
    .pv-card-1 { min-height: 138px; }
    .pv-card-2 { min-height: 116px; }
    .pv-card-3 { min-height: 98px; }

    .pv-medalla { font-size: 1.25em; }
    .pv-foto-wrap {
        width: 38px;
        height: 38px;
        font-size: 1.05em;
    }
    .pv-card-1 .pv-foto-wrap { width: 46px; height: 46px; }

    /* Nombres: legibles, sin aplastarse */
    .pv-nombre {
        font-size: 0.68em;
        line-height: 1.22;
        letter-spacing: 0.005em;
        padding: 0 1px;
    }
    .pv-card-1 .pv-nombre { font-size: 0.74em; }
    .pv-votos { font-size: 0.60em; }

    .pv-laurel-row { font-size: 0.64em; margin-top: 1px; padding: 0 3px; }

    /* Barras de podio: proporcionadas al alto reducido */
    .pv-card-1 .pv-barra { height: 27px; }
    .pv-card-2 .pv-barra { height: 19px; }
    .pv-card-3 .pv-barra { height: 13px; }

    #podio-viral-pie {
        font-size: 0.62em;
        padding-top: 8px;
        letter-spacing: 0.03em;
    }

    /* ── Panel de acciones: compacto y centrado ── */
    #podio-viral-acciones {
        gap: 8px;
        max-width: 340px;
        margin: 0 auto;
    }
    #pv-texto-viral {
        font-size: 0.82em;
        line-height: 1.5;
        padding: 0 4px;
    }

    /* Botón WhatsApp — borde dorado neón en móvil también, ligeramente
       más sutil que en desktop para no recargar la pantalla. */
    #pv-btn-whatsapp {
        font-size: 0.95em;
        padding: 12px 18px;
        gap: 8px;
        box-shadow:
            0 0 0 1px rgba(251, 191, 36, 0.28),
            0 0 14px rgba(251, 191, 36, 0.28),
            0 3px 14px rgba(37, 211, 102, 0.38),
            inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    }

    /* ── Iconos sociales: directamente DEBAJO del WhatsApp (el botón
       "Compartir imagen del Podio" se eliminó). Más grandes para tap
       cómodo y para que la fila de redes "respire" en pantalla. ── */
    #pv-iconos-sociales {
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: center;
        width: auto;
        margin-top: 8px;
        padding: 0;
    }
    .pv-social-icon {
        width: 52px;
        height: 52px;
    }
    .pv-social-icon svg { width: 24px; height: 24px; }

    /* ── Botón CERRAR — rojo elegante, más grande y más bajo en móvil
         para que sea cómodo de tocar con el pulgar al final del flujo. */
    #pv-btn-cerrar {
        margin-top: 16px;
        padding: 15px 38px;
        font-size: 1.02em;
        font-weight: 700;
        letter-spacing: 0.02em;
        min-height: 52px;
        color: #fca5a5;
        background: linear-gradient(180deg, rgba(239, 68, 68, 0.10) 0%, rgba(185, 28, 28, 0.08) 100%);
        border: 1px solid rgba(248, 113, 113, 0.45);
        border-radius: 999px;
        box-shadow:
            0 0 16px rgba(239, 68, 68, 0.22),
            0 0 0 1px rgba(239, 68, 68, 0.10) inset;
        transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s;
    }
    #pv-btn-cerrar:hover,
    #pv-btn-cerrar:focus-visible,
    #pv-btn-cerrar:active {
        color: #fee2e2;
        border-color: rgba(248, 113, 113, 0.75);
        background: linear-gradient(180deg, rgba(239, 68, 68, 0.18) 0%, rgba(185, 28, 28, 0.14) 100%);
        box-shadow:
            0 0 22px rgba(239, 68, 68, 0.40),
            0 0 0 1px rgba(248, 113, 113, 0.30) inset;
        transform: translateY(-1px);
    }
}

/* ── Teléfonos pequeños (≤380px): apretar un punto más sin romper ── */
@media (max-width: 380px) {
    #podio-viral-captura { padding: 10px 8px 8px; max-width: 320px; }
    #podio-viral-grid { gap: 5px; }
    .pv-card { padding: 7px 3px 0; }
    .pv-card-1 { min-height: 128px; }
    .pv-card-2 { min-height: 108px; }
    .pv-card-3 { min-height: 92px; }
    .pv-foto-wrap { width: 34px; height: 34px; }
    .pv-card-1 .pv-foto-wrap { width: 42px; height: 42px; }
    .pv-nombre { font-size: 0.64em; }
    .pv-card-1 .pv-nombre { font-size: 0.70em; }
    .pv-votos { font-size: 0.58em; }
    #pv-iconos-sociales { gap: 6px; margin-top: 6px; }
    .pv-social-icon { width: 46px; height: 46px; }
    .pv-social-icon svg { width: 21px; height: 21px; }
    #pv-btn-whatsapp { font-size: 0.92em; padding: 11px 16px; }
    #pv-btn-cerrar { padding: 13px 32px; font-size: 0.97em; min-height: 48px; }
}

/* ── SECCIÓN PERFIL — responsive mobile ─────────────────── */
@media (max-width: 767px) {
    .seccion-perfil { padding: 16px 4px 40px; }
    .pp-header { padding: 18px 16px 14px; border-radius: 18px; }
    .pp-badge-icon-circle { width: 44px; height: 44px; font-size: 1.4em; }
    .pp-badge-nivel { font-size: 1em; }
    .pp-pct-badge { font-size: 1.3em; }
    .pp-tabs { gap: 4px; padding: 4px; }
    .pp-tab { font-size: 0.80em; padding: 10px 4px; }
    .pp-tab-sub { display: none; }
    .pp-pill { font-size: 0.80em; padding: 7px 12px; }
    #seccion-perfil .pp-pill-row[data-campo="edad_rango"] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #seccion-perfil .pp-pill.edad-pill {
        width: 100%;
        min-width: 0;
        min-height: 56px;
        padding: 8px 6px;
    }
    .pp-charts-grid { grid-template-columns: 1fr; }
    .nav-perfil-chip .nav-nivel-badge { display: none; } /* Ahorra espacio en nav mobile */
}

/* ── POPUP PODER CIUDADANO — ajustes móvil ─────────────── */
@media (max-width: 480px) {
    #popup-perfil-overlay {
        align-items: center;
        padding:
            max(10px, env(safe-area-inset-top))
            10px
            max(10px, env(safe-area-inset-bottom));
    }

    #popup-perfil-caja {
        width: min(92vw, 368px);
        max-height: min(92dvh, 720px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-radius: 20px;
        padding: 20px 14px 16px;
        border-top-width: 2px;
        box-shadow:
            0 0 0 1px rgba(14,165,233,0.10),
            0 0 34px rgba(14,165,233,0.13),
            0 18px 42px rgba(0,0,0,0.68);
    }
    #popup-perfil-caja::-webkit-scrollbar { display: none; }

    #popup-perfil-cerrar {
        top: 8px; right: 9px;
        width: 34px; height: 34px;
        display: grid; place-items: center;
        border-radius: 999px;
        background: rgba(15,23,42,0.58);
        border: 1px solid rgba(148,163,184,0.18);
        font-size: 1.24em;
    }

    .perfil-poder-header {
        gap: 7px;
        margin: 0 34px 10px;
    }
    .perfil-poder-icono { font-size: 1.42em; }
    .perfil-poder-header h3 {
        font-size: 1.02em;
        line-height: 1.08;
    }

    .perfil-poder-barra-wrap {
        gap: 9px;
        margin-bottom: 12px;
    }
    .perfil-poder-barra-track { height: 8px; }
    .perfil-poder-pct {
        min-width: 34px;
        font-size: 0.76em;
    }

    .perfil-mensaje-principal {
        font-size: 0.78em;
        line-height: 1.42;
        margin-bottom: 13px;
        padding: 9px 10px;
        border-radius: 10px;
    }

    .perfil-pill-grupo { margin-bottom: 10px; }
    .perfil-pill-label {
        font-size: 0.70em;
        letter-spacing: 0.035em;
        margin-bottom: 6px;
    }
    .perfil-pill-row {
        display: grid;
        gap: 6px;
    }
    .perfil-pill-row[data-group="edad"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .perfil-pill-row[data-group="genero"],
    .perfil-pill-row[data-group="ocupacion"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .perfil-pill {
        min-height: 36px;
        width: 100%;
        padding: 7px 7px;
        border-radius: 14px;
        font-size: 0.76em;
        line-height: 1.15;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        overflow-wrap: anywhere;
    }
    .perfil-pill.edad-pill {
        min-width: 0;
        min-height: 52px;
        padding-inline: 5px;
    }
    .edad-pill-generacion {
        font-size: 0.70em;
    }

    #popup-perfil-btn-votar {
        min-height: 42px;
        margin-top: 12px;
        margin-bottom: 8px;
        padding: 10px 16px;
        font-size: 0.90em;
        box-shadow: 0 4px 18px rgba(14,165,233,0.38);
    }
    #popup-perfil-btn-saltar {
        min-height: 34px;
        padding: 7px 12px;
        font-size: 0.78em;
    }
}

@media (max-width: 380px) {
    #popup-perfil-caja {
        width: 94vw;
        padding: 18px 12px 14px;
    }
    .perfil-poder-header { margin-bottom: 9px; }
    .perfil-mensaje-principal {
        font-size: 0.75em;
        padding: 8px 9px;
        margin-bottom: 11px;
    }
    .perfil-pill-grupo { margin-bottom: 9px; }
    .perfil-pill { font-size: 0.72em; min-height: 34px; padding-inline: 5px; }
    .perfil-pill.edad-pill { min-height: 48px; }
    #popup-perfil-btn-votar { min-height: 40px; font-size: 0.86em; }
}

@media (max-width: 480px) and (max-height: 700px) {
    #popup-perfil-overlay { align-items: flex-start; }
    #popup-perfil-caja {
        max-height: calc(100dvh - 16px);
        padding-top: 17px;
        padding-bottom: 13px;
    }
    .perfil-poder-header { margin-bottom: 8px; }
    .perfil-poder-barra-wrap { margin-bottom: 9px; }
    .perfil-mensaje-principal {
        line-height: 1.34;
        margin-bottom: 10px;
    }
    .perfil-pill-grupo { margin-bottom: 8px; }
    .perfil-pill { min-height: 33px; }
    #popup-perfil-btn-votar { margin-top: 9px; }
}

/* ══════════════════════════════════════════════════════════
   ZONA TÁCTIL AMPLIADA RUMIÑAHUI
   Elipse 100% invisible (sin fill, sin stroke, sin animación)
   que solo recibe eventos de tap en móvil. En escritorio los
   clics atraviesan al polígono real debajo.
══════════════════════════════════════════════════════════ */
#ruminahui-touch {
    fill: transparent;
    stroke: none;
    pointer-events: none;
}

@media (max-width: 767px) {
    #ruminahui-touch {
        pointer-events: auto;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
}
