/* ============================================================================
   AnthroSynth App — Premium Design System
   ============================================================================ */
:root {
    --pri: #6366F1; --pri-dark: #4F46E5; --pri-light: #818CF8; --pri-bg: #EEF2FF;
    --accent: #8B5CF6; --success: #10B981; --success-bg: #D1FAE5;
    --warn: #F59E0B; --warn-bg: #FEF3C7; --danger: #EF4444; --danger-bg: #FEE2E2;
    --t1: #111827; --t2: #4B5563; --t3: #9CA3AF; --t4: #D1D5DB;
    --bg: #F8FAFC; --bg2: #FFFFFF; --bg3: #F1F5F9; --bg4: #E2E8F0;
    --border: #E5E7EB; --border2: #F3F4F6; --border-focus: #6366F1;
    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.07);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.1);
    --shadow-glow: 0 0 0 3px rgba(99,102,241,.12);
    --r: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 9999px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --tr: 150ms ease;
}
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-font-smoothing: antialiased; }
body { font-family:var(--font); font-size:14px; line-height:1.5; color:var(--t1); background:var(--bg); }

/* ── Top Nav ──────────────────────────────────────────── */
.topnav { position:sticky; top:0; z-index:100; background:rgba(255,255,255,.85); backdrop-filter:blur(12px); border-bottom:1px solid var(--border); height:56px; }
.topnav-inner { max-width:1400px; margin:0 auto; padding:0 24px; height:100%; display:flex; align-items:center; justify-content:space-between; }
.topnav-brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--t1); font-weight:700; font-size:17px; }
.topnav-brand svg { color:var(--pri); }
.topnav-right { display:flex; align-items:center; gap:12px; }
.topnav-link { color:var(--t2); text-decoration:none; font-size:13px; font-weight:500; padding:6px 14px; border-radius:var(--r); transition:all var(--tr); }
.topnav-link:hover { background:var(--bg3); color:var(--t1); }

/* ── Layout ───────────────────────────────────────────── */
.page { max-width:1200px; margin:0 auto; padding:32px 24px; }
.page-sm { max-width:800px; }
.page-header { margin-bottom:28px; }
.page-title { font-size:24px; font-weight:800; letter-spacing:-.02em; }
.page-subtitle { font-size:14px; color:var(--t3); margin-top:4px; }
.breadcrumb { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--t3); margin-bottom:16px; }
.breadcrumb a { color:var(--t2); text-decoration:none; }
.breadcrumb a:hover { color:var(--pri); }

/* ── Cards ────────────────────────────────────────────── */
.card { background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); box-shadow:var(--shadow-xs); transition:all var(--tr); }
.card-hover:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); border-color:var(--border); }
.card-click { cursor:pointer; }
.card-body { padding:20px 24px; }
.card-footer { padding:14px 24px; border-top:1px solid var(--border2); background:var(--bg); border-radius:0 0 var(--r-md) var(--r-md); }

