:root {
  color-scheme: light;
  --ink: #1c2432;
  --muted: #687180;
  --line: #dce3e7;
  --panel: #ffffff;
  --soft: #f5f8fa;
  --page: #eef3f7;
  --sidebar-bg: rgba(255, 255, 255, 0.92);
  --nav-link: #475161;
  --nav-hover-bg: #111827;
  --nav-hover-text: #ffffff;
  --field-bg: #ffffff;
  --deep: #111827;
  --teal: #00a9a9;
  --teal-dark: #007d82;
  --teal-glow: rgba(0, 169, 169, 0.22);
  --amber: #f59b16;
  --red: #c64b44;
  --blue: #243447;
  --leak: #7c3aed;
  --leak-soft: rgba(124, 58, 237, 0.14);
  --drip: #0b3a75;
  --drip-soft: rgba(11, 58, 117, 0.14);
  --crm: #008c4a;
  --crm-soft: rgba(0, 140, 74, 0.14);
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.1);
}

body.theme-dark {
  color-scheme: dark;
  --ink: #eef6f7;
  --muted: #9fb0bd;
  --line: #273544;
  --panel: #121a24;
  --soft: #0d141d;
  --page: #081019;
  --sidebar-bg: rgba(10, 16, 24, 0.94);
  --nav-link: #b7c5cf;
  --nav-hover-bg: #e9fbfb;
  --nav-hover-text: #0b1118;
  --field-bg: #0f1722;
  --deep: #e9fbfb;
  --teal-dark: #62d8d3;
  --teal-glow: rgba(0, 169, 169, 0.32);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(0, 169, 169, 0.08), rgba(255, 255, 255, 0) 280px),
    var(--page);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.theme-dark {
  background:
    linear-gradient(180deg, rgba(0, 169, 169, 0.14), rgba(8, 16, 25, 0) 320px),
    radial-gradient(circle at 76% 8%, rgba(245, 155, 22, 0.08), transparent 30%),
    var(--page);
}

body.service-leak {
  --teal: var(--leak);
  --teal-dark: #5b21b6;
  --teal-glow: var(--leak-soft);
}

body.service-drip {
  --teal: var(--drip);
  --teal-dark: #082f62;
  --teal-glow: var(--drip-soft);
}

body.service-crm {
  --teal: var(--crm);
  --teal-dark: #006b3a;
  --teal-glow: var(--crm-soft);
}

body.leadleak-shell {
  --leadleak-navy: #172033;
  --leadleak-teal: #00a7a0;
  --product-accent: var(--leadleak-teal);
  --product-accent-soft: rgba(0, 167, 160, 0.12);
}

body.leadleak-shell[data-leadleak-product="scan"] {
  --product-accent: #e89200;
  --product-accent-soft: rgba(232, 146, 0, 0.13);
  --teal: #e89200;
  --teal-dark: #a76600;
  --teal-glow: rgba(232, 146, 0, 0.2);
}

body.leadleak-shell[data-leadleak-product="recover"] {
  --product-accent: #7457d9;
  --product-accent-soft: rgba(116, 87, 217, 0.13);
  --teal: #7457d9;
  --teal-dark: #543bad;
  --teal-glow: rgba(116, 87, 217, 0.2);
}

body.leadleak-shell[data-leadleak-product="flow"] {
  --product-accent: #1769d2;
  --product-accent-soft: rgba(23, 105, 210, 0.12);
  --teal: #1769d2;
  --teal-dark: #0d4d9e;
  --teal-glow: rgba(23, 105, 210, 0.2);
}

body.leadleak-shell[data-leadleak-product="crm"] {
  --product-accent: #008a5a;
  --product-accent-soft: rgba(0, 138, 90, 0.12);
  --teal: #008a5a;
  --teal-dark: #006540;
  --teal-glow: rgba(0, 138, 90, 0.2);
}

body.leadleak-shell[data-leadleak-product="insights"] {
  --product-accent: #008fa8;
  --product-accent-soft: rgba(0, 143, 168, 0.12);
  --teal: #008fa8;
  --teal-dark: #006b7e;
  --teal-glow: rgba(0, 143, 168, 0.2);
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
  border-top: 1px solid var(--line);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 18px 16px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 18px;
  backdrop-filter: blur(18px);
  box-shadow: 12px 0 34px rgba(17, 24, 39, 0.04);
}

body.leadleak-shell .app-shell {
  grid-template-columns: 278px minmax(0, 1fr);
}

body.leadleak-shell .sidebar {
  gap: 12px;
  padding: 16px 14px 14px;
  overflow: visible;
  z-index: 20;
}

body.leadleak-shell .brand {
  min-height: 48px;
  display: block;
}

.leadleak-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 2px 4px;
  color: var(--ink);
  text-decoration: none;
}

.leadleak-brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.14);
}

.leadleak-brand span {
  display: grid;
  gap: 1px;
  color: inherit;
  text-transform: none;
}

.leadleak-brand strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.leadleak-brand small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.product-switcher {
  position: relative;
  z-index: 30;
}

.product-switcher__trigger {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

.product-switcher__trigger:hover,
.product-switcher.open .product-switcher__trigger {
  border-color: var(--product-accent);
  background: var(--product-accent-soft);
}

.product-switcher__trigger > span,
.product-switcher__option > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.product-switcher__trigger small,
.product-switcher__option small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-switcher__trigger strong {
  font-size: 14px;
  line-height: 1.2;
}

.product-signal {
  display: block;
  width: 18px;
  height: 18px;
  border: 5px solid currentColor;
  border-radius: 5px;
  background: var(--panel);
  color: var(--product-accent);
  box-shadow: inset 0 0 0 2px var(--panel);
}

.product-signal.product-scan { color: #e89200; }
.product-signal.product-recover { color: #7457d9; }
.product-signal.product-flow { color: #1769d2; }
.product-signal.product-crm { color: #008a5a; }
.product-signal.product-insights { color: #008fa8; }

.product-switcher__chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
}

.product-switcher.open .product-switcher__chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.product-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 344px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.2);
}

.product-switcher__menu[hidden] {
  display: none;
}

.product-switcher__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 10px;
  border-bottom: 1px solid var(--line);
}

.product-switcher__heading strong {
  font-size: 12px;
}

.product-switcher__heading span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.product-switcher__option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin-top: 3px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.product-switcher__option:hover,
.product-switcher__option.active {
  border-color: var(--line);
  background: var(--soft);
}

.product-switcher__option strong {
  font-size: 13px;
}

.product-switcher__option b {
  color: var(--product-accent);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.brand {
  display: grid;
  gap: 8px;
  min-height: 92px;
  align-content: start;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: 56px;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.02) contrast(1.02);
}

nav {
  display: grid;
  gap: 4px;
}

body.leadleak-shell .leadleak-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding: 1px 3px 8px 1px;
  scrollbar-width: thin;
}

.leadleak-nav__group {
  display: grid;
  gap: 2px;
}

.leadleak-nav__operations {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

body.leadleak-shell .leadleak-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
}

body.leadleak-shell .leadleak-nav a:hover {
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
}

body.leadleak-shell .leadleak-nav a.active {
  border-color: color-mix(in srgb, var(--product-accent) 34%, var(--line));
  background: var(--product-accent-soft);
  color: var(--ink);
}

body.leadleak-shell .leadleak-nav a.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 3px;
  border-radius: 2px;
  background: var(--product-accent);
  content: "";
}

body.leadleak-shell .leadleak-nav .shell-quick-add {
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 2px;
  border-color: var(--leadleak-navy);
  background: var(--leadleak-navy);
  color: #ffffff;
}

body.leadleak-shell .leadleak-nav .shell-quick-add:hover {
  border-color: var(--product-accent);
  background: var(--product-accent);
  color: #ffffff;
}

.shell-quick-add b {
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
}

body.leadleak-shell .nav-section-label {
  margin: 5px 8px 2px;
  font-size: 9px;
}

body.leadleak-shell .dashboard-switcher,
body.leadleak-shell .app-flow-map {
  display: none;
}

