/* A Real Change Health — Doctor Referral design system.
   Tokens and layout rules are defined by docs/design-reference.md (binding):
   brand language extracted from arealchange.com + arealchange.ai. The contract
   is AIR — generous section rhythm, max 3-up grids, pill CTAs, Playfair display
   headings over Poppins UI. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --ink: rgb(27, 42, 50);
  --ink-soft: rgb(98, 120, 132);
  --teal: rgb(41, 163, 151);
  --teal-deep: rgb(13, 148, 136);
  --teal-tint: rgba(41, 163, 151, 0.1);
  /* A Real Change plum (issue #105). Layered onto the existing palette as the
     warm CLIENT accent — eyebrows, section heads, the status panel, the welcome
     band, the client CTA accent, and the card top-accent. The gold Verified
     badge and the teal system chrome stay as they are. #b03a6e on white passes
     AA for text/accents; --plum-tint is a background only (dark --ink text). */
  --plum: rgb(176, 58, 110);
  --plum-deep: rgb(143, 47, 89);
  --plum-soft: rgb(196, 90, 134);
  --plum-tint: rgba(176, 58, 110, 0.1);
  --coral: rgb(240, 113, 66);
  --coral-soft: rgb(233, 122, 106);
  --gold: rgb(244, 192, 37);
  /* Friendly success green (issue #47) for the per-doctor "How was your visit?"
     follow-up button. Distinct from the teal system chrome and the red danger
     safety valve. #1f8a4d on white passes AA for white button text. */
  --green: rgb(31, 138, 77);
  --green-deep: rgb(22, 110, 60);
  --bg: rgb(245, 249, 249);
  --bg-warm: rgb(251, 249, 248);
  --bg-band: rgb(209, 224, 224);
  --card: #ffffff;
  --footer: rgb(27, 42, 50);
  --danger: rgb(186, 64, 47);
  --ok: var(--teal-deep);
  --line: rgba(27, 42, 50, 0.12);
  --shadow: 0 10px 30px rgba(27, 42, 50, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 72px;
  --space-7: 96px;
  --wrap: 1120px;
  --font-ui: "Poppins", Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body, #app { max-width: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
#app.boot { padding: var(--space-6); color: var(--ink-soft); text-align: center; }
img { max-width: 100%; }
main { display: block; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(34px, 5vw, 58px); }
h2 { font-size: clamp(26px, 3.2vw, 38px); }
h3 { font-size: 19px; font-weight: 600; line-height: 1.35; margin: 0 0 var(--space-1); }
h1 em, h2 em { font-style: normal; color: var(--teal); }
p { margin: 0 0 var(--space-2); }
a { color: var(--teal-deep); }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal);
  margin: 0 0 var(--space-1);
}
.lede { font-size: 19px; line-height: 1.7; color: var(--ink); max-width: 56ch; }
.sublede, .panel-copy { color: var(--ink-soft); max-width: 60ch; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
}
.skip-link:focus { left: 16px; }

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

/* ---------- Buttons ---------- */
button, .link-button {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  border-radius: 999px;
  border: 1.5px solid transparent;
  padding: 14px 28px;
  min-height: 48px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
button.primary, .link-button.primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 8px 20px rgba(240, 113, 66, 0.32);
}
button.primary:hover, .link-button.primary:hover { background: var(--coral-soft); transform: translateY(-1px); }
button.secondary, .link-button.secondary {
  background: var(--card);
  color: var(--teal-deep);
  border-color: var(--teal);
}
button.secondary:hover, .link-button.secondary:hover { background: var(--teal-tint); }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.ghost-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 999px;
}
.ghost-link:hover { background: var(--teal-tint); color: var(--teal-deep); }

/* ---------- Sections & layout ---------- */
section { padding: var(--space-6) var(--space-3); }
section > .eyebrow, section > h2, section > .panel-copy, section > .lede,
section > ol, section > div, section > article, section > form, section > p,
section > blockquote, section > strong {
  max-width: var(--wrap);
  margin-left: auto;
  margin-right: auto;
}
section > h2 { margin-bottom: var(--space-2); }
section > .panel-copy { margin-bottom: var(--space-4); }

/* ---------- Landing: nav + hero ---------- */
.hero {
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--teal-tint), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 100%);
  padding: var(--space-3) var(--space-3) var(--space-7);
}
.site-nav {
  max-width: var(--wrap);
  margin: 0 auto var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
/* Sandi signature logo in the marketing top bar — parity with the app header.
   The teal mark sits cleanly on the light hero (no recolor); 44px tap target. */
.site-brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.site-logo { display: block; height: 38px; width: auto; max-width: 72vw; }
@media (max-width: 480px) { .site-logo { height: 28px; } }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.hero-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--space-5);
  align-items: center;
}
.hero-copy h1 { margin-bottom: var(--space-3); }
/* Give the sales copy room to breathe — a clear beat between the headline, the
   lede, and the supporting line instead of a dense 16px stack. */