/* ── Buttons ──────────────────────────────────────────── */
.btn { display:inline-flex; align-items:center; gap:7px; padding:9px 18px; font-family:var(--font); font-size:13px; font-weight:600; border-radius:var(--r); border:none; cursor:pointer; transition:all var(--tr); text-decoration:none; line-height:1.4; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary { background:var(--pri); color:white; box-shadow:0 1px 3px rgba(99,102,241,.3); }
.btn-primary:hover:not(:disabled) { background:var(--pri-dark); box-shadow:0 4px 12px rgba(99,102,241,.3); }
.btn-secondary { background:var(--bg2); color:var(--t2); border:1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background:var(--bg3); color:var(--t1); border-color:var(--t4); }
.btn-ghost { background:none; color:var(--t2); padding:8px 12px; }
.btn-ghost:hover { background:var(--bg3); color:var(--t1); }
.btn-danger { background:var(--danger); color:white; }
.btn-danger:hover:not(:disabled) { background:#DC2626; }
.btn-danger-ghost { background:none; color:var(--danger); padding:8px 12px; }
.btn-danger-ghost:hover { background:var(--danger-bg); }
.btn-sm { padding:6px 12px; font-size:12px; }
.btn-lg { padding:12px 24px; font-size:15px; border-radius:var(--r-md); }

/* ── Inputs ───────────────────────────────────────────── */
.form-group { margin-bottom:20px; }
.form-label { display:block; font-size:13px; font-weight:600; color:var(--t1); margin-bottom:6px; }
.form-hint { font-size:12px; color:var(--t3); margin-top:4px; }
.form-input, .form-textarea, .form-select { width:100%; padding:10px 14px; font-family:var(--font); font-size:14px; color:var(--t1); background:var(--bg2); border:1px solid var(--border); border-radius:var(--r); transition:all var(--tr); }
.form-input:focus, .form-textarea:focus, .form-select:focus { outline:none; border-color:var(--border-focus); box-shadow:var(--shadow-glow); }
.form-textarea { resize:vertical; min-height:100px; line-height:1.6; }

/* ── Badges ───────────────────────────────────────────── */
.badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:var(--r-full); font-size:11px; font-weight:600; }
.badge-pri { background:var(--pri-bg); color:var(--pri); }
.badge-success { background:var(--success-bg); color:#065F46; }
.badge-warn { background:var(--warn-bg); color:#92400E; }
.badge-danger { background:var(--danger-bg); color:#991B1B; }
.badge-neutral { background:var(--bg3); color:var(--t2); }
.tag { display:inline-block; padding:3px 10px; border-radius:var(--r-full); font-size:12px; font-weight:500; background:var(--bg3); color:var(--t2); }

/* ── Tabs ─────────────────────────────────────────────── */
.tabs { display:flex; gap:0; border-bottom:2px solid var(--border2); margin-bottom:24px; }
.tab { padding:10px 20px; font-size:13px; font-weight:500; color:var(--t3); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; transition:all var(--tr); background:none; border-left:none; border-right:none; border-top:none; font-family:var(--font); }
.tab:hover { color:var(--t1); }
.tab.active { color:var(--pri); border-bottom-color:var(--pri); font-weight:600; }
.tab-count { display:inline-block; min-width:20px; height:18px; line-height:18px; text-align:center; border-radius:9px; background:var(--bg3); font-size:11px; font-weight:600; margin-left:6px; color:var(--t3); }
.tab.active .tab-count { background:var(--pri-bg); color:var(--pri); }

/* ── Empty State ──────────────────────────────────────── */
.empty-state { text-align:center; padding:64px 24px; }
.empty-icon { width:64px; height:64px; border-radius:var(--r-lg); background:var(--bg3); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; color:var(--t3); }
.empty-state h3 { font-size:16px; font-weight:600; color:var(--t1); margin-bottom:8px; }
.empty-state p { font-size:14px; color:var(--t3); max-width:400px; margin:0 auto 20px; }

/* ── Grid ─────────────────────────────────────────────── */
.grid { display:grid; gap:16px; }
.grid-2 { grid-template-columns:repeat(2,1fr); }
.grid-3 { grid-template-columns:repeat(3,1fr); }
.grid-auto { grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); }

/* ── Project Cards ────────────────────────────────────── */
.project-card { position:relative; overflow:hidden; }
.project-card .card-body { padding:24px; }
.project-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--pri),var(--accent)); opacity:0; transition:opacity var(--tr); }
.project-card:hover::before { opacity:1; }
.project-icon { width:44px; height:44px; display:flex; align-items:center; justify-content:center; background:var(--pri-bg); border-radius:var(--r-md); margin-bottom:14px; font-size:20px; }
.project-card h3 { font-size:16px; font-weight:700; margin-bottom:4px; }
.project-desc { font-size:13px; color:var(--t3); line-height:1.5; margin-bottom:14px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.project-meta { display:flex; align-items:center; gap:14px; font-size:12px; color:var(--t3); }
.project-meta span { display:flex; align-items:center; gap:4px; }
.card-actions { position:absolute; top:12px; right:12px; z-index:20; display:flex; gap:4px; opacity:0; transition:opacity var(--tr); }
.project-card:hover .card-actions, .study-card:hover .card-actions { opacity:1; }
.card-del-btn { background:var(--danger); border:none; color:white; width:32px; height:32px; border-radius:6px; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; transition:background var(--tr); }
.card-del-btn:hover { background:#dc2626; }

/* ── Study Cards ──────────────────────────────────────── */
.study-card { position:relative; overflow:visible; }

/* ── Study Type Cards ─────────────────────────────────── */
.study-type-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; }
.study-type-card { padding:20px; border:1.5px solid var(--border); border-radius:var(--r-md); cursor:pointer; transition:all var(--tr); background:var(--bg2); }
.study-type-card:hover { border-color:var(--pri); background:var(--pri-bg); }
.study-type-card.selected { border-color:var(--pri); background:var(--pri-bg); box-shadow:var(--shadow-glow); }
.study-type-card .st-icon { margin-bottom:10px; line-height:0; }
.study-type-card h4 { font-size:14px; font-weight:700; margin-bottom:4px; }
.study-type-card p { font-size:12px; color:var(--t3); line-height:1.5; }

/* ── Persona Cards ────────────────────────────────────── */
.persona-card { background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; transition:all var(--tr); }
.persona-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.persona-card-header { padding:20px 20px 14px; display:flex; align-items:flex-start; gap:14px; }
.persona-avatar { width:48px; height:48px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:16px; color:white; flex-shrink:0; box-shadow:0 2px 8px rgba(0,0,0,.12); }
.persona-info { flex:1; min-width:0; }
.persona-name { font-size:15px; font-weight:700; }
.persona-role { font-size:12px; color:var(--t3); }
.persona-age-loc { font-size:12px; color:var(--t3); margin-top:2px; }
.persona-card-body { padding:0 20px 20px; }
.persona-bio { font-size:13px; color:var(--t2); line-height:1.6; margin-bottom:12px; padding:10px 14px; background:var(--bg); border-radius:var(--r); border-left:3px solid var(--pri); }
.persona-traits { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:12px; }
.persona-trait { padding:3px 10px; border-radius:var(--r-full); font-size:11px; font-weight:500; background:var(--bg3); color:var(--t2); }
.persona-ocean { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; padding-top:12px; border-top:1px solid var(--border2); }
.ocean-dim { text-align:center; }
.ocean-label { display:block; font-size:10px; color:var(--t3); font-weight:700; letter-spacing:.05em; }
.ocean-bar { height:4px; border-radius:2px; background:var(--border2); margin-top:6px; overflow:hidden; }
.ocean-fill { height:100%; border-radius:2px; background:var(--pri); transition:width .5s ease; }

/* ── Interview List ───────────────────────────────────── */
.interview-list { display:flex; flex-direction:column; gap:6px; }
.interview-row { display:flex; align-items:center; gap:14px; padding:14px 20px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r); cursor:pointer; transition:all var(--tr); }
.interview-row:hover { background:var(--pri-bg); border-color:var(--pri); box-shadow:var(--shadow-glow); }
.interview-row.disabled { cursor:default; opacity:.6; }
.interview-row.disabled:hover { background:var(--bg2); border-color:var(--border); box-shadow:none; }
.ir-avatar { width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; color:white; flex-shrink:0; }
.ir-info { flex:1; }
.ir-name { font-size:14px; font-weight:600; }
.ir-role { font-size:12px; color:var(--t3); }
.ir-status { margin-left:auto; }

/* ── Interview — Premium Layout ───────────────────────── */
.iv-layout { display:grid; grid-template-columns:360px 1fr; min-height:calc(100vh - 56px); background:var(--bg); }

/* Sidebar */
.iv-sidebar { background:var(--bg2); border-right:1px solid var(--border); padding:20px; overflow-y:auto; display:flex; flex-direction:column; gap:4px; }
.iv-sidebar::-webkit-scrollbar { width:4px; }
.iv-sidebar::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }
.iv-back { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:500; color:var(--t3); text-decoration:none; padding:6px 10px; border-radius:var(--r); margin:-4px -10px 8px; transition:all var(--tr); }
.iv-back:hover { color:var(--pri); background:var(--pri-bg); }

