/* Pouls MedTech Insights — marketing.css (v2 component layer)
 *
 * Component layer for the public marketing surface. Pulls all tokens
 * from design-system.css. Loaded by marketing/_base.html after the
 * design-system stylesheet.
 *
 * Voice constraints (binding):
 *   - No emoji, no exclamation marks, no autoplay sound.
 *   - No countdown timers, no scarcity copy.
 *   - Show data, not stock photography.
 *   - Editorial restraint: motion is minimal, gradients are rare,
 *     numerals are tabular, hierarchy is real.
 */


/* ========================================================================
 * 1. Base
 * ======================================================================== */

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.ri-page {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--color-ink-700);
  background: var(--color-surface);
  font-feature-settings: "ss01", "cv11";
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-ink);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-ink);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.018em;
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, var(--fs-display));
  font-weight: var(--fw-black);
  letter-spacing: -0.028em;
  line-height: 1.06;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, var(--fs-h2));
  letter-spacing: -0.022em;
  line-height: 1.18;
  text-wrap: balance;
}
h3 {
  font-size: clamp(1.125rem, 1rem + 0.5vw, var(--fs-h3));
  letter-spacing: -0.014em;
  line-height: 1.25;
}
h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
}
h5 { font-size: var(--fs-h5); font-weight: var(--fw-semibold); }
h6 { font-size: var(--fs-h6); font-weight: var(--fw-semibold); }

p { margin: 0 0 var(--space-4); }
p, li { text-wrap: pretty; }

small { color: var(--color-ink-500); }

hr {
  border: 0;
  height: 1px;
  background: var(--color-line);
  margin: var(--space-8) 0;
}


/* ========================================================================
 * 2. Layout primitives
 * ======================================================================== */

.ri-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.ri-container--mid    { max-width: var(--container-mid); }
.ri-container--text   { max-width: var(--container-text); }
.ri-container--narrow { max-width: var(--container-narrow); }

.ri-skip-link {
  position: absolute;
  left: -9999px;
}
.ri-skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--color-ink);
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 100;
}


/* ========================================================================
 * 3. Topbar / navigation
 * ======================================================================== */

.ri-topbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--color-line);
  position: sticky;
  top: 0;
  z-index: 30;
  transition: padding var(--duration-base) var(--ease-out);
}
.ri-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--pad-x);
  max-width: var(--container-max);
  margin: 0 auto;
}
.ri-topbar.is-scrolled .ri-topbar__inner {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.ri-brand {
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--color-ink);
  font-size: 1.0625rem;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-sans);
}
.ri-brand:hover { text-decoration: none; color: var(--color-ink); }
.ri-brand::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--color-primary);
  transform: translateY(-1px) rotate(45deg);
}

.ri-nav {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  flex-wrap: wrap;
}
.ri-nav a {
  color: var(--color-ink-600);
  font-weight: var(--fw-medium);
  font-size: 0.94rem;
  padding: 8px var(--space-3);
  border-radius: var(--radius-sm);
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}
.ri-nav a:hover {
  color: var(--color-ink);
  background: var(--color-surface-tint);
  text-decoration: none;
}
/* Topbar Contact-button legibility override (CONSULTING_V2_OVERHAUL §2.2).
 * Without this, `.ri-nav a { color: ink-600 }` (specificity 0,1,1) wins
 * over `.ri-btn--primary { color: white }` (0,1,0) — the Contact CTA in
 * the primary nav renders ink-on-ink and is unreadable. The double-class
 * override (specificity 0,2,1) restores white text without re-raising
 * the surrounding `.ri-nav a` weight site-wide. Hover-state too — the
 * primary-button hover background (`--color-primary-deep`) is also dark
 * and would clash with `--color-ink-700` body text. */
.ri-nav .ri-btn--primary,
.ri-nav .ri-nav__cta.ri-btn--primary {
  color: white;
}
.ri-nav .ri-btn--primary:hover {
  color: white;
}
.ri-nav__cta { margin-left: var(--space-2); }

.ri-nav__toggle {
  display: none;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  cursor: pointer;
}
.ri-nav__toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}
.ri-nav__toggle-bars span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

@media (max-width: 720px) {
  .ri-nav__toggle { display: inline-flex; }
  .ri-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
    gap: var(--space-1);
    display: none;
  }
  .ri-nav.is-open { display: flex; }
  .ri-nav a { padding: 12px var(--space-3); border-radius: var(--radius-sm); }
  .ri-nav__cta { margin-left: 0; margin-top: var(--space-2); }
}


/* ========================================================================
 * 4. Buttons
 * ======================================================================== */

.ri-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}
.ri-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.ri-btn--primary {
  background: var(--color-ink);
  color: white;
  box-shadow: 0 1px 1px rgba(11, 18, 32, 0.10);
}
.ri-btn--primary:hover {
  background: var(--color-primary-deep);
  color: white;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.ri-btn--primary:active { transform: translateY(0); }

.ri-btn--secondary {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-line);
  box-shadow: var(--shadow-xs);
}
.ri-btn--secondary:hover {
  border-color: var(--color-ink-400);
  background: var(--color-surface);
  color: var(--color-ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.ri-btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: transparent;
}
.ri-btn--ghost:hover {
  background: var(--color-surface-tint);
  color: var(--color-ink);
  text-decoration: none;
}

.ri-btn--accent {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 1px 1px rgba(199, 90, 60, 0.20);
}
.ri-btn--accent:hover {
  background: #ad4929;
  color: white;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.ri-btn--lg { padding: 14px 22px; font-size: 1rem; }
.ri-btn--sm { padding: 8px 12px; font-size: 0.8125rem; }


/* ========================================================================
 * 5. Eyebrow
 * ======================================================================== */

.ri-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-500);
  margin-bottom: var(--space-3);
}
.ri-eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--color-primary);
  display: inline-block;
}
.ri-eyebrow--muted { color: var(--color-ink-400); }
.ri-eyebrow--accent { color: var(--color-accent); }
.ri-eyebrow--accent::before { background: var(--color-accent); }


/* ========================================================================
 * 6. Hero
 * ======================================================================== */

.ri-hero {
  padding: clamp(64px, 10vw, 112px) 0 clamp(48px, 8vw, 88px);
  position: relative;
  background:
    radial-gradient(60% 70% at 100% 0%, var(--color-primary-tint) 0%,
      transparent 70%),
    linear-gradient(180deg, var(--color-surface) 0%,
      var(--color-surface-soft) 100%);
  border-bottom: 1px solid var(--color-line);
  overflow: hidden;
}
.ri-hero > * { position: relative; }

.ri-hero__grid {
  display: grid;
  /* V2 §4.1: card column slightly wider so level-2 facility names
     ("Houston Methodist Sugarland Hospital") don't truncate at 1280px+. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
@media (max-width: 880px) {
  .ri-hero__grid { grid-template-columns: 1fr; }
}

.ri-hero h1 {
  margin-bottom: var(--space-5);
  max-width: 16ch;
}
.ri-hero__sub {
  color: var(--color-ink-500);
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.1875rem);
  max-width: 56ch;
  line-height: var(--lh-base);
}
/* Small secondary line beneath the main subhead — used on the
   homepage hero per COMPREHENSIVE_REVIEW_BATCH_1.md §10.1 to
   surface the site-licensed / no-per-seat framing without
   inflating the primary subhead. */
.ri-hero__subnote {
  margin-top: var(--space-2, 8px);
  color: var(--color-ink-500);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}
.ri-hero__ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-8);
}

.ri-hero--single { text-align: left; }
.ri-hero--single h1 { max-width: 22ch; }
.ri-hero--single .ri-hero__sub { max-width: 60ch; }

/* Hero data card (homepage / methodology pages) */
.ri-hero__visual {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}
.ri-hero__visual::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--color-primary);
}


/* ========================================================================
 * 7. Data card (CSS-only chart)
 * ======================================================================== */

