/* ── Chat bubbles ─────────────────────────────────────────────────────────── */

.kb-bubble-bot {
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 0 1rem 1rem 1rem;
    padding: 0.625rem 0.875rem;
    display: inline-block;
    max-width: 100%;
    line-height: 1.6;
}

.kb-bubble-user {
    background: #4f46e5;
    color: #ffffff;
    border-radius: 1rem 1rem 0 1rem;
    padding: 0.625rem 0.875rem;
    display: inline-block;
    max-width: 100%;
    line-height: 1.6;
}

.kb-bubble-oos {
    background: #fef9c3;
    color: #713f12;
    border: 1px solid #fde68a;
    border-radius: 0 1rem 1rem 1rem;
    padding: 0.625rem 0.875rem;
    display: inline-block;
    max-width: 100%;
    line-height: 1.6;
}

/* ── Typing indicator ─────────────────────────────────────────────────────── */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 2px;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing-bounce 1.3s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* ── Citation cards ───────────────────────────────────────────────────────── */

.citation-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #6366f1;
    border-radius: 0.625rem;
    padding: 0.625rem 0.75rem;
}

/* ── Document preview ─────────────────────────────────────────────────────── */

.doc-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #475569;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.doc-preview::-webkit-scrollbar { width: 4px; }
.doc-preview::-webkit-scrollbar-track { background: transparent; }
.doc-preview::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* ── Upload progress bar ──────────────────────────────────────────────────── */

.upload-progress-bar {
    transition: width 0.4s ease;
}

/* ── KB loading dots ─────────────────────────────────────────────────────── */

.kb-loading-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-loading-dots span {
    width: 12px;
    height: 12px;
    background: #6366f1;
    border-radius: 50%;
    animation: kb-bounce 1.2s infinite ease-in-out;
}

.kb-loading-dots span:nth-child(1) { animation-delay: 0s; }
.kb-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.kb-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

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

/* ── Messages scrollbar ───────────────────────────────────────────────────── */

[x-ref="chatMessages"]::-webkit-scrollbar { width: 4px; }
[x-ref="chatMessages"]::-webkit-scrollbar-track { background: transparent; }
[x-ref="chatMessages"]::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
