/* RAPP - Referral and Access Precision Policy
   Reuses the demo-site design system (Inter + Plus Jakarta Sans, slate
   neutrals, radius/shadow tokens) so this dashboard belongs to the same
   family, and adds the dark RAPP header, the six-panel grid, and the
   per-need color system shown in the mockup. */

:root {
  /* Brand neutrals + tokens carried over from the demo-site stylesheet */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --hhd-orange: #f1601f;       /* Houston Health Department mark orange */
  --hhd-orange-600: #d94f12;

  --bg: #ffffff;
  --bg-muted: #eef1f4;
  --surface: #ffffff;
  --border: var(--slate-200);
  --border-strong: var(--slate-300);
  --text: var(--slate-900);
  --text-muted: var(--slate-600);
  --text-subtle: var(--slate-500);

  --shadow-xs: 0 1px 2px rgba(13, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(13, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -6px rgba(13, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --container: 1640px;
  --header-height: 84px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;

  /* Need colors (one per ranked NMDoH), carried across every panel */
  --need-blue: #1d6fe0;
  --need-magenta: #e0179f;
  --need-green: #2fa32a;
  --need-orange: #f0a500;
  --need-gray: #8a8f98;
  --need-teal: #0e9aa7;
  --need-purple: #7c3aed;
  --need-brown: #8b5e3c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* The HTML `hidden` attribute must win over explicit display rules (e.g. on
   .btn), otherwise toggling `hidden` in JS has no effect. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-muted);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(29, 111, 224, 0.40);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  background: var(--slate-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* Visually-hidden but available to screen readers (for headings/labels). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------------- Header (dark RAPP banner) ---------------- */
.rapp-header {
  background: linear-gradient(135deg, #ffffff 31%, #ffffff 40%, #0E5C8C 52%, #003767 58%, #00264D 100%);
  border-bottom: 3px solid var(--hhd-orange);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}
.rapp-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 26px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.rapp-brands { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }
.rapp-brand { display: flex; align-items: center; flex: 0 0 auto; }
.rapp-logo { height: 52px; width: auto; }
.rapp-cobrand-divider {
  width: 1px;
  height: 42px;
  background: rgba(150, 158, 167, 0.55);
  flex: 0 0 auto;
}
.rapp-cobrand {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  flex: 0 0 auto;
}
.rapp-cobrand-logo { height: 30px; width: auto; }

@media (max-width: 860px) {
  .rapp-cobrand-divider, .rapp-cobrand { display: none; }
}
.rapp-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  text-align: right;
  letter-spacing: 0.2px;
}
.rapp-title-mark {
  color: var(--hhd-orange);
  font-size: clamp(1.5rem, 2.4vw, 2.5rem);
  text-transform: uppercase;
}
.rapp-title-rest {
  color: #ffffff;
  font-size: clamp(1.05rem, 1.7vw, 1.85rem);
}
.rapp-title-copy { color: #cfd3d8; font-size: 0.85rem; font-style: normal; align-self: flex-start; }

@media (max-width: 720px) {
  .rapp-title-rest { display: none; }
}

/* ---------------- Toolbar (above the grid) ---------------- */
.rapp-toolbar {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rapp-toolbar-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.rapp-state-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--need-green);
  box-shadow: 0 0 0 4px rgba(47, 163, 42, 0.15);
}
.rapp-state-dot.is-template { background: var(--slate-400); box-shadow: 0 0 0 4px rgba(148,163,184,0.18); }
.rapp-toolbar-actions { display: inline-flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 150ms ease, transform 120ms ease, box-shadow 150ms ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(180deg, #2b7bee 0%, var(--need-blue) 100%);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(29, 111, 224, 0.7), var(--shadow-sm);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: #fff;
  color: var(--slate-700);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--slate-50); }

/* ---------------- Six-panel grid ---------------- */
.rapp-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 26px 8px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.25fr) minmax(360px, 1.15fr);
  grid-auto-rows: minmax(420px, auto);
  gap: 18px;
}
@media (max-width: 1180px) {
  .rapp-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .rapp-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.panel-head {
  background: linear-gradient(100deg, #00264D 0%, #003767 55%, #0E5C8C 100%);
  color: #fff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.2px;
}
.panel-tag {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.16);
  color: #f1f5f9;
  white-space: nowrap;
}
.panel-tag.is-generated { background: rgba(47, 163, 42, 0.30); }
.panel-body {
  padding: 16px 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.panel-body.is-flush { padding: 0; display: flex; }

/* ---------------- Panel 1: Client Background ---------------- */
.client-card dl { margin: 0; }
.client-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 4px 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--slate-100);
}
.client-row:last-child { border-bottom: none; }
.client-row dt { font-weight: 700; color: var(--slate-700); }
.client-row dd { margin: 0; color: var(--text); }
.client-list { margin: 2px 0 0; padding-left: 18px; }
.client-list li { margin: 1px 0; }
.client-muted { color: var(--text-subtle); }
.client-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--slate-900);
}

/* ---------------- Panel 2: Graph + Panel 3: Map ---------------- */
/* Absolute-fill inside a flex parent that has a definite height (from the grid
   row), so vis-network and Leaflet always get a real box to draw into. */
.graph-wrap, .map-wrap { position: relative; flex: 1 1 auto; min-height: 320px; }
#agency-graph, #client-map { position: absolute; inset: 0; }
#client-map { background: var(--slate-100); }

