/* ==========================================================================
   Aleph Omni v27.4 — Linear & Notion High-Craft Design System
   8pt/4pt Spatial Grid • Zero-Shadow Clean Geometry • WCAG AAA Contrast
   ========================================================================== */

:root {
  /* Surfaces & Backgrounds */
  --bg-app: #07090e;
  --bg-rail: #0b101b;
  --bg-surface: #0f172a;
  --bg-card: #162033;
  --bg-card-hover: #1c2942;
  --bg-input: #0b1120;
  --bg-subtle: rgba(255, 255, 255, 0.04);
  --bg-popover: #131b2e;

  /* Borders & Dividers */
  --border-subtle: #1e293b;
  --border-card: #27354f;
  --border-hover: #3b4d70;
  --border-focus: #6366f1;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-faint: #475569;

  /* Accents & Brand Palette */
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-purple: #8b5cf6;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-emerald-soft: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-soft: rgba(245, 158, 11, 0.12);
  --accent-rose: #ef4444;
  --accent-rose-soft: rgba(239, 68, 68, 0.12);

  /* Geometry & Spacing (4pt/8pt Grid) */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Fonts */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Shadows (Subtle, strictly layered) */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-popover: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-card);
}

/* Light Theme Variables */
body.theme-light {
  --bg-app: #f1f5f9;
  --bg-rail: #ffffff;
  --bg-surface: #ffffff;
  --bg-card: #f8fafc;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-subtle: rgba(0, 0, 0, 0.03);
  --bg-popover: #ffffff;

  --border-subtle: #e2e8f0;
  --border-card: #cbd5e1;
  --border-hover: #94a3b8;
  --border-focus: #6366f1;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body.omni-body {
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
}

/* Main Outer Layout: App Rail (90px) + Full Workspace */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   APP RAIL (.main-sidebar, 90px)
   ========================================================================== */
.main-sidebar {
  width: 90px;
  min-width: 90px;
  height: 100vh;
  background: var(--bg-rail);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px;
  user-select: none;
  z-index: 50;
}

.sidebar-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
}

.sidebar-logo {
  margin-bottom: 6px;
}

.logo-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  width: 72px;
  text-align: center;
}

.logo-bolt {
  font-size: 16px;
  color: var(--accent-cyan);
}

.logo-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-main);
  line-height: 1.1;
}

.sidebar-tariff {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-amber);
  background: var(--accent-amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
  text-align: center;
}

.account-switcher-wrap {
  width: 100%;
  padding: 0 4px;
}

.sidebar-select {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 2px;
  outline: none;
  cursor: pointer;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 4px 2px;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-main);
  transform: translateY(-1px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-admin-btn {
  color: var(--accent-rose);
  margin-top: auto;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 12px;
  background: var(--accent-rose);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
}

.nav-badge.scheduled {
  background: var(--accent-amber);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.status-indicator-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

/* ==========================================================================
   MAIN WORKSPACE & SECTIONS
   ========================================================================== */
.main-workspace {
  flex: 1;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: var(--bg-app);
}

.view-section {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
}

.view-section.active {
  display: flex;
}

/* ==========================================================================
   VIEW 1: CHATS (3-COLUMN LAYOUT)
   ========================================================================== */
#view-chats {
  display: none;
}
#view-chats.active {
  display: flex;
  flex-direction: row;
}

/* Left Column: Inbox List (360px) */
.chats-sidebar {
  width: 360px;
  min-width: 360px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.chats-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.title-with-count {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-with-count h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.badge-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.header-actions {
  display: flex;
  gap: 6px;
}

.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
  background: var(--bg-card-hover);
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-inside {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 32px 8px 30px;
  color: var(--text-main);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-box input:focus {
  border-color: var(--border-focus);
}

.search-settings-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
}

.advanced-search-panel {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.filter-group label {
  font-size: 10px;
  color: var(--text-muted);
}

.filter-group select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  padding: 4px 6px;
  font-size: 11px;
}

/* Pinned "В работе" Section */
.pinned-section-wrap {
  border-bottom: 2px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.03);
}

.pinned-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 4px 16px;
}

