/* Landing Avatar — hero vídeo, canvas frames, hero escritorio + chat */

html {
    background: var(--bg-dark);
    overscroll-behavior: none;
}

body.landing-avatar-page {
    margin: 0;
    overflow-x: hidden;
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* H1 único para SEO (texto alineado con <title>); no altera el layout del hero */
.avatar-seo-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mientras precarga frames + vídeo intro (JS añade .avatar-preload-lock) */
html.avatar-preload-lock,
body.avatar-preload-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
    height: 100%;
}

/* ─── Secuencia fija (hero + canvas) ─── */
.avatar-sequences {
    position: fixed;
    inset: 0;
    z-index: 7;
    pointer-events: auto;
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.avatar-sequences.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.avatar-sequences.avatar-sequences--gsap-fade {
    transition: none !important;
}

.avatar-sequences.avatar-sequences--soft-reveal {
    pointer-events: none;
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .avatar-sequences {
        transition-duration: 0.12s;
    }
}

.avatar-hero-video-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.avatar-hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    /* iOS Safari: a veces el plano de vídeo no compone hasta tener capa propia */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

video.avatar-video-error {
    background: var(--bg-dark);
}

.avatar-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
}

.avatar-hero-logo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: avatar-hero-logo-reveal 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

/* Overlay “Toca para revivir”: sin logo del hero 1 (clase la pone landing_avatar.js) */
.avatar-sequences.avatar-sequences--revive-active .avatar-hero-logo-wrap {
    animation: none !important;
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.32s ease, visibility 0.32s ease;
}

@media (prefers-reduced-motion: reduce) {
    .avatar-hero-logo-wrap {
        animation: none;
        opacity: 1;
    }
}

.avatar-hero-logo-glow {
    position: absolute;
    width: min(420px, 92vw);
    height: 140px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -58%);
    background: radial-gradient(
        ellipse at center,
        rgba(0, 200, 220, 0.22) 0%,
        rgba(80, 120, 255, 0.08) 45%,
        transparent 72%
    );
    pointer-events: none;
    filter: blur(2px);
    animation: avatar-hero-glow-pulse 5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .avatar-hero-logo-glow {
        animation: none;
        opacity: 0.85;
    }
}

@keyframes avatar-hero-glow-pulse {
    0%, 100% { opacity: 0.75; transform: translate(-50%, -58%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -58%) scale(1.06); }
}

@keyframes avatar-hero-logo-reveal {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.avatar-hero-logo {
    position: relative;
    z-index: 1;
    display: block;
    width: min(260px, 58vw);
    height: auto;
    filter:
        brightness(0) invert(1)
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45))
        drop-shadow(0 12px 40px rgba(0, 0, 0, 0.35));
    opacity: 0.97;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Barra de precarga (hero): encima del canvas, debajo del overlay “revivir” */