/* Persona Card */
.iv-persona-card { padding:20px; background:linear-gradient(135deg,rgba(99,102,241,.04) 0%,rgba(139,92,246,.06) 100%); border:1px solid rgba(99,102,241,.12); border-radius:var(--r-lg); margin-bottom:4px; }
.iv-persona-header { display:flex; align-items:center; gap:14px; margin-bottom:14px; }
.iv-avatar { width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:18px; color:white; position:relative; flex-shrink:0; box-shadow:0 4px 14px rgba(0,0,0,.12); }
.iv-avatar-ring { position:absolute; inset:-3px; border-radius:50%; border:2px solid rgba(99,102,241,.3); animation:iv-ring-pulse 3s infinite; }
@keyframes iv-ring-pulse { 0%,100%{opacity:.4;transform:scale(1);} 50%{opacity:0;transform:scale(1.15);} }
.iv-persona-name { font-size:17px; font-weight:800; color:var(--t1); line-height:1.2; }
.iv-persona-role { font-size:12px; color:var(--t3); margin-top:2px; }
.iv-persona-meta { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.iv-meta-chip { display:inline-flex; align-items:center; gap:4px; font-size:11px; color:var(--t2); background:var(--bg2); border:1px solid var(--border); padding:3px 10px; border-radius:var(--r-full); }
.iv-agent-badge { display:flex; align-items:center; gap:6px; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--pri); padding:6px 0 0; border-top:1px solid rgba(99,102,241,.1); }
.iv-agent-dot { width:6px; height:6px; border-radius:50%; background:var(--pri); animation:agent-pulse 2s infinite; }

/* Sidebar sections */
.iv-section { padding:16px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); margin-bottom:0; }
.iv-section-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--t3); margin-bottom:12px; display:flex; align-items:center; gap:6px; }
.iv-bio { font-size:12.5px; color:var(--t2); line-height:1.65; padding:10px 12px; background:var(--bg); border-radius:var(--r); border-left:3px solid var(--pri); }

/* OCEAN Pentagon */
.iv-ocean-wrap { display:flex; justify-content:center; margin-bottom:12px; }
.iv-pentagon-svg { width:160px; height:160px; }
.iv-pent-grid { fill:none; stroke:var(--border); stroke-width:.5; }
.iv-pent-axis { stroke:var(--border2); stroke-width:.5; }
.iv-pent-value { fill:rgba(99,102,241,.12); stroke:var(--pri); stroke-width:1.5; stroke-linejoin:round; }
.iv-pent-label { font-size:9px; font-weight:700; fill:var(--t3); }
.iv-ocean-bars { display:flex; flex-direction:column; gap:6px; }
.iv-ocean-row { display:grid; grid-template-columns:1fr 70px 28px; align-items:center; gap:8px; }
.iv-ocean-dim { font-size:11px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.iv-ocean-track { height:5px; background:var(--bg4); border-radius:3px; overflow:hidden; }
.iv-ocean-fill { height:100%; border-radius:3px; transition:width .8s cubic-bezier(.4,0,.2,1); }
.iv-ocean-val { font-size:11px; font-weight:700; color:var(--t2); text-align:right; }

/* Trait cloud */
.iv-trait-cloud { display:flex; flex-wrap:wrap; gap:5px; }
.iv-trait { padding:4px 10px; border-radius:var(--r-full); font-size:11px; font-weight:500; background:var(--bg3); color:var(--t2); border:1px solid var(--border2); transition:all var(--tr); }
.iv-trait:hover { border-color:var(--pri); color:var(--pri); background:var(--pri-bg); }

/* Quick stats */
.iv-quick-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.iv-qs { text-align:center; padding:8px 4px; background:var(--bg); border-radius:var(--r); }
.iv-qs-val { font-size:18px; font-weight:800; color:var(--pri); line-height:1; }
.iv-qs-label { font-size:9px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--t3); margin-top:3px; }

/* Main chat area */
.iv-main { display:flex; flex-direction:column; min-height:0; }

/* Chat header */
.iv-chat-header { display:flex; align-items:center; justify-content:space-between; padding:16px 28px; border-bottom:1px solid var(--border); background:var(--bg2); flex-shrink:0; }
.iv-chat-title { font-size:16px; font-weight:700; color:var(--t1); }
.iv-chat-subtitle { font-size:12px; color:var(--t3); margin-top:1px; }
.iv-status-pill { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; color:var(--success); background:var(--success-bg); padding:5px 12px; border-radius:var(--r-full); }
.iv-status-dot { width:6px; height:6px; border-radius:50%; background:var(--success); }

/* Chat scroll area */
.iv-chat-scroll { flex:1; overflow-y:auto; padding:28px; scroll-behavior:smooth; }
.iv-chat-scroll::-webkit-scrollbar { width:5px; }
.iv-chat-scroll::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

/* Session start marker */
.iv-chat-start { display:flex; align-items:center; gap:10px; justify-content:center; padding:12px 20px; margin-bottom:28px; background:var(--bg3); border-radius:var(--r-full); font-size:12px; color:var(--t3); }
.iv-chat-start-icon { width:32px; height:32px; border-radius:50%; background:var(--pri-bg); display:flex; align-items:center; justify-content:center; flex-shrink:0; }

