/* ═══════════════════════════════════════════════════════
   CREDENTIALS MODULE
═══════════════════════════════════════════════════════ */
.cred-form-panel                    { margin-bottom: 20px; animation: slideDown 0.22s ease; }
@keyframes slideDown                { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.cred-form-inner                    { border-radius: 14px; padding: 28px 32px 24px; max-width: 640px; }
.cred-form-header                   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.cred-form-title                    { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: var(--text-main); }
.cred-form-title i                  { width: 16px; height: 16px; color: var(--accent); }
.cred-form-close                    { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 4px; border-radius: 6px; transition: color 0.15s, background 0.15s; }
.cred-form-close:hover              { color: var(--text-main); background: var(--glass-hover); }
.cred-form-close i                  { width: 16px; height: 16px; display: block; }

/* Provider selector */
.cred-provider-row                  { display: flex; gap: 10px; margin-bottom: 22px; }
.cred-provider-btn                  { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--glass-bg); cursor: pointer; color: var(--text-dim); transition: all 0.18s; font-family: var(--font-main); font-size: 14px; font-weight: 500; }
.cred-provider-btn:hover            { border-color: var(--accent); color: var(--text-main); background: var(--accent-soft); }
.cred-provider-btn.active           { border-color: var(--accent); background: var(--accent-soft); color: var(--text-main); box-shadow: 0 0 0 1px var(--accent); }
.cred-provider-icon                 { font-size: 20px; line-height: 1; }
.cred-icon-openai                   { color: #10a37f; }
.cred-icon-azure                    { color: #0089d6; }
.cred-provider-label                { font-weight: 600; }

/* Fields */
.cred-fields                        { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.cred-input                         { width: 100%; }
.cred-field-hint                    { font-size: 11px; color: var(--text-dim); margin-left: 8px; display: inline-flex; align-items: center; gap: 3px; }
.cred-field-hint i                  { width: 10px; height: 10px; }

/* ── Catálogo de Modelos IA ── */
.cred-catalog-section {
    margin-top: 40px;
}
.cred-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.cred-catalog-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.95rem; font-weight: 600;
    color: var(--text-main); margin: 0 0 4px;
}
.cred-catalog-title svg { width: 15px; height: 15px; color: var(--accent); }
.cred-catalog-subtitle { font-size: 0.78rem; color: var(--text-faint); margin: 0; }
.cred-catalog-body { display: flex; flex-direction: column; gap: 6px; }
.cred-catalog-loading { color: var(--text-faint); font-size: 0.85rem; padding: 12px 0; }
.cred-catalog-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.025);
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
    overflow: hidden;
}
.cred-catalog-row::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.cred-catalog-row:hover {
    background: rgba(124, 77, 255, 0.07);
    border-color: rgba(124, 77, 255, 0.3);
    box-shadow: 0 2px 16px rgba(0,0,0,0.28), 0 0 0 1px rgba(124,77,255,0.12);
    transform: translateY(-1px);
}
.cred-catalog-row:hover::before { opacity: 1; }
.cred-catalog-model-info {
    display: flex; align-items: center; gap: 12px;
    flex: 1; min-width: 0;
}
.cred-catalog-provider-icon {
    font-size: 1.1rem;
    color: var(--accent);
    flex-shrink: 0;
    width: 22px; text-align: center;
}
.cred-catalog-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-main);
    display: block;
}
.cred-catalog-model-id {
    font-size: 0.7rem;
    color: var(--text-faint);
    font-family: var(--font-mono);
    display: block;
    margin-top: 1px;
}
.cred-catalog-prices {
    display: flex; gap: 20px; flex-shrink: 0;
}
.cred-catalog-price {
    display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.cred-catalog-price-label {
    font-size: 0.62rem; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-faint); font-weight: 600;
}
.cred-catalog-price-val {
    font-size: 0.92rem; font-weight: 700;
    color: #b8aaff;
    font-family: system-ui, -apple-system, sans-serif;
}
.cred-catalog-price-val-out { color: #ffd740; }
.cred-catalog-price-unit {
    font-size: 0.62rem; color: var(--text-faint);
    font-weight: 400; margin-left: 1px;
}
.cred-catalog-edit-btn {
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 6px 12px;
    gap: 5px;
    border-color: rgba(255,255,255,0.1);
}
.cred-catalog-edit-btn svg { width: 12px; height: 12px; }
.cred-catalog-edit-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Pricing update modal */
.cred-pricing-modal-inner { max-width: 380px; }
.cred-pricing-model-id {
    font-size: 0.72rem; font-family: var(--font-mono);
    color: var(--text-faint); margin: -10px 0 18px;
    padding: 0 2px;
}
.cred-pricing-fields { display: flex; flex-direction: column; gap: 14px; }

/* Model pricing hint below select */
.model-pricing-hint {
    display: flex;
    align-items: stretch;
    gap: 1px;
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}
.mph-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 9px 14px 8px;
    gap: 3px;
    background: rgba(255,255,255,0.03);
}
.mph-item:first-child { background: rgba(124,106,255,0.08); }
.mph-item:last-child  { background: rgba(255,215,64,0.06); }
.mph-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    font-weight: 700;
}
.mph-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: #b8aaff;
    letter-spacing: -0.02em;
    line-height: 1;
    font-family: system-ui, -apple-system, sans-serif;
}
.mph-val-out { color: #ffd740; }
.mph-unit {
    font-size: 0.62rem;
    color: var(--text-faint);
    font-weight: 500;
    letter-spacing: 0.02em;
}
.mph-sep { display: none; }

/* Key reveal */
.cred-key-wrap                      { display: flex; align-items: center; gap: 0; position: relative; }
.cred-key-input                     { flex: 1; border-radius: 8px 0 0 8px !important; border-right: none !important; }
.cred-reveal-btn                    { height: 40px; width: 42px; display: flex; align-items: center; justify-content: center; background: var(--glass-bg); border: 1px solid var(--glass-border); border-left: none; border-radius: 0 8px 8px 0; cursor: pointer; color: var(--text-dim); transition: all 0.15s; user-select: none; -webkit-user-select: none; }
.cred-reveal-btn:hover              { color: var(--text-main); background: var(--glass-hover); }
.cred-reveal-btn.active             { color: var(--accent); background: var(--accent-soft); }
.cred-reveal-btn i                  { width: 15px; height: 15px; pointer-events: none; }
.cred-key-hint                      { font-size: 11px; color: var(--text-faint); margin-top: 5px; display: block; }

/* Verify status */
.cred-verify-status                 { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 18px; }
.cred-verify-status i               { width: 16px; height: 16px; flex-shrink: 0; }
.cred-verify-status.verifying       { background: rgba(124,77,255,0.08); border: 1px solid rgba(124,77,255,0.2); color: var(--text-dim); }
.cred-verify-status.success         { background: rgba(0,230,118,0.07); border: 1px solid rgba(0,230,118,0.2); color: #00e676; }
.cred-verify-status.error           { background: rgba(255,82,82,0.07); border: 1px solid rgba(255,82,82,0.2); color: #ff5252; }
@keyframes credSpin                 { to { transform: rotate(360deg); } }
.cred-verify-spin                   { animation: credSpin 0.8s linear infinite; }

/* Form footer */
.cred-form-footer                   { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.cred-save-btn                      { min-width: 170px; justify-content: center; }
.cred-save-btn:disabled             { opacity: 0.6; cursor: not-allowed; }

/* Table */
.cred-table-wrap                    { border-radius: 14px; overflow: hidden; }
.cred-table                         { width: 100%; border-collapse: separate; border-spacing: 0; }
.cred-table th                      { padding: 11px 20px; }
.cred-table td                      { padding: 16px 20px; }
.cred-table tbody tr {
    position: relative;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cred-table tbody tr:last-child     { border-bottom: none; }
.cred-table tbody tr:hover {
    background: rgba(124, 77, 255, 0.06);
    box-shadow: inset 3px 0 0 var(--accent);
}
.cred-table tbody tr:hover .cred-name-text  { color: #fff; }
.cred-name-cell                     { font-weight: 500; }
.cred-name-text                     { font-family: var(--font-mono); font-size: 13px; color: var(--text-main); transition: color 0.2s; font-weight: 600; letter-spacing: 0.01em; }
.cred-date                          { font-size: 12.5px; color: var(--text-dim); }
.cred-actions                       { text-align: right; width: 80px; }
.cred-delete-btn                    { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 6px; border-radius: 6px; transition: color 0.15s, background 0.15s; }
.cred-delete-btn:hover              { color: var(--error); background: rgba(255,82,82,0.1); }
.cred-delete-btn i                  { width: 14px; height: 14px; display: block; }
.cred-chatbot-badge                 { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #22c55e; background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
.cred-jobs-badge                    { color: #22c55e; background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.3); }
.cred-chatbot-btn                   { font-size: 11px; font-weight: 500; color: var(--text-faint); background: none; border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; cursor: pointer; white-space: nowrap; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.cred-chatbot-btn:hover             { color: #22c55e; border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.08); }

/* Provider badges in table */
.cred-type-badge                    { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.cred-type-openai                   { background: rgba(16,163,127,0.1); color: #10a37f; border: 1px solid rgba(16,163,127,0.2); }
.cred-type-azure                    { background: rgba(0,137,214,0.1); color: #0089d6; border: 1px solid rgba(0,137,214,0.2); }
.cred-type-default                  { background: var(--glass-bg); color: var(--text-dim); border: 1px solid var(--glass-border); }

/* Status badges in table */
.cred-status-badge                  { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.cred-status-badge i                { width: 12px; height: 12px; }
.cred-status-badge.verified         { background: rgba(0,230,118,0.08); color: #00e676; border: 1px solid rgba(0,230,118,0.2); }
.cred-status-badge.unverified       { background: rgba(255,82,82,0.08); color: #ff5252; border: 1px solid rgba(255,82,82,0.2); }

/* Empty state */
.cred-empty-row td                  { padding: 40px 16px !important; }
.cred-empty-state                   { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-faint); }
.cred-empty-state i                 { width: 32px; height: 32px; opacity: 0.3; }
.cred-empty-state p                 { text-align: center; font-size: 13.5px; line-height: 1.6; }
.cred-empty-state strong            { color: var(--text-dim); }

/* Credential rename inline */
.cred-rename-input              { width: 100%; padding: 4px 8px; font-size: 13px; font-family: var(--font-mono); }
.cred-rename-btn                { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 6px; border-radius: 6px; transition: color 0.15s, background 0.15s; }
.cred-rename-btn:hover          { color: var(--accent); background: var(--accent-soft); }
.cred-rename-btn i,
.cred-confirm-btn i             { width: 14px; height: 14px; display: block; }
.cred-confirm-btn               { background: none; border: none; color: var(--success); cursor: pointer; padding: 6px; border-radius: 6px; transition: background 0.15s; }
.cred-confirm-btn:hover         { background: rgba(0,230,118,0.1); }
.cred-actions                   { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

/* Credential edit modal */
.cred-edit-overlay              { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn 0.15s ease; }
@keyframes fadeIn               { from { opacity: 0; } to { opacity: 1; } }
.cred-edit-modal                { width: 100%; max-width: 480px; border-radius: 16px; padding: 28px 32px 24px; animation: slideDown 0.2s ease; }
.cred-edit-header               { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cred-edit-title                { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: var(--text-main); }
.cred-edit-title i              { width: 16px; height: 16px; color: var(--accent); }
.cred-edit-provider-tag         { margin-bottom: 20px; }
.cred-edit-btn                  { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 6px; border-radius: 6px; transition: color 0.15s, background 0.15s; }
.cred-edit-btn:hover            { color: var(--accent); background: var(--accent-soft); }
.cred-edit-btn i                { width: 14px; height: 14px; display: block; }

/* ── Chatbot FAB — Propuesta 2: Círculo animado premium ── */
.chatbot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #9b6dff, var(--accent, #7c4dff) 70%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    border: none;
    box-shadow: 0 4px 20px rgba(124, 77, 255, 0.35);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    /* Outer ring via pseudo-element */
}
body.cookie-banner-active .chatbot-fab {
    bottom: 80px;
}
.chatbot-fab::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(124, 77, 255, 0.4);
    animation: fab-pulse 2.5s ease-in-out infinite;
}
.chatbot-fab::after {
    content: none;
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    transform: translateY(-50%);
    left: auto;
    bottom: auto;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(13, 13, 20, 0.95);
    border: 1px solid rgba(124, 77, 255, 0.3);
    color: #c4b5fd;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.03em;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-50%) translateX(4px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.chatbot-fab:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.chatbot-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(124, 77, 255, 0.5);
}
.chatbot-fab:hover::before {
    animation: none;
    border-color: rgba(124, 77, 255, 0.7);
}
.chatbot-fab i { width: 24px; height: 24px; }

/* ── FAB Recommendation Prompt (hover opt-in) ── */
.fab-rec-prompt {
    position: fixed;
    bottom: 33px;
    right: 94px;
    background: rgba(91, 33, 182, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(124, 77, 255, 0.35);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    white-space: nowrap;
}
.fab-rec-prompt.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}
.fab-rec-prompt span {
    color: #e6edf3;
    font-size: 0.82rem;
    font-weight: 500;
}
.fab-rec-prompt-actions {
    display: flex;
    gap: 6px;
}
.fab-rec-prompt-yes,
.fab-rec-prompt-no {
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.fab-rec-prompt-yes {
    background: #7c3aed;
    color: #fff;
}
.fab-rec-prompt-yes:hover {
    background: #6d28d9;
}
.fab-rec-prompt-no {
    background: rgba(255, 255, 255, 0.1);
    color: #8b949e;
}
.fab-rec-prompt-no:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e6edf3;
}

/* ── FAB Badge numérico (insights pendientes) ── */
.fab-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 20px; height: 20px;
    border-radius: 10px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: none;          /* se muestra vía JS */
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(239,68,68,0.5);
    animation: badge-pop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
    z-index: 2;
}
.fab-badge.visible { display: flex; }
@keyframes badge-pop {
    0%   { transform: scale(0); }
    100% { transform: scale(1); }
}

/* ── Panel de Insights (Agente de Conocimiento) ── */
.fab-insight-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 700px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: linear-gradient(145deg, rgba(8, 6, 18, 0.92) 0%, rgba(16, 10, 32, 0.92) 100%);
    border: 1px solid rgba(140, 100, 255, 0.5);
    border-radius: 16px;
    padding: 14px 36px 16px 16px;
    color: #ede8f5;
    font-size: 13px;
    line-height: 1.5;
    box-shadow:
        0 0 15px rgba(124, 77, 255, 0.3),
        0 0 40px rgba(124, 77, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 8px 24px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    z-index: 1001;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(124,77,255,0.3) transparent;
}
/* ── Layout 2 columnas: temas (izq) + carrusel (der) ── */
.fab-panel-body {
    display: flex;
    gap: 0;
    align-items: stretch;
}
.fab-panel-left {
    width: 200px;
    min-width: 200px;
    padding-right: 16px;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fab-panel-right {
    flex: 1;
    min-width: 0;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fab-panel-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    z-index: 2;
}
.fab-panel-close:hover {
    background: rgba(124,77,255,0.35);
    border-color: rgba(124,77,255,0.5);
    color: #fff;
}
.fab-panel-close svg { width: 14px; height: 14px; }
.fab-insight-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.fab-panel-section { display: flex; flex-direction: column; gap: 6px; }
.fab-panel-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.fab-panel-label i { color: var(--accent); }

/* ── Topic chips ── */
#fab-panel-topics {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    flex: 1;
    justify-content: space-around;
}
.fab-topic-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    border-left: 2px solid rgba(124, 77, 255, 0.35);
    color: #d6d0f0;
    padding: 5px 8px 5px 10px;
    border-radius: 0;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, color 0.2s;
    font-family: inherit;
    text-align: left;
    width: 100%;
    line-height: 1.4;
}
.fab-topic-chip:hover {
    border-left-color: var(--accent);
    background: rgba(124, 77, 255, 0.1);
    color: #fff;
    transform: translateX(3px);
}
.fab-topic-rank {
    font-size: 10px;
    font-weight: 700;
    color: rgba(124, 77, 255, 0.6);
    font-variant-numeric: tabular-nums;
    min-width: 18px;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    transition: color 0.2s;
}
.fab-topic-chip:hover .fab-topic-rank {
    color: var(--accent);
}
.fab-topic-chip.active {
    border-left-color: var(--accent);
    background: rgba(124, 77, 255, 0.18);
    color: #fff;
    transform: translateX(3px);
}
.fab-topic-chip.active .fab-topic-rank {
    color: var(--accent);
}
.fab-topic-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* ── Carrusel ── */
.fab-carousel { position: relative; }
.fab-carousel-track { position: relative; }
.fab-carousel-slide {
    display: none;
    flex-direction: column;
    gap: 8px;
    animation: fabSlideIn 0.3s ease;
}
.fab-carousel-slide.active { display: flex; }
@keyframes fabSlideIn {
    from { opacity: 0; transform: translateX(6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Card del artículo — magazine cover: imagen full-bleed + texto overlay */
.fab-slide-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.fab-slide-card:hover {
    transform: scale(1.015);
    border-color: rgba(124, 77, 255, 0.4);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 12px rgba(124, 77, 255, 0.15);
}
.fab-slide-media {
    position: relative;
    width: 100%;
    height: 206px;
}
.fab-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.05);
}
.fab-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(8, 6, 18, 0.96) 0%,
        rgba(8, 6, 18, 0.4) 50%,
        transparent 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 12px;
}
.fab-slide-counter {
    align-self: flex-end;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.fab-slide-bottom {
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    position: relative;
    z-index: 4;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: background 0.15s ease;
}
.fab-slide-bottom:hover {
    background: rgba(255, 255, 255, 0.08);
}
.fab-rec-source {
    font-size: 9.5px;
    color: rgba(196, 181, 253, 0.65);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.fab-rec-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #f0ecff;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}


/* Dots — barras segmentadas */
.fab-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 10px;
}
.fab-carousel-dot {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    padding: 0;
    cursor: default;
    pointer-events: none;
    transition: width 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.fab-carousel-dot.active {
    width: 28px;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.55);
}

/* ── Tap zones de navegación del carrusel ── */
.fab-tap-prev,
.fab-tap-next {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 3;
    display: flex;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.fab-tap-prev {
    left: 0;
    justify-content: flex-start;
    padding-left: 10px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.28), transparent);
}
.fab-tap-next {
    right: 0;
    justify-content: flex-end;
    padding-right: 10px;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.28), transparent);
}
.fab-tap-prev::after {
    content: '‹';
    font-size: 24px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1;
}
.fab-tap-next::after {
    content: '›';
    font-size: 24px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1;
}
.fab-slide-media:hover .fab-tap-prev,
.fab-slide-media:hover .fab-tap-next {
    opacity: 1;
}
.fab-tap-prev[hidden],
.fab-tap-next[hidden] {
    display: none;
}

#fab-panel-generic {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#fab-panel-generic .fab-panel-label {
    text-transform: none;
    font-size: 12.5px;
    color: rgba(255,255,255,0.7);
    line-height: 1.4;
}

/* ── CTA mini para panel genérico (no logueados) ── */
.fab-panel-cta-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 9px 12px;
    background: rgba(124,77,255,0.12);
    border: 1px solid rgba(124,77,255,0.25);
    border-radius: 10px;
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}
.fab-panel-cta-mini:hover {
    background: rgba(124,77,255,0.25);
    border-color: var(--accent);
    color: #fff;
}
.fab-panel-cta-mini i { color: var(--accent); }

/* ── FAB "ideating" — nube de pensamiento (thought bubble) ── */
.chatbot-fab.ideating {
    animation: fab-ideate-glow 3s ease-in-out infinite;
}
.chatbot-fab.ideating::before {
    display: none;
}

/* Speech bubble — sien derecha del bot */
.chatbot-fab.ideating .fab-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    top: -4px;
    right: -6px;
    min-width: 0;
    width: 32px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: linear-gradient(145deg, #5b21b6, #7c4dff);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        0 0 12px rgba(124, 77, 255, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.5);
    animation: fab-bubble-float 3s ease-in-out infinite;
}

/* Speech bubble arrow — sale del bottom-left apuntando al bot */
.chatbot-fab.ideating .fab-badge::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid rgba(255, 255, 255, 0.7);
}
.chatbot-fab.ideating .fab-badge::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 7px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #6d28d9;
    z-index: 1;
}

/* Dots (estado base del ideating) */
.fab-badge .ideate-dot {
    display: none;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c4b5fd;
    animation: fab-dot-bounce 1.4s ease-in-out infinite;
}
.chatbot-fab.ideating .fab-badge .ideate-dot { display: block; }
.fab-badge .ideate-dot:nth-child(2) { animation-delay: 0.2s; }
.fab-badge .ideate-dot:nth-child(3) { animation-delay: 0.4s; }

/* Modo icono (cada 20s muestra un símbolo) */
.chatbot-fab.ideating .fab-badge.ideate-icon-mode {
    animation: fab-bubble-float 3s ease-in-out infinite, fab-icon-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.chatbot-fab.ideating .fab-badge.ideate-icon-mode svg {
    width: 14px;
    height: 14px;
    color: #c4b5fd;
    filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.5));
}

@keyframes fab-dot-bounce {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40%           { opacity: 1;   transform: scale(1.3); }
}
@keyframes fab-bubble-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}
@keyframes fab-icon-pop {
    0%   { transform: translateY(0) scale(0.6); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes fab-ideate-glow {
    0%, 100% { box-shadow: 0 4px 20px rgba(124, 77, 255, 0.35); }
    50%      { box-shadow: 0 4px 30px rgba(124, 77, 255, 0.6), 0 0 15px rgba(167, 139, 250, 0.3); }
}
@keyframes fab-ideate-orbit {
    0%   { transform: scale(1.15) rotate(0deg); }
    100% { transform: scale(1.15) rotate(360deg); }
}

/* ── FAB "thinking" pulse — más rápido que el idle ── */
.chatbot-fab.thinking::before {
    animation: fab-think-pulse 1.4s ease-in-out infinite;
    border-color: rgba(124, 77, 255, 0.6);
}
@keyframes fab-think-pulse {
    0%, 100% { transform: scale(1);   opacity: 0.6; }
    50%      { transform: scale(1.3); opacity: 0; }
}

@keyframes fab-pulse {
    0%   { transform: scale(1) rotate(0deg); opacity: 0; }
    30%  { opacity: 0.5; }
    50%  { transform: scale(1.25) rotate(180deg); opacity: 0.55; box-shadow: 0 0 12px 3px rgba(124, 77, 255, 0.3); }
    100% { transform: scale(1.4) rotate(360deg); opacity: 0; box-shadow: 0 0 0 rgba(124, 77, 255, 0); }
}

.chat-sidebar {
    position: fixed;
    top: 0;
    right: -31.5vw;
    width: 31.5vw;
    min-width: 380px;
    height: calc(100vh - 36px);
    background: #0e0e12; /* Solid Premium Dark */
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-sidebar.active { right: 0; }

/* ── Chatbot: Mobile responsive ── */
@media (max-width: 767px) {
    .chat-sidebar {
        width: 100vw;
        right: -100vw;
        height: 100vh;
        height: 100dvh;
        border-left: none;
    }
    .chat-sidebar.active { right: 0; }
    .chat-header { padding: 16px; }
    .chat-messages { padding: 16px; }
    .chat-input-area { padding: 16px; }
}

.chat-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}
.chat-title i { color: var(--accent); font-size: 1.4rem; }

/* ── Mini-FAB animado en header del chat ── */
.chat-header-fab {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #9b6dff, #7c4dff 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.chat-header-fab i,
.chat-header-fab svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.chat-header-fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(124, 77, 255, 0.4);
    animation: fab-pulse 2.5s ease-in-out infinite;
}

.chat-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    transition: color 0.2s;
}
.chat-close:hover { color: var(--error); }

.chat-messages-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.message-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}
.message-user {
    align-self: flex-end;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

/* ── Markdown dentro de burbujas del bot ── */
.message-bot.markdown-body { max-width: 92%; }
.message-bot.markdown-body p { margin: 0 0 1.4em; line-height: 1.75; }
.message-bot.markdown-body p:last-child { margin-bottom: 0; }
.message-bot.markdown-body strong { color: #c4b5fd; font-weight: 700; }
/* Streaming cursor — blinking caret while LLM generates */
.message-bot.streaming::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent, #7c3aed);
    margin-left: 2px;
    animation: streamCursorBlink 0.7s infinite;
    vertical-align: text-bottom;
}
@keyframes streamCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.message-bot.markdown-body em { color: rgba(255,255,255,0.7); font-style: italic; }
.message-bot.markdown-body h1,
.message-bot.markdown-body h2,
.message-bot.markdown-body h3 {
    color: var(--accent);
    font-weight: 700;
    margin: 0.9em 0 0.35em;
    line-height: 1.3;
}
.message-bot.markdown-body h1 { font-size: 1.05rem; }
.message-bot.markdown-body h2 { font-size: 0.98rem; }
.message-bot.markdown-body h3 { font-size: 0.92rem; color: #a78bfa; }
.message-bot.markdown-body ul,
.message-bot.markdown-body ol {
    margin: 0.5em 0 1em 1.2em;
    padding: 0;
}
.message-bot.markdown-body li {
    margin-bottom: 1.2em;
    line-height: 1.75;
    padding-bottom: 0.5em;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.message-bot.markdown-body li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.message-bot.markdown-body hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.8em 0;
}
.message-bot.markdown-body code {
    background: rgba(124,77,255,0.15);
    border: 1px solid rgba(124,77,255,0.25);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', monospace;
    color: #c4b5fd;
}
/* Referencias inline tipo [[1]](url) */
.message-bot.markdown-body a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.72em;
    vertical-align: baseline;
    line-height: 1;
    font-weight: 700;
    background: rgba(124,77,255,0.12);
    border: 1px solid rgba(124,77,255,0.30);
    border-radius: 4px;
    padding: 2px 5px;
    margin: 0 1px;
    transition: background 0.15s;
    white-space: nowrap;
    position: relative;
    top: -1px;
}
.message-bot.markdown-body a:hover {
    background: rgba(124,77,255,0.28);
    color: #c4b5fd;
}
.message-bot.markdown-body blockquote {
    border-left: 3px solid var(--accent);
    margin: 0.5em 0;
    padding: 0.3em 0.8em;
    background: rgba(124,77,255,0.06);
    border-radius: 0 6px 6px 0;
    color: rgba(255,255,255,0.7);
    font-style: italic;
}

.chat-input-area {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

/* Botón toggle de filtros (solo visible tras primera pregunta) */
.chat-filters-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(124, 77, 255, 0.08);
    border: 1px solid rgba(124, 77, 255, 0.15);
    border-radius: 10px;
    color: #c4b5fd;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-filters-toggle i {
    width: 16px;
    height: 16px;
}

.chat-filters-toggle .toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.chat-filters-toggle:hover {
    background: rgba(124, 77, 255, 0.12);
    border-color: rgba(124, 77, 255, 0.3);
}

.chat-filters-toggle:not(.collapsed) .toggle-icon {
    transform: rotate(180deg);
}

/* Sección expandible (filtros + quick queries) */
.chat-expandable-section {
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-context-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.chat-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-control-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
}

.chat-control-group .input-glass {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-suggestions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.chat-suggestion-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(124, 77, 255, 0.08);
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: 12px;
    color: #c4b5fd;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.chat-suggestion-btn i {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

/* ─── Chat Insights Bar ─────────────────────────────────────────── */
.chat-insights-bar {
    background: var(--surface, #0e1117);
    padding: 8px 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
    transition: max-height 200ms ease-in-out, opacity 200ms ease-in-out, padding 200ms ease-in-out;
}
.chat-insights-bar.insights-hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.chat-insights-bar.insights-reappearing {
    border-left: 2px solid var(--accent, #7c3aed);
}
.insights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.insights-label {
    color: #475569;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.insights-timer {
    display: flex;
    align-items: center;
    gap: 4px;
}
.insights-timer-bar {
    width: 36px;
    height: 3px;
    background: #1e2337;
    border-radius: 2px;
    overflow: hidden;
}
.insights-timer-fill {
    height: 100%;
    background: #6366f1;
    border-radius: 2px;
    width: 100%;
}
.insights-timer-count {
    color: #334155;
    font-size: 0.7rem;
}
.insights-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.insight-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid;
    background: transparent;
    transition: border-color 150ms, color 150ms, opacity 150ms;
    font-family: inherit;
}
.insight-chip--news {
    color: #60a5fa;
    background: #0f1e30;
    border-color: #1e3a5f;
}
.insight-chip--news:hover {
    border-color: #3b82f6;
    color: #93c5fd;
}
.insight-chip--trend {
    color: #4ade80;
    background: #0a1f0e;
    border-color: #14532d;
}
.insight-chip--trend:hover {
    border-color: #22c55e;
    color: #86efac;
}
.insight-chip--used {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.chat-suggestion-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.2);
}

.chat-suggestion-btn:active {
    transform: translateY(0);
}

/* ── Micro-copy para anónimos ── */
.chat-anon-microcopy {
    text-align: center;
    font-size: 0.74rem;
    color: #a78bfa;
    padding: 6px 0 2px;
    font-weight: 500;
}

/* Textarea row */
.chat-textarea-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.chat-textarea {
    flex: 1;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.875rem;
    line-height: 1.4;
    overflow-y: hidden;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s;
}
.chat-send-btn:hover { transform: scale(1.08); }
.chat-send-btn i { width: 18px; height: 18px; }

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px !important;
    background: rgba(124,77,255,0.06) !important;
    border: 1px solid rgba(124,77,255,0.18) !important;
}
.typing-dots { display: flex; gap: 5px; align-items: center; }
.typing-dots span {
    width: 7px; height: 7px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingBounce 1.3s infinite ease-in-out;
    box-shadow: 0 0 6px rgba(124,77,255,0.5);
}
.typing-dots span:nth-child(2) { animation-delay: 0.22s; }
.typing-dots span:nth-child(3) { animation-delay: 0.44s; }
.typing-label {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.03em;
    animation: typingFade 1.6s infinite ease-in-out;
}
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}
@keyframes typingFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Entry animations */
@keyframes msgPop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-message {
    animation: msgPop 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Chat Login Overlay ── */
.chat-login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 14, 0.92);
    backdrop-filter: blur(12px);
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: msgPop 0.25s ease forwards;
}
.chat-login-card {
    background: #16161e;
    border: 1px solid rgba(124, 77, 255, 0.25);
    border-radius: 20px;
    padding: 32px 28px;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.chat-login-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(124, 77, 255, 0.12);
    border: 1px solid rgba(124, 77, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.chat-login-icon i { width: 26px; height: 26px; }
.chat-login-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    text-align: center;
}
.chat-login-desc {
    font-size: 0.875rem;
    color: var(--text-dim);
    text-align: center;
    margin: 0;
    line-height: 1.6;
}
.chat-login-demo-user {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    width: 100%;
}
.chat-login-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.chat-login-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-login-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
.chat-login-user-email {
    font-size: 0.78rem;
    color: var(--text-dim);
}
.chat-login-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.chat-login-btn:hover { background: #6d28d9; transform: translateY(-1px); }
.chat-login-btn i { width: 16px; height: 16px; }
.chat-login-notice {
    font-size: 0.73rem;
    color: var(--text-dim);
    text-align: center;
    margin: 0;
    line-height: 1.5;
    opacity: 0.7;
}
.chat-login-notice a { color: var(--accent); text-decoration: none; }

/* ── Chat Login Hint (debajo del textarea) ── */
.chat-login-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 4px 2px 0;
    opacity: 0.7;
}
.chat-login-hint a { color: var(--accent); text-decoration: none; }
.chat-login-hint a:hover { text-decoration: underline; }

/* ── Chat Session Badge (header) ── */
.chat-session-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(124, 77, 255, 0.12);
    border: 1px solid rgba(124, 77, 255, 0.25);
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
    font-size: 0.75rem;
    color: var(--accent);
}
.chat-session-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-session-name { font-weight: 600; }

/* ── Chat Session Welcome message ── */
.chat-session-welcome {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    background: rgba(124, 77, 255, 0.07);
    border-color: rgba(124, 77, 255, 0.2);
    max-width: 100%;
}
.chat-session-welcome strong { color: var(--accent); }

/* ── Toast temporal de bienvenida (animaciones desde abajo) ── */
@keyframes toastSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.chat-welcome-toast {
    position: relative;
    animation: toastSlideIn 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.chat-welcome-toast.exiting {
    animation: toastSlideOut 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Follow-up Question Chips ── */
.chat-follow-up-strip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: flex-start;
    width: 100%;
    max-width: 92%;
    animation: msgPop 0.3s ease forwards;
}
.chat-follow-up-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-dim);
    padding: 0 2px;
    opacity: 0.7;
}
.chat-follow-up-chip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
    background: rgba(124, 77, 255, 0.06);
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    width: 100%;
}
.chat-follow-up-chip:hover {
    background: rgba(124, 77, 255, 0.14);
    border-color: rgba(124, 77, 255, 0.45);
    transform: translateX(2px);
}
.chat-follow-up-q {
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.4;
}
.chat-follow-up-ctx {
    font-size: 0.72rem;
    color: var(--accent);
    opacity: 0.75;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Cookie Consent Banner (GDPR) ── */
#cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 1rem 1.5rem;
    background: rgba(18, 18, 23, 0.95);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    animation: slideUpConsent 0.3s ease-out;
}
@keyframes slideUpConsent {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.cookie-consent-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
}
.cookie-consent-inner p {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
    white-space: nowrap;
}
.cookie-consent-inner a {
    color: var(--accent);
    text-decoration: underline;
}
.cookie-consent-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.cookie-btn {
    padding: 0.65rem 1.6rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
}
.cookie-btn-accept {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.cookie-btn-accept:hover { filter: brightness(1.15); }
.cookie-btn-reject {
    background: transparent;
    color: var(--text-dim);
}
.cookie-btn-reject:hover { background: var(--glass-hover); color: var(--text-main); }

@media (max-width: 767px) {
    .cookie-consent-inner {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    .cookie-consent-inner p {
        white-space: normal;
        font-size: 0.85rem;
    }
    .cookie-btn {
        padding: 0.55rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* ── Chat: Cited Article Cards ───────────────────────────────── */
.chat-cited-section {
    margin: 10px 0 4px;
}
.chat-cited-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    margin-bottom: 8px;
}
.chat-cited-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent, #8b5cf6);
    box-shadow: 0 0 6px var(--accent, #8b5cf6);
    flex-shrink: 0;
}
.chat-cited-cards {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.chat-cited-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    padding: 8px;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
    animation: citedCardIn 0.35s ease both;
}
.chat-cited-card:hover {
    background: rgba(139,92,246,0.1);
    border-color: rgba(139,92,246,0.3);
    transform: translateX(3px);
}
@keyframes citedCardIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cited-card-img-wrap {
    width: 64px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}
.cited-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cited-card-img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(59,130,246,0.15));
    font-size: 20px;
    font-weight: 700;
    color: rgba(255,255,255,0.45);
}
.cited-card-img-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,rgba(255,255,255,0.04) 25%,rgba(255,255,255,0.09) 50%,rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.cited-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.cited-card-titulo {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(255,255,255,0.82);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cited-card-title-skeleton {
    height: 10px;
    width: 80%;
    border-radius: 4px;
    background: linear-gradient(90deg,rgba(255,255,255,0.04) 25%,rgba(255,255,255,0.09) 50%,rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.cited-card-temas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.cited-card-tema {
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(139,92,246,0.9);
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 4px;
    padding: 1px 5px;
    text-transform: lowercase;
}

/* ── Botón Leídos en feed ── */
.feed-read-history-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 10px;
  color: var(--accent, #7c3aed);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.feed-read-history-btn:hover:not(.disabled) {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.feed-read-history-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.feed-read-count {
  background: var(--accent, #7c3aed);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
}

.feed-read-history-btn.disabled .feed-read-count {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

/* ── Modal Leídos ── */
.read-history-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  overflow-y: auto;
  padding: 32px;
}

.read-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto 24px;
}

.read-history-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.read-history-scope-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent, #7c3aed);
  letter-spacing: 0.3px;
}

.read-history-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #8b949e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.read-history-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.read-history-grid {
  max-width: 1400px;
  margin: 0 auto;
}

/* ── CTA inline post-respuesta (anónimos) ── */
.chat-anon-cta {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.chat-anon-exhausted {
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-top: 8px;
}

.chat-anon-blocked {
    margin-top: 8px;
}

/* ── Job Assistant Split Layout ──────────────────────────────────────────── */
/* El wrapper vive FUERA del job-card para que position:sticky no quede
   dentro de overflow:hidden. El job-card conserva sus estilos originales. */
.job-card-split-wrapper {
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 0;
    align-items: start;
    margin-bottom: 20px; /* reemplaza el margin-bottom del job-card */
}

.job-card-split-wrapper > .job-card {
    margin-bottom: 0; /* el wrapper ya tiene margin */
}

.job-card-split-wrapper > .user-agent-cta-section {
    position: sticky;
    top: 16px;
    align-self: start;
    border-right: 1px solid rgba(139,92,246,0.18);
    padding: 0 16px 16px 0;
    min-height: 300px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

@media (max-width: 900px) {
    .job-card-split-wrapper {
        grid-template-columns: 1fr;
    }
    .job-card-split-wrapper > .user-agent-cta-section {
        border-right: none;
        border-bottom: 1px solid rgba(139,92,246,0.18);
        padding: 0 0 16px 0;
        margin-bottom: 16px;
        position: static;
        max-height: none;
    }
}

/* ── CTA Agente para usuarios normales (General → Guardar → Configurar con IA) ── */

.user-agent-cta-section {
    margin: 0 0 16px;
}
.agent-cta-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.agent-cta-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.agent-cta-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: #a78bfa;
    margin-top: 2px;
}
.agent-cta-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.agent-cta-text strong {
    font-size: 15px;
    color: #e2d9f3;
}
.agent-cta-text span {
    font-size: 12px;
    color: var(--text-muted, rgba(255,255,255,0.5));
    line-height: 1.5;
}
.agent-prev-run {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.agent-prev-summary {
    font-size: 11px;
    color: var(--text-muted, rgba(255,255,255,0.45));
}

/* ── Agente de Configuración Automática de Jobs ────────────────────────────── */

.agent-config-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s, border-color 0.2s;
}
.agent-config-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(99, 102, 241, 0.35));
    border-color: rgba(139, 92, 246, 0.6);
}
.agent-config-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.agent-panel {
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.agent-panel.hidden {
    display: none;
}

.agent-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}
.agent-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.agent-steps-log {
    font-size: 11px;
    color: var(--text-muted, rgba(255,255,255,0.45));
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 8px;
}
.agent-step::before {
    content: '▸ ';
    color: #8b5cf6;
}

.agent-result-row {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.04);
}
.agent-result-row.agent-quality--ok    { color: #86efac; background: rgba(34,197,94,0.08); }
.agent-result-row.agent-quality--low   { color: #fde68a; background: rgba(234,179,8,0.08); }
.agent-result-row.agent-quality--empty { color: #fca5a5; background: rgba(239,68,68,0.08); }

.agent-score-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    margin: 8px 0 6px;
}
.agent-score-badge.score-good {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}
.agent-score-badge.score-mid {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #facc15;
}
.agent-score-badge.score-low {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.agent-summary {
    font-size: 12px;
    color: var(--text-muted, rgba(255,255,255,0.55));
    margin: 6px 0;
    line-height: 1.5;
}

.agent-apply-btn {
    margin-top: 8px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Spinner para ícono de carga en botón del agente */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Agent v2: Repair + Actions + Feedback ─────────────────────────────────── */
.repair-ok  { color: #86efac; font-size: 11px; }
.repair-fail { color: #fca5a5; font-size: 11px; }

.agent-actions-panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(139,92,246,0.2);
}
.agent-actions-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 8px;
}
.agent-action-card {
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.agent-action-card:last-child { margin-bottom: 0; }
.agent-action-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.agent-action-priority {
    font-size: 10px;
    opacity: 0.75;
    text-transform: capitalize;
    white-space: nowrap;
}
.agent-action-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin: 0 0 8px;
    line-height: 1.4;
}
.agent-apply-btn {
    font-size: 11px;
    padding: 3px 10px;
}
.agent-apply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.agent-feedback-panel {
    margin-top: 14px;
    padding: 12px;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 8px;
}
.agent-feedback-label {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    margin: 0 0 6px;
}
.agent-feedback-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    padding: 6px 8px;
    resize: vertical;
    margin-bottom: 8px;
    box-sizing: border-box;
    font-family: inherit;
}
.agent-feedback-input:focus {
    outline: none;
    border-color: rgba(99,102,241,0.5);
    background: rgba(255,255,255,0.08);
}
.agent-feedback-input::placeholder {
    color: rgba(255,255,255,0.3);
}
.spin { animation: spin 1s linear infinite; display: inline-block; }

/* ── Wizard de Configuración v3 ──────────────────────────────────────────── */
.agent-wizard-panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(139,92,246,0.2);
}
.wizard-message {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin: 0 0 10px;
    line-height: 1.5;
}
.wizard-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wizard-choice-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    width: 100%;
    color: inherit;
}
.wizard-choice-card:hover:not(:disabled) {
    background: rgba(139,92,246,0.12);
    border-color: rgba(139,92,246,0.45);
}
.wizard-choice-card:disabled,
.wizard-card--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.wizard-card-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}
.wizard-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wizard-card-label {
    font-size: 13px;
    font-weight: 600;
    color: #e2d9f3;
}
.wizard-card-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    line-height: 1.4;
}
.wizard-card-note {
    font-size: 10px;
    color: rgba(234,179,8,0.8);
    margin-top: 2px;
}
.wizard-thinking-spinner {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin: 6px 0;
}
.wizard-hint-form {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Pill "Nuevos artículos" (estilo X/Twitter) ── */
#new-items-pill {
    position: fixed;
    top: 56px;
    left: calc(50% + 24px);  /* 50% viewport + 24px (mitad del sidebar de 48px) */
    transform: translateX(-50%) translateY(-16px) scale(0.92);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.3px;
    padding: 9px 22px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow:
        0 6px 24px rgba(109, 40, 217, 0.7),
        0 2px 8px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255,255,255,0.15);
    cursor: pointer;
    z-index: 300;
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
}

#new-items-pill.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
    animation: pill-appear 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#new-items-pill:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow:
        0 8px 32px rgba(109, 40, 217, 0.85),
        0 2px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateX(-50%) translateY(-2px) scale(1.04);
}

/* Cuando el chat está abierto, restar la mitad del margen del chat (31.5vw / 2 = 15.75vw) */
body.chat-open #new-items-pill {
    left: calc(50% + 24px - 15.75vw);
}

@keyframes pill-appear {
    from { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(0.92); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0)      scale(1);   }
}

