/* ═══════════════════════════════════════════════════════════
   CEREBRO · estilos
   Mismo design system que el CRM: lime + dark
   ═══════════════════════════════════════════════════════════ */

#view-cerebro {
    height: calc(100vh - 60px);
    overflow: hidden;
}

.cb-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100%;
    gap: 0;
    background: #0c0c0e;
}

/* ── Sidebar conversaciones ─────────────────────────────── */
.cb-sidebar {
    background: #111113;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cb-sidebar-head {
    padding: 16px 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cb-sidebar-head h3 {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.cb-btn-new {
    width: 100%;
    padding: 10px 14px;
    background: #e8ff47;
    color: #0c0c0e;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cb-btn-new:hover {
    background: #d9f03d;
    transform: translateY(-1px);
}

.cb-convs-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.cb-conv-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.cb-conv-item:hover {
    background: rgba(255,255,255,0.04);
}

.cb-conv-item.active {
    background: rgba(232,255,71,0.08);
    border-left: 3px solid #e8ff47;
    padding-left: 9px;
}

.cb-conv-info {
    flex: 1;
    min-width: 0;
}

.cb-conv-title {
    font-size: 12px;
    color: #e8e8e8;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.cb-conv-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}

.cb-conv-del {
    opacity: 0;
    background: none;
    border: none;
    color: rgba(239,68,68,0.7);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: opacity 0.15s;
}

.cb-conv-item:hover .cb-conv-del {
    opacity: 1;
}

.cb-conv-del:hover {
    background: rgba(239,68,68,0.15);
}

.cb-convs-empty {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 12px;
    padding: 40px 20px;
    line-height: 1.6;
}

/* ── Chat principal ─────────────────────────────────────── */
.cb-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0c0c0e;
}

.cb-main-head {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0f0f11;
}

.cb-main-title {
    font-size: 13px;
    font-weight: 700;
    color: #e8e8e8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cb-main-title span.icon {
    font-size: 16px;
}

.cb-main-actions {
    display: flex;
    gap: 8px;
}

.cb-main-actions button {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
}

.cb-main-actions button:hover {
    background: rgba(255,255,255,0.1);
    color: #e8e8e8;
}

/* ── Mensajes ───────────────────────────────────────────── */
.cb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cb-msg {
    display: flex;
    gap: 12px;
    animation: cbFadeIn 0.3s ease;
    max-width: 80%;
}

@keyframes cbFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cb-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.cb-msg.assistant {
    align-self: flex-start;
}

.cb-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.cb-msg.user .cb-msg-avatar {
    background: rgba(232,255,71,0.15);
    color: #e8ff47;
}

.cb-msg.assistant .cb-msg-avatar {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
}

.cb-msg-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #e8e8e8;
    word-wrap: break-word;
}

.cb-msg.user .cb-msg-bubble {
    background: rgba(232,255,71,0.08);
    border: 1px solid rgba(232,255,71,0.15);
}

.cb-msg.assistant .cb-msg-bubble {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.cb-msg-bubble strong { color: #fff; font-weight: 700; }
.cb-msg-bubble em { color: rgba(255,255,255,0.85); }
.cb-msg-bubble code {
    background: rgba(0,0,0,0.4);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #e8ff47;
    font-family: 'SF Mono', Monaco, monospace;
}
.cb-msg-bubble ul, .cb-msg-bubble ol {
    padding-left: 20px;
    margin: 8px 0;
}
.cb-msg-bubble li { margin-bottom: 4px; }
.cb-msg-bubble p { margin-bottom: 8px; }
.cb-msg-bubble p:last-child { margin-bottom: 0; }
.cb-msg-bubble pre {
    background: rgba(0,0,0,0.5);
    padding: 10px 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 11px;
}

.cb-msg-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    margin-top: 4px;
}

/* ── Loading ────────────────────────────────────────────── */
.cb-loading {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.cb-loading span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(165,180,252,0.6);
    animation: cbBounce 1.4s infinite ease-in-out;
}

.cb-loading span:nth-child(2) { animation-delay: 0.16s; }
.cb-loading span:nth-child(3) { animation-delay: 0.32s; }

@keyframes cbBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── Empty state ────────────────────────────────────────── */
.cb-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    text-align: center;
}

.cb-empty-icon {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.cb-empty h2 {
    font-size: 20px;
    font-weight: 800;
    color: #e8e8e8;
    margin-bottom: 8px;
}

.cb-empty p {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    max-width: 460px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.cb-empty-cta {
    background: #e8ff47;
    color: #0c0c0e;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.cb-empty-cta:hover {
    background: #d9f03d;
    transform: translateY(-1px);
}

/* ── Input ──────────────────────────────────────────────── */
.cb-input-wrap {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 16px 24px 20px;
    background: #0f0f11;
}

.cb-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 10px 14px;
    transition: border-color 0.15s;
}

.cb-input-row:focus-within {
    border-color: rgba(232,255,71,0.4);
}

.cb-input {
    flex: 1;
    background: none;
    border: none;
    color: #e8e8e8;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 22px;
    max-height: 140px;
    line-height: 1.5;
    padding: 4px 0;
}

.cb-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.cb-send {
    background: #e8ff47;
    color: #0c0c0e;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.cb-send:hover:not(:disabled) {
    background: #d9f03d;
    transform: scale(1.05);
}

.cb-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cb-input-hint {
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    margin-top: 8px;
    text-align: center;
}

/* ── Toast ──────────────────────────────────────────────── */
.cb-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1d;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 13px;
    color: #e8e8e8;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: cbToastIn 0.3s ease;
}

.cb-toast.ok { border-color: #4ade80; color: #bbf7d0; }
.cb-toast.err { border-color: #ef4444; color: #fecaca; }

@keyframes cbToastIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Responsive básico ──────────────────────────────────── */
@media (max-width: 900px) {
    .cb-wrap { grid-template-columns: 1fr; }
    .cb-sidebar { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   FASE 3 · Fuentes (chips + modal de búsqueda)
   ═══════════════════════════════════════════════════════════ */

.cb-sources-bar {
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(232,255,71,0.02);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cb-sources-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    margin-right: 4px;
}

.cb-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(232,255,71,0.08);
    border: 1px solid rgba(232,255,71,0.25);
    border-radius: 20px;
    padding: 5px 12px 5px 10px;
    font-size: 11px;
    color: #e8e8e8;
    transition: all 0.15s;
}

.cb-source-chip:hover {
    background: rgba(232,255,71,0.12);
    border-color: rgba(232,255,71,0.4);
}

.cb-source-chip .cb-chip-icon { font-size: 12px; }

.cb-source-chip .cb-chip-remove {
    background: none;
    border: none;
    color: rgba(239,68,68,0.6);
    cursor: pointer;
    font-size: 13px;
    padding: 0 2px;
    line-height: 1;
    margin-left: 2px;
}

.cb-source-chip .cb-chip-remove:hover {
    color: #ef4444;
}

.cb-source-add {
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.15s;
}

.cb-source-add:hover {
    border-color: rgba(232,255,71,0.5);
    color: #e8ff47;
    background: rgba(232,255,71,0.05);
}

.cb-sources-count {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    margin-left: auto;
}

/* ── Modal añadir fuente ───────────────────────────────── */
.cb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cbFadeIn 0.2s ease;
    padding: 20px;
}

.cb-modal {
    background: #111113;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.cb-modal-head {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cb-modal-head h2 {
    font-size: 14px;
    font-weight: 700;
    color: #e8e8e8;
}

.cb-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

.cb-modal-close:hover {
    color: #e8e8e8;
    background: rgba(255,255,255,0.05);
}

.cb-modal-search {
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cb-modal-search input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: #e8e8e8;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.cb-modal-search input:focus {
    border-color: rgba(232,255,71,0.4);
}

.cb-modal-search input::placeholder {
    color: rgba(255,255,255,0.3);
}

.cb-modal-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.cb-result-item {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.12s;
    margin-bottom: 2px;
}

.cb-result-item:hover {
    background: rgba(232,255,71,0.06);
}

.cb-result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.cb-result-info {
    flex: 1;
    min-width: 0;
}

.cb-result-name {
    font-size: 13px;
    font-weight: 600;
    color: #e8e8e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-result-meta {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-result-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(232,255,71,0.12);
    color: #e8ff47;
    font-weight: 600;
    flex-shrink: 0;
}

.cb-results-empty {
    text-align: center;
    color: rgba(255,255,255,0.3);
    padding: 40px 20px;
    font-size: 12px;
}

.cb-modal-foot {
    padding: 12px 22px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   FASE 4 · Audio Input
   ═══════════════════════════════════════════════════════════ */

.cb-mic-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    font-size: 16px;
}

.cb-mic-btn:hover {
    border-color: rgba(232,255,71,0.4);
    color: #e8ff47;
    background: rgba(232,255,71,0.05);
}

.cb-mic-btn.recording {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    animation: cbMicPulse 1.2s ease-in-out infinite;
}

@keyframes cbMicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
    50%      { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.cb-recording-bar {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 80px;
    background: #1a1a1d;
    border: 1px solid #ef4444;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
    z-index: 100;
    animation: cbRecSlide 0.25s ease;
}

@keyframes cbRecSlide {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.cb-rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    animation: cbRecBlink 1s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes cbRecBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.cb-rec-label {
    font-size: 13px;
    font-weight: 600;
    color: #e8e8e8;
}

.cb-rec-timer {
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 14px;
    color: #ef4444;
    font-weight: 700;
    margin-left: auto;
    margin-right: 8px;
}

.cb-rec-bar-progress {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 12px;
    max-width: 240px;
}

.cb-rec-bar-fill {
    height: 100%;
    background: #ef4444;
    width: 0%;
    transition: width 0.1s linear;
}

.cb-rec-actions {
    display: flex;
    gap: 8px;
}

.cb-rec-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e8e8e8;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.cb-rec-btn.stop {
    background: #e8ff47;
    color: #0c0c0e;
    border-color: #e8ff47;
}

.cb-rec-btn.stop:hover {
    background: #c2e62a;
}

.cb-rec-btn.cancel:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
}

.cb-rec-processing {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    padding: 6px 0;
}

.cb-rec-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: #e8ff47;
    border-radius: 50%;
    animation: cbSpin 0.8s linear infinite;
}

@keyframes cbSpin {
    to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════
   FASE 5A · Diferenciación visual por tipo de fuente
   ═══════════════════════════════════════════════════════════ */

.cb-source-chip[data-tipo="deal"] {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.25);
}
.cb-source-chip[data-tipo="deal"]:hover {
    background: rgba(99,102,241,0.14);
    border-color: rgba(99,102,241,0.4);
}
.cb-source-chip[data-tipo="tour"] {
    background: rgba(244,114,182,0.08);
    border-color: rgba(244,114,182,0.25);
}
.cb-source-chip[data-tipo="tour"]:hover {
    background: rgba(244,114,182,0.14);
    border-color: rgba(244,114,182,0.4);
}

.cb-result-badge.tipo-contacto {
    background: rgba(232,255,71,0.12);
    color: #e8ff47;
}
.cb-result-badge.tipo-deal {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
}
.cb-result-badge.tipo-tour {
    background: rgba(244,114,182,0.15);
    color: #f9a8d4;
}

/* FIX1 · Secciones del modal */
.cb-results-section{padding:10px 14px 6px;font-size:10px;font-weight:700;letter-spacing:1.2px;color:rgba(255,255,255,0.4);text-transform:uppercase;border-top:1px solid rgba(255,255,255,0.04);margin-top:4px}
.cb-results-section:first-child{border-top:none;margin-top:0}


/* ═══════════════════════════════════════════════════════════
   FASE 5B · Notas libres
   ═══════════════════════════════════════════════════════════ */

.cb-modal-quickadd {
    padding: 14px 22px 0;
}

.cb-quickadd-btn {
    width: 100%;
    background: rgba(232,255,71,0.06);
    border: 1px dashed rgba(232,255,71,0.3);
    color: #e8ff47;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s;
    text-align: left;
}

.cb-quickadd-btn:hover {
    background: rgba(232,255,71,0.12);
    border-color: rgba(232,255,71,0.5);
}

.cb-source-chip[data-tipo="nota"] {
    background: rgba(251,191,36,0.08);
    border-color: rgba(251,191,36,0.25);
}
.cb-source-chip[data-tipo="nota"]:hover {
    background: rgba(251,191,36,0.14);
    border-color: rgba(251,191,36,0.4);
}

.cb-result-badge.tipo-nota {
    background: rgba(251,191,36,0.15);
    color: #fcd34d;
}

.cb-modal-nota {
    max-width: 640px;
}

.cb-nota-body {
    padding: 20px 22px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cb-nota-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
    display: block;
}

.cb-nota-body input[type="text"] {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: #e8e8e8;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.cb-nota-body input[type="text"]:focus {
    border-color: rgba(232,255,71,0.4);
}

.cb-nota-body textarea {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: #e8e8e8;
    font-size: 13px;
    outline: none;
    resize: vertical;
    min-height: 260px;
    max-height: 50vh;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color 0.15s;
}

.cb-nota-body textarea:focus {
    border-color: rgba(232,255,71,0.4);
}

.cb-nota-counter {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-align: right;
    margin-top: 6px;
}

.cb-nota-foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 22px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.cb-nota-cancel {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.cb-nota-cancel:hover {
    background: rgba(255,255,255,0.08);
    color: #e8e8e8;
}

.cb-nota-save {
    background: #e8ff47;
    color: #0c0c0e;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s;
}

.cb-nota-save:hover:not(:disabled) {
    background: #d9f03d;
}

.cb-nota-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   FASE 5C · PDFs como fuentes
   ═══════════════════════════════════════════════════════════ */

.cb-modal-quickadd {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px 22px 0;
}

.cb-modal-quickadd .cb-quickadd-btn {
    width: 100%;
}

.cb-quickadd-pdf {
    background: rgba(251,146,60,0.06);
    border: 1px dashed rgba(251,146,60,0.3);
    color: #fb923c;
}

.cb-quickadd-pdf:hover {
    background: rgba(251,146,60,0.12);
    border-color: rgba(251,146,60,0.5);
}

/* Chip pdf */
.cb-source-chip[data-tipo="pdf"] {
    background: rgba(251,146,60,0.08);
    border-color: rgba(251,146,60,0.25);
}
.cb-source-chip[data-tipo="pdf"]:hover {
    background: rgba(251,146,60,0.14);
    border-color: rgba(251,146,60,0.4);
}

.cb-result-badge.tipo-pdf {
    background: rgba(251,146,60,0.15);
    color: #fdba74;
}

/* Modal subir PDF */
.cb-modal-pdf {
    max-width: 560px;
}

.cb-pdf-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cb-pdf-dropzone {
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: rgba(255,255,255,0.02);
}

.cb-pdf-dropzone:hover,
.cb-pdf-dropzone.drag-over {
    border-color: rgba(251,146,60,0.5);
    background: rgba(251,146,60,0.05);
}

.cb-pdf-dropzone-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.cb-pdf-dropzone:hover .cb-pdf-dropzone-icon,
.cb-pdf-dropzone.drag-over .cb-pdf-dropzone-icon {
    opacity: 1;
}

.cb-pdf-dropzone-text {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
}

.cb-pdf-status {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 12px;
    line-height: 1.5;
}

.cb-pdf-loading {
    color: rgba(255,255,255,0.6);
}

.cb-pdf-foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 22px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.cb-pdf-cancel {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.cb-pdf-cancel:hover {
    background: rgba(255,255,255,0.08);
    color: #e8e8e8;
}

/* ═══════════════════════════════════════════════════════════
   FASE 5D · URLs como fuentes
   ═══════════════════════════════════════════════════════════ */

.cb-modal-quickadd {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.cb-quickadd-url {
    background: rgba(34,211,238,0.06);
    border: 1px dashed rgba(34,211,238,0.3);
    color: #22d3ee;
}

.cb-quickadd-url:hover {
    background: rgba(34,211,238,0.12);
    border-color: rgba(34,211,238,0.5);
}

/* Chip url */
.cb-source-chip[data-tipo="url"] {
    background: rgba(34,211,238,0.08);
    border-color: rgba(34,211,238,0.25);
}
.cb-source-chip[data-tipo="url"]:hover {
    background: rgba(34,211,238,0.14);
    border-color: rgba(34,211,238,0.4);
}

.cb-result-badge.tipo-url {
    background: rgba(34,211,238,0.15);
    color: #67e8f9;
}

/* Modal añadir URL */
.cb-modal-url {
    max-width: 580px;
}

.cb-url-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cb-url-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.6);
    display: block;
}

.cb-url-body input[type="url"] {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: #e8e8e8;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.cb-url-body input[type="url"]:focus {
    border-color: rgba(34,211,238,0.4);
}

.cb-url-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    line-height: 1.5;
}

.cb-url-status {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 4px;
}

.cb-url-loading {
    color: rgba(255,255,255,0.6);
}

.cb-url-foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 22px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.cb-url-cancel {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}
.cb-url-cancel:hover {
    background: rgba(255,255,255,0.08);
    color: #e8e8e8;
}

.cb-url-save {
    background: #22d3ee;
    color: #0c0c0e;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s;
}
.cb-url-save:hover:not(:disabled) {
    background: #06b6d4;
}
.cb-url-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   [CEREBRO-PREMIUM-START]
   Sprint P2 · onboarding, polish, branded
   Generado por install-cerebro-B-css.php
   ═══════════════════════════════════════════════════════════ */

/* ── Avatar assistant branded (sustituye violeta) ── */
.cb-msg.assistant .cb-msg-avatar {
    background: linear-gradient(135deg, #1a1a1d, #0c0c0e) !important;
    color: #e8ff47 !important;
    border: 1px solid rgba(232, 255, 71, 0.2) !important;
}

/* ── Empty state premium (sin conv abierta) ── */
.cb-empty-premium {
    padding: 50px 30px;
    max-width: 580px;
    margin: 0 auto;
}
.cb-empty-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 255, 71, 0.18), rgba(232, 255, 71, 0.02));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(232, 255, 71, 0.08);
    animation: cbPulseGlow 3s ease-in-out infinite;
}
@keyframes cbPulseGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(232, 255, 71, 0.08); }
    50%      { box-shadow: 0 0 60px rgba(232, 255, 71, 0.18); }
}
.cb-empty-premium .cb-empty-icon {
    font-size: 42px;
    opacity: 1;
}
.cb-empty-premium h2 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.cb-empty-premium > p {
    font-size: 13px;
    max-width: 380px;
    margin: 0 auto 24px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.55;
}