.avatar-preload-bar {
    position: absolute;
    left: 50%;
    bottom: max(52px, calc(env(safe-area-inset-bottom, 0px) + 40px));
    transform: translateX(-50%);
    /* Por encima de la guía de scroll (4); por debajo de “Toca para revivir” (40) */
    z-index: 15;
    width: min(200px, 42vw);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.avatar-preload-bar.is-visible {
    opacity: 1;
    visibility: visible;
}

.avatar-preload-bar.is-done {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.4s;
}

.avatar-preload-bar__track {
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.avatar-preload-bar__fill {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    transform-origin: left center;
    transform: scaleX(0);
    background: linear-gradient(
        90deg,
        rgba(0, 200, 220, 0.55) 0%,
        rgba(120, 180, 255, 0.95) 50%,
        rgba(0, 200, 220, 0.75) 100%
    );
    box-shadow: 0 0 12px rgba(0, 200, 220, 0.35);
    transition: transform 0.22s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .avatar-preload-bar,
    .avatar-preload-bar.is-done {
        transition-duration: 0.05s;
    }
    .avatar-preload-bar__fill {
        transition: none;
    }
}

/* Capa fija encima del canvas: guía de scroll */
.avatar-scroll-guide {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: max(36px, env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}

.avatar-hero-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.avatar-hero-scroll-hint i {
    font-size: 22px;
    animation: avatar-bounce 2s ease-in-out infinite;
}

@keyframes avatar-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* Hero2: flecha + texto transparentes; pista 2s tras scroll arriba (ver landing_avatar.js) */
.avatar-scroll-up-hint {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 12;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    pointer-events: none;
}

.avatar-scroll-up-hint__btn {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    min-height: 44px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    color: rgba(255, 255, 255, 0.92);
    transition: transform 0.18s ease;
}

.avatar-scroll-up-hint__icon-up {
    display: block;
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
    animation: avatar-bounce-up 2.2s ease-in-out infinite;
}

.avatar-scroll-up-hint__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    text-transform: none;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
    animation: avatar-scroll-up-label-pulse 1.4s ease-in-out infinite;
}

@keyframes avatar-bounce-up {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(-7px); opacity: 1; }
}

@keyframes avatar-scroll-up-label-pulse {
    0%, 100% { opacity: 0.82; }
    50% { opacity: 1; }
}

.avatar-scroll-up-hint__btn:hover {
    transform: scale(1.06);
}

.avatar-scroll-up-hint__btn:active {
    transform: scale(0.92);
}

@keyframes avatar-scroll-up-tap {
    0% { transform: scale(1); }
    45% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.avatar-scroll-up-hint__btn.avatar-scroll-up-hint__btn--tap {
    animation: avatar-scroll-up-tap 0.38s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .avatar-scroll-up-hint__icon-up,
    .avatar-scroll-up-hint__label {
        animation: none;
    }

    .avatar-scroll-up-hint__btn.avatar-scroll-up-hint__btn--tap {
        animation: none;
    }

    .avatar-scroll-up-hint__btn:hover,
    .avatar-scroll-up-hint__btn:active {
        transform: none;
    }
}

/* Móvil: “Toca para revivir” — latidos + reanimación al tocar */
.avatar-revive-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: max(24px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
    visibility: hidden;
}

.avatar-revive-overlay.is-active {
    display: flex;
    pointer-events: auto;
    visibility: visible;
}

.avatar-revive-overlay:focus-visible {
    outline: 2px solid rgba(0, 200, 220, 0.65);
    outline-offset: -4px;
}

.avatar-revive-overlay__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 50% 38%,
        rgba(255, 80, 120, 0.18) 0%,
        rgba(0, 200, 220, 0.2) 22%,
        rgba(20, 24, 55, 0.9) 52%,
        rgba(6, 8, 22, 0.98) 100%
    );
    animation: avatar-revive-glow-heartbeat 1.15s ease-in-out infinite;
    transform-origin: 50% 38%;
}

.avatar-revive-overlay__ripples {
    position: absolute;
    left: 50%;
    top: 38%;
    width: 1px;
    height: 1px;
    z-index: 0;
    pointer-events: none;
}

.avatar-revive-overlay__ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(280px, 70vw);
    height: min(280px, 70vw);
    margin-left: calc(min(280px, 70vw) / -2);
    margin-top: calc(min(280px, 70vw) / -2);
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 230, 0.45);
    opacity: 0;
    transform: scale(0.35);
    pointer-events: none;
}

