/* HealthSync public site. No inline styles: the CSP only allows this file. */

:root {
  /* Brand tokens */
  --primary-blue: #1B5FD4;
  --dark-blue: #0F3E9E;
  --light-blue: #EBF1FF;
  --care-partner-green: #0D9B6B;
  --dark-green: #066845;
  --light-green: #E4F7F0;
  --page-bg: #F5F7FB;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --secondary-text: #64748B;

  /* Supporting shades */
  --muted-strong: #56657A;  /* secondary text that keeps 4.5:1 on --page-bg and --light-blue too */
  --border-strong: #CBD5E1;
  --notice-border: #C7D6F7;

  /* Semantic roles (switched for dark mode below) */
  --bg: var(--page-bg);
  --surface: var(--card-bg);
  --surface-blue: var(--light-blue);
  --surface-green: var(--light-green);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --ink: var(--text);
  --ink-muted: var(--muted-strong);
  --brand: var(--primary-blue);
  --brand-ink: var(--dark-blue);
  --green: var(--care-partner-green);
  --green-ink: var(--dark-green);
  --link: var(--primary-blue);
  --link-hover: var(--dark-blue);
  --btn: var(--primary-blue);
  --btn-hover: var(--dark-blue);
  --on-btn: #FFFFFF;
  --focus: var(--primary-blue);
  --phone-frame: #0F172A;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.07);

  --radius: 1rem;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --surface: #121B2E;
    --surface-blue: #15264D;
    --surface-green: #0F2E26;
    --line: #24314A;
    --line-strong: #364665;
    --notice-border: #2B3F6E;
    --ink: #E7ECF4;
    --ink-muted: #A7B4C8;
    --brand: #6F9DFF;
    --brand-ink: #A9C4FF;
    --green: #3CC796;
    --green-ink: #6EDDB4;
    --link: #8DB2FF;
    --link-hover: #BFD3FF;
    --btn: #8DB2FF;
    --btn-hover: #BFD3FF;
    --on-btn: #0B1220;
    --focus: #8DB2FF;
    --phone-frame: #020617;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/PlusJakartaSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/PlusJakartaSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/PlusJakartaSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/PlusJakartaSans-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem; /* 17px */
  line-height: 1.7;
  overflow-wrap: break-word;
}

@media (min-width: 1024px) {
  body { font-size: 1.125rem; } /* 18px */
}

img, svg { max-width: 100%; }

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0 0 1.1em; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

main:focus { outline: none; }

.container {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  background: var(--btn);
  color: var(--on-btn);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus { top: 1rem; color: var(--on-btn); }

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand:hover { color: var(--ink); }

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
}

.site-nav ul,
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.8rem;
  border-radius: 0.6rem;
  color: var(--ink);
  font-size: 0.97rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--surface-blue);
  color: var(--brand-ink);
}

.site-nav a[aria-current="page"] {
  color: var(--brand-ink);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.5em;
  text-decoration-color: var(--brand);
}

@media (max-width: 719px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-nav { margin-left: -0.5rem; }
  .site-nav ul { gap: 0; }
  .site-nav a { padding: 0 0.5rem; font-size: 0.94rem; }
}

/* ---------- Page head (legal pages) ---------- */

.page-head {
  background: var(--surface-blue);
  border-bottom: 1px solid var(--line);
  padding: 2.5rem 0 2.25rem;
}

.page-head h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 24ch;
}

.page-lede {
  margin: 0.75rem 0 0;
  max-width: 60ch;
  color: var(--ink-muted);
  font-size: 1.05em;
}

.effective {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.95rem;
  font-weight: 700;
}

.effective .icon { color: var(--brand); }

@media (max-width: 599px) {
  .page-head { padding: 1.5rem 0 1.4rem; }
  .effective { margin-top: 1rem; }
}

/* ---------- Long document layout ---------- */

.doc-layout {
  padding: 2rem 0 4rem;
}

.toc-desktop { display: none; }

.doc {
  max-width: var(--measure);
  min-width: 0;
}

@media (min-width: 1024px) {
  .doc-layout {
    display: grid;
    grid-template-columns: 16rem minmax(0, var(--measure));
    justify-content: center;
    gap: 4.5rem;
    padding-top: 3rem;
  }

  .toc-desktop {
    display: block;
    position: sticky;
    top: 1.5rem;
    align-self: start;
  }

  .toc-mobile { display: none; }
}

.toc-inner {
  position: relative;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 0.25rem 0.25rem 0.5rem;
}