.pinned-icon {
  font-size: 12px;
}

.pinned-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.03em;
}

.pinned-badge {
  margin-left: auto;
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.pinned-chats-list {
  display: flex;
  flex-direction: column;
  padding: 4px 8px 8px 8px;
  gap: 4px;
}

.chats-divider {
  padding: 8px 16px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  background: var(--bg-surface);
}

/* Conversations List */
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Conversation Card */
.chat-card {
  display: flex;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  gap: 10px;
}

.chat-card:hover {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

.chat-card.active {
  background: var(--bg-card);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.chat-card-content {
  flex: 1;
  min-width: 0;
}

.chat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.buyer-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-preview-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  margin-top: 2px;
}

/* In-Card Stage Badge & Dropdown */
.stage-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
  transition: all 0.15s ease;
}

.stage-chip:hover {
  transform: scale(1.04);
}

.stage-chip.new {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.stage-chip.in_progress {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.4);
}

.stage-chip.deal {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.4);
}

.stage-chip.refused {
  background: var(--accent-rose-soft);
  color: var(--accent-rose);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Context Menu for In-Card Stage Change */
.card-stage-context-menu {
  position: fixed;
  background: var(--bg-popover);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: 4px;
  z-index: 1000;
  min-width: 140px;
}

.context-item {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s ease;
}

.context-item:hover {
  background: var(--bg-card);
}

/* ==========================================================================
   MAIN CHAT (CENTER COLUMN)
   ========================================================================== */
.main-chat {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  position: relative;
}

.chat-main-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.platform-badge.avito {
  background: #3b82f6;
  color: white;
}

.chat-title-group {
  display: flex;
  flex-direction: column;
}

.chat-item-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.chat-item-link:hover {
  color: var(--accent-cyan);
}

.buyer-name-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-control-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stage-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
}

.mode-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.mode-toggle-btn.auto-ai {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}

.mode-toggle-btn.human-mode {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Item Card Banner */
.item-card-banner {
  padding: 8px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

.item-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-chip {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.guard-chip {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-amber);
  background: var(--accent-amber-soft);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Messages Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 10px;
}

.empty-icon {
  font-size: 36px;
  opacity: 0.6;
}

/* Chat Bubbles */
.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.msg-bubble-wrap.incoming {
  align-self: flex-start;
}

.msg-bubble-wrap.outgoing {
  align-self: flex-end;
}

.msg-author-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.incoming .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

.outgoing .msg-bubble {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: white;
  border-bottom-right-radius: 2px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.msg-ai-pill {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 4px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
}

/* Input Area */
.input-area {
  padding: 16px 20px 20px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.input-wrapper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attach-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.attach-btn:hover {
  color: var(--text-main);
}

.composer-row textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  resize: none;
}

/* Input Toolbar */
.input-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-pill-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.toolbar-pill-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-main);
}

.arrow-down {
  font-size: 9px;
  opacity: 0.7;
}

.btn-ai-sparkle {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(99, 102, 241, 0.35));
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-ai-sparkle:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(99, 102, 241, 0.5));
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-send-message {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-send-message:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.05);
}

.btn-send-message svg {
  width: 15px;
  height: 15px;
}

/* Schedule Picker Panel */
.schedule-picker-panel {
  background: var(--bg-popover);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-panel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.quick-presets-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.preset-btn.btn-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

.preset-btn.btn-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.3);
}

