:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-strong: #e2e8f0;
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-faint: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --line-strong: #cbd5e1;

  /* Silverpush Brand Accent (Deep Emerald / Slate Teal) */
  --brand: #007568;
  --brand-hover: #006054;
  --brand-active: #004d43;
  --brand-soft: #f0fdf4;
  --brand-line: #bbf7d0;
  --brand-ring: rgba(0, 117, 104, 0.2);

  /* Enterprise Semantic Accents */
  --apollo-gold: #d97706;
  --apollo-gold-hover: #b45309;
  --apollo-gold-soft: #fffbeb;
  --apollo-gold-line: #fde68a;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --ok-line: #a7f3d0;
  --warn: #d97706;
  --serious: #ea580c;
  --critical: #dc2626;
  --critical-soft: #fef2f2;
  --critical-line: #fecaca;

  /* Tier Semantic Tokens */
  --tier-a: #c2410c;
  --tier-b: #b45309;
  --tier-c: #2563eb;
  --tier-d: #64748b;
  --tier-x: #94a3b8;

  /* Restrained, Crisp Enterprise Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);

  /* Precise Corner Radii */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-pill: 9999px;

  /* Executive Obsidian Sidebar Tokens */
  --sidebar-bg: #0a0f1d;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f8fafc;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(0, 117, 104, 0.16);
  --sidebar-active-text: #ffffff;
  --sidebar-active-line: #00a896;
  --sidebar-badge-bg: #1e293b;
  --sidebar-badge-text: #cbd5e1;
  --sidebar-badge-active: #007568;

  /* Aliases for names used across older redesign passes; they follow the theme via the tokens above. */
  --danger: var(--critical);
  --ink-muted: var(--ink-faint);
  --ink-base: var(--ink);
  --subtle: var(--ink-faint);
  --border: var(--line);
  --surface-sunken: var(--surface-soft);
  --brand-glow: var(--brand-ring);
  --radius-md: var(--radius);
  --font-sans: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", monospace;

  --info: #2563eb;
  /* Lead-quality ramp: one hue, strongest evidence darkest (validated: monotonic, CVD-separated) */
  --quality-1: #00574d;
  --quality-2: #1a9e8f;
  --quality-3: #7fd1c5;
  --quality-none: var(--surface-strong);

  /* Pipeline stage colours (dots, kanban headers). */
  --stage-new: #3b82f6;
  --stage-working: #d97706;
  --stage-meeting: #7c3aed;
  --stage-opportunity: #059669;
  --stage-nurture: #4f46e5;
  --stage-lost: #94a3b8;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090d16;
  --surface: #0f172a;
  --surface-soft: #1e293b;
  --surface-strong: #334155;
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --ink-faint: #94a3b8;
  --line: #1e293b;
  --line-soft: #162032;
  --line-strong: #334155;

  --brand: #00a896;
  --brand-hover: #14b8a6;
  --brand-active: #007568;
  --brand-soft: rgba(0, 168, 150, 0.12);
  --brand-line: rgba(0, 168, 150, 0.3);
  --brand-ring: rgba(0, 168, 150, 0.35);

  --apollo-gold: #fbbf24;
  --apollo-gold-hover: #f59e0b;
  --apollo-gold-soft: rgba(251, 191, 36, 0.12);
  --apollo-gold-line: rgba(251, 191, 36, 0.3);
  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.12);
  --ok-line: rgba(16, 185, 129, 0.3);
  --warn: #fbbf24;
  --serious: #fb923c;
  --critical: #f87171;
  --critical-soft: rgba(239, 68, 68, 0.12);
  --critical-line: rgba(239, 68, 68, 0.3);

  --tier-a: #fb923c;
  --tier-b: #fbbf24;
  --tier-c: #60a5fa;
  --tier-d: #94a3b8;
  --tier-x: #64748b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);

  --sidebar-bg: #060913;
  --sidebar-border: #161f30;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #ffffff;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: rgba(0, 168, 150, 0.2);
  --sidebar-active-text: #ffffff;
  --sidebar-active-line: #14b8a6;
  --sidebar-badge-bg: #1e293b;
  --sidebar-badge-text: #cbd5e1;
  --sidebar-badge-active: #00a896;

  --info: #60a5fa;
  /* Dark surface: strongest evidence lightest */
  --quality-1: #5eead4;
  --quality-2: #14b8a6;
  --quality-3: #0f766e;
  --quality-none: var(--surface-strong);

  --stage-new: #60a5fa;
  --stage-working: #fbbf24;
  --stage-meeting: #a78bfa;
  --stage-opportunity: #34d399;
  --stage-nurture: #818cf8;
  --stage-lost: #64748b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 13px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  background: var(--bg);
  width: 100%;
  position: relative;
}

/* ── Apollo-style Deep Slate/Navy Sidebar Navigation ───────────────── */
.sidebar {
  width: 248px;
  min-width: 248px;
  max-width: 248px;
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 18px 14px;
  z-index: 30;
  overflow-y: auto;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.26s ease;
}

.sidebar-header {
  padding: 2px 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px;
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-weight: 700;
  font-size: 14.5px;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar-brand-desc {
  font-size: 10.5px;
  color: var(--sidebar-active-line);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav-section {
  display: flex;
  flex-direction: column;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #64748b;
  padding: 16px 8px 6px;
}

.sidebar-section-title:first-child {
  padding-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tab.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

.tab.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.tab.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-left: 3px solid var(--sidebar-active-line);
  border-radius: 4px var(--radius) var(--radius) 4px;
}

.tab.nav-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--brand);
}

.nav-icon {
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  opacity: 0.85;
}

.tab.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--sidebar-active-line);
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.count,
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--sidebar-badge-bg);
  color: var(--sidebar-badge-text);
  font-size: 10.5px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tab.nav-item.active .count,
.tab.nav-item.active .nav-badge {
  background: var(--sidebar-badge-active);
  color: #ffffff;
  border-color: transparent;
}

.sidebar-spacer {
  flex: 1;
  min-height: 20px;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-status-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 28;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Main Workspace Container ──────────────────────────────────── */
.main-container {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.mobile-nav-toggle:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.mobile-nav-toggle svg {
  width: 20px;
  height: 20px;
}

.page-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  min-width: 0;
}

.breadcrumb-root {
  color: var(--ink-faint);
  font-weight: 500;
}

.breadcrumb-sep {
  color: var(--line-strong);
  font-size: 12px;
}

.breadcrumb-current {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
}

.status-text {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.action-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  box-shadow: var(--shadow-sm);
  user-select: none;
  cursor: pointer;
}

.action-btn:hover,
.btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.action-btn:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.action-btn:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink-soft);
}

.btn.ghost:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.action-btn.primary,
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  font-weight: 600;
}

.action-btn.primary:hover,
.btn.primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.action-btn.primary:active,
.btn.primary:active {
  background: var(--brand-active);
}

[data-theme="dark"] .action-btn.primary,
[data-theme="dark"] .btn.primary,
[data-theme="dark"] .action-btn.primary:hover,
[data-theme="dark"] .btn.primary:hover {
  color: #04211d;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  border-radius: var(--radius);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.ghost-btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--line-soft);
}

.ghost-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.ghost-btn:disabled,
.ghost-btn:disabled:hover {
  opacity: 0.45;
  background: transparent;
  border-color: transparent;
  color: var(--ink-faint);
  cursor: default;
}

/* How many leads the current filters leave, next to Reset. */
.filter-result-count {
  margin-right: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

main {
  flex: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.content-wrap {
  max-width: 1680px;
  margin: 0 auto;
  padding: 18px;
}

.narrow {
  max-width: 960px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.kpi-card {
  padding: 14px 18px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background 0.15s ease;
}

.kpi-card:last-child {
  border-right: 0;
}

.kpi-card:hover {
  background: var(--surface-soft);
}

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

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 3px;
}

.kpi-value small {
  font-size: 13px;
  color: var(--ink-faint);
  font-weight: 500;
}

.kpi-sub,
.kpi-meta {
  font-size: 11px;
  color: var(--ink-faint);
}

.kpi-sub strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.meter {
  display: none !important;
}

.two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel-body {
  padding: 14px;
}

.nopad {
  padding: 0;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.panel-header .eyebrow,
.results-header-bar .eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-muted);
  margin-top: 2px;
  display: block;
}

.mt-20 {
  margin-top: 20px;
}

.stackbar {
  display: flex;
  width: 100%;
  height: 24px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
  background: var(--surface-soft);
}

.stackbar>span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
}