.ri-data-card {
  padding: var(--space-6) var(--space-6) var(--space-5);
  font-feature-settings: "tnum", "ss01";
}
/* V2 §4.1: head now stacks the click-cue title + raw-data subline.
   The two lines together replace the old single-line procedure label. */
.ri-data-card__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: var(--space-4);
}
.ri-data-card__label {
  font-weight: var(--fw-bold);
  font-size: var(--fs-h5);
  color: var(--color-ink);
  letter-spacing: -0.01em;
  line-height: var(--lh-snug);
}
.ri-data-card__cue {
  font-size: var(--fs-small);
  color: var(--color-ink-500);
  font-weight: var(--fw-regular);
  letter-spacing: -0.005em;
  line-height: var(--lh-snug);
}
.ri-data-card__sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-ink-400);
}

/* Numeric cells use lining tabular figures everywhere so columns
   align cleanly down the right edge across all three levels. */
.ri-data-card .ri-numeric,
.ri-data-row__num,
.ri-data-row__abbr,
.ri-data-card__rows {
  font-variant-numeric: tabular-nums lining-nums;
}

.ri-data-card__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}
.ri-data-row {
  display: block;
}
.ri-data-row__btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  display: grid;
  /* caret · abbr · "(N facilities)" · bar · "N services" */
  grid-template-columns: 18px 28px 110px 1fr 130px;
  align-items: center;
  gap: var(--space-3);
  transition: background-color 160ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 160ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ri-data-row__btn:hover {
  background: var(--color-surface-tint);
  border-color: var(--color-line-soft);
}
.ri-data-row__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.ri-data-row.is-open > .ri-data-row__btn {
  background: var(--color-primary-tint);
  border-color: var(--color-primary-soft);
}

/* Caret pseudo-element. Animated rotation on expand. */
.ri-data-row__caret {
  display: inline-block;
  width: 12px;
  height: 12px;
  position: relative;
  color: var(--color-ink-500);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
              color 160ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ri-data-row__caret::before {
  content: "";
  position: absolute;
  inset: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-2px, -2px) rotate(-45deg);
  width: 8px;
  height: 8px;
  top: 2px;
  left: 2px;
}
.ri-data-row__btn[aria-expanded="true"] .ri-data-row__caret {
  transform: rotate(90deg);
  color: var(--color-primary);
}

.ri-data-row__abbr {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  font-size: 0.84rem;
  color: var(--color-ink);
  letter-spacing: 0.04em;
}
/* Small parenthetical count next to a state code or facility name.
   Replaces the old "5 of N facilities / providers" footer per V2 §3.3. */
.ri-data-row__count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-ink-400);
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
}
.ri-data-row__bar {
  position: relative;
  height: 8px;
  background: var(--color-surface-tint);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.ri-data-row__bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  width: 0;
  animation: ri-bar-grow 800ms var(--ease-out) both;
}
@keyframes ri-bar-grow {
  from { width: 0; }
  to   { width: var(--w, 0%); }
}
.ri-data-row__num {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--color-ink);
  text-align: right;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

/* Inline labels that follow numeric values:
 *   "(236 facilities)"  — `__count-label` inside `__count`
 *   "140,401 services"  — `__num-label`   inside `__num`
 *   "(38 providers)"    — `__count-label` inside `.ri-data-facility__count`
 * Sans-serif, smaller, lighter weight so the eye still reads the number
 * first; the label sits alongside as a quiet unit-of-measure. */
.ri-data-row__count-label,
.ri-data-row__num-label,
.ri-data-facility__count-label {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: var(--fw-regular);
  color: var(--color-ink-400);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.ri-data-row__num-label {
  margin-left: 4px;
}

/* ----- Expandable panels (level 2 + level 3) -------------------------- */

/* V3 §2.2 (third bug-fix attempt): switched from the
 * `grid-template-rows: 0fr -> 1fr` hack to a plain `display: none` <->
 * `display: block` toggle. Reason: the grid hack visibly leaked the
 * inner nest's box-model (border + background + margin) under
 * already-collapsed rows in production — see V3 prompt §2 for the
 * symptom screenshots. The grid hack relies on the inner cell having
 * `min-height: 0; overflow: hidden`, which clips CONTENT, but does
 * not reliably clip the cell's own margin/border/padding across all
 * browsers when the row track is at `0fr`.
 *
 * The new approach gives up the smooth 0->auto height transition in
 * exchange for guaranteed-zero box-model on collapse. The §2.3 collapse
 * test asserts every property of every panel reads exactly `0px` when
 * closed; the explicit `height: 0; border: 0; padding: 0; margin: 0`
 * declarations below make `getComputedStyle()` return literal `0px`
 * even though display:none takes the element out of layout. */
.ri-data-row__panel,
.ri-data-facility__panel {
  display: none;
  height: 0;
  border: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
.ri-data-row.is-open > .ri-data-row__panel,
.ri-data-facility.is-open > .ri-data-facility__panel {
  display: block;
  height: auto;
}

/* The nested container is the visible card-in-a-card. With the panel
   above now toggled by display:none, the nest only renders when its
   parent row is open — no margin/border escape on collapse possible. */
.ri-data-card__nest {
  margin: var(--space-2) 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04);
}
.ri-data-card__nest--deep {
  margin: 6px 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-soft);
  box-shadow: none;
}
.ri-data-card__nest-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}
.ri-data-card__nest-foot {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--color-line-soft);
  font-size: var(--fs-caption);
  color: var(--color-ink-400);
  letter-spacing: normal;
}

/* Level-2 facility row: caret · name · bar · services. The bar is the
   half-opacity twin of the level-1 bar — same idea, one level deeper. */
.ri-data-facility {
  display: block;
}
.ri-data-row__btn--nested {
  /* caret · "name (N providers)" · bar · "N services" */
  grid-template-columns: 14px 1fr 60px 110px;
  padding: 4px var(--space-2);
  min-height: 36px;
  font-size: var(--fs-small);
  border-radius: var(--radius-sm);
}
.ri-data-row__btn--nested:hover {
  background: var(--color-surface-tint);
  border-color: var(--color-line);
}
.ri-data-facility.is-open > .ri-data-row__btn--nested {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-soft);
}
.ri-data-row__btn--nested .ri-data-row__caret {
  width: 10px;
  height: 10px;
}
.ri-data-row__btn--nested .ri-data-row__caret::before {
  width: 7px;
  height: 7px;
}
.ri-data-facility__name {
  color: var(--color-ink);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* Inline (N) provider count after facility name. */
.ri-data-facility__count {
  font-family: var(--font-mono);
  font-weight: var(--fw-regular);
  font-size: 0.78em;
  color: var(--color-ink-400);
  margin-left: 4px;
  letter-spacing: 0;
}
.ri-data-facility__bar {
  position: relative;
  height: 5px;
  background: var(--color-surface-tint);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.ri-data-facility__bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--color-primary);
  opacity: 0.5;
  border-radius: var(--radius-pill);
  width: var(--w, 0%);
}

/* Level-3 redacted provider row. Per prompts/COMPREHENSIVE_REVIEW_BATCH_1.md
   §2 the row now renders three uniform redaction pills (name + specialty
   + NPI) followed by the right-aligned service count. The literal "NPI"
   text in the row body is retired; it stays only as a column header.

   Grid: chevron + 3 pills + numeric (5 cols). Pills declare their own
   widths via the .ri-data-redact-pill--{name|specialty|npi} modifiers
   so the row reads as three distinct fields, not one repeated bar. */
.ri-data-provider {
  display: grid;
  grid-template-columns: 14px max-content max-content max-content 1fr;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 4px var(--space-2);
  border-radius: var(--radius-sm);
  cursor: default;
}
.ri-data-provider::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--color-ink-400);
  opacity: 0.35;
}

/* Uniform redaction pill primitive. The same visual class is used for
   the name, specialty, and NPI columns — the only thing that differs
   is the per-column width modifier, so the eye reads three distinct
   redacted fields rather than one repeated bar. Background tint is
   ~10% darker than the card surface so the pill reads as
   "this is a real value that's been hidden", not as decorative
   ornament. Used on hero card + both map drilldowns. */
