/* --- CHAT FLOTANTE --- */
/* En móvil, espacio extra por encima de la barra inferior del iframe (jugamos.lat) */
:root {
    --chat-embed-tab-bar-offset: 0px;
    /* Distancia desde abajo hasta la píldora cuando el iframe del casino está visible (0 = usar solo tab-bar-offset). */
    --chat-casino-fab-bottom: 0px;
}

/* Teléfonos y vistas estrechas: el chat sube para no tapar la barra del casino (iframe) */
@media (max-width: 640px) {
    :root {
        --chat-embed-tab-bar-offset: 58px;
    }

    /* registro.html: no hay iframe del casino; bajar la burbuja para no tapar “¿Ya tenés cuenta? Entrar” */
    body.smartplay-page-registro {
        --chat-embed-tab-bar-offset: 0px;
    }

    body.smartplay-page-registro .chat-widget {
        bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
    }
}

/* registro.html: overlay de espera + cartel de credenciales usan z-index ~10k; el chat debe quedar encima */
body.smartplay-page-registro .chat-widget {
    z-index: 11000;
}
body.smartplay-page-registro #chatPopup {
    z-index: 2147483641 !important;
}

/*
 * index embebido (no es jugamos.lat) + sesión de chat + iframe avisa inGame (postMessage).
 * Oculta la píldora y el popup amarillo; no afecta registro.html ni jugamos.lat top-level.
 */
/*
 * Ocultar en juego sin `display:none`: los rescates con estilos en línea (`!important`) dejaban
 * el dock visible aunque el body tuviera esta clase.
 */
body.smartplay-embed-hide-chat #chatWidget,
body.smartplay-embed-hide-chat #chatPopup {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate3d(0, 12px, 0) scale(0.96) !important;
}

/*
 * Intro SMARTPLAY (z-index ~2000): en algunos WebView el stacking tapa el chat si queda “justo encima”.
 * :has() es amplio en navegadores actuales; solo sube z-index en esta pantalla.
 */
body:has(#casinoIntro:not(.casino-intro--hidden)) #chatWidget {
    z-index: 50000 !important;
}
body:has(#casinoIntro:not(.casino-intro--hidden)) #chatPopup {
    /* +1 respecto al widget: mismo stacking y orden DOM no tapa el recordatorio */
    z-index: 50001 !important;
}

.chat-widget {
    position: fixed;
    bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px) + var(--chat-embed-tab-bar-offset, 0px));
    /* Margen mínimo al borde derecho; en casino (iframe) se fuerza aún más abajo. */
    right: max(2px, env(safe-area-inset-right, 0px) + 1px);
    width: 300px;
    height: 400px;
    max-height: calc(100dvh - 1.25rem - env(safe-area-inset-bottom, 0px) - var(--chat-embed-tab-bar-offset, 0px));
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    /* Por encima del intro (2000), toast instalación (2120) y del iframe; debajo del popup global admin */
    z-index: 12000;
    pointer-events: auto;
    overflow: hidden; /* el scroll va dentro de .chat-body / .auth-container */
    transition: height 0.25s ease, width 0.3s ease, box-shadow 0.3s ease;
}

/* Panel abierto (logueado o login): mismas medidas siempre — 300×400 */
.chat-widget:not(.minimized):not(.chat-widget--micro) {
    width: 300px;
    height: 400px;
    max-height: calc(100dvh - 1.25rem - env(safe-area-inset-bottom, 0px) - var(--chat-embed-tab-bar-offset, 0px));
}

/*
 * Casino activo: la píldora minimizada sube (franja del juego).
 * El panel abierto vuelve abajo a la derecha como siempre.
 */
body.smartplay-casino-active {
    --chat-embed-tab-bar-offset: 0px;
    --chat-casino-fab-bottom: min(max(18dvh, 80px), 148px);
    --chat-casino-expanded-bottom-offset: 0px;
}

@media (max-width: 640px) {
    body.smartplay-casino-active {
        /* ~franja morada lateral del panel (Pragmatic / slots), por encima de − / + / spin */
        --chat-casino-fab-bottom: min(max(30dvh, 142px), 262px);
        /* Mismo margen que el chat expandido en móvil sin casino (evita barra del iframe) */
        --chat-casino-expanded-bottom-offset: 58px;
    }

    /*
     * URU2 (ganamos.plus): base baja +30 % y +20 % más (≈1,56×) para subir la píldora sin tapar modales.
     */
    html[data-smartplay-market="uru2"] body.smartplay-casino-active {
        --chat-casino-fab-bottom: calc(1.56 * (0.4rem + 58px));
    }
}

body.smartplay-casino-active .chat-widget.minimized {
    right: max(0px, env(safe-area-inset-right, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + var(--chat-casino-fab-bottom));
}

body.smartplay-casino-active .chat-widget:not(.minimized) {
    right: max(2px, env(safe-area-inset-right, 0px) + 1px);
    bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px) + var(--chat-casino-expanded-bottom-offset));
    max-height: calc(
        100dvh - 1.25rem - env(safe-area-inset-bottom, 0px) - var(--chat-casino-expanded-bottom-offset)
    );
}

body.smartplay-casino-active .chat-popup {
    /* Fallback: píldora ~50px; si JS ancla con --chat-popup-* sale desde el dock real (micro o pill). */
    right: var(--chat-popup-right, max(0px, env(safe-area-inset-right, 0px)));
    bottom: var(
        --chat-popup-bottom,
        calc(env(safe-area-inset-bottom, 0px) + var(--chat-casino-fab-bottom) + 50px + 6px)
    );
}

/*
 * Sin sesión: mismo shell 300×400 que con sesión; el formulario ocupa el .chat-body completo.
 */
.chat-widget.chat-widget--auth:not(.minimized) .chat-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.chat-widget.chat-widget--auth:not(.minimized) .auth-container {
    flex: 1 1 auto;
    min-height: 0;
    gap: 10px;
    margin: 0;
    padding: 10px 8px 12px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
}

body.smartplay-casino-active .install-promo-toast {
    bottom: calc(env(safe-area-inset-bottom, 0px) + var(--chat-casino-fab-bottom));
}

/* Sin sesión: solo formulario de login/registro (nada de chat ni panel bancario) */
.chat-widget.chat-widget--auth .chat-deposit-tabs,
.chat-widget.chat-widget--auth .chat-deposit-panel,
.chat-widget.chat-widget--auth .chat-input-container,
.chat-widget.chat-widget--auth .chat-bonus-terms,
.chat-widget.chat-widget--auth .attach-float-hint,
.chat-widget.chat-widget--auth .chat-messages,
.chat-widget.chat-widget--auth .chat-notification-opt-in {
    display: none !important;
}

.chat-widget.chat-widget--auth .chat-deposit-tabs[hidden],
.chat-widget.chat-widget--auth .chat-deposit-panel[hidden] {
    display: none !important;
}

/* Estado minimizado: píldora verde — foto, nombre, “en línea”, flecha y ». */
.chat-widget.minimized {
    width: max-content;
    min-width: 220px;
    max-width: min(320px, calc(100vw - 16px));
    height: 56px;
    border-radius: 999px;
    background-color: transparent;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
    overflow: visible;
}

