/* SD LIVE — Public Styles
   Design: inspired by tiktok-live-monitoring-webui (dark theme)
   Font: Geist via Google Fonts
*/
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
    --tah-bg:           #000202;
    --tah-bg-card:      #000202;
    --tah-bg-input:     #0d1414;
    --tah-bg-muted:     #000202;
    --tah-border:       rgba(255,255,255,0.3);
    --tah-border-hover: rgba(255,255,255,0.65);
    --tah-text:         #fafaf9;
    --tah-text-muted:   #a8a29e;
    --tah-text-subtle:  #78716c;
    --tah-primary:      #FE2C55;
    --tah-primary-dim:  rgba(254, 44, 85, 0.15);
    --tah-secondary:    #25F4EE;
    --tah-secondary-dim:rgba(37, 244, 238, 0.12);
    --tah-success:      #22c55e;
    --tah-success-dim:  rgba(34, 197, 94, 0.12);
    --tah-warning:      #f59e0b;
    --tah-danger:       #ef4444;
    --tah-radius:       0.75rem;
    --tah-radius-sm:    0.5rem;
    --tah-radius-full:  9999px;
    --tah-shadow:       0 4px 24px rgba(0,0,0,.45);
    --tah-shadow-sm:    0 2px 8px rgba(0,0,0,.3);
    --tah-font:         'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --tah-transition:   0.18s ease;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
.tah-dashboard,
.tah-register-wrap {
    font-family: var(--tah-font);
    color: var(--tah-text);
    -webkit-font-smoothing: antialiased;
    background: var(--tah-bg);
    min-height: 100vh;
}

/* Force dark theme with explicit values for all elements inside tah-dashboard */
.tah-dashboard {
    --tah-bg:           #000202;
    --tah-bg-card:      #000202;
    --tah-bg-input:     #0d1414;
    --tah-bg-muted:     #000202;
    --tah-border:       rgba(255,255,255,0.3);
    --tah-border-hover: rgba(255,255,255,0.65);
    --tah-text:         #fafaf9;
    --tah-text-muted:   #a8a29e;
    --tah-text-subtle:  #78716c;
    --tah-primary:      #FE2C55;
    --tah-primary-dim:  rgba(254, 44, 85, 0.15);
    --tah-secondary:    #25F4EE;
    --tah-secondary-dim:rgba(37, 244, 238, 0.12);
    --tah-success:      #22c55e;
    --tah-success-dim:  rgba(34, 197, 94, 0.12);
    --tah-warning:      #f59e0b;
    --tah-danger:       #ef4444;
    --tah-font:         'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000202;
}

/* Override WordPress theme styles on dashboard page */
body.tah-dashboard-page,
body.tah-dashboard-page #content,
body.tah-dashboard-page .entry-content,
body.tah-dashboard-page .site-content,
body.tah-dashboard-page .site-main {
    background: #000202 !important;
}

/* ── Notices ────────────────────────────────────────────────────────────── */
.tah-notice {
    padding: 12px 16px;
    border-radius: var(--tah-radius-sm);
    margin: 12px 0;
    font-size: .88rem;
    font-weight: 500;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tah-notice-warning { background: rgba(245,158,11,.1); color: #fbbf24; border-color: rgba(245,158,11,.25); }
.tah-notice-info    { background: color-mix(in srgb, var(--tah-secondary) 8%, transparent); color: var(--tah-secondary); border-color: color-mix(in srgb, var(--tah-secondary) 20%, transparent); }
.tah-notice-error   { background: rgba(239,68,68,.1);  color: #f87171; border-color: rgba(239,68,68,.25); }
.tah-notice-success { background: var(--tah-success-dim); color: var(--tah-success); border-color: rgba(34,197,94,.25); }

/* ── Dashboard wrapper ──────────────────────────────────────────────────── */
.tah-dashboard {
    max-width: 1040px;
    margin: 0 auto;
    padding: 8px 0 40px;
}

/* ── Agency logo ────────────────────────────────────────────────────────── */
.tah-dash-agency-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 16px 8px;
}
.tah-dash-agency-logo img {
    max-height: 64px;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.tah-dash-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--tah-bg-card);
    border: 1px solid #ffffff;
    border-radius: var(--tah-radius);
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: var(--tah-shadow-sm);
}

.tah-avatar-btn {
    position: relative !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: var(--tah-radius-sm) !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}
.tah-avatar-btn:hover .tah-avatar-edit-icon { opacity: 1; }

.tah-dash-avatar,
.tah-avatar-btn > span:first-child {
    position: absolute !important;
    inset: 0 !important;
    border-radius: var(--tah-radius-sm);
    background: linear-gradient(135deg, var(--tah-primary) 0%, #ff6b6b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.tah-avatar-btn img.tah-avatar-img,
#tah-avatar-img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    object-fit: cover !important;
    object-position: center top !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tah-avatar-edit-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,.7);
    border-radius: 50%;
    font-size: .6rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--tah-transition);
}

.tah-dash-info { flex: 1; min-width: 0; }
.tah-dash-info h2 {
    margin: 0;
    color: var(--tah-text);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tah-dash-info p {
    margin: 3px 0 0;
    color: var(--tah-text-muted);
    font-size: .78rem;
}

.tah-dash-status {
    font-size: .72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--tah-radius-full);
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--tah-success-dim);
    color: var(--tah-success);
    border: 1px solid rgba(34,197,94,.2);
    white-space: nowrap;
}
.tah-dash-status.tah-status-suspended {
    background: rgba(239,68,68,.1);
    color: #f87171;
    border-color: rgba(239,68,68,.2);
}

/* ── Mobile header (≤ 720px): foto + usuario + estado arriba;
   "Panel · fecha" abajo de la foto. Los botones (wallet/compartir) se
   ocultan porque ya están en el bottom-nav. */
@media (max-width: 720px) {
    .tah-dash-header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        column-gap: 8px;
        row-gap: 8px;
        padding: 14px;
        align-items: center;
    }
    /* "Desestructuramos" el contenedor info para que el h2 y la p
       participen directamente en el grid del padre */
    .tah-dash-info { display: contents; }

    .tah-avatar-btn {
        grid-row: 1;
        grid-column: 1;
        width: 46px !important;
        height: 46px !important;
    }
    .tah-dash-info h2 {
        grid-row: 1;
        grid-column: 2;
        align-self: center;
        font-size: .95rem;
        line-height: 1.2;
        margin: 0;
    }
    .tah-dash-status {
        grid-row: 1;
        grid-column: 3;
        align-self: center;
        font-size: .65rem;
        padding: 3px 8px;
    }
    /* "Panel · 2026-05" va abajo de la foto, ancho completo */
    .tah-dash-info p {
        grid-row: 2;
        grid-column: 1 / -1;
        margin: 0;
        font-size: .75rem;
        color: var(--tah-text-muted);
    }
    /* Bell + Refresh: van juntos a la derecha. El bell cae en la
       columna 1fr (centro) por el flujo natural del grid, así que lo
       empujamos al borde derecho con justify-self y dejamos el refresh
       inmediatamente al lado (solo 6px de separación). */
    .tah-dash-header > .tah-inbox-trigger {
        justify-self: end;
        margin-left: 0;
    }
    .tah-dash-header > .tah-refresh-trigger {
        justify-self: start;
        margin-left: 6px;
    }
    /* Ocultamos los botones de la cabecera en móvil: ya están en el bottom-nav */
    .tah-dash-header > .tah-wallet-trigger,
    .tah-dash-header > .tah-affiliate-share-btn {
        display: none !important;
    }
}

/* Móviles muy estrechos: badge de estado más compacto + h2 más pequeño */
@media (max-width: 380px) {
    .tah-dash-header { padding: 12px; column-gap: 10px; }
    .tah-dash-info h2  { font-size: .88rem; }
    .tah-dash-status {
        font-size: .6rem;
        padding: 2px 6px;
    }
}

/* ── Metrics grid ───────────────────────────────────────────────────────── */
.tah-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .tah-metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

.tah-metric-card {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 18px 16px;
    text-align: center;
    box-shadow: var(--tah-shadow-sm);
    transition: transform var(--tah-transition), border-color var(--tah-transition), box-shadow var(--tah-transition);
    position: relative;
    overflow: hidden;
}
.tah-metric-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--tah-transition);
    pointer-events: none;
}
.tah-metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--tah-border-hover);
    box-shadow: var(--tah-shadow);
}

/* Colored accent strip on top */
.tah-metric-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: var(--tah-radius) var(--tah-radius) 0 0;
}

.tah-metric-diamonds::after { background: var(--tah-secondary); }
.tah-metric-viewers::after  { background: var(--tah-primary); }
.tah-metric-likes::after    { background: #ff4d6d; }
.tah-metric-gifts::after    { background: var(--tah-warning); }
.tah-metric-sessions::after { background: #a78bfa; }
.tah-metric-peak::after     { background: #f97316; }

/* Placeholder when no metrics data */
.tah-metrics-placeholder {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 40px 24px;
    text-align: center;
    margin-bottom: 20px;
}
.tah-metrics-placeholder-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: .7;
}
.tah-metrics-placeholder h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tah-text);
}
.tah-metrics-placeholder p {
    margin: 0;
    font-size: .85rem;
    color: var(--tah-text-muted);
    line-height: 1.5;
}

.tah-metric-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
    display: block;
    line-height: 1;
}
.tah-metric-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--tah-text);
    line-height: 1;
    letter-spacing: -.03em;
    margin-bottom: 4px;
}
.tah-metric-label {
    font-size: .72rem;
    color: var(--tah-text-muted);
    font-weight: 500;
    letter-spacing: .02em;
}

/* ── Prize progress ─────────────────────────────────────────────────────── */
.tah-prizes-section { margin-bottom: 20px; }
.tah-prizes-section h3 {
    font-size: .8rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.tah-prize-bar-wrap {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--tah-shadow-sm);
    transition: border-color var(--tah-transition);
    border-left: 3px solid var(--tah-primary);
}
.tah-prize-bar-wrap:hover { border-color: var(--tah-border-hover); }
.tah-prize-achieved {
    border-left-color: var(--tah-success);
}

.tah-prize-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--tah-radius-sm);
    flex-shrink: 0;
    border: 1px solid var(--tah-border);
}

.tah-prize-bar-info { flex: 1; min-width: 0; }
.tah-prize-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.tah-prize-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--tah-text);
}
.tah-prize-pct {
    font-size: .8rem;
    font-weight: 700;
    color: var(--tah-primary);
}
.tah-prize-achieved .tah-prize-pct { color: var(--tah-success); }
.tah-prize-desc {
    font-size: .75rem;
    color: var(--tah-text-muted);
    margin: 0 0 8px;
}

.tah-progress-track {
    background: rgba(255,255,255,.06);
    border-radius: var(--tah-radius-full);
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.tah-progress-fill {
    height: 100%;
    border-radius: var(--tah-radius-full);
    background: linear-gradient(90deg, var(--tah-primary), #ff6b6b);
    transition: width .8s ease;
}
.tah-prize-achieved .tah-progress-fill {
    background: linear-gradient(90deg, var(--tah-success), #86efac);
}
.tah-prize-bar-footer {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--tah-text-subtle);
}

/* ── Backstage data section ─────────────────────────────────────────────── */
.tah-backstage-section { margin-bottom: 20px; }
.tah-backstage-section h3 {
    font-size: .8rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
.tah-backstage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.tah-backstage-item {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tah-backstage-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--tah-text-subtle);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.tah-backstage-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tah-text);
    line-height: 1.2;
}
.tah-backstage-highlight {
    color: var(--tah-secondary);
}

/* ── Refresh / Logout row ───────────────────────────────────────────────── */
.tah-refresh-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: .75rem;
    color: var(--tah-text-subtle);
}
.tah-btn-refresh,
.tah-btn-logout {
    background: transparent !important;
    border: 1px solid var(--tah-border) !important;
    border-radius: var(--tah-radius-full) !important;
    padding: 5px 12px !important;
    cursor: pointer !important;
    font-size: .75rem !important;
    color: var(--tah-text-muted) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: border-color var(--tah-transition), color var(--tah-transition) !important;
    box-shadow: none !important;
    font-family: var(--tah-font) !important;
}
.tah-btn-refresh:hover,
.tah-btn-logout:hover {
    border-color: var(--tah-primary) !important;
    color: var(--tah-primary) !important;
}

/* ── Push notification section ──────────────────────────────────────────── */
.tah-push-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--tah-border);
}
.tah-push-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tah-push-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--tah-border);
    color: var(--tah-text-muted);
    border-radius: var(--tah-radius-full);
    padding: 7px 16px;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--tah-transition), color var(--tah-transition), border-color var(--tah-transition);
    font-family: var(--tah-font);
}
.tah-push-btn:hover {
    background: rgba(255,255,255,.08);
    color: var(--tah-text);
    border-color: var(--tah-border-hover);
}
.tah-push-btn.tah-push-active {
    background: var(--tah-primary-dim);
    border-color: var(--tah-primary);
    color: var(--tah-primary);
}
.tah-notif-history-btn { color: var(--tah-text-muted); }
.tah-push-msg { font-size: .75rem; min-height: 18px; text-align: center; color: var(--tah-text-muted); }

/* ── Register form ──────────────────────────────────────────────────────── */
.tah-register-wrap {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
    min-height: 60vh;
    align-items: center;
}
.tah-register-card {
    background: var(--tah-bg-card);
    border: 1px solid #ffffff;
    border-radius: var(--tah-radius);
    padding: 36px 32px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--tah-shadow);
    text-align: center;
}
.tah-reg-logo-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.tah-reg-logo { max-height: 80px; max-width: 200px; object-fit: contain; }
.tah-register-card h2 {
    margin: 0 0 6px;
    color: var(--tah-text);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.03em;
}
.tah-reg-subtitle {
    color: var(--tah-text-muted);
    font-size: .85rem;
    margin-bottom: 24px;
}

.tah-reg-referral {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tah-primary) 10%, transparent);
    color: var(--tah-primary);
    border: 1px solid color-mix(in srgb, var(--tah-primary) 35%, transparent);
    font-size: .82rem;
    font-weight: 500;
}
.tah-reg-referral-icon { font-size: 1rem; line-height: 1; }
.tah-reg-referral strong { color: #fafaf9; font-weight: 700; }

/* ── Icon system ────────────────────────────────────────────────────────── */
.tah-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.tah-icon-gold { color: #f59e0b; }
.tah-icon-cyan { color: var(--tah-secondary); }
.tah-icon-pink { color: var(--tah-primary); }

/* ── Layout utilities ───────────────────────────────────────────────────── */
.tah-section-spaced { margin-top: 24px; }
.tah-section-title {
    margin: 0;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 1rem; font-weight: 700; color: var(--tah-text);
}
.tah-section-header-flex {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
}

/* ── Affiliate share button (usa color SECUNDARIO de la marca) ────────────
   !important obligatorio: el wp_head del plugin fuerza estilos globales a
   todos los <button> con !important, así que sin esto no ganamos. */
.tah-affiliate-share-btn {
    margin-left: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tah-secondary) 8%, transparent) !important;
    color: var(--tah-secondary) !important;
    border: 1px solid color-mix(in srgb, var(--tah-secondary) 45%, transparent) !important;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background var(--tah-transition), border-color var(--tah-transition), color var(--tah-transition);
}
.tah-affiliate-share-btn:hover {
    background: var(--tah-secondary-dim) !important;
    border-color: var(--tah-secondary) !important;
    color: var(--tah-secondary) !important;
}
.tah-affiliate-share-btn--secondary { margin-left: 0; }
/* El icono SVG dentro del botón hereda el color del padre */
.tah-affiliate-share-btn svg { stroke: var(--tah-secondary) !important; }

/* ── Prize bars ─────────────────────────────────────────────────────────── */
.tah-prize-affiliate .tah-progress-fill {
    background: linear-gradient(90deg, var(--tah-primary), var(--tah-secondary));
}
.tah-prize-tag {
    display: inline-block;
    padding: 1px 7px;
    margin-right: 6px;
    border-radius: 10px;
    background: var(--tah-secondary-dim);
    color: var(--tah-secondary);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: middle;
}
.tah-prize-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    font-size: 1.6rem;
}

/* ── Affiliate modal ────────────────────────────────────────────────────── */
.tah-affiliate-modal {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
}
.tah-affiliate-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(4px);
}
.tah-affiliate-modal-card {
    position: relative; z-index: 1;
    width: min(420px, 92vw);
    background: #1c1917;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    padding: 22px 22px 18px;
    color: var(--tah-text);
    box-shadow: var(--tah-shadow);
}
.tah-affiliate-modal-card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--tah-text); }
.tah-affiliate-modal-help { margin: 0 0 14px; font-size: .82rem; color: var(--tah-text-muted); line-height: 1.45; }
.tah-affiliate-modal-close {
    position: absolute; top: 8px; right: 12px;
    background: none; border: none;
    color: var(--tah-text-subtle);
    font-size: 1.4rem; cursor: pointer; padding: 4px 8px;
}
.tah-affiliate-link-row { display: flex; gap: 8px; margin-bottom: 12px; }
.tah-affiliate-link-row input {
    flex: 1; min-width: 0;
    padding: 8px 10px; border-radius: 8px;
    background: #0d0c0b; color: var(--tah-text);
    border: 1px solid rgba(255,255,255,.12);
    font-size: .8rem; font-family: ui-monospace, SFMono-Regular, monospace;
}
.tah-affiliate-action-btn {
    padding: 8px 14px; border-radius: 8px;
    border: none; cursor: pointer;
    background: var(--tah-primary); color: #fff;
    font-weight: 600; font-size: .82rem;
    transition: background var(--tah-transition);
}
.tah-affiliate-action-btn:hover { background: #e62547; }
.tah-affiliate-action-btn.copied { background: var(--tah-success); }
.tah-affiliate-share-row { display: flex; gap: 8px; }
.tah-affiliate-share-link {
    flex: 1; text-align: center;
    padding: 9px 0; border-radius: 8px;
    background: rgba(255,255,255,.05);
    color: var(--tah-text);
    text-decoration: none;
    font-size: .8rem; font-weight: 500;
    border: 1px solid rgba(255,255,255,.08);
    transition: background var(--tah-transition);
}
.tah-affiliate-share-link:hover { background: rgba(255,255,255,.1); color: var(--tah-text); }

.tah-affiliate-qr-details { margin-top: 12px; }
.tah-affiliate-qr-details summary {
    cursor: pointer; font-size: .78rem;
    color: var(--tah-text-muted);
    padding: 6px 0; list-style: none; user-select: none;
}
.tah-affiliate-qr-details summary::-webkit-details-marker { display: none; }
.tah-affiliate-qr-details summary::before { content: '▸ '; transition: transform .15s; display: inline-block; }
.tah-affiliate-qr-details[open] summary::before { content: '▾ '; }
.tah-affiliate-qr { text-align: center; padding: 12px 0 4px; }
.tah-affiliate-qr img {
    background: #fff; padding: 8px;
    border-radius: 10px;
    display: block; margin: 0 auto;
    max-width: 220px; height: auto;
}
.tah-affiliate-qr p { margin: 10px 0 0; font-size: .76rem; color: var(--tah-text-subtle); }

/* ── Referrals list ─────────────────────────────────────────────────────── */
.tah-referrals-section { background: rgba(255,255,255,.02); border-radius: 14px; padding: 16px 18px; }
.tah-referrals-empty { margin: 12px 0 0; font-size: .85rem; color: var(--tah-text-muted); line-height: 1.5; }
.tah-referrals-stats { margin: 10px 0 8px; font-size: .85rem; color: var(--tah-text-muted); }
.tah-referrals-stats strong { color: var(--tah-primary); font-weight: 700; }
.tah-referrals-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tah-referral-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px;
    background: rgba(255,255,255,.03);
    font-size: .85rem;
}
.tah-referral-item.is-qualified { background: var(--tah-success-dim); }
.tah-referral-status {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: var(--tah-text-subtle);
    font-weight: 700; font-size: .75rem;
    flex-shrink: 0;
}
.tah-referral-item.is-qualified .tah-referral-status { background: var(--tah-success); color: #fff; }
.tah-referral-name { flex: 1; min-width: 0; font-weight: 600; color: var(--tah-text); }
.tah-referral-meta { font-size: .76rem; color: var(--tah-text-muted); text-align: right; }

/* ── iOS install banner ─────────────────────────────────────────────────── */
.tah-ios-install {
    display: flex; align-items: center; gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--tah-primary-dim), var(--tah-secondary-dim));
    border: 1px solid color-mix(in srgb, var(--tah-primary) 30%, transparent);
    color: var(--tah-text);
    font-size: .82rem;
    line-height: 1.4;
}
/* `display: flex` de arriba pisa el `[hidden] { display: none }` del navegador
   porque tienen la misma especificidad y este viene después. Forzamos. */