/* Q&A blocks */
.iv-qa-block { display:flex; gap:16px; margin-bottom:28px; animation:iv-fade-up .4s ease both; }
.iv-qa-new { animation:iv-fade-up .4s ease both; }
@keyframes iv-fade-up { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.iv-qa-num { width:28px; height:28px; border-radius:50%; background:var(--bg3); border:1.5px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:var(--t3); flex-shrink:0; margin-top:2px; }
.iv-qa-content { flex:1; min-width:0; display:flex; flex-direction:column; gap:14px; }

/* Individual messages */
.iv-msg { border-radius:var(--r-md); overflow:hidden; }
.iv-msg-sender { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:600; margin-bottom:6px; }
.iv-msg-avatar { width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-size:8px; font-weight:700; flex-shrink:0; }
.iv-msg-body { font-size:14px; line-height:1.75; padding:16px 20px; border-radius:var(--r-md); }

/* Interviewer message */
.iv-msg-q .iv-msg-sender { color:var(--pri); }
.iv-msg-body-q { background:linear-gradient(135deg,var(--pri-bg) 0%,#E0E7FF 100%); border:1px solid #C7D2FE; color:var(--t1); font-weight:500; }

/* Participant message */
.iv-msg-a .iv-msg-sender { color:var(--t1); }
.iv-msg-body-a { background:var(--bg2); border:1px solid var(--border); color:var(--t2); box-shadow:var(--shadow-xs); }

/* Typing indicator */
.iv-typing { display:flex; align-items:center; gap:5px; padding:18px 22px !important; }
.iv-typing-dot { width:7px; height:7px; border-radius:50%; background:var(--t4); animation:iv-typing-bounce 1.4s infinite ease-in-out; }
.iv-typing-dot:nth-child(2) { animation-delay:.16s; }
.iv-typing-dot:nth-child(3) { animation-delay:.32s; }
@keyframes iv-typing-bounce { 0%,80%,100%{transform:scale(0.6);opacity:.4;} 40%{transform:scale(1);opacity:1;} }

/* Input bar */
.iv-input-bar { padding:16px 28px 14px; background:var(--bg2); border-top:1px solid var(--border); flex-shrink:0; }
.iv-input-wrap { display:flex; align-items:center; gap:0; background:var(--bg); border:1.5px solid var(--border); border-radius:var(--r-md); overflow:hidden; transition:all var(--tr); }
.iv-input-wrap:focus-within { border-color:var(--pri); box-shadow:0 0 0 3px rgba(99,102,241,.1); }
.iv-input { flex:1; border:none; outline:none; padding:12px 16px; font-family:var(--font); font-size:14px; background:transparent; color:var(--t1); }
.iv-input::placeholder { color:var(--t4); }
.iv-send-btn { width:42px; height:42px; display:flex; align-items:center; justify-content:center; background:var(--pri); color:white; border:none; cursor:pointer; transition:all var(--tr); flex-shrink:0; border-radius:0 8px 8px 0; }
.iv-send-btn:hover { background:var(--pri-dark); }
.iv-send-btn:active { transform:scale(.95); }
.iv-input-hint { font-size:11px; color:var(--t4); margin-top:6px; text-align:center; }

/* Responsive */
@media(max-width:768px){
  .iv-layout { grid-template-columns:1fr; }
  .iv-sidebar { border-right:none; border-bottom:1px solid var(--border); max-height:320px; }
  .iv-ocean-wrap { display:none; }
  .iv-chat-scroll { padding:16px; }
  .iv-input-bar { padding:12px 16px 10px; }
}

/* ── Report (Legacy — kept for compat) ────────────────── */
.report-section { margin-bottom:32px; }
.report-title { font-size:16px; font-weight:700; margin-bottom:14px; display:flex; align-items:center; gap:8px; }
.report-summary { padding:24px; background:linear-gradient(135deg,var(--pri-bg),#E0E7FF); border:1px solid #C7D2FE; border-radius:var(--r-lg); font-size:15px; line-height:1.8; margin-bottom:32px; }
.finding-card { padding:20px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r); margin-bottom:10px; transition:all var(--tr); }
.finding-card:hover { box-shadow:var(--shadow-sm); }
.finding-card h4 { font-size:14px; font-weight:700; margin-bottom:8px; display:flex; align-items:center; gap:8px; }
.finding-card p { font-size:13px; color:var(--t2); line-height:1.6; }
.finding-participants { display:flex; gap:5px; flex-wrap:wrap; margin-top:10px; }
.quote-card { padding:16px 20px; border-left:3px solid var(--pri); background:var(--bg); border-radius:0 var(--r) var(--r) 0; margin-bottom:10px; }
.quote-card blockquote { font-size:14px; font-style:italic; line-height:1.6; color:var(--t2); margin-bottom:6px; }
.quote-card cite { font-size:12px; font-style:normal; font-weight:600; color:var(--t3); }
.quote-context { font-size:12px; color:var(--t3); margin-top:4px; }
.pain-row { display:flex; align-items:flex-start; gap:10px; padding:12px 0; border-bottom:1px solid var(--border2); }
.pain-row:last-child { border-bottom:none; }
.rec-list { list-style:none; }
.rec-list li { display:flex; align-items:flex-start; gap:10px; padding:10px 0; font-size:14px; line-height:1.6; color:var(--t2); border-bottom:1px solid var(--border2); }
.rec-list li:last-child { border-bottom:none; }
.variation-card { padding:16px 20px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r); margin-bottom:8px; }
.variation-card h5 { font-size:13px; font-weight:600; margin-bottom:8px; }
.variation-persp { display:flex; align-items:flex-start; gap:8px; font-size:13px; padding:3px 0; line-height:1.5; }

/* ── Premium Report ───────────────────────────────────── */
.rpt-header { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:28px; flex-wrap:wrap; }
.rpt-header-left { flex:1; min-width:240px; }
.rpt-badge { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--pri); background:var(--pri-bg); padding:5px 12px; border-radius:var(--r-full); margin-bottom:10px; }
.rpt-badge-dot { width:7px; height:7px; background:var(--pri); border-radius:50%; animation:pulse-dot 2s infinite; }
.rpt-title { font-size:22px; font-weight:800; color:var(--t1); margin-bottom:4px; }
.rpt-subtitle { font-size:13px; color:var(--t3); line-height:1.5; }
.rpt-header-right { flex-shrink:0; }
.rpt-action-row { display:flex; gap:8px; margin-top:12px; }
.rpt-stat-row { display:flex; gap:8px; flex-wrap:wrap; }
.rpt-stat-card { text-align:center; padding:12px 18px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); min-width:80px; }
.rpt-stat-num { font-size:26px; font-weight:800; line-height:1; }
.rpt-stat-label { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--t3); margin-top:4px; }

/* Executive Summary */
.rpt-exec-card { display:flex; gap:16px; padding:24px; background:linear-gradient(135deg,var(--pri-bg) 0%,#E0E7FF 50%,#DDD6FE 100%); border:1px solid #C7D2FE; border-radius:var(--r-lg); margin-bottom:28px; }
.rpt-section-icon { flex-shrink:0; margin-top:2px; }
.rpt-section-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--pri); margin-bottom:8px; }
.rpt-exec-text { font-size:15px; line-height:1.85; color:var(--t1); }