.toc-title {
  margin: 0 0 0.6rem;
  padding-left: 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border-radius: 0.55rem;
  color: var(--ink-muted);
  font-size: 0.93rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc-link:hover {
  background: var(--surface);
  color: var(--ink);
}

.toc-link.is-active {
  background: var(--surface-blue);
  color: var(--brand-ink);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brand);
}

.toc-num {
  flex: none;
  min-width: 1.4em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.toc-item--h3 .toc-link { padding-left: 2rem; }

.toc-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  margin-top: 0.75rem;
  padding: 0 0.75rem;
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
}

/* Mobile "Jump to section" */
.toc-mobile {
  margin: 0 0 1.75rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}

.toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.toc-mobile summary::-webkit-details-marker { display: none; }

.toc-mobile summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
}

.toc-mobile[open] summary::after { transform: translateY(25%) rotate(-135deg); }

.toc-mobile[open] summary { border-bottom: 1px solid var(--line); }

.toc-mobile .toc-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.35rem;
}

/* Document typography */
.doc-intro { margin-bottom: 0.5rem; }

.doc-section { margin-top: 2.75rem; }

.doc-intro + .doc-section,
.toc-mobile + .doc-section { margin-top: 1.5rem; }

.heading-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.heading-row h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.75rem);
  font-weight: 800;
}

.heading-row h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.heading-row--h3 { margin-top: 1.75rem; }

.doc h2,
.doc h3 { scroll-margin-top: 1.5rem; }

.h-num { color: var(--brand); }

.heading-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: -0.5rem 0;
  border-radius: 0.5rem;
  color: var(--line-strong);
  font-weight: 700;
  text-decoration: none;
}

.heading-anchor:hover,
.heading-anchor:focus-visible { color: var(--brand); }

.doc ul,
.doc ol {
  margin: 0 0 1.1em;
  padding-left: 1.4rem;
}

.doc li + li { margin-top: 0.45em; }

.doc li::marker { color: var(--brand); font-weight: 700; }

.doc strong { font-weight: 700; }

/* Long email addresses must wrap on narrow screens. */
.doc a[href^="mailto:"] { overflow-wrap: anywhere; }

.routes > *,
.outcomes > * { min-width: 0; }

.back-to-top {
  margin: 3rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.back-to-top a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}

/* Data table */
.table-wrap {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  line-height: 1.55;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--surface-blue);
  color: var(--brand-ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.data-table td { border-top: 1px solid var(--line); }

.data-table td:first-child { font-weight: 700; }

@media (max-width: 599px) {
  .table-wrap {
    border: 0;
    background: none;
    overflow: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td { display: block; }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .data-table tr {
    margin-bottom: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: var(--surface);
    overflow: hidden;
  }

  .data-table td { border-top: 1px solid var(--line); }

  .data-table td:first-child {
    border-top: 0;
    background: var(--surface-blue);
    color: var(--brand-ink);
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

/* ---------- Account deletion page ---------- */

.doc-single { padding: 2rem 0 4rem; }

.doc--wide {
  max-width: 56rem;
  margin-inline: auto;
}

.doc--wide p { max-width: var(--measure); }

.routes {
  display: grid;
  gap: 1rem;
}

@media (min-width: 760px) {
  .routes { grid-template-columns: 1fr 1fr; }
}

.route-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.route-card--email { border-top: 4px solid var(--brand); }
.route-card:not(.route-card--email) { border-top: 4px solid var(--green); }

.route-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--brand-ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.route-label .icon { width: 1.35em; height: 1.35em; }

.doc .step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step 0;
}

.doc .step-list[start="3"] { counter-reset: step 2; }
.doc .step-list[start="4"] { counter-reset: step 3; }

.step-list li {
  position: relative;
  min-height: 2.25rem;
  padding-left: 3rem;
  counter-increment: step;
}

.doc .step-list li + li { margin-top: 1rem; }

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--btn);
  color: var(--on-btn);
  font-size: 0.95rem;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  align-self: flex-start;
  min-height: 48px;
  margin-top: auto;
  padding: 0.7rem 1.3rem;
  border-radius: 0.75rem;
  background: var(--btn);
  color: var(--on-btn);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.route-card .step-list + .button { margin-top: 1.5rem; }

.button:hover {
  background: var(--btn-hover);
  color: var(--on-btn);
}

.after-steps {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.outcomes {
  display: grid;
  gap: 1rem;
  margin-top: 2.75rem;
}

@media (min-width: 760px) {
  .outcomes { grid-template-columns: 1fr 1fr; }
}

.outcome {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.outcome--deleted { border-top: 4px solid var(--brand); }
.outcome--kept { border-top: 4px solid var(--green); }

.outcome-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.9rem;
  border-radius: 0.8rem;
}

.outcome-icon .icon { width: 1.5rem; height: 1.5rem; }

.outcome--deleted .outcome-icon { background: var(--surface-blue); color: var(--brand-ink); }
.outcome--kept .outcome-icon { background: var(--surface-green); color: var(--green-ink); }

.outcome .heading-row h2 { font-size: 1.35rem; }

.outcome ul { margin-bottom: 0; }

/* ---------- Home ---------- */

.hero {
  padding: 3.5rem 0 4rem;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; gap: 3rem; }
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.availability-dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--surface-green);
}

.hero h1 {
  max-width: 13ch;
  margin: 1.1rem 0 1.1rem;
  font-size: clamp(2.5rem, 6.5vw, 4.1rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-lede {
  max-width: 34em;
  font-size: 1.2em;
  line-height: 1.6;
}

.hero-note {
  max-width: 34em;
  padding-left: 0.9rem;
  border-left: 3px solid var(--green);
  color: var(--ink-muted);
}

.hero-jump { margin: 0; }

.hero-jump a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--brand-ink);
  font-weight: 700;
  text-decoration: none;
}

.hero-jump a::after { content: "↓"; }

.hero-jump a:hover { border-color: var(--brand); }

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1rem 0;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: min(26rem, 92%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface-blue);
}

