/* ==========================================================================
   VARIABLES Y CONFIGURACIÓN GLOBAL (MAXIQUEEN OS)
   ========================================================================== */
:root {
    --mq-neon: #00ff66;
    --mq-neon-glow: rgba(0, 255, 102, 0.4);
    --mq-dark-bg: #070908;
    --mq-dark-panel: #121513;
    --mq-text: #f8fafc;
}

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

/* Fondo Cyberpunk Neon de la Página */
.mq-widget-page {
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--mq-text, #f8fafc);
    background:
        radial-gradient(circle at 50% 0%, rgba(250, 204, 21, .12), transparent 28%),
        radial-gradient(circle at 85% 18%, rgba(34, 211, 238, .14), transparent 28%),
        radial-gradient(circle at 12% 18%, rgba(192, 132, 252, .14), transparent 30%),
        linear-gradient(180deg, #05070f 0%, #020617 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mq-widget-page::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background:
        linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .82), transparent 84%);
}

/* Cascarón contenedor principal */
.mq-widget-shell {
    display: grid;
    min-height: 100dvh;
    place-items: center;
    gap: 22px;
    padding: 34px 18px;
}

/* ==========================================================================
   SECCIÓN INTRODUCTORIA / HERO
   ========================================================================== */
.mq-widget-intro {
    width: min(860px, 100%);
    text-align: center;
}

.mq-widget-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(250, 204, 21, .28);
    border-radius: 999px;
    background: rgba(250, 204, 21, .08);
    color: #fde68a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    box-shadow: 0 0 28px rgba(250, 204, 21, .12);
}

.mq-widget-intro h1 {
    max-width: 780px;
    margin: 18px auto 10px;
    color: #fff;
    font-size: clamp(34px, 6vw, 76px);
    font-weight: 950;
    letter-spacing: 0;
    line-height: .98;
    text-wrap: balance;
}

.mq-widget-intro p {
    max-width: 720px;
    margin: 0 auto;
    color: #cbd5e1;
    font-size: clamp(16px, 2.2vw, 21px);
    line-height: 1.55;
}

/* ==========================================================================
   COMPONENTE CHAT: CONTENCIÓN DE ELEMENTOS INTERNOS (VISTA ESCRITORIO)
   ========================================================================== */
.mq-chat {
    position: relative;
    right: auto;
    bottom: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Encierra estrictamente todo su contenido */
    
    width: min(760px, calc(100vw - 28px));
    height: min(690px, calc(100dvh - 230px));
    min-height: 560px;
    margin: 0;
    
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(8, 13, 27, .98), rgba(19, 11, 35, .96)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 24px);
    box-shadow:
        0 26px 80px rgba(0, 0, 0, .55),
        0 0 34px rgba(45, 212, 191, .11),
        inset 0 1px 0 rgba(255, 255, 255, .09);
    backdrop-filter: blur(22px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.mq-chat::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background:
        linear-gradient(90deg, rgba(34, 211, 238, .12), transparent 25%, rgba(244, 114, 182, .1) 62%, transparent),
        linear-gradient(0deg, rgba(250, 204, 21, .07), transparent 28%);
    opacity: .76;
}

/* ESTRUCTURA INTERNA IMPENETRABLE (FLEX LAYOUT) */
.mq-chat-header {
    flex-shrink: 0; /* Bloquea el tamaño para que no colapse */
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    background: rgba(3, 7, 18, .64);
}

.mq-signal-bar {
    flex-shrink: 0; /* Bloquea el tamaño */
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(15, 23, 42, .36);
}

/* Zona de Scroll Única */
.mq-chat-body {
    display: flex !important;
    flex: 1 1 auto; /* Absorbe dinámicamente todo el espacio sobrante */
    flex-direction: column;
    gap: 16px;
    min-height: 0; /* Regla de oro para activar el overflow-y en flex containers */
    overflow-y: auto;
    padding: 22px;
    scroll-behavior: smooth;
}