.graph-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 4px;
  z-index: 5;
}
.legend-row { display: flex; align-items: center; gap: 7px; }
.legend-glyph { width: 14px; height: 14px; flex: 0 0 auto; }
.legend-circle { border-radius: 50%; background: var(--need-gray); }
.legend-tri {
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid var(--slate-900);
}
.legend-arrow { color: var(--slate-700); font-weight: 700; }

.map-note {
  position: absolute;
  left: 12px;
  bottom: 12px;
  right: 12px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  z-index: 500;
}
.map-note strong { color: var(--slate-700); }

/* Map pin glyphs (Leaflet divIcons) */
.pin-star { font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ---------------- Panel 4: Ranked NMDoH ---------------- */
.nmdoh-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.nmdoh-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--slate-50);
}
.nmdoh-rank {
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 18px;
  text-align: center;
}
.nmdoh-label { flex: 1 1 auto; font-weight: 700; }
.nmdoh-item.is-unmapped .nmdoh-label { font-weight: 600; }
.nmdoh-unmapped-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-subtle);
  background: var(--slate-100);
  border-radius: var(--radius-full);
  padding: 2px 7px;
  font-weight: 700;
}
.nmdoh-ctrl {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--slate-400);
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 6px;
  /* Accessible touch target */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}
.nmdoh-ctrl:hover { color: var(--slate-700); background: var(--slate-100); }
.nmdoh-ctrl[disabled] { opacity: 0.3; cursor: default; }

.nmdoh-add { display: flex; gap: 8px; margin-bottom: 14px; }
.nmdoh-select {
  flex: 1 1 auto;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}
.depression {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  border: 1px solid var(--border);
  font-size: 1rem;
}
.depression-label { color: var(--text-muted); font-weight: 600; }
.depression-value { font-weight: 800; font-family: var(--font-display); }
.depression.risk-high { background: #fef2f2; border-color: #fecaca; }
.depression.risk-high .depression-value { color: #b91c1c; }
.depression.risk-moderate { background: #fffbeb; border-color: #fde68a; }
.depression.risk-moderate .depression-value { color: #b45309; }
.depression.risk-low { background: #ecfdf5; border-color: #a7f3d0; }
.depression.risk-low .depression-value { color: #047857; }

/* ---------------- Panel 5: Agency Navigation ---------------- */
.nav-empty, .strategy-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 220px;
  color: var(--text-subtle);
  gap: 8px;
  padding: 20px;
}
.nav-empty svg, .strategy-empty svg { color: var(--slate-300); }
.nav-empty strong, .strategy-empty strong { color: var(--slate-600); font-size: 1rem; }

.nav-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 14px;
}
.nav-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 340px;
}
.nav-support {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.nav-support-chip {
  text-align: center;
  font-size: 0.78rem;
  color: var(--slate-600);
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  line-height: 1.2;
  max-width: 280px;
}
.nav-connector { color: var(--slate-400); font-size: 0.85rem; line-height: 1; }
.nav-primary {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  text-align: center;
  padding: 6px 4px;
}
.nav-arrow {
  display: flex;
  justify-content: center;
  color: var(--slate-800);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  padding: 2px 0;
}

/* ---------------- Panel 6: Tailored Strategy ---------------- */
.strategy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.strategy-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.strategy-group[open] { box-shadow: var(--shadow-sm); }
.strategy-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  list-style: none;
  user-select: none;
  border-radius: var(--radius-md);
  transition: background 150ms ease;
}
.strategy-group-head::-webkit-details-marker { display: none; }
.strategy-group-head:hover { background: var(--slate-50); }
.strategy-group-head:focus-visible { outline: 3px solid rgba(29, 111, 224, 0.40); outline-offset: -3px; }
.strategy-group-count {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-subtle);
  background: var(--slate-100);
  border-radius: var(--radius-full);
  padding: 2px 9px;
}
.strategy-chevron { flex: 0 0 auto; color: var(--slate-400); transition: transform 200ms ease; }
.strategy-group[open] .strategy-chevron { transform: rotate(180deg); }
.strategy-group-body { padding: 0 13px 13px; }
.strategy-step-num { font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
  .strategy-chevron { transition: none; }
}
.strategy-actions { margin: 6px 0 0; padding-left: 26px; }
.strategy-actions li { margin: 4px 0; color: var(--slate-700); }
.strategy-actions li::marker { color: var(--slate-400); }

/* ---------------- Need color utility classes ---------------- */
.c-blue { color: var(--need-blue); }
.c-magenta { color: var(--need-magenta); }
.c-green { color: var(--need-green); }
.c-orange { color: var(--need-orange); }
.c-gray { color: var(--need-gray); }
.c-teal { color: var(--need-teal); }
.c-purple { color: var(--need-purple); }
.c-brown { color: var(--need-brown); }

.swatch {
  width: 13px; height: 13px; border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}

/* ---------------- Footer ---------------- */
.rapp-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 10px;
  color: var(--text-subtle);
  font-size: 0.82rem;
  background: transparent;
}
.rapp-footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rapp-footer-mockup {
  font-style: italic;
  color: var(--slate-400);
  font-weight: 600;
}

/* ============================================================
   Clients: toolbar chip, wizard, and directory
   ============================================================ */

.rapp-seed-chip {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--need-blue);
  background: rgba(29, 111, 224, 0.10);
  border: 1px solid rgba(29, 111, 224, 0.25);
  border-radius: var(--radius-full);
  padding: 2px 9px;
  margin-left: 4px;
}

