/* ============================================================
   Design tokens
   ============================================================ */
:root {
  /* Type scale (fluid) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.6vw, 1.5rem);
  --text-2xl: clamp(1.6rem, 1.4rem + 1vw, 2rem);
  --text-3xl: clamp(2rem, 1.7rem + 1.6vw, 2.75rem);

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1180px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Light palette (default) --- */
  --color-bg: #ffffff;
  --color-bg-subtle: #f6f8fb;
  --color-bg-raised: #ffffff;
  --color-border: #e3e8ef;
  --color-border-strong: #cbd5e1;
  --color-text: #101828;
  --color-text-muted: #5b6472;
  --color-text-faint: #8a94a3;

  --color-primary: #1f6feb;
  --color-primary-hover: #1857c2;
  --color-primary-contrast: #ffffff;
  --color-primary-soft: #eaf1fe;

  --color-accent: #0d9488;
  --color-accent-soft: #e5f7f5;

  --color-success: #15803d;
  --color-warning: #b45309;
  --color-danger: #b91c1c;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0b0e14;
    --color-bg-subtle: #11151d;
    --color-bg-raised: #151a24;
    --color-border: #262c39;
    --color-border-strong: #343c4c;
    --color-text: #eef1f6;
    --color-text-muted: #a2acbd;
    --color-text-faint: #717c8f;

    --color-primary: #6ea8ff;
    --color-primary-hover: #8fbbff;
    --color-primary-contrast: #0b0e14;
    --color-primary-soft: #16233d;

    --color-accent: #33c9bb;
    --color-accent-soft: #0f2723;

    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-danger: #f87171;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --color-bg: #0b0e14;
  --color-bg-subtle: #11151d;
  --color-bg-raised: #151a24;
  --color-border: #262c39;
  --color-border-strong: #343c4c;
  --color-text: #eef1f6;
  --color-text-muted: #a2acbd;
  --color-text-faint: #717c8f;

  --color-primary: #6ea8ff;
  --color-primary-hover: #8fbbff;
  --color-primary-contrast: #0b0e14;
  --color-primary-soft: #16233d;

  --color-accent: #33c9bb;
  --color-accent-soft: #0f2723;

  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-danger: #f87171;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

/* ============================================================
   Reset & base
   ============================================================ */
* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

.skip-link:focus {
  left: var(--space-4) !important;
  top: var(--space-4) !important;
  background: var(--color-bg-raised);
  color: var(--color-text);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--text-3xl); margin: 0 0 var(--space-3); }
h2 { font-size: var(--text-2xl); margin: var(--space-10) 0 var(--space-4); }
h3 { font-size: var(--text-xl); margin: var(--space-6) 0 var(--space-3); }
p { margin: 0 0 var(--space-4); color: var(--color-text); }
.lede { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 640px; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-center { text-align: center; }
.sample-heading { margin-bottom: var(--space-8); }
.page-intro { text-align: center; padding: var(--space-8) 0; }
.page-intro .lede { margin: 0 auto; }

/* ============================================================
   Header / nav
   ============================================================ */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

header.site-header .bar {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--color-text);
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; color: var(--color-primary); }
.logo-mark { flex-shrink: 0; }

nav.main-nav { flex: 1; display: flex; justify-content: center; }
nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
}
nav.main-nav a {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: var(--text-sm);
}
nav.main-nav a:hover { color: var(--color-primary); text-decoration: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  /* Pushes the theme toggle + hamburger to the right edge even when
     nav.main-nav is display:none on mobile and its flex:1 no longer
     claims the space between it and the logo. */
  margin-left: auto;
  padding-right: 5px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-raised);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--color-border-strong); color: var(--color-text); }

.nav-toggle {
  display: none;
  border: 1px solid var(--color-border);
  background: var(--color-bg-raised);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 760px) {
  nav.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-raised);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: var(--space-3) 0;
  }
  nav.main-nav[data-open="true"] { display: block; }
  nav.main-nav ul { flex-direction: column; gap: 0; }
  nav.main-nav a { display: block; padding: var(--space-3) var(--space-5); }
  .nav-toggle { display: inline-flex; }
}

/* ============================================================
   Breadcrumbs
   ============================================================ */
nav.breadcrumbs {
  padding: var(--space-3) 0;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}
nav.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}
nav.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: var(--space-2); color: var(--color-border-strong); }
nav.breadcrumbs a { color: var(--color-text-muted); }
nav.breadcrumbs li[aria-current] { color: var(--color-text); font-weight: 600; }

