/* Underneath design system. Tokens follow research/02-ux-design.md. Light theme only. */

/* Self-hosted web fonts, latin subset (SIL Open Font License 1.1; license texts in assets/fonts/).
   Downloaded from Google Fonts on 2026-11-29. Inter and roman Newsreader are variable fonts.
   Letters outside the latin subset (for example "š" in one source title) use the fallback font. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: optional;
  src: url("../fonts/web/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/web/newsreader-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/web/newsreader-italic-latin.woff2") format("woff2");
}

/* Fallback face for Newsreader, shown until the Newsreader file arrives.
   size-adjust was measured on 2026-11-29 (Chromium on Windows): Newsreader text is 93% to 96% as wide
   as Georgia at the sizes the app uses (22px headings at weight 500, 36px and 48px titles at weight 400).
   94% keeps the swap from moving lines. Phones without Georgia, such as most Android phones,
   skip this face and use their own serif. */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 94%;
}

:root {
  color-scheme: only light;

  /* Color */
  --paper: #F7F2EC;
  --surface: #FFFDFA;
  --sunken: #EFE7DE;
  --selected: #F3E9E1;
  --ink: #1F1A17;
  --ink-2: #5A4F47;
  --ink-3: #6E6157;
  --line: #E2D8CD;
  --line-strong: #8C7D70;
  --accent: #9A4A31;
  --track: #E6DCD1;
  --caution: #7A4E00;
  --caution-bg: #FBF1DC;
  --danger: #A12C22;
  --danger-bg: #FBE9E6;
  --ok: #3F5E46;
  --ok-bg: #E8EFE6;
  /* Decorative skin tones, shown only as a range */
  --tone-1: #F3D9C6;
  --tone-2: #E8BFA0;
  --tone-3: #C98E6B;
  --tone-4: #A8694A;
  --tone-5: #7A4A33;
  --tone-6: #4E2E22;
  --quiet: var(--paper);

  /* Type */
  --font-serif: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-10: 64px;
  --s-11: 80px;
  --gutter: 20px;
  --section-gap: 48px;
  --column: 480px;
  --cta-h: 76px;

  /* Radius */
  --r-sm: 8px;
  --r-option: 14px;
  --r-card: 20px;
  --r-sheet: 24px;
  --r-pill: 999px;

  /* Shadow (only two) */
  --shadow-1: 0 1px 2px rgb(31 26 23 / .06);
  --shadow-2: 0 12px 32px rgb(31 26 23 / .12);

  /* Motion */
  --d-press: 100ms;
  --d-select: 160ms;
  --d-enter: 280ms;
  --d-exit: 200ms;
  --d-sheet-in: 320ms;
  --d-sheet-out: 240ms;
  --d-progress: 300ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--quiet);
  scroll-padding-bottom: calc(var(--cta-h) + 16px);
}
html.has-sheet { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--quiet);
  color: var(--ink);
  font: 400 17px/26px var(--font-sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

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

/* Type scale */
.display { font: 400 36px/40px var(--font-serif); letter-spacing: -0.015em; text-wrap: balance; }
h1, .h1 { font: 400 28px/34px var(--font-serif); letter-spacing: -0.01em; text-wrap: balance; }
h2, .h2 { font: 500 22px/28px var(--font-serif); letter-spacing: -0.005em; }
h3, .h3 { font: 600 17px/24px var(--font-sans); }
.small { font-size: 15px; line-height: 22px; }
.caption { font: 500 13px/18px var(--font-sans); color: var(--ink-3); }
.eyebrow { font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lede { color: var(--ink-2); }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.serif-line { font: italic 400 28px/34px var(--font-serif); }

/* App column */
.app {
  position: relative;
  max-width: var(--column);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  background: var(--paper);
}
.screen {
  --pad-l: max(var(--gutter), env(safe-area-inset-left));
  --pad-r: max(var(--gutter), env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: env(safe-area-inset-top) var(--pad-r) 0 var(--pad-l);
}
.screen-body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-6) 0 var(--s-8);
}
.screen-plain { justify-content: center; gap: var(--s-4); padding-bottom: var(--s-8); }
.screen-center .screen-body { justify-content: center; }
.stack { display: grid; gap: var(--s-4); }
.stack-sm { display: grid; gap: var(--s-2); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.section { display: grid; gap: var(--s-4); margin-top: var(--section-gap); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Sticky call to action */
.cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: auto calc(var(--pad-r) * -1) 0 calc(var(--pad-l) * -1);
  padding: 12px var(--pad-r) calc(12px + env(safe-area-inset-bottom)) var(--pad-l);
  background: var(--surface);
  border-top: 1px solid var(--line);
  text-align: center;
}
.cta-bar .notice { text-align: left; }

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 52px;
  padding: 0 var(--s-6);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--surface);
  font: 600 17px/24px var(--font-sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--d-press) var(--ease), background-color var(--d-select) var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-danger { background: var(--danger); }
.btn[aria-busy="true"] { cursor: progress; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn .icon { width: 20px; height: 20px; }
.btn-text {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 var(--s-2);
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 15px/22px var(--font-sans);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-text .icon { width: 18px; height: 18px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.icon { width: 24px; height: 24px; flex: none; }

/* Quiz top bar and progress */
.topbar { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding-top: var(--s-2); }
.topbar .icon-btn { margin-left: -12px; }
.progress { flex: 1; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.progress-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform var(--d-progress) var(--ease);
}
.count { min-width: 4.5em; text-align: right; font: 500 13px/18px var(--font-sans); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Option cards (native radios and checkboxes) */
.options { display: grid; gap: var(--s-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.option { position: relative; display: block; }
.option-input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.option-box {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-option);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  transition: box-shadow var(--d-select) var(--ease), background-color var(--d-select) var(--ease), transform var(--d-press) var(--ease);
}
.option-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.option-label { font-weight: 500; }
.option-sub { font-size: 15px; line-height: 22px; color: var(--ink-2); }
.option-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  color: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: background-color var(--d-select) var(--ease), box-shadow var(--d-select) var(--ease);
}
.option-mark .icon { width: 16px; height: 16px; opacity: 0; transform: scale(.4); transition: opacity var(--d-select) var(--ease), transform var(--d-select) var(--ease-enter); }
.option-input[type="checkbox"] + .option-box .option-mark { border-radius: 6px; }
.option-input:active + .option-box { transform: scale(.99); }
.option-input:checked + .option-box { background: var(--selected); box-shadow: inset 0 0 0 2px var(--ink); }
.option-input:checked + .option-box .option-mark { background: var(--accent); box-shadow: none; }
.option-input:checked + .option-box .option-mark .icon { opacity: 1; transform: none; }
.option-input:focus-visible + .option-box { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Notices and callouts */
.notice { font: 500 15px/22px var(--font-sans); color: var(--danger); }
.callout {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-option);
  background: var(--sunken);
  font-size: 15px;
  line-height: 22px;
}
.callout > .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--ink-2); }
.callout strong { font-weight: 600; }
.callout .stack-sm { flex: 1; }
.callout-caution { background: var(--caution-bg); }
.callout-caution > .icon { color: var(--caution); }
.callout-danger { background: var(--danger-bg); }
.callout-danger > .icon { color: var(--danger); }
.callout-ok { background: var(--ok-bg); }
.callout-ok > .icon { color: var(--ok); }

/* Cards */
.card { display: grid; gap: var(--s-3); padding: var(--s-5); border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.locked {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px var(--s-3);
  width: 100%;
  padding: var(--s-4) var(--s-5);
  border: 0;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.locked-title { font: 600 17px/24px var(--font-sans); }
.locked-count { font-size: 15px; line-height: 22px; color: var(--ink-2); }
.locked > .icon { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 20px; height: 20px; color: var(--ink-3); }
.redaction { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: var(--s-2); }
.redaction span { display: block; height: 10px; border-radius: 5px; background: var(--sunken); }
.redaction span:nth-child(1) { width: 92%; }
.redaction span:nth-child(2) { width: 74%; }
.redaction span:nth-child(3) { width: 56%; }

/* Lists */
.facts { display: grid; gap: var(--s-2); padding: 0; list-style: none; }
.facts li { display: flex; align-items: flex-start; gap: var(--s-2); font-size: 15px; line-height: 22px; color: var(--ink-2); }
.facts .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--ok); }
.steps { display: grid; gap: var(--s-4); padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); align-items: start; counter-increment: step; color: var(--ink-2); }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 500 17px/1 var(--font-serif);
  color: var(--accent);
}
.included { display: grid; gap: var(--s-2); padding: 0; list-style: none; }
.included li { display: flex; gap: var(--s-2); align-items: flex-start; }
.included .icon { width: 20px; height: 20px; margin-top: 3px; color: var(--accent); }

/* Price */
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2) var(--s-3); }
.price-amount { font: 400 56px/60px var(--font-serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price-terms { font-weight: 500; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-3) 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { width: 20px; height: 20px; transform: rotate(90deg); transition: transform var(--d-select) var(--ease); }
.faq details[open] summary .icon { transform: rotate(-90deg); }
.faq details > div { padding: 0 0 var(--s-4); color: var(--ink-2); display: grid; gap: var(--s-2); }

/* Segmented control: tabs or a two-way choice */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--sunken); }
.segmented [role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  font: 600 15px/22px var(--font-sans);
  cursor: pointer;
}
.segmented [role="tab"] .icon { width: 18px; height: 18px; }
.segmented [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.segmented label { position: relative; display: grid; }
.segmented label input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented label span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: var(--r-pill); color: var(--ink-2); font: 600 15px/22px var(--font-sans); }
.segmented label input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.segmented label input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
[role="tabpanel"] { display: grid; gap: var(--s-3); }