.tah-ios-install[hidden] { display: none !important; }
.tah-ios-install-icon { font-size: 1.5rem; flex-shrink: 0; }
.tah-ios-install-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tah-ios-install-text strong { color: var(--tah-primary); font-weight: 700; }
.tah-ios-install-close {
    flex-shrink: 0; background: none; border: none;
    color: var(--tah-text-muted);
    font-size: 1.4rem; cursor: pointer; padding: 0 6px; line-height: 1;
}

/* ── Checklist ──────────────────────────────────────────────────────────── */
.tah-checklist {
    margin: 14px 0 18px;
    padding: 16px 18px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tah-primary) 8%, transparent), color-mix(in srgb, var(--tah-secondary) 8%, transparent));
    border: 1px solid color-mix(in srgb, var(--tah-primary) 20%, transparent);
    border-radius: 14px;
    color: var(--tah-text);
    position: relative;
}
.tah-checklist-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tah-checklist-head strong { display: block; font-size: 1rem; }
.tah-checklist-progress-label { display: block; font-size: .75rem; color: var(--tah-text-muted); margin-top: 2px; }
.tah-checklist .tah-onboarding-close {
    background: none; border: none;
    color: var(--tah-text-muted);
    cursor: pointer;
    font-size: 1.3rem; line-height: 1; padding: 0 4px;
}
.tah-checklist-bar {
    height: 6px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    margin: 12px 0 14px;
    overflow: hidden;
}
.tah-checklist-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tah-primary), var(--tah-secondary));
    transition: width .3s ease;
}
.tah-checklist-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tah-checklist-list li { display: flex; align-items: center; gap: 10px; font-size: .85rem; padding: 4px 0; }
.tah-checklist-check {
    width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08);
    color: var(--tah-text-subtle);
    font-weight: 700; font-size: .8rem;
}
.tah-checklist-list li.is-done .tah-checklist-check { background: var(--tah-success); color: #fff; }
.tah-checklist-list li.is-done .tah-checklist-label { text-decoration: line-through; color: var(--tah-text-subtle); }
.tah-checklist-label { flex: 1; }
.tah-checklist-cta { font-size: .78rem; color: var(--tah-primary); text-decoration: none; font-weight: 600; }
.tah-checklist-cta:hover { color: #ff6b88; }

/* ── Hero metric ────────────────────────────────────────────────────────── */
.tah-hero {
    margin: 14px 0 18px;
    padding: 22px 24px;
    border-radius: 18px;
    background:
        radial-gradient(120% 200% at 0% 0%, color-mix(in srgb, var(--tah-primary) 18%, transparent), transparent 50%),
        radial-gradient(120% 200% at 100% 100%, color-mix(in srgb, var(--tah-secondary) 14%, transparent), transparent 50%),
        #0a0a0a;
    border: 1px solid rgba(255,255,255,.08);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.tah-hero-main { display: flex; flex-direction: column; }
.tah-hero-label { font-size: .72rem; color: var(--tah-text-muted); text-transform: uppercase; letter-spacing: .08em; }
.tah-hero-value {
    font-size: 2.6rem; font-weight: 800; line-height: 1.05;
    background: linear-gradient(90deg, var(--tah-primary), var(--tah-secondary));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 2px 0 4px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Diamante animado: rota sutilmente + brillo pulsante para llamar la atención */
.tah-hero-diamond {
    display: inline-block;
    font-size: 2.2rem;
    line-height: 1;
    /* El emoji no se pinta con background-clip, así que lo dejamos opaco */
    -webkit-text-fill-color: initial;
    color: initial;
    animation: tah-diamond-spin 2.4s ease-in-out infinite;
    transform-origin: center;
    filter: drop-shadow(0 0 0 transparent);
    will-change: transform, filter;
}
@keyframes tah-diamond-spin {
    0%   { transform: rotate(-8deg) scale(1);    filter: drop-shadow(0 0 0 transparent); }
    25%  { transform: rotate(0deg)  scale(1.08); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tah-secondary) 75%, transparent)); }
    50%  { transform: rotate(8deg)  scale(1);    filter: drop-shadow(0 0 0 transparent); }
    75%  { transform: rotate(0deg)  scale(1.08); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tah-secondary) 75%, transparent)); }
    100% { transform: rotate(-8deg) scale(1);    filter: drop-shadow(0 0 0 transparent); }
}

/* Respeta a usuarios con motion reducida */
@media (prefers-reduced-motion: reduce) {
    .tah-hero-diamond { animation: none; }
}
.tah-hero-period { font-size: .72rem; color: var(--tah-text-subtle); }
.tah-hero-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; max-width: 60%; }
.tah-hero-chip {
    padding: 8px 12px; border-radius: 999px; font-size: .8rem;
    background: rgba(255,255,255,.05);
    color: var(--tah-text);
    border: 1px solid rgba(255,255,255,.08);
}
.tah-hero-chip strong { color: var(--tah-primary); }
.tah-hero-chip-win {
    background: var(--tah-success-dim);
    border-color: rgba(34,197,94,.3);
    color: #4ade80;
}
@media (max-width: 540px) {
    .tah-hero { padding: 16px 18px; }
    .tah-hero-value { font-size: 2rem; }
    .tah-hero-side { max-width: 100%; align-items: flex-start; }
}

/* ── Win celebration animations ─────────────────────────────────────────── */
@keyframes tah-pulse-win {
    0%   { transform: scale(1);     box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
    50%  { transform: scale(1.015); box-shadow: 0 0 0 10px rgba(34,197,94,0); }
    100% { transform: scale(1);     box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.tah-prize-bar-wrap.tah-just-won {
    animation: tah-pulse-win 1.2s ease-out 2;
    border: 1px solid rgba(34,197,94,.5);
}
.tah-toast {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
    background: linear-gradient(135deg, var(--tah-success), #16a34a);
    color: #fff; padding: 14px 20px; border-radius: 14px;
    font-weight: 700; font-size: .95rem;
    box-shadow: 0 10px 40px rgba(34,197,94,.4);
    z-index: 200000; opacity: 0;
    transition: opacity .25s, transform .25s;
}
.tah-toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ── Bottom navigation ──────────────────────────────────────────────────── */
.tah-bottom-nav { display: none; }
@media (max-width: 720px) {
    .tah-bottom-nav {
        display: flex; justify-content: space-around;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
        background: rgba(0, 2, 2, .96);
        backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255,255,255,.1);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .tah-dashboard { padding-bottom: 84px; }
}
.tah-bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 4px; color: var(--tah-text-muted);
    text-decoration: none; font-size: .65rem;
    transition: color var(--tah-transition);
}
.tah-bottom-nav-item.is-active, .tah-bottom-nav-item:hover { color: var(--tah-primary); }

/* ── Empty state ────────────────────────────────────────────────────────── */
.tah-empty-state {
    margin: 18px 0;
    padding: 28px 22px;
    text-align: center;
    background: rgba(255,255,255,.02);
    border: 1px dashed rgba(255,255,255,.15);
    border-radius: 16px;
}
.tah-empty-icon { display: block; font-size: 2.4rem; margin-bottom: 6px; }
.tah-empty-state h3 { margin: 8px 0 6px; font-size: 1.05rem; color: var(--tah-text); }
.tah-empty-state p  { margin: 4px 0; font-size: .9rem; color: var(--tah-text-muted); line-height: 1.5; }
.tah-empty-hint     { font-size: .82rem !important; color: var(--tah-text-subtle) !important; margin-top: 12px !important; }

/* ── Leaderboard ────────────────────────────────────────────────────────── */
.tah-leaderboard-section { background: rgba(255,255,255,.02); border-radius: 14px; padding: 16px 18px; }
.tah-lb-optout-btn {
    background: color-mix(in srgb, var(--tah-secondary) 6%, transparent) !important;
    border: 1px solid color-mix(in srgb, var(--tah-secondary) 45%, transparent) !important;
    color: var(--tah-secondary) !important;
    font-size: .78rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--tah-transition), border-color var(--tah-transition);
}
.tah-lb-optout-btn:hover {
    background: var(--tah-secondary-dim) !important;
    border-color: var(--tah-secondary) !important;
    color: var(--tah-secondary) !important;
}
.tah-leaderboard { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 4px; }
.tah-leaderboard li {
    display: grid; grid-template-columns: 50px 1fr; gap: 10px; align-items: center;
    padding: 8px 12px; border-radius: 8px;
    background: rgba(255,255,255,.03);
    font-size: .85rem;
}
.tah-leaderboard li.is-self {
    background: linear-gradient(90deg, color-mix(in srgb, var(--tah-primary) 15%, transparent), color-mix(in srgb, var(--tah-secondary) 8%, transparent));
    border: 1px solid color-mix(in srgb, var(--tah-primary) 35%, transparent);
}
.tah-lb-rank { font-weight: 700; color: var(--tah-primary); }
.tah-lb-name { font-weight: 500; color: var(--tah-text); }
.tah-lb-name small { color: var(--tah-text-muted); }
.tah-lb-value { font-variant-numeric: tabular-nums; color: var(--tah-secondary); font-weight: 600; }
.tah-lb-optout-info { color: var(--tah-text-muted); font-size: .85rem; }
.tah-forgot-actions { display: flex; gap: 8px; }
.tah-btn-grow { flex: 1; }
.tah-label-hint {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--tah-text-subtle);
}

/* Visually hidden pero accesible para screen readers + sigue siendo clickeable por JS */
.tah-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Avatar upload: botón + input URL lado a lado */
.tah-avatar-upload-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.tah-avatar-upload-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: .82rem;
    font-weight: 600;
}
.tah-avatar-url-input {
    flex: 1;
    min-width: 0;
}
.tah-upload-status {
    display: block;
    margin-top: 6px;
    color: var(--tah-text-subtle);
    font-size: .72rem;
}
@media (max-width: 540px) {
    .tah-avatar-upload-row { flex-direction: column; }
    .tah-avatar-upload-btn { width: 100%; }
}

.tah-form-group { text-align: left; margin-bottom: 14px; }
.tah-form-group label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    margin-bottom: 5px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.tah-form-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--tah-border) !important;
    border-radius: var(--tah-radius-sm);
    font-size: .9rem;
    font-family: var(--tah-font);
    color: var(--tah-text) !important;
    background: var(--tah-bg-input) !important;
    transition: border-color var(--tah-transition), box-shadow var(--tah-transition);
}
.tah-form-group input::placeholder { color: var(--tah-text-subtle) !important; }
.tah-form-group input:focus {
    outline: none !important;
    border-color: var(--tah-primary) !important;
    box-shadow: 0 0 0 3px var(--tah-primary-dim) !important;
}
.tah-form-group small {
    display: block;
    font-size: .72rem;
    color: var(--tah-text-subtle);
    margin-top: 4px;
}
.tah-required { color: var(--tah-primary); }

/* Phone row in register */
.tah-phone-row {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100%;
}
.tah-phone-code-select {
    width: 140px !important;
    max-width: 140px !important;
    min-width: 140px !important;
    flex-shrink: 0 !important;
    padding: 9px 8px;
    border: 1px solid var(--tah-border) !important;
    border-radius: var(--tah-radius-sm);
    font-size: .85rem;
    font-family: var(--tah-font);
    color: var(--tah-text) !important;
    background: var(--tah-bg-input) !important;
    box-sizing: border-box;
}
.tah-phone-number-input {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
}

.tah-btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--tah-primary);
    color: #fff;
    border: none;
    border-radius: var(--tah-radius-sm);
    font-size: .95rem;
    font-weight: 600;
    font-family: var(--tah-font);
    cursor: pointer;
    transition: opacity var(--tah-transition), transform var(--tah-transition);
    margin-top: 8px;
    letter-spacing: -.01em;
}
.tah-btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.tah-btn-primary:active { transform: translateY(0); }
.tah-btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Profile panel ──────────────────────────────────────────────────────── */
.tah-profile-panel {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--tah-shadow-sm);
}
.tah-profile-inner { padding: 18px 20px; }
.tah-profile-inner h3 {
    margin: 0 0 14px;
    color: var(--tah-text);
    font-size: .9rem;
    font-weight: 600;
}

.tah-profile-avatar-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}
.tah-profile-avatar-preview img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--tah-primary);
}
.tah-profile-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tah-primary), #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--tah-primary);
}

.tah-profile-fields { display: flex; flex-direction: column; gap: 10px; }
.tah-profile-field label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    margin-bottom: 4px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.tah-profile-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 11px;
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius-sm);
    color: var(--tah-text) !important;
    font-size: .88rem;
    font-family: var(--tah-font);
    transition: border-color var(--tah-transition);
}
.tah-profile-field input:focus {
    outline: none;
    border-color: var(--tah-primary);
    box-shadow: 0 0 0 2px var(--tah-primary-dim);
}

.tah-btn-secondary {
    padding: 8px 13px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--tah-border);
    color: var(--tah-text-muted);
    border-radius: var(--tah-radius-sm);
    cursor: pointer;
    font-size: .85rem;
    font-family: var(--tah-font);
    font-weight: 500;
    white-space: nowrap;
    transition: border-color var(--tah-transition), color var(--tah-transition), background var(--tah-transition);
}
.tah-btn-secondary:hover {
    border-color: var(--tah-border-hover);
    color: var(--tah-text);
    background: rgba(255,255,255,.08);
}

/* ── Notification history modal ─────────────────────────────────────────── */
.tah-notif-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}
.tah-notif-modal {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    width: 100%;
    max-width: 440px;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--tah-shadow);
}
.tah-notif-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--tah-border);
    font-weight: 600;
    font-size: .9rem;
    color: var(--tah-text);
}
.tah-notif-modal-header button {
    background: none;
    border: none;
    color: var(--tah-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--tah-transition);
}
.tah-notif-modal-header button:hover { color: var(--tah-text); }
.tah-notif-modal-body { overflow-y: auto; padding: 10px 14px; flex: 1; }
.tah-notif-loading, .tah-notif-empty {
    text-align: center;
    color: var(--tah-text-muted);
    padding: 24px;
    font-size: .85rem;
}
.tah-notif-item {
    display: block;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    color: inherit;
    text-decoration: none;
    transition: background var(--tah-transition), border-color var(--tah-transition);
}
.tah-notif-item:last-child { margin-bottom: 0; }
.tah-notif-item-title { font-weight: 600; color: var(--tah-text); font-size: .85rem; margin-bottom: 3px; }
.tah-notif-item-body  { color: var(--tah-text-muted); font-size: .78rem; margin-bottom: 5px; line-height: 1.4; }
.tah-notif-item-date  { color: var(--tah-text-subtle); font-size: .7rem; }
.tah-notif-item-link:hover {
    background: rgba(255,255,255,.06);
    border-color: var(--tah-border-hover);
}

/* ── AI Chat floating button ─────────────────────────────────────────────
   El FAB del agente: usa la foto configurada en Branding como fondo y
   un borde grueso del color SECUNDARIO de la marca. Si no hay foto,
   cae al estilo original (círculo primario con icono SVG).
   NOTA: NO usamos el shorthand `background:` porque sería reset implícito
   de background-image, y haría que el style inline (con la URL del avatar)
   nunca gane sobre el !important del CSS. */
#tah-ai-chat-toggle {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 99999 !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background-color: var(--tah-primary) !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    color: #fff !important;
    border: 3px solid var(--tah-secondary) !important;
    font-size: 1.4rem !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-shadow:
        0 4px 18px color-mix(in srgb, var(--tah-secondary) 35%, transparent),
        0 0 0 2px color-mix(in srgb, var(--tah-secondary) 25%, transparent) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform var(--tah-transition), box-shadow var(--tah-transition) !important;
    overflow: visible !important;
}
#tah-ai-chat-toggle.has-avatar {
    /* Si la foto falla al cargar, se ve un fondo oscuro neutro en vez del rosa */
    background-color: var(--tah-bg-card) !important;
}
#tah-ai-chat-toggle:hover {
    transform: scale(1.08) !important;
    box-shadow:
        0 6px 26px color-mix(in srgb, var(--tah-secondary) 55%, transparent),
        0 0 0 3px color-mix(in srgb, var(--tah-secondary) 35%, transparent) !important;
}

/* Punto verde "en línea" sobre el FAB, estilo WhatsApp */
.tah-ai-chat-toggle-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--tah-bg, #000202);
    pointer-events: none;
}

/* En mobile el bottom nav está fijo abajo: subimos el FAB para no
   superponerlo sobre "Perfil". Bottom nav ≈ 60px + safe-area. */
@media (max-width: 720px) {
    #tah-ai-chat-toggle {
        bottom: calc(76px + env(safe-area-inset-bottom)) !important;
        right: 16px !important;
    }
}

/* ── AI Chat panel ──────────────────────────────────────────────────────── */
#tah-ai-chat-panel {
    position: fixed !important;
    bottom: 88px !important;
    right: 24px !important;
    z-index: 99998 !important;
    width: 360px;
    height: 520px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    box-shadow: var(--tah-shadow);
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(.97);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}
#tah-ai-chat-panel.tah-chat-open {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: all;
}

/* Chat header */
.tah-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--tah-primary) 0%, #c8193e 100%);
    color: #fff;
    flex-shrink: 0;
}
.tah-chat-header-left { display: flex; align-items: center; gap: 10px; }
.tah-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    position: relative;
}
/* Cuando hay imagen de fondo, ocultar el SVG fallback */
.tah-chat-avatar.has-image > svg { display: none; }
/* Punto verde de "en línea" estilo WhatsApp */
.tah-chat-presence-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.1);
}
.tah-chat-header-info { display: flex; flex-direction: column; line-height: 1.2; }
.tah-chat-header-name  { font-weight: 700; font-size: .88rem; }
.tah-chat-header-status { font-size: .68rem; opacity: .85; color: #b2f5c8; }
#tah-ai-chat-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background var(--tah-transition), color var(--tah-transition);
    line-height: 1;
}
#tah-ai-chat-close:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Chat messages area */
.tah-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--tah-bg-muted);
}
.tah-chat-messages::-webkit-scrollbar { width: 4px; }
.tah-chat-messages::-webkit-scrollbar-track { background: transparent; }
.tah-chat-messages::-webkit-scrollbar-thumb { background: var(--tah-border-hover); border-radius: 4px; }

/* Row contenedor de cada mensaje (estilo WhatsApp con avatar al lado) */
.tah-chat-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 92%;
}
.tah-chat-msg-row-ai   { align-self: flex-start; }
.tah-chat-msg-row-user { align-self: flex-end; justify-content: flex-end; }

/* Avatar inline junto a cada mensaje del AI */
.tah-chat-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--tah-primary);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    overflow: hidden;
}
.tah-chat-msg-avatar.has-image { background-color: transparent; }
.tah-chat-msg-avatar span { line-height: 1; }

