/* ============================================================
   renobackpain.com  -  dark clinical reference design
   Restyles JS-built markup; does not change any JS logic.
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    var(--hero-glow),
    linear-gradient(180deg, var(--bg-tint), var(--bg) 640px);
  background-repeat: no-repeat;
  background-attachment: fixed, scroll;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-4); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; }

/* ---------- Header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: 14px;
  padding-bottom: 14px;
}
.wordmark {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: .1px;
  color: var(--text);
}
.wordmark:hover { text-decoration: none; color: var(--text); }
.wordmark-tld { color: var(--text-faint); font-weight: 500; }
.site-nav { display: flex; gap: var(--space-4); }
.site-nav a {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  letter-spacing: .2px;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }

.site-actions { display: flex; align-items: center; gap: var(--space-4); }
.site-providers-link {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  letter-spacing: .2px;
  transition: color .15s ease;
}
.site-providers-link:hover { color: var(--text); text-decoration: none; }
.site-ask-btn {
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.site-ask-btn:hover { filter: brightness(1.06); }
.site-ask-btn:active { transform: translateY(1px); }

/* ---------- Hero ---------- */
/* ---------- Hero band ---------- */
.hero { padding: var(--space-6) 0 var(--space-4); text-align: center; }
.hero-title {
  margin: 0 auto;
  max-width: 26ch; /* fits "8/10 People Get Back Pain." on one line */
  font-size: clamp(1.7rem, 5.5vw, var(--fs-2xl));
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--text);
}
.hero-sub {
  margin: var(--space-3) auto 0;
  max-width: 44ch;
  font-size: var(--fs-md);
  color: var(--text-dim);
}

/* Stat strip infographic */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  max-width: 640px;
  margin: var(--space-5) auto 0;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-3) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
}
.stat-icon { width: 26px; height: 26px; color: var(--accent); }
.stat-icon svg { width: 100%; height: 100%; }
.stat-num { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-lg); color: var(--text); line-height: 1.1; }
.stat-label { font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.25; }

/* Red-flag affordance */
.redflag-affordance { margin-top: var(--space-4); }
.redflag-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.redflag-btn svg { width: 16px; height: 16px; color: var(--danger); }
.redflag-btn:hover { color: var(--text); border-color: var(--text-faint); }
.redflag-panel {
  max-width: 560px;
  margin: var(--space-3) auto 0;
  text-align: left;
}
.redflag-panel[hidden] { display: none; }
.redflag-message {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  animation: panel-in .2s ease both;
}
.redflag-message-icon { color: var(--danger); flex: 0 0 auto; }
.redflag-message-icon svg { width: 26px; height: 26px; }
.redflag-message-title { margin: 0 0 var(--space-2); font-weight: 600; color: var(--text); }
.redflag-message-list { margin: 0; padding-left: 1.1em; color: var(--text); display: grid; gap: 4px; }
.redflag-message-foot { margin: var(--space-3) 0 0; font-size: var(--fs-sm); color: var(--text-dim); }

/* ---------- Path cards (primary navigation) ---------- */
.paths {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  padding-top: var(--space-5);
  padding-bottom: var(--space-2);
}
.path-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  text-align: left;
  font-family: var(--font);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.path-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.path-card--active {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--glow);
}
.path-card-icon {
  width: 34px; height: 34px;
  color: var(--accent);
  margin-bottom: var(--space-1);
}
.path-card-icon svg { width: 100%; height: 100%; }
.path-card-label { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-md); color: var(--text); line-height: 1.1; }
.path-card-sub { font-size: var(--fs-sm); color: var(--text-dim); }

/* ---------- Content stage ---------- */
.stage { padding-top: var(--space-4); padding-bottom: var(--space-6); }
.stage-title {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-lg);
  color: var(--text);
}
.stage-redirect { color: var(--text-dim); }

/* ---------- Category grid infographic (replaces radial hub) ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}
.cat-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
  overflow: hidden;
  transition: border-color .15s ease;
}
.cat-tile--open { border-color: var(--accent); grid-column: 1 / -1; }
.cat-tile-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  font-family: var(--font);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
}
.cat-tile-btn:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cat-tile-icon { width: 32px; height: 32px; color: var(--accent); flex: 0 0 auto; }
.cat-tile-icon svg { width: 100%; height: 100%; }
.cat-tile-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.cat-tile-name { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-md); color: var(--text); line-height: 1.15; }
.cat-tile-meta { font-size: var(--fs-sm); color: var(--text-dim); }
.cat-dots { display: flex; gap: 4px; justify-content: flex-end; flex: 0 0 auto; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cat-dot--strong { background: var(--tier-strong); }
.cat-dot--moderate { background: var(--tier-moderate); }
.cat-dot--limited { background: var(--tier-limited); }
.cat-tile-chev { width: 18px; height: 18px; color: var(--text-faint); flex: 0 0 auto; transition: transform .15s ease; }
.cat-tile--open .cat-tile-chev { transform: rotate(180deg); }

.cat-panel { border-top: 1px solid var(--border-soft); padding: var(--space-2) var(--space-4) var(--space-3); }
.cat-panel[hidden] { display: none; }
.cat-tx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.cat-tx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  font-family: var(--font);
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.cat-tx:hover, .cat-tx:focus-visible { border-color: var(--accent); background: var(--surface-3); }
.cat-tx-name { font-size: var(--fs-base); }
.cat-tx-tier {
  flex: 0 0 auto;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}

.cat-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.cat-legend .cat-dot { margin-left: var(--space-3); }
.cat-legend .cat-dot:first-of-type { margin-left: 0; }

/* ---------- Tier badge ---------- */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}
.tier-badge::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.tier-strong   { background: rgba(67,192,143,.12);  color: var(--tier-strong);   border-color: rgba(67,192,143,.28); }
.tier-moderate { background: rgba(219,164,62,.12);  color: var(--tier-moderate); border-color: rgba(219,164,62,.28); }
.tier-limited  { background: rgba(138,147,166,.12); color: var(--tier-limited);  border-color: rgba(138,147,166,.28); }

