*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; width: 100%; }
body { font-family: 'Inter', sans-serif; background: #0f172a; overflow: hidden; }

:root {
  --accent: #6366f1;
  --accent-rgb: 99, 102, 241;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.2); border-radius: 99px; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.15; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 2px 8px rgba(99,102,241,0.35); }
.avatar--sm { width: 32px; height: 32px; }
.avatar--md { width: 48px; height: 48px; }
.avatar--lg { width: 64px; height: 64px; }

/* ── StatusDot ───────────────────────────────────────────────────────────── */
.status-dot { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.status-dot__inner { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; animation: pulse-dot 2s ease-in-out infinite; }
.status-dot__ring { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; opacity: 0.4; animation: pulse-dot 2s ease-in-out infinite; transform: scale(1.8); }

/* ── SourcePills ─────────────────────────────────────────────────────────── */
.sources { margin-top: 8px; }
.source-toggle { background: none; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 4px; color: #94a3b8; font-size: 11px; font-family: inherit; }
.sources__list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; animation: fadeUp 0.15s ease; }
.source-pill { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; background: rgba(var(--accent-rgb), 0.094); color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.188); }
.chevron { transition: transform 0.2s; }
.chevron--open { transform: rotate(180deg); }

/* ── ThinkingDots ────────────────────────────────────────────────────────── */
.thinking-dots { display: flex; gap: 5px; align-items: center; padding: 4px 2px; }
.thinking-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; display: inline-block; animation: blink 1.4s ease-in-out infinite; }
.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── BotMessage ──────────────────────────────────────────────────────────── */
.bot-message { display: flex; gap: 10px; align-items: flex-start; animation: fadeUp 0.2s ease; }
.bot-bubble { max-width: min(540px, 80%); background: #fff; border: 1px solid #e2e8f0; border-radius: 4px 12px 12px 12px; padding: 12px 16px; box-shadow: 0 1px 4px rgba(15,23,42,0.06); }
.message-text { font-size: 15px; line-height: 1.65; color: #1e293b; white-space: pre-wrap; }

/* ── UserMessage ─────────────────────────────────────────────────────────── */
.user-message { display: flex; justify-content: flex-end; animation: fadeUp 0.2s ease; }
.user-bubble { max-width: min(480px, 78%); background: var(--accent); color: #fff; border-radius: 12px 4px 12px 12px; padding: 12px 16px; box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.251); }

/* ── HowItWorks ──────────────────────────────────────────────────────────── */
.how-it-works { margin-top: 12px; }
.how-toggle { background: none; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 6px; width: 100%; color: #94a3b8; font-size: 12px; font-family: inherit; font-weight: 500; }
.how-toggle__chevron { transition: transform 0.2s; margin-left: auto; }
.how-toggle__chevron--open { transform: rotate(180deg); }
.how-list { margin-top: 10px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; animation: slideIn 0.2s ease; }
.how-list__item { display: flex; gap: 8px; align-items: flex-start; }
.how-list__bullet { color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.how-list__text { color: #94a3b8; font-size: 12px; line-height: 1.5; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar { width: 280px; flex-shrink: 0; background: #0f172a; border-right: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; padding: 32px 24px 24px; overflow-y: auto; }
.sidebar__profile { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.sidebar__name { color: #f1f5f9; font-weight: 700; font-size: 20px; line-height: 1.2; }
.sidebar__title { color: #94a3b8; font-size: 13px; margin-top: 4px; line-height: 1.5; }
.sidebar__company { color: #64748b; font-size: 12px; }
.sidebar__meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sidebar__location { color: #64748b; font-size: 12px; display: flex; align-items: center; gap: 4px; }
.sidebar__experience { color: #64748b; font-size: 12px; }
.sidebar__quote { color: #94a3b8; font-size: 13px; line-height: 1.6; border-left: 2px solid var(--accent); padding-left: 12px; font-style: italic; }
.sidebar__skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.skill-tag { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; background: rgba(var(--accent-rgb), 0.125); color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.188); }
.divider { height: 1px; background: rgba(255,255,255,0.06); margin: 24px 0; }
.sidebar__links { display: flex; flex-direction: column; gap: 8px; }
.links-label { color: #475569; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.sidebar-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; background: rgba(255,255,255,0.07); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.1); text-decoration: none; transition: background 0.15s, color 0.15s; }
.sidebar-link:hover { background: rgba(255,255,255,0.12); color: #f1f5f9; }
.sidebar-link__ext { margin-left: auto; opacity: 0.4; }
.sidebar__footer { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.clear-btn { width: 100%; padding: 10px 0; border-radius: 999px; border: 1px solid rgba(239,68,68,0.3); background: rgba(239,68,68,0.1); color: #fca5a5; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.15s, color 0.15s; font-family: inherit; }
.clear-btn:hover { background: rgba(239,68,68,0.25); color: #fecaca; }
.sidebar__credit { color: #334155; font-size: 11px; line-height: 1.5; }

/* ── WelcomeState ────────────────────────────────────────────────────────── */
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 40px 24px; animation: fadeUp 0.3s ease; }
.welcome__hero { text-align: center; }
.welcome__icon { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, rgba(var(--accent-rgb),0.188), rgba(var(--accent-rgb),0.063)); border: 1px solid rgba(var(--accent-rgb),0.188); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.welcome__title { color: #1e293b; font-weight: 700; font-size: 22px; }
.welcome__subtitle { color: #64748b; font-size: 14px; margin-top: 8px; line-height: 1.6; max-width: 380px; }
.welcome__starters { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 460px; }
.starters-label { color: #94a3b8; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; text-align: center; }
.starter-btn { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 16px; text-align: left; cursor: pointer; color: #334155; font-size: 14px; font-family: inherit; line-height: 1.4; transition: all 0.15s; box-shadow: 0 1px 3px rgba(15,23,42,0.05); }
.starter-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.082); }
.starter-btn__arrow { color: var(--accent); margin-right: 8px; font-weight: 600; }

/* ── App Layout ──────────────────────────────────────────────────────────── */
.app { height: 100vh; display: flex; background: #f8fafc; font-family: 'Inter', sans-serif; font-size: 15px; }
.main-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { height: 60px; flex-shrink: 0; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: #fff; }
.header__info { display: flex; align-items: center; gap: 8px; }
.header__name { font-weight: 600; color: #1e293b; font-size: 14px; }
.header__status-text { color: #22c55e; font-size: 11px; font-weight: 500; }
.header__subtitle { color: #94a3b8; font-size: 11px; }
.header__badge { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; margin-left: auto; }
.thread { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.input-bar { border-top: 1px solid #e2e8f0; background: #fff; padding: 16px 24px; }
.input-wrapper { display: flex; gap: 10px; align-items: flex-end; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 10px 12px 10px 16px; transition: border-color 0.15s, box-shadow 0.15s; }
.input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.094); }
.input-textarea { flex: 1; border: none; background: transparent; resize: none; font-family: inherit; font-size: 14px; color: #1e293b; line-height: 1.5; outline: none; min-height: 22px; max-height: 140px; scrollbar-width: none; }
.send-btn { width: 36px; height: 36px; border-radius: 10px; border: none; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; }
.send-btn:enabled { background: var(--accent); color: #fff; cursor: pointer; transform: scale(1); }
.send-btn:disabled { background: #e2e8f0; color: #94a3b8; cursor: default; transform: scale(0.95); }
.input-hint { color: #94a3b8; font-size: 11px; margin-top: 8px; text-align: center; }