nav a {
  color: var(--nav-link);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

nav a.active,
nav a:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-text);
}

.nav-section-label {
  margin: 12px 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.mobile-menu-button {
  display: none;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--deep);
  color: var(--nav-hover-text);
  font-weight: 800;
}

.source-card {
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.12), rgba(245, 155, 22, 0.08)),
    var(--panel);
}

.source-card span,
.source-card p {
  color: var(--muted);
  font-size: 12px;
}

.source-card strong {
  display: block;
  margin: 5px 0;
  font-size: 14px;
}

.source-card p {
  margin: 0;
  line-height: 1.45;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

body.leadleak-shell .sidebar-bottom {
  gap: 8px;
}

body.leadleak-shell .workspace-card {
  padding: 10px 11px;
  border-radius: 6px;
  background: var(--panel);
}

body.leadleak-shell .workspace-card span {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

body.leadleak-shell .workspace-card strong {
  margin: 3px 0;
  font-size: 12px;
}

body.leadleak-shell .workspace-card p {
  display: none;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 9px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

body.leadleak-shell .theme-toggle {
  min-height: 40px;
  border-radius: 6px;
}

body.leadleak-shell .theme-toggle strong {
  font-size: 12px;
}

.theme-toggle span {
  display: grid;
  gap: 2px;
  text-align: left;
}

.theme-toggle small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.theme-toggle__switch {
  position: relative;
  width: 46px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  flex: 0 0 auto;
}

.theme-toggle__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--teal);
  transition: transform 160ms ease;
}

body.theme-dark .theme-toggle__switch::after {
  transform: translateX(20px);
}

/* Canonical LeadLeak workflow pages */
.canonical-page {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.canonical-page > section + section,
.canonical-page > nav + section {
  margin-top: 16px;
}

.compact-page-header {
  min-height: 92px;
  padding: 16px 18px;
  background: var(--panel);
}

.compact-page-header h1 {
  max-width: 900px;
  margin: 0;
  font-size: 26px;
  line-height: 1.18;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(170px, 0.7fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.command-strip > div,
.command-strip label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.command-strip > div span,
.command-strip label > span,
.compact-form label > span,
.access-form label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.command-strip input,
.command-strip select,
.compact-form input,
.compact-form select,
.access-form select,
.invite-output input,
.rule-sentence input,
.rule-sentence select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--field-bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.command-search {
  min-width: 0;
}

.view-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.view-tabs button,
.view-tabs a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.view-tabs button:hover,
.view-tabs button.active,
.view-tabs a:hover,
.view-tabs a.active {
  border-color: var(--line);
  background: var(--product-accent-soft);
  color: var(--ink);
}

.canonical-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.canonical-metrics .metric-card {
  min-height: 118px;
  padding: 15px;
  border-radius: 6px;
}

.canonical-metrics .metric-card::before {
  height: 3px;
  background: var(--product-accent);
}

.canonical-metrics .metric-card strong {
  margin: 7px 0;
  font-size: 28px;
}

.canonical-metrics .metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.canonical-split,
.canonical-master-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.7fr);
  gap: 14px;
  align-items: start;
}

.canonical-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.canonical-panel h2 {
  margin: 4px 0 10px;
  font-size: 19px;
}

.canonical-panel > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.canonical-empty {
  display: grid;
  place-items: start;
  min-height: 210px;
  align-content: center;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  background: var(--soft);
}

.canonical-empty strong {
  font-size: 16px;
}

.canonical-empty p {
  max-width: 620px;
  margin: 7px 0 15px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.canonical-empty .actions {
  justify-content: flex-start;
}

.detail-placeholder {
  min-height: 310px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.status-list {
  display: grid;
  margin-top: 12px;
}

.status-list a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 3px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.status-list a:last-child {
  border-bottom: 0;
}

.status-list a > span {
  display: grid;
  gap: 2px;
}

.status-list small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.status-list b {
  color: var(--muted);
  font-size: 12px;
}

.canonical-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.canonical-board > article {
  min-height: 390px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.canonical-board article > header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.canonical-board article > header b {
  color: var(--muted);
}

.stage-empty {
  margin: 10px;
  padding: 14px 10px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.automation-builder {
  border-top: 3px solid var(--product-accent);
}

.rule-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.rule-sentence select {
  width: auto;
  min-width: 220px;
}

.rule-sentence input {
  width: 72px;
}

.automation-guardrails {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}

.automation-guardrails label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 230px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}

.chart-empty span {
  width: 72%;
  height: 96px;
  border-bottom: 2px solid var(--product-accent);
  opacity: 0.22;
}

.report-catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--line);
}

.report-catalog article {
  min-height: 115px;
  padding: 13px;
  background: var(--panel);
}

.report-catalog p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.inbox-connect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.connect-provider {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.connect-provider:hover {
  border-color: var(--product-accent);
  background: var(--product-accent-soft);
}

.connect-provider span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.compact-form {
  display: grid;
  gap: 10px;
}

.compact-form label {
  display: grid;
  gap: 5px;
}

.access-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.access-form label {
  display: grid;
  gap: 5px;
}

.invite-output {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.plan-capabilities {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.plan-capabilities span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.report-funnel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--line);
}

.report-funnel span {
  display: grid;
  gap: 5px;
  min-height: 96px;
  align-content: center;
  padding: 12px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-funnel strong {
  color: var(--ink);
  font-size: 24px;
}

.product-suite .suite-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.product-suite .suite-grid article {
  min-height: 245px;
  border-radius: 6px;
  background: var(--panel);
}

.product-suite .suite-grid .product-signal {
  width: 24px;
  height: 24px;
  border-width: 6px;
}

.app-flow-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 18px;
}

.app-flow-map a {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
}

.app-flow-map strong {
  color: var(--ink);
  font-size: 13px;
}

.app-flow-map span {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.app-flow-map a.active,
.app-flow-map a:hover {
  border-color: rgba(0, 169, 169, 0.4);
  background: var(--teal-glow);
  color: var(--ink);
}

.production-empty-filter {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

main {
  padding: 24px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.actions,
.segmented,
.opportunity-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 20px;
}

.primary-button,
.draft-button,
.secondary-button,
.primary-link,
.secondary-link,
.price-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 4px;
  text-decoration: none;
  padding: 0 15px;
  font-weight: 800;
}

.primary-button,
.draft-button,
.primary-link,
.price-card a {
  background: linear-gradient(135deg, var(--teal), #00c2b8);
  color: #ffffff;
  box-shadow: 0 12px 26px var(--teal-glow);
}

.secondary-link {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.page-header h1 {
  max-width: none;
  font-size: clamp(32px, 3vw, 40px);
  line-height: 1.12;
}

.page-header .eyebrow {
  margin-bottom: 8px;
}

.page-header > div:first-child {
  flex: 1 1 100%;
  min-width: 0;
}

.page-header > .actions,
.page-header > .primary-link,
.page-header > .secondary-link,
.page-header > .role-selector,
.page-header > .workspace-switcher,
.page-header > .billing-toggle,
.page-header > .recovered-total {
  margin-left: auto;
}

.page-header > .actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 380px;
}

.page-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.08), rgba(255, 255, 255, 0)),
    #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.page-intro.is-hidden {
  display: none;
}

.page-intro h1 {
  max-width: 980px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.06;
}

.page-intro .eyebrow {
  margin-bottom: 8px;
}

.page-intro-dismiss {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace-switcher {
  display: grid;
  gap: 6px;
  width: min(240px, 100%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-switcher select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
  padding: 0 10px;
}

.index-hero {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 251, 251, 0.84)),
    #ffffff;
  box-shadow: 0 22px 58px rgba(17, 24, 39, 0.12);
}

.index-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 169, 169, 0.12), transparent 42%),
    repeating-linear-gradient(90deg, rgba(17, 24, 39, 0.055) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(17, 24, 39, 0.04) 0 1px, transparent 1px 64px);
}

.index-hero__nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 34px 0;
}

.index-hero__nav img {
  width: 142px;
  height: auto;
  display: block;
}

.hero-logo-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.08);
}

.hero-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.08);
}