main { padding: 0 0 var(--space-12); min-height: 50vh; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  /* No overflow:hidden here -- the glow/grid layers below are already
     bounded to this box via inset:0, so it wasn't containing anything.
     What it WAS doing: clipping the state-picker dropdown (an absolutely
     positioned child that extends below the hero) at the hero's bottom
     edge, making the list look like it vanished into the next section. */
  padding: var(--space-12) 0 var(--space-10);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}
.hero .hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at top, color-mix(in srgb, var(--color-primary) 14%, transparent), transparent 60%),
    radial-gradient(ellipse at bottom right, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 50%);
}
.hero .hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 90%);
}
.hero .container { position: relative; z-index: 1; }
.hero .breadcrumbs { padding: 0 0 var(--space-5); }
.hero .breadcrumbs ol { justify-content: center; }

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
}
.hero .eyebrow .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 { max-width: 18ch; margin: 0 auto var(--space-4); }
.detail-hero { padding-bottom: var(--space-8); }
.detail-hero h1 { max-width: 32ch; }
.hero h1 .gradient-text {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede { margin: 0 auto var(--space-8); }

.hero .cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.hero .btn-primary {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-primary) 35%, transparent);
}

@media (max-width: 760px) {
  .hero .cta-row {
    flex-direction: column;
  }
  .hero .cta-row form,
  .hero .cta-row > a.btn {
    width: 100%;
    max-width: 260px;
  }
  .hero .cta-row form .btn {
    width: 100%;
  }
}

.state-picker {
  position: relative;
  width: 100%;
  max-width: 260px;
  text-align: left;
}
/* Same widget, just not squeezed next to a hero CTA button -- used standalone
   on its own line (e.g. the TAM calculator's state/specialty pickers). */
.state-picker-wide { max-width: 420px; }
.state-picker input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
}
.state-picker-list {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  max-height: 380px;
  overflow-y: auto;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.state-picker-list li {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
}
.state-picker-list li:hover { background: var(--color-bg-subtle); }
.state-picker-list li.picker-active { background: var(--color-bg-subtle); outline: 2px solid var(--color-primary); outline-offset: -2px; }
.state-picker-list .state-picker-empty { color: var(--color-text-faint); cursor: default; }
.state-picker-list .state-picker-empty:hover { background: none; }

.trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}
.trust-row .trust-item { display: inline-flex; align-items: center; gap: var(--space-1); }
.trust-row svg { width: 18px; height: 18px; color: var(--color-primary); flex-shrink: 0; }

/* ============================================================
   Buttons & inputs
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); color: var(--color-primary-contrast); }
.btn-primary:hover { background: var(--color-primary-hover); color: var(--color-primary-contrast); }
.btn-secondary { background: var(--color-bg-raised); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-border-strong); }
.btn-danger {
  background: color-mix(in srgb, var(--color-danger) 10%, transparent);
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 30%, transparent);
}
.btn-danger:hover { background: color-mix(in srgb, var(--color-danger) 18%, transparent); }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }

input[type="text"], input[type="search"], input[type="email"], select, textarea {
  font-family: inherit;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-raised);
  color: var(--color-text);
}
input[type="text"]:focus, input[type="search"]:focus, input[type="email"]:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  outline: none;
}

/* ============================================================
   Contact form
   ============================================================ */
.contact-page { padding-top: var(--space-12); padding-bottom: var(--space-12); max-width: 640px; }
.contact-card {
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  box-shadow: var(--shadow-lg);
}
.contact-card h1 { text-align: center; font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.contact-card .lede { text-align: center; margin-bottom: var(--space-6); }
.form-field { margin-bottom: var(--space-4); }
.form-field label { display: block; font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-2); }
.form-field input, .form-field textarea { width: 100%; }
.form-field textarea { resize: vertical; min-height: 140px; }
/* display:none (not just off-screen) -- a merely off-screen field can still
   get populated by a real browser's autofill (e.g. a saved "company" value),
   silently tripping the honeypot for a genuine visitor. A basic bot that
   fills every field without rendering CSS still catches on this either way. */