.hero-visual::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: 10%;
  width: 5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface-green);
}

.phone {
  position: relative;
  z-index: 1;
  width: min(18rem, 80vw);
  padding: 0.65rem;
  border-radius: 2.4rem;
  background: var(--phone-frame);
  box-shadow: var(--shadow), 0 30px 60px rgba(15, 23, 42, 0.18);
  line-height: 1.35;
}

.phone-screen {
  padding: 0.75rem 0.85rem 1.1rem;
  border-radius: 1.85rem;
  background: var(--bg);
  font-size: 0.85rem;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.phone-status-icons { display: inline-flex; gap: 0.25rem; }

.phone-status-icons span {
  width: 0.9rem;
  height: 0.45rem;
  border-radius: 0.15rem;
  background: currentColor;
  opacity: 0.7;
}

.phone-appbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1rem 0.3rem 0.75rem;
}

.phone-appname { color: var(--brand-ink); font-weight: 800; font-size: 1rem; }
.phone-today { color: var(--ink-muted); font-weight: 600; }

.reminder-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.reminder-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.reminder-tag {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--brand-ink);
  font-size: 0.7rem;
  font-weight: 700;
}

.reminder-time { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }

.reminder-med { margin: 0.75rem 0 0; font-size: 1.05rem; font-weight: 700; }
.reminder-dose { margin: 0.1rem 0 0; color: var(--ink-muted); }

.reminder-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.phone-btn {
  display: grid;
  place-items: center;
  min-height: 2.5rem;
  border-radius: 0.7rem;
  font-weight: 700;
}