/* ---------- Homepage responsive ---------- */
@media (max-width: 860px) {
  .paths { grid-template-columns: repeat(2, 1fr); }
  /* 5 cards in a 2-col grid: let the last one (Find local help, the
     highest-intent action) span the full row instead of orphaning. */
  .path-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .paths { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .path-card { padding: var(--space-3); }
  .stat-strip { gap: var(--space-2); }
  .stat-num { font-size: var(--fs-md); }
  .cat-grid { grid-template-columns: 1fr; }
}

/* Sticky-header clearance for every in-page scroll target. */
#stage, #directory, #detail-panel, #provider-panel {
  scroll-margin-top: 72px;
}

/* ---------- Detail panel ---------- */
#detail-panel {
  position: relative;
  margin: var(--space-5) auto 0;
  max-width: 760px;
  text-align: left;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
  animation: panel-in .28s ease both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
#detail-panel h2 {
  margin: 0 var(--space-5) var(--space-3) 0;
  font-size: var(--fs-xl);
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--text);
}
#detail-panel h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
}
#detail-panel > p { max-width: var(--measure); color: var(--text-dim); }
#detail-panel > p:nth-of-type(2) { color: var(--text); }

.detail-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  float: none;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 14px;
  font: inherit;
  font-size: var(--fs-sm);
  transition: background .15s ease, color .15s ease;
}
.detail-close:hover { background: var(--surface); color: var(--text); }

.resource-list { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: var(--space-2); }
.resource-list li {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.resource-list li:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow-md);
}
.resource-list a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: .62em; height: .62em;
  margin-left: .4em;
  vertical-align: baseline;
  background: currentColor;
  -webkit-mask: no-repeat center / contain url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4"><path d="M7 17 17 7M9 7h8v8"/></svg>');
  mask: no-repeat center / contain url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4"><path d="M7 17 17 7M9 7h8v8"/></svg>');
  opacity: .8;
}

.read-more {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.read-more:hover { color: var(--accent-2); }

.citations {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.citations div + div { margin-top: var(--space-2); }

.roc-callout {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-left: 3px solid var(--accent);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  margin-top: var(--space-4);
  color: var(--text);
  font-size: var(--fs-sm);
}

/* ---------- Buttons ---------- */
.btn, .modal button, .chat-form button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: filter .15s ease, transform .1s ease, background .15s ease;
}
.btn-primary, .modal button {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  border: 0;
  padding: 10px 20px;
  box-shadow: var(--glow);
}
.btn-primary:hover, .modal button:hover { filter: brightness(1.06); }
.btn-primary:active, .modal button:active { transform: translateY(1px); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4,7,12,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-3); z-index: 50;
  animation: fade-in .2s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
  animation: panel-in .26s ease both;
}
.modal h2 { margin-top: 0; font-size: var(--fs-xl); }
.modal p { color: var(--text-dim); max-width: 52ch; }
.modal button { margin-top: var(--space-4); }

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
  padding: var(--space-5) 0 var(--space-6);
  color: var(--text-faint);
  font-size: var(--fs-sm);
}
.disclaimer-line {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text);
  margin: 0 0 var(--space-3);
}
#paper-attribution { max-width: var(--measure); line-height: 1.65; margin: 0; }
#paper-attribution a { color: var(--accent); }

/* ============================================================
   Chatbot
   ============================================================ */
.chat-launcher {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 41;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: var(--shadow-md), var(--glow);
  transition: transform .15s ease, filter .15s ease;
}
.chat-launcher:hover { transform: translateY(-2px); filter: brightness(1.06); }
.chat-launcher svg { width: 24px; height: 24px; }