/* Checklist and switch */
.checklist { display: grid; padding: 0; list-style: none; }
.check-row { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--ok); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 56px; cursor: pointer; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color var(--d-select) var(--ease);
}
.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform var(--d-select) var(--ease);
}
.switch:checked { background: var(--ok); }
.switch:checked::before { transform: translateX(20px); }

/* Inputs and the access link */
.input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-option);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 500 17px/24px var(--font-sans);
  color: var(--ink);
}
.link-value {
  display: block;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-option);
  background: var(--sunken);
  font: 500 15px/22px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}

/* Landing */
.screen-landing { padding-top: 0; }
.hero {
  position: relative;
  min-height: 28vh;
  min-height: 28svh;
  margin: 0 calc(var(--pad-r) * -1) 0 calc(var(--pad-l) * -1);
  padding: calc(var(--s-4) + env(safe-area-inset-top)) var(--pad-r) 0 var(--pad-l);
  overflow: hidden;
}
.hero > :not(.field) { position: relative; z-index: 1; }
.field {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 75% at 82% 14%, rgb(232 191 160 / .55), transparent 70%),
    radial-gradient(55% 65% at 8% 58%, rgb(201 142 107 / .38), transparent 72%),
    radial-gradient(45% 50% at 58% 92%, rgb(243 217 198 / .6), transparent 70%);
  -webkit-mask-image: linear-gradient(#000 50%, transparent);
  mask-image: linear-gradient(#000 50%, transparent);
}
.field::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .1 0 0 0 0 .09 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.wordmark { display: inline-flex; align-items: center; gap: var(--s-2); font: 500 22px/28px var(--font-serif); letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.wordmark svg { width: 28px; height: 28px; }
.landing-body { padding-top: 0; }
.tones { display: flex; gap: 6px; }
.tones span { width: 14px; height: 14px; border-radius: 50%; }
.tones span:nth-child(1) { background: var(--tone-1); }
.tones span:nth-child(2) { background: var(--tone-2); }
.tones span:nth-child(3) { background: var(--tone-3); }
.tones span:nth-child(4) { background: var(--tone-4); }
.tones span:nth-child(5) { background: var(--tone-5); }
.tones span:nth-child(6) { background: var(--tone-6); }

/* Building moment */
.tick-list { display: grid; gap: var(--s-3); padding: 0; list-style: none; }
.tick { display: flex; align-items: center; gap: var(--s-3); opacity: 0; transform: translateY(6px); transition: opacity var(--d-enter) var(--ease-enter), transform var(--d-enter) var(--ease-enter); }
.tick.is-on { opacity: 1; transform: none; }
.tick .icon { color: var(--ok); }

/* Plan page */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 56px; padding-top: var(--s-2); }
.plan-head .icon-btn { margin-right: -10px; }
.chips {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: var(--s-2);
  margin: 0 calc(var(--pad-r) * -1) 0 calc(var(--pad-l) * -1);
  padding: var(--s-2) var(--pad-r) var(--s-2) var(--pad-l);
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 44px;
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 500 15px/22px var(--font-sans);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.plan-section { scroll-margin-top: 72px; }
.day-big { font: 400 36px/40px var(--font-serif); font-variant-numeric: tabular-nums; }
.weeks { display: grid; gap: var(--s-3); }
.week-label { margin-bottom: var(--s-1); font: 500 13px/18px var(--font-sans); color: var(--ink-3); }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: 500 15px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.day.is-future { color: var(--ink-3); background: transparent; }
.day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.day.is-done::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--ok); }