.tier-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.tier-table th,
.tier-table td {
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  font-size: 12px;
}

.tier-table th {
  color: var(--ink-faint);
  font-family: "Archivo", sans-serif;
  letter-spacing: 0.08em;
  font-size: 10px;
  text-transform: uppercase;
}

.tier-table td:last-child,
.tier-table th:last-child {
  text-align: right;
}

.tier-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.color-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.score-box {
  margin-top: 18px;
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.histogram {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 150px;
  padding-top: 4px;
}

.hist-bar {
  display: grid;
  grid-template-rows: 16px 1fr 18px;
  align-items: end;
  justify-items: center;
  height: 100%;
}

.hist-bar .hist-count {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hist-bar i {
  display: block;
  width: 100%;
  align-self: end;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.hist-bar:hover i {
  opacity: 1;
}

.hist-bar .hist-label {
  width: 100%;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.data-bars {
  margin-top: 8px;
}

.source-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.source-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
}

.source-marker {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.source-track {
  position: relative;
  height: 9px;
  background: var(--surface-soft);
  border-radius: 0 4px 4px 0;
  overflow: hidden;
}

.source-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.source-value {
  text-align: right;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
}

.hygiene-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hygiene-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.hygiene-item:first-child {
  border-top: 0;
}

/* Verification counts that open the matching leads */
.kpi-card-link,
.hygiene-item-link {
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border-left: 0;
  border-bottom: 0;
  cursor: pointer;
  width: 100%;
}
.kpi-card-link { border-top: 0; }
.hygiene-item-link { border-right: 0; }
.kpi-card-link:hover,
.hygiene-item-link:hover { background: var(--surface-soft); }
.kpi-card-link:focus-visible,
.hygiene-item-link:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.kpi-card-link .kpi-meta,
.hygiene-item-link .hygiene-text { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

.hygiene-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hygiene-icon svg {
  width: 14px;
  height: 14px;
}

.hygiene-text {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}

.hygiene-count {
  font-size: 12px;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
  color: var(--ink);
  background: var(--surface-soft);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-top: 4px;
  box-shadow: var(--shadow-sm);
  overflow: visible !important;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.filters-actions,
.filter-selects {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.search-box {
  position: relative;
  min-width: 220px;
  flex: 1 1 280px;
  max-width: 440px;
}

.search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink-faint);
  font: 600 10.5px var(--mono);
  pointer-events: none;
}

.search-box:focus-within .search-kbd {
  display: none;
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  stroke: var(--ink-faint);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
  transition: stroke 0.15s ease;
}

.search-box:focus-within svg {
  stroke: var(--brand);
}

.search-box input,
.filters select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 6px 10px 6px 32px;
  height: 32px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.15s ease;
}

.search-box input:hover,
.filters select:hover {
  border-color: var(--line-strong);
}

.search-box input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
  background: var(--surface);
}

.filters select {
  padding: 6px 10px;
  min-width: 105px;
  width: auto;
  cursor: pointer;
}

.chip-list {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-soft);
  padding: 2px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  align-items: center;
  flex-wrap: nowrap;
}

.chip {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 500;
  transition: all 0.12s ease;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
}

.chip:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.chip.active {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.chip .chip-label {
  font-weight: 600;
}

.chip .chip-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: var(--ink-faint);
  padding: 0 4px;
  border-radius: 3px;
  background: var(--surface-soft);
}

.chip.active .chip-count {
  color: var(--brand);
  background: var(--brand-soft);
}

#clearFiltersBtn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: var(--radius);
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

#clearFiltersBtn:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-export-filtered {
  background: var(--surface) !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--line) !important;
  padding: 0 12px;
  height: 32px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-export-filtered:hover {
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
  border-color: var(--line-strong) !important;
  box-shadow: var(--shadow-sm);
}

.view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-soft);
  padding: 3px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.view-toggle:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.view-toggle.active {
  background: var(--surface) !important;
  color: var(--brand) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  font-weight: 700;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-top: 0;
  color: var(--ink);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}

.bulk-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.bulk-bar-count {
  font-weight: 700;
  color: var(--brand);
}

.bulk-bar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.bulk-bar-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}

.bulk-bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-bar select {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.bulk-bar .btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: auto;
}

.table-status {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.table-status.is-error {
  color: var(--critical);
  background: var(--critical-soft);
}

.table-status .btn {
  margin-left: 10px;
}

.lead-grid {
  width: 100%;
  /* The columns below add up to this, so the table fits a 1280px laptop window without scrolling
     sideways; wider windows stretch the columns proportionally. */
  min-width: 965px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.lead-grid:not(.compact-grid) th:nth-child(1),
.lead-grid:not(.compact-grid) td:nth-child(1) {
  width: 36px;
}

.lead-grid:not(.compact-grid) th:nth-child(2),
.lead-grid:not(.compact-grid) td:nth-child(2) {
  width: 30px;
}

.lead-grid:not(.compact-grid) th:nth-child(3),
.lead-grid:not(.compact-grid) td:nth-child(3) {
  width: 150px;
}

.lead-grid:not(.compact-grid) th:nth-child(4),
.lead-grid:not(.compact-grid) td:nth-child(4) {
  width: 140px;
}

.lead-grid:not(.compact-grid) th:nth-child(5),
.lead-grid:not(.compact-grid) td:nth-child(5) {
  width: 115px;
}

.lead-grid:not(.compact-grid) th:nth-child(6),
.lead-grid:not(.compact-grid) td:nth-child(6) {
  width: 66px;
}

.lead-grid:not(.compact-grid) th:nth-child(7),
.lead-grid:not(.compact-grid) td:nth-child(7) {
  width: 108px;
}

.lead-grid:not(.compact-grid) th:nth-child(8),
.lead-grid:not(.compact-grid) td:nth-child(8) {
  width: 84px;
}

.lead-grid:not(.compact-grid) th:nth-child(9),
.lead-grid:not(.compact-grid) td:nth-child(9) {
  width: 104px;
}

.lead-grid:not(.compact-grid) th:nth-child(10),
.lead-grid:not(.compact-grid) td:nth-child(10) {
  width: 132px;
}

.lead-grid:not(.compact-grid) .lead-email,
.lead-grid:not(.compact-grid) .company-block,
.lead-grid:not(.compact-grid) td:nth-child(4) small,
.lead-grid:not(.compact-grid) .source-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.lead-grid:not(.compact-grid) .owner-select,
.lead-grid:not(.compact-grid) .stage-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.lead-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: var(--ink-faint);
  text-align: left;
  font-size: 11px;
  font-family: inherit;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.lead-grid tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  overflow: hidden;
}

.lead-grid tbody tr:hover td {
  background: rgba(0, 117, 104, 0.025);
}

.lead-grid tbody tr.selected td {
  background: rgba(0, 117, 104, 0.07);
}

.lead-grid tbody tr:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.kanban-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.lead-grid tbody tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

/* Contact Cell with Initials Avatar */
.lead-cell-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 1px solid transparent;
  flex-shrink: 0;
  user-select: none;
}

.lead-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

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

.lead-name.muted {
  color: var(--ink-faint);
  font-style: italic;
}