/* Full-height right-side drawer on desktop/tablet. */
#chatbot {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: chat-in .24s ease both;
}
#chatbot[hidden] { display: none; }
@keyframes chat-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text);
  background: var(--surface-2);
}
.chat-close {
  background: none;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.chat-close:hover { background: var(--surface-3); color: var(--text); }
.chat-close svg { width: 16px; height: 16px; }

.chat-log {
  padding: var(--space-3) var(--space-4);
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-log::-webkit-scrollbar { width: 8px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }

.chat-msg {
  padding: var(--space-2) var(--space-3);
  border-radius: 14px;
  max-width: 86%;
  font-size: var(--fs-sm);
  line-height: 1.55;
  animation: msg-in .2s ease both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  border-bottom-right-radius: 4px;
}
.chat-msg.user a { color: var(--accent-ink); text-decoration: underline; }
.chat-msg.bot {
  align-self: flex-start;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.chat-msg.redflag {
  border-left: 3px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  color: var(--text);
}
.chat-msg.redflag.emergency {
  border-left-width: 4px;
  background: color-mix(in srgb, var(--danger) 20%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 60%, var(--border));
  font-weight: 600;
}
.redflag-emergency-title { color: var(--danger); }

/* Rendered markdown inside bot replies (see renderMarkdown in js/chatbot.js). */
.chat-msg.bot { max-width: 94%; }
.chat-msg p { margin: 0 0 var(--space-2); }
.chat-msg p:first-child { margin-top: 0; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-msg strong { font-weight: 700; color: var(--text); }
.chat-msg ol,
.chat-msg ul {
  margin: var(--space-1) 0 var(--space-2);
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.chat-msg ol:last-child,
.chat-msg ul:last-child { margin-bottom: 0; }
.chat-msg li { line-height: 1.5; padding-left: 2px; }
.chat-msg li::marker { color: var(--text-dim); font-weight: 600; }
.chat-msg.bot a { color: var(--accent-2); text-decoration: underline; overflow-wrap: anywhere; }

.chat-pt-note {
  margin: var(--space-2) 0 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.chat-pt-note a { color: var(--accent-2); text-decoration: underline; }

.chat-shortlist { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: var(--space-1); }
.chat-shortlist li {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.chat-form {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.chat-form input {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font: inherit;
  font-size: var(--fs-sm);
}
.chat-form input::placeholder { color: var(--text-faint); }
.chat-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chat-form button {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  border: 0;
  padding: 9px 16px;
}
.chat-form button:hover { filter: brightness(1.06); }

.chat-disclaimer {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  padding: var(--space-2) var(--space-4);
  margin: 0;
  background: var(--surface-2);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .hero { padding: var(--space-5) 0 var(--space-4); }
  #detail-panel { padding: var(--space-4); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 var(--space-3); }
  .site-actions { gap: var(--space-3); }
  .chat-launcher { right: var(--space-3); bottom: var(--space-3); }
}

/* Small screens: chat becomes a full-width bottom sheet */
@media (max-width: 560px) {
  /* background-attachment: fixed is janky on mobile Safari/Chrome */
  body { background-attachment: scroll, scroll; }

  #chatbot {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 85vh;      /* fallback for browsers without dvh */
    height: 85dvh;
    max-height: 85vh;  /* fallback for browsers without dvh */
    max-height: 85dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    animation-name: chat-in-sheet;
  }
  @keyframes chat-in-sheet {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  #chatbot .chat-log {
    min-height: 0; /* let the flex child shrink so the log scrolls */
  }
  #chatbot .chat-form {
    position: sticky;
    bottom: 0;
    background: var(--surface-2);
  }
}

/* ============================================================
   Provider Directory
   ============================================================ */

#directory {
  padding: var(--space-7) 0 var(--space-6);
  border-top: 1px solid var(--border);
}

.dir-header {
  margin-bottom: var(--space-5);
}

.dir-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-xl);
  letter-spacing: -.01em;
  color: var(--text);
}

.dir-subtitle {
  margin: 0;
  max-width: 68ch;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

/* Filter bar */
.dir-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dir-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.dir-filter-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dir-filter-select {
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 32px 7px 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="%238a93a6" stroke-width="1.5"><polyline points="4,6 8,10 12,6"/></svg>');
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  min-width: 180px;
}

.dir-filter-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dir-filter-count-group {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.dir-filter-count {
  font-size: var(--fs-sm);
  color: var(--text-faint);
}

.dir-clear-btn {
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.dir-clear-btn:hover { background: var(--surface-3); color: var(--text); }

/* Provider grid */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

/* Empty state */
.dir-empty {
  grid-column: 1 / -1;
  color: var(--text-dim);
  padding: var(--space-5) 0;
  text-align: center;
}

/* Provider card */
.dir-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.dir-card:hover,
.dir-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-md);
  outline: none;
}

.dir-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dir-card--featured {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--surface)), var(--bg-tint));
}

.dir-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.dir-card-name {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  font-family: var(--font-serif);
}

.dir-card-type {
  margin: 2px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.dir-card-blurb {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
}

.dir-card-area {
  margin: 2px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.dir-card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Tap-to-call: a real 44px touch target for the audience most likely to
   want a phone call over a website. */
.dir-card-call {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.dir-card-call:hover { border-color: var(--accent); background: var(--surface-3); }

.dir-card-view {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Featured badge */
.dir-featured-badge {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 999px;
  padding: 2px 10px;
}

/* Chips (service tags and treatment links) */
.dir-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.dir-chip {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.dir-chip--treatment {
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-xs);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
  color: var(--accent);
  transition: background .15s ease, border-color .15s ease;
}

.dir-chip--treatment:hover,
.dir-chip--treatment:focus-visible {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  outline: none;
}

.dir-chip--treatment:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Provider profile panel */
#provider-panel {
  position: relative;
  margin: var(--space-5) auto 0;
  max-width: 760px;
  text-align: left;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
  animation: panel-in .28s ease both;
}

#provider-panel[hidden] { display: none; }

.provider-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 14px;
  font: inherit;
  font-size: var(--fs-sm);
  transition: background .15s ease, color .15s ease;
}

.provider-close:hover { background: var(--surface); color: var(--text); }

.provider-profile {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.provider-profile-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding-right: var(--space-6);
}

.provider-profile-name {
  margin: 0;
  font-size: var(--fs-xl);
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--text);
  font-family: var(--font-serif);
}

.provider-profile-type {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  font-weight: 500;
}

.provider-profile-area {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.provider-profile-blurb {
  margin: 0;
  color: var(--text);
  max-width: var(--measure);
  line-height: 1.65;
}

.provider-profile-section-label {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-family: var(--font);
}

.provider-profile-address { margin: 0 0 var(--space-2); color: var(--text-dim); font-size: var(--fs-sm); }
.provider-profile-contact { display: flex; flex-direction: column; gap: var(--space-2); }
.dir-contact-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dir-contact-link {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent);
  padding: 7px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  transition: background .15s ease, border-color .15s ease;
  text-decoration: none;
}

.dir-contact-link:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  text-decoration: none;
}

/* Video placeholder (16:9) */
.dir-video-placeholder {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dir-video-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--text-faint);
}