.hero-copy .lede { margin-bottom: var(--space-3); }
.hero-copy .sublede { margin-bottom: 0; }
.hero-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); }
.hero-subaction { margin-top: var(--space-2); font-size: 15px; }
/* inline-flex + a 44px min-height gives the link a proper touch target on mobile
   even when its (shorter) label sits on a single line — the layout-contract
   tap-target floor no longer depends on the text wrapping to two lines. */
.hero-subaction a {
  color: var(--ink-soft);
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.hero-subaction a:hover { color: var(--teal-deep); }
.hero-visual { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.hero-photo {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}
.brand-proof {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-1);
  max-width: 340px;
  border-top: 6px solid var(--teal);
}
.brand-proof span {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--teal-deep);
}
.brand-proof b { font-size: 30px; font-family: var(--font-display); }
.brand-proof small { color: var(--ink-soft); font-size: 14px; line-height: 1.55; }

/* ---------- Landing: opener, legal band ---------- */
.sandi-opener { background: var(--bg-warm); text-align: center; }
.sandi-opener blockquote {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.45;
  max-width: 720px;
  margin: 0 auto var(--space-2);
}
.opener-pending { color: var(--ink-soft); }
.opener-attribution { color: var(--ink-soft); font-weight: 500; }

.legal-band {
  background: var(--teal-tint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}
/* The dense "Important" paragraph reads as a wall at full width — hold it to a
   comfortable measure and centre it so the eye can track each line. */
.legal-band-inner { max-width: 70ch; margin: 0 auto; }

/* ---------- Landing: offer + steps ---------- */
.offer-explainer { background: var(--bg); }
.offer-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.offer-strip article {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-4);
}
.offer-strip article .eyebrow { color: var(--coral); }
.offer-strip article p:last-child { margin-bottom: 0; color: var(--ink-soft); }
.fee-note {
  font-size: 14px;
  color: var(--ink-soft);
  border-left: 3px solid var(--teal);
  padding-left: var(--space-2);
}

/* ---------- Landing: about / why I built this ---------- */
.about-strip { background: var(--bg-warm); }
.about-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: var(--space-5);
  align-items: center;
}
.about-photo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}
.about-copy p { color: var(--ink-soft); }
.about-copy h2 { margin-bottom: var(--space-2); }
.about-attribution { color: var(--ink); font-weight: 500; margin-top: var(--space-2); }

.how-strip { background: var(--bg-warm); }
.how-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.how-steps li {
  counter-increment: step;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: var(--space-3) var(--space-3) var(--space-3) 76px;
  position: relative;
  color: var(--ink-soft);
}
.how-steps li b { color: var(--ink); display: block; margin-bottom: 2px; }
.how-steps li::before {
  content: counter(step);
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------- Landing: preview + auth panels ---------- */
.public-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  max-width: var(--wrap);
  margin: 0 auto;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-4);
}
.panel h2 { font-size: 26px; }
.auth-panel { border-top: 6px solid var(--coral); }
#preview.panel { border-top: 6px solid var(--teal); }