.lead-email {
  font-size: 11.5px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

/* Company Block & Micro Badges */
.company-block {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.lead-title {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.3;
}

.co-badge.badge-verified {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-line);
}

.co-badge.badge-domain {
  background: #eff6ff;
  color: var(--info);
  border: 1px solid #bfdbfe;
}

.co-badge.badge-emp {
  background: var(--surface-soft);
  color: var(--ink-faint);
  border: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0;
}

/* Identity next to a lead's name: a shield once the person is confirmed, a globe when only the domain is. */
.identity-mark {
  display: inline-flex;
  vertical-align: -2px;
  margin-left: 3px;
}

.identity-mark svg {
  width: 13px;
  height: 13px;
}

.identity-mark.identity-person {
  color: color-mix(in srgb, var(--brand) 82%, var(--ink));
}

[data-theme="dark"] .identity-mark.identity-person {
  color: var(--sidebar-active-line);
}

.identity-mark.identity-domain {
  color: var(--ink-faint);
}

/* Role fit under the tier: words, not a second badge; the reason is in the tooltip. */
.role-fit {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-fit-none {
  color: var(--ink-faint);
}

/* Score: a plain number in its tier's colour. The tier badge next to it is the one boxed label. */
.score-pill {
  display: inline-flex;
  align-items: baseline;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.score-pill.score-tier-a {
  color: var(--tier-a);
}

.score-pill.score-tier-b {
  color: var(--tier-b);
}

.score-pill.score-tier-c {
  color: var(--tier-c);
}

.score-pill.score-tier-d {
  color: var(--ink-faint);
}

/* Refined Tier Badges */
.tier-badge,
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tier-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.tier-badge-a,
.tier-pill-a {
  background: rgba(194, 65, 12, 0.08);
  color: var(--tier-a);
  border: 1px solid rgba(194, 65, 12, 0.22);
}

.tier-badge-a .tier-dot,
.tier-pill-a .tier-dot {
  background: var(--tier-a);
}

.tier-badge-b,
.tier-pill-b {
  background: rgba(180, 83, 9, 0.08);
  color: var(--tier-b);
  border: 1px solid rgba(180, 83, 9, 0.22);
}

.tier-badge-b .tier-dot,
.tier-pill-b .tier-dot {
  background: var(--tier-b);
}

.tier-badge-c,
.tier-pill-c {
  background: color-mix(in srgb, var(--info) 8%, transparent);
  color: var(--tier-c);
  border: 1px solid color-mix(in srgb, var(--info) 20%, transparent);
}

.tier-badge-c .tier-dot,
.tier-pill-c .tier-dot {
  background: var(--tier-c);
}

.tier-badge-d,
.tier-pill-d {
  background: var(--surface-soft);
  color: var(--ink-faint);
  border: 1px solid var(--line);
}

.tier-badge-d .tier-dot,
.tier-pill-d .tier-dot {
  background: var(--ink-faint);
}

/* Refined Hygiene Badges */
.hygiene-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

/* In list rows the word and its dot carry the status; boxes stay for the drawer and summaries. The
   colours lean toward the text colour so small text stays readable (4.5:1) in both themes. */
.lead-grid .hygiene-badge {
  padding: 0;
  background: transparent;
  border: 0;
  font-weight: 600;
}

.lead-grid .hygiene-clean {
  color: color-mix(in srgb, var(--ok) 78%, var(--ink));
}

.lead-grid .hygiene-warn {
  color: color-mix(in srgb, var(--warn) 76%, var(--ink));
}

.lead-grid .hygiene-fail {
  color: color-mix(in srgb, var(--critical) 85%, var(--ink));
}

.hygiene-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.hygiene-clean,
.status-clean {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-line);
}

.hygiene-clean .hygiene-dot,
.status-clean::before {
  background: var(--ok);
}

.hygiene-warn,
.status-warn {
  background: var(--apollo-gold-soft);
  color: var(--warn);
  border: 1px solid var(--apollo-gold-line);
}

.hygiene-warn .hygiene-dot {
  background: var(--warn);
}

.hygiene-fail,
.status-fail {
  background: var(--critical-soft);
  color: var(--critical);
  border: 1px solid var(--critical-line);
}

.hygiene-fail .hygiene-dot {
  background: var(--critical);
}

.owner-select,
.stage-select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 4px;
  padding: 4px 6px;
  color: var(--ink);
  font-size: 11.5px;
  transition: all 0.15s ease;
}

.owner-select:hover,
.stage-select:hover {
  border-color: var(--brand);
  background: var(--surface-soft);
}

.score-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

.score-cell strong {
  width: 26px;
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--ink);
}

.score-meter {
  width: 48px;
  height: 6px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
}

.score-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #6a8cf8);
}

.tier-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}

.status-badge {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-clean {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.status-warn {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.status-suspect {
  background: #ffedd5;
  border-color: #fdba74;
  color: #c2410c;
}

.status-fail {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

[data-theme="dark"] .status-clean {
  background: rgba(28, 168, 100, 0.12);
  border-color: rgba(28, 168, 100, 0.4);
  color: var(--ok);
}

[data-theme="dark"] .status-warn {
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.5);
  color: #f5a623;
}

[data-theme="dark"] .status-suspect {
  background: rgba(235, 125, 56, 0.12);
  border-color: rgba(235, 125, 56, 0.6);
  color: #eb7d38;
}

[data-theme="dark"] .status-fail {
  background: rgba(217, 73, 95, 0.12);
  border-color: rgba(217, 73, 95, 0.4);
  color: var(--critical);
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  z-index: 70;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.close-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.close-btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(11, 12, 17, 0.45);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.scrim.show {
  opacity: 1;
  pointer-events: auto;
}

#drawerContent {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.drawer-header {
  padding: 16px 20px 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.drawer-header .who h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

.drawer-header .who .role {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.drawer-header .who .em {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 4px;
  word-break: break-all;
}

.drawer-header .dscore {
  margin-left: auto;
  text-align: right;
  flex: none;
}

.drawer-header .dscore .n {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.drawer-header .dscore .l {
  font-size: 10px;
  color: var(--ink-faint);
  font-family: "Archivo", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 3px;
}

.dbody {
  overflow-y: auto;
  padding: 0 16px 28px;
  flex: 1;
}

.sect {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.sect:last-child {
  border-bottom: none;
}

.sect>.eyebrow {
  margin-bottom: 9px;
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-family: "Archivo", sans-serif;
}

.brk {
  display: grid;
  grid-template-columns: 118px 1fr 52px;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}

.brk .lab {
  color: var(--ink-soft);
}

.brk .track {
  height: 6px;
  background: var(--surface-soft);
  border-radius: 3px;
  overflow: hidden;
}

.brk .track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
}

.brk .pts {
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.brk .pts b {
  color: var(--ink);
  font-weight: 600;
}

.why {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--ink-faint);
  margin: -2px 0 4px 0;
  padding-left: 0;
}

.flag {
  display: flex;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
}

.flag:first-of-type {
  border-top: none;
}

.flag .ic {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex: none;
  font-family: "IBM Plex Mono", monospace;
  margin-top: 2px;
}

.flag .tx b {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
}

.flag .tx span {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.flag .tx .hygiene-check-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.hygiene-check-codes code {
  color: var(--ink-faint);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
  font: 10px "IBM Plex Mono", monospace;
}

.flag .code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--ink-faint);
  margin-left: auto;
  flex: none;
  background: var(--surface-soft);
  border-radius: 3px;
  padding: 1px 5px;
  height: fit-content;
}

.kv {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 4px 10px;
  font-size: 12px;
  margin: 0;
}

.kv dt {
  color: var(--ink-faint);
}

.kv dd {
  margin: 0;
  color: var(--ink);
}

.play {
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 11px 12px;
}

.play h4 {
  font-size: 12.5px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}

.play p {
  margin: 0 0 7px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.play ul {
  margin: 0;
  padding-left: 16px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.play ul li {
  margin-bottom: 2px;
}

.draft-type-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.draft-type-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.14s ease;
  font-family: inherit;
}

.draft-type-btn:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

/* ── Account Intelligence & Verification Dossier ── */
.ai-intel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.ai-source-note {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--ink-faint);
}

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

.ai-intel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ai-tag-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ai-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-pill-vertical {
  background: #eff6ff;
  color: var(--info);
  border: 1px solid #bfdbfe;
}

.ai-pill-product {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
  font-weight: 600;
}

.ai-pill-intent-high {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-line);
}

.ai-pill-intent-medium {
  background: var(--apollo-gold-soft);
  color: var(--warn);
  border: 1px solid var(--apollo-gold-line);
}

.ai-pill-intent-low {
  background: var(--surface-soft);
  color: var(--ink-faint);
  border: 1px solid var(--line);
}

.ai-dossier-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 10px;
}

.ai-hook-box {
  background: var(--surface-soft);
  border-left: 3px solid var(--line-strong);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink);
  margin-bottom: 12px;
}

.ai-talking-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.ai-outreach-preview {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
}

.ai-outreach-subject {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.ai-outreach-body {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
}

.ai-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ── Person & Decision Maker Intelligence ── */
.ai-detective-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  margin-top: 10px;
}

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

.ai-detective-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Score feedback (drawer) */
.score-feedback {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.score-feedback-q { font-size: 12px; font-weight: 600; color: var(--ink); }
.score-feedback-options { display: flex; gap: 6px; flex-wrap: wrap; }
.score-feedback-meta { flex-basis: 100%; font-size: 11px; color: var(--ink-faint); }

/* Web person finder */
.pf-empty {
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pf-empty-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.pf-empty-text {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
  max-width: 52ch;
}

.pf-level {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.pf-level.pf-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.pf-level.pf-warn { color: var(--warn); border-color: currentColor; }
.pf-level.pf-critical { color: var(--critical); background: var(--critical-soft); border-color: var(--critical-line); }

.pf-kv { margin-top: 6px; font-size: 12px; }
.pf-kv a, .pf-evidence a, .pf-links a { color: var(--brand); text-decoration: none; font-weight: 600; }
.pf-kv a:hover, .pf-evidence a:hover, .pf-links a:hover { text-decoration: underline; }

.pf-note { font-size: 11px; color: var(--ink-faint); font-weight: 400; }

.pf-alert {
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--critical);
  background: var(--critical-soft);
  border: 1px solid var(--critical-line);
  border-radius: 6px;
}

.pf-summary { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink); }
.pf-detail { margin: 4px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--ink-soft); }

.pf-subhead {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.pf-evidence { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 12px; }
.pf-evidence a { overflow-wrap: anywhere; }
.pf-quote { margin-top: 2px; font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }

.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pf-links { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-faint); }
.pf-footer { margin-top: 10px; font-size: 11px; color: var(--ink-faint); }

.ai-dm-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

@media (min-width: 600px) {
  .ai-dm-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ai-dm-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.ai-dm-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.ai-dm-why {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.4;
}

.ai-dm-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  margin-top: 4px;
}

.ai-dm-link:hover {
  text-decoration: underline;
}



.draft-type-btn.active {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.draft-variant-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 9px;
}

.draft-variant-btn {
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
}

.draft-variant-btn:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}

.draft-variant-btn.ai-variant-tab {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.3);
  color: #7c3aed;
  font-weight: 600;
}