.dir-play-icon {
  width: 64px;
  height: 64px;
  color: var(--text-faint);
}

.dir-video-text {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-faint);
  letter-spacing: .03em;
}

/* Engagement funnel CTA on treatment detail */
.detail-funnel {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.detail-funnel-btn {
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: filter .15s ease, transform .1s ease;
}

.detail-funnel-btn:hover { filter: brightness(1.06); }
.detail-funnel-btn:active { transform: translateY(1px); }
.detail-funnel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Footer link */
.footer-links {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-sm);
}

.footer-links a { color: var(--text-faint); }
.footer-links a:hover { color: var(--text-dim); }

/* ============================================================
   Directory responsive
   ============================================================ */

@media (max-width: 720px) {
  .dir-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .dir-filter-count-group {
    margin-left: 0;
    flex-direction: row;
    justify-content: space-between;
  }
  .dir-filter-select { min-width: 0; width: 100%; }
  #provider-panel { padding: var(--space-4); }
  .provider-profile-head { padding-right: var(--space-5); }
}

@media (max-width: 640px) {
  .dir-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   providers.html page
   ============================================================ */

.providers-page-section {
  padding: var(--space-7) 0 var(--space-6);
  max-width: 720px;
}

.providers-page-title {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.8rem, 4vw, var(--fs-2xl));
  line-height: 1.1;
  color: var(--text);
}

.providers-page-lede {
  margin: 0 0 var(--space-4);
  max-width: 62ch;
  color: var(--text-dim);
  font-size: var(--fs-md);
  line-height: 1.6;
}

.providers-benefits {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.providers-benefits li {
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.6;
  padding-left: calc(var(--space-4) + 16px);
  position: relative;
}

.providers-benefits li::before {
  content: "";
  position: absolute;
  left: var(--space-4);
  top: calc(var(--space-3) + 8px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.providers-note {
  margin: 0 0 var(--space-5);
  color: var(--text-faint);
  font-size: var(--fs-sm);
}

.providers-form-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}

.providers-form-title {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-lg);
  color: var(--text);
}

.providers-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.providers-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.providers-field label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-dim);
}

.providers-field input,
.providers-field textarea {
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  resize: vertical;
  transition: border-color .15s ease;
}

.providers-field input:focus-visible,
.providers-field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.providers-field input::placeholder,
.providers-field textarea::placeholder {
  color: var(--text-faint);
}

.providers-form-note {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

.providers-submit-btn {
  align-self: flex-start;
}

.providers-thankyou {
  padding: var(--space-4) 0;
}

.providers-thankyou h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-lg);
  color: var(--text);
}

.providers-thankyou p {
  color: var(--text-dim);
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
}

.providers-mailto-fallback a { color: var(--accent); }

/* ============================================================
   #learn - Patient Education Layer
   ============================================================ */

#learn {
  border-top: 1px solid var(--border-soft);
  padding: var(--space-6) 0 var(--space-7);
}

.edu-wrap {
  /* inherits max-width and centering from .wrap */
}

/* ---- Section heading ---- */
.edu-header {
  text-align: center;
  margin-bottom: var(--space-5);
}

.edu-heading {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--space-2);
  line-height: 1.2;
}

.edu-intro {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Pillar tabs (segmented control) ---- */
.edu-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: center;
  margin-bottom: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.edu-tab {
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  padding: 8px 20px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}

.edu-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.edu-tab--active {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}

.edu-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---- Card grid ---- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  align-items: start;
}

/* ---- Card tile ---- */
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}

.edu-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Icon */
.edu-card-icon {
  display: block;
  width: 44px;
  height: 44px;
  color: var(--accent);
  flex-shrink: 0;
}

.edu-card-icon svg {
  width: 100%;
  height: 100%;
}

/* Headline */
.edu-card-headline {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

/* Body */
.edu-card-body {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin: 0;
  line-height: 1.55;
}

/* Card links row */
.edu-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.edu-card-link {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.edu-card-link:hover {
  color: var(--accent-2);
}

.edu-card-see-tx {
  font-family: var(--font);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  white-space: nowrap;
}

.edu-card-see-tx:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.edu-card-see-tx:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---- Warning variant (opioids-last) ---- */
.edu-card--warning {
  border-left: 3px solid var(--danger);
}

.edu-card--warning .edu-card-icon {
  color: var(--danger);
}

/* ---- Red-flag card (hard-coded, always first in Causes) ---- */
.edu-card--redflag {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--danger) 40%, var(--border));
  border-left: 4px solid var(--danger);
}

.edu-card--redflag .edu-card-icon {
  color: var(--danger);
}

.edu-card--redflag .edu-card-headline {
  color: var(--text);
}

.edu-card--redflag .edu-card-body {
  color: var(--text-dim);
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .edu-heading { font-size: var(--fs-lg); }
  .edu-tabs { width: 100%; justify-content: stretch; }
  .edu-tab { flex: 1; text-align: center; padding: 8px 12px; }
  .edu-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .edu-tab { font-size: var(--fs-xs); padding: 7px 8px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .edu-card { transition: none; }
  .edu-tab { transition: none; }
}

/* ---------- "What to do now" action infographic (pathways.js) ---------- */
.pw { display: grid; gap: var(--space-4); }

/* Red-flag emergency banner: calm but visually distinct, never ER-directing */
.pw-redflag {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--danger) 50%, var(--border));
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.pw-redflag-icon { color: var(--danger); flex: 0 0 auto; }
.pw-redflag-icon svg { width: 26px; height: 26px; }
.pw-redflag-text { margin: 0; color: var(--text); line-height: 1.5; }