.btn-ghost-link {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost-link:hover { color: var(--need-blue); background: var(--slate-50); }

/* ---------------- Wizard ---------------- */
.wizard-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 26px 40px;
}
.wizard-head { text-align: center; margin-bottom: 18px; }
.wizard-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--slate-900);
}
.wizard-sub { color: var(--text-muted); max-width: 560px; margin: 6px auto 0; }

.wizard-steps {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 6px;
  margin: 0 0 18px;
  padding: 0;
}
.wizard-step-pip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-subtle);
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.wizard-step-pip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--slate-100);
  color: var(--slate-500);
  font-weight: 800;
  font-size: 0.78rem;
}
.wizard-step-pip.is-active { color: var(--need-blue); border-color: rgba(29,111,224,0.4); box-shadow: var(--shadow-sm); }
.wizard-step-pip.is-active span { background: var(--need-blue); color: #fff; }
.wizard-step-pip.is-done span { background: var(--need-green); color: #fff; }

.wizard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px;
}
.wizard-panel { display: none; }
.wizard-panel.is-active { display: block; animation: wizardfade 180ms ease; }
@keyframes wizardfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.wizard-h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--slate-900);
}
.wizard-field { margin-bottom: 16px; }
.wizard-field > label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--slate-700);
  margin-bottom: 6px;
}
.wizard-field .req { color: var(--danger-600, #dc2626); }
.wizard-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
}
select.wizard-input { cursor: pointer; }
.wizard-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .wizard-grid-2 { grid-template-columns: 1fr; } }

.wizard-hint { font-size: 0.8rem; color: var(--text-subtle); margin: 7px 0 0; }
.wizard-err { font-size: 0.82rem; color: #b91c1c; margin: 7px 0 0; font-weight: 600; }
.wizard-empty { font-size: 0.85rem; color: var(--text-subtle); margin: 10px 0 0; }

.wizard-add-row { display: flex; gap: 8px; }
.wizard-add-row .wizard-input { flex: 1 1 auto; }
.wizard-add-row .btn { flex: 0 0 auto; }

.wizard-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wizard-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 6px 5px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
}
.wizard-chip-x {
  border: none; background: transparent; cursor: pointer;
  color: var(--slate-400); font-size: 1rem; line-height: 1;
  padding: 2px 5px; border-radius: 50%;
}
.wizard-chip-x:hover { color: #b91c1c; background: #fee2e2; }

.wizard-review dl { margin: 0; }
.wizard-review-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--slate-100);
}
.wizard-review-row dt { font-weight: 700; color: var(--slate-700); }
.wizard-review-row dd { margin: 0; color: var(--text); }
.wizard-review .muted { color: var(--text-subtle); }

.wizard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.wizard-actions-spacer { flex: 1 1 auto; }

/* ---------------- Client directory ---------------- */
.directory-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 26px 44px;
}
.directory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.directory-title { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--slate-900); }
.directory-sub { color: var(--text-muted); margin-top: 4px; }

.directory-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 8px 10px 8px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  color: var(--slate-400);
}
.directory-search input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: transparent;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.client-card-link {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 150ms ease, transform 120ms ease, border-color 150ms ease;
}
.client-card-link:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.client-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.client-card-name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--slate-900); }
.client-card-badge {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 800;
  color: var(--need-blue); background: rgba(29,111,224,0.10);
  border-radius: var(--radius-full); padding: 2px 8px;
}
.client-card-meta { color: var(--text-muted); font-size: 0.85rem; margin-top: 3px; }
.client-card-addr { color: var(--text); font-size: 0.9rem; margin-top: 8px; }
.client-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--slate-100);
}
.client-card-needs { font-size: 0.8rem; color: var(--text-subtle); font-weight: 600; }
.client-card-open { font-size: 0.85rem; color: var(--need-blue); font-weight: 700; }

.directory-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* ============================================================
   Navigation bar + settings dropdown
   ============================================================ */
.rapp-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: var(--header-height);
  z-index: 30;
}
.rapp-nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 26px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.rapp-nav-links { display: flex; align-items: center; gap: 4px; height: 100%; }
.rapp-nav-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.rapp-nav-link:hover { color: var(--need-blue); }
.rapp-nav-link.is-active { color: var(--slate-900); border-bottom-color: var(--hhd-orange); }

.rapp-nav-settings { position: relative; }
.rapp-gear {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--slate-700);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.rapp-gear:hover { background: var(--slate-50); color: var(--need-blue); }
.rapp-gear svg { transition: transform 200ms ease; }
.rapp-gear[aria-expanded="true"] svg { transform: rotate(45deg); }

