/* Public guide (/guide/). Same visual system as the app (src/index.css): warm paper, ink text, terracotta accent, serif display headings.
   Tokens only: every colour and font is defined once below. Mobile-first; no horizontal scroll at 375 px; touch targets >= 44 px. */
:root {
  --paper: #faf7f2;
  --paper-2: #f3ede4;
  --surface: #ffffff;
  --ink: #1b1613;
  --ink-2: #4a423b;
  --muted: #6b625a;
  --line: #e6ddd0;
  --brand-50: #fbeee9;
  --brand-100: #f6dcd3;
  --brand-500: #d4573a;
  --brand-600: #b53f27;
  --brand-700: #932f1b;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-card: 0 1px 2px rgb(27 22 19 / 0.04), 0 8px 24px -12px rgb(27 22 19 / 0.12);
  --radius-lg: 20px;
  --radius: 14px;
  --radius-pill: 999px;
  --gutter: 16px;
  --measure: 48rem;
  --target: 44px;
  color-scheme: light;
}

*, *::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(--paper); color: var(--ink); font-family: var(--font-sans);
  font-size: 1rem; line-height: 1.6; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; line-height: 1.2; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 4.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p, ul, ol, dl, table { margin: 0; }
a { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand-600); }
:focus-visible { outline: 3px solid var(--brand-600); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-100); }
main:focus { outline: none; }
[id] { scroll-margin-top: 1.5rem; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10; padding: 10px 16px; min-height: var(--target);
  background: var(--ink); color: var(--paper); border-radius: var(--radius); font-weight: 600;
}
.skip:focus { top: 8px; color: var(--paper); }

.wrap { max-width: 70rem; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--target); color: var(--ink); text-decoration: none; font-weight: 700; }
.brand:hover { color: var(--ink); }
.brand__mark { flex: none; }
.brand__mark circle { fill: var(--ink); }
.brand__mark text { fill: var(--paper); font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.brand span { font-family: var(--font-display); font-size: 1.1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--target); padding: 10px 18px;
  border-radius: var(--radius-pill); border: 1px solid transparent; font: inherit; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn--primary { background: var(--brand-600); color: var(--surface); }
.btn--primary:hover { background: var(--brand-700); color: var(--surface); }
.btn--primary:active { transform: translateY(1px); }
.btn--lg { min-height: 52px; padding: 14px 26px; font-size: 1.05rem; }
.btn[hidden] { display: none; }

/* Breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; padding: 0; margin: 12px 0 0; font-size: 0.9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; content: "/" / ""; margin: 0 10px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: var(--target); }

/* Layout: hero, then TOC, then content (mobile); TOC becomes a sticky side column next to hero + content (desktop). */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); padding-bottom: 48px; }
.hero, .content { min-width: 0; max-width: var(--measure); }
.toc { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.toc__title { font-family: var(--font-sans); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); column-gap: 16px; }
.toc a { display: flex; align-items: center; min-height: var(--target); color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.toc a:hover { color: var(--brand-700); text-decoration: underline; }
@media (min-width: 64rem) {
  .layout { grid-template-columns: 14rem minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 56px; }
  .hero { grid-column: 2; grid-row: 1; }
  .content { grid-column: 2; grid-row: 2; }
  .toc { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 24px; align-self: start; margin-top: 36px; background: transparent; border: 0; padding: 0; }
  .toc ol { grid-template-columns: 1fr; }
}

/* Hero */
.hero { padding: 28px 0 8px; }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-700); }
.hero h1 { margin-top: 10px; }
.lead { margin-top: 16px; font-size: 1.125rem; color: var(--ink-2); }
.meta { margin-top: 14px; font-size: 0.9rem; color: var(--muted); }

section { margin-top: 48px; }
section > h2 + p, .step__blurb { margin-top: 10px; color: var(--ink-2); }
.step > h2 { margin-top: 6px; }