.day.is-marked::before { content: ""; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.chip[aria-current="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }

/* Plan content: lists, cards and links */
.strong { font-weight: 600; color: var(--ink); }
.cards { display: grid; gap: var(--s-3); padding: 0; list-style: none; }
.cards > li:not(.card) { display: grid; }
.referral, .trait, .tip, .ingredient, .product-group { gap: var(--s-2); }
.referral .pill { margin-bottom: var(--s-1); }
.bullets, .reasons { display: grid; gap: var(--s-2); padding-left: 1.25em; }
.bullets { color: var(--ink-2); }
.reasons { gap: var(--s-1); }
.bullets li::marker, .reasons li::marker { color: var(--ink-3); }
.line-items { display: grid; padding: 0; list-style: none; border-top: 1px solid var(--line); }
li.line-item { display: grid; gap: var(--s-1); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
li.line-item .pill { justify-self: start; }
div.line-item { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 500; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--sunken);
  color: var(--ink-2);
  font: 600 13px/18px var(--font-sans);
}
.pill .icon { width: 16px; height: 16px; }
.pill-today { background: var(--danger-bg); color: var(--danger); }
.pill-soon { background: var(--caution-bg); color: var(--caution); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.pair .btn { width: 100%; padding: 0 var(--s-3); }
.text-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  min-height: 44px;
  font: 500 15px/22px var(--font-sans);
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.text-link .icon, .source-link .icon { width: 16px; height: 16px; color: var(--ink-3); }
.sources { display: grid; padding-left: 1.5em; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.sources li::marker { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.source-link { display: inline-block; padding: 11px 0; color: var(--ink-2); overflow-wrap: anywhere; }
.source-link .icon { display: inline-block; margin-left: 4px; vertical-align: -2px; }
details.more > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  font: 500 15px/22px var(--font-sans);
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  list-style: none;
  cursor: pointer;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--d-select) var(--ease);
}
details.more[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
details.more[open] > summary + * { margin-top: var(--s-1); }

/* Plan content: checklists and check-ins */
.check-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.check-label { font-weight: 500; }
.check-row > .icon { width: 20px; height: 20px; color: var(--ink-3); }
.check-row.is-new .check-label, .check-row.is-new > .icon { color: var(--accent); }
.check-row.is-preview { cursor: default; }
.check-dot { flex: none; width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line-strong); opacity: .5; }
.checklist > li:last-child .check-row { border-bottom: 0; }
.checkin { gap: var(--s-3); }
.option-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 52px;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-option);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow var(--d-select) var(--ease), background-color var(--d-select) var(--ease);
}
.option-row input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.option-row:has(input:checked) { background: var(--selected); box-shadow: inset 0 0 0 2px var(--ink); }
.option-row:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.option-row input:focus-visible { outline: none; }

/* Plan content: phases, routine and products */
.phase-card { gap: var(--s-2); }
.phases { display: grid; padding: 0; list-style: none; }
.phase { display: grid; gap: 2px; padding: var(--s-3) 0 var(--s-3) var(--s-4); border-left: 2px solid var(--line); }
.phase.is-current { border-left-color: var(--accent); }
.phase.is-current > .caption { color: var(--accent); }
.routine-steps h3 { color: var(--ink); }
.swap { padding: var(--s-3); border-radius: var(--r-sm); background: var(--sunken); }
.products { display: grid; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.product { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.product:last-child { padding-bottom: 0; border-bottom: 0; }
.product-name { font-size: 17px; line-height: 24px; }
.product-link { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }

/* Bottom sheet */
.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: var(--column);
  max-height: 85vh;
  max-height: 85svh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  overflow: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform var(--d-sheet-out) var(--ease-exit);
}
.sheet.is-open { transform: none; transition: transform var(--d-sheet-in) var(--ease-enter); }
.sheet::backdrop { background: rgb(31 26 23 / .36); }
.sheet-inner {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-2) max(var(--gutter), env(safe-area-inset-right)) calc(var(--s-5) + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.sheet-handle { width: 36px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--line); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.sheet-head .icon-btn { margin-right: -10px; }
.sheet-actions { display: grid; gap: var(--s-2); }
.test-badge { justify-self: start; padding: 2px var(--s-2); border-radius: var(--r-sm); background: var(--caution-bg); color: var(--caution); font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }

/* Footer links */
.legal-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-2); margin-top: var(--section-gap); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.legal-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-1); font: 500 13px/18px var(--font-sans); color: var(--ink-2); }

