:root {
  --pad: 16px;
  --radius: 14px;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --text: #030912;
  --muted: #475569;
  --border: #d7dde9;
  --brand: #0ea5e9;
  --brand-contrast: #ffffff;
  --bg-app: var(--bg);
  --page-bg: var(--bg);
  --bg-panel: var(--panel);
  --bg-panel-border: var(--border);
  --surface: var(--panel);
  --surface-muted: var(--panel-2);
  --surface-alt: #eef2fb;
  --flat-surface: #f7f9fc;
  --band-bg: #f1f5f9;
  --band-border: var(--border);
  --trust-strip-bg: #ffffff;
  --trust-strip-border: var(--border);
  --chip-bg: #e2e8f0;
  --chip-border: #d1d5db;
  --icon-circle-bg: #0f172a;
  --icon-circle-text: #ffffff;
  --text-on-light: #0f172a;
  --demo-bubble-text: #030912;
  --shadow: rgba(5, 13, 32, 0.15);
  --topbar-h: 64px;
  --mobile-nav-h: 72px;
  --nav-height: var(--topbar-h);
  --code-bg: rgba(10, 11, 66, 0.08);
  --code-text: rgba(5, 13, 32, 0.95);
  --text-secondary: #64748b;
  --text-helper: var(--muted);
  --primary: var(--brand);
  --primary-strong: #0b79c1;
  --danger: #ef4444;
  --danger-strong: #dc2626;
  --success: #15803d;
  --success-soft: #dcfce7;
  --info: #dbeafe;
  --info-strong: #0369a1;
  --warning: #fde68a;
  --warning-strong: #d97706;
  --menu-backdrop: rgba(15, 23, 42, 0.6);
  --menu-sheet-shadow: 0 -16px 40px rgba(15, 23, 42, 0.35);
  --status-ok: #dbf6fd;
  --status-ok-border: #7dd3fc;
  --status-warn: #fef9c3;
  --status-warn-border: #f59e0b;
  --status-error: #fee2e2;
  --status-error-border: #f87171;
  --status-muted: #f0f4ff;
  --status-muted-border: #c7d2fe;
  }

.last-action-failure-banner {
  padding: 12px 16px;
  background: var(--status-error);
  border: 1px solid var(--status-error-border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}
.last-action-failure-banner.is-visible {
  display: block;
}

.csrf-missing-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 12px 16px;
  background: var(--status-error);
  border: 1px solid var(--status-error-border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  box-shadow: 0 4px 18px rgba(5, 13, 32, 0.35);
}
.csrf-missing-banner button {
  border: none;
  background: var(--text);
  color: var(--panel);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.system-issues-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 12px 16px;
  background: var(--status-error);
  border: 1px solid var(--status-error-border);
  border-radius: 12px;
  color: var(--text);
  margin-bottom: 16px;
}
.system-issues-banner ul {
  margin: 8px 0 0;
  padding-left: 1.25rem;
}
.system-issues-banner li {
  list-style: disc;
  margin-bottom: 4px;
}
.system-issues-link {
  align-self: center;
  background: var(--text);
  color: var(--panel);
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.readiness-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.readiness-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.readiness-line.ok {
  border-color: rgba(16, 185, 129, 0.35);
}
.readiness-line.warn {
  border-color: rgba(245, 158, 11, 0.45);
}
.readiness-line.error {
  border-color: rgba(239, 68, 68, 0.45);
}
.readiness-label {
  font-weight: 600;
}
.readiness-value {
  font-weight: 700;
}
.readiness-dot {
  color: var(--muted);
}
.readiness-health {
  color: var(--text);
  text-transform: lowercase;
  text-decoration: none;
}
.readiness-health.neutral {
  color: var(--muted);
}
.readiness-health.warn {
  color: var(--warning-strong);
  font-weight: 600;
}
.readiness-health:hover,
.readiness-health:focus-visible {
  text-decoration: underline;
}
.readiness-inbound.ok {
  color: var(--success);
}
.readiness-inbound.info {
  color: var(--muted);
}
.readiness-inbound.warn {
  color: var(--warning);
}
.readiness-inbound.error {
  color: var(--danger);
}
.readiness-strip .btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

.component-health-panel {
  border: 1px solid var(--border);
}
.component-health-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.component-health-tile {
  --component-tile-text: #0f172a;
  --component-tile-muted: #334155;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface);
  color: var(--component-tile-text);
}
.component-health-tile.tone-ok {
  border-color: var(--status-ok-border);
  background: var(--status-ok);
}
.component-health-tile.tone-warn {
  border-color: var(--status-warn-border);
  background: var(--status-warn);
}
.component-health-tile.tone-error {
  border-color: var(--status-error-border);
  background: var(--status-error);
}
.component-health-tile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.component-health-tile .muted {
  color: var(--component-tile-muted);
}
.component-health-tile .pill {
  color: var(--component-tile-text);
}
.component-health-tile .btn-sm {
  margin-top: 6px;
}
@media (max-width: 1100px) {
  .component-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .component-health-grid {
    grid-template-columns: 1fr;
  }
}

.setup-wizard-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--surface);
}
.setup-checklist {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
}
.setup-checklist-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
}
.setup-checklist-summary::-webkit-details-marker {
  display: none;
}
.setup-checklist-summary p {
  margin: 0;
}
.setup-checklist .setup-wizard-panel {
  margin: 0;
  border: 0;
  border-top: 1px dashed var(--border);
  border-radius: 0 0 14px 14px;
  background: transparent;
}
.setup-wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 12px;
}
.setup-wizard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.setup-wizard-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.setup-wizard-step-index {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.setup-wizard-step.is-done .setup-wizard-step-index {
  background: var(--status-ok);
  color: #047857;
  border: 1px solid var(--status-ok-border);
}
.setup-wizard-step.is-done strong {
  color: #0f766e;
}
.setup-wizard-step p {
  margin: 2px 0;
}
.setup-wizard-step-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
}
.state-pill {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: var(--status-muted);
  color: var(--text);
}
.state-pill-none {
  border-color: var(--status-error-border);
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}
.state-pill-connected {
  border-color: var(--status-warn-border);
  background: rgba(251, 191, 36, 0.15);
  color: #92400e;
}
.state-pill-verified {
  border-color: rgba(249, 115, 22, 0.6);
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}
.state-pill-messaging_enabled {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.lead-clarity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.clarity-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.clarity-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 0.5rem;
}
.clarity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.clarity-list li strong {
  display: block;
  font-size: 0.95rem;
}
.clarity-card p {
  margin: 0;
}
.clarity-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clarity-action-alt {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 10px;
  font-size: 0.85rem;
}
.clarity-confidence {
  font-weight: 600;
  color: #0f766e;
}
.clarity-missing {
  color: #c2410c;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.lead-more-actions.is-pending {
  opacity: 0.7;
}

.lead-outbound-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.lead-outbound-status .status-icon {
  font-size: 1.1rem;
}
.lead-outbound-status--delivered {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}
.lead-outbound-status--failed {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.08);
}
.lead-outbound-status--pending {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}
.more-actions-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: moreActionsSpin 0.6s linear infinite;
}

@keyframes moreActionsSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

* {
  box-sizing: border-box;
}

img, table {
  max-width: 100%;
}

:root[data-theme='dark'] {
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.85);
  --panel-2: rgba(15, 23, 42, 0.7);
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.35);
  --brand-contrast: #020617;
  --bg-app: var(--bg);
  --page-bg: var(--bg);
  --bg-panel: var(--panel);
  --bg-panel-border: var(--border);
  --surface: var(--panel);
  --surface-muted: var(--panel-2);
  --surface-alt: rgba(2, 6, 23, 0.95);
  --flat-surface: rgba(2, 6, 23, 0.55);
  --band-bg: rgba(10, 15, 26, 0.85);
  --band-border: var(--border);
  --trust-strip-bg: rgba(15, 23, 42, 0.7);
  --trust-strip-border: var(--border);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --chip-border: var(--border);
  --icon-circle-bg: rgba(148, 163, 184, 0.12);
  --text-on-light: #cbd5e1;
  --demo-bubble-text: #0f172a;
  --shadow: rgba(0, 0, 0, 0.6);
  --text-secondary: #cbd5e1;
  --text-helper: var(--muted);
  --primary: var(--brand);
  --primary-strong: #7dd3fc;
  --info: #0ea5e9;
  --info-strong: #7dd3fc;
  --warning: #fde68a;
  --warning-strong: #f97316;
  --menu-backdrop: rgba(0, 0, 0, 0.7);
  --menu-sheet-shadow: 0 -16px 40px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Inter", Segoe UI, sans-serif; color: var(--text); background: var(--page-bg); }
a { color: inherit; text-decoration: none; }

:target,
[id] {
  scroll-margin-top: var(--topbar-h, 64px);
}
.topbar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  padding: 12px var(--pad);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  z-index: 10;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}
.topbar-owner {
  background: color-mix(in srgb, var(--surface) 88%, #f5f9ff 12%);
}
.nav-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-left:6px;
  border-radius:999px;
  padding:2px 8px;
  background:var(--surface-muted);
  color:var(--text);
  font-size:11px;
  font-weight:700;
}
.nav-badge-error {
  background: var(--status-error);
  border: 1px solid var(--status-error-border);
  color: #7f1d1d;
}
.nav-badge-warn {
  background: var(--status-warn);
  border: 1px solid var(--status-warn-border);
  color: #92400e;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.brand-main {
  font-size: 18px;
}
.brand-account {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-health-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-left: 8px;
  border: 1px solid transparent;
  vertical-align: middle;
}
.nav-health-dot.ok {
  background: #10b981;
  border-color: #059669;
}
.nav-health-dot.warn {
  background: #ef4444;
  border-color: #dc2626;
}
.nav-desktop { display: none; gap: 12px; align-items: center; }
.nav-desktop a {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.nav-desktop a:hover,
.nav-desktop a:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border) 72%);
  background: var(--surface-alt);
  color: var(--text);
  outline: none;
  transform: translateY(-1px);
}
.nav-desktop a.active {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border) 65%);
  background: color-mix(in srgb, var(--surface-alt) 78%, #eef7ff 22%);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}
.auth-block { display:flex; align-items:center; gap:8px; justify-self: end; }
.auth-email { font-size: 13px; color: var(--muted); }
.auth-link { text-decoration: none; font-weight: 800; color: var(--primary); display: inline-block; padding: 4px 0; }
.quick-actions-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px var(--pad) 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.quick-action-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.quick-action-link:hover,
.quick-action-link:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}
.hamburger {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 0;
  font-size: 18px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  color: var(--text);
}
.hamburger:hover,
.hamburger:focus-visible {
  background: var(--surface-muted);
  outline: none;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}
button.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
button.theme-toggle:hover,
button.theme-toggle:focus-visible {
  background: var(--surface-muted);
  border-color: var(--primary);
  outline: none;
}
button.theme-toggle [data-theme-toggle-icon] {
  font-size: 1rem;
  line-height: 1;
}

