/* Recall Gap app. Same paper, ink and green as the quiz, so the buyer lands
   somewhere that feels like the test they just took. Big type (body 19px),
   taps ≥ 56px, high contrast: built for 45–80 on a phone. */

:root {
  --cream: #fbf5ea;
  --cream-2: #f3e9d7;
  --surface: #ffffff;
  --ink: #1d2622;
  --ink-2: #48524c;
  --line: #e6dac5;
  --brand: #1f6b4f;
  --brand-deep: #154d39;
  --brand-soft: #e1eee5;
  --warm: #d0680f;
  --warm-deep: #9a4b08;
  --warm-soft: #fce5c8;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --sans: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --max: 560px;
  --r: 16px;
  --r-lg: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100svh; background: var(--cream); color: var(--ink); font: 400 19px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--brand); text-underline-offset: 3px; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(251, 245, 234, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--max); margin: 0 auto; height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.mark { font: 700 22px/1 var(--serif); color: var(--brand-deep); letter-spacing: -.01em; text-decoration: none; }
.top .sp { flex: 1; }
.iconbtn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; display: grid; place-items: center; cursor: pointer; font-size: 22px; color: var(--ink-2); }
.iconbtn:active { background: var(--cream-2); }
.back { border: 0; background: none; font-weight: 700; color: var(--brand-deep); padding: 8px 4px; cursor: pointer; font-size: 18px; }