.rapp-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 50;
}
.rapp-menu-head {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text-subtle);
  padding: 6px 10px 4px;
}
.rapp-menu-item {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.rapp-menu-item:hover { background: var(--slate-50); color: var(--need-blue); }
.rapp-menu-item.is-active { color: var(--need-blue); background: var(--utmb-blue-50, rgba(29,111,224,0.08)); }
.rapp-menu-signout { margin-top: 4px; border-top: 1px solid var(--border); color: var(--slate-600); }
.rapp-menu-signout:hover { color: #b91c1c; }

@media (max-width: 600px) { .rapp-gear-label { display: none; } }

/* ============================================================
   Settings: agencies admin
   ============================================================ */
.settings-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 26px 44px; }
.settings-wrap-narrow { max-width: 760px; }
.settings-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.settings-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text-subtle);
  margin-bottom: 2px;
}
.settings-eyebrow a { color: var(--need-blue); text-decoration: none; }
.settings-title { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--slate-900); }
.settings-sub { color: var(--text-muted); margin-top: 4px; max-width: 640px; }
.settings-count { color: var(--text-subtle); font-size: 0.85rem; margin: 0 0 10px; }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.agency-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.agency-table thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--slate-50);
  white-space: nowrap;
}
.agency-table td { padding: 12px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: top; }
.agency-table tbody tr:last-child td { border-bottom: none; }
.agency-table tbody tr:hover { background: var(--slate-50); }
.agency-name { display: block; font-weight: 700; color: var(--slate-900); }
.agency-id { display: block; font-size: 0.74rem; color: var(--text-subtle); font-family: ui-monospace, Menlo, monospace; }
.ta-actions { white-space: nowrap; }
.ta-actions .btn { margin-left: 6px; }

.type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.type-community { background: rgba(47,163,42,0.14); color: #1a7d1a; }
.type-government { background: rgba(29,111,224,0.12); color: #1857b3; }

.need-chips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 460px; }
.need-chip {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--slate-100);
  color: var(--slate-600);
  white-space: nowrap;
}
.need-chip.is-primary { background: rgba(29,111,224,0.12); color: var(--need-blue); }
.loc-yes { color: var(--need-green); font-weight: 600; }
.muted { color: var(--text-subtle); }

.btn-small { height: 32px; padding: 0 12px; font-size: 0.82rem; }
.btn-danger { background: #fff; color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }

/* Needs matrix in the agency form */
.needs-matrix { width: 100%; border-collapse: collapse; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.needs-matrix th, .needs-matrix td { padding: 8px 12px; border-bottom: 1px solid var(--slate-100); text-align: left; font-size: 0.9rem; }
.needs-matrix thead th { background: var(--slate-50); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-subtle); }
.needs-matrix tbody tr:last-child td { border-bottom: none; }
.needs-matrix .nm-col { text-align: center; width: 88px; }
.needs-matrix input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; accent-color: var(--need-blue); }

/* ============================================================
   Editable Client Background (Panel 1) + auto-save status
   ============================================================ */
.panel-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}
.panel-edit-btn:hover { background: rgba(255,255,255,0.22); }

.rapp-save-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 4px;
}
.rapp-save-status.is-saving { color: var(--text-subtle); }
.rapp-save-status.is-saved { color: var(--need-green); }
.rapp-save-status.is-error { color: #b91c1c; }

.bg-form { display: block; }
.bg-field { margin-bottom: 12px; }
.bg-field > label {
  display: block;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--slate-700);
  margin-bottom: 4px;
}
.bg-input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}
select.bg-input { cursor: pointer; }
.bg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bg-add { display: flex; gap: 6px; }
.bg-add .bg-input { flex: 1 1 auto; }
.bg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Panel 4: subtype + risk readouts (SDoH subtype engine)
   ============================================================ */
.risk-block { display: grid; gap: 10px; }
.subtype-head { display: flex; flex-direction: column; gap: 1px; }
.subtype-eyebrow { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; color: var(--text-subtle); }
.subtype-name { font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; color: var(--slate-900); }
.subtype-name.muted { color: var(--text-subtle); font-weight: 600; }
.subtype-cluster { font-size: 0.72rem; font-weight: 700; color: var(--text-subtle); background: var(--slate-100); border-radius: var(--radius-full); padding: 2px 7px; margin-left: 4px; vertical-align: middle; }

.risk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.risk-readout { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; background: var(--slate-50); }
.risk-label { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; line-height: 1.2; }
.risk-value { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; }
.risk-adj { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--slate-300); color: #fff; font-size: 0.7rem; cursor: help; }