.ri-data-redact-pill {
  display: inline-block;
  height: 14px;
  background: var(--color-surface-tint-strong, rgba(11, 18, 32, 0.10));
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm, 3px);
  user-select: none;
  vertical-align: middle;
}
.ri-data-redact-pill--name      { width: 140px; }
.ri-data-redact-pill--specialty { width: 110px; }
.ri-data-redact-pill--npi       { width:  80px; }

.ri-data-provider .ri-data-row__num {
  color: var(--color-ink);
  font-size: 0.82rem;
  text-align: right;
}

/* Level-3 column-header row: "physician name | specialty | NPI | service claims/year".
 * Shares the .ri-data-provider 5-column grid so the labels align exactly
 * with the three redaction pills + the right-aligned services count
 * below. The leading dot is suppressed (it's a row-marker, not a
 * column heading). aria-hidden on the markup — see marketing.js comment. */
.ri-data-provider--head {
  cursor: default;
  min-height: auto;
  padding: 2px var(--space-2);
  margin: 0 0 4px 0;
  border-bottom: 1px dashed var(--color-line-soft);
}
.ri-data-provider--head::before {
  content: none;
}
.ri-data-provider__col-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ri-data-provider__col-label--num {
  text-align: right;
}

/* Terse "+N" indicator at the bottom of the level-3 panel.
   Replaces the old "+ N more in the CSV." sentence per founder feedback —
   the count alone is enough; the deliverable context is established
   elsewhere on the card. */
.ri-data-card__nest-foot--more {
  font-family: var(--font-mono);
  text-align: right;
  font-size: 0.72rem;
  font-feature-settings: "tnum";
  color: var(--color-ink-400);
  border-top: 1px dashed var(--color-line-soft);
}

/* Visually-hidden helper for screen-reader-only text alternatives.
   Standard recipe; matches the WCAG 2.2 sufficient technique. */
.ri-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Respect prefers-reduced-motion: skip the panel reveal + caret rotate. */
@media (prefers-reduced-motion: reduce) {
  .ri-data-row__panel,
  .ri-data-facility__panel,
  .ri-data-row__caret,
  .ri-data-row__btn {
    transition: none !important;
  }
  .ri-data-row__bar > span,
  .ri-data-facility__bar > span {
    animation: none !important;
    width: var(--w, 0%) !important;
  }
}

/* Mobile (≤520px): tighten indentation, allow facility names to wrap.
 * The descriptive labels ("facilities", "providers", "services") are
 * hidden at this width — the column structure (and the screen-reader
 * `.ri-visually-hidden` text) carries the meaning when horizontal
 * room runs out. The L3 column-header row is also hidden because its
 * narrow grid drops the "NPI" column on this width. */
@media (max-width: 520px) {
  .ri-data-row__btn {
    grid-template-columns: 16px 28px 48px 1fr 78px;
    gap: var(--space-2);
  }
  .ri-data-card__nest {
    margin-left: var(--space-3);
    padding: var(--space-2) var(--space-3);
  }
  .ri-data-card__nest--deep {
    margin-left: var(--space-2);
  }
  .ri-data-row__btn--nested {
    grid-template-columns: 12px 1fr 80px;
  }
  .ri-data-row__btn--nested .ri-data-facility__bar {
    display: none;
  }
  .ri-data-facility__name {
    white-space: normal;
  }
  /* Mobile (≤520px): collapse the 5-column row to chevron + name pill +
     numeric. The specialty + NPI pills are hidden because there isn't
     enough horizontal room for three pills plus the service count.
     The screen-reader fallback text + the (hidden) header still carry
     the columns' meaning. */
  .ri-data-provider {
    grid-template-columns: 12px max-content 1fr;
  }
  .ri-data-redact-pill--specialty,
  .ri-data-redact-pill--npi {
    display: none;
  }
  .ri-data-row__count-label,
  .ri-data-row__num-label,
  .ri-data-facility__count-label {
    display: none;
  }
  .ri-data-provider--head {
    display: none;
  }
}

/* Card foot: two stacked rows.
   Row 1: national totals (mono, two-up, justify-between).
   Row 2: example-claim/service caveat (italic, centered, quieter).
   The italic note clarifies that every figure in the card represents
   ONE example procedure family — the engagement scopes its own. */
.ri-data-card__foot {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-line-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.ri-data-card__foot-stats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--color-ink-400);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ri-data-card__foot-stats strong {
  color: var(--color-ink-600);
  font-weight: var(--fw-semibold);
}
.ri-data-card__example-note {
  margin: 0;
  font-size: 0.7rem;
  color: var(--color-ink-400);
  text-align: center;
  font-style: italic;
  letter-spacing: 0.02em;
}


/* ========================================================================
 * 8. Sections
 * ======================================================================== */

.ri-section {
  padding: clamp(56px, 9vw, 96px) 0;
  position: relative;
}
.ri-section + .ri-section { border-top: 1px solid var(--color-line); }
.ri-section--tight  { padding: clamp(32px, 6vw, 56px) 0; }
.ri-section--alt    { background: var(--color-surface-soft); }
.ri-section--ink {
  background: var(--color-ink);
  color: var(--color-line);
}
.ri-section--ink h2,
.ri-section--ink h3 { color: white; }
.ri-section--ink p  { color: rgba(255, 255, 255, 0.78); }

.ri-section__head {
  max-width: 64ch;
  margin: 0 0 var(--space-10);
}
.ri-section__head p {
  color: var(--color-ink-500);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-base);
  margin-bottom: 0;
}
.ri-section__head--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.ri-section h2 + p { margin-top: var(--space-2); }


/* ========================================================================
 * 9. Cards
 * ======================================================================== */

.ri-grid { display: grid; gap: var(--space-5); }
.ri-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ri-grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ri-grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.ri-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  transition:
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}
.ri-card:has(a:hover, a:focus-visible) {
  border-color: var(--color-ink-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.ri-card h3 {
  margin: var(--space-1) 0 var(--space-1);
  color: var(--color-ink);
  font-size: 1.1875rem;
}
.ri-card p {
  color: var(--color-ink-600);
  margin-bottom: var(--space-3);
  font-size: 0.9375rem;
}
.ri-card__meta {
  font-family: var(--font-mono);
  color: var(--color-ink-500);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
}
.ri-card__price {
  color: var(--color-ink);
  font-weight: var(--fw-bold);
  font-size: 0.95rem;
  font-feature-settings: "tnum";
  letter-spacing: -0.005em;
}
.ri-card__cta { margin-top: auto; align-self: flex-start; }

.ri-card--feature {
  border-color: var(--color-ink);
  border-width: 1.5px;
  box-shadow: var(--shadow-sm);
}

/* Numbered step card */
.ri-step {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ri-step__num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  color: var(--color-primary);
  text-transform: uppercase;
}
.ri-step h3 {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--color-ink);
}
.ri-step p {
  color: var(--color-ink-600);
  font-size: 0.9375rem;
  margin: 0;
}


/* ========================================================================
 * 10. Stats / numeric
 * ======================================================================== */

.ri-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}
.ri-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; height: 3px; width: 36px;
  background: var(--color-primary);
  border-bottom-right-radius: 2px;
}
.ri-stat__num {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem);
  font-weight: var(--fw-black);
  color: var(--color-primary);
  letter-spacing: -0.028em;
  line-height: 1.05;
  font-feature-settings: "tnum", "ss01";
}
.ri-stat__label {
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  margin-top: 6px;
  font-size: 0.95rem;
}
.ri-stat__sub {
  color: var(--color-ink-500);
  font-size: 0.875rem;
  margin-top: var(--space-2);
  line-height: var(--lh-base);
}

.ri-numeric {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "ss01";
  letter-spacing: 0;
}


/* ========================================================================
 * 11. Source strip
 * ======================================================================== */