.form-honeypot { display: none; }
.form-banner {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
  text-align: center;
}
.form-banner-success {
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
  border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
}
.form-banner-error {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  color: var(--color-danger);
  border: 1px solid color-mix(in srgb, var(--color-danger) 30%, transparent);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin: var(--space-5) 0;
  padding: var(--space-4);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.filters input, .filters select { min-width: 160px; }

.htmx-indicator { opacity: 0; transition: opacity 0.15s var(--ease); }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* ============================================================
   Stat tiles
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}
.stat-card {
  /* Grid items default to min-width: auto, i.e. sized to their content's
     min-content -- without this, the animated counter's growing digit
     count pushes this track (and every card sharing its row) wider frame
     by frame, visibly shaking the whole grid. */
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--color-bg-raised);
  box-shadow: var(--shadow-sm);
}
.stat-card .icon { margin-bottom: var(--space-2); color: var(--color-primary); }
.stat-card .icon svg { width: 22px; height: 22px; }
.stat-card .value {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-card .label { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-1); }

/* ============================================================
   Cards / link grid
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}
.link-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--color-text);
  background: var(--color-bg-raised);
  transition: border-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}
.link-card:hover {
  border-color: var(--color-primary);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.link-card .name { font-weight: 600; }
.link-card .count { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-1); }

/* ============================================================
   Blog
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
  margin: var(--space-6) 0;
}
.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--color-text);
  background: var(--color-bg-raised);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}
.blog-card:hover {
  border-color: var(--color-primary);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.blog-card-title { font-weight: 700; font-size: var(--text-lg); line-height: 1.3; }
.blog-card-excerpt {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: var(--space-3) 0 var(--space-4);
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.blog-card-date { color: var(--color-text-faint); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; }

.blog-post-meta { text-align: center; margin-top: 0; }
.blog-post-back { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--color-border); }

.specialty-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  overflow: hidden;
  margin: var(--space-5) 0;
}
.specialty-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s var(--ease);
}
.specialty-row-with-cta { grid-template-columns: minmax(140px, 220px) 1fr auto auto; }
.specialty-list .specialty-row:last-child { border-bottom: none; }
.specialty-row:hover { background: var(--color-bg-subtle); }
.specialty-row-name { font-weight: 600; color: var(--color-text); }
.specialty-row-name:hover { color: var(--color-primary); text-decoration: none; }
.specialty-row-name-unlinked { cursor: default; }
.specialty-row-bar-wrap { display: flex; flex-direction: column; gap: var(--space-2); }
.specialty-row-buy { margin: 0; }
.specialty-row-buy .btn { white-space: nowrap; }
.specialty-row-total {
  font-weight: 700;
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.specialty-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-bg-subtle);
}
.specialty-bar-practices { background: var(--color-primary); }
.specialty-bar-individuals { background: var(--color-accent); }
.specialty-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.specialty-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.specialty-dot-practices { background: var(--color-primary); }
.specialty-dot-individuals { background: var(--color-accent); }

@media (max-width: 640px) {
  .specialty-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .specialty-row-total { text-align: left; }
}

/* ============================================================
   Dataset fields ("What's Included") section
   ============================================================ */
.section-lede { margin: 0 auto var(--space-8); }
.dataset-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}
.dataset-fields-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  padding: var(--space-5);
}
.dataset-fields-card-title {
  font-weight: 700;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.dataset-fields-list { list-style: none; margin: 0; padding: 0; }
.dataset-fields-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.dataset-fields-list svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-accent);
}

/* ============================================================
   Use cases
   ============================================================ */
.use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}
.use-case-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  padding: var(--space-5);
}
.use-case-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.use-case-icon svg { width: 22px; height: 22px; }
.use-case-title { font-weight: 700; margin-bottom: var(--space-2); }
.use-case-desc { color: var(--color-text-muted); font-size: var(--text-sm); margin: 0; }

/* ============================================================
   Pricing
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
  align-items: stretch;
}
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  padding: var(--space-6) var(--space-5) var(--space-5);
  text-align: center;
}
.pricing-card-featured {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}
.pricing-name { font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: var(--text-sm); }
.pricing-price { font-size: var(--text-3xl); font-weight: 800; margin: var(--space-2) 0 var(--space-3); font-variant-numeric: tabular-nums; }
.pricing-desc { color: var(--color-text-muted); font-size: var(--text-sm); margin: 0 0 var(--space-5); flex: 1; }
.pricing-card form { margin: 0; }
.pricing-card .btn { width: 100%; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
}
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-list .faq-item:last-child { border-bottom: none; }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--color-primary); }
.faq-chevron { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-muted); transition: transform 0.15s var(--ease); }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-item p { margin: 0; padding: 0 var(--space-5) var(--space-4); color: var(--color-text-muted); font-size: var(--text-sm); }

/* ============================================================
   Bar list (specialty / state breakdowns)
   ============================================================ */