.tab-row { display: flex; gap: var(--space-1); margin-bottom: var(--space-3); }
.tab-row button {
  flex: 1;
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 12px 16px;
}
.tab-row button.active { background: var(--ink); color: #fff; }

.doctor-strip {
  background: var(--bg-band);
  text-align: center;
  padding: var(--space-7) var(--space-3);
}
.doctor-strip .eyebrow { color: var(--coral); }
.doctor-strip .panel-copy { color: var(--ink-soft); margin-left: auto; margin-right: auto; max-width: 64ch; }

/* ---------- Forms ---------- */
form.stacked { display: grid; gap: var(--space-2); }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
input, select, textarea {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  min-height: 48px;
  width: 100%;
}
/* iOS WebKit ignores author min-height on native selects (UA menulist
   appearance) — drop the native appearance and draw our own chevron so the
   48px tap target holds on real iPhones. */
select {
  -webkit-appearance: none;
  appearance: none;
  height: 48px;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23628784' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-tint); }
.field-error { color: var(--danger); font-size: 13px; font-weight: 500; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.loc-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-2); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: var(--space-2); }
.privacy-note, .payment-note, .gate-note, .returnable-note, .seed-note {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--teal-tint);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0;
}
.hardcase-note {
  font-size: 13px;
  color: var(--ink);
  background: rgba(244, 192, 37, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0;
}

.result {
  margin-top: var(--space-2);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 15px;
}
.result.show.good { background: var(--plum-tint); color: var(--plum-deep); font-weight: 500; }
.result.show.warn { background: rgba(240, 113, 66, 0.12); color: var(--danger); font-weight: 500; }
/* The status preview banner must never run off a narrow screen (issue #105, PR
   C): long messages wrap inside the panel instead of forcing horizontal scroll. */
.result { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.waitlist-form { margin-top: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-3); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer);
  color: rgba(255, 255, 255, 0.75);
  padding: var(--space-6) var(--space-3);
  font-size: 14px;
}
.site-footer > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.site-footer a { color: #fff; }
.disclaimers { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.disclaimers p { margin: 0; }
.footer-brand { color: rgba(255, 255, 255, 0.55); margin: 0; }

/* ---------- App shell (logged-in) ---------- */
.app-shell { max-width: var(--wrap); margin: 0 auto; padding: var(--space-3); }
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
}
.app-nav strong { font-family: var(--font-display); font-size: 20px; }
.nav-user { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-soft); font-size: 14px; flex-wrap: wrap; }
.nav-user button { padding: 10px 18px; min-height: 40px; }

.dashboard-grid, .portal-grid, .review-grid, .doctor-grid { display: grid; gap: var(--space-3); }
.dashboard-grid > *, .portal-grid > *, .review-grid > *, .doctor-grid > *,
.content-stack > * { min-width: 0; max-width: 100%; }
.portal-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; }
.doctor-grid { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); align-items: start; gap: var(--space-3); }
.content-stack { display: grid; gap: var(--space-3); }

/* Sectioned delivery (issue #100, Slice 3): near-you reads as the hero; the
   statewide section is a calm, collapsed secondary so a long telehealth list
   never overwhelms. Collapsible summaries get a 44px tap target + chevron. */
.delivery-sections { display: grid; gap: var(--space-4); }
.doctor-section-head { margin-bottom: var(--space-2); }
.doctor-section-head .eyebrow { margin-bottom: 2px; }
.section-sub { margin: 0 0 var(--space-2); color: var(--ink-soft); font-size: 14px; }
.doctor-section.is-telehealth {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-warm);
  padding: var(--space-2) var(--space-3);
}
.doctor-section.is-telehealth > summary,
.doctor-more > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal-deep);
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
}
.doctor-section.is-telehealth > summary::-webkit-details-marker,
.doctor-more > summary::-webkit-details-marker { display: none; }
.doctor-section.is-telehealth > summary::after,
.doctor-more > summary::after {
  content: "\203A"; /* › */
  margin-left: auto;
  transition: transform 0.15s ease;
}
.doctor-section.is-telehealth[open] > summary::after,
.doctor-more[open] > summary::after { transform: rotate(90deg); }
.doctor-section.is-telehealth .doctor-grid,
.doctor-more[open] .doctor-grid { margin-top: var(--space-2); }

.portal-panel, .doctor-panel, .admin-panel, .list-panel, .intake-card, .listing-card, .roi-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-4);
}
/* Referral-detail route must not scroll horizontally on a narrow phone (issue
   #105, PR C — iPhone 13 measured scrollWidth 421 > 390). Constrain the status
   panel and its long text (status line, summary values, explainer) to the
   viewport so nothing runs off-screen. */