.ri-source-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  padding: var(--space-6) var(--pad-x);
  background: var(--color-surface);
}
.ri-source-strip__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-ink-400);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: var(--fw-semibold);
}
.ri-source-strip__name {
  font-weight: var(--fw-semibold);
  color: var(--color-ink-600);
  letter-spacing: 0.04em;
  font-size: 0.875rem;
  padding: 4px 10px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface-soft);
}


/* ========================================================================
 * 12. Tables
 * ======================================================================== */

.ri-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  /* Native horizontal scroll on narrow viewports; the fixed
     min-width on .ri-table forces overflow and the WebKit/iOS
     scrollbar is enough affordance. Keep the scroll hint paragraph
     in the template (mobile-only) for additional clarity. */
  -webkit-overflow-scrolling: touch;
  position: relative;
}
/* Mobile-only scroll-hint cue rendered next to the table per
   COMPREHENSIVE_REVIEW_BATCH_2.md §5.3. The cue is hidden by
   default and revealed on viewports where the table overflow is
   the most likely outcome (≤720px maps to the .ri-table
   min-width: 720px below). */
.ri-table-scroll-hint {
  display: none;
  margin: var(--space-2) 0 var(--space-3) 0;
  font-size: 0.78rem;
  color: var(--color-ink-500);
  font-style: italic;
}
@media (max-width: 720px) {
  .ri-table-scroll-hint {
    display: block;
  }
}
.ri-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-feature-settings: "tnum", "ss01";
}
.ri-table th, .ri-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--color-line-soft);
  vertical-align: top;
  font-size: 0.9rem;
  line-height: 1.5;
}
.ri-table th {
  background: var(--color-surface-soft);
  color: var(--color-ink);
  font-weight: var(--fw-semibold);
  font-size: 0.8125rem;
  letter-spacing: -0.005em;
  border-bottom: 1px solid var(--color-line);
}
.ri-table td:first-child {
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  width: 26%;
}
.ri-table tbody tr:hover { background: var(--color-surface-soft); }
.ri-table tr:last-child td { border-bottom: 0; }


/* ========================================================================
 * 13. Forms
 * ======================================================================== */

.ri-form {
  display: grid;
  gap: var(--space-4);
  max-width: 580px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}
.ri-field { display: grid; gap: 6px; }
.ri-field > label {
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  font-size: 0.875rem;
}
.ri-field > .ri-help {
  color: var(--color-ink-500);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.ri-field input,
.ri-field textarea,
.ri-field select {
  font: inherit;
  color: var(--color-ink);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  background: var(--color-surface);
  width: 100%;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}
.ri-field input::placeholder,
.ri-field textarea::placeholder { color: var(--color-ink-400); }
.ri-field input:hover,
.ri-field textarea:hover { border-color: var(--color-ink-400); }
.ri-field input:focus,
.ri-field textarea:focus {
  outline: 0;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.ri-field textarea {
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
  line-height: var(--lh-base);
}
.ri-field--checkbox {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-3);
}
.ri-field--checkbox input { width: auto; margin-top: 4px; }
.ri-field--checkbox label {
  font-weight: var(--fw-medium);
  color: var(--color-ink-600);
}

.ri-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 540px) {
  .ri-form__row { grid-template-columns: 1fr; }
}

.ri-form button[type="submit"] {
  margin-top: var(--space-1);
  align-self: flex-start;
}

/* Contact split layout */
.ri-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 880px) {
  .ri-contact-grid { grid-template-columns: 1fr; }
}
.ri-contact-aside {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.ri-contact-aside h3 {
  font-size: 0.875rem;
  font-weight: var(--fw-bold);
  color: var(--color-ink);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.005em;
}
/* Aside list shells. Per COMPREHENSIVE_REVIEW_BATCH_1.md §7.1 the
   /contact aside collapsed from a 5-bullet <ul> to a 3-step <ol>.
   Both element shapes share the same outer chrome; the only
   difference is the marker style. */
.ri-contact-aside ul,
.ri-contact-aside ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
  counter-reset: ri-contact-step;
}
.ri-contact-aside li {
  font-size: 0.875rem;
  color: var(--color-ink-600);
  line-height: var(--lh-base);
  padding-left: 28px;
  position: relative;
  counter-increment: ri-contact-step;
}
/* <ul> bullet — small horizontal bar, decorative. */
.ri-contact-aside ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}
/* <ol> bullet — numbered step marker per §7.1. */
.ri-contact-aside ol > li::before {
  content: counter(ri-contact-step) ".";
  position: absolute;
  left: 0;
  top: -1px;
  width: 22px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
}
.ri-contact-aside strong {
  display: block;
  color: var(--color-ink);
  font-weight: var(--fw-semibold);
  margin-bottom: 2px;
}
/* Trust-signal lines under the 3-step process per §7.1. Small,
   muted, single-line — they read as confidence-builders, not
   bulleted process steps. */
.ri-contact-aside__trust {
  margin: var(--space-4) 0 0;
  font-size: 0.8125rem;
  color: var(--color-ink-500);
  line-height: var(--lh-base);
}
.ri-contact-aside__trust + .ri-contact-aside__trust {
  margin-top: var(--space-2);
}


/* ========================================================================
 * 14. Callouts (info, warn, footnote)
 * ======================================================================== */

.ri-callout {
  border: 1px solid var(--color-line);
  background: var(--color-surface-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.9375rem;
  line-height: var(--lh-base);
  color: var(--color-ink-700);
}
.ri-callout__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  color: var(--color-ink-500);
}
.ri-callout p { margin: 0; }
.ri-callout strong { color: var(--color-ink); }

.ri-callout--info {
  background: var(--color-primary-tint);
  border-color: var(--color-primary-soft);
}
.ri-callout--info .ri-callout__label { color: var(--color-primary); }

.ri-callout--warn {
  background: var(--color-warn-soft);
  border-color: var(--color-warn-line);
}
.ri-callout--warn .ri-callout__label { color: var(--color-warn); }

.ri-callout--footnote {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--color-line);
  border-radius: 0;
  padding: var(--space-5) 0 0;
  font-size: 0.875rem;
  color: var(--color-ink-500);
}
.ri-callout--footnote .ri-callout__label { color: var(--color-ink-400); }


/* ========================================================================
 * 15. Disclaimer treatments
 * ======================================================================== */

.ri-disclaimer-banner {
  background: var(--color-warn-soft);
  border-bottom: 1px solid var(--color-warn-line);
  color: var(--color-ink-700);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  text-align: center;
  line-height: var(--lh-base);
}
.ri-disclaimer-banner strong {
  color: var(--color-warn);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-right: 8px;
  font-weight: var(--fw-bold);
}

.ri-disclaimer-sticky {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--color-line);
  padding: var(--space-3) var(--space-4);
  font-size: 0.8125rem;
  color: var(--color-ink-500);
  z-index: 5;
  text-align: center;
  line-height: 1.45;
}


/* ========================================================================
 * 16. Honesty band
 * ======================================================================== */

.ri-honesty {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px) { .ri-honesty { grid-template-columns: 1fr; } }
.ri-honesty__col {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
}
.ri-honesty__col::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--space-6);
  right: var(--space-6);
  height: 2px;
  background: var(--color-line);
  border-radius: 0 0 2px 2px;
}
.ri-honesty__col:first-child::before { background: var(--color-success); }
.ri-honesty__col:last-child::before  { background: var(--color-ink-400); }
.ri-honesty__col h3 {
  color: var(--color-ink);
  margin: var(--space-2) 0 var(--space-4);
  font-size: 1.05rem;
}
.ri-honesty__col ul {
  padding-left: 0;
  margin: 0;
  list-style: none;
}
.ri-honesty__col li {
  margin-bottom: var(--space-3);
  color: var(--color-ink-600);
  padding-left: 22px;
  position: relative;
  line-height: var(--lh-base);
  font-size: 0.9375rem;
}
.ri-honesty__col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-line);
}
.ri-honesty__col:first-child li::before { background: var(--color-success); }
.ri-honesty__col:last-child  li::before { background: var(--color-ink-400); }
.ri-honesty__col li strong {
  color: var(--color-ink);
  font-weight: var(--fw-semibold);
}