.index-hero__nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #475161;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.index-hero__nav a:hover {
  border-color: rgba(0, 169, 169, 0.24);
  background: rgba(232, 251, 251, 0.78);
  color: var(--teal-dark);
}

.index-hero__nav .hero-nav-cta {
  background: var(--deep);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.16);
}

.index-hero__nav .hero-nav-cta:hover {
  border-color: var(--deep);
  background: var(--deep);
  color: #ffffff;
}

.index-hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) minmax(440px, 1.12fr);
  gap: 24px;
  align-items: center;
  min-height: 86vh;
  padding: 42px;
}

.index-hero__copy {
  max-width: 680px;
  margin-left: max(0px, calc((100vw - 1440px) / 2));
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 16px;
  padding: 0 10px;
  border-left: 4px solid var(--teal);
  background: #ffffff;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.index-hero__copy h1 {
  max-width: 700px;
  margin-bottom: 18px;
  color: var(--deep);
  font-size: clamp(46px, 6.5vw, 84px);
  line-height: 0.92;
}

.index-hero__copy p {
  max-width: 620px;
  margin-bottom: 22px;
  color: #475161;
  font-size: 18px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.hero-proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hero-proof-strip span {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-proof-strip strong {
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.index-hero__visual {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.2);
  border-radius: 4px;
  background: var(--deep);
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.2);
}

.index-hero__visual::before,
.index-hero__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.index-hero__visual::before {
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.78), rgba(17, 24, 39, 0.14) 58%, rgba(0, 169, 169, 0.24)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 52px);
}

.index-hero__visual::after {
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.index-hero__visual img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  display: block;
}

.hero-glass {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.76);
  color: #ffffff;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.hero-glass span,
.hero-glass small {
  color: #c6d2ce;
}

.hero-glass strong {
  display: block;
}

.hero-glass--main {
  left: 22px;
  bottom: 22px;
  padding: 18px;
}

.hero-glass--main strong {
  margin: 5px 0;
  font-size: 46px;
  line-height: 1;
}

.hero-glass--alert {
  top: 22px;
  right: 22px;
  max-width: 260px;
  padding: 14px;
}

.hero-glass--alert strong {
  margin: 5px 0;
  font-size: 19px;
}

.hero-glass--draft {
  right: 22px;
  bottom: 118px;
  padding: 12px 14px;
  border-color: rgba(0, 194, 184, 0.42);
}

.hero-glass--draft strong {
  margin-top: 4px;
  color: #ffffff;
  font-size: 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
}

.radar-panel {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  border: 1px solid rgba(17, 24, 39, 0.22);
  border-radius: 4px;
  background: #111b1a;
  box-shadow: var(--shadow);
}

.radar-panel::before,
.radar-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.radar-panel::before {
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.78), rgba(17, 24, 39, 0.12) 55%, rgba(0, 169, 169, 0.2)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 48px);
}

.radar-panel::after {
  border: 1px solid rgba(255, 255, 255, 0.18);
  inset: 14px;
}

.radar-panel img {
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
  display: block;
}

.radar-copy {
  position: absolute;
  left: 22px;
  bottom: 22px;
  max-width: 310px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.76);
  color: #ffffff;
  backdrop-filter: blur(12px);
}

.radar-copy span,
.radar-copy p {
  color: #c6d2ce;
}

.radar-copy strong {
  display: block;
  margin: 4px 0;
  font-size: 54px;
  line-height: 0.95;
}

.radar-copy p {
  margin-bottom: 0;
  line-height: 1.45;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-grid article,
.opportunity-card,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 12px 35px rgba(21, 32, 31, 0.06);
}

.metric-grid article {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric-grid article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.metric-grid span,
.opportunity-meta,
.detail-label,
.signal {
  color: var(--muted);
  font-size: 13px;
}

.metric-grid strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
  line-height: 1;
}

.metric-grid small {
  color: var(--muted);
  line-height: 1.35;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 390px);
  gap: 18px;
  align-items: start;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading.compact {
  align-items: start;
}

.segmented {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.segmented button {
  min-width: 54px;
  height: 32px;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.active {
  background: var(--deep);
  color: white;
}

.opportunity-list {
  display: grid;
  gap: 10px;
}

.opportunity-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.opportunity-card.selected {
  border-color: rgba(15, 143, 138, 0.75);
  box-shadow: 0 0 0 3px var(--teal-glow), 0 16px 36px rgba(17, 24, 39, 0.08);
}

.opportunity-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.status-hot {
  background: var(--red);
}

.status-warm {
  background: var(--amber);
}

.status-new {
  background: var(--teal);
}

.opportunity-title strong {
  font-size: 15px;
}

.opportunity-meta {
  line-height: 1.45;
}

.opportunity-value {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.detail-panel {
  position: sticky;
  top: 28px;
  padding: 18px;
}

.value-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 4px;
  background: #e8fbfb;
  color: var(--teal-dark);
  font-weight: 800;
  white-space: nowrap;
}

.detail-body {
  display: grid;
  gap: 14px;
}

.detail-box {
  padding: 14px;
  border: 1px solid #e5eaee;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.08), rgba(255, 255, 255, 0)),
    var(--soft);
}

.detail-box p {
  margin-bottom: 0;
  color: #303c3a;
  line-height: 1.5;
}

.draft {
  display: grid;
  gap: 12px;
}

.draft textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

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

.signal {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 7px 10px;
  font-weight: 700;
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(420px, 1.14fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-message,
.hero-product,
.feature-band article,
.split-section,
.price-card,
.comparison-table,
.closed-ledger,
.loss-model,
.recovery-metrics article {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.hero-message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
}

.hero-message h1 {
  margin-bottom: 18px;
}

.hero-message p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.hero-product {
  position: relative;
  overflow: hidden;
  min-height: 500px;
  background: var(--deep);
}

.hero-product::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.7), rgba(17, 24, 39, 0.12)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 56px);
}

.hero-product img {
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
  display: block;
}

.overlay-panel {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.78);
  color: #ffffff;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.overlay-panel span,
.overlay-panel small {
  color: #c6d2ce;
}

.overlay-panel strong {
  display: block;
}

.overlay-main {
  left: 24px;
  bottom: 24px;
  padding: 18px;
}

.overlay-main strong {
  margin: 5px 0;
  font-size: 44px;
  line-height: 1;
}

.overlay-side {
  top: 24px;
  right: 24px;
  max-width: 240px;
  padding: 14px;
}

.overlay-side strong {
  margin: 5px 0;
  font-size: 19px;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.product-suite,
.drip-sequence,
.drip-editor {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.product-suite {
  margin-bottom: 18px;
  padding: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-product-card {
  display: grid;
  gap: 12px;
  min-height: 330px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.08), rgba(245, 155, 22, 0.05)),
    #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
  color: inherit;
  text-decoration: none;
}

.dashboard-product-card:hover {
  border-color: rgba(0, 169, 169, 0.55);
  box-shadow: 0 0 0 3px var(--teal-glow), 0 18px 42px rgba(17, 24, 39, 0.1);
}

.service-leak-card:hover,
.service-leak-card:focus-within {
  border-color: rgba(124, 58, 237, 0.55);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(255, 255, 255, 0)),
    #ffffff;
  box-shadow: 0 0 0 3px var(--leak-soft), 0 18px 42px rgba(17, 24, 39, 0.1);
}

.service-drip-card:hover,
.service-drip-card:focus-within {
  border-color: rgba(11, 58, 117, 0.55);
  background:
    linear-gradient(135deg, rgba(11, 58, 117, 0.14), rgba(255, 255, 255, 0)),
    #ffffff;
  box-shadow: 0 0 0 3px var(--drip-soft), 0 18px 42px rgba(17, 24, 39, 0.1);
}

.service-crm-card:hover,
.service-crm-card:focus-within {
  border-color: rgba(0, 140, 74, 0.55);
  background:
    linear-gradient(135deg, rgba(0, 140, 74, 0.14), rgba(255, 255, 255, 0)),
    #ffffff;
  box-shadow: 0 0 0 3px var(--crm-soft), 0 18px 42px rgba(17, 24, 39, 0.1);
}

.dashboard-product-card img {
  width: min(220px, 100%);
  height: 58px;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
}

.product-suite img,
.drip-hero img {
  width: min(220px, 100%);
  height: 58px;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
}

.dashboard-product-card span,
.activity-feed span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-product-card h2 {
  font-size: 26px;
  line-height: 1.05;
}

.dashboard-product-card p,
.activity-feed p {
  color: var(--muted);
  line-height: 1.55;
}

.dashboard-product-card strong {
  align-self: end;
  color: var(--ink);
  font-size: 18px;
}

.service-leak-card span,
.service-leak-card a,
.service-leak-card strong {
  color: var(--leak);
}

.service-drip-card span,
.service-drip-card a,
.service-drip-card strong {
  color: var(--drip);
}

.service-crm-card span,
.service-crm-card a,
.service-crm-card strong {
  color: var(--crm);
}

.activity-feed {
  display: grid;
  gap: 10px;
}

.activity-feed article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.activity-feed p {
  margin-bottom: 0;
}

.suite-flow {
  display: grid;
  grid-template-columns: minmax(300px, 0.44fr) minmax(520px, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.suite-flow h2 {
  font-size: 28px;
  line-height: 1.08;
}

.flow-lane {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.flow-lane article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.flow-lane span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--deep);
  color: #ffffff;
  font-weight: 800;
}

.flow-lane p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.suite-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.suite-grid article {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.08), rgba(255, 255, 255, 0)),
    var(--soft);
}