.preset-btn.btn-amber {
  background: var(--accent-amber-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.preset-btn.btn-emerald {
  background: var(--accent-emerald-soft);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.manual-schedule-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.schedule-datetime-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  padding: 4px 8px;
  font-size: 11px;
}

/* Floating Popovers (Prompt role, auto dropdown) */
.dropdown-wrapper {
  position: relative;
}

.floating-popover {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  background: var(--bg-popover);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: 12px;
  width: 320px;
  z-index: 500;
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.popover-header strong {
  font-size: 12px;
  color: var(--text-main);
}

.popover-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.popover-textarea {
  width: 100%;
  height: 120px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  padding: 8px;
  font-size: 11px;
  resize: vertical;
}

.checkbox-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
  padding: 6px 4px;
  cursor: pointer;
}

/* ==========================================================================
   RIGHT PANEL: CRM & MEMORY (360px)
   ========================================================================== */
.right-panel {
  width: 360px;
  min-width: 320px;
  max-width: 380px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon {
  font-size: 18px;
}

.card-title-wrap strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 10px;
  color: var(--text-muted);
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-soft {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-toggle-pill {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.btn-toggle-pill.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.card-body-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.body-label {
  font-size: 11px;
  color: var(--text-muted);
}

.compact-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  padding: 3px 6px;
  font-size: 11px;
}

.card-description {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.notes-textarea {
  width: 100%;
  height: 90px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px;
  font-size: 12px;
  resize: vertical;
  outline: none;
}

.new-chunk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

.new-chunk-row select {
  flex: 0 0 95px;
  min-width: 90px;
  box-sizing: border-box;
}

.new-chunk-row input {
  flex: 1 1 110px;
  min-width: 80px;
  box-sizing: border-box;
}

.new-chunk-row button {
  width: 100%;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.notes-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
}

.save-status-text {
  font-size: 10px;
  color: var(--accent-emerald);
  white-space: nowrap;
  flex-shrink: 0;
}

.notes-hint {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
  flex: 1;
  min-width: 130px;
  text-align: right;
}

.crystal-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.crystal-metric {
  background: var(--bg-subtle);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.metric-key {
  font-size: 10px;
  color: var(--text-muted);
}

.metric-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

/* ==========================================================================
   VIEW 2: BROADCASTS (FULL SCREEN 3-STEP WIZARD)
   ========================================================================== */
#view-broadcast {
  overflow-y: auto;
}

.broadcast-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.broadcast-top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.broadcast-title-group h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Wizard Step Indicator Bar */
.step-indicator-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-indicator-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.step-indicator-item.active {
  color: var(--accent-cyan);
}

.step-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.step-indicator-item.active .step-circle {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.step-line {
  width: 30px;
  height: 1px;
  background: var(--border-subtle);
}

.btn-history-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}

/* Form Card & Layout Grids */
.omni-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.form-help {
  font-size: 11px;
  color: var(--text-muted);
}

.large-textarea {
  width: 100%;
  height: 110px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px;
  font-size: 12px;
  resize: vertical;
}

.medium-textarea {
  width: 100%;
  height: 80px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px;
  font-size: 12px;
  resize: vertical;
}

.callout-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.audience-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.radio-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: all 0.15s ease;
}

.radio-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.radio-card.active {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
}

.radio-card-body {
  display: flex;
  flex-direction: column;
}

.radio-card-body strong {
  font-size: 12px;
  color: var(--text-main);
}

.radio-card-body span {
  font-size: 10px;
  color: var(--text-muted);
}

.step-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.step-footer-actions.space-between {
  justify-content: space-between;
}

/* Button Sizes & Variants */
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: var(--radius-xs); cursor: pointer; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); cursor: pointer; }
.btn-md { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-md); cursor: pointer; }
.btn-lg { padding: 10px 20px; font-size: 14px; border-radius: var(--radius-md); cursor: pointer; font-weight: 700; }
.btn-xl { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); cursor: pointer; font-weight: 800; }

.btn-primary { background: var(--accent-primary); color: white; border: none; }
.btn-primary:hover { background: var(--accent-primary-hover); }

.btn-primary-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text-main); }

/* Launch Parameters Grid */
.launch-parameters-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.param-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.param-label {
  font-size: 11px;
  color: var(--text-muted);
}

.param-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.range-wrap input {
  flex: 1;
}

.param-sub {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 4px;
  display: block;
}