.band-high { background: #fef2f2; border-color: #fecaca; } .band-high .risk-value { color: #b91c1c; }
.band-medium-high { background: #fff7ed; border-color: #fed7aa; } .band-medium-high .risk-value { color: #c2410c; }
.band-medium { background: #fffbeb; border-color: #fde68a; } .band-medium .risk-value { color: #b45309; }
.band-lower { background: #ecfdf5; border-color: #a7f3d0; } .band-lower .risk-value { color: #047857; }
.band-unknown { background: var(--slate-50); border-color: var(--border); } .band-unknown .risk-value { color: var(--text-subtle); }

.medicaid-banner { display: flex; align-items: flex-start; gap: 8px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; border-radius: var(--radius-md); padding: 9px 11px; font-size: 0.85rem; font-weight: 600; }
.medicaid-banner svg { flex: 0 0 auto; margin-top: 1px; }

.screening { border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 9px 11px; background: #fff; }
.screening-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; color: var(--text-subtle); margin-bottom: 4px; }
.screening-row { font-size: 0.85rem; color: var(--slate-700); margin: 2px 0; }
.screening-cluster { font-weight: 700; }

.risk-provenance { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-subtle); cursor: help; }
.info-dot { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--slate-300); color: #fff; font-style: italic; font-weight: 700; font-size: 0.7rem; }

/* Panel 6 emphasis + priority star */
.emphasis-block { background: var(--utmb-blue-50, #eff6ff); border: 1px solid #cfe0fb; border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 12px; }
.emphasis-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 800; color: var(--need-blue); margin-bottom: 4px; }
.emphasis-text { font-size: 0.85rem; color: var(--slate-700); margin: 4px 0 0; }
.priority-star { color: var(--need-blue); font-size: 0.85rem; margin-left: 4px; }

/* ============================================================
   Settings: subtypes / clustering / thresholds
   ============================================================ */
.settings-section-title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--slate-900); margin: 28px 0 4px; }
.settings-hint { color: var(--text-subtle); font-size: 0.85rem; margin: 0 0 12px; max-width: 760px; }

.cluster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cluster-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px; }
.cluster-card-head { font-family: var(--font-display); font-weight: 800; margin-bottom: 10px; color: var(--slate-900); }
.cluster-factors { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.factor-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; font-weight: 600; padding: 3px 4px 3px 9px; border-radius: var(--radius-full); background: var(--slate-100); color: var(--slate-600); }
.factor-chip.is-catalog { background: rgba(29,111,224,0.10); color: var(--need-blue); }
.factor-chip-x { border: none; background: transparent; cursor: pointer; color: inherit; opacity: 0.55; font-size: 0.95rem; line-height: 1; padding: 0 3px; border-radius: 50%; }
.factor-chip-x:hover { opacity: 1; color: #b91c1c; }
.cluster-add { display: flex; gap: 6px; }
.cluster-add .wizard-input { height: 34px; font-size: 0.85rem; }
.factor-add-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0 0; }
.factor-add-row .wizard-input { max-width: 320px; height: 36px; }
.inline-check { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; color: var(--slate-700); font-weight: 600; }
.inline-check input { width: 16px; height: 16px; accent-color: var(--need-blue); }

.form-actions-row { margin-top: 12px; }
.thresholds-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px; }
.thresholds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.thresholds-col-title { font-weight: 700; font-size: 0.85rem; color: var(--slate-700); margin-bottom: 8px; }
.th-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.85rem; color: var(--slate-700); margin-bottom: 8px; }
.th-input { max-width: 110px; height: 32px; }

/* Agency address + phone cell (Agencies settings) */
.agency-addr-cell .agency-addr { display: block; }
.agency-phone { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.agency-phone::before { content: "\260E\00a0"; opacity: 0.6; }

/* Multiple agency locations: map sub-dot + admin list */
.pin-dot.pin-sub { background: #fff; border-width: 3px; width: 12px; height: 12px; }
.loc-pin { color: var(--need-green); font-size: 0.85rem; }
.loc-warn { font-size: 0.7rem; color: var(--text-subtle); font-style: italic; }

.locations-card { margin-top: 18px; }
.loc-section-title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--slate-900); display: flex; align-items: center; gap: 8px; }
.loc-count { font-size: 0.8rem; font-weight: 700; color: var(--need-blue); background: rgba(29,111,224,0.10); border-radius: var(--radius-full); padding: 1px 9px; }
.loc-list { display: grid; gap: 8px; margin: 12px 0 18px; }
.loc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--slate-50); }
.loc-row.is-main { border-color: rgba(29,111,224,0.35); background: rgba(29,111,224,0.05); }
.loc-label { font-weight: 700; color: var(--slate-800); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.loc-badge { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 800; color: var(--need-blue); background: rgba(29,111,224,0.12); border-radius: var(--radius-full); padding: 1px 7px; }
.loc-src { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-subtle); background: var(--slate-100); border-radius: var(--radius-full); padding: 1px 7px; }
.loc-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.loc-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.loc-add { border-top: 1px solid var(--border); padding-top: 14px; }
.loc-add-title { font-size: 0.95rem; font-weight: 800; color: var(--slate-800); margin-bottom: 10px; }

/* Network graph node popup (click a node) */
.graph-popup {
  position: absolute;
  z-index: 20;
  min-width: 180px;
  max-width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 10px 12px 11px;
  font-size: 0.82rem;
  color: var(--slate-700);
}
.graph-popup-x {
  position: absolute;
  top: 4px; right: 4px;
  border: none; background: transparent; cursor: pointer;
  color: var(--slate-400); font-size: 1rem; line-height: 1;
  padding: 2px 5px; border-radius: 6px;
}
.graph-popup-x:hover { color: var(--slate-700); background: var(--slate-100); }
.graph-popup-name { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; color: var(--slate-900); padding-right: 16px; }
.graph-popup-type { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-subtle); font-weight: 700; margin: 1px 0 6px; }
.graph-popup-locs { display: grid; gap: 8px; max-height: 200px; overflow: auto; }
.graph-popup-loc { padding-left: 8px; border-left: 2px solid var(--border-strong); line-height: 1.35; }
.graph-popup-loc-label { font-weight: 700; color: var(--slate-800); }
.graph-popup-empty { color: var(--text-subtle); font-style: italic; }

/* Agencies table: full location list per row */
.loc-count-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; color: var(--need-blue); margin-bottom: 4px; }
.addr-loc-list { display: grid; gap: 5px; max-height: 168px; overflow: auto; }
.addr-loc { display: flex; align-items: baseline; gap: 6px; line-height: 1.3; }
.addr-loc-tag { flex: 0 0 auto; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 800; color: var(--need-blue); background: rgba(29,111,224,0.10); border-radius: var(--radius-full); padding: 1px 6px; }
.addr-loc-tag.sub { color: var(--text-subtle); background: var(--slate-100); }
.addr-loc-text { flex: 1 1 auto; }