.avatar-revive-overlay.is-reviving .avatar-revive-overlay__ripple:nth-child(1) {
    animation: avatar-revive-ripple-out 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.avatar-revive-overlay.is-reviving .avatar-revive-overlay__ripple:nth-child(2) {
    animation: avatar-revive-ripple-out 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.avatar-revive-overlay.is-reviving .avatar-revive-overlay__ripple:nth-child(3) {
    animation: avatar-revive-ripple-out 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.24s forwards;
}

/* Destello tipo “desfibrilador” / reanimación */
.avatar-revive-overlay__shock {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(
        circle at 50% 38%,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(0, 240, 220, 0.35) 28%,
        transparent 62%
    );
    opacity: 0;
}

.avatar-revive-overlay.is-reviving .avatar-revive-overlay__shock {
    animation: avatar-revive-shock-flash 0.55s ease-out forwards;
}

.avatar-revive-overlay__content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 340px;
    animation: avatar-revive-content-heartbeat 1.15s ease-in-out infinite;
}

.avatar-revive-overlay__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(
        145deg,
        rgba(255, 100, 130, 0.35),
        rgba(0, 200, 220, 0.32),
        rgba(99, 102, 241, 0.22)
    );
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 0 0 0 rgba(255, 90, 120, 0.35),
        0 0 56px rgba(0, 200, 220, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    animation: avatar-revive-icon-heartbeat 1.15s ease-in-out infinite;
}

.avatar-revive-overlay__icon .avatar-revive-overlay__heart-svg {
    display: block;
    width: 36px;
    height: 36px;
    color: rgba(255, 230, 240, 0.98);
    filter: drop-shadow(0 0 12px rgba(0, 200, 220, 0.55));
}

.avatar-revive-overlay__title {
    margin: 0;
    font-size: clamp(22px, 5.5vw, 30px);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    text-shadow:
        0 4px 28px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(255, 90, 120, 0.35),
        0 0 56px rgba(0, 200, 220, 0.4);
}

.avatar-revive-overlay__sub {
    margin: 14px 0 0;
    font-size: 11px;
    color: rgba(225, 235, 255, 0.72);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Doble latido (lub–dub), pausa, repetir */
@keyframes avatar-revive-glow-heartbeat {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    8% {
        transform: scale(1.04);
        filter: brightness(1.12);
    }
    14% {
        transform: scale(1);
        filter: brightness(1);
    }
    22% {
        transform: scale(1.025);
        filter: brightness(1.08);
    }
    30% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes avatar-revive-icon-heartbeat {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(255, 90, 120, 0.35),
            0 0 56px rgba(0, 200, 220, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.18);
    }
    8% {
        transform: scale(1.14);
        box-shadow:
            0 0 0 14px rgba(255, 90, 120, 0.12),
            0 0 72px rgba(0, 200, 220, 0.65),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }
    14% {
        transform: scale(1);
    }
    22% {
        transform: scale(1.08);
        box-shadow:
            0 0 0 8px rgba(0, 200, 220, 0.1),
            0 0 64px rgba(0, 200, 220, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.18);
    }
    30% {
        transform: scale(1);
    }
}

@keyframes avatar-revive-content-heartbeat {
    0%, 100% { transform: translateY(0) scale(1); }
    8% { transform: translateY(-2px) scale(1.03); }
    14% { transform: translateY(0) scale(1); }
    22% { transform: translateY(-1px) scale(1.02); }
    30% { transform: translateY(0) scale(1); }
}

@keyframes avatar-revive-ripple-out {
    0% {
        opacity: 0.85;
        transform: scale(0.35);
    }
    100% {
        opacity: 0;
        transform: scale(2.4);
    }
}

@keyframes avatar-revive-shock-flash {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }
    18% {
        opacity: 1;
        transform: scale(1.05);
    }
    45% {
        opacity: 0.35;
        transform: scale(1);
    }
    70% {
        opacity: 0.65;
        transform: scale(1.02);
    }
    100% {
        opacity: 0;
        transform: scale(1.15);
    }
}

.avatar-revive-overlay.is-reviving .avatar-revive-overlay__glow {
    animation: avatar-revive-glow-reanimate 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.avatar-revive-overlay.is-reviving .avatar-revive-overlay__content {
    animation: avatar-revive-text-rebirth 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.avatar-revive-overlay.is-reviving .avatar-revive-overlay__icon {
    animation: avatar-revive-icon-jolt 0.85s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

.avatar-revive-overlay.is-done {
    pointer-events: none !important;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0s 0.4s;
}

@keyframes avatar-revive-glow-reanimate {
    0% {
        opacity: 1;
        filter: brightness(1);
        transform: scale(1);
    }
    25% {
        filter: brightness(1.6);
        transform: scale(1.08);
    }
    55% {
        filter: brightness(1.25);
        transform: scale(1.02);
    }
    100% {
        opacity: 0;
        filter: brightness(1.9);
        transform: scale(1.35);
    }
}

@keyframes avatar-revive-text-rebirth {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0) brightness(1);
    }
    20% {
        transform: translateY(0) scale(1.06);
        filter: blur(0) brightness(1.35);
    }
    100% {
        transform: translateY(-28vh) scale(1.08);
        opacity: 0;
        filter: blur(10px) brightness(1.5);
    }
}

@keyframes avatar-revive-icon-jolt {
    0% {
        transform: scale(1);
    }
    12% {
        transform: scale(1.35) rotate(-6deg);
    }
    24% {
        transform: scale(1.2) rotate(4deg);
    }
    45% {
        transform: scale(1.45);
        filter: brightness(1.4) drop-shadow(0 0 24px rgba(0, 255, 230, 0.9));
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
        filter: brightness(2) blur(4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .avatar-revive-overlay__glow,
    .avatar-revive-overlay__content,
    .avatar-revive-overlay__icon {
        animation: none;
    }

    .avatar-revive-overlay.is-reviving .avatar-revive-overlay__glow,
    .avatar-revive-overlay.is-reviving .avatar-revive-overlay__content,
    .avatar-revive-overlay.is-reviving .avatar-revive-overlay__icon,
    .avatar-revive-overlay.is-reviving .avatar-revive-overlay__shock,
    .avatar-revive-overlay.is-reviving .avatar-revive-overlay__ripple {
        animation: none;
    }

    .avatar-revive-overlay.is-reviving .avatar-revive-overlay__shock {
        opacity: 0.5;
    }

    .avatar-revive-overlay.is-reviving .avatar-revive-overlay__content,
    .avatar-revive-overlay.is-reviving .avatar-revive-overlay__icon {
        opacity: 0;
    }
}

.avatar-canvas-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
}

#avatar-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.avatar-canvas-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: transparent;
}

/* Spacers de scroll */
.avatar-intro-spacer {
    height: 100vh;
    height: 100dvh;
    position: relative;
    z-index: 0;
}

.avatar-scroll-spacer {
    height: 280vh;
    position: relative;
    z-index: 0;
    background: var(--bg-dark);
}

@media (max-width: 900px) {
    .avatar-scroll-spacer {
        height: 240vh;
    }
}

/* ─── Hero escritorio ─── */
.avatar-hero-desk {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 5;
}

.avatar-hero-desk--sticky {
    position: sticky;
    top: 0;
}

.avatar-desk-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Móvil (hero 2): encuadre hacia la izquierda — en portrait el recorte central suele perder el sujeto */
@media (max-width: 900px) {
    .avatar-hero-desk .avatar-desk-video {
        object-position: left center;
    }
}

.avatar-desk-video--typing { opacity: 0; z-index: 2; }
.avatar-desk-video--idle   { z-index: 1; }

.avatar-hero-desk.is-bot-typing .avatar-desk-video--idle   { opacity: 0; }
.avatar-hero-desk.is-bot-typing .avatar-desk-video--typing { opacity: 1; }

.avatar-desk-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: transparent;
    pointer-events: none;
}

/* ── Layout UI: hub centrado + chat a la derecha ── */
.avatar-desk-ui {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    --avatar-desk-chat-col: min(420px, calc(100% - 32px));
    --avatar-desk-chat-gap: clamp(14px, 2.5vw, 22px);
}

.avatar-desk-hub-area {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: calc(var(--avatar-desk-chat-col) + var(--avatar-desk-chat-gap));
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 20px;
    box-sizing: border-box;
    pointer-events: none;
}

.avatar-desk-chat-area {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--avatar-desk-chat-col);
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 24px 10px;
    box-sizing: border-box;
    pointer-events: none;
    min-height: 0;
}

