/* APP 10/25. Friendly, colorful, one thing at a time. Layout: one centered column (max 560px) like a phone app; bottom tab bar; sheets slide up for details. */
:root {
  --bg: #F4F6FA; --surface: #FFFFFF; --surface-2: #EEF2F8; --ink: #152033; --muted: #5A6880; --line: #E2E8F1;
  --green: #12A150; --green-soft: #E2F6E9; --green-ink: #FFFFFF;
  --blue: #2667F0; --blue-soft: #E5EEFE;
  --yellow: #E59A00; --yellow-soft: #FFF3D6;
  --red: #E0464B; --red-soft: #FDE7E7;
  --purple: #7653F5; --purple-soft: #EEE8FF;
  --teal: #0C9C9A; --teal-soft: #DDF5F4;
  --pink: #E0458E; --pink-soft: #FCE6F1;
  --orange: #EE6A1F; --orange-soft: #FFEADD;
  --shadow: 0 1px 2px rgba(21,32,51,.05), 0 6px 20px rgba(21,32,51,.06);
  --font-head: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --r: 22px; --r-sm: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1320; --surface: #171F30; --surface-2: #1F2940; --ink: #EAF0FA; --muted: #9AA8C1; --line: #2A3550;
  --green: #3CCB7A; --green-soft: #15362A; --green-ink: #062012;
  --blue: #6E9BFF; --blue-soft: #1A2A4F;
  --yellow: #FFC24A; --yellow-soft: #3A2E12;
  --red: #FF7A7E; --red-soft: #45201F;
  --purple: #A48DFF; --purple-soft: #2B2450;
  --teal: #45D3D0; --teal-soft: #123735;
  --pink: #FF7DB8; --pink-soft: #43203A;
  --orange: #FF9A5C; --orange-soft: #43281A;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0E1320; --surface: #171F30; --surface-2: #1F2940; --ink: #EAF0FA; --muted: #9AA8C1; --line: #2A3550;
  --green: #3CCB7A; --green-soft: #15362A; --green-ink: #062012;
  --blue: #6E9BFF; --blue-soft: #1A2A4F;
  --yellow: #FFC24A; --yellow-soft: #3A2E12;
  --red: #FF7A7E; --red-soft: #45201F;
  --purple: #A48DFF; --purple-soft: #2B2450;
  --teal: #45D3D0; --teal-soft: #123735;
  --pink: #FF7DB8; --pink-soft: #43203A;
  --orange: #FF9A5C; --orange-soft: #43281A;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--font-body); font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased; padding-top: env(safe-area-inset-top, 0px); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; flex: none; }
.badge svg { width: 14px; height: 14px; }
.file-drop svg { width: 36px; height: 36px; color: var(--green); }
.tight-stack { gap: 6px; }
.big-num { font-family: var(--font-head); font-weight: 600; font-size: 2.6rem; line-height: 1; }
input[type="range"] { width: 100%; accent-color: var(--green); min-height: 36px; }
.find input { width: 26px; height: 26px; accent-color: var(--green); flex: none; }
.item { color: inherit; text-decoration: none; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.money { font-variant-numeric: tabular-nums; font-weight: 800; }

/* page */
.page { max-width: 560px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(110px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 18px; }
.page.no-nav { padding-bottom: 40px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 1.3rem; flex: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }

/* cards */
.card { background: var(--surface); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.tight { padding: 14px 16px; gap: 10px; }
.card.soft-green { background: var(--green-soft); box-shadow: none; }
.card.soft-blue { background: var(--blue-soft); box-shadow: none; }
.card.soft-yellow { background: var(--yellow-soft); box-shadow: none; }
.card.soft-red { background: var(--red-soft); box-shadow: none; }
.card.soft-purple { background: var(--purple-soft); box-shadow: none; }
.card.tap { cursor: pointer; transition: transform .12s; border: 0; text-align: left; width: 100%; }
.card.tap:active { transform: scale(.98); }

/* the big "today" card */
.today { border-radius: 28px; padding: 24px; color: #fff; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; border: 0; text-align: left; cursor: pointer; width: 100%; }
.today.good { background: linear-gradient(140deg, #13A653, #0E8E6B); }
.today.careful { background: linear-gradient(140deg, #F2A10A, #E07A12); }
.today.stop { background: linear-gradient(140deg, #E5484D, #C7375B); }
.today .face { position: absolute; right: -6px; top: -6px; width: 120px; height: 120px; opacity: .22; }
.today .label { font-weight: 700; font-size: 1rem; opacity: .95; }
.today .big { font-family: var(--font-head); font-weight: 600; font-size: clamp(3rem, 15vw, 4.2rem); line-height: 1; letter-spacing: -.02em; }
.today .big small { font-size: .38em; font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.today .sub { font-weight: 600; font-size: 1.02rem; opacity: .95; }
.today .how { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; background: rgba(255,255,255,.2); border-radius: 999px; padding: 6px 12px; align-self: flex-start; }

/* buttons: 52px tall, rounded, one main color */
.btn { min-height: 52px; padding: 0 22px; border-radius: 16px; border: 0; font-weight: 800; font-size: 1.02rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--surface-2); color: var(--ink); transition: transform .1s, filter .15s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.go { background: var(--green); color: var(--green-ink); box-shadow: 0 6px 16px rgba(18,161,80,.25); }
.btn.blue { background: var(--blue); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.line { background: var(--surface); border: 2px solid var(--line); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 16px; font-size: .92rem; border-radius: 12px; }
.btn svg { width: 22px; height: 22px; flex: none; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-tile { min-height: 96px; border-radius: var(--r); border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 16px; font-weight: 800; text-align: left; font-size: 1rem; transition: transform .12s; }
.action-tile:active { transform: scale(.97); }
.action-tile .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.6); }
.action-tile svg { width: 24px; height: 24px; }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-purple { background: var(--purple-soft); color: var(--purple); }
.t-green { background: var(--green-soft); color: var(--green); }
.t-yellow { background: var(--yellow-soft); color: var(--yellow); }
.t-teal { background: var(--teal-soft); color: var(--teal); }
.t-pink { background: var(--pink-soft); color: var(--pink); }
.t-red { background: var(--red-soft); color: var(--red); }
.t-orange { background: var(--orange-soft); color: var(--orange); }
.action-tile span.txt { color: var(--ink); }

/* lists with round icons */
.list { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; }
.item:last-child { border-bottom: 0; }
button.item { cursor: pointer; }
.item .name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { color: var(--muted); font-size: .88rem; }
.item .amt { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.item .amt small { display: block; font-weight: 600; color: var(--muted); font-size: .78rem; }
.dot { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 1.3rem; color: #fff; flex: none; }
.dot svg { width: 24px; height: 24px; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }

/* alerts */
.alert { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; border-radius: 18px; }
.alert .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); }
.alert .ic svg { width: 24px; height: 24px; }
.alert b { display: block; font-weight: 800; }
.alert.red { background: var(--red-soft); } .alert.red .ic { color: var(--red); }
.alert.yellow { background: var(--yellow-soft); } .alert.yellow .ic { color: var(--yellow); }
.alert.blue { background: var(--blue-soft); } .alert.blue .ic { color: var(--blue); }
.alert.green { background: var(--green-soft); } .alert.green .ic { color: var(--green); }
.alert.purple { background: var(--purple-soft); } .alert.purple .ic { color: var(--purple); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 800; font-size: .95rem; }
.field small { color: var(--muted); font-size: .85rem; }
.input { min-height: 56px; width: 100%; border: 2px solid var(--line); border-radius: 16px; padding: 0 16px; background: var(--surface); font-size: 1.05rem; font-weight: 600; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.input.bad { border-color: var(--red); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.money-input { position: relative; }
.money-input::before { content: "$"; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--muted); font-size: 1.1rem; }
.money-input .input { padding-left: 36px; font-variant-numeric: tabular-nums; }
.money-input.huge .input { min-height: 76px; font-size: 2rem; font-family: var(--font-head); padding-left: 46px; }
.money-input.huge::before { font-size: 2rem; left: 20px; font-family: var(--font-head); }
.err { color: var(--red); font-weight: 700; font-size: .9rem; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 76px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--blue); font-weight: 800; cursor: pointer; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* choices */
.choices { display: grid; grid-template-columns: 1fr; gap: 10px; }
.choices.cols { grid-template-columns: 1fr 1fr; }
.choice { min-height: 60px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-weight: 800; cursor: pointer; text-align: left; transition: transform .1s, border-color .15s, background .15s; }
.choice:active { transform: scale(.98); }
.choice .ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.choice .ic svg { width: 22px; height: 22px; }
.choice[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.choice[aria-pressed="true"] .ic { background: var(--green); color: var(--green-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); padding: 0 18px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.chip small { font-weight: 600; opacity: .8; }

/* onboarding */
.q-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.q-head { display: flex; align-items: center; gap: 12px; }
.q-head .btn { min-height: 48px; padding: 0 12px; }
.progress { flex: 1; height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), #34D399); transition: width .35s ease; }
.q-body { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 26px 0 20px; }
.q-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.q-icon svg { width: 34px; height: 34px; }
.q-count { font-weight: 800; color: var(--muted); font-size: .9rem; }
.q-foot { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 22%); padding: 22px 0 calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 6px; }
.item-rows { display: flex; flex-direction: column; gap: 10px; }
.item-row { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.item-row .head { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.item-row .head .ic { width: 36px; height: 36px; border-radius: 12px; background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; }
.item-row .head svg { width: 20px; height: 20px; }

/* welcome / auth */
.welcome { min-height: 100vh; min-height: 100dvh; max-width: 480px; margin: 0 auto; padding: 32px max(20px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(140deg, #13A653, #2667F0); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: .95rem; letter-spacing: -.02em; }
.logo-name { font-family: var(--font-head); font-weight: 600; font-size: 1.5rem; }
.hero-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-art div { border-radius: 20px; padding: 14px 12px; font-weight: 800; font-size: .9rem; display: flex; flex-direction: column; gap: 8px; }
.hero-art svg { width: 28px; height: 28px; }
.code-box { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .08em; text-align: center; padding: 18px; border-radius: 18px; background: var(--yellow-soft); border: 2px dashed var(--yellow); user-select: all; word-break: break-all; }
.check-row { display: flex; gap: 12px; align-items: center; min-height: 48px; font-weight: 700; cursor: pointer; }
.check-row input { width: 26px; height: 26px; accent-color: var(--green); flex: none; }

/* bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.tabs-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tabs button { min-height: 60px; border: 0; background: none; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-weight: 800; font-size: .74rem; color: var(--muted); cursor: pointer; position: relative; }
.tabs button svg { width: 26px; height: 26px; }
.tabs button[aria-current="page"] { color: var(--green); background: var(--green-soft); }
.tabs .pip { position: absolute; top: 6px; right: calc(50% - 20px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; display: grid; place-items: center; padding: 0 4px; }

/* sheets (pop-up panels) */
.sheet-bg { position: fixed; inset: 0; background: rgba(10,16,30,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-radius: 28px 28px 0 0; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; animation: up .25s ease; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -10px; background: var(--bg); padding: 8px 0; z-index: 1; }
.close { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; flex: none; }
.close svg { width: 22px; height: 22px; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* small pieces */
.bar { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { border-radius: 18px; padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--font-head); font-weight: 600; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; font-weight: 700; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
.math { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; font-weight: 700; }
.math .tot { border-top: 2px solid var(--line); padding-top: 10px; font-weight: 800; }
.empty { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty .ic { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; }
.empty .ic svg { width: 38px; height: 38px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 800; opacity: 0; transition: opacity .2s, transform .2s; z-index: 60; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: drop 1.6s ease-in forwards; }
@keyframes drop { to { transform: translateY(110vh) rotate(540deg); } }
.pop { animation: popin .35s ease-out; }
@keyframes popin { from { transform: scale(.94); opacity: .3; } to { transform: none; opacity: 1; } }
.file-drop { border: 3px dashed var(--line); border-radius: var(--r); padding: 26px 16px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; cursor: pointer; background: var(--surface); }
.file-drop.over { border-color: var(--green); background: var(--green-soft); }
.saved-dot { font-size: .8rem; font-weight: 800; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.saved-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.saved-dot.saving::before { background: var(--yellow); }
.saved-dot.failed::before { background: var(--red); }

@media (min-width: 900px) {
  .page { padding-top: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