.chat-header {
    background-color: #075e54; /* Verde oscuro WhatsApp */
    color: white;
    padding: 0;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    min-height: 50px;
    box-sizing: border-box;
    border-radius: 10px 10px 0 0;
    position: relative;
    gap: 0;
    overflow: visible;
    /* Solo los controles hijos capturan toques (abrir chat vs cerrar sesión) */
    cursor: default;
}

.chat-widget.minimized .chat-header {
    border-radius: 999px;
    min-height: 56px;
    height: 56px;
    background-color: #0f9464;
    position: relative;
    z-index: 3; /* Por encima del cuerpo: los toques abren el chat */
    flex-shrink: 0;
}

/**
 * Prioridad: abrir / cerrar el chat (avatar + título + flecha).
 * Separado del botón de cerrar sesión para móvil.
 */
.chat-header,
.chat-header-toggle {
    pointer-events: auto;
    position: relative;
    z-index: 4;
}

.chat-header-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
    padding: 8px 10px 8px 14px;
    box-sizing: border-box;
    border: none;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
    user-select: none;
    -webkit-user-select: none;
    -webkit-appearance: none;
    appearance: none;
}

.chat-header-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: -2px;
}

/* Columna “Cerrar sesión”: divisor respecto a la zona de abrir chat */
.chat-header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    flex-shrink: 0;
    padding: 0 8px 0 10px;
    margin: 6px 0;
    border-left: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow: -1px 0 0 rgba(0, 0, 0, 0.12);
}

.chat-header-actions[hidden] {
    display: none !important;
}

#logoutBtnHeader {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin: 0;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
    transition: opacity 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.chat-header-chevron {
    flex-shrink: 0;
    padding: 4px 2px 4px 6px;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.95;
}

#logoutBtnHeader:hover {
    opacity: 1;
}

#chatHeaderNotifBtn {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin: 0;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
    transition: opacity 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

#chatHeaderNotifBtn:hover {
    opacity: 1;
}

#chatHeaderAffiliateBtn {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin: 0;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
    transition: opacity 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

#chatHeaderAffiliateBtn:hover {
    opacity: 1;
}

#chatHeaderAffiliateBtn[hidden] {
    display: none !important;
}

.chat-widget.minimized #chatHeaderAffiliateBtn {
    min-width: 34px;
    min-height: 34px;
    font-size: 1.05rem;
}

.chat-affiliate-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #ece5dd;
}

.chat-affiliate-panel[hidden] {
    display: none !important;
}

.chat-affiliate-panel__head {
    flex: 0 0 auto;
    padding: 10px 12px 8px;
    background: #075e54;
    color: #fff;
}

.chat-affiliate-panel__back {
    display: inline-flex;
    align-items: center;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0 6px;
    font-family: inherit;
}

.chat-affiliate-panel__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.chat-affiliate-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
}

.chat-affiliate-stat {
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.chat-affiliate-stat--pending {
    border-left: 4px solid #15803d;
}

.chat-affiliate-stat--review {
    border-left: 4px solid #d97706;
}

.chat-affiliate-panel__blocked {
    font-size: 0.78rem;
    color: #b45309;
    margin: 0 0 10px;
    line-height: 1.4;
}

.chat-affiliate-panel__btn--withdraw {
    width: 100%;
    padding: 11px 16px;
    font-size: 0.9rem;
}

.chat-affiliate-panel__btn--withdraw:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.chat-affiliate-stat__label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 2px;
}

.chat-affiliate-stat__value {
    font-size: 1.15rem;
    color: #0f172a;
}

.chat-affiliate-panel__hint {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #475569;
    margin: 4px 0 12px;
}

.chat-affiliate-panel__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.chat-affiliate-panel__row--stack {
    flex-direction: column;
    align-items: stretch;
}

.chat-affiliate-panel__mono {
    font-size: 0.78rem;
    word-break: break-all;
    color: #1e293b;
}

.chat-affiliate-panel__link {
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

.chat-affiliate-panel__btn {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #e2e8f0;
    color: #0f172a;
    font-family: inherit;
}

.chat-affiliate-panel__btn--primary {
    background: #075e54;
    color: #fff;
}

.chat-affiliate-panel__sub {
    margin: 12px 0 6px;
    font-size: 0.88rem;
    color: #0f172a;
}

.chat-affiliate-panel__list {
    margin: 0;
    padding: 0 0 0 1rem;
    font-size: 0.76rem;
    line-height: 1.45;
    color: #334155;
}

.chat-widget.minimized #chatHeaderNotifBtn {
    min-width: 34px;
    min-height: 34px;
    font-size: 1.05rem;
}

.chat-header-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #fff;
}

.chat-header-titles {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
    text-align: left;
    min-width: 0;
}

.chat-header-name {
    font-size: 0.9rem;
    white-space: nowrap;
}

.chat-header-status {
    font-size: 0.6rem;
    font-weight: 500;
    opacity: 0.88;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.chat-header-status.chat-header-status--offline {
    opacity: 0.72;
    color: #fecaca;
}

.chat-header-wa {
    display: none;
}

html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    height: 78px;
    border-radius: 50%;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro)::before {
    content: "";
    position: absolute;
    left: -3px;
    top: -3px;
    width: 86px;
    height: 96px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 96'%3E%3Cdefs%3E%3CradialGradient id='f' cx='32%25' cy='26%25' r='70%25'%3E%3Cstop offset='0' stop-color='%233a3a3a'/%3E%3Cstop offset='.4' stop-color='%23141414'/%3E%3Cstop offset='.75' stop-color='%23050505'/%3E%3Cstop offset='1' stop-color='%23000'/%3E%3C/radialGradient%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff6c4'/%3E%3Cstop offset='.4' stop-color='%23e8c25a'/%3E%3Cstop offset='.72' stop-color='%23a56b12'/%3E%3Cstop offset='1' stop-color='%23fff1b0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M72.3 63.2 A37 37 0 1 0 45.2 78.9 L67.4 82.7 Z' fill='url(%23f)' stroke='url(%23g)' stroke-width='4.2' stroke-linejoin='miter' stroke-miterlimit='8'/%3E%3C/svg%3E") 0 0 / 86px 96px no-repeat;
    z-index: 0;
    pointer-events: none;
}

html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) .chat-header {
    width: 78px;
    height: 78px;
    min-height: 78px;
    border-radius: 50%;
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 1;
}

html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) .chat-header::before {
    content: "";
    position: absolute;
    left: 14%;
    right: 18%;
    top: 7px;
    height: 28%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 2;
}

html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) .chat-header-toggle {
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 7px 6px 6px;
    border-radius: 50%;
    gap: 0;
    z-index: 1;
}

html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) .chat-header-info,
html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) .chat-header-chevron,
html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) .chat-header-shrink {
    display: none !important;
}

html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) .chat-header-wa {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
}

.chat-header-wa__icon {
    width: 28px;
    height: 28px;
    display: block;
    filter:
        drop-shadow(0 2px 1px rgba(0, 0, 0, 0.75))
        drop-shadow(0 0 5px rgba(37, 211, 102, 0.7));
}