/* Chat bubbles */
.tah-chat-msg {
    padding: 8px 12px 7px;
    font-size: .88rem;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
    max-width: 100%;
}
.tah-chat-msg-ai {
    background: var(--tah-bg-card);
    color: var(--tah-text);
    border: 1px solid var(--tah-border);
    /* Esquina superior izquierda más pequeña (la "cola" apunta al avatar) */
    border-radius: 4px 14px 14px 14px;
}
.tah-chat-msg-user {
    background: var(--tah-primary);
    color: #fff;
    /* Esquina superior derecha más pequeña, simétrico al AI */
    border-radius: 14px 4px 14px 14px;
}
.tah-chat-typing {
    background: var(--tah-bg-card);
    color: var(--tah-text-muted);
    border: 1px solid var(--tah-border);
    border-radius: 4px 14px 14px 14px;
    padding: 10px 14px;
    font-size: .82rem;
}
.tah-chat-typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.tah-chat-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tah-text-muted);
    animation: tah-dot-bounce .9s infinite ease-in-out;
}
.tah-chat-typing-dots span:nth-child(2) { animation-delay: .15s; }
.tah-chat-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes tah-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-4px); }
}

/* Chat input area */
.tah-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 10px 11px;
    background: var(--tah-bg-card);
    border-top: 1px solid var(--tah-border);
    flex-shrink: 0;
    align-items: center;
}
#tah-chat-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 20px;
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    color: var(--tah-text) !important;
    font-size: .88rem;
    font-family: var(--tah-font);
    line-height: 1.4;
    outline: none;
    resize: none;
    transition: border-color var(--tah-transition), height var(--tah-transition);
    /* Auto-grow: empieza en 1 línea, máx 5 líneas (~140px) */
    min-height: 40px;
    max-height: 140px;
    overflow-y: auto;
}
#tah-chat-input::placeholder { color: var(--tah-text-subtle); }
#tah-chat-input:focus { border-color: var(--tah-primary); }
#tah-chat-input:disabled { opacity: .6; cursor: not-allowed; }

/* Chips de sugerencias iniciales */
.tah-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 12px 10px;
    background: var(--tah-bg-card);
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,.04);
}
.tah-chat-suggestions.is-hidden { display: none; }
.tah-chat-suggestion-chip {
    background: color-mix(in srgb, var(--tah-primary) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--tah-primary) 25%, transparent);
    color: var(--tah-primary);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.2;
    font-family: var(--tah-font);
    transition: background var(--tah-transition), transform var(--tah-transition);
    text-align: left;
}
.tah-chat-suggestion-chip:hover {
    background: color-mix(in srgb, var(--tah-primary) 18%, transparent);
    transform: translateY(-1px);
}
.tah-chat-suggestion-chip:active { transform: translateY(0); }

/* Acciones del header del chat (reset, close) */
.tah-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.tah-chat-header-btn {
    background: rgba(255, 255, 255, .12);
    border: none;
    color: rgba(255, 255, 255, .85);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tah-transition);
}
.tah-chat-header-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }
#tah-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--tah-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--tah-transition), opacity var(--tah-transition);
}
#tah-chat-send:hover { opacity: .9; transform: scale(1.06); }
#tah-chat-send:active { transform: scale(.95); }

/* ── Mobile AI Chat — full screen ───────────────────────────────────────── */
@media (max-width: 767px) {
    #tah-ai-chat-panel {
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: none !important;
        border-radius: 0 !important;
        opacity: 1 !important;
        transform: translateY(110%) !important;
        transition: transform .3s cubic-bezier(.4,0,.2,1) !important;
        box-shadow: none !important;
    }
    #tah-ai-chat-panel.tah-chat-open { transform: translateY(0) !important; }

    /* Ocultar el botón flotante mientras el chat está abierto para que no
       se superponga al botón de enviar mensaje. */
    body.tah-chat-active #tah-ai-chat-toggle { display: none !important; }
    .tah-chat-header { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
    .tah-chat-messages { padding: 12px; gap: 8px; }
    .tah-chat-msg { font-size: .9rem; padding: 9px 12px 7px; }
    #tah-chat-input { font-size: 16px !important; }
    #tah-chat-send  { width: 44px; height: 44px; }
    .tah-chat-input-wrap { padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }

    .tah-metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tah-register-card { padding: 28px 20px; }
}

/* ── Login page ─────────────────────────────────────────────────────────── */
.tah-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 32px 16px;
    background: var(--tah-bg);
}
.tah-login-card {
    background: var(--tah-bg-card);
    border: 1px solid #ffffff;
    border-radius: var(--tah-radius);
    padding: 40px 36px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--tah-shadow);
    text-align: center;
}
.tah-login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.tah-login-logo {
    max-height: 90px;
    max-width: 220px;
    object-fit: contain;
    display: block;
}
.tah-login-title {
    margin: 0 0 6px;
    color: var(--tah-text);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.03em;
}
.tah-login-subtitle {
    color: var(--tah-text-muted);
    font-size: .85rem;
    margin-bottom: 28px;
}
.tah-password-wrap {
    position: relative;
}
.tah-password-wrap input {
    padding-right: 42px !important;
}
.tah-toggle-pwd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--tah-text-subtle);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color var(--tah-transition);
}
.tah-toggle-pwd:hover { color: var(--tah-text); }
.tah-login-footer {
    margin-top: 20px;
    font-size: .82rem;
    color: var(--tah-text-muted);
}
.tah-login-footer a {
    color: var(--tah-primary) !important;
    text-decoration: none;
    font-weight: 600;
}
.tah-login-footer a:hover { opacity: .85; }

@media (max-width: 480px) {
    .tah-login-card { padding: 28px 20px; }
}

/* ── Elementor overrides ────────────────────────────────────────────────── */
.tah-elementor-metrics .tah-metrics-grid { margin-bottom: 0; }

/* ─────────────────────────────────────────────────────────────────────────
   v5.0.9 — UX upgrades: wizard, password strength, spinners, benefits,
   login extras, onboarding, profile logout
   ───────────────────────────────────────────────────────────────────────── */

/* Card de beneficios en registro */
.tah-reg-benefits {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: color-mix(in srgb, var(--tah-primary) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--tah-primary) 20%, transparent);
    border-radius: var(--tah-radius-sm);
    padding: 12px 14px;
    margin-bottom: 18px;
    text-align: left;
}
.tah-benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--tah-text-muted);
}
.tah-benefit-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

/* Indicador de pasos */
.tah-step-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 22px;
    gap: 4px;
}
.tah-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.tah-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--tah-border);
    color: var(--tah-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
    font-weight: 700;
    transition: all .25s ease;
}
.tah-step-label {
    font-size: .68rem;
    color: var(--tah-text-subtle);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}
.tah-step.active .tah-step-num {
    background: var(--tah-primary);
    border-color: var(--tah-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--tah-primary-dim);
}
.tah-step.active .tah-step-label { color: var(--tah-text); }
.tah-step.done .tah-step-num {
    background: var(--tah-success);
    border-color: var(--tah-success);
    color: #fff;
}
.tah-step.done .tah-step-num::before { content: '✓'; }
.tah-step.done .tah-step-num span { display: none; }
.tah-step-line {
    flex: 1;
    height: 2px;
    background: var(--tah-border);
    margin: 0 4px;
    margin-bottom: 18px;
}

/* Acciones del wizard */
.tah-step-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.tah-step-actions .tah-btn-secondary { flex: 0 0 auto; padding: 10px 16px; }
.tah-step-actions .tah-btn-primary { flex: 1; margin-top: 0; }
.tah-step-panel[hidden] { display: none !important; }

/* Input con error */
.tah-input-error {
    border-color: var(--tah-danger) !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important;
    animation: tah-shake .3s ease;
}
@keyframes tah-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.tah-field-hint { display: block; font-size: .72rem; color: var(--tah-text-subtle); margin-top: 4px; }

/* Medidor de fuerza de contraseña */
.tah-pwd-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tah-pwd-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,.1);
    border-radius: 2px;
    overflow: hidden;
}
.tah-pwd-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--tah-danger);
    transition: width .25s ease, background .25s ease;
}
.tah-pwd-label {
    font-size: .72rem;
    color: var(--tah-text-subtle);
    min-width: 88px;
    text-align: right;
    font-weight: 600;
}

/* Botón con spinner */
.tah-btn-primary, .tah-btn-secondary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tah-btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tah-spin .7s linear infinite;
}
.tah-btn-primary.tah-loading .tah-btn-spinner { display: inline-block; }
.tah-btn-primary.tah-loading .tah-btn-label { opacity: .6; }
.tah-btn-primary.tah-loading,
.tah-btn-secondary.tah-loading { cursor: wait; pointer-events: none; }
@keyframes tah-spin { to { transform: rotate(360deg); } }

/* Footer del registro */
.tah-reg-footer {
    margin-top: 16px;
    font-size: .8rem;
    color: var(--tah-text-muted);
    text-align: center;
}
.tah-reg-footer a {
    color: var(--tah-primary) !important;
    text-decoration: none;
    font-weight: 600;
}
.tah-reg-footer a:hover { opacity: .85; }

/* Login: extras (recordarme + olvidé) */
.tah-login-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    margin: -4px 0 14px;
    color: var(--tah-text-muted);
}
.tah-remember {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}
.tah-remember input { width: auto; margin: 0; }
#tah-forgot-link {
    color: var(--tah-secondary) !important;
    text-decoration: none;
    font-weight: 500;
}
#tah-forgot-link:hover { text-decoration: underline; }
#tah-forgot-form { text-align: left; }

/* Panel de avatar: divisor + logout */
.tah-profile-divider {
    height: 1px;
    background: var(--tah-border);
    margin: 18px 0 14px;
}
.tah-profile-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--tah-text-muted) !important;
    font-size: .85rem;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--tah-radius-sm);
    border: 1px solid var(--tah-border);
    transition: all var(--tah-transition);
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    font-weight: 500;
}
.tah-profile-logout:hover {
    background: rgba(239,68,68,.1);
    color: #f87171 !important;
    border-color: rgba(239,68,68,.3);
}

/* Onboarding card */
.tah-onboarding-card {
    position: relative;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tah-primary) 8%, transparent), color-mix(in srgb, var(--tah-secondary) 6%, transparent));
    border: 1px solid var(--tah-primary);
    border-radius: var(--tah-radius);
    padding: 20px 22px;
    margin: 14px 0;
    box-shadow: 0 4px 20px color-mix(in srgb, var(--tah-primary) 12%, transparent);
}
.tah-onboarding-card h3 {
    margin: 0 0 8px;
    color: var(--tah-text);
    font-size: 1.05rem;
    font-weight: 700;
}
.tah-onboarding-card p {
    color: var(--tah-text-muted);
    font-size: .88rem;
    margin: 0 0 14px;
}
.tah-onboarding-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tah-onboarding-steps li {
    color: var(--tah-text);
    font-size: .87rem;
    line-height: 1.5;
    padding-left: 4px;
}
.tah-onboarding-steps strong { color: var(--tah-text); }
.tah-onboarding-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: var(--tah-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color var(--tah-transition);
}
.tah-onboarding-close:hover { color: var(--tah-text); }
.tah-onboarding-card .tah-btn-primary { width: auto; padding: 9px 22px; }

/* Mejorar focus visible global (a11y) */
.tah-form-group input:focus-visible,
.tah-form-group select:focus-visible,
.tah-btn-primary:focus-visible,
.tah-btn-secondary:focus-visible {
    outline: 2px solid var(--tah-secondary) !important;
    outline-offset: 2px;
}

/* Mobile tweaks para wizard */
@media (max-width: 480px) {
    .tah-step-label { display: none; }
    .tah-reg-benefits { padding: 10px 12px; }
    .tah-benefit { font-size: .78rem; }
    .tah-step-actions { flex-direction: column-reverse; }
    .tah-step-actions .tah-btn-secondary { width: 100%; }
}

/* ─────────────────────────────────────────────────────────────────────────
   v5.0.12 — Admin Dashboard (panel agencia con stats y tareas)
   ───────────────────────────────────────────────────────────────────────── */
.tah-admin-dashboard {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    color: var(--tah-text);
    font-family: var(--tah-font);
    background: var(--tah-bg);
    min-height: 100vh;
}
body.tah-dashboard-page .tah-admin-dashboard { background: transparent; }

/* Header */
.tah-ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tah-border);
}
.tah-ad-header-info { display: flex; align-items: center; gap: 16px; }
.tah-ad-logo { max-height: 48px; max-width: 160px; object-fit: contain; }
.tah-ad-header h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    color: var(--tah-text);
    letter-spacing: -.02em;
}
.tah-ad-header p { margin: 0; color: var(--tah-text-muted); font-size: .85rem; }

.tah-ad-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tah-ad-btn-secondary {
    background: rgba(255,255,255,.05);
    color: var(--tah-text-muted) !important;
    border: 1px solid var(--tah-border);
    padding: 8px 14px;
    border-radius: var(--tah-radius-sm);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none !important;
    transition: all var(--tah-transition);
    font-family: var(--tah-font);
}
.tah-ad-btn-secondary:hover {
    background: rgba(255,255,255,.1);
    color: var(--tah-text) !important;
    border-color: var(--tah-primary);
}

/* Section title */
.tah-ad-section-title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 28px 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tah-ad-section-count {
    background: var(--tah-primary-dim);
    color: var(--tah-primary);
    border: 1px solid color-mix(in srgb, var(--tah-primary) 30%, transparent);
    padding: 1px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

/* Stats grid (4 cards) */
.tah-ad-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.tah-ad-stat-card {
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 18px 20px;
    transition: border-color var(--tah-transition), transform var(--tah-transition);
}
.tah-ad-stat-card:hover {
    border-color: var(--tah-border-hover);
    transform: translateY(-2px);
}
.tah-ad-stat-label {
    font-size: .68rem;
    text-transform: uppercase;
    color: var(--tah-text-subtle);
    letter-spacing: .05em;
    margin-bottom: 4px;
}
.tah-ad-stat-name {
    font-size: .82rem;
    color: var(--tah-text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}
.tah-ad-stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--tah-text);
    line-height: 1;
    margin-bottom: 12px;
    letter-spacing: -.03em;
}
.tah-ad-stat-value-cyan  { color: var(--tah-secondary); }
.tah-ad-stat-value-green { color: var(--tah-success); }
.tah-ad-stat-value-pink  { color: var(--tah-primary); }

.tah-ad-stat-spark {
    height: 32px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,.04));
    border-bottom: 2px solid var(--tah-border);
    margin-bottom: 8px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.tah-ad-stat-spark::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(180deg, transparent, currentColor);
    opacity: .15;
    clip-path: polygon(0 80%, 12% 60%, 24% 75%, 36% 40%, 48% 55%, 60% 30%, 72% 50%, 84% 25%, 100% 15%, 100% 100%, 0 100%);
}
.tah-ad-stat-spark[data-color="cyan"]  { color: var(--tah-secondary); border-color: color-mix(in srgb, var(--tah-secondary) 30%, transparent); }
.tah-ad-stat-spark[data-color="green"] { color: var(--tah-success); border-color: rgba(34,197,94,.3); }
.tah-ad-stat-spark[data-color="pink"]  { color: var(--tah-primary); border-color: color-mix(in srgb, var(--tah-primary) 30%, transparent); }

.tah-ad-stat-bar {
    height: 6px;
    background: rgba(255,255,255,.05);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.tah-ad-stat-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .4s ease;
}
.tah-ad-stat-source {
    font-size: .7rem;
    color: var(--tah-text-subtle);
    margin-top: 4px;
}

@media (max-width: 900px) {
    .tah-ad-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .tah-ad-stats-grid { grid-template-columns: 1fr; }
}

/* Tasks grid */
.tah-ad-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.tah-ad-task-card {
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 16px 18px;
    transition: border-color var(--tah-transition);
}
.tah-ad-task-card:hover { border-color: var(--tah-border-hover); }
.tah-ad-task-card.tah-ad-task-done {
    border-color: rgba(34,197,94,.5);
    background: linear-gradient(135deg, var(--tah-bg-input), rgba(34,197,94,.04));
}
.tah-ad-task-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.tah-ad-task-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tah-text-subtle);
    margin-bottom: 3px;
}
.tah-ad-task-name {
    font-size: .92rem;
    font-weight: 600;
    color: var(--tah-text);
    line-height: 1.3;
}
.tah-ad-task-pct {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
    flex-shrink: 0;
}
.tah-ad-task-numbers {
    margin: 10px 0;
    color: var(--tah-text-muted);
    font-size: .85rem;
}
.tah-ad-task-numbers strong {
    color: var(--tah-text);
    font-size: 1.05rem;
    font-weight: 700;
}
.tah-ad-task-bar {
    height: 8px;
    background: rgba(255,255,255,.06);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}
.tah-ad-task-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .5s ease;
}
.tah-ad-task-footer {
    display: flex;
    justify-content: space-between;
    color: var(--tah-text-subtle);
    font-size: .72rem;
}
.tah-ad-task-period { font-family: monospace; }

/* Empty state */
.tah-ad-empty {
    grid-column: 1 / -1;
    background: var(--tah-bg-input);
    border: 1px dashed var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 32px;
    text-align: center;
    color: var(--tah-text-muted);
}
.tah-ad-empty a { color: var(--tah-primary) !important; text-decoration: none; font-weight: 600; }

/* Rankings */
.tah-ad-rankings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 24px;
}
@media (max-width: 900px) {
    .tah-ad-rankings { grid-template-columns: 1fr; }
}
.tah-ad-ranking-card {
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 16px 18px;
}
.tah-ad-ranking-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 6px;
}
.tah-ad-ranking-head h3 {
    margin: 0;
    color: var(--tah-text);
    font-size: 1rem;
    font-weight: 700;
}
.tah-ad-ranking-sub {
    font-size: .72rem;
    color: var(--tah-text-subtle);
    font-weight: 500;
}
.tah-ad-ranking-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--tah-text);
}
.tah-ad-ranking-table thead th {
    text-align: left;
    padding: 8px 6px;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tah-text-subtle);
    border-bottom: 1px solid var(--tah-border);
    font-weight: 600;
}
.tah-ad-ranking-table tbody td {
    padding: 11px 6px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: .85rem;
    vertical-align: top;
}
.tah-ad-ranking-table tbody tr:last-child td { border-bottom: none; }
.tah-ad-rank-pos {
    color: var(--tah-text-subtle);
    font-weight: 700;
    font-family: monospace;
    width: 36px;
}
.tah-ad-streamer-name { color: var(--tah-text); font-weight: 600; }
.tah-ad-streamer-sub  { color: var(--tah-text-subtle); font-size: .72rem; margin-top: 2px; }
.tah-ad-rank-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.tah-ad-rank-value-up   { color: var(--tah-success); }
.tah-ad-rank-value-down { color: var(--tah-danger); }
.tah-ad-rank-value-zero { color: var(--tah-text-subtle); }