/* Situation tiles + step flows (accordion) */
.pw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.pw-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pw-item--open { border-color: var(--accent); box-shadow: var(--glow); }
.pw-tile-h { margin: 0; }
.pw-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  font-family: var(--font);
  padding: var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
  transition: background .15s ease;
}
.pw-tile:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pw-tile:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius); }
.pw-tile-icon { width: 38px; height: 38px; color: var(--accent); flex: 0 0 auto; }
.pw-tile-icon svg { width: 100%; height: 100%; }
.pw-tile-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.pw-tile-title { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-md); line-height: 1.15; }
.pw-tile-intro { font-size: var(--fs-sm); color: var(--text-dim); }
.pw-tile-chev { width: 20px; height: 20px; color: var(--text-faint); flex: 0 0 auto; transition: transform .15s ease; }
.pw-item--open .pw-tile-chev { transform: rotate(180deg); }

.pw-panel { border-top: 1px solid var(--border-soft); padding: var(--space-4); animation: panel-in .2s ease both; }
.pw-panel[hidden] { display: none; }
.pw-panel-intro { margin: 0 0 var(--space-4); color: var(--text); max-width: var(--measure); }

/* Numbered step flow with a connecting line down the number chips */
.pw-steps { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: var(--space-3); }
.pw-steps::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--border);
}
.pw-step { position: relative; display: grid; grid-template-columns: 36px 28px 1fr; align-items: center; gap: var(--space-3); }
.pw-step-num {
  position: relative;
  z-index: 1;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--fs-base);
}
.pw-step-icon { width: 24px; height: 24px; color: var(--text-dim); flex: 0 0 auto; }
.pw-step-icon svg { width: 100%; height: 100%; }
.pw-step-text { color: var(--text); line-height: 1.45; }

/* Honest note aside */
.pw-note {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.pw-note-label { color: var(--accent); font-weight: 600; }

.pw-actions { margin-top: var(--space-4); }
.pw-see-tx {
  display: inline-flex;
  align-items: center;
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.pw-see-tx:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pw-see-tx:focus-visible { outline: none; box-shadow: var(--ring); }

@media (max-width: 560px) {
  .pw-tile { padding: var(--space-3); }
  .pw-step { grid-template-columns: 32px 22px 1fr; gap: var(--space-2); }
  .pw-steps::before { left: 15px; }
  .pw-step-num { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .pw-item, .pw-tile, .pw-tile-chev, .pw-see-tx { transition: none; }
  .pw-panel { animation: none; }
}

/* ---------- Touch targets ----------
   Primary interactive controls get a 44px minimum height for the
   phone-first, gloves-off-at-lunch audience. Chips that only display
   information are excluded. */
.cat-tx,
.read-more,
.dir-clear-btn,
.chat-form button,
.site-ask-btn,
.redflag-btn,
.dir-chip--treatment,
.detail-funnel-btn,
.pw-see-tx {
  min-height: 44px;
}
.detail-close,
.provider-close,
.chat-close {
  min-height: 40px;
  min-width: 40px;
}

/* ---------- Loading skeletons (app.js boot) ---------- */
.skeleton {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton--stat { min-height: 96px; }
.skeleton--card { min-height: 120px; border-radius: var(--radius-lg); }
@keyframes skeleton-pulse {
  0%, 100% { opacity: .55; }
  50%      { opacity: .95; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; opacity: .7; }
}

/* Boot failure fallback message */
.boot-error {
  margin: 0;
  padding: var(--space-4);
  color: var(--text);
}

/* ---------- Utilities ---------- */
/* Screen-reader-only text (standard clip pattern) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Recovery timeline (What to do now) ---------- */
.pw-timeline {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
}
.pw-timeline-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text);
}
.pw-timeline-track {
  display: flex;
  gap: 4px;
  min-height: 58px;
}
.pw-timeline-seg {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  color: var(--text);
  min-width: 0;
}
.pw-timeline-seg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-timeline-tag { font-weight: 600; }
.pw-timeline-seg--worst     { background: color-mix(in srgb, var(--danger) 26%, var(--surface)); }
.pw-timeline-seg--improving { background: color-mix(in srgb, var(--tier-moderate) 24%, var(--surface)); }
.pw-timeline-seg--better    { background: color-mix(in srgb, var(--tier-strong) 24%, var(--surface)); }
.pw-timeline-foot {
  margin: var(--space-3) 0 0;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
@media (max-width: 560px) {
  .pw-timeline-track { flex-direction: column; }
  .pw-timeline-seg { flex-direction: row; align-items: center; justify-content: space-between; width: 100% !important; }
}

/* ---------- Guided self-check ---------- */
.sc-entry { margin-top: var(--space-3); }
.sc-entry-btn {
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: filter .15s ease, transform .1s ease;
}
.sc-entry-btn:hover { filter: brightness(1.06); }
.sc-entry-btn:active { transform: translateY(1px); }

.sc { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-3); }
.sc-progress { display: flex; align-items: center; justify-content: space-between; }
.sc-progress-label { font-size: var(--fs-sm); color: var(--text-dim); }
.sc-dots { display: flex; gap: 6px; }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.sc-dot--done { background: var(--accent); opacity: .5; }
.sc-dot--current { background: var(--accent); }
.sc-heading { margin: 0; font-size: var(--fs-lg); color: var(--text); outline: none; }
.sc-answers { display: flex; flex-direction: column; gap: var(--space-2); }
.sc-answer {
  font-family: var(--font);
  font-size: var(--fs-base);
  text-align: left;
  color: var(--text);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-height: 52px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.sc-answer:hover { border-color: var(--accent); background: var(--surface-3); }
.sc-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 40px;
  cursor: pointer;
}
.sc-back:hover { color: var(--text); border-color: var(--text-faint); }
.sc-back-icon svg { width: 16px; height: 16px; display: block; }
.sc-stop {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.sc-stop-icon { color: var(--danger); flex: 0 0 auto; }
.sc-stop-icon svg { width: 26px; height: 26px; }
.sc-stop-text { font-size: var(--fs-md); }
.sc-result {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.sc-result-lead { margin: 0; font-size: var(--fs-sm); color: var(--text-dim); }
.sc-result-title { font-size: var(--fs-lg); }
.sc-result-line { margin: 0; color: var(--text); }
.sc-suggest { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.sc-suggest-item { display: flex; align-items: center; gap: 8px; color: var(--text); }
.sc-suggest-icon { color: var(--tier-strong); }
.sc-suggest-icon svg { width: 18px; height: 18px; display: block; }
.sc-cta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-2); }
.sc-cta-primary {
  font-family: var(--font); font-size: var(--fs-base); font-weight: 600;
  color: var(--accent-ink); background: var(--accent);
  border: none; border-radius: var(--radius-sm); padding: 12px 20px; min-height: 44px; cursor: pointer;
}
.sc-cta-secondary {
  font-family: var(--font); font-size: var(--fs-base); font-weight: 600;
  color: var(--text); background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 20px; min-height: 44px; cursor: pointer;
}
.sc-disclaimer { margin: var(--space-2) 0 0; font-size: var(--fs-xs); color: var(--text-faint); }

/* ---------- Simple moves ---------- */
.mv { margin-top: var(--space-6); }
.mv-title { margin: 0 0 var(--space-2); font-size: var(--fs-lg); color: var(--text); }
.mv-banner {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.mv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}
.mv-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mv-card-head { display: flex; align-items: center; gap: var(--space-2); }
.mv-card-icon { width: 30px; height: 30px; color: var(--accent); flex: 0 0 auto; }
.mv-card-icon svg { width: 100%; height: 100%; }
.mv-card-name { margin: 0; font-size: var(--fs-md); color: var(--text); }
.mv-steps { margin: 0; padding-left: 1.2em; color: var(--text); display: grid; gap: 4px; font-size: var(--fs-sm); }
.mv-tip { margin: 0; font-size: var(--fs-sm); color: var(--text-dim); }
.mv-caution { margin: 0; font-size: var(--fs-xs); color: var(--tier-moderate); }

/* Header links stay on one line: "For clinicians" was wrapping and
   doubling the mobile header height. */
.site-providers-link { white-space: nowrap; }

/* Self-check safety checklist: warning signs shown as readable content
   between the question and the yes/no answers. */
.sc-checklist {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  list-style: none;
  display: grid;
  gap: 8px;
}
.sc-checklist li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--text);
}
.sc-checklist li::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  opacity: .7;
  transform: translateY(-1px);
}