.chat-header-wa__text {
    color: #5dff57;
    font-weight: 800;
    font-size: 0.58rem;
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-align: center;
    text-shadow:
        0 1px 0 #06330c,
        0 2px 2px rgba(0, 0, 0, 0.85),
        0 0 6px rgba(80, 255, 90, 0.55);
}

html[data-smartplay-market="uruvip"] .chat-widget.minimized:not(.chat-widget--micro) #userUnreadBadge {
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    font-size: 0.62rem;
    border: 1.5px solid #fff;
    background: radial-gradient(circle at 35% 30%, #ff6a62, #e10600 70%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* Píldora: nombre + “en línea” siempre visibles */
.chat-widget.minimized .chat-header-titles {
    line-height: 1.05;
    min-width: max-content;
    flex-shrink: 0;
}

.chat-widget.minimized .chat-header-name {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.chat-widget.minimized .chat-header-status {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.92;
}

.chat-widget.minimized .chat-header-chevron {
    font-size: 0.72rem;
    margin-left: 2px;
}

.chat-widget.minimized .chat-header-img {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.92);
}

.chat-widget.minimized .chat-header-toggle {
    padding: 6px 4px 6px 8px;
    gap: 8px;
    min-width: 0;
}

.chat-widget.minimized .chat-header-info {
    gap: 6px !important;
}

.chat-widget.minimized .chat-header-actions {
    padding: 0 5px 0 6px;
    margin: 3px 0;
}

.chat-widget.minimized #logoutBtnHeader {
    min-width: 34px;
    min-height: 34px;
    font-size: 1.05rem;
}

/* Solo en píldora (no en panel abierto ni en modo icono): reducir a círculo mínimo */
.chat-header-shrink {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-height: 44px;
    margin: 0;
    padding: 0 2px;
    box-sizing: border-box;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.14);
    color: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.15);
    border-radius: 0;
    transition: background 0.15s ease;
}

.chat-header-shrink:hover {
    background: rgba(0, 0, 0, 0.22);
}

.chat-header-shrink:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: -2px;
}

.chat-header-shrink__icon {
    display: block;
    opacity: 0.95;
}

.chat-widget.minimized:not(.chat-widget--micro) .chat-header-shrink {
    display: flex;
    width: 40px;
    height: 40px;
    min-height: 40px;
    margin: 0 8px 0 2px;
    align-self: center;
    border-radius: 50%;
    border-left: none;
    background: rgba(0, 0, 0, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.chat-widget.minimized.chat-widget--micro .chat-header-shrink {
    display: none;
}

/* Modo “solo icono”: ~52px, casi no tapa el juego */
.chat-widget.minimized.chat-widget--micro {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.38);
}

.chat-widget.minimized.chat-widget--micro .chat-header {
    border-radius: 50%;
    min-height: 52px;
    height: 52px;
}

.chat-widget.minimized.chat-widget--micro .chat-header-toggle {
    flex: 1 1 auto;
    justify-content: center;
    align-items: center;
    padding: 5px;
    gap: 0;
    border-radius: 50%;
}

.chat-widget.minimized.chat-widget--micro .chat-header-titles,
.chat-widget.minimized.chat-widget--micro .chat-header-chevron {
    display: none !important;
}

.chat-widget.minimized.chat-widget--micro .chat-header-info {
    gap: 0 !important;
    justify-content: center;
}

.chat-widget.minimized.chat-widget--micro .chat-header-img {
    width: 38px;
    height: 38px;
}

.chat-widget.minimized.chat-widget--micro .chat-header-actions {
    display: none !important;
}

.chat-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0; /* clave: el flex hijo puede encogerse y hacer scroll interno */
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 8px;
    overflow: hidden;
    background-color: #efeae2; /* Fondo estilo WhatsApp */
    opacity: 1;
    transition: opacity 0.2s ease;
    border-radius: 0 0 10px 10px;
}

/* Franja: activar notificaciones (usuarios ya registrados) */
.chat-notification-opt-in {
    flex-shrink: 0;
    margin: 0 0 6px 0;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #e8f5f0 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    box-sizing: border-box;
}

.chat-notification-opt-in[hidden] {
    display: none !important;
}

.chat-notification-opt-in__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    flex-wrap: wrap;
}

.chat-notification-opt-in__text {
    flex: 1 1 120px;
    min-width: 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #064e3b;
    font-weight: 600;
}

.chat-notification-opt-in__btn {
    flex-shrink: 0;
    background: #075e54;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
}

.chat-notification-opt-in__btn:hover {
    background: #128c7e;
}

.chat-notification-opt-in__close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    touch-action: manipulation;
}

.chat-notification-opt-in__close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #334155;
}

.chat-widget.minimized .chat-body {
    /* display:none evita capas invisibles que en iOS/Safari siguen interceptando toques */
    display: none !important;
    opacity: 0;
    visibility: hidden;
    flex: 0 0 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    pointer-events: none;
}

/* Ningún control del panel puede “robar” el toque cuando la burbuja está cerrada */
.chat-widget.minimized .chat-body * {
    pointer-events: none !important;
}

/* Formularios (Auth) — columna alineada, ancho completo del panel */
.auth-container {
    /* La landing puede usar color-scheme: dark (URU2); sin esto el UA pinta inputs oscuros. */
    color-scheme: light;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    padding-top: 4px;
    padding-bottom: 8px; /* espacio al hacer scroll hasta “Ingresar” en pantallas chicas */
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox: barra lateral oculta, el scroll sigue con rueda/táctil */
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y manipulation;
    position: relative;
    z-index: 1;
}

.auth-container::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.auth-container h3 {
    font-size: 0.95rem;
    flex-shrink: 0;
    margin: 0 0 2px;
    color: #075e54;
    font-weight: 700;
}

.auth-container input[type="text"],
.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container input[type="tel"] {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background-color: #fff;
    color: #303030;
    border: 1px solid #d1d7db;
    border-radius: 8px;
    font-size: 0.9rem;
}

.auth-container input::placeholder {
    color: #8696a0;
    opacity: 1;
}

/* Autofill Chrome/Safari: sin esto vuelve fondo amarillo/oscuro y rompe el look “WhatsApp”. */
.auth-container input:-webkit-autofill,
.auth-container input:-webkit-autofill:hover,
.auth-container input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 32px #fff inset;
    -webkit-text-fill-color: #303030;
    caret-color: #303030;
}

.auth-container .phone-row {
    display: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    gap: 6px;
}

.auth-container .phone-row.phone-row--visible {
    display: flex !important;
}

.auth-container #countryCode {
    flex: 0 0 34%;
    width: auto !important;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 4px;
    background-color: #fff;
    color: #303030;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    font-size: 0.8rem;
}

.auth-container #phoneInput {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
}

.auth-container #authBtn {
    width: 100%;
    box-sizing: border-box;
    margin-top: 2px;
    padding: 11px 10px;
    min-height: 44px; /* área táctil cómoda en celular */
    background-color: #075e54;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    touch-action: manipulation; /* menos retraso / gestos raros en iOS */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.auth-container #authBtn:hover {
    background-color: #128c7e;
}

.auth-container button:not(#authBtn) {
    padding: 8px;
    background-color: #075e54;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
}

