/* CashMoney: quiet ledger. Cool paper, graphite ink, one ink-blue accent. Serif for figures, grotesque for interface. */
@font-face { font-family: 'Newsreader'; font-weight: 200 800; font-style: normal; font-display: swap; src: url(fonts/newsreader-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-weight: 200 800; font-style: normal; font-display: swap; src: url(fonts/newsreader-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; font-weight: 100 900; font-style: normal; font-display: swap; src: url(fonts/geist-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-weight: 100 900; font-style: normal; font-display: swap; src: url(fonts/geist-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f5f6f4; --surface: #fcfcfb; --ink: #1b2024; --muted: #6c757b; --line: #dfe3e0; --line-2: #c3c9c6;
  --accent: #2f43c7; --accent-soft: #e9ecfa; --warn: #a8691b; --bad: #ad3e2e;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif; --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101314; --surface: #171b1d; --ink: #e9ecea; --muted: #8b959b; --line: #252b2e; --line-2: #3a4246;
    --accent: #9aabff; --accent-soft: #1d2342; --warn: #d9a05b; --bad: #e08573;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
input:focus-visible, select:focus-visible { outline: none; }

.wrap { max-width: 520px; margin: 0 auto; padding: 28px 24px calc(var(--nav-h) + 110px + env(safe-area-inset-bottom)); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }
.row { display: flex; align-items: center; gap: 12px; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mt2 { margin-top: 32px; } .center { text-align: center; }
.base { align-items: baseline; }

/* headings and the quiet rhythm of the page */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 36px; }
.top h1 { font: 400 2rem/1.1 var(--serif); letter-spacing: -.01em; }
.top p { margin-top: 6px; }
h2 { font: 400 1.6rem/1.15 var(--serif); letter-spacing: -.01em; }
h3 { font: 600 .95rem/1.3 var(--sans); }
.card { margin: 0 0 44px; }
.card > h3, .sec-h h3 { margin-bottom: 14px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; }
.card p + .btn, .card p + form { margin-top: 18px; }
.card > h3 + p { margin-top: -6px; }
.label, label { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
label { margin-top: 22px; }

/* hero: the one memorable thing is the figure and the pace line */
.hero { margin: 0 0 48px; }
.figure, .big { font: 300 4.6rem/1 var(--serif); letter-spacing: -.035em; font-feature-settings: 'lnum', 'tnum'; margin: 6px 0 14px; }
.figure .cur { font-size: .5em; letter-spacing: 0; margin-right: .06em; position: relative; top: -.42em; font-weight: 400; color: var(--muted); }
.figure.sm { font-size: 2.9rem; margin: 4px 0 8px; }
.big { font-size: 3.4rem; }
.lede { font-size: 1.05rem; color: var(--ink); margin-bottom: 28px; max-width: 34ch; }
.meta { color: var(--muted); font-size: .85rem; margin-top: 12px; max-width: 44ch; }
.pace { position: relative; height: 3px; background: var(--line); margin: 0; }
.pace i { position: absolute; left: 0; top: 0; height: 100%; background: var(--ink); transition: width .5s ease; }
.pace.warn i { background: var(--warn); } .pace.bad i { background: var(--bad); }
.pace b { position: absolute; top: -6px; width: 1px; height: 15px; background: var(--muted); transform: translateX(-.5px); }

.stat { font: 400 1.9rem/1.15 var(--serif); letter-spacing: -.02em; font-feature-settings: 'lnum', 'tnum'; }
.stat .cur { font-size: .6em; color: var(--muted); margin-right: .05em; position: relative; top: -.2em; }
.unit { font: 400 .9rem var(--sans); color: var(--muted); letter-spacing: 0; }
.stats { margin: 0 0 44px; gap: 24px; } .stats .label { margin-bottom: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.bar { height: 3px; background: var(--line); margin-top: 12px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); transition: width .4s ease; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }
.stack { display: flex; height: 6px; gap: 2px; margin: 22px 0 18px; }
.stack > i { display: block; height: 100%; }
.legend .row { padding: 7px 0; font-size: .92rem; } .legend .muted { font-size: .85rem; }
.row-b { padding: 12px 0; } .row-b .bar { margin-top: 8px; }

/* lists: hairlines only where rows need separating */
.list { margin: 0 0 44px; }
.card .list { margin-bottom: 0; }
.list > .item, .list > .tip { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 0; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.list > .item:last-child, .list > .tip:last-child { border-bottom: 0; }
.item.stackrow { display: block; } .item.stackrow .row { align-items: center; } .item.stackrow .bar { margin-top: 10px; }
.ico { display: flex; flex: none; width: 10px; } .ico:empty { display: none; }
.cd { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 10px; flex: none; vertical-align: middle; }
.ico .cd { margin: 0; }
.amt { font-weight: 500; white-space: nowrap; }
.day { font-size: .85rem; color: var(--muted); margin: 32px 0 0; font-weight: 500; }
.tip { display: block !important; } .tip-t { font: 400 1.15rem/1.3 var(--serif); margin-bottom: 4px; }
.tipcard .tip-t { font-size: 1.3rem; margin-bottom: 6px; }
.banner { display: flex; gap: 14px; align-items: center; padding: 12px 0; margin: 0 0 32px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty { color: var(--muted); padding: 56px 0; max-width: 30ch; }
.monthnav { display: flex; align-items: center; gap: 4px; font-size: .9rem; } .monthnav span { min-width: 112px; text-align: center; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 500; transition: opacity .15s, transform .1s; }
.btn:active { transform: scale(.985); opacity: .88; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.block { width: 100%; } .btn.sm { min-height: 38px; padding: 0 16px; font-size: .9rem; border-radius: 12px; }
.link { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 500; }
.icon-btn { background: none; border: 0; width: 36px; height: 36px; font-size: 1.3rem; color: var(--muted); border-radius: 50%; }
.stackbtn { display: grid; gap: 10px; margin-top: 18px; }

.seg { display: flex; gap: 22px; margin: 0 0 32px; border-bottom: 1px solid var(--line); }
.seg button { background: none; border: 0; padding: 10px 0; color: var(--muted); font-weight: 500; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.seg button.on { color: var(--ink); border-bottom-color: var(--ink); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.nav button { flex: 1; height: var(--nav-h); border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .72rem; font-weight: 500; }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav button.on { color: var(--ink); } .nav button.on svg { stroke-width: 1.9; }
.fab { position: fixed; right: 22px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; z-index: 15; }
.fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

/* sheets */
#sheet-root .scrim { position: fixed; inset: 0; background: rgba(16, 19, 20, .42); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet { background: var(--surface); width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 12px 24px calc(28px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
.sheet .grab { width: 36px; height: 4px; border-radius: 9px; background: var(--line-2); margin: 0 auto 22px; }
.sheet h2 { margin-bottom: 18px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } } @keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

input, select { width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: transparent; outline: none; font-size: 1rem; }
input:focus, select:focus { border-bottom-color: var(--accent); }
input::placeholder { color: var(--muted); opacity: .7; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.amount-in { font: 300 2.8rem/1.1 var(--serif); letter-spacing: -.02em; padding: 8px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .quick button { display: inline-flex; align-items: center; border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 8px 14px; font-size: .9rem; font-weight: 500; color: var(--ink); }
.chip span:empty, .oi:empty { display: none; } .chip .cd { margin-right: 8px; }
.chip.on, .quick button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actions { display: flex; gap: 10px; margin-top: 28px; } .actions .btn { flex: 1; }
.err { color: var(--bad); font-size: .9rem; margin-top: 12px; min-height: 1.2em; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; margin: 0; color: var(--ink); font-size: .95rem; font-weight: 400; border-bottom: 1px solid var(--line); }
.switch select { width: auto; padding: 4px 0; } .switch input[type=checkbox] { width: 20px; height: 20px; }
.steps { margin: 14px 0 0; padding-left: 20px; color: var(--ink); } .steps li { padding: 3px 0; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 86px); transform: translateX(-50%) translateY(12px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: .9rem; font-weight: 500; opacity: 0; pointer-events: none; transition: .22s; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* goals */
.goal { margin-bottom: 40px; }
.goalbtn { display: block; width: 100%; padding: 0; background: none; border: 0; text-align: left; }
.gname { font: 400 1.35rem/1.2 var(--serif); } .gamt { margin: 6px 0 0; font-weight: 500; }
.goal .link { margin-top: 10px; display: inline-block; }

/* challenges */
.weeks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 20px; }
.week { border: 1px solid var(--line-2); background: transparent; border-radius: 8px; padding: 7px 0 6px; font-size: .75rem; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; align-items: center; }
.week b { font-size: .6rem; font-weight: 400; color: var(--muted); }
.week.done { background: var(--ink); border-color: var(--ink); color: var(--bg); } .week.done b { color: var(--bg); opacity: .7; }
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.dot { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; font-size: .75rem; color: var(--muted); }
.dot.on { background: var(--ink); border-color: var(--ink); color: var(--bg); } .dot.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.badge { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.badge.on { border-color: var(--accent); color: var(--accent); }
.result { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.result b { font: 400 1.9rem/1.2 var(--serif); letter-spacing: -.02em; }

/* savings style picker */
.opts { margin: 4px 0 0; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 15px 0; }
.opt::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; }
.opt.on::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 44%, transparent 48%); }
.opt b { display: block; font-weight: 500; } .opt small { display: block; color: var(--muted); font-size: .8rem; }
.opt .oa { font: 400 1.25rem var(--serif); white-space: nowrap; }

.auth { max-width: 380px; margin: 0 auto; padding: 14vh 28px 40px; }
.wordmark { font: 300 2.8rem/1 var(--serif); letter-spacing: -.03em; margin-bottom: 14px; }
.auth form { margin-top: 36px; }
[hidden] { display: none !important; }

.card .empty { padding: 4px 0 0; }
.wrap > .btn.block { margin-bottom: 44px; }