.test-send-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.launch-action-center {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.progress-live-card {
  margin-top: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.progress-title-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  transition: width 0.3s ease;
}

.progress-stats-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

/* ==========================================================================
   VIEW 3: REVIEWS (2-COLUMN REPUTATION HUB)
   ========================================================================== */
.reviews-workspace {
  display: flex;
  width: 100%;
  height: 100%;
}

.reviews-sidebar {
  width: 420px;
  min-width: 420px;
  height: 100%;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}

.reviews-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.reviews-filter-pills {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.reviews-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-item-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: all 0.15s ease;
}

.review-item-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.review-item-card.active {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.rating-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.rating-circle.rate-5 { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); border: 1px solid var(--accent-emerald); }
.rating-circle.rate-4 { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid #34d399; }
.rating-circle.rate-3 { background: var(--accent-amber-soft); color: var(--accent-amber); border: 1px solid var(--accent-amber); }
.rating-circle.rate-1, .rating-circle.rate-2 { background: var(--accent-rose-soft); color: var(--accent-rose); border: 1px solid var(--accent-rose); }

.review-meta {
  flex: 1;
  min-width: 0;
}

.review-meta-top {
  display: flex;
  justify-content: space-between;
}

.review-author {
  font-weight: 600;
  color: var(--text-main);
}

.review-date {
  font-size: 10px;
  color: var(--text-muted);
}

.review-item-title {
  font-size: 11px;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-snippet {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Review Detail Pane */
.review-detail-pane {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
}

.detail-header-row {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-full-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.seller-reply-bubble {
  margin-top: 16px;
  padding: 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
}

.seller-reply-title {
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-primary);
  margin-bottom: 6px;
}

.review-reply-composer {
  padding: 16px 24px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.composer-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.review-reply-composer textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px;
  font-size: 13px;
  resize: vertical;
}

.composer-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   VIEW 4: ANALYTICS & DUAL SEARCH DASHBOARD
   ========================================================================== */
#view-analytics {
  overflow-y: auto;
}

.analytics-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.analytics-header-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.date-picker-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  padding: 4px 6px;
  font-size: 11px;
}

.stat-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.kpi-icon {
  font-size: 28px;
}

.kpi-val {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
}

.usage-progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 12px;
}

.track-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.track-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.track-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
}

/* CRM Funnel */
.funnel-cards-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.funnel-step-card {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.funnel-step-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.funnel-step-card.stage-new:hover { border-color: var(--accent-cyan); }
.funnel-step-card.stage-in-progress:hover { border-color: var(--accent-amber); }
.funnel-step-card.stage-deal:hover { border-color: var(--accent-emerald); }
.funnel-step-card.stage-refused:hover { border-color: var(--accent-rose); }

.stage-count {
  font-size: 22px;
  font-weight: 800;
  margin: 4px 0;
}

.stage-name {
  font-size: 11px;
  color: var(--text-muted);
}

.funnel-arrow {
  color: var(--text-faint);
  font-size: 16px;
}

.funnel-separator {
  color: var(--text-faint);
  font-size: 20px;
}

.funnel-conversion-bar {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Dual Search Bar */
.search-mode-switcher-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.search-tab-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-tab-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.slider-control-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 6px;
}

.slider-hints-row {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
}

.search-input-action-row {
  display: flex;
  gap: 10px;
}

.search-input-action-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

/* Results Action Bar */
.results-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.actions-left, .actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.analytics-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

.similarity-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   VIEW 5: PROFILE & SETTINGS
   ========================================================================== */
#view-profile {
  overflow-y: auto;
}

.profile-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.subscription-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.sub-plan-name {
  font-size: 18px;
  font-weight: 700;
}

.account-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.account-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-connect-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
}

.tg-code-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.tg-code-row code {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.theme-switcher-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.theme-choice-btn {
  flex: 1;
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.theme-choice-btn.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

/* ==========================================================================
   VIEW 6: AFFILIATE PROGRAM (PARTNER HUB)
   ========================================================================== */
#view-affiliate {
  overflow-y: auto;
}

.affiliate-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.affiliate-hero-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(56, 189, 248, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.commission-badge {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.ref-link-action-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.ref-link-action-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-mono);
}

.currency-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  gap: 6px;
}