/* Nav step + strategy: agency location (nearest site) */
.nav-mid { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nav-addr { font-size: 0.7rem; color: var(--text-muted); text-align: center; line-height: 1.25; max-width: 130px; }
.nav-addr-count { font-weight: 700; color: var(--need-blue); }
.strategy-contact { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 2px 0 6px 26px; font-size: 0.82rem; }
.strategy-addr { color: var(--text-muted); }
.strategy-phone { font-weight: 600; }
.strategy-nearest { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 700; color: var(--text-subtle); background: var(--slate-100); border-radius: var(--radius-full); padding: 1px 7px; }

/* Agencies table: compact address summary + expandable locations grid */
.addr-summary { display: flex; align-items: baseline; gap: 6px; }
.addr-summary-phone { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.addr-summary-site { font-size: 0.8rem; margin-top: 2px; }
.addr-summary-site a { color: var(--need-blue); font-weight: 600; text-decoration: none; }
.addr-summary-site a:hover { text-decoration: underline; }
.addr-summary-site.muted { color: var(--text-subtle); }
.strategy-site { font-weight: 600; color: var(--need-blue); text-decoration: none; }
.strategy-site:hover { text-decoration: underline; }
.graph-popup-site { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border); font-size: 0.8rem; }
.graph-popup-site a { color: var(--need-blue); font-weight: 600; text-decoration: none; }
.graph-popup-site a:hover { text-decoration: underline; }
.loc-toggle {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border-strong); background: #fff;
  color: var(--need-blue); font-weight: 700; font-size: 0.76rem;
  padding: 3px 10px; border-radius: var(--radius-full); cursor: pointer;
}
.loc-toggle:hover { background: var(--slate-50); }
.loc-toggle-caret { transition: transform 150ms ease; }
.loc-toggle.is-open .loc-toggle-caret { transform: rotate(180deg); }

.loc-detail-row > td { background: var(--slate-50); padding: 14px 16px !important; border-bottom: 1px solid var(--border); }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.loc-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; box-shadow: var(--shadow-xs); }
.loc-card.is-main { border-color: rgba(29,111,224,0.35); }
.loc-card-head { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.loc-card-label { font-weight: 800; font-size: 0.82rem; color: var(--slate-800); }
.loc-card-src { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 800; color: var(--text-subtle); background: var(--slate-100); border-radius: var(--radius-full); padding: 1px 6px; }
.loc-card-addr { font-size: 0.84rem; color: var(--slate-700); line-height: 1.35; }
.loc-card-phone { font-size: 0.82rem; font-weight: 600; display: inline-block; margin-top: 4px; }

/* Strategy: per-agency stop cards within each need group */
.strategy-stops { display: grid; gap: 9px; margin-top: 7px; }
.strategy-stop { padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--slate-50); }
.strategy-stop.is-primary { background: #fff; border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.strategy-stop-name { font-family: var(--font-display); font-weight: 800; font-size: 0.92rem; }
.strategy-stop .strategy-contact { margin: 3px 0 0; }
.strategy-stop .strategy-actions { margin: 6px 0 0; padding-left: 20px; }
.strategy-stop .strategy-actions li { margin: 3px 0; }

/* Conditions: agency form checkbox grid + strategy "addresses" chips */
.cond-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; margin-top: 8px; }
.cond-check { display: flex; align-items: center; gap: 7px; font-size: 0.88rem; color: var(--slate-700); }
.cond-check input { width: 16px; height: 16px; accent-color: var(--need-blue); }
.strategy-conditions { margin-top: 5px; font-size: 0.8rem; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.cond-chip { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); background: #fef2f2; color: #b91c1c; }

/* Strategy: proximity-ranked nearby agencies for a need (reassessment) */
.strategy-nearby { margin-top: 10px; padding: 9px 11px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: #fff; }
.strategy-nearby-title { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 800; color: var(--text-subtle); margin-bottom: 6px; }
.nearby-row { display: flex; align-items: baseline; gap: 9px; padding: 3px 0; }
.nearby-dist { flex: 0 0 auto; font-weight: 800; font-size: 0.72rem; color: var(--need-blue); background: rgba(29,111,224,0.10); border-radius: var(--radius-full); padding: 1px 8px; min-width: 48px; text-align: center; }
.nearby-body { font-size: 0.84rem; line-height: 1.3; }
.nearby-name { font-weight: 700; color: var(--slate-800); }
.nearby-addr { color: var(--text-muted); margin-left: 6px; }

/* ============================================================
   Error pages (404 / 500)
   ============================================================ */
.error-page { max-width: 540px; margin: clamp(48px, 10vw, 120px) auto; padding: 0 24px; text-align: center; }
.error-code { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 8vw, 5rem); line-height: 1; color: var(--need-blue); }
.error-title { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--slate-900); margin: 8px 0 0; }
.error-message { margin: 12px 0 0; color: var(--text-muted); line-height: 1.6; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ============================================================
   Login page
   ============================================================ */
.login-body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(14, 92, 140, 0.45), transparent 60%),
    radial-gradient(800px 480px at 100% 100%, rgba(241, 96, 31, 0.18), transparent 60%),
    linear-gradient(160deg, #00264D 0%, #003767 45%, #0E5C8C 100%);
}
.login-shell { width: 100%; max-width: 420px; }
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -20px rgba(0, 12, 28, 0.55), var(--shadow-md);
  padding: clamp(26px, 5vw, 38px);
  text-align: center;
}
.login-brands { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; }
.login-logo { height: 46px; width: auto; }
.login-divider { width: 1px; height: 34px; background: var(--border-strong); }
.login-cobrand { height: 34px; width: auto; }
.login-title-row { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.login-mark { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 1.5rem; color: var(--hhd-orange); letter-spacing: -0.01em; }
.login-rest { font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; color: var(--slate-700); }
.login-heading { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--slate-900); margin: 18px 0 4px; }
.login-sub { margin: 0 0 22px; color: var(--text-muted); font-size: 0.95rem; }
.login-label { display: block; text-align: left; font-weight: 700; font-size: 0.85rem; color: var(--slate-800); margin-bottom: 7px; }
.login-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #fff;
}
.login-input:focus-visible { outline: none; border-color: var(--need-blue); box-shadow: 0 0 0 3px rgba(29, 111, 224, 0.18); }
.login-help { display: block; text-align: left; margin-top: 7px; font-size: 0.8rem; color: var(--text-subtle); }
.login-error {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
}
.login-submit { width: 100%; height: 46px; margin-top: 18px; gap: 8px; }
.login-footnote { margin: 20px 0 0; font-size: 0.76rem; color: var(--text-subtle); }