.draft-variant-btn.ai-variant-tab:hover {
  background: rgba(124, 58, 237, 0.12);
}

.draft-variant-btn.ai-variant-tab.active {
  background: #7c3aed;
  border-color: #6d28d9;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35);
}

.draft-variant-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  font-weight: 600;
}

.draftbox {
  margin-top: 6px;
}

.draftbox .subj {
  width: 100%;
  margin-bottom: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.draftbox textarea {
  width: 100%;
  min-height: 160px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  color: var(--ink);
  font-family: inherit;
}

.draftmeta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 7px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ink-faint);
}

.fieldrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-family: "Archivo", sans-serif;
  margin-bottom: 4px;
}

.field select,
.field input,
.field textarea {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 12.5px;
  color: var(--ink);
  font-family: inherit;
}

.field select:focus,
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.field textarea {
  min-height: 68px;
  resize: vertical;
}

.tierpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

.tierpill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-notice.has-action {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.first-touch-panel {
  margin: 16px 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon .ui-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.user-avatar .ui-icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.stat-icon .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.source-label .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  margin-right: 2px;
}

.activity-icon .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.theme-toggle-icon .ui-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.first-touch-medians {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
}

.first-touch-tier {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.first-touch-tier strong {
  margin-left: auto;
  font-size: 18px;
}

.first-touch-tier small {
  color: var(--ink-faint);
}

.owner-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

/* A quiet text action under the owner, not a second full-size control in every row. Two classes so
   .btn.sm can't win (fixed height, no wrapping): a long owner name ran past the table's edge. */
.btn.accept-owner-suggestion {
  height: auto;
  min-height: 0;
  max-width: 100%;
  padding: 1px 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  /* Toward the text colour: darker on white, lighter on the dark theme (plain brand teal was 3.2:1 there). */
  color: color-mix(in srgb, var(--brand) 82%, var(--ink));
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
  justify-content: flex-start;
  overflow-wrap: anywhere;
}

[data-theme="dark"] .btn.accept-owner-suggestion {
  color: var(--sidebar-active-line);
}

.btn.accept-owner-suggestion:hover {
  background: transparent;
  color: color-mix(in srgb, var(--brand) 65%, var(--ink));
  text-decoration: underline;
}

.signal-gaps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  font-size: 11px;
  color: var(--ink-soft);
}

.signal-gap-chip {
  padding: 4px 7px;
  border: 1px solid var(--warn);
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
}

.all-signals {
  margin-top: 8px;
}

.all-signals summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.all-signal-list {
  margin-top: 8px;
}

.signal-row-gap {
  padding: 5px 7px;
  border-left: 2px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 6%, var(--surface));
}

@media (max-width: 620px) {
  .first-touch-medians {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.toast-undo {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}

.toast-undo:disabled {
  opacity: .6;
  cursor: wait;
}

.disqualify-dialog-form {
  min-width: min(360px, 80vw);
  padding: 20px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.disqualify-dialog-form h3 {
  margin: 0 0 14px;
}

.disqualify-dialog-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.disqualify-dialog-form select {
  width: 100%;
  min-height: 40px;
  padding: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.disqualify-dialog-form .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.drop,
.dropzone {
  margin-top: 18px;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 34px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop.hot,
.dropzone.hot {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.drop h3,
.dropzone h3 {
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--ink);
}

.drop p,
.dropzone p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 12px;
}

.maptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.maptable th {
  text-align: left;
  font-family: "Archivo", sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  padding: 0 8px 7px 0;
}

.maptable td {
  padding: 6px 8px 6px 0;
  border-top: 1px solid var(--line-soft);
  vertical-align: middle;
}

.maptable select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  font-size: 12px;
  color: var(--ink);
}

.maptable select:focus {
  outline: none;
  border-color: var(--brand);
}

.maptable .samp {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--ink-faint);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 9px;
  line-height: 1.5;
}

.note.note-warn {
  color: var(--ink-soft);
  border-left: 3px solid var(--warn);
  padding-left: 8px;
}

.modelgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
  align-items: start;
}

/* Weights stay in view while the long dictionary column scrolls. */
.model-col-left {
  position: sticky;
  top: 72px;
}

@media (max-width: 980px) {

  .two-col,
  .modelgrid,
  .model-grid {
    grid-template-columns: 1fr;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-col-left {
    position: static;
  }
}

.wrow {
  display: grid;
  grid-template-columns: 1fr 118px 54px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.wrow:first-of-type {
  border-top: none;
}

.wrow .n {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.wrow .n small {
  display: block;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}

.wrow input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  cursor: pointer;
}

.wrow input[type="number"] {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-align: right;
}

.total-bar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}

.total-number {
  font-family: "Archivo", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.total-note {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.panel-footer-note {
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-faint);
}

.listedit {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dict-group {
  display: flex;
  flex-direction: column;
}

.dict-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
  font-family: "Archivo", sans-serif;
  margin-bottom: 6px;
}

.dict-sub {
  color: var(--ink-faint);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 10px;
}

.dict-chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 5px;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scrollbar-width: thin;
}

.dict-chips {
  display: contents;
}

.dict-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.dict-chip:hover {
  border-color: var(--line-strong);
}

.dict-chip button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s;
}

.dict-chip button:hover {
  color: var(--critical);
}

.dict-chip-input {
  flex: 1 1 140px;
  min-width: 120px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  padding: 2px 4px;
}

.dict-match-count {
  display: block;
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 11px;
}

.listedit textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.listedit textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.model-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.model-actions .model-note {
  margin-left: auto;
}

.model-note {
  font-size: 12px;
  color: var(--ink-soft);
}

.model-note.saving {
  color: var(--brand);
}

.model-note.success {
  color: var(--ok);
}

.model-note.error {
  color: var(--critical);
}

.docs {
  max-width: 860px;
  margin: 0 auto;
}

.docs h2 {
  font-size: 18px;
  margin: 20px 0 8px;
  color: var(--ink);
}

.docs h3 {
  font-size: 13px;
  margin: 16px 0 6px;
  color: var(--ink);
}

.docs p,
.docs li {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.docs code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  background: var(--surface-soft);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink);
}