/* ========================================================================
 * 17. CTA strip (replaces the v1 CTA "band")
 *
 * The §3 "scope a project" reminder. Used at the bottom of feature
 * pages (consulting, reports, methodology, etc.). Quieter than the
 * v1 dark-band treatment so it feels like a footnote, not a slab.
 * ======================================================================== */

.ri-cta-strip {
  background: var(--color-surface-soft);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  padding: clamp(40px, 6vw, 72px) 0;
}
.ri-cta-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.ri-cta-strip__copy { max-width: 56ch; }
.ri-cta-strip h2 {
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  margin-bottom: var(--space-2);
  color: var(--color-ink);
}
.ri-cta-strip p {
  color: var(--color-ink-500);
  margin: 0;
  font-size: 1rem;
}
.ri-cta-strip__ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Dark variant for the homepage closing band */
.ri-cta-strip--ink {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: white;
}
.ri-cta-strip--ink h2 { color: white; }
.ri-cta-strip--ink p { color: rgba(255, 255, 255, 0.78); }
.ri-cta-strip--ink .ri-btn--primary {
  background: white;
  color: var(--color-ink);
}
.ri-cta-strip--ink .ri-btn--primary:hover {
  background: var(--color-surface-soft);
  color: var(--color-ink);
}
.ri-cta-strip--ink .ri-btn--secondary {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.32);
}
.ri-cta-strip--ink .ri-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.6);
  color: white;
}


/* ========================================================================
 * 17b. /consulting v2 — hero stat strip, scroll-snap carousel,
 *      and inline closing CTA
 *
 * Per prompts/CONSULTING_V2_OVERHAUL.md §3.2. Three components, all
 * scoped to /consulting (the .ri-hero--consulting wrapper, the
 * .ri-carousel BEM block, and the .ri-inline-cta block). No new
 * design-system tokens; everything pulls from the existing palette.
 * ======================================================================== */

/* Three-stat strip below the hero CTAs (§3.2.1). Big tabular number
 * + one-line label per stat, with a thin accent rule under each
 * number for visual interest without being decorative. */
.ri-stat-strip {
  list-style: none;
  margin: var(--space-8) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-6);
  max-width: 720px;
}
.ri-stat-strip__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 2px solid var(--color-primary);
}
.ri-stat-strip__item:nth-child(2) { border-top-color: var(--color-primary-deep); }
.ri-stat-strip__item:nth-child(3) { border-top-color: var(--color-accent); }
.ri-stat-strip__num {
  font-size: clamp(2rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: var(--fw-black);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--color-ink);
}
.ri-stat-strip__label {
  font-size: 0.875rem;
  color: var(--color-ink-600);
  line-height: var(--lh-base);
}

/* /retinamaps + /cpapmaps stat strips need 4 cells across desktop;
 * widen the max-width and add a fourth accent color so the four-stat
 * variant stays visually parallel to the three-stat shipped pattern.
 * Per MAPS_RETINA_AND_CGM_BUILD.md §3.5 (retina) and
 * REBUILD_CGMMAPS_AS_CPAPMAPS.md §3.7 (cpap).
 */
.ri-stat-strip--four {
  max-width: 920px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.ri-stat-strip--four .ri-stat-strip__item:nth-child(4) {
  border-top-color: var(--color-success, #2f855a);
}

/* Dollar-figure stat-strip cell. Per
 * prompts/MAP_POLISH_DOLLAR_FRAMING_AND_LABELS.md §2.3 (founder
 * direction 2026-05-01): every absolute dollar figure on a public
 * map page must carry a small second-line scope qualifier so a
 * Medicare-only number is never misread as the buyer's full TAM.
 * The qualifier renders as a third element inside the stat-cell
 * flex column, beneath the value + label. */
.ri-stat-strip__qualifier {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--color-ink-500);
  line-height: 1.35;
}

/* Map-page buyer-note. A single italic line that sits beneath every
 * map-page hero and above the stat strip. Tells the buyer "this is
 * Medicare Part B FFS only; multi-payer market is materially larger;
 * directional signal not TAM" so they don't undervalue their actual
 * market opportunity from the dollar figures rendered on the page.
 * Per prompts/MAP_POLISH_DOLLAR_FRAMING_AND_LABELS.md §2.3 Change 3. */
.ri-map-buyer-note {
  margin: 0 0 var(--space-6);
  max-width: 78ch;
  font-size: 0.92rem;
  line-height: var(--lh-base);
  color: var(--color-ink-500);
}
.ri-map-buyer-note em {
  font-style: italic;
}

/* Drug-mix breakdown chip row on /retinamaps. Per
 * MAPS_RETINA_AND_CGM_BUILD.md §3.5 — a single horizontal row of
 * pills beneath the stat strip showing the national split across
 * the four covered anti-VEGF drugs. Pharma buyers care which drug
 * owns which slice; the chip row is the "make it attractive to
 * buyers" element. Wraps to a second line on narrow widths. */
.ri-drug-mix {
  margin-top: var(--space-6);
  max-width: 920px;
}
.ri-drug-mix__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-ink-500);
  margin-bottom: var(--space-3);
}
.ri-drug-mix__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ri-drug-mix__chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill, 999px);
  font-size: 0.92rem;
}
.ri-drug-mix__name {
  color: var(--color-ink-700);
  font-weight: var(--fw-medium, 500);
}
.ri-drug-mix__share {
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
}
@media (max-width: 600px) {
  .ri-drug-mix__chip {
    font-size: 0.85rem;
    padding: 6px 10px;
  }
}

/* Static (non-expandable) drilldown row variant. Used by:
 * - /retinamaps clusters that have no provider roster (rare, but
 *   safer than rendering an empty expand panel).
 * - /cpapmaps provider-direct rows: each row is one redacted
 *   referring physician (3 redaction pills + city + service count),
 *   no nested layer to expand into. The rfrhpr file has no facility/
 *   CCN dimension. Per REBUILD_CGMMAPS_AS_CPAPMAPS.md §3.6.
 * Visual: same layout as the expandable variant minus the caret +
 * cursor:pointer + hover state. */
.ri-data-row__btn--static {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  width: 100%;
  padding: var(--space-3, 12px) var(--space-4, 16px);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: default;
}
.ri-data-facility--flat {
  list-style: none;
}
.ri-data-facility--flat .ri-data-facility__panel {
  display: none;
}

/* /cpapmaps provider-direct row: visible city/state label rendered in
 * the same slot the facility-name occupies on the procedure-shaped
 * maps. Slightly muted compared to a real facility name so the row
 * reads as "physician @ location" rather than "facility name". */
.ri-data-facility__name--location {
  color: var(--color-ink-700);
  font-weight: var(--fw-medium, 500);
}
.ri-data-facility--provider-direct .ri-data-row__btn--static {
  /* Three redaction pills + location + bar + count → keep the row
   * compact so 10 stack cleanly inside the state-detail panel. */
  gap: var(--space-2, 8px);
  padding-block: 10px;
}

/* /examples 3-card live-demo gallery. The cards reuse .ri-card chrome
 * and only add a touch of margin + a meta-pill accent line so the
 * three demos read at parallel weight (no "single hero featured"
 * skew). Per MAPS_RETINA_AND_CGM_BUILD.md §5.2. */