/* ============================================================
   Landing / home page
   ============================================================ */
.home-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}
.home-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--need-blue);
}

/* ---- Hero ---- */
.home-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(900px 520px at 10% 0%, rgba(16, 185, 129, 0.18), transparent 60%),
    radial-gradient(800px 480px at 100% 100%, rgba(202, 75, 12, 0.14), transparent 60%),
    linear-gradient(160deg, #00264D 0%, #003767 45%, #0E5C8C 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: clamp(40px, 6vw, 84px) 0 clamp(44px, 6vw, 80px);
}
/* faint dot texture for depth on the dark hero */
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.6;
}
.home-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  padding: 6px 13px;
}
.home-badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hhd-orange);
  box-shadow: 0 0 0 4px rgba(241, 96, 31, 0.15);
}
.home-hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-size: clamp(2.05rem, 1.3rem + 3.1vw, 3.25rem);
  color: #fff;
  margin: 18px 0 0;
}
.home-hero-sub {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.62em;
  letter-spacing: -0.01em;
}
.home-lede {
  margin: 18px 0 0;
  max-width: 50ch;
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.15rem);
  line-height: 1.62;
  color: rgba(255, 255, 255, 0.84);
}
.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.home-cta { height: 46px; padding: 0 22px; font-size: 0.95rem; }
.home-cta-tertiary {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}
.home-cta-tertiary:hover { color: #fff; }

/* Hero demo visual */
.home-hero-demo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.home-demo-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px 18px;
}
.home-demo-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin-bottom: 10px;
}
.home-demo-needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.home-demo-needs li {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 0.92rem; color: var(--slate-800);
}
.home-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.home-demo-risk {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border-strong);
  font-size: 0.82rem; color: var(--slate-600); display: flex; justify-content: space-between; align-items: center;
}
.home-demo-risk strong { color: #b91c1c; font-weight: 800; }
.home-demo-arrow {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: rgba(255, 255, 255, 0.85); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.home-demo-plan { border-color: rgba(29, 111, 224, 0.30); }
.home-demo-stop { padding: 8px 0; }
.home-demo-stop + .home-demo-stop { border-top: 1px solid var(--border); }
.home-demo-stop-name { font-weight: 700; color: var(--slate-900); font-size: 0.94rem; }
.home-demo-stop-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.home-demo-stop.subdued .home-demo-stop-name { color: var(--slate-600); font-weight: 600; }
.home-demo-stop-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.home-demo-stop-tags span {
  font-size: 0.7rem; font-weight: 600; color: var(--slate-600);
  background: var(--slate-100); border-radius: var(--radius-full); padding: 2px 9px;
}
.home-demo-stop-tags .cond { color: #b45309; background: rgba(240, 165, 0, 0.16); }

/* ---- Generic section ---- */
.home-section { padding: clamp(46px, 6.5vw, 84px) 0; }
.home-section-alt {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.home-section-head { max-width: 640px; margin: 0 auto clamp(28px, 4vw, 48px); text-align: center; }
.home-section-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.018em;
  font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.1rem);
  color: var(--slate-900);
  margin-top: 10px;
}
.home-section-lede {
  margin: 12px auto 0;
  max-width: 56ch;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ---- How it works (steps) ---- */
.home-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  counter-reset: none;
}
.home-step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.home-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.home-step-num {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  color: #fff; background: linear-gradient(180deg, #2b7bee 0%, var(--need-blue) 100%);
  box-shadow: 0 8px 18px -8px rgba(29, 111, 224, 0.7);
}
.home-step h3 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; color: var(--slate-900); margin: 16px 0 6px; }
.home-step p { margin: 0; color: var(--text-muted); line-height: 1.55; font-size: 0.92rem; }

/* ---- Features grid ---- */
.home-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.home-feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.home-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.home-feat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  color: var(--fi, var(--need-blue));
  background: color-mix(in srgb, var(--fi, var(--need-blue)) 12%, white);
  border: 1px solid color-mix(in srgb, var(--fi, var(--need-blue)) 22%, white);
}
.home-feature h3 { font-family: var(--font-display); font-size: 1.06rem; font-weight: 700; color: var(--slate-900); margin: 14px 0 6px; }
.home-feature p { margin: 0; color: var(--text-muted); line-height: 1.55; font-size: 0.9rem; }