.container { width: 100%; max-width: 1140px; padding: var(--pad); padding-bottom: 72px; margin: 0 auto; }
main > header { margin-bottom: 10px; }
main > header h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.2px; }
main > header h2 { margin: 0 0 6px; font-size: 22px; }
main > header p.muted { margin: 0; font-size: 14px; }

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: var(--menu-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12;
  backdrop-filter: blur(12px);
}
.menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.menu-sheet {
  position: fixed;
  bottom: var(--mobile-nav-h);
  left: 0;
  right: 0;
  padding: 18px var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: var(--menu-sheet-shadow);
  backdrop-filter: blur(24px);
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 15;
}
.menu-sheet.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.menu-sheet a {
  display: block;
  padding: 14px 0;
  font-weight: 700;
  color: var(--text);
  min-height: 44px;
  line-height: 1.4;
}
.menu-sheet a:hover {
  background: var(--surface-muted);
}
.menu-sheet-more {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
body.menu-open {
  overflow: hidden;
  position: relative;
}
@media (max-width: 768px) {
  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px var(--pad) 8px;
  }
  .nav-desktop {
    display: none;
  }
  .auth-block {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }
  .hamburger {
    justify-self: flex-end;
    width: 100%;
    text-align: right;
  }
  .lead-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .lead-more-actions {
    width: 100%;
  }
  .lead-more-actions > summary {
    width: 100%;
    justify-content: space-between;
  }
  .topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .topbar-actions a,
  .topbar-actions button {
    font-size: 14px;
  }
  .brand-account {
    max-width: 100%;
  }
  .quick-actions-strip {
    gap: 6px;
    padding: 8px var(--pad) 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .quick-action-link {
    white-space: nowrap;
  }
  .lead-actions-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--mobile-nav-h) + 12px);
    top: auto;
    border-radius: 18px;
    padding: 12px;
    max-height: calc(100svh - var(--mobile-nav-h) - 36px);
    overflow-y: auto;
    display: none;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.25);
  }
  .lead-more-actions[open] .lead-actions-menu {
    display: grid;
  }
  .tabs-mobile a,
  .tabs-mobile-more {
    min-width: 0;
    flex: 1 1 0;
    font-size: 13px;
  }
  .owner-status-hero-actions {
    width: 100%;
  }
}
.menu-sheet-more a.active {
  color: var(--primary);
}
.menu-sheet hr {
  border-color: var(--border);
  margin: 10px 0;
}
.menu-auth {
  display:flex;
  align-items:center;
  gap:10px;
}
.tabs-mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  justify-content: space-around;
  align-items: center;
  flex-wrap: nowrap;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, #f5f9ff 10%);
  z-index: 50;
  padding: 10px 10px 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  min-height: var(--mobile-nav-h);
}
.tabs-mobile a,
.tabs-mobile-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  min-height: var(--mobile-nav-h);
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  border: 1px solid transparent;
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}
.tabs-mobile-more {
  background: var(--surface-muted);
  border-color: transparent;
}
.tabs-mobile a:focus-visible,
.tabs-mobile-more:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.tabs-mobile a.active {
  background: color-mix(in srgb, var(--surface-alt) 76%, #eef7ff 24%);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.18);
}
.tabs-mobile a:hover,
.tabs-mobile-more:hover {
  transform: translateY(-1px);
}

:root[data-theme='dark'] .tabs-mobile a.active,
:root[data-theme='dark'] .tabs-mobile-more {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .topbar .top-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  /* Optional: keep the username/email from forcing layout breaks */
  .topbar .auth-email,
  .topbar .org-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}
.card .card {
  box-shadow: none;
  border-color: rgba(15, 23, 42, 0.08);
  background: var(--surface-alt);
}
.card h2 { margin: 0 0 6px; font-size: 20px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.confirm-wrapper {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  padding: 0 16px 32px;
}
.confirm-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 32px;
  text-align: left;
}
.confirm-detail {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}
.confirm-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.confirm-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.confirm-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-weight: 600;
}
.demo-lead { border-style: dashed; background: var(--surface-muted); }
.demo-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.demo-title { font-weight:800; }
.demo-body { margin-top:12px; display:grid; gap:6px; }
.demo-row strong { color: var(--text); }
.demo-grid { margin-top:12px; display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.demo-reply { border:1px solid #e2e8f0; border-radius:12px; padding:10px 12px; background:var(--surface-muted); }
.demo-label { font-size:12px; font-weight:700; color:#64748b; margin-bottom:6px; }
.demo-bubble { background:#e0f2fe; color: var(--demo-bubble-text); border-radius:12px; padding:10px 12px; display:inline-block; }
.demo-kpi { font-size:28px; font-weight:800; color: var(--text); }
.demo-kpi-label { margin-top:6px; color: var(--muted); font-weight:600; }
.demo-lead-section { margin-top:18px; }
.mono-area, .mono-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  overflow-x: auto;
}
.codebox {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: var(--surface-alt);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.15);
  max-width: 100%;
}
.pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 16px;
  border-radius:999px;
  font-weight:700;
  font-size:12px;
  border:1px solid rgba(15, 23, 42, 0.15);
  background: rgba(10, 10, 44, 0.05);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(5, 13, 32, 0.12);
}
.stats-row .pill {
  border-width: 1px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
}
.stats-pill {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stats-pill:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.stats-pill.is-active {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}
.pill--info,
.pill.info {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--text);
  box-shadow: none;
}
.pill--ok,
.pill.ok {
  background: linear-gradient(130deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.3));
  border-color: rgba(16, 185, 129, 0.45);
  color: #064c37;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.2);
}
.pill--error,
.pill.error {
  background: linear-gradient(130deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.2));
  border-color: rgba(239, 68, 68, 0.45);
  color: #7f1d1d;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.14);
}
.pill--warn,
.pill.warn {
  background: linear-gradient(130deg, rgba(251, 191, 36, 0.24), rgba(251, 191, 36, 0.15));
  border-color: rgba(245, 158, 11, 0.6);
  color: #713f12;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.18);
}
.pill.confidence-pill {
  background: linear-gradient(130deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
  border-color: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.18);
}
.confidence-pill.confidence-high {
  background: linear-gradient(130deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.26));
  border-color: rgba(16, 185, 129, 0.45);
  color: #065f46;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.25);
}
.confidence-pill.confidence-medium {
  background: linear-gradient(130deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.28));
  border-color: rgba(251, 191, 36, 0.55);
  color: #92400e;
  box-shadow: 0 10px 24px rgba(251, 191, 36, 0.25);
}
.confidence-pill.confidence-review {
  background: linear-gradient(130deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.28));
  border-color: rgba(245, 158, 11, 0.55);
  color: #92400e;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.2);
}
.pill.block { display:block; width:max-content; margin:10px auto; }
.filter-chips { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 14px; }
.filter-chips .pill { text-decoration:none; }
.muted { color: var(--muted); }
.panel-light {
  background: var(--surface-0);
  color: var(--text-on-light);
}
:root[data-theme='dark'] .panel-light {
  background: var(--surface-1);
  color: var(--text);
}
.text-xs { font-size:12px; }
.text-sm { font-size:13px; }
.text-md { font-size:14px; }
.text-secondary { color: var(--text-secondary); }
.font-strong { font-weight:700; }
.font-stronger { font-weight:800; }
.no-margin { margin:0; }
.ml-8 { margin-left:8px; }
.mt-6 { margin-top:6px; }
.mt-8 { margin-top:8px; }
.mt-10 { margin-top:10px; }
.mt-12 { margin-top:12px; }
.mt-16 { margin-top:16px; }
.mt-18 { margin-top:18px; }
.mb-10 { margin-bottom:10px; }
.mb-12 { margin-bottom:12px; }
.mb-16 { margin-bottom:16px; }
.gap-6 { gap:6px; }
.gap-8 { gap:8px; }
.gap-10 { gap:10px; }
.gap-12 { gap:12px; }
.flex-row { display:flex; align-items:center; }
.flex-col { display:flex; flex-direction:column; }
.flex-wrap { flex-wrap:wrap; }
.justify-end { justify-content:flex-end; }
.justify-between { justify-content:space-between; }
.align-end { align-items:flex-end; }
.inline { display:inline; }
.is-hidden { display:none; }
.full-width { width:100%; }
.minw-160 { min-width:160px; }
.minw-180 { min-width:180px; }
.minw-200 { min-width:200px; }
.minw-240 { min-width:240px; }
.grid-span-3 { grid-column: span 3; }
.grid-span-all { grid-column: 1 / -1; }
.spacer-sm { height:12px; }
.overflow-auto { overflow:auto; }
.overflow-x { overflow-x:auto; }
.error-text { color:#b91c1c; }
.success { color:#15803d; }
.btn, .btn-secondary, .btn-danger {
  background: var(--brand);
  color: var(--brand-contrast);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.2s ease;
}
.btn:hover, .btn-secondary:hover, .btn-danger:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(14, 165, 233, 0.35);
  filter: brightness(1.05);
}
.next-action-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.btn:active,
.btn-secondary:active,
.btn-danger:active,
.next-action-button:active {
  transform: translateY(0px);
  filter: brightness(0.98);
}

.slot-booking-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(2px);
  padding: 1rem;
  z-index: 2000;
}

body.modal-open {
  overflow: hidden;
}

.slot-booking-card {
  background: var(--surface-0);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 30px 55px rgba(15, 23, 42, 0.38);
  position: relative;
}

.slot-booking-card h3 {
  margin: 0;
  margin-bottom: 0.35rem;
  font-size: 1.2rem;
}

.slot-booking-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--text);
}

.slot-booking-subtitle {
  margin: 0 0 0.9rem;
  color: var(--text-secondary);
}

.slot-booking-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 0.25rem;
}

.slot-booking-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: var(--surface);
}

.slot-booking-option:hover {
  border-color: var(--brand);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
  background: var(--surface-0);
}

.slot-booking-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(14, 165, 233, 0.08);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

.slot-booking-option input {
  margin-top: 0.15rem;
}

.slot-booking-option-copy strong {
  display: block;
  font-size: 1rem;
}

.slot-booking-option-meta {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-secondary);
}

.slot-booking-notes {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-0);
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 0.75rem;
}

.slot-booking-notes:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}

.slot-booking-label {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  display: inline-block;
}

.slot-booking-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.slot-booking-cancel {
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--border);
}

.slot-booking-status {
  min-height: 1rem;
  margin-top: 0.65rem;
  color: var(--text-secondary);
}