.ri-examples-gallery .ri-card--demo {
  border-top: 3px solid var(--color-primary);
}
.ri-examples-gallery .ri-card--demo:nth-child(2) {
  border-top-color: var(--color-primary-deep, #1f3b6b);
}
.ri-examples-gallery .ri-card--demo:nth-child(3) {
  border-top-color: var(--color-accent, #2f855a);
}
.ri-examples-gallery .ri-card--demo h3 {
  margin-top: var(--space-2);
}

/* Horizontally-scrolling carousel (§3.2.2). Native CSS scroll-snap;
 * no JS required for core behavior. The optional auto-scroll lives
 * in marketing.js and respects `prefers-reduced-motion: reduce`. */
.ri-carousel {
  position: relative;
  margin-top: var(--space-6);
}
.ri-carousel__track {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--space-4);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Top/bottom padding so the hover-lift transform isn't clipped by
   * overflow-x; horizontal padding to inset the first/last card. */
  padding: var(--space-2) var(--space-1) var(--space-4);
  /* Hide native scrollbar — the snap behavior + drag/swipe is enough
   * UX signaling, and the right-edge fade communicates "more to see". */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ri-carousel__track::-webkit-scrollbar { display: none; }
.ri-carousel__track:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}
.ri-carousel__card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  min-height: 200px;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  /* The thin colored accent rule sits above the card; rendered via
   * a pseudo-element so it doesn't disturb the card's content box. */
  overflow: hidden;
  transition:
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}
.ri-carousel__card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--color-primary);
}
.ri-carousel__card--accent-1::before { background: var(--color-primary); }
.ri-carousel__card--accent-2::before { background: var(--color-primary-deep); }
.ri-carousel__card--accent-3::before { background: var(--color-accent); }
.ri-carousel__card--accent-4::before { background: var(--color-ink); }
.ri-carousel__card--accent-5::before {
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--color-accent) 100%
  );
}
.ri-carousel__card h3 {
  margin: var(--space-1) 0 0;
  font-size: 1.0625rem;
  color: var(--color-ink);
  letter-spacing: -0.01em;
}
.ri-carousel__card p {
  margin: 0;
  color: var(--color-ink-600);
  font-size: 0.9375rem;
  line-height: var(--lh-base);
}
@media (hover: hover) {
  .ri-carousel__card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--color-ink-400);
  }
}
.ri-carousel__card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
@media (min-width: 768px) {
  .ri-carousel__card { flex-basis: 320px; }
}

/* Right-edge fade overlay — strong gradient from transparent to the
 * surrounding section background, signaling that more cards exist
 * off-screen. Pure decoration; pointer-events disabled so it never
 * intercepts the user's scroll/drag/click. Width + opacity ramp
 * tuned per COMPREHENSIVE_REVIEW_BATCH_1.md §5.2 so the right-edge
 * truncation reads as "scroll for more" rather than "broken layout"
 * (the founder reported the v2 fade as too subtle on 3.5-card cuts).
 * The left-edge mirror is intentionally omitted because the first
 * card is always anchored to the left and a visible left fade would
 * imply earlier content. */
.ri-carousel__fade {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 80px;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(248, 249, 251, 0) 0%,
    var(--color-surface-soft, #f8f9fb) 70%,
    var(--color-surface-soft, #f8f9fb) 100%
  );
}
@media (max-width: 720px) {
  .ri-carousel__fade { width: 40px; }
}

/* Scroll cue line beneath the carousel — small muted glyph hint
 * reinforcing the scrollable nature when the right-edge fade alone
 * doesn't make it obvious. Hidden on touch-first viewports where
 * users will swipe naturally. */
.ri-carousel__cue {
  margin: var(--space-3) 0 0;
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-ink-500);
  letter-spacing: 0.02em;
  user-select: none;
}
.ri-carousel__cue-arrow {
  display: inline-block;
  margin-left: 0.25em;
  transition: transform var(--duration-base, 200ms) var(--ease-out, ease-out);
}
.ri-carousel:hover .ri-carousel__cue-arrow {
  transform: translateX(3px);
}

/* `prefers-reduced-motion` discipline — disable scroll-behavior:
 * smooth and the hover-lift transition. Manual scroll/snap still
 * works; the auto-scroll JS already gates itself on this query. */
@media (prefers-reduced-motion: reduce) {
  .ri-carousel__track { scroll-behavior: auto; }
  .ri-carousel__card { transition: none; }
  .ri-carousel__card:hover { transform: none; }
}

/* Inline closing CTA (§3.2.3). Replaces the standalone .ri-cta-strip
 * section that v1 used. Stacks on mobile, side-by-side on desktop. */
.ri-inline-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}
.ri-inline-cta h3 {
  margin: 0 0 var(--space-1);
  font-size: 1.25rem;
}
.ri-inline-cta p { margin: 0; color: var(--color-ink-600); }
.ri-inline-cta__ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
@media (min-width: 720px) {
  .ri-inline-cta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .ri-inline-cta__copy { max-width: 40ch; }
  .ri-inline-cta__ctas { flex-shrink: 0; }
}


/* ========================================================================
 * 18. Footer
 * ======================================================================== */

.ri-footer {
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.72);
  padding: var(--space-16) 0 var(--space-8);
  font-size: 0.875rem;
  line-height: var(--lh-base);
}
.ri-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-10);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
@media (max-width: 880px) {
  .ri-footer__top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}
@media (max-width: 540px) {
  .ri-footer__top { grid-template-columns: 1fr; gap: var(--space-6); }
}
.ri-footer__brand {
  color: white;
  font-weight: var(--fw-bold);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.ri-footer__brand::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--color-primary-soft);
  transform: translateY(-1px) rotate(45deg);
}
.ri-footer__tag {
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 var(--space-3);
  max-width: 36ch;
}
.ri-footer__col h4 {
  color: white;
  font-size: 0.78rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
}
.ri-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.ri-footer__col a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}
.ri-footer__col a:hover {
  color: white;
  text-decoration: none;
}
.ri-footer__bottom {
  padding-top: var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.ri-footer__copy {
  color: rgba(255, 255, 255, 0.50);
  font-size: 0.8125rem;
  margin: 0;
}
.ri-footer__vintage {
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  max-width: 64ch;
  font-size: 0.8125rem;
  line-height: var(--lh-base);
}
.ri-footer__vintage strong {
  color: white;
  font-weight: var(--fw-semibold);
}


/* ========================================================================
 * 19. Flash messages
 * ======================================================================== */

.ri-flash-stack { display: grid; gap: var(--space-3); padding: var(--space-4) 0; }
.ri-flash {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--color-surface-soft);
  font-size: 0.9rem;
}
.ri-flash--danger {
  border-color: var(--color-danger-line);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.ri-flash--success {
  border-color: #a7f3d0;
  background: var(--color-success-soft);
  color: var(--color-success);
}


/* ========================================================================
 * 20. Prose (legal pages, founder note, methodology body)
 * ======================================================================== */

.ri-prose {
  max-width: 70ch;
  font-size: var(--fs-body-lg);
  line-height: var(--lh-prose);
}
.ri-prose p { color: var(--color-ink-700); }
.ri-prose ul, .ri-prose ol {
  padding-left: 1.4em;
  margin: 0 0 var(--space-5);
}
.ri-prose li { margin-bottom: var(--space-2); color: var(--color-ink-700); }
.ri-prose h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-line);
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem);
}
.ri-prose h2:first-child { margin-top: 0; }
.ri-prose h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  font-size: 1.1875rem;
}
.ri-prose strong { color: var(--color-ink); }
.ri-prose blockquote {
  border-left: 3px solid var(--color-primary);
  padding: 4px 0 4px var(--space-4);
  margin: var(--space-5) 0;
  color: var(--color-ink-600);
  font-style: italic;
}
.ri-prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  background: var(--color-surface-tint);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
}
.ri-prose figure {
  margin: var(--space-8) 0;
}
.ri-prose figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-ink-400);
  letter-spacing: 0.04em;
  margin-top: var(--space-3);
}


/* ========================================================================
 * 21. Utilities
 * ======================================================================== */

.ri-mt-2     { margin-top: var(--space-2); }
.ri-mt-4     { margin-top: var(--space-4); }
.ri-mt-6     { margin-top: var(--space-6); }
.ri-mt-8     { margin-top: var(--space-8); }
.ri-mt-12    { margin-top: var(--space-12); }
.ri-mb-0     { margin-bottom: 0; }
.ri-text-muted { color: var(--color-ink-500); }
.ri-text-mono  { font-family: var(--font-mono); }
.ri-tabular    { font-feature-settings: "tnum", "ss01"; }
.ri-screen-only { }
@media print { .ri-screen-only { display: none; } }