.docs ol,
.docs ul {
  padding-left: 20px;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-info strong {
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
}

.pagination-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-faint);
  margin-left: 4px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: var(--surface-strong);
  border-color: var(--brand-line);
  color: var(--ink);
}

.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--ink-faint);
  user-select: none;
}

/* Source Origin Tags */
.source-badge-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.source-tag.tag-web {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.source-tag.tag-csv {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

[data-theme="dark"] .source-tag.tag-web {
  background: rgba(28, 168, 100, 0.14);
  color: #2bd685;
  border: 1px solid rgba(28, 168, 100, 0.35);
}

[data-theme="dark"] .source-tag.tag-csv {
  background: rgba(138, 92, 246, 0.16);
  color: #c4b5fd;
  border: 1px solid rgba(138, 92, 246, 0.4);
}

.source-tag .source-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.source-sub {
  font-size: 11px;
  color: var(--ink-faint);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}



/* ── Live stat bar ─────────────────────────────────────────────────────────── */
.live-stat-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 2px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11.5px;
  font-family: inherit;
  color: var(--ink-soft);
  transition: all 0.14s ease;
  user-select: none;
}

button.stat-pill {
  cursor: pointer;
}

.stat-pill.is-static {
  background: transparent;
  border-color: transparent;
}

button.stat-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
}

button.stat-pill:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

/* An applied quick filter: brand outline and tint, like the selected tier button. */
button.stat-pill.is-active,
button.stat-pill.is-active:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  color: var(--ink);
}

button.stat-pill.is-active .stat-label {
  color: var(--ink);
}

.stat-pill .stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-pill .stat-icon svg {
  width: 13px;
  height: 13px;
  color: var(--ink-faint);
}

.stat-pill .stat-value {
  font-weight: 650;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-pill .stat-label {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 500;
}

.stat-pill.stat-pill-overdue.has-value {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.05);
}

.stat-pill.stat-pill-overdue.has-value .stat-value {
  color: var(--critical);
}

.stat-pill.stat-hot.has-value {
  border-color: rgba(194, 65, 12, 0.3);
  background: rgba(194, 65, 12, 0.05);
}

.stat-pill.stat-hot.has-value .stat-value {
  color: var(--tier-a);
}

.stat-pill.stat-warm.has-value {
  border-color: rgba(180, 83, 9, 0.3);
  background: rgba(180, 83, 9, 0.05);
}

.stat-pill.stat-warm.has-value .stat-value {
  color: var(--tier-b);
}

/* ── Activity timeline & notes in drawer ───────────────────────────────────── */
.activity-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  font-size: 14px;
  margin-top: 1px;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-text {
  color: var(--ink);
  line-height: 1.5;
  word-break: break-word;
}

.activity-meta {
  color: var(--ink-faint);
  font-size: 11px;
  margin-top: 2px;
}

.note-item {
  background: rgba(47, 122, 224, 0.05);
  border-radius: var(--radius);
  padding: 7px 9px;
  border: 1px solid rgba(47, 122, 224, 0.12) !important;
  margin-bottom: 4px;
}

/* ── Critical / Disqualify button ──────────────────────────────────────────── */
/* ── Kanban Board ─────────────────────────────────────────── */
.kanban-wrap {
  display: grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding: 16px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 520px;
}

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: 750px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.kanban-col-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-soft);
  border-radius: 8px 8px 0 0;
}

.kanban-col-title {
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kanban-col-badge {
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
}

.kanban-card-list {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.kanban-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}

.kanban-card-sub {
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line-soft);
}

.kanban-advance-btn {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.kanban-advance-btn:hover {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

/* ── Authentication & User Pill (LD-15) ────────────────────────── */
/* ── Authentication & User Pill (LD-15) ────────────────────────── */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 11.5px;
  color: var(--ink);
}

.user-pill .user-avatar {
  font-size: 12px;
}

.user-pill .user-name {
  font-weight: 600;
  color: var(--ink);
}

.sidebar .user-pill,
.sidebar-user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
}

.sidebar .user-pill:hover,
.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.sidebar-user .user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user .user-name {
  color: #ffffff !important;
  font-weight: 600;
  font-size: 12px;
}

.sidebar-user .user-role {
  font-size: 10.5px;
  color: #94a3b8;
}

.sidebar-user .btn-logout {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 6px;
  border-radius: 4px;
}

.sidebar-user .btn-logout:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--critical);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.15s ease;
  margin-left: 2px;
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.1);
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px var(--line);
  animation: authCardPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardPop {
  0% {
    transform: scale(0.96) translateY(8px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-badge {
  display: inline-block;
  text-transform: uppercase;
  padding: 3px 9px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand);
  margin-bottom: 8px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-error-banner {
  padding: 9px 12px;
  background: var(--critical-soft);
  border: 1px solid var(--critical-line);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--critical);
  font-weight: 500;
}

.auth-error-banner.hidden {
  display: none;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.auth-field input {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.btn-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  height: 40px;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-auth-submit:hover {
  background: var(--brand-hover);
}

.btn-auth-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
}

[data-theme="dark"] .btn-auth-submit {
  color: #04211d;
}

.btn-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* ── Sidebar footer: theme toggle + Apollo coverage ────────────────── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-toggle-btn:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--sidebar-active-line);
  outline-offset: 2px;
}

.theme-toggle-icon {
  display: inline-flex;
  line-height: 1;
}

.sync-health-badge {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--sidebar-text);
  font-weight: 500;
}

.sync-health-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-meter {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sync-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sidebar-active-line);
  transition: width 0.4s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn-export-all {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: var(--surface) !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--line) !important;
  padding: 0 12px;
  height: 32px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  user-select: none;
}

.btn-export-all:hover {
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
  border-color: var(--line-strong) !important;
  box-shadow: var(--shadow-sm);
}

.btn-export-all:active {
  background: var(--surface-strong) !important;
}

.lead-name.muted {
  color: var(--ink-faint);
  font-weight: 500;
}

.no-name-tag {
  margin-left: 5px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-faint);
}

.sla-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  margin: 2px 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.sla-ok {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.sla-warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}

.sla-critical {
  color: var(--critical);
  background: color-mix(in srgb, var(--critical) 13%, transparent);
}

.tier-empty-hint {
  align-self: center;
  color: var(--ink-faint);
  font-size: 11px;
  padding: 0 4px;
}

.import-batch-label {
  display: block;
  color: var(--ink-faint);
  font-size: 11px;
  margin-top: 2px;
}

.drawer-actions {
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.drawer-actions>.eyebrow {
  display: none;
}

.drawer-actions .fieldrow {
  gap: 8px;
}

.drawer-actions .field {
  margin: 0;
}

.drawer-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

/* ── Custom Interactive Apollo Dropdowns ──────────────────────────── */
.apollo-dropdown {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.apollo-dropdown.open {
  z-index: 125;
}

.filters .apollo-dropdown {
  flex: 0 1 auto;
}

.apollo-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  min-width: 110px;
  max-width: 230px;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.apollo-dropdown-trigger:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.apollo-dropdown.open .apollo-dropdown-trigger,
.apollo-dropdown-trigger:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
  background: var(--surface);
}

.apollo-dropdown-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.apollo-dropdown-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--ink-faint);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apollo-dropdown.open .apollo-dropdown-chevron {
  transform: rotate(180deg);
  color: var(--brand);
}