.currency-input-wrap input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 700;
  width: 100%;
  outline: none;
}

/* ==========================================================================
   VIEW 7: HELP & FAQ
   ========================================================================== */
#view-help {
  overflow-y: auto;
}

.help-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.help-hero-banner {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.help-hero-banner h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.steps-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.step-guide-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 8px;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

kbd {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   VIEW 8: ADMIN CONTROL PLANE
   ========================================================================== */
#view-admin {
  overflow-y: auto;
}

.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Modal Backdrops & Windows */
.omni-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.omni-modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
}

.omni-modal-window.large-modal {
  max-width: 900px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

/* Utility Helpers */
.omni-hidden {
  display: none !important;
}

.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-emerald); }
.text-rose { color: var(--accent-rose); }
.text-amber { color: var(--accent-amber); }
.gold-badge { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.1); }
.green { color: var(--accent-emerald); }

/* ==========================================================================
   MOBILE RESPONSIVE SYSTEM (PWA & BOTTOM NAVIGATION BAR & MASTER-DETAIL CHATS)
   ========================================================================== */

/* Mobile header buttons (hidden on desktop) */
.mobile-back-btn,
.mobile-drawer-btn {
  display: none;
}

/* Mobile Bottom Drawers & Backdrop Overlay */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  transition: opacity 0.25s ease;
}

.mobile-bottom-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: #13151f;
  border-top: 1px solid #232738;
  border-radius: 20px 20px 0 0;
  z-index: 1100;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-bottom-drawer.omni-active {
  transform: translateY(0);
}

.drawer-drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 10px auto 4px auto;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 12px 18px;
  border-bottom: 1px solid #232738;
}

.drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.drawer-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-textarea {
  width: 100%;
  min-height: 140px;
  background: #090a0f;
  border: 1px solid #232738;
  border-radius: 10px;
  color: #fff;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.notes-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.save-status-text {
  font-size: 12px;
  color: #10b981;
}