/* ---------- Question-first front door ---------- */
#entry-question { margin-top: var(--space-4); }
.eq-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-lg);
  color: var(--text);
}
.eq-btns {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 480px;
  margin: 0 auto;
}
.eq-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  font-family: var(--font);
  padding: 14px 18px;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.eq-btn:hover { border-color: var(--accent); background: var(--surface-3); }
.eq-btn:active { transform: translateY(1px); }
.eq-btn-main { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.eq-btn-sub { font-size: var(--fs-sm); color: var(--text-dim); }

/* ---------- Guide flash-cards ---------- */
.g-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  min-height: 200px;
  justify-content: center;
}
.g-card-icon { width: 52px; height: 52px; color: var(--accent); }
.g-card-icon svg { width: 100%; height: 100%; }
.g-card-text { font-size: var(--fs-md); line-height: 1.5; max-width: 34ch; }
.g-browse-link {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: var(--fs-sm);
  color: var(--accent-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Demoted browse pills (paths--links) ---------- */
.paths--links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-4);
  padding-bottom: var(--space-2);
}
.paths--links .path-card {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: 999px;
  box-shadow: none;
}
.paths--links .path-card:hover { transform: none; }
.paths--links .path-card-icon { width: 18px; height: 18px; margin: 0; }
.paths--links .path-card-label { font-size: var(--fs-sm); }
.paths--links .path-card-sub { display: none; }
.paths--links .path-card:last-child { grid-column: auto; }

/* ---------- Disclosure summaries (timeline + moves) ---------- */
.pw-timeline-summary, .mv-summary {
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text);
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-timeline-see { color: var(--accent-2); font-weight: 600; font-size: var(--fs-sm); }
.pw-timeline[open] .pw-timeline-summary { margin-bottom: var(--space-3); }
.mv-holder {
  margin-top: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 4px var(--space-4);
}
.mv-summary { font-weight: 600; color: var(--accent-2); }
.mv-body { padding-bottom: var(--space-3); }
.mv-body .mv { margin-top: var(--space-2); }

/* ---------- Directory type chips (replace dropdown filters) ---------- */
.dir-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-2);
}
.dir-typechip {
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.dir-typechip:hover { border-color: var(--accent); color: var(--text); }
.dir-typechip--active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.dir-txnote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: var(--fs-sm);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 40px;
  cursor: pointer;
  margin-top: var(--space-3);
}
.dir-txnote-x { font-size: 1.1em; color: var(--text-dim); }
.dir-txnote:hover .dir-txnote-x { color: var(--danger); }

/* Formal treatment name under the plain-words heading */
.detail-formal-name {
  margin: -6px 0 var(--space-2);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-transform: none;
}