.auth-container button:not(#authBtn):hover {
    background-color: #128c7e;
}

.auth-toggle {
    text-align: center;
    font-size: 0.82rem;
    color: #667781;
    cursor: pointer;
    margin-top: 8px;
    line-height: 1.35;
}

.auth-toggle:hover {
    text-decoration: underline;
}

.auth-recovery-links {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin: -2px 0 8px;
    text-align: center;
}

.auth-recovery-links__a {
    font-size: 0.75rem;
    color: #075e54;
    text-decoration: none;
}

.auth-recovery-links__a:hover {
    text-decoration: underline;
}

.auth-recovery-links__sep {
    font-size: 0.75rem;
    color: #94a3b8;
}

.auth-recovery-help {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.auth-recovery-help__lead {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #065f46;
    line-height: 1.35;
}

.auth-recovery-help__hint {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: #334155;
    line-height: 1.4;
}

.auth-recovery-help__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.auth-recovery-help__input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
}

.auth-recovery-help__send {
    width: 100%;
    margin-top: 4px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #075e54;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.auth-recovery-help__send:hover {
    background: #064e46;
}

.auth-recovery-help__back {
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
}

.auth-recovery-help__status {
    margin: 8px 0 0;
    font-size: 0.78rem;
    text-align: center;
    min-height: 1.2em;
    color: #075e54;
}

.auth-recovery-help__status.is-error {
    color: #dc2626;
}

#registerHint {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Aviso registro: al menos 4 números en el usuario (encima del campo) */
.auth-username-hint {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.38;
    color: #475569;
    text-align: center;
    padding: 0 2px 2px;
}

.auth-username-hint[hidden] {
    display: none !important;
}

.auth-username-hint strong {
    color: #1e293b;
    font-weight: 700;
}

#authError {
    flex-shrink: 0;
}

/* Mensajes (Chat) */
.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    display: none; /* Oculto hasta login */
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.chat-messages::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.smartplay-chat-load-older {
    display: block;
    width: calc(100% - 8px);
    margin: 4px auto 8px;
    padding: 7px 10px;
    border: none;
    border-radius: 8px;
    background: rgba(137, 87, 229, 0.18);
    color: #e9d5ff;
    font-size: 0.72rem;
    cursor: pointer;
    text-align: center;
}

.smartplay-chat-load-older:disabled {
    opacity: 0.65;
    cursor: wait;
}

.message {
    position: relative;
    padding: 6px 10px;
    border-radius: 8px;
    max-width: 92%;
    width: fit-content;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 0.72rem;
    line-height: 1.35;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1); /* Sombra suave WhatsApp */
}

.message img {
    max-width: 100% !important;
    height: auto;
    box-sizing: border-box;
}

.chat-attach-video-wrap {
    margin-top: 6px;
    max-width: 100%;
}

.message video.chat-attach-video {
    max-width: 100%;
    max-height: min(220px, 42vh);
    width: auto;
    height: auto;
    border-radius: 8px;
    display: block;
    background: #0f172a;
    vertical-align: top;
}

.chat-attach-video-wrap--missing {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.85rem;
    color: #64748b;
}

.chat-video-unavailable {
    font-style: italic;
}

.message a {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-sizing: border-box;
}

.message-pdf-link {
    display: inline-block;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    text-decoration: none;
    color: inherit;
    font-size: 0.68rem;
    line-height: 1.3;
    max-width: 100%;
}

.message-receipt-ok {
    margin-top: 8px;
    padding: 6px 8px;
    background: #dcf8c6;
    border-radius: 5px;
    font-size: 0.68rem;
    color: #075e54;
    border: 1px solid #c3e6cb;
    text-align: center;
    line-height: 1.35;
}

.message.self {
    background-color: #dcf8c6; /* Verde claro WhatsApp */
    color: #1a1a1a;
    align-self: flex-end;
    border-top-right-radius: 0; /* Cola del globo */
}

.message.self::after {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-top: 10px solid #dcf8c6;
    border-right: 10px solid transparent;
}

.message.other, .message.admin {
    background-color: #ffffff; /* Blanco WhatsApp */
    color: #1a1a1a;
    align-self: flex-start;
    border-top-left-radius: 0; /* Cola del globo */
}

.message.other::before, .message.admin::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 10px solid #ffffff;
    border-left: 10px solid transparent;
}

.message .meta {
    font-size: 0.58rem;
    color: #999; /* Gris sutil para la hora */
    margin-top: 3px;
    display: block;
    text-align: right; /* Hora a la derecha como en WA */
}

.message strong {
    font-weight: 700;
}

.message.admin strong {
    color: #075e54; /* Nombre de Pame en verde oscuro WhatsApp */
}

.message.admin .meta-admin-sub {
    font-size: 0.58rem !important;
    font-weight: 500 !important;
    opacity: 0.9;
}

.message.admin .meta-admin-sub.meta-admin-sub--offline {
    color: #b45309;
    opacity: 1;
}

/* Cuerpo de mensajes automáticos offline: mismo globo .message.admin, saltos de línea como WhatsApp */
.message.admin .message-offline-auto-text {
    display: block;
    margin-top: 2px;
    white-space: pre-line;
}

/* Badge sobre la zona “abrir chat” (no encima del botón cerrar sesión) */
#userUnreadBadge {
    background-color: #ff3b30; /* Rojo más intenso y moderno */
    color: white;
    border-radius: 50%;
    min-width: 22px; /* Ancho mínimo para que sea un círculo perfecto */
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); /* Sombra para darle relieve */
    position: absolute;
    top: 6px;
    right: 8px;
    border: 2px solid white; /* Borde blanco para separarlo del fondo verde */
    z-index: 12;
    pointer-events: none;
    box-sizing: border-box;
    padding: 0 2px;
    line-height: 1;
}
#userUnreadBadge.show {
    display: flex;
}

.chat-widget.minimized #userUnreadBadge {
    top: 2px;
    right: 4px;
}

.chat-widget.minimized.chat-widget--micro #userUnreadBadge {
    top: 0;
    right: -2px;
}

.chat-bonus-terms {
    flex-shrink: 0;
    text-align: center;
    padding: 5px 10px 2px;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #667781;
    background-color: #f0f2f5;
    border-top: 1px solid #e9edef;
}

.chat-bonus-terms[hidden] {
    display: none !important;
}

.chat-bonus-terms a {
    color: #54656f;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-bonus-terms a:hover {
    color: #075e54;
}

.chat-input-container {
    display: none; /* Oculto hasta login */
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    gap: 6px;
    border-top: none;
    padding: 4px 4px 8px;
    align-items: flex-end;
    /* Misma idea que .auth-container: la página puede ser color-scheme dark y el UA oscurece el textarea. */
    color-scheme: light;
    background-color: #f0f2f5; /* Franja del compositor, estilo WhatsApp */
}

