/* Cairn design system.

   Light and editorial: large light-weight headlines (Lexend), small monospace
   labels (IBM Plex Mono), hairline borders instead of heavy shadows, soft
   pastel gradients, pill buttons with a round arrow badge, and a deep
   green-ink for dark bands. Fonts are self-hosted in web/fonts (SIL OFL);
   nothing loads from another site. Every text and background pair meets
   WCAG 2.2 AA in light and dark mode. */

@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --font-sans: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --heading: #0c2b27;
  --text: #1d322f;
  --muted: #506263;
  --line: #dde7e3;
  --line-strong: #bfd1cb;
  --control: #7b8f8a;
  --bg: #ffffff;
  --bg-soft: #f3f7f5;
  --surface: #ffffff;
  --inset: #f3f7f5;
  --accent: #0f766e;
  --accent-strong: #0b5c56;
  --accent-soft: #e2f3ee;
  --mint: #86e5c8;
  --mint-strong: #63d8b5;
  --on-mint: #0c2b27;
  --on-accent: #ffffff;
  --band: #0c2b27;
  --band-2: #11403a;
  --band-text: #d9e8e3;
  --band-muted: #a3bbb4;
  --band-line: rgba(255, 255, 255, 0.14);
  --step: #8a5a14;
  --step-soft: #fcf4e4;
  --step-line: #ebd8ae;
  --draft-bg: #fff4c9;
  --draft-text: #5c4400;
  --draft-line: #c9a227;
  --reviewed-bg: #e3ecfb;
  --reviewed-text: #123f7a;
  --reviewed-line: #1b5fb8;
  --error-bg: #fbe9e7;
  --error-text: #8a1c0e;
  --focus: #1b5fb8;
  --dot: rgba(12, 43, 39, 0.13);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 24px;
  --lift: 0 22px 44px -26px rgba(12, 43, 39, 0.4);
  --gutter: 1.25rem;
  --header-h: 4.25rem;
  --tabbar-h: 4.1rem;

  --grad-hero:
    radial-gradient(55% 75% at 0% 100%, rgba(134, 229, 200, 0.55) 0%, transparent 62%),
    radial-gradient(45% 65% at 100% 0%, rgba(206, 220, 250, 0.8) 0%, transparent 60%),
    radial-gradient(35% 45% at 72% 72%, rgba(250, 230, 200, 0.65) 0%, transparent 70%),
    #f2f8f5;
  --grad-soft:
    radial-gradient(60% 140% at 0% 0%, rgba(134, 229, 200, 0.3) 0%, transparent 60%),
    radial-gradient(45% 140% at 100% 0%, rgba(206, 220, 250, 0.55) 0%, transparent 60%),
    #f6faf8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --heading: #eef6f3;
    --text: #dbe7e3;
    --muted: #9fb3ad;
    --line: #243532;
    --line-strong: #35504a;
    --control: #688a82;
    --bg: #0b1614;
    --bg-soft: #0f1d1b;
    --surface: #10201d;
    --inset: #0a1614;
    --accent: #74d6c3;
    --accent-strong: #a3e6d8;
    --accent-soft: #15302b;
    --on-accent: #0c2b27;
    --band: #06120f;
    --band-2: #0b1d1a;
    --step: #f0c37c;
    --step-soft: #251f12;
    --step-line: #54462a;
    --draft-bg: #3b3000;
    --draft-text: #ffe7a0;
    --reviewed-bg: #16243d;
    --reviewed-text: #c7dafc;
    --reviewed-line: #8ab4ff;
    --error-bg: #3a1a16;
    --error-text: #ffb4a8;
    --focus: #8ab4ff;
    --dot: rgba(255, 255, 255, 0.09);
    --lift: 0 22px 44px -26px rgba(0, 0, 0, 0.8);
    --grad-hero:
      radial-gradient(55% 75% at 0% 100%, rgba(40, 160, 130, 0.32) 0%, transparent 62%),
      radial-gradient(45% 65% at 100% 0%, rgba(70, 90, 170, 0.32) 0%, transparent 60%),
      #0b1614;
    --grad-soft:
      radial-gradient(60% 140% at 0% 0%, rgba(40, 160, 130, 0.18) 0%, transparent 60%),
      radial-gradient(45% 140% at 100% 0%, rgba(70, 90, 170, 0.18) 0%, transparent 60%),
      #0d1a18;
  }
}

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

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: var(--accent-strong);
}

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

h1,
h2,
h3,
h4 {
  color: var(--heading);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

h1 {
  margin: 0.4rem 0 0.75rem;
  font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.4rem);
}