/* ── Suggestion grid ── */
.cb-suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 480px;
    margin: 0 auto 22px;
}
.cb-suggestion {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
    text-align: left;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    font-family: inherit;
}
.cb-suggestion:hover:not(:disabled) {
    background: rgba(232, 255, 71, 0.06);
    border-color: rgba(232, 255, 71, 0.35);
    color: #e8e8e8;
    transform: translateY(-1px);
}
.cb-suggestion:active { transform: translateY(0); }
.cb-suggestion:disabled { opacity: 0.4; cursor: wait; }
.cb-sug-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}
.cb-sug-text { flex: 1; }

.cb-suggestions-conv {
    grid-template-columns: 1fr;
    max-width: 380px;
}
.cb-suggestions-conv .cb-suggestion {
    padding: 10px 12px;
    font-size: 12px;
}

/* ── Stats + CTA ghost ── */
.cb-empty-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.32);
    font-weight: 500;
}
.cb-empty-stat-sep { opacity: 0.4; }

.cb-empty-cta-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 9px 18px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.cb-empty-cta-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.25);
    transform: none;
}

/* ── Empty state conv (con/sin fuentes) ── */
.cb-empty-conv {
    padding: 40px 24px;
    max-width: 520px;
    margin: 0 auto;
}
.cb-empty-conv .cb-empty-icon {
    font-size: 38px;
    opacity: 0.85;
    margin-bottom: 14px;
}
.cb-empty-conv h2 {
    font-size: 17px;
    margin-bottom: 6px;
    color: #fff;
    font-weight: 800;
}
.cb-empty-conv > p {
    max-width: 380px;
    margin: 0 auto 18px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.55;
}
.cb-empty-sources-list {
    color: rgba(232, 255, 71, 0.7) !important;
    font-weight: 500;
}