.suite-grid img {
  width: min(230px, 100%);
  height: 56px;
  object-fit: contain;
  object-position: left center;
}

.suite-grid span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.suite-grid p {
  color: var(--muted);
  line-height: 1.55;
}

.suite-grid a {
  align-self: end;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.product-page-header {
  align-items: center;
}

.product-page-header img {
  width: min(340px, 36vw);
  height: auto;
}

.drip-builder {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 400px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.drip-sequence,
.drip-editor {
  padding: 18px;
}

.drip-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.drip-controls label,
.setting-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.drip-controls input,
.drip-controls select,
.setting-control input,
.setting-control select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
}

.drip-controls input[type="range"] {
  accent-color: var(--teal);
}

.sequence-steps {
  display: grid;
  gap: 12px;
}

.sequence-steps article {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.sequence-steps article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--teal);
}

.sequence-steps article.loaded {
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.12), rgba(245, 155, 22, 0.08)),
    #ffffff;
}

.sequence-steps span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sequence-steps strong {
  font-size: 22px;
}

.sequence-steps p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.drip-editor {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 24px;
}

.drip-editor label {
  display: grid;
  gap: 6px;
}

.drip-editor input,
.drip-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.drip-editor input {
  min-height: 42px;
  padding: 0 12px;
}

.drip-editor textarea {
  min-height: 210px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.drip-preview-meta {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 400px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.settings-panel,
.onboarding-shell,
.onboarding-panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.settings-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.settings-table {
  display: grid;
}

#inboxList {
  display: grid;
}

.inbox-admin-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 0.8fr) minmax(170px, 1fr) minmax(160px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  margin: 16px 0 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.inbox-admin-form label {
  display: grid;
  gap: 7px;
}

.inbox-admin-form .toggle-row {
  align-self: center;
  margin: 0;
}

.settings-row {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 1fr 0.7fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.settings-row:first-child {
  border-top: 0;
}

.settings-head {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-row strong {
  color: var(--ink);
}

.settings-row em {
  justify-self: start;
  padding: 6px 8px;
  border-radius: 4px;
  background: #e8fbfb;
  color: var(--teal-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.role-map {
  display: grid;
  gap: 10px;
}

.role-map article,
.toggle-row,
.settings-status {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.role-map article {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) 1fr;
  gap: 12px;
  align-items: center;
}

.role-map span,
.settings-status {
  color: var(--muted);
  line-height: 1.45;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.toggle-row input {
  accent-color: var(--teal);
}

.auth-status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-status-pill a,
.auth-status-pill button {
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(0, 159, 159, 0.14), transparent 42%),
    #f6fafb;
}

.auth-panel {
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-panel .hero-logo-link img {
  width: 168px;
}

.auth-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.auth-panel p {
  margin: 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.auth-links a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.account-panel {
  align-content: start;
}

.account-form {
  display: grid;
  gap: 14px;
}

.account-form label {
  display: grid;
  gap: 8px;
}

.account-form small {
  color: var(--muted);
  font-weight: 700;
}

.account-form input:disabled {
  color: var(--muted);
  background: #edf3f4;
  cursor: not-allowed;
  border-style: dashed;
}

.member-list-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.member-list {
  display: grid;
  gap: 10px;
}

.member-list article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.member-list span,
.member-list em {
  color: var(--muted);
  font-size: 0.88rem;
}

.invite-link-output textarea {
  min-height: 92px;
  resize: vertical;
  font-size: 0.82rem;
}

.onboarding-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.onboarding-steps {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--soft);
}

.onboarding-steps button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
  font-weight: 800;
}

.onboarding-steps button.active {
  border-color: var(--deep);
  background: var(--deep);
  color: #ffffff;
}

.onboarding-panel {
  min-height: 520px;
  padding: 22px;
  box-shadow: none;
  border: 0;
}

.onboarding-view {
  display: none;
}

.onboarding-view.active {
  display: grid;
  gap: 18px;
}

.connect-grid,
.plan-picker {
  display: grid;
  gap: 12px;
}

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

.connect-grid button,
.plan-picker label {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.09), rgba(255, 255, 255, 0)),
    var(--soft);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.plan-picker label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
}

.plan-picker input {
  accent-color: var(--teal);
}

.scan-meter {
  overflow: hidden;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.scan-meter span {
  display: block;
  width: 18%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 0.35s ease;
}

.onboarding-summary {
  margin-bottom: 0;
}

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

.permission-grid article,
.addon-card,
.org-chart-panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.permission-grid article,
.addon-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 9px;
  padding: 18px;
}

.permission-grid article::before,
.addon-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.permission-grid span,
.addon-card span,
.delegated-inboxes span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.permission-grid p,
.addon-card p,
.subscription-base p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.org-layout,
.subscription-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(320px, 400px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.org-chart-panel {
  padding: 18px;
}

.org-tree,
.org-branch {
  display: grid;
  gap: 12px;
}

.org-branch {
  margin-left: 28px;
  padding-left: 18px;
  border-left: 2px solid var(--line);
}

.org-branch.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.org-node {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.org-node.superuser {
  border-color: rgba(0, 169, 169, 0.45);
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.12), rgba(245, 155, 22, 0.08)),
    #ffffff;
}

.org-node span,
.org-node em {
  color: var(--muted);
  font-size: 12px;
}

.org-node em {
  font-style: normal;
  font-weight: 800;
}

.delegated-inboxes {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.delegated-inboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.delegated-inboxes input {
  accent-color: var(--teal);
}

.ai-guardrail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sync-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-guardrail-grid article,
.sync-model-grid article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.ai-guardrail-grid span,
.sync-model-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.subscription-base {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.1), rgba(245, 155, 22, 0.06)),
    var(--soft);
}

.subscription-base strong,
.addon-card strong {
  font-size: 34px;
  line-height: 1;
}

.addon-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-band article {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.feature-band article::before,
.price-card::before,
.recovery-metrics article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.feature-band span {
  color: var(--teal-dark);
  font-weight: 800;
}

.feature-band h2,
.split-section h2,
.loss-model h2 {
  margin: 8px 0 10px;
  font-size: 24px;
  line-height: 1.12;
}

.feature-band p,
.price-card p,
.split-section span,
.loss-model span,
.deal-row,
.table-row {
  color: var(--muted);
  line-height: 1.5;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(320px, 0.7fr) minmax(420px, 1fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.proof-grid,
.recovery-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.proof-grid article {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  background: var(--soft);
}

.proof-grid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 26px;
}

.billing-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.role-selector {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-selector select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-transform: none;
}

.billing-toggle button {
  min-height: 34px;
  border-radius: 3px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.billing-toggle button.active {
  background: var(--deep);
  color: #ffffff;
}

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

.price-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 460px;
  padding: 22px;
}

.price-card.featured {
  border-color: rgba(0, 169, 169, 0.7);
  box-shadow: 0 0 0 3px var(--teal-glow), 0 20px 48px rgba(17, 24, 39, 0.1);
}

.price-card.enterprise {
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.08), rgba(245, 155, 22, 0.08)),
    #ffffff;
}

.tier-label {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.price-card h2 {
  margin: 10px 0;
  font-size: 22px;
}

.price-card strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 38px;
  line-height: 1;
}

.price-card strong span {
  color: var(--muted);
  font-size: 14px;
}

.price-card ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 24px;
  padding: 0;
  list-style: none;
}

.price-card li {
  color: #475161;
  font-weight: 600;
}

.price-card li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: var(--teal);
}