h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem);
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.015em;
}

h4 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 0.8rem;
}

strong {
  font-weight: 600;
}

h1:focus,
h2:focus,
h3:focus,
main:focus {
  outline: none;
}

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

.skip-link {
  position: absolute;
  top: -5rem;
  left: 0.75rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--lift);
}

.skip-link:focus {
  top: 0.75rem;
}

.container {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container.narrow {
  max-width: 50rem;
}

@media (min-width: 760px) {
  :root {
    --gutter: 2rem;
  }
}

/* Small monospace labels: the "[ LABEL ]" eyebrows */
.eyebrow {
  display: inline-block;
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "[ " / "";
}

.eyebrow::after {
  content: " ]" / "";
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.22rem);
  line-height: 1.6;
}

.hint {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Icons: inline SVG next to text, never alone ---------- */

.icon {
  flex: none;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.25em;
}

.with-icon {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* An icon in a small hairline square */
.icon-badge,
h2.with-icon > .icon {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--accent);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.4rem 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: var(--heading);
  color: var(--heading);
}

.button.primary {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--on-mint);
}

.button.primary:hover {
  border-color: var(--mint-strong);
  background: var(--mint-strong);
  color: var(--on-mint);
}

/* The trailing arrow is a round badge, like a trail marker */
.button > .icon-end {
  width: 2.2rem;
  height: 2.2rem;
  margin: -0.1rem -0.95rem -0.1rem 0.1rem;
  padding: 0.55rem;
  border-radius: 50%;
  background: var(--heading);
  color: var(--bg);
  transition: transform 160ms ease;
}

.button.primary > .icon-end {
  background: var(--on-mint);
  color: var(--mint);
}

.button:hover > .icon-end {
  transform: translateX(2px);
}

.button > .icon:not(.icon-end) {
  width: 1.15rem;
  height: 1.15rem;
}

.button.small {
  min-height: 40px;
  padding: 0.3rem 1rem;
  font-size: 0.74rem;
}

.add-button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-self: start;
  min-height: 42px;
  padding: 0.35rem 1rem 0.35rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.add-button > .icon {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.35rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.add-button:hover {
  border-color: var(--heading);
}

.add-button.added {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--on-mint);
}

.add-button.added > .icon {
  background: var(--on-mint);
  color: var(--mint);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.icon-button,
.text-button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.icon-button {
  display: inline-grid;
  place-items: center;
}

.text-button {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0 0.95rem;
}

.icon-button:hover,
.text-button:hover {
  border-color: var(--heading);
}

.icon-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.icon-button:disabled:hover {
  border-color: var(--line);
}

.actions {
  margin: 2rem 0;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Top bar: demo mode ---------- */

.topbar {
  background: var(--band);
  color: var(--band-text);
  font-size: 0.8rem;
  line-height: 1.55;
}

@media (min-width: 760px) {
  .topbar {
    font-size: 0.86rem;
  }
}

.topbar-inner {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.topbar-tag {
  display: inline-block;
  margin-right: 0.6rem;
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  background: var(--mint);
  color: var(--on-mint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
}

.header-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--heading);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-decoration: none;
}

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

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  color: var(--accent);
}

.header-tagline {
  display: none;
  margin: 0 auto 0 0.25rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.main-nav {
  display: none;
}

@media (min-width: 1100px) {
  .header-tagline {
    display: block;
  }
}

@media (min-width: 760px) {
  .main-nav {
    display: flex;
    gap: 0.35rem;
    align-items: center;
  }

  .main-nav a {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    min-height: 42px;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    color: var(--heading);
    font-size: 0.97rem;
    text-decoration: none;
    transition: background-color 160ms ease;
  }

  .main-nav a > .icon {
    display: none;
  }

  .main-nav a:hover {
    background: var(--bg-soft);
  }

  .main-nav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .main-nav a.nav-cta {
    margin-left: 0.4rem;
    border: 1px solid var(--mint);
    background: var(--mint);
    color: var(--on-mint);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .main-nav a.nav-cta:hover,
  .main-nav a.nav-cta[aria-current="page"] {
    border-color: var(--mint-strong);
    background: var(--mint-strong);
    color: var(--on-mint);
  }
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  margin-left: 0.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--heading);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0;
}

/* ---------- Bottom tab bar (phones) ---------- */

.tab-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
}

.tab-bar a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  justify-content: center;
  min-height: var(--tabbar-h);
  padding: 0.4rem 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
}

.tab-bar a > .icon {
  width: 1.45rem;
  height: 1.45rem;
}

.tab-bar a[aria-current="page"] {
  color: var(--accent-strong);
}