.mq-attachment-tray {
    flex-shrink: 0; /* Bloquea el tamaño */
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    max-height: 118px;
    overflow-y: auto;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(2, 6, 23, .34);
}

.mq-attachment-tray.is-empty {
    display: none !important;
}

.mq-voice-panel {
    flex-shrink: 0; /* Bloquea el tamaño */
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 14px 0;
    background: rgba(2, 6, 23, .55);
}

.mq-chat-input {
    flex-shrink: 0; /* Bloquea el tamaño */
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) 86px;
    gap: 10px;
    align-items: center;
    padding: 12px 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(2, 6, 23, .55);
}

/* ==========================================================================
   ESTILOS DE SUB-ELEMENTOS DEL CHAT (BOTONES, BURBUJAS, CONTROLES)
   ========================================================================== */
.mq-agent {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.mq-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(103, 232, 249, .52);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, .95), rgba(22, 78, 99, .78)),
        linear-gradient(45deg, rgba(251, 191, 36, .2), transparent);
    box-shadow: 0 0 22px rgba(34, 211, 238, .22), inset 0 0 18px rgba(255, 255, 255, .06);
}

.mq-antenna {
    position: absolute;
    top: -9px;
    left: 50%;
    width: 2px;
    height: 10px;
    background: #facc15;
    transform: translateX(-50%);
}

.mq-antenna::after {
    position: absolute;
    top: -5px;
    left: 50%;
    width: 8px;
    height: 8px;
    content: "";
    border-radius: 99px;
    background: #22d3ee;
    box-shadow: 0 0 12px rgba(34, 211, 238, .9);
    transform: translateX(-50%);
}

.mq-eye {
    position: absolute;
    top: 20px;
    width: 9px;
    height: 9px;
    border-radius: 99px;
    background: #e0f2fe;
    box-shadow: 0 0 12px rgba(125, 211, 252, .95);
}

.mq-eye-left { left: 15px; }
.mq-eye-right { right: 15px; }

.mq-mouth {
    position: absolute;
    bottom: 14px;
    left: 50%;
    width: 24px;
    height: 5px;
    border-radius: 999px;
    background: #facc15;
    box-shadow: 0 0 12px rgba(250, 204, 21, .65);
    transform: translateX(-50%);
}

.chat-title {
    overflow: hidden;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: .6px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-title span {
    color: #facc15;
    text-shadow: 0 0 16px rgba(250, 204, 21, .45);
}

.mq-status {
    max-width: 210px;
    margin-top: 5px;
    overflow: hidden;
    color: #a5f3fc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.mq-chat-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.mq-chat-controls button, .mq-chip-btn, .mq-file-btn, #mqSendBtn {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .12);
    color: #f8fafc;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.mq-chat-controls button {
    width: 44px;
    height: 38px;
    border-radius: 14px;
    background: rgba(15, 23, 42, .85);
    font-size: 12px;
    font-weight: 800;
}

.mq-chat-controls button:hover, .mq-chip-btn:hover, .mq-file-btn:hover, #mqSendBtn:hover {
    border-color: rgba(34, 211, 238, .5);
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(34, 211, 238, .13);
}

.mq-chat-controls button.is-active, .mq-chip-btn.is-active {
    border-color: rgba(74, 222, 128, .55);
    background: rgba(22, 101, 52, .32);
    color: #bbf7d0;
}

