@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/web/fonts/ahn-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/web/fonts/ahn-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* Snow white, ink, one red. Red is only for the main action, the badge, and what needs you. */
:root {
  --paper: #f7f5f0;
  --paper-2: #ece7de;
  --card: #ffffff;
  --ink: #1a1a18;
  --muted: #5e5b55;
  --line: #ddd8cf;
  --field: #cfc9be;
  --accent: #c8321f;
  --accent-ink: #ffffff;
  --accent-soft: #f7dcd6;
  --accent-text: #9c2313;
  --stamp-face: #fffdf8;
  --ok: #1f6b3a;
  --bad: #a32020;
  --radius: 14px;
  --tap: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15140f;
    --paper-2: #24221c;
    --card: #1e1c17;
    --ink: #f3efe8;
    --muted: #b3ab9e;
    --line: #37322a;
    --field: #4a443a;
    --accent: #ef5a44;
    --accent-ink: #1a0b07;
    --accent-soft: #3d1c15;
    --accent-text: #ff9c8c;
    --stamp-face: #1e1c17;
    --ok: #6fcf8f;
    --bad: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* The input styles below set display:block, which would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
html.t-lg { font-size: 20px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
/* No double-tap zoom delay on anything you tap. Inputs stay >= 16px so iOS never zooms on focus. */
a, button, label, input, select, textarea, summary { touch-action: manipulation; }
main { max-width: 600px; margin: 0 auto; padding: 20px 20px 48px; }
body.has-tabs main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

h1 { font-size: 1.9rem; line-height: 1.1; margin: 0.15em 0 0.35em; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.12rem; margin: 0 0 0.6em; }
h3 { font-size: 1.05rem; margin: 1em 0 0.3em; }
p { margin: 0 0 0.8em; }
a { color: var(--ink); text-underline-offset: 3px; }
small { display: block; color: var(--muted); font-size: 0.88rem; font-weight: 400; }
small b { color: var(--ink); font-weight: 700; }
strong { font-weight: 700; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.lede { font-size: 1.05rem; color: var(--muted); }
.muted, .hint { color: var(--muted); }
.hint { font-size: 0.88rem; font-weight: 400; }
.meta { color: var(--muted); margin: 0 0 0.3em; }
.meta a { color: var(--ink); font-weight: 700; }
.date { color: var(--muted); margin: 4px 0 0; }
.center { text-align: center; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wordmark { font-weight: 700; color: var(--accent); letter-spacing: 0.02em; margin: 0; }
a.wordmark { display: inline-block; text-decoration: none; padding: 10px 0; min-height: 44px; }
.opt { font-weight: 400; color: var(--muted); }

/* Buttons: one filled red per screen, everything else outlined in ink. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  min-height: var(--tap); padding: 0 1.2em; margin: 0 0 10px;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font: inherit; font-size: 1.05rem; font-weight: 700; text-decoration: none; cursor: pointer;
  width: 100%;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 44px; padding: 0 0.95em; width: auto; font-size: 0.95rem; border-radius: 12px; }
.btn.quiet { border-color: transparent; color: var(--muted); }
.btn:active { transform: scale(0.985); }
.btn .hint { color: inherit; opacity: 0.75; }
.link { background: none; border: 0; padding: 8px 0; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 44px; }
.stack { display: flex; flex-direction: column; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.inline .btn { margin: 0; }
.inline form { margin: 0; }

.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.top h1 { margin: 0; }
.top .btn { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 700; }
.plus { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; }
.plus svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.notice { background: var(--accent-soft); color: var(--accent-text); padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.error { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 20; max-width: 560px; margin: 0 auto; background: var(--ink); color: var(--paper); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
/* Inside a bottom sheet: show it above the sheet, not over its buttons. */
dialog .toast { top: calc(16px + env(safe-area-inset-top)); bottom: auto; }
.banner { display: flex; align-items: center; min-height: 56px; padding: 0 16px; margin: 0 0 18px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; text-decoration: none; }
.done { color: var(--ok); font-weight: 700; }
.empty { padding: 28px 0; color: var(--muted); }

/* Today: one card for the next move */
.next { display: flex; flex-direction: column; gap: 4px; padding: 20px; margin: 0 0 24px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.next-title { font-size: 1.5rem; line-height: 1.2; font-weight: 700; margin: 0; }
.next .muted { margin: 0 0 12px; }
.next .btn { margin: 0 0 8px; }
.next .btn:last-child, .next form:last-child .btn { margin-bottom: 0; }
.next form { margin: 0; }
/* Today: all clear */
.clear { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 44px 0 36px; }
.clear > * { animation: rise 0.5s ease-out both; }
.clear > :nth-child(2) { animation-delay: 0.12s; }
.clear > :nth-child(3) { animation-delay: 0.24s; }
.clear .big { font-size: 2.1rem; line-height: 1.05; font-weight: 700; margin: 6px 0 0; }
.clear .muted { margin: 0; }
.mtn { width: 200px; height: 100px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.mtn .sn { stroke: var(--accent); stroke-width: 3; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.chev { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); flex: none; margin-right: 6px; }

/* Forms */
.form label, .form fieldset { display: block; margin: 0 0 18px; font-weight: 700; }
.form label > .hint { display: block; margin-top: 2px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px;
  min-height: 52px; padding: 12px 14px;
  font: inherit; font-weight: 400; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--field); border-radius: 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 1px var(--ink); }
input[type="radio"], input[type="checkbox"] { width: auto; min-height: 0; display: inline-block; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute; left: -9999px; }
.for { background: var(--paper-2); padding: 12px 14px; border-radius: 12px; }
.paste textarea { min-height: 110px; font-size: 0.95rem; }
.paste > label { margin-bottom: 2px; }
.paste > .hint { margin: 0; }
.paste [data-extract-result] { color: var(--ink); font-weight: 700; margin: 6px 0 12px; }
.paste [data-extract-result]:empty { margin: 0 0 12px; }

/* Big tappable choices, stacked */
.choice { display: flex !important; gap: 12px; align-items: flex-start; padding: 14px; margin: 0 0 8px !important; border: 1.5px solid var(--field); border-radius: var(--radius); background: var(--card); font-weight: 400 !important; cursor: pointer; }
.choice input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* Chips: wrap in rows, the whole chip is the target. Picked = solid ink. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips legend { width: 100%; }
.chip { position: relative; margin: 0 !important; font-weight: 400 !important; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border: 1.5px solid var(--field); border-radius: 999px; background: var(--card); font-weight: 700; }
.chip input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.label { font-weight: 700; margin: 14px 0 8px; }
/* `.form label` / `.form fieldset` would otherwise force chips into a one-per-line stack. */
.form .chips { display: flex; }
.form .chip { display: inline-block; margin: 0; }

.student { padding-top: 8px !important; margin-bottom: 26px !important; }
.student legend { font-size: 1.25rem; }

/* Rows, not cards */
.rows { border-top: 1px solid var(--line); margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 62px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.row .when { flex: none; width: 5.4em; font-weight: 700; font-variant-numeric: tabular-nums; }
.row .who { flex: 1; min-width: 0; }
.row .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.section { font-size: 1.12rem; color: var(--ink); margin: 26px 0 8px; }
.tag { flex: none; font-size: 0.85rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.tag.hot { background: var(--accent-soft); color: var(--accent-text); }
.tag.done { background: transparent; color: var(--ok); }
.tag.muted { text-decoration: line-through; }

.search input { margin: 0 0 12px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--paper-2); border-radius: 12px; }
.seg a { min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.seg a[aria-current] { background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }

/* Lesson steps */
.step { padding: 22px 0 6px; border-top: 1px solid var(--line); }
.script { margin: 0 0 12px; }
.script summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.script ol { padding-left: 1.3em; margin: 0 0 12px; }
.script li { margin-bottom: 6px; }
.answers { margin: 0; }
.answers dt { font-weight: 700; margin-top: 10px; }
.answers dd { margin: 2px 0 0; }
.plainlist { padding-left: 1.2em; margin: 0 0 12px; }
.ticks { list-style: none; padding: 0; margin: 0 0 12px; }
.ticks li { padding: 6px 0 6px 30px; position: relative; }
.ticks li::before { content: '✓'; position: absolute; left: 4px; color: var(--ink); font-weight: 700; }
.ticks small { display: inline; margin-left: 6px; }
.quiet { display: flex; gap: 20px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.quiet a { font-weight: 700; }
.quiet form { margin: 0; }
/* Lesson screen: one card for the next move, a checklist for the rest */
.hero-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px 20px 12px; margin: 16px 0 20px; }
.hero-card h2 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 4px; }
.hero-card .muted { margin-bottom: 14px; }
.hero-card form { margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 8px; border-top: 1px solid var(--line); }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.checklist .dot { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--field); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
.checklist .is-done .dot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.checklist li > div { flex: 1; min-width: 0; padding-top: 2px; }
.checklist summary { cursor: pointer; }
.checklist .answers { margin-top: 8px; }
.amounts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.btn.amt { margin: 0; width: 100%; padding: 0; font-size: 1.15rem; background: var(--card); border: 1.5px solid var(--field); }
.other { display: flex; gap: 8px; margin: 10px 0 12px; }
.other input { margin: 0; }
.other .btn { margin: 0; flex: none; min-height: 52px; }
.tipquick .chips { margin-bottom: 12px; }
details.more { margin: 0 0 14px; }
details.more > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
details.more[open] > summary { margin-bottom: 8px; }
.form details.more label, .form details.more fieldset { margin-bottom: 14px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 4px; }
.stats p { margin: 0; padding: 10px 4px; text-align: center; border-top: 2px solid var(--ink); }
.stats strong { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.8rem; color: var(--muted); }

.where { margin: 4px 0 0; }
details.else > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); font-size: 0.92rem; }
details.else[open] > summary { margin-bottom: 4px; }
details.danger { margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
details.danger summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--bad); font-weight: 700; }
details.danger .btn { border-color: var(--bad); color: var(--bad); }
.followup .btn { margin: 0; }
.followup .btn.quiet { padding: 0 0.5em; }
.followup form { margin: 0; }

/* Results: one number per row, big */
.results { border-top: 1px solid var(--line); margin-bottom: 8px; }
.result { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.result .big { flex: none; width: 4.6em; margin: 0; font-size: 1.75rem; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.result .hint { margin: 2px 0 0; }
.result small { margin-top: 4px; }

/* Leads */
.leads { list-style: none; padding: 0; margin: 0 0 20px; border-top: 1px solid var(--line); }
.lead { padding: 16px 0; border-bottom: 1px solid var(--line); }
.lead .who { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }

/* Passport on client page */
.passport { padding: 4px 0 10px; }
.passport h3 small { display: inline; margin-left: 4px; }

/* Bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper); border-top: 1px solid var(--line);
  /* Tabs line up with the 600px content column instead of the window edges. */
  padding: 4px max(0px, calc((100% - 600px) / 2)) env(safe-area-inset-bottom);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; color: var(--muted); text-decoration: none; font-size: 0.78rem; font-weight: 700; }
.tabs a[aria-current] { color: var(--accent); }
.i { width: 26px; height: 26px; }

/* Guest pages */
.hero { padding: 28px 0 12px; }
.hero h1 { font-size: 2.1rem; }
.plain { padding: 16px 0; border-top: 1px solid var(--line); }
.steps { padding-left: 1.2em; }
.steps li { margin-bottom: 12px; }
/* ---------- Guest side: feels like an app, one job per screen ---------- */
/* clip, not hidden: keeps the sticky progress bar working while confetti can't widen the page. */
body.guest { overflow-x: clip; }
body.guest main { max-width: 480px; padding-top: 12px; }
.fine { font-size: 0.88rem; color: var(--muted); margin: 8px 0 0; }
.g-muted { color: var(--muted); }
.say { font-size: 1.1rem; font-weight: 700; padding: 12px 16px; background: var(--paper-2); border-radius: 12px; }

.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex: none; background: var(--paper-2); color: var(--muted); font-weight: 700; }
.avatar.xl { width: 128px; height: 128px; font-size: 3rem; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.8rem; }
.avatar.sm { width: 44px; height: 44px; font-size: 1.1rem; }
.photo-row { display: flex; gap: 16px; align-items: center; margin: 4px 0 18px; }
.photo-row .btn { margin: 0; }

.btn.big { min-height: 60px; font-size: 1.15rem; border-radius: 16px; width: 100%; margin-top: 18px; }
.btn.big .i { width: 22px; height: 22px; }

.g-hero { text-align: center; padding: 24px 0 8px; }
.g-hero h1 { font-size: 2.3rem; margin: 18px 0 4px; }
.g-sub { color: var(--muted); font-size: 1.05rem; margin: 0 0 12px; }
.g-bio { font-size: 1.1rem; margin: 0 auto 4px; max-width: 30ch; }
.g-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px 18px; margin: 24px 0; }
.g-card h2 { margin-bottom: 4px; }
.g-form input { margin: 4px 0 0; }
.g-label { display: block; margin-top: 12px; font-size: 0.9rem; font-weight: 700; }
.g-form .btn { margin-top: 14px; width: 100%; }
.g-done { text-align: center; padding: 8px 0; }
.g-done .i { width: 44px; height: 44px; color: var(--ok); }
.g-pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 10px 0 14px; }
.g-pills li { padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); font-weight: 700; }