.avatar-desk-hub-area .avatar-desk-hub,
.avatar-desk-chat-area .avatar-chat-panel {
    pointer-events: auto;
}

@media (min-width: 1240px) {
    .avatar-desk-hub-area .avatar-desk-hub {
        transform: translateX(calc((var(--avatar-desk-chat-col) + var(--avatar-desk-chat-gap)) / 2));
    }
}


/* ═══════════════════════════════════════════════
   HUB — "Explora Wemvy" — grid 2×2, icon circles with color glow
   ═══════════════════════════════════════════════ */
.avatar-desk-hub {
    width: 100%;
    max-width: 420px;
    margin: 0;
    padding: 28px 22px 24px;
    border-radius: 22px;
    /* Escritorio: ligera transparencia + blur (mucho más opaco que móvil ~0.4) */
    background: linear-gradient(
        160deg,
        rgba(22, 22, 48, 0.56) 0%,
        rgba(12, 12, 30, 0.59) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.048);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-sizing: border-box;
}

.avatar-hub-quick { margin: 0; padding: 0; }

.avatar-hub-quick-title {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: rgba(240, 240, 245, 0.8);
    margin: 0 0 20px;
    letter-spacing: 0.04em;
}

.avatar-hub-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Pill base */
.avatar-hub-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 10px;
    padding: 20px 10px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.072);
    background: rgba(255, 255, 255, 0.044);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    transition:
        border-color 0.28s ease,
        background 0.28s ease,
        transform 0.28s ease,
        box-shadow 0.28s ease;
}