/* ---- Research basis ---- */
.home-research {
  padding: clamp(46px, 6.5vw, 84px) 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.home-research .home-section-lede em,
.home-method-copy em,
.home-researcher-copy em { font-style: italic; }

/* Researcher spotlight (the award + the story) */
.home-researcher {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(29, 111, 224, 0.06), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f6f9fe 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(20px, 3vw, 34px);
  margin-bottom: clamp(36px, 5vw, 60px);
}
.home-researcher-photo { margin: 0; }
.home-researcher-photo img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center top;
}
.home-researcher-photo figcaption {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-subtle);
  line-height: 1.4;
}
.home-award-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(110deg, #00264D 0%, #0E5C8C 100%);
  box-shadow: 0 10px 22px -12px rgba(0, 38, 77, 0.7);
}
.home-award-badge svg { color: #f5c518; flex: 0 0 auto; }  /* gold star */
.home-researcher-copy h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.55rem);
  color: var(--slate-900);
  margin: 14px 0 10px;
}
.home-researcher-copy p {
  margin: 0 0 11px;
  color: var(--text-muted);
  line-height: 1.62;
  font-size: 0.96rem;
}
.home-researcher-copy strong { color: var(--slate-900); font-weight: 700; }

/* Sub-head introducing the four subtypes */
.home-research-subhead { max-width: 640px; margin: 0 auto 22px; text-align: center; }
.home-research-subhead h3 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.5rem); color: var(--slate-900);
}
.home-research-subhead p { margin: 8px 0 0; color: var(--text-muted); line-height: 1.55; }

.home-subtypes {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.home-subtype {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--sc, var(--need-orange));
  border-radius: var(--radius-md);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-xs);
}
.home-subtype-label { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--slate-900); }
.home-subtype-desc { margin: 7px 0 11px; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.home-subtype-risk { font-size: 0.72rem; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.04em; }
.home-subtype-risk .band { font-weight: 800; }
.home-subtype-risk .band.high { color: #b91c1c; }
.home-subtype-risk .band.medhigh { color: #c2410c; }
.home-subtype-risk .band.med { color: #b45309; }
.home-subtype-risk .band.lower { color: var(--need-green); }
.home-research-method {
  margin-top: 18px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(20px, 3vw, 28px);
}
.home-method-copy h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; color: var(--slate-900); margin: 0 0 8px; }
.home-method-copy p { margin: 0; color: var(--text-muted); line-height: 1.6; font-size: 0.92rem; }
.home-method-cite { margin-top: 12px !important; font-size: 0.82rem; color: var(--slate-600); line-height: 1.55; }
.home-cite-src { font-style: italic; }
.home-method-cite a { color: var(--need-blue); font-weight: 600; text-decoration: none; white-space: nowrap; }
.home-method-cite a:hover { text-decoration: underline; }
.home-method-note {
  background: #fff8f3;
  border: 1px solid #f3d8c4;
  border-radius: var(--radius-md);
  padding: 16px 16px;
}
.home-method-note-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; color: #9a3412;
  margin-bottom: 8px;
}
.home-method-note-head svg { color: var(--hhd-orange); flex: 0 0 auto; }
.home-method-note p { margin: 0; font-size: 0.84rem; line-height: 1.55; color: var(--slate-600); }

/* ---- Stats band ---- */
.home-stats {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(241, 96, 31, 0.18), transparent 55%),
    linear-gradient(110deg, var(--slate-900) 0%, #14213a 60%, #0b1120 100%);
}
.home-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-top: clamp(34px, 4vw, 52px); padding-bottom: clamp(34px, 4vw, 52px);
  gap: 18px;
}
.home-stat { text-align: center; color: #fff; }
.home-stat-num {
  display: block;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
}
.home-stat-label { display: block; margin-top: 8px; font-size: 0.85rem; font-weight: 500; color: var(--slate-300); }

/* ---- Get started ---- */
.home-start {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 4vw, 56px); align-items: center;
}
.home-start-copy h2 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.018em;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); color: var(--slate-900); margin-top: 10px;
}
.home-start-copy .home-section-lede { margin-left: 0; }
.home-start .home-cta-row { margin-top: 22px; }
.home-search {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 20px;
}
.home-search-label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--slate-800); margin-bottom: 10px; }
.home-search-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  padding: 5px 6px 5px 14px; color: var(--slate-400);
}
.home-search-row:focus-within { border-color: var(--need-blue); box-shadow: 0 0 0 3px rgba(29, 111, 224, 0.16); }
.home-search-row input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 0.95rem; color: var(--text); padding: 8px 0;
}
.home-search-row input::placeholder { color: var(--slate-400); }
.home-search-row .btn { height: 38px; flex: 0 0 auto; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .home-hero-grid, .home-start { grid-template-columns: 1fr; }
  .home-hero-demo { max-width: 460px; }
  .home-features, .home-steps { grid-template-columns: repeat(2, 1fr); }
  .home-subtypes { grid-template-columns: repeat(2, 1fr); }
  .home-research-method { grid-template-columns: 1fr; }
  .home-researcher { grid-template-columns: 1fr; }
  .home-researcher-photo { max-width: 520px; margin: 0 auto; }
}
@media (max-width: 620px) {
  .home-features, .home-steps, .home-stats-grid { grid-template-columns: 1fr; }
  .home-subtypes { grid-template-columns: 1fr; }
  .home-stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
  .home-cta, .home-cta-row .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .home-step, .home-feature { transition: none; }
  .home-step:hover, .home-feature:hover { transform: none; }
}

/* ============================================================
   Global reduced-motion fallback (covers any animation/transition
   not explicitly handled above).
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