/* Dual grid (sentiment + participants) */
.rpt-dual-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:28px; }
@media (max-width:900px) { .rpt-dual-grid { grid-template-columns:1fr; } }
.rpt-card { background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-lg); padding:24px; }
.rpt-card-header { font-size:15px; font-weight:700; display:flex; align-items:center; gap:8px; margin-bottom:16px; color:var(--t1); }

/* Sentiment donut */
.rpt-sentiment-visual { display:flex; flex-direction:column; align-items:center; gap:16px; }
.rpt-donut-wrap { position:relative; width:140px; height:140px; }
.rpt-donut { width:100%; height:100%; transform:rotate(-90deg); }
.rpt-donut-center { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.rpt-donut-label { font-size:14px; font-weight:700; text-transform:capitalize; color:var(--t1); }
.rpt-sentiment-legend { display:flex; gap:20px; flex-wrap:wrap; justify-content:center; }
.rpt-legend-item { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--t2); }
.rpt-legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.rpt-sentiment-note { font-size:12px; color:var(--t3); text-align:center; line-height:1.5; margin-top:4px; }

/* Participant snapshot */
.rpt-participant-grid { display:flex; flex-direction:column; gap:10px; }
.rpt-participant-row { display:grid; grid-template-columns:1fr 120px 1fr; gap:12px; align-items:center; padding:8px 0; border-bottom:1px solid var(--border2); }
.rpt-participant-row:last-child { border-bottom:none; }
.rpt-participant-info { display:flex; align-items:center; gap:10px; min-width:0; }
.rpt-participant-avatar { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-size:11px; font-weight:700; flex-shrink:0; }
.rpt-participant-name { font-size:13px; font-weight:600; color:var(--t1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rpt-participant-role { font-size:11px; color:var(--t3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rpt-participant-score-wrap { display:flex; align-items:center; gap:8px; }
.rpt-score-bar { flex:1; height:6px; background:var(--bg4); border-radius:3px; overflow:hidden; }
.rpt-score-fill { height:100%; border-radius:3px; transition:width .6s ease; }
.rpt-score-num { font-size:13px; font-weight:700; min-width:24px; text-align:right; }
.rpt-participant-concern { font-size:11px; color:var(--t3); line-height:1.4; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }

/* Section headers */
.rpt-section { margin-bottom:32px; }
.rpt-section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.rpt-count-badge { font-size:12px; font-weight:700; background:var(--pri-bg); color:var(--pri); padding:3px 10px; border-radius:var(--r-full); }
.rpt-count-danger { background:var(--danger-bg); color:var(--danger); }

/* Pills & Tags */
.rpt-pill { font-size:11px; font-weight:600; padding:3px 10px; border-radius:var(--r-full); display:inline-flex; align-items:center; gap:4px; text-transform:capitalize; }
.rpt-pill-xs { font-size:10px; font-weight:600; padding:2px 8px; border-radius:var(--r-full); text-transform:capitalize; }
.rpt-tag { font-size:11px; font-weight:500; padding:2px 8px; border-radius:var(--r); background:var(--bg3); color:var(--t2); }
.rpt-tag-sm { font-size:10px; font-weight:500; padding:1px 6px; border-radius:var(--r); background:var(--bg3); color:var(--t3); }

/* Findings */
.rpt-findings-grid { display:flex; flex-direction:column; gap:12px; }
.rpt-finding-card { display:flex; gap:16px; padding:20px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); transition:all var(--tr); }
.rpt-finding-card:hover { box-shadow:var(--shadow-md); border-color:var(--border-focus); }
.rpt-finding-num { width:36px; height:36px; background:var(--pri-bg); color:var(--pri); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:800; flex-shrink:0; }
.rpt-finding-body { flex:1; min-width:0; }
.rpt-finding-title { font-size:15px; font-weight:700; color:var(--t1); margin-bottom:6px; }
.rpt-finding-desc { font-size:13px; color:var(--t2); line-height:1.65; margin-bottom:10px; }
.rpt-finding-meta { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.rpt-finding-participants { display:flex; gap:4px; flex-wrap:wrap; }

/* Themes */
.rpt-themes-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:16px; }
.rpt-theme-card { padding:20px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); transition:all var(--tr); }
.rpt-theme-card:hover { box-shadow:var(--shadow-sm); }
.rpt-theme-top { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.rpt-theme-name { font-size:14px; font-weight:700; color:var(--t1); }
.rpt-theme-desc { font-size:13px; color:var(--t2); line-height:1.6; margin-bottom:12px; }
.rpt-theme-freq { margin-bottom:12px; }
.rpt-freq-bar { height:6px; background:var(--bg4); border-radius:3px; overflow:hidden; margin-bottom:4px; }
.rpt-freq-fill { height:100%; background:var(--accent); border-radius:3px; transition:width .6s ease; }
.rpt-freq-label { font-size:11px; color:var(--t3); }
.rpt-theme-quotes { display:flex; flex-direction:column; gap:6px; }
.rpt-mini-quote { font-size:12px; font-style:italic; color:var(--t3); line-height:1.5; padding:6px 10px; background:var(--bg3); border-radius:var(--r); border-left:2px solid var(--accent); }

/* Pain Points */
.rpt-pain-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:14px; }
.rpt-pain-card { padding:18px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); border-left:4px solid var(--danger); }
.rpt-pain-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.rpt-severity-badge { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:3px 10px; border-radius:var(--r-full); }
.rpt-sev-high { background:var(--danger-bg); color:var(--danger); }
.rpt-sev-medium { background:var(--warn-bg); color:var(--warn); }
.rpt-sev-low { background:var(--success-bg); color:var(--success); }
.rpt-pain-freq { font-size:11px; color:var(--t3); }
.rpt-pain-title { font-size:14px; font-weight:600; color:var(--t1); margin-bottom:6px; }
.rpt-pain-impact { font-size:12px; color:var(--t2); line-height:1.5; margin-bottom:8px; }
.rpt-pain-who { display:flex; gap:4px; flex-wrap:wrap; }

/* Opportunities */
.rpt-oppo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:14px; }
.rpt-oppo-card { padding:20px; background:linear-gradient(135deg,#FFFBEB 0%,#FEF3C7 100%); border:1px solid #FDE68A; border-radius:var(--r-md); }
.rpt-oppo-title { font-size:14px; font-weight:700; color:var(--t1); margin-bottom:6px; }
.rpt-oppo-desc { font-size:13px; color:var(--t2); line-height:1.6; margin-bottom:10px; }
.rpt-oppo-meta { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.rpt-oppo-links { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }

/* Quotes */
.rpt-quotes-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.rpt-quote-card { padding:20px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); position:relative; }
.rpt-quote-mark { position:absolute; top:10px; left:16px; font-size:48px; font-weight:800; color:var(--pri-bg); line-height:1; font-family:Georgia,serif; pointer-events:none; }
.rpt-quote-text { font-size:14px; font-style:italic; line-height:1.7; color:var(--t2); margin-bottom:10px; padding-top:12px; position:relative; z-index:1; }
.rpt-quote-footer { display:flex; align-items:center; gap:8px; }
.rpt-quote-author { font-size:12px; font-weight:700; color:var(--t1); font-style:normal; }
.rpt-quote-context { font-size:11px; color:var(--t3); margin-top:6px; line-height:1.4; }

/* Variations */
.rpt-variation-card { padding:18px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); margin-bottom:12px; }
.rpt-variation-topic { font-size:14px; font-weight:700; color:var(--t1); margin-bottom:10px; }
.rpt-variation-list { display:flex; flex-direction:column; gap:8px; }
.rpt-variation-item { display:flex; align-items:flex-start; gap:8px; font-size:13px; line-height:1.5; color:var(--t2); }
.rpt-variation-view { flex:1; }

/* Recommendations */
.rpt-rec-grid { display:flex; flex-direction:column; gap:12px; }
.rpt-rec-card { display:flex; gap:14px; padding:18px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); transition:all var(--tr); }
.rpt-rec-card:hover { box-shadow:var(--shadow-sm); }
.rpt-rec-num { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:800; flex-shrink:0; }
.rpt-rec-body { flex:1; min-width:0; }
.rpt-rec-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:6px; flex-wrap:wrap; }
.rpt-rec-title { font-size:14px; font-weight:700; color:var(--t1); }
.rpt-rec-badges { display:flex; gap:5px; flex-wrap:wrap; flex-shrink:0; }
.rpt-rec-desc { font-size:13px; color:var(--t2); line-height:1.6; }