.slot-booking-modal.is-hidden {
  display: none;
}
.btn:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.next-action-button:focus-visible,
.lead-more-summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}
.btn:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
button:disabled {
  opacity: 0.6;
  filter: saturate(0.9);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-secondary {
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.08));
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-shadow: 0 10px 20px rgba(5, 13, 32, 0.15);
}
.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--primary);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger-strong); }
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px var(--shadow);
}
.section h3 { margin: 0 0 10px; font-size: 18px; }
.section h3 + .muted { margin-top: -6px; margin-bottom: 8px; }
.numbers-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:16px;
}
.numbers-tabs {
  display: inline-flex;
  gap: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
.numbers-tab {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}
.numbers-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}
.numbers-tab-panels {
  display: block;
}
.numbers-tab-panel {
  display: none;
}
.numbers-tab-panel.is-active {
  display: block;
}
.numbers-simple-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.numbers-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.numbers-simple-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.numbers-header-actions {
  display:flex;
  align-items:center;
  gap:8px;
}
.numbers-setup {
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
  box-shadow:0 12px 32px rgba(15,23,42,0.15);
  margin-bottom:16px;
  padding:0;
}
.numbers-setup summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px;
  cursor:pointer;
  font-weight:600;
  border-bottom:1px solid var(--border);
}
.numbers-setup summary::marker,
.numbers-setup summary::-webkit-details-marker {
  display:none;
}
.numbers-setup-summary-actions {
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.numbers-setup-summary > div:first-child {
  flex:1;
  min-width:0;
}
.numbers-setup-inner {
  padding:16px;
  background:var(--surface);
  border-radius:0 0 16px 16px;
}
.numbers-setup-edit {
  border:none;
  background:none;
  color:var(--primary);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  padding:0;
}
.numbers-setup-edit:hover,
.numbers-setup-edit:focus-visible {
  text-decoration:underline;
}
.forwarding-simple {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.forwarding-code-single {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-muted);
}
.forwarding-code-single-label {
  margin-bottom: 6px;
}
.forwarding-all-codes {
  margin-top: 6px;
}
.forwarding-all-codes summary {
  cursor: pointer;
  list-style: none;
  color: var(--link);
}
.forwarding-all-codes-toggle {
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.forwarding-all-codes summary::-webkit-details-marker {
  display: none;
}
.forwarding-all-codes-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.numbers-readiness-details {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
}
.numbers-readiness-details summary {
  cursor: pointer;
  list-style: none;
  color: var(--link);
}
.numbers-readiness-details summary::-webkit-details-marker {
  display: none;
}
.diagnostics-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.diagnostics-raw summary {
  cursor: pointer;
  list-style: none;
  color: var(--link);
}
.diagnostics-raw summary::-webkit-details-marker {
  display: none;
}
.diagnostics-raw-output {
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  max-height: 240px;
  overflow: auto;
}
.diagnostics-debug-console {
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px;
  max-height: 200px;
  overflow: auto;
}
.today-hero {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.09), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #f8fbff 8%), var(--surface));
  border: 1px solid color-mix(in srgb, var(--border) 86%, #dbeafe 14%);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}
.today-hero h1 {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: -0.03em;
}
.today-hero-copy {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}
.today-eyebrow,
.today-card-kicker,
.settings-kicker,
.owner-callback-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.14);
  color: #0f4c82;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.today-inline-card {
  border-radius: 14px;
}
.today-callback-card,
.today-scheduled-card,
.settings-business-line-card,
.owner-voicemail-card {
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.today-callback-card-head,
.owner-callback-card-title-block {
  display: grid;
  gap: 6px;
}
.today-primary-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
}
.proof-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}
.proof-item {
  flex: 1;
  min-width: 160px;
}
.proof-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.proof-item strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.proof-helper {
  font-size: 12px;
  color: var(--muted);
}
.proof-link {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}
.proof-link a {
  color: var(--brand);
  font-weight: 700;
}
.proof-link a:hover {
  text-decoration: underline;
}
.proof-strip .muted {
  color: var(--muted);
}
.proof-strip .proof-link span {
  font-size: 12px;
}
.recent-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 18px 0;
  box-shadow: 0 6px 18px rgba(5, 13, 32, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.recent-strip-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}
.recent-strip strong {
  font-size: 18px;
}
.recent-strip-note {
  font-size: 12px;
  color: var(--muted);
}
.calm-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-alt);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.calm-card p {
  margin: 0;
  font-size: 15px;
}
.scheduling-callout-wrapper {
  margin-top: 12px;
}
.scheduling-callout {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.scheduling-state {
  font-size: 14px;
  color: var(--text);
}
.scheduling-state-prompt strong {
  font-size: 15px;
}
.scheduling-auto {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.scheduling-auto-ack {
  color: var(--text-secondary);
}
.scheduling-pricing-note {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px 16px;
  margin: 10px 0;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.scheduling-pricing-note a {
  color: var(--brand);
  font-weight: 700;
}
.scheduling-pill {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.45);
  color: #075985;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 3px 10px;
  border-radius: 999px;
}
.scheduling-cta-primary {
  min-width: 190px;
  text-align: center;
}
.scheduling-auto-option {
  min-width: 150px;
}
@media (max-width: 720px) {
  .proof-strip {
    flex-direction: column;
  }
  .proof-link {
    margin-left: 0;
    text-align: left;
    align-items: flex-start;
  }
  .recent-strip {
    flex-direction: column;
  }
  .today-hero {
    padding: 20px;
  }
  .today-hero h1 {
    font-size: 30px;
  }
}
.today-jobs {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  background: var(--surface);
  box-shadow: 0 6px 18px var(--shadow);
}
.today-jobs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.today-job {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
}
.today-job-time {
  font-weight: 700;
  min-width: 90px;
}
.row { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:12px; }
label { display:block; font-weight:600; margin-bottom:6px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--flat-surface);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border) 45%);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
  background: var(--surface);
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  accent-color: var(--primary);
  flex: 0 0 auto;
}
:root[data-theme='dark'] input,
:root[data-theme='dark'] textarea,
:root[data-theme='dark'] select {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}
:root[data-theme='dark'] input::placeholder,
:root[data-theme='dark'] textarea::placeholder {
  color: var(--muted);
}
:root[data-theme='dark'] .card,
:root[data-theme='dark'] .panel {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

:root[data-theme='dark'] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

:root[data-theme='dark'] .pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e9eef8;
}

:root[data-theme='dark'] .pill--warn,
:root[data-theme='dark'] .pill.warn { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.35); }
:root[data-theme='dark'] .pill--error,
:root[data-theme='dark'] .pill.error { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.35); }
:root[data-theme='dark'] .pill--ok,
:root[data-theme='dark'] .pill.ok { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.35); }

table { width:100%; border-collapse:collapse; background:var(--surface); border:1px solid #e2e8f0; border-radius:10px; overflow:hidden; box-shadow:0 6px 18px var(--shadow); }
th, td { padding:12px; border-bottom:1px solid #e2e8f0; text-align:left; font-size:14px; }
th { background:var(--surface-alt); }
.tech-cards { display:none; gap:12px; grid-template-columns: 1fr; }
.numbers-grid { display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.number-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 6px 16px var(--shadow);
}
.number-card h3 { margin:0 0 6px; }
.actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.checklist { list-style:none; padding:0; margin:0; display:grid; gap:6px; }
.checklist li { display:flex; align-items:center; gap:8px; }
.checklist-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:10px; }
.checklist-item {
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-muted);
  color: var(--text);
  min-height: 44px;
}
.checklist-item input[type="checkbox"] {
  margin: 0;
}
.checklist-item input[type="checkbox"][disabled] {
  opacity: 0.7;
}
.badge { display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px; background:#e2e8f0; color:var(--text); font-size:12px; font-weight:700; }
.badge--neutral,
.badge.neutral { background:#e2e8f0; color:var(--text); }
.badge--info,
.badge.info { background:#e2e8f0; color:var(--text); }
.badge--ok,
.badge.success { background:var(--success-soft); color:var(--success); }
.badge--warn,
.badge.warning { background:var(--warning); color:var(--warning-strong); }
.badge--error,
.badge.error { background:var(--status-error); color:#7f1d1d; }
.alert-pill { background:var(--status-warn); color:var(--warning-strong); border:1px solid var(--status-warn-border); display:inline-block; padding:6px 10px; border-radius:999px; }
.alert-pill.error { background:var(--status-error); color:var(--danger); border-color:var(--status-error-border); }
.status-pill {
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}
.status-pill.ok {
  background: var(--status-ok);
  border-color: var(--status-ok-border);
  color: #0f172a;
}
.status-pill.warn {
  background: var(--status-warn);
  border-color: var(--status-warn-border);
  color: #92400e;
}
.status-pill.error {
  background: var(--status-error);
  border-color: var(--status-error-border);
  color: #b91c1c;
}
.status-pill.muted {
  background: var(--status-muted);
  border-color: var(--status-muted-border);
  color: #1e1b4b;
}
.info-callout {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 6px 18px rgba(5, 13, 32, 0.08);
}
.number-title { font-weight:800; font-size:18px; }
.helper-card {
  margin-top:10px;
  padding:12px;
  border:1px dashed #cbd5e1;
  border-radius:10px;
  background:var(--surface-muted);
}
.owner-status-hero {
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 36%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #f7fcfb 8%), var(--surface));
}
.status-owner-kicker,
.owner-empty-state-kicker,
.owner-leads-header-kicker,
.owner-customer-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.16);
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.owner-status-hero-actions {
  min-width: 180px;
}
.owner-status-health-card {
  border-radius: 16px;
}
.owner-status-section-head {
  display: grid;
  gap: 6px;
}
.owner-status-capability-list {
  display: grid;
  gap: 10px;
}
.owner-status-capability-row {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 90%, white 10%);
  background: var(--surface-alt);
}
.owner-status-capability-detail {
  line-height: 1.5;
}
.settings-notifications-section {
  display: grid;
  gap: 6px;
}
.settings-notifications-card {
  border-radius: 16px;
}
.settings-notifications-actions {
  align-items: center;
}
.owner-empty-state-card {
  border-radius: 14px;
  display: grid;
  gap: 8px;
}
.owner-leads-header {
  display: grid;
  gap: 6px;
}
.owner-queue-card {
  border-radius: 16px;
}
.lead-summary-detail {
  line-height: 1.5;
}
.lead-summary-priority-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lead-summary-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.today-scheduled-list {
  display: grid;
  gap: 10px;
}
.today-scheduled-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid color-mix(in srgb, var(--border) 90%, white 10%);
}
.today-scheduled-item a {
  display: grid;
  gap: 3px;
}
.today-scheduled-item-main {
  font-weight: 700;
  color: var(--text);
}
.today-scheduled-item-meta {
  line-height: 1.5;
}
.settings-business-line-intro {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.settings-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.settings-form-grid {
  row-gap: 16px;
}
.settings-message-block textarea {
  min-height: 120px;
}
.settings-help {
  line-height: 1.5;
}
.owner-callback-card-head {
  align-items: flex-start;
}
.owner-callback-actions {
  padding-top: 4px;
}
.owner-callback-details > summary {
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-alt);
}
.owner-callback-details[open] > summary {
  margin-bottom: 8px;
}
.owner-voicemail-title {
  margin-bottom: 2px;
}
.owner-voicemail-transcript {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(148, 163, 184, 0.26);
  line-height: 1.55;
}
.quick-setup summary {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.quick-setup summary::marker,
.quick-setup summary::-webkit-details-marker {
  display: none;
}
.quick-setup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.warning-note {
  color: var(--warning-strong);
  font-weight: 600;
}
.sticky-summary {
  position: relative;
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:12px;
}
.sticky-next-action {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  z-index: 6;
}
.sticky-next-action-card {
  position: static;
}
.next-action-sticky-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.next-action-sticky-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@media (min-width: 960px) {
  .lead-next-action-sticky-wrap {
    position: sticky;
    top: calc(var(--topbar-h) + 12px);
    z-index: 5;
    align-self: start;
  }
  .sticky-next-action-card {
    position: static;
  }
  .next-action-sticky-header {
    top: 0;
  }
}
.next-action-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
}
.next-action-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.sticky-summary .card,
.sticky-summary .helper-card {
  box-shadow:0 10px 20px rgba(15,23,42,0.2);
}
.status-pill.clickable {
  cursor:pointer;
}
.kpi-strip {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap:10px;
}
.mobile-action-card {
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.25);
  background: var(--surface);
}
.lead-summary-name {
  max-width: 55vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}