.phone-btn--done { background: var(--dark-green); color: #FFFFFF; }
.phone-btn--snooze { background: var(--surface-blue); color: var(--brand-ink); }

.upnext {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.9rem;
}

.upnext-label {
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.upnext-row { display: flex; justify-content: space-between; font-weight: 600; }

@media (max-width: 599px) {
  .hero { padding: 2rem 0 2.5rem; }
  .phone { width: min(16rem, 78vw); }
}

/* Home sections */
.band {
  padding: 4.5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.band--plain { background: var(--bg); }

@media (max-width: 599px) {
  .band { padding: 3rem 0; }
}

.section-title {
  margin-bottom: 1.75rem;
  font-size: clamp(1.65rem, 3.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* How it works */
.flow {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

.flow-step {
  position: relative;
  padding: 0 0 2rem 3.75rem;
  counter-increment: flow;
}

.flow-step:last-child { padding-bottom: 0; }

.flow-step::before {
  content: counter(flow);
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--btn);
  color: var(--on-btn);
  font-weight: 800;
}

.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.3rem - 1px);
  top: 2.6rem;
  bottom: 0;
  width: 2px;
  background: var(--line-strong);
}

.flow-step p { margin: 0.6rem 0 0; max-width: 36em; }

@media (min-width: 900px) {
  .flow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  .flow-step { padding: 3.6rem 0 0; }

  .flow-step:not(:last-child)::after {
    left: 3.4rem;
    right: -1.4rem;
    top: calc(1.3rem - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
  }
}

.role {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.6;
}

.role--partner { background: var(--surface-green); color: var(--green-ink); }
.role--patient { background: var(--surface-blue); color: var(--brand-ink); }

/* Features */
@media (min-width: 900px) {
  .split {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
  }
}

.features {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.feature {
  display: flex;
  gap: 1.1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.feature h3 {
  margin-bottom: 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.feature p { margin: 0; color: var(--ink-muted); }

.feature-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  background: var(--surface-blue);
  color: var(--brand-ink);
}

.feature-icon svg { width: 1.6rem; height: 1.6rem; }

.feature-icon--green { background: var(--surface-green); color: var(--green-ink); }

/* Optional medicine box */
.optional-block {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border: 2px dashed var(--line-strong);
  border-radius: 1.5rem;
  background: var(--bg);
}

@media (min-width: 800px) {
  .optional-block { grid-template-columns: 1.4fr 1fr; padding: 2.5rem; }
}

@media (max-width: 599px) {
  .optional-block { padding: 1.5rem; }
}

.optional-tag {
  display: inline-block;
  margin: 0 0 0.9rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--brand-ink);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.optional-copy .section-title { margin-bottom: 0.9rem; }
.optional-copy p:last-child { margin-bottom: 0; max-width: 38em; }

.box-art {
  justify-self: center;
  width: 100%;
  max-width: 20rem;
}

.box-body { fill: var(--surface); stroke: var(--line-strong); stroke-width: 2; }
.box-cell { fill: var(--surface-blue); stroke: var(--line); stroke-width: 1.5; }
.box-cell--lit { fill: var(--surface-green); stroke: var(--green); stroke-width: 3; }
.box-led { fill: var(--line-strong); }
.box-led--lit { fill: var(--green); }

/* Privacy tiles */
.tiles {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

@media (min-width: 1000px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
}

.tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
  min-height: 4.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.tile:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}

.tile-arrow { color: var(--brand); font-size: 1.2em; }

@media (prefers-reduced-motion: no-preference) {
  .tile-arrow { transition: transform 0.15s ease; }
  .tile:hover .tile-arrow { transform: translateX(3px); }
}

.tiles-note { margin: 1.25rem 0 0; color: var(--ink-muted); }

/* Important notice */
.notice {
  display: flex;
  gap: 1.25rem;
  padding: 1.75rem;
  border: 1px solid var(--notice-border);
  border-left: 6px solid var(--brand-ink);
  border-radius: 1.25rem;
  background: var(--surface-blue);
}

.notice-icon {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--brand-ink);
}

.notice .section-title { margin-bottom: 0.6rem; }
.notice p { max-width: 62ch; margin: 0; }

@media (max-width: 599px) {
  .notice { flex-direction: column; gap: 0.75rem; padding: 1.4rem; }
}

.about-text { max-width: 52ch; margin: 0; font-size: 1.12em; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding: 2.5rem 0;
}

.footer-id p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.97rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem !important;
  color: var(--ink) !important;
  font-weight: 800;
  font-size: 1.05rem !important;
}

.footer-brand .brand-mark { width: 1.5rem; height: 1.5rem; border-radius: 0.4rem; }

.footer-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  font-weight: 600;
}

.footer-nav ul { gap: 0 1.25rem; }

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.97rem;
  font-weight: 600;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print: clean black-on-white legal pages ---------- */

@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  body { font-size: 11pt; line-height: 1.5; }

  .skip-link,
  .site-nav,
  .footer-nav,
  .toc,
  .toc-mobile,
  .heading-anchor,
  .back-to-top,
  .hero-visual,
  .hero-jump,
  .box-art { display: none !important; }

  .container { width: auto; }

  .site-header,
  .site-footer,
  .page-head,
  .band { border-color: #000 !important; }

  .page-head { padding: 0 0 12pt; }
  .doc-layout,
  .doc-single { display: block; padding: 12pt 0 0; }
  .doc, .doc--wide { max-width: none; }

  a { text-decoration: underline; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; }

  h2, h3, .heading-row { break-after: avoid; page-break-after: avoid; }
  tr, .route-card, .outcome, .notice { break-inside: avoid; page-break-inside: avoid; }

  .table-wrap, .route-card, .outcome, .after-steps, .effective, .optional-block, .notice, .tile {
    border: 1px solid #000 !important;
  }
  .data-table th, .data-table td { border: 1px solid #000 !important; }

  .step-list li::before,
  .flow-step::before { border: 1px solid #000; }

  .button { border: 1px solid #000; }
}