.apollo-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px -4px rgba(15, 23, 42, 0.18), 0 6px 14px -2px rgba(15, 23, 42, 0.08);
  padding: 5px;
  z-index: 999999;
  max-height: 290px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.14s cubic-bezier(0.16, 1, 0.3, 1), transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

/* A filter dropdown that is narrowing the list: outlined like an active quick filter. */
.apollo-dropdown.is-filtered .apollo-dropdown-trigger {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  color: var(--ink);
}

/* A closed menu waits inside its dropdown; out of the layout, so a wide menu near the window's or the
   table's right edge can't make the page or the table scroll sideways. Opening moves it to <body>. */
.apollo-dropdown > .apollo-dropdown-menu:not(.open) {
  display: none;
}

.apollo-dropdown-menu.open,
.apollo-dropdown.open .apollo-dropdown-menu {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  display: block !important;
  transform: translateY(0) scale(1) !important;
}

/* Compact In-Table Apollo Dropdowns */
.apollo-dropdown.compact {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  vertical-align: middle;
}

.apollo-dropdown.compact .apollo-dropdown-trigger {
  width: auto;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 3px 6px;
  height: 26px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  box-shadow: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-soft);
  transition: all 0.12s ease;
}

tr:hover .apollo-dropdown.compact .apollo-dropdown-trigger {
  border-color: var(--line);
  background: var(--surface);
}

.apollo-dropdown.compact .apollo-dropdown-trigger:hover,
.apollo-dropdown.compact.open .apollo-dropdown-trigger {
  border-color: var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow-sm) !important;
}

.apollo-dropdown.compact .apollo-dropdown-chevron {
  width: 11px;
  height: 11px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

tr:hover .apollo-dropdown.compact .apollo-dropdown-chevron,
tr:focus-within .apollo-dropdown.compact .apollo-dropdown-chevron,
.apollo-dropdown.compact.open .apollo-dropdown-chevron {
  opacity: 1;
}

@media (hover: none) {
  .apollo-dropdown.compact .apollo-dropdown-chevron {
    opacity: 1;
  }
}

.apollo-dropdown.compact .apollo-dropdown-label {
  font-size: 11.5px;
}

/* Stage indicator: a token-coloured dot before the label; text stays neutral in both themes. */
.apollo-dropdown[data-stage] .apollo-dropdown-label::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--stage-color, var(--ink-faint));
}

.apollo-dropdown[data-stage] .apollo-dropdown-trigger {
  color: var(--ink);
  font-weight: 600;
}

.apollo-dropdown[data-stage="new"] { --stage-color: var(--stage-new); }
.apollo-dropdown[data-stage="working"] { --stage-color: var(--stage-working); }
.apollo-dropdown[data-stage="meeting booked"] { --stage-color: var(--stage-meeting); }
.apollo-dropdown[data-stage="opportunity"] { --stage-color: var(--stage-opportunity); }
.apollo-dropdown[data-stage="nurture"] { --stage-color: var(--stage-nurture); }
.apollo-dropdown[data-stage="closed lost"] { --stage-color: var(--stage-lost); }

.apollo-dropdown[data-stage="closed lost"] .apollo-dropdown-trigger {
  color: var(--ink-faint);
  font-weight: 500;
}

.apollo-dropdown-item {
  padding: 7px 10px;
  font-size: 12.5px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  transition: all 0.12s ease;
  user-select: none;
}

.apollo-dropdown-item:hover,
.apollo-dropdown-item.active {
  background: var(--surface-soft);
  color: var(--ink);
}

.apollo-dropdown-item.active {
  box-shadow: inset 2px 0 0 var(--brand);
}

.apollo-dropdown-item.selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.apollo-item-check {
  width: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.apollo-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apollo-dropdown>select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* ── Premium Apollo Restore / Undisqualify Lead Button ────────────── */
.btn-restore-lead,
.btn-undisqualify {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  background: var(--surface) !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  padding: 4px 10px !important;
  white-space: nowrap !important;
  box-shadow: var(--shadow-sm) !important;
  cursor: pointer !important;
  transition: all 0.14s ease !important;
}

.btn-restore-lead:hover,
.btn-undisqualify:hover {
  background: var(--surface-soft) !important;
  border-color: var(--line-strong) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow-sm) !important;
}

.btn-restore-lead:active,
.btn-undisqualify:active {
  background: var(--surface-strong) !important;
}

.btn-restore-lead:focus-visible,
.btn-undisqualify:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px var(--brand-ring) !important;
}

.btn-restore-lead svg,
.btn-undisqualify svg {
  width: 12px !important;
  height: 12px !important;
  color: var(--ink-faint) !important;
}

.btn-restore-lead:hover svg,
.btn-undisqualify:hover svg {
  color: var(--ok) !important;
}

#d-undisqualify {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: var(--surface) !important;
  color: var(--ok) !important;
  border: 1px solid var(--ok-line) !important;
  border-radius: var(--radius) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 5px 12px !important;
  cursor: pointer !important;
  transition: all 0.14s ease !important;
}

#d-undisqualify:hover {
  background: var(--ok-soft) !important;
  border-color: var(--ok) !important;
}

.btn.critical,
#d-disqualify {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--critical-soft);
  color: var(--critical);
  border: 1px solid var(--critical-line);
  font-weight: 600;
}

.btn.critical:hover,
#d-disqualify:hover {
  background: var(--critical);
  color: #ffffff;
  border-color: var(--critical);
}

[data-theme="dark"] .btn.critical:hover,
[data-theme="dark"] #d-disqualify:hover {
  color: var(--bg);
}

.tier-pill-a,
.tierpill-a {
  color: var(--tier-a) !important;
  border-color: color-mix(in srgb, var(--tier-a) 45%, transparent) !important;
  background: color-mix(in srgb, var(--tier-a) 12%, transparent) !important;
}

.tier-pill-b,
.tierpill-b {
  color: var(--tier-b) !important;
  border-color: color-mix(in srgb, var(--tier-b) 45%, transparent) !important;
  background: color-mix(in srgb, var(--tier-b) 12%, transparent) !important;
}

.tier-pill-c,
.tierpill-c {
  color: var(--tier-c) !important;
  border-color: color-mix(in srgb, var(--tier-c) 45%, transparent) !important;
  background: color-mix(in srgb, var(--tier-c) 12%, transparent) !important;
}

.tier-pill-d,
.tierpill-d {
  color: var(--tier-d) !important;
  border-color: color-mix(in srgb, var(--tier-d) 45%, transparent) !important;
  background: color-mix(in srgb, var(--tier-d) 12%, transparent) !important;
}

.tier-pill-x,
.tierpill-x {
  color: var(--tier-x) !important;
  border-color: color-mix(in srgb, var(--tier-x) 45%, transparent) !important;
  background: color-mix(in srgb, var(--tier-x) 12%, transparent) !important;
}

.chip-tier-a {
  color: var(--tier-a);
  border-color: color-mix(in srgb, var(--tier-a) 42%, transparent);
}

.chip-tier-b {
  color: var(--tier-b);
  border-color: color-mix(in srgb, var(--tier-b) 42%, transparent);
}

.chip-tier-c {
  color: var(--tier-c);
  border-color: color-mix(in srgb, var(--tier-c) 42%, transparent);
}

.chip-tier-d {
  color: var(--tier-d);
  border-color: color-mix(in srgb, var(--tier-d) 42%, transparent);
}

.chip-tier-a.active {
  background: color-mix(in srgb, var(--tier-a) 18%, var(--surface));
}

.chip-tier-b.active {
  background: color-mix(in srgb, var(--tier-b) 18%, var(--surface));
}

.chip-tier-c.active {
  background: color-mix(in srgb, var(--tier-c) 18%, var(--surface));
}

.chip-tier-d.active {
  background: color-mix(in srgb, var(--tier-d) 18%, var(--surface));
}

.sortable-header {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}

.sortable-header:hover,
.sortable-header.is-sorted {
  color: var(--ink);
}

