/**
 * TbaiClub — 4 temas de chat (atributo en .tbaiclub-root / .ftbai-panel: data-tbai-chat-theme).
 * Por defecto: terminal (Trading Terminal). Alternativas: void, day, magenta.
 *
 * Los tokens --tbai-chat-* alimentan tipografía/accesorios; los tokens --club-*
 * del bundle se redefinen por tema (void/magenta) o vía bloque «day» extraído
 * del layout claro original (.tbai-layout.light).
 */
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='terminal'] {
  --tbai-chat-dark-bg: #10141f;
  --tbai-chat-glass-bg: rgba(16, 20, 31, 0.7);
  --tbai-chat-bubble-opt: rgba(22, 28, 44, 0.4);
  --tbai-chat-cyan: #00cfff;
  --tbai-chat-purple: #9440ff;
  --tbai-chat-text: #e2e8f0;
  --tbai-chat-text-muted: #a0aec0;
  --tbai-chat-border: #4a5568;
  --tbai-chat-badge-admin-bg: rgba(148, 64, 255, 0.1);
  --tbai-chat-badge-pro-bg: rgba(0, 207, 255, 0.1);
  --tbai-chat-badge-glow-admin: 0 0 5px rgba(148, 64, 255, 0.45);
  --tbai-chat-badge-glow-pro: 0 0 5px rgba(0, 207, 255, 0.45);
  --tbai-chat-scrollbar-thumb: #4a5568;
  --tbai-chat-scrollbar-thumb-hover: #00cfff;
  --tbai-chat-scrollbar-track: rgba(16, 20, 31, 0.5);
  --tbai-chat-focus-glow: 0 0 15px rgba(0, 207, 255, 0.35);
  --tbai-chat-send-hover-glow: 0 0 10px rgba(148, 64, 255, 0.55);
  --tbai-chat-chip-border: rgba(0, 207, 255, 0.35);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void'] {
  --tbai-chat-dark-bg: #05070d;
  --tbai-chat-glass-bg: rgba(5, 8, 14, 0.88);
  --tbai-chat-bubble-opt: rgba(12, 16, 28, 0.55);
  --tbai-chat-cyan: #00b8e6;
  --tbai-chat-purple: #7b2cbf;
  --tbai-chat-text: #e2e8f0;
  --tbai-chat-text-muted: #8b9cb3;
  --tbai-chat-border: #334155;
  --tbai-chat-badge-admin-bg: rgba(123, 44, 191, 0.18);
  --tbai-chat-badge-pro-bg: rgba(0, 184, 230, 0.12);
  --tbai-chat-badge-glow-admin: 0 0 4px rgba(123, 44, 191, 0.35);
  --tbai-chat-badge-glow-pro: 0 0 4px rgba(0, 184, 230, 0.35);
  --tbai-chat-scrollbar-thumb: #475569;
  --tbai-chat-scrollbar-thumb-hover: #00b8e6;
  --tbai-chat-scrollbar-track: rgba(5, 8, 14, 0.55);
  --tbai-chat-focus-glow: 0 0 14px rgba(0, 184, 230, 0.38);
  --tbai-chat-send-hover-glow: 0 0 12px rgba(123, 44, 191, 0.45);
  --tbai-chat-chip-border: rgba(0, 184, 230, 0.38);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] {
  --tbai-chat-dark-bg: #f8fafc;
  --tbai-chat-glass-bg: rgba(255, 255, 255, 0.92);
  --tbai-chat-bubble-opt: #ffffff;
  --tbai-chat-cyan: #0e7490;
  --tbai-chat-purple: #6d28d9;
  --tbai-chat-text: #0a0f1a;
  --tbai-chat-text-muted: #334155;
  --tbai-chat-border: #94a3b8;
  --tbai-chat-badge-admin-bg: rgba(109, 40, 217, 0.14);
  --tbai-chat-badge-pro-bg: rgba(14, 116, 144, 0.14);
  --tbai-chat-badge-glow-admin: none;
  --tbai-chat-badge-glow-pro: none;
  --tbai-chat-scrollbar-thumb: #64748b;
  --tbai-chat-scrollbar-thumb-hover: #0e7490;
  --tbai-chat-scrollbar-track: #f1f5f9;
  --tbai-chat-focus-glow: 0 0 0 3px rgba(14, 116, 144, 0.25);
  --tbai-chat-send-hover-glow: 0 0 0 2px rgba(14, 116, 144, 0.35);
  --tbai-chat-chip-border: rgba(14, 116, 144, 0.45);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta'] {
  --tbai-chat-dark-bg: #120616;
  --tbai-chat-glass-bg: rgba(24, 6, 32, 0.78);
  --tbai-chat-bubble-opt: rgba(40, 10, 52, 0.45);
  --tbai-chat-cyan: #f472b6;
  --tbai-chat-purple: #e879f9;
  --tbai-chat-text: #fce7f3;
  --tbai-chat-text-muted: #f9a8d4;
  --tbai-chat-border: #9d174d;
  --tbai-chat-badge-admin-bg: rgba(232, 121, 249, 0.15);
  --tbai-chat-badge-pro-bg: rgba(244, 114, 182, 0.15);
  --tbai-chat-badge-glow-admin: 0 0 6px rgba(232, 121, 249, 0.35);
  --tbai-chat-badge-glow-pro: 0 0 6px rgba(244, 114, 182, 0.35);
  --tbai-chat-scrollbar-thumb: #a21caf;
  --tbai-chat-scrollbar-thumb-hover: #f472b6;
  --tbai-chat-scrollbar-track: rgba(24, 6, 32, 0.55);
  --tbai-chat-focus-glow: 0 0 15px rgba(244, 114, 182, 0.45);
  --tbai-chat-send-hover-glow: 0 0 12px rgba(232, 121, 249, 0.55);
  --tbai-chat-chip-border: rgba(232, 121, 249, 0.45);
}