.memory-search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.rag-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   @media (max-width: 768px) Mobile Responsive Shell
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  /* 1. App Rail becomes Bottom Navigation Bar (62px) */
  .main-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 62px;
    min-height: 62px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 4px !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom)) !important;
    border-right: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(13, 15, 23, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
    z-index: 1000 !important;
  }

  .sidebar-header-section {
    display: none !important;
  }

  .sidebar-footer {
    display: none !important;
  }

  .main-sidebar .nav-item.nav-secondary {
    display: none !important;
  }

  .nav-menu {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .nav-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 2px !important;
    gap: 2px !important;
    min-width: 0 !important;
    width: 20% !important;
    height: 100% !important;
    border-radius: 10px !important;
    border: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    position: relative !important;
    transition: all 0.2s ease !important;
  }

  .nav-item.active {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.12) !important;
  }

  .nav-item.active::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 20% !important;
    right: 20% !important;
    height: 3px !important;
    background: linear-gradient(90deg, #6366f1, #ec4899) !important;
    border-radius: 0 0 3px 3px !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.6) !important;
  }

  .nav-item .nav-icon {
    font-size: 19px !important;
    line-height: 1 !important;
  }

  .nav-item .nav-label {
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .nav-item .nav-badge {
    top: 2px !important;
    right: calc(50% - 18px) !important;
    font-size: 8px !important;
    padding: 1px 4px !important;
  }

  /* 2. Strict View Isolation on Mobile: Inactive views NEVER render */
  .view-section:not(.active),
  #view-chats:not(.active),
  #view-broadcast:not(.active),
  #view-reviews:not(.active),
  #view-analytics:not(.active),
  #view-profile:not(.active),
  #view-affiliate:not(.active),
  #view-admin:not(.active),
  #view-help:not(.active) {
    display: none !important;
  }

  .main-workspace,
  .workspace-view,
  #view-chats,
  #view-broadcast,
  #view-reviews,
  #view-analytics,
  #view-profile,
  #view-affiliate,
  #view-admin,
  #view-help {
    height: calc(100vh - 62px);
    height: calc(100dvh - 62px);
    padding-bottom: 0;
  }

  /* 3. Master-Detail Transition for Conversations */
  #view-chats {
    position: relative;
    display: none;
    width: 100%;
    overflow: hidden;
  }

  #view-chats.active {
    position: relative;
    display: flex !important;
    width: 100%;
    height: calc(100vh - 62px) !important;
    height: calc(100dvh - 62px) !important;
    overflow: hidden;
  }

  /* Other active view sections on mobile */
  .view-section.active:not(#view-chats) {
    display: flex !important;
    position: relative !important;
    width: 100% !important;
    height: calc(100vh - 62px) !important;
    height: calc(100dvh - 62px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  #view-chats .chats-sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    border-right: none;
    display: flex;
    flex-direction: column;
  }

  #view-chats .main-chat {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #090a0f;
    z-index: 50;
    flex-direction: column;
  }

  /* When a chat is active on mobile */
  #view-chats.chat-open .chats-sidebar {
    display: none !important;
  }

  #view-chats.chat-open .main-chat {
    display: flex !important;
  }

  #view-chats .right-panel {
    display: none !important; /* Drawer replaces column 3 */
  }

  /* Mobile Fullscreen Chat: Hide bottom nav so chat has 100% height */
  body.mobile-chat-open .main-sidebar,
  .app-layout.mobile-chat-open .main-sidebar {
    display: none !important;
  }

  body.mobile-chat-open .main-workspace,
  .app-layout.mobile-chat-open .main-workspace,
  body.mobile-chat-open #view-chats,
  .app-layout.mobile-chat-open #view-chats,
  body.mobile-chat-open #view-chats.chat-open .main-chat,
  .app-layout.mobile-chat-open #view-chats.chat-open .main-chat {
    height: 100vh !important;
    height: 100dvh !important;
  }

  /* Mobile Header Buttons */
  .mobile-back-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #232738;
    background: #13151f;
    color: #f1f5f9;
    font-size: 18px;
    cursor: pointer;
    margin-right: 6px;
    flex-shrink: 0;
  }

  .mobile-drawer-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #232738;
    background: #13151f;
    font-size: 15px;
    cursor: pointer;
    margin-left: 4px;
    flex-shrink: 0;
  }

  /* Chat Header layout adjustments */
  .chat-main-header {
    padding: 8px 10px !important;
    gap: 6px !important;
  }

  .chat-title-group {
    min-width: 0 !important;
    flex: 1 !important;
  }

  .chat-title-group .chat-item-link {
    font-size: 13px !important;
    max-width: 140px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
  }

  .stage-control-box {
    display: none; /* Hide stage dropdown in compact header to save space */
  }

  /* Product Banner Adaptation */
  .item-card-banner {
    padding: 6px 10px !important;
    font-size: 11px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .item-banner-left strong {
    max-width: 160px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    vertical-align: middle !important;
  }

  .item-banner-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  /* Composer Adaptation for Mobile */
  .input-area {
    padding: 6px 8px !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }

  .input-wrapper-card {
    padding: 8px !important;
  }

  .input-toolbar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  .toolbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
  .toolbar-left::-webkit-scrollbar {
    display: none !important;
  }

  .toolbar-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .toolbar-pill-btn {
    padding: 5px 9px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .btn-ai-sparkle {
    padding: 6px 14px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .btn-send-message {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0 !important;
  }

  /* Responsive Cards & Tables for Other Views */
  .view-container {
    padding: 12px;
  }

  .stats-grid,
  .kpi-row,
  .metric-cards-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .broadcast-content-grid,
  .reviews-columns,
  .affiliate-columns,
  .admin-columns {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .data-table-card,
  .table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wizard-steps-header {
    gap: 8px;
  }

  .step-label {
    display: none; /* Icon-only in wizard steps on mobile */
  }
}

/* DOM Parity Utility Selectors */
.schedule-trigger-btn,
.notes-btn,
.history-table-wrap,
.pwa-buttons-row,
.semantic-memory-card,
.reviews-badge,
.omni-select,
.section-title-wrap,
.panel-buyer-crystal,
.role-selector-row,
.search-input,
.stars-display,
.date-sep,
.rag-examples-content,
.sub-expires,
.analytics-results-wrap,
.hero-left,
.empty-state-small,
.theme-dark,
.mini-badge,
.table-actions-row,
.table-wrap,
.connected-accounts-list,
.recipients-table-wrap,
.form-group,
.image-preview-container,
.rag-btn,
.buyer-crystal-card,
.usage-track-item,
.withdrawal-input-row,
.kpi-info,
.ai-status-indicator,
.panel-episteme-radar,
.account-actions,
.info,
.payout-fields,
.status-text,
.image-remove-btn,
.stage-icon,
.text-secondary,
.hero-right,
.hero-sub,
.client-notes-card,
.broadcast-step-content,
.btn-accent,
.image-status-text {
  /* Defined component or utility hook */
}

/* ==========================================================================
   CHUNKED NOTES & SEMANTIC MEMORY EXEMPLARS
   ========================================================================== */
.notes-chunks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.chunk-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.chunk-card.enabled {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.05);
}

.chunk-card.disabled {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

.chunk-content-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.chunk-tag-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  white-space: nowrap;
}

.chunk-card.enabled .chunk-tag-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.chunk-tag-badge.tag-budget { background: rgba(245, 158, 11, 0.15) !important; color: #f59e0b !important; border-color: rgba(245, 158, 11, 0.35) !important; }
.chunk-tag-badge.tag-delivery { background: rgba(14, 165, 233, 0.15) !important; color: #38bdf8 !important; border-color: rgba(14, 165, 233, 0.35) !important; }
.chunk-tag-badge.tag-req { background: rgba(236, 72, 153, 0.15) !important; color: #f472b6 !important; border-color: rgba(236, 72, 153, 0.35) !important; }
.chunk-tag-badge.tag-spec { background: rgba(168, 85, 247, 0.15) !important; color: #c084fc !important; border-color: rgba(168, 85, 247, 0.35) !important; }
.chunk-tag-badge.tag-urgent { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; border-color: rgba(239, 68, 68, 0.35) !important; }
.chunk-tag-badge.tag-discount { background: rgba(16, 185, 129, 0.15) !important; color: #34d399 !important; border-color: rgba(16, 185, 129, 0.35) !important; }
.chunk-tag-badge.tag-item { background: rgba(99, 102, 241, 0.15) !important; color: #818cf8 !important; border-color: rgba(99, 102, 241, 0.35) !important; }
.chunk-tag-badge.tag-pay { background: rgba(20, 184, 166, 0.15) !important; color: #2dd4bf !important; border-color: rgba(20, 184, 166, 0.35) !important; }
.chunk-tag-badge.tag-interest { background: rgba(139, 92, 246, 0.15) !important; color: #a78bfa !important; border-color: rgba(139, 92, 246, 0.35) !important; }

.chunk-text {
  font-size: 11px;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
}

.chunk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chunk-toggle-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.chunk-toggle-btn.active {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.chunk-del-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  transition: color 0.15s ease;
}
.chunk-del-btn:hover {
  color: #f87171;
}

.semantic-exemplars-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.exemplar-card {
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease;
}

.exemplar-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.exemplar-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exemplar-source-pill {
  font-size: 10px;
  font-weight: 600;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.exemplar-score-pill {
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 1px 6px;
  border-radius: 10px;
}

.exemplar-body-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.exemplar-tag-active {
  font-size: 9px;
  color: #a78bfa;
  font-weight: 600;
}