.inbox-row.needs-attention {
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.3);
  border-left: 3px solid rgba(14, 165, 233, 0.7);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.inbox-row.needs-attention:hover {
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.5), 0 10px 20px rgba(14, 165, 233, 0.15);
}
.kpi-card {
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background:var(--surface-alt);
  text-align:center;
}
.next-action-badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(14, 165, 233, 0.25);
  border: 1px solid rgba(14, 165, 233, 0.5);
  color: #0f4c82;
  margin-left: auto;
}
.status-pill-action {
  font-size: 11px;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 999px;
  border-width: 1px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kpi-value {
  font-size:20px;
  font-weight:700;
  color:var(--text);
  display:block;
}
.field-stack { display:grid; gap:8px; }
.toggle-item {
  display:flex;
  align-items:flex-start;
  gap:8px;
  line-height: 1.25;
}
.toggle-item input[type="checkbox"],
.toggle-item input[type="radio"] {
  margin-top: 2px;
}
.toggle-list { display:grid; gap:8px; }
.danger-card { border:1px solid #fecaca; background:#fff5f5; }
.auth-block { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.settings-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.settings-section > summary { list-style:none; }
.settings-section > summary::-webkit-details-marker { display:none; }
.settings-section > summary { display:flex; align-items:center; gap:8px; }
.inline-edit > summary { list-style:none; cursor:pointer; }
.inline-edit > summary::-webkit-details-marker { display:none; }
.settings-section[open] > summary { margin-bottom:10px; }
.settings-section > summary::before {
  content:"+";
  font-weight:800;
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #e2e8f0;
  border-radius:6px;
  background:#fff;
}
.settings-section[open] > summary::before { content:"−"; }
.summary-meta { color:#64748b; font-size:12px; margin-left:8px; }
.settings-section[open] .summary-meta { display:none; }
.section#advanced-settings > summary {
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: flex-start;
}
.section-actions { margin-top:10px; display:flex; justify-content:flex-end; }
.external-auth {
  display:flex;
  gap:8px;
  flex-direction:column;
  text-align:center;
}
.external-auth__label {
  font-size:12px;
  font-weight:600;
  color: var(--muted);
  letter-spacing:0.4px;
  text-transform:uppercase;
}
.btn.google {
  justify-content:center;
  border-color: transparent;
  background: var(--surface);
  color: var(--text);
  border-radius:12px;
  border:1px solid var(--border);
}
.btn.google:hover {
  background: var(--surface-muted);
}
.google-icon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  font-weight:700;
  color:#ea4335;
}
.hero {
  background: radial-gradient(circle at 15% 20%, rgba(250, 204, 21, 0.25), transparent 45%),
              radial-gradient(circle at 85% 10%, rgba(16, 185, 129, 0.22), transparent 40%),
              linear-gradient(150deg, #2563eb, #312e81);
  color:#fff;
  padding:64px 18px 76px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.2);
  box-shadow:0 18px 40px rgba(15,23,42,0.35);
}
.hero-builtfor {
  margin:24px 0 12px;
  padding:10px 14px;
  font-size:15px;
  line-height:1.4;
  font-weight:600;
  letter-spacing:0.2px;
  border-radius:14px;
  max-width: 720px;
  border:1px solid rgba(255,255,255,0.5);
  background: rgba(15,23,42,0.82);
  color: rgba(255,255,255,0.95);
  box-shadow: 0 18px 32px rgba(15,23,42,0.55);
}
.hero h1 { margin:0 0 16px; font-size:34px; font-weight:800; }
.hero p { margin:0 0 18px; color:rgba(255,255,255,0.9); line-height:1.5; }
.cta-row { display:flex; gap:12px; flex-wrap:wrap; }
.btn-primary {
  display:inline-flex;
  align-items:center;
  gap:8px;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  color:#fff;
  border-radius:12px;
  padding:12px 16px;
  font-weight:800;
  border:1px solid var(--primary);
  box-shadow:0 12px 30px rgba(14,165,233,0.35);
}
.btn-secondary {
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius:12px;
  padding:12px 16px;
  font-weight:700;
}
.hero .btn-secondary {
  background:rgba(255,255,255,0.14);
  color:#fff;
  border:1px solid rgba(255,255,255,0.4);
}
.hero .btn-secondary:hover { background:rgba(255,255,255,0.2); }
.card.highlight {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.12);
}
.card.flat { box-shadow:none; }
.price-note { font-size:14px; color: var(--muted); }
.cta-block { margin-top:10px; }
.details-toggle { cursor:pointer; font-weight:700; }
.summary-row { cursor:pointer; font-weight:700; color:var(--text); }
.feature-list.tight { margin-top:6px; }
.card-grid { display:grid; gap:14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin:18px 0; }
.pricing-grid { display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pricing-grid.simplified { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.final-pricing {
  max-width: 980px;
  margin: 0 auto 30px;
  padding: 0 4px;
}
.final-pricing .section-head.simple {
  margin-bottom: 16px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.final-pricing .cta-row {
  justify-content:flex-start;
  margin-top:18px;
}
.final-pricing .cta-row .btn-secondary {
  background: var(--surface);
  color: var(--text);
  border:1px solid var(--border);
}

@media (max-width: 900px) {
  .hero {
    padding: 48px 16px 60px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  .lead-summary-window {
    display: none;
  }
  .lead-summary-window-mobile {
    display: inline-flex;
  }
  .final-pricing .pricing-grid {
    grid-template-columns: 1fr;
  }
  .final-pricing .cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-builtfor {
    font-size: 14px;
    padding: 10px 12px;
  }
  .demo-grid {
    grid-template-columns: 1fr;
  }
  .demo-row {
    font-size: 14px;
  }
}
.feature-list.short {
  margin: 12px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.feature-list.short li::before {
  content: "•";
  margin-right: 8px;
  color: var(--primary);
  font-weight: 700;
}
.feature-list { list-style:none; padding:0; margin:10px 0 0; display:grid; gap:6px; }
.feature-list li::before { content:"✔"; color:#16a34a; margin-right:6px; }
/* The app runs in dark theme by default; the band section is intentionally light.
   Override the theme variables inside .band so text/buttons aren’t “dark-theme white”
   on a light background (the main contrast issue you’re seeing on mobile). */
.band {
  --text: #0f172a;
  --muted: #475569;
  --panel: #ffffff;
  --border: rgba(15, 23, 42, 0.14);
  --icon-circle-bg: #0f172a;
  --icon-circle-text: #ffffff;
  background: var(--panel);
  padding: 24px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
}
.band .card {
  box-shadow: none;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.band .card h3,
.band .card h4,
.band .card strong { color: var(--text); }
.band .card p,
.band .subtle,
.band .muted { color: var(--muted); }
.band .pill {
  color: var(--text);
  background: var(--surface-muted);
  border-color: rgba(15, 23, 42, 0.12);
}
.band .btn,
.band .btn-primary {
  color: #ffffff;
}
.band .demo-bubble { color: var(--text); }
.on-light {
  color: #0f172a;
}
.section-title { margin:0 0 8px; }
.text-sm { font-size:13px; }
.landing-hero {
  padding: 40px 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(800px 240px at 0% 0%, rgba(0, 188, 212, 0.18), transparent 58%),
    linear-gradient(160deg, #0f172a, #111827);
  color: #fff;
}
.landing-kicker {
  margin: 0 0 10px;
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.landing-hero h1 {
  margin: 0 0 10px;
  max-width: 18ch;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.landing-subhead {
  margin: 0;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.55;
  font-size: 18px;
}
.landing-section {
  padding: 16px 4px 4px;
}
.landing-grid-3 {
  margin-top: 10px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.landing-card {
  border: 1px solid var(--border);
  box-shadow: none;
}
.landing-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.landing-queue-card {
  border: 1px solid var(--border);
  box-shadow: none;
  max-width: 720px;
}
.landing-queue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.landing-queue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.landing-final-cta {
  border: 1px solid var(--border);
  box-shadow: none;
}
.landing-final-cta .section-title {
  margin-bottom: 8px;
}
@media (max-width: 900px) {
  .landing-hero {
    padding: 28px 16px;
  }
  .landing-hero h1 {
    font-size: 34px;
  }
  .landing-subhead {
    font-size: 16px;
  }
}
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--icon-circle-bg);
  color: var(--icon-circle-text);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.trust-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--trust-strip-border);
  border-radius: 12px;
  background: var(--trust-strip-bg);
  color: var(--text);
}
.trust-label { font-weight:700; color:var(--text); }
.trust-icons { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.trust-icon { display:flex; align-items:center; gap:8px; color:var(--text); font-weight:700; font-size:12px; }
.trust-icon svg { width:22px; height:22px; }
.hero .trust-strip { border-color:rgba(255,255,255,0.3); background:rgba(255,255,255,0.12); }
.hero .trust-label,
.hero .trust-icon { color:#fff; }
.price {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.price-amount { font-size:26px; font-weight:800; }
.price-note { margin-top:4px; font-size:11px; color:#64748b; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; }
.tier {
  background: rgba(15,23,42,.35);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 18px;
}
table.comparison { width:100%; }
.test-mode-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 12px;
}
.test-mode-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.3;
  color: var(--text-primary);
  font-weight: 600;
}
.test-mode-header .subhead {
  margin: 0;
  max-width: 560px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.test-mode-header .eyebrow-label {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.test-mode-page {
  background: rgba(3, 6, 17, 0.9);
  border: 1px solid var(--bg-panel-border);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.85);
}
.test-mode-page .badge {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.45);
  color: #bfdbfe;
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: none;
}
.test-mode-page-results {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.codebox-panel.reply-panel {
  background: var(--bg-primary);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.7);
}
.codebox-panel.detection-panel {
  background: transparent;
  border: none;
  box-shadow: none;
}
.test-mode-page-results .reply-panel-head {
  margin-bottom: 12px;
}
.detection-panel {
  border: 1px dashed #334155;
  border-radius: 18px;
  padding: 20px;
  background: rgba(2, 6, 23, 0.12);
  color: var(--text-secondary);
  opacity: 0.85;
}
.detection-panel .detection-heading {
  color: var(--text-primary);
}
.detection-panel .detection-heading-hint {
  color: var(--text-helper);
}
.detection-panel .detection-label,
.detection-panel .detection-value {
  color: var(--text-secondary);
}
.detection-panel .text-xs {
  color: var(--text-helper);
}
.test-mode-page h2,
.test-mode-page h3 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.section-subtitle {
  color: var(--text-secondary);
}
.test-mode-page .banner { display:flex; align-items:center; gap:8px; padding:10px 12px; border-radius:10px; margin-bottom:16px; }
.test-mode-page .banner.warn { background:#fef9c3; color:#854d0e; }
.test-mode-page .banner.error { background:#fee2e2; color:#991b1b; }
.test-mode-page .banner.info { background:#e0f2fe; color:#075985; }
body.dark .test-mode-page .banner.warn { color:#854d0e; }
body.dark .test-mode-page .banner.error { color:#991b1b; }
body.dark .test-mode-page .banner.info { color:#075985; }
.test-mode-page pre {
  background:#0f172a;
  color:#e2e8f0;
  padding:12px;
  border-radius:8px;
  overflow-x:auto;
  font-size:13px;
}
.test-mode-page .codebox {
  min-height: 120px;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.test-mode-page .codebox-grid {
  display: grid;
  gap: 24px;
}
.test-mode-page .codebox-panel {
  display: flex;
  flex-direction: column;
}
.test-mode-page .codebox-panel h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0.02em;
}
.test-mode-page .container {
  max-width: 900px;
  padding: 24px;
  padding-bottom: 84px;
}
.test-mode-page textarea,
.test-mode-page input {
  margin-bottom:12px;
  font-family: inherit;
}
.test-mode-page .subcard {
  background: var(--surface);
  border:1px dashed var(--border);
  color: var(--text);
}
.test-mode-page .test-panel {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 26px;
  padding: 22px 28px;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.test-mode-page .test-panel input,
.test-mode-page .test-panel textarea {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}
.test-mode-page .message-preview {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(222, 244, 255, 0.9));
  border-radius: 20px;
  padding: 18px;
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #0f172a;
  box-shadow: 0 10px 26px rgba(14, 165, 233, 0.25);
}
.test-mode-page .internal-details {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 20px;
  padding: 18px 22px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: inset 0 0 0 rgba(15, 23, 42, 0.5);
}
.detection-grid {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.detected-box {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 18px;
  padding: 18px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  opacity: 0.9;
  box-shadow: inset 0 0 0 rgba(15, 23, 42, 0.35);
}
.detected-box .detection-grid {
  margin-top: 12px;
  gap: 12px;
}
.detected-box .detection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.detection-heading {
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}
.detection-heading-hint {
  font-size: 0.7rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
}
.detection-json {
  margin-top: 12px;
}
.detection-json summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.detection-json summary::-webkit-details-marker {
  display: none;
}
.detection-json summary::marker {
  content: "";
  display: none;
}
.detection-json .captured-box {
  margin-top: 0;
  font-size: 0.85rem;
  max-height: 180px;
  line-height: 1.5;
  overflow: auto;
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 12px;
  padding: 14px;
  color: var(--text-secondary);
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
.test-mode-page-results {
  margin-top: 32px;
}
.test-output-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.test-output {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reply-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.reply-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.reply-panel-head > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.suggested-reply-label {
  color: var(--text-secondary);
  font-weight: 600;
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}
.reply-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.reply-note.muted {
  color: var(--muted);
  font-size: 0.83rem;
}
.reply-note.reply-note-primary {
  margin-top: 6px;
  font-weight: 600;
  color: var(--text-secondary);
}
.preview-pill {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.preview-pill.ok {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.6);
  color: #064e3b;
}
.suggested-reply-shell {
  position: relative;
}
.reply-panel .reply-box {
  min-height: 140px;
  border-radius: 14px;
  padding: 20px;
  background: rgba(3, 6, 17, 0.7);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 16px;
  line-height: 1.6;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 0 0 rgba(15, 23, 42, 0.35), 0 12px 24px rgba(2, 6, 23, 0.65);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.reply-panel .reply-box.suggested-reply {
  background: rgba(56, 189, 248, 0.06);
  border: 2px solid #38BDF8;
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.85), 0 0 40px rgba(56, 189, 248, 0.35);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-primary);
  border-radius: 14px;
  padding: 22px;
}
.reply-panel .reply-box.muted {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.2);
  color: var(--muted);
  font-weight: 400;
  box-shadow: none;
}
.reply-panel.preview-success .reply-box.suggested-reply {
  animation: pulseGlow 0.3s ease-out;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.45), 0 20px 50px rgba(2, 6, 23, 0.65);
}

@keyframes pulseGlow {
  from {
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
    transform: translateY(4px);
  }
  to {
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.35), 0 30px 60px rgba(2, 6, 23, 0.55);
    transform: translateY(0);
  }
}
.test-output.secondary {
  margin-top: 16px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(3, 6, 17, 0.8);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.7);
}
.test-output.secondary.detected-box {
  background: rgba(3, 6, 17, 0.9);
  color: var(--text-secondary);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  box-shadow: inset 0 0 0 rgba(15, 23, 42, 0.4);
  opacity: 0.9;
  font-size: 0.85rem;
  padding: 18px;
}
.reply-placeholder {
  color: var(--muted);
  font-style: italic;
}
.test-intro {
  margin-bottom: 8px;
  font-weight: 600;
}
.test-footnote {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.detection-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.85;
}
.detection-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.autopilot-bar {
  padding:6px 16px;
  font-size:12px;
  color: var(--muted);
  background: var(--surface);
  border-bottom:1px solid var(--border);
}
.footer {
  padding:16px 0;
  text-align:center;
  color: var(--muted);
  font-size:13px;
}
.table-wrap-scroll {
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.payload-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
  color: var(--text);
}
.payload-summary { font-size:12px; display:flex; gap:10px; flex-wrap:wrap; }
.payload-pre {
  margin:8px 0 0;
  padding:10px;
  background: var(--surface-muted);
  border:1px solid var(--border);
  border-radius:8px;
  font-size:12px;
  overflow:auto;
  max-height:260px;
  color: var(--text);
}
.detail-grid { margin-top:10px; display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); color:var(--text); }
.availability-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(14, 165, 233, 0.12);
  display:flex;
  flex-direction:column;
  gap:16px;
}
.availability-calendar-banner {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  gap:12px;
}
.availability-calendar-banner p {
  margin:0;
  line-height:1.25;
}
.availability-calendar-banner-cta {
  white-space:nowrap;
  flex-shrink:0;
}
.availability-calendar-banner.is-hidden {
  display:none;
}
.availability-panel.is-disabled {
  opacity: 0.65;
}
.availability-panel.is-disabled .availability-tiles,
.availability-panel.is-disabled .availability-message-preview {
  pointer-events: none;
}
.availability-panel.is-disabled .offer-composer-body,
.availability-panel.is-disabled .availability-actions {
  pointer-events: auto;
}
.availability-panel.is-disabled .offer-window-btn,
.availability-panel.is-disabled .offer-count-btn,
.availability-panel.is-disabled .offer-mode-btn,
.availability-panel.is-disabled .availability-book,
.availability-panel.is-disabled .availability-escalate,
.availability-panel.is-disabled .availability-refresh {
  cursor: not-allowed;
}
.offer-composer-disabled {
  border: 1px dashed rgba(243, 244, 246, 0.8);
  padding: 16px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}
.offer-composer-disabled-actions {
  display: flex;
  gap: 8px;
}
.offer-composer-disabled-actions .btn,
.offer-composer-disabled-actions .btn-secondary {
  flex: 1;
}
.offer-step {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
}
.offer-step-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.offer-step-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.offer-step-title {
  font-weight: 600;
}
.offer-step-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}
.offer-step .offer-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.offer-window-btn,
.offer-count-btn,
.offer-mode-btn,
.owner-confidence-btn,
.offer-regenerate-btn,
.offer-action-btn,
.slot-pill {
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 10px;
  background: var(--surface-0);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.1s ease;
}
.offer-window-btn:hover,
.offer-count-btn:hover,
.offer-mode-btn:hover,
.owner-confidence-btn:hover,
.offer-regenerate-btn:hover,
.offer-action-btn:hover,
.slot-pill:hover {
  border-color: rgba(14, 165, 233, 0.6);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.offer-window-btn:active,
.offer-count-btn:active,
.offer-mode-btn:active,
.owner-confidence-btn:active,
.offer-regenerate-btn:active,
.offer-action-btn:active,
.slot-pill:active {
  transform: translateY(1px);
}
.offer-window-btn.is-active,
.offer-count-btn.is-active,
.offer-mode-btn.is-active,
.owner-confidence-btn.is-active,
.offer-action-btn.is-active {
  border-color: var(--primary);
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary-strong);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.16);
}
.offer-action-btn.is-send {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.offer-action-btn.is-send:hover {
  filter: brightness(1.03);
}
.offer-window-btn:focus-visible,
.offer-count-btn:focus-visible,
.offer-mode-btn:focus-visible,
.owner-confidence-btn:focus-visible,
.offer-regenerate-btn:focus-visible,
.offer-action-btn:focus-visible,
.slot-pill:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.offer-selection-summary {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.offer-message-editor {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-0);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  min-height: 86px;
  resize: vertical;
}
.offer-message-editor:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}
.offer-composer-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.offer-composer-heading strong {
  font-size: 14px;
}
.availability-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  font-size:16px;
}
.availability-state {
  font-size:12px;
  color:var(--muted);
}
.availability-body {
  display:flex;
  flex-direction:column;
  gap:16px;
}
.availability-tiles {
  display:flex;
  gap:16px;
  flex-wrap:wrap;
}
.availability-tile {
  flex:1;
  min-width:200px;
  border:1px solid rgba(148, 163, 184, 0.5);
  border-radius:14px;
  background: var(--surface-muted);
  padding:16px 18px;
  display:flex;
  flex-direction:column;
  gap:12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.tile-title {
  font-weight:700;
  font-size:13px;
}
.slot-status {
  min-height:20px;
  color: var(--muted);
  font-size: 13px;
}
.slot-list {
  margin:0;
  padding:0;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.slot-list li {
  font-size:13px;
  color:var(--text);
}
.slot-list li strong {
  display:block;
}
.availability-actions {
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  justify-content:space-between;
}
.availability-actions .btn-secondary {
  flex:1;
  min-width:170px;
  padding:12px 14px;
  justify-content:center;
  border-radius:12px;
  background: var(--surface-alt);
  border:1px solid rgba(148, 163, 184, 0.4);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  font-weight:600;
  text-transform:none;
}
.availability-actions .btn-secondary:hover {
  border-color:var(--primary);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}
.availability-book {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.95) 100%);
}
.availability-book:not(:disabled):hover {
  border-color: rgba(34, 197, 94, 0.55);
}
.availability-escalate:not(:disabled):hover {
  border-color: rgba(59, 130, 246, 0.55);
}
.availability-refresh:not(:disabled):hover {
  border-color: rgba(148, 163, 184, 0.65);
}
.availability-panel .slot-list .slot-pill {
  width: fit-content;
}
.availability-reason {
  font-size: 0.75rem;
  min-height: 1.2em;
  margin-top: 8px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .availability-tiles { flex-direction:column; }
}
.lead-last-action {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lead-last-action-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lead-last-action-reason {
  font-size: 0.75rem;
  line-height: 1.3;
}
.lead-last-action-link {
  padding: 0;
  border: none;
  background: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease;
}
.lead-last-action-link:hover,
.lead-last-action-link:focus-visible {
  color: var(--primary-strong);
}
.lead-last-action .last-action-pill {
  font-size:11px;
  padding:3px 10px;
  border-radius:999px;
}
.lead-last-action .last-action-pill.ok {
  background:#ecfdf3;
  color:#166534;
}
.lead-last-action .last-action-pill.error {
  background:#fee2e2;
  color:#9b1c1c;
}
.retry-last-send {
  font-size: 0.75rem;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.retry-last-send:hover,
.retry-last-send:focus-visible {
  color: var(--primary-strong);
  text-decoration: underline;
}
.lead-history {
  margin-top:8px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.lead-history-entry {
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  background:var(--surface);
}
.lead-history-entry-top {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.lead-history-label {
  font-size:12px;
  font-weight:600;
  color:var(--text-secondary);
}
.lead-history-status {
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  text-transform:none;
}
.lead-history-status.status-failed {
  background:#fee2e2;
  color:#b91c1c;
}
.lead-history-status.status-sent {
  background:#dcfce7;
  color:#166534;
}
.lead-history-status.status-received {
  background:#e0f2fe;
  color:#0369a1;
}
.lead-history-time {
  margin-left:auto;
  font-size:11px;
  color:var(--muted);
}
.lead-history-body {
  margin-top:6px;
  font-size:13px;
  color:var(--text);
  line-height:1.4;
}
.lead-history-error {
  margin-top:4px;
  font-size:12px;
  color:#b91c1c;
}
.lead-history-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lead-history-attachment {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: var(--surface-muted);
  text-decoration: none;
  color: var(--text);
  max-width: 220px;
}
.lead-history-attachment-image img {
  width: 160px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
}
.lead-history-attachment-file {
  min-width: 140px;
}
.scheduling-matrix {
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  margin:12px 0;
  background: var(--surface);
  display:flex;
  flex-direction:column;
  gap:10px;
}
.scheduling-matrix-heading {
  display:flex;
  flex-direction:column;
  gap:4px;
}
.scheduling-matrix-grid {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.scheduling-matrix-item {
  flex:1;
  min-width:150px;
  border:1px solid #d5e4ff;
  border-radius:12px;
  padding:10px;
  background:#f8faff;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.scheduling-matrix-item.is-ok {
  border-color:#9ae6b4;
  background:#ecfdf3;
}
.matrix-label {
  font-size:11px;
  letter-spacing:0.18em;
  text-transform:uppercase;
  color: var(--muted);
}
.matrix-status {
  font-weight:600;
  color: var(--text);
}
.matrix-link {
  font-size:12px;
  color: var(--primary);
  font-weight:600;
  text-decoration:none;
}
.matrix-link:hover {
  text-decoration:underline;
}
.scheduling-matrix-note {
  margin:0;
  font-size:12px;
  color: var(--muted);
}
.availability-fallback-note {
  border-top:1px solid var(--border);
  padding-top:10px;
  font-size:12px;
  color: var(--muted);
  display:flex;
  flex-direction:column;
  gap:4px;
}
.availability-note-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.availability-note-actions a {
  font-size:12px;
  color: var(--primary);
  font-weight:600;
}
.availability-message-preview {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--surface-muted);
  line-height: 1.4;
}
.availability-message-preview strong {
  display: inline-block;
  margin-right: 6px;
  color: var(--text);
}
.reschedule-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 18px 20px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  display:flex;
  flex-direction:column;
  gap:10px;
}
.reschedule-heading strong {
  font-size: 16px;
}
.reschedule-controls {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}
.reschedule-controls .reschedule-btn {
  background: var(--surface-alt);
  border:1px solid rgba(148, 163, 184, 0.4);
  box-shadow: none;
  padding: 12px 18px;
  font-size:14px;
  font-weight:600;
  color: var(--text);
  border-radius: 12px;
}
.reschedule-controls .reschedule-btn:hover {
  border-color:var(--primary);
}
.reschedule-saving,
.reschedule-error {
  font-size:13px;
}
.reschedule-saving {
  color: var(--muted);
}
.reschedule-error {
  color: var(--danger);
  font-weight:600;
}
@media (max-width: 720px) {
  .reschedule-controls {
    flex-direction:column;
    align-items:stretch;
  }
  .reschedule-controls .reschedule-btn {
    width:100%;
    justify-content:center;
  }
}
:root[data-theme='dark'] .availability-panel {
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.5);
}
:root[data-theme='dark'] .slot-booking-card {
  border-color: rgba(148, 163, 184, 0.45);
}
:root[data-theme='dark'] .slot-booking-option {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.86);
}
:root[data-theme='dark'] .slot-booking-option:has(input:checked) {
  background: rgba(14, 165, 233, 0.14);
}
:root[data-theme='dark'] .availability-tile {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
:root[data-theme='dark'] .offer-window-btn,
:root[data-theme='dark'] .offer-count-btn,
:root[data-theme='dark'] .offer-mode-btn,
:root[data-theme='dark'] .owner-confidence-btn,
:root[data-theme='dark'] .offer-regenerate-btn,
:root[data-theme='dark'] .offer-action-btn,
:root[data-theme='dark'] .slot-pill {
  background: rgba(15, 23, 42, 0.86);
  border-color: rgba(148, 163, 184, 0.55);
}
:root[data-theme='dark'] .availability-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
}
:root[data-theme='dark'] .availability-actions .btn-secondary:hover {
  border-color: rgba(129, 184, 255, 0.7);
}
:root[data-theme='dark'] .reschedule-card {
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}
:root[data-theme='dark'] .reschedule-controls .reschedule-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  color: var(--text);
}

.detail-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.detail-hint-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-hint-text {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.automation-state-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(15, 23, 42, 0.15);
}
.automation-state-badge.automation-state-active {
  color: #0f766e;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}
.automation-state-badge.automation-state-paused {
  color: #92400e;
  border-color: rgba(234, 179, 8, 0.6);
  background: rgba(251, 191, 36, 0.17);
}
.automation-state-badge.automation-state-manual {
  color: var(--danger);
  border-color: var(--status-error-border);
  background: rgba(248, 113, 113, 0.12);
}
.save-blob { padding:4px 10px; border-radius:999px; background:#dcfce7; color:#166534; font-weight:700; font-size:12px; }
.lead-outbound-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(15, 23, 42, 0.15);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}
.lead-outbound-status--delivered.lead-outbound-badge {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #065f46;
}
.lead-outbound-status--failed.lead-outbound-badge {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #7f1d1d;
}
.lead-outbound-status--pending.lead-outbound-badge {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #92400e;
}
.save-blob.error { background:#fee2e2; color:#991b1b; }
.backfill-note { padding:4px 10px; border-radius:999px; background:#e0f2fe; color:#075985; font-weight:700; font-size:12px; }
.backfill-note.fade { animation: fadeOut 1.4s ease 2.6s forwards; }
@keyframes fadeOut {
  to { opacity: 0; }
}
.quick-note { min-width:220px; display:flex; flex-direction:column; gap:6px; }
.notes-quick-state { min-height:16px; }
.field-save-state { display:flex; gap:8px; align-items:center; }
.mobile-sticky-actions { display:flex; gap:8px; flex-wrap:wrap; margin:6px 0; }
.filter-bar { margin:12px 0; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.filter-input { flex:1; min-width:200px; }
.filters-row { margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }
.filters-details { width:100%; }
.filter-panel {
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:var(--surface);
  box-shadow:0 10px 30px rgba(15,23,42,0.25);
  margin:12px 0;
}
.filter-summary {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  cursor:pointer;
  font-weight:700;
}
.filter-summary .muted {
  margin:0;
}
.filter-panel[open] .filter-bar {
  margin-top:12px;
}
@media (max-width: 768px) {
  .next-action {
    position: sticky;
    top: 56px;
    z-index: 10;
    background: var(--surface);
  }
}
.payloads-card { margin:12px 0 18px; }
.payloads-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.payloads-form { margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.payloads-list { margin-top:10px; display:grid; gap:10px; }
.handled-section { margin-top:16px; }
.row-top { position:relative; }
.status-saving { color:#64748b; display:none; }

/* Leads */
.next-action-head {
  display:flex;
  flex-direction:column;
  gap:4px;
}
.next-action-label {
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.3px;
  color:var(--muted);
}
.next-action-title {
  font-size:18px;
  line-height:1.3;
  font-weight: 800;
}
.next-action-meta {
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.next-action-message {
  font-weight:600;
  color:var(--text);
}
.next-action-actions {
  flex-direction:row;
  align-items:flex-start;
  gap:12px;
}
.next-action-overflow {
  margin-left:auto;
}
.next-action-overflow .lead-more-actions {
  margin:0;
}
.lead-inbox-hero {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 12px 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  margin-bottom: clamp(8px, 2vh, 18px);
}
.lead-inbox-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.history-toggle {
  margin-left:auto;
}
.lead-inbox-stats {
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-top:12px;
}
.lead-counter {
  flex:1;
  min-width:160px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--surface-muted);
  margin-bottom: clamp(12px, 3vh, 32px);
}
.lead-counter-label {
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.4px;
  color:var(--muted);
}
.lead-counter-value {
  font-size:34px;
  line-height:1;
  display:block;
  margin-top:4px;
  font-weight:700;
}
.history-section {
  margin-top:14px;
  border-top:1px dashed rgba(148, 163, 184, 0.42);
  padding-top:12px;
}
.history-section-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.history-section .helper-card {
  margin-top:0;
}
.lead-system-fix {
  margin-top:4px;
}
.stats-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.system-stats-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.filter-select { min-width:140px; }
.inbox-list { display:grid; gap:8px; }
.inbox-row { border:1px solid rgba(148, 163, 184, 0.34); border-radius:12px; background:var(--surface); padding:10px 12px; color:var(--text); box-shadow:0 3px 10px rgba(15,23,42,0.035); overflow: visible; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease; }
.inbox-row:hover { box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08); transform: translateY(-1px); }
.inbox-row.lead-action-pending { opacity: 0.75; }
.inbox-row.lead-confirmed {
  opacity:0.7;
  border-color: rgba(148, 163, 184, 0.3);
}
.inbox-row.handled { opacity:0.6; }
.inbox-row.handled .action-cluster { display:none; }
.inbox-row.handled details { display:none; }
.lead-summary {
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom: clamp(10px, 2vh, 18px);
}
.lead-summary-row {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.lead-summary-left {
  display:flex;
  flex-direction:column;
  gap:5px;
}
.lead-summary-service {
  font-weight:600;
  font-size:14px;
}
.lead-summary-meta {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.lead-message-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lead-message-line {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 12px;
}
.lead-message-label {
  color: var(--muted);
  flex: 0 0 auto;
}
.lead-message-body {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}
.lead-summary-mobile .lead-message-line {
  align-items: flex-start;
}
.lead-summary-mobile .lead-message-body {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.lead-summary-mobile .lead-summary-row {
  gap: 8px;
}
.lead-summary-mobile .lead-summary-right {
  width: 100%;
  justify-content: flex-start;
}
.lead-thread-link {
  width: fit-content;
}
.lead-summary-right {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.lead-time-row {
  font-size:12px;
  color:var(--muted);
  border-top:1px dashed rgba(148, 163, 184, 0.42);
  padding-top:4px;
  overflow:hidden;
}
.lead-time-text {
  white-space:nowrap;
  display:inline-block;
  max-width:100%;
  text-overflow:ellipsis;
  overflow:hidden;
}
.lead-summary-window {
  white-space:nowrap;
}
.lead-summary-window-mobile {
  display:none;
}
.lead-summary-status {
  font-size:12px;
  padding:4px 10px;
}
.lead-summary-area {
  font-size:12px;
  padding:2px 8px;
}
.lead-primary-row {
  margin-bottom:12px;
}
.lead-primary-row .lead-primary-action {
  width:100%;
}
.next-action-button {
  font-size: 15px;
}
.lead-actions-block {
  display:flex;
  flex-direction:column;
  gap:8px;
}
.lead-actions-row {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}
.lead-summary-title {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.lead-needs-details {
  margin-top: 2px;
}
.lead-needs-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}
.lead-needs-summary::-webkit-details-marker {
  display: none;
}
.lead-needs-label {
  font-weight: 600;
}
.lead-needs-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead-needs-ellipsis {
  color: var(--muted);
}
.lead-needs-more {
  color: var(--link);
  text-decoration: underline;
}
.lead-needs-details[open] .lead-needs-ellipsis {
  display: none;
}
.lead-needs-details[open] .lead-needs-more {
  text-decoration: none;
}
.lead-needs-body {
  margin-top: 4px;
  display: grid;
  gap: 2px;
}
.sent-note {
  font-size:12px;
  color: var(--muted);
  max-width: 100%;
  word-break: break-word;
}
.lead-reinforcement {
  border-left: 3px solid var(--brand);
  padding-left: 10px;
  font-size: 13px;
  color: var(--text);
  margin-top: 6px;
  line-height: 1.4;
}
.zip-pill {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--text);
}
.zip-pill.zip-in {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #0f5132;
}
.zip-pill.zip-out {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.45);
  color: #7c2d12;
}
.zip-pill.zip-unknown {
  background: rgba(148, 163, 184, 0.25);
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--muted);
}
.sent-pill {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
}
.lead-needs-reply {
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 11px;
  padding: 2px 8px;
}
.call-now-dominant {
  font-weight: 800;
  min-height: 40px;
  padding: 10px 16px;
}
.lead-quick-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sent-pill .sent-time {
  font-weight: 700;
}
.sent-pill.is-hidden {
  display: none;
}
.lead-details {
  margin-top: 16px;
}
.lead-details > summary {
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.lead-details > summary::-webkit-details-marker,
.lead-details > summary::marker {
  display: none;
}
.lead-detail-card {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lead-detail-card-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (min-width: 769px) {
  .split-detail-content .lead-detail-card {
    margin-top: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }
  .split-detail-content .lead-detail-card-body {
    gap: 12px;
  }
}
.lead-actions-row .btn {
  min-width: 140px;
}
.lead-call-action {
  white-space:nowrap;
  flex-shrink:0;
}
.more-actions {
  position: relative;
}
.more-actions-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 50;
  min-width: 180px;
}
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn, .menu-item {
  -webkit-tap-highlight-color: transparent;
}
.lead-more-actions {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  z-index: 20;
}
.lead-more-actions > summary {
  list-style: none;
  margin: 0;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.lead-more-actions > summary::-webkit-details-marker {
  display: none;
}
.lead-more-actions > summary::marker {
  display: none;
}
.lead-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  z-index: 10000;
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 10px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  display: none;
  gap: 6px;
}
.lead-more-actions[open] .lead-actions-menu {
  display: grid;
}
.lead-actions-menu .menu-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  color: inherit;
  font-weight: 600;
}
.lead-actions-menu .menu-item:hover {
  filter: brightness(1.15);
}
.lead-more-icon {
  font-size: 16px;
  line-height: 1;
}
.inbox-row.just-handled {
  opacity: 0.7;
}
.detail-message-section {
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
}
.detail-actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.detail-status-row {
  display:flex;
  align-items:center;
  gap:10px;
}
.detail-status-row select {
  min-width:160px;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--surface);
  font-weight:600;
}
.detail-message-section .msg-preview {
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:var(--flat-surface);
}
.detail-message-section .quick-note {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.detail-message-section .msg-preview .muted {
  font-size:13px;
  color:var(--muted);
}
.secondary-actions-panel {
  border-top:1px solid var(--border);
  padding-top:12px;
}
.secondary-actions-grid {
  display:flex;
  flex-direction:column;
  gap:10px;
}
.secondary-actions-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.action-cluster { display:flex; gap:8px; flex-wrap:wrap; color:var(--text); }
.msg-preview .muted { font-size: 13px; color: var(--muted); }
.status-pill {
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(5, 13, 32, 0.18);
}
.pill.action { background:#e0f2fe; color:#075985; text-decoration:none; }
.pill.action:hover { background:#bae6fd; }
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 200px;
  max-width: 320px;
  background: var(--brand);
  color: var(--brand-contrast);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.45);
  border: 1px solid transparent;
}
.toast[data-undo-lead] {
  pointer-events: auto;
  cursor: pointer;
}
.toast.show {
  opacity: 1;
  transform: translateY(-4px);
}
.toast[data-type="success"] {
  background: var(--success);
  color: var(--brand-contrast);
}
.toast[data-type="error"] {
  background: var(--danger);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.55);
}
.toast[data-type="info"] {
  background: var(--info);
  color: var(--text);
}
.toast[data-type="warning"] {
  background: var(--warning);
  color: #78350f;
  border-color: rgba(255, 255, 255, 0.35);
}
.toast[data-type="info"]::before,
.toast[data-type="success"]::before,
.toast[data-type="error"]::before {
  content: "";
}
.lead-feedback-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-top: 10px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}
.lead-feedback-banner.is-hidden {
  display: none;
}
.lead-feedback-banner.success {
  background: var(--success);
  color: var(--brand-contrast);
}
.lead-feedback-banner.error {
  background: var(--danger);
  color: #fff;
}
.lead-feedback-banner.info {
  background: var(--info);
  color: var(--text);
}
.lead-feedback-banner.warning {
  background: var(--warning);
  color: #78350f;
}
.status-new { background: rgba(14, 165, 233, 0.28); border-color: rgba(14, 165, 233, 0.55); color: #023c6b; }
.status-waiting_on_customer { background: rgba(251, 191, 36, 0.3); border-color: rgba(247, 159, 31, 0.6); color: #7c4c1c; }
.status-confirmed { background: rgba(16, 185, 129, 0.3); border-color: rgba(16, 185, 129, 0.55); color: #0f5132; }
.status-closed { background: rgba(148, 163, 184, 0.2); border-color: rgba(148, 163, 184, 0.4); color: var(--muted); }
.status-error, .tech-error, .notes-error, .field-save-error { color:#b91c1c; }
.tech-saving, .notes-saving, .field-save-status, .status-error, .tech-error, .notes-error, .field-save-error { display:none; }
.note-block textarea { min-height:72px; }
.note-actions { display:flex; gap:8px; align-items:center; margin-top:6px; flex-wrap:wrap; }
.reply-blocker-stack {
  display: grid;
  gap: 8px;
}
.reply-blocker-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 6px 10px;
  font-size: 12px;
}
.reply-input { min-height:64px; width:100%; }
.reply-template { min-width:200px; }
.reply-history {
  display: grid;
  gap: 8px;
}
.reply-history-entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border-left: 4px solid var(--brand);
  background: var(--surface-muted);
  font-size: 13px;
}
.reply-history-text {
  flex: 1;
  color: var(--text);
}
.reply-history-time {
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.reply-interpretation-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reply-interpretation-card .reply-interpretation-chip {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 4px;
}
.reply-interpretation-chip .reply-interpretation-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.reply-interpretation-text {
  font-size: 0.95rem;
  color: var(--text);
}
.reply-interpretation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.offer-owner-confidence {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}
.owner-confidence-toggle {
  display: flex;
  gap: 6px;
}
.owner-confidence-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}
.owner-confidence-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}
.owner-confidence-details {
  font-size: 0.85rem;
  color: var(--muted);
}
.owner-confidence-details strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
}
.desktop-only { display:block; }
.mobile-only { display:none; }
.filter-toggle-row {
  margin-bottom: 12px;
}
.tab-row {
  display:flex;
  gap:12px;
  margin-bottom:8px;
  flex-wrap:wrap;
}
.tab-pill {
  padding:10px 18px;
  border-radius:999px;
  border:1px solid var(--border);
  background: var(--flat-surface);
  color: var(--text);
  font-weight:600;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.tab-pill.is-active {
  background: var(--brand);
  color: var(--brand-contrast);
  border-color: var(--brand);
}
.tab-pill-count {
  font-size:12px;
  opacity:0.9;
}
.intake-meter {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.intake-meter-label {
  font-weight: 600;
  color: var(--text);
}
.intake-meter-missing {
  font-size: 12px;
}
.intake-action-btn {
  padding: 4px 12px;
  font-size: 12px;
}
.raw-toggle-row {
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
}
.raw-toggle-link {
  font-size: 13px;
  color: var(--brand);
}
.recent-inbound {
  margin-top: 20px;
  padding: 20px;
}
.recent-inbound-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
}
.recent-inbound-table {
  margin-top:12px;
}
.recent-inbound-row {
  display:grid;
  grid-template-columns: 180px 120px 1fr 120px;
  gap:12px;
  padding:6px 0;
  border-bottom:1px solid var(--border);
  font-size:13px;
}
.recent-inbound-row:last-child {
  border-bottom:none;
}
.recent-inbound-header {
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.05em;
  color:var(--text-muted);
  border-bottom:2px solid var(--border);
  padding-bottom:8px;
}
.setup-card {
  margin-top: 20px;
  padding: 20px;
}
.setup-card-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
}
.setup-results {
  margin-top: 16px;
}
.setup-check {
  display:flex;
  align-items:center;
  gap:12px;
  padding:6px 0;
  border-bottom:1px solid var(--border);
  font-size:13px;
}
.setup-check:last-child {
  border-bottom:none;
}
.setup-check-icon {
  width:24px;
  text-align:center;
}
.setup-check-label {
  font-weight:600;
  flex:1;
}
.setup-check-detail {
  color:var(--text-muted);
  font-size:12px;
}
.setup-check-subsystem {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 8px;
}
.setup-check-pass .setup-check-icon {
  color:#16a34a;
}
.setup-check-fail .setup-check-icon {
  color:#dc2626;
}
.filter-toggle-mobile {
  display: none;
}
.filter-panel-close {
  display: none;
}
.filter-search-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--brand-contrast);
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
  margin-left: 8px;
}
.filter-bar.is-submitting .filter-search-spinner {
  display: inline-block;
}
.filter-bar.is-submitting .filter-search-text {
  opacity: 0.5;
}
.filter-bar.is-submitting .filter-search-btn {
  pointer-events: none;
}

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .hamburger, .tabs-mobile, .menu-sheet, .menu-backdrop { display: none; }
  .container { padding-bottom: var(--pad); }
}

@media (max-width: 900px) {
  .table-wrap { display:none; }
  .tech-cards { display:grid; }
  .desktop-only { display:none; }
  .mobile-only { display:block; }
  .filter-chips { display:none; }
  main > header h1 { font-size: 24px; }
  .hero { padding:44px 14px 56px; }
  .hero h1 { font-size:26px; }
  .cta-row { gap:10px; }
  .trust-strip { flex-direction:column; align-items:flex-start; }
  .trust-icons { gap:10px; }
  .card-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  .inbox-row { padding:10px; background:var(--surface); border:1px solid rgba(148, 163, 184, 0.34); color:var(--text); }
  .inbox-row.lead-action-pending { opacity: 0.75; }
  .inbox-row.handled .action-cluster { display:none; }
  .inbox-row.handled details { display:none; }
  .action-cluster .btn-secondary { padding:8px 10px; font-size:13px; }
  .stats-row { gap:6px; }
  .settings-section .row { grid-template-columns: 1fr; }
  input, select, textarea { padding:12px 14px; }
  .toggle-item { padding:6px 0; }
  .mobile-sticky-actions {
    position: sticky;
    top: 6px;
    background: var(--surface);
    padding: 6px 0;
    z-index: 2;
  }
  .sticky-summary { position: static; }
  .lead-summary {
    flex-direction: column;
  }
  .lead-summary-right {
    justify-content: flex-start;
  }
  .filter-toggle-mobile {
    display: inline-flex;
  }
  .filter-panel {
    display: none;
  }
.filter-panel.mobile-visible {
  display: block;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  padding: var(--pad);
  z-index: 20;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.35);
}
.filter-panel-close {
  display: inline-flex;
  margin-bottom: 12px;
}
.filter-open {
  overflow: hidden;
}
.filter-search-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--brand-contrast);
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
  margin-left: 8px;
}
.filter-bar.is-submitting .filter-search-spinner {
  display: inline-block;
}
.filter-bar.is-submitting .filter-search-text {
  opacity: 0.5;
}
.filter-bar.is-submitting .filter-search-btn {
  pointer-events: none;
}

@keyframes spinner {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
}

@media (max-width: 768px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
  }
  main,
  .container,
  .page {
    padding-top: calc(var(--topbar-h) + var(--pad));
    padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + var(--pad));
  }
  .autopilot-bar {
    font-size: 13px;
    line-height: 1.2;
    white-space: normal;
    padding: 8px 12px;
  }
  .has-next-action .page-wrap {
    padding-top: 72px;
  }
}

@media (max-width: 768px) {
  .topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
  }

  .topbar-actions a,
  .topbar-actions button {
    font-size: 14px;
  }
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 6px;
  }

  .topbar .auth-block {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .topbar .auth-block .auth-link,
  .topbar .auth-block .theme-toggle {
    font-size: 14px;
  }

  .topbar .auth-email,
  .topbar .org-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.takeover-action-btn {
  min-width: 120px;
}
.inbox-row[data-human-owned="1"] .takeover-action-btn {
  display: none;
}
.split-detail-content[data-human-owned="1"] .takeover-action-btn {
  display: none;
}
.lead-human-takeover-banner {
  display: none;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  background: #f3f5f9;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.lead-human-takeover-banner.is-active {
  display: flex;
}
.lead-human-takeover-copy p {
  margin: 0;
  line-height: 1.2;
}
.lead-human-takeover-copy {
  display:flex;
  flex-direction:column;
  gap:4px;
}
.lead-human-takeover-copy .takeover-expires {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.takeover-expires.is-hidden {
  display: none;
}
.takeover-action-btn + .takeover-action-btn {
  margin-left: 8px;
}
.pause-tooltip {
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px dotted var(--muted);
  align-self: flex-start;
  cursor: help;
}
.system-health-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--surface);
  margin-bottom: clamp(6px, 1.5vh, 14px);
  box-shadow: none;
}
.system-health-panel.compact-strip {
  padding: 4px 8px;
}
.system-health-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  min-height: 30px;
}
.system-health-panel.compact-strip .system-health-summary {
  min-height: 24px;
}
.system-health-summary::-webkit-details-marker {
  display: none;
}
.system-health-summary-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 1px;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
}
.system-health-icon {
  color: var(--warning-strong);
  font-weight: 700;
}
.system-health-summary-text .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-health-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.system-health-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.system-health-caret {
  display: inline-block;
  transition: transform 140ms ease;
}
.system-health-details[open] .system-health-caret {
  transform: rotate(90deg);
}
.system-health-body {
  margin-top: 12px;
}
.system-health-panel.compact-strip .system-health-body {
  margin-top: 8px;
}
.system-health-panel.status-limited {
  border-color: rgba(250, 204, 21, 0.5);
}
.system-health-panel.status-action-needed,
.system-health-panel.status-broken {
  border-color: rgba(239, 68, 68, 0.5);
}
.system-health-panel.status-healthy {
  border-color: rgba(34, 197, 94, 0.4);
}
.system-health-issues {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.system-health-issue {
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.system-health-issue:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.routing-presets {
  padding-bottom: 16px;
}
.routing-presets .preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.routing-presets .preset-card {
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.05);
}
.routing-presets .preset-card .row {
  gap: 12px;
}
.routing-presets .preset-card select,
.routing-presets .preset-card input {
  width: 100%;
}

.lead-state-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lead-progress-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.lead-state-timeline-snippet {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.1rem;
}

.lead-state-event {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.state-timeline-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--panel, #fff);
}

.state-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.state-timeline-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.state-timeline-row {
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
.timeline-details {
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}
.timeline-summary {
  cursor: pointer;
  list-style: none;
  color: var(--link);
}
.timeline-summary::-webkit-details-marker {
  display: none;
}
.timeline-full {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.state-timeline-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.timeline-actor-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.sms-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid transparent;
}
.sms-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--muted);
}
.sms-status-dot--queued,
.sms-status-dot--sending {
  background: var(--warning-strong);
}
.sms-status-dot--sent,
.sms-status-dot--accepted,
.sms-status-dot--delivered {
  background: var(--success);
}
.sms-status-dot--failed,
.sms-status-dot--undelivered,
.sms-status-dot--rejected,
.sms-status-dot--blocked {
  background: var(--danger);
}
.sms-failure-details {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 4px;
}
.sms-failure-label {
  font-size: 0.75rem;
  color: var(--danger);
}
.sms-failure-link {
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: underline;
}
.sms-failure-link:hover,
.sms-failure-link:focus-visible {
  color: var(--primary-strong);
}

.state-timeline-row:first-child {
  border-top: none;
  padding-top: 0;
}

.status-rail-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--panel, #fff);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-rail-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.status-rail {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-rail-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-rail-btn.is-active {
  background: var(--brand);
  color: var(--brand-contrast);
  border-color: var(--brand-contrast);
}

.status-rail-note {
  font-size: 0.8rem;
}

.lead-detail-breadcrumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 2px;
}

.reply-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reply-suggestion-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
}

.reply-suggestion-btn:hover,
.reply-suggestion-btn:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}