.portal-panel { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.portal-panel .status-explainer,
.portal-panel .summary-row,
.portal-panel .summary-row b { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.panel-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.panel-top > * { min-width: 0; }
.status-chip, .timeline li, .audit-detail { overflow-wrap: anywhere; }

.empty-state, .roi-empty, .candidate-empty {
  color: var(--ink-soft);
  background: var(--bg);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  text-align: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  white-space: nowrap;
}
.status-chip.warn { background: rgba(240, 113, 66, 0.14); color: var(--danger); }
.status-chip.gold { background: rgba(244, 192, 37, 0.18); color: rgb(146, 107, 0); }
.status-explainer { color: var(--ink-soft); font-size: 14px; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-1); }
.timeline li {
  position: relative;
  padding-left: var(--space-3);
  color: var(--ink-soft);
  font-size: 14px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 6px; top: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
}
/* #67-7: keep the timestamp and label from jamming together. */
.timeline .timeline-time { font-weight: 600; color: var(--ink); }
.timeline .timeline-sep { color: var(--ink-soft); }

.referral-list { display: grid; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
.referral-list button { width: 100%; justify-content: space-between; background: var(--bg); color: var(--ink); border-radius: var(--radius-sm); }
.referral-list button.active, .referral-list button:hover { background: var(--teal-tint); }
.referral-script {
  font-family: var(--font-display);
  font-size: 18px;
  background: var(--teal-tint);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.reach-block { background: var(--teal-tint); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: var(--space-2); }
.why-block { color: var(--ink-soft); }
/* #67-4/#67-5: held/no-doctor referral next-step reassurance block. */
.next-step { background: var(--teal-tint); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.next-step p { margin: 0; }
.next-step .eyebrow { margin-bottom: 4px; }
.checkline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 500; min-height: 44px; }
.checkline input { width: auto; min-height: 0; }
/* #102: keep a validation error on its own full-width row under the checkbox
   instead of wrapping into the label mid-row (the required disclosure gate). */
.checkline .field-error { flex-basis: 100%; margin-top: 4px; }
/* #102: the account "Our referral terms" block reads as its own section. */
.referral-terms { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
/* #102: the one-time agreement reads as a deliberate "read this once" box, not
   just another form field. */
.disclosure-agreement, .disclosure-gate {
  background: var(--bg-warm); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: var(--space-3); margin: var(--space-2) 0;
  display: grid; gap: var(--space-2);
}
.disclosure-agreement .screened-disclosure, .disclosure-gate .screened-disclosure { background: #fff; }
.disclosure-agreement .panel-copy { font-size: 15px; margin-bottom: 0; }
input[type="checkbox"], input[type="radio"] {
  width: 22px; height: 22px; min-height: 0;
  accent-color: var(--teal-deep);
}

/* Delivered doctor list (issue #102 aesthetic pass). De-crammed: the name is the
   hero, the contact + reach zones read as distinct panels, and the report link is
   a clear red safety valve. */
.delivery-portal { display: grid; gap: var(--space-4); margin-top: var(--space-3); }
/* Geo-radius count line (issue #100): plain framing above a longer doctor list. */
.delivery-count { margin: 0; font-weight: 600; color: var(--ink); }
.doctor-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-3) var(--space-2);
  display: grid;
  gap: var(--space-2);
  background: #fff;
}
.doctor-card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.doctor-card h3 { font-family: var(--font-display); font-size: 24px; line-height: 1.2; margin: 2px 0 0; }
.doctor-card .eyebrow { margin-bottom: 0; }
.doctor-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: var(--space-2); }

/* --------- A Real Change plum accents (issue #105) ---------
   Scoped to the logged-in CLIENT surface only. The eyebrows, delivery section
   heads, status panel, welcome band, client CTA accent, and the doctor-card
   top-accent read in plum, while the gold Verified badge and the teal system
   chrome are untouched. Plum is used for accents on white/tinted backgrounds —
   never plum text on a plum fill — so AA contrast holds. */
.patient-home-screen .eyebrow,
.portal-panel .eyebrow,
.delivery-portal .eyebrow,
.status-overview .eyebrow,
.doctor-section-head .eyebrow,
.welcome-row .eyebrow,
.status-reassure .eyebrow { color: var(--plum); }
/* Plum top-accent on the key client cards (the delivery list + the status
   panel) to echo the landing's accented panels. */
.delivery-portal.is-delivered { border-top: 4px solid var(--plum); padding-top: var(--space-3); }
.doctor-card { border-top: 3px solid var(--plum-tint); }
.doctor-card.is-verified { border-top: 3px solid var(--gold); }
/* The delivery + status headings carry Playfair already; tint the count line
   and the primary client CTA with plum so the surface reads on-brand. */
.delivery-portal h3 { color: var(--ink); }
.patient-home-screen .link-button.primary,
.status-overview .link-button.primary { background: var(--plum); }
.patient-home-screen .link-button.primary:hover,
.status-overview .link-button.primary:hover { background: var(--plum-deep); }
/* The referral-detail / status status chip reads in the plum client accent for
   brand continuity (issue #105, PR C). The gold Verified badge (.status-chip.gold)
   keeps its gold — only the neutral status chip on the client status surfaces is
   re-skinned, not the teal system chrome elsewhere (admin/doctor). */
.portal-panel .status-chip:not(.gold):not(.warn),
.status-overview .status-chip:not(.gold):not(.warn) {
  background: var(--plum-tint);
  color: var(--plum-deep);
}

/* Slim status panel (issue #105) — one calm, reassuring line. */
.status-reassure {
  background: var(--plum-tint);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.status-reassure.is-empty { display: none; }
.status-reassure .eyebrow { margin-bottom: 4px; }
.reassure-line { font-family: var(--font-display); font-size: 18px; color: var(--ink); margin: 0; }

/* Sandi welcome moment (issue #105, Slice 7). A rounded avatar beside a plum
   eyebrow + one warm line. width/height on the <img> reserve the box so the
   photo never shifts the layout in. */
.welcome-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
}
.welcome-photo {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 6px 18px rgba(176, 58, 110, 0.22);
  border: 3px solid #fff;
  flex: 0 0 auto;
}
.welcome-text h1 { margin: 2px 0 0; }
.welcome-line { font-family: var(--font-display); font-size: 18px; color: var(--ink); max-width: 46ch; margin: 6px 0 0; line-height: 1.45; }
.screen-heading-sub { align-items: center; margin-bottom: var(--space-3); }
/* Desktop welcome leading (issue #105, PR C): on a wide screen the H1 and the
   subhead sat cramped together — give the subhead a little more breathing room
   below the headline so the welcome reads relaxed, not stacked. */
@media (min-width: 900px) {
  .welcome-text h1 { line-height: 1.15; }
  .welcome-line { margin-top: var(--space-2); line-height: 1.5; }
}
@media (max-width: 480px) {
  .welcome-row { gap: var(--space-2); }
  .welcome-photo { width: 60px; height: 60px; }
}

/* The single Screened disclosure (issue #102 — shown once at the top of results,
   no longer on every card). Reads as a calm note, not an alarm. */
.screened-disclosure {
  font-size: 13.5px; line-height: 1.55; color: var(--ink-soft);
  background: var(--bg-warm); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin: 0 0 var(--space-2);
}

/* Populated-delivery horizontal-overflow guard (issue #105 PR D / #109).
   PR C constrained the STATUS panel (.portal-panel) text; the same discipline has
   to cover the DELIVERED-DOCTOR CARDS, because once the list is populated the card
   content carries the longest real-world strings — a long practice name, a long
   booking/portal URL, a long insurance list. Constrain the card + its long-text
   surfaces to the viewport and let them wrap, so a single unbreakable token (e.g.
   a 140-char booking URL) can never force a min content width that pushes the
   delivery panel off-screen on a 320px phone. The 18-populated-overflow E2E proves
   this stays load-bearing (it overflows without these rules). */
.doctor-card { max-width: 100%; min-width: 0; }
.doctor-card h3,
.doctor-card .reach-block,
.doctor-card .eyebrow,
.doctor-contact li,
.doctor-contact a { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }

/* Contact facts read as their own quiet panel instead of a bare bullet list. */
.doctor-contact {
  list-style: none; margin: var(--space-1) 0 0; padding: var(--space-3);
  background: var(--bg); border-radius: var(--radius-sm);
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px;
}
.doctor-contact li { margin: 0; }
.doctor-offices summary { cursor: pointer; font-weight: 600; color: var(--teal-deep); min-height: 40px; display: flex; align-items: center; }

/* Report-a-problem: the deliberate red safety valve at the card footer (issue #102). */
.doctor-report { margin-top: var(--space-2); border-top: 1px solid var(--line); padding-top: var(--space-2); }
.doctor-report-toggle { cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.doctor-report-toggle:hover { color: var(--teal-deep); }
.doctor-report-toggle.danger { color: var(--danger); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.doctor-report-toggle.danger:hover { text-decoration: underline; color: var(--danger); }
.doctor-report-form { margin-top: var(--space-2); gap: var(--space-2); }
.doctor-report-form label { font-size: 14px; }
.doctor-report-form textarea, .doctor-report-form select, .doctor-report-form input { width: 100%; }

/* Per-doctor "How was your visit?" follow-up (issue #47). The green pill is the
   warm, low-pressure invite to tell us how it went. Both the summary toggle and
   the submit button use .btn-followup so they read as one friendly action. */
.doctor-visit { margin-top: var(--space-2); border-top: 1px solid var(--line); padding-top: var(--space-2); }
.btn-followup {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; min-height: 44px; padding: 10px 20px;
  background: var(--green); color: #fff;
  border: none; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; text-align: center; list-style: none;
}
.btn-followup::-webkit-details-marker { display: none; }
.btn-followup:hover { background: var(--green-deep); }
.btn-followup:focus-visible { outline: 3px solid var(--green-deep); outline-offset: 2px; }
.doctor-visit-form { margin-top: var(--space-2); gap: var(--space-2); }
.doctor-visit-form label { font-size: 14px; }
.doctor-visit-form textarea, .doctor-visit-form select { width: 100%; }
.visit-thanks {
  margin-top: var(--space-2); padding: 12px 14px;
  background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--line); color: var(--green-deep);
  font-weight: 600; font-size: 14px;
}

@media (max-width: 480px) {
  .doctor-card { padding: var(--space-3) var(--space-2) var(--space-2); }
  .doctor-contact { grid-template-columns: 1fr; padding: var(--space-2); }
  .btn-followup { width: 100%; }
}

/* ---------- Pay screen ($47 conversion, issue #113) ----------
   The most revenue-critical screen. The frame (.pay-section -> .panel) and the
   CTA (.pay-button -> .primary) are already styled; this block gives the
   persuasive COPY proper visual hierarchy WITHOUT touching any wording: the
   price line is the visual anchor, the bullets read as a confident checklist,
   and the subcopy/urgency/fineprint sit on clear emphasis tiers instead of a
   flat stack. On-brand tokens only (--plum / --teal / --space-* / --radius). */
.pay-section { display: flex; flex-direction: column; gap: var(--space-2); }
.pay-section .eyebrow { color: var(--plum); margin-bottom: 0; }
.pay-section h3 { font-family: var(--font-display); font-size: 24px; margin: 0; }
/* Lead persuasive paragraph — slightly larger, comfortable measure. */
.pay-subcopy { font-size: 17px; line-height: 1.6; color: var(--ink); max-width: 60ch; margin: 0; }
/* Confident checklist — no disc, a brand-teal check marker per row. */
.pay-bullets {
  list-style: none; margin: var(--space-1) 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--space-2);
}
.pay-bullets li {
  position: relative; padding-left: 30px; line-height: 1.5; color: var(--ink);
}
.pay-bullets li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-tint); color: var(--teal-deep);
  font-size: 13px; font-weight: 700; line-height: 1;
}
/* The price is the anchor: large, bold, plum. */
.pay-price {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  color: var(--plum); line-height: 1.3; margin: var(--space-1) 0; max-width: 60ch;
}
/* Urgency reads as warm emphasis, not body text. */
.pay-urgency {
  font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.55;
  margin: 0; max-width: 60ch;
}
/* Reassurance/fineprint/coupon are calm, small, muted supporting text. */
.pay-section .pay-fineprint,
.pay-section .pay-coupon-note { font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin: 0; }
.pay-section .pay-coupon-note {
  border-top: 1px solid var(--line); padding-top: var(--space-2); margin-top: var(--space-1);
}
@media (max-width: 480px) {
  .pay-section h3 { font-size: 21px; }
  .pay-price { font-size: 22px; }
  .pay-section .primary { width: 100%; }
}