/* Hover glow overlay (per color) */
.avatar-hub-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.avatar-hub-pill[data-color="cyan"]::before   { background: radial-gradient(ellipse at 50% 20%, rgba(0, 200, 220, 0.13) 0%, transparent 70%); }
.avatar-hub-pill[data-color="purple"]::before { background: radial-gradient(ellipse at 50% 20%, rgba(167, 139, 250, 0.13) 0%, transparent 70%); }
.avatar-hub-pill[data-color="blue"]::before   { background: radial-gradient(ellipse at 50% 20%, rgba(99, 102, 241, 0.13) 0%, transparent 70%); }
.avatar-hub-pill[data-color="green"]::before  { background: radial-gradient(ellipse at 50% 20%, rgba(52, 211, 153, 0.13) 0%, transparent 70%); }

.avatar-hub-pill:hover::before { opacity: 1; }

.avatar-hub-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.avatar-hub-pill[data-color="cyan"]:hover   { border-color: rgba(0, 200, 220, 0.35); }
.avatar-hub-pill[data-color="purple"]:hover { border-color: rgba(167, 139, 250, 0.35); }
.avatar-hub-pill[data-color="blue"]:hover   { border-color: rgba(99, 102, 241, 0.35); }
.avatar-hub-pill[data-color="green"]:hover  { border-color: rgba(52, 211, 153, 0.35); }

.avatar-hub-pill:active { transform: translateY(0); }
.avatar-hub-pill:focus-visible { outline: 2px solid rgba(0, 200, 220, 0.55); outline-offset: 2px; }

/* Icon circle */
.avatar-hub-pill-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}
.avatar-hub-pill-icon i { font-size: 22px; }

/* Per-color icon circles */
.avatar-hub-pill[data-color="cyan"] .avatar-hub-pill-icon   { background: rgba(0, 200, 220, 0.1);   box-shadow: 0 0 22px rgba(0, 200, 220, 0.18); }
.avatar-hub-pill[data-color="cyan"] .avatar-hub-pill-icon i { color: var(--accent-cyan); }

.avatar-hub-pill[data-color="purple"] .avatar-hub-pill-icon   { background: rgba(167, 139, 250, 0.1);  box-shadow: 0 0 22px rgba(167, 139, 250, 0.18); }
.avatar-hub-pill[data-color="purple"] .avatar-hub-pill-icon i { color: var(--accent-purple); }

.avatar-hub-pill[data-color="blue"] .avatar-hub-pill-icon   { background: rgba(99, 102, 241, 0.1);   box-shadow: 0 0 22px rgba(99, 102, 241, 0.18); }
.avatar-hub-pill[data-color="blue"] .avatar-hub-pill-icon i { color: var(--accent-blue); }