/* At a glance */
.glance__grid { display: grid; gap: 12px; margin-top: 16px; }
.glance__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); }
.glance__card:first-child { border-color: var(--brand-100); background: var(--brand-50); }
.glance__card h3 { font-size: 1.1rem; }
.glance__card p { margin-top: 8px; font-size: 0.95rem; color: var(--ink-2); }
.glance__card .chips { margin-top: 12px; }
@media (min-width: 40rem) {
  .glance__card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .glance__card h3, .glance__card > p:not(.chips) { grid-column: 1; }
  .glance__card .chips { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}
.glance__example { margin-top: 16px; font-size: 0.95rem; color: var(--muted); }

/* Chips (look like the form's tiles) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 0.875rem; font-weight: 600; line-height: 1.35;
}
.chip--on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip--link { min-height: var(--target); padding: 8px 14px; text-decoration: none; color: var(--ink); }
.chip--link:hover { border-color: var(--brand-600); color: var(--brand-700); }

/* One question */
.field {
  margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 18px; box-shadow: var(--shadow-card);
}
@media (min-width: 40rem) { .field { padding: 26px 28px; } }
.field__num { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.field__head h3 { margin-top: 4px; font-size: 1.35rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin-top: 12px; }
.badge { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--paper-2); color: var(--ink-2); font-size: 0.8rem; font-weight: 600; }
.badge--best { background: var(--brand-600); color: var(--surface); }
.badge--enough { background: var(--paper-2); color: var(--ink); }
.field__meaning { margin-top: 14px; font-size: 1.05rem; }
.facts, .verdicts { display: grid; gap: 12px; margin-top: 16px; }
.facts dt, .verdicts dt { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts dd, .verdicts dd { margin: 2px 0 0; color: var(--ink-2); }
.verdicts { padding-top: 16px; border-top: 1px solid var(--line); }
@media (min-width: 40rem) { .verdicts { grid-template-columns: 1fr 1fr; gap: 20px; } }
.verdicts strong { color: var(--ink); }
.tips { margin-top: 14px; padding-left: 1.2rem; color: var(--ink-2); }
.tips li + li { margin-top: 6px; }
.field__rule { margin-top: 12px; font-size: 0.95rem; color: var(--ink-2); }

/* Weak vs strong */
.compare { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 40rem) { .compare { grid-template-columns: 1fr 1fr; } .compare--single { grid-template-columns: 1fr; } }
.answer { border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); background: var(--paper); min-width: 0; }
.answer--strong { border-color: var(--brand-500); background: var(--brand-50); }
.answer__label { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.answer--strong .answer__label { color: var(--brand-700); }
.answer__note { margin-top: 10px; font-size: 0.92rem; color: var(--ink-2); }
.entry { margin-top: 10px; display: grid; gap: 8px; }
.entry__row { display: grid; gap: 4px; }
.entry dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.entry dd { margin: 0; }
.entry__hint { font-size: 0.85rem; color: var(--muted); }
.typed {
  display: block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-size: 0.95rem; color: var(--ink);
}
.typed--empty { color: var(--muted); font-style: italic; }
.entry__saved { margin-top: 8px; font-size: 0.82rem; color: var(--muted); }

/* Options list */
.options { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.options__title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.options__list { list-style: none; padding: 0; display: grid; gap: 10px; }
.options__hint { color: var(--muted); font-size: 0.92rem; }
.options__tip { display: block; margin-top: 2px; color: var(--ink-2); font-size: 0.95rem; }

/* Whole example */
.example { margin-top: 16px; padding: 0; list-style: none; counter-reset: q; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.example li { counter-increment: q; padding: 14px 18px; border-top: 1px solid var(--line); }
.example li:first-child { border-top: 0; }
.example__q { font-size: 0.9rem; font-weight: 600; }
.example__q::before { content: counter(q) ". "; color: var(--muted); }
.example__q a { color: var(--ink-2); }
.example__a { margin-top: 4px; }

/* Where details go */
.map { width: 100%; margin-top: 16px; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.map th, .map td { text-align: left; vertical-align: top; padding: 12px 16px; border-top: 1px solid var(--line); }
.map thead th { border-top: 0; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); }
.map tbody th { font-weight: 600; width: 38%; }
.map__fields { margin-top: 2px; font-size: 0.88rem; }
.map__fields a { display: inline-flex; align-items: center; min-height: var(--target); }
@media (max-width: 39.99rem) {
  .map thead { display: none; }
  .map, .map tbody, .map tr, .map th, .map td, .map tbody th { display: block; width: auto; }
  .map tbody tr { border-top: 1px solid var(--line); padding: 12px 16px; }
  .map tbody tr:first-child { border-top: 0; }
  .map tbody th, .map td { border: 0; padding: 0; }
  .map td { margin-top: 4px; }
}

/* AI helper */
.howto { margin-top: 14px; padding-left: 1.3rem; color: var(--ink-2); }
.howto li + li { margin-top: 6px; }
.prompt { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.prompt__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.prompt__title { font-weight: 600; font-size: 0.95rem; }
.prompt__text {
  margin: 0; padding: 16px; max-height: 26rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.55; color: var(--ink);
}
.prompt__text:focus-visible { outline-offset: -3px; }
.prompt__status { min-height: 1.5em; padding: 0 16px 12px; font-size: 0.9rem; color: var(--brand-700); font-weight: 600; }
.prompt__status:empty { padding-bottom: 0; min-height: 0; }
.note { margin-top: 14px; font-size: 0.95rem; color: var(--muted); }

/* FAQ */
.faq { margin-top: 16px; display: grid; gap: 12px; }
.faq__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.faq__item h3 { font-size: 1.1rem; }
.faq__item p { margin-top: 6px; color: var(--ink-2); }

/* Call to action */
.cta { padding: 28px 22px; border-radius: var(--radius-lg); background: var(--ink); color: var(--paper); text-align: center; }
.cta h2 { color: var(--paper); }
.cta p { margin: 10px auto 18px; max-width: 34rem; color: var(--paper-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-2); }
.footer { padding-top: 20px; padding-bottom: 24px; }
.footer__brand { font-family: var(--font-display); font-weight: 700; }
.footer ul { display: flex; flex-wrap: wrap; column-gap: 18px; list-style: none; padding: 0; margin-top: 6px; }
.footer a { display: inline-flex; align-items: center; min-height: var(--target); color: var(--ink-2); }
.footer a:hover { color: var(--brand-700); }
.footer__meta { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header .btn, .toc, .prompt__bar .btn, .cta .btn { display: none; }
  .prompt__text { max-height: none; overflow: visible; }
  .field, .prompt, .glance__card { box-shadow: none; }
}