/* Banner de aviso: aún no hay datos de backstage */
.tah-ad-warning-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.3);
    border-radius: var(--tah-radius);
    padding: 14px 18px;
    margin: 18px 0 24px;
}
.tah-ad-warning-banner strong { color: #fbbf24; font-size: .92rem; display: block; margin-bottom: 4px; }
.tah-ad-warning-banner p     { margin: 0; color: var(--tah-text-muted); font-size: .82rem; }
.tah-ad-warning-banner a     { color: var(--tah-text) !important; }

/* ── Section title con link a la derecha ───────────────────────────────── */
.tah-ad-section-link {
    margin-left: auto;
    color: var(--tah-secondary) !important;
    text-decoration: none;
    font-size: .76rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.tah-ad-section-link:hover { text-decoration: underline; }

/* ── Premios: grid de cards ────────────────────────────────────────────── */
.tah-ad-prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.tah-ad-prize-card {
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 18px 20px;
    transition: border-color var(--tah-transition);
}
.tah-ad-prize-card:hover { border-color: var(--tah-border-hover); }

.tah-ad-prize-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.tah-ad-prize-img,
.tah-ad-prize-img-fallback {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--tah-primary) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--tah-primary) 30%, transparent);
}
.tah-ad-prize-img-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}
.tah-ad-prize-info { flex: 1; min-width: 0; }
.tah-ad-prize-title {
    color: var(--tah-text);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 3px;
}
.tah-ad-prize-value {
    color: var(--tah-secondary);
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.tah-ad-prize-threshold {
    color: var(--tah-text-subtle);
    font-size: .75rem;
}
.tah-ad-prize-winner-count {
    text-align: center;
    flex-shrink: 0;
    padding: 8px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius-sm);
    min-width: 64px;
}
.tah-ad-prize-winner-count strong {
    display: block;
    font-size: 1.4rem;
    color: var(--tah-text-muted);
    line-height: 1;
}
.tah-ad-prize-winner-count span {
    font-size: .65rem;
    color: var(--tah-text-subtle);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tah-ad-prize-winner-count.has-winners {
    background: rgba(34,197,94,.1);
    border-color: rgba(34,197,94,.4);
}
.tah-ad-prize-winner-count.has-winners strong { color: var(--tah-success); }
.tah-ad-prize-winner-count.has-winners span   { color: var(--tah-success); opacity: .85; }

.tah-ad-prize-desc {
    color: var(--tah-text-muted);
    font-size: .8rem;
    line-height: 1.4;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tah-border);
}

.tah-ad-prize-section { margin-top: 12px; }
.tah-ad-prize-section-title {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tah-text-subtle);
    margin-bottom: 8px;
    font-weight: 600;
}
.tah-ad-prize-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tah-ad-prize-item {
    background: rgba(255,255,255,.03);
    border-radius: var(--tah-radius-sm);
    padding: 8px 10px;
}
.tah-ad-prize-item-winner {
    background: rgba(34,197,94,.08);
    border: 1px solid rgba(34,197,94,.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tah-ad-prize-item-winner .tah-ad-prize-item-name { color: var(--tah-success); font-weight: 600; }
.tah-ad-prize-item-winner .tah-ad-prize-item-value { color: var(--tah-success); font-size: .82rem; font-weight: 700; }

.tah-ad-prize-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.tah-ad-prize-item-name {
    color: var(--tah-text);
    font-weight: 600;
    font-size: .85rem;
}
.tah-ad-prize-item-pct {
    font-size: .82rem;
    font-weight: 700;
    color: var(--tah-secondary);
}
.tah-ad-prize-item-bar {
    height: 6px;
    background: rgba(255,255,255,.06);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}
.tah-ad-prize-item-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tah-primary), var(--tah-secondary));
    border-radius: 999px;
    transition: width .4s ease;
}
.tah-ad-prize-item-detail {
    font-size: .7rem;
    color: var(--tah-text-subtle);
}
.tah-ad-prize-item-more {
    text-align: center;
    color: var(--tah-text-subtle);
    font-size: .75rem;
    padding: 4px;
    font-style: italic;
}
.tah-ad-prize-empty {
    background: rgba(255,255,255,.03);
    border: 1px dashed var(--tah-border);
    border-radius: var(--tah-radius-sm);
    padding: 14px;
    color: var(--tah-text-subtle);
    font-size: .8rem;
    text-align: center;
}

/* ─── SD Coin Wallet ──────────────────────────────────────────────────────── */
/* Botón en el header del dashboard */
.tah-wallet-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 10px;
    margin-left: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,193,7,.18), rgba(254,44,85,.18)) !important;
    border: 1px solid rgba(255,193,7,.45) !important;
    color: #fde68a !important;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--tah-transition), background var(--tah-transition), box-shadow var(--tah-transition);
    box-shadow: 0 2px 10px rgba(254,44,85,.18);
}
.tah-wallet-trigger:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255,193,7,.28), rgba(254,44,85,.28)) !important;
    box-shadow: 0 4px 16px rgba(254,44,85,.3);
}
.tah-wallet-trigger-icon { font-size: 1rem; line-height: 1; }
.tah-wallet-trigger-amount { font-variant-numeric: tabular-nums; color: #fff7d6; }
.tah-wallet-trigger-code   { font-size: .68rem; opacity: .85; letter-spacing: .04em; }

/* Modal overlay + card */
.tah-wallet-modal {
    position: fixed; inset: 0; z-index: 100001;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.tah-wallet-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}
.tah-wallet-modal-card {
    position: relative; z-index: 1;
    width: min(460px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    background: linear-gradient(180deg, #1c1917 0%, #0d0908 100%);
    border: 1px solid rgba(255,193,7,.25);
    border-radius: 20px;
    padding: 24px 22px 20px;
    color: var(--tah-text);
    box-shadow: 0 28px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,193,7,.12);
    animation: tah-wallet-pop .25s ease-out;
}
@keyframes tah-wallet-pop {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.tah-wallet-modal-close {
    position: absolute; top: 10px; right: 14px;
    background: rgba(255,255,255,.06) !important;
    border: none !important;
    color: var(--tah-text-subtle) !important;
    font-size: 1.5rem; line-height: 1;
    cursor: pointer; padding: 2px 10px 4px;
    border-radius: 50%;
    transition: background var(--tah-transition), color var(--tah-transition);
}
.tah-wallet-modal-close:hover {
    background: rgba(255,255,255,.14) !important;
    color: #fff !important;
}

/* Hero / saldo grande */
.tah-wallet-hero {
    text-align: center;
    padding: 6px 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 14px;
}
.tah-wallet-hero-coin {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 12px rgba(254,44,85,.4));
    animation: tah-wallet-spin 3.5s ease-in-out infinite;
    display: inline-block;
}
@keyframes tah-wallet-spin {
    0%, 100% { transform: rotateY(0deg); }
    50%      { transform: rotateY(180deg); }
}
.tah-wallet-hero-title {
    margin: 4px 0 2px;
    font-size: 1.05rem;
    color: var(--tah-text);
    font-weight: 700;
}
.tah-wallet-hero-subtitle {
    margin: 0 0 14px;
    color: var(--tah-text-subtle);
    font-size: .78rem;
}
.tah-wallet-hero-balance {
    display: inline-flex; align-items: baseline; gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, rgba(255,193,7,.12), rgba(254,44,85,.12));
    border: 1px solid rgba(255,193,7,.3);
    border-radius: 14px;
    margin-bottom: 8px;
}
.tah-wallet-hero-amount {
    font-size: 2.1rem;
    font-weight: 800;
    color: #fde68a;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.tah-wallet-hero-code {
    font-size: .85rem;
    color: #fbbf24;
    letter-spacing: .06em;
    font-weight: 700;
}
.tah-wallet-hero-rate {
    margin: 0;
    color: var(--tah-text-subtle);
    font-size: .72rem;
}
.tah-wallet-hero-usd {
    margin: 4px 0 4px;
    color: #4ade80;
    font-size: .92rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

/* Stats row */
.tah-wallet-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.tah-wallet-stat {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.tah-wallet-stat-label {
    font-size: .68rem;
    color: var(--tah-text-subtle);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.tah-wallet-stat-value {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.tah-wallet-stat-earn  { color: #22c55e; }
.tah-wallet-stat-spent { color: #f59e0b; }

/* History */
.tah-wallet-history {
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    padding: 12px 4px 6px 14px;
}
.tah-wallet-history-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.tah-wallet-history-header h4 {
    margin: 0; font-size: .85rem; color: var(--tah-text);
    font-weight: 700; letter-spacing: .02em;
}
.tah-wallet-history-refresh {
    background: rgba(255,255,255,.06) !important;
    border: none !important;
    color: var(--tah-text-muted) !important;
    border-radius: 50%;
    width: 28px; height: 28px;
    line-height: 1;
    cursor: pointer; font-size: 1rem;
    transition: transform .3s ease, color var(--tah-transition);
}
.tah-wallet-history-refresh:hover {
    color: #fff !important;
    transform: rotate(90deg);
}
.tah-wallet-history-body {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 8px;
}
.tah-wallet-history-body::-webkit-scrollbar { width: 4px; }
.tah-wallet-history-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.15);
    border-radius: 4px;
}
.tah-wallet-history-loading,
.tah-wallet-history-empty {
    color: var(--tah-text-subtle);
    font-size: .78rem;
    padding: 18px 6px;
    text-align: center;
    font-style: italic;
}
.tah-wallet-tx {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.tah-wallet-tx:last-child { border-bottom: none; }
.tah-wallet-tx-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    flex-shrink: 0;
}
.tah-wallet-tx-credit .tah-wallet-tx-icon {
    background: rgba(34,197,94,.15);
    color: #4ade80;
}
.tah-wallet-tx-debit .tah-wallet-tx-icon {
    background: rgba(245,158,11,.15);
    color: #fbbf24;
}
.tah-wallet-tx-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 1px;
}
.tah-wallet-tx-title {
    font-size: .82rem;
    color: var(--tah-text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tah-wallet-tx-meta {
    font-size: .68rem;
    color: var(--tah-text-subtle);
}
.tah-wallet-tx-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: .92rem;
    text-align: right;
    flex-shrink: 0;
}
.tah-wallet-tx-credit .tah-wallet-tx-amount { color: #4ade80; }
.tah-wallet-tx-debit  .tah-wallet-tx-amount { color: #fbbf24; }

.tah-wallet-footer-note {
    margin: 14px 0 0;
    padding: 10px 12px;
    background: rgba(255,255,255,.03);
    border-radius: 10px;
    font-size: .72rem;
    color: var(--tah-text-subtle);
    text-align: center;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .tah-wallet-trigger-code { display: none; }
    .tah-wallet-hero-amount  { font-size: 1.8rem; }
}

/* ── Wallet action buttons (transferir / mi cuenta) ────────────────────── */
.tah-wallet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.tah-wallet-action-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 700;
    border: none !important;
    cursor: pointer;
    transition: transform var(--tah-transition), box-shadow var(--tah-transition);
    line-height: 1.1;
}
.tah-wallet-action-btn:hover { transform: translateY(-1px); }
.tah-wallet-action-transfer {
    background: linear-gradient(135deg, #FE2C55 0%, #d61f47 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(254,44,85,.32);
}
.tah-wallet-action-transfer:hover {
    box-shadow: 0 8px 26px rgba(254,44,85,.45);
}
.tah-wallet-action-bank {
    background: rgba(255,255,255,.06) !important;
    color: #fafaf9 !important;
    border: 1px solid rgba(255,255,255,.1) !important;
}
.tah-wallet-action-bank:hover {
    background: rgba(255,255,255,.1) !important;
}

/* ── Transferencia / formularios ────────────────────────────────────────── */
.tah-transfer-card {
    width: min(560px, 96vw);
}
.tah-bank-card {
    width: min(520px, 96vw);
}
.tah-transfer-help {
    margin: 0 0 14px;
    color: var(--tah-text-muted);
    font-size: .84rem;
    line-height: 1.5;
}
.tah-transfer-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}
.tah-transfer-summary > div {
    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;
}
.tah-transfer-sum-label {
    font-size: .68rem;
    color: var(--tah-text-subtle);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.tah-transfer-sum-value {
    font-size: 1rem;
    color: #fafaf9;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tah-transfer-section {
    margin: 14px 0 10px;
    font-size: .8rem;
    color: var(--tah-text);
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding-bottom: 6px;
}

.tah-transfer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 12px;
}
.tah-transfer-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tah-transfer-field--full {
    grid-column: 1 / -1;
}
.tah-transfer-field label {
    font-size: .72rem;
    color: var(--tah-text-muted);
    font-weight: 600;
    letter-spacing: .02em;
}
.tah-transfer-field input,
.tah-transfer-field select {
    background: rgba(255,255,255,.04) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    border-radius: 8px;
    padding: 9px 11px;
    color: #fafaf9 !important;
    font-size: .88rem;
    transition: border-color var(--tah-transition), background var(--tah-transition);
    outline: none;
    width: 100%;
}
.tah-transfer-field input:focus,
.tah-transfer-field select:focus {
    border-color: #FE2C55 !important;
    background: rgba(255,255,255,.06) !important;
}
.tah-transfer-field input::placeholder { color: var(--tah-text-subtle); }

/* Forzar fondo oscuro y texto claro en las opciones del dropdown.
   Firefox y algunos navegadores ignoran el estilo del <select> en los <option>. */
.tah-transfer-field select option,
.tah-transfer-field select optgroup,
#tah-transfer-modal select option,
#tah-bank-modal select option {
    background-color: #1c1917 !important;
    color: #fafaf9 !important;
}
.tah-transfer-field select option:hover,
.tah-transfer-field select option:checked,
#tah-transfer-modal select option:checked,
#tah-bank-modal select option:checked {
    background-color: #FE2C55 !important;
    color: #fff !important;
}
/* Datalist (autocomplete del banco) en algunos navegadores */
input[list]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .5; }

/* Hint debajo del campo de banco */
.tah-bank-hint {
    font-size: .68rem;
    color: var(--tah-text-subtle);
    opacity: .75;
    margin-top: 2px;
}

/* ── Tarjeta resumen de cuenta bancaria en modal Transferir ─────────────── */
.tah-bank-summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: background var(--tah-transition);
}
.tah-bank-summary.is-set {
    background: rgba(34,197,94,.06);
    border: 1px solid rgba(34,197,94,.25);
}
.tah-bank-summary.is-empty {
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.35);
}
.tah-bank-summary-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}
.tah-bank-summary-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.tah-bank-summary-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tah-bank-summary-row strong {
    font-size: .92rem;
    color: #fafaf9;
    font-weight: 700;
}
.tah-bank-summary-row span {
    font-size: .7rem;
    color: var(--tah-text-muted);
    background: rgba(255,255,255,.06);
    padding: 1px 8px;
    border-radius: 999px;
}
.tah-bank-summary-account {
    font-size: .82rem;
    color: #86efac;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    letter-spacing: .02em;
}
.tah-bank-summary-holder {
    font-size: .78rem;
    color: var(--tah-text-muted);
}
.tah-bank-summary-country {
    font-size: .68rem;
    color: var(--tah-text-subtle);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 2px;
}
.tah-bank-summary-edit {
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    color: #fafaf9 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-size: .74rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    flex-shrink: 0;
    transition: background var(--tah-transition), border-color var(--tah-transition);
}
.tah-bank-summary-edit:hover {
    background: rgba(255,255,255,.12) !important;
    border-color: rgba(255,255,255,.25) !important;
}

/* Estado: cuenta vacía */
.tah-bank-summary-empty {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}
.tah-bank-summary-empty-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}
.tah-bank-summary-empty strong {
    display: block;
    color: #fbbf24;
    font-size: .92rem;
    margin-bottom: 4px;
}
.tah-bank-summary-empty p {
    margin: 0 0 10px;
    color: var(--tah-text-muted);
    font-size: .78rem;
    line-height: 1.5;
}
.tah-bank-summary-cta {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #fff !important;
    border: none !important;
    padding: 9px 14px !important;
    border-radius: 8px !important;
    font-size: .82rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(245,158,11,.3);
    transition: transform var(--tah-transition), box-shadow var(--tah-transition);
}
.tah-bank-summary-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245,158,11,.45);
}

/* ─── Admin Dashboard · sección Wallet ─────────────────────────────────── */
.tah-ad-wallet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.tah-ad-wallet-card {
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 16px 18px;
    position: relative;
    transition: border-color var(--tah-transition), transform var(--tah-transition);
}
.tah-ad-wallet-card:hover {
    border-color: var(--tah-border-hover);
    transform: translateY(-2px);
}
.tah-ad-wallet-circulation { border-color: rgba(254,44,85,.4); }
.tah-ad-wallet-pending     { border-color: rgba(59,130,246,.4); }
.tah-ad-wallet-earned      { border-color: rgba(34,197,94,.4); }
.tah-ad-wallet-gas         { border-color: rgba(168,85,247,.4); }