.avatar-hub-pill[data-color="green"] .avatar-hub-pill-icon   { background: rgba(52, 211, 153, 0.1);   box-shadow: 0 0 22px rgba(52, 211, 153, 0.18); }
.avatar-hub-pill[data-color="green"] .avatar-hub-pill-icon i { color: var(--accent-green); }

/* Hover glow intensify */
.avatar-hub-pill[data-color="cyan"]:hover .avatar-hub-pill-icon   { box-shadow: 0 0 30px rgba(0, 200, 220, 0.38);   background: rgba(0, 200, 220, 0.16); }
.avatar-hub-pill[data-color="purple"]:hover .avatar-hub-pill-icon { box-shadow: 0 0 30px rgba(167, 139, 250, 0.38); background: rgba(167, 139, 250, 0.16); }
.avatar-hub-pill[data-color="blue"]:hover .avatar-hub-pill-icon   { box-shadow: 0 0 30px rgba(99, 102, 241, 0.38);  background: rgba(99, 102, 241, 0.16); }
.avatar-hub-pill[data-color="green"]:hover .avatar-hub-pill-icon  { box-shadow: 0 0 30px rgba(52, 211, 153, 0.38);  background: rgba(52, 211, 153, 0.16); }

/* Pill text */
.avatar-hub-pill-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.avatar-hub-pill-text strong { font-size: 13px; font-weight: 700; line-height: 1.25; }
.avatar-hub-pill-text small  { font-size: 10.5px; color: var(--text-secondary); font-weight: 500; line-height: 1.35; opacity: 0.85; }


/* ═══════════════════════════════════════════════
   CHAT PANEL — vidrio premium
   ═══════════════════════════════════════════════ */
.avatar-chat-panel {
    pointer-events: auto;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    align-self: center;
    /* Escritorio: altura fija moderada (auto rompe flex:1 en .chat-messages) */
    height: min(52dvh, 52vh, 500px);
    max-height: min(58dvh, 58vh, 520px);
    min-height: min(34dvh, 34vh, 360px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(
        175deg,
        rgba(18, 18, 40, 0.61) 0%,
        rgba(10, 10, 26, 0.64) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 28px 72px rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.048);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.avatar-chat-panel .chat-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(0, 200, 220, 0.048), rgba(99, 102, 241, 0.032));
    border-bottom: 1px solid rgba(255, 255, 255, 0.048);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.avatar-chat-panel .chat-header-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.avatar-chat-collapse-toggle {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.064);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.avatar-chat-collapse-toggle:hover {
    background: rgba(255, 255, 255, 0.096);
}

.avatar-chat-collapse-toggle:focus-visible {
    outline: 2px solid rgba(0, 200, 220, 0.55);
    outline-offset: 2px;
}

.avatar-chat-collapse-toggle i {
    font-size: 20px;
    transition: transform 0.28s ease;
}

.avatar-chat-panel.is-collapsed .avatar-chat-collapse-toggle i {
    transform: rotate(180deg);
}

.avatar-chat-panel .chat-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    box-shadow: 0 0 18px rgba(0, 200, 220, 0.25);
}

.avatar-chat-panel .chat-messages {
    /* Ocupa todo el hueco entre cabecera e input; min-height:0 + padre con height fija → scroll interno real */
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.avatar-chat-panel .chat-bubble.bot {
    background: rgba(255, 255, 255, 0.036);
    border: 1px solid rgba(255, 255, 255, 0.064);
}

.avatar-chat-panel .chat-input {
    border-top: 1px solid rgba(255, 255, 255, 0.048);
    padding: 14px 16px;
    flex-shrink: 0;
}

.avatar-chat-panel .chat-input input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    /* ≥16px: iOS Safari no hace zoom automático al focus (rompe la vista del hero) */
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.avatar-chat-panel .chat-input input:focus {
    border-color: rgba(0, 200, 220, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 200, 220, 0.08);
}

.avatar-chat-panel .chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    box-shadow: 0 4px 16px rgba(0, 200, 220, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-chat-panel .chat-send-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 22px rgba(0, 200, 220, 0.38);
}

.avatar-chat-panel .chat-powered {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.032);
    padding: 10px 16px;
    font-size: 11px;
    opacity: 0.6;
}


