/* ============================================================
   WALLET HUB — drawer/dropdown desde el header
   Camino medio (Task #80)
   ============================================================ */

/* ---------- Balance pill como botón clickeable ---------- */
.cl-balance-pill {
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.cl-balance-pill:hover[data-authed="true"] {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 200, 80, .25);
}
.cl-balance-pill:focus-visible {
    outline: 2px solid var(--cl-color-gold, #ffc850);
    outline-offset: 2px;
}
.cl-balance-pill[aria-expanded="true"] {
    background-color: rgba(255, 200, 80, .12);
}
.cl-balance-pill__chev {
    margin-left: 4px;
    transition: transform .2s ease;
    opacity: .7;
}
.cl-balance-pill[aria-expanded="true"] .cl-balance-pill__chev {
    transform: rotate(180deg);
}

/* ---------- Wallet Hub container ---------- */
.cl-wallet-hub {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    visibility: hidden;
}
.cl-wallet-hub[data-open="true"] {
    pointer-events: auto;
    visibility: visible;
}

/* Backdrop */
.cl-wallet-hub__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 5, 22, .55);
    opacity: 0;
    transition: opacity .2s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.cl-wallet-hub[data-open="true"] .cl-wallet-hub__backdrop {
    opacity: 1;
}

/* Panel — desktop: dropdown anclado a la derecha; mobile: drawer */
.cl-wallet-hub__panel {
    position: absolute;
    top: 76px;
    right: 16px;
    width: 420px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 96px);
    background: linear-gradient(180deg, #1a0f3a 0%, #15092e 100%);
    border: 1px solid rgba(255, 200, 80, .2);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(-12px) scale(.98);
    opacity: 0;
    transition: transform .22s cubic-bezier(.2, .9, .3, 1), opacity .22s ease;
    color: #fff;
}
.cl-wallet-hub[data-open="true"] .cl-wallet-hub__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Mobile: drawer slide desde la derecha a pantalla completa */
@media (max-width: 720px) {
    .cl-wallet-hub__panel {
        top: 0;
        right: 0;
        bottom: 0;
        width: min(420px, 100vw);
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        border-left: 1px solid rgba(255, 200, 80, .2);
        border-top: 0;
        border-right: 0;
        border-bottom: 0;
        transform: translateX(100%);
    }
    .cl-wallet-hub[data-open="true"] .cl-wallet-hub__panel {
        transform: translateX(0);
    }
}

/* ---------- Header del hub ---------- */
.cl-wallet-hub__header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    background: linear-gradient(180deg, rgba(255, 200, 80, .06) 0%, transparent 100%);
}
/* Fullscreen drawer on mobile: pad the header top so the inline close button
   clears the iOS status bar. Declared AFTER the base rule above so the
   longhand padding-top wins the equal-specificity cascade (media queries add
   no specificity). Works in browser + standalone via the shared --cl-safe-top
   token; no-op when env()=0. */
