* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter',sans-serif; background:#0a0a2e; color:#1a1a1a; }

/* Login */
.login-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:#fff; z-index:1000; display:flex; align-items:center; justify-content:center; }
.login-overlay.hidden { display:none; }
.login-box { width:400px; max-width:calc(100vw - 32px); padding:48px 36px; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.1); border-radius:16px; backdrop-filter:blur(12px); }
.login-box .login-logo { text-align:center; margin-bottom:32px; }
.login-box .login-logo img { width:64px; height:64px; border-radius:12px; }
.login-box .login-logo h1 { font-size:22px; font-weight:700; margin-top:12px; color:#fff; letter-spacing:1px; }
.login-box .login-logo p { font-size:14px; color:rgba(255,255,255,0.5); margin-top:4px; }
.login-box label { color:rgba(255,255,255,0.7); font-size:13px; }
.login-box input[type="email"], .login-box input[type="password"], .login-box input[type="text"] { background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.15); color:#fff; border-radius:8px; padding:12px 16px; font-size:15px; width:100%; }
.login-box input::placeholder { color:rgba(255,255,255,0.35); }
.login-box input:focus { outline:none; border-color:#6366f1; }
.login-box button[type="submit"], .login-box .btn-primary { background:linear-gradient(135deg, #6366f1, #8b5cf6); color:#fff; border:none; border-radius:8px; padding:14px; font-size:16px; font-weight:600; cursor:pointer; width:100%; }
.login-box button[type="submit"]:hover { opacity:0.9; }
.login-box a { color:#8b5cf6; }
.login-box .login-links { display:flex; justify-content:space-between; margin-top:16px; font-size:13px; }
.login-box .login-links a { color:rgba(255,255,255,0.5); }
.login-box .login-links a:hover { color:#fff; }
.login-box .error-msg, .login-box .success-msg { font-size:13px; padding:8px 12px; border-radius:6px; margin-top:8px; }
.login-box .error-msg { background:rgba(239,68,68,0.15); color:#f87171; }
.login-field { margin-bottom:16px; }
.login-field label { display:block; font-size:13px; font-weight:500; color:#666; margin-bottom:6px; }
.login-field input { width:100%; padding:10px 14px; border:1px solid #e0e0e0; border-radius:6px; font-size:14px; font-family:'Inter',sans-serif; outline:none; color:#1a1a1a; }
.login-field input:focus { border-color:#1a1a1a; }
.login-btn { width:100%; padding:12px; background:#1a1a1a; color:#fff; border:none; border-radius:6px; font-size:14px; font-weight:500; font-family:'Inter',sans-serif; cursor:pointer; }
.login-btn:hover { background:#333; }
.login-error { color:#dc3545; font-size:13px; margin-top:12px; text-align:center; display:none; }

/* Dev toolbar */
.dev-toolbar { background:#fafafa; border-bottom:1px solid #eee; padding:6px 24px; display:flex; align-items:center; gap:8px; font-size:12px; flex-wrap:wrap; }
.dev-toolbar.hidden { display:none; }
.dev-toolbar .dev-label { font-weight:600; color:#666; white-space:nowrap; }
.dev-toggle { display:inline-flex; align-items:center; gap:4px; padding:3px 8px; border-radius:4px; background:#fff; border:1px solid #e0e0e0; cursor:pointer; font-size:12px; white-space:nowrap; color:#666; }
.dev-toggle:has(input:checked) { background:#f0f0f0; border-color:#999; color:#1a1a1a; }
.dev-toggle input { accent-color:#1a1a1a; margin:0; }

/* Header */
.header { display:flex; align-items:center; padding:0 24px; border-bottom:1px solid #eee; height:52px; background:#fff; position:sticky; top:0; z-index:50; }
.logo { display:flex; align-items:center; gap:8px; font-size:16px; font-weight:600; width:220px; cursor:pointer; color:#1a1a1a; }
.logo i { color:#1a1a1a; font-size:18px; }
.header-right { margin-left:auto; display:flex; align-items:center; gap:16px; }
.header-right .user-name { font-size:13px; color:#999; }
.hdr-btn { background:none; border:1px solid #e0e0e0; padding:6px 14px; border-radius:6px; font-size:13px; font-family:'Inter',sans-serif; cursor:pointer; color:#666; }
.hdr-btn:hover { background:#fafafa; color:#1a1a1a; border-color:#ccc; }

/* Layout */
.app-layout { display:flex; min-height:calc(100vh - 52px); }

/* Sidebar */
.sidebar { width:220px; background:#fff; border-right:1px solid #eee; padding:16px 0; overflow-y:auto; flex-shrink:0; }
.nav-section-label { font-size:11px; font-weight:600; color:#bbb; text-transform:uppercase; letter-spacing:0.5px; padding:8px 20px 4px; }
.nav-item { display:flex; align-items:center; gap:10px; padding:9px 20px; cursor:pointer; font-size:14px; color:#666; transition:all 0.1s; border-left:2px solid transparent; }
.nav-item:hover { color:#1a1a1a; background:#fafafa; }
.nav-item.active { color:#1a1a1a; font-weight:500; border-left-color:#1a1a1a; background:#fafafa; }
.nav-item i { width:16px; text-align:center; font-size:14px; color:#999; }
.nav-item.active i { color:#1a1a1a; }
.nav-divider { height:1px; background:#f0f0f0; margin:10px 0; }
.nav-back { display:flex; align-items:center; gap:8px; padding:9px 20px; cursor:pointer; font-size:13px; color:#999; }
.nav-back:hover { color:#1a1a1a; }

/* Main */
.main-content { flex:1; padding:32px 40px; overflow-y:auto; background:#fafafa; }

/* Page header */
.page-header { margin-bottom:28px; }
.page-header h1 { font-size:22px; font-weight:600; margin-bottom:4px; color:#1a1a1a; }
.page-header p { font-size:14px; color:#999; }

/* Module cards (home) — muse.ai style grid */
.module-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:16px; }
.module-card { background:#fff; border:1px solid #e8e8e8; border-radius:8px; padding:24px; cursor:pointer; transition:all 0.15s; }
.module-card:hover { border-color:#ccc; }
.mc-icon { width:36px; height:36px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:18px; color:#1a1a1a; margin-bottom:14px; background:none; }
.module-card h3 { font-size:15px; font-weight:600; margin-bottom:4px; color:#1a1a1a; }
.module-card p { font-size:13px; color:#999; line-height:1.5; }

/* Stats */
.stats-row { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:12px; margin-bottom:28px; }
.stat-card { background:#fff; border:1px solid #e8e8e8; border-radius:8px; padding:20px; }
.stat-value { font-size:28px; font-weight:600; color:#1a1a1a; }
.stat-label { font-size:12px; color:#999; margin-top:4px; }

/* Inbox */
.inbox-layout { display:flex; height:calc(100vh - 220px); border:1px solid #e8e8e8; border-radius:8px; overflow:hidden; background:#fff; }
.inbox-list { width:300px; border-right:1px solid #eee; overflow-y:auto; }
.inbox-item { display:flex; align-items:center; gap:12px; padding:14px 16px; border-bottom:1px solid #f5f5f5; cursor:pointer; }
.inbox-item:hover { background:#fafafa; }
.inbox-item.active { background:#f5f5f5; }
.inbox-avatar { width:36px; height:36px; border-radius:50%; background:#e8e8e8; color:#666; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:14px; flex-shrink:0; }
.inbox-info { flex:1; min-width:0; }
.inbox-name { font-size:14px; font-weight:500; color:#1a1a1a; }
.inbox-preview { font-size:13px; color:#999; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.inbox-chat { flex:1; display:flex; flex-direction:column; }
.inbox-messages { flex:1; overflow-y:auto; padding:20px; display:flex; flex-direction:column; }
.msg { max-width:70%; margin-bottom:12px; padding:10px 14px; border-radius:10px; font-size:14px; line-height:1.5; }
.msg.inbound { background:#f5f5f5; color:#1a1a1a; align-self:flex-start; border-bottom-left-radius:4px; }
.msg.outbound { background:#1a1a1a; color:#fff; align-self:flex-end; border-bottom-right-radius:4px; }
.msg-time { font-size:11px; color:#bbb; margin-top:4px; }
.msg.outbound .msg-time { color:rgba(255,255,255,0.5); }
.inbox-empty { display:flex; align-items:center; justify-content:center; flex:1; color:#bbb; }

/* Sections */
.section-box { background:#fff; border:1px solid #e8e8e8; border-radius:8px; padding:24px; margin-bottom:16px; }
.section-box h3 { font-size:15px; font-weight:600; margin-bottom:16px; color:#1a1a1a; }
.segment-card { display:flex; align-items:center; gap:16px; padding:14px; border:1px solid #eee; border-radius:8px; margin-bottom:8px; cursor:pointer; }
.segment-card:hover { border-color:#ccc; background:#fafafa; }
.segment-count { font-size:22px; font-weight:600; color:#1a1a1a; min-width:50px; text-align:center; }
.segment-info h4 { font-size:14px; font-weight:500; color:#1a1a1a; }
.segment-info p { font-size:12px; color:#999; }

/* Empty */
.empty-state { text-align:center; padding:60px 20px; color:#bbb; }
.empty-state i { font-size:40px; margin-bottom:16px; display:block; color:#ddd; }
.empty-state h3 { font-size:16px; color:#999; margin-bottom:8px; font-weight:500; }
.btn { padding:10px 20px; border-radius:6px; font-size:14px; font-weight:500; font-family:'Inter',sans-serif; cursor:pointer; border:none; }
.btn-primary { background:#1a1a1a; color:#fff; }
.btn-primary:hover { background:#333; }
.btn-outline { background:#fff; color:#666; border:1px solid #e0e0e0; }
.btn-outline:hover { background:#fafafa; border-color:#ccc; color:#1a1a1a; }

/* Page visibility */
.page { display:none; }
.page.active { display:block; }

/* Voice note player */
.voice-note { margin:4px 0; }
.voice-note audio { width:100%; max-width:250px; height:32px; }
.voice-transcript { font-size:12px; color:#666; margin-top:6px; padding:6px 10px; background:#f5f5f5; border-radius:6px; font-style:italic; }
.msg.outbound .voice-transcript { background:rgba(255,255,255,0.15); color:rgba(255,255,255,0.8); }

/* Train AI button */
.train-btn { display:flex; align-items:center; gap:6px; margin-top:8px; padding:6px 14px; background:#1a1a1a; color:#fff; border:none; border-radius:20px; font-size:12px; font-weight:500; font-family:'Inter',sans-serif; cursor:pointer; transition:all 0.1s; }
.train-btn:hover { background:#333; }
.train-btn i { font-size:13px; }
.train-btn.trained { background:#666; }


/* Split pane messages */
.msg-split { display:flex; height:calc(100vh - 140px); }
.msg-list-pane { width:380px; min-width:320px; border-right:1px solid #e0e0e0; overflow-y:auto; flex-shrink:0; }
.msg-preview-pane { flex:1; overflow-y:auto; background:#fafafa; }
.msg-preview-pane .empty-preview { display:flex; align-items:center; justify-content:center; height:100%; color:#bbb; font-size:14px; }
.msg-row { display:flex; align-items:center; padding:14px 24px; border-bottom:1px solid #f0f0f0; cursor:pointer; transition:background 0.15s; }
.msg-row:hover { background:#fafafa; }
.msg-row.selected { background:#f0f4ff; border-left:3px solid #1a1a1a; }
.msg-row.reviewed .msg-badge { background:#22c55e !important; }
.msg-tab { padding:10px 20px; border:none; background:transparent; font-size:13px; font-family:Inter,sans-serif; cursor:pointer; color:#666; border-bottom:2px solid transparent; }
.msg-tab.active { color:#1a1a1a; font-weight:500; border-bottom-color:#1a1a1a; }
.msg-full-view { position:absolute; inset:0; background:#fff; z-index:100; overflow-y:auto; }

/* Mobile: stack instead of split */
@media (max-width: 768px) {
  .msg-split { flex-direction:column; height:auto; }
  .msg-list-pane { width:100%; min-width:0; border-right:none; border-bottom:1px solid #e0e0e0; max-height:none; }
  .msg-preview-pane { display:none; }
  .msg-split.has-preview .msg-list-pane { display:none; }
  .msg-split.has-preview .msg-preview-pane { display:block; }
  .msg-row { padding:12px 16px; }
}



/* Brain Fullscreen */
.brain-fullscreen { position:fixed; top:0; left:0; right:0; bottom:0; z-index:9999; background:#0a0a0f; display:flex; flex-direction:column; }
.brain-fullscreen canvas { flex:1; width:100%; }
.brain-fullscreen-close { position:absolute; top:16px; right:16px; background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2); color:#fff; width:40px; height:40px; border-radius:50%; cursor:pointer; font-size:18px; display:flex; align-items:center; justify-content:center; z-index:10; }
.brain-fullscreen-close:hover { background:rgba(255,255,255,0.2); }
.brain-fullscreen-title { position:absolute; top:20px; left:20px; color:rgba(255,255,255,0.6); font-size:14px; font-family:Inter,sans-serif; z-index:10; }
.brain-expand-btn { position:absolute; top:12px; right:12px; background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.15); color:rgba(255,255,255,0.5); width:32px; height:32px; border-radius:8px; cursor:pointer; font-size:14px; display:flex; align-items:center; justify-content:center; z-index:3; transition:all 0.15s; }
.brain-expand-btn:hover { background:rgba(255,255,255,0.2); color:#fff; }
.brain-viz-tooltip2 { position:fixed; display:none; background:rgba(255,255,255,0.95); backdrop-filter:blur(8px); border-radius:10px; padding:14px 18px; max-width:320px; box-shadow:0 8px 32px rgba(0,0,0,0.3); pointer-events:none; z-index:10000; border:1px solid rgba(255,255,255,0.2); }
.brain-viz-tooltip2 .tt-cat { font-size:10px; text-transform:uppercase; letter-spacing:0.5px; color:#999; margin-bottom:2px; }
.brain-viz-tooltip2 .tt-title { font-size:14px; font-weight:600; color:#1a1a1a; margin-bottom:6px; }
.brain-viz-tooltip2 .tt-content { font-size:12px; color:#555; line-height:1.4; }
.brain-viz-tooltip2 .tt-meta { font-size:10px; color:#bbb; margin-top:6px; }

/* Brain Page Layout */
.brain-page { max-width:960px; margin:0 auto; }
.brain-hero { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:32px; }
@media (max-width:768px) { .brain-hero { grid-template-columns:1fr; } }
.brain-card { position:relative; border-radius:16px; overflow:hidden; cursor:pointer; transition:transform 0.2s, box-shadow 0.2s; background:linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%); min-height:320px; }
.brain-card:hover { transform:translateY(-2px); box-shadow:0 12px 40px rgba(0,0,0,0.3); }
.brain-card-header { position:absolute; top:0; left:0; right:0; padding:20px 20px 0; z-index:2; }
.brain-card-title { font-size:18px; font-weight:600; color:rgba(255,255,255,0.95); margin:0 0 4px; font-family:Inter,sans-serif; }
.brain-card-subtitle { font-size:12px; color:rgba(255,255,255,0.4); font-family:Inter,sans-serif; line-height:1.4; }
.brain-card-canvas { width:100%; height:260px; }
.brain-card-stats { position:absolute; bottom:0; left:0; right:0; padding:12px 20px; display:flex; gap:16px; background:linear-gradient(transparent, rgba(0,0,0,0.6)); z-index:2; }
.brain-card-stat { font-size:11px; color:rgba(255,255,255,0.5); font-family:Inter,sans-serif; }
.brain-card-stat strong { color:rgba(255,255,255,0.85); }

.brain-expanded { display:none; }
.brain-expanded.active { display:block; }
.brain-expanded-back { display:inline-flex; align-items:center; gap:6px; padding:8px 0; margin-bottom:16px; font-size:13px; color:#999; cursor:pointer; border:none; background:none; font-family:Inter,sans-serif; }
.brain-expanded-back:hover { color:#333; }
.brain-expanded-viz { border-radius:16px; overflow:hidden; margin-bottom:24px; background:linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%); }
.brain-expanded-canvas { width:100%; height:460px; }

.brain-section-heading { font-size:18px; font-weight:600; color:#1a1a1a; margin:0 0 4px; }
.brain-section-sub { font-size:13px; color:#999; margin:0 0 20px; }

.integrations-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:12px; }
.integration-card { border:1px solid #e8e8e8; border-radius:12px; padding:20px; text-align:center; opacity:0.5; }
.integration-card-icon { font-size:28px; margin-bottom:8px; }
.integration-card-name { font-size:14px; font-weight:500; color:#333; margin-bottom:4px; }
.integration-card-badge { display:inline-block; font-size:10px; background:#f0f0f0; color:#999; padding:2px 8px; border-radius:10px; }

/* Brain Neural Visualization */
.brain-viz-container { position:relative; width:100%; height:460px; border-radius:16px; overflow:hidden; margin-bottom:24px; background:linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%); }
.brain-viz-canvas { width:100%; height:100%; cursor:grab; }
.brain-viz-canvas:active { cursor:grabbing; }
.brain-viz-tooltip { position:absolute; display:none; background:rgba(255,255,255,0.95); backdrop-filter:blur(8px); border-radius:10px; padding:14px 18px; max-width:320px; box-shadow:0 8px 32px rgba(0,0,0,0.3); pointer-events:none; z-index:10; border:1px solid rgba(255,255,255,0.2); }
.brain-viz-tooltip .tt-cat { font-size:10px; text-transform:uppercase; letter-spacing:0.5px; color:#999; margin-bottom:2px; }
.brain-viz-tooltip .tt-title { font-size:14px; font-weight:600; color:#1a1a1a; margin-bottom:6px; }
.brain-viz-tooltip .tt-content { font-size:12px; color:#555; line-height:1.4; }
.brain-viz-tooltip .tt-meta { font-size:10px; color:#bbb; margin-top:6px; }
.brain-viz-label { position:absolute; bottom:16px; left:16px; color:rgba(255,255,255,0.3); font-size:12px; font-family:Inter,sans-serif; pointer-events:none; }
.brain-viz-stats { position:absolute; top:16px; right:16px; display:flex; gap:8px; }
.brain-viz-stat { background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.1); border-radius:8px; padding:6px 12px; color:rgba(255,255,255,0.6); font-size:11px; font-family:Inter,sans-serif; }
.brain-viz-stat strong { color:rgba(255,255,255,0.9); }

/* Brain Dashboard */
.brain-tabs { display:flex; gap:0; border-bottom:1px solid #e0e0e0; margin-bottom:24px; }
.brain-tab { padding:12px 20px; border:none; background:transparent; font-size:14px; font-family:Inter,sans-serif; cursor:pointer; color:#999; border-bottom:2px solid transparent; transition:all 0.15s; }
.brain-tab:hover { color:#666; }
.brain-tab.active { color:#1a1a1a; font-weight:500; border-bottom-color:#1a1a1a; }
.brain-entry { background:#fff; border:1px solid #e0e0e0; border-radius:10px; padding:16px 20px; margin-bottom:12px; transition:box-shadow 0.15s; }
.brain-entry:hover { box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.brain-entry-header { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.brain-entry-category { font-size:11px; text-transform:uppercase; letter-spacing:0.5px; color:#999; background:#f5f5f5; padding:2px 8px; border-radius:4px; }
.brain-entry-title { font-size:14px; font-weight:600; color:#1a1a1a; }
.brain-entry-content { font-size:13px; color:#555; line-height:1.5; }
.brain-entry-meta { display:flex; gap:12px; margin-top:8px; font-size:11px; color:#bbb; }
.brain-entry-actions { display:flex; gap:6px; margin-left:auto; }
.brain-entry-actions button { padding:4px 10px; border:1px solid #e0e0e0; background:#fff; border-radius:4px; font-size:11px; cursor:pointer; color:#666; font-family:Inter,sans-serif; }
.brain-entry-actions button:hover { background:#f5f5f5; }
.brain-entry-actions button.delete:hover { background:#fef2f2; color:#ef4444; border-color:#fca5a5; }
.brain-empty { text-align:center; padding:40px 20px; color:#bbb; }
.brain-empty i { font-size:32px; margin-bottom:12px; display:block; }
.brain-stat { display:inline-block; padding:4px 12px; background:#f5f5f5; border-radius:6px; font-size:12px; color:#666; margin-right:8px; margin-bottom:8px; }
.activity-item { display:flex; gap:12px; padding:12px 0; border-bottom:1px solid #f5f5f5; }
.activity-dot { width:8px; height:8px; border-radius:50%; margin-top:6px; flex-shrink:0; }
.activity-dot.learned { background:#22c55e; }
.activity-dot.updated { background:#3b82f6; }
.activity-dot.manual { background:#8b5cf6; }
.activity-dot.deleted { background:#ef4444; }
.activity-text { font-size:13px; color:#555; }
.activity-time { font-size:11px; color:#bbb; }
.instinct-badge { display:inline-block; padding:2px 6px; background:#fef3c7; color:#92400e; border-radius:4px; font-size:10px; font-weight:500; }

/* Universal voice component */
.voice-record-btn { width:64px; height:64px; border-radius:50%; background:#1a1a1a; border:none; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:transform 0.15s, box-shadow 0.15s; box-shadow:0 4px 16px rgba(0,0,0,0.12); }
.voice-record-btn:hover { transform:scale(1.05); box-shadow:0 6px 24px rgba(0,0,0,0.18); }
.voice-record-btn:active { transform:scale(0.95); }
.voice-record-btn svg { width:24px; height:24px; }
.voice-waveform-bar { width:3px; border-radius:2px; background:#ef4444; transition:height 0.05s; }

/* Training panel */
.train-panel { background:#fafafa; border:1px solid #e0e0e0; border-radius:8px; padding:20px; margin:12px 0; max-width:100%; }
.train-panel h4 { font-size:15px; font-weight:600; margin-bottom:4px; display:flex; align-items:center; gap:8px; color:#1a1a1a; }
.train-panel h4 i { color:#1a1a1a; }
.train-panel p.train-hint { font-size:13px; color:#999; margin-bottom:14px; }

/* Voice record button */
.record-area { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.record-btn { width:48px; height:48px; border-radius:50%; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:20px; transition:all 0.2s; }
.record-btn.idle { background:#1a1a1a; color:#fff; }
.record-btn.recording { background:#dc3545; color:#fff; animation:pulse 1s infinite; }
.record-btn.idle:hover { background:#333; }
@keyframes pulse { 0%,100% { box-shadow:0 0 0 0 rgba(220,53,69,0.4); } 50% { box-shadow:0 0 0 12px rgba(220,53,69,0); } }
.record-status { font-size:13px; color:#999; }
.record-status.active { color:#dc3545; font-weight:500; }
.record-playback { margin:10px 0; }
.record-playback audio { width:100%; height:36px; }

/* AI summary */
.ai-summary { background:#fff; border:1px solid #e0e0e0; border-radius:8px; padding:12px; margin:12px 0; }
.ai-summary .summary-label { font-size:11px; font-weight:600; color:#999; text-transform:uppercase; margin-bottom:6px; }
.ai-summary .summary-text { font-size:14px; line-height:1.5; color:#1a1a1a; }
.ai-summary .summary-actions { display:flex; gap:8px; margin-top:10px; }

/* Text area */
.train-text-area { width:100%; border:1px solid #e0e0e0; border-radius:6px; padding:10px 12px; font-family:'Inter',sans-serif; font-size:14px; resize:vertical; min-height:60px; outline:none; color:#1a1a1a; }
.train-text-area:focus { border-color:#1a1a1a; }
.train-text-area::placeholder { color:#ccc; }

/* Category pills */
.category-pills { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.cat-pill { padding:6px 14px; border:1px solid #e0e0e0; border-radius:20px; font-size:13px; cursor:pointer; background:#fff; font-family:'Inter',sans-serif; transition:all 0.1s; color:#666; }
.cat-pill:hover { border-color:#999; color:#1a1a1a; }
.cat-pill.active { background:#1a1a1a; border-color:#1a1a1a; color:#fff; }

/* Or divider */
.or-divider { display:flex; align-items:center; gap:12px; margin:14px 0; font-size:12px; color:#ccc; }
.or-divider::before, .or-divider::after { content:''; flex:1; height:1px; background:#eee; }

/* Existing feedback */
.existing-feedback { background:#f5f5f5; border-radius:6px; padding:8px 12px; margin-top:6px; font-size:12px; border-left:3px solid #ddd; }
.existing-feedback .fb-type { font-weight:600; color:#666; text-transform:uppercase; font-size:11px; }

/* Setup wizard */
.setup-step-dot { flex:1; padding:10px 12px; text-align:center; font-size:13px; font-weight:500; color:#bbb; background:#fafafa; border-radius:6px; cursor:pointer; transition:all 0.1s; border:1px solid #eee; }
.setup-step-dot.active { background:#1a1a1a; color:#fff; border-color:#1a1a1a; }
.setup-step-dot.done { background:#f0f0f0; color:#666; border-color:#ddd; }
.setup-step-dot:hover { background:#f0f0f0; }
.setup-step-dot.active:hover { background:#333; }
.voice-answer-area { margin-bottom:8px; }

/* ═══ MOBILE RESPONSIVE ═══ */
@media (max-width: 768px) {
  .header { padding:0 16px; height:48px; }
  .logo { width:auto; font-size:15px; }
  .topbar-user, .header-right .user-name { display:none; }
  .app-layout { flex-direction:column; }
  .sidebar { width:100%; border-right:none; border-bottom:1px solid #eee; padding:8px 0; display:flex; overflow-x:auto; flex-shrink:0; }
  .sidebar::-webkit-scrollbar { display:none; }
  .nav-section-label { display:none; }
  .nav-divider { display:none; }
  .nav-item { padding:8px 16px; white-space:nowrap; font-size:13px; border-bottom:none; border-left:none; }
  .nav-item i { display:none; }
  .nav-item.active { background:#f0f0f0; border-radius:20px; border-left:none; }
  .nav-back { padding:8px 16px; white-space:nowrap; font-size:13px; }
  .main-content { padding:16px; }
  .page-header h1 { font-size:20px; }
  .module-grid { grid-template-columns:1fr; gap:12px; }
  .stats-row { grid-template-columns:repeat(2, 1fr); gap:10px; }
  .inbox-layout { flex-direction:column; height:auto; min-height:60vh; }
  .inbox-list { width:100%; max-height:200px; border-right:none; border-bottom:1px solid #eee; }
  .inbox-chat { min-height:400px; }
  .msg { max-width:85%; }
  .train-panel { padding:14px; }
  .category-pills { gap:4px; }
  .cat-pill { padding:5px 10px; font-size:12px; }
  .section-box { padding:16px; }
  .dev-toolbar { padding:4px 12px; gap:4px; font-size:11px; }
  .voice-note audio { max-width:100%; }
  .inbox-list.hidden-mobile { display:none; }
  .inbox-chat.fullscreen-mobile { min-height:calc(100vh - 200px); }
}

@media (max-width: 400px) {
  .setup-step-dot { font-size:10px; padding:6px 4px; }
  .stats-row { grid-template-columns:1fr 1fr; gap:8px; }
  .main-content { padding:12px; }
}

/* Broadcast tabs */
.bc-tab { padding:10px 16px; font-size:14px; color:#999; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.1s; }
.bc-tab:hover { color:#1a1a1a; }
.bc-tab.active { color:#1a1a1a; font-weight:500; border-bottom-color:#1a1a1a; }
.bc-tab-count { background:#f0f0f0; color:#999; font-size:12px; padding:1px 8px; border-radius:10px; margin-left:4px; }
.bc-tab.active .bc-tab-count { background:#1a1a1a; color:#fff; }

/* Broadcast steps */
.bc-step { display:flex; align-items:center; gap:8px; font-size:14px; color:#bbb; cursor:pointer; }
.bc-step.active { color:#1a1a1a; font-weight:500; }
.bc-step.done { color:#666; }
.bc-step-num { width:24px; height:24px; border-radius:50%; border:1.5px solid #ddd; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; }
.bc-step.active .bc-step-num { background:#1a1a1a; color:#fff; border-color:#1a1a1a; }
.bc-step.done .bc-step-num { background:#666; color:#fff; border-color:#666; }
.bc-step-line { flex:0 0 40px; height:1px; background:#ddd; align-self:center; }
.bc-composer-step { }

/* Template cards */
.bc-template { padding:10px 16px; border:1px solid #e0e0e0; border-radius:6px; cursor:pointer; font-size:13px; color:#666; }
.bc-template:hover { border-color:#999; color:#1a1a1a; background:#fafafa; }

/* Quill overrides */
.ql-toolbar { border-color:#e0e0e0 !important; border-radius:6px 6px 0 0 !important; }
.ql-container { border-color:#e0e0e0 !important; border-radius:0 0 6px 6px !important; font-family:'Inter',sans-serif !important; font-size:14px !important; }

.merge-tag { padding:2px 8px;border:1px solid #e0e0e0;border-radius:4px;font-size:11px;font-family:'Inter',sans-serif;cursor:pointer;background:#fff;color:#666; }
.merge-tag:hover { border-color:#999;color:#1a1a1a;background:#fafafa; }
.contact-row:hover { background:#fafafa; }

/* Tag autocomplete */
.tag-autocomplete { position:relative; }
.tag-autocomplete input { width:100%;padding:8px;border:1px solid #e0e0e0;border-radius:6px;font-size:13px;font-family:'Inter',sans-serif;outline:none; }
.tag-autocomplete input:focus { border-color:#1a1a1a; }
.tag-dropdown { position:absolute;top:100%;left:0;right:0;background:#fff;border:1px solid #e0e0e0;border-radius:6px;margin-top:2px;max-height:200px;overflow-y:auto;z-index:200;display:none;box-shadow:0 4px 12px rgba(0,0,0,0.1); }
.tag-dropdown.show { display:block; }
.tag-dropdown-item { padding:8px 12px;cursor:pointer;font-size:13px;color:#333; }
.tag-dropdown-item:hover { background:#fafafa; }
.tag-dropdown-item.create { color:#1a1a1a;font-weight:500;border-bottom:1px solid #eee; }
.tag-dropdown-item.create i { margin-right:6px; }

.toast-container { position:fixed; top:20px; right:20px; z-index:100000; display:flex; flex-direction:column; gap:8px; }
.toast { padding:12px 20px; background:#1a1a1a; color:#fff; border-radius:8px; font-size:13px; font-family:'Inter',sans-serif; box-shadow:0 4px 16px rgba(0,0,0,0.15); animation:toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards; max-width:360px; }
.toast.success { background:#1a1a1a; }
.toast.error { background:#dc3545; }
.toast.info { background:#333; }
@keyframes toastIn { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }

.sidebar-item-truncate { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:180px; display:inline-block; vertical-align:middle; }
.dna-section-header { cursor:pointer; display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border:1px solid #e0e0e0; border-radius:10px; margin-bottom:8px; transition:background 0.15s; }
.dna-section-header:hover { background:#fafafa; }
.dna-section-body { display:none; padding:0 20px 20px; }
.dna-section-body.open { display:block; }
.dna-section-status { font-size:11px; padding:2px 8px; border-radius:10px; }
.dna-section-status.saved { background:#e8f5e9; color:#2e7d32; }
.dna-section-status.empty { background:#f5f5f5; color:#999; }
/* ── Universal Voice Component ── */
.uv-wrap { position:relative; }
.uv-textarea { width:100%; min-height:80px; padding:12px 14px 42px; border:1px solid #e0e0e0; border-radius:10px; font-size:14px; font-family:Inter,sans-serif; resize:vertical; color:#1a1a1a; outline:none; box-sizing:border-box; transition:border-color 0.2s; }
.uv-textarea:focus { border-color:#1a1a1a; }
.uv-mic-btn { position:absolute; bottom:10px; right:10px; width:32px; height:32px; border-radius:50%; background:#f5f5f5; border:1px solid #e0e0e0; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all 0.15s; color:#666; }
.uv-mic-btn:hover { background:#1a1a1a; color:#fff; border-color:#1a1a1a; }
.uv-mic-btn svg { width:14px; height:14px; }
.uv-overlay { position:absolute; inset:0; background:#fff; border-radius:10px; border:1px solid #e0e0e0; display:none; flex-direction:column; align-items:center; justify-content:center; gap:8px; z-index:2; box-shadow:0 2px 12px rgba(0,0,0,0.06); }
.uv-overlay.recording { display:flex; border-color:#ef4444; }
.uv-overlay.transcribing { display:flex; }
.uv-bars { display:flex; align-items:center; gap:2px; height:36px; }
.uv-bars div { width:3px; background:#ef4444; border-radius:2px; transition:height 0.05s; }
.uv-timer { font-size:20px; font-weight:600; color:#1a1a1a; font-variant-numeric:tabular-nums; font-family:Inter,sans-serif; }
.uv-actions { display:flex; gap:8px; margin-top:4px; }
.uv-btn { padding:8px 18px; border-radius:8px; font-size:13px; cursor:pointer; font-family:Inter,sans-serif; border:none; transition:opacity 0.15s; }
.uv-btn:hover { opacity:0.85; }
.uv-btn-cancel { background:#f5f5f5; color:#666; border:1px solid #e0e0e0; }
.uv-btn-stop { background:#ef4444; color:#fff; }
.uv-btn-redo { background:#f5f5f5; color:#1a1a1a; border:1px solid #e0e0e0; }
.uv-btn-accept { background:#1a1a1a; color:#fff; }
.uv-transcript { background:#f8f8f8; border-radius:8px; padding:12px 16px; text-align:left; max-height:120px; overflow-y:auto; width:calc(100% - 48px); margin:0 auto; }
.uv-transcript p { color:#1a1a1a; font-size:13px; line-height:1.5; margin:0; }
.uv-big-mic { width:72px; height:72px; border-radius:50%; background:#1a1a1a; border:none; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:transform 0.15s, box-shadow 0.15s; box-shadow:0 4px 16px rgba(0,0,0,0.12); }
.uv-big-mic:hover { transform:scale(1.05); box-shadow:0 6px 24px rgba(0,0,0,0.18); }
.uv-big-mic:active { transform:scale(0.95); }
.uv-big-mic svg { width:24px; height:24px; stroke:white; fill:none; stroke-width:2; }
.uv-hint { color:#999; font-size:12px; margin-top:8px; }

/* Legacy compat aliases */
.voice-input-wrap { position:relative; margin-bottom:16px; }
.voice-toggle { display:none; }
.voice-recording-overlay { display:none; }
.voice-stop-btn { padding:10px 28px; background:#ef4444; color:#fff; border:none; border-radius:8px; font-size:14px; font-weight:500; cursor:pointer; font-family:Inter,sans-serif; }
.voice-stop-btn:hover { background:#dc2626; }
.voice-transcribing { font-size:14px; color:#666; display:flex; align-items:center; gap:8px; }
.voice-btn { display:none; }

    /* WhatsApp Inbox — Transcript style (Muse-inspired) */
    .wa-inbox-layout { display:flex; gap:0; height:calc(100vh - 140px); border-radius:12px; overflow:hidden; background:#fff; }
    
    /* Contact list */
    .wa-inbox-list { width:320px; border-right:1px solid #eee; overflow-y:auto; background:#fff; }
    .wa-inbox-item { display:flex; align-items:center; gap:12px; padding:14px 18px; cursor:pointer; border-bottom:1px solid #f5f5f5; transition:background 0.15s; }
    .wa-inbox-item:hover { background:#fafafa; }
    .wa-inbox-item.active { background:#f5f5f5; border-left:3px solid #1a1a1a; }
    .wa-inbox-avatar { width:40px; height:40px; border-radius:50%; background:#f0f0f0; display:flex; align-items:center; justify-content:center; font-weight:600; color:#999; font-size:15px; flex-shrink:0; }
    .wa-inbox-item-info { flex:1; min-width:0; }
    .wa-inbox-item-name { font-weight:500; font-size:14px; color:#1a1a1a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .wa-inbox-item-preview { font-size:12px; color:#999; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
    .wa-inbox-item-meta { text-align:right; flex-shrink:0; }
    .wa-inbox-item-time { font-size:11px; color:#bbb; }
    .wa-inbox-item-status { font-size:11px; margin-top:2px; }

    /* Thread area */
    /* Thread — light mode (default) */
    .wa-inbox-thread { flex:1; display:flex; flex-direction:column; background:#efeae2; }
    .wa-inbox-thread-header { padding:12px 16px; border-bottom:1px solid #e0e0e0; display:flex; justify-content:space-between; align-items:center; background:#f0f2f5; }
    .wa-inbox-thread-header h3 { margin:0; font-size:16px; font-weight:500; color:#111b21; }
    .wa-inbox-thread-tabs { display:flex; gap:0; border-bottom:1px solid #e0e0e0; background:#f0f2f5; }
    .wa-tab-btn { padding:10px 20px; border:none; background:transparent; color:#667781; cursor:pointer; font-size:13px; font-family:Inter,sans-serif; border-bottom:2px solid transparent; transition:all 0.15s; }
    .wa-tab-btn:hover { color:#111b21; }
    .wa-tab-btn.active { color:#111b21; font-weight:500; border-bottom-color:#00a884; }
    .wa-inbox-thread-messages { flex:1; overflow-y:auto; padding:12px 4px; background:#efeae2; }

    /* Thread — dark mode (toggle) */
    .wa-dark .wa-inbox-thread { background:#0b141a; }
    .wa-dark .wa-inbox-thread-header { border-bottom-color:#222d34; background:#202c33; }
    .wa-dark .wa-inbox-thread-header h3 { color:#e9edef; }
    .wa-dark .wa-inbox-thread-tabs { border-bottom-color:#222d34; background:#202c33; }
    .wa-dark .wa-tab-btn { color:#8696a0; }
    .wa-dark .wa-tab-btn.active { color:#e9edef; }
    .wa-dark .wa-inbox-thread-messages { background:#0b141a; }
    .wa-msg-date-divider { text-align:center; padding:20px 0 12px; }
    .wa-msg-date-divider span { color:#bbb; font-size:12px; font-weight:500; }
    .wa-transcript-line { display:flex; gap:16px; padding:8px 0; align-items:flex-start; border-bottom:1px solid transparent; transition:background 0.1s; }
    .wa-transcript-line:hover { background:#fafafa; border-radius:6px; }
    .wa-transcript-time { font-size:13px; color:#bbb; min-width:45px; padding-top:1px; font-variant-numeric:tabular-nums; flex-shrink:0; }
    .wa-transcript-speaker { font-size:13px; font-weight:600; color:#1a1a1a; min-width:60px; flex-shrink:0; }
    .wa-transcript-speaker.ai { color:#25D366; }
    .wa-transcript-text { font-size:14px; line-height:1.6; color:#333; flex:1; }
    .wa-transcript-voice { color:#999; font-style:italic; }

    /* Reply bar */
    .wa-inbox-reply { display:flex; gap:10px; padding:8px 12px; border-top:1px solid #e0e0e0; align-items:center; background:#f0f2f5; }
    .wa-inbox-reply input { flex:1; padding:9px 14px; border:1px solid #ccc; border-radius:8px; background:#fff; color:#111b21; font-size:14px; outline:none; font-family:Inter,sans-serif; }
    .wa-dark .wa-inbox-reply { border-top-color:#222d34; background:#202c33; }
    .wa-dark .wa-inbox-reply input { border-color:#2a3942; background:#2a3942; color:#e9edef; }
    .wa-inbox-reply input:focus { border-color:#1a1a1a; }
    .wa-inbox-reply button { padding:9px 18px; border-radius:8px; border:none; background:#00a884; color:#fff; font-weight:500; font-size:13px; cursor:pointer; font-family:Inter,sans-serif; }
    .wa-inbox-reply button:hover { background:#333; }

    @media (max-width: 768px) { 
      .wa-inbox-list { width:100%; } 
      .wa-inbox-thread { display:none; }
    }
      .wa-inbox-layout { height:calc(100vh - 120px); }
    }

.builder-tab{background:none;border:none;padding:10px 20px;cursor:pointer;font-size:14px;font-weight:500;color:#888;border-bottom:2px solid transparent;margin-bottom:-2px;font-family:Inter,sans-serif;}
        .builder-tab.active{color:#1a1a1a;border-bottom-color:#1a1a1a;}
        .builder-card{background:#fff;border:1px solid #e0e0e0;border-radius:8px;padding:20px;cursor:pointer;transition:box-shadow .2s;}
        .builder-card:hover{box-shadow:0 2px 8px rgba(0,0,0,0.08);}
        .builder-card-title{font-size:16px;font-weight:600;color:#1a1a1a;margin-bottom:4px;}
        .builder-card-meta{font-size:12px;color:#888;}
        .builder-card-actions{display:flex;justify-content:space-between;align-items:center;margin-top:12px;}
        .builder-card .dot-menu{position:relative;cursor:pointer;padding:4px 8px;font-size:18px;color:#888;}
        .builder-card .dot-menu:hover{color:#1a1a1a;}
        .builder-page-card{background:#fff;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden;}
        .builder-page-thumb{height:140px;background:#f0f0f0;display:flex;align-items:center;justify-content:center;color:#ccc;font-size:32px;position:relative;overflow:hidden;}
        .builder-page-info{padding:12px;}
        .builder-page-info .name{font-weight:600;font-size:14px;color:#1a1a1a;margin-bottom:8px;}
        .builder-page-actions{display:flex;gap:8px;align-items:center;}
        .builder-page-actions button{background:none;border:1px solid #e0e0e0;border-radius:4px;padding:4px 10px;cursor:pointer;font-size:12px;color:#1a1a1a;}
        .builder-page-actions button:hover{background:#f5f5f5;}
        .builder-reorder{cursor:grab;color:#ccc;margin-right:8px;}
        .builder-reorder:hover{color:#888;}