/* ---------- Persistent safety banner (banner mode) ---------- */
.rf-banner {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.rf-banner-icon { color: var(--danger); flex: 0 0 auto; margin-top: 2px; }
.rf-banner-icon svg { width: 22px; height: 22px; }
.rf-banner-text { margin: 0; font-size: var(--fs-sm); color: var(--text); line-height: 1.55; }
.rf-banner-text strong { color: var(--danger); }

/* ---------- "Right now" mini-plan (condensed beats 1-3) ---------- */
.now-plan {
  max-width: 480px;
  margin: var(--space-4) auto 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  text-align: left;
}
.now-plan-title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text);
}
.now-plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.now-plan-list li { display: flex; gap: 12px; align-items: baseline; color: var(--text); }
.now-plan-num {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-sm);
  font-weight: 700;
  transform: translateY(4px);
}
.now-plan-foot { margin: var(--space-3) 0 0; font-size: var(--fs-sm); color: var(--text-dim); }

/* ---------- Homepage treatment directory heading ---------- */
.home-tx-title {
  margin: var(--space-6) 0 var(--space-1);
  font-size: var(--fs-lg);
  color: var(--text);
}
.home-tx-sub { margin: 0 0 var(--space-4); color: var(--text-dim); font-size: var(--fs-sm); }

/* ---------- Quick links row ---------- */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-5);
}
.quick-links button {
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.quick-links button:hover { border-color: var(--accent); color: var(--text); }

/* Hero recovery arc: always expanded, sits under the Right-now card. */
.pw-timeline--open {
  max-width: 480px;
  margin: var(--space-3) auto 0;
  text-align: left;
}
.pw-timeline--open .pw-timeline-title { margin-bottom: var(--space-3); }

/* Hero arc: always stacked full-width rows so no label ever gets
   clipped by the proportional 18%/42%/40% widths on wide screens. */
.pw-timeline--open .pw-timeline-track { flex-direction: column; }
.pw-timeline--open .pw-timeline-seg {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100% !important;
}
.pw-timeline--open .pw-timeline-seg span { overflow: visible; text-overflow: unset; }

/* Header actions can wrap on small screens now that there are four. */
@media (max-width: 640px) {
  .site-actions { flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2) var(--space-3); }
}

/* ---------- Mobile spacing polish ---------- */
@media (max-width: 640px) {
  /* Header: centered stack instead of a ragged right-aligned wrap, and
     static instead of sticky - a three-row bar must not shadow every
     scroll. */
  header.site { position: static; }
  .site-bar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    padding-bottom: 14px;
  }
  .site-actions {
    width: 100%;
    justify-content: center;
    gap: var(--space-2) var(--space-4);
  }
  .site-providers-link { font-size: var(--fs-xs); }

  /* Vertical rhythm: let the top of the page breathe */
  .rf-banner { margin: var(--space-4) 0 var(--space-2); }
  .hero { padding-top: var(--space-4); padding-bottom: var(--space-6); }
  .now-plan { margin-top: var(--space-5); }
  .pw-timeline--open { margin-top: var(--space-4); }
  .home-tx-sub { margin-bottom: var(--space-5); }
  .quick-links { justify-content: center; padding-top: var(--space-6); padding-bottom: var(--space-2); }

  /* Scroll targets no longer need sticky-header clearance on mobile */
  #stage, #directory, #detail-panel, #provider-panel { scroll-margin-top: 12px; }
}

/* Directory chip-row labels (Where / Kind of help) */
.dir-chiplabel {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
}

/* ============================================================
   Warm & Human reskin (design handoff 2026-07-04)
   Restyles JS-built markup; does not change any JS logic.
   ============================================================ */

body { overflow-x: clip; }
.wrap { padding-left: clamp(20px, 5vw, 64px); padding-right: clamp(20px, 5vw, 64px); }

/* Header brand lockup: logo mark + serif wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-size: 20px; letter-spacing: -.01em; }
.brand-mark { height: 34px; width: auto; display: block; border-radius: 6px; }
.site-ask-btn { padding: 9px 20px; }
.site-ask-btn:hover { filter: none; background: var(--accent-2); }

/* Safety banner: full-bleed danger-tint strip */
#redflag-banner .rf-banner {
  margin: 0 calc(50% - 50vw);
  padding: 14px max(clamp(20px, 5vw, 64px), calc(50vw - var(--maxw) / 2));
  border: none;
  border-bottom: 1px solid var(--danger-line);
  border-radius: 0;
  background: var(--danger-bg);
}
#redflag-banner .rf-banner-text { color: var(--danger); font-size: 14.5px; line-height: 1.5; }
#redflag-banner .rf-banner-text strong { color: var(--danger); }
#redflag-banner .rf-banner-icon { color: var(--danger); }
#redflag-banner .rf-banner-icon svg { width: 20px; height: 20px; }

/* Hero: centered serif headline, infographic, subline, two-column block */
.hero-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(34px, 5.4vw, 52px);
  line-height: 1.12;
  letter-spacing: -.01em;
  max-width: 20ch;
}
.hero-sub {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(18px, 2.4vw, 23px);
  line-height: 1.35;
  color: var(--text-dim);
  max-width: 34ch;
  margin: 22px auto 0;
}

/* 4-of-5 people infographic */
.hero-fig {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(12px, 2.2vw, 22px);
  margin-top: 32px;
}
.hero-fig svg { width: clamp(40px, 6.4vw, 58px); height: auto; display: block; }
.hero-fig .fig { color: var(--accent); }
.hero-fig .fig--well { color: var(--figure-muted); }