:is(.tbaiclub-root,.ftbai-panel) {
  --tbai-term-glass: var(--tbai-chat-glass-bg);
  --tbai-term-cyan: var(--tbai-chat-cyan);
  --tbai-term-purple: var(--tbai-chat-purple);
}

/* ── Terminal: alinea el marco exterior con tokens (resto = CSS del bundle) ─ */
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='terminal'] {
  background: radial-gradient(ellipse 130% 70% at 50% -15%, rgba(0, 207, 255, 0.08) 0%, transparent 52%),
    linear-gradient(180deg, #1e3a5f 0%, var(--club-bg) 60%);
}

/* ── Void: paleta fría + gradientes propios (lista, main, encabezado) ───── */
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void'] {
  --club-bg: #060a14;
  --club-messages-bg: #050810;
  --club-sidebar: #0c1222;
  --club-sidebar2: #111827;
  --club-surface: rgba(15, 23, 42, 0.88);
  --club-surface2: rgba(30, 41, 59, 0.82);
  --club-border: rgba(51, 65, 85, 0.55);
  --club-accent: #22d3ee;
  --club-accent2: #06b6d4;
  --club-accent-glow: rgba(34, 211, 238, 0.22);
  --club-red: #fb7185;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text1: #f1f5f9;
  --text2: #cbd5e1;
  --text3: #94a3b8;
  --msg-hover: rgba(34, 211, 238, 0.07);
  --badge-bg: rgba(34, 211, 238, 0.12);
  --msg-bubble-bg: rgba(10, 16, 30, 0.58);
  --msg-bubble-border: rgba(34, 211, 238, 0.14);
  --msg-bubble-glow: rgba(34, 211, 238, 0.08);
  background: radial-gradient(ellipse 130% 70% at 50% -15%, rgba(34, 211, 238, 0.07) 0%, transparent 52%),
    linear-gradient(180deg, #0f172a 0%, var(--club-bg) 60%);
  color: var(--text-primary);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void'] .tbai-sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 32%),
    linear-gradient(175deg, #1e293b, #0f172a 52%, #080c14);
  border-color: rgba(34, 211, 238, 0.14);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 1px rgba(255, 255, 255, 0.06);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void'] .tbai-main {
  background: radial-gradient(ellipse 90% 55% at 50% 0%, rgba(34, 211, 238, 0.07) 0%, transparent 52%),
    linear-gradient(180deg, #0f172a, var(--club-messages-bg));
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void'] .tbai-channel-header {
  background: rgba(8, 12, 22, 0.92);
  border-color: var(--club-border);
  color: var(--text-primary);
}

/* ── Magenta: neón rosa/púrpura en marco, lista y mensajes ───────────────── */
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta'] {
  --club-bg: #14051a;
  --club-messages-bg: #100414;
  --club-sidebar: #1f0a28;
  --club-sidebar2: #2a0f36;
  --club-surface: rgba(36, 10, 48, 0.88);
  --club-surface2: rgba(48, 12, 62, 0.85);
  --club-border: rgba(157, 23, 77, 0.45);
  --club-accent: #f472b6;
  --club-accent2: #e879f9;
  --club-accent-glow: rgba(244, 114, 182, 0.25);
  --club-red: #fb7185;
  --text-primary: #fce7f3;
  --text-secondary: #f9a8d4;
  --text-muted: #f472b6;
  --text1: #fff1f2;
  --text2: #fbcfe8;
  --text3: #f9a8d4;
  --msg-hover: rgba(244, 114, 182, 0.08);
  --badge-bg: rgba(232, 121, 249, 0.14);
  --msg-bubble-bg: rgba(40, 10, 52, 0.55);
  --msg-bubble-border: rgba(232, 121, 249, 0.22);
  --msg-bubble-glow: rgba(232, 121, 249, 0.12);
  background: radial-gradient(ellipse 130% 70% at 50% -15%, rgba(232, 121, 249, 0.12) 0%, transparent 52%),
    linear-gradient(180deg, #2a0a32 0%, var(--club-bg) 60%);
  color: var(--text-primary);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta'] .tbai-sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 32%),
    linear-gradient(175deg, #3b0a45, #24062e 52%, #14051a);
  border-color: rgba(232, 121, 249, 0.28);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 1px rgba(255, 255, 255, 0.05);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta'] .tbai-main {
  background: radial-gradient(ellipse 90% 55% at 50% 0%, rgba(232, 121, 249, 0.1) 0%, transparent 52%),
    linear-gradient(180deg, #2a0a32, var(--club-messages-bg));
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta'] .tbai-channel-header {
  background: rgba(24, 6, 32, 0.92);
  border-color: var(--club-border);
  color: var(--text-primary);
}

/* ── Claro: mismo alcance que .tbai-layout.light (sin depender del toggle React) ─ */
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"]{--club-bg: #f0f4fa;--club-messages-bg: #f5f8fc;--club-sidebar: #e2e8f2;--club-sidebar2: #dbe2ef;--club-surface: #ffffff;--club-border: rgba(33, 150, 243, .15);--club-accent: #2196F3;--club-accent2: #1976D2;--club-accent-glow: rgba(33, 150, 243, .2);--club-red: #ef4444;--text1: #0a0f1a;--text2: #1e293b;--text3: #334155;--text-muted: #475569;--text-primary: #0a0f1a;--text-secondary: #1e293b;--msg-hover: rgba(33, 150, 243, .06);--badge-bg: rgba(33, 150, 243, .12);--msg-bubble-bg: rgba(255, 255, 255, .7);--msg-bubble-border: rgba(33, 150, 243, .12);--msg-bubble-glow: rgba(33, 150, 243, .04)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"]{background:#f0f4fa;color:#0a0f1a}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-sidebar{background:linear-gradient(175deg,#e8edf5,#e2e8f2)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-sidebar-header{background:linear-gradient(135deg,#e0e6f2,#dce4f5);border-bottom:1px solid rgba(33,150,243,.12)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-sidebar-title{color:#111827}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-sidebar-subtitle{color:#374151}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-category-label{color:#1976d2}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-channel-item{color:#374151}@media (hover: hover) and (pointer: fine){:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-channel-item:hover{background:#2196f314;color:#111827}}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-channel-item.active{background:#2196f324;color:#111827}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-channel-item--locked{opacity:.88}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-locked-channel-title{color:#111827}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-locked-channel-desc{color:#4b5563}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-main{background:linear-gradient(180deg,var(--club-messages-bg, #f5f8fc) 0%,var(--club-bg, #f0f4fa) 100%)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-channel-header{background:#f0f4faf2;border-bottom:1px solid rgba(33,150,243,.1)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-channel-header-name{color:#111827}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-channel-header-desc{color:#6b7280}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-messages{background:var(--club-messages-bg, #f5f8fc)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-message:hover{background:#2196f30d}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-msg-author{color:#111827}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-msg-content{color:#1f2937}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-msg-time{color:#9ca3af}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-avatar{background:linear-gradient(135deg,#2196f3,#1565c0)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-date-divider{color:#9ca3af}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-date-divider:before,:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-date-divider:after{background:#2196f31f}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-reaction{background:#ffffffd9;border-color:#2196f31f;color:#374151}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-reaction.mine{background:#2196f31f;border-color:#2196f359}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-message:not(.grouped){background:#ffffffd1;border-color:#2196f31f;border-left-color:#2196f347;box-shadow:0 2px 12px #2196f314,inset 0 1px #ffffffe6;backdrop-filter:none;-webkit-backdrop-filter:none}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-reply-indicator{background:#2196f314;border-left-color:var(--club-accent);color:#6b7280}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-message.pinned{background:#fbbf2414;border-color:#fbbf2440}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-input-area{background:linear-gradient(180deg,#f5f8fc,#f0f4fa);border-top:1px solid rgba(33,150,243,.1);backdrop-filter:none;-webkit-backdrop-filter:none}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-input-box{background:#fff;border-color:#2196f324;box-shadow:0 2px 8px #0f172a0a;backdrop-filter:none;-webkit-backdrop-filter:none}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-date-sep-line{background:linear-gradient(90deg,transparent,rgba(33,150,243,.2),transparent)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-date-sep-text{background:#ffffffeb;border-color:#2196f31f;color:#64748b;box-shadow:0 1px 4px #0f172a0f}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-textarea{background:transparent;color:#111827}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-textarea::placeholder{color:#9ca3af}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-icon-btn{color:#6b7280}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-icon-btn:hover{color:#111827;background:#2196f314}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-send-btn{background:linear-gradient(135deg,#2196f3,#1976d2);color:#fff}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-modal-overlay{background:#00000040}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-modal{background:#fff;border-color:#2196f31f}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-modal-header{border-bottom-color:#2196f314;color:#111827}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-modal-label{color:#374151}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-modal-input,:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-modal-select{background:#f9fafb;border-color:#2196f31f;color:#111827}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-error-toast{background:#ef4444e6}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-poll-card{background:#fff;border-color:#2196f31f}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-poll-option{background:#f9fafb;border-color:#2196f31a;color:#374151}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-poll-option:hover{border-color:var(--club-accent)}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-poll-bar{background:#2196f326}:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme="day"] .tbai-poll-option.voted .tbai-poll-bar{background:#2196f340}

/* Claro — contraste: React suele dejar :not(.light); el bundle fuerza texto blanco en sidebar */
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] {
  --club-bg: #e2e8f0;
  --club-messages-bg: #f8fafc;
  --club-sidebar: #d8e2ec;
  --club-sidebar2: #cbd8e6;
  --club-border: rgba(15, 23, 42, 0.14);
  --text-primary: #0a0f1a;
  --text-secondary: #1e293b;
  --text-muted: #334155;
  --text1: #0a0f1a;
  --text2: #1e293b;
  --text3: #334155;
  --msg-bubble-bg: #ffffff;
  --msg-bubble-border: rgba(15, 23, 42, 0.12);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-sidebar {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(175deg, #d0dce8, #c5d4e3);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-main {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-channel-header {
  background: rgba(248, 250, 252, 0.97);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-channel-header-desc,
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-sidebar-subtitle {
  color: #1e293b !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-msg-time,
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-date-sep-text {
  color: #334155 !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-message:not(.grouped) {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-left: 3px solid #0284c7 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-reply-indicator {
  color: #334155 !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-poll-option {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #1e293b !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-modal-input,
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-modal-select {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-sidebar-subtitle,
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-notif-toggle {
  color: #475569 !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-category-label,
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-dm-section .tbai-cat-label {
  color: #0c4a6e !important;
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.12) 0%, transparent 100%) !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-category-label:hover {
  color: #0f172a !important;
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.18) 0%, transparent 100%) !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-channel-item {
  color: #1e293b !important;
}

@media (hover: hover) and (pointer: fine) {
  :is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-channel-item:hover {
    background: rgba(14, 116, 144, 0.1) !important;
    color: #0f172a !important;
  }
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-channel-item.has-unread,
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-channel-item.has-unread .tbai-channel-name {
  color: #0f172a !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-channel-item.active {
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.18), rgba(241, 245, 249, 0.95)) !important;
  color: #0f172a !important;
  box-shadow: inset 0 0 0 1px rgba(14, 116, 144, 0.35) !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-channel-item.active:before {
  background: linear-gradient(180deg, #0e7490 0%, #0284c7 100%) !important;
  box-shadow: 0 0 10px rgba(14, 116, 144, 0.45) !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-cat-add-btn {
  color: #0f172a !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-cat-add-btn:hover {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-chan-notif-btn,
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-chan-edit-btn {
  color: #64748b !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-chan-notif-btn:hover,
:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-chan-edit-btn:hover {
  color: #0f172a !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-channel-drag-grip {
  color: #94a3b8 !important;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']:not(.light) .tbai-sidebar .tbai-lock {
  color: #64748b !important;
}

/* ── Tipografía / badges / scroll (no aplastar gradientes del shell) ─────── */
:is(.tbaiclub-root,.ftbai-panel) .tbai-message .tbai-msg-content {
  color: var(--tbai-chat-text);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-message .tbai-msg-content {
  color: #0a0f1a !important;
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-msg-time,
:is(.tbaiclub-root,.ftbai-panel) .tbai-date-sep-text {
  color: var(--tbai-chat-text-muted) !important;
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-input-box {
  background-color: rgba(16, 20, 31, 0.8);
  border: 1px solid var(--tbai-chat-border);
  border-radius: 10px;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-input-box {
  background-color: #ffffff;
  border-color: rgba(15, 23, 42, 0.16) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void'] .tbai-input-box {
  background-color: rgba(5, 8, 14, 0.9);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta'] .tbai-input-box {
  background-color: rgba(24, 6, 32, 0.9);
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-textarea:focus {
  outline: none;
  border-color: var(--tbai-chat-cyan) !important;
  box-shadow: var(--tbai-chat-focus-glow, 0 0 15px rgba(0, 207, 255, 0.35));
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-send-btn:hover {
  box-shadow: var(--tbai-chat-send-hover-glow, 0 0 10px rgba(148, 64, 255, 0.55));
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-role-badge.admin {
  background-color: var(--tbai-chat-badge-admin-bg);
  color: var(--tbai-chat-purple);
  text-shadow: var(--tbai-chat-badge-glow-admin, none);
  border: 1px solid var(--tbai-chat-purple);
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-role-badge.pro,
:is(.tbaiclub-root,.ftbai-panel) .tbai-role-badge.user {
  background-color: var(--tbai-chat-badge-pro-bg);
  color: var(--tbai-chat-cyan);
  text-shadow: var(--tbai-chat-badge-glow-pro, none);
  border: 1px solid var(--tbai-chat-cyan);
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-messages,
:is(.tbaiclub-root,.ftbai-panel) .tbai-messages-outer {
  scrollbar-color: var(--tbai-chat-scrollbar-thumb, #4a5568) var(--tbai-chat-scrollbar-track, rgba(16, 20, 31, 0.5));
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-channel-presence-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--tbai-chat-cyan);
  background: var(--tbai-chat-badge-pro-bg);
  border: 1px solid var(--tbai-chat-chip-border, rgba(0, 207, 255, 0.35));
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta'] .tbai-channel-presence-chip {
  color: var(--tbai-chat-purple);
  background: var(--tbai-chat-badge-admin-bg);
}

:is(.tbaiclub-root,.ftbai-panel) .tbai-channel-access-hint {
  color: var(--tbai-chat-text-muted, #94a3b8);
  border-top-color: rgba(148, 163, 184, 0.15);
}

:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day'] .tbai-channel-access-hint {
  color: #475569;
  border-top-color: rgba(15, 23, 42, 0.12);
}

/* ── FAB flotante TbaiClub (app madre): solo si hay superficie club con ese tema ───── */
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='terminal']) #tbai-chat-fab.tbai-fab {
  background: linear-gradient(135deg, #00cfff, #9440ff);
  box-shadow: 0 4px 20px rgba(0, 207, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='terminal']) #tbai-chat-fab.tbai-fab--active {
  background: linear-gradient(135deg, #0891b2, #6d28d9);
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='terminal']) #tbai-chat-fab.tbai-fab--active:hover {
  background: linear-gradient(135deg, #0e7490, #5b21b6);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='terminal']) #tbai-chat-fab.tbai-fab:hover:not(.tbai-fab--dragging):not(.tbai-fab--active) {
  box-shadow: 0 6px 28px rgba(0, 207, 255, 0.45), 0 4px 12px rgba(0, 0, 0, 0.35);
}

body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void']) #tbai-chat-fab.tbai-fab {
  background: linear-gradient(135deg, #00b8e6, #7b2cbf);
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.28), 0 2px 8px rgba(0, 0, 0, 0.35);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void']) #tbai-chat-fab.tbai-fab--active {
  background: linear-gradient(135deg, #0e7490, #4c1d95);
  box-shadow: 0 4px 16px rgba(123, 44, 191, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void']) #tbai-chat-fab.tbai-fab--active:hover {
  background: linear-gradient(135deg, #155e75, #5b21b6);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void']) #tbai-chat-fab.tbai-fab:hover:not(.tbai-fab--dragging):not(.tbai-fab--active) {
  box-shadow: 0 6px 28px rgba(34, 211, 238, 0.38), 0 4px 12px rgba(0, 0, 0, 0.38);
}

body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']) #tbai-chat-fab.tbai-fab {
  background: linear-gradient(135deg, #0e7490, #6d28d9);
  box-shadow: 0 4px 18px rgba(14, 116, 144, 0.35), 0 2px 8px rgba(15, 23, 42, 0.12);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']) #tbai-chat-fab.tbai-fab--active {
  background: linear-gradient(135deg, #0f766e, #5b21b6);
  box-shadow: 0 4px 14px rgba(91, 33, 182, 0.25), 0 2px 6px rgba(15, 23, 42, 0.12);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']) #tbai-chat-fab.tbai-fab--active:hover {
  background: linear-gradient(135deg, #115e59, #4c1d95);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']) #tbai-chat-fab.tbai-fab:hover:not(.tbai-fab--dragging):not(.tbai-fab--active) {
  box-shadow: 0 6px 26px rgba(14, 116, 144, 0.4), 0 4px 12px rgba(15, 23, 42, 0.14);
}

body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta']) #tbai-chat-fab.tbai-fab {
  background: linear-gradient(135deg, #f472b6, #e879f9);
  box-shadow: 0 4px 22px rgba(244, 114, 182, 0.4), 0 2px 8px rgba(0, 0, 0, 0.35);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta']) #tbai-chat-fab.tbai-fab--active {
  background: linear-gradient(135deg, #db2777, #7e22ce);
  box-shadow: 0 4px 16px rgba(232, 121, 249, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta']) #tbai-chat-fab.tbai-fab--active:hover {
  background: linear-gradient(135deg, #e11d48, #6d28d9);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta']) #tbai-chat-fab.tbai-fab:hover:not(.tbai-fab--dragging):not(.tbai-fab--active) {
  box-shadow: 0 6px 28px rgba(244, 114, 182, 0.5), 0 4px 12px rgba(0, 0, 0, 0.38);
}

body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='terminal']) #tbai-chat-fab.tbai-fab__badge,
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='void']) #tbai-chat-fab.tbai-fab__badge {
  border-color: rgba(15, 23, 42, 0.95);
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='day']) #tbai-chat-fab.tbai-fab__badge {
  border-color: #f1f5f9;
}
body:has(:is(.tbaiclub-root,.ftbai-panel)[data-tbai-chat-theme='magenta']) #tbai-chat-fab.tbai-fab__badge {
  border-color: #120616;
}

/* FAB siempre visible (panel cerrado = sin :has): mismo origen /api que el club embebido */
#tbai-chat-fab.tbai-fab {
  background: linear-gradient(135deg, #00cfff, #9440ff);
  box-shadow: 0 4px 20px rgba(0, 207, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
  color: #fff;
  z-index: 10070;
  pointer-events: auto;
}
#tbai-chat-fab.tbai-fab--active {
  background: linear-gradient(135deg, #0891b2, #6d28d9);
}
#tbai-chat-fab.tbai-fab__badge {
  border-color: rgba(15, 23, 42, 0.95);
}