.price-card a {
  margin-top: auto;
}

.comparison-table,
.closed-ledger,
.loss-model {
  padding: 18px;
}

.table-row,
.deal-row {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}

.table-row:first-child,
.deal-row:first-child {
  border-top: 0;
}

.table-head,
.deal-head {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.recovered-total {
  min-width: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.12), rgba(245, 155, 22, 0.1)),
    #ffffff;
}

.recovered-total span,
.recovery-metrics span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.recovered-total strong {
  display: block;
  margin-top: 5px;
  font-size: 34px;
  line-height: 1;
}

.recovery-metrics {
  margin-bottom: 18px;
}

.recovery-metrics article {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.recovery-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.deal-table {
  overflow: hidden;
}

.deal-row {
  grid-template-columns: 1.05fr 1.35fr 1.35fr 0.7fr 0.7fr;
}

.deal-row strong {
  color: var(--ink);
}

.deal-row em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 4px;
  background: #e8fbfb;
  color: var(--teal-dark);
  font-style: normal;
  font-weight: 800;
}

.loss-model {
  display: grid;
  grid-template-columns: minmax(260px, 0.46fr) minmax(0, 1.54fr);
  gap: 20px;
  align-items: center;
  margin-top: 18px;
}

.formula-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.9fr) auto minmax(0, 1.15fr) auto minmax(0, 1.1fr);
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.formula-strip span,
.formula-strip strong,
.formula-strip b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.formula-strip span,
.formula-strip strong {
  text-align: center;
}

.formula-strip span {
  border: 1px solid var(--line);
  background: var(--soft);
}

.formula-strip strong {
  background: var(--deep);
  color: #ffffff;
}

.formula-strip b {
  color: var(--teal-dark);
}

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

.report-summary article {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.report-summary article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.report-summary span,
.report-summary small {
  color: var(--muted);
  font-size: 12px;
}

.report-summary strong {
  display: block;
  margin: 6px 0;
  font-size: 28px;
  line-height: 1;
}

.aggregate-panel {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.1), rgba(245, 155, 22, 0.06)),
    #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.account-filter-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(420px, 1.25fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.account-filter-panel h2 {
  margin-bottom: 6px;
}

.account-filter-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.inbox-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.inbox-filter label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.inbox-filter input {
  accent-color: var(--teal);
}

.aggregate-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hierarchy-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.hierarchy-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.standard-report {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.report-main-card,
.report-side-card,
.report-history {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.report-main-card,
.report-side-card {
  padding: 18px;
}

.report-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-section-grid article {
  position: relative;
  overflow: hidden;
  min-height: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.08), rgba(255, 255, 255, 0)),
    var(--soft);
}

.report-section-grid article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.report-section-grid span,
.delivery-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-section-grid strong {
  display: block;
  margin: 10px 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
}

.report-section-grid p,
.report-narrative p,
.delivery-list {
  color: var(--muted);
  line-height: 1.5;
}