/* Popup periódico “adjuntá comprobante”: misma línea visual que #chatPopup (amarillo + pico hacia Pame). */
.attach-float-hint {
    position: absolute;
    left: 6px;
    right: auto;
    /* Por encima de la barra de input, sin tapar el textarea */
    bottom: 64px;
    z-index: 120;
    display: flex;
    justify-content: flex-start;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    transform-origin: var(--attach-float-transform-origin, bottom center);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.attach-float-hint.attach-float-hint--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.attach-float-hint__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
    padding: 8px 12px;
    /* Evita tapar el input: deja aire para el área del mensaje */
    max-width: min(260px, calc(100% - 86px));
    box-sizing: border-box;
    font-size: 0.68rem;
    line-height: 1.3;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    background-color: #ffcc00;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.attach-float-hint__inner::after {
    content: '';
    position: absolute;
    left: var(--attach-float-tail-left, 24%);
    bottom: -6px;
    margin-left: 0;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #ffcc00 transparent transparent transparent;
}

.attach-float-hint__icon {
    font-size: 1rem;
    line-height: 1;
}

.chat-widget.minimized .attach-float-hint {
    visibility: hidden;
    opacity: 0 !important;
    pointer-events: none;
}

/* Aviso Aztec Rush: encima del hint de adjuntar comprobante para no superponerse */
#aztecMaintenanceHint.attach-float-hint {
    bottom: 118px;
}

#aztecMaintenanceHint .attach-float-hint__inner {
    max-width: min(280px, calc(100% - 12px));
}

#attachBtn {
    background-color: transparent;
    color: #128c7e;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Input file accesible en iOS/WebView: no usar display:none (bloquea el selector). */
.smartplay-chat-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

#attachBtn.smartplay-attach-btn--locked {
    opacity: 0.74;
    cursor: not-allowed;
}

.chat-input-container input[type="text"],
.chat-input-container textarea#messageInput,
.chat-input-container textarea.smartplay-chat-input {
    flex-grow: 1;
    min-width: 0;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9edef;
    border-radius: 20px;
    outline: none;
    font-size: 0.8rem;
    font-family: inherit;
    box-sizing: border-box;
    background-color: #fff;
    color: #111b21;
    -webkit-text-fill-color: #111b21;
    caret-color: #111b21;
}

.chat-input-container textarea#messageInput,
.chat-input-container textarea.smartplay-chat-input {
    min-height: 34px;
    max-height: 120px;
    resize: none;
    line-height: 1.35;
    align-self: flex-end;
}

.chat-input-container textarea#messageInput::placeholder,
.chat-input-container textarea.smartplay-chat-input::placeholder,
.chat-input-container input[type="text"]::placeholder {
    color: #c4ccd4;
    opacity: 1;
}

.chat-input-container textarea#messageInput:focus,
.chat-input-container textarea.smartplay-chat-input:focus,
.chat-input-container input[type="text"]:focus {
    border-color: #00a884;
}

.chat-input-container button {
    background-color: #128c7e; /* Verde WhatsApp para el botón de enviar */
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.chat-input-container textarea#messageInput:disabled,
.chat-input-container textarea.smartplay-chat-input:disabled,
.chat-input-container button:disabled {
    opacity: 0.74;
    cursor: not-allowed;
}

/* --- TOAST: instalación app + bono (index / registro) --- */
.install-promo-toast {
    position: fixed;
    left: 50%;
    bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px) + var(--chat-embed-tab-bar-offset, 0px));
    transform: translateX(-50%) translateY(calc(100% + 1rem));
    max-width: min(22rem, calc(100vw - 1.5rem));
    box-sizing: border-box;
    padding: 0.85rem 2.25rem 0.85rem 0.95rem;
    border-radius: 0.85rem;
    background: linear-gradient(145deg, #1e0a3a 0%, #2d0f4a 50%, #1a0630 100%);
    border: 1px solid rgba(167, 139, 250, 0.45);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(0, 0, 0, 0.2);
    color: #f3f4f6;
    font-size: 0.82rem;
    line-height: 1.45;
    z-index: 2120; /* sobre el chat (2100); bajo popup global admin */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.38s ease,
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.38s ease;
}

.install-promo-toast.install-promo-toast--visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.install-promo-toast__text {
    margin: 0 0 0.65rem;
    padding: 0;
}

.install-promo-toast__text strong {
    color: #fde68a;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
}