.g-check { width: 96px; height: 96px; margin: 8px auto 0; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; }
.g-check .i { width: 52px; height: 52px; stroke-width: 3; }
.pop { animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Step-by-step form. Without JS every question just stacks. */
.stepper { position: relative; }
.screen { border: 0; padding: 0; margin: 0 0 36px; min-width: 0; }
.js .screen { display: none; }
/* Margin, not padding: a fieldset's legend ignores padding and would slide under the back arrow. */
.js .screen.on { display: block; animation: slide-in 0.28s ease-out both; margin-top: 64px; }
.js .screen.intro.on { margin-top: 28px; }
.js .screen.on.from-left { animation-name: slide-back; }
/* The slide-in starts 28px to the right; clip so the page never scrolls sideways. */
.js form[data-steps] { overflow-x: clip; }
/* Headings get focus by script so screen readers announce each step; no ring for that. */
.screen [tabindex="-1"]:focus { outline: none; }
@keyframes slide-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-back { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
.stepbar { display: none; }
.js .stepbar { display: block; position: sticky; top: 8px; z-index: 5; height: 6px; margin: 8px 0 0 48px; background: var(--line); border-radius: 3px; overflow: hidden; }
.stepbar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 0.3s ease; }
.stepback { position: absolute; top: -10px; left: -10px; z-index: 6; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.stepback[hidden] { display: none; }
.stepback .i { width: 28px; height: 28px; }
.screen.intro { text-align: center; }
.screen.intro h1 { font-size: 2.2rem; margin: 18px 0 4px; }
.q { display: block; width: 100%; font-size: 1.75rem; font-weight: 700; line-height: 1.15; margin: 0 0 18px; padding: 0; }
.q + .g-muted { margin-top: -10px; }
.screen input:not([type="radio"]):not([type="checkbox"]), .screen textarea { margin: 12px 0 0; }

.tiles { display: grid; gap: 10px; }
.tile { position: relative; cursor: pointer; }
.tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.tile span { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 0 18px; border: 1.5px solid var(--field); border-radius: var(--radius); background: var(--card); font-size: 1.12rem; font-weight: 700; transition: transform 0.12s, border-color 0.12s; }
.tile svg { width: 30px; height: 30px; flex: none; color: var(--ink); }
.tile:active span { transform: scale(0.98); }
.tile input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }
.tile input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.chips.big span { min-height: 54px; font-size: 1.05rem; padding: 0 18px; }

/* ---------- Recap ---------- */
.g-top { padding: 18px 0 6px; }
.g-top h1 { font-size: 2.4rem; line-height: 1.05; margin: 6px 0 10px; }
.g-kid { text-align: center; padding: 26px 0 12px; }
.g-kid + .g-kid { border-top: 1px solid var(--line); }

/* The medal: rays turn slowly, the stamp slams down, a shine sweeps across, ribbons drop. */
.medal { position: relative; width: 300px; height: 300px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.rays { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--accent); opacity: 0.16; animation: spin 30s linear infinite; }
.tails { position: absolute; left: 50%; top: 192px; width: 116px; height: 110px; margin-left: -58px; fill: var(--accent-text); animation: drop-in 0.4s 1s both; }
.stamp { position: relative; width: 220px; height: 220px; border-radius: 50%; overflow: hidden; box-shadow: 0 14px 30px rgba(156, 35, 19, 0.28); animation: slam 0.75s 0.35s cubic-bezier(.2, 1.6, .4, 1) both; }
.badge { display: block; width: 100%; height: 100%; }
.b-face { fill: var(--stamp-face); }
.b-ring { fill: none; stroke: var(--accent); }
.b-ink { fill: var(--accent); font-family: inherit; font-weight: 700; }
.b-title { font-size: 20px; letter-spacing: 1px; }
.b-emb { color: var(--accent); }
.shine { position: absolute; top: -20%; left: -60%; width: 40%; height: 140%; background: rgba(255, 255, 255, 0.7); transform: rotate(20deg); animation: shine 1s 1.2s ease-out both; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slam { 0% { opacity: 0; transform: scale(2.4) rotate(-26deg); } 70% { opacity: 1; transform: scale(0.93) rotate(-5deg); } 100% { opacity: 1; transform: scale(1) rotate(-8deg); } }
@keyframes shine { from { left: -60%; } to { left: 130%; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.earned { font-size: 1.4rem; font-weight: 700; margin: 4px 0 10px; animation: drop-in 0.4s 1.1s both; }
.earned strong { color: var(--accent); }

/* Badge collection, like enamel pins: earned ones in full color, locked ones
   grey silhouettes, the next one ringed and pulsing. */
.trail { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; list-style: none; padding: 0; margin: 6px 0 0; }
.pin { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.disc { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--accent); background: var(--stamp-face); color: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.07), 0 3px 8px rgba(156, 35, 19, 0.16); }
.emb { width: 22px; height: 22px; }
.sign-black { fill: var(--ink); }
.pin.past .disc { opacity: 0.6; box-shadow: none; }
.pin.off .disc { border: 2px solid var(--line); background: var(--paper-2); color: var(--muted); box-shadow: none; }
.pin.off .emb, .pin.up .emb { filter: grayscale(1); opacity: 0.4; }
.pin.up .disc { border: 2.5px dashed var(--accent); background: var(--stamp-face); box-shadow: none; animation: beckon 2.4s 2s ease-in-out infinite; }
.pin.new .disc { box-shadow: 0 0 0 5px var(--accent-soft), 0 3px 8px rgba(156, 35, 19, 0.16); animation: pop 0.45s 1.5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes beckon { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 7px var(--accent-soft); } }

/* The guest's trophy case: bigger pins with their names, four to a row. */
.trophies { margin: 18px 0 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.trophies h3 { font-size: 1.1rem; margin: 0 0 14px; }
.trail.case { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 6px; }
.case .disc { width: 58px; height: 58px; border-width: 3px; }
.case .pin.off .disc, .case .pin.up .disc { border-width: 2.5px; }
.case .emb { width: 32px; height: 32px; }
.pin-name { font-size: 0.78rem; font-weight: 700; line-height: 1.2; color: var(--ink); }
.pin.off .pin-name { color: var(--muted); font-weight: 400; }
.pin.up .pin-name { color: var(--accent-text); }
.trail-count { margin: 14px 0 4px; }
.goal { margin: 0 0 6px; font-size: 1.05rem; }
.goal a { display: inline-block; min-height: 44px; line-height: 44px; color: var(--accent-text); font-weight: 700; }
.passport .trail { justify-content: flex-start; }
.passport .trail-count { margin: 8px 0 2px; }
.passport .trail-count + .fine { margin: 0 0 10px; }

.wins { display: flex; flex-direction: column; list-style: none; padding: 0; margin: 14px 0 12px; border-top: 1px solid var(--line); text-align: left; }
.wins li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); font-weight: 700; }
.wins .i { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--ink); color: var(--paper); stroke-width: 3.5; flex: none; }
.nextup { color: var(--ink); text-align: left; }
.nextup span { display: inline-block; margin-right: 6px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 0.82rem; font-weight: 700; }

/* Confetti falls once from the top of the screen when a recap with a badge opens. */
.rain { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.rain i { position: absolute; top: -24px; width: 8px; height: 14px; border-radius: 2px; background: var(--accent); animation: fall 3.2s cubic-bezier(.25, .6, .5, 1) both; }
.rain i:nth-child(3n) { background: var(--ink); }
.rain i:nth-child(4n+1) { background: var(--accent-soft); }
.rain i:nth-child(5n) { width: 10px; height: 10px; border-radius: 50%; }
.rain i:nth-child(7n) { width: 5px; height: 18px; }
.rain i:nth-child(1) { left: 3%; animation-delay: 0.05s; --dx: 30px; }
.rain i:nth-child(2) { left: 8%; animation-delay: 0.4s; --dx: -20px; }
.rain i:nth-child(3) { left: 13%; animation-delay: 0.15s; --dx: 40px; --r: 720deg; }
.rain i:nth-child(4) { left: 18%; animation-delay: 0.6s; --dx: -30px; }
.rain i:nth-child(5) { left: 22%; animation-delay: 0.25s; --dx: 25px; }
.rain i:nth-child(6) { left: 27%; animation-delay: 0.5s; --dx: -15px; --r: 360deg; }
.rain i:nth-child(7) { left: 32%; animation-delay: 0s; --dx: 35px; }
.rain i:nth-child(8) { left: 36%; animation-delay: 0.35s; --dx: -40px; --r: 720deg; }
.rain i:nth-child(9) { left: 41%; animation-delay: 0.7s; --dx: 20px; }
.rain i:nth-child(10) { left: 46%; animation-delay: 0.1s; --dx: -25px; }
.rain i:nth-child(11) { left: 50%; animation-delay: 0.45s; --dx: 30px; }
.rain i:nth-child(12) { left: 55%; animation-delay: 0.2s; --dx: -35px; --r: 720deg; }
.rain i:nth-child(13) { left: 59%; animation-delay: 0.55s; --dx: 15px; }
.rain i:nth-child(14) { left: 64%; animation-delay: 0.05s; --dx: -20px; }
.rain i:nth-child(15) { left: 68%; animation-delay: 0.65s; --dx: 40px; --r: 360deg; }
.rain i:nth-child(16) { left: 73%; animation-delay: 0.3s; --dx: -30px; }
.rain i:nth-child(17) { left: 78%; animation-delay: 0.15s; --dx: 25px; }
.rain i:nth-child(18) { left: 82%; animation-delay: 0.5s; --dx: -15px; --r: 720deg; }
.rain i:nth-child(19) { left: 87%; animation-delay: 0.25s; --dx: -35px; }
.rain i:nth-child(20) { left: 92%; animation-delay: 0.9s; --dx: 20px; }
.rain i:nth-child(21) { left: 96%; animation-delay: 1s; --dx: -25px; }
.rain i:nth-child(22) { left: 11%; animation-delay: 0.85s; --dx: 30px; }
.rain i:nth-child(23) { left: 25%; animation-delay: 0.95s; --dx: -20px; }
.rain i:nth-child(24) { left: 39%; animation-delay: 1.1s; --dx: 10px; }
.rain i:nth-child(25) { left: 53%; animation-delay: 0.8s; --dx: -30px; --r: 720deg; }
.rain i:nth-child(26) { left: 66%; animation-delay: 1.05s; --dx: 20px; }
.rain i:nth-child(27) { left: 80%; animation-delay: 0.75s; --dx: -10px; }
.rain i:nth-child(28) { left: 90%; animation-delay: 1.15s; --dx: 35px; }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--dx, 20px), 105vh) rotate(var(--r, 540deg)); opacity: 0; }
}