.report-narrative {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.report-narrative p:last-child {
  margin-bottom: 0;
}

.report-side-card {
  position: sticky;
  top: 24px;
}

.report-side-card h2 {
  margin-bottom: 14px;
  font-size: 26px;
}

.delivery-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.delivery-list span {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.delivery-list strong {
  color: var(--ink);
}

.report-history {
  padding: 18px;
}

.history-table {
  display: grid;
}

.history-row {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 0.8fr 1.2fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.history-row:first-child {
  border-top: 0;
}

.history-head {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-row strong {
  color: var(--ink);
}

.history-row button {
  min-height: 32px;
  padding: 0 12px;
}

.today-command-list {
  display: grid;
  gap: 10px;
}

.today-command-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.today-command-list span,
.trust-principles span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.today-command-list strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 19px;
}

.today-command-list p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.command-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.command-actions a,
.command-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  padding: 0 12px;
}

.command-actions button {
  background: var(--deep);
  color: #ffffff;
}

.trust-principles,
.compliance-grid {
  display: grid;
  gap: 12px;
}

.trust-principles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.trust-principles article,
.compliance-grid article {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.trust-principles h2 {
  font-size: 22px;
  line-height: 1.12;
}

.trust-principles p,
.compliance-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.checkout-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.checkout-steps span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.checkout-steps span.active {
  border-color: rgba(0, 169, 169, 0.36);
  background: var(--teal-glow);
  color: var(--teal-dark);
}

.checkout-addons {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.outcome-tracker {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  background: var(--deep);
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.22);
}

.outcome-dot {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  box-shadow: 0 0 0 7px rgba(0, 169, 169, 0.14);
}

.outcome-hover {
  position: absolute;
  right: 0;
  bottom: 56px;
  width: 240px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.outcome-hover strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.outcome-tracker:hover .outcome-hover,
.outcome-tracker:focus .outcome-hover {
  opacity: 1;
  transform: translateY(0);
}

.outcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
}

.outcome-overlay.open {
  display: grid;
}

.outcome-panel {
  width: min(640px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.outcome-grid article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.outcome-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.outcome-state {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
}

.outcome-state.recovered { background: var(--crm); }
.outcome-state.replied { background: var(--teal); }
.outcome-state.booked { background: var(--amber); }
.outcome-state.ignored { background: var(--muted); }

.dashboard-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.dashboard-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.dashboard-switcher a:hover,
.dashboard-switcher a.active {
  border-color: rgba(0, 169, 169, 0.28);
  background: var(--soft);
  color: var(--ink);
}

.rescue-queue,
.relationship-map,
.how-steps {
  display: grid;
  gap: 12px;
}

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

.rescue-queue article,
.relationship-map article,
.how-steps article {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.06), rgba(255, 255, 255, 0)),
    var(--soft);
}

.rescue-queue article span,
.relationship-map article span,
.how-steps article span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.rescue-queue article strong,
.relationship-map article strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.rescue-queue article p,
.relationship-map article p,
.how-steps article p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.rescue-queue article a {
  align-self: end;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

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

.how-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.how-steps article {
  min-height: 250px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.how-steps article h2 {
  font-size: 22px;
  line-height: 1.12;
}

.contact-layout,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.demo-form {
  display: grid;
  gap: 14px;
}

.demo-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.demo-form input,
.demo-form select,
.demo-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  padding: 10px 12px;
}

.demo-form textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.5;
}

.demo-form input:focus,
.demo-form select:focus,
.demo-form textarea:focus {
  outline: 3px solid var(--teal-glow);
  border-color: rgba(0, 169, 169, 0.55);
}

.crm-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.crm-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.crm-subnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 4px;
  color: #475161;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.crm-subnav a.active,
.crm-subnav a:hover {
  background: var(--teal);
  color: #ffffff;
}

.crm-search-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.crm-search-panel label {
  display: grid;
  gap: 6px;
}

.crm-search-panel span,
.crm-search-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-search-panel input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
}

.crm-search-panel input:focus {
  outline: 3px solid var(--teal-glow);
  border-color: var(--teal);
  background: #ffffff;
}

.crm-search-empty {
  display: none;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.crm-search-empty.visible {
  display: block;
}

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

.search-match {
  border-color: rgba(0, 140, 74, 0.55) !important;
  box-shadow: 0 0 0 3px var(--crm-soft), 0 14px 36px rgba(17, 24, 39, 0.07) !important;
}

.crm-pipeline,
.crm-side-panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.crm-pipeline {
  padding: 18px;
}

.crm-side-panel {
  position: sticky;
  top: 24px;
  padding: 18px;
}

.crm-side-panel h2 {
  margin-bottom: 14px;
  font-size: 26px;
}

.crm-kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.crm-kanban article {
  min-height: 330px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.crm-kanban h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
}

.crm-card {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.crm-card.hot {
  border-color: rgba(198, 75, 68, 0.45);
  box-shadow: 0 0 0 3px rgba(198, 75, 68, 0.1);
}

.crm-card strong {
  color: var(--ink);
}

.crm-card span {
  color: var(--muted);
  font-size: 12px;
}

.crm-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.crm-card em {
  justify-self: start;
  padding: 6px 8px;
  border-radius: 4px;
  background: #e8fbfb;
  color: var(--teal-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-table {
  display: grid;
}

.crm-row {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 1fr 0.7fr 0.8fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.crm-row:first-child {
  border-top: 0;
}

.crm-head {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-row strong {
  color: var(--ink);
}

.quick-add-layout,
.lead-intake-layout,
.timeline-board {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 400px);
  gap: 18px;
  align-items: start;
}

.quick-add-form,
.quick-add-preview,
.lead-intake-form,
.lead-intake-side,
.lead-preview-card,
.duplicate-panel,
.crm-pipeline-board article,
.suspect-grid article,
.account-directory article,
.task-board article {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.quick-add-form,
.quick-add-preview,
.lead-intake-form,
.lead-preview-card,
.duplicate-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.lead-intake-side {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.quick-add-form label,
.lead-intake-form label {
  display: grid;
  gap: 6px;
}

.quick-add-form input,
.quick-add-form select,
.quick-add-form textarea,
.lead-intake-form input,
.lead-intake-form select,
.lead-intake-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.quick-add-form input,
.quick-add-form select,
.lead-intake-form input,
.lead-intake-form select {
  min-height: 42px;
  padding: 0 12px;
}

.quick-add-form textarea,
.lead-intake-form textarea {
  min-height: 170px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.lead-step {
  display: none;
  gap: 12px;
}

.lead-step.active {
  display: grid;
}

.lead-form-actions {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
}

#leadCreateButton {
  display: none;
  justify-self: end;
}

.lead-intake-form.ready-to-create #leadCreateButton {
  display: inline-flex;
}

.lead-intake-form.ready-to-create #leadNextButton {
  display: none;
}

.duplicate-panel {
  display: none;
  border-color: rgba(245, 155, 22, 0.55);
  background:
    linear-gradient(135deg, rgba(245, 155, 22, 0.14), rgba(255, 255, 255, 0)),
    #ffffff;
}

.duplicate-panel.visible {
  display: grid;
}

.quick-add-split,
.conversion-rules,
.suspect-toolbar,
.timeline-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-add-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.conversion-rules,
.suspect-toolbar,
.timeline-filters {
  margin-bottom: 18px;
}

.conversion-rules article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.conversion-rules span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

.conversion-rules p,
.suspect-grid p,
.account-directory p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.crm-pipeline-board,
.suspect-grid,
.account-directory,
.task-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.crm-pipeline-board article,
.task-board article {
  min-height: 340px;
  padding: 14px;
  background: var(--soft);
}

.crm-pipeline-board h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.crm-stage-card {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.crm-stage-card.deal {
  border-color: rgba(0, 140, 74, 0.42);
  box-shadow: 0 0 0 3px var(--crm-soft);
}

.crm-stage-card span,
.crm-stage-card em {
  color: var(--muted);
  font-size: 12px;
}

.crm-stage-card em {
  justify-self: start;
  padding: 6px 8px;
  border-radius: 4px;
  background: #e8fbfb;
  color: var(--teal-dark);
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.suspect-toolbar,
.timeline-filters {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.suspect-grid article,
.account-directory article {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.relationship-command,
.relationship-two-col {
  display: grid;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.relationship-command {
  grid-template-columns: minmax(560px, 1fr) minmax(300px, 360px);
}

.relationship-two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.relationship-board,
.relationship-card,
.relationship-side {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.relationship-board,
.relationship-card,
.relationship-side {
  padding: 18px;
}

.relationship-card {
  display: grid;
  gap: 14px;
}

.relationship-card--featured {
  min-height: 420px;
  background:
    linear-gradient(135deg, rgba(0, 140, 74, 0.12), rgba(255, 255, 255, 0) 42%),
    #ffffff;
}

.relationship-card__head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.relationship-card__head h2,
.relationship-card__head h3 {
  margin-bottom: 4px;
  line-height: 1.02;
}

.relationship-card__head h2 {
  font-size: 42px;
}

.relationship-card__head h3 {
  font-size: 23px;
}

.relationship-card__head span,
.relationship-context-grid span,
.suggestion-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.relationship-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 4px;
  background: var(--deep);
  color: #ffffff;
  font-size: 24px;
}

.relationship-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.relationship-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(0, 140, 74, 0.28);
  border-radius: 4px;
  background: rgba(0, 140, 74, 0.08);
  color: var(--crm);
  font-size: 12px;
  font-weight: 800;
}

.relationship-context-grid,
.relationship-card-grid,
.suggestion-list {
  display: grid;
  gap: 12px;
}

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

.relationship-context-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.relationship-context-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  line-height: 1.35;
}

.internal-review-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.internal-review-strip div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.internal-review-strip span,
.internal-review-strip small,
.referral-grid span,
.note-visibility span,
.note-visibility small {
  color: var(--muted);
  font-size: 12px;
}

.internal-review-strip span,
.referral-grid span,
.note-visibility span {
  font-weight: 800;
  text-transform: uppercase;
}

.relationship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.relationship-side {
  position: sticky;
  top: 24px;
}

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

.relationship-card p,
.suggestion-list p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.role-matrix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.role-matrix span,
.role-matrix strong {
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.role-matrix span:nth-last-child(2),
.role-matrix strong:last-child {
  border-bottom: 0;
}

.role-matrix span {
  color: var(--muted);
  font-weight: 800;
}

.role-matrix strong {
  background: var(--soft);
  color: var(--ink);
  text-align: right;
}

.access-map {
  display: grid;
  gap: 10px;
}

.access-map article {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.access-map span,
.access-map strong,
.access-map em {
  font-style: normal;
  font-weight: 800;
}

.access-map strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

.suggestion-list article {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.suggestion-list article div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-loop-hero {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.loop-timeline,
.client-loop-grid,
.loop-action-list {
  display: grid;
  gap: 12px;
}

.loop-timeline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.loop-timeline article,
.client-loop-grid article,
.loop-action-list article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.loop-timeline span,
.client-loop-grid span,
.loop-action-list span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.loop-timeline p,
.client-loop-grid p,
.loop-action-list p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.client-loop-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-loop-grid em {
  align-self: end;
  justify-self: start;
  padding: 7px 9px;
  border-radius: 4px;
  background: #ffffff;
  color: var(--crm);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.loop-action-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.loop-action-list article span,
.loop-action-list article strong,
.loop-action-list article p {
  grid-column: 1;
}

.loop-action-list article button {
  grid-column: 2;
  grid-row: 1 / span 3;
}

.referral-grid,
.internal-note-form {
  display: grid;
  gap: 12px;
}

.referral-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.referral-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.referral-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.referral-metrics b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.internal-note-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.internal-note-form select,
.internal-note-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  padding: 10px 12px;
}

.internal-note-form select {
  min-height: 44px;
}

.internal-note-form textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.5;
}

.note-visibility {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(0, 140, 74, 0.24);
  border-radius: 4px;
  background: rgba(0, 140, 74, 0.08);
}

.note-visibility strong {
  color: var(--ink);
}

.coi-formula {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.1fr);
  gap: 6px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 140, 74, 0.22);
  border-radius: 4px;
  background: rgba(0, 140, 74, 0.07);
}

.coi-formula span,
.coi-formula b {
  color: var(--crm);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.coi-formula strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-size: 11px;
  text-align: center;
}

.suspect-grid span:first-child {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.timeline-board > div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  overflow: hidden;
}

.timeline-item button {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.timeline-item button span {
  color: var(--muted);
  font-size: 12px;
}

.timeline-item div {
  display: none;
  padding: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.timeline-item.open div {
  display: block;
}

.timeline-item.hidden {
  display: none;
}

.contact-stack {
  display: grid;
  gap: 8px;
}

.contact-stack span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(340px, 420px);
  gap: 18px;
  align-items: start;
}

.flagged-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sort-control select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 34px 0 10px;
  font: inherit;
  font-weight: 700;
}

.flagged-email-list {
  display: grid;
  gap: 8px;
}

.flagged-email-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) minmax(140px, auto) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
  cursor: pointer;
}

.flagged-email-card.selected {
  border-color: rgba(0, 169, 169, 0.72);
  box-shadow: 0 0 0 3px var(--teal-glow), 0 16px 34px rgba(17, 24, 39, 0.08);
}

.email-status {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 24px;
  border-radius: 4px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-critical {
  background: var(--red);
}

.status-high {
  background: var(--amber);
}

.status-medium {
  background: var(--blue);
}

.status-watch {
  background: var(--teal);
}

.email-main,
.email-score {
  display: grid;
  gap: 3px;
}

.email-main strong,
.email-score strong {
  color: var(--ink);
  font-size: 14px;
}

.email-main span,
.email-main small,
.email-score small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.email-score {
  text-align: right;
}

.email-row-actions {
  display: flex;
  justify-content: end;
}

.expand-inline {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.report-detail {
  top: 24px;
}

.email-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.email-actions .draft-button {
  grid-column: 1 / -1;
}

body.modal-open {
  overflow: hidden;
}

.email-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 24px;
}

.email-modal.open {
  display: grid;
  place-items: center;
}

.email-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.76);
  backdrop-filter: blur(8px);
}

.email-modal__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.email-modal__header,
.email-modal__footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.09), rgba(245, 155, 22, 0.06)),
    #ffffff;
}

.email-modal__header h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

.email-modal__header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.email-modal__footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.email-modal__body {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(420px, 0.58fr);
  gap: 14px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.email-original,
.email-composer {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  padding: 14px;
}

.email-original h3 {
  margin: 10px 0;
  color: var(--ink);
  font-size: 17px;
}

.email-original p {
  color: #303c3a;
  font-size: 13px;
  line-height: 1.5;
}

.email-composer {
  display: grid;
  gap: 12px;
  background: #ffffff;
}

.email-composer label {
  display: grid;
  gap: 6px;
}

.email-composer input,
.email-composer select,
.email-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.email-composer input,
.email-composer select {
  min-height: 42px;
  padding: 0 12px;
}

.email-composer textarea {
  min-height: 220px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-actions {
  grid-template-columns: repeat(4, auto);
}

.modal-actions .draft-button {
  grid-column: auto;
}

body.theme-dark .topbar,
body.theme-dark .page-intro,
body.theme-dark .metric-card,
body.theme-dark .dashboard-card,
body.theme-dark .dashboard-product-card,
body.theme-dark .settings-panel,
body.theme-dark .crm-search-panel,
body.theme-dark .crm-stage-card,
body.theme-dark .crm-card,
body.theme-dark .org-chart-panel,
body.theme-dark .org-node,
body.theme-dark .member-list article,
body.theme-dark .permission-grid article,
body.theme-dark .standard-report,
body.theme-dark .aggregate-panel,
body.theme-dark .account-filter-panel,
body.theme-dark .report-card,
body.theme-dark .history-panel,
body.theme-dark .email-list,
body.theme-dark .email-row,
body.theme-dark .modal,
body.theme-dark .modal-content,
body.theme-dark .timeline-card,
body.theme-dark .quick-add-card,
body.theme-dark .lead-card,
body.theme-dark .relationship-card,
body.theme-dark .client-loop-card,
body.theme-dark .suspect-card,
body.theme-dark .pricing-card,
body.theme-dark .contact-card,
body.theme-dark .trust-card,
body.theme-dark .feature-band,
body.theme-dark .split-section,
body.theme-dark .product-card,
body.theme-dark .suite-card,
body.theme-dark .inbox-admin-form,
body.theme-dark .delegated-inboxes,
body.theme-dark .outcome-panel,
body.theme-dark .auth-card,
body.theme-dark .login-card {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: var(--field-bg);
  color: var(--ink);
  border-color: var(--line);
}

body.theme-dark input:disabled {
  background: #151f2b;
  color: var(--muted);
}

body.theme-dark .settings-row,
body.theme-dark .crm-row,
body.theme-dark .history-row,
body.theme-dark .timeline-event,
body.theme-dark .delivery-list span,
body.theme-dark .role-map article,
body.theme-dark .sync-model-grid article,
body.theme-dark .ai-guardrail-grid article,
body.theme-dark .source-card {
  border-color: var(--line);
}

body.theme-dark .settings-row em,
body.theme-dark .value-pill,
body.theme-dark .status-pill,
body.theme-dark .tier-label,
body.theme-dark .crm-stage-card em,
body.theme-dark .history-row em {
  background: rgba(0, 169, 169, 0.16);
  color: var(--teal-dark);
}

body.theme-dark .secondary-button,
body.theme-dark .page-intro-dismiss {
  background: var(--field-bg);
  color: var(--ink);
  border-color: var(--line);
}

body.theme-dark .primary-button,
body.theme-dark .primary-link {
  background: var(--teal);
  color: #ffffff;
}

body.theme-dark .index-hero,
body.theme-dark .marketing-hero {
  background:
    linear-gradient(135deg, rgba(0, 169, 169, 0.16), rgba(245, 155, 22, 0.08)),
    var(--panel);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  body.leadleak-shell .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    gap: 12px;
  }

  body.leadleak-shell .sidebar {
    position: relative;
    padding: 12px 14px;
    overflow: visible;
  }

  body.leadleak-shell .brand {
    padding-right: 116px;
  }

  body.leadleak-shell .mobile-menu-button {
    position: absolute;
    top: 16px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    width: 104px;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 5px;
  }

  body.leadleak-shell .mobile-menu-button span {
    display: none;
  }

  body.leadleak-shell .product-switcher {
    max-width: 420px;
  }

  body.leadleak-shell .product-switcher__menu {
    width: min(420px, calc(100vw - 28px));
  }

  body.leadleak-shell .sidebar nav {
    display: none;
  }

  body.leadleak-shell .sidebar.nav-open nav {
    display: flex;
    max-height: none;
    overflow: visible;
  }

  body.leadleak-shell .sidebar-bottom {
    grid-template-columns: minmax(0, 420px);
  }

  .source-card {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar nav {
    display: none;
  }

  .sidebar.nav-open nav {
    display: grid;
  }

  .sidebar-bottom {
    margin-top: 0;
  }

  main {
    padding: 18px;
  }

  .topbar,
  .hero-grid,
  .workspace,
  .report-workspace,
  .standard-report,
  .aggregate-panel,
  .account-filter-panel,
  .contact-layout,
  .checkout-layout,
  .crm-layout,
  .relationship-command,
  .relationship-two-col,
  .client-loop-hero,
  .quick-add-layout,
  .lead-intake-layout,
  .timeline-board,
  .drip-builder,
  .settings-layout,
  .org-layout,
  .subscription-layout,
  .suite-flow,
  .onboarding-shell,
  .index-hero__content,
  .marketing-hero,
  .split-section,
  .loss-model {
    grid-template-columns: 1fr;
  }

  .crm-search-panel {
    grid-template-columns: 1fr;
  }

  .app-flow-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-band,
  .dashboard-grid,
  .pricing-grid,
  .proof-grid,
  .trust-principles,
  .recovery-metrics,
  .report-summary,
  .report-section-grid,
  .suite-grid,
  .flow-lane,
  .permission-grid,
  .addon-grid,
  .ai-guardrail-grid,
  .sync-model-grid,
  .crm-pipeline-board,
  .suspect-grid,
  .account-directory,
  .task-board,
  .relationship-card-grid,
  .suggestion-list,
  .loop-timeline,
  .client-loop-grid,
  .conversion-rules,
  .suspect-toolbar,
  .timeline-filters,
  .crm-kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rescue-queue,
  .relationship-map,
  .relationship-context-grid,
  .internal-review-strip,
  .how-steps,
  .compliance-grid,
  .outcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    display: flex;
    height: auto;
    min-height: 74px;
  }

  .page-header > div:first-child,
  .page-header > .actions,
  .page-header > .primary-link,
  .page-header > .secondary-link,
  .page-header > .role-selector,
  .page-header > .workspace-switcher,
  .page-header > .billing-toggle,
  .page-header > .recovered-total {
    margin-left: 0;
  }

  .page-header > .actions {
    justify-content: flex-start;
    max-width: none;
  }

  .page-intro {
    grid-template-columns: 1fr;
  }

  .index-hero__content {
    padding: 22px;
  }

  .index-hero__visual,
  .index-hero__visual img {
    min-height: 430px;
  }

  .detail-panel {
    position: static;
  }

  .drip-editor {
    position: static;
  }

  .drip-controls,
  .connect-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-steps {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 36px;
  }

  .page-header h1 {
    font-size: 34px;
  }

  .page-header > .actions {
    flex-wrap: wrap;
    justify-self: stretch;
  }

  .index-hero__nav {
    display: grid;
    padding: 14px;
  }

  .hero-nav-links {
    justify-content: start;
  }

  .index-hero__copy h1 {
    font-size: 44px;
  }

  .index-hero__copy p {
    font-size: 15px;
  }

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

  .index-hero__visual,
  .index-hero__visual img {
    min-height: 390px;
  }

  .hero-glass--main {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .hero-glass--main strong {
    font-size: 34px;
  }

  .hero-glass--alert,
  .hero-glass--draft {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    margin: 14px;
  }

  .actions {
    align-items: stretch;
  }

  .topbar {
    justify-content: flex-start;
  }

  .page-intro {
    padding: 18px;
  }

  .page-intro-dismiss {
    justify-self: start;
  }

  .primary-button {
    flex: 1;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .feature-band,
  .dashboard-grid,
  .pricing-grid,
  .proof-grid,
  .trust-principles,
  .recovery-metrics,
  .report-summary,
  .report-section-grid,
  .suite-grid,
  .flow-lane,
  .permission-grid,
  .addon-grid,
  .ai-guardrail-grid,
  .sync-model-grid,
  .org-branch.two-col,
  .quick-add-split,
  .lead-intake-layout,
  .crm-pipeline-board,
  .suspect-grid,
  .account-directory,
  .task-board,
  .relationship-card-grid,
  .suggestion-list,
  .conversion-rules,
  .suspect-toolbar,
  .timeline-filters,
  .timeline-board,
  .crm-kanban {
    grid-template-columns: 1fr;
  }

  .rescue-queue,
  .relationship-map,
  .relationship-command,
  .relationship-two-col,
  .client-loop-hero,
  .relationship-context-grid,
  .internal-review-strip,
  .referral-metrics,
  .coi-formula,
  .how-steps,
  .compliance-grid,
  .outcome-grid,
  .checkout-steps,
  .today-command-list article,
  .loop-action-list article {
    grid-template-columns: 1fr;
  }

  .product-page-header img {
    width: min(280px, 100%);
  }

  .section-heading,
  .opportunity-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .opportunity-value {
    white-space: normal;
  }

  .table-row,
  .deal-row,
  .history-row,
  .crm-row,
  .settings-row,
  .inbox-admin-form,
  .access-map article,
  .role-map article,
  .flagged-email-card,
  .email-modal__body {
    grid-template-columns: 1fr;
  }

  .email-score {
    text-align: left;
  }

  .email-row-actions {
    justify-content: start;
  }

  .loop-action-list article button {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .relationship-card--featured {
    min-height: auto;
  }

  .relationship-card__head {
    display: grid;
  }

  .relationship-card__head h2 {
    font-size: 34px;
  }

  .inbox-filter {
    justify-content: start;
  }

  .sort-control {
    align-items: stretch;
    flex-direction: column;
  }

  .email-modal {
    padding: 10px;
  }

  .email-modal__panel {
    max-height: calc(100vh - 20px);
  }

  .email-modal__header,
  .email-modal__footer,
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .formula-strip {
    gap: 4px;
  }

  .formula-strip span,
  .formula-strip strong,
  .formula-strip b {
    min-height: 34px;
    padding: 0 5px;
    font-size: 9px;
  }

  .hero-product,
  .hero-product img {
    min-height: 420px;
  }

  .overlay-side {
    position: static;
    top: auto;
    right: auto;
    margin: 14px;
  }
}

/* Complete dark-surface contract for legacy detail views and canonical pages. */
body.theme-dark :is(
  .report-summary article,
  .flagged-panel,
  .flagged-email-card,
  .detail-panel,
  .email-modal__panel,
  .email-original,
  .email-composer,
  .email-composer input,
  .email-composer select,
  .email-composer textarea,
  .sort-control select,
  .workspace-switcher select,
  .segmented,
  .secondary-link,
  .secondary-button,
  .canonical-panel,
  .canonical-empty,
  .command-strip,
  .view-tabs,
  .connect-provider,
  .canonical-board > article,
  .report-catalog article,
  .automation-guardrails label,
  .rule-sentence,
  .chart-empty,
  .product-switcher__trigger,
  .product-switcher__menu,
  .product-switcher__option,
  .workspace-card,
  .theme-toggle,
  .crm-subnav,
  .crm-search-panel,
  .crm-search-empty,
  .crm-card,
  .crm-stage-card,
  .quick-add-form,
  .quick-add-preview,
  .lead-intake-form,
  .lead-preview-card,
  .duplicate-panel,
  .suspect-grid article,
  .account-directory article,
  .relationship-board,
  .relationship-card,
  .relationship-side,
  .timeline-card,
  .timeline-item button,
  .outcome-panel
) {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

body.theme-dark :is(
  .email-original p,
  .detail-body p,
  .canonical-empty p,
  .canonical-panel > p,
  .report-summary span,
  .report-summary small,
  .flagged-email-card span,
  .flagged-email-card small,
  .timeline-item p,
  .relationship-card p
) {
  color: var(--muted);
}

body.theme-dark :is(
  .email-original h3,
  .flagged-email-card strong,
  .report-summary strong,
  .canonical-panel h2,
  .canonical-empty strong,
  .timeline-item strong
) {
  color: var(--ink);
}

body.theme-dark :is(.canonical-empty, .rule-sentence, .chart-empty, .stage-empty) {
  background: var(--soft);
  box-shadow: none;
}

body.theme-dark .product-switcher__option:hover,
body.theme-dark .product-switcher__option.active,
body.theme-dark .view-tabs button:hover,
body.theme-dark .view-tabs button.active {
  background: var(--product-accent-soft);
  color: var(--ink);
}

@media (max-width: 1180px) {
  .canonical-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 820px) {
  .compact-page-header h1 {
    font-size: 23px;
  }

  .command-strip,
  .canonical-split,
  .canonical-master-detail,
  .insight-grid,
  .inbox-connect-grid,
  .access-form {
    grid-template-columns: 1fr;
  }

  .automation-guardrails {
    grid-template-columns: 1fr;
  }

  .rule-sentence {
    align-items: stretch;
  }

  .rule-sentence select,
  .rule-sentence input {
    width: 100%;
  }

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

@media (max-width: 620px) {
  .canonical-metrics,
  .product-suite .suite-grid,
  .report-catalog,
  .plan-capabilities {
    grid-template-columns: 1fr;
  }

  .canonical-page {
    min-width: 0;
  }

  .compact-page-header {
    padding: 14px;
  }

  .compact-page-header h1 {
    font-size: 21px;
  }

  .canonical-empty {
    min-height: 180px;
    padding: 17px;
  }

  .report-funnel {
    grid-template-columns: 1fr;
  }
}