/* ========================================================================
 * 22. Map page chrome (pwvmap.html / dexamap.html)
 *
 * Map functional logic stays unchanged. These rules only restyle the
 * surrounding chrome (header, sidebar headings, legend) so the maps
 * inherit the v2 look without their JS being touched.
 * ======================================================================== */

.ri-map-shell {
  padding: 0;
}
.ri-map-meta {
  background: var(--color-surface-soft);
  border-bottom: 1px solid var(--color-line);
  padding: var(--space-4) 0;
}
.ri-map-meta__inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.ri-map-meta h1 {
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
  margin: 0;
  color: var(--color-ink);
}
.ri-map-meta p {
  color: var(--color-ink-500);
  margin: 0;
  font-size: 0.875rem;
}


/* ========================================================================
 * 22b. Homepage cataract map (S1)
 *
 * Static SVG choropleth + side-panel + caveat. Driven by
 * archival_plan/marketing_brief/HOMEPAGE_MAP_SPEC.md §5 / §6. The map is
 * a *picture* — single-hue ramp, no legend, no animation on load. The
 * accent color (terracotta) is reserved for hover / focus only.
 * ======================================================================== */

.ri-section--map {
  background: var(--color-surface);
}

.ri-map-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  position: relative; /* anchor the absolutely-positioned tooltip */
}

.ri-map-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
}

.ri-map-grid__map {
  min-width: 0; /* allow the SVG to shrink inside the grid track */
}

.ri-map-grid__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-2) 0;
}

/* SVG container ------------------------------------------------------------ */

.ri-map {
  width: 100%;
  height: auto;
  display: block;
  /* Aspect ratio of the source viewBox (1015 / 594 ≈ 1.71) keeps the map
     wider than tall — gives the choropleth horizontal room without
     dominating vertical. */
}

.ri-map__states path {
  /* Reset SVG defaults so transitions read on hover. */
  cursor: default;
  outline: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
  transition: fill 120ms ease-out, stroke 120ms ease-out, stroke-width 120ms ease-out;
}

/* 5-step single-hue ramp (HOMEPAGE_MAP_SPEC.md §6.1).
   Step 1 = lightest (lowest-volume); step 5 = brand primary (highest). */