.wizard-progress { display: flex; gap: var(--space-1); margin-bottom: var(--space-3); }
.wizard-progress span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.wizard-progress span.active { background: var(--teal); }
.wizard-actions { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-3); }

/* ---------- Admin ---------- */
.admin-section { margin-bottom: var(--space-5); }
.admin-section > h2 { font-size: 24px; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-3); }
.metric {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-3);
  display: grid;
  gap: 4px;
}
.metric b { font-size: 28px; font-family: var(--font-display); }
.metric span { font-size: 13px; color: var(--ink-soft); }
.metric small { color: var(--teal-deep); font-weight: 600; }

.filter-chips { display: flex; gap: var(--space-1); flex-wrap: wrap; margin-bottom: var(--space-3); }
.filter-chips button { padding: 8px 18px; min-height: 40px; background: var(--bg); color: var(--ink-soft); font-size: 14px; }
.filter-chips button.active { background: var(--ink); color: #fff; }
.filter-chips button:disabled { opacity: 0.45; cursor: not-allowed; }
.vetting-state-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.vetting-state-filter select { min-height: 40px; padding: 6px 10px; }

.ops-row, .admin-row, .doctor-admin-row, .seed-row, .summary-row, .compact-row {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}
.admin-list, .audit-list { display: grid; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
.admin-actions { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.admin-actions button { padding: 10px 18px; min-height: 40px; font-size: 14px; }
.candidate-list { display: grid; gap: var(--space-1); list-style: none; padding: 0; margin: 0; }
.candidate-list li { background: var(--bg); border-radius: var(--radius-sm); padding: var(--space-2); font-size: 14px; }
.candidate-meta { color: var(--ink-soft); font-size: 13px; display: block; }
/* "More detail" / "Advanced" expanders in the plain-language admin (issue #85).
   Keep the collapsed-detail text readable: the summary and any <small> rows
   stay at or above the 13px readable floor so a non-technical reviewer can read
   them and the layout font-size gate (>=12px) holds. */
.admin-detail { display: grid; gap: var(--space-1); color: var(--ink-soft); }
.admin-detail > summary { font-size: 14px; color: var(--teal-deep); font-weight: 600; cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.admin-detail small { font-size: 13px; color: var(--ink-soft); display: block; }
.origin-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal-deep); font-weight: 700; }

.table-scroll { overflow-x: auto; min-width: 0; max-width: 100%; }
/* Grid/flex children containing wide content (tables) must be allowed to
   shrink, or they blow out the page width on mobile. */
.ops-row > *, .admin-row > *, .doctor-admin-row > *, .seed-row > *,
.summary-row > *, .compact-row > *, .admin-section > * { min-width: 0; }
/* Long, unbroken email/URL strings (e.g. a queue/applicant email) must wrap
   instead of forcing horizontal scroll on small screens (#89 mobile polish). */
.ops-row span, .admin-row span, .doctor-admin-row span, .seed-row span,
.summary-row b, .summary-row span, .admin-list li { overflow-wrap: anywhere; }
.admin-table, .admin-subtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td, .admin-subtable th, .admin-subtable td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.admin-table th { color: var(--ink-soft); font-weight: 600; font-size: 13px; }

.audit-filter-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: var(--space-2); align-items: end; margin-bottom: var(--space-3); }
.audit-detail { color: var(--ink-soft); font-size: 13px; word-break: break-word; }
.admin-doctor-editor, .profile-editor { display: grid; gap: var(--space-2); }
.waitlist-box { display: grid; gap: var(--space-1); }
.compact-band { background: var(--bg); border-radius: var(--radius-sm); padding: var(--space-2); font-size: 14px; color: var(--ink-soft); }

/* Admin "view as client" preview banner (PRD v2 Slice 4). Persistent strip with
   an exit control; visually distinct from the legal bands so the admin always
   knows they are in preview mode. */
.preview-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  background: var(--ink, #1f2933);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  font-size: 14px;
  font-weight: 600;
}
.preview-band button { min-height: 36px; padding: 8px 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  section { padding: var(--space-5) var(--space-2); }
  .hero { padding-bottom: var(--space-6); }
  .hero-grid, .public-grid, .portal-grid, .offer-strip, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { align-items: stretch; }
  .hero-photo, .about-photo { max-width: 100%; }
  .site-nav { margin-bottom: var(--space-5); }
  .app-shell { padding: var(--space-2); padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero-actions .link-button { width: 100%; }
  .loc-row { grid-template-columns: minmax(0, 1fr); }
  .status-chip { white-space: normal; text-align: center; }
  .panel, .portal-panel, .doctor-panel, .admin-panel, .list-panel, .intake-card, .listing-card, .roi-card { padding: var(--space-3); }
}

/* ---------- Print (delivery portal) ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 13px; }
  .app-nav, .no-print, button, .site-footer, .skip-link { display: none !important; }
  .portal-panel, .panel, .doctor-card { box-shadow: none; border: 1px solid #ccc; }
  section { padding: 12px 0; }
  /* A printed referral must stay complete (issue #100, Slice 3): the JS print
     handler force-opens the collapsed doctor sections, but force their contents
     visible here too as a backstop, and drop the chevron affordance in print. */
  details.doctor-section > *, details.doctor-more > * { display: revert !important; }
  .doctor-section.is-telehealth > summary::after,
  .doctor-more > summary::after { content: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button, .link-button { transition: none; }
}

/* ---------- App shell v2 ---------- */
.loading-page, .auth-page {
  min-height: 100vh;
  background: var(--bg);
}

.loading-screen, .auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6) var(--space-3);
}