/* Two-column hero block: Right-now card | recovery arc */
.hero-cols {
  max-width: 920px;
  margin: var(--space-5) auto 0;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 34px;
  text-align: left;
  align-items: start;
}
.hero-cols .now-plan { margin: 0; max-width: none; }
.hero-cols .pw-timeline--open { margin: 0; max-width: none; }
@media (max-width: 820px) {
  .hero-cols { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* Right-now card per spec */
.now-plan {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}
.now-plan-num {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

/* Recovery arc: vertical rail with terracotta dots */
.pw-timeline--open .pw-timeline-title {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
}
.pw-timeline--open .pw-timeline-track {
  flex-direction: column;
  gap: 18px;
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 22px;
  margin-left: 5px;
}
.pw-timeline--open .pw-timeline-seg {
  background: transparent;
  border: none;
  padding: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 3px;
  position: relative;
  border-radius: 0;
}
.pw-timeline--open .pw-timeline-seg::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}
.pw-timeline--open .pw-timeline-seg > span:first-child {
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--accent-2);
}
.pw-timeline--open .pw-timeline-tag { font-weight: 400; font-size: 14.5px; color: var(--text-dim); }

/* Treatment directory: 2-col category grid, warm cards, icon tiles */
.cat-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .cat-grid { grid-template-columns: 1fr; } }
.cat-tile {
  background: var(--surface);
  border-radius: var(--radius-lg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cat-tile--open { border-color: var(--accent-line); box-shadow: var(--shadow-lg); }
.cat-tile-btn { padding: 22px 24px; }
.cat-tile-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-tile-icon svg { width: 22px; height: 22px; }
.cat-panel { padding-left: 24px; padding-right: 24px; }
.cat-tx { background: var(--bg); border-color: var(--border); border-radius: var(--radius); }
.cat-tx:hover, .cat-tx:focus-visible { border-color: var(--accent-line); background: var(--surface-2); }

/* Evidence tiers: warm pill backgrounds from the handoff */
.tier-strong   { background: var(--tier-strong-bg);   color: var(--tier-strong);   border-color: transparent; }
.tier-moderate { background: var(--tier-moderate-bg); color: var(--tier-moderate); border-color: transparent; }
.tier-limited  { background: var(--tier-limited-bg);  color: var(--tier-limited);  border-color: transparent; }
.tier-badge::before { box-shadow: none; }

/* Provider call action: terracotta pill */
.dir-card-call {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 999px;
  padding: 0 16px;
}
.dir-card-call:hover { background: var(--accent-2); border: none; }

/* Cards pick up the 20px card radius */
.dir-card, .detail, .chat-panel { border-radius: var(--radius-lg); }

/* Footer: logo mark + serif disclaimer */
.foot-brand { height: 46px; width: auto; display: block; margin-bottom: var(--space-3); border-radius: 8px; }

/* Nav ≤720px: hide all links except "For clinicians" + Ask (per handoff);
   the hidden pages stay reachable from the footer link row. */
@media (max-width: 720px) {
  .site-actions a.site-providers-link:not([href*="clinicians"]) { display: none; }
}
/* With only two actions left, the header fits one sticky row on phones. */
@media (max-width: 640px) {
  header.site { position: sticky; }
  .site-bar { flex-direction: row; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
  .site-actions { width: auto; flex-wrap: nowrap; }
  .wordmark { font-size: 17px; }
  .brand-mark { height: 28px; }
}

/* "Try some simple stretches" link in the Right-now card */
.now-plan-link {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}
.now-plan-link:hover { color: var(--accent); }

/* Right-now list: top-align the square number chips with their first
   text line (the old translateY hack was tuned for baseline circles). */
.now-plan-list li { align-items: flex-start; }
.now-plan-num { transform: none; margin-top: 1px; }

/* Phone header: the lockup + For clinicians + Ask must fit 390px */
@media (max-width: 640px) {
  .site-bar { gap: 10px; }
  .site-actions { gap: 10px; }
  .site-ask-btn { padding: 8px 14px; }
  .wordmark { gap: 8px; }
}
@media (max-width: 430px) {
  .wordmark-tld { display: none; }
}

/* ---------- Directory: search box + accordion groups ---------- */
.dir-search {
  position: relative;
  max-width: 480px;
  margin: var(--space-3) 0 var(--space-2);
}
.dir-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-faint);
  pointer-events: none;
}
.dir-search input {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px 10px 42px;
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.dir-search input:focus { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.dir-search input::placeholder { color: var(--text-faint); }

.dir-acc {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: var(--space-2);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dir-acc--open { border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.dir-acc-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 56px;
  text-align: left;
  font-family: var(--font);
  padding: 14px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.dir-acc-btn:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dir-acc-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text);
  flex: 1 1 auto;
}
.dir-acc-count {
  flex: 0 0 auto;
  min-width: 30px;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent-2);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
  font-variant-numeric: tabular-nums;
}
.dir-acc-chev { width: 18px; height: 18px; color: var(--text-faint); flex: 0 0 auto; transition: transform .15s ease; }
.dir-acc--open .dir-acc-chev { transform: rotate(180deg); }
.dir-acc-panel {
  border-top: 1px solid var(--border-soft);
  padding: var(--space-3) 20px var(--space-4);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* display:grid on the panel would otherwise defeat the hidden attribute */
.dir-acc-panel[hidden] { display: none; }

/* Accordion groups: closed headers pack the multi-column grid; the
   open group spans the full page width (same pattern as the open
   treatment tile) with cards in columns inside it. */
.dir-acc { margin-bottom: 0; align-self: start; }
.dir-acc--open { grid-column: 1 / -1; }