.g-note { display: flex; gap: 12px; align-items: flex-end; margin: 22px 0; }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; padding: 14px 16px; }
.bubble p { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.35; }
.bubble .fine { margin-top: 6px; font-weight: 400; font-size: 0.88rem; }

/* Tip, right on the page: amount (or type one), then the pay app. */
/* Review: five big stars, then a bottom sheet. */
.g-rate { padding: 22px 0 14px; border-top: 1px solid var(--line); text-align: center; }
.g-rate h2 { font-size: 1.3rem; margin-bottom: 8px; }
.stars { display: flex; justify-content: center; gap: 4px; margin: 0; }
.star { position: relative; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; cursor: pointer; }
.star input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.star svg { width: 40px; height: 40px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; transition: transform 150ms ease-out, fill 150ms ease-out; }
.star:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.star:active svg { transform: scale(0.9); }
.stars:has(label.star:nth-of-type(1) input:checked) label.star:nth-of-type(-n+1) svg,
.stars:has(label.star:nth-of-type(2) input:checked) label.star:nth-of-type(-n+2) svg,
.stars:has(label.star:nth-of-type(3) input:checked) label.star:nth-of-type(-n+3) svg,
.stars:has(label.star:nth-of-type(4) input:checked) label.star:nth-of-type(-n+4) svg,
.stars:has(label.star:nth-of-type(5) input:checked) label.star:nth-of-type(-n+5) svg { fill: var(--accent); stroke: var(--accent); }
.rate-sheet { box-sizing: border-box; width: 100%; max-width: 480px; margin: auto auto 0; padding: 20px 20px calc(16px + env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0; background: var(--paper); color: var(--ink); text-align: left; }
.rate-sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
.rate-sheet[open] { animation: sheet-up 220ms ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.rate-sheet-stars { color: var(--accent); font-size: 1.6rem; letter-spacing: 4px; margin: 0; text-align: center; }
.rate-sheet h3 { font-size: 1.3rem; margin: 4px 0 14px; text-align: center; }
.rate-sheet label { display: block; font-weight: 700; }
.rate-sheet textarea { margin-bottom: 14px; }
.rate-tip { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); text-align: center; }
.rate-sites { display: grid; gap: 10px; }
.rate-sites .btn { margin: 0; width: 100%; }
.rate-sheet .btn.quiet { margin: 4px 0 0; }
@media (prefers-reduced-motion: reduce) { .rate-sheet[open] { animation: none; } .star svg { transition: none; } }
.g-tip { padding: 22px 0 10px; border-top: 1px solid var(--line); }
.g-tip h2 { font-size: 1.3rem; margin-bottom: 10px; }
.tipamts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 12px 0 8px; }
.tipamts .chip span { width: 100%; justify-content: center; min-height: 58px; border-radius: 12px; font-size: 1.15rem; padding: 0 4px; }
.tipother { display: flex; align-items: center; gap: 6px; min-height: 58px; padding: 0 16px; margin: 0 0 8px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; font-size: 1.3rem; font-weight: 700; }
.tipother input { margin: 0; padding: 0; min-height: 54px; border: 0; box-shadow: none; background: transparent; font-size: 1.3rem; font-weight: 700; }
.tipapps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.tipapps .btn { margin: 0; padding: 0 6px; min-height: 52px; font-size: 1rem; }