.tah-ad-wallet-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tah-text-subtle);
    margin-bottom: 6px;
}
.tah-ad-wallet-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-bottom: 8px;
}
.tah-ad-wallet-circulation .tah-ad-wallet-value { color: #FE2C55; }
.tah-ad-wallet-pending     .tah-ad-wallet-value { color: #3b82f6; }
.tah-ad-wallet-earned      .tah-ad-wallet-value { color: #22c55e; }
.tah-ad-wallet-gas         .tah-ad-wallet-value { color: #a855f7; }

.tah-ad-wallet-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
}
.tah-ad-wallet-rows > div {
    display: flex;
    justify-content: space-between;
    color: var(--tah-text-muted);
}
.tah-ad-wallet-rows strong {
    color: var(--tah-text);
    font-weight: 700;
}
.tah-ad-wallet-foot {
    font-size: .7rem;
    color: var(--tah-text-subtle);
    margin-top: 4px;
}
.tah-ad-wallet-cta {
    display: inline-block;
    margin-top: 6px;
    font-size: .78rem;
    color: #3b82f6 !important;
    font-weight: 700;
    text-decoration: none;
}
.tah-ad-wallet-cta:hover { color: #60a5fa !important; }

/* Panels: top holders + retiros recientes */
.tah-ad-wallet-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}
.tah-ad-wallet-panel {
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 16px 18px;
}
.tah-ad-wallet-panel h3 {
    margin: 0 0 12px;
    font-size: .95rem;
    color: var(--tah-text);
}

/* Top holders list */
.tah-ad-wallet-holders {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tah-ad-wallet-holders li {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.tah-ad-wallet-holders li:last-child { border-bottom: none; }
.tah-ad-wallet-pos {
    font-weight: 800;
    color: var(--tah-text-subtle);
    font-size: .9rem;
}
.tah-ad-wallet-user {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.tah-ad-wallet-user small {
    color: var(--tah-text-subtle);
    font-size: .7rem;
    margin-top: 1px;
}
.tah-ad-wallet-bal {
    text-align: right;
    color: #FE2C55;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.tah-ad-wallet-bal small {
    display: block;
    color: #3b82f6;
    font-size: .7rem;
    font-weight: 500;
}

/* Recent withdrawals list */
.tah-ad-wallet-withdrawals {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tah-ad-wallet-withdrawals li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
    border-left: 3px solid transparent;
    padding-left: 10px;
    margin-bottom: 2px;
}
.tah-ad-wallet-withdrawals li:last-child { border-bottom: none; }
.tah-ad-wallet-withdrawals li.is-ok       { border-left-color: #22c55e; }
.tah-ad-wallet-withdrawals li.is-err      { border-left-color: #ef4444; }
.tah-ad-wallet-withdrawals li.is-pending  { border-left-color: #3b82f6; }

.tah-ad-wallet-w-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.tah-ad-wallet-w-user {
    font-weight: 700;
    color: var(--tah-text);
}
.tah-ad-wallet-w-status {
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
}
.is-ok .tah-ad-wallet-w-status     { background: rgba(34,197,94,.15);  color: #4ade80; }
.is-err .tah-ad-wallet-w-status    { background: rgba(239,68,68,.15);  color: #fca5a5; }
.is-pending .tah-ad-wallet-w-status{ background: rgba(59,130,246,.15); color: #93c5fd; }

.tah-ad-wallet-w-amount {
    color: #22c55e;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.tah-ad-wallet-w-amount small {
    color: #3b82f6;
    font-weight: 500;
}
.tah-ad-wallet-w-bank {
    color: var(--tah-text-muted);
    font-size: .78rem;
}
.tah-ad-wallet-w-time {
    color: var(--tah-text-subtle);
    font-size: .7rem;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 1100px) {
    .tah-ad-wallet-grid    { grid-template-columns: repeat(2, 1fr); }
    .tah-ad-wallet-grid-2  { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .tah-ad-wallet-grid    { grid-template-columns: 1fr; }
    .tah-ad-wallet-value   { font-size: 1.35rem; }
}

.tah-transfer-equiv {
    margin-top: 4px;
    padding: 8px 10px;
    background: rgba(34,197,94,.08);
    border: 1px solid rgba(34,197,94,.2);
    border-radius: 8px;
    font-size: .78rem;
    color: #86efac;
    font-variant-numeric: tabular-nums;
}

/* Desglose de transferencia: bruto - GAS = neto */
.tah-transfer-breakdown {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}
.tah-transfer-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    color: var(--tah-text-muted);
}
.tah-transfer-breakdown-row small { opacity: .55; }
.tah-transfer-breakdown-gas {
    color: #fbbf24;
    border-bottom: 1px dashed rgba(255,255,255,.08);
    padding-bottom: 6px;
}
.tah-transfer-breakdown-net {
    color: #86efac;
    margin-top: 6px;
    padding-top: 8px;
    font-size: .95rem;
}
.tah-transfer-breakdown-net strong {
    font-size: 1rem;
}

.tah-transfer-save {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 8px;
    font-size: .82rem;
    color: var(--tah-text-muted);
    cursor: pointer;
}
.tah-transfer-save input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #FE2C55;
}

.tah-transfer-trm-note {
    background: rgba(59,130,246,.08);
    border: 1px solid rgba(59,130,246,.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .74rem;
    color: #93c5fd;
    margin-bottom: 12px;
    line-height: 1.45;
}

.tah-transfer-buttons {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.tah-transfer-submit {
    flex: 1;
    background: linear-gradient(135deg, #FE2C55, #d61f47) !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--tah-transition), box-shadow var(--tah-transition), opacity var(--tah-transition);
    box-shadow: 0 6px 18px rgba(254,44,85,.3);
}
.tah-transfer-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(254,44,85,.45);
}
.tah-transfer-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.tah-transfer-cancel {
    background: rgba(255,255,255,.06) !important;
    color: var(--tah-text-muted) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: .88rem;
}
.tah-transfer-cancel:hover {
    background: rgba(255,255,255,.1) !important;
    color: #fafaf9 !important;
}

.tah-transfer-response {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .82rem;
    line-height: 1.5;
    display: none;
}
.tah-transfer-response.show { display: block; }
.tah-transfer-response.is-ok {
    background: rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.3);
    color: #86efac;
}
.tah-transfer-response.is-err {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.3);
    color: #fca5a5;
}

@media (max-width: 520px) {
    .tah-wallet-actions { grid-template-columns: 1fr; }
    .tah-transfer-grid  { grid-template-columns: 1fr; }
    .tah-transfer-summary { grid-template-columns: 1fr; }
}

/* ============================================================
   📬 BANDEJA DE MENSAJES DEL CREADOR (v5.17)
   Botón campana en header + modal con lista personal/general.
   ============================================================ */
.tah-inbox-trigger,
.tah-refresh-trigger {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    margin-left: 8px;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.04);
    border-radius: 50%;
    cursor: pointer;
    transition: all .15s ease;
}
.tah-inbox-trigger:hover {
    background: rgba(254,44,85,.18);
    border-color: rgba(254,44,85,.45);
    transform: translateY(-1px);
}
.tah-refresh-trigger:hover {
    background: rgba(34,211,238,.18);
    border-color: rgba(34,211,238,.45);
    transform: translateY(-1px);
}
.tah-refresh-icon { font-size: 1.1rem; line-height: 1; display: inline-block; }
.tah-refresh-trigger.is-spinning .tah-refresh-icon { animation: tah-refresh-spin .6s linear; }
@keyframes tah-refresh-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.tah-inbox-icon { font-size: 1.1rem; line-height: 1; }
.tah-inbox-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: #ef4444; color: #fff;
    border: 2px solid #000202;
    border-radius: 999px;
    font-size: .68rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.tah-inbox-modal {
    position: fixed; inset: 0; z-index: 100001;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.tah-inbox-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.72); backdrop-filter: blur(6px);
}
.tah-inbox-modal-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 540px; max-height: 85vh;
    background: #0d1414; border: 1px solid rgba(255,255,255,.18);
    border-radius: 16px; padding: 22px 22px 18px;
    overflow-y: auto; color: #fafaf9;
    box-shadow: 0 18px 60px rgba(0,0,0,.6);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tah-inbox-modal-close {
    position: absolute; top: 12px; right: 14px;
    width: 32px; height: 32px;
    border: 1px solid rgba(255,255,255,.18); border-radius: 50%;
    background: #121b1b; color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer;
}
.tah-inbox-modal-close:hover { background: #ef4444; }

.tah-inbox-head {
    display: flex; justify-content: space-between; align-items: center;
    padding-right: 44px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    margin-bottom: 12px;
}
.tah-inbox-head h3 { margin: 0; font-size: 16px; }
.tah-inbox-mark-all {
    background: transparent; border: 1px solid rgba(255,255,255,.18);
    color: #a8a29e; padding: 5px 10px; border-radius: 7px;
    font-size: 11px; cursor: pointer; font-family: inherit;
}
.tah-inbox-mark-all:hover { color: #fff; border-color: #22d3ee; }

.tah-inbox-filters {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.tah-inbox-filter {
    padding: 5px 11px; font-size: 11px; font-weight: 600;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px; color: #a8a29e; cursor: pointer;
    font-family: inherit;
}
.tah-inbox-filter:hover { color: #fff; }
.tah-inbox-filter.is-active {
    background: #FE2C55; border-color: #FE2C55; color: #fff;
}

.tah-inbox-list { display: flex; flex-direction: column; gap: 8px; }
.tah-inbox-loading,
.tah-inbox-empty {
    padding: 30px; text-align: center;
    color: #a8a29e; font-size: 13px;
}

.tah-inbox-item {
    padding: 12px 14px; border-radius: 10px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
    cursor: pointer; transition: all .15s ease;
}
.tah-inbox-item:hover { background: rgba(255,255,255,.06); }
.tah-inbox-item.is-unread {
    background: rgba(34,211,238,.06);
    border-left: 3px solid #22d3ee;
}

.tah-inbox-item-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px; margin-bottom: 4px;
}
.tah-inbox-item-title { font-size: 14px; font-weight: 600; color: #fff; }
.tah-inbox-item.is-unread .tah-inbox-item-title { color: #22d3ee; }
.tah-inbox-item-date { font-size: 11px; color: #78716c; white-space: nowrap; }
.tah-inbox-item-body {
    margin: 0 0 6px; font-size: 12px; color: #d6d3d1; line-height: 1.45;
    word-wrap: break-word;
}
.tah-inbox-item-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tah-inbox-tag {
    font-size: 10px; padding: 2px 8px; border-radius: 999px;
    background: rgba(255,255,255,.06); color: #a8a29e;
    border: 1px solid rgba(255,255,255,.10);
}
.tah-inbox-tag.is-personal { background: rgba(34,211,238,.12); color: #22d3ee; border-color: rgba(34,211,238,.30); }
.tah-inbox-tag.is-general  { background: rgba(168,162,158,.10); color: #a8a29e; }
.tah-inbox-tag.is-unread   { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.30); }

/* ============================================================
   📬 BANDEJA · Modal de DETALLE (mensaje completo)
   Se abre encima del modal de bandeja al tocar una notificación.
   ============================================================ */
.tah-inbox-detail-modal {
    position: fixed; inset: 0; z-index: 100002;  /* encima del modal de bandeja (100001) */
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.tah-inbox-detail-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.82); backdrop-filter: blur(8px);
}
.tah-inbox-detail-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 480px; max-height: 80vh;
    background: #0d1414; border: 1px solid rgba(255,255,255,.18);
    border-radius: 16px; padding: 28px 24px 22px;
    overflow-y: auto; color: #fafaf9;
    box-shadow: 0 24px 80px rgba(0,0,0,.7);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: tah-inbox-pop .25s ease;
}
@keyframes tah-inbox-pop {
    from { opacity: 0; transform: scale(.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.tah-inbox-detail-close {
    position: absolute; top: 14px; right: 16px;
    width: 32px; height: 32px;
    border: 1px solid rgba(255,255,255,.20); border-radius: 50%;
    background: #121b1b; color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer;
    transition: all .15s ease;
}
.tah-inbox-detail-close:hover {
    background: #ef4444; border-color: #ef4444;
    transform: scale(1.05);
}

.tah-inbox-detail-tags {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
    padding-right: 44px;  /* espacio para el botón de cerrar */
}
.tah-inbox-detail-title {
    margin: 0 0 8px;
    font-size: 19px; font-weight: 700; color: #fff !important;
    padding-right: 44px;
    line-height: 1.3;
    word-wrap: break-word;
}
.tah-inbox-detail-date {
    font-size: 12px; color: #a8a29e; margin-bottom: 16px;
}
.tah-inbox-detail-body {
    font-size: 15px; line-height: 1.55; color: #e7e5e4 !important;
    padding: 16px 18px;
    background: rgba(255,255,255,.04);
    border-left: 3px solid #22d3ee;
    border-radius: 8px;
    margin-bottom: 18px;
    white-space: pre-wrap; word-wrap: break-word;
}
.tah-inbox-detail-body:empty { display: none; }
.tah-inbox-detail-actions {
    display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
.tah-inbox-detail-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 9px;
    font-size: 13px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    transition: all .15s ease;
    font-family: inherit;
}
.tah-inbox-detail-btn-primary {
    background: #FE2C55; color: #fff;
}
.tah-inbox-detail-btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.tah-inbox-detail-btn-ghost {
    background: transparent; color: #a8a29e;
    border-color: rgba(255,255,255,.18);
}
.tah-inbox-detail-btn-ghost:hover { color: #fff; border-color: #a8a29e; }

/* ============================================================
   🧑‍💼 GESTIÓN POR MANAGER (admin-dashboard)
   ============================================================ */
.tah-ad-mgr-period-toggle .tah-ad-mgr-pbtn {
    padding: 5px 12px; font-size: 12px; font-weight: 600;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
    color: #a8a29e; border-radius: 999px;
    cursor: pointer; font-family: inherit; transition: all .15s ease;
}
.tah-ad-mgr-period-toggle .tah-ad-mgr-pbtn:hover { color: #fff; border-color: rgba(255,255,255,.25); }
.tah-ad-mgr-period-toggle .tah-ad-mgr-pbtn.is-active {
    background: #FE2C55; border-color: #FE2C55; color: #fff;
}

.tah-ad-mgr-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.tah-ad-mgr-total-card {
    padding: 12px 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
}
.tah-ad-mgr-total-lbl {
    font-size: 11px; color: #a8a29e;
    text-transform: uppercase; letter-spacing: .04em;
}
.tah-ad-mgr-total-val {
    font-size: 22px; font-weight: 800; color: #fafaf9 !important;
    margin-top: 4px; font-variant-numeric: tabular-nums;
}

.tah-ad-mgr-table-wrap {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    overflow: hidden; overflow-x: auto;
    margin-bottom: 20px;
}
.tah-ad-mgr-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #fafaf9; }
.tah-ad-mgr-table thead th {
    text-align: left; padding: 12px 14px;
    background: rgba(255,255,255,.05);
    color: #a8a29e; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid rgba(255,255,255,.10);
}
.tah-ad-mgr-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: #fafaf9 !important;
}
.tah-ad-mgr-table tbody tr:last-child td { border-bottom: none; }
.tah-ad-mgr-table tbody tr:hover { background: rgba(255,255,255,.04); }
.tah-ad-mgr-table .tah-ad-mgr-num {
    text-align: right; font-variant-numeric: tabular-nums;
}
.tah-ad-mgr-empty { text-align: center; color: #a8a29e !important; padding: 24px !important; }

.tah-ad-mgr-user { display: flex; align-items: center; gap: 10px; }
.tah-ad-mgr-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.tah-ad-mgr-user strong { display: block; font-weight: 600; }
.tah-ad-mgr-user small { display: block; color: #78716c; font-size: 11px; }

/* ============================================================
   🔔 BANNER OBLIGATORIO · Activar notificaciones PWA
   Aparece en el dashboard del creador si NO tiene suscripción activa.
   ============================================================ */
.tah-push-mandatory-banner {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; margin: 12px 0 18px;
    background: linear-gradient(135deg, rgba(254,44,85,.22) 0%, rgba(254,44,85,.06) 100%);
    border: 1px solid rgba(254,44,85,.45);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(254,44,85,.18);
    animation: tah-push-pulse 2.5s ease-in-out infinite;
}
@keyframes tah-push-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(254,44,85,.18); }
    50%      { box-shadow: 0 4px 24px rgba(254,44,85,.32); }
}
.tah-push-mandatory-icon {
    font-size: 32px; line-height: 1;
    flex-shrink: 0;
}
.tah-push-mandatory-text {
    flex: 1; min-width: 0;
    color: #fafaf9;
}
.tah-push-mandatory-text strong {
    display: block; font-size: 14px; font-weight: 700;
    margin-bottom: 2px; color: #fff !important;
}
.tah-push-mandatory-text span {
    display: block; font-size: 12px; color: #d6d3d1 !important;
    line-height: 1.4;
}
.tah-push-mandatory-cta {
    flex-shrink: 0;
    padding: 10px 18px;
    background: #fff; color: #FE2C55 !important;
    border: none; border-radius: 999px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: all .15s ease;
    white-space: nowrap;
}
.tah-push-mandatory-cta:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 12px rgba(255,255,255,.25);
}
@media (max-width: 560px) {
    .tah-push-mandatory-banner { flex-direction: column; text-align: center; padding: 14px; }
    .tah-push-mandatory-cta    { width: 100%; }
}

/* ============================================================
   🔴 LIVE — Botón header + Modal stream en tiempo real (v5.20)
   ============================================================ */

/* Botón LIVE en el header */
.tah-live-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px 7px 12px;
    margin-left: 8px;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff !important;
    border-radius: 999px;
    font-size: .85rem; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(239,68,68,.7);
    animation: tah-live-pulse-shadow 1.8s ease-in-out infinite;
    transition: transform .15s ease;
    font-family: inherit;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.tah-live-trigger:hover { transform: translateY(-1px) scale(1.03); }
@keyframes tah-live-pulse-shadow {
    0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
    70%  { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.tah-live-pulse {
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255,255,255,.9);
    animation: tah-live-blink 1.2s ease-in-out infinite;
}
@keyframes tah-live-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(.8); }
}
.tah-live-label { letter-spacing: .08em; }
.tah-live-viewers {
    padding: 2px 8px; background: rgba(0,0,0,.30);
    border-radius: 999px; font-size: .72rem; font-weight: 700;
}

/* Botón "Iniciar Live" (antes de transmitir) */
.tah-live-start-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    margin-left: 8px;
    background: linear-gradient(135deg, rgba(254,44,85,.18), rgba(34,211,238,.18));
    border: 1px solid rgba(254,44,85,.40);
    color: #fff !important;
    border-radius: 999px;
    font-size: .85rem; font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}
.tah-live-start-btn:hover {
    background: linear-gradient(135deg, rgba(254,44,85,.32), rgba(34,211,238,.32));
    transform: translateY(-1px);
}
.tah-live-start-btn:disabled {
    opacity: .5; cursor: wait;
}

/* Botón "Terminar Live" (cuando hay sesión activa) */
.tah-live-stop-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    margin-left: 8px;
    background: rgba(120,113,108,.20);
    border: 1px solid rgba(255,255,255,.20);
    color: #fff !important;
    border-radius: 999px;
    font-size: .82rem; font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}
.tah-live-stop-btn:hover { background: rgba(120,113,108,.35); }

/* Modal del live */
.tah-live-modal {
    position: fixed; inset: 0; z-index: 100003;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.tah-live-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.85); backdrop-filter: blur(8px);
}
.tah-live-modal-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 1100px; max-height: 92vh;
    background: #0d1414; border: 1px solid rgba(239,68,68,.40);
    border-radius: 16px; padding: 18px 20px 16px;
    color: #fafaf9 !important;
    box-shadow: 0 0 60px rgba(239,68,68,.25), 0 24px 80px rgba(0,0,0,.7);
    overflow: hidden;
    display: flex; flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tah-live-modal-close {
    position: absolute; top: 12px; right: 14px; z-index: 10;
    width: 32px; height: 32px;
    border: 1px solid rgba(255,255,255,.20); border-radius: 50%;
    background: #121b1b; color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer;
}
.tah-live-modal-close:hover { background: #ef4444; border-color: #ef4444; }

.tah-live-modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding-right: 44px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    margin-bottom: 14px;
    flex-wrap: wrap; gap: 8px;
}
.tah-live-modal-title-wrap { display: flex; align-items: center; gap: 10px; }
.tah-live-modal-title-wrap h3 {
    margin: 0; font-size: 17px; font-weight: 700;
    color: #fff !important;
}
.tah-live-modal-duration {
    padding: 3px 10px; background: rgba(255,255,255,.06);
    border-radius: 999px;
    font-size: 11px; color: #a8a29e; font-variant-numeric: tabular-nums;
}
.tah-live-modal-status { font-size: 12px; color: #22c55e; font-weight: 600; }
.tah-live-modal-status.is-disconnected { color: #ef4444; }
.tah-live-modal-status.is-ended { color: #a8a29e; }
.tah-live-modal-lastpoll {
    font-size: 10px; color: #6b7280;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    margin-left: auto;
}
.tah-live-modal-lastpoll:empty { display: none; }

/* Stats grid */
.tah-live-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.tah-live-stat {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
}
.tah-live-stat-icon { font-size: 20px; }
.tah-live-stat-label { font-size: 10px; color: #a8a29e; text-transform: uppercase; letter-spacing: .04em; }
.tah-live-stat-value {
    font-size: 18px; font-weight: 800; color: #fff !important;
    font-variant-numeric: tabular-nums;
    transition: color .3s ease;
}
.tah-live-stat-value.is-bumped { color: #22c55e !important; }

/* Grid principal: LOLA en una sola columna */
.tah-live-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    flex: 1; min-height: 0;
}
.tah-live-grid--solo { grid-template-columns: 1fr; }

/* Feed de eventos */
.tah-live-feed-wrap {
    display: flex; flex-direction: column;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    overflow: hidden;
    min-height: 320px;
}
.tah-live-feed-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.tah-live-feed-head h4 { margin: 0; font-size: 13px; color: #fff !important; }
.tah-live-autoscroll-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; color: #a8a29e; cursor: pointer;
}
.tah-live-feed {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex; flex-direction: column; gap: 6px;
    max-height: 50vh;
}
.tah-live-feed-empty {
    text-align: center; padding: 30px;
    color: #78716c; font-size: 13px;
}

.tah-live-event {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 7px 10px;
    background: rgba(255,255,255,.02);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    animation: tah-live-event-in .25s ease-out;
    word-wrap: break-word;
}
@keyframes tah-live-event-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tah-live-event-icon { font-size: 14px; flex-shrink: 0; line-height: 1.2; }
.tah-live-event-content { flex: 1; min-width: 0; color: #d6d3d1 !important; }
.tah-live-event-content strong { color: #fff !important; }
.tah-live-event-time {
    font-size: 10px; color: #78716c; flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.tah-live-event.evt-gift     { background: rgba(254,44,85,.10); border-left: 3px solid #FE2C55; }
.tah-live-event.evt-follow   { background: rgba(34,211,238,.08); border-left: 3px solid #22d3ee; }
.tah-live-event.evt-share    { background: rgba(168,85,247,.08); border-left: 3px solid #a855f7; }
.tah-live-event.evt-like_milestone { background: rgba(245,158,11,.08); border-left: 3px solid #f59e0b; }

/* Panel LOLA */
.tah-live-lola-wrap {
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, rgba(34,211,238,.06) 0%, rgba(255,255,255,.02) 100%);
    border: 1px solid rgba(34,211,238,.20);
    border-radius: 12px;
    overflow: hidden;
}
.tah-live-lola-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px;
    background: rgba(34,211,238,.08);
    border-bottom: 1px solid rgba(34,211,238,.15);
}
.tah-live-lola-head h4 { margin: 0; font-size: 13px; color: #22d3ee !important; }
.tah-live-lola-status { font-size: 10px; color: #a8a29e; }
.tah-live-lola-list {
    flex: 1; overflow-y: auto;
    padding: 10px 14px;
    display: flex; flex-direction: column; gap: 8px;
    max-height: 60vh;
    min-height: 280px;
}
.tah-live-lola-empty {
    text-align: center; padding: 20px 10px;
    color: #78716c; font-size: 12px;
    line-height: 1.4;
}
/* LOLA semáforo: VERDE (info/good) / AMARILLO (warning) / ROJO (danger) */
.tah-live-lola-item {
    padding: 10px 12px; border-radius: 9px;
    background: rgba(34,197,94,.08);
    border-left: 3px solid #22c55e;   /* verde por defecto */
    font-size: 12px;
    line-height: 1.45;
    animation: tah-live-event-in .3s ease-out;
}
.tah-live-lola-item.is-warning { border-left-color: #f59e0b; background: rgba(245,158,11,.08); }
.tah-live-lola-item.is-danger {
    border-left-color: #ef4444;
    background: rgba(239,68,68,.10);
    animation: tah-live-event-in .3s ease-out, tah-live-danger-pulse 1.5s ease-in-out infinite 0.5s;
}
@keyframes tah-live-danger-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
    50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}
.tah-live-lola-title { font-weight: 700; color: #fff !important; margin-bottom: 3px; }
.tah-live-lola-msg   { color: #d6d3d1 !important; }
.tah-live-lola-meta  { font-size: 10px; color: #78716c; margin-top: 4px; display: flex; gap: 8px; }

/* Tag "PENALIDAD" arriba del título cuando el item es danger */
.tah-live-lola-penalty-tag {
    display: inline-block;
    padding: 2px 8px;
    margin-bottom: 6px;
    background: #ef4444;
    color: #fff !important;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    border-radius: 999px;
    text-transform: uppercase;
}

/* Banner danger persistente arriba del modal */
.tah-live-danger-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; margin: 0 0 12px;
    background: linear-gradient(90deg, rgba(239,68,68,.20) 0%, rgba(239,68,68,.06) 100%);
    border: 1px solid rgba(239,68,68,.50);
    border-radius: 10px;
    animation: tah-live-danger-banner-in .25s ease-out, tah-live-banner-pulse 2s ease-in-out infinite 0.5s;
}
@keyframes tah-live-danger-banner-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tah-live-banner-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
    50%      { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.tah-live-danger-icon { font-size: 26px; flex-shrink: 0; }
.tah-live-danger-text { flex: 1; min-width: 0; }
.tah-live-danger-text strong { display: block; color: #fff !important; font-size: 13px; margin-bottom: 2px; }
.tah-live-danger-text span { display: block; font-size: 12px; color: #fecaca !important; }
.tah-live-danger-dismiss {
    flex-shrink: 0;
    padding: 7px 14px;
    background: #fff; color: #dc2626 !important;
    border: none; border-radius: 999px;
    font-size: 12px; font-weight: 700;
    cursor: pointer; font-family: inherit;
}
.tah-live-danger-dismiss:hover { transform: scale(1.04); }

/* ═══════════════════════════════════════════════════════════════════════ */
/*  LMS — Academia (v5.29.0)                                              */
/* ═══════════════════════════════════════════════════════════════════════ */

/* Fuentes empaquetadas para diplomas. document.fonts.ready debe resolver
   antes de que html2canvas dispare para que el PDF use la tipografía. */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal; font-weight: 400; font-display: block;
    src: url('../fonts/playfair-display-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal; font-weight: 700; font-display: block;
    src: url('../fonts/playfair-display-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal; font-weight: 400; font-display: block;
    src: url('../fonts/montserrat-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal; font-weight: 700; font-display: block;
    src: url('../fonts/montserrat-700.woff2') format('woff2');
}

.tah-lms { margin-top: 36px; }
.tah-lms-header h2 { margin: 0 0 6px; font-size: 1.6rem; }
.tah-lms-subtitle { color: #a8a29e; margin-top: 0; }
.tah-lms-section-title { margin-top: 28px; font-size: 1.1rem; }

.tah-lms-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px; margin: 18px 0;
}
.tah-lms-stat-card {
    display: flex; gap: 12px; align-items: center;
    padding: 14px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.1);
}
.tah-lms-stat-icon { font-size: 1.8rem; }
.tah-lms-stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #a8a29e; }
.tah-lms-stat-value { font-size: 1.4rem; font-weight: 700; color: #fafaf9; }

.tah-lms-chart-wrap {
    margin: 18px 0; padding: 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
}
.tah-lms-chart-wrap h3 { margin: 0 0 10px; font-size: .95rem; color: #d6d3d1; }
.tah-lms-chart-wrap canvas { width: 100%; max-width: 100%; height: auto; }

.tah-lms-course-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px; margin: 12px 0;
}
.tah-lms-course-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px; padding: 14px;
    display: flex; flex-direction: column; gap: 8px;
}
.tah-lms-course-card h4 { margin: 0; font-size: 1rem; color: #fafaf9; }
.tah-lms-course-thumb {
    height: 120px; background-size: cover; background-position: center;
    border-radius: 8px; background-color: rgba(255,255,255,.06);
}
.tah-lms-course-desc { color: #a8a29e; font-size: .85rem; margin: 0; }
.tah-lms-course-reward { font-size: .78rem; color: #a8a29e; }
.tah-lms-progress-bar {
    width: 100%; height: 8px;
    background: rgba(255,255,255,.08);
    border-radius: 999px; overflow: hidden;
}
.tah-lms-progress-fill {
    height: 100%; background: var(--tah-primary, #FE2C55);
    transition: width .3s ease;
}
.tah-lms-progress-big { height: 14px; }

.tah-lms-cert-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.tah-lms-cert-tile {
    background: linear-gradient(135deg, rgba(254,44,85,.1), rgba(37,244,238,.08));
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px; padding: 14px;
    display: flex; flex-direction: column; gap: 6px;
}
.tah-lms-cert-tile-title { font-weight: 700; color: #fafaf9; }
.tah-lms-cert-tile-date { font-size: .78rem; color: #a8a29e; }
.tah-lms-cert-tile-badge { color: #f87171; font-size: .82rem; }
.tah-lms-cert-revoked { opacity: .6; }

/* ── Botón "Tus certificados" (abre el modal de diplomas) ──────────────── */
.tah-lms-certs-trigger {
    width: 100%;
    display: flex; align-items: center; gap: 14px;
    text-align: left; cursor: pointer;
    background: linear-gradient(135deg, rgba(254,44,85,.12), rgba(37,244,238,.08));
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px; padding: 16px 18px;
    transition: border-color .15s ease, transform .12s ease;
}
.tah-lms-certs-trigger:hover { border-color: rgba(255,255,255,.28); }
.tah-lms-certs-trigger:active { transform: scale(.99); }
.tah-lms-certs-trigger-icon { font-size: 1.6rem; line-height: 1; }
.tah-lms-certs-trigger-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tah-lms-certs-trigger-title { font-weight: 700; color: #fafaf9; }
.tah-lms-certs-trigger-sub { font-size: .82rem; color: #a8a29e; }
.tah-lms-certs-trigger-chevron { font-size: 1.6rem; color: #a8a29e; line-height: 1; }

/* ── Modal: lista de certificados / diplomas ───────────────────────────── */
.tah-lms-certs-modal {
    position: fixed; inset: 0; z-index: 999997;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.tah-lms-certs-modal[hidden] { display: none !important; }
.tah-lms-certs-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,2,2,.88);
    backdrop-filter: blur(4px);
}
.tah-lms-certs-modal-box {
    position: relative; z-index: 1;
    background: #0d1414;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    padding: 22px 24px 24px;
    max-width: 760px; width: 100%;
    max-height: 92vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    animation: tahQuizModalIn .25s ease-out;
}
.tah-lms-certs-modal-title { margin: 0 0 16px; font-size: 1.3rem; color: #fafaf9; }
.tah-lms-certs-modal-close {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer;
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.tah-lms-certs-modal-close:hover { background: rgba(255,255,255,.2); }

.tah-lms-course-detail {
    margin-top: 20px; padding: 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px;
}
.tah-lms-loading { padding: 30px; text-align: center; color: #a8a29e; }
.tah-lms-completion-banner {
    margin: 14px 0; padding: 14px;
    background: rgba(34,197,94,.15);
    border: 1px solid rgba(34,197,94,.4);
    border-radius: 10px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

.tah-lms-lesson-list { list-style: none; padding: 0; margin: 14px 0; }
.tah-lms-lesson-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin-bottom: 6px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
}
.tah-lms-lesson-item.is-done { border-color: rgba(34,197,94,.5); }
.tah-lms-lesson-item.is-locked { opacity: .55; }
.tah-lms-lesson-status {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,.08);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .9rem;
}
.tah-lms-lesson-item.is-done .tah-lms-lesson-status {
    background: #22c55e; color: #022c1e;
}
.tah-lms-lesson-title { flex: 1; }
.tah-lms-lesson-title small { display: block; color: #a8a29e; font-size: .7rem; margin-top: 2px; }
.tah-lms-locked-label { color: #a8a29e; font-size: .75rem; }

.tah-lms-lesson-view {
    margin-top: 18px; padding: 18px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
}
.tah-lms-lesson-h { margin: 10px 0 14px; font-size: 1.2rem; }
.tah-lms-lesson-content {
    line-height: 1.6;
}
.tah-lms-lesson-content img,
.tah-lms-lesson-content iframe,
.tah-lms-lesson-content video {
    max-width: 100%; border-radius: 8px; margin: 8px 0;
}
.tah-lms-lesson-actions { margin-top: 16px; }

.tah-lms-quiz-rules { color: #a8a29e; font-size: .85rem; margin: 6px 0 14px; }
.tah-lms-quiz-form fieldset {
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px; padding: 12px 14px;
    margin: 10px 0;
}
.tah-lms-quiz-form legend { padding: 0 8px; font-weight: 700; }
.tah-lms-quiz-a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; margin: 4px 0;
    background: rgba(255,255,255,.04);
    border-radius: 8px; cursor: pointer;
}
.tah-lms-quiz-a:hover { background: rgba(255,255,255,.08); }
.tah-lms-quiz-result { margin-top: 14px; padding: 12px; border-radius: 10px; }
.tah-lms-quiz-pass { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.4); padding: 10px; border-radius: 8px; }
.tah-lms-quiz-fail { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.4); padding: 10px; border-radius: 8px; }

/* ── Quiz modo tarjetas: una pregunta a la vez ───────────────────────────
   Reemplaza el scroll largo por un flow tipo Typeform: marcas respuesta,
   la card hace fade-out y entra la siguiente. Al contestar la última,
   se dispara el submit del form (la lógica de envío no cambia). */
.tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-cards {
    position: relative;
}
.tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-card {
    display: none;
    animation: tahQuizCardIn .35s cubic-bezier(.2,.7,.2,1);
}
.tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-card.is-active {
    display: block;
}
.tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-card.is-leaving {
    animation: tahQuizCardOut .2s ease-in forwards;
}
@keyframes tahQuizCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tahQuizCardOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-20px); }
}
.tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-card legend {
    font-size: 1.05rem; line-height: 1.4; margin-bottom: 12px;
}
.tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-a {
    padding: 14px 14px;
    min-height: 52px;
    font-size: 1rem;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-a:active {
    transform: scale(.98);
}
.tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-a:has(input:checked) {
    background: rgba(254,44,85,.14);
    border-color: rgba(254,44,85,.55);
}
.tah-lms-quiz-card-hint {
    color: #a8a29e; font-size: .8rem; margin: 10px 0 0;
}
.tah-lms-quiz-progress {
    display: flex; align-items: center; gap: 10px;
    margin: 4px 0 14px;
}
.tah-lms-quiz-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,.08);
    border-radius: 3px;
    overflow: hidden;
}
.tah-lms-quiz-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--tah-primary, #FE2C55);
    border-radius: 3px;
    transition: width .3s ease;
}
.tah-lms-quiz-progress-text {
    color: #a8a29e; font-size: .8rem;
    font-variant-numeric: tabular-nums;
    min-width: 44px; text-align: right;
}
.tah-lms-quiz-nav {
    display: flex; gap: 10px; align-items: center;
    margin-top: 16px;
}
.tah-lms-quiz-nav .tah-lms-quiz-prev { flex: 0 0 auto; }
.tah-lms-quiz-nav .tah-lms-quiz-next,
.tah-lms-quiz-nav .tah-lms-quiz-submit { flex: 1; min-height: 48px; }
.tah-lms-quiz-nav button[disabled] {
    opacity: .4; cursor: not-allowed; pointer-events: none;
}

/* Botones genéricos del LMS (refuerzan los del plugin sin reinventar) */
.tah-lms .tah-btn-primary,
.tah-lms-course-detail .tah-btn-primary,
.tah-verify-page .tah-btn-primary {
    background: var(--tah-primary, #FE2C55); color: #fff;
    border: none; padding: 9px 18px; border-radius: 999px;
    font-weight: 700; cursor: pointer; font-size: .9rem;
}
.tah-lms .tah-btn-primary:hover { filter: brightness(1.1); }
.tah-lms .tah-btn-ghost,
.tah-lms-course-detail .tah-btn-ghost,
.tah-verify-page .tah-btn-ghost {
    background: transparent; color: #fafaf9;
    border: 1px solid rgba(255,255,255,.2);
    padding: 8px 14px; border-radius: 999px;
    cursor: pointer; font-size: .85rem;
}

/* ── Vista del diploma del creador ─────────────────────────────────────── */
.tah-lms-cert-view {
    margin-top: 24px;
}
.tah-lms-cert-toolbar {
    display: flex; gap: 10px; align-items: center;
    justify-content: space-between; margin-bottom: 14px;
}
.tah-lms-cert-note { color: #a8a29e; font-size: .85rem; }
.tah-lms-cert-stage {
    background: #e5e5e5; padding: 24px; border-radius: 14px;
    display: flex; justify-content: center;
}
.tah-lms-cert-verify { color: #a8a29e; font-size: .8rem; text-align: center; margin-top: 10px; }
.tah-lms-cert-verify a { color: #25F4EE; }

/* ════════════════════════════════════════════════════════════════════════ */
/*  Diploma (.tah-cert) — usado por el creador y el preview admin          */
/* ════════════════════════════════════════════════════════════════════════ */

/* =====================================================================
   DIPLOMA SD LIVE AGENCY — diseño visual v5.31.3
   Wrapper externo .tah-cert (compat con el JS de paintQR y downloadPDF).
   Estructura interna sigue el spec entregado (.diploma + .dip-*).
   Formato: A4 horizontal (1.414:1).
   ===================================================================== */

.tah-cert {
    --cert-bg-ink:    #000202;
    --cert-red:       #FE2C55;
    --cert-cy:        #25F4EE;
    --cert-gold:      #ffb800;
    --cert-gold-soft: #ffd23f;
    --cert-lola:      #ff2d95;
    --cert-ink:       #fafaf9;
    --cert-mut:       #a8a29e;
    --cert-fd:        'Bebas Neue', sans-serif;
    --cert-fc:        'Cinzel', serif;
    --cert-fu:        'Montserrat', sans-serif;
    --cert-fm:        'Space Mono', monospace;
    --cert-fsign:     'Great Vibes', cursive;

    width: 100%; max-width: 1100px;
    aspect-ratio: 1.414/1;
    position: relative;
    font-family: var(--cert-fu);
    color: var(--cert-ink);
    box-sizing: border-box;
}

.tah-cert .diploma {
    position: absolute; inset: 0;
    /* Background base ligeramente aclarado respecto a la versión inicial
       (#050608 → #0e1118) para que la marca de agua sea visible sin perder
       el look dark del diseño. */
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(254,44,85,.10), transparent 60%),
        radial-gradient(ellipse 70% 60% at 50% 100%, rgba(37,244,238,.08), transparent 60%),
        linear-gradient(160deg, #0e1118 0%, #181b24 50%, #0e1118 100%);
    border-radius: 6px;
    overflow: hidden;
    display: flex; flex-direction: column; align-items: center;
    padding: 4% 6% 3.5%;
    box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04);
}
/* textura grid sutil */
.tah-cert .diploma::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(37,244,238,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37,244,238,.025) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 20%, transparent 80%);
            mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 20%, transparent 80%);
}
/* Marca de agua: imagen centrada de fondo (logo / sello) en baja opacidad.
   Se posiciona por encima del background pero detrás del contenido (.dip-inner).
   Sólo se renderiza si --cert-watermark está definido en el inline style. */
.tah-cert .diploma::after {
    content: '';
    position: absolute; inset: 0;
    background-image: var(--cert-watermark, none);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 55% auto;
    opacity: .07;
    pointer-events: none;
    z-index: 1;
    /* Mezclamos con el fondo para que la marca tome el color dominante (cyan)
       sin verse plana ni gris muerto. */
    filter: grayscale(.4) contrast(.9);
    mix-blend-mode: screen;
}

/* marco doble + esquinas glitch */
.tah-cert .diploma-frame {
    position: absolute; inset: 18px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 4px;
    pointer-events: none;
}
.tah-cert .diploma-frame::before {
    content: ''; position: absolute; inset: 6px;
    border: 1px solid rgba(255,255,255,.06);
}
.tah-cert .corner {
    position: absolute; width: 46px; height: 46px;
    pointer-events: none; z-index: 3;
}
.tah-cert .corner::before, .tah-cert .corner::after {
    content: ''; position: absolute;
    background: linear-gradient(90deg, var(--cert-red), var(--cert-cy));
}
.tah-cert .corner::before { width: 100%; height: 2px; }
.tah-cert .corner::after  { height: 100%; width: 2px; }
.tah-cert .corner.tl { top: 14px; left: 14px; }
.tah-cert .corner.tl::before { top: 0; left: 0; }
.tah-cert .corner.tl::after  { top: 0; left: 0; }
.tah-cert .corner.tr { top: 14px; right: 14px; }
.tah-cert .corner.tr::before { top: 0; right: 0; }
.tah-cert .corner.tr::after  { top: 0; right: 0; }
.tah-cert .corner.bl { bottom: 14px; left: 14px; }
.tah-cert .corner.bl::before { bottom: 0; left: 0; }
.tah-cert .corner.bl::after  { bottom: 0; left: 0; }
.tah-cert .corner.br { bottom: 14px; right: 14px; }
.tah-cert .corner.br::before { bottom: 0; right: 0; }
.tah-cert .corner.br::after  { bottom: 0; right: 0; }

/* contenido */
.tah-cert .dip-inner {
    position: relative; z-index: 2;
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
}

.tah-cert .dip-logo-plate {
    display: inline-flex; align-items: center; justify-content: center;
    background: #000; border-radius: 10px;
    padding: 10px 22px; margin-bottom: 1.4%;
    box-shadow: 0 0 30px rgba(37,244,238,.12), 0 0 0 1px rgba(255,255,255,.06);
}
.tah-cert .dip-logo {
    height: clamp(56px, 8vw, 96px); width: auto;
    object-fit: contain; display: block;
}

.tah-cert .dip-kicker {
    font-family: var(--cert-fm);
    font-size: clamp(9px, 1.1vw, 13px);
    letter-spacing: .42em; text-transform: uppercase;
    color: var(--cert-cy);
    margin-bottom: 1.6%; padding-left: .42em;
    display: flex; align-items: center; gap: 14px;
}
.tah-cert .dip-kicker::before, .tah-cert .dip-kicker::after {
    content: ''; width: 34px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--cert-cy));
}
.tah-cert .dip-kicker::after { background: linear-gradient(90deg, var(--cert-cy), transparent); }

.tah-cert .dip-title {
    font-family: var(--cert-fc); font-weight: 800;
    font-size: clamp(26px, 4.4vw, 52px);
    line-height: 1; letter-spacing: .02em;
    color: #fff;
    margin-bottom: .4%;
}
.tah-cert .dip-title .grad {
    color: var(--cert-cy);
    text-shadow: 0 0 18px rgba(37,244,238,.45);
}
.tah-cert .dip-sub {
    font-family: var(--cert-fu);
    font-size: clamp(10px, 1.25vw, 15px); font-weight: 500;
    color: var(--cert-mut); letter-spacing: .04em;
    margin-bottom: 2.4%;
}

.tah-cert .dip-otorga {
    font-family: var(--cert-fu);
    font-size: clamp(9px, 1.1vw, 13px); font-weight: 600;
    letter-spacing: .28em; text-transform: uppercase;
    color: var(--cert-gold);
    margin-bottom: 1.2%;
}

.tah-cert .dip-name {
    font-family: var(--cert-fd);
    font-size: clamp(34px, 6.4vw, 78px);
    line-height: .96; letter-spacing: .02em;
    color: #fff;
    text-shadow:
        -2px 0 0 rgba(254,44,85,.55),
        2px 0 0 rgba(37,244,238,.55),
        0 0 36px rgba(255,255,255,.18);
    padding: 0 .3em 2px;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, transparent, var(--cert-red), var(--cert-cy), transparent) 1;
    min-width: 40%; max-width: 92%;
    overflow-wrap: break-word; word-break: break-word;
}

.tah-cert .dip-body {
    font-family: var(--cert-fu);
    font-size: clamp(11px, 1.5vw, 18px); line-height: 1.6;
    color: #e7e5e4;
    max-width: 76%; margin: 2.4% 0 0;
    font-weight: 400;
}
.tah-cert .dip-body .curso { display: inline; font-weight: 800; color: var(--cert-cy); }
.tah-cert .dip-body b { color: #fff; font-weight: 700; }

/* pie: firma | sello | fecha | QR */
.tah-cert .dip-foot {
    margin-top: auto; width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 3.5%;
    align-items: end;
    padding-top: 2%; padding-bottom: 1.5%;
}
.tah-cert .dip-sign {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tah-cert .dip-sign-img {
    height: clamp(46px, 6.5vw, 78px); width: auto;
    object-fit: contain; margin-bottom: -4px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,.3));
}
.tah-cert .dip-sign-line {
    width: 78%; max-width: 230px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
}
.tah-cert .dip-sign-role {
    font-family: var(--cert-fm);
    font-size: clamp(7px, .85vw, 10px); color: var(--cert-mut);
    letter-spacing: .12em; text-transform: uppercase;
    margin-top: 6px;
}

/* sello / medalla central */
.tah-cert .dip-seal {
    position: relative;
    width: clamp(74px, 10vw, 118px);
    height: clamp(74px, 10vw, 118px);
    display: flex; align-items: center; justify-content: center;
}
.tah-cert .dip-seal-ring {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg, var(--cert-lola), #ff6bc1, var(--cert-lola), #c41e6f, var(--cert-lola));
    padding: 2px;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    animation: tah-cert-spin 14s linear infinite;
}
.tah-cert .dip-seal-inner {
    position: absolute; inset: 7px; border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #15171c, #070809);
    border: 1px solid rgba(255,255,255,.12);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px;
}
.tah-cert .dip-seal-star {
    font-size: clamp(20px, 2.8vw, 34px); line-height: 1;
    color: var(--cert-gold);
    filter: drop-shadow(0 0 10px rgba(255,184,0,.85));
}
.tah-cert .dip-seal-txt {
    font-family: var(--cert-fd);
    font-size: clamp(10px, 1.3vw, 16px);
    letter-spacing: .12em; color: var(--cert-gold-soft);
    line-height: .9;
}
.tah-cert .dip-seal-sub {
    font-family: var(--cert-fm);
    font-size: 6.5px; letter-spacing: .18em;
    color: var(--cert-mut); text-transform: uppercase;
}
@keyframes tah-cert-spin { to { transform: rotate(360deg); } }

.tah-cert .dip-date {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tah-cert .dip-date-val {
    font-family: var(--cert-fu);
    font-size: clamp(10px, 1.15vw, 14px);
    font-weight: 700; color: #fff;
}
.tah-cert .dip-date-line {
    width: 78%; max-width: 230px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
    margin-top: 4px;
}
.tah-cert .dip-date-role {
    font-family: var(--cert-fm);
    font-size: clamp(7px, .85vw, 10px); color: var(--cert-mut);
    letter-spacing: .12em; text-transform: uppercase;
    margin-top: 6px;
}

/* QR de verificación */
.tah-cert .dip-qr {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.tah-cert .dip-qr-box {
    position: relative;
    width: clamp(58px, 8vw, 92px);
    height: clamp(58px, 8vw, 92px);
    background: #fff; border-radius: 8px; padding: 5px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 6px 18px -6px rgba(0,0,0,.6);
}
.tah-cert .tah-cert-qr {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.tah-cert .tah-cert-qr canvas,
.tah-cert .tah-cert-qr img {
    width: 100% !important; height: 100% !important;
    display: block; border-radius: 3px;
}
.tah-cert .dip-qr-label {
    font-family: var(--cert-fm);
    font-size: clamp(7px, .8vw, 9px); color: var(--cert-mut);
    letter-spacing: .1em; text-transform: uppercase;
}

/* LOLA mini en esquina */
.tah-cert .dip-lola {
    position: absolute; top: 6%; right: 6%; z-index: 4;
    display: flex; align-items: center; gap: 9px;
    background: linear-gradient(135deg, rgba(255,45,149,.12), rgba(37,244,238,.05));
    border: 1px solid rgba(255,45,149,.3);
    border-radius: 50px;
    padding: 5px 14px 5px 5px;
}
.tah-cert .dip-lola-av {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background-size: 140%; background-position: 50% 25%;
    border: 1.5px solid var(--cert-lola);
    box-shadow: 0 0 10px rgba(255,45,149,.5);
}
.tah-cert .dip-lola-tx {
    font-family: var(--cert-fm);
    font-size: 8px; letter-spacing: .1em; line-height: 1.3;
    text-align: left; color: #f0f0f0;
}
.tah-cert .dip-lola-tx b {
    color: var(--cert-lola); display: block;
    font-family: var(--cert-fd);
    font-size: 11px; letter-spacing: .12em;
}

/* folio / id */
.tah-cert .dip-folio {
    position: absolute; top: 6%; left: 6%; z-index: 4;
    font-family: var(--cert-fm);
    font-size: 9px; letter-spacing: .1em;
    color: var(--cert-mut);
    text-align: left; line-height: 1.5;
}
.tah-cert .dip-folio b { color: var(--cert-cy); }

/* Fallback minimalista cuando no hay plantilla */
.tah-cert-fallback {
    background: #fff; color: #1c1917;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1rem;
    text-align: center; padding: 40px;
}

/* Print del diploma (cuando se imprime directo desde el browser) */
@media print {
    @page { size: A4 landscape; margin: 0; }
    .tah-cert {
        max-width: none; width: 100vw; height: 100vh; aspect-ratio: auto;
    }
    .tah-cert .diploma { border-radius: 0; box-shadow: none; }
    .tah-cert .dip-seal-ring { animation: none; }
}

/* ── Modal "Academia" (se abre desde el bottom-nav del dashboard) ──────── */
/* z-index 8500 va POR DEBAJO del bottom-nav (z-index:9000) para que la
   barra inferior siga visible y el creador pueda navegar a otras pestañas. */
.tah-academia-modal {
    position: fixed; inset: 0; z-index: 8500;
    display: flex; align-items: stretch; justify-content: center;
}
.tah-academia-modal[hidden] { display: none !important; }
.tah-academia-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,2,2,.94);
    backdrop-filter: blur(6px);
}
.tah-academia-modal-box {
    position: relative; z-index: 1;
    background: #000202;
    width: 100%; max-width: 1100px;
    max-height: 100vh; overflow-y: auto;
    padding: calc(56px + env(safe-area-inset-top)) 20px calc(100px + env(safe-area-inset-bottom));
    animation: tahAcademiaIn .28s ease-out;
}
@keyframes tahAcademiaIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tah-academia-modal-close {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top));
    right: calc(16px + env(safe-area-inset-right));
    z-index: 10;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer;
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.tah-academia-modal-close:hover { background: rgba(255,255,255,.2); }
/* Dentro del modal Academia, eliminamos el margin-top de la sección LMS
   para que no quede espacio en blanco arriba del título */
.tah-academia-modal .tah-lms { margin-top: 0; }

/* ── Modal flotante del quiz (se abre auto al terminar el video) ───────── */
.tah-lms-quiz-modal {
    position: fixed; inset: 0; z-index: 999998;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.tah-lms-quiz-modal[hidden] { display: none !important; }
.tah-lms-quiz-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,2,2,.86);
    backdrop-filter: blur(4px);
}
.tah-lms-quiz-modal-box {
    position: relative; z-index: 1;
    background: #0d1414;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    padding: 20px 24px 24px;
    max-width: 900px; width: 100%;
    max-height: 92vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    animation: tahQuizModalIn .25s ease-out;
}
body.tah-lms-modal-locked { overflow: hidden; }
.tah-lms-lesson-header { margin-bottom: 14px; }
.tah-lms-lesson-header h3 { margin: 0 0 4px; font-size: 1.3rem; color: #fafaf9; }
.tah-lms-lesson-hint { margin: 0; color: #a8a29e; font-size: .85rem; }
.tah-lms-autoembed,
.tah-lms-lesson-content iframe {
    width: 100%; aspect-ratio: 16/9; max-height: 60vh;
    border: none; border-radius: 10px;
    background: #000;
    margin: 10px 0;
}

/* ── Reproductor custom (oculta el branding de YouTube/Vimeo) ──────────── */
.tah-video-player {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin: 14px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.tah-video-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 60vh;
    background: #000;
    overflow: hidden;
}
.tah-video-frame-slot,
.tah-video-frame-slot iframe,
.tah-video-native {
    position: absolute; inset: 0;
    width: 100% !important; height: 100% !important;
    border: 0; display: block;
    background: #000;
}
.tah-video-native { object-fit: contain; }
/* El iframe / video nativo NO recibe interacción directa: todo pasa por el
   clickshield. Esto evita la UI nativa de YouTube y los controles default
   del navegador en HTML5 <video> (no le ponemos controls). */
.tah-video-frame-slot iframe,
.tah-video-native { pointer-events: none; }
/* Sólo ocultamos la badge "SD LIVE" para videos locales (ya son white-label) */
.tah-video-player-local .tah-video-brand { display: none; }
.tah-video-clickshield {
    position: absolute; inset: 0;
    z-index: 5;
    cursor: pointer;
    background: transparent;
}
.tah-video-bigplay {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
}
.tah-video-bigplay.show { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }

.tah-video-loading {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 7;
}
.tah-video-loading span {
    display: block; width: 44px; height: 44px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: var(--tah-primary, #FE2C55);
    border-radius: 50%;
    animation: tahVideoSpin .9s linear infinite;
}
@keyframes tahVideoSpin { to { transform: rotate(360deg); } }

/* Marca de agua de la agencia (esquina, para tapar el branding de YouTube) */
.tah-video-brand {
    position: absolute; top: 10px; right: 14px; z-index: 6;
    font-size: .72rem; font-weight: 700;
    color: rgba(255,255,255,.75);
    letter-spacing: .08em; text-transform: uppercase;
    background: rgba(0,0,0,.45);
    padding: 4px 9px; border-radius: 999px;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.tah-video-controls {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(180deg, #0d1414, #050a0a);
    border-top: 1px solid rgba(255,255,255,.06);
}
.tah-vctrl {
    background: transparent; border: none;
    color: #fafaf9; cursor: pointer;
    padding: 6px 10px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.tah-vctrl:hover  { background: rgba(255,255,255,.08); }
.tah-vctrl:active { transform: scale(.95); }
.tah-vctrl-mute.is-muted { opacity: .55; }
.tah-vctrl-progress {
    flex: 1;
    position: relative;
    height: 8px;
    cursor: pointer;
    display: flex; align-items: center;
}
.tah-vctrl-progress-bg {
    position: absolute; inset: 3px 0;
    background: rgba(255,255,255,.12);
    border-radius: 3px;
}
.tah-vctrl-progress-fill {
    position: absolute; left: 0; top: 3px; bottom: 3px;
    background: var(--tah-primary, #FE2C55);
    border-radius: 3px;
    width: 0%;
    transition: width .15s linear;
}
.tah-vctrl-progress:hover .tah-vctrl-progress-bg { background: rgba(255,255,255,.18); }
.tah-vctrl-time {
    color: #d6d3d1;
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
    min-width: 92px;
    text-align: right;
}

/* Fullscreen: cuando el stage está en pantalla completa, llenar todo */
.tah-video-stage:fullscreen,
.tah-video-stage:-webkit-full-screen {
    width: 100vw; height: 100vh; max-height: 100vh;
    aspect-ratio: auto;
}

/* ── Mobile: el modal de contenido y el video ocupan toda la pantalla ──── */
@media (max-width: 720px) {
    .tah-lms-quiz-modal { padding: 0; }
    .tah-lms-quiz-modal-box {
        max-width: 100vw;
        width: 100vw;
        max-height: 100vh;
        min-height: 100vh;
        max-height: 100dvh;
        min-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
        padding: 0;
        border: none;
        background: #000;
        display: flex; flex-direction: column;
        overflow: hidden;
    }
    .tah-lms-quiz-modal-close {
        position: fixed;
        top: max(10px, env(safe-area-inset-top));
        right: 10px;
        z-index: 100;
        background: rgba(0,0,0,.6);
        border: 1px solid rgba(255,255,255,.25);
        border-radius: 50%;
        width: 42px; height: 42px;
        font-size: 1.6rem;
        color: #fff;
    }
    #tah-lms-content-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        display: flex; flex-direction: column;
        background: #000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 0;
    }
    /* Vista de lección con video: ocupa toda la pantalla */
    .tah-lms-lesson-view {
        flex: 1;
        display: flex; flex-direction: column;
        background: #000;
        padding: 0;
        margin: 0;
        border-radius: 0;
        border: none;
    }
    .tah-lms-lesson-header {
        padding: max(12px, env(safe-area-inset-top)) 56px 8px 14px;
        background: #000;
        margin-bottom: 0;
    }
    .tah-lms-lesson-header h3 { font-size: 1.05rem; }
    .tah-lms-lesson-hint { font-size: .78rem; }
    .tah-lms-lesson-content {
        flex: 1;
        display: flex; flex-direction: column;
        padding: 0;
        min-height: 0;
    }
    .tah-video-player {
        flex: 1;
        margin: 0;
        border-radius: 0;
        display: flex; flex-direction: column;
        box-shadow: none;
    }
    .tah-video-stage {
        flex: 1;
        aspect-ratio: auto;
        max-height: none;
        min-height: 60vh;
    }
    .tah-video-controls {
        padding: 10px 14px max(10px, env(safe-area-inset-bottom));
    }
    .tah-lms-lesson-actions {
        padding: 12px 14px max(14px, env(safe-area-inset-bottom));
        background: rgba(0,0,0,.6);
        border-top: 1px solid rgba(255,255,255,.12);
        margin-top: 0;
    }
    /* ── Quiz en modo tarjetas: ocupa toda la pantalla y la nav inferior
       (Atrás / Siguiente) queda fija. Ya no necesitamos scroll porque
       solo se muestra UNA pregunta a la vez. ─────────────────────────── */
    .tah-lms-quiz {
        flex: 1;
        display: flex; flex-direction: column;
        background: #0d1414;
        padding: calc(max(14px, env(safe-area-inset-top)) + 4px) 16px 0;
        overflow: visible;
        min-height: 0;
    }
    /* El botón "← Cerrar quiz" interno se oculta en móvil porque el
       modal ya tiene su propio botón X en la esquina superior. */
    .tah-lms-quiz > .tah-lms-lesson-close {
        display: none;
    }
    /* En la vista de quiz, el contenido descriptivo NO debe estirarse
       (la regla `.tah-lms-lesson-content { flex: 1 }` de arriba es para
       la vista de video; aquí la sobreescribimos). */
    .tah-lms-quiz > .tah-lms-lesson-content {
        flex: 0 0 auto;
        display: block;
        padding: 0;
        margin: 0 0 10px;
        font-size: .88rem;
        line-height: 1.4;
        color: #a8a29e;
    }
    .tah-lms-quiz .tah-lms-lesson-h {
        font-size: 1.1rem;
        line-height: 1.3;
        margin: 0 0 8px;
    }
    .tah-lms-quiz .tah-lms-quiz-rules {
        font-size: .76rem;
        line-height: 1.35;
        margin: 0 0 14px;
    }
    .tah-lms-quiz-form[data-mode="cards"] {
        flex: 1;
        display: flex; flex-direction: column;
        min-height: 0;
    }
    .tah-lms-quiz-cards {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -4px;     /* deja respirar el borde de la card */
        padding: 0 4px;
    }
    .tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-card {
        margin: 0;
        border: none;
        padding: 0;
        background: transparent;
    }
    .tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-card legend {
        font-size: 1.05rem;
        line-height: 1.35;
        padding: 0;
        margin-bottom: 14px;
        font-weight: 700;
    }
    .tah-lms-quiz-form[data-mode="cards"] .tah-lms-quiz-a {
        padding: 14px 14px;
        margin: 8px 0;
        font-size: .98rem;
    }
    .tah-lms-quiz-nav {
        padding: 12px 0 max(14px, env(safe-area-inset-bottom));
        margin-top: 4px;
        border-top: 1px solid rgba(255,255,255,.06);
    }

    /* Mientras el modal de contenido está abierto, ocultamos el bottom-nav
       de la app y el FAB de chat (LOLA): hacen ruido visual sobre el quiz
       y, en iOS, el FAB se monta en un stacking context distinto y termina
       tapando la card aunque tenga z-index menor. Usamos clase en body
       (fallback de :has() para iOS Safari viejito). */
    body.tah-content-modal-open .tah-bottom-nav,
    body.tah-content-modal-open #tah-ai-chat-toggle {
        display: none !important;
    }
}
.tah-lms-lesson-content { color: #d6d3d1; line-height: 1.55; }
.tah-lms-lesson-actions {
    display: flex; justify-content: space-between; gap: 10px;
    margin-top: 18px; padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    align-items: center; flex-wrap: wrap;
}
.tah-lms-review-hint {
    color: #22c55e; font-size: .82rem;
    background: rgba(34,197,94,.12);
    padding: 4px 10px; border-radius: 999px;
    border: 1px solid rgba(34,197,94,.35);
}
@keyframes tahQuizModalIn {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tah-lms-quiz-modal-close {
    position: absolute; top: 10px; right: 14px;
    background: transparent; border: none;
    color: rgba(255,255,255,.6);
    font-size: 1.8rem; line-height: 1; cursor: pointer;
    padding: 4px 10px; border-radius: 50%;
}
.tah-lms-quiz-modal-close:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── Toast de LIVCOINs ganados (esquina inferior derecha) ──────────────── */
.tah-lms-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 999999;
    background: linear-gradient(135deg, #f59e0b, #eab308);
    color: #1c1917; font-weight: 700;
    padding: 14px 22px; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(245,158,11,.45);
    transform: translateY(20px); opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
    pointer-events: none;
}
.tah-lms-toast[hidden] { display: none !important; }
.tah-lms-toast.tah-lms-toast-show {
    transform: translateY(0); opacity: 1;
}
.tah-lms-toast strong { color: #1c1917; }

/* ── Página pública de verificación ────────────────────────────────────── */
.tah-verify-page {
    max-width: 600px; margin: 60px auto; padding: 20px;
    color: #fafaf9;
    box-sizing: border-box;
}
.tah-verify-header { text-align: center; margin-bottom: 24px; }
.tah-verify-header h1 { font-size: 1.75rem; margin: 0 0 8px; line-height: 1.2; }
.tah-verify-header p  { margin: 0; opacity: .75; font-size: .95rem; }
.tah-verify-logo {
    max-width: 100px;
    max-height: 80px;
    width: auto; height: auto;
    margin: 0 auto 12px;
    display: block;
    object-fit: contain;
}
.tah-verify-card {
    padding: 28px; border-radius: 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    text-align: center;
    box-sizing: border-box;
}
.tah-verify-card h2 { font-size: 1.4rem; margin: 0 0 14px; }
.tah-verify-icon { font-size: 3rem; margin-bottom: 10px; }
.tah-verify-valid  { border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.06); }
.tah-verify-invalid{ border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.06); }
.tah-verify-revoked{ border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.06); }
.tah-verify-data {
    display: grid; grid-template-columns: 1fr 2fr; gap: 8px 18px;
    text-align: left; margin-top: 20px;
}
.tah-verify-data dt { color: #a8a29e; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.tah-verify-data dd { margin: 0; font-weight: 600; word-break: break-word; overflow-wrap: anywhere; }
.tah-verify-data dd code {
    font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .82rem;
    background: rgba(255,255,255,.06);
    padding: 4px 8px;
    border-radius: 6px;
    word-break: break-all;
    overflow-wrap: anywhere;
    display: inline-block;
    max-width: 100%;
}
.tah-verify-form { display: flex; gap: 8px; margin-top: 14px; }
.tah-verify-form input { flex: 1; padding: 10px 14px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); color: #fafaf9; min-width: 0; }

/* ── Verificador en móvil ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .tah-verify-page {
        margin: 24px auto;
        padding: 16px 14px;
        max-width: 100%;
    }
    .tah-verify-header { margin-bottom: 16px; }
    .tah-verify-header h1 { font-size: 1.3rem; }
    .tah-verify-header p  { font-size: .85rem; }
    .tah-verify-logo {
        max-width: 70px;
        max-height: 56px;
        margin-bottom: 8px;
    }
    .tah-verify-card {
        padding: 20px 16px;
        border-radius: 12px;
    }
    .tah-verify-card h2 { font-size: 1.15rem; }
    .tah-verify-icon { font-size: 2.4rem; }
    /* En móvil: label arriba, valor abajo (single column) para que el código
       de verificación y demás textos largos no se desborden */
    .tah-verify-data {
        grid-template-columns: 1fr;
        gap: 2px 0;
        margin-top: 16px;
    }
    .tah-verify-data dt {
        font-size: .72rem;
        margin-top: 10px;
    }
    .tah-verify-data dt:first-child { margin-top: 0; }
    .tah-verify-data dd {
        font-size: .95rem;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255,255,255,.06);
    }
    .tah-verify-data dd:last-child { border-bottom: none; }
    .tah-verify-data dd code {
        font-size: .75rem;
        padding: 3px 6px;
    }
    .tah-verify-form {
        flex-direction: column;
    }
}

/* Variante del modal-card cuando hosteamos la pantalla nueva del streamer.
   Lo dejamos transparente y sin padding para que el .tah-sl-screen ocupe
   todo el área, manteniendo el botón cerrar por encima. */
.tah-live-modal-card--streamer {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    max-width: 480px;
}
.tah-live-modal-card--streamer .tah-live-modal-close {
    top: 12px; right: 12px;
    z-index: 60;
    background: rgba(0,0,0,.7);
    border: 1px solid rgba(255,255,255,.2);
}
.tah-live-modal-card--streamer .tah-sl-screen {
    max-height: 92vh;
    overflow-y: auto;
}

/* =====================================================================
   SD LIVE · INTERFAZ DEL STREAMER EN TIEMPO REAL  (sección "screen")
   Implementación del spec entregado: 2 luces (Momentum/Safety) + 1
   tarjeta de instrucción + critical takeover. Prefijo .tah-sl- para
   no chocar con otros estilos. Vive dentro del modal del live.
   ===================================================================== */

.tah-sl-screen {
    --tah-sl-bg:#0E0D14;
    --tah-sl-panel:#16151F;
    --tah-sl-panel-2:#1E1C2A;
    --tah-sl-line:#2A2838;
    --tah-sl-lilac:#6B5CE7;
    --tah-sl-lilac-soft:#8E82F0;
    --tah-sl-white:#F4F2FF;
    --tah-sl-muted:#8B8898;
    --tah-sl-green:#2FD179;
    --tah-sl-amber:#F5B23E;
    --tah-sl-red:#F5544E;
    --tah-sl-cyan:#3FC8E0;

    position: relative;
    background: var(--tah-sl-bg);
    color: var(--tah-sl-white);
    border: 1px solid #211F2E;
    border-radius: 24px;
    overflow: hidden;
    min-height: 600px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hanken Grotesk", Roboto, sans-serif;
}

/* Topbar */
.tah-sl-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--tah-sl-line);
}
.tah-sl-brand { display: flex; align-items: center; gap: 8px; }
.tah-sl-brand-dot {
    width: 22px; height: 22px; border-radius: 7px;
    background: linear-gradient(135deg, var(--tah-sl-lilac), #4A3DC0);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px; color: #fff;
}
.tah-sl-brand b {
    font-weight: 700; font-size: 13px; letter-spacing: -.01em;
}
.tah-sl-live-pill {
    display: flex; align-items: center; gap: 6px;
    background: rgba(245,84,78,.12);
    border: 1px solid rgba(245,84,78,.4);
    color: #FF8C88;
    border-radius: 999px; padding: 4px 10px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
}
.tah-sl-live-pill .tah-sl-blink {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--tah-sl-red);
    animation: tah-sl-blink 1.4s infinite;
}
.tah-sl-timer {
    font-size: 11px; font-weight: 600;
    color: var(--tah-sl-muted);
    font-variant-numeric: tabular-nums;
}

/* Rótulos de sección */
.tah-sl-seclabel {
    display: flex; align-items: center; gap: 8px;
    padding: 0 18px; margin: 16px 0 9px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .2em; text-transform: uppercase;
    color: var(--tah-sl-muted);
}
.tah-sl-seclabel::after {
    content: ""; flex: 1; height: 1px; background: var(--tah-sl-line);
}

/* Zona de estado: 2 luces */
.tah-sl-status { display: flex; gap: 11px; padding: 0 16px; }
.tah-sl-orb-card {
    flex: 1; display: flex; align-items: center; gap: 11px;
    background: var(--tah-sl-panel);
    border: 1px solid var(--tah-sl-line);
    border-radius: 16px; padding: 14px 12px;
}
.tah-sl-orb {
    position: relative;
    width: 38px; height: 38px; border-radius: 50%;
    flex-shrink: 0;
    transition: background .4s, box-shadow .4s;
}
.tah-sl-orb::after {
    content: ""; position: absolute; inset: 8px;
    border-radius: 50%; background: rgba(255,255,255,.16);
}
.tah-sl-orb.is-green { background: var(--tah-sl-green); box-shadow: 0 0 16px rgba(47,209,121,.55); }
.tah-sl-orb.is-amber { background: var(--tah-sl-amber); box-shadow: 0 0 16px rgba(245,178,62,.55); }
.tah-sl-orb.is-red   { background: var(--tah-sl-red);   box-shadow: 0 0 18px rgba(245,84,78,.7);
                       animation: tah-sl-pulseRed 1s infinite; }
.tah-sl-orb-meta .tah-sl-ttl {
    margin-bottom: 3px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--tah-sl-muted);
}
.tah-sl-orb-meta .tah-sl-val {
    font-weight: 700; font-size: 15px; letter-spacing: -.01em;
    transition: color .3s;
}
.tah-sl-val.is-green { color: var(--tah-sl-green); }
.tah-sl-val.is-amber { color: var(--tah-sl-amber); }
.tah-sl-val.is-red   { color: var(--tah-sl-red); }

/* Zona de instrucción: tarjeta */
.tah-sl-instr-wrap { padding: 0 16px 18px; }
.tah-sl-instr {
    position: relative;
    background: var(--tah-sl-panel-2);
    border: 1px solid var(--tah-sl-line);
    border-radius: 20px;
    padding: 20px 18px 20px 20px;
    overflow: hidden;
    transition: border-color .35s;
}
.tah-sl-instr::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--tah-sl-cat-color, var(--tah-sl-lilac));
    transition: background .35s;
}
.tah-sl-instr.is-flash { animation: tah-sl-flash .55s ease; }
.tah-sl-cat-tag {
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 14px; padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .13em; text-transform: uppercase;
    color: var(--tah-sl-cat-color, var(--tah-sl-lilac-soft));
    background: color-mix(in srgb, var(--tah-sl-cat-color, var(--tah-sl-lilac)) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--tah-sl-cat-color, var(--tah-sl-lilac)) 35%, transparent);
}
.tah-sl-cat-tag .tah-sl-tdot {
    width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.tah-sl-instr-body { display: flex; align-items: center; gap: 15px; }
.tah-sl-icon-box {
    width: 56px; height: 56px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 15px; font-size: 27px;
    background: color-mix(in srgb, var(--tah-sl-cat-color, var(--tah-sl-lilac)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--tah-sl-cat-color, var(--tah-sl-lilac)) 30%, transparent);
    overflow: hidden;
}
/* Avatar de LOLA en la tarjeta de instrucción (reemplaza al emoji cuando
   hay imagen configurada en Branding → avatar del chat IA). */
.tah-sl-icon-box .tah-sl-icon-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}
/* Feed de eventos en tiempo real (websocket de TikTok + moderación AV). */
.tah-sl-feed {
    max-height: 170px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
}
.tah-sl-feed--mod { max-height: 120px; }
.tah-sl-feed-empty {
    font-size: 12px; color: #8B8898; padding: 6px 0;
}
.tah-sl-feed-item {
    display: flex; align-items: baseline; gap: 7px;
    font-size: 12.5px; line-height: 1.35;
    color: #D8D5E2;
    animation: tahSlFeedIn .25s ease;
}
@keyframes tahSlFeedIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}
.tah-sl-feed-time {
    flex-shrink: 0; font-size: 10px; color: #6E6B7B;
    font-variant-numeric: tabular-nums;
}
.tah-sl-feed-ico { flex-shrink: 0; }
.tah-sl-feed-txt { word-break: break-word; }
.tah-sl-feed-item.is-gift   .tah-sl-feed-txt { color: #F5B23E; font-weight: 600; }
.tah-sl-feed-item.is-follow .tah-sl-feed-txt { color: #2FD179; }
.tah-sl-feed-item.is-risk   .tah-sl-feed-txt { color: #F5544E; font-weight: 600; }
.tah-sl-feed-item.is-pos    .tah-sl-feed-txt { color: #2FD179; font-weight: 600; }
.tah-sl-instr-text {
    font-weight: 700; font-size: 20px; line-height: 1.2; letter-spacing: -.02em;
    color: var(--tah-sl-white);
}
.tah-sl-instr-sub {
    margin-top: 5px; font-size: 12.5px; line-height: 1.4;
    color: var(--tah-sl-muted);
}
.tah-sl-instr-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 16px; padding-top: 13px;
    border-top: 1px solid var(--tah-sl-line);
}
.tah-sl-instr-foot .tah-sl-hint {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--tah-sl-muted);
}
.tah-sl-priobars { display: flex; gap: 3px; }
.tah-sl-priobars i {
    width: 14px; height: 4px; border-radius: 2px;
    background: var(--tah-sl-line);
}
.tah-sl-priobars i.is-on { background: var(--tah-sl-cat-color, var(--tah-sl-lilac)); }

/* Leyenda */
.tah-sl-legend {
    display: flex; gap: 14px; padding: 12px 16px;
    background: var(--tah-sl-panel);
    border-top: 1px solid var(--tah-sl-line);
}
.tah-sl-legend .tah-sl-lg { display: flex; align-items: flex-start; gap: 8px; flex: 1; }
.tah-sl-legend .tah-sl-lk {
    width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px;
    border-radius: 5px;
    border: 1px solid var(--tah-sl-line);
}
.tah-sl-legend .tah-sl-lk.is-orb { border-radius: 50%; background: var(--tah-sl-green); }
.tah-sl-legend .tah-sl-lk.is-card { background: var(--tah-sl-lilac); }
.tah-sl-legend .tah-sl-lg p {
    font-size: 10.5px; line-height: 1.35; color: var(--tah-sl-muted); margin: 0;
}
.tah-sl-legend .tah-sl-lg p b {
    display: block; font-size: 11px; font-weight: 700;
    color: var(--tah-sl-white);
}

/* Critical takeover */
.tah-sl-critical {
    position: absolute; inset: 0; z-index: 50;
    display: none;
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 28px 24px;
    background: radial-gradient(circle at 50% 35%, #7A1410, #3A0807 75%);
    animation: tah-sl-critIn .3s ease;
}
.tah-sl-critical.is-show { display: flex; }
.tah-sl-critical::before {
    content: ""; position: absolute; inset: 0;
    border: 3px solid var(--tah-sl-red); border-radius: 24px;
    animation: tah-sl-critBorder 1s infinite;
    pointer-events: none;
}
.tah-sl-crit-tag {
    margin-bottom: 22px; padding: 7px 16px;
    border-radius: 999px;
    font-size: 11px; font-weight: 800;
    letter-spacing: .22em; text-transform: uppercase;
    color: #FFD2CF;
    background: rgba(0,0,0,.3);
    border: 1px solid rgba(255,255,255,.25);
}
.tah-sl-crit-icon {
    font-size: 54px; margin-bottom: 8px;
    animation: tah-sl-shake 1.1s infinite;
}
.tah-sl-crit-text {
    margin-bottom: 10px;
    font-weight: 800; font-size: 26px; line-height: 1.15; letter-spacing: -.02em;
    color: #fff;
}
.tah-sl-crit-sub {
    max-width: 280px; margin: 0 auto 22px;
    font-size: 13px; line-height: 1.45; color: #FFC9C6;
}
.tah-sl-crit-count {
    width: 96px; height: 96px; margin: 0 auto 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.25);
    background: rgba(0,0,0,.25);
}
.tah-sl-crit-count b {
    font-weight: 800; font-size: 34px; line-height: 1; color: #fff;
    font-variant-numeric: tabular-nums;
}
.tah-sl-crit-count span {
    margin-top: 3px; font-size: 9px;
    letter-spacing: .14em; text-transform: uppercase; color: #FFC9C6;
}
.tah-sl-crit-op {
    display: inline-flex; align-items: center; gap: 7px;
    margin: 14px 0 18px; font-size: 11px; color: #FFB3AF;
}
.tah-sl-crit-op .tah-sl-pgreen {
    width: 7px; height: 7px; border-radius: 50%;
    background: #FF6B66;
    animation: tah-sl-blink 1.1s infinite;
}
.tah-sl-crit-btn {
    padding: 13px 26px;
    border: none; border-radius: 11px;
    background: #fff; color: #7A1410;
    font-weight: 700; font-size: 13px;
    cursor: pointer; transition: background .15s;
}
.tah-sl-crit-btn:hover { background: #FFE9E8; }

/* Métricas en vivo (números reales) */
.tah-sl-metrics {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px; padding: 0 16px;
}
.tah-sl-metric {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 11px 6px;
    background: var(--tah-sl-panel);
    border: 1px solid var(--tah-sl-line);
    border-radius: 14px; text-align: center;
}
.tah-sl-metric-icon { font-size: 16px; line-height: 1; }
.tah-sl-metric-val {
    font-weight: 800; font-size: 18px; line-height: 1.1;
    color: var(--tah-sl-white);
    font-variant-numeric: tabular-nums;
}
.tah-sl-metric-lbl {
    font-size: 9px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--tah-sl-muted);
}
.tah-sl-metric-sub {
    font-size: 10px; font-weight: 600; color: var(--tah-sl-muted);
    font-variant-numeric: tabular-nums;
}

/* Barra de meta de diamantes */
.tah-sl-goal { padding: 12px 16px 0; }
.tah-sl-goal-head {
    display: flex; justify-content: space-between;
    font-size: 11px; font-weight: 700; color: var(--tah-sl-muted);
    margin-bottom: 6px;
}
.tah-sl-goal-head span:last-child {
    color: var(--tah-sl-amber); font-variant-numeric: tabular-nums;
}
.tah-sl-goal-track {
    height: 8px; border-radius: 999px;
    background: var(--tah-sl-panel-2); overflow: hidden;
}
.tah-sl-goal-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--tah-sl-amber), #FFD27A);
    transition: width .4s ease;
}

/* Informe final del live */
.tah-sl-report {
    position: absolute; inset: 0; z-index: 60;
    display: none;
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 28px 24px;
    background: radial-gradient(circle at 50% 25%, #1B2540, #0E0D14 78%);
    overflow-y: auto;
    animation: tah-sl-critIn .3s ease;
}
.tah-sl-report.is-show { display: flex; }
.tah-sl-report-icon { font-size: 46px; margin-bottom: 10px; }
.tah-sl-report-title {
    font-weight: 800; font-size: 22px; line-height: 1.2;
    letter-spacing: -.02em; color: var(--tah-sl-white);
    margin-bottom: 14px;
}
.tah-sl-report-body {
    max-width: 320px; margin: 0 auto 18px;
    font-size: 13.5px; line-height: 1.55; color: #C9C7D6;
    white-space: pre-wrap;
}
.tah-sl-report-loading { color: var(--tah-sl-muted); font-style: italic; }
.tah-sl-report-stats {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    margin-bottom: 22px;
}
.tah-sl-report-chip {
    display: flex; flex-direction: column; align-items: center;
    min-width: 64px; padding: 9px 12px;
    background: var(--tah-sl-panel); border: 1px solid var(--tah-sl-line);
    border-radius: 12px;
}
.tah-sl-report-chip b {
    font-size: 14px; font-weight: 800; color: var(--tah-sl-white);
    font-variant-numeric: tabular-nums;
}
.tah-sl-report-chip span {
    font-size: 9px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--tah-sl-muted); margin-top: 2px;
}

/* Animaciones */
@keyframes tah-sl-blink {
    0%,100% { opacity: 1; }
    50%     { opacity: .25; }
}
@keyframes tah-sl-pulseRed {
    0%,100% { box-shadow: 0 0 14px rgba(245,84,78,.5); }
    50%     { box-shadow: 0 0 26px rgba(245,84,78,.95); }
}
@keyframes tah-sl-flash {
    0%   { transform: scale(.985); opacity: .4; }
    100% { transform: scale(1);    opacity: 1; }
}
@keyframes tah-sl-critIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes tah-sl-critBorder {
    0%,100% { opacity: .35; }
    50%     { opacity: 1; }
}
@keyframes tah-sl-shake {
    0%,100% { transform: rotate(0); }
    25%     { transform: rotate(-9deg); }
    75%     { transform: rotate(9deg); }
}

@media (max-width: 430px) {
    .tah-sl-instr-text { font-size: 18px; }
    .tah-sl-crit-text { font-size: 22px; }
    .tah-sl-metrics { gap: 6px; padding: 0 12px; }
    .tah-sl-metric { padding: 9px 3px; }
    .tah-sl-metric-val { font-size: 16px; }
    .tah-sl-metric-lbl { font-size: 8px; letter-spacing: .04em; }
}