.tab-bar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 30%;
  right: 30%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

.tab-bar .count {
  position: absolute;
  top: 0.35rem;
  left: calc(50% + 0.45rem);
  height: 1.2rem;
  min-width: 1.2rem;
  font-size: 0.66rem;
}

@media (max-width: 759px) {
  body {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  }
}

@media (min-width: 760px) {
  .tab-bar {
    display: none;
  }
}

/* ---------- Notices ---------- */

.status-wrap {
  padding-top: 2rem;
}

.notice {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.notice.error {
  border-color: transparent;
  background: var(--error-bg);
  color: var(--error-text);
}

.notice.error ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.note {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.97rem;
}

.note p:last-child {
  margin: 0;
}

.empty-state {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.empty-state > .icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

/* ---------- Page head: the band at the top of each screen ---------- */

.page-head {
  border-bottom: 1px solid var(--line);
  background: var(--grad-soft);
}

.page-head .container {
  padding-top: 2.75rem;
  padding-bottom: 2.25rem;
}

.page-head h1 {
  max-width: 22ch;
}

.page-head .lead {
  max-width: 42rem;
  margin: 0;
}

.page-body {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

@media (min-width: 760px) {
  .page-head .container {
    padding-top: 3.75rem;
    padding-bottom: 3rem;
  }

  .page-body {
    padding-top: 3.25rem;
  }
}

/* Your situation: the answers as chips, under the map's title */
.situation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.situation li {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  font-size: 0.92rem;
}

.situation li.unsure {
  border-style: dashed;
  color: var(--muted);
}

.situation .edit {
  border: 0;
  background: none;
  padding: 0;
}

.change-link {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 500;
}

/* ---------- Welcome page ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--grad-hero);
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-top: 3rem;
  padding-bottom: 3.5rem;
}

.hero h1 {
  max-width: 14ch;
  margin: 1.1rem 0 1.25rem;
  font-size: clamp(2.6rem, 1.4rem + 4.8vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.hero-lead {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 1.4rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.hero-meta li {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.hero-meta .icon {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}

.welcome-back {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  max-width: 34rem;
  margin: 1.5rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--heading);
}

.welcome-back > .icon {
  color: var(--accent);
}

.hero-art {
  position: relative;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
}

.hero-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.art-chip {
  position: absolute;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.85rem 0.55rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--lift);
  color: var(--heading);
  font-size: 0.86rem;
  line-height: 1.25;
  white-space: nowrap;
}

.art-chip .icon {
  width: 2rem;
  height: 2rem;
  padding: 0.45rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.art-chip .mono {
  display: block;
  color: var(--accent);
  font-size: 0.64rem;
}

.art-chip.chip-a {
  top: 6%;
  left: -2%;
}

.art-chip.chip-b {
  top: 44%;
  right: -2%;
}

.art-chip.chip-c {
  bottom: 6%;
  left: 4%;
}

.art-chip.chip-b .icon {
  background: var(--step-soft);
  color: var(--step);
}

@media (min-width: 960px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
    min-height: 36rem;
    padding-top: 4.5rem;
    padding-bottom: 5rem;
  }
}

@media (max-width: 480px) {
  .art-chip {
    font-size: 0.78rem;
  }

  .art-chip .icon {
    width: 1.7rem;
    height: 1.7rem;
    padding: 0.35rem;
  }
}

/* Welcome sections */
.band {
  padding: 4rem 0;
}

.band.soft {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

@media (min-width: 760px) {
  .band {
    padding: 5.5rem 0;
  }
}

.section-head {
  display: grid;
  gap: 0 4rem;
  margin-bottom: 2.75rem;
}

.section-head .eyebrow {
  justify-self: start;
}

.section-head h2 {
  margin: 0.9rem 0 1rem;
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem);
}

.section-text {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

@media (min-width: 900px) {
  .section-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .section-head .eyebrow {
    grid-column: 1 / -1;
  }

  .section-head h2 {
    margin-bottom: 0;
  }

  .section-text {
    padding-top: 1.4rem;
  }
}

.steps-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.step-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.step-num {
  color: var(--heading);
  font-family: var(--font-mono);
  font-size: 2.9rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.step-card h3 {
  margin-top: 2.25rem;
  font-size: 1.4rem;
  font-weight: 300;
}

.step-card p {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 900px) {
  .steps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .feature-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-card {
  display: grid;
  gap: 0.4rem;
  padding: 1.6rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature-card h3 {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  font-size: 1.45rem;
  font-weight: 300;
}

.feature-card h3 .icon {
  width: 1.4rem;
  height: 1.4rem;
  color: var(--accent);
}

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

.not-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.not-tile {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.not-tile h3 {
  margin: 0.4rem 0 0;
  font-size: 1.3rem;
  font-weight: 300;
}

.not-tile p {
  margin: 0;
  color: var(--muted);
}

.not-tile.is-urgent {
  border-color: color-mix(in srgb, var(--error-text) 35%, var(--line));
}

.not-tile.is-urgent .icon-badge {
  color: var(--error-text);
}

.not-tile.is-urgent p {
  color: var(--text);
  font-weight: 500;
}

.caregiver-note {
  margin: 1.5rem 0 0;
  color: var(--muted);
}

@media (min-width: 900px) {
  .not-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The closing call to action: a dark band */
.cta-band {
  position: relative;
  overflow: hidden;
  padding: 3rem 1.75rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(134, 229, 200, 0.28) 0%, transparent 60%),
    radial-gradient(50% 80% at 0% 100%, rgba(120, 140, 230, 0.22) 0%, transparent 60%),
    var(--band);
  color: var(--band-text);
  text-align: center;
}

.cta-band h2 {
  max-width: 22ch;
  margin: 0.9rem auto 0.9rem;
  color: #ffffff;
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem);
}

.cta-band p {
  max-width: 34rem;
  margin: 0 auto 1.75rem;
  color: var(--band-muted);
}

.cta-band .eyebrow {
  color: var(--mint);
}

.cta-band .actions-row {
  justify-content: center;
}

.cta-band .button:not(.primary) {
  border-color: var(--band-line);
  background: transparent;
  color: #ffffff;
}

.cta-band .button:not(.primary):hover {
  border-color: #ffffff;
}

@media (min-width: 760px) {
  .cta-band {
    padding: 4.5rem 2rem;
  }
}

/* Small phones: room for the longest button label on one line */
@media (max-width: 480px) {
  .cta-band {
    padding: 2.5rem 1.25rem;
  }

  .button {
    padding-left: 1.15rem;
    letter-spacing: 0.05em;
  }
}

/* ---------- Screen 1: the answers form ---------- */

.answers-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.answers-form {
  max-width: 50rem;
  counter-reset: question;
}

.answers-aside {
  display: none;
}

@media (min-width: 1040px) {
  .answers-layout {
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: 3.5rem;
    align-items: start;
  }

  .answers-aside {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}

.answer-summary {
  margin: 0.9rem 0 1.5rem;
}

.answer-summary div {
  display: grid;
  gap: 0.1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.answer-summary dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.answer-summary dd {
  margin: 0;
  color: var(--heading);
  font-weight: 500;
  line-height: 1.4;
}

.answer-summary dd.empty {
  color: var(--muted);
  font-weight: 400;
}

.aside-note {
  display: flex;
  gap: 0.6rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.aside-note .icon {
  margin-top: 0.1rem;
  color: var(--accent);
}

.choice-group {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

/* Each top-level question is a numbered card */
.answers-form .choice-group:not(.choice-group .choice-group) {
  position: relative;
  padding: 1.5rem 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.answers-form .choice-group:not(.choice-group .choice-group) > legend {
  float: left;
  width: 100%;
  margin-bottom: 0.9rem;
  padding: 0;
  color: var(--heading);
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.answers-form .choice-group:not(.choice-group .choice-group) > legend::before {
  counter-increment: question;
  content: counter(question, decimal-leading-zero);
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.answers-form .choice-group:not(.choice-group .choice-group) > legend + * {
  clear: both;
}

.choice-group .hint {
  clear: both;
  margin: -0.35rem 0 0.9rem;
}

.choices {
  display: grid;
  gap: 0.5rem;
  clear: both;
}

@media (min-width: 640px) {
  .answers-form .choice-group:not(.choice-group .choice-group) {
    padding: 1.75rem 1.75rem 1.5rem;
  }

  .answers-form .choice-group:not(.choice-group .choice-group) > .choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.choice {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  min-height: 54px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--heading);
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.choice:hover {
  border-color: var(--line-strong);
  background: var(--bg-soft);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* A custom radio: a ring that fills like a trail marker */
.choice input {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  margin: 0;
  border: 1.5px solid var(--control);
  border-radius: 50%;
  background: var(--surface);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.choice input::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 140ms ease;
}

.choice input:checked {
  border-color: var(--accent);
}

.choice input:checked::after {
  transform: scale(1);
}

.choice input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* The "have you had these tests?" rows: one small group per test */
.choice-group .choice-group {
  margin: 1.1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.choice-group .choice-group > legend {
  margin-bottom: 0.6rem;
  padding: 0;
  color: var(--heading);
  font-size: 1rem;
  font-weight: 500;
}

.choice-group .choice-group .choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-group .choice-group .choice {
  justify-content: center;
  min-height: 48px;
  padding: 0.5rem 0.6rem;
}

.answers-form .actions {
  display: flex;
  justify-content: flex-end;
  margin: 1.75rem 0 0;
}

@media (max-width: 759px) {
  .answers-form .actions {
    position: sticky;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    z-index: 5;
    margin: 1.25rem calc(-1 * var(--gutter)) 0;
    padding: 0.75rem var(--gutter);
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .answers-form .actions .button {
    width: 100%;
  }
}

/* ---------- Screen 2: the map ---------- */

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 1040px) {
  .map-layout {
    grid-template-columns: 14.5rem minmax(0, 1fr);
    gap: 3.5rem;
  }
}

/* On this page: chips on a phone, a sticky list beside the map on a wide screen */
.page-nav-label {
  margin: 0 0 0.6rem;
}

.page-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-nav button {
  min-height: 38px;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.page-nav button:hover {
  border-color: var(--heading);
}

@media (max-width: 1039px) {
  .page-nav ul {
    flex-wrap: nowrap;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0.1rem 3rem 0.35rem var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
  }

  .page-nav ul::-webkit-scrollbar {
    display: none;
  }

  .page-nav li {
    flex: none;
  }
}

@media (min-width: 1040px) {
  .page-nav {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
  }

  .page-nav ul {
    display: grid;
    gap: 0;
    border-left: 1px solid var(--line);
  }

  .page-nav button {
    display: block;
    width: 100%;
    min-height: 36px;
    margin-left: -1px;
    padding: 0.35rem 0 0.35rem 1rem;
    border: 0;
    border-left: 2px solid transparent;
    border-radius: 0;
    background: none;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
  }

  .page-nav button:hover {
    color: var(--heading);
  }

  .page-nav button[aria-current="true"] {
    border-left-color: var(--accent);
    color: var(--heading);
  }
}

.map-main > :first-child {
  margin-top: 0;
}

.map-section {
  margin: 0 0 3.75rem;
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}

.map-section > h2 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.6rem, 1.25rem + 1.2vw, 2.1rem);
}

.map-section:has(> .map-topic:not([open])) {
  margin-bottom: 0.85rem;
}

.map-topic {
  padding: 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.map-topic > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 1rem 0;
  color: var(--heading);
  list-style: none;
  cursor: pointer;
}

.map-topic > summary::-webkit-details-marker {
  display: none;
}

.map-topic > summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1;
}

.map-topic[open] > summary::after {
  content: "\2212";
}

.map-topic > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.map-topic > summary h2 {
  margin: 0;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem);
}

.map-topic > .cards,
.map-topic > .terms,
.map-topic > .reading,
.map-topic > .trail {
  margin-bottom: 1.25rem;
}

.section-intro {
  max-width: 42rem;
  margin-bottom: 1.4rem;
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 0.75rem;
}

.card {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
  transition: border-color 160ms ease;
}

.card:hover {
  border-color: var(--line-strong);
}

.card > :last-child {
  margin-bottom: 0;
}

.card h3 {
  font-size: 1.3rem;
  font-weight: 400;
}

.card-step {
  position: relative;
}

.card-step::before {
  content: "";
  position: absolute;
  top: 1.35rem;
  bottom: 1.35rem;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--step);
}

.card-label {
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-note {
  display: inline-flex;
  margin: 0.15rem 0 0.4rem;
  padding: 0.2rem 0.7rem;
  border-radius: 0.75rem;
  line-height: 1.45;
  background: var(--step-soft);
  color: var(--step);
  font-size: 0.88rem;
  font-weight: 500;
}

.draft-tag {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--draft-bg);
  color: var(--draft-text);
  font-size: 0.78rem;
}

.ask {
  margin: 1rem 0 0.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--inset);
}

.ask-label,
.card-help-label {
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Where to learn more: resources linked to a card, such as places to look for trials */
.card-help {
  margin: 1.1rem 0 0.35rem;
  padding: 0 0.1rem;
}

.card-help ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-help li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  line-height: 1.45;
}

.card-help li > .icon {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  color: var(--accent);
}

.card-help a {
  font-weight: 500;
}

.ask-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ask-list li {
  display: grid;
  gap: 0.55rem;
}

.ask-text {
  color: var(--heading);
  font-size: 1.05rem;
}

.question-title {
  font-size: 1.3rem;
}

.card-sources {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.card-sources a {
  color: var(--muted);
}

.card-sources a:hover {
  color: var(--accent-strong);
}

.resource-links {
  font-weight: 500;
}

.more {
  margin-top: 0.4rem;
}

.more > summary {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.55rem 0 0.2rem;
  color: var(--heading);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

.more > summary::-webkit-details-marker {
  display: none;
}

.more > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  letter-spacing: 0;
  line-height: 1;
  transition: transform 160ms ease;
}

.more[open] > summary::before {
  content: "\2212";
}

.more[open] > summary {
  margin-bottom: 0.5rem;
}

.card > .more:last-child > :last-child {
  margin-bottom: 0;
}

.terms {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.terms dt {
  padding-top: 1rem;
  color: var(--heading);
  font-size: 1.1rem;
}

.terms dd {
  margin: 0.2rem 0 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

@media (min-width: 760px) {
  .terms {
    grid-template-columns: 13rem minmax(0, 1fr);
  }

  .terms dt,
  .terms dd {
    margin: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
  }
}

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

.reading li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.publisher {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- The trail ---------- */

.trail {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trail-stop {
  position: relative;
  padding-left: 3rem;
}

.trail-stop::before {
  content: "";
  position: absolute;
  top: 2.3rem;
  bottom: -1.1rem;
  left: 1.05rem;
  border-left: 2px dashed var(--line-strong);
}

.trail-stop.is-last::before,
.trail-stop.is-anytime::before {
  display: none;
}

.trail-stop.is-behind::before {
  border-left-style: solid;
  border-color: var(--accent);
}

.trail-marker {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--accent);
}

.trail-marker .dot {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.is-behind .trail-marker .dot {
  border-color: var(--accent);
  background: var(--accent);
}

.is-anytime .trail-marker .dot {
  border-style: dashed;
}

.is-current .trail-marker {
  border-radius: 50%;
  background: var(--mint);
  color: var(--on-mint);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.trail-marker svg {
  width: 1.5rem;
  height: 1.5rem;
}

.trail-stop-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 400;
}

.is-behind .trail-stop-title,
.is-behind .trail-counts {
  color: var(--muted);
}

.trail-badge {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--heading);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trail-badge .icon {
  width: 0.95em;
  height: 0.95em;
}

.trail-counts {
  margin: 0.2rem 0 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.trail-details > summary {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0;
  color: var(--accent-strong);
  font-weight: 500;
  cursor: pointer;
}

.trail-details[open] {
  padding: 0.75rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.trail-details[open] > summary {
  margin-bottom: 0.6rem;
}

.trail-group {
  margin: 1rem 0;
}

.trail-group-title {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trail-link {
  min-height: 40px;
  padding: 0.35rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  color: var(--heading);
  font: inherit;
  font-size: 0.93rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease;
}

.trail-link:hover {
  border-color: var(--heading);
}

.trail-link.is-step {
  border-color: var(--step-line);
  background: var(--step-soft);
  color: var(--heading);
  box-shadow: inset 3px 0 0 var(--step);
}

/* An item from another part of care: no card on this map, so it opens in place */
.trail-peek > summary {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 1rem 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  color: var(--heading);
  font-size: 0.93rem;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
  transition: border-color 160ms ease;
}

.trail-peek > summary::-webkit-details-marker {
  display: none;
}

.trail-peek > summary::before {
  content: "+" / "";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.95rem;
  line-height: 1;
}

.trail-peek[open] > summary::before {
  content: "\2212" / "";
}

.trail-peek > summary:hover {
  border-color: var(--heading);
}

.trail-peek.is-step > summary {
  border-color: var(--step-line);
  background: var(--step-soft);
}

.trail-links li:has(> .trail-peek[open]) {
  flex-basis: 100%;
}

.trail-peek[open] {
  padding: 0.5rem 1rem 0.9rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.trail-peek[open] > summary {
  margin-bottom: 0.4rem;
  border-color: transparent;
  font-weight: 500;
}

.trail-peek > p {
  margin: 0 0 0.6rem 0.5rem;
  font-size: 0.95rem;
}

.trail-peek > p:last-child {
  margin-bottom: 0;
}

@media (min-width: 720px) {
  .trail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 0.2rem;
  }

  .trail.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trail.cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .trail.cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .trail-stop {
    display: contents;
  }

  .trail-stop::before {
    display: none;
  }

  .trail-stop:nth-of-type(1) > * { grid-column: 1; }
  .trail-stop:nth-of-type(2) > * { grid-column: 2; }
  .trail-stop:nth-of-type(3) > * { grid-column: 3; }
  .trail-stop:nth-of-type(4) > * { grid-column: 4; }
  .trail-stop:nth-of-type(5) > * { grid-column: 5; }
  .trail-stop:nth-of-type(6) > * { grid-column: 6; }

  .trail-stop > .trail-marker {
    position: relative;
    top: 0;
    grid-row: 1;
    justify-self: stretch;
    justify-items: start;
    width: auto;
    height: 2.4rem;
    margin-bottom: 0.6rem;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .trail-stop.is-current > .trail-marker svg {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0.4rem;
    border-radius: 50%;
    background: var(--mint);
    color: var(--on-mint);
    box-shadow: 0 0 0 5px var(--accent-soft);
  }

  .trail-stop > .trail-marker::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -1rem;
    left: 2.6rem;
    border-top: 2px dashed var(--line-strong);
  }

  .trail-stop:not(.is-current) > .trail-marker::after {
    left: 1.6rem;
  }

  .trail-stop.is-behind > .trail-marker::after {
    border-top-style: solid;
    border-color: var(--accent);
  }

  .trail-stop.is-last > .trail-marker::after {
    display: none;
  }

  .trail-stop > .trail-stop-title {
    grid-row: 2;
    align-self: start;
  }

  .trail-stop > .trail-counts {
    grid-row: 3;
    align-self: start;
  }

  .trail-stop > .trail-details {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
  }

  .trail-stop.is-anytime > * {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .trail-stop.is-anytime > .trail-marker {
    display: none;
  }

  .trail-stop.is-anytime > .trail-stop-title {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
  }
}

/* ---------- Stage groups strip ---------- */

.stage-groups {
  margin: 0 0 1.1rem;
}

.stage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.stage-strip li {
  display: grid;
  flex: 1 1 calc(50% - 0.4rem);
  gap: 0.15rem;
  align-content: center;
  min-width: 0;
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: center;
}

.stage-strip li.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--heading);
  font-weight: 500;
}

.stage-strip-you {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-group h4 {
  margin: 1rem 0 0.25rem;
}

@media (min-width: 480px) {
  .stage-strip li {
    flex: 1 1 0;
  }
}

/* ---------- Subtype comparison ---------- */

.compare-wrap {
  margin: 1rem 0;
  overflow-x: auto;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.compare caption {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.compare th,
.compare td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  border-bottom-color: var(--line-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare tbody th {
  color: var(--heading);
  font-weight: 500;
}

.compare tr.is-current th,
.compare tr.is-current td {
  background: var(--accent-soft);
}

.compare-you {
  display: block;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 719px) {
  .compare thead {
    display: none;
  }

  .compare,
  .compare caption,
  .compare tbody,
  .compare tr,
  .compare th,
  .compare td {
    display: block;
  }

  .compare tr {
    margin-bottom: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }

  .compare th,
  .compare td {
    border-bottom: 0;
    border-top: 1px solid var(--line);
  }

  .compare tr > :first-child {
    border-top: 0;
    font-size: 1rem;
  }

  .compare td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

/* ---------- Screen 3: your questions ---------- */

.q-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "main"
    "aside"
    "suggest";
  gap: 2rem;
}

.q-main {
  grid-area: main;
}

.q-aside {
  grid-area: aside;
}

.q-suggest {
  grid-area: suggest;
}

@media (min-width: 1040px) {
  .q-layout {
    grid-template-columns: minmax(0, 1fr) 21rem;
    grid-template-areas:
      "main aside"
      "suggest aside";
    gap: 2.5rem 3.5rem;
    align-items: start;
  }

  .q-aside {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}

.list-card {
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--grad-soft);
}

.list-count {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  margin: 0.8rem 0 0.25rem;
  color: var(--heading);
}

.list-count strong {
  font-family: var(--font-mono);
  font-size: 3.2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.list-card .hint {
  margin-bottom: 1.25rem;
}

.list-card .button {
  width: 100%;
}

.list-tips {
  display: grid;
  gap: 0.6rem;
  margin: 1.4rem 0 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.93rem;
  list-style: none;
}

.list-tips li {
  display: flex;
  gap: 0.6rem;
}

.list-tips .icon {
  margin-top: 0.15rem;
  color: var(--accent);
}

.question-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: question;
}

.question-item {
  position: relative;
  padding: 1rem 1.1rem 0.75rem 3.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 160ms ease;
}

.question-item:hover {
  border-color: var(--line-strong);
}

.question-item::before {
  content: counter(question, decimal-leading-zero);
  counter-increment: question;
  position: absolute;
  top: 1.05rem;
  left: 1.15rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.question-check {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  color: var(--heading);
  font-size: 1.05rem;
  cursor: pointer;
}

.question-check input {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.question-item.asked .question-text {
  color: var(--muted);
  text-decoration: line-through;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.add-own {
  margin: 1.75rem 0 0;
  padding: 1.4rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.add-own label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--heading);
  font-size: 1.15rem;
  font-weight: 300;
}

.add-own-row {
  display: flex;
  gap: 0.5rem;
}

.add-own input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--control);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.add-own input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.question-suggestions > summary {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--heading);
  cursor: pointer;
  font-size: 1.25rem;
}

.question-suggestions > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.question-suggestions[open] > summary {
  margin-bottom: 1rem;
}

.question-suggestions .section-intro {
  margin: 0 0 1rem;
}

.suggestions {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.suggestions li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.suggestions li > span {
  flex: 1 1 18rem;
  color: var(--heading);
}

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

.site-footer {
  margin-top: 0;
  padding: 3.5rem 0 2rem;
  background: var(--band);
  color: var(--band-muted);
  font-size: 0.94rem;
}

.site-footer a,
.site-footer .link-button {
  color: var(--band-text);
}

.site-footer a:hover,
.site-footer .link-button:hover {
  color: #ffffff;
}

.footer-grid {
  display: grid;
  gap: 2.25rem;
}

.footer-brand .brand {
  color: #ffffff;
}

.footer-brand .brand-mark {
  color: var(--mint);
}

.footer-brand p {
  max-width: 22rem;
  margin: 0.9rem 0 0;
}

.footer-heading {
  margin: 0 0 0.9rem;
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-heading::before {
  content: "[ " / "";
}

.footer-heading::after {
  content: " ]" / "";
}

.footer-links {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links .icon {
  color: var(--band-muted);
}

.footer-safety .emergency {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0 0 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--band-line);
  border-radius: 12px;
  color: #ffffff;
}

.footer-safety .emergency .icon {
  margin-top: 0.15rem;
  color: #ffb4a8;
}

.footer-safety p {
  margin: 0 0 0.8rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--band-line);
  font-size: 0.88rem;
}

.footer-bottom p {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0;
}

.footer-bottom .icon {
  margin-top: 0.2rem;
  color: var(--mint);
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: 1.3fr 0.8fr 1fr 1.6fr;
    gap: 3rem;
  }
}

/* ---------- Print: only the question sheet ---------- */

.print-root {
  display: none;
}

@media print {
  @page {
    margin: 1.6cm;
  }

  body {
    padding: 0;
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  body > :not(main),
  main > :not(.print-root) {
    display: none !important;
  }

  .print-root {
    display: block !important;
  }

  .print-sheet h1 {
    margin: 0 0 8pt;
    color: #000;
    font-size: 20pt;
    font-weight: 400;
  }

  .print-draft {
    padding: 6pt 8pt;
    border: 1.5pt solid #000;
    font-weight: 600;
  }

  .print-meta {
    display: flex;
    gap: 18pt;
    margin-bottom: 14pt;
  }

  .print-field {
    display: flex;
    flex: 1;
    gap: 6pt;
    align-items: baseline;
  }

  .print-field.wide {
    flex: 2;
  }

  .print-blank {
    flex: 1;
    border-bottom: 0.75pt solid #000;
  }

  .print-list {
    padding-left: 1.4em;
  }

  .print-list li {
    margin-bottom: 12pt;
    break-inside: avoid;
  }

  .print-box {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-right: 0.5em;
    border: 1.2pt solid #000;
    vertical-align: -0.1em;
    text-align: center;
    line-height: 0.8;
  }

  .print-box.checked::after {
    content: "✓";
  }

  .print-answer {
    display: block;
    height: 18pt;
    border-bottom: 0.75pt solid #888;
  }

  .print-notes p {
    margin: 16pt 0 0;
    font-weight: 600;
  }

  .print-line {
    height: 22pt;
    border-bottom: 0.75pt solid #888;
  }

  .print-footer {
    margin-top: 18pt;
    font-size: 9pt;
  }
}

/* --- Public demo and contact (ADR-015) ------------------------------------ */

/* The welcome page's closing band sits right under the section before it. */
.band.flush-top {
  padding-top: 0;
}

/* The demo notice on the welcome page: the welcome-back note, in the accent color. */
.demo-note {
  align-items: flex-start;
  border-color: var(--accent);
}

.demo-note > .icon {
  margin-top: 0.2rem;
}

/* Under the footer's contact link: contact is not for medical questions. */
.footer-note {
  max-width: 22rem;
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
}