.g-cta { position: relative; padding: 20px 0 8px; border-top: 1px solid var(--line); }
.acts { display: flex; gap: 10px; margin-top: 14px; }
.acts > * { flex: 1; }
.act { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border: 2px solid var(--ink); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; list-style: none; }
.act::-webkit-details-marker { display: none; }
.act .i { width: 22px; height: 22px; }
.act:active { transform: scale(0.97); }
details.act-menu[open] > .act { border-color: var(--accent); }
.menu { position: absolute; left: 0; right: 0; z-index: 6; margin-top: 8px; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); text-align: left; }
.menu .btn { margin: 8px 0 0; width: 100%; }
.menu .fine { margin: 0 0 4px; }
.g-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 28px 0 8px; font-size: 0.88rem; color: var(--muted); }
.g-foot a { color: var(--muted); }
.menu-title { font-weight: 700; font-size: 1.1rem; margin: 0 0 4px; }

/* Drafted text with a quiet "write it another way" icon in its corner. */
.draft { position: relative; margin-bottom: 12px; }
.draft textarea { padding-bottom: 44px; }
.reroll { position: absolute; right: 4px; bottom: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.reroll svg { width: 20px; height: 20px; transition: transform 0.35s ease-out; }
.reroll:hover, .reroll:focus-visible { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .reroll svg { transition: none; } }

/* My code: a card the guest scans off the instructor's phone. Always ink on
   white, even in dark mode: scanners need the contrast and it reads in sun glare. */
.code-card { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px auto 16px; padding: 24px 20px 20px; max-width: 380px; text-align: center; background: #fff; color: #1a1a18; border-radius: 22px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 10px 28px rgba(26, 26, 24, 0.12); }
.code-card .avatar { margin-bottom: 6px; }
.code-card .avatar.mono { background: #ece7de; color: #5e5b55; }
.code-name { font-size: 1.35rem; font-weight: 700; margin: 0; line-height: 1.2; }
.code-sub { margin: 0; color: #5e5b55; font-size: 0.92rem; }
.code-qr { width: min(100%, 300px); margin: 14px 0 6px; }
.code-qr svg { display: block; width: 100%; height: auto; }
.code-cta { margin: 4px 0 0; font-size: 1.05rem; font-weight: 700; color: #c8321f; }
.code-tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.code-tools .btn { width: auto; }

/* Printable sticker sheet (optional, from My code) */
.sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.sticker { border: 1.5px dashed var(--field); border-radius: var(--radius); padding: 14px; text-align: center; background: #fff; color: #1a1a18; }
.sticker .qr svg { width: 100%; max-width: 200px; height: auto; }
.sticker .big { font-size: 1.2rem; font-weight: 700; margin: 6px 0 0; }
.sticker p { margin: 0; }
@media print {
  .no-print, .tabs { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .sheet { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 700px) {
  .btn { width: auto; }
  .stack .btn, .next .btn, .hero-card .btn, .g-tip .btn, .g-cta .btn { width: 100%; }
  h1 { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .rain { display: none; }
}