/* Next Steps */
.rpt-next-steps { padding:24px; background:linear-gradient(135deg,var(--pri-bg) 0%,#E0E7FF 100%); border:1px solid #C7D2FE; border-radius:var(--r-lg); margin-bottom:28px; }
.rpt-next-list { display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.rpt-next-item { display:flex; align-items:flex-start; gap:10px; font-size:14px; color:var(--t1); line-height:1.6; }
.rpt-next-arrow { color:var(--pri); font-size:18px; font-weight:700; flex-shrink:0; margin-top:1px; }

/* ── Study Status ─────────────────────────────────────── */
.study-status { display:flex; align-items:center; gap:6px; margin-bottom:24px; padding:12px 16px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); }
.ss-step { display:flex; align-items:center; gap:5px; font-size:12px; font-weight:500; color:var(--t3); }
.ss-step.done { color:var(--success); }
.ss-step.active { color:var(--pri); font-weight:700; }
.ss-dot { width:8px; height:8px; border-radius:50%; background:var(--border); }
.ss-step.done .ss-dot { background:var(--success); }
.ss-step.active .ss-dot { background:var(--pri); box-shadow:0 0 0 3px rgba(99,102,241,.2); }
.ss-line { width:24px; height:2px; background:var(--border); }
.ss-step.done+.ss-line { background:var(--success); }

/* ── Modal ────────────────────────────────────────────── */
.modal-overlay { position:fixed; inset:0; z-index:200; background:rgba(0,0,0,.45); backdrop-filter:blur(4px); display:flex; align-items:center; justify-content:center; padding:24px; }
.modal { background:var(--bg2); border-radius:var(--r-lg); box-shadow:var(--shadow-lg); width:100%; max-width:560px; max-height:90vh; overflow-y:auto; }
.modal-header { padding:24px 24px 0; }
.modal-header h2 { font-size:18px; font-weight:700; }
.modal-header p { font-size:13px; color:var(--t3); margin-top:4px; }
.modal-body { padding:24px; }
.modal-footer { padding:16px 24px; border-top:1px solid var(--border2); display:flex; justify-content:flex-end; gap:10px; }

/* ── Toggle ───────────────────────────────────────────── */
.toggle-row { display:flex; align-items:center; justify-content:space-between; padding:12px 0; }
.toggle-label { font-size:14px; font-weight:500; }
.toggle-desc { font-size:12px; color:var(--t3); }
.toggle-switch { width:44px; height:24px; background:var(--border); border-radius:12px; position:relative; cursor:pointer; transition:background var(--tr); }
.toggle-switch.on { background:var(--pri); }
.toggle-switch::after { content:''; position:absolute; top:3px; left:3px; width:18px; height:18px; background:white; border-radius:50%; transition:transform var(--tr); box-shadow:var(--shadow-xs); }
.toggle-switch.on::after { transform:translateX(20px); }

/* ── Spinner / Loading ────────────────────────────────── */
.spinner { width:20px; height:20px; border:2.5px solid var(--border); border-top-color:var(--pri); border-radius:50%; animation:spin .6s linear infinite; }
.tab-spinner { display:inline-block; width:14px; height:14px; border:2px solid var(--border); border-top-color:var(--pri); border-radius:50%; animation:spin .6s linear infinite; vertical-align:middle; margin-left:6px; }
@keyframes spin { to { transform:rotate(360deg); } }
.loading-overlay { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:80px 24px; gap:16px; }
.loading-overlay p { font-size:14px; color:var(--t3); }
.progress-container { width:100%; max-width:300px; height:6px; background:var(--border2); border-radius:3px; overflow:hidden; }
.progress-fill { height:100%; background:var(--pri); border-radius:3px; transition:width .5s ease; }

/* ── Domain Chips ─────────────────────────────────────── */
.domain-chips { display:flex; flex-wrap:wrap; gap:8px; }
.domain-chip { padding:8px 16px; border:1.5px solid var(--border); border-radius:var(--r-full); font-size:13px; font-weight:500; cursor:pointer; transition:all var(--tr); background:var(--bg2); color:var(--t2); }
.domain-chip:hover { border-color:var(--pri); color:var(--pri); }
.domain-chip.selected { background:var(--pri); color:white; border-color:var(--pri); box-shadow:0 2px 8px rgba(99,102,241,.25); }

/* ── Annotations ──────────────────────────────────────── */
.ann-layout { display:grid; grid-template-columns:1fr 280px; gap:24px; }
@media (max-width:900px) { .ann-layout { grid-template-columns:1fr; } }
.ann-main { min-width:0; }
.ann-composer { display:flex; align-items:center; gap:10px; padding:14px 18px; background:var(--bg2); border:1.5px solid var(--border); border-radius:var(--r-md); margin-bottom:16px; transition:all var(--tr); }
.ann-composer:focus-within { border-color:var(--pri); box-shadow:var(--shadow-glow); }
.ann-composer-icon { flex-shrink:0; }
.annotation-card { padding:16px 18px; background:#FFFBEB; border:1px solid #FDE68A; border-radius:var(--r-md); margin-bottom:8px; position:relative; transition:all var(--tr); }
.annotation-card:hover { box-shadow:var(--shadow-sm); }
.annotation-card p { font-size:13px; line-height:1.6; color:var(--t1); padding-right:24px; }
.annotation-meta { display:flex; align-items:center; gap:4px; font-size:11px; color:var(--t3); margin-top:8px; }
.annotation-meta svg { flex-shrink:0; }
.annotation-target-badge { font-size:10px; font-weight:600; padding:2px 8px; border-radius:var(--r-full); background:var(--pri-bg); color:var(--pri); margin-left:4px; }
.annotation-delete { position:absolute; top:10px; right:10px; background:none; border:none; cursor:pointer; color:var(--t4); font-size:18px; padding:2px 6px; border-radius:var(--r); transition:all var(--tr); line-height:1; }
.annotation-delete:hover { color:var(--danger); background:var(--danger-bg); }

.ann-sidebar { padding:20px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); align-self:flex-start; position:sticky; top:80px; }
.ann-sidebar-title { font-size:13px; font-weight:700; color:var(--t1); display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.ann-sidebar-hint { font-size:11px; color:var(--t3); margin-bottom:14px; line-height:1.4; }
.ann-insights-list { display:flex; flex-direction:column; gap:4px; }
.ann-insight-btn { display:flex; align-items:center; gap:8px; padding:8px 10px; background:var(--bg); border:1px solid var(--border2); border-radius:var(--r); cursor:pointer; font-family:var(--font); font-size:12px; text-align:left; transition:all var(--tr); color:var(--t2); }
.ann-insight-btn:hover { border-color:var(--pri); background:var(--pri-bg); color:var(--pri); }
.ann-insight-icon { font-size:14px; flex-shrink:0; width:18px; text-align:center; }
.ann-insight-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
.ann-insight-type { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--t3); flex-shrink:0; }

/* ── Agent Activity Indicator ─────────────────────────── */
.agent-pulse { display:flex; align-items:center; gap:8px; padding:10px 16px; background:linear-gradient(90deg,rgba(99,102,241,.06),rgba(139,92,246,.06)); border:1px solid rgba(99,102,241,.15); border-radius:var(--r); font-size:12px; color:var(--pri); font-weight:500; margin-bottom:16px; }
.agent-pulse .pulse-dot { width:8px; height:8px; border-radius:50%; background:var(--pri); animation:agent-pulse 2s infinite; }
@keyframes agent-pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:.4;transform:scale(.8);} }
.agent-chip { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; background:rgba(99,102,241,.08); border:1px solid rgba(99,102,241,.15); border-radius:var(--r-full); font-size:11px; font-weight:600; color:var(--pri); }
.agent-chip .ac-dot { width:5px; height:5px; border-radius:50%; background:var(--pri); }