.cb-empty-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 440px;
    margin: 0 auto 16px;
}
.cb-empty-quick {
    background: rgba(232, 255, 71, 0.04);
    border: 1px dashed rgba(232, 255, 71, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
    text-align: left;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    line-height: 1.4;
    font-family: inherit;
}
.cb-empty-quick:hover {
    background: rgba(232, 255, 71, 0.1);
    border-color: rgba(232, 255, 71, 0.5);
    color: #e8e8e8;
    transform: translateY(-1px);
}
.cb-empty-quick .cb-eq-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}
.cb-empty-quick strong {
    color: #e8ff47;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}
.cb-empty-or {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.25) !important;
    margin: 8px auto 0 !important;
    max-width: 380px;
    font-style: italic;
}

/* ── Markdown extras dentro de mensajes ── */
.cb-msg-bubble .cb-md-h {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 12px 0 6px;
    letter-spacing: -0.2px;
}
.cb-msg-bubble h3.cb-md-h { font-size: 15px; }
.cb-msg-bubble h4.cb-md-h { font-size: 14px; }
.cb-msg-bubble h5.cb-md-h,
.cb-msg-bubble h6.cb-md-h { font-size: 13px; opacity: 0.85; }

.cb-msg-bubble .cb-md-bq {
    border-left: 3px solid #e8ff47;
    padding: 8px 14px;
    margin: 10px 0;
    background: rgba(232, 255, 71, 0.05);
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

.cb-msg-bubble hr {
    border: none;
    border-top: 1px dashed rgba(255, 255, 255, 0.18);
    margin: 14px 0;
}

.cb-msg-bubble .cb-md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 11.5px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.cb-msg-bubble .cb-md-table th,
.cb-msg-bubble .cb-md-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 7px 12px;
    text-align: left;
}
.cb-msg-bubble .cb-md-table th {
    background: rgba(232, 255, 71, 0.08);
    color: #e8ff47;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.cb-msg-bubble .cb-md-table tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}
.cb-msg-bubble .cb-md-table tr:last-child td {
    border-bottom: none;
}

.cb-msg-bubble del {
    color: rgba(255, 255, 255, 0.4);
    text-decoration-color: rgba(239, 68, 68, 0.5);
}

.cb-msg-bubble a {
    color: #e8ff47 !important;
    text-decoration: underline;
    text-decoration-color: rgba(232, 255, 71, 0.35);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s;
    font-weight: 500;
}
.cb-msg-bubble a:hover {
    text-decoration-color: #e8ff47;
}

/* Nested lists */
.cb-msg-bubble ul ul,
.cb-msg-bubble ol ol,
.cb-msg-bubble ul ol,
.cb-msg-bubble ol ul {
    margin-top: 4px;
    margin-bottom: 4px;
    padding-left: 20px;
}

/* Code block con lang */
.cb-msg-bubble pre[class^="lang-"]::before {
    content: attr(class);
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 9px;
    color: rgba(232, 255, 71, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.cb-msg-bubble pre {
    position: relative;
}

/* ── Confirm modal premium ── */
.cb-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cbFadeIn 0.15s ease;
}
.cb-confirm-modal {
    max-width: 420px;
    width: 100%;
    padding: 32px 32px 24px;
    text-align: center;
    background: #14141b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    animation: cbBounce 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cb-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 28px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.cb-confirm-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}
.cb-confirm-msg {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.55;
    margin-bottom: 22px;
}
.cb-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.cb-confirm-cancel,
.cb-confirm-ok {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    flex: 1;
    max-width: 160px;
    font-family: inherit;
    letter-spacing: 0.3px;
}
.cb-confirm-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.cb-confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}
.cb-confirm-ok {
    background: #e8ff47;
    color: #0c0c0e;
}
.cb-confirm-ok:hover { background: #d9f03d; }
.cb-confirm-ok:focus { outline: 2px solid rgba(232, 255, 71, 0.5); outline-offset: 2px; }
.cb-confirm-ok.cb-confirm-danger {
    background: #ef4444;
    color: #fff;
}
.cb-confirm-ok.cb-confirm-danger:hover { background: #dc2626; }
.cb-confirm-ok.cb-confirm-danger:focus { outline-color: rgba(239, 68, 68, 0.5); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .cb-suggestions { grid-template-columns: 1fr; }
    .cb-empty-quick-grid { grid-template-columns: 1fr; }
    .cb-empty-premium { padding: 36px 18px; }
    .cb-empty-premium h2 { font-size: 19px; }
    .cb-confirm-modal { padding: 26px 22px 20px; }
}

/* ═══════════════════════════════════════════════════════════
   [CEREBRO-PREMIUM-END]
   ═══════════════════════════════════════════════════════════ */

/* [CEREBRO-LAYOUT-V2-START] · 20260605221408 */
/* ════════════════════════════════════════════════════════════════════════════
   CEREBRO · LAYOUT V2 (NotebookLM-style) · Sprint C1
   3 paneles · Studio cards · Cites · Confirm modal · Skeleton
   ════════════════════════════════════════════════════════════════════════════ */

/* === LAYOUT 3-PANELES === */
.cb-wrap-v2 {
    display: grid !important;
    grid-template-columns: 240px 1fr 260px !important;
    grid-template-rows: 1fr !important;
    height: 100% !important;
    background: #0a0a0c !important;
    color: #e5e7eb !important;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif !important;
    position: relative !important;
}

.cb-panel {
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
.cb-panel-sources { border-right: 0.5px solid rgba(255,255,255,0.06); background: rgba(0,0,0,0.2); padding: 14px 12px; }
.cb-panel-chat { background: #0a0a0c; }
.cb-panel-studio { border-left: 0.5px solid rgba(255,255,255,0.06); background: rgba(0,0,0,0.2); padding: 14px 12px; }

.cb-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cb-panel-label {
    font-size: 10px;
    color: #71717a;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}

/* === CTA add === */
.cb-cta-add {
    width: 100%;
    padding: 9px 12px;
    background: #e8ff47;
    color: #0c0c0e;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.cb-cta-add:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,255,71,0.25); }
.cb-cta-add:active { transform: translateY(0); }
.cb-cta-ghost {
    background: transparent;
    color: #e8ff47;
    border: 1px solid rgba(232,255,71,0.3);
    margin-top: 4px;
}
.cb-cta-ghost:hover { background: rgba(232,255,71,0.06); }

/* === Sources tools === */
.cb-sources-tools {
    margin-bottom: 8px;
}
.cb-sources-search {
    position: relative;
    margin-bottom: 8px;
}
.cb-sources-search svg {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #71717a;
}
.cb-sources-search input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 0.5px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 6px 8px 6px 26px;
    color: #e5e7eb;
    font-size: 11px;
    outline: none;
    transition: border-color 0.15s;
}
.cb-sources-search input:focus { border-color: rgba(232,255,71,0.4); }
.cb-select-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: #a3a3a3;
    cursor: pointer;
    padding: 4px 4px;
}
.cb-select-all input[type="checkbox"] {
    accent-color: #e8ff47;
    width: 12px;
    height: 12px;
}

/* === Sources list === */
.cb-sources-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.cb-sources-empty, .cb-convs-empty {
    color: #71717a;
    font-size: 10.5px;
    padding: 14px 6px;
    text-align: center;
    font-style: italic;
}
.cb-source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    background: rgba(255,255,255,0.025);
    border: 0.5px solid rgba(255,255,255,0.06);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.cb-source-item:hover {
    background: rgba(232,255,71,0.06);
    border-color: rgba(232,255,71,0.2);
}
.cb-source-flash {
    background: rgba(232,255,71,0.15) !important;
    border-color: rgba(232,255,71,0.5) !important;
    box-shadow: 0 0 0 2px rgba(232,255,71,0.2);
}
.cb-src-idx {
    background: rgba(232,255,71,0.12);
    color: #e8ff47;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cb-src-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.cb-src-body { flex: 1; min-width: 0; }
.cb-src-title {
    font-size: 11px;
    color: #e5e7eb;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cb-src-meta {
    font-size: 9px;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cb-src-remove {
    opacity: 0;
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 3px;
    border-radius: 3px;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.cb-source-item:hover .cb-src-remove { opacity: 1; }
.cb-src-remove:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

/* === Chat head === */
.cb-chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.cb-chat-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
    min-width: 0;
}
.cb-chat-title span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cb-brand-dot {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #1a1a1d 0%, #000 100%);
    border: 1px solid rgba(232,255,71,0.35);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.cb-chat-head-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.cb-icon-btn {
    background: transparent;
    border: 0.5px solid rgba(255,255,255,0.08);
    color: #a3a3a3;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.cb-icon-btn:hover {
    background: rgba(232,255,71,0.08);
    border-color: rgba(232,255,71,0.25);
    color: #e8ff47;
}
.cb-mobile-open, .cb-mobile-close { display: none; }

/* === Chat content + messages === */
.cb-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.cb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Mensajes */
.cb-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: cbMsgIn 0.25s ease-out;
}
@keyframes cbMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.cb-msg-user { flex-direction: row-reverse; }
.cb-msg-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #1a1a1d 0%, #000 100%);
    border: 1px solid rgba(232,255,71,0.35);
    color: #e8ff47;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.cb-msg-avatar-user {
    background: rgba(232,255,71,0.1);
    border: 1px solid rgba(232,255,71,0.4);
    color: #e8ff47;
    font-size: 10px;
    font-weight: 700;
}
.cb-msg-body { flex: 1; min-width: 0; max-width: calc(100% - 38px); }
.cb-msg-user .cb-msg-body { display: flex; flex-direction: column; align-items: flex-end; }

.cb-msg-bubble {
    background: rgba(255,255,255,0.025);
    border: 0.5px solid rgba(255,255,255,0.06);
    border-radius: 12px 12px 12px 4px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.55;
    color: #e5e7eb;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.cb-msg-user .cb-msg-bubble {
    background: rgba(232,255,71,0.08);
    border: 0.5px solid rgba(232,255,71,0.18);
    border-radius: 12px 12px 4px 12px;
    color: #e8e8e8;
    max-width: 85%;
}
.cb-msg-bubble p { margin: 0 0 6px 0; }
.cb-msg-bubble p:last-child { margin-bottom: 0; }
.cb-msg-bubble strong { color: #ffffff; font-weight: 600; }
.cb-msg-bubble code {
    background: rgba(0,0,0,0.4);
    border: 0.5px solid rgba(255,255,255,0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 11.5px;
    color: #e8ff47;
}
.cb-msg-bubble pre {
    background: rgba(0,0,0,0.5);
    border: 0.5px solid rgba(255,255,255,0.1);
    padding: 10px 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 11.5px;
    line-height: 1.4;
}
.cb-msg-bubble pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #e5e7eb;
}
.cb-msg-bubble a {
    color: #e8ff47;
    text-decoration: underline;
    text-decoration-color: rgba(232,255,71,0.4);
}
.cb-msg-bubble a:hover { text-decoration-color: #e8ff47; }
.cb-msg-bubble ul, .cb-msg-bubble ol { margin: 6px 0; padding-left: 18px; }
.cb-msg-bubble li { margin: 2px 0; }
.cb-md-h {
    color: #ffffff;
    font-weight: 600;
    margin: 10px 0 4px;
    font-size: 13.5px;
    line-height: 1.3;
}
.cb-md-bq {
    border-left: 2px solid rgba(232,255,71,0.4);
    margin: 8px 0;
    padding: 4px 10px;
    color: #a3a3a3;
    font-style: italic;
    background: rgba(255,255,255,0.02);
}
.cb-md-table {
    border-collapse: collapse;
    margin: 8px 0;
    width: 100%;
    font-size: 11.5px;
}
.cb-md-table th, .cb-md-table td {
    border: 0.5px solid rgba(255,255,255,0.1);
    padding: 5px 8px;
    text-align: left;
}
.cb-md-table th {
    background: rgba(232,255,71,0.06);
    color: #e8ff47;
    font-weight: 600;
}
.cb-msg-bubble hr { border: none; border-top: 0.5px solid rgba(255,255,255,0.1); margin: 10px 0; }
.cb-msg-bubble del { color: #71717a; }

/* Citas */
.cb-cite {
    color: #e8ff47;
    background: rgba(232,255,71,0.12);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    margin: 0 1px;
    cursor: pointer;
    transition: background 0.15s;
    vertical-align: super;
    line-height: 1;
}
.cb-cite:hover { background: rgba(232,255,71,0.25); }
.cb-cite-unknown { color: #71717a; background: rgba(255,255,255,0.05); cursor: default; }

/* Actions */
.cb-msg-actions {
    display: flex;
    gap: 4px;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}
.cb-msg:hover .cb-msg-actions { opacity: 1; }
.cb-msg-act {
    background: transparent;
    border: 0.5px solid rgba(255,255,255,0.08);
    color: #71717a;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.cb-msg-act:hover { background: rgba(232,255,71,0.08); border-color: rgba(232,255,71,0.25); color: #e8ff47; }
.cb-msg-act-active { background: rgba(232,255,71,0.15); border-color: rgba(232,255,71,0.4); color: #e8ff47; }
.cb-msg-audio {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #71717a;
    margin-top: 4px;
}

/* Loading / typing */
.cb-typing { display: inline-flex; gap: 3px; padding: 4px 0; }
.cb-typing span {
    width: 6px;
    height: 6px;
    background: #e8ff47;
    border-radius: 50%;
    animation: cbTyping 1.2s ease-in-out infinite;
}
.cb-typing span:nth-child(2) { animation-delay: 0.15s; }
.cb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cbTyping {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

.cb-msg-bubble-error {
    background: rgba(239,68,68,0.08) !important;
    border-color: rgba(239,68,68,0.25) !important;
    color: #f87171;
}
.cb-msg-retry {
    display: block;
    margin-top: 6px;
    background: transparent;
    border: 0.5px solid rgba(239,68,68,0.4);
    color: #f87171;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}
.cb-msg-retry:hover { background: rgba(239,68,68,0.1); }

/* === Empty states === */
.cb-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 28px;
    text-align: center;
    overflow-y: auto;
}
.cb-empty-premium { max-width: 580px; margin: 0 auto; }
.cb-empty-icon-wrap {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(232,255,71,0.1), rgba(232,255,71,0.02));
    border: 1px solid rgba(232,255,71,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    animation: cbPulseGlow 3s ease-in-out infinite;
}
@keyframes cbPulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232,255,71,0.1); }
    50% { box-shadow: 0 0 0 12px rgba(232,255,71,0); }
}
.cb-empty-icon { font-size: 28px; line-height: 1; }
.cb-empty-conv .cb-empty-icon { font-size: 30px; letter-spacing: 4px; margin-bottom: 12px; }
.cb-empty h2 {
    font-size: 19px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 6px 0;
}
.cb-empty p {
    font-size: 12.5px;
    color: #a3a3a3;
    margin: 0 0 18px 0;
    max-width: 460px;
    line-height: 1.5;
}
.cb-empty-sources-list { color: #e8e8e8 !important; font-weight: 500; font-size: 12px; }
.cb-suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 480px;
    margin-bottom: 18px;
}
.cb-suggestions-conv { grid-template-columns: 1fr; }
.cb-suggestion {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    color: #e5e7eb;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}
.cb-suggestion:hover {
    background: rgba(232,255,71,0.06);
    border-color: rgba(232,255,71,0.25);
    transform: translateY(-1px);
}
.cb-sug-icon { font-size: 16px; flex-shrink: 0; }
.cb-sug-text { flex: 1; }
.cb-empty-stats {
    font-size: 10.5px;
    color: #71717a;
    margin: 4px 0 12px;
}
.cb-empty-cta-ghost {
    background: transparent;
    border: 1px solid rgba(232,255,71,0.25);
    color: #e8ff47;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.cb-empty-cta-ghost:hover { background: rgba(232,255,71,0.08); border-color: rgba(232,255,71,0.5); }

.cb-empty-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 460px;
    margin-bottom: 14px;
}
.cb-empty-quick {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(232,255,71,0.18);
    border-radius: 9px;
    color: #e5e7eb;
    font-size: 11.5px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}
.cb-empty-quick:hover { background: rgba(232,255,71,0.08); transform: translateY(-1px); }
.cb-eq-icon { font-size: 16px; flex-shrink: 0; }
.cb-eq-text { display: flex; flex-direction: column; line-height: 1.25; }
.cb-eq-text strong { color: #e8ff47; font-weight: 600; font-size: 12px; }
.cb-empty-or { font-size: 11px; color: #71717a; font-style: italic; }

/* === Skeleton === */
.cb-skeleton-wrap { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.cb-skeleton-msg { display: flex; gap: 10px; align-items: flex-start; }
.cb-skeleton-user { flex-direction: row-reverse; }
.cb-skel-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: cbSkel 1.4s ease-in-out infinite;
    border-radius: 50%;
    flex-shrink: 0;
}
.cb-skel-bubble {
    flex: 1;
    max-width: 70%;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: cbSkel 1.4s ease-in-out infinite;
    border-radius: 12px;
    padding: 10px 14px;
    height: 50px;
}
.cb-skel-bubble-user {
    max-width: 50%;
    background: linear-gradient(90deg, rgba(232,255,71,0.04) 25%, rgba(232,255,71,0.1) 50%, rgba(232,255,71,0.04) 75%);
    background-size: 200% 100%;
    animation: cbSkel 1.4s ease-in-out infinite;
    height: 36px;
}
.cb-skel-line {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    margin-bottom: 6px;
}
.cb-skel-line-short { width: 60%; }
@keyframes cbSkel {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Input === */
.cb-input-wrap {
    padding: 12px 22px 14px;
    border-top: 0.5px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.2);
}
.cb-input-inner {
    background: rgba(255,255,255,0.04);
    border: 0.5px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 10px 12px 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.cb-input-inner:focus-within {
    border-color: rgba(232,255,71,0.35);
    box-shadow: 0 0 0 3px rgba(232,255,71,0.08);
}
#cb-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #e5e7eb;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    font-family: inherit;
    min-height: 22px;
    max-height: 200px;
}
#cb-input::placeholder { color: #71717a; }
#cb-input:disabled { opacity: 0.5; }
.cb-input-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    gap: 8px;
}
.cb-src-count {
    font-size: 10.5px;
    color: #e8ff47;
    background: rgba(232,255,71,0.1);
    padding: 3px 9px;
    border-radius: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.cb-send-btn {
    background: #e8ff47;
    color: #0c0c0e;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.cb-send-btn:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 4px 12px rgba(232,255,71,0.3); }
.cb-send-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.cb-input-hint {
    font-size: 9.5px;
    color: #71717a;
    margin-top: 6px;
    padding-left: 4px;
    font-style: italic;
}
.cb-mic-btn {
    background: transparent;
    border: 0.5px solid rgba(255,255,255,0.12);
    color: #a3a3a3;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.cb-mic-btn:hover { background: rgba(232,255,71,0.08); border-color: rgba(232,255,71,0.3); color: #e8ff47; }
.cb-mic-btn.recording { background: #ef4444; border-color: #ef4444; color: #fff; animation: cbRecPulse 1.2s ease-in-out infinite; }
@keyframes cbRecPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); } 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }

/* === Studio panel === */
.cb-studio-section { margin-bottom: 16px; }
.cb-studio-sec-label {
    font-size: 9.5px;
    color: #71717a;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
}
.cb-studio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.cb-studio-card {
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 11px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.cb-studio-card:hover {
    background: rgba(232,255,71,0.06);
    border-color: rgba(232,255,71,0.3);
    transform: translateY(-1px);
}
.cb-studio-primary {
    background: rgba(232,255,71,0.06);
    border: 0.5px solid rgba(232,255,71,0.25);
}
.cb-studio-primary:hover { background: rgba(232,255,71,0.12); }
.cb-sc-icon { font-size: 18px; line-height: 1; }
.cb-sc-name {
    font-size: 9.5px;
    color: #a3a3a3;
    font-weight: 500;
}
.cb-studio-primary .cb-sc-name { color: #e8ff47; font-weight: 600; }

/* === Convs list === */
.cb-convs-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
}
.cb-conv-group-label {
    font-size: 9px;
    color: #71717a;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin: 8px 4px 3px;
    font-weight: 600;
}
.cb-conv-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    background: rgba(255,255,255,0.02);
    border: 0.5px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.cb-conv-item:hover {
    background: rgba(232,255,71,0.05);
    border-color: rgba(232,255,71,0.15);
}
.cb-conv-active {
    background: rgba(232,255,71,0.08) !important;
    border-color: rgba(232,255,71,0.25) !important;
}
.cb-conv-icon { font-size: 12px; flex-shrink: 0; }
.cb-conv-body { flex: 1; min-width: 0; }
.cb-conv-title {
    font-size: 11px;
    color: #e5e7eb;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cb-conv-meta { font-size: 9px; color: #71717a; }
.cb-conv-del {
    opacity: 0;
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    flex-shrink: 0;
    transition: all 0.15s;
}
.cb-conv-item:hover .cb-conv-del { opacity: 1; }
.cb-conv-del:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

/* === Confirm modal === */
.cb-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: cbFadeIn 0.2s ease;
}
@keyframes cbFadeIn { from { opacity: 0; } to { opacity: 1; } }
.cb-confirm-modal {
    background: #18181b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 24px 24px 18px;
    max-width: 380px;
    text-align: center;
    animation: cbModalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cbModalIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: none; } }
.cb-confirm-icon {
    width: 48px;
    height: 48px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}
.cb-confirm-title { font-size: 16px; color: #ffffff; margin: 0 0 8px 0; font-weight: 600; }
.cb-confirm-msg { font-size: 12.5px; color: #a3a3a3; line-height: 1.5; margin: 0 0 18px 0; }
.cb-confirm-actions { display: flex; gap: 8px; justify-content: center; }
.cb-confirm-cancel, .cb-confirm-ok {
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}
.cb-confirm-cancel { background: rgba(255,255,255,0.06); border: 0.5px solid rgba(255,255,255,0.12); color: #e5e7eb; }
.cb-confirm-cancel:hover { background: rgba(255,255,255,0.1); }
.cb-confirm-ok { background: #e8ff47; color: #0c0c0e; }
.cb-confirm-ok:hover { transform: translateY(-1px); }
.cb-confirm-danger { background: #ef4444; color: #fff; }
.cb-confirm-danger:hover { background: #dc2626; }

/* === Sources modal (refresh + completar v2) === */
.cb-modal-quickadd {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 12px 18px 0;
}
.cb-quickadd-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px;
    background: rgba(232,255,71,0.06);
    border: 0.5px solid rgba(232,255,71,0.2);
    border-radius: 8px;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.15s;
}
.cb-quickadd-btn:hover { background: rgba(232,255,71,0.12); border-color: rgba(232,255,71,0.4); transform: translateY(-1px); }
.cb-qa-icon { font-size: 20px; }
.cb-qa-name { font-size: 10.5px; font-weight: 600; color: #e8ff47; }
.cb-modal-search { padding: 14px 18px 8px; }
.cb-modal-search input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 0.5px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 9px 12px;
    color: #e5e7eb;
    font-size: 13px;
    outline: none;
}
.cb-modal-search input:focus { border-color: rgba(232,255,71,0.4); }
.cb-modal-results { padding: 0 18px 18px; max-height: 400px; overflow-y: auto; }
.cb-modal-hint { font-size: 11px; color: #71717a; padding: 12px 0; text-align: center; font-style: italic; }
.cb-modal-err { color: #f87171 !important; font-style: normal; }
.cb-result-section { margin-bottom: 10px; }
.cb-result-section-label {
    font-size: 9px;
    color: #71717a;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 8px 4px 4px;
    font-weight: 600;
}
.cb-result-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    background: rgba(255,255,255,0.025);
    border: 0.5px solid rgba(255,255,255,0.05);
    border-radius: 7px;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    text-align: left;
    margin-bottom: 4px;
}
.cb-result-item:hover { background: rgba(232,255,71,0.06); border-color: rgba(232,255,71,0.2); }
.cb-result-item:disabled { opacity: 0.5; cursor: not-allowed; }
.cb-result-added { background: rgba(34,197,94,0.08) !important; border-color: rgba(34,197,94,0.3) !important; }
.cb-result-body { flex: 1; min-width: 0; }
.cb-result-title {
    font-size: 12px;
    color: #e5e7eb;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cb-result-meta { font-size: 10px; color: #71717a; }
.cb-result-add {
    color: #e8ff47;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
.cb-modal-x {
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
}
.cb-modal-x:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
.cb-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cb-modal-title span { font-size: 18px; }

.cb-pdf-dropzone-hint { color: rgba(255,255,255,0.4); font-size: 11px; }
.cb-pdf-err { color: #ef4444; }
.cb-pdf-warn { color: #f59e0b; font-size: 11px; }
.cb-pdf-ok { color: #4ade80; }
.cb-pdf-meta { font-size: 11px; color: rgba(255,255,255,0.5); }
.cb-nota-opt { color: rgba(255,255,255,0.3); font-weight: 400; }

/* === Mobile overlay === */
.cb-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99998;
    backdrop-filter: blur(2px);
}
.cb-mobile-overlay.cb-mobile-show { display: block; }

/* === Responsive === */
@media (max-width: 900px) {
    .cb-wrap-v2 {
        grid-template-columns: 1fr !important;
    }
    .cb-panel-sources, .cb-panel-studio {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 84vw;
        max-width: 320px;
        z-index: 99999;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .cb-panel-studio { left: auto; right: 0; transform: translateX(100%); }
    .cb-panel-sources.cb-mobile-open, .cb-panel-studio.cb-mobile-open { transform: translateX(0); }
    .cb-mobile-open, .cb-mobile-close { display: inline-flex; }
}

/* [CEREBRO-LAYOUT-V2-END] */

/* [CEREBRO-C15-CSS-START] · Sprint C1.5 polish */

/* Fix B: defensa contra leaks visuales de elementos del Studio
   filtrándose al panel Fuentes */
.cb-panel-sources .cb-studio-card,
.cb-panel-sources .cb-studio-grid,
.cb-panel-sources .cb-studio-section,
.cb-panel-sources .cb-convs-section {
    display: none !important;
}
.cb-panel-sources {
    overflow-x: hidden;
    contain: layout style;
}

/* Fix C: input universal en empty state inicial */
.cb-empty-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 28px;
    max-width: 680px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 8px 10px 8px 14px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.cb-empty-input-row:focus-within {
    border-color: rgba(232, 255, 71, 0.45);
    background: rgba(232, 255, 71, 0.04);
    box-shadow: 0 0 0 3px rgba(232, 255, 71, 0.08);
}
.cb-empty-input-row textarea {
    flex: 1;
    background: transparent;
    border: 0;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    padding: 8px 0;
    min-height: 28px;
    max-height: 200px;
    overflow-y: auto;
}
.cb-empty-input-row textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.cb-empty-input-row textarea:disabled {
    opacity: 0.5;
}
.cb-empty-input-row .cb-empty-send {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #e8ff47;
    color: #000;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
    flex-shrink: 0;
}
.cb-empty-input-row .cb-empty-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(232, 255, 71, 0.25);
}
.cb-empty-input-row .cb-empty-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.cb-empty-input-hint {
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.32);
    text-align: center;
    letter-spacing: 0.02em;
}

/* [CEREBRO-C15-CSS-END] */
/* [CEREBRO-C2-CSS-START] · Sprint C2 · Studio backend rendering */

/* ── Spinner loading durante generación studio ─────────────── */
.cb-studio-loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}
.cb-studio-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: #e8ff47;
    border-radius: 50%;
    animation: cb-spin 0.7s linear infinite;
}
@keyframes cb-spin { to { transform: translateY(-50%) rotate(360deg); } }

.cb-studio-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: #e8ff47;
    border-radius: 50%;
    animation: cb-spin-plain 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}
@keyframes cb-spin-plain { to { transform: rotate(360deg); } }

.cb-studio-loading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* ── Badge "Studio · X" sobre el mensaje ───────────────────── */
.cb-studio-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    background: rgba(232, 255, 71, 0.1);
    border: 1px solid rgba(232, 255, 71, 0.25);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #e8ff47;
    margin-bottom: 8px;
    width: fit-content;
}
.cb-studio-badge-icon {
    font-size: 13px;
    line-height: 1;
}

/* ── Bubble del mensaje studio ─────────────────────────────── */
.cb-msg-bubble-studio {
    background: linear-gradient(180deg, rgba(232, 255, 71, 0.04), rgba(232, 255, 71, 0.01));
    border: 1px solid rgba(232, 255, 71, 0.15);
}

/* ── Render MAPA mental ────────────────────────────────────── */
.cb-studio-mapa-wrap {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin: 4px 0;
    overflow-x: auto;
}
.cb-studio-mapa-wrap svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 800px;
    margin: 0 auto;
}

/* ── Render TARJETAS (flip cards) ──────────────────────────── */
.cb-studio-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 8px 0;
}
.cb-flip-card {
    perspective: 1200px;
    height: 180px;
    cursor: pointer;
    outline: none;
}
.cb-flip-card:focus-visible .cb-flip-card-inner {
    box-shadow: 0 0 0 2px #e8ff47;
}
.cb-flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.55s cubic-bezier(.4, 0, .2, 1);
    transform-style: preserve-3d;
    border-radius: 12px;
}
.cb-flip-card.cb-flipped .cb-flip-card-inner {
    transform: rotateY(180deg);
}
.cb-flip-card-front,
.cb-flip-card-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.cb-flip-card-front {
    background: linear-gradient(135deg, #1a1a1c, #25252a);
    color: #fff;
}
.cb-flip-card-back {
    background: linear-gradient(135deg, #e8ff47, #d4eb3a);
    color: #0c0c0e;
    transform: rotateY(180deg);
}
.cb-flip-card-num {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 10px;
    font-weight: 700;
    opacity: 0.5;
    letter-spacing: 0.05em;
}
.cb-flip-card-q {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}
.cb-flip-card-hint {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: auto;
}
.cb-flip-card-a {
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
}

/* ── Render CUESTIONARIO (quiz interactivo) ────────────────── */
.cb-studio-quiz {
    margin: 8px 0;
}
.cb-quiz-q {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.cb-quiz-q-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.cb-quiz-q-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: rgba(232, 255, 71, 0.12);
    border: 1px solid rgba(232, 255, 71, 0.3);
    border-radius: 50%;
    color: #e8ff47;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cb-quiz-q-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
}
.cb-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cb-quiz-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    color: #ddd;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}
.cb-quiz-opt:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.18);
}
.cb-quiz-opt:disabled {
    cursor: default;
    opacity: 0.7;
}
.cb-quiz-opt-letter {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
}
.cb-quiz-opt-text {
    flex: 1;
    line-height: 1.4;
}
.cb-quiz-opt-correct {
    background: rgba(80, 200, 120, 0.12) !important;
    border-color: rgba(80, 200, 120, 0.4) !important;
    color: #7be6a6 !important;
}
.cb-quiz-opt-correct .cb-quiz-opt-letter {
    background: rgba(80, 200, 120, 0.3);
    color: #7be6a6;
}
.cb-quiz-opt-correct::after {
    content: '✓';
    margin-left: auto;
    font-weight: 800;
    color: #7be6a6;
}
.cb-quiz-opt-wrong {
    background: rgba(255, 80, 80, 0.1) !important;
    border-color: rgba(255, 80, 80, 0.3) !important;
    color: #ff8a8a !important;
}
.cb-quiz-opt-wrong .cb-quiz-opt-letter {
    background: rgba(255, 80, 80, 0.25);
    color: #ff8a8a;
}
.cb-quiz-opt-wrong::after {
    content: '✗';
    margin-left: auto;
    font-weight: 800;
    color: #ff8a8a;
}
.cb-quiz-explicacion {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(232, 255, 71, 0.05);
    border-left: 3px solid rgba(232, 255, 71, 0.5);
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
}
.cb-quiz-result {
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(232, 255, 71, 0.12), rgba(232, 255, 71, 0.04));
    border: 1px solid rgba(232, 255, 71, 0.35);
    border-radius: 10px;
    text-align: center;
}
.cb-quiz-result-inner {
    font-size: 18px;
    font-weight: 700;
    color: #e8ff47;
}

/* ── Errores y retry ───────────────────────────────────────── */
.cb-studio-error {
    padding: 14px 16px;
    background: rgba(255, 80, 80, 0.08);
    border: 1px solid rgba(255, 80, 80, 0.25);
    border-radius: 10px;
    color: #ff8a8a;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cb-studio-retry {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.cb-studio-retry:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* [CEREBRO-C2-CSS-END] */

/* ════════════════════════════════════════════════════════════════
   [CRM-CEREBRO-SEARCH-V1-CSS] · Buscador premium de chats Cerebro
   ════════════════════════════════════════════════════════════════ */

.cb-search-container {
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.08));
    position: sticky;
    top: 0;
    z-index: 12;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cb-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    padding: 0 10px;
    height: 36px;
    gap: 8px;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.cb-search-bar:focus-within {
    border-color: rgba(232,255,71,0.55);
    background: rgba(232,255,71,0.04);
    box-shadow: 0 0 0 3px rgba(232,255,71,0.10);
}

.cb-search-icon {
    color: rgba(255,255,255,0.42);
    flex-shrink: 0;
    transition: color .15s ease;
}
.cb-search-bar:focus-within .cb-search-icon { color: #e8ff47; }

.cb-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    padding: 0;
    outline: none;
    font-family: inherit;
    min-width: 0;
}
.cb-search-bar input::placeholder { color: rgba(255,255,255,0.32); }

.cb-search-clear {
    background: rgba(255,255,255,0.06);
    border: none;
    color: rgba(255,255,255,0.6);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s ease;
}
.cb-search-clear:hover { background: rgba(255,255,255,0.14); color: #fff; }

.cb-search-kbd {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    transition: opacity .15s ease, transform .15s ease;
}
.cb-search-bar:focus-within .cb-search-kbd {
    opacity: 0;
    transform: scale(0.8);
}

.cb-search-filters {
    display: flex;
    gap: 5px;
    margin-top: 9px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.cb-search-filters::-webkit-scrollbar { display: none; }

.cb-filter-chip {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.55);
    border-radius: 18px;
    padding: 4px 11px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all .14s ease;
    flex-shrink: 0;
    font-family: inherit;
}
.cb-filter-chip:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.88);
    border-color: rgba(255,255,255,0.1);
}
.cb-filter-chip.active {
    background: rgba(232,255,71,0.12);
    border-color: rgba(232,255,71,0.40);
    color: #e8ff47;
    font-weight: 600;
}

/* Card de resultado de búsqueda (más rica) */
.cb-conv-result {
    padding: 11px 12px !important;
}
.cb-conv-snippet {
    font-size: 11.5px;
    color: rgba(255,255,255,0.5);
    margin-top: 5px;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-style: italic;
}
.cb-conv-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
    font-size: 10.5px;
    color: rgba(255,255,255,0.4);
    flex-wrap: wrap;
}
.cb-conv-time { font-weight: 500; color: rgba(255,255,255,0.55); }
.cb-conv-msgs { color: rgba(255,255,255,0.32); }

.cb-conv-badge {
    padding: 1.5px 7px;
    border-radius: 11px;
    background: rgba(255,255,255,0.05);
    font-size: 9.5px;
    color: rgba(255,255,255,0.55);
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.35;
    white-space: nowrap;
}
.cb-conv-badge.fuentes { background: rgba(232,255,71,0.10); color: #e8ff47; }
.cb-conv-badge.tokens  { background: rgba(99,102,241,0.10); color: #a5b4fc; }
.cb-conv-badge.role-user { background: rgba(16,185,129,0.10); color: #6ee7b7; }
.cb-conv-badge.role-ai   { background: rgba(168,85,247,0.10); color: #d8b4fe; }

/* Highlight de match */
mark.cb-mark {
    background: rgba(232,255,71,0.35);
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(232,255,71,0.4);
}

/* Empty state buscador */
.cb-search-empty {
    padding: 36px 20px;
    text-align: center;
    color: rgba(255,255,255,0.4);
}
.cb-search-empty-icon { font-size: 28px; opacity: 0.5; margin-bottom: 10px; }
.cb-search-empty-title { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.75); margin-bottom: 4px; }
.cb-search-empty-msg { font-size: 11.5px; color: rgba(255,255,255,0.42); }

/* Loading state */
.cb-list-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity .12s ease;
}
.cb-list-loading::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e8ff47, transparent);
    animation: cb-loading-bar 1.2s infinite;
    z-index: 100;
}
@keyframes cb-loading-bar {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ════════════════ /[CRM-CEREBRO-SEARCH-V1-CSS] ════════════════ */

/* ═══ [CRM-CEREBRO-SEARCH-V2-CSS] · patch v2 ═══ */
.cb-search-results-list {
    padding: 4px 0;
    position: relative;
}
.cb-search-results-list .cb-conv-item {
    margin: 1px 6px;
}
/* ═══ /[CRM-CEREBRO-SEARCH-V2-CSS] ═══ */