.bar-list { list-style: none; margin: var(--space-5) 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.bar-list li { display: block; }
.bar-list a { display: block; color: var(--color-text); }
.bar-list a:hover { text-decoration: none; }
.bar-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font-size: var(--text-sm); margin-bottom: var(--space-1); }
.bar-row .name { font-weight: 600; color: var(--color-text); }
.bar-row .count { color: var(--color-text-muted); white-space: nowrap; }
.bar-track { height: 8px; border-radius: var(--radius-full); background: var(--color-bg-subtle); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--color-primary), var(--color-accent)); }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin: var(--space-5) 0; }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.data-table th, table.data-table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }
table.data-table thead th {
  position: sticky; top: 0;
  background: var(--color-bg-subtle);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  white-space: nowrap;
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--color-bg-subtle); }

/* ============================================================
   Sample data table (tabs + avatar rows)
   ============================================================ */
.sample-table-tabs {
  display: inline-flex;
  gap: var(--space-1);
  padding: 3px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}
.sample-tab {
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.sample-tab:hover { color: var(--color-text); }
.sample-tab.active {
  background: var(--color-bg-raised);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.sample-data-table td { vertical-align: middle; }
.sample-name-cell { display: flex; align-items: center; gap: var(--space-3); font-weight: 600; white-space: nowrap; }
.sample-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
}
.sample-npi { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--color-text-muted); }
.sample-wide-col { min-width: 220px; white-space: nowrap; }

.sample-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-bg-raised);
  box-shadow: 1px 0 0 var(--color-border);
}
table.data-table thead .sample-sticky-col { z-index: 3; background: var(--color-bg-subtle); }

/* Multi-column sticky region (individual providers: prefix, first, middle,
   last name) -- fixed widths so each column's left offset can be a plain
   cumulative sum instead of measured at render time. Only the last one
   carries the divider shadow, matching the single-sticky-column look. */
.sample-sticky-col.sample-sticky-0,
.sample-sticky-col.sample-sticky-1,
.sample-sticky-col.sample-sticky-2 {
  box-shadow: none;
}
.sample-sticky-0 { left: 0; width: 80px; min-width: 80px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-sticky-1 { left: 80px; width: 140px; min-width: 140px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-sticky-2 { left: 220px; width: 130px; min-width: 130px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-sticky-3 { left: 350px; width: 150px; min-width: 150px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sample-table-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
@media (max-width: 760px) {
  .sample-table-header { justify-content: center; text-align: center; }
}

.sample-disclosure {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.sample-disclosure svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--color-primary); }

.sample-blurred {
  filter: blur(4px);
  user-select: none;
  cursor: not-allowed;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sample-blurred:hover { filter: blur(3px); }

/* ============================================================
   Buy CSV
   ============================================================ */
.buy-csv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  padding: var(--space-5);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
}
.buy-csv-title { font-weight: 700; font-size: var(--text-lg); margin-bottom: var(--space-1); }
.buy-csv form { flex-shrink: 0; }

/* ============================================================
   Provider list
   ============================================================ */
.provider-list { list-style: none; padding: 0; margin: var(--space-5) 0; display: flex; flex-direction: column; gap: var(--space-3); }
.provider-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-raised);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.provider-card .name { font-weight: 700; }
.provider-card .meta { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-1); }
.provider-card .empty { color: var(--color-text-muted); }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  margin-left: var(--space-2);
}
.badge-accent { background: var(--color-accent-soft); color: var(--color-accent); border-color: transparent; }
.badge-primary { background: var(--color-primary-soft); color: var(--color-primary); border-color: transparent; }

/* ============================================================
   Chips (TAM calculator multi-select)
   ============================================================ */
.calculator-card {
  margin-top: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.calculator-card h3 { margin-top: var(--space-5); }
.calculator-card h3:first-child { margin-top: 0; }
.calculator-row {
  display: flex;
  gap: var(--space-6);
}
.calculator-field { flex: 1 1 0; min-width: 0; }
.calculator-field .state-picker.state-picker-wide { max-width: none; }
@media (max-width: 760px) {
  .calculator-row { flex-direction: column; gap: var(--space-5); }
}
.chip-picker { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-raised);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s var(--ease);
}
.chip:hover { border-color: var(--color-border-strong); }
.chip[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-primary-contrast);
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-6) 0; font-size: var(--text-sm); }
.pagination a.btn { min-width: 100px; }

/* ============================================================
   FAQ
   ============================================================ */