.ri-map__state--q1 { fill: #eef2f7; }
.ri-map__state--q2 { fill: #cdd9e8; }
.ri-map__state--q3 { fill: #8fa8c7; }
.ri-map__state--q4 { fill: #3f5f8f; }
.ri-map__state--q5 { fill: var(--color-primary); }

/* Hover / focus: terracotta accent border, fill darkens one step.
   The single-hue ramp keeps the map calm; the accent border on hover
   is the only "interactive" signal on the surface. */
.ri-map__state:hover,
.ri-map__state:focus-visible {
  stroke: var(--color-accent);
  stroke-width: 2;
  cursor: pointer;
  outline: none;
}
.ri-map__state:focus-visible {
  /* Slight inset glow on top of the brand-accent border, for AA-clear
     keyboard focus visibility. */
  filter: drop-shadow(0 0 0 var(--color-accent));
}
.ri-map__state--q1:hover,
.ri-map__state--q1:focus-visible { fill: #cdd9e8; }
.ri-map__state--q2:hover,
.ri-map__state--q2:focus-visible { fill: #8fa8c7; }
.ri-map__state--q3:hover,
.ri-map__state--q3:focus-visible { fill: #3f5f8f; }
.ri-map__state--q4:hover,
.ri-map__state--q4:focus-visible { fill: var(--color-primary); }
.ri-map__state--q5:hover,
.ri-map__state--q5:focus-visible { fill: var(--color-primary-deep); }

/* Selected (persistent click-state). One state at a time per
   HOMEPAGE_MAP_SPEC.md §8.1: fill darkens by a step, terracotta
   border, kept until the user clicks elsewhere or hits Back. */
.ri-map__state.is-selected {
  stroke: var(--color-accent);
  stroke-width: 2;
}
.ri-map__state--q1.is-selected { fill: #cdd9e8; }
.ri-map__state--q2.is-selected { fill: #8fa8c7; }
.ri-map__state--q3.is-selected { fill: #3f5f8f; }
.ri-map__state--q4.is-selected { fill: var(--color-primary); }
.ri-map__state--q5.is-selected { fill: var(--color-primary-deep); }

/* State-code labels (HOMEPAGE_MAP_SPEC.md §5.2). Pointer-events
   disabled so labels never intercept the click target. */
.ri-map__labels {
  pointer-events: none;
}
.ri-map__label {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
}
.ri-map__label--dark {
  fill: var(--color-ink-700, #1c2733);
}
.ri-map__label--light {
  fill: #ffffff;
}
.ri-map__label--external {
  fill: var(--color-ink-700, #1c2733);
  font-size: 10px;
  font-weight: 700;
}
.ri-map__leader {
  /* Per prompts/MAP_POLISH_DOLLAR_FRAMING_AND_LABELS.md §4.2 +
   * founder direction 2026-05-01: leader lines must read as
   * "intentional connector," not "background line noise." Bumped
   * from var(--color-line) (#e2e8f0, ~88% lightness) to
   * var(--color-ink-400) (#64748b, ~47% lightness) — the closest
   * existing mid-gray token to the prompt's #6f7a8a target.
   * Stroke width nudged 0.75 → 1.0 to match. */
  stroke: var(--color-ink-400, #64748b);
  stroke-width: 1.0;
  fill: none;
  opacity: 0.85;
}
.ri-map__label-box {
  fill: var(--color-surface, #ffffff);
  stroke: var(--color-line, #c8d0db);
  stroke-width: 0.5;
}

/* Side-panel insight rows -------------------------------------------------- */

.ri-map-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ri-map-stat__num {
  font-size: clamp(1.5rem, 1.05rem + 1.4vw, 2.125rem);
  font-weight: var(--fw-bold);
  color: var(--color-ink);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.ri-map-stat__num--prose {
  /* Prose-shape "strong" cell (rare; kept for back-compat). */
  font-size: clamp(1.125rem, 0.85rem + 0.9vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.ri-map-stat__num-sep {
  display: inline-block;
  margin: 0 0.25em;
  color: var(--color-ink-400);
  font-weight: var(--fw-semibold);
}
.ri-map-stat__label {
  font-size: 0.875rem;
  color: var(--color-ink-500);
  line-height: 1.4;
}

/* Block 2 — top-5 list (MAPS_REFINEMENT_AND_CONSULTING.md §2.1).
   The block-header is a row of "Top 5 states" + the aggregate %
   (procedure-specific). The list below is tight: state name on
   the left (body text, weight 500) + share % on the right
   (numeric, weight 600). */
.ri-map-stat--list {
  gap: 6px;
}
.ri-map-stat__list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}
.ri-map-stat__list-head-label {
  font-size: 1rem;
  font-weight: var(--fw-bold);
  color: var(--color-ink);
  letter-spacing: -0.005em;
}
.ri-map-stat__list-head-pct {
  font-size: 1.25rem;
  font-weight: var(--fw-bold);
  color: var(--color-ink);
  letter-spacing: -0.01em;
}
.ri-map-top5 {
  list-style: none;
  margin: 4px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ri-map-top5__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: 2px 0;
  font-size: 0.9375rem;
  line-height: 1.3;
}
.ri-map-top5__name {
  color: var(--color-ink-700);
  font-weight: 500;
}
.ri-map-top5__pct {
  color: var(--color-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* State-detail drilldown panel (HOMEPAGE_MAP_SPEC.md §8.1 +
   MAPS_REFINEMENT_AND_CONSULTING.md §2.2). The panel sits at full
   container width below the map grid; the national side-panel stays
   visible on the right. Smooth height transition on open/close
   honors prefers-reduced-motion via the @media block at the bottom. */

.ri-map-panel__national {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.ri-map-card__detail {
  display: contents; /* layout container only; visibility lives on the inner panel */
}
.ri-map-panel__state {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-5) var(--space-4);
  background: var(--color-surface-soft, rgba(15, 32, 51, 0.025));
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  animation: ri-map-detail-in 180ms var(--ease-out, ease-out);
}
.ri-map-panel__state[hidden] {
  display: none;
}
@keyframes ri-map-detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ri-map-panel__state-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}
.ri-map-panel__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px 6px 8px;
  margin-left: -8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  color: var(--color-ink-700);
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out;
}
.ri-map-panel__back:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-ink);
}
.ri-map-panel__back:focus-visible {
  outline: none;
  border-color: var(--color-accent);
}
.ri-map-panel__back-arrow {
  font-size: 1rem;
  line-height: 1;
}
.ri-map-panel__state-name {
  margin: 0;
  font-size: clamp(1.375rem, 1.05rem + 1vw, 1.75rem);
  font-weight: var(--fw-bold);
  color: var(--color-ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.ri-map-panel__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px 8px;
  font-size: 0.9375rem;
}
.ri-map-panel__stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--color-ink-500);
}
.ri-map-panel__stat strong {
  color: var(--color-ink);
  font-weight: var(--fw-semibold);
}
.ri-map-panel__stat-label {
  font-size: 0.875rem;
}
.ri-map-panel__stat-sep {
  color: var(--color-ink-400);
}
.ri-map-panel__facilities {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* Facility rows reuse the .ri-data-facility / .ri-data-provider visuals
   from the hero card so the drilldown reads as the same component. The
   numeric rank chip was dropped per EXAMPLES_PAGE_AND_SITEMAP_CLEANUP.md
   §2.1: the list is ordered by services desc and the proportional bar
   already communicates ranking; the chip cluttered the row and pushed
   facility names off-center. */
.ri-map-panel__state-foot {
  margin: 0;
  font-style: italic;
  color: var(--color-ink-500);
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* Click-affordance caption — moved INSIDE the map card per
   COMPREHENSIVE_REVIEW_BATCH_2.md §3. Anchored at the top of the
   interactive area, above the choropleth grid. Reads as an in-card
   hint ("this is interactive") rather than a sibling text element
   below the H2. The arrow glyph + small caps register communicate
   "click to do something" without competing visually with the
   choropleth's color encoding.

   Sits inside .ri-map-card; follows the card's padding-top edge.
   The .ri-map-grid below it gets a small top margin to keep the
   choropleth from crowding the caption.

   COLOR: --color-ink-700 deliberately. We trialled --color-ink-500
   (the muted body color) in v1 but the line failed WCAG AA contrast
   on the soft surface; ink-700 reads as "guidance text" without
   demanding eyeball ahead of the choropleth itself. */
.ri-map-card__click-caption {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 8px);
  margin: 0 0 var(--space-3, 12px) 0;
  padding: var(--space-1, 4px) var(--space-3, 12px);
  font-size: 0.85rem;
  font-weight: var(--fw-semibold, 600);
  color: var(--color-ink-700, #1e293b);
  background: var(--color-surface-soft, #f8fafc);
  border: 1px solid var(--color-line, #e2e8f0);
  border-radius: var(--radius-pill, 999px);
  letter-spacing: 0.01em;
}
.ri-map-card__click-caption-arrow {
  display: inline-block;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--color-primary, #1f3b6b);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .ri-map-card__click-caption {
    font-size: 0.78rem;
    padding: 3px var(--space-2, 8px);
    gap: 6px;
  }
}

/* Caveat ------------------------------------------------------------------- */

.ri-map-card__caveat {
  margin: var(--space-6) 0 0 0;
  font-style: italic;
  color: var(--color-ink-500);
  font-size: 0.9375rem;
  text-align: center;
}

/* Tooltip ------------------------------------------------------------------ */

.ri-map-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--color-ink);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  font-size: 0.75rem;
  line-height: 1.3;
  z-index: 5;
  max-width: 240px;
  transition: opacity 120ms ease-out;
  opacity: 0;
}
.ri-map-tooltip[data-visible="true"] {
  opacity: 1;
}
.ri-map-tooltip[hidden] {
  display: none;
}
.ri-map-tooltip__name {
  display: block;
  font-weight: var(--fw-semibold);
}
.ri-map-tooltip__count {
  display: block;
  color: rgba(255, 255, 255, 0.8);
}

/* Mobile (≤768px) ---------------------------------------------------------- */

@media (max-width: 768px) {
  .ri-map-card {
    padding: var(--space-4);
  }
  .ri-map-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .ri-map-stat__num {
    font-size: clamp(1.5rem, 1rem + 3vw, 2rem);
  }
  .ri-map-stat__list-head-pct {
    font-size: 1.125rem;
  }
  .ri-map-card__caveat {
    text-align: left;
  }
  .ri-map-panel__state {
    padding: var(--space-4);
    margin-top: var(--space-4);
  }
  .ri-map-panel__state-head {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .ri-map-panel__stats {
    justify-content: flex-start;
  }
  .ri-map-panel__state-name {
    font-size: 1.375rem;
  }
  .ri-map__label {
    font-size: 9px;
  }
  .ri-map__label--external {
    font-size: 9px;
  }
}

/* Reduced motion ----------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ri-map__states path,
  .ri-map-tooltip {
    transition: none;
  }
  .ri-map-panel__state {
    animation: none;
  }
}


/* ========================================================================
 * 22.5 Soft-engagement secondary CTA (demo pages)
 *
 * Mid-page mini-form on /kneemaps, /cpapmaps, /retinamaps that GET-
 * submits to /contact with ?topic=<slug>&q=<short text> for ad-
 * traffic capture. Per prompts/ADS_LAUNCH_PREP_DEMO_CTAS_AND_PRICING.md
 * §B.5: alt-section background, copy left + form right at >= 720px,
 * stacked at < 720px, ink title (NOT dark-on-dark — we explicitly
 * avoid the legibility regression that previously hit map titles).
 * The submit button reuses the canonical `.ri-btn--primary` so the
 * brand button style stays single-sourced.
 * ======================================================================== */

.ri-soft-cta-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}

.ri-soft-cta-card__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ri-soft-cta-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: var(--fw-semibold, 600);
  line-height: var(--lh-tight, 1.25);
  color: var(--color-ink);
}

.ri-soft-cta-card__sub {
  margin: 0;
  color: var(--color-ink-700);
  font-size: 0.9375rem;
  line-height: var(--lh-base);
}

.ri-soft-cta-card__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ri-soft-cta-card__form textarea {
  width: 100%;
  resize: vertical;
  min-height: 4rem;
  padding: var(--space-3);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: var(--lh-base);
  color: var(--color-ink);
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md, 8px);
}

.ri-soft-cta-card__form textarea:focus {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: 2px;
  border-color: transparent;
}

.ri-soft-cta-card__form button {
  align-self: flex-start;
}

@media (min-width: 720px) {
  .ri-soft-cta-card {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-7, var(--space-6));
  }
  .ri-soft-cta-card__copy {
    flex: 1 1 38%;
    min-width: 0;
  }
  .ri-soft-cta-card__form {
    flex: 1 1 62%;
    min-width: 0;
  }
}


/* ========================================================================
 * 23. Print
 * ======================================================================== */

@media print {
  .ri-topbar, .ri-cta-strip, .ri-disclaimer-sticky, .ri-skip-link,
  .ri-nav__cta, .ri-nav__toggle, .ri-btn { display: none; }
  .ri-footer {
    background: transparent;
    color: var(--color-ink-700);
    padding: var(--space-4) 0;
  }
  .ri-footer__brand,
  .ri-footer__col h4 { color: var(--color-ink); }
  .ri-footer__col a { color: var(--color-ink-700); }
  body.ri-page { color: var(--color-ink); }
  .ri-section { padding: var(--space-4) 0; border: 0; }
  .ri-hero { padding: var(--space-4) 0; background: white; border: 0; }
  .ri-card, .ri-stat, .ri-honesty__col {
    border: 1px solid var(--color-line);
    box-shadow: none;
    break-inside: avoid;
  }
  a { color: var(--color-ink); text-decoration: underline; }
}