.loading-screen {
  align-content: center;
  text-align: center;
}

.auth-card {
  width: min(100%, 520px);
  border-top: 6px solid var(--coral);
}

.auth-card h1 {
  font-size: clamp(32px, 4vw, 46px);
}

.auth-backlink {
  margin: var(--space-3) 0 0;
  text-align: center;
  font-size: 14px;
}

.access-panel {
  border-top: 6px solid var(--coral);
}

.app-shell-v2 {
  max-width: 1280px;
  min-height: 100vh;
}

.app-brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  /* Keep a comfortable tap target around the logo link (mobile layout
     contract wants >= 44px); the logo itself stays its sized height, vertically
     centered within. */
  min-height: 44px;
  min-width: 0;
}

.app-brand .eyebrow {
  margin: 0;
}

/* Sandi signature logo in the app header (issue #50). The PNG is a teal
   "Sandi Krakowski" signature on a transparent ground, so it sits cleanly on the
   white .app-nav card without recoloring. Fixed height, auto width preserves the
   ~2.57:1 aspect; block + max-width guards keep it from overflowing the nav on
   narrow shells next to the logout button. */
.app-brand-logo {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
}
@media (max-width: 480px) {
  .app-brand-logo { height: 24px; }
}

.app-shell-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-5) 0 var(--space-6);
}