.install-promo-toast__close {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.85rem;
    height: 1.85rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.install-promo-toast__close:hover,
.install-promo-toast__close:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.install-promo-toast__cta {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a0a2e;
    background: linear-gradient(180deg, #fde68a 0%, #f59e0b 100%);
    border: none;
    border-radius: 0.55rem;
    cursor: pointer;
}

.install-promo-toast__cta:hover {
    filter: brightness(1.06);
}

@media (max-width: 480px) {
    /* Dejar libre la esquina inferior derecha para la burbuja del chat (no tapar toques) */
    .install-promo-toast {
        left: 0.75rem;
        right: calc(0.75rem + min(186px, 46vw));
        width: auto;
        max-width: none;
        transform: translateY(calc(100% + 1rem));
    }

    .install-promo-toast.install-promo-toast--visible {
        transform: translateY(0);
    }

    /* Chat flotante: alineado al borde derecho del viewport útil */
    .chat-widget {
        right: max(2px, env(safe-area-inset-right, 0px) + 1px);
        width: min(
            300px,
            calc(100vw - max(16px, env(safe-area-inset-left, 0px)) - max(16px, env(safe-area-inset-right, 0px)))
        );
    }

    .chat-widget.minimized {
        width: min(
            172px,
            calc(100vw - max(12px, env(safe-area-inset-left, 0px)) - max(0px, env(safe-area-inset-right, 0px)) - 4px)
        );
    }

    /* Píldora: texto largo no desborda ni empuja el badge fuera de pantalla */
    .chat-widget.minimized .chat-header-toggle {
        padding-left: 7px;
        padding-right: 5px;
        gap: 3px;
    }

    .chat-widget.minimized .chat-header-info {
        min-width: 0;
        flex: 1 1 auto;
    }

    .chat-widget.minimized .chat-header-titles {
        min-width: 0;
        overflow: hidden;
    }

    .chat-widget.minimized .chat-header-titles .chat-header-name {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-widget.minimized .chat-header-actions {
        flex-shrink: 0;
        padding-left: 8px;
        padding-right: 6px;
        margin: 4px 0;
    }

    #userUnreadBadge {
        right: 6px;
        top: 8px;
    }

    /* iOS: evita zoom al tocar inputs del login en el chat */
    .auth-container input[type="text"],
    .auth-container input[type="email"],
    .auth-container input[type="password"],
    .auth-container input[type="tel"],
    .auth-container #countryCode {
        font-size: 16px;
    }

    .chat-popup {
        right: var(--chat-popup-right, max(2px, env(safe-area-inset-right, 0px) + 1px));
        width: min(172px, calc(100vw - 0.75rem - min(186px, 46vw)));
        max-width: min(172px, calc(100vw - 0.75rem - min(186px, 46vw)));
    }
}

/* --- POPUP DE RECORDATORIO: por defecto encima de la píldora; JS puede fijar --chat-popup-* al rect del dock --- */
.chat-popup {
    position: fixed;
    box-sizing: border-box;
    bottom: var(
        --chat-popup-bottom,
        calc(
            0.4rem + env(safe-area-inset-bottom, 0px) + var(--chat-embed-tab-bar-offset, 0px) + 50px + 6px
        )
    );
    right: var(--chat-popup-right, max(2px, env(safe-area-inset-right, 0px) + 1px));
    width: min(172px, calc(100vw - 1rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: min(172px, calc(100vw - 1rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    background-color: #ffcc00;
    color: #1a1a1a;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: bold;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(10px) scale(0.94);
    transform-origin: var(--chat-popup-transform-origin, bottom right);
    transition:
        opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

/* Por encima del dock (#chatWidget puede llevar z-index inline ~2147483640 al rescatar embed). */
#chatPopup {
    z-index: 2147483641 !important;
    pointer-events: none !important;
}

.chat-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/*
 * Panel del chat abierto: ocultar el recordatorio del dock aunque lleve .show o reglas de intro en index.
 * Sin depender solo de .show (index podía forzar opacity con 2×# sobre ~#chatPopup).
 */
body.smartplay-chat-panel-expanded #chatPopup.chat-popup,
body:has(#chatWidget:not(.minimized)) #chatPopup.chat-popup {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(10px) scale(0.94) !important;
}

/* Gana a #casinoIntro:not(.casino-intro--hidden) ~ #chatPopup del index si intro y panel quedan “abiertos” a la vez */
body.smartplay-chat-panel-expanded #casinoIntro:not(.casino-intro--hidden) ~ #chatPopup.chat-popup {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(10px) scale(0.94) !important;
}

body.smartplay-chat-panel-expanded #chatPopup.chat-popup::after,
body:has(#chatWidget:not(.minimized)) #chatPopup.chat-popup::after,
body.smartplay-chat-panel-expanded #casinoIntro:not(.casino-intro--hidden) ~ #chatPopup.chat-popup::after {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Pico hacia Pame (sin fallback al 50%: antes quedaba “del medio”). */
.chat-popup::after {
    content: '';
    position: absolute;
    left: var(--chat-popup-tail-left, 22%);
    right: auto;
    bottom: -6px;
    margin-left: 0;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #ffcc00 transparent transparent transparent;
}

/* --- POPUP GLOBAL (ENVIADO POR ADMIN) --- */
.global-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85); /* Fondo más oscuro para que resalte más */
    z-index: 2147483647; /* Z-index MÁXIMO ABSOLUTO permitido por los navegadores */
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.global-popup-overlay.show {
    display: flex;
    opacity: 1;
}

.global-popup-box {
    background: #ffcc00;
    padding: 22px 20px 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.global-popup-overlay.show .global-popup-box {
    transform: scale(1);
}

.global-popup-title {
    color: #111827;
    font-size: 1.2rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 12px;
    text-transform: none;
    letter-spacing: 0.02em;
}

.global-popup-message {
    color: #1a1a1a;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 18px;
}

.global-popup-close {
    background: #075e54;
    color: white;
    border: none;
    padding: 11px 28px;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, filter 0.2s;
}

.global-popup-close:hover {
    background: #128c7e;
    filter: brightness(1.03);
}

/* —— Onboarding guiado (index + player-onboarding.js) —— */
.guided-onboarding {
    flex: 0 0 auto;
    position: relative;
    z-index: 6;
    display: flex;
    flex-direction: column;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: #e4e4e7;
    border-bottom: 1px solid rgba(192, 132, 252, 0.22);
    background: linear-gradient(92deg, rgba(24, 10, 40, 0.96) 0%, rgba(15, 15, 18, 0.98) 100%);
}

.guided-onboarding[hidden] {
    display: none !important;
}

.guided-onboarding__toprow {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.guided-onboarding__bar {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
    min-height: 44px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.guided-onboarding__bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    max-width: 100%;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.35) 0%, rgba(52, 211, 153, 0.2) 100%);
    pointer-events: none;
    transition: width 0.35s ease;
}

.guided-onboarding__bar-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.guided-onboarding__bar-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    opacity: 0.95;
}

.guided-onboarding__bar-text {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.guided-onboarding__bar-pct {
    flex-shrink: 0;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #86efac;
}

.guided-onboarding__bar-chevron {
    flex-shrink: 0;
    opacity: 0.75;
    font-size: 0.7rem;
}

.guided-onboarding__dismiss-bar {
    flex-shrink: 0;
    width: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fafafa;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 0;
    align-self: stretch;
}

.guided-onboarding__dismiss-bar:hover {
    background: rgba(255, 255, 255, 0.14);
}

.guided-onboarding__panel {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.35);
    max-height: min(52dvh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.guided-onboarding__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 6px;
    font-size: 0.9rem;
}

.guided-onboarding__dismiss-all {
    border: none;
    background: transparent;
    color: #a1a1aa;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.guided-onboarding__dismiss-all:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.guided-onboarding__row {
    display: flex;
    gap: 12px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.guided-onboarding__row--locked {
    opacity: 0.45;
}

.guided-onboarding__row-icon {
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    font-weight: 800;
    color: #a7f3d0;
}

.guided-onboarding__row--locked .guided-onboarding__row-icon {
    color: #71717a;
}

.guided-onboarding__row-body {
    flex: 1 1 auto;
    min-width: 0;
}

.guided-onboarding__row-title {
    font-weight: 700;
    margin-bottom: 4px;
    color: #fafafa;
}

.guided-onboarding__row-detail {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #d4d4d8;
    line-height: 1.45;
}

.guided-onboarding__row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.guided-onboarding__btn {
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

.guided-onboarding__btn--primary {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    color: #fff;
}

.guided-onboarding__btn--primary:hover {
    filter: brightness(1.05);
}

.guided-onboarding__btn--ghost {
    background: transparent;
    color: #d4d4d8;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.guided-onboarding__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

.guided-onboarding-reinforce {
    position: fixed;
    overflow: visible;
    pointer-events: none;
    left: auto;
    right: var(--smartplay-dock-bubble-right, max(2px, env(safe-area-inset-right, 0px) + 1px));
    bottom: calc(
        var(
            --smartplay-dock-bubble-bottom,
            calc(0.4rem + env(safe-area-inset-bottom, 0px) + var(--chat-embed-tab-bar-offset, 0px) + 50px + 6px)
        ) + 6.35rem
    );
    width: min(22rem, calc(100vw - 1rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: min(22rem, calc(100vw - 1rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 10px;
    background-color: #ffcc00;
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.72rem;
    font-weight: bold;
    line-height: 1.35;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transform-origin: var(--smartplay-dock-bubble-transform-origin, bottom right);
    z-index: 2147483642;
}

body.smartplay-casino-active .guided-onboarding-reinforce {
    right: var(--smartplay-dock-bubble-right, max(0px, env(safe-area-inset-right, 0px)));
    bottom: calc(
        var(
            --smartplay-dock-bubble-bottom,
            calc(env(safe-area-inset-bottom, 0px) + var(--chat-casino-fab-bottom) + 50px + 6px)
        ) + 6.35rem
    );
}

.guided-onboarding-reinforce::after {
    content: '';
    position: absolute;
    left: var(--smartplay-dock-bubble-tail-left, 22%);
    right: auto;
    bottom: -6px;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #ffcc00 transparent transparent transparent;
}

/* —— Cartel bono primera carga — modal centrado (index + first-deposit-bonus-banner.js) —— */
.first-deposit-bonus {
    position: fixed;
    inset: 0;
    z-index: 11900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
        max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    pointer-events: none;
}

.first-deposit-bonus:not([hidden]) {
    display: flex;
    pointer-events: auto;
}

.first-deposit-bonus__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.first-deposit-bonus__card {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 28px 22px 24px;
    border-radius: 18px;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: linear-gradient(165deg, #3d1a06 0%, #1a1008 42%, #121018 100%);
    color: #fef3c7;
    text-align: center;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 48px rgba(251, 191, 36, 0.12);
    animation: first-deposit-bonus-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

@keyframes first-deposit-bonus-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.first-deposit-bonus__dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fde68a;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.first-deposit-bonus__dismiss:hover,
.first-deposit-bonus__dismiss:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.first-deposit-bonus__badge {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fbbf24;
}

.first-deposit-bonus__title {
    margin: 0 0 10px;
    font-size: clamp(1.15rem, 4.5vw, 1.45rem);
    font-weight: 700;
    line-height: 1.25;
    color: #fffbeb;
}

.first-deposit-bonus__title strong {
    display: inline-block;
    color: #fde047;
    font-weight: 900;
    text-shadow: 0 0 24px rgba(250, 204, 21, 0.35);
}

.first-deposit-bonus__emoji {
    display: block;
    font-size: 2rem;
    margin-bottom: 6px;
}

.first-deposit-bonus__sub {
    margin: 0 0 16px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #fde68a;
}

.first-deposit-bonus__sub strong {
    color: #fff;
}

.first-deposit-bonus__urgency {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fbbf24;
}

.first-deposit-bonus__clock {
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
    color: #fff;
}

.first-deposit-bonus__track {
    height: 10px;
    margin-bottom: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.first-deposit-bonus__fill {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ea580c 0%, #f59e0b 40%, #fde047 100%);
    transition: width 1s linear;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.first-deposit-bonus__hint {
    margin: 0 0 18px;
    font-size: 0.84rem;
    line-height: 1.5;
    color: #fcd34d;
}

.first-deposit-bonus__hint strong {
    color: #fff;
}

.first-deposit-bonus__cta {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    color: #451a03;
    background: linear-gradient(180deg, #fde047 0%, #fbbf24 55%, #f59e0b 100%);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.first-deposit-bonus__cta:hover,
.first-deposit-bonus__cta:focus-visible {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

body.smartplay-first-deposit-bonus-open {
    overflow: hidden;
}

/* Ganamos Deportes: chat con púrpura + oro (alineado al logo) */
html[data-smartplay-market="deportes"] .chat-header,
html[data-smartplay-market="deportes"] .chat-send-btn,
html[data-smartplay-market="deportes"] .auth-btn {
    background: linear-gradient(135deg, #2d1254 0%, #3d1a6e 55%, #1a0835 100%);
}

html[data-smartplay-market="deportes"] .chat-header-name,
html[data-smartplay-market="deportes"] .message-bubble.admin {
    color: #f5d76e;
}

html[data-smartplay-market="deportes"] .message-bubble.user {
    background: linear-gradient(135deg, #3d1a6e 0%, #2d1254 100%);
}

html[data-smartplay-market="deportes"] body.smartplay-casino-active .chat-popup {
    border-color: rgba(212, 175, 55, 0.35);
}

.chat-deposit-panel {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 12px 8px;
    background: #f0f2f5;
    font-size: 0.88rem;
    line-height: 1.4;
    box-sizing: border-box;
}

.chat-deposit-panel__intro {
    margin: 0 0 12px;
    color: #1a1a1a;
}

.chat-deposit-panel__field {
    background: #fff;
    border: 1px solid rgba(7, 94, 84, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.chat-deposit-panel__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 4px;
}

.chat-deposit-panel__value {
    font-weight: 700;
    word-break: break-all;
    color: #111;
}

.chat-deposit-panel__hint {
    margin: 8px 0 0;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    color: #4b5563;
}

.chat-deposit-panel__copy {
    margin-top: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 2px solid #075e54;
    background: #fff;
    color: #075e54;
    font-weight: 700;
    cursor: pointer;
}

.chat-casino-creds {
    margin-top: 4px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e6eef2;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.chat-casino-creds__banner {
    margin: 0;
    padding: 8px 10px;
    background: #d7eef8;
    color: #3d4d5c;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.chat-casino-creds__row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 8px 8px;
    margin: 0;
    background: #fff;
    border-top: 1px solid #eef2f4;
}

.chat-casino-creds__label {
    display: block;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #6b7280;
}

.chat-casino-creds__value {
    margin: 0;
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.2;
    word-break: break-all;
    color: #111;
    user-select: all;
    -webkit-user-select: all;
}

.chat-casino-creds__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: auto;
    margin: 0;
    padding: 7px 10px;
    border-radius: 10px;
    border: none;
    background: #128a4e;
    color: #fff;
    font-weight: 800;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    touch-action: manipulation;
}

.chat-casino-creds__copy-ico {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    display: block;
}

.chat-casino-creds__copy:active {
    filter: brightness(0.94);
}

.message.message--casino-creds {
    max-width: 100%;
    width: 100%;
    padding: 6px 6px 4px;
}

.chat-casino-creds__value--missing {
    color: #e39b12;
    font-weight: 700;
    text-transform: lowercase;
}

.chat-casino-creds__banner--load {
    background: #efe6c8;
    color: #6a5420;
}

.chat-casino-creds__pay-hint {
    margin: 0;
    padding: 8px 10px 4px;
    text-align: center;
    color: #9aa3ad;
    font-size: 0.78rem;
}

.chat-casino-creds__pay {
    display: block;
    width: calc(100% - 16px);
    margin: 6px 8px 8px;
    border: none;
    border-radius: 12px;
    padding: 12px 10px;
    background: linear-gradient(180deg, #3dce67, #12a34a);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    font-family: inherit;
}

.chat-casino-creds__install {
    display: block;
    width: calc(100% - 16px);
    margin: 0 8px 10px;
    border: 2px solid #e6c15a;
    border-radius: 999px;
    padding: 8px 12px;
    background: linear-gradient(90deg, #ff4fa3, #b14bff);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.chat-header-ganamos,
.chat-uruvip-connected {
    display: none;
}

.chat-uruvip-connected[hidden] {
    display: none !important;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-header-info {
    display: none !important;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--micro):not(.chat-widget--auth) {
    width: min(360px, calc(100vw - 12px));
    height: min(520px, calc(100dvh - 0.6rem - env(safe-area-inset-bottom, 0px) - var(--chat-embed-tab-bar-offset, 0px)));
    max-height: calc(100dvh - 0.6rem - env(safe-area-inset-bottom, 0px) - var(--chat-embed-tab-bar-offset, 0px));
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-header {
    min-height: 42px;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-header-toggle {
    gap: 6px;
    padding: 4px 6px 4px 8px;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-header-ganamos {
    display: flex !important;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-header-ganamos__logo {
    width: 28px;
    height: 28px;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-header-ganamos__name {
    font-size: 0.88rem;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-header-ganamos__role {
    font-size: 0.68rem;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) #logoutBtnHeader,
html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) #chatHeaderNotifBtn,
html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-header-shrink {
    min-width: 32px;
    min-height: 32px;
}

.chat-header-ganamos__logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.chat-header-ganamos__titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
}

.chat-header-ganamos__name {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.1;
}

.chat-header-ganamos__role {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-body {
    padding: 0;
    background: #f6f1e8;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-uruvip-connected:not([hidden]) {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 24px;
    margin-top: 4px;
    padding: 3px 8px;
    background: #e7f8ee;
    color: #145c38;
    font-size: 0.72rem;
    font-weight: 600;
}

.chat-uruvip-creds,
.chat-uruvip-creds[hidden] {
    display: none !important;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-uruvip-creds:not([hidden]) {
    display: block !important;
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(250px, 48%);
    margin: 4px 6px 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

html[data-smartplay-market="uruvip"] .message.message--casino-creds-pinned {
    display: none !important;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-messages {
    padding: 6px;
    margin-bottom: 0;
    min-height: 0;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized):not(.chat-widget--auth) .chat-bonus-terms {
    padding: 2px 6px;
    font-size: 0.66rem;
    background: transparent;
    border-top: none;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__banner {
    padding: 4px 6px;
    font-size: 0.58rem;
    white-space: normal;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 4px;
    padding: 3px 6px;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__label {
    font-size: 0.68rem;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__value {
    font-size: 0.78rem;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__copy {
    padding: 4px 7px;
    border-radius: 8px;
    font-size: 0.66rem;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__copy-ico {
    width: 12px;
    height: 12px;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__pay-hint {
    padding: 3px 6px 0;
    font-size: 0.66rem;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__pay {
    width: calc(100% - 12px);
    margin: 4px 6px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 0.74rem;
}

html.smartplay-installed-pwa .chat-casino-creds__install,
html.smartplay-installed-pwa #chatUruvipInstall,
html.smartplay-installed-pwa #uruvipPortalInstallCta {
    display: none !important;
}

html[data-smartplay-market="uruvip"] #chatUruvipCreds .chat-casino-creds__install {
    width: calc(100% - 12px);
    margin: 0 6px 6px;
    padding: 5px 8px;
    font-size: 0.7rem;
}

html[data-smartplay-market="uruvip"] #chatNotificationOptIn {
    display: none !important;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized) .chat-deposit-tabs {
    background: #f4efe6;
    gap: 4px;
    padding: 4px 6px;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized) .chat-deposit-tabs__btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 34px;
    padding: 4px 6px;
    border: none;
    border-radius: 10px;
    background: #10281f;
    color: #fff;
    font-size: 0.7rem;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized) .chat-deposit-tabs__ico svg {
    width: 15px;
    height: 15px;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized) .chat-deposit-tabs__btn--active {
    background: #0c211a;
    box-shadow: inset 0 0 0 2px #1f9d55;
    color: #fff;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized) .chat-deposit-tabs__ico {
    display: flex;
    color: #d8ffe8;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized) #chatInputContainer {
    background: #f6f1e8;
    align-items: center;
    padding: 4px 6px 6px;
}

html[data-smartplay-market="uruvip"] #chatWidget:not(.minimized) #sendBtn {
    width: auto;
    min-width: 72px;
    height: 34px;
    border-radius: 10px;
    padding: 0 10px;
    background: #128a4e;
    font-size: 0.82rem;
}

.chat-deposit-panel__upload {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #1db954, #12a648);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
}

.chat-deposit-first-welcome {
    padding: 4px 0 56px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.chat-deposit-first-welcome__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    max-width: 100%;
    min-width: 0;
}

.chat-deposit-first-welcome__avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(7, 94, 84, 0.25);
}

.chat-deposit-first-welcome__bubble {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    background: #fff;
    border-radius: 12px;
    border-top-left-radius: 4px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(7, 94, 84, 0.12);
    box-sizing: border-box;
    overflow: hidden;
}

.chat-deposit-first-welcome__name {
    display: block;
    font-size: 0.82rem;
    color: #075e54;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-deposit-first-welcome__text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #1a1a1a;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.chat-deposit-first-welcome__text .smartplay-chat-link,
.chat-deposit-first-welcome__text a {
    color: #027eb5;
    text-decoration: underline;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-deposit-first-welcome__cta {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #1db954, #12a648);
    color: #fff;
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    margin-bottom: 10px;
}

.chat-deposit-first-welcome__chat-link {
    display: block;
    width: 100%;
    padding: 8px;
    border: none;
    background: transparent;
    color: #075e54;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}

.chat-deposit-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 8px 6px;
    background: #e8ecef;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    overflow: visible;
}

.chat-deposit-tabs__btn {
    flex: 1;
    padding: 8px 4px;
    border-radius: 8px;
    border: 2px solid #075e54;
    background: #fff;
    color: #075e54;
    font-weight: 800;
    font-size: 0.72rem;
    cursor: pointer;
    position: relative;
}

.chat-deposit-tabs__unread {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 10px;
    background: #ff3b30;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    line-height: 1;
    z-index: 2;
    box-sizing: border-box;
}

.chat-deposit-tabs__unread[hidden] {
    display: none !important;
}

.chat-deposit-tabs__btn--active {
    background: linear-gradient(135deg, #1db954, #12a648);
    border-color: #12a648;
    color: #fff;
}

.chat-deposit-contact {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.chat-deposit-contact[hidden] {
    display: none !important;
}

.chat-deposit-contact__card {
    width: 100%;
    max-width: 320px;
    max-height: 100%;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    padding: 16px 14px 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.chat-deposit-contact__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #075e54;
    text-align: center;
}

.chat-deposit-contact__lead {
    margin: 0 0 12px;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #374151;
    text-align: center;
}

.chat-deposit-contact__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    margin: 8px 0 4px;
}

.chat-deposit-contact__input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
}

.chat-deposit-contact__phone-row {
    display: flex;
    gap: 6px;
}

.chat-deposit-contact__cc {
    flex: 0 0 38%;
    padding: 8px 6px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.82rem;
}

.chat-deposit-contact__phone {
    flex: 1;
    min-width: 0;
}

.chat-deposit-contact__err {
    margin: 10px 0 0;
    font-size: 0.78rem;
    color: #b91c1c;
    text-align: center;
}

.chat-deposit-contact__submit {
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #1db954, #12a648);
    color: #fff;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
}

html[data-smartplay-market="deportes"] body.smartplay-casino-active {
    --chat-casino-fab-bottom: calc(1.56 * (0.4rem + 58px));
}

/* Respaldo CSS cuando SMARTPLAY_CHAT_YELLOW_POPUPS_DISABLED (chat-widget.js) */
html[data-smartplay-yellow-popups="off"] #chatPopup,
html[data-smartplay-yellow-popups="off"] .attach-float-hint,
html[data-smartplay-yellow-popups="off"] #aztecMaintenanceHint,
html[data-smartplay-yellow-popups="off"] #guidedOnboardingReinforceToast,
html[data-smartplay-yellow-popups="off"] .global-popup-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