/* ── Insight Cards (in study overview) ────────────────── */
.insight-bar { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:24px; }
.insight-card { padding:16px 18px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--r-md); }
.insight-card .ic-value { font-size:22px; font-weight:800; letter-spacing:-.02em; }
.insight-card .ic-label { font-size:12px; color:var(--t3); margin-top:2px; }
.insight-card.ic-pri .ic-value { color:var(--pri); }
.insight-card.ic-success .ic-value { color:var(--success); }
.insight-card.ic-warn .ic-value { color:var(--warn); }
.insight-card.ic-danger .ic-value { color:var(--danger); }

/* ── Print (PDF Export) ───────────────────────────────── */
@media print {
  body { background:#fff; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .topnav, .breadcrumb, .tabs, .page-header, .study-status, #study-insights,
  .rpt-export-pdf, .rpt-send-email, .rpt-action-row, #asai-panel, #asai-fab,
  .asai-nav-btn, .ss-step { display:none !important; }
  .page { max-width:100%; padding:0; margin:0; }
  #tab-report { display:block !important; }
  #tab-personas, #tab-interviews, #tab-annotations { display:none !important; }
  .rpt-header { page-break-after:avoid; }
  .rpt-section { page-break-inside:avoid; }
  .rpt-dual-grid { grid-template-columns:1fr 1fr; }
  .card, .rpt-card, .rpt-finding-card, .rpt-theme-card, .rpt-pain-card, .rpt-rec-card, .rpt-quote-card { box-shadow:none; border:1px solid #ddd; }
}

/* ── ASAI Nav Button ──────────────────────────────────── */
.asai-nav-btn { display:inline-flex; align-items:center; gap:7px; padding:7px 16px; font-family:var(--font); font-size:13px; font-weight:600; color:white; background:linear-gradient(135deg,var(--pri),var(--accent)); border:none; border-radius:var(--r-full); cursor:pointer; transition:all var(--tr); box-shadow:0 2px 8px rgba(99,102,241,.3); }
.asai-nav-btn:hover { box-shadow:0 4px 16px rgba(99,102,241,.4); transform:translateY(-1px); }
.asai-nav-btn svg { flex-shrink:0; }

/* ── ASAI Panel ───────────────────────────────────────── */
.asai-panel { position:fixed; top:56px; right:0; bottom:0; width:380px; z-index:150; background:var(--bg2); border-left:1px solid var(--border); box-shadow:-4px 0 20px rgba(0,0,0,.08); display:flex; flex-direction:column; transition:transform .25s ease, opacity .25s ease; }
.asai-hidden { transform:translateX(100%); opacity:0; pointer-events:none; }

.asai-header { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border); background:linear-gradient(135deg,rgba(99,102,241,.06),rgba(139,92,246,.06)); flex-shrink:0; }
.asai-header-left { display:flex; align-items:center; gap:12px; }
.asai-logo { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,var(--pri),var(--accent)); display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(99,102,241,.3); }
.asai-title { font-size:15px; font-weight:800; color:var(--t1); }
.asai-subtitle { font-size:11px; color:var(--t3); }
.asai-close { background:none; border:none; font-size:24px; color:var(--t3); cursor:pointer; padding:4px 8px; border-radius:var(--r); transition:all var(--tr); line-height:1; }
.asai-close:hover { background:var(--bg3); color:var(--t1); }