.readiness-goal-progress {
  width: 100%;
  height: 6px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}

.readiness-goal-progress-bar {
  height: 100%;
  background: var(--brand);
}

.mission-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 16px 20px;
  background: rgba(59, 130, 246, 0.06);
  color: var(--text);
  line-height: 1.6;
  font-size: 0.95rem;
}
.mission-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.state-timeline-row.is-hidden {
  display: none;
}

.next-action-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel, #fff);
}

.next-action-card-body {
  padding: 16px;
}

.next-action-card .next-action-button {
  width: 100%;
  margin-top: 0.75rem;
}

.lead-timeline .timeline-viewport {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lead-timeline .timeline-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lead-timeline .timeline-scroll::-webkit-scrollbar {
  width: 6px;
}

.lead-timeline .timeline-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
}

.timeline-note {
  text-align: right;
  font-style: italic;
}

.forwarding-flow-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

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

.is-highlighted {
  outline: 2px solid rgba(38, 120, 255, 0.55);
  outline-offset: 6px;
  border-radius: 10px;
}

.flash-highlight,
.hash-focus-highlight {
  animation: flash-highlight-pulse 1.2s ease-out 1;
}

@keyframes flash-highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(38, 120, 255, 0.24);
    background-color: rgba(38, 120, 255, 0.1);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(38, 120, 255, 0);
    background-color: transparent;
  }
}

.inbox-advanced-divider {
  border-top: 1px solid var(--border);
  margin: 10px 0 0;
  opacity: 0.65;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.automation-heartbeat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}

.automation-heartbeat-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.automation-heartbeat-ok .automation-heartbeat-dot {
  background: #1f9d55;
}

.automation-heartbeat-warn .automation-heartbeat-dot {
  background: #d6a22c;
}

.automation-heartbeat-info .automation-heartbeat-dot {
  background: #2678ff;
}

.automation-heartbeat-error .automation-heartbeat-dot {
  background: #d64545;
}
