/* ============================================================
   RACRM v5.99.632.113 — RUTHLESS 26 THEME (default)
   Phase 1 Visual Design Polish — Dark Cockpit
   ============================================================ */
:root {
  /* --- Color Palette: Dark Cockpit --- */
  --bg-primary: #0d1117;
  --bg-secondary: #111820;
  --bg-tertiary: #1a2332;
  --bg-card: #151d28;
  --bg-hover: #1c2636;
  --bg-input: #0a0f16;
  --border: #1e2a3a;
  --border-subtle: #162030;
  --border-focus: #FF2D55;
  --text-primary: #e6edf5;
  --text-secondary: #8b98a8;
  --text-muted: #556272;
  --accent: #FF2D55;
  --accent-hover: #ff4568;
  --accent-glow: rgba(255, 45, 85, 0.12);
  --accent-subtle: rgba(255, 45, 85, 0.08);
  --success: #34d399;
  --success-glow: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-glow: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-glow: rgba(248, 113, 113, 0.12);
  --error: #f87171;
  --info: #60a5fa;
  --info-glow: rgba(96, 165, 250, 0.12);
  --richness-5: #34d399;
  --richness-4: #22c55e;
  --richness-3: #fbbf24;
  --richness-2: #f59e0b;
  --richness-1: #f87171;
  --richness-0: #4b5563;

  /* --- Typography --- */
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --fs-page-title: 22px;
  --fs-section-header: 16px;
  --fs-card-title: 14px;
  --fs-body: 13px;
  --fs-label: 11px;
  --fs-meta: 10px;
  --fw-bold: 700;
  --fw-semibold: 600;
  --fw-medium: 500;
  --fw-regular: 400;
  --lh: 1.45;

  /* --- Spacing Scale --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;

  /* --- Component Tokens --- */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --radius-pill: 100px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.2);
  --transition: 0.15s ease;
  --transition-slow: 0.25s ease;

  /* --- Button Tokens --- */
  --btn-height: 36px;
  --btn-height-sm: 28px;
  --btn-px: 16px;
  --btn-fs: 13px;
  --btn-radius: var(--radius-sm);

  /* --- Input Tokens --- */
  --input-height: 36px;
  --input-px: 12px;
  --input-fs: 13px;
  --input-radius: var(--radius-sm);

  /* --- Card Tokens --- */
  --card-padding: var(--sp-4);
  --card-radius: var(--radius);
  --card-border: 1px solid var(--border);
  --card-gap: var(--sp-2);

  /* --- Density: comfortable (default) --- */
  --density-card-pad: 16px;
  --density-row-pad: 10px 14px;
  --density-row-gap: 0;
  --density-fs-body: 13px;
  --density-fs-meta: 10px;
  --density-section-gap: 16px;

  /* --- Legacy compat --- */
  --bevel-raised: none;
  --bevel-sunken: none;
  --bevel-btn: none;
}

/* --- Density: Compact Mode --- */
[data-density="compact"] {
  --density-card-pad: 10px;
  --density-row-pad: 6px 12px;
  --density-row-gap: 0;
  --density-fs-body: 12px;
  --density-fs-meta: 9px;
  --density-section-gap: 10px;
  --fs-body: 12px;
  --fs-card-title: 13px;
  --fs-label: 10px;
  --fs-meta: 9px;
  --card-padding: 10px;
  --sp-4: 12px;
  --btn-height: 32px;
  --btn-height-sm: 24px;
  --input-height: 32px;
}

/* Density toggle button */
.density-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.density-toggle:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.density-toggle .density-icon { font-size: 12px; line-height: 1; }

/* Classic 94 Theme */
[data-theme="classic94"] {
  --bg-primary: #C0C0C0;
  --bg-secondary: #d4d0c8;
  --bg-tertiary: #C0C0C0;
  --bg-card: #ffffff;
  --bg-hover: #e0ddd5;
  --bg-input: #ffffff;
  --border: #808080;
  --border-focus: #000080;
  --text-primary: #000000;
  --text-secondary: #222222;
  --text-muted: #444444;
  --accent: #000080;
  --accent-hover: #0000cc;
  --accent-glow: rgba(0,0,128,0.12);
  --shadow: none;
  --shadow-lg: none;
  --radius: 0px;
  --bevel-raised: inset 3px 3px 0 #ffffff, inset -3px -3px 0 #808080, 2px 2px 0 #808080, -2px -2px 0 #ffffff;
  --bevel-sunken: inset 3px 3px 0 #808080, inset -3px -3px 0 #ffffff, 2px 2px 0 #ffffff, -2px -2px 0 #808080;
  --bevel-btn: inset 3px 3px 0 #ffffff, inset -3px -3px 0 #808080, 2px 2px 0 #808080, -2px -2px 0 #ffffff;
}

[data-theme="classic94"] .topbar {
  background: #000080;
  border-bottom: 3px solid #808080;
  box-shadow: inset 0 -1px 0 #404040;
}

[data-theme="classic94"] .topbar-brand {
  color: #ffffff;
  font-weight: 700;
}

[data-theme="classic94"] .topbar-brand span {
  color: #c0c0c0;
}

[data-theme="classic94"] .topbar-stat {
  color: #c0c0c0;
}

[data-theme="classic94"] .topbar-stat strong {
  color: #ffffff;
}

[data-theme="classic94"] .theme-btn {
  box-shadow: var(--bevel-btn);
  background: #C0C0C0;
  border: none;
  color: #000000;
  font-weight: 700;
  padding: 4px 10px;
}

[data-theme="classic94"] .theme-btn:hover {
  background: #d4d0c8;
}

[data-theme="classic94"] .theme-btn.active {
  box-shadow: var(--bevel-sunken);
  background: #b0b0b0;
  color: #000080;
  font-weight: 700;
  border: none;
}

[data-theme="classic94"] .list-panel {
  box-shadow: var(--bevel-sunken);
  border-right: 2px solid #808080;
}

[data-theme="classic94"] .ai-panel {
  box-shadow: var(--bevel-sunken);
}

[data-theme="classic94"] .ai-input-area {
  background: #C0C0C0;
  border-top: 2px solid #808080;
}

[data-theme="classic94"] .ai-input-area button {
  box-shadow: var(--bevel-btn);
  background: #C0C0C0;
  color: #000000;
  font-weight: 700;
}

[data-theme="classic94"] .ai-input-area button:hover {
  background: #d4d0c8;
}

[data-theme="classic94"] .ai-input-area input {
  box-shadow: var(--bevel-sunken);
  border: none;
  background: #ffffff;
}

[data-theme="classic94"] .ai-quick-actions {
  background: #C0C0C0;
  border-top: 2px solid #808080;
}

[data-theme="classic94"] .filter-chip {
  box-shadow: var(--bevel-btn);
  border: none;
  background: #C0C0C0;
  color: #000000;
  border-radius: 0;
  font-weight: 600;
}

[data-theme="classic94"] .filter-chip:hover, [data-theme="classic94"] .filter-chip.active {
  box-shadow: var(--bevel-sunken);
  color: #000080;
  background: #b0b0b0;
}

[data-theme="classic94"] .quick-chip {
  box-shadow: var(--bevel-btn);
  border: none;
  background: #C0C0C0;
  color: #000000;
  border-radius: 0;
  font-weight: 600;
}

[data-theme="classic94"] .quick-chip:hover {
  box-shadow: var(--bevel-sunken);
  color: #000080;
}

[data-theme="classic94"] .detail-panel {
  box-shadow: var(--bevel-raised);
  border-left: 2px solid #808080;
}

[data-theme="classic94"] .detail-header {
  background: #000080;
  border-bottom: 2px solid #808080;
}

[data-theme="classic94"] .detail-header h2 {
  color: #ffffff;
}

[data-theme="classic94"] .detail-close {
  background: #C0C0C0;
  box-shadow: var(--bevel-btn);
  border: none;
  color: #000000;
}

[data-theme="classic94"] .detail-close:hover {
  background: #d4d0c8;
  color: #000080;
}

[data-theme="classic94"] .ask-ruthless-detail-btn {
  background: #C0C0C0;
  box-shadow: var(--bevel-btn);
  color: #000080;
  font-weight: 700;
}

[data-theme="classic94"] .ask-ruthless-detail-btn:hover {
  background: #d4d0c8;
}

[data-theme="classic94"] .ask-ruthless-row-btn {
  border: none;
  box-shadow: var(--bevel-btn);
  background: #C0C0C0;
  color: #000080;
  border-radius: 0;
}

[data-theme="classic94"] .ask-ruthless-row-btn:hover {
  background: #d4d0c8;
  color: #000080;
}

[data-theme="classic94"] .list-pagination {
  background: #C0C0C0;
  border-top: 2px solid #808080;
}

[data-theme="classic94"] .list-pagination button {
  box-shadow: var(--bevel-btn);
  border: none;
  background: #C0C0C0;
  color: #000000;
  font-weight: 600;
}

[data-theme="classic94"] .list-pagination button:hover {
  background: #d4d0c8;
}

[data-theme="classic94"] .detail-tabs {
  background: #C0C0C0;
}

[data-theme="classic94"] .detail-tab {
  color: #000000;
  border-bottom: none;
  box-shadow: var(--bevel-btn);
  margin: 2px 1px;
}

[data-theme="classic94"] .detail-tab:hover {
  color: #000080;
}

[data-theme="classic94"] .detail-tab.active {
  box-shadow: var(--bevel-sunken);
  background: #d4d0c8;
  color: #000080;
  font-weight: 700;
}

[data-theme="classic94"] .ai-header {
  background: #000080;
  color: #ffffff;
  border-bottom: 2px solid #808080;
}

[data-theme="classic94"] .ai-header h2 {
  color: #ffffff;
}

[data-theme="classic94"] .ai-header .ai-subtitle {
  color: #c0c0c0;
}

[data-theme="classic94"] .ai-header .ai-dot {
  background: #00ff00;
  box-shadow: 0 0 4px #00ff00;
}

[data-theme="classic94"] .ai-msg.system {
  box-shadow: var(--bevel-sunken);
  background: #C0C0C0;
  border: none;
}

[data-theme="classic94"] .ai-msg.user {
  box-shadow: var(--bevel-raised);
  background: #ffffff;
  border: none;
  color: #000080;
}

[data-theme="classic94"] .ai-msg.assistant {
  box-shadow: var(--bevel-sunken);
  background: #C0C0C0;
  border: none;
  border-left: none;
}

[data-theme="classic94"] .ai-action-btn {
  box-shadow: var(--bevel-btn);
  background: #C0C0C0;
  border: none;
  color: #000080;
  border-left: none;
  border-radius: 0;
}

[data-theme="classic94"] .ai-action-btn:hover {
  box-shadow: var(--bevel-sunken);
  background: #d4d0c8;
  color: #000080;
}

[data-theme="classic94"] .account-row {
  border-bottom: 1px solid #808080;
}

[data-theme="classic94"] .account-list {
  box-shadow: var(--bevel-sunken);
  background: #ffffff;
}

[data-theme="classic94"] .ai-messages {
  box-shadow: var(--bevel-sunken);
  background: #ffffff;
}

[data-theme="classic94"] .account-row.selected {
  background: #000080;
  color: #ffffff;
  border-left: 3px solid #000080;
}

[data-theme="classic94"] .account-row.selected .acct-name {
  color: #ffffff;
}

[data-theme="classic94"] .account-row.selected .acct-meta span {
  color: #c0c0c0;
}

[data-theme="classic94"] .account-row.selected .acct-stage {
  background: #0000aa;
  color: #ffffff;
}

[data-theme="classic94"] .contact-card {
  box-shadow: var(--bevel-sunken);
  border: none;
}

[data-theme="classic94"] .log-form {
  box-shadow: var(--bevel-sunken);
  border: none;
  background: #C0C0C0;
}

[data-theme="classic94"] .log-form select,
[data-theme="classic94"] .log-form input,
[data-theme="classic94"] .log-form textarea {
  box-shadow: var(--bevel-sunken);
  border: none;
}

[data-theme="classic94"] .log-form button {
  box-shadow: var(--bevel-btn);
  background: #C0C0C0;
  color: #000080;
  font-weight: 700;
}

[data-theme="classic94"] .detail-field .field-value.clickable {
  color: #000080;
  text-decoration: underline;
}

[data-theme="classic94"] .detail-content {
  box-shadow: var(--bevel-sunken);
  background: #d4d0c8;
}

[data-theme="classic94"] .detail-field select,
[data-theme="classic94"] .detail-field input {
  box-shadow: var(--bevel-sunken);
  border: none;
  background: #ffffff;
}

/* Classic94 monospace on phone/email fields */
[data-theme="classic94"] .cc-info span,
[data-theme="classic94"] .field-value.clickable {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
}

[data-theme="classic94"] .list-header {
  background: #000080;
  border-bottom: 2px solid #808080;
}

[data-theme="classic94"] .list-header h3 {
  color: #ffffff;
}

[data-theme="classic94"] .list-header .list-count {
  color: #c0c0c0;
}

[data-theme="classic94"] .list-filters {
  background: #C0C0C0;
  border-bottom: 2px solid #808080;
}

[data-theme="classic94"] .topbar-search input {
  box-shadow: var(--bevel-sunken);
  border: none;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
}

[data-theme="classic94"] .topbar-search {
  background: #C0C0C0;
  padding: 2px;
  box-shadow: var(--bevel-sunken);
  border-radius: 0;
}

[data-theme="classic94"] .search-results-dropdown {
  box-shadow: var(--bevel-raised);
  border: 2px solid #808080;
}

[data-theme="classic94"] .reminder-card {
  box-shadow: var(--bevel-raised);
  border: 2px solid #000080;
  background: #C0C0C0;
}

[data-theme="classic94"] .reminder-card h3 {
  color: #000080;
}

[data-theme="classic94"] .reminder-card .rem-actions button {
  box-shadow: var(--bevel-btn);
  border: none;
  background: #C0C0C0;
}

[data-theme="classic94"] .reminder-card .rem-actions button.primary {
  background: #C0C0C0;
  color: #000080;
  font-weight: 700;
}

/* Dark View Theme */
[data-theme="dark"] {
  --bg-primary: #111827;
  --bg-secondary: #1a2233;
  --bg-tertiary: #1f2937;
  --bg-card: #1F2937;
  --bg-hover: #2d3a4d;
  --bg-input: #0f172a;
  --border: #374151;
  --border-subtle: #2d3748;
  --border-focus: #3B82F6;
  --text-primary: #E5E5E5;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --accent: #3B82F6;
  --accent-hover: #60A5FA;
  --accent-glow: rgba(59,130,246,0.12);
  --accent-subtle: rgba(59,130,246,0.08);
  --shadow: 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.4);
  --bevel-raised: none;
  --bevel-sunken: none;
  --bevel-btn: none;
}

[data-theme="dark"] .topbar {
  border-bottom: 1px solid #374151;
}

[data-theme="dark"] .ai-header {
  border-bottom: 1px solid #374151;
}

[data-theme="dark"] .ai-msg.system {
  background: #1F2937;
  border-color: #374151;
  color: #CBD5E1;
}

[data-theme="dark"] .ai-msg.assistant {
  background: #1F2937;
  border-color: #374151;
  border-left: 3px solid #3B82F6;
  color: #E5E5E5;
}

[data-theme="dark"] .account-row.selected {
  background: rgba(59,130,246,0.12);
  border-left-color: #3B82F6;
}

[data-theme="dark"] .detail-header {
  border-bottom: 1px solid #374151;
}

[data-theme="dark"] .list-header {
  background: #1F2937;
  border-bottom: 1px solid #374151;
}

[data-theme="dark"] .list-header h3 {
  color: #CBD5E1;
}

[data-theme="dark"] .detail-section h4 {
  color: #94A3B8;
  border-bottom-color: #374151;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 1fr 420px;
  grid-template-rows: 48px auto 1fr;
  height: 100vh;
  height: 100dvh;
  gap: 0;
}

.app.kanban-mode {
  grid-template-columns: 380px 1fr;
}

.app.kanban-mode.detail-open {
  grid-template-columns: 380px 1fr 480px;
}

.app.classic-mode {
  grid-template-columns: 1fr 480px;
}

.app.detail-open {
  grid-template-columns: 1fr 420px 480px;
}

/* Sandbox Banner */
.sandbox-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #92400e, #b45309, #92400e);
  color: #fef3c7;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 100;
}
.sandbox-banner .sb-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sandbox-banner .sb-exit {
  padding: 3px 10px;
  background: rgba(254, 243, 199, 0.15);
  border: 1px solid rgba(254, 243, 199, 0.4);
  color: #fef3c7;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}
.sandbox-banner .sb-exit:hover {
  background: rgba(254, 243, 199, 0.3);
  border-color: #fef3c7;
}

/* Top Bar */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-3);
  z-index: 100;
  min-height: 44px;
  overflow: visible;
}

.topbar-brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1.5px;
  white-space: nowrap;
  text-transform: uppercase;
}

.topbar-brand span {
  color: var(--text-muted);
  font-weight: var(--fw-regular);
  font-size: var(--fs-meta);
  margin-left: 6px;
  letter-spacing: 0;
  text-transform: none;
}

.topbar-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 7px var(--sp-3) 7px 32px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--input-radius);
  color: var(--text-primary);
  font-size: var(--fs-body);
  font-family: var(--font-body);
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
  height: var(--btn-height-sm);
}

.topbar-search input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.topbar-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--fs-body);
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: var(--sp-1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}

.search-results-dropdown .search-group-label {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
}

.search-results-dropdown .search-item {
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}

.search-results-dropdown .search-item:hover {
  background: var(--bg-hover);
}

.search-results-dropdown .search-item .si-name {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
}

.search-results-dropdown .search-item .si-meta {
  font-size: var(--fs-label);
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-shrink: 0;
}