/* ═══════════════════════════════════════════════
   RESPONSIVE ≤ 900px
   ═══════════════════════════════════════════════ */
@media (max-width: 900px) {
    .avatar-desk-ui {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
        padding: 0;
        min-height: 0;
    }

    .avatar-desk-hub-area {
        position: relative;
        left: auto; right: auto; top: auto; bottom: auto;
        flex: 0 0 auto;
        padding: 16px 16px 10px;
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
        align-self: center;
    }

    .avatar-desk-chat-area {
        position: relative;
        top: auto; right: auto; bottom: auto;
        /* Crece hacia arriba y deja sitio al hub abajo (antes 0 grow → panel minúsculo) */
        flex: 1 1 0%;
        min-height: 0;
        width: 100%;
        padding: 0 16px max(12px, env(safe-area-inset-bottom, 0px));
        /* Más alto útil para mensajes en móvil */
        max-height: min(88dvh, 88vh, 860px);
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
    }

    .avatar-desk-hub {
        max-width: none;
        padding: 20px 16px 18px;
        border-radius: 18px;
        /* Móvil: sin blur; hub un poco más opaco que antes para legibilidad (chat sin cambio) */
        background: linear-gradient(
            160deg,
            rgba(22, 22, 48, 0.4) 0%,
            rgba(12, 12, 30, 0.44) 100%
        );
        border: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow:
            0 14px 36px rgba(0, 0, 0, 0.26),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .avatar-hub-pill {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.11);
    }

    .avatar-hub-pill-text small { max-width: none; }

    .avatar-chat-panel {
        max-width: none;
        flex: 1 1 auto;
        width: 100%;
        /* Llena el chat-area; suelo más alto para #chat-messages-hero */
        height: 100%;
        max-height: 100%;
        min-height: min(54dvh, 54vh, 560px);
        background: linear-gradient(
            175deg,
            rgba(18, 18, 40, 0.3) 0%,
            rgba(10, 10, 26, 0.34) 100%
        );
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow:
            0 14px 36px rgba(0, 0, 0, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .avatar-chat-panel .chat-header {
        background: linear-gradient(135deg, rgba(0, 200, 220, 0.04), rgba(99, 102, 241, 0.02));
    }

    .avatar-chat-panel .chat-bubble.bot {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.09);
    }

    .avatar-chat-panel .chat-input input {
        background: rgba(255, 255, 255, 0.025);
        border-color: rgba(255, 255, 255, 0.11);
    }

    .avatar-chat-collapse-toggle {
        display: flex;
        background: rgba(255, 255, 255, 0.05);
    }

    /* Por defecto en móvil el JS añade .is-collapsed: solo cabecera para que quepa el hub */
    .avatar-chat-panel.is-collapsed .chat-messages,
    .avatar-chat-panel.is-collapsed .chat-input,
    .avatar-chat-panel.is-collapsed .chat-powered {
        display: none !important;
    }

    .avatar-chat-panel.is-collapsed {
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        max-height: none;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 200, 220, 0.15);
        user-select: none;
        -webkit-user-select: none;
    }

    .avatar-chat-panel.is-collapsed .chat-header {
        border-bottom: none;
        cursor: pointer;
    }

    .avatar-chat-panel.is-collapsed .avatar-chat-collapse-toggle {
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
    }

    .avatar-desk-chat-area:has(.avatar-chat-panel.is-collapsed) {
        max-height: none;
        flex: 0 0 auto;
        padding-top: 8px;
    }

    /*
     * Móvil: chat expandido ↔ hub compacto (evita superposición; prioridad al foco activo).
     * Clase .avatar-desk-ui--chat-expanded la pone landing_avatar.js al quitar .is-collapsed.
     */
    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-desk-hub-area {
        flex: 0 0 auto;
        padding: 6px 10px 4px;
        max-width: 100%;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-desk-hub {
        padding: 10px 10px 8px;
        border-radius: 14px;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-hub-quick-title {
        display: none;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-hub-quick-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
        padding: 2px 0 4px;
        margin: 0;
        grid-template-columns: unset;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-hub-pill {
        flex: 0 0 auto;
        min-width: 4.5rem;
        max-width: 5.5rem;
        padding: 10px 6px 8px;
        gap: 6px;
        scroll-snap-align: start;
        touch-action: manipulation;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-hub-pill-text small {
        display: none;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-hub-pill-text strong {
        font-size: 9.5px;
        line-height: 1.2;
        text-align: center;
        max-width: 100%;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-hub-pill-icon {
        width: 38px;
        height: 38px;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-hub-pill-icon i {
        font-size: 18px;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-desk-chat-area {
        flex: 1 1 0%;
        min-height: 0;
        max-height: min(72dvh, 72vh, 640px);
        padding-top: 4px;
    }

    .avatar-desk-ui.avatar-desk-ui--chat-expanded .avatar-chat-panel {
        min-height: min(42dvh, 42vh, 420px);
        max-height: 100%;
    }
}


/* ── Otros componentes ── */
.avatar-explore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}

.avatar-explore-btn:hover {
    background: rgba(0, 200, 220, 0.15);
    border-color: rgba(0, 200, 220, 0.45);
}

/* Contacto (partial): CTA hacia el asistente en hero escritorio */
.avatar-contact-assistant-wrap {
    display: flex;
    justify-content: center;
    margin: 20px auto 28px;
    max-width: 520px;
}

.avatar-cta-assistant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 28px;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #00c8b3 0%, #00a896 35%, #0891b2 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 4px 24px rgba(0, 200, 180, 0.45),
        0 12px 40px rgba(0, 160, 200, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.avatar-cta-assistant-btn i {
    font-size: 22px;
    opacity: 0.95;
}

.avatar-cta-assistant-btn:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.08);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.28),
        0 8px 32px rgba(0, 220, 200, 0.55),
        0 16px 48px rgba(0, 180, 220, 0.35);
}

.avatar-cta-assistant-btn:active {
    transform: translateY(0) scale(0.98);
}

.avatar-cta-assistant-btn:focus-visible {
    outline: 2px solid rgba(0, 240, 220, 0.9);
    outline-offset: 3px;
}

/* Pulso al volver al chat del hero escritorio */
#wemvy-chat-hero.avatar-chat-highlight {
    animation: avatar-chat-pulse 1.1s ease-in-out 3;
    box-shadow:
        0 0 0 2px rgba(0, 220, 200, 0.85),
        0 0 40px 12px rgba(0, 200, 180, 0.35),
        0 24px 80px rgba(0, 0, 0, 0.55);
}

@keyframes avatar-chat-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 2px rgba(0, 220, 200, 0.5),
            0 0 28px 6px rgba(0, 200, 180, 0.25),
            0 24px 80px rgba(0, 0, 0, 0.55);
    }
    50% {
        box-shadow:
            0 0 0 3px rgba(0, 255, 230, 0.95),
            0 0 48px 14px rgba(0, 230, 210, 0.45),
            0 24px 80px rgba(0, 0, 0, 0.55);
    }
}

/* Contenido oculto */
.avatar-content-below {
    position: relative;
    z-index: 6;
    background: var(--bg-dark);
}

.avatar-content-below.avatar-content-hidden {
    display: none !important;
}

.avatar-content-below:not(.avatar-content-hidden) {
    animation: avatar-content-in 0.6s ease forwards;
}

@keyframes avatar-content-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/*
 * Tras quitar .active-section (reset al volver al hero2), las .content-section quedan en display:none
 * pero el footer seguía visible. Solo mostrarlo cuando hay una sección activa (misma lógica que el cuerpo).
 */
.landing-avatar-page #avatar-content-below:not(:has(.content-section.active-section)) .landing-footer {
    display: none;
}