.app-shell-body > .shell-tabs-primary,
.app-shell-body > .app-content {
  max-width: none;
  margin: 0;
  min-width: 0;
}

.app-content {
  display: grid;
  gap: var(--space-3);
}

.shell-tabs {
  gap: var(--space-1);
}

.shell-tabs-primary {
  position: sticky;
  top: var(--space-3);
  display: grid;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-2);
}

.shell-tab {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}

.shell-tab:hover {
  background: var(--teal-tint);
  color: var(--teal-deep);
}

.shell-tab.active {
  background: var(--ink);
  color: #fff;
}

.screen-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.screen-heading h1 {
  font-size: clamp(32px, 4vw, 46px);
}

.screen-heading .panel-copy {
  margin-bottom: 0;
}

.patient-home-screen {
  padding: 0;
}

.patient-home-screen > .screen-heading,
.patient-home-screen > .dashboard-grid {
  max-width: none;
}

.referral-list .referral-item {
  min-height: 56px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg);
  color: var(--ink);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.referral-list .referral-item b {
  color: var(--teal-deep);
  font-size: 13px;
  text-align: right;
}

.referral-list .referral-item.active,
.referral-list .referral-item:hover {
  background: var(--teal-tint);
  border-color: rgba(41, 163, 151, 0.22);
}