main { max-width: var(--max); margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
body.focus main { padding-bottom: 40px; }
body.focus .nav { display: none; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav-in { max-width: var(--max); margin: 0 auto; height: var(--nav-h); display: grid; grid-template-columns: repeat(5, 1fr); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 700; }
.nav a .ic { font-size: 24px; line-height: 1; filter: grayscale(1); opacity: .7; }
.nav a.on { color: var(--brand-deep); }
.nav a.on .ic { filter: none; opacity: 1; }

/* ---------- type ---------- */
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--warm-deep); }
.h1 { font: 700 30px/1.15 var(--serif); letter-spacing: -.015em; }
.h2 { font: 700 24px/1.2 var(--serif); letter-spacing: -.01em; }
.h3 { font: 700 20px/1.25 var(--sans); }
.sub { color: var(--ink-2); }
.small { font-size: 16px; color: var(--ink-2); }
.tiny { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 22px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row .sp { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card.soft { background: var(--brand-soft); border-color: #cfe2d6; }
.card.warm { background: var(--warm-soft); border-color: #f3cf9f; }
.card.hero { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%); color: #fff; border: 0; }
.card.hero .sub, .card.hero .small { color: rgba(255, 255, 255, .85); }
.card.hero .eyebrow { color: #ffd9a8; }
a.card { display: block; color: inherit; text-decoration: none; }
.card.tap { cursor: pointer; transition: transform .12s var(--ease); }
.card.tap:active { transform: scale(.985); }
.locked { opacity: .55; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 10px; text-align: center; }
.stat .v { font: 700 28px/1.1 var(--serif); color: var(--brand-deep); }
.stat .l { font-size: 14px; color: var(--ink-2); line-height: 1.25; margin-top: 4px; }
.stat.warm .v { color: var(--warm-deep); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--cream-2); font-size: 15px; font-weight: 700; color: var(--ink-2); }
.pill.green { background: var(--brand-soft); color: var(--brand-deep); }
.pill.warm { background: var(--warm-soft); color: var(--warm-deep); }

/* ---------- buttons ---------- */
.btn { display: flex; width: 100%; min-height: 60px; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px; border: 0; border-radius: 16px; background: var(--brand); color: #fff; font-weight: 700; font-size: 20px; cursor: pointer; text-decoration: none; box-shadow: 0 3px 0 var(--brand-deep); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brand-deep); }
.btn.ghost { background: var(--surface); color: var(--brand-deep); border: 2px solid var(--brand); box-shadow: none; }
.btn.warm { background: var(--warm); box-shadow: 0 3px 0 var(--warm-deep); }
.btn.light { background: #fff; color: var(--brand-deep); box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.btn.sm { min-height: 48px; font-size: 17px; padding: 10px 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { background: none; border: 0; color: var(--brand-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 0; }

.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; text-align: left; font-weight: 700; }
.choice.on { border-color: var(--brand); background: var(--brand-soft); }
.choice .ic { font-size: 26px; }

input.field, textarea.field, select.field { width: 100%; min-height: 56px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 20px; }
input.field:focus, textarea.field:focus, select.field:focus { border-color: var(--brand); outline: none; }
label.lbl { display: block; font-weight: 700; margin-bottom: 6px; }

/* ---------- today ---------- */
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; background: conic-gradient(#ffd9a8 calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); display: grid; place-items: center; flex: none; }
.ring b { width: 60px; height: 60px; border-radius: 50%; background: var(--brand-deep); display: grid; place-items: center; font: 700 22px/1 var(--serif); color: #fff; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .d { text-align: center; font-size: 13px; color: var(--ink-2); }
.week .dot { width: 34px; height: 34px; margin: 4px auto 0; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 16px; }
.week .dot.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.week .dot.today { border-color: var(--warm); box-shadow: 0 0 0 3px var(--warm-soft); }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.plan-list li:first-child { border-top: 0; }
.plan-list .ic { font-size: 24px; width: 32px; text-align: center; flex: none; }

/* ---------- session ---------- */
.progress { height: 8px; border-radius: 4px; background: var(--cream-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--warm); border-radius: 4px; transition: width .4s var(--ease); }
.steps-top { display: flex; gap: 6px; margin-bottom: 18px; }
.steps-top span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps-top span.done { background: var(--brand); }
.steps-top span.on { background: var(--warm); }

.bigword { font: 700 44px/1.1 var(--serif); color: var(--ink); text-align: center; letter-spacing: -.01em; overflow-wrap: anywhere; }
.locus { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; font-size: 20px; }
.stage { min-height: 46svh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; text-align: center; }
.count { font: 700 18px/1 var(--sans); color: var(--ink-2); }
.timer-bar { width: 100%; height: 6px; background: var(--cream-2); border-radius: 3px; overflow: hidden; }
.timer-bar i { display: block; height: 100%; background: var(--brand); transform-origin: left; }

.recall-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.recall-row:first-child { border-top: 0; }
.recall-row .where { font-size: 16px; font-weight: 700; color: var(--brand-deep); }
.res-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.res-list li { padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 17px; }
.res-list .ok { background: var(--brand-soft); color: var(--brand-deep); }
.res-list .miss { background: var(--cream-2); color: var(--ink-2); }

/* speed board */
.board { position: relative; width: min(92vw, 360px); aspect-ratio: 1; margin: 0 auto; border-radius: 24px; background: var(--surface); border: 2px solid var(--line); overflow: hidden; touch-action: manipulation; }
.board .center { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 18px; background: var(--cream); border: 2px solid var(--line); display: grid; place-items: center; }
.board .slot { position: absolute; width: 16%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; }
.board .slot.pick { border-radius: 50%; border: 2px dashed var(--line); cursor: pointer; background: var(--cream); }
.board .slot.pick:active, .board .slot.pick.hit { background: var(--brand-soft); border-color: var(--brand); }
.board svg { width: 100%; height: 100%; display: block; }
.board .mask { position: absolute; inset: 0; }
.board .fix { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.shape-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 360px; margin: 0 auto; }
.shape-btn { height: 110px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.shape-btn svg { width: 64px; height: 64px; }
.shape-btn:active { border-color: var(--brand); background: var(--brand-soft); }
.flash { font-weight: 700; font-size: 20px; min-height: 30px; }
.flash.ok { color: var(--brand-deep); }
.flash.no { color: var(--warm-deep); }

/* finding things grid */
.rooms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.room { aspect-ratio: 1; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; padding: 4px; text-align: center; line-height: 1.15; }
.room .e { font-size: 32px; }
.room.has { border-color: var(--warm); background: var(--warm-soft); }
.room.ok { border-color: var(--brand); background: var(--brand-soft); }
.room.no { border-color: var(--bad); background: var(--bad-soft); }

/* keypad */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 340px; margin: 0 auto; }
.keypad button { height: 64px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); font: 700 26px/1 var(--sans); cursor: pointer; }
.keypad button:active { background: var(--brand-soft); border-color: var(--brand); }
.keypad .wide { grid-column: span 2; }
.digits-shown { font: 700 40px/1 var(--serif); letter-spacing: .14em; min-height: 48px; color: var(--ink); }
.digits-typed { font: 700 34px/1 var(--serif); letter-spacing: .12em; min-height: 44px; color: var(--brand-deep); border-bottom: 3px solid var(--line); padding-bottom: 8px; width: 100%; max-width: 340px; text-align: center; }

/* recognition grid */
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wchip { min-height: 56px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 700; font-size: 19px; cursor: pointer; }
.wchip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }

/* things */
.thing { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.thing:first-child { border-top: 0; }
.thing .q { font-weight: 700; }
.thing .a { color: var(--ink-2); font-size: 16px; }
.boxes { display: flex; gap: 3px; }
.boxes i { width: 8px; height: 18px; border-radius: 2px; background: var(--line); }
.boxes i.on { background: var(--brand); }
.flip { min-height: 220px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; text-align: center; }
.flip .q { font: 700 26px/1.25 var(--serif); }
.flip .a { font: 700 30px/1.2 var(--serif); color: var(--brand-deep); }

/* habits */
.habit .row { align-items: flex-start; }
.habit .ic { font-size: 30px; line-height: 1; }
.bar { height: 12px; border-radius: 6px; background: var(--cream-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .3s var(--ease); }
.bar.done i { background: var(--warm); }
.addrow { display: flex; gap: 8px; flex-wrap: wrap; }
.addrow button { flex: 1; min-width: 70px; min-height: 48px; border-radius: 12px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand-deep); font-weight: 700; cursor: pointer; }
.addrow button.minus { flex: 0 0 56px; border-color: var(--line); color: var(--ink-2); }
details.why { margin-top: 8px; }
details.why summary { cursor: pointer; font-weight: 700; color: var(--brand-deep); font-size: 16px; list-style: none; }
details.why summary::-webkit-details-marker { display: none; }
details.why summary::before { content: "ⓘ "; }
details.why p { margin-top: 8px; font-size: 16px; color: var(--ink-2); }
.cite { font-size: 13px; color: var(--ink-2); line-height: 1.4; margin-top: 6px; }

/* skills */
.skill-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); display: grid; place-items: center; font-size: 30px; flex: none; }
.steps3 { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps3 li { counter-increment: s; position: relative; padding: 0 0 14px 48px; }
.steps3 li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; background: var(--warm); color: #fff; font-weight: 700; display: grid; place-items: center; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .pt { fill: var(--surface); stroke: var(--brand); stroke-width: 3; }
.chart .pt.last { fill: var(--warm); stroke: var(--warm); }
.chart text { font: 700 12px var(--sans); fill: var(--ink-2); }
.chart .base { stroke: var(--warm); stroke-dasharray: 5 5; stroke-width: 2; }
.empty { padding: 26px 12px; text-align: center; color: var(--ink-2); font-size: 16px; border: 2px dashed var(--line); border-radius: var(--r); }

/* compare table */
.cmp { width: 100%; border-collapse: collapse; font-size: 17px; }
.cmp th, .cmp td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.cmp th { font-size: 14px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.cmp td.n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.up { color: var(--brand-deep); font-weight: 700; }
.down { color: var(--warm-deep); font-weight: 700; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 60; transition: .25s var(--ease); max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.pop { animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.fade { animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.confetti { font-size: 56px; text-align: center; animation: pop .5s var(--ease); }

/* doctor sheet (print) */
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px; font-size: 16px; }
.sheet h2 { font: 700 22px var(--serif); }
.sheet table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.sheet td, .sheet th { border: 1px solid #ccc; padding: 6px 4px; text-align: left; font-size: 13px; }
@media print {
  body { background: #fff; font-size: 13px; }
  .top, .nav, .noprint, .toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