.sortable-header .sort-indicator {
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sortable-header:hover .sort-indicator,
.sortable-header.is-sorted .sort-indicator {
  opacity: 1;
}

.lead-age {
  white-space: nowrap;
  color: var(--ink-faint);
  font-size: 11px;
}

.route-hint {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
  margin-top: 3px;
}

.rescale-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 0 2px;
  color: var(--ink);
  font-size: 12px;
}

.rescale-option small {
  display: block;
  color: var(--ink-faint);
  font-size: 11px;
  margin-left: auto;
}

.no-data-label {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 500;
}

.excluded-signals {
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 11px;
}

/* ── Drawer Top Control Bar ────────────────────────────────────────── */
.drawer-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  gap: 12px;
}

.drawer-top-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.drawer-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.drawer-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.drawer-record-nav {
  position: static !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.drawer-record-nav button,
.drawer-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.drawer-record-nav button:hover,
.drawer-nav-btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.drawer-top-divider {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 4px;
}

/* Executive Drawer Hero & Quick Bar */
.drawer-hero {
  padding: 16px 20px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.drawer-hero-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.drawer-avatar,
.drawer-avatar-lg {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  flex-shrink: 0;
  user-select: none;
}

/* Apollo Verification Status Pills */
.apollo-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.apollo-status-pill svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.apollo-status-pill.apollo-status-verified {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.apollo-status-pill.apollo-status-domain {
  background: color-mix(in srgb, var(--info) 8%, transparent);
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 20%, transparent);
}

.apollo-status-pill.apollo-status-unmatched {
  background: var(--surface-soft);
  color: var(--ink-faint);
  border: 1px solid var(--line);
}

.apollo-status-pill.apollo-status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Normalization indicator tag */
.apollo-norm-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

.apollo-norm-chip svg {
  width: 10px;
  height: 10px;
}

/* Drawer Hero Refinements */
.drawer-hero-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.drawer-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-name-row h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}

.drawer-hero-role {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.drawer-title-txt {
  color: var(--ink-soft);
}

.drawer-company-txt {
  font-weight: 600;
  color: var(--ink);
}

.drawer-emp-badge {
  background: var(--surface-soft);
  color: var(--ink-faint);
  border: 1px solid var(--line);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.drawer-hero-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 3px;
}

.drawer-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.drawer-contact-item svg {
  width: 11px;
  height: 11px;
  color: var(--ink-faint);
}

/* ── Apollo Verification Section Component ────────────────────────── */
.apollo-intel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.apollo-intel-card.card-verified {
  border-color: rgba(16, 185, 129, 0.3);
}

.apollo-intel-card.card-domain {
  border-color: color-mix(in srgb, var(--info) 25%, transparent);
}

.apollo-intel-card.card-unmatched {
  border-color: var(--line);
}

.apollo-card-header {
  padding: 12px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.apollo-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.apollo-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.apollo-card-icon svg {
  width: 14px;
  height: 14px;
}

.apollo-card-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.apollo-card-icon.domain {
  background: color-mix(in srgb, var(--info) 12%, transparent);
  color: var(--info);
}

.apollo-card-icon.unmatched {
  background: var(--surface-sunken);
  color: var(--ink-faint);
  border: 1px solid var(--line);
}

.apollo-card-icon.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.apollo-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.apollo-card-sub {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 1px;
}

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

.apollo-header-btn {
  height: 26px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.apollo-header-btn:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--ink);
}

.apollo-header-btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.apollo-header-btn.primary:hover {
  background: var(--brand-hover);
}

.apollo-status-inline {
  font-size: 11px;
  color: var(--ink-faint);
}

/* Attributes Grid */
.apollo-attributes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
}

.apollo-attr-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.apollo-attr-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.apollo-attr-value {
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-word;
}

.apollo-attr-value.bold {
  font-weight: 600;
}

.apollo-attr-value.font-mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.apollo-attr-value.text-muted {
  color: var(--ink-faint);
}

/* Form Normalization Audit Box */
.apollo-audit-box {
  margin: 0 14px 14px;
  padding: 10px 12px;
  background: var(--surface-sunken);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.apollo-audit-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.apollo-audit-header svg {
  width: 12px;
  height: 12px;
  color: var(--brand);
}

.apollo-audit-sub {
  font-size: 10.5px;
  color: var(--ink-faint);
  font-weight: normal;
  margin-left: 4px;
}

.apollo-audit-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apollo-audit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  flex-wrap: wrap;
  padding: 5px 8px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
}

.audit-field {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-faint);
  width: 72px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.audit-submitted {
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.audit-submitted del {
  text-decoration: line-through;
  opacity: 0.8;
}

.audit-arrow {
  color: var(--ink-faint);
  font-size: 11px;
}

.audit-verified {
  color: var(--ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.audit-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
}

.audit-tag.form {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-faint);
}

.audit-tag.verified {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

/* Research Helpers and Fallbacks */
.apollo-research-helpers {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.apollo-helper-label {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 500;
}

.apollo-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
  text-decoration: none;
  transition: all 0.15s ease;
}

.apollo-pill-link:hover {
  background: var(--surface-soft);
  border-color: var(--brand);
}

.apollo-pill-link svg {
  width: 11px;
  height: 11px;
}

/* Unmatched diagnostic layout */
.apollo-unmatched-body {
  padding: 12px 14px;
  background: var(--surface);
}

.apollo-unmatched-hint {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 8px 0 0;
}

.drawer-score-box {
  text-align: right;
  flex-shrink: 0;
}

.drawer-score-num {
  font-size: 26px;
  font-weight: 800;
  font-family: "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}

.drawer-score-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 3px;
}

/* Drawer Quick Action Bar */
.drawer-quick-bar {
  padding: 8px 20px;
  min-height: 48px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.drawer-quick-fields {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.drawer-field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-field-inline label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.drawer-field-inline select,
.drawer-select {
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.drawer-field-inline select:hover,
.drawer-select:hover {
  border-color: var(--line-strong);
}

.drawer-field-inline select:focus,
.drawer-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.drawer-quick-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-quick-btns .btn.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Drawer Tab Navigation Strip */
.drawer-tab-strip {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 4px;
  flex-shrink: 0;
}

.drawer-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.drawer-tab-btn:hover {
  color: var(--ink);
}

.drawer-tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.drawer-tab-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
}

.drawer-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
}

.drawer-pane.hidden {
  display: none !important;
}

/* Drawer Stat Strip */
.drawer-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 2px;
}

.drawer-stat-tile {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.drawer-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.drawer-stat-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}

/* ── Apollo Results Intelligence Dashboard ────────────────────────── */
.results-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 16px;
}

.results-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.results-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.results-period-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.results-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.results-kpi-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.results-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.results-kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: normal;
  text-transform: none;
}

.results-kpi-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 1.5px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.results-kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 6px;
}