.asai-messages { flex:1; overflow-y:auto; padding:20px; display:flex; flex-direction:column; gap:12px; scroll-behavior:smooth; }
.asai-messages::-webkit-scrollbar { width:4px; }
.asai-messages::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

.asai-msg { display:flex; }
.asai-msg-user { justify-content:flex-end; }
.asai-msg-bot { justify-content:flex-start; }

.asai-msg-bubble { max-width:88%; padding:10px 14px; border-radius:14px; font-size:13px; line-height:1.65; word-break:break-word; }
.asai-bubble-user { background:var(--pri); color:white; border-bottom-right-radius:4px; }
.asai-bubble-bot { background:var(--bg3); color:var(--t1); border:1px solid var(--border2); border-bottom-left-radius:4px; }
.asai-bubble-bot strong { color:var(--pri); font-weight:700; }

/* Typing */
.asai-typing { display:flex; align-items:center; gap:4px; padding:14px 18px !important; }
.asai-typing-dot { width:6px; height:6px; border-radius:50%; background:var(--t4); animation:iv-typing-bounce 1.4s infinite ease-in-out; }
.asai-typing-dot:nth-child(2) { animation-delay:.16s; }
.asai-typing-dot:nth-child(3) { animation-delay:.32s; }

/* Study picker dropdown */
.asai-study-picker { padding:4px 0; }
.asai-study-select { width:100%; padding:10px 14px; font-family:var(--font); font-size:13px; color:var(--t1); background:var(--bg2); border:1.5px solid var(--border); border-radius:var(--r-md); cursor:pointer; transition:all var(--tr); appearance:auto; }
.asai-study-select:focus { outline:none; border-color:var(--pri); box-shadow:var(--shadow-glow); }

/* Input area */
.asai-input-bar { padding:14px 16px; border-top:1px solid var(--border); background:var(--bg2); flex-shrink:0; }
.asai-input-wrap { display:flex; align-items:center; gap:0; background:var(--bg); border:1.5px solid var(--border); border-radius:var(--r-full); overflow:hidden; transition:all var(--tr); }
.asai-input-wrap:focus-within { border-color:var(--pri); box-shadow:0 0 0 3px rgba(99,102,241,.1); }
.asai-input { flex:1; border:none; outline:none; padding:10px 4px 10px 14px; font-family:var(--font); font-size:13px; background:transparent; color:var(--t1); min-width:0; }
.asai-input::placeholder { color:var(--t4); }

.asai-mic-btn { width:36px; height:36px; display:flex; align-items:center; justify-content:center; background:none; border:none; color:var(--t3); cursor:pointer; transition:all var(--tr); flex-shrink:0; border-radius:50%; }
.asai-mic-btn:hover { color:var(--pri); background:var(--pri-bg); }
.asai-mic-active { color:var(--danger) !important; background:var(--danger-bg) !important; animation:agent-pulse 1s infinite; }

.asai-send-btn { width:34px; height:34px; display:flex; align-items:center; justify-content:center; background:var(--pri); color:white; border:none; cursor:pointer; transition:all var(--tr); flex-shrink:0; border-radius:50%; margin:2px; }
.asai-send-btn:hover { background:var(--pri-dark); }

@media (max-width:768px) {
  .asai-panel { width:100%; left:0; }
}

/* ── Utilities ────────────────────────────────────────── */
.flex{display:flex;}.items-center{align-items:center;}.justify-between{justify-content:space-between;}.flex-wrap{flex-wrap:wrap;}
.gap-4{gap:4px;}.gap-6{gap:6px;}.gap-8{gap:8px;}.gap-12{gap:12px;}.gap-16{gap:16px;}.gap-24{gap:24px;}
.mt-4{margin-top:4px;}.mt-8{margin-top:8px;}.mt-12{margin-top:12px;}.mt-16{margin-top:16px;}.mt-24{margin-top:24px;}
.mb-4{margin-bottom:4px;}.mb-8{margin-bottom:8px;}.mb-12{margin-bottom:12px;}.mb-16{margin-bottom:16px;}.mb-24{margin-bottom:24px;}
.text-sm{font-size:13px;}.text-xs{font-size:12px;}.text-muted{color:var(--t3);}.text-center{text-align:center;}
.w-full{width:100%;}.hidden{display:none !important;}

/* ── Responsive ───────────────────────────────────────── */
@media(max-width:768px){
    .grid-2,.grid-3,.grid-auto{grid-template-columns:1fr;}
    .iv-layout{grid-template-columns:1fr;}
    .iv-sidebar{border-right:none;border-bottom:1px solid var(--border);max-height:320px;}
    .study-type-grid{grid-template-columns:1fr;}
    .page{padding:20px 16px;}
    .insight-bar{grid-template-columns:repeat(2,1fr);}
}