/* Legal drafts */
.legal-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding-top: var(--s-2); }
.prose { display: grid; gap: var(--s-3); }
.prose h2 { margin-top: var(--s-6); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { display: grid; gap: var(--s-2); padding-left: 1.25em; }
.ph { padding: 0 4px; border-radius: 4px; background: var(--caution-bg); color: var(--caution); font-weight: 600; }

/* Motion */
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
.screen-enter { animation: enter var(--d-enter) var(--ease-enter) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 120ms !important; }
  .screen-enter { animation: fade 120ms linear both; }
  .tick, .option-mark .icon, .btn:active, .option-input:active + .option-box { transform: none; }
  .sheet, .sheet.is-open { transform: none; opacity: 0; transition: opacity 120ms linear; }
  .sheet.is-open { opacity: 1; }
}

/* Wider screens: centered column on a quiet background */
@media (min-width: 560px) {
  :root { --quiet: var(--sunken); }
  .app { box-shadow: 0 0 0 1px var(--line); }
}
@media (min-width: 600px) {
  .display { font-size: 48px; line-height: 52px; }
}

/* Print: the plan page is the accessible, printable version */
@media print {
  :root { --quiet: #fff; }
  .cta-bar, .chips, .topbar, .plan-head .icon-btn, .sheet, .no-print { display: none !important; }
  .app { max-width: none; box-shadow: none; }
}