.results-kpi-sub {
  font-size: 11.5px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.results-kpi-meter {
  display: none;
}

/* Funnel Card */
/* Results: lead quality */
.results-quality-card {
  padding: 18px 20px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.quality-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.quality-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.quality-sub { font-size: 12px; color: var(--ink-faint); }
.quality-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.quality-col h4 { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); }
.quality-hero { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.quality-hero small { font-size: 12px; font-weight: 500; color: var(--ink-faint); margin-left: 4px; }
.quality-bar { display: flex; gap: 2px; height: 12px; margin: 10px 0 8px; }
.quality-bar span { min-width: 2px; }
.quality-bar span:first-child { border-radius: 4px 0 0 4px; }
.quality-bar span:last-child { border-radius: 0 4px 4px 0; }
.quality-bar span:only-child { border-radius: 4px; }
.quality-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.quality-legend li { display: flex; align-items: center; gap: 6px; }
.quality-legend b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.quality-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.quality-meter { margin-top: 10px; }
.quality-meter-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.quality-meter-top b { color: var(--ink); font-variant-numeric: tabular-nums; }
.quality-meter .quality-bar { height: 8px; margin: 5px 0 3px; }
.quality-meter-note { font-size: 11px; color: var(--ink-faint); }
.quality-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.quality-table th { text-align: right; font-weight: 600; color: var(--ink-faint); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.quality-table td { text-align: right; padding: 5px 6px; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.quality-table th:first-child, .quality-table td:first-child { text-align: left; color: var(--ink); }
.quality-empty { font-size: 12px; color: var(--ink-faint); line-height: 1.45; margin-top: 8px; }

@media (max-width: 900px) {
  .quality-grid { grid-template-columns: 1fr; }
}

/* Dimensions Grid */
.results-dimensions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.results-dimension-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.results-dimension-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.results-dimension-head {
  padding: 14px 18px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.results-dimension-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.results-dimension-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th {
  padding: 9px 14px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.results-table th:last-child,
.results-table td:last-child {
  text-align: right;
}

.results-table td {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.results-table tbody tr:hover td {
  background: var(--surface-soft);
}

.results-group-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.results-mini-bar {
  flex: 1;
  max-width: 70px;
  height: 4px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-left: 6px;
}

.results-mini-bar>i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}

.conv-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.conv-badge strong {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}

.conv-badge .conv-rate {
  font-size: 10.5px;
  opacity: 0.85;
}

.conv-meeting {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-line);
}

.conv-opp {
  background: color-mix(in srgb, var(--info) 8%, transparent);
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 25%, transparent);
}

.conv-zero {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-faint);
  padding: 2px 4px;
}

.quarantine-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

.role-hidden {
  display: none !important;
}

.quarantine-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quarantine-controls select,
.quarantine-release-reason {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.quarantine-controls select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.quarantine-release-btn {
  margin-left: 6px;
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 11.5px;
}

.quarantine-release-btn:disabled {
  opacity: .6;
  cursor: wait;
}

/* ── SaaS Full Responsiveness Breakpoints ─────────────────────────── */
@media (max-width: 1100px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modelgrid {
    grid-template-columns: 1fr !important;
  }

  .kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .results-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-dimensions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -268px;
    bottom: 0;
    width: 260px;
    min-width: 260px;
    max-width: 85vw;
    z-index: 100;
    box-shadow: none;
  }

  .sidebar.mobile-open {
    transform: translateX(268px);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.45);
  }

  .app-topbar {
    padding: 0 14px;
    height: 52px;
  }

  .content-wrap {
    padding: 12px;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card {
    border-bottom: 1px solid var(--line-soft);
  }

  .filters {
    padding: 10px 12px;
    gap: 8px;
  }

  .filters .search-box {
    min-width: 100%;
    max-width: 100%;
  }

  .filters-actions,
  .filter-selects {
    margin-left: 0;
    width: 100%;
  }

  .filter-selects .apollo-dropdown {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .filter-selects .apollo-dropdown-trigger {
    width: 100%;
  }

  .chip-list {
    width: 100%;
    overflow-x: auto;
  }

  .chip {
    white-space: nowrap;
  }

  .view-switcher {
    margin-left: auto;
  }

  .view-toggle {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    border-right: 0;
  }

  .topbar-actions {
    gap: 6px;
  }

  .btn-export-all {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }

  .btn-export-all .btn-label,
  .breadcrumb-root,
  .breadcrumb-sep {
    display: none;
  }

  .breadcrumb-current {
    font-size: 15px;
  }

  .drawer-header {
    padding: 14px 16px;
  }

  .drawer-body {
    padding: 14px 16px;
  }
}

/* Layout Item 12: Content Height Alignment & Segment Tables */
.results-kpi-grid,
.results-dimensions-grid {
  align-items: start !important;
}

.results-dimension-card {
  align-self: start;
}

.results-mini-bar {
  flex-shrink: 0;
  width: 56px;
  height: 5px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-left: 8px;
}

.results-show-all-wrap {
  padding: 8px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-soft);
  text-align: center;
}

.results-show-all-btn {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
}

.results-show-all-btn:hover {
  background: var(--brand-glow);
}

.results-table-note {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--ink-faint);
  background: var(--surface-soft);
  border-top: 1px solid var(--line-soft);
}

/* Layout Item 13: Quarantine Banner, Toolbar, Badges, and Table */
/* One line of context above a page's main panel, instead of a boxed banner. */
.page-intro {
  margin: 2px 2px 14px;
  max-width: 820px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.page-intro strong {
  color: var(--ink);
  font-weight: 600;
}

/* Apollo health notices (admin, Verification page) */
.apollo-notices {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.apollo-notice {
  --notice: var(--info);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--notice) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--notice) 30%, var(--line));
  border-left: 4px solid var(--notice);
  border-radius: var(--radius-lg);
}

.apollo-notice-critical { --notice: var(--critical); }
.apollo-notice-warn { --notice: var(--warn); }

.apollo-notice-icon {
  color: var(--notice);
  flex-shrink: 0;
  margin-top: 1px;
}

.apollo-notice-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.apollo-notice-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.quarantine-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.quarantine-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.quarantine-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}

.quarantine-search-wrap input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  outline: none;
}

.quarantine-search-wrap input:focus {
  border-color: var(--brand);
  background: var(--surface);
}

.quarantine-reason-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.quarantine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quarantine-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.quarantine-chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 600;
}

.quarantine-chip-count {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
}

.quarantine-chip.active .quarantine-chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.quarantine-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
}

[data-theme="dark"] .quarantine-bulk-bar {
  background: rgba(30, 58, 138, 0.4);
  border-color: rgba(96, 165, 250, 0.3);
}

.quarantine-bulk-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quarantine-bulk-count {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
}

.quarantine-bulk-hint {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.quarantine-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quarantine-table {
  table-layout: fixed;
  width: 100%;
}

.quarantine-table th.col-select,
.quarantine-table td.col-select {
  width: 36px;
  text-align: center;
}

.quarantine-table th.col-num,
.quarantine-table td.col-num {
  width: 36px;
  text-align: center;
}

.quarantine-table th.col-lead,
.quarantine-table td.col-lead {
  width: 220px;
}

.quarantine-table th.col-reason,
.quarantine-table td.col-reason {
  width: 270px;
}

.quarantine-table th.col-source,
.quarantine-table td.col-source {
  width: 90px;
}

.quarantine-table th.col-owner,
.quarantine-table td.col-owner {
  width: 130px;
}

.quarantine-table th.col-action,
.quarantine-table td.col-action {
  width: 100px;
  text-align: right;
}

.quarantine-table .lead-email {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quarantine-reason-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.quarantine-cat-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tag-cat-vendor { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.tag-cat-incomplete { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.tag-cat-spam { background: #fae8ff; color: #86198f; border: 1px solid #f5d0fe; }
.tag-cat-internal { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.tag-cat-competitor { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.tag-cat-default { background: var(--surface-soft); color: var(--ink-soft); border: 1px solid var(--line); }

[data-theme="dark"] .tag-cat-vendor { background: rgba(180, 83, 9, 0.2); color: #fde68a; border-color: rgba(180, 83, 9, 0.4); }
[data-theme="dark"] .tag-cat-incomplete { background: rgba(185, 28, 28, 0.2); color: #fca5a5; border-color: rgba(185, 28, 28, 0.4); }
[data-theme="dark"] .tag-cat-spam { background: rgba(134, 25, 143, 0.2); color: #f0abfc; border-color: rgba(134, 25, 143, 0.4); }
[data-theme="dark"] .tag-cat-internal { background: rgba(55, 48, 163, 0.2); color: #a5b4fc; border-color: rgba(55, 48, 163, 0.4); }
[data-theme="dark"] .tag-cat-competitor { background: rgba(194, 65, 12, 0.2); color: #fdba74; border-color: rgba(194, 65, 12, 0.4); }

.quarantine-reason-detail {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.35;
}
/* In-row controls are drawn flat until hovered; keyboard focus still shows the same ring as other
   controls, or a keyboard user can't tell which row's stage or owner they are on. */
.apollo-dropdown.compact .apollo-dropdown-trigger:focus-visible,
.btn.accept-owner-suggestion:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

/* People who ask their system for less motion get instant state changes instead of animations. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