.theme-btn {
  padding: var(--sp-1) 10px;
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.theme-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.theme-btn.active { border-color: var(--accent); color: #fff; background: var(--accent); font-weight: var(--fw-bold); }

.topbar-stat {
  font-size: var(--fs-label);
  color: var(--text-muted);
  white-space: nowrap;
}

.topbar-stat strong {
  color: var(--text-secondary);
}

/* ============================================================
   AI COMMAND CENTER (left panel)
   ============================================================ */
.ai-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.ai-header {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.ai-header .ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ai-header h2 {
  font-size: var(--fs-card-title);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.ai-header .ai-subtitle {
  font-size: var(--fs-label);
  color: var(--text-muted);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.ai-msg {
  max-width: 95%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-body);
  line-height: var(--lh);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ai-msg.system {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  align-self: flex-start;
}

.ai-msg.user {
  background: var(--accent-subtle);
  border: 1px solid rgba(255,45,85,0.25);
  color: var(--text-primary);
  align-self: flex-end;
}

.ai-msg.assistant {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text-primary);
  align-self: flex-start;
}

.ai-msg .account-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-weight: var(--fw-semibold);
}

.ai-msg .account-link:hover {
  color: var(--accent-hover);
}

/* Action buttons in AI responses */
.ai-msg .ai-action-btns {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

.ai-action-btn {
  padding: 5px var(--sp-3);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.ai-action-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.ai-action-btn.btn-log-call { border-left: 3px solid var(--success); }
.ai-action-btn.btn-draft-email { border-left: 3px solid var(--info); }
.ai-action-btn.btn-schedule { border-left: 3px solid var(--warning); }
.ai-action-btn.btn-update-stage { border-left: 3px solid var(--accent); }

/* Action Cards (Items 10/11) */
.ai-msg.action { white-space: normal; max-width: 100%; padding: 0; background: none; border: none; }
.action-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: var(--density-card-pad); transition: all 0.3s ease; }
.action-card:hover { border-color: var(--accent); }
.action-card.action-done { border-left-color: var(--success); background: var(--success-glow); }
.action-card.action-error-card { border-left-color: var(--danger); background: var(--danger-glow); }
.action-card.action-cancelled-card { opacity: 0.5; }
.action-header { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); font-size: var(--fs-body); color: var(--text-primary); font-weight: var(--fw-semibold); }
.action-match { font-size: var(--fs-label); color: var(--text-secondary); margin-bottom: var(--sp-2); display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.action-match-label { color: var(--text-muted); }
.action-details { background: var(--bg-tertiary); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.action-detail-row { font-size: var(--fs-label); padding: 2px 0; color: var(--text-secondary); }
.action-detail-label { color: var(--text-muted); margin-right: var(--sp-1); }
.action-btns { display: flex; gap: var(--sp-2); }
.action-btn { padding: var(--sp-2) var(--sp-4); border-radius: var(--btn-radius); border: none; font-size: var(--fs-label); font-weight: var(--fw-semibold); cursor: pointer; transition: all 0.15s ease; height: var(--btn-height-sm); display: inline-flex; align-items: center; font-family: var(--font-body); }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.action-exec-btn { background: var(--accent); color: #fff; }
.action-exec-btn:hover:not(:disabled) { background: var(--accent-hover); }
.action-cancel-btn { background: var(--bg-tertiary); color: var(--text-muted); border: 1px solid var(--border); }
.action-cancel-btn:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.action-result-msg { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--success); padding: var(--sp-1) 0; }
.bulk-card { border-left-color: #a855f7; }
.bulk-card.action-done { border-left-color: var(--success); }
.bulk-badge { font-size: 10px; font-weight: 700; background: #a855f7; color: #fff; padding: 1px 6px; border-radius: 3px; margin-left: 6px; letter-spacing: 0.5px; }
.bulk-preview { background: var(--bg-tertiary); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; max-height: 160px; overflow-y: auto; }
.bulk-preview-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.bulk-preview-row { font-size: 12px; padding: 2px 0; }
.query-card { border-left-color: #06b6d4; }
.query-badge { font-size: 10px; font-weight: 700; background: #06b6d4; color: #fff; padding: 1px 6px; border-radius: 3px; margin-left: 6px; letter-spacing: 0.5px; }
.query-results-table { overflow-x: auto; margin: 8px 0; }
.query-results-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.query-results-table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-weight: 600; font-size: 11px; white-space: nowrap; }
.query-results-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.query-results-table tr:hover td { background: var(--bg-tertiary); }
.field-concept-badge { font-size: 9px; font-weight: 700; background: #f59e0b; color: #000; padding: 1px 6px; border-radius: 3px; letter-spacing: 0.5px; }
.field-concept-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.field-concept-text { flex: 1; color: var(--text-primary); line-height: 1.4; }
.field-concept-date { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.field-concept-remove { cursor: pointer; color: var(--text-muted); font-size: 14px; line-height: 1; }
.field-concept-remove:hover { color: #f87171; }
.fsp-badge { font-size: 9px; font-weight: 700; background: #708238; color: #fff; padding: 1px 6px; border-radius: 3px; letter-spacing: 0.5px; }
.fsp-card { border-left: 3px solid #708238 !important; }
.fsp-card .action-header { color: #708238; }
.fsp-card.action-done { border-left-color: #4ade80 !important; }
.fsp-card.action-error-card { border-left-color: #f87171 !important; }
.fsp-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.fsp-section-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.fsp-item { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-left: 2px solid #708238; background: var(--bg-secondary); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 6px; font-size: 12px; }
.fsp-item-text { color: var(--text-primary); line-height: 1.5; }
.fsp-item-meta { display: flex; gap: 8px; align-items: center; font-size: 10px; color: var(--text-muted); }
.fsp-item-cat { font-size: 9px; font-weight: 600; background: rgba(112,130,56,0.2); color: #708238; padding: 1px 5px; border-radius: 2px; }
.fsp-panel-item { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--bg-secondary); }
.fsp-panel-item-text { font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.fsp-panel-item-meta { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.fsp-panel-remove { cursor: pointer; color: var(--text-muted); font-size: 12px; margin-left: auto; }
.fsp-panel-remove:hover { color: #f87171; }
.fsp-score { font-size: 9px; font-weight: 600; background: rgba(112,130,56,0.3); color: #708238; padding: 1px 5px; border-radius: 2px; }

.ai-input-area {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--sp-2);
}

.ai-input-area input {
  flex: 1;
  padding: 9px var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--input-radius);
  color: var(--text-primary);
  font-size: var(--fs-body);
  font-family: var(--font-body);
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
  height: var(--input-height);
}

.ai-input-area input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.ai-input-area button {
  padding: 9px 18px;
  background: var(--accent);
  border: none;
  border-radius: var(--btn-radius);
  color: #fff;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  height: var(--input-height);
}

.ai-input-area button:hover { background: var(--accent-hover); }
.ai-input-area button:disabled { opacity: 0.5; cursor: default; }

/* Phase 3: Voice input mic button */
.ai-mic-btn {
  width: var(--input-height);
  height: var(--input-height);
  padding: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: all var(--transition);
}
.ai-mic-btn:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent); }
.ai-mic-btn.listening {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  animation: mic-pulse 1.2s ease-in-out infinite;
}
.ai-mic-btn.unsupported, body.voice-unsupported .ai-mic-btn { display: none; }
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

/* Phase 4: Driving mode indicator */
.driving-badge {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  background: #16a34a;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  line-height: 1.3;
  pointer-events: none;
  z-index: 2;
}
body.driving-mode-active .driving-badge { display: block; }
body.driving-mode-active .ai-mic-btn {
  border-color: #16a34a;
  color: #16a34a;
}
.ai-mic-btn { position: relative; }
/* BATCH 1 ROUND 2 ITEM 6: TTS failure indicator (red flash) */
.ai-mic-btn.tts-error-flash {
  background: #dc2626 !important;
  color: #fff !important;
  border-color: #dc2626 !important;
  animation: tts-error-flash-anim 0.6s ease-out;
}
@keyframes tts-error-flash-anim {
  0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.8); }
  100% { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
}

/* Phase 3: Chat panel collapse (desktop) */
.app.chat-collapsed { grid-template-columns: 44px 1fr; }
.app.chat-collapsed.detail-open { grid-template-columns: 44px 1fr 480px; }
.app.chat-collapsed.classic-mode { grid-template-columns: 44px 1fr; }
/* WORKBENCH-TRUEFULLWIDTH-v1: Workbench is a true full-width surface — no chat rail at all. */
/* WORKBENCH-LAYOUT-FIX2-v1: true full-width Workbench. Override kanban-mode's grid-column:2 on subview-wrap. */
.app.view-workbench { grid-template-columns: 1fr !important; }
.app.view-workbench.kanban-mode > .subview-wrap { grid-column: 1 / -1 !important; }
.app.view-workbench > .subview-wrap { grid-column: 1 / -1 !important; }
.app.view-workbench .ai-panel { display: none !important; }
.app.chat-collapsed .ai-panel .ai-header > div:not(.ai-dot):not(.ai-collapse-btn),
.app.chat-collapsed .ai-panel .ai-messages,
.app.chat-collapsed .ai-panel .ai-quick-actions,
.app.chat-collapsed .ai-panel .ai-input-area { display: none; }
.app.chat-collapsed .ai-panel .ai-header {
  flex-direction: column;
  padding: var(--sp-3) 0;
  border-bottom: none;
  justify-content: flex-start;
  gap: var(--sp-2);
}
.ai-collapse-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}
.ai-collapse-btn:hover { color: var(--accent); background: var(--bg-hover); }
.app.chat-collapsed .ai-collapse-btn { font-size: 18px; padding: 6px; }

/* Phase 3: Keyboard shortcuts modal */
.shortcuts-modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
}
.shortcuts-modal {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-5);
  max-width: 480px; width: 100%; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.shortcuts-modal h3 { margin: 0 0 var(--sp-4) 0; color: var(--accent); font-size: 16px; }
.shortcuts-modal .sc-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.shortcuts-modal .sc-row:last-child { border-bottom: none; }
.shortcuts-modal .sc-key { font-family: var(--font-mono, monospace); background: var(--bg-tertiary); padding: 2px 8px; border-radius: var(--radius-xs); color: var(--accent); font-weight: var(--fw-semibold); }
.shortcuts-modal .sc-close { margin-top: var(--sp-4); width: 100%; padding: 9px; background: var(--accent); color: #fff; border: none; border-radius: var(--btn-radius); cursor: pointer; font-weight: var(--fw-semibold); }

/* Phase 3: Chain command result styling */
.chain-result-line { padding: 3px 0; font-family: var(--font-mono, monospace); font-size: 12px; }
.chain-result-line.ok { color: var(--success, #22c55e); }
.chain-result-line.fail { color: var(--danger, #dc2626); }
.chain-result-line.pending { color: var(--text-muted); }

/* Quick action chips */
.ai-quick-actions {
  padding: var(--sp-2) var(--sp-4);
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.quick-chip {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.quick-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ============================================================
   ACCOUNT LIST (right panel)
   ============================================================ */
.list-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.list-header {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-header h3 {
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.list-header .list-count {
  font-size: var(--fs-label);
  color: var(--text-muted);
}

.list-filters {
  padding: var(--sp-2) var(--sp-4);
  display: flex;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-wrap: wrap;
}

.filter-chip {
  padding: 3px var(--sp-2);
  font-size: var(--fs-meta);
  font-weight: var(--fw-medium);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-chip:hover, .filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.account-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.account-row {
  padding: var(--density-row-pad);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  position: relative;
}

.account-row:hover { background: var(--bg-hover); }
.account-row.selected { background: var(--accent-subtle); border-left: 3px solid var(--accent); }

.account-row .richness-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.account-row .acct-info {
  flex: 1;
  min-width: 0;
}

.account-row .acct-name {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-row .acct-meta {
  font-size: var(--density-fs-meta);
  color: var(--text-muted);
  display: flex;
  gap: var(--sp-2);
  margin-top: 1px;
}

.account-row .acct-stage {
  font-size: var(--density-fs-meta);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  flex-shrink: 0;
  font-weight: var(--fw-medium);
}

/* Ask Ruthless button on account rows */
.ask-ruthless-row-btn {
  padding: 3px var(--sp-2);
  font-size: var(--fs-meta);
  font-weight: var(--fw-semibold);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.account-row:hover .ask-ruthless-row-btn {
  opacity: 1;
}

.ask-ruthless-row-btn:hover {
  background: var(--accent);
  color: #fff;
}

.list-pagination {
  padding: var(--sp-2) var(--sp-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.list-pagination button {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.list-pagination button:hover { border-color: var(--accent); color: var(--accent); }
.list-pagination button:disabled { opacity: 0.3; cursor: default; }

.list-pagination .page-info {
  font-size: var(--fs-label);
  color: var(--text-muted);
}

/* ============================================================
   ACCOUNT DETAIL (third panel)
   ============================================================ */
.detail-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
  border-left: 1px solid var(--border);
}

.detail-header {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}

.detail-header h2 {
  font-size: var(--fs-section-header);
  font-weight: var(--fw-bold);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-header-actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.ask-ruthless-detail-btn {
  padding: 5px var(--sp-3);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  background: var(--accent);
  border: none;
  border-radius: var(--btn-radius);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  font-family: var(--font-body);
}

.ask-ruthless-detail-btn:hover {
  background: var(--accent-hover);
}

.detail-close {
  padding: var(--sp-1) var(--sp-2);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
}

.detail-close:hover { color: var(--accent); border-color: var(--accent); }

.detail-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  flex-wrap: nowrap;
}
.detail-tabs::-webkit-scrollbar { height: 4px; }
.detail-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.detail-tab {
  flex: 0 0 auto;
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-body);
  background: none;
  white-space: nowrap;
}

.detail-tab:hover { color: var(--text-primary); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.detail-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-4);
}

/* Detail sections */
.detail-section {
  margin-bottom: var(--density-section-gap);
}

.detail-section h4 {
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-1);
  border-bottom: 1px solid var(--border);
}

.detail-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: var(--density-fs-body);
}

.detail-field .field-label {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.detail-field .field-value {
  color: var(--text-primary);
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-field .field-value.clickable {
  color: var(--accent);
  cursor: pointer;
}

.detail-field .field-value.clickable:hover {
  text-decoration: underline;
}

/* Editable fields */
.detail-field select,
.detail-field input[type="text"],
.detail-field input[type="date"],
.detail-field input[type="number"] {
  padding: 3px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: var(--density-fs-body);
  font-family: var(--font-body);
  max-width: 60%;
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}

/* Date picker calendar icon visibility for dark themes */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
  opacity: 1;
  padding: 2px;
}

.detail-field select:focus,
.detail-field input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Contact cards in detail */
.contact-card {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-2);
  transition: border-color var(--transition);
}

.contact-card:hover {
  border-color: var(--accent);
}

.contact-card .cc-name {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
}

.contact-card .cc-title {
  font-size: var(--fs-label);
  color: var(--text-muted);
}

.contact-card .cc-info {
  font-size: var(--fs-label);
  color: var(--text-secondary);
  margin-top: 3px;
}

.contact-card .cc-info span {
  cursor: pointer;
  color: var(--accent);
}

.contact-card .cc-info span:hover {
  text-decoration: underline;
}

.cc-verified { display: inline-block; font-size: 9px; font-weight: 700; background: #22c55e; color: #fff; padding: 1px 5px; border-radius: 3px; margin-left: 4px; letter-spacing: 0.3px; vertical-align: middle; }
.cc-unverified { display: inline-block; font-size: 9px; font-weight: 600; background: rgba(245,158,11,0.2); color: #f59e0b; padding: 1px 5px; border-radius: 3px; margin-left: 4px; letter-spacing: 0.3px; vertical-align: middle; }
.cc-source { display: inline-block; font-size: 9px; color: var(--text-muted); margin-left: 4px; }
.cc-find-email-btn { font-size: 10px; padding: 2px 8px; background: var(--accent); color: #fff; border: none; border-radius: 3px; cursor: pointer; margin-top: 3px; font-weight: 600; }
.cc-find-email-btn:hover { opacity: 0.85; }
.cc-find-email-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cc-enrich-all-btn { font-size: 11px; padding: 4px 12px; background: #22c55e; color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-weight: 700; letter-spacing: 0.3px; }
.cc-enrich-all-btn:hover { opacity: 0.85; }
.cc-enrich-all-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cc-add-btn { font-size: 11px; padding: 4px 12px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.cc-add-btn:hover { opacity: 0.85; }
.cc-linkedin { font-size: 10px; color: #0077b5; cursor: pointer; margin-left: 4px; }
.cc-linkedin:hover { text-decoration: underline; }
.cc-actions { display: flex; gap: 4px; margin-top: 4px; align-items: center; }
.cc-delete-btn { font-size: 9px; padding: 1px 5px; background: transparent; color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px; cursor: pointer; }
.cc-delete-btn:hover { color: var(--danger); border-color: var(--danger); }

/* Deal History Timeline */
.dh-timeline { position: relative; padding-left: 20px; }
.dh-timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.dh-node { position: relative; margin-bottom: 14px; padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.dh-node::before { content: ''; position: absolute; left: -17px; top: 12px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-primary); }
.dh-node.dh-forward::before { border-color: var(--success); background: var(--success); }
.dh-node.dh-backward::before { border-color: var(--warning); background: var(--warning); }
.dh-node.dh-closed-won::before { border-color: #2ecc71; background: #2ecc71; box-shadow: 0 0 6px rgba(46,204,113,0.5); }
.dh-node.dh-closed-lost::before { border-color: #e74c3c; background: #e74c3c; }
.dh-stage-badge { display: inline-block; padding: 1px 6px; font-size: 10px; font-weight: 700; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px; }
.dh-stage-badge.from { background: var(--bg-tertiary); color: var(--text-muted); }
.dh-stage-badge.to { background: var(--accent); color: #fff; }
.dh-stage-badge.to.won { background: #2ecc71; }
.dh-stage-badge.to.lost { background: #e74c3c; }
.dh-arrow { display: inline-block; margin: 0 4px; color: var(--text-muted); font-size: 10px; }
.dh-meta { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.dh-reason { font-size: 11px; color: var(--text-secondary); margin-top: 3px; font-style: italic; }

/* Audit Log Panel */
.audit-panel { padding: 16px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.audit-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.audit-filters select { padding: 5px 8px; font-size: 11px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); outline: none; }
.audit-row { display: grid; grid-template-columns: 140px 80px 120px 100px 1fr; gap: 8px; padding: 6px 10px; font-size: 11px; border-bottom: 1px solid var(--border); align-items: start; }
.audit-row:hover { background: var(--bg-tertiary); }
.audit-row-header { font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-size: 10px; background: var(--bg-secondary); border-radius: var(--radius) var(--radius) 0 0; }
.audit-actor { font-weight: 600; color: var(--accent); }
.audit-action { padding: 1px 5px; border-radius: 3px; font-size: 10px; font-weight: 600; background: var(--bg-tertiary); color: var(--text-secondary); display: inline-block; }
.audit-target { color: var(--text-secondary); }
.audit-detail { color: var(--text-muted); font-size: 10px; word-break: break-word; }

/* Scout History Panel */
.scout-hist-panel { padding: 16px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.scout-hist-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.scout-hist-card { padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: border-color var(--transition); }
.scout-hist-card:hover { border-color: var(--accent); }
.scout-hist-card.unsaved { border-left: 3px solid var(--warning); }
.scout-hist-card.saved { border-left: 3px solid var(--success); }
.shc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.shc-company { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.shc-date { font-size: 10px; color: var(--text-muted); }
.shc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.shc-tag { display: inline-block; padding: 1px 6px; font-size: 10px; font-weight: 600; border-radius: 3px; background: var(--bg-tertiary); color: var(--text-secondary); }
.shc-tag.vertical { color: var(--accent); border: 1px solid var(--accent); background: transparent; }
.shc-tag.competitor { color: var(--warning); border: 1px solid var(--warning); background: transparent; }
.shc-tag.saved { color: var(--success); border: 1px solid var(--success); background: transparent; }
.shc-tag.curiosity { color: #9b59b6; border: 1px solid #9b59b6; background: transparent; }
.shc-signals { font-size: 11px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.shc-actions { display: flex; gap: 6px; margin-top: 6px; }
.shc-btn { padding: 3px 10px; font-size: 10px; font-weight: 600; border-radius: var(--radius); cursor: pointer; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-secondary); }
.shc-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Templates Panel */
.templates-panel { padding: 16px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.tpl-card { padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; transition: border-color var(--transition); }
.tpl-card:hover { border-color: var(--accent); }
.tpl-card.inactive { opacity: 0.5; }
.tpl-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.tpl-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.tpl-stats { display: flex; gap: 8px; align-items: center; }
.tpl-stat { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; background: var(--bg-tertiary); color: var(--text-muted); }
.tpl-stat.uses { color: var(--accent); }
.tpl-stat.wins { color: var(--success); background: rgba(46,204,113,0.15); }
.tpl-stat.rate { color: var(--warning); }
.tpl-subject { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.tpl-body-preview { font-size: 11px; color: var(--text-muted); line-height: 1.4; max-height: 44px; overflow: hidden; }
.tpl-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tpl-tag { display: inline-block; padding: 1px 6px; font-size: 10px; font-weight: 600; border-radius: 3px; background: var(--bg-tertiary); color: var(--text-secondary); }
.tpl-tag.vertical { color: var(--accent); border: 1px solid var(--accent); background: transparent; }
.tpl-tag.curiosity { color: #9b59b6; border: 1px solid #9b59b6; background: transparent; }
.tpl-tag.type { color: var(--text-muted); }
.tpl-actions { display: flex; gap: 6px; margin-top: 8px; }
.tpl-btn { padding: 4px 10px; font-size: 10px; font-weight: 600; border-radius: var(--radius); cursor: pointer; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-secondary); }
.tpl-btn:hover { border-color: var(--accent); color: var(--accent); }
.tpl-btn.win { border-color: var(--success); color: var(--success); }
.tpl-btn.win:hover { background: rgba(46,204,113,0.15); }
.tpl-btn.danger { border-color: var(--warning); color: var(--warning); }
.tpl-btn.danger:hover { background: rgba(231,76,60,0.15); }
.tpl-form { padding: 14px; background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius); margin-bottom: 14px; }
.tpl-form input, .tpl-form select, .tpl-form textarea { width: 100%; padding: 6px 10px; margin-bottom: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 12px; font-family: var(--font-body); outline: none; box-sizing: border-box; }
.tpl-form textarea { height: 120px; resize: vertical; }
.tpl-form-row { display: flex; gap: 8px; }
.tpl-form-row > * { flex: 1; }
.tpl-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.tpl-form-btn { padding: 6px 16px; font-size: 11px; font-weight: 600; border-radius: var(--radius); cursor: pointer; border: none; }
.tpl-form-btn.save { background: var(--accent); color: #fff; }
.tpl-form-btn.cancel { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border); }

/* Campaigns Panel */
.campaigns-panel { padding: 16px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.camp-layout { display: flex; gap: 16px; margin-top: 12px; }
.camp-sidebar { flex: 0 0 280px; min-width: 240px; }
.camp-main { flex: 1; min-width: 0; }
.camp-card { padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: border-color var(--transition); }
.camp-card:hover { border-color: var(--accent); }
.camp-card.active { border-color: var(--accent); border-width: 2px; }
.camp-card.archived { opacity: 0.5; }
.camp-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.camp-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; max-height: 30px; overflow: hidden; }
.camp-stats-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.camp-stat { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; background: var(--bg-tertiary); color: var(--text-muted); }
.camp-stat.accounts { color: var(--accent); }
.camp-stat.active-deals { color: var(--success); }
.camp-stat.wins { color: #2ecc71; background: rgba(46,204,113,0.15); }
.camp-stat.pipeline { color: var(--warning); }
.camp-acct-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 80px; gap: 8px; padding: 6px 10px; font-size: 11px; border-bottom: 1px solid var(--border); align-items: center; }
.camp-acct-row:hover { background: var(--bg-tertiary); }
.camp-acct-row.header { font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-size: 10px; background: var(--bg-secondary); border-radius: var(--radius) var(--radius) 0 0; }
.camp-remove-btn { padding: 2px 8px; font-size: 10px; font-weight: 600; border: 1px solid var(--warning); border-radius: var(--radius); background: transparent; color: var(--warning); cursor: pointer; }
.camp-remove-btn:hover { background: rgba(231,76,60,0.15); }
.camp-form { padding: 14px; background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius); margin-bottom: 14px; }
.camp-form input, .camp-form select, .camp-form textarea { width: 100%; padding: 6px 10px; margin-bottom: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 12px; font-family: var(--font-body); outline: none; box-sizing: border-box; }
.camp-form textarea { height: 60px; resize: vertical; }
.camp-form-row { display: flex; gap: 8px; }
.camp-form-row > * { flex: 1; }
.camp-add-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.camp-add-bar input { flex: 1; padding: 6px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 12px; outline: none; }
.camp-add-btn { padding: 6px 14px; font-size: 11px; font-weight: 600; background: var(--accent); border: none; border-radius: var(--radius); color: #fff; cursor: pointer; white-space: nowrap; }

/* Saved Searches Panel */
.saved-searches-panel { padding: 16px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.ss-card { padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: border-color var(--transition); }
.ss-card:hover { border-color: var(--accent); }
.ss-header { display: flex; justify-content: space-between; align-items: center; }
.ss-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.ss-date { font-size: 10px; color: var(--text-muted); }
.ss-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.ss-tag { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; background: var(--bg-tertiary); color: var(--text-muted); }
.ss-tag.results { color: var(--accent); }
.ss-tag.runs { color: var(--success); }
.ss-actions { display: flex; gap: 6px; margin-top: 8px; }
.ss-btn { padding: 3px 10px; font-size: 10px; font-weight: 600; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-tertiary); color: var(--text-secondary); cursor: pointer; }
.ss-btn:hover { border-color: var(--accent); color: var(--accent); }
.ss-btn.apply { border-color: var(--accent); color: var(--accent); }
.ss-btn.apply:hover { background: var(--accent); color: #fff; }
.ss-btn.delete { border-color: var(--warning); color: var(--warning); }
.ss-btn.delete:hover { background: rgba(231,76,60,0.15); }
.ss-save-form { padding: 12px; background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius); margin-bottom: 14px; }
.ss-save-form input { width: 100%; padding: 6px 10px; margin-bottom: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 12px; font-family: var(--font-body); outline: none; box-sizing: border-box; }
.ss-params-preview { font-size: 10px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }

/* Concept Applications Panel */
.concepts-panel { padding: 16px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.ca-card { padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.ca-card:hover { border-color: var(--accent); }
.ca-header { display: flex; justify-content: space-between; align-items: center; }
.ca-concept { font-size: 13px; font-weight: 700; color: var(--accent); }
.ca-account { font-size: 12px; color: var(--text-primary); cursor: pointer; }
.ca-account:hover { text-decoration: underline; }
.ca-date { font-size: 10px; color: var(--text-muted); }
.ca-context { font-size: 11px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; max-height: 40px; overflow: hidden; }
.ca-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.ca-tag { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; background: var(--bg-tertiary); color: var(--text-muted); }
.ca-tag.won { color: #2ecc71; background: rgba(46,204,113,0.15); }
.ca-tag.lost { color: #e74c3c; background: rgba(231,76,60,0.15); }
.ca-tag.pending { color: var(--warning); background: rgba(245,158,11,0.15); }
.ca-tag.psie { color: var(--accent); }
.ca-tag.fsp { color: #708238; }
.ca-actions { display: flex; gap: 6px; margin-top: 8px; }
.ca-btn { padding: 3px 10px; font-size: 10px; font-weight: 600; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-tertiary); color: var(--text-secondary); cursor: pointer; }
.ca-btn:hover { border-color: var(--accent); color: var(--accent); }
.ca-btn.delete { border-color: var(--warning); color: var(--warning); }
.ca-btn.delete:hover { background: rgba(231,76,60,0.15); }
.ca-form { padding: 12px; background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius); margin-bottom: 14px; }
.ca-form input, .ca-form select, .ca-form textarea { width: 100%; padding: 6px 10px; margin-bottom: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 12px; font-family: var(--font-body); outline: none; box-sizing: border-box; }
.ca-form textarea { height: 50px; resize: vertical; }
.ca-form-row { display: flex; gap: 8px; }
.ca-form-row > * { flex: 1; }
.ca-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ca-stat-card { padding: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.ca-stat-num { font-size: 20px; font-weight: 700; color: var(--accent); }
.ca-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Report Snapshots Panel */
.snapshots-panel { padding: 16px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.reports-panel { padding: 16px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.snap-layout { display: flex; gap: 16px; margin-top: 12px; }
.snap-sidebar { flex: 0 0 240px; min-width: 200px; }
.snap-main { flex: 1; min-width: 0; }
.snap-card { padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; cursor: pointer; transition: border-color var(--transition); display: flex; justify-content: space-between; align-items: center; }
.snap-card:hover { border-color: var(--accent); }
.snap-card.active { border-color: var(--accent); border-width: 2px; }
.snap-date { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.snap-type { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; background: var(--bg-tertiary); color: var(--text-muted); }
.snap-type.manual { color: var(--accent); }
.snap-detail { padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.snap-stage-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; padding: 6px 10px; font-size: 11px; border-bottom: 1px solid var(--border); align-items: center; }
.snap-stage-row:hover { background: var(--bg-tertiary); }
.snap-stage-row.header { font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-size: 10px; background: var(--bg-secondary); border-radius: var(--radius) var(--radius) 0 0; }
.snap-delta { font-size: 10px; font-weight: 600; }
.snap-delta.up { color: #2ecc71; }
.snap-delta.down { color: #e74c3c; }
.snap-delta.flat { color: var(--text-muted); }
.snap-move-row { display: flex; gap: 8px; padding: 4px 10px; font-size: 11px; align-items: center; border-bottom: 1px solid var(--border); }
.snap-move-arrow { color: var(--accent); font-weight: 700; }

/* PSIE Engage Tab */
.psie-engage-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, #cc1144 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.psie-engage-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.psie-engage-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.psie-brief-section { margin-bottom: 14px; }
.psie-brief-section h5 {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 6px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.psie-brief-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.psie-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.psie-meta-tag {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
}
.psie-meta-tag.active { color: var(--accent); border-color: var(--accent); }
.psie-loading {
  text-align: center;
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.psie-signals-panel { background: rgba(231, 76, 60, 0.08); border: 1px solid rgba(231, 76, 60, 0.25); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.psie-signals-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.psie-signals-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.psie-signals-dot.positive { background: var(--success); }
.psie-signals-title { font-size: 12px; font-weight: 700; color: var(--danger); letter-spacing: 0.5px; }
.psie-signal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; }
.psie-signal-card:last-child { margin-bottom: 0; }
.psie-signal-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.psie-signal-label { font-size: 11px; font-weight: 700; color: var(--danger); }
.psie-signal-label.positive { color: var(--success); }
.psie-signal-products { font-size: 10px; color: var(--text-muted); }
.psie-signal-angle { font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.psie-signal-tco { font-size: 10px; color: var(--text-muted); margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.psie-signal-evidence { margin: 4px 0; padding: 4px 8px; border-left: 2px solid var(--danger); background: rgba(0,0,0,0.1); border-radius: 0 3px 3px 0; }
.psie-signal-snippet { font-size: 11px; color: var(--text-primary); line-height: 1.4; font-style: italic; }
.psie-signal-source { font-size: 9px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psie-signals-tool { font-size: 10px; color: var(--text-muted); font-style: italic; margin-top: 8px; }
.psie-water-panel { background: rgba(52, 152, 219, 0.08); border: 1px solid rgba(52, 152, 219, 0.25); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.psie-water-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.psie-water-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); flex-shrink: 0; }
.psie-water-title { font-size: 12px; font-weight: 700; color: var(--info); letter-spacing: 0.5px; }
.psie-water-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; }
.psie-water-card:last-child { margin-bottom: 0; }
.psie-water-label { font-size: 11px; font-weight: 700; color: var(--info); margin-bottom: 3px; }
.psie-water-text { font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.psie-concepts-footer { border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin-bottom: 10px; }
.psie-concepts-label { font-size: 10px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.psie-concepts-list { font-size: 11px; color: var(--text-primary); line-height: 1.5; }
.psie-synthesis-toggle { display: flex; align-items: center; gap: 6px; padding: 6px 0; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text-muted); user-select: none; }
.psie-synthesis-toggle:hover { color: var(--text-secondary); }
.psie-synthesis-arrow { font-size: 10px; transition: transform 0.15s; }
.psie-synthesis-arrow.open { transform: rotate(90deg); }
.psie-source-link { display: inline-block; font-size: 10px; color: var(--info); text-decoration: none; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; opacity: 0.85; }
.psie-source-link:hover { opacity: 1; text-decoration: underline; }

/* v5.3.4: Evidence Card — Receipts and Confidence Framework */
.evidence-card { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; margin-left: 4px; vertical-align: middle; }
.evidence-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: 0.3px; user-select: none; }
.evidence-badge.high { background: rgba(46,204,113,0.2); color: #27ae60; }
.evidence-badge.medium { background: rgba(243,156,18,0.2); color: #f39c12; }
.evidence-badge.low { background: rgba(231,76,60,0.2); color: #e74c3c; }
.evidence-expanded { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin-top: 4px; margin-bottom: 6px; font-size: 11px; }
.evidence-snippet { color: var(--text-secondary); font-style: italic; margin-bottom: 4px; line-height: 1.4; }
.evidence-source-link { display: inline-block; font-size: 10px; color: var(--info); text-decoration: none; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.evidence-source-link:hover { text-decoration: underline; }
.evidence-report-btn { font-size: 9px; color: var(--text-muted); background: none; border: 1px solid var(--border); border-radius: 3px; padding: 2px 6px; cursor: pointer; margin-top: 2px; }
.evidence-report-btn:hover { color: var(--danger); border-color: var(--danger); }
.evidence-cards-panel { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.evidence-cards-toggle { font-size: 10px; color: var(--text-muted); cursor: pointer; user-select: none; }
.evidence-cards-toggle:hover { color: var(--text-secondary); }
.evidence-inline-low { background: rgba(243,156,18,0.15); padding: 0 2px; border-radius: 2px; }
.health-info-icon { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; font-size: 9px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 50%; cursor: help; margin-left: 4px; vertical-align: middle; }
.health-info-tooltip { display: none; position: absolute; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; font-size: 10px; color: var(--text-secondary); z-index: 100; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.health-info-icon:hover + .health-info-tooltip { display: block; }

/* v5.3.5: Reply Detection — Conversation bubbles and intent badges */
.thread-list { margin-bottom:12px; }
.thread-item { display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius);margin-bottom:4px;cursor:pointer;background:var(--bg-card);transition:background 0.15s; }
.thread-item:hover { background:var(--bg-input); }
.thread-item.active { border-color:var(--accent);background:rgba(99,102,241,0.08); }
.thread-subject { flex:1;font-size:11px;color:var(--text-primary);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.thread-meta { font-size:9px;color:var(--text-muted); }
.thread-count { font-size:9px;font-weight:700;background:var(--bg-input);border-radius:10px;padding:1px 6px;color:var(--text-secondary); }
.intent-badge { display:inline-block;font-size:9px;font-weight:700;padding:1px 6px;border-radius:3px;letter-spacing:0.3px;text-transform:uppercase; }
.intent-badge.positive { background:rgba(46,204,113,0.2);color:#27ae60; }
.intent-badge.meeting_request { background:rgba(52,152,219,0.2);color:#2980b9; }
.intent-badge.objection { background:rgba(231,76,60,0.2);color:#e74c3c; }
.intent-badge.unsubscribe { background:rgba(0,0,0,0.15);color:#333; }
.intent-badge.wrong_person { background:rgba(243,156,18,0.2);color:#f39c12; }
.intent-badge.neutral { background:rgba(149,165,166,0.2);color:#7f8c8d; }
.msg-bubble { max-width:85%;padding:8px 12px;border-radius:8px;margin-bottom:6px;font-size:11px;line-height:1.5;word-wrap:break-word; }
.msg-bubble.outbound { margin-left:auto;background:rgba(99,102,241,0.12);border:1px solid rgba(99,102,241,0.25);color:var(--text-primary); }
.msg-bubble.inbound { margin-right:auto;background:var(--bg-card);border:1px solid var(--border);color:var(--text-primary); }
.msg-bubble-meta { font-size:9px;color:var(--text-muted);margin-top:4px; }
.msg-bubble-summary { font-size:10px;color:var(--accent);font-style:italic;margin-top:4px; }
.suppression-warning { background:rgba(231,76,60,0.12);border:1px solid rgba(231,76,60,0.3);border-radius:var(--radius);padding:8px 12px;font-size:11px;color:#c0392b;margin-bottom:8px;display:flex;align-items:center;gap:6px; }
.dros-reply-card { border-left:3px solid var(--accent);padding-left:10px; }
.dros-reply-card.positive { border-left-color:#27ae60; }
.dros-reply-card.meeting_request { border-left-color:#2980b9; }
.dros-reply-card.objection { border-left-color:#e74c3c; }
.dros-reply-card.unsubscribe { border-left-color:#333; }
.dros-reply-card.wrong_person { border-left-color:#f39c12; }
.psie-sources-list { padding: 4px 0; }
.psie-source-item { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; font-size: 11px; }
.psie-source-num { color: var(--text-muted); font-size: 10px; min-width: 16px; }
.psie-source-cat { font-size: 9px; font-weight: 600; color: var(--bg-primary); background: var(--text-muted); border-radius: 2px; padding: 1px 4px; white-space: nowrap; }

/* Deep Intel panel (v1.3.0) */
.deep-intel-panel { background: rgba(155, 89, 182, 0.08); border: 1px solid rgba(155, 89, 182, 0.25); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.deep-intel-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.deep-intel-dot { width: 8px; height: 8px; border-radius: 50%; background: #9b59b6; flex-shrink: 0; }
.deep-intel-title { font-size: 12px; font-weight: 700; color: #9b59b6; letter-spacing: 0.5px; }
.deep-intel-section { margin-bottom: 10px; }
.deep-intel-section:last-child { margin-bottom: 0; }
.deep-intel-section-header { display: flex; align-items: center; gap: 6px; padding: 4px 0; cursor: pointer; font-size: 11px; font-weight: 700; color: #9b59b6; user-select: none; }
.deep-intel-section-header:hover { opacity: 0.8; }
.deep-intel-section-arrow { font-size: 9px; transition: transform 0.15s; }
.deep-intel-section-arrow.open { transform: rotate(90deg); }
.deep-intel-count { font-size: 9px; font-weight: 600; color: var(--bg-primary); background: #9b59b6; border-radius: 2px; padding: 1px 5px; }
.deep-intel-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin-bottom: 5px; border-left: 3px solid #9b59b6; }
.deep-intel-item:last-child { margin-bottom: 0; }
.deep-intel-item-title { font-size: 11px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; line-height: 1.4; }
.deep-intel-item-snippet { font-size: 10px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.deep-intel-item-age { font-size: 9px; color: var(--text-muted); margin-top: 2px; }
.deep-intel-empty { font-size: 10px; color: var(--text-muted); font-style: italic; padding: 4px 0; }

/* Activity log */
.activity-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.activity-item .act-type {
  font-weight: 600;
  color: var(--accent);
}

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

.activity-item .act-notes {
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Transcript ingestion */
.trs-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.15s;
}
.trs-btn:hover { background: var(--accent); color: #fff; }
.trs-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}
.trs-modal textarea {
  width: 100%;
  height: 120px;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 11px;
  font-family: var(--font-body);
  resize: vertical;
  outline: none;
  margin-bottom: 8px;
}
.trs-modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.trs-modal-actions button {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.trs-modal-actions .trs-submit {
  background: var(--accent);
  color: #fff;
}
.trs-modal-actions .trs-cancel {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.trs-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: trs-spin 0.8s linear infinite;
}
@keyframes trs-spin { to { transform: rotate(360deg); } }

/* Transcript card in activity history */
.trs-card {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
}
.trs-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.trs-card-header .trs-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.trs-card-summary {
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.trs-section {
  margin-bottom: 6px;
}
.trs-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 4px 6px;
  background: var(--bg-input);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}
.trs-section-head:hover { background: var(--border); }
.trs-section-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.trs-section-body {
  padding: 4px 6px 4px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.trs-section-body li {
  margin-bottom: 3px;
  list-style-type: disc;
}
.trs-contact-pill {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 3px 2px 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 10px;
  color: var(--text-primary);
}
.trs-contact-pill .trs-role {
  font-weight: 700;
  color: var(--accent);
}
.trs-stage-rec {
  padding: 6px 8px;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-primary);
  margin-top: 6px;
}
.trs-stage-rec strong {
  color: #2ecc71;
}
.trs-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  gap: 10px;
}

/* Log activity form */
.log-form {
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.log-form select,
.log-form input,
.log-form textarea {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 12px;
  margin-bottom: 6px;
  font-family: var(--font-body);
  outline: none;
}

.log-form textarea {
  height: 60px;
  resize: vertical;
}

.log-form button {
  padding: 6px 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Reminder popup */
.reminder-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.reminder-card {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.reminder-card h3 {
  color: var(--accent);
  margin-bottom: 12px;
}

.reminder-card .rem-account {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.reminder-card .rem-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.reminder-card .rem-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reminder-card .rem-actions button {
  padding: 6px 14px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.reminder-card .rem-actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-muted);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* RLFS Badge - only visible in Ruthless View */
.rlfs-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2.5px;
  background: #FF2D55;
  color: #ffffff;
  border-radius: 3px;
  margin-left: 10px;
  vertical-align: middle;
  text-transform: uppercase;
  animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,45,85,0.5), 0 0 2px rgba(255,45,85,0.3); }
  50% { box-shadow: 0 0 20px rgba(255,45,85,0.8), 0 0 6px rgba(255,45,85,0.5); }
}

/* View toggle in topbar */
.alert-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53e3e;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 8px;
  min-width: 14px;
  text-align: center;
  line-height: 14px;
  animation: badge-glow 2s ease-in-out infinite;
}
.view-toggle {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-1) var(--sp-4);
  grid-column: 1 / -1;
}
.view-toggle::-webkit-scrollbar { display: none; }

.nav-scroll-wrapper {
  display: none;
}
.nav-scroll-arrow {
  display: none;
}
.nav-scroll-left { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.nav-scroll-right { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.nav-scroll-arrow:hover { color: var(--text-primary); background: var(--bg-hover); }

.view-toggle-btn {
  padding: 5px var(--sp-3);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  margin: 1px 2px;
  font-family: var(--font-body);
}

.view-toggle-btn:last-child { border-right: none; }
.view-toggle-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.view-toggle-btn.active { background: var(--accent); color: #fff; }

[data-theme="classic94"] .view-toggle {
  background: #C0C0C0;
  border-bottom: 2px solid #808080;
}

[data-theme="classic94"] .view-toggle-btn {
  box-shadow: var(--bevel-btn);
  background: #C0C0C0;
  color: #000000;
  border-right: none;
  font-weight: 700;
  border-radius: 0;
}

[data-theme="classic94"] .view-toggle-btn.active {
  box-shadow: var(--bevel-sunken);
  background: #b0b0b0;
  color: #000080;
}

/* ============================================================
   KANBAN BOARD — ACT! 2.0 Digital Index Cards
   ============================================================ */
.kanban-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.kanban-header {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.kanban-header h3 {
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.kanban-header .kanban-count {
  font-size: var(--fs-label);
  color: var(--text-muted);
}

.kanban-filters {
  padding: var(--sp-2) var(--sp-4);
  display: flex;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

.kanban-filters .filter-label {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: var(--fw-semibold);
}

.kanban-board {
  flex: 1;
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-3) var(--sp-2);
}

.kanban-column {
  min-width: 200px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 3px;
  overflow: hidden;
}

.kanban-column.drag-over {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.kanban-col-header {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.kanban-col-header .col-title {
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.kanban-col-header .col-count {
  font-size: var(--fs-meta);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-1);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-height: 60px;
}

/* Kanban empty state */
.kanban-cards:empty::before {
  content: 'No deals in this stage';
  display: block;
  text-align: center;
  padding: var(--sp-5) var(--sp-3);
  font-size: var(--fs-label);
  color: var(--text-muted);
  font-style: italic;
}

/* --- Index Card --- */
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, padding 0.12s ease;
  position: relative;
  border-left: 4px solid var(--text-muted);
}

.kanban-card.bar-active { border-left-color: var(--success); }
.kanban-card.bar-dormant { border-left-color: var(--danger); }
.kanban-card.bar-cold { border-left-color: var(--text-muted); }

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.kanban-card .kc-actions {
  display: none;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.kanban-card:hover .kc-actions {
  display: flex;
}

.kanban-card.kb-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
}

.kanban-card.dragging {
  opacity: 0.35;
  transform: scale(0.96);
}

/* Touch drag ghost card */
.kanban-touch-ghost {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  opacity: 0.85;
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 8px 10px;
  max-width: 240px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.1s;
}

.kanban-card.touch-lifting {
  animation: touchLift 0.2s ease forwards;
}
@keyframes touchLift {
  0% { transform: scale(1); }
  100% { transform: scale(0.95); opacity: 0.4; }
}

.kanban-card .kc-name {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card .kc-contact-line {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card .kc-detail-line {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-card .kc-stars {
  letter-spacing: 1px;
  font-size: 9px;
}

.kanban-card .kc-badges {
  position: absolute;
  top: 6px;
  right: 7px;
  display: flex;
  gap: 3px;
}

.kanban-card .kc-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.3;
}

.kanban-card .kc-badge.badge-vert-hosp { color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.kanban-card .kc-badge.badge-vert-hc { color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.kanban-card .kc-badge.badge-vert-sled { color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); }
.kanban-card .kc-badge.badge-tier { color: var(--accent); border: 1px solid var(--accent-glow); }

.kanban-card .kc-next-action {
  font-size: 9px;
  margin-top: 3px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.kanban-card .kc-next-action.overdue { color: var(--danger); background: rgba(231,76,60,0.1); }
.kanban-card .kc-next-action.upcoming { color: var(--warning); }

/* Kanban task indicator */
.kc-task-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: 4px;
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  font-size: var(--density-fs-meta);
  cursor: pointer;
  transition: background var(--transition);
  border-left: 3px solid transparent;
}
.kc-task-indicator:hover { background: var(--bg-hover); }
.kc-task-indicator.task-future { border-left-color: var(--success); color: var(--text-secondary); }
.kc-task-indicator.task-today { border-left-color: var(--warning); color: var(--warning); }
.kc-task-indicator.task-overdue { border-left-color: var(--danger); color: var(--danger); }
.kc-task-indicator .kc-task-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.kc-task-indicator.task-future .kc-task-dot { background: var(--success); }
.kc-task-indicator.task-today .kc-task-dot { background: var(--warning); }
.kc-task-indicator.task-overdue .kc-task-dot { background: var(--danger); }
.kc-task-indicator .kc-task-text {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kc-task-indicator .kc-task-date {
  flex-shrink: 0; font-weight: var(--fw-semibold); font-size: 9px;
}

/* No-task indicator — muted gray, Pipedrive style */
.kc-no-task {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: 2px;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  font-size: var(--density-fs-meta);
  cursor: pointer;
  transition: background var(--transition);
  border-left: 3px solid var(--border-subtle);
  color: var(--text-muted);
  opacity: 0.7;
}
.kc-no-task:hover { background: var(--bg-hover); opacity: 1; }
.kc-no-task .kc-no-task-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--text-muted); background: transparent;
}
.kc-no-task .kc-no-task-label {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-style: italic;
}

/* Inline task create form on kanban card */
.kc-task-create {
  margin-top: 4px;
  padding: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  animation: flowFadeIn 0.15s ease;
}
.kc-task-create-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.kc-task-create-row + .kc-task-create-row { margin-top: 4px; }
.kc-task-create input[type="text"] {
  flex: 1;
  padding: 3px 6px;
  font-size: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-width: 0;
}
.kc-task-create input[type="text"]:focus { border-color: var(--accent); outline: none; }
.kc-task-create input[type="date"] {
  width: 100px;
  padding: 3px 4px;
  font-size: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font-body);
}
.kc-task-create-save {
  padding: 3px 10px;
  font-size: 9px;
  font-weight: var(--fw-bold);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-xs);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
}
.kc-task-create-save:hover { filter: brightness(1.15); }
.kc-task-create-cancel {
  padding: 3px 8px;
  font-size: 9px;
  font-weight: var(--fw-semibold);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
}
.kc-task-create-cancel:hover { border-color: var(--text-secondary); color: var(--text-secondary); }

/* === COMPACT AT REST — expand on hover === */
/* Badges: hidden at rest, visible on hover */
.kanban-card .kc-badges { opacity: 0; transition: opacity 0.15s ease; pointer-events: none; }
.kanban-card:hover .kc-badges { opacity: 1; pointer-events: auto; }

/* Account name line: hidden at rest */
.kanban-card .kc-account-name { display: none; }
.kanban-card:hover .kc-account-name { display: block; }

/* Next action text: hidden at rest */
.kanban-card .kc-next-action { display: none; }
.kanban-card:hover .kc-next-action { display: block; }

/* Task indicator: dot only at rest, full text on hover */
.kanban-card .kc-task-indicator .kc-task-text,
.kanban-card .kc-task-indicator .kc-task-date { display: none; }
.kanban-card:hover .kc-task-indicator .kc-task-text,
.kanban-card:hover .kc-task-indicator .kc-task-date { display: inline; }
.kanban-card:hover .kc-task-indicator { padding: 3px 6px; margin-top: 4px; }

/* No-task indicator: dot only at rest, label on hover */
.kanban-card .kc-no-task .kc-no-task-label { display: none; }
.kanban-card:hover .kc-no-task .kc-no-task-label { display: inline; }
.kanban-card:hover .kc-no-task { padding: 3px 6px; margin-top: 4px; }

/* Detail line: hide stars at rest, keep dollar value visible */
.kanban-card .kc-detail-line .kc-stars { display: none; }
.kanban-card:hover .kc-detail-line .kc-stars { display: inline; }
.kanban-card .kc-detail-line { margin-top: 1px; }
.kanban-card:hover .kc-detail-line { margin-top: 3px; }

/* Card name: tighter at rest */
.kanban-card .kc-name { font-size: 11px; padding-right: 4px; }
.kanban-card:hover .kc-name { font-size: 12px; padding-right: 50px; }

/* Card padding: compact at rest, comfortable on hover */
.kanban-card { padding: 5px 8px 4px 10px; }
.kanban-card:hover { padding: var(--density-card-pad) var(--density-card-pad) var(--density-card-pad) calc(var(--density-card-pad) + 2px); }

/* Move task dot inline with dollar value at rest */
.kanban-card .kc-task-indicator { border-left: none; display: inline-flex; vertical-align: middle; }
.kanban-card:hover .kc-task-indicator { border-left: 3px solid transparent; display: flex; }
.kanban-card:hover .kc-task-indicator.task-future { border-left-color: var(--success); }
.kanban-card:hover .kc-task-indicator.task-today { border-left-color: var(--warning); }
.kanban-card:hover .kc-task-indicator.task-overdue { border-left-color: var(--danger); }
.kanban-card .kc-no-task { border-left: none; display: inline-flex; vertical-align: middle; }
.kanban-card:hover .kc-no-task { border-left: 3px solid var(--border-subtle); display: flex; }

/* Kanban task inline actions */
.kc-task-actions {
  display: flex;
  gap: var(--sp-1);
  margin-top: 3px;
  padding: 4px 0 2px;
  border-top: 1px solid var(--border-subtle);
  animation: flowFadeIn 0.15s ease;
}
.kc-task-action-btn {
  padding: 2px 8px;
  font-size: 9px;
  font-weight: var(--fw-semibold);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.kc-task-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.kc-task-action-btn.task-complete-btn:hover { border-color: var(--success); color: var(--success); }
.kc-task-action-btn.task-snooze-btn:hover { border-color: var(--warning); color: var(--warning); }
.kc-task-reschedule-input {
  width: 90px;
  padding: 2px 4px;
  font-size: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font-body);
}

/* Stage transition task prompt */
.stage-task-prompt {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--sp-4);
  box-shadow: var(--shadow-lg);
  animation: flowFadeIn 0.2s ease;
}

/* Pipeline total */
.kanban-pipeline-total {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
}

/* ---- Ruthless Kanban specifics ---- */
.kanban-card.bar-dormant { border-left-color: #FF2D55; }
.kanban-col-header .col-title { color: #FF2D55; font-size: 12px; }
.kanban-col-header {
  border-bottom: 2px solid rgba(255,45,85,0.3);
}

/* High-value glow in Ruthless */
.kanban-card.bar-dormant:hover {
  box-shadow: 0 0 12px rgba(255,45,85,0.3), 0 2px 8px rgba(0,0,0,0.3);
}

/* Closed column color */
.kanban-column.col-closed .kanban-col-header .col-title { color: var(--success); }
.kanban-column.col-closed .kanban-col-header { border-bottom-color: rgba(46,204,113,0.3); }

/* Deal Detail Side Panel */
.deal-detail-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.deal-detail-panel.open {
  right: 0;
}
.ddp-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.ddp-body {
  padding: 12px 16px;
  flex: 1;
  overflow-y: auto;
}
.ddp-section {
  margin-bottom: 14px;
}
.ddp-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ddp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}
.ddp-label {
  color: var(--text-muted);
  font-size: 11px;
}
.ddp-val {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}
.ddp-editable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.ddp-editable:hover {
  border-color: var(--border);
  background: var(--bg-input);
}
.ddp-input, .ddp-select, .ddp-textarea {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  background: var(--bg-input);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}
.ddp-textarea {
  min-height: 60px;
  resize: vertical;
}
.ddp-save-bar {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.ddp-save-btn {
  flex: 1;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
}
.ddp-save-btn:hover { opacity: 0.85; }
.ddp-save-btn.primary { background: var(--accent); color: #fff; }
.ddp-save-btn.secondary { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); }

/* ---- Classic94 Kanban ---- */
[data-theme="classic94"] .kanban-container { background: #C0C0C0; }
[data-theme="classic94"] .kanban-header {
  background: #000080;
  border-bottom: 3px solid #808080;
}
[data-theme="classic94"] .kanban-header h3 { color: #ffffff; }
[data-theme="classic94"] .kanban-header .kanban-count { color: #c0c0c0; }
[data-theme="classic94"] .kanban-header .kanban-pipeline-total { color: #00ff00; }
[data-theme="classic94"] .kanban-filters {
  background: #C0C0C0;
  border-bottom: 2px solid #808080;
}
[data-theme="classic94"] .kanban-board { background: #C0C0C0; padding: 8px 4px; }
[data-theme="classic94"] .kanban-column {
  box-shadow: inset 2px 2px 0 #808080, inset -2px -2px 0 #ffffff, 3px 3px 0 #404040;
  border: none;
  border-radius: 0;
  background: #d4d0c8;
  margin: 0 5px;
}
[data-theme="classic94"] .kanban-col-header {
  background: #000080;
  border-bottom: 3px solid #404040;
  padding: 8px 10px;
}
[data-theme="classic94"] .kanban-col-header .col-title {
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
[data-theme="classic94"] .kanban-col-header .col-count { color: #ffff00; font-weight: 700; }
[data-theme="classic94"] .kanban-card {
  box-shadow: inset 3px 3px 0 #ffffff, inset -3px -3px 0 #808080, 2px 2px 0 #808080, -2px -2px 0 #ffffff;
  border: none;
  border-left: 5px solid #808080;
  border-radius: 0;
  background: #ffffff;
  padding: 8px 10px 8px 10px;
  margin-bottom: 2px;
}
[data-theme="classic94"] .kanban-card.bar-active { border-left-color: #008000; }
[data-theme="classic94"] .kanban-card.bar-dormant { border-left-color: #ff0000; }
[data-theme="classic94"] .kanban-card:hover {
  box-shadow: inset 3px 3px 0 #808080, inset -3px -3px 0 #ffffff, 2px 2px 0 #ffffff, -2px -2px 0 #808080;
}
[data-theme="classic94"] .kanban-card.kb-selected {
  box-shadow: inset 3px 3px 0 #808080, inset -3px -3px 0 #ffffff, 2px 2px 0 #ffffff, -2px -2px 0 #808080;
  background: #e0e0ff;
}
[data-theme="classic94"] .kanban-card .kc-name { color: #000000; font-weight: 700; }
[data-theme="classic94"] .kanban-card .kc-contact-line { color: #000080; }
[data-theme="classic94"] .kanban-card .kc-stars { color: #000080; }
[data-theme="classic94"] .kanban-card .kc-badge { background: #d4d0c8; border: 1px solid #808080; color: #000080; }
[data-theme="classic94"] .kanban-card .kc-badge.badge-tier { color: #000080; border-color: #000080; }
[data-theme="classic94"] .kanban-column.drag-over {
  background: #e0e0ff;
  box-shadow: inset 2px 2px 0 #000080, inset -2px -2px 0 #ffffff, 3px 3px 0 #000080;
}
[data-theme="classic94"] .kanban-cards { background: #d4d0c8; }

/* ---- Dark Kanban ---- */
[data-theme="dark"] .kanban-container { background: #0f1520; }
[data-theme="dark"] .kanban-header {
  background: #1F2937;
  border-bottom: 1px solid #374151;
}
[data-theme="dark"] .kanban-header h3 { color: #CBD5E1; }
[data-theme="dark"] .kanban-column {
  background: #141c28;
  border-color: #374151;
}
[data-theme="dark"] .kanban-col-header {
  background: #1F2937;
  border-bottom: 2px solid rgba(59,130,246,0.3);
}
[data-theme="dark"] .kanban-col-header .col-title { color: #3B82F6; font-size: 12px; }
[data-theme="dark"] .kanban-card {
  background: #1a2438;
  border-color: #2d3a4d;
}
[data-theme="dark"] .kanban-card:hover {
  border-color: #3B82F6;
  box-shadow: 0 2px 12px rgba(59,130,246,0.15);
}
[data-theme="dark"] .kanban-card.kb-selected {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}
[data-theme="dark"] .kanban-card.bar-dormant { border-left-color: #ef4444; }
[data-theme="dark"] .kanban-cards { background: #111827; }

/* ============================================================
   CLASSIC CONTACT VIEW — ACT! 2.0 Single Record
   ============================================================ */
.classic-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.classic-nav {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ============================================================
   DROS — Daily Rep Operating System Styles
   ============================================================ */
.dros-container { padding: var(--sp-4); max-width: 1200px; margin: 0 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); }
.dros-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 2px solid var(--accent); }
.dros-header h2 { font-size: var(--fs-page-title); font-weight: 800; color: var(--text-primary); margin: 0; letter-spacing: -0.3px; }
.dros-header .dros-time { font-size: var(--fs-label); color: var(--text-muted); }
.dros-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 900px) { .dros-grid { grid-template-columns: 1fr; } }
.dros-section { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: var(--density-card-pad); }
.dros-section-title { font-size: var(--fs-label); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: var(--sp-3); display: flex; justify-content: space-between; align-items: center; }
.dros-section-title .dros-count { background: var(--accent); color: #fff; padding: 1px 7px; border-radius: var(--radius-pill); font-size: var(--fs-meta); font-weight: var(--fw-bold); }
.dros-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--density-card-pad); margin-bottom: var(--sp-2); transition: border-color var(--transition); position: relative; }
.dros-card:hover { border-color: var(--accent); }
.dros-card:last-child { margin-bottom: 0; }
.dros-card-rank { position: absolute; top: 8px; left: -6px; background: var(--accent); color: #fff; width: 20px; height: 20px; border-radius: 50%; font-size: var(--fs-meta); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.dros-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); }
.dros-card-name { font-size: var(--fs-body); font-weight: var(--fw-bold); color: var(--text-primary); cursor: pointer; }
.dros-card-name:hover { color: var(--accent); }
.dros-card-badge { font-size: var(--fs-meta); font-weight: var(--fw-bold); padding: 2px var(--sp-2); border-radius: var(--radius-xs); text-transform: uppercase; white-space: nowrap; }
.dros-badge-red { background: #dc262622; color: #dc2626; box-shadow: 0 0 10px rgba(220,38,38,0.45); animation: dros-pulse-red 2.6s ease-in-out infinite; }
@keyframes dros-pulse-red { 0%,100% { box-shadow: 0 0 10px rgba(220,38,38,0.45); transform: scale(1); } 50% { box-shadow: 0 0 18px rgba(220,38,38,0.7); transform: scale(1.03); } }
.dros-badge-amber { background: #f59e0b22; color: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,0.4); }
.dros-badge-blue { background: #3b82f622; color: #3b82f6; }
.dros-badge-hold { background: #3498db22; color: #3498db; font-weight: 800; letter-spacing: 1px; }
.dros-badge-green { background: #22c55e22; color: #22c55e; }
.dros-badge-zombie { background: #dc262633; color: #dc2626; font-weight: 800; letter-spacing: 0.5px; animation: zombie-pulse 2s ease-in-out infinite; }
@keyframes zombie-pulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } }
.zombie-banner { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; }
.zombie-banner.zombie-red { background: rgba(220,38,38,0.1); border: 1px solid rgba(220,38,38,0.3); }
.zombie-banner.zombie-amber { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); }
.zombie-banner-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.zombie-banner.zombie-red .zombie-banner-title { color: #dc2626; }
.zombie-banner.zombie-amber .zombie-banner-title { color: #f59e0b; }
.zombie-banner-reason { font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin-top: 4px; }
.zombie-banner-actions { display: flex; gap: 6px; margin-top: 8px; }
.zombie-indicator { display: inline-block; margin-left: 3px; vertical-align: middle; font-size: 10px; }
.dros-badge-gray { background: #6b728022; color: #6b7280; }
.dros-card-reason { font-size: 11px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.dros-card-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.dros-card-meta span { font-size: 10px; color: var(--text-muted); }
.dros-card-actions { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.dros-btn { font-size: var(--fs-meta); padding: var(--sp-1) var(--sp-3); border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); border-radius: var(--radius-xs); cursor: pointer; font-weight: var(--fw-semibold); transition: all 0.15s; font-family: var(--font-body); }
.dros-btn:hover { border-color: var(--accent); color: var(--accent); }
.dros-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.dros-btn-primary:hover { background: var(--accent-hover); color: #fff; }
.dros-btn-dismiss { color: var(--text-muted); }
.dros-btn-dismiss:hover { color: var(--danger); border-color: var(--danger); }
.dros-fu-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.dros-fu-row:last-child { border-bottom: none; }
.dros-fu-name { font-size: 12px; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.dros-fu-name:hover { color: var(--accent); }
.dros-fu-action { font-size: 11px; color: var(--text-secondary); }
.dros-fu-date { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.dros-fu-overdue { background: #dc262622; color: #dc2626; }
.dros-fu-today { background: #f59e0b22; color: #f59e0b; }
.dros-fu-upcoming { background: #22c55e22; color: #22c55e; }
.dros-scoreboard { display: flex; gap: var(--sp-1); flex-wrap: wrap; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-3); margin-top: var(--sp-4); }
.dros-score-item { flex: 1; min-width: 80px; text-align: center; padding: var(--sp-2) var(--sp-1); }
.dros-score-num { font-size: 24px; font-weight: 800; color: var(--accent); text-shadow: 0 0 20px var(--accent-glow); }
.dros-score-label { font-size: var(--fs-meta); font-weight: var(--fw-semibold); text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.3px; }
.dros-streak { font-size: 11px; font-weight: 700; color: var(--accent); text-align: center; margin-top: 6px; }

/* v5.99.2.89 Ship 10B: DROS visual polish */
/* v5.99.2.90 Ship 10B-tune: dazzle pass */
/* v5.99.2.92 Ship 10C-tune: zero-mute deeper */
/* Zero-state metric muting (Edit 1). Frontend toggles .zero conditionally. */
.dros-score-num.zero { color: var(--text-muted); opacity: 0.25; text-shadow: none; font-weight: 600; }
/* Account-name typography +20% modifier (Edit 4). Used on top-action cards. */
.dros-card-name-large { font-size: calc(var(--fs-body) * 1.2); }
/* Why-this-action affordance bump (Edit 5). 9px -> 10px, hover underline. */
.dros-why-action { font-size: 10px; color: var(--text-muted); margin-top: 3px; cursor: pointer; transition: color var(--transition); }
.dros-why-action:hover { color: var(--text-secondary); text-decoration: underline; }
/* Streak flame slow pulse (Edit 7). Frontend wraps flame emoji in span.dros-streak-flame. */
.dros-streak-flame { display: inline-block; animation: dros-flame-pulse 2.6s ease-in-out infinite; }
@keyframes dros-flame-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.12); } }
/* Best-streak label (10C will render). */
.dros-streak-best { color: var(--text-muted); font-weight: 500; margin-left: 6px; }
.dros-signal { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.dros-signal:last-child { border-bottom: none; }
.dros-signal-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.dros-signal-dot.red { background: #dc2626; }
.dros-signal-dot.amber { background: #f59e0b; }
.dros-signal-dot.blue { background: #3b82f6; }
.dros-signal-body { flex: 1; }
.dros-signal-msg { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
.dros-signal-acct { font-size: 11px; font-weight: 700; color: var(--text-primary); cursor: pointer; }
.dros-signal-acct:hover { color: var(--accent); }
.dros-risk-card { padding: 10px 12px; border-left: 3px solid var(--danger); margin-bottom: 8px; background: var(--bg-primary); border-radius: 0 4px 4px 0; }
.dros-risk-card.medium { border-left-color: #f59e0b; }
.dros-risk-card.low { border-left-color: #3b82f6; }
.dros-risk-factors { margin-top: 4px; }
.dros-risk-factor { font-size: 10px; color: var(--text-muted); padding: 1px 0; }
.dros-stage-warning { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.dros-stage-warning-card { background: var(--bg-primary); border: 2px solid var(--danger); border-radius: 8px; padding: 20px; max-width: 440px; width: 90%; }
.dros-stage-warning h3 { margin: 0 0 10px; font-size: 14px; color: var(--danger); }
.dros-stage-warning p { font-size: 12px; color: var(--text-secondary); margin: 0 0 12px; line-height: 1.5; }
.dros-stage-warning ul { margin: 0 0 16px; padding-left: 20px; }
.dros-stage-warning li { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.dros-stage-warning-actions { display: flex; gap: 8px; justify-content: flex-end; }
.dros-play { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.dros-play:last-child { border-bottom: none; }
.dros-play-info { flex: 1; }
.dros-play-type { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.dros-play-key { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.dros-play-rate { font-size: 14px; font-weight: 800; color: var(--accent); }

/* v5.5.0 Item 2: DROS Flow Mode */
.flow-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-primary); z-index: 9999; display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.flow-topbar { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3) 20px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); flex-shrink: 0; }
.flow-progress-text { font-size: var(--fs-body); font-weight: var(--fw-bold); color: var(--text-primary); }
.flow-progress-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: var(--sp-1); overflow: hidden; }
.flow-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; }
.flow-exit-btn { font-size: var(--fs-label); padding: 5px var(--sp-4); background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--btn-radius); color: var(--text-muted); cursor: pointer; font-weight: var(--fw-semibold); font-family: var(--font-body); transition: all var(--transition); }
.flow-exit-btn:hover { border-color: var(--danger); color: var(--danger); }
.flow-card { max-width: 720px; width: 95%; margin: var(--sp-5) auto; padding: 0; animation: flowFadeIn 0.3s ease; }
@keyframes flowFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flowFadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-12px); } }
.flow-card.exiting { animation: flowFadeOut 0.25s ease forwards; }
.flow-section { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); margin-bottom: var(--sp-3); }
.flow-acct-name { font-size: 18px; font-weight: 800; color: var(--text-primary); cursor: pointer; }
.flow-acct-name:hover { color: var(--accent); }
.flow-acct-meta { display: flex; gap: var(--sp-3); align-items: center; margin-top: var(--sp-2); flex-wrap: wrap; }
.flow-acct-meta span { font-size: var(--fs-label); padding: 2px var(--sp-2); border-radius: var(--radius-xs); font-weight: var(--fw-semibold); }
.flow-reason { font-size: var(--fs-body); color: var(--text-primary); line-height: 1.6; margin-bottom: var(--sp-2); }
.flow-why { font-size: var(--fs-label); color: var(--text-secondary); line-height: var(--lh); padding: var(--sp-2) var(--sp-3); background: var(--bg-primary); border-radius: var(--radius-xs); margin-top: var(--sp-2); }
.flow-brain-bar { padding: 8px 12px; border-left: 3px solid var(--info, #3498db); background: var(--bg-primary); border-radius: 0 4px 4px 0; margin-bottom: 8px; }
.flow-brain-bar .flow-brain-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--info, #3498db); margin-bottom: 2px; }
.flow-brain-bar .flow-brain-text { font-size: 11px; color: var(--text-primary); line-height: 1.4; }
.flow-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.flow-pill { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.flow-pill-green { background: #22c55e22; color: #22c55e; border: 1px solid #22c55e44; }
.flow-pill-red { background: #ef444422; color: #ef4444; border: 1px solid #ef444444; }
.flow-draft-area { width: 100%; min-height: 120px; border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary); font-size: 12px; font-family: inherit; padding: 10px; border-radius: 4px; resize: vertical; line-height: 1.5; }
.flow-draft-subject { width: 100%; border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary); font-size: 12px; font-family: inherit; padding: 8px 10px; border-radius: 4px; margin-bottom: 6px; font-weight: 600; }
.flow-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-4) 0 var(--sp-2); justify-content: center; }
.flow-action-btn { padding: var(--sp-2) 18px; font-size: var(--fs-body); font-weight: var(--fw-bold); border: 1px solid var(--border); border-radius: var(--btn-radius); cursor: pointer; transition: all 0.15s; background: var(--bg-secondary); color: var(--text-primary); font-family: var(--font-body); }
.flow-action-btn:hover { border-color: var(--accent); }
.flow-action-btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.flow-action-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.flow-action-btn.primary:hover { background: var(--accent-hover); }
.flow-action-btn.done-btn { background: var(--success); color: #fff; border-color: var(--success); }
.flow-action-btn.skip-btn { color: var(--text-muted); }
.flow-action-btn.skip-btn:hover { color: var(--text-primary); }
.flow-flash { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #22c55e; color: #fff; padding: 12px 28px; border-radius: 8px; font-size: 14px; font-weight: 700; z-index: 10001; animation: flowFlashAnim 1.2s ease forwards; }
@keyframes flowFlashAnim { 0% { opacity: 0; transform: translate(-50%,-50%) scale(0.8); } 20% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.flow-inline-form { padding: 10px 12px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 4px; margin-top: 8px; }
.flow-inline-form label { font-size: 10px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 3px; margin-top: 8px; }
.flow-inline-form label:first-child { margin-top: 0; }
.flow-inline-form input, .flow-inline-form select, .flow-inline-form textarea { width: 100%; padding: 6px 8px; font-size: 11px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg-secondary); color: var(--text-primary); font-family: inherit; }
.flow-inline-form textarea { min-height: 60px; resize: vertical; }
.flow-summary { max-width: 520px; width: 95%; margin: 60px auto; text-align: center; animation: flowFadeIn 0.4s ease; }
.flow-summary h2 { font-size: var(--fs-page-title); font-weight: 800; color: var(--accent); margin-bottom: var(--sp-2); }
.flow-summary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: 20px 0; }
.flow-summary-stat { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4) var(--sp-3); }
.flow-summary-stat .num { font-size: 28px; font-weight: 800; color: var(--accent); text-shadow: 0 0 20px var(--accent-glow); }
.flow-summary-stat .lbl { font-size: var(--fs-meta); font-weight: var(--fw-semibold); text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.3px; }
/* v5.5.0 Item 4: New House Card */
.dros-new-house-badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 9px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; background: var(--accent); color: #fff; }

.classic-nav-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.classic-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.classic-nav-btn:disabled { opacity: 0.3; cursor: default; }

.classic-record-counter {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  flex: 1;
  text-align: center;
}

.classic-record-counter strong {
  color: var(--text-primary);
}

.classic-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* --- Contact Card (top half) --- */
.classic-card {
  padding: 16px 16px;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}

.classic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.classic-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.classic-card-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.classic-card-badges .cc-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.classic-card-badges .cc-badge.badge-stage { color: var(--accent); border: 1px solid var(--accent); }
.classic-card-badges .cc-badge.badge-vert { color: var(--warning); border: 1px solid rgba(243,156,18,0.3); }

.classic-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.classic-field {
  display: flex;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: baseline;
}

.classic-field:nth-child(odd) { padding-right: 20px; }
.classic-field:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--border); }

.classic-field .cf-label {
  width: 90px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.classic-field .cf-value {
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classic-field .cf-value.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.classic-field .cf-value.clickable {
  color: var(--accent);
  cursor: pointer;
}

.classic-field .cf-value.clickable:hover { text-decoration: underline; }

.classic-stars {
  color: var(--warning);
  letter-spacing: 2px;
  font-size: 14px;
}

/* --- RLFS Bar (middle strip) --- */
.classic-rlfs-bar {
  padding: 6px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.classic-rlfs-bar .rlfs-field {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.classic-rlfs-bar .rlfs-field strong {
  color: var(--text-primary);
  margin-left: 4px;
}

/* --- Notes/History (bottom half) --- */
.classic-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  background: var(--bg-primary);
}

.classic-history h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.classic-history-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.classic-history-item .chi-type {
  font-weight: 700;
  color: var(--accent);
}

.classic-history-item .chi-date {
  font-size: 10px;
  color: var(--text-muted);
  float: right;
}

.classic-history-item .chi-subject {
  font-weight: 600;
  margin-top: 2px;
}

.classic-history-item .chi-notes {
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.classic-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.classic-empty-hint {
  font-size: 12px;
  margin-top: 8px;
  color: var(--text-muted);
}

/* ---- Classic94 Contact View ---- */
[data-theme="classic94"] .classic-container { background: #C0C0C0; }
[data-theme="classic94"] .classic-nav {
  background: #000080;
  border-bottom: 3px solid #808080;
}
[data-theme="classic94"] .classic-nav-btn {
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #808080, 1px 1px 0 #808080;
  background: #C0C0C0;
  border: none;
  border-radius: 0;
  color: #000000;
}
[data-theme="classic94"] .classic-nav-btn:hover { color: #000080; }
[data-theme="classic94"] .classic-record-counter { color: #ffffff; }
[data-theme="classic94"] .classic-record-counter strong { color: #ffff00; }
[data-theme="classic94"] .classic-card {
  background: #ffffff;
  border-bottom: 3px solid #808080;
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #808080;
}
[data-theme="classic94"] .classic-card-name { color: #000080; }
[data-theme="classic94"] .classic-field { border-bottom-color: #c0c0c0; }
[data-theme="classic94"] .classic-field:nth-child(even) { border-left-color: #c0c0c0; }
[data-theme="classic94"] .classic-field .cf-label { color: #000000; font-weight: 700; }
[data-theme="classic94"] .classic-field .cf-value { color: #000080; }
[data-theme="classic94"] .classic-field .cf-value.mono { font-family: 'Cascadia Code', 'Consolas', monospace; }
[data-theme="classic94"] .classic-field .cf-value.clickable { color: #000080; text-decoration: underline; }
[data-theme="classic94"] .classic-rlfs-bar {
  background: #C0C0C0;
  border-bottom: 2px solid #808080;
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #808080;
}
[data-theme="classic94"] .classic-rlfs-bar .rlfs-field { color: #000000; }
[data-theme="classic94"] .classic-rlfs-bar .rlfs-field strong { color: #000080; }
[data-theme="classic94"] .classic-history {
  background: #d4d0c8;
  box-shadow: inset 2px 2px 0 #808080, inset -2px -2px 0 #ffffff;
}
[data-theme="classic94"] .classic-history h4 { color: #000080; border-bottom-color: #808080; }
[data-theme="classic94"] .classic-history-item { border-bottom-color: #b0b0b0; }
[data-theme="classic94"] .classic-history-item .chi-type { color: #000080; }
[data-theme="classic94"] .classic-card-badges .cc-badge {
  background: #d4d0c8;
  border: 1px solid #808080;
  color: #000080;
}

/* ---- Dark Contact View ---- */
[data-theme="dark"] .classic-card { background: #1F2937; border-bottom-color: #374151; }
[data-theme="dark"] .classic-card-name { color: #E5E5E5; }
[data-theme="dark"] .classic-rlfs-bar { background: #1a2233; border-bottom-color: #374151; }
[data-theme="dark"] .classic-history { background: #111827; }
[data-theme="dark"] .classic-nav { background: #1F2937; border-bottom-color: #374151; }

/* Keyboard shortcut hints */
.kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}

/* ============ DAILY MOVES MODAL ============ */
.dm-overlay { position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.7);z-index:10000;display:flex;justify-content:center;align-items:flex-start;padding-top:50px; }
.dm-panel { width:720px;max-width:95vw;max-height:82vh;max-height:82dvh;overflow-y:auto;-webkit-overflow-scrolling:touch;background:var(--bg-primary);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg); }
.dm-header { padding:var(--sp-4) 20px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center; }
.dm-header h2 { margin:0;color:var(--accent);font-size:var(--fs-section-header);font-weight:var(--fw-bold); }
.dm-summary { display:flex;gap:var(--sp-3);padding:var(--sp-4) 20px;border-bottom:1px solid var(--border); }
.dm-stat { flex:1;text-align:center;padding:var(--sp-3);background:var(--bg-card);border-radius:var(--radius);border:1px solid var(--border); }
.dm-stat .num { font-size:22px;font-weight:var(--fw-bold);color:var(--accent); }
.dm-stat .lbl { font-size:var(--fs-meta);color:var(--text-muted);margin-top:2px; }
.dm-section { padding:var(--sp-3) 20px;border-bottom:1px solid var(--border-subtle); }
.dm-section h3 { margin:0 0 var(--sp-2);font-size:var(--fs-label);color:var(--text-muted);text-transform:uppercase;letter-spacing:0.5px;font-weight:var(--fw-bold); }
.dm-row { padding:var(--sp-2) var(--sp-3);margin-bottom:var(--sp-1);background:var(--bg-card);border-radius:var(--radius-sm);cursor:pointer;display:flex;justify-content:space-between;align-items:center;border:1px solid transparent;transition:all var(--transition); }
.dm-row:hover { background:var(--bg-hover);border-color:var(--border); }
.dm-row .acct { font-weight:var(--fw-semibold);color:var(--text-primary);font-size:var(--fs-body); }
.dm-badge { padding:2px var(--sp-2);border-radius:var(--radius-pill);font-size:var(--fs-meta);font-weight:var(--fw-bold); }
.dm-badge-red { background:var(--accent);color:#fff; }
.dm-badge-orange { background:var(--warning);color:#000; }
.dm-badge-gray { background:var(--richness-0);color:#fff; }
.dm-ai { padding:var(--sp-4) 20px;margin:var(--sp-3) 20px;background:var(--bg-card);border-left:3px solid var(--accent);border-radius:var(--radius-sm);white-space:pre-wrap;font-size:var(--fs-body);line-height:1.6; }

/* ============ FOLLOW-UP QUEUE ============ */
.queue-header-row { display:grid;grid-template-columns:2fr 1fr 1fr 1.5fr 80px;padding:var(--sp-2) var(--sp-4);font-size:var(--fs-meta);color:var(--text-muted);border-bottom:1px solid var(--border);text-transform:uppercase;font-weight:var(--fw-semibold);letter-spacing:0.5px; }
.queue-section-hdr { padding:var(--sp-2) var(--sp-4);font-weight:var(--fw-bold);font-size:var(--fs-label);display:flex;justify-content:space-between;border-radius:var(--radius-xs) var(--radius-xs) 0 0; }
.queue-section-hdr.overdue { background:var(--accent-subtle);color:var(--accent); }
.queue-section-hdr.today { background:var(--warning-glow);color:var(--warning); }
.queue-section-hdr.upcoming { background:var(--info-glow);color:var(--info); }
.queue-section-hdr.nodate { background:rgba(128,128,128,0.08);color:var(--text-muted); }
.queue-row { display:grid;grid-template-columns:2fr 1fr 1fr 1.5fr 80px;padding:var(--sp-2) var(--sp-4);border-bottom:1px solid var(--border-subtle);align-items:center;cursor:pointer;font-size:var(--density-fs-body);transition:background var(--transition); }
.queue-row:hover { background:var(--bg-hover); }

/* ============ CAST LOGGER ============ */
.cast-logger { padding:var(--sp-3);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:var(--sp-3);background:var(--bg-card); }
.cast-logger .cl-title { font-weight:var(--fw-bold);margin-bottom:var(--sp-2);color:var(--accent);font-size:var(--fs-label); }
.cast-logger input, .cast-logger select { width:100%;padding:5px;margin-bottom:var(--sp-1);background:var(--bg-input);color:var(--text-primary);border:1px solid var(--border);border-radius:var(--radius-xs);font-size:var(--density-fs-body);box-sizing:border-box;font-family:var(--font-body); }
.cast-logger .cl-row { display:flex;gap:var(--sp-1);margin-bottom:var(--sp-1); }
.cast-logger .cl-row select { flex:1; }
.cast-logger button { padding:var(--sp-2) var(--sp-4);background:var(--accent);color:#fff;border:none;border-radius:var(--btn-radius);cursor:pointer;font-weight:var(--fw-bold);font-size:var(--fs-body);font-family:var(--font-body); }

/* ============ EDITABLE FIELDS ============ */
@keyframes fieldSaved { 0%{background:transparent} 50%{background:rgba(52,211,153,0.12)} 100%{background:transparent} }
.cf-value.editable { cursor:pointer;border-bottom:1px dashed transparent;transition:border-color 0.15s; }
.cf-value.editable:hover { border-bottom-color:var(--accent); }
.cf-value.editable input, .cf-value.editable select, .cf-value.editable textarea {
  width:100%;padding:3px 5px;font-size:inherit;font-family:var(--font-body);border:2px solid var(--accent);border-radius:var(--radius-xs);background:var(--bg-input);color:var(--text-primary);box-sizing:border-box;
}

/* ============ TOPBAR ADDITIONS ============ */
.topbar-move-btn { padding:var(--sp-1) var(--sp-3);background:var(--accent);color:#fff;border:none;border-radius:var(--btn-radius);cursor:pointer;font-weight:var(--fw-bold);font-size:var(--fs-label);white-space:nowrap;font-family:var(--font-body); }
.topbar-move-btn:hover { background:var(--accent-hover); }
.topbar-util-btn { padding:var(--sp-1) var(--sp-2);background:var(--bg-card);color:var(--text-secondary);border:1px solid var(--border);border-radius:var(--btn-radius);cursor:pointer;font-size:var(--fs-meta);white-space:nowrap;font-family:var(--font-body);transition:all var(--transition); }
.topbar-util-btn:hover { color:var(--text-primary);border-color:var(--accent); }
/* v5.88.5 UX#1 — DROS home button, expanded three-state contrast so "you are home"
   is unmistakable. Default neutral (muted border + muted text, reads as nav button).
   Hover previews active without full fill (accent border + accent text).
   Active dramatic (accent fill + white text + 4px glow ring + inset highlight). */
.topbar-move-btn.topbar-dros-btn { background:var(--bg-card);color:var(--text-muted);border:1px solid var(--border);transition:all var(--transition); }
.topbar-move-btn.topbar-dros-btn:hover { background:var(--bg-card);color:var(--accent);border-color:var(--accent); }
.topbar-move-btn.topbar-dros-btn.active { background:var(--accent);color:#fff;border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2); }
[data-theme="classic94"] .topbar-move-btn.topbar-dros-btn { box-shadow:var(--bevel-btn);background:#C0C0C0;color:#000000;border:none;font-weight:700; }
[data-theme="classic94"] .topbar-move-btn.topbar-dros-btn:hover { background:#b0b0b0;color:#000080; }
[data-theme="classic94"] .topbar-move-btn.topbar-dros-btn.active { box-shadow:var(--bevel-sunken);background:#000080;color:#ffffff; }
/* ============ TARGET LIST BUILDER ============ */
.target-panel { width:100%;padding:var(--sp-4);overflow-y:auto;height:calc(100vh - 48px);height:calc(100dvh - 48px); }
.target-input-row { display:flex;gap:var(--sp-2);margin-bottom:var(--sp-2); }
.target-input-row input, .target-input-row select { padding:var(--sp-3);background:var(--bg-input);border:1px solid var(--border);border-radius:var(--input-radius);color:var(--text-primary);font-size:var(--fs-body);font-family:var(--font-body);outline:none;transition:border var(--transition),box-shadow var(--transition); }
.target-input-row input:focus, .target-input-row select:focus { border-color:var(--border-focus);box-shadow:0 0 0 2px var(--accent-glow); }
.target-btn { width:100%;padding:var(--sp-3);font-size:var(--fs-card-title);font-weight:var(--fw-bold);background:var(--accent);color:#fff;border:none;border-radius:var(--btn-radius);cursor:pointer;letter-spacing:0.5px;transition:background 0.15s;font-family:var(--font-body); }
.target-btn:hover { background:var(--accent-hover); }
.target-btn:disabled { opacity:0.5;cursor:not-allowed; }
.target-results-table { width:100%;border-collapse:collapse;font-size:var(--density-fs-body);margin-top:var(--sp-3); }
.target-results-table th { text-align:left;padding:var(--sp-2) var(--sp-3);background:var(--bg-tertiary);color:var(--text-secondary);font-size:var(--fs-meta);text-transform:uppercase;letter-spacing:0.5px;border-bottom:1px solid var(--border);font-weight:var(--fw-semibold); }
.target-results-table td { padding:var(--sp-2) var(--sp-3);border-bottom:1px solid var(--border-subtle);color:var(--text-primary);vertical-align:top; }
.target-results-table tr:hover { background:var(--bg-hover); }
.target-score { display:inline-block;min-width:24px;text-align:center;padding:2px 6px;border-radius:10px;font-weight:700;font-size:11px;color:#fff; }
.target-score-high { background:#2ecc71; }
.target-score-med { background:#f39c12; }
.target-score-low { background:#e74c3c; }
.target-saved-badge { display:inline-block;padding:2px 6px;border-radius:3px;font-size:10px;font-weight:600;background:rgba(46,204,113,0.15);color:#2ecc71;margin-left:4px; }
.target-save-btn { padding:3px 8px;font-size:10px;background:var(--accent);color:#fff;border:none;border-radius:3px;cursor:pointer;font-weight:600; }
.target-save-btn:hover { opacity:0.85; }
.target-save-btn:disabled { opacity:0.4;cursor:not-allowed; }
.target-list-card { padding:10px 12px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:6px;cursor:pointer;transition:border-color 0.15s; }
.target-list-card:hover { border-color:var(--accent); }
.target-list-card.active { border-color:var(--accent);background:var(--bg-hover); }
.target-list-meta { font-size:10px;color:var(--text-muted);margin-top:2px; }
.target-section-title { font-size:11px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:0.5px;margin:16px 0 8px;font-weight:600; }
.target-bulksave-btn { padding:10px 24px;font-size:13px;font-weight:700;background:var(--success);color:#fff;border:none;border-radius:var(--radius);cursor:pointer;letter-spacing:0.5px; }
.target-bulksave-btn:hover { opacity:0.9; }
.target-delete-btn { padding:4px 8px;font-size:10px;background:transparent;color:var(--danger);border:1px solid var(--danger);border-radius:3px;cursor:pointer; }
.target-delete-btn:hover { background:var(--danger);color:#fff; }
.target-snippet { font-size:11px;color:var(--text-muted);max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.target-reasons { font-size:10px;color:var(--text-muted);margin-top:2px; }
/* ============ CAST DRAFT MODAL ============ */
.cast-overlay { position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.7);z-index:9999;display:flex;align-items:center;justify-content:center; }
.cast-modal { background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);width:600px;max-width:90vw;max-height:80vh;max-height:80dvh;overflow-y:auto;-webkit-overflow-scrolling:touch;box-shadow:var(--shadow-lg); }
.cast-modal-header { padding:var(--sp-4) 18px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center; }
.cast-modal-header h3 { margin:0;font-size:var(--fs-card-title);color:var(--text-primary);font-weight:var(--fw-bold); }
.cast-modal-close { background:none;border:none;color:var(--text-muted);font-size:20px;cursor:pointer;padding:0 4px; }
.cast-modal-close:hover { color:var(--text-primary); }
.cast-modal-body { padding:18px; }
.cast-field-label { font-size:var(--fs-meta);text-transform:uppercase;letter-spacing:0.5px;color:var(--text-muted);margin-bottom:var(--sp-1);font-weight:var(--fw-semibold); }
.cast-field-value { font-size:var(--fs-body);color:var(--text-primary);padding:var(--sp-3);background:var(--bg-input);border:1px solid var(--border);border-radius:var(--radius-sm);margin-bottom:var(--sp-3);line-height:var(--lh);white-space:pre-wrap;font-family:var(--font-body);cursor:text;user-select:all; }
.cast-field-value.subject { font-weight:var(--fw-semibold); }
.cast-modal-actions { padding:var(--sp-3) 18px;border-top:1px solid var(--border);display:flex;gap:var(--sp-2);justify-content:flex-end; }
.cast-copy-btn { padding:var(--sp-2) 20px;font-size:var(--fs-body);font-weight:var(--fw-bold);background:var(--accent);color:#fff;border:none;border-radius:var(--btn-radius);cursor:pointer;font-family:var(--font-body); }
.cast-copy-btn:hover { background:var(--accent-hover); }
.cast-copy-all-btn { padding:var(--sp-2) 20px;font-size:var(--fs-body);font-weight:var(--fw-bold);background:var(--success);color:#fff;border:none;border-radius:var(--btn-radius);cursor:pointer;font-family:var(--font-body); }
.cast-copy-all-btn:hover { opacity:0.9; }
.cast-draft-btn { padding:var(--sp-2) var(--sp-3);font-size:var(--fs-label);font-weight:var(--fw-semibold);background:#8b5cf6;color:#fff;border:none;border-radius:var(--radius-xs);cursor:pointer;font-family:var(--font-body); }
.cast-draft-btn:hover { opacity:0.85; }
.cast-draft-btn:disabled { opacity:0.4;cursor:not-allowed; }
.cast-tool-badge { display:inline-block;padding:2px 6px;border-radius:var(--radius-xs);font-size:var(--fs-meta);font-weight:var(--fw-semibold);margin-left:6px; }
.cast-tool-threat { background:var(--danger-glow);color:var(--danger); }
.cast-tool-possibility { background:var(--info-glow);color:var(--info); }
.cast-tool-ease { background:var(--success-glow);color:var(--success); }

/* ============================================================
   ONBOARDING FLOW — Phase 8
   ============================================================ */
#onboarding-overlay {
  position:fixed;top:0;left:0;right:0;bottom:0;z-index:99999;
  background:var(--bg-primary);
  display:flex;align-items:center;justify-content:center;
  opacity:0;animation:obFadeIn 0.4s ease forwards;
}
@keyframes obFadeIn { to { opacity:1; } }
.ob-container {
  width:100%;max-width:680px;padding:24px;
}
.ob-card {
  background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);
  padding:48px 40px;position:relative;overflow:hidden;
}
.ob-card::before {
  content:'';position:absolute;top:0;left:0;right:0;height:3px;
  background:linear-gradient(90deg,var(--accent),#8b5cf6,var(--accent));
}
.ob-progress {
  display:flex;gap:var(--sp-2);margin-bottom:var(--sp-6);
}
.ob-progress-dot {
  flex:1;height:4px;border-radius:2px;background:var(--border);transition:background 0.3s ease;
}
.ob-progress-dot.active { background:var(--accent); }
.ob-progress-dot.done { background:var(--success); }
.ob-step-num {
  font-size:var(--fs-label);text-transform:uppercase;letter-spacing:1.5px;color:var(--text-muted);margin-bottom:var(--sp-2);
}
.ob-title {
  font-size:var(--fs-page-title);font-weight:var(--fw-bold);color:var(--text-primary);margin-bottom:var(--sp-2);line-height:1.3;
}
.ob-subtitle {
  font-size:var(--fs-card-title);color:var(--text-secondary);margin-bottom:28px;line-height:var(--lh);
}
.ob-industry-grid {
  display:grid;grid-template-columns:repeat(2,1fr);gap:var(--sp-3);margin-bottom:var(--sp-5);
}
@media(max-width:600px){ .ob-industry-grid { grid-template-columns:1fr; } }
.ob-industry-card {
  padding:var(--sp-4);border:1px solid var(--border);border-radius:var(--radius);cursor:pointer;
  transition:all 0.15s ease;background:var(--bg-primary);text-align:left;
}
.ob-industry-card:hover { border-color:var(--text-muted);background:var(--bg-hover); }
.ob-industry-card.selected { border-color:var(--accent);background:var(--accent-subtle);box-shadow:0 0 0 2px var(--accent-glow); }
.ob-industry-card .ob-ic-icon { font-size:22px;margin-bottom:var(--sp-2); }
.ob-industry-card .ob-ic-name { font-size:var(--fs-card-title);font-weight:var(--fw-semibold);color:var(--text-primary); }
.ob-industry-card .ob-ic-desc { font-size:var(--fs-label);color:var(--text-muted);margin-top:var(--sp-1); }
.ob-btn-row { display:flex;gap:var(--sp-3);justify-content:flex-end;margin-top:28px; }
.ob-btn {
  padding:var(--sp-3) 28px;font-size:var(--fs-card-title);font-weight:var(--fw-semibold);border:none;border-radius:var(--btn-radius);cursor:pointer;
  transition:all 0.15s ease;letter-spacing:0.3px;font-family:var(--font-body);
}
.ob-btn-primary { background:var(--accent);color:#fff; }
.ob-btn-primary:hover { background:var(--accent-hover); }
.ob-btn-primary:disabled { opacity:0.4;cursor:not-allowed; }
.ob-btn-secondary { background:transparent;color:var(--text-secondary);border:1px solid var(--border); }
.ob-btn-secondary:hover { border-color:var(--text-muted);color:var(--text-primary); }
.ob-btn-ghost { background:transparent;color:var(--text-muted);border:none; }
.ob-btn-ghost:hover { color:var(--text-primary); }
.ob-input {
  width:100%;padding:var(--sp-3) var(--sp-4);background:var(--bg-primary);border:1px solid var(--border);
  border-radius:var(--input-radius);color:var(--text-primary);font-size:var(--fs-card-title);font-family:var(--font-body);
}
.ob-input:focus { outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-glow); }
.ob-input::placeholder { color:var(--text-muted); }
.ob-label { display:block;font-size:var(--fs-label);color:var(--text-secondary);margin-bottom:var(--sp-2);text-transform:uppercase;letter-spacing:0.5px;font-weight:var(--fw-semibold); }
.ob-field { margin-bottom:var(--sp-4); }
.ob-tag-list { display:flex;flex-wrap:wrap;gap:var(--sp-2);margin-top:var(--sp-2); }
.ob-tag {
  display:inline-flex;align-items:center;gap:4px;padding:4px 10px;background:var(--accent-glow);
  border:1px solid var(--accent);border-radius:16px;font-size:12px;color:var(--accent);
}
.ob-tag button { background:none;border:none;color:var(--accent);cursor:pointer;font-size:14px;padding:0;line-height:1; }
.ob-vert-checks { display:flex;flex-wrap:wrap;gap:8px;margin-top:8px; }
.ob-vert-check { display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text-primary);cursor:pointer; }
.ob-vert-check input { accent-color:var(--accent); }
.ob-import-choice { display:flex;gap:12px;margin-bottom:20px; }
.ob-import-btn {
  flex:1;padding:20px;border:1px solid var(--border);border-radius:8px;cursor:pointer;
  background:var(--bg-primary);text-align:center;transition:all 0.15s ease;
}
.ob-import-btn:hover { border-color:var(--text-muted); }
.ob-import-btn.selected { border-color:var(--accent);background:var(--accent-glow); }
.ob-import-btn .ob-ib-icon { font-size:28px;margin-bottom:6px; }
.ob-import-btn .ob-ib-label { font-size:14px;font-weight:600;color:var(--text-primary); }
.ob-import-btn .ob-ib-desc { font-size:11px;color:var(--text-muted);margin-top:4px; }
.ob-csv-area {
  width:100%;height:140px;padding:10px;background:var(--bg-primary);border:1px solid var(--border);
  border-radius:6px;color:var(--text-primary);font-size:12px;font-family:var(--font-mono);resize:vertical;
}
.ob-csv-area:focus { outline:none;border-color:var(--accent); }
.ob-preview-table {
  width:100%;border-collapse:collapse;font-size:12px;margin-top:12px;
}
.ob-preview-table th {
  text-align:left;padding:6px 8px;background:var(--bg-tertiary);color:var(--text-secondary);
  font-size:10px;text-transform:uppercase;letter-spacing:0.5px;border-bottom:1px solid var(--border);
}
.ob-preview-table td {
  padding:6px 8px;border-bottom:1px solid var(--border);color:var(--text-primary);
}
.ob-loaded-list {
  max-height:200px;overflow-y:auto;margin:16px 0;
}
.ob-loaded-item {
  display:flex;justify-content:space-between;align-items:center;
  padding:8px 12px;border:1px solid var(--border);border-radius:6px;margin-bottom:6px;
  font-size:13px;color:var(--text-primary);background:var(--bg-primary);
}
.ob-loaded-item .ob-li-label { font-weight:600; }
.ob-loaded-item .ob-li-count { font-size:11px;color:var(--text-muted); }
.ob-scout-result {
  margin-top:16px;padding:16px;background:var(--bg-primary);border:1px solid var(--border);border-radius:8px;
  font-size:13px;color:var(--text-secondary);max-height:250px;overflow-y:auto;line-height:1.6;
}
.ob-scout-result strong { color:var(--text-primary); }
.ob-spinner {
  display:inline-block;width:16px;height:16px;border:2px solid var(--border);
  border-top-color:var(--accent);border-radius:50%;animation:obSpin 0.8s linear infinite;
  vertical-align:middle;margin-right:6px;
}
@keyframes obSpin { to { transform:rotate(360deg); } }

/* ============================================================
   ITEM 12: MOBILE PWA — Responsive CSS
   ============================================================ */

/* --- Hamburger Drawer --- */
.mobile-hamburger { display:none;background:none;border:none;color:var(--text-primary);font-size:24px;cursor:pointer;padding:8px;line-height:1;z-index:1001; }
.ai-mobile-toggle { display:none; }
.mobile-drawer-overlay { display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:9990; }
.mobile-drawer-overlay.open { display:block; }
.mobile-drawer { position:fixed;top:0;left:-280px;width:280px;height:100%;background:var(--bg-primary);border-right:1px solid var(--border);z-index:9991;transition:left 0.25s ease;overflow-y:auto;padding:var(--sp-4) 0; }
.mobile-drawer.open { left:0; }
.mobile-drawer-header { padding:var(--sp-3) var(--sp-4);border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center; }
.mobile-drawer-brand { font-size:var(--fs-section-header);font-weight:800;color:var(--text-primary);letter-spacing:1px; }
.mobile-drawer-close { background:none;border:none;color:var(--text-muted);font-size:20px;cursor:pointer;padding:var(--sp-1) var(--sp-2); }
.mobile-drawer .drawer-nav-btn { display:block;width:100%;text-align:left;padding:var(--sp-3) var(--sp-4);border:none;background:none;color:var(--text-secondary);font-size:var(--fs-card-title);font-weight:var(--fw-semibold);cursor:pointer;border-bottom:1px solid var(--border-subtle);font-family:var(--font-body); }
.mobile-drawer .drawer-nav-btn:hover,.mobile-drawer .drawer-nav-btn.active { color:var(--accent);background:var(--accent-subtle); }
.mobile-drawer .drawer-section { padding:var(--sp-2) var(--sp-4);font-size:var(--fs-meta);font-weight:var(--fw-bold);color:var(--text-muted);text-transform:uppercase;letter-spacing:0.5px;margin-top:var(--sp-2); }
.mobile-drawer .drawer-themes { padding:var(--sp-2) var(--sp-4);display:flex;gap:var(--sp-2); }
.mobile-drawer .drawer-themes .theme-btn { flex:1; }
.mobile-drawer .drawer-status { padding:var(--sp-3) var(--sp-4);display:flex;align-items:center;gap:var(--sp-2);font-size:var(--fs-body);color:var(--text-secondary); }

/* --- Mobile Search Overlay --- */
.mobile-search-toggle { display:none;background:none;border:none;color:var(--text-secondary);font-size:18px;cursor:pointer;padding:8px; }
.mobile-search-overlay { display:none;position:fixed;top:0;left:0;right:0;height:56px;background:var(--bg-primary);z-index:9980;padding:8px 12px;align-items:center;gap:8px;border-bottom:1px solid var(--border); }
.mobile-search-overlay.open { display:flex; }
.mobile-search-overlay input { flex:1;padding:10px 12px;font-size:16px;background:var(--bg-input);border:1px solid var(--border);border-radius:var(--radius);color:var(--text-primary);outline:none; }
.mobile-search-overlay .mobile-search-close { background:none;border:none;color:var(--text-muted);font-size:18px;cursor:pointer;padding:4px 8px; }

/* --- Offline Banner --- */
.offline-banner { display:none;position:fixed;top:0;left:0;right:0;padding:8px 16px;background:#f59e0b;color:#000;font-size:12px;font-weight:700;text-align:center;z-index:99998;letter-spacing:0.3px; }
.offline-banner.visible { display:block; }

/* --- PWA Install Banner --- */
.pwa-install-banner { display:none;position:fixed;bottom:0;left:0;right:0;padding:12px 16px;padding-bottom:calc(12px + env(safe-area-inset-bottom));background:var(--bg-secondary);border-top:1px solid var(--border);z-index:9998;align-items:center;gap:12px; }
.pwa-install-banner.visible { display:flex; }
.pwa-install-banner .pwa-text { flex:1;font-size:12px;color:var(--text-secondary);line-height:1.4; }
.pwa-install-banner .pwa-install-btn { padding:8px 16px;background:var(--accent);color:#fff;border:none;border-radius:var(--radius);font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap; }
.pwa-install-banner .pwa-dismiss { background:none;border:none;color:var(--text-muted);font-size:16px;cursor:pointer;padding:4px; }

/* Mobile-safe scroll containers (dvh fallback for inline-styled panels) */
.scroll-vh-48 { overflow-y:auto;height:calc(100vh - 48px);height:calc(100dvh - 48px); }
.scroll-vh-50 { overflow-y:auto;height:calc(100vh - 50px);height:calc(100dvh - 50px); }
.scroll-vh-60 { overflow-y:auto;max-height:calc(100vh - 60px);max-height:calc(100dvh - 60px); }
.scroll-vh-120 { overflow-y:auto;max-height:calc(100vh - 120px);max-height:calc(100dvh - 120px); }

/* Mobile-only elements hidden on desktop */
.mobile-bottom-nav { display:none; }
.ai-mobile-toggle { display:none; }
.ddp-deal-overlay { display:none; }
.mobile-back-btn { display:none;background:none;border:none;color:var(--text-primary);font-size:22px;cursor:pointer;padding:4px 8px 4px 0;line-height:1; }

/* ============================================================
   iPAD / TABLET BREAKPOINT (769px — 1024px)
   Two-column layout, desktop nav visible, larger touch targets
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* App grid: 2 columns, narrower panels */
  .app { grid-template-columns: 1fr 360px; }
  .app.detail-open { grid-template-columns: 1fr 420px; }
  .app.detail-open .list-panel { display:none; }
  .app.kanban-mode { grid-template-columns: 1fr; }
  .app.kanban-mode.detail-open { grid-template-columns: 1fr 420px; }
  .app.classic-mode { grid-template-columns: 1fr 400px; }

  /* AI panel: narrower on tablet */
  .ai-panel { max-width:360px; }

  /* Topbar: tighten spacing */
  .topbar { padding:8px 12px;min-height:48px; }
  .topbar-brand { font-size:15px; }
  .topbar-brand span { font-size:9px; }
  .topbar-stat { font-size:11px; }
  .topbar-search input { width:160px;font-size:13px; }
  .nav-scroll-wrapper { max-width:340px; }
  .nav-scroll-wrapper button { font-size:10px;padding:6px 8px; }

  /* Touch targets: 44px minimum for all interactive elements */
  button, .filter-chip, .quick-chip, .view-toggle-btn, .theme-btn, input[type="submit"] {
    min-height:44px;min-width:44px;
  }
  input, select, textarea { font-size:16px !important;padding:10px 12px; }

  /* List panel: slightly larger items for finger tapping */
  .account-item { padding:10px 14px; }
  .account-name { font-size:13px; }

  /* Detail panel: takes over right side */
  .detail-panel { overflow-y:auto; }
  .detail-header h2 { font-size:15px; }
  .detail-tabs { overflow-x:auto;-webkit-overflow-scrolling:touch;flex-wrap:nowrap;scrollbar-width:none; }
  .detail-tabs::-webkit-scrollbar { display:none; }
  .detail-tabs button { white-space:nowrap;flex-shrink:0;min-height:44px;font-size:11px; }
  .detail-content { padding:12px; }

  /* DROS: keep 2-col grid but tighter */
  .dros-container { padding:14px; }
  .dros-grid { gap:12px; }
  .dros-score-item { min-width:calc(33% - 4px); }
  .dros-card-actions .dros-btn { min-height:44px;font-size:11px; }

  /* Kanban: columns scroll horizontally */
  .kanban-board { overflow-x:auto;-webkit-overflow-scrolling:touch; }
  .kanban-column { min-width:280px;flex-shrink:0; }

  /* Deal detail panel: overlay from right, 420px */
  .deal-detail-panel { max-width:420px; }

  /* Flow Mode */
  .flow-card { width:calc(100% - 32px);margin:12px auto; }
  .flow-actions .flow-action-btn { min-height:44px; }

  /* Reports: 2 columns for stats */
  .report-stats { display:grid !important;grid-template-columns:1fr 1fr;gap:8px; }
  .report-table-wrap { overflow-x:auto;-webkit-overflow-scrolling:touch; }

  /* Settings: single column */
  .settings-grid { grid-template-columns:1fr !important; }

  /* Modals: centered, not full-screen like phone */
  .dros-stage-warning-card, .modal-card, [class*="modal"] > div:not(.modal-overlay) {
    max-width:90% !important;max-height:90% !important;
  }

  /* Relationship map */
  .relationship-map svg { max-width:100%;height:auto; }

  /* Onboarding grid */
  .ob-industry-grid { grid-template-columns:repeat(2,1fr); }
}

/* ============================================================
   TABLET BREAKPOINT (768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Hide desktop nav, show hamburger */
  .nav-scroll-wrapper, .topbar-actions, .topbar-search { display:none !important; }
  .view-toggle { display:none !important; }
  .mobile-hamburger, .mobile-search-toggle { display:inline-block; }
  .topbar { padding:8px 12px;min-height:48px;gap:8px; }
  .topbar-brand span { font-size:9px; }
  .topbar-stat { font-size:11px; }

  /* App layout — single column stack */
  .app { grid-template-columns:1fr !important;grid-template-rows:48px auto 1fr !important; }
  .app.detail-open { grid-template-columns:1fr !important; }
  .app.detail-open .list-panel { display:none; }
  .detail-panel { position:fixed;top:48px;left:0;right:0;bottom:0;z-index:100;overflow-y:auto; }
  .app.detail-open .detail-panel { display:block; }

  /* AI Panel — collapsed by default on mobile, just input bar visible */
  .ai-panel { max-height:52px;overflow:hidden;transition:max-height 0.25s ease; }
  .ai-panel .ai-header, .ai-panel .ai-messages, .ai-panel .ai-quick-actions { display:none; }
  .ai-panel.mobile-expanded .ai-header, .ai-panel.mobile-expanded .ai-quick-actions { display:flex; }
  .ai-panel.mobile-expanded .ai-messages { display:block; }
  .ai-panel.mobile-expanded { max-height:70vh;max-height:70dvh;position:fixed;top:48px;left:0;right:0;z-index:9985;box-shadow:0 4px 24px rgba(0,0,0,0.5);overflow-y:auto;-webkit-overflow-scrolling:touch; }
  .ai-panel .ai-input-area { position:relative; }
  .ai-mobile-toggle { display:inline-block;background:none;border:none;color:var(--accent);font-size:18px;cursor:pointer;padding:8px;line-height:1; }
  .ai-quick-actions { flex-wrap:wrap; }

  /* DROS Panel */
  .dros-container { padding:12px; }
  .dros-header { flex-direction:column;gap:8px;align-items:flex-start; }
  .dros-header h2 { font-size:16px; }
  .dros-grid { grid-template-columns:1fr !important; }
  .dros-scoreboard { flex-wrap:wrap; }
  .dros-score-item { min-width:calc(33% - 4px); }
  .dros-card-actions { flex-wrap:wrap; }
  .dros-card-actions .dros-btn { flex:1 1 calc(50% - 4px);min-width:0;text-align:center;padding:8px 6px;min-height:44px;font-size:11px; }

  /* Account detail */
  .detail-tabs { overflow-x:auto;-webkit-overflow-scrolling:touch;flex-wrap:nowrap;scrollbar-width:none; }
  .detail-tabs::-webkit-scrollbar { display:none; }
  .detail-tabs button { white-space:nowrap;flex-shrink:0;min-height:44px; }
  .detail-content { padding:12px; }

  /* Reports */
  .report-stats { display:grid !important;grid-template-columns:1fr 1fr;gap:8px; }
  .report-table-wrap { overflow-x:auto;-webkit-overflow-scrolling:touch; }

  /* Settings */
  .settings-grid { grid-template-columns:1fr !important; }

  /* Modals become full-screen */
  .dros-stage-warning-card, .modal-card, [class*="modal"] > div:not(.modal-overlay) {
    max-width:100% !important;width:100% !important;height:100% !important;
    border-radius:0 !important;margin:0 !important;
  }

  /* Flow Mode bottom toolbar */
  .flow-actions { position:sticky;bottom:0;background:var(--bg-primary);padding:10px 0;border-top:1px solid var(--border);display:flex;flex-wrap:wrap;gap:6px;z-index:10; }
  .flow-actions .flow-action-btn { flex:1 1 calc(33% - 6px);min-height:44px;font-size:11px;text-align:center;justify-content:center; }
  .flow-card { margin:12px auto;width:calc(100% - 24px); }
  .flow-section { padding:12px; }
  .flow-draft-area { min-height:120px;font-size:14px; }
  .flow-topbar { padding:8px 12px; }

  /* Kanban: horizontal scroll with snap */
  .kanban-board { overflow-x:auto;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory;scroll-padding:0 8px; }
  .kanban-column { min-width:85vw;scroll-snap-align:start;flex-shrink:0; }

  /* Deal detail panel — full screen on mobile with overlay */
  .deal-detail-panel { width:100%;max-width:100%;right:-100%; }
  .deal-detail-panel.open { right:0; }
  .ddp-deal-overlay { display:block;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:9997; }

  /* General touch targets */
  button, .filter-chip, .quick-chip, .view-toggle-btn, .theme-btn, input[type="submit"] {
    min-height:44px;min-width:44px;
  }
  input, select, textarea { font-size:16px !important;padding:10px 12px; }

  /* Toasts at bottom above nav */
  .toast, [style*="position:fixed"][style*="bottom:20px"] { bottom:72px !important;right:12px !important;left:12px !important;max-width:none !important; }

  /* No horizontal scroll */
  body, .app, .dros-container { overflow-x:hidden; max-width:100vw; }

  /* Relationship map SVG */
  .relationship-map svg { max-width:100%;height:auto; }

  /* Mobile bottom nav bar */
  .mobile-bottom-nav { display:flex;position:fixed;bottom:0;left:0;right:0;height:56px;background:var(--bg-secondary);border-top:1px solid var(--border);z-index:9989;justify-content:space-around;align-items:center;padding:0 4px;padding-bottom:env(safe-area-inset-bottom); }
  .mobile-bottom-nav .mbn-btn { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:none;border:none;color:var(--text-muted);font-size:18px;cursor:pointer;padding:4px 8px;min-width:52px;min-height:44px;position:relative; }
  .mobile-bottom-nav .mbn-btn.active { color:var(--accent); }
  .mobile-bottom-nav .mbn-btn .mbn-label { font-size:9px;font-weight:700;letter-spacing:0.3px; }
  .mobile-bottom-nav .mbn-badge { position:absolute;top:2px;right:6px;min-width:14px;height:14px;border-radius:7px;background:var(--danger);color:#fff;font-size:8px;font-weight:800;display:flex;align-items:center;justify-content:center;padding:0 3px; }

  /* Make room for bottom nav */
  .app { padding-bottom:56px;padding-bottom:calc(56px + env(safe-area-inset-bottom)); }
  .ai-panel.mobile-expanded { bottom:56px;bottom:calc(56px + env(safe-area-inset-bottom)); }
  .mobile-back-btn { display:inline-block; }
  .detail-panel { bottom:56px;bottom:calc(56px + env(safe-area-inset-bottom)); }

  /* iOS Safari: prevent auto-zoom on focus for ALL inputs including inline-styled ones */
  input, select, textarea { font-size:16px !important; }

  /* iOS Safari: prevent rubber-band bounce on scroll containers */
  .list-panel, .detail-panel, .dros-container, .flow-overlay { overscroll-behavior:contain; }

  /* iOS Safari: prevent pull-to-refresh and elastic scrolling on fixed overlays */
  .mobile-drawer-overlay, .dros-stage-warning { touch-action:none; }

  /* Safe area: pad content away from notch/Dynamic Island */
  .topbar { padding-left:max(12px, env(safe-area-inset-left));padding-right:max(12px, env(safe-area-inset-right)); }
  .mobile-bottom-nav { height:calc(56px + env(safe-area-inset-bottom)); }

  /* Touch feedback: active states for tap responsiveness */
  .account-row:active, .mbn-btn:active, .dros-btn:active, .filter-chip:active, .quick-chip:active, .ss-card:active { opacity:0.7;transition:opacity 0.05s; }

  /* Prevent iOS tap highlight from obscuring UI */
  * { -webkit-tap-highlight-color:rgba(255,45,85,0.1); }

  /* Prevent rubber-band scroll behind JS-created fixed overlays */
  [style*="position:fixed"][style*="top:0"][style*="bottom:0"] { overscroll-behavior:contain;touch-action:none; }
}

/* ============================================================
   SMALL PHONE BREAKPOINT (480px)
   ============================================================ */
@media (max-width: 480px) {
  .topbar { padding:6px 10px; }
  .topbar-brand { font-size:14px; }
  .dros-container { padding:8px; }
  .dros-header h2 { font-size:14px; }
  .dros-score-item { min-width:calc(50% - 4px); }
  .dros-score-num { font-size:18px; }
  .dros-card { padding:10px; }
  .dros-card-actions .dros-btn { font-size:10px;padding:8px 4px; }

  .flow-card { width:calc(100% - 16px);margin:8px auto; }
  .flow-acct-name { font-size:15px; }
  .flow-reason { font-size:12px; }
  .flow-actions .flow-action-btn { flex:1 1 calc(50% - 6px);font-size:10px; }

  .ai-panel { max-height:48px; }
  .ai-panel.mobile-expanded { max-height:80vh;max-height:80dvh; }
  .quick-chip { font-size:10px;padding:4px 8px; }

  .detail-tabs button { font-size:10px;padding:6px 10px; }
  .detail-content { padding:8px; }

  /* Meetings section above Top Actions on mobile (reorder via flexbox) */
  .dros-grid > div:first-child { display:flex;flex-direction:column; }

  /* v5.91.0 UX#5: bottom nav carries 6 tabs. Tighten per-button width so
     DROS+List+Kanban+People+Alerts+More all fit on 320px viewports. */
  .mobile-bottom-nav { padding:0 2px; }
  .mobile-bottom-nav .mbn-btn { min-width:46px;padding:4px 3px; }
  .mobile-bottom-nav .mbn-btn .mbn-label { font-size:8px;letter-spacing:0.2px; }
}

/* Custom time picker */
.tp-cell:hover { background: var(--bg-hover) !important; }
#tp-hour-col::-webkit-scrollbar, #tp-min-col::-webkit-scrollbar { width: 4px; }
#tp-hour-col::-webkit-scrollbar-thumb, #tp-min-col::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
/* ============================================================
   UI SNAPPINESS — Skeleton Screens, AI Progress, Optimistic
   ============================================================ */

/* Skeleton shimmer */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skel-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  margin-bottom: 8px;
}
.skel-line.w60 { width: 60%; }
.skel-line.w80 { width: 80%; }
.skel-line.w40 { width: 40%; }
.skel-line.w100 { width: 100%; }
.skel-line.h20 { height: 20px; }
.skel-line.h8 { height: 8px; }
.skel-block {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  margin-bottom: 10px;
}
.skel-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

/* AI progress stepper */
.ai-progress {
  text-align: center;
  padding: 24px 16px;
}
.ai-progress-step {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  opacity: 0.4;
  transition: opacity 0.3s, color 0.3s;
}
.ai-progress-step.active {
  opacity: 1;
  color: var(--accent);
  font-weight: 600;
}
.ai-progress-step.done {
  opacity: 0.6;
  color: var(--success);
}
.ai-progress-step.done::before {
  content: 'âœ“ ';
}
.ai-progress-step.active::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
.ai-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
  max-width: 200px;
  overflow: hidden;
}
.ai-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Optimistic fade out for dismissed/completed items */
.optimistic-removing {
  opacity: 0.3;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

/* ============================================================
   EMPTY STATES — Designed first impressions
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  min-height: 200px;
}
.empty-state-icon {
  font-size: 40px;
  margin-bottom: var(--sp-4);
  opacity: 0.3;
  color: var(--text-muted);
}
.empty-state-title {
  font-size: var(--fs-section-header);
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}
.empty-state-desc {
  font-size: var(--fs-body);
  color: var(--text-muted);
  max-width: 320px;
  line-height: var(--lh);
  margin-bottom: var(--sp-4);
}
.empty-state-btn {
  padding: var(--sp-2) var(--sp-5);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--transition);
}
.empty-state-btn:hover { background: var(--accent-hover); }

/* ============================================================
   SCROLLBAR — Thin, dark, unobtrusive
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ============================================================
   FOCUS RING — Consistent accessibility
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ============================================================
   v5.93.0.1 -- Unrouted Email Queue (v5.93.0.1 UNROUTED_QUEUE)
   ============================================================ */

.unrouted-queue-card {
  background: var(--bg-card);
  border: 1px solid var(--warning, #f59e0b);
  border-left: 3px solid var(--warning, #f59e0b);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.unrouted-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.unrouted-queue-title {
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  font-size: var(--fs-label);
  letter-spacing: 0.3px;
}
.unrouted-queue-count {
  font-size: 11px;
  color: var(--warning, #f59e0b);
  font-weight: var(--fw-semibold);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}
.unrouted-queue-rows { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.unrouted-mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--text-secondary);
}
.unrouted-mini-row:hover { background: var(--bg-hover); color: var(--text-primary); }
.unrouted-mini-from { font-weight: var(--fw-semibold); color: var(--text-primary); min-width: 140px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unrouted-mini-arrow { color: var(--text-muted); }
.unrouted-mini-subj { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }
.unrouted-queue-view-all {
  width: 100%;
  padding: 6px;
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.unrouted-queue-view-all:hover { background: var(--bg-hover); }

/* Bell icon in topbar */
.unrouted-bell-btn { padding: 4px 10px; font-size: 14px; }
.unrouted-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: var(--fw-bold);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Modal system */
.unrouted-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unrouted-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.unrouted-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.unrouted-modal-header h3 { margin: 0; font-size: var(--fs-card-title); color: var(--text-primary); font-weight: var(--fw-bold); }
.unrouted-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
}
.unrouted-modal-close:hover { color: var(--text-primary); }
.unrouted-modal-body { padding: 16px 18px; }
.unrouted-modal-actions {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.unrouted-row { margin-bottom: 8px; font-size: var(--fs-body); color: var(--text-primary); }
.unrouted-row strong { color: var(--text-muted); font-weight: var(--fw-semibold); margin-right: 4px; }
.unrouted-meta { margin: 10px 0; }
.unrouted-meta summary { cursor: pointer; color: var(--accent); font-size: var(--fs-label); font-weight: var(--fw-semibold); }
.unrouted-meta-body { padding: 8px 0 0 12px; color: var(--text-secondary); font-size: var(--fs-label); }

.unrouted-route-box {
  margin-top: 12px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.unrouted-route-label { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: var(--fw-semibold); }
.unrouted-route-box input {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: var(--fs-body);
  box-sizing: border-box;
  font-family: var(--font-body);
  margin-bottom: 8px;
}

.unrouted-suggestions { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.unrouted-suggest-label { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin: 4px 0; }
.unrouted-suggest-row {
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.unrouted-suggest-row:hover { background: var(--bg-hover); }
.unrouted-suggest-name { font-weight: var(--fw-semibold); color: var(--text-primary); margin-right: 6px; }
.unrouted-suggest-score { color: var(--text-muted); font-size: 11px; }
.unrouted-suggest-reason { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-style: italic; }
.unrouted-suggest-loading, .unrouted-empty { font-size: 12px; color: var(--text-muted); padding: 8px; text-align: center; }

.unrouted-list-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  background: var(--bg-card);
}
.unrouted-list-row:hover { background: var(--bg-hover); }
.unrouted-list-from { font-weight: var(--fw-semibold); color: var(--text-primary); font-size: var(--fs-body); }
.unrouted-list-subj { color: var(--text-secondary); font-size: var(--fs-label); margin-top: 2px; }
.unrouted-list-when { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.unrouted-field-label { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 4px; font-weight: var(--fw-semibold); }
.unrouted-modal-body input[type="text"],
.unrouted-modal-body input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: var(--fs-body);
  box-sizing: border-box;
  font-family: var(--font-body);
}

.unrouted-btn-primary,
.unrouted-btn-secondary,
.unrouted-btn-danger {
  padding: 6px 14px;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-family: var(--font-body);
}
.unrouted-btn-primary { background: var(--accent); color: #fff; }
.unrouted-btn-primary:hover { background: var(--accent-hover); }
.unrouted-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.unrouted-btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.unrouted-btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }
.unrouted-btn-danger { background: transparent; color: var(--danger, #ef4444); border: 1px solid var(--danger, #ef4444); }
.unrouted-btn-danger:hover { background: rgba(239, 68, 68, 0.08); }


/* v5.93.0.17 Sub-Deploy C — review UI styles */
.review-panel {
  padding: 16px 20px;
  max-width: 980px;
  margin: 0 auto;
}
.review-panel-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.review-panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}
.review-panel-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.review-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 12px 0 8px 0;
}
.review-empty {
  padding: 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 4px;
  text-align: center;
}
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
}
.review-card-header {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 120ms;
}
.review-card-header:hover {
  background: var(--bg-hover, rgba(255,255,255,0.04));
}
.review-card-subj {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.review-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-secondary);
}
.review-card-cls {
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.review-card-from { color: var(--text-muted); }
.review-card-conf { color: var(--text-muted); font-family: var(--font-mono, monospace); }
.review-card-recv { color: var(--text-muted); }
.review-actions {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  background: var(--bg-input, rgba(0,0,0,0.15));
}
.review-decision-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font-body);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: background 120ms, border-color 120ms;
}
.review-btn-accept { background: #22c55e; border-color: #22c55e; color: #fff; }
.review-btn-accept:hover { background: #16a34a; }
.review-btn-reject { background: transparent; color: var(--text-secondary); }
.review-btn-reject:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #ef4444; }
.review-btn-recat:hover { border-color: var(--accent); color: var(--accent); }
.review-card-detail {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-input, rgba(0,0,0,0.2));
}
.review-card-detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 6px 0 4px 0;
}
.review-card-detail-text {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 8px 0;
  max-height: 300px;
  overflow-y: auto;
}
.review-noise-section {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.review-noise-toggle {
  cursor: pointer;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-noise-toggle:hover { background: var(--bg-hover, rgba(255,255,255,0.04)); }
.review-noise-caret { font-size: 14px; color: var(--text-muted); }
.review-noise-label { font-weight: 600; }
.review-noise-list { margin-top: 10px; }


/* v5.99.2.98 ship11b-fixed — Calibrated Trust UI */
.unrouted-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}
.unrouted-dot-green { background: #4caf50; box-shadow: 0 0 4px rgba(76, 175, 80, 0.5); }
.unrouted-dot-yellow { background: #ffc107; box-shadow: 0 0 4px rgba(255, 193, 7, 0.5); }
.unrouted-dot-red { background: #f44336; box-shadow: 0 0 4px rgba(244, 67, 54, 0.5); }
.unrouted-accept-btn {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.4);
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
  transition: background 0.12s ease;
}
.unrouted-accept-btn:hover { background: rgba(76, 175, 80, 0.3); }
.unrouted-list-dot-cell {
  flex: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unrouted-list-accept-cell {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ============================================================
 * Ship 12: Sub-tab navigation (v5.99.2.99-ship12-subtab-css)
 * Used by renderKanbanSubTabs / renderTerritorySubTabs /
 * renderScoutSubTabs at the dispatcher level. Sub-tabs render
 * above the panel body and let the rep navigate sideways within
 * a sub-view family without bouncing back to the parent nav tab.
 * ============================================================ */
.panel-subtabs {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  background: var(--bg-card);
}

.panel-subtab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--font-body);
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.panel-subtab:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.panel-subtab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}


/* ============================================================
 * Ship 12 HOTFIX: subview-wrap (v5.99.2.100-ship12-subview-wrap-css)
 *
 * Wraps sub-tab + panel pairs into a single grid/layout child so the
 * parent .app container's child count is preserved (was 6, kept at 6).
 * Without this, kanban-mode CSS Grid auto-placement displaces the
 * panel content into a wrong cell.
 *
 * The wrap is a flex column: sub-tabs stack above the panel body,
 * panel body fills remaining height. Inside any layout mode (grid
 * kanban-mode, classic-mode, default), the wrap behaves as one
 * normal block child of .app.
 * ============================================================ */
.subview-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* In kanban-mode, the parent .app is CSS Grid. The original
 * .kanban-container claimed the full content column at row 4.
 * .subview-wrap must claim the same slot. Since grid-area was not
 * named (grid-template-areas: none in production), we let
 * auto-placement put the wrap into the same row .kanban-container
 * would have, in column 2 (the content column). */
.app.kanban-mode > .subview-wrap {
  grid-column: 2;
  min-height: 0;
}

/* Ensure the panel body inside the wrap can scroll if needed
 * without the wrap itself overflowing the grid cell. */
.subview-wrap > .panel-subtabs {
  flex-shrink: 0;
}

.subview-wrap > *:not(.panel-subtabs) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