@media (max-width: 720px) {
    .cl-wallet-hub__header {
        padding-top: calc(18px + var(--cl-safe-top));
    }
}
.cl-wallet-hub__title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.cl-wallet-hub__title-row > .cl-icon {
    color: var(--cl-color-gold, #ffc850);
}
.cl-wallet-hub__title {
    flex: 1;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: .2px;
}
.cl-wallet-hub__close {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.cl-wallet-hub__close:hover,
.cl-wallet-hub__close:focus-visible {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 200, 80, .4);
    outline: none;
}

/* Saldo total */
.cl-wallet-hub__balance {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}
.cl-wallet-hub__balance-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255, 255, 255, .55);
}
.cl-wallet-hub__balance-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(120deg, #ffd76a 0%, #ffc850 60%, #fff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

/* Sub-saldos Lotería / Casino */
.cl-wallet-hub__sub-balances {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.cl-wallet-hub__sub {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cl-wallet-hub__sub-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: rgba(255, 255, 255, .5);
}
.cl-wallet-hub__sub-amount {
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
}

/* Acciones primarias (Depositar / Comprar boleto) */
.cl-wallet-hub__primary-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.cl-wallet-hub__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 200, 80, .25);
    background: linear-gradient(180deg, rgba(255, 200, 80, .12) 0%, rgba(255, 200, 80, .04) 100%);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.cl-wallet-hub__action i,
.cl-wallet-hub__action svg {
    width: 22px;
    height: 22px;
    color: var(--cl-color-gold, #ffc850);
}
.cl-wallet-hub__action:hover,
.cl-wallet-hub__action:focus-visible {
    background: linear-gradient(180deg, rgba(255, 200, 80, .22) 0%, rgba(255, 200, 80, .08) 100%);
    border-color: rgba(255, 200, 80, .55);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 200, 80, .15);
    outline: none;
}
.cl-wallet-hub__action--primary[data-wallet-hub-action="buy-ticket"] {
    background: linear-gradient(135deg, #ffc850 0%, #ff9f3d 100%);
    border-color: transparent;
    color: #1a0f3a;
}
.cl-wallet-hub__action--primary[data-wallet-hub-action="buy-ticket"] i,
.cl-wallet-hub__action--primary[data-wallet-hub-action="buy-ticket"] svg {
    color: #1a0f3a;
}
.cl-wallet-hub__action--primary[data-wallet-hub-action="buy-ticket"]:hover {
    background: linear-gradient(135deg, #ffd76a 0%, #ffae50 100%);
}

/* Acción secundaria destacada (Swap) */
.cl-wallet-hub__action--secondary {
    flex-direction: row;
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    font-size: .85rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.cl-wallet-hub__action--secondary i,
.cl-wallet-hub__action--secondary svg {
    width: 18px;
    height: 18px;
    color: var(--cl-color-gold, #ffc850);
}
.cl-wallet-hub__action--secondary:hover,
.cl-wallet-hub__action--secondary:focus-visible {
    background: rgba(255, 200, 80, .12);
    border-color: rgba(255, 200, 80, .35);
    outline: none;
}

/* ---------- Body con accordions inyectados ---------- */
.cl-wallet-hub__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px;
    background: rgba(0, 0, 0, .15);
}
.cl-wallet-hub__body:empty::before {
    content: attr(data-empty-msg, "Inicia sesión para ver tu wallet");
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, .45);
    font-size: .85rem;
    padding: 20px;
}
/* Compactar accordions reusados dentro del hub */
.cl-wallet-hub__body .wallet-accordion {
    margin-bottom: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
}
.cl-wallet-hub__body .wallet-accordion:last-child {
    margin-bottom: 0;
}
.cl-wallet-hub__body .wallet-accordion-header {
    padding: 12px 14px;
    cursor: pointer;
}
.cl-wallet-hub__body .wallet-accordion-body {
    padding: 0 12px 12px;
}
/* ============================================================
   Lista nativa de tokens dentro del hub
   (reemplaza el reuso del .wallet-accordion legacy)
   ============================================================ */
.cl-hub-section {
    padding: 14px 16px 8px;
}
.cl-hub-section + .cl-hub-section {
    border-top: 1px solid rgba(255, 255, 255, .06);
    margin-top: 4px;
}
.cl-hub-section__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    color: #d9d4ea;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.cl-hub-section__header [data-lucide] {
    width: 16px;
    height: 16px;
    color: #f5c64c;
}
.cl-hub-section__title {
    flex: 1 1 auto;
    min-width: 0;
}
.cl-hub-section__amount {
    color: #f5c64c;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
}

.cl-hub-tokens {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Layout de dos filas SIEMPRE (icono+info+balance / acciones). El panel del
   hub mide ~420px como máximo en cualquier viewport, así que el layout de una
   sola fila con los botones verticales (Task #216) aplastaba la columna 1fr
   del nombre a 0px en viewports >480px (el texto desbordaba encima de la
   cantidad). El breakpoint por viewport era el bug: la anchura relevante es
   la del panel, que es constante. */
.cl-token-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    grid-template-areas:
        "icon info balance"
        "icon actions actions";
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    transition: background .15s ease, border-color .15s ease;
}
.cl-token-row:hover {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(245, 198, 76, .25);
}
.cl-token-row__icon {
    grid-area: icon;
    align-self: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(0, 0, 0, .25);
    padding: 4px;
}
.cl-token-row__info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cl-token-row__name {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.1;
}
.cl-token-row__full {
    color: #aaa3c4;
    font-size: 11px;
    margin-top: 2px;
}
.cl-token-row__network {
    display: inline-block;
    margin-top: 3px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(240, 185, 11, .15);
    border: 1px solid rgba(240, 185, 11, .4);
    color: #f0b90b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.4;
    width: fit-content;
}
.cl-token-row__balance {
    grid-area: balance;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    min-width: 0;
}
.cl-token-row__amount {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.cl-token-row__usd {
    color: #aaa3c4;
    font-size: 11px;
    margin-top: 2px;
    white-space: nowrap;
}
.cl-token-row__actions {
    grid-area: actions;
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
}
/* Botón vertical icono + texto (estilo Binance) — Task #216 */
.cl-token-row__btn {
    min-width: 52px;
    max-width: 68px;
    border-radius: 10px;
    border: 1px solid rgba(245, 198, 76, .35);
    background: rgba(245, 198, 76, .1);
    color: #f5c64c;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    padding: 6px 5px 5px;
    transition: background .15s ease, transform .1s ease;
}
.cl-token-row__btn:hover {
    background: rgba(245, 198, 76, .2);
}
.cl-token-row__btn:active {
    transform: scale(.95);
}
.cl-token-row__btn [data-lucide] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.cl-token-row__btn-label {
    font-size: 9px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: .01em;
    text-align: center;
    white-space: normal;
    max-width: 100%;
}
/* Depósito BNB oculto temporalmente (Task #216) */
.cl-token-row__btn--hidden,
.cl-token-row__btn[hidden] {
    display: none !important;
}

/* Ocultar los acordeones legacy (#walletAccordion, #casinoAccordion) cuando el
   hub está montado en la página. Mantienen los IDs internos
   (#walletBalanceSPS, etc.) como source of truth para balance-system.js, pero
   no se muestran al usuario para evitar UI duplicada y dobles desplegables.
   El js setea body.cl-has-wallet-hub en init(). */
body.cl-has-wallet-hub #walletAccordion,
body.cl-has-wallet-hub #casinoAccordion {
    display: none !important;
}

/* ---------- Footer del hub ---------- */
.cl-wallet-hub__footer {
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding: 12px 16px 14px;
    background: rgba(0, 0, 0, .15);
}
.cl-wallet-hub__more {
    margin-bottom: 10px;
}
.cl-wallet-hub__more-label {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    color: rgba(255, 255, 255, .75);
    font-size: .85rem;
    font-weight: 500;
    user-select: none;
}
.cl-wallet-hub__more-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding-top: 8px;
}
.cl-wallet-hub__more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .85);
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s ease;
}
.cl-wallet-hub__more-btn i,
.cl-wallet-hub__more-btn svg {
    width: 16px;
    height: 16px;
    color: var(--cl-color-gold, #ffc850);
}
.cl-wallet-hub__more-btn:hover,
.cl-wallet-hub__more-btn:focus-visible {
    background: rgba(255, 200, 80, .1);
    outline: none;
}
.cl-wallet-hub__open-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    color: var(--cl-color-gold, #ffc850);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background .15s ease;
}
.cl-wallet-hub__open-full:hover {
    background: rgba(255, 200, 80, .08);
}
.cl-wallet-hub__open-full i,
.cl-wallet-hub__open-full svg {
    width: 14px;
    height: 14px;
}

/* ============================================================
   COMPACT WALLET SUMMARY — bajo el fold (sólo authed)
   ============================================================ */
.cl-wallet-summary {
    display: none;
    margin: 24px auto;
    padding: 0 16px;
    max-width: 1240px;
}
.cl-wallet-summary[data-authed="true"] {
    display: block;
}
.cl-wallet-summary__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a0f3a 0%, #15092e 100%);
    border: 1px solid rgba(255, 200, 80, .18);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    color: #fff;
}
.cl-wallet-summary__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.cl-wallet-summary__label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: rgba(255, 255, 255, .55);
}
.cl-wallet-summary__total {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(120deg, #ffd76a 0%, #ffc850 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.cl-wallet-summary__sub {
    display: flex;
    gap: 14px;
    font-size: .82rem;
    color: rgba(255, 255, 255, .7);
    flex-wrap: wrap;
}
.cl-wallet-summary__sub strong {
    color: #fff;
    font-weight: 600;
}
.cl-wallet-summary__cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cl-wallet-summary__cta i,
.cl-wallet-summary__cta svg {
    width: 16px;
    height: 16px;
}
@media (max-width: 640px) {
    .cl-wallet-summary__inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .cl-wallet-summary__sub {
        justify-content: center;
    }
    .cl-wallet-summary__cta {
        justify-content: center;
    }
}

/* ============================================================
   SOLO JACKPOT EN HERO — asegurar layout estable sin tabs
   ============================================================ */
body.cl-home-v3 .cl-jackpot-card.cl-jackpot-card--solo {
    /* Restaurar layout sin necesidad de paneles */
    min-height: auto;
}
/* Defensa: ocultar cualquier residuo de tabs si CSS legacy intentara mostrarlos */
body.cl-home-v3 .cl-jackpot-card--solo .cl-jackpot-card__tabs,
body.cl-home-v3 .cl-jackpot-card--solo .cl-jackpot-card__panel {
    display: none !important;
}

/* Body lock cuando el hub está abierto (suave, no rompe drawer hamburger).
   !important a propósito: js/touch-scroll-enabler.js escribe
   body.style.overflow = 'auto' INLINE en móvil, y un inline sin !important
   ganaba a esta regla. Resultado: con el hub abierto la página de atrás
   seguía scrolleando y el gesto sobre la lista de activos se lo llevaba el
   documento (síntoma reportado: "abro la wallet desde el saldo del header y
   no scrollean los activos"). El congelado real del documento lo hace el
   gestor compartido js/scroll-lock.js (clase body.scroll-locked, que ya trae
   position:fixed en css/styles.css); esto es el refuerzo mínimo por si el
   gestor no estuviera cargado. overscroll-behavior corta el encadenamiento. */
body[data-wallet-hub-open="true"] {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* La lista de activos se queda el gesto: al llegar a su tope no lo encadena
   al documento (iOS Safari mueve la barra de URL y la lista parece trabada). */
.cl-wallet-hub__body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* ============================================================
   BOTÓN "COMPRAR CON TARJETA" — abre modal CoinIA pasarelas
   ============================================================ */
.cl-hub-buy-cta {
    padding: 10px 16px 6px;
}
.cl-hub-buy-cta__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a0b34;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .02em;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
    box-shadow: 0 4px 18px rgba(255, 184, 0, .35);
    text-decoration: none;
    line-height: 1;
}
.cl-hub-buy-cta__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 24px rgba(255, 184, 0, .55);
}
.cl-hub-buy-cta__btn:active {
    transform: translateY(0);
    opacity: .88;
}
.cl-hub-buy-cta__btn svg,
.cl-hub-buy-cta__btn [data-lucide] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    stroke: #1a0b34;
}

