:root {
	--amber: #ffb703;
	--sky: #8ecae6;
	--paper: #f2f9fc;
	--card: #ffffff;
	--ink: #023047;
	--ink-2: #44606f;
	--leaf: #219ebc;
	--leaf-2: #8ecae6;
	--forest: #023047;
	--coral: #fb8500;
	--line: #d3e8f1;
	--radius: 14px;
	--serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Noto Serif', Georgia, serif;
	--sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
main { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.btn { display: block; width: 100%; border: 0; border-radius: 999px; padding: 16px 20px; font-weight: 650; font-size: 17px; cursor: pointer; transition: transform .1s; text-align: center; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.light { background: var(--amber); color: var(--ink); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- landing ---------- */
.landing { height: 100dvh; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; color: var(--ink); }
.landing .bg { position: absolute; inset: 0; z-index: -1; background: var(--sky) url('data:image/webp;base64,UklGRmQAAABXRUJQVlA4IFgAAADwAwCdASoKABIAPu1iqk2ppaQiMAgBMB2JaACdACK3lnpUThIpsGuAAP7fYwgCkljj2LgyCBm9S7VpLToEDCjAH1VVAWm989/K5YaVQRVO1RfDL7yegmQA') center/cover; }
.landing .bg img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.landing-mid { padding: 0 28px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.landing h1 { font-size: clamp(36px, 11vw, 46px); line-height: 1.05; max-width: 11ch; }
.landing .btn.primary { width: 100%; max-width: 320px; }
.lede { font-size: 17px; line-height: 1.45; max-width: 30ch; margin: 0; }
.landing .btn.primary { background: var(--ink); color: #fff; }

/* ---------- flow (questions, value screens, upload) ---------- */
.flow { min-height: 100dvh; display: flex; flex-direction: column; }
.flow-head { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 16px 8px; position: sticky; top: 0; background: var(--paper); z-index: 2; }
.back { border: 0; background: none; font-size: 22px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.progress { flex: 1; height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--leaf); border-radius: 6px; transition: width .35s ease; }
.flow-body { min-width: 0; flex: 1; display: flex; flex-direction: column; padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); }
.q-title { font-size: 27px; line-height: 1.15; margin: 10px 0 8px; }
.q-sub { color: var(--ink-2); font-size: 15px; margin-bottom: 18px; }
.opts { display: grid; gap: 10px; margin-bottom: 18px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 15px 16px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-size: 16px; }
.opt .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #a9cbdb; flex: none; display: grid; place-items: center; }
.opt.multi .tick { border-radius: 6px; }
.opt[aria-pressed='true'] { border-color: var(--leaf); background: #e6f4fa; }
.opt[aria-pressed='true'] .tick { background: var(--leaf); border-color: var(--leaf); }
.opt .tick .ic { color: #fff; font-size: 15px; opacity: 0; }
.opt[aria-pressed='true'] .tick .ic { opacity: 1; }
.spacer { flex: 1; }

/* value screens */
.value { display: flex; flex-direction: column; flex: 1; }
.value .art { margin: 4px -4px 18px; border-radius: 18px; background: var(--sky); overflow: hidden; aspect-ratio: 1 / 0.86; position: relative; }
.value .art svg { width: 100%; height: 100%; display: block; }
.value h2 { font-size: 26px; line-height: 1.15; margin-bottom: 10px; }
.value p { color: var(--ink-2); }

/* upload */
.checklist { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 2px; }
.check-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px; font-size: 15px; border-bottom: 1px solid var(--line); }
.files { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.file { min-width: 0; grid-template-columns: minmax(0, 1fr); background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; }
.file-top { display: flex; align-items: center; gap: 10px; }
.file-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-state { font-size: 13px; color: var(--ink-2); }
.file-state.ok { color: var(--leaf); }
.file-state.bad { color: var(--coral); }
.file .x { border: 0; background: none; font-size: 18px; color: var(--ink-2); cursor: pointer; padding: 0 4px; }
.pw { display: flex; gap: 8px; }
.pw input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; }
.pw input.bad { border-color: var(--coral); }
.pw button { border: 0; border-radius: 10px; background: var(--ink); color: #fff; padding: 0 14px; font-weight: 600; }
.pw-msg { font-size: 13px; color: var(--coral); }
.pick { display: grid; place-items: center; gap: 4px; padding: 22px; border-radius: var(--radius); border: 2px dashed #8ecae6; background: var(--card); cursor: pointer; text-align: center; margin-bottom: 14px; }
.pick b { font-size: 16px; }
.pick span { font-size: 13px; color: var(--ink-2); }
.small { font-size: 13px; color: var(--ink-2); }
.center { text-align: center; }

/* ---------- processing ---------- */
.plain { min-height: 100dvh; padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.processing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 30px; }
.processing h2 { font-size: 24px; }
.note { font-size: 13.5px; color: var(--ink-2); }

/* ---------- results ---------- */
.result, .report, .pay { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--leaf); }
.headline { font-family: var(--serif); font-size: 28px; line-height: 1.15; }
.card { min-width: 0; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px; }
.flows { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flows .n { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flows .l { font-size: 13px; color: var(--ink-2); }
.bars { display: grid; gap: 10px; }
.bar { display: grid; gap: 4px; }
.bar .row { display: flex; justify-content: space-between; font-size: 15px; }
.bar .row b { font-variant-numeric: tabular-nums; }
.bar .track { height: 8px; background: #e1f0f7; border-radius: 8px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--leaf); border-radius: 8px; }
.finding { display: grid; gap: 8px; }
.finding .amt { font-size: 24px; font-weight: 750; color: var(--coral); font-variant-numeric: tabular-nums; }
.finding h3 { font-size: 19px; line-height: 1.25; }
.finding .action { background: #e6f4fa; border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.finding .items { display: grid; gap: 6px; font-size: 14.5px; }
.finding .items div { display: flex; justify-content: space-between; gap: 10px; }
.finding .items > div > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.blur { filter: blur(6px); user-select: none; }
.paywall { background: var(--forest); color: #fff; border-radius: 18px; padding: 18px; display: grid; gap: 12px; }
.paywall h3 { font-size: 22px; }
.paywall ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 15px; }
.qr { background: #fff; border-radius: 18px; padding: 16px; display: grid; justify-items: center; gap: 10px; }
.qr img { width: 240px; height: 240px; image-rendering: pixelated; }
.field { display: grid; gap: 6px; font-size: 14px; }
.field input { font: inherit; font-size: 16px; padding: 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; }
.question { display: grid; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer; }
.chip[aria-pressed='true'] { border-color: var(--leaf); background: #e6f4fa; }
.legal { padding: 28px 20px 40px; display: grid; gap: 14px; }
.legal h1 { font-size: 30px; }
.legal h2 { font-size: 20px; margin-top: 8px; }
.legal p, .legal li { color: var(--ink-2); }
footer.mini { text-align: center; font-size: 12.5px; color: var(--ink-2); padding: 8px 0 0; }
footer.mini a { color: var(--ink-2); }
.field.email { margin: 4px 0 16px; }
.field.email b { font-size: 15px; }
.bars-run { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.run { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; opacity: .45; transition: opacity .3s; }
.run.active, .run.finished { opacity: 1; }
.run-top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.run-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pct { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.vine { height: 12px; border-radius: 12px; background: #e1f0f7; position: relative; }
.vine span { display: block; height: 100%; width: 0; border-radius: 12px; background: linear-gradient(90deg, #6a994e, #386641); transition: width .45s ease-out; position: relative; }
.vine span::after { content: ''; position: absolute; right: -6px; top: -7px; width: 12px; height: 8px; background: #6a994e; border-radius: 12px 0; transform: rotate(-20deg); opacity: 0; transition: opacity .3s; }
.run.active .vine span::after { opacity: 1; animation: sway 1.6s ease-in-out infinite alternate; }
.run.finished .vine span { background: linear-gradient(90deg, #6a994e, #219ebc); }
.run.finished .vine span::after { opacity: 1; width: 10px; height: 10px; top: 1px; right: 1px; border-radius: 50%; background: var(--amber); transform: none; }
@keyframes sway { from { transform: rotate(-30deg); } to { transform: rotate(5deg); } }
.cap { font-size: 13.5px; color: var(--ink-2); min-height: 1.4em; }
.run.finished .cap { color: var(--ink); }
.early:empty, .asks:empty { display: none; }
.asks { display: grid; gap: 10px; }
.ic { flex: none; vertical-align: -0.15em; }
.back { display: grid; place-items: center; }
.back .ic { font-size: 22px; }
.file .x { display: grid; place-items: center; font-size: 18px; }
.pick-ic { font-size: 26px; color: var(--leaf); }
/* Once they exist, the exact headline and the questions sit above the bars. */
.processing .early { order: 1; }
.processing .asks { order: 2; }
.processing .bars-run { order: 3; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opts.two .opt { padding: 13px 12px; font-size: 15px; }
.check-item .st { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--leaf); }
.check-item .st .ic { font-size: 16px; }
/* iPhone Safari's floating toolbar covers the bottom ~80px: keep the CTA and terms above it. */
.flow-body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- upload: what each file turned out to be ---------- */
.check-item { justify-content: flex-start; gap: 10px; }
.check-item .ci { display: inline-flex; font-size: 18px; color: var(--ink-2); opacity: .5; }
.check-item.done .ci { color: var(--leaf); opacity: 1; }
.check-item .st { margin-left: auto; }
.file .accts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.file .accts li, .icon-list li, .nudge { display: flex; gap: 8px; align-items: flex-start; }
.file .accts .ic { color: var(--leaf); flex: none; margin-top: 2px; }
.found:empty { display: none; }
.found { margin: 12px 0; }
.nudge { margin: 8px 0 0; font-size: 14.5px; font-weight: 600; }
.nudge .ic, .icon-list .ic { flex: none; font-size: 18px; margin-top: 1px; }
.icon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.paywall ul.icon-list { padding: 0; }

/* ---------- preview ---------- */
.card .items { display: grid; gap: 6px; font-size: 14.5px; }
.card .items div { display: flex; justify-content: space-between; gap: 10px; }
.card .items > div > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
footer.mini { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }

.value .btn { margin-top: 28px; }

/* Long labels and notes wrap; only the amount column stays on one line. */
.items > div > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.finding h3, .finding .action, .card p { overflow-wrap: anywhere; }

/* Resuming: no landing flash (class set by the inline script in index.html). */
.resume [data-screen=landing] { display: none; }

/* ---------- action items ---------- */
.actions h3 { font-size: 20px; }
.actions ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.actions li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.actions li + li { border-top: 1px solid var(--line); padding-top: 14px; }
.actions .n { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.actions p { margin: 3px 0 0; font-size: 15.5px; line-height: 1.4; overflow-wrap: anywhere; }
.chip-save { display: inline-block; margin-top: 7px; padding: 4px 10px; border-radius: 999px; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip-save.is-save { background: #dff1f7; color: #024b60; }
.chip-save.is-back { background: #fff1cc; color: #633b00; }

.home .ic { font-size: 21px; }

/* iOS zooms into inputs under 16px. */
input, select, textarea { font-size: 16px; }

/* ---------- upload: compact button on top, files under it ---------- */
.checklist { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.checklist .check-item { border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 8px; background: var(--card); font-size: 14px; gap: 6px; }
.checklist .check-item.done { border-color: var(--leaf); background: #e6f4fa; }
.checklist .check-item .st { margin-left: 0; font-size: 12.5px; }
.checklist .check-item .st:empty { display: none; }
.pick { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); margin-bottom: 8px; }
.pick .ic { font-size: 20px; }
.guide { margin-bottom: 14px; font-size: 14px; color: var(--ink-2); }
.guide summary { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--leaf); font-weight: 650; list-style: none; padding: 4px 0; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary .ic { transition: transform .2s; }
.guide[open] summary .ic { transform: rotate(180deg); }
.guide p { background: #e1f0f7; border-radius: 12px; padding: 12px 14px; margin-top: 6px; }
.go-bar { position: sticky; bottom: 0; margin: auto -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(242, 249, 252, 0), var(--paper) 18px); display: grid; gap: 8px; }
.up { flex: 1; display: flex; flex-direction: column; }

/* ---------- processing: one bar ---------- */
.processing .bars-run { order: 1; }
.processing .early { order: 2; }
.processing .asks { order: 3; }
.run { opacity: 1; gap: 8px; }
.run .run-top b { white-space: normal; }

/* ---------- preview ---------- */
.found-card h3, .card > h3 { font-size: 19px; }
.lock { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; }
.lock > .ic { font-size: 18px; margin-top: 2px; color: var(--ink); }
.lock .small { margin-top: 2px; }
.lock + .items { margin: -2px 0 4px 28px; }
.found-card .lock:not(:first-of-type) { margin-top: 6px; }
.actions .blur { filter: blur(5px); }
.qr p { color: var(--ink); }
.pay-steps { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; color: var(--ink); justify-self: stretch; }
.waiting { font-size: 14px; font-weight: 650; color: var(--leaf); }

/* ---------- report ---------- */
.bocor { gap: 8px; }
.bocor h3 { font-size: 22px; }
.bocor .big { font: 700 38px/1.05 var(--serif); font-variant-numeric: tabular-nums; }
.bocor > p { color: var(--ink-2); font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.stats div { background: #e1f0f7; border-radius: 12px; padding: 9px 10px; display: grid; }
.stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.callout { background: #fff1cc; color: #633b00; border-radius: 12px; padding: 10px 12px; font-weight: 650; font-size: 15px; }
.habits { display: grid; margin-top: 4px; }
.habit { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.habit .hn { font-weight: 750; color: #a34500; font-variant-numeric: tabular-nums; }
.habit .ht small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 1px; }
.habit b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions .why { color: var(--ink-2); font-size: 14.5px; }
details.finding summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: start; cursor: pointer; list-style: none; }
details.finding summary::-webkit-details-marker { display: none; }
details.finding summary h3 { font-size: 17.5px; }
details.finding summary .chip-save { margin-top: 6px; }
details.finding .amt { font-size: 17px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
details.finding summary > .ic { font-size: 20px; color: var(--ink-2); transition: transform .2s; margin-top: 1px; }
details.finding[open] summary > .ic { transform: rotate(180deg); }
details.finding:not([open]) { gap: 0; }
details.finding summary .chip-save { grid-column: 1 / -1; justify-self: start; margin-top: 0; }
.habit { grid-template-columns: 34px minmax(0, 1fr) auto; }
.stats b { font-size: 16px; }
.stats div { padding: 8px 9px; }

/* landing: legal links over the photo */
.landing-foot { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 22px; font-size: 13.5px; }
.landing-foot a { color: #fff; text-decoration: none; text-shadow: 0 1px 3px rgba(2, 48, 71, .7); padding: 6px 2px; }

/* onboarding demo: a piece of the report */
.demo { margin-bottom: 18px; }
.demo .eyebrow { margin: 0 0 8px 2px; }
.demo .habit { opacity: 0; animation: rise .4s ease-out forwards; }
.demo-act { border-top: 1px solid var(--line); padding-top: 10px; opacity: 0; animation: rise .4s ease-out 2.1s forwards; }
.demo-act .why { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.demo-act .chip-save { animation: pop .4s cubic-bezier(.34, 1.56, .64, 1) 2.4s both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
/* Habit rows sit centred between their dividers. */
.habit { align-items: center; padding: 10px 0; }
.value .demo .big, .value .demo-act b { color: var(--ink); }
.value .demo .eyebrow { color: var(--leaf); }
@media (prefers-reduced-motion: reduce) { .demo .habit, .demo-act, .demo-act .chip-save { animation: none; opacity: 1; } }

/* upload: no e-statement yet */
.escape:empty { display: none; }
.escape { margin-bottom: 14px; }
.escape-card { grid-template-columns: minmax(0, 1fr); background: var(--card); border: 1.5px dashed #8ecae6; border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.escape-card > b { font-size: 15.5px; }
.escape .sub { font-size: 14px; color: var(--ink-2); }
.btn.small { padding: 11px 14px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn.small .ic { font-size: 19px; }
.btn.strong { border-color: var(--ink); background: #fff; }
.resume-link { display: block; background: #e6f4fa; border-radius: 10px; padding: 10px 12px; font-size: 14.5px; font-weight: 650; color: #0b6e8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps-ios { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.steps-ios b { color: var(--ink); }
.escape .or { font-size: 12.5px; color: var(--ink-2); text-align: center; }
.escape .done { display: flex; gap: 8px; align-items: flex-start; background: #e6f4fa; border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #024b60; font-weight: 600; }
.escape .done .ic { flex: none; margin-top: 2px; }
.escape-line { font-size: 14px; color: var(--ink-2); }
.escape-line a { color: var(--leaf); font-weight: 650; }
.escape .btn.small { font-size: 14.5px; white-space: nowrap; color: var(--ink); padding: 11px 10px; }

/* Headings and short centred text break into even lines; body text avoids lonely last words. */
h1, h2, h3, .headline, .q-title, .lede { text-wrap: balance; }
p, li, .sub { text-wrap: pretty; }