.account-panel {
  display: grid;
  gap: var(--space-3);
}

.wizard-progress {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
}

.wizard-progress li {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink-soft);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}

.wizard-progress li b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--teal-tint);
  color: var(--teal-deep);
}

.wizard-progress li.current {
  background: var(--ink);
  color: #fff;
}

.wizard-progress li.current b {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.wizard-progress li.done {
  color: var(--teal-deep);
}

@media (max-width: 900px) {
  .auth-screen, .loading-screen {
    padding: var(--space-5) var(--space-2);
  }

  .app-shell-v2 {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  /* Mobile shell: the tab bar is STICKY, not fixed — it pins to the viewport
     bottom while scrolling but participates in layout, so it can never
     overlay/intercept content (flex `order` places it after the content in
     layout flow without changing the DOM). */
  .app-shell-body {
    display: flex;
    flex-direction: column;
    /* Desktop grid sets align-items: start; flex needs stretch so the
       content and tab bar span the full width. */
    align-items: stretch;
    padding: var(--space-4) 0 var(--space-3);
  }

  .app-shell-body > .app-content {
    order: 1;
    min-width: 0;
    /* iPhone fixed-bottom-tab-bar overlap (issue #93): the primary tab bar is a
       sticky-bottom bar (~88px tall) layered above the scroll flow at z-index 40.
       On short screens (notably empty-state cards like "You have not asked for a
       doctor yet.") the card's bottom tucked under the bar. Reserve scrollable
       space below the content equal to the bar height plus the iPhone home-bar
       safe-area inset so app content always clears the bottom nav. */
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  /* Sectioned delivery (issue #100, Slice 3) made the referral page taller, so
     its bottom-most controls — the follow-up form's checkboxes/button — can land
     in the ~96px zone the sticky bottom nav pins over. The .app-content padding
     above keeps content visible, but a scroll-INTO-view lands the control flush
     at the viewport bottom, behind the nav. scroll-margin-bottom reserves
     clearance so any scroll-to leaves the control above the bar (helps real
     thumbs + automated taps alike). */
  .app-shell-body > .app-content .doctor-report,
  .app-shell-body > .app-content .checkline {
    scroll-margin-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .shell-tabs-primary {
    order: 2;
    position: sticky;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    box-shadow: 0 -8px 24px rgba(27, 42, 50, 0.08);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    margin-top: var(--space-3);
  }

  .shell-tabs-primary .shell-tab {
    min-height: 48px;
    justify-content: center;
    padding: 8px 6px;
    font-size: 13px;
    text-align: center;
  }

  .screen-heading {
    display: grid;
    align-items: start;
  }

  .screen-heading .link-button {
    width: 100%;
  }

  .wizard-progress {
    grid-template-columns: minmax(0, 1fr);
  }
}