/* ============================================================
   TASK #217 — Compra desde el hub + affordance de scroll + móvil
   ============================================================ */

/* ---------- Affordance de scroll de la lista de saldos ---------- */
/* Wrapper de altura 0 entre el body scrollable y el footer: el degradado se
   dibuja por ENCIMA de los últimos px de la lista sin ocupar layout y sin
   desplazarse con el contenido. wallet-hub.js sincroniza data-scroll-more
   en el panel (true = hay más activos debajo del borde visible). */
.cl-wallet-hub__scroll-hint {
    position: relative;
    height: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity .18s ease;
}
.cl-wallet-hub__panel[data-scroll-more="true"] .cl-wallet-hub__scroll-hint {
    opacity: 1;
}
.cl-wallet-hub__scroll-hint::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: linear-gradient(180deg,
        rgba(21, 9, 46, 0) 0%,
        rgba(21, 9, 46, .55) 48%,
        rgba(18, 8, 40, .96) 100%);
}
.cl-wallet-hub__scroll-hint-pill {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(26, 15, 58, .92);
    border: 1px solid rgba(255, 200, 80, .45);
    color: var(--cl-color-gold, #ffc850);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.cl-wallet-hub__scroll-hint-pill i,
.cl-wallet-hub__scroll-hint-pill svg {
    width: 14px;
    height: 14px;
    animation: cl-hub-hint-bounce 1.6s ease-in-out infinite;
}
@keyframes cl-hub-hint-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}
@media (prefers-reduced-motion: reduce) {
    .cl-wallet-hub__scroll-hint-pill i,
    .cl-wallet-hub__scroll-hint-pill svg {
        animation: none;
    }
}

/* ---------- Separación visual real entre secciones ---------- */
/* El CTA "Comprar con tarjeta" vive ENTRE las dos secciones, así que el
   selector .cl-hub-section + .cl-hub-section nunca aplicaba. Divisor real
   antes de Wallet Casino: */
.cl-hub-buy-cta + .cl-hub-section {
    border-top: 1px solid rgba(255, 200, 80, .18);
    margin-top: 12px;
    padding-top: 16px;
}

/* ---------- Alturas con unidades dinámicas de viewport ---------- */
/* 100vh clásico puede quedar detrás de las barras dinámicas del navegador
   móvil; dvh sigue el viewport visible. Las reglas base con vh quedan como
   fallback para navegadores sin soporte. */
@supports (height: 100dvh) {
    .cl-wallet-hub__panel {
        max-height: calc(100dvh - 96px);
    }
    @media (max-width: 720px) {
        .cl-wallet-hub__panel {
            max-height: 100dvh;
        }
    }
}

/* ---------- Móvil: objetivos táctiles ≥44px + safe area inferior ---------- */
@media (max-width: 720px) {
    .cl-wallet-hub__close {
        width: 44px;
        height: 44px;
    }
    .cl-wallet-hub__action {
        min-height: 44px; /* la acción secundaria (Swap) medía ~40px */
    }
    .cl-token-row__btn {
        min-height: 44px;
        min-width: 44px; /* icon-only (retirar casino) también ≥44px */
    }
    .cl-wallet-hub__more-btn {
        min-height: 44px;
    }
    .cl-wallet-hub__open-full,
    .cl-hub-buy-cta__btn {
        min-height: 44px;
    }
    /* Las últimas acciones del footer no deben quedar bajo el home
       indicator (token compartido de css/pwa-safe-area.css; no-op cuando
       el inset es 0). */
    .cl-wallet-hub__footer {
        padding-bottom: calc(14px + var(--cl-safe-bottom, 0px));
    }
}

/* ============================================================
   DENSIDAD MÓVIL DEL HUB — que la lista de activos sea la
   protagonista (revisión arquitecto + UX, ago 2026)
   ============================================================
   Medición previa en 390×664 (iPhone 13, sesión real):
   header 361px + footer fijo 221px = 582px de 664 ⇒ al body
   scrolleable le quedaban 83px y solo cabía 1 activo (cada fila
   mide ~133px). Dos correcciones estructurales:
   1) "Más opciones" dejó de ser un footer fijo hermano del body:
      ahora es el último bloque DENTRO de #cl-wallet-hub-slot, así
      que scrollea con el contenido (patrón Binance/Trust Wallet:
      saldo + activos mandan, utilidades secundarias al final).
      El safe-area inferior se mueve al body, que es quien toca el
      home indicator.
   2) Cabecera y filas se densifican SOLO en el drawer móvil,
      manteniendo todos los targets táctiles ≥44px.
   Objetivo: ≥2 filas de activo completas + la 3ª visible. */

/* --- El footer ya no es barra fija: es contenido del scroll --- */
.cl-wallet-hub__footer {
    margin-top: 12px;
    background: transparent;
}

@media (max-width: 720px) {
    /* El body es ahora el último elemento del panel: él carga con el
       inset inferior (antes lo hacía el footer fijo). */
    .cl-wallet-hub__body {
        padding-bottom: calc(14px + var(--cl-safe-bottom, 0px));
    }
    .cl-wallet-hub__footer {
        padding: 12px 0 0;
    }

    /* --- Cabecera densa (~361px → ~240px) --- */
    .cl-wallet-hub__header {
        padding: 12px 16px 10px;
        padding-top: calc(12px + var(--cl-safe-top));
    }
    .cl-wallet-hub__title-row {
        margin-bottom: 8px;
    }
    .cl-wallet-hub__balance {
        gap: 2px;
        margin-bottom: 8px;
    }
    .cl-wallet-hub__balance-amount {
        font-size: 1.55rem;
    }
    .cl-wallet-hub__sub-balances {
        gap: 6px;
        margin-bottom: 8px;
    }
    .cl-wallet-hub__sub {
        padding: 6px 10px;
    }
    /* Depositar / Comprar boleto pasan de columna (icono sobre
       texto) a fila: mismo peso visual, ~24px menos de alto. */
    .cl-wallet-hub__primary-actions .cl-wallet-hub__action {
        flex-direction: row;
        gap: 8px;
        padding: 10px 8px;
    }
    .cl-wallet-hub__primary-actions .cl-wallet-hub__action i,
    .cl-wallet-hub__primary-actions .cl-wallet-hub__action svg {
        width: 18px;
        height: 18px;
    }
    .cl-wallet-hub__action--secondary {
        padding: 9px 14px;
    }

    /* --- Secciones y filas más compactas (~133px → ~112px) --- */
    .cl-wallet-hub__body {
        padding-top: 10px;
    }
    .cl-hub-section {
        padding: 10px 14px 6px;
    }
    .cl-hub-section__header {
        margin-bottom: 8px;
    }
    .cl-hub-tokens {
        gap: 6px;
    }
    .cl-token-row {
        padding: 8px 10px;
        gap: 4px 8px;
    }
    /* La columna de identidad (nombre + emisor + red) marcaba la altura de
       la primera fila del grid: 55px frente a 35px del balance. Se aprieta
       sin quitar información. */
    .cl-token-row__full {
        margin-top: 1px;
        font-size: 10px;
        line-height: 1.2;
    }
    .cl-token-row__network {
        margin-top: 2px;
        line-height: 1.3;
    }
    .cl-token-row__actions {
        margin-top: 2px;
    }
    /* Los botones por activo pasan de columna (icono sobre etiqueta,
       "Recarga Casino" partía en 2 líneas ⇒ ~55px) a fila: siguen
       midiendo 44px de alto táctil y conservan su ETIQUETA visible
       (requisito UX: no esconder Recarga Casino / Depositar / Enviar
       tras iconos sueltos), pero la fila baja de ~125px a ~100px. */
    .cl-token-row__btn {
        flex-direction: row;
        gap: 5px;
        padding: 4px 9px;
        min-width: 44px;
        max-width: none;
    }
    .cl-token-row__btn-label {
        font-size: 10px;
        white-space: nowrap;
    }
    /* El botón icon-only (retirar del casino) mantiene caja cuadrada. */
    .cl-token-row__btn:not(:has(.cl-token-row__btn-label)) {
        padding: 4px;
    }
}

/* --- Viewports cortos (iPhone SE, navegador con barras) --- */
/* Con ~568px de alto la cabecera se lleva más de la mitad del panel: se
   aprieta un escalón más para conservar 2 activos completos. Los targets
   táctiles siguen en 44px; solo bajan tipografías y paddings. */
@media (max-width: 720px) and (max-height: 700px) {
    .cl-wallet-hub__balance-amount {
        font-size: 1.35rem;
    }
    .cl-wallet-hub__balance {
        margin-bottom: 6px;
    }
    .cl-wallet-hub__sub {
        padding: 5px 9px;
    }
    .cl-wallet-hub__sub-balances {
        margin-bottom: 6px;
    }
    .cl-wallet-hub__header {
        padding-bottom: 8px;
    }
    .cl-wallet-hub__body {
        padding-top: 6px;
    }
    .cl-hub-section {
        padding: 6px 12px 4px;
    }
    .cl-hub-section__header {
        margin-bottom: 6px;
    }
}