.mq-signal-bar span {
    min-width: 0;
    overflow: hidden;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    background: rgba(2, 6, 23, .36);
    color: #dbeafe;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.mq-signal-bar span:nth-child(2) { color: #fde68a; }
.mq-signal-bar span:nth-child(3) { color: #f0abfc; }
.mq-signal-bar span:nth-child(4) { color: #86efac; }

.mq-message {
    display: flex;
    width: 100%;
    animation: fadeUp .25s ease;
}

.mq-message.user { justify-content: flex-end; }
.mq-message.bot { justify-content: flex-start; }

.mq-bubble {
    max-width: min(88%, 560px);
    padding: 14px 15px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.mq-message.bot .mq-bubble {
    color: #f8fafc;
    border: 1px solid rgba(103, 232, 249, .16);
    border-bottom-left-radius: 7px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(17, 24, 39, .86)),
        linear-gradient(90deg, rgba(34, 211, 238, .12), transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.mq-message.user .mq-bubble {
    color: #111827;
    border-bottom-right-radius: 7px;
    background: linear-gradient(135deg, #fde047, #fb923c);
    font-weight: 750;
    box-shadow: 0 10px 30px rgba(251, 191, 36, .18);
}

.mq-quick-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
    max-width: 100%;
    margin: -4px 0 4px;
    padding-left: 2px;
}

.mq-quick-action {
    display: inline-flex !important;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(34, 211, 238, .22);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(15, 23, 42, .9), rgba(30, 41, 59, .78)), rgba(2, 6, 23, .72);
    color: #dbeafe;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .03em;
    padding: 8px 11px;
    margin: 0 !important;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.mq-attachment {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    gap: 8px;
    width: 100%;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    background: rgba(15, 23, 42, .68);
}

.mq-attachment-thumb {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(34, 211, 238, .12);
    color: #facc15;
    font-size: 11px;
    font-weight: 900;
}

.mq-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mq-attachment-name {
    overflow: hidden;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mq-chip-btn {
    height: 36px;
    border-radius: 12px;
    background: rgba(15, 23, 42, .78);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 850;
}

.mq-file-btn {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: rgba(34, 211, 238, .12);
    color: #a5f3fc;
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
}

.mq-file-btn input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#mqInput {
    width: 100%;
    height: 46px;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 15px;
    outline: none;
    padding: 0 14px;
    background: rgba(15, 23, 42, .82);
    color: #fff;
    font-size: 14px;
}

#mqSendBtn {
    width: 86px;
    height: 46px;
    border-radius: 15px;
    background: linear-gradient(135deg, #fde047, #22d3ee);
    color: #020617;
    font-size: 13px;
    font-weight: 950;
}

/* ==========================================================================
   ESTADO MINIMIZADO / INTERFAZ FLOTANTE MÓVIL
   ========================================================================== */
.mq-chat.minimized {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: min(390px, calc(100vw - 24px));
    height: min(640px, calc(100dvh - 32px));
    min-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(.96);
    visibility: hidden;
}

.mq-chat.minimized .mq-signal-bar,
.mq-chat.minimized .mq-chat-body,
.mq-chat.minimized .mq-attachment-tray,
.mq-chat.minimized .mq-voice-panel,
.mq-chat.minimized .mq-chat-input {
    display: none !important;
}

.mq-burbuja-v2 {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99998;
    width: 86px;
    height: 86px;
    overflow: hidden;
    border: 1px solid rgba(250, 204, 21, .42);
    border-radius: 999px;
    background: radial-gradient(circle at 50% 35%, rgba(250, 204, 21, .18), transparent 55%), rgba(2, 6, 23, .92);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .42), 0 0 30px rgba(250, 204, 21, .22);
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.mq-chat:not(.minimized) + .mq-burbuja-v2 {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(12px) scale(.92);
}

.mq-video-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   SECCIÓN PREMIUM: REACTOR VISUAL / ENGINES
   ========================================================================== */
.mq-core-premium {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: radial-gradient(circle at center, var(--mq-dark-panel) 0%, var(--mq-dark-bg) 100%);
    padding: 60px 20px;
    border-radius: 24px;
    border: 1px solid rgba(0, 255, 102, 0.1);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 255, 102, 0.05);
    overflow: hidden;
    position: relative;
    font-family: 'Courier New', Courier, monospace;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.mq-visual-engine {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mq-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.mq-ring-outer {
    width: 100%;
    height: 100%;
    border-top: 2px solid var(--mq-neon);
    border-right: 2px solid var(--mq-neon);
    animation: mqSpin 8s linear infinite;
    box-shadow: 0 0 15px var(--mq-neon-glow);
}

.mq-ring-middle {
    width: 75%;
    height: 75%;
    border-bottom: 2px dashed var(--mq-neon);
    border-left: 2px dashed rgba(0, 255, 102, 0.5);
    animation: mqSpinReverse 5s linear infinite;
}

.mq-ring-inner {
    width: 50%;
    height: 50%;
    border: 1px dotted var(--mq-neon);
    animation: mqSpin 3s linear infinite;
    opacity: 0.7;
}

.mq-core-center-btn {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(0, 255, 102, 0.1);
    border: 1px solid var(--mq-neon);
    border-radius: 50%;
    color: var(--mq-neon);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 20px var(--mq-neon-glow);
    backdrop-filter: blur(4px);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.mq-core-center-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 255, 102, 0.2);
    box-shadow: 0 0 40px var(--mq-neon-glow);
}

.mq-core-text {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: 5px;
    text-shadow: 0 0 8px var(--mq-neon);
}

.mq-voice-wave {
    display: flex;
    gap: 3px;
    height: 15px;
    align-items: flex-end;
}

.mq-voice-wave span {
    width: 3px;
    background: var(--mq-neon);
    border-radius: 1px;
    animation: mqWave 1.2s ease-in-out infinite;
}

.mq-voice-wave span:nth-child(1) { animation-delay: 0.0s; }
.mq-voice-wave span:nth-child(2) { animation-delay: 0.2s; }
.mq-voice-wave span:nth-child(3) { animation-delay: 0.4s; }
.mq-voice-wave span:nth-child(4) { animation-delay: 0.2s; }
.mq-voice-wave span:nth-child(5) { animation-delay: 0.0s; }

.mq-terminal-data { text-align: center; color: #fff; z-index: 2; }
.mq-glitch-title {
    font-size: 32px;
    font-weight: 900;
    margin: 0;
    color: #ffffff;
    text-shadow: 2px 2px 0px rgba(0, 255, 102, 0.7), -2px -2px 0px rgba(255, 0, 102, 0.7);
    letter-spacing: 4px;
    position: relative;
    animation: mqGlitch 3s infinite;
}

.mq-subtitle-type { font-size: 14px; color: var(--mq-neon); margin: 10px 0 20px; letter-spacing: 1px; }
.mq-metrics-grid { display: flex; flex-direction: column; gap: 10px; background: rgba(0, 0, 0, 0.5); padding: 12px 20px; border-radius: 8px; border: 1px solid rgba(0, 255, 102, 0.2); }
.mq-status-badge { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--mq-neon); font-size: 14px; font-weight: bold; }
.mq-pulse-dot { width: 10px; height: 10px; background: var(--mq-neon); border-radius: 50%; box-shadow: 0 0 10px var(--mq-neon); animation: mqPulseDot 1.5s infinite; }
.mq-live-metrics { font-size: 12px; color: rgba(255, 255, 255, 0.6); display: flex; gap: 10px; justify-content: center; }
.mq-separator { color: var(--mq-neon); opacity: 0.5; }
.mq-burbuja-v2.hidden-bubble { opacity: 0; transform: scale(0.8); pointer-events: none; }

/* ==========================================================================
   MEDIA QUERIES COMPLETAS Y CORREGIDAS
   ========================================================================== */
@media (max-width: 720px) {
    .mq-widget-shell {
        justify-content: stretch;
        padding: 18px 10px;
    }

    .mq-widget-intro h1 { font-size: 38px; }
    .mq-widget-intro p { font-size: 15px; }

    .mq-chat {
        width: 100%;
        height: calc(100dvh - 190px);
        min-height: 520px;
        border-radius: 22px;
    }
}

@media (max-width: 560px) {
    .mq-widget-page {
        overflow: hidden; /* Evita scrolls raros en móviles */
    }

    .mq-widget-shell {
        display: block;
        gap: 14px;
        padding: 14px 0 0;
        height: 100dvh;
    }

    .mq-widget-intro { padding: 0 14px; }
    .mq-widget-badge { min-height: 30px; font-size: 10px; }
    .mq-widget-intro h1 { margin-top: 12px; font-size: 32px; }

    /* ANCLADO TOTAL DE APP NATIVA EN MÓVIL */
    .mq-chat {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 70dvh !important; /* Ajuste perfecto de altura */
        max-height: none !important;
        border-radius: 22px 22px 0 0 !important;
        border-right: 0 !important;
        border-bottom: 0 !important;
        border-left: 0 !important;
    }

    .mq-chat-header { min-height: 84px; padding: 13px 12px; }
    .mq-avatar { width: 50px; height: 50px; border-radius: 16px; }
    .chat-title { font-size: 18px; }
    .mq-status { max-width: 160px; }
    .mq-chat-controls button { width: 40px; height: 36px; }
    .mq-signal-bar { gap: 6px; padding: 9px 10px; }
    .mq-signal-bar span { padding: 6px 4px; font-size: 9px; letter-spacing: .05em; }
    .mq-chat-body { padding: 14px 12px; }
    .mq-bubble { max-width: 90%; font-size: 13.5px; }
    .mq-voice-panel { gap: 6px; padding: 10px 10px 0; }
    .mq-chip-btn { height: 34px; font-size: 11px; }
    
    .mq-chat-input {
        grid-template-columns: 42px minmax(0, 1fr) 76px;
        gap: 8px;
        padding: 10px;
    }

    .mq-file-btn, #mqInput, #mqSendBtn { height: 44px; border-radius: 14px; }
    .mq-file-btn { width: 42px; }
    #mqSendBtn { width: 76px; font-size: 12px; }
    .mq-burbuja-v2 { right: 16px; bottom: 16px; width: 72px; height: 72px; }
}

/* ==========================================================================
   ANIMACIONES CORE
   ========================================================================== */
@keyframes mqSpin { 100% { transform: rotate(360deg); } }
@keyframes mqSpinReverse { 100% { transform: rotate(-360deg); } }
@keyframes mqPulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.4; } }
@keyframes mqWave { 0%, 100% { height: 4px; } 50% { height: 15px; box-shadow: 0 0 8px var(--mq-neon); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes avatarSpeak { from { height: 4px; width: 18px; } to { height: 12px; width: 28px; } }
@keyframes avatarListen { 0%, 100% { box-shadow: 0 0 16px rgba(74, 222, 128, .2), inset 0 0 18px rgba(255, 255, 255, .06); } 50% { box-shadow: 0 0 30px rgba(74, 222, 128, .38), inset 0 0 18px rgba(255, 255, 255, .06); } }
@keyframes typingPulse { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-1px); } }
@keyframes mqGlitch {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 2px); }
    94% { transform: translate(2px, -2px); }
    96% { transform: translate(-2px, -2px); }
}

/* ==========================================================================
CORRECCIÓN PARA WIDGET FLOTANTE EN PÁGINAS EXTERNAS (ESCRITORIO)
========================================================================== */
@media (min-width: 561px) {
.mq-chat.mq-widget-floating:not(.minimized) {
    position: fixed !important;
    right: 24px !important;
    bottom: 124px !important; /* Se ubica justo por encima de la burbuja .mq-burbuja-v2 */
    left: auto !important;
    top: auto !important;
    z-index: 99999 !important; /* Evita que elementos de la otra página lo tapen */
    width: 430px !important; /* Un ancho más estilizado para modo widget flotante */
    height: min(650px, calc(100dvh - 160px)) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(34, 211, 238, 0.15);
}
}