.faq dt { font-weight: 700; margin-top: var(--space-4); }
.faq dd { margin: var(--space-1) 0 0; color: var(--color-text-muted); }

/* ============================================================
   Prose (blog / static pages)
   ============================================================ */
.prose { max-width: 72ch; padding-top: var(--space-6); }
.prose h2 { font-size: var(--text-xl); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose code { background: var(--color-bg-subtle); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }

/* ============================================================
   Footer
   ============================================================ */
footer.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  background: var(--color-bg-subtle);
}
footer.site-footer .footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-5);
}
footer.site-footer a { color: var(--color-text-muted); }
footer.site-footer a:hover { color: var(--color-primary); }
footer.site-footer .brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

/* ============================================================
   Checkout result (order confirmation page)
   ============================================================ */
.checkout-page {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
  max-width: 560px;
}
.checkout-result-card {
  text-align: center;
  padding: var(--space-10) var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
  box-shadow: var(--shadow-lg);
}
.checkout-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-5);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-success) 15%, transparent);
  color: var(--color-success);
}
.checkout-result-icon svg { width: 32px; height: 32px; }
.checkout-result-card h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}
.checkout-result-card .btn {
  margin: var(--space-6) 0 var(--space-4);
}
.checkout-result-footnote { margin-top: 0; }
.checkout-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-5);
  border-radius: var(--radius-full);
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  animation: checkout-spin 0.8s linear infinite;
}
@keyframes checkout-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Misc utility
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-5);
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-subtle) 25%, var(--color-border) 37%, var(--color-bg-subtle) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ============================================================
   Chat widget (visitor-facing)
   ============================================================ */
.chat-widget {
  position: fixed;
  right: var(--space-5);
  /* Bumped up by cookie-consent.js while the cookie banner is visible, so
     the two don't overlap in the bottom-right corner on narrow screens. */
  bottom: calc(var(--space-5) + var(--cookie-banner-offset, 0px));
  z-index: 50;
}
.chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-bubble svg { width: 26px; height: 26px; }
.chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-3));
  width: min(340px, calc(100vw - var(--space-8)));
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font-weight: 700;
}
.chat-panel-close {
  background: none;
  border: none;
  color: inherit;
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 200px;
}
.chat-empty { text-align: center; margin: auto; }
.chat-message {
  max-width: 85%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-message-visitor {
  align-self: flex-end;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border-bottom-right-radius: var(--radius-sm);
}
.chat-message-owner {
  align-self: flex-start;
  background: var(--color-bg-subtle);
  color: var(--color-text);
  border-bottom-left-radius: var(--radius-sm);
}
.chat-panel-form {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.chat-panel-form input { flex: 1; }

/* ============================================================
   Cookie banner
   ============================================================ */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-raised);
  border-top: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}
.cookie-banner p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.cookie-banner-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }

@media (max-width: 640px) {
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .cookie-banner-actions { justify-content: center; }
}

/* ============================================================
   Admin (shared)
   ============================================================ */
.admin-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.admin-nav-links { display: flex; gap: var(--space-4); }
.admin-nav-bar a { color: var(--color-text-muted); font-weight: 600; font-size: var(--text-sm); }
.admin-nav-bar a.active { color: var(--color-primary); }
.admin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.admin-list-header h1 { margin: 0; }

/* ============================================================
   Admin chat inbox
   ============================================================ */
.admin-chat-list { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-chat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
}
.admin-chat-row:hover { border-color: var(--color-border-strong); }
.admin-chat-row-main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.admin-chat-row-visitor { font-weight: 700; }
.admin-chat-row-preview { font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-chat-row-time { white-space: nowrap; }
.admin-blog-row { flex-wrap: wrap; }
.admin-blog-row .admin-chat-row-main { flex: 1; }
.admin-status-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.admin-status-good { background: color-mix(in srgb, var(--color-success) 15%, transparent); color: var(--color-success); }
.admin-status-neutral { background: var(--color-bg-subtle); color: var(--color-text-muted); }
.admin-blog-row-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.admin-blog-row-actions form { margin: 0; }
.admin-chat-messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 420px;
  overflow-y: auto;
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}
.admin-chat-reply-form { display: flex; flex-direction: column; gap: var(--space-3); }
.admin-chat-reply-form textarea { min-height: 100px; resize: vertical; }

@media (max-width: 640px) {
  .chat-panel { width: calc(100vw - var(--space-8)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 640px) {
  .container { padding: 0 var(--space-4); }
  .provider-card { flex-direction: column; }
}
