:root {
  --bg: #f3f5f1; --card: #ffffff; --ink: #14201a; --muted: #6b7a72; --line: #e6ebe6;
  --green: #17803d; --green-soft: #e4f4e9; --red: #b4432f; --accent: #9fe870;
  --hero-a: #0b3d2e; --hero-b: #155e3f; --radius: 20px; --shadow: 0 1px 2px rgba(20,32,26,.05), 0 8px 24px rgba(20,32,26,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1411; --card: #171f1a; --ink: #eef3ee; --muted: #93a398; --line: #253029; --green: #6fd68f; --green-soft: #1c2f22; --red: #ff8a75; --hero-a: #10402f; --hero-b: #1b6a47; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* author display rules must never resurrect a hidden element */
/* iPhone full-screen: the page runs under the status bar / notch. The root is
   painted dark green so the (white) clock and signal icons sit on brand color,
   and everything starts below the safe area. */
html { background: var(--hero-a); padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
body { margin: 0; min-height: calc(100vh - env(safe-area-inset-top)); min-height: calc(100dvh - env(safe-area-inset-top)); background: var(--bg); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.app { max-width: 1040px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.eyebrow { font-size: 20px; font-weight: 700; }
button, input, select { font: inherit; }
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; cursor: pointer; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.btn.primary { background: var(--hero-a); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn.small { padding: 8px 12px; font-size: 13px; } .btn.full { width: 100%; margin-top: 6px; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
/* ── banner: header + hero as one full-bleed gradient "sky" ─────────────── */
.banner { position: relative; overflow: hidden; margin: 0 0 14px; padding: 16px 18px 22px; color: #fff; background: linear-gradient(160deg, #0b3d2e 0%, #145a3c 55%, #1d7a4f 100%); border-radius: var(--radius); box-shadow: var(--shadow); isolation: isolate; }
.banner-inner { position: relative; z-index: 1; }
.blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; pointer-events: none; z-index: 0; }
.blob.b1 { width: 320px; height: 320px; background: #9fe870; top: -140px; right: -80px; animation: drift1 18s ease-in-out infinite alternate; }
.blob.b2 { width: 260px; height: 260px; background: #2fb37a; bottom: -140px; left: -60px; animation: drift2 22s ease-in-out infinite alternate; }
.blob.b3 { width: 180px; height: 180px; background: #ffe9a3; opacity: .22; top: 40%; left: 55%; animation: drift1 26s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.15); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(50px, -30px) scale(.9); } }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 0 0 18px; }
.who { display: flex; gap: 12px; align-items: center; min-width: 0; }
@media (max-width: 520px) { .top { flex-wrap: wrap; } .top .eyebrow { font-size: 18px; } .top-actions { width: 100%; justify-content: flex-start; } .logo-sm { width: 40px; height: 40px; } }
.logo-sm { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.banner .top .muted { color: rgba(255,255,255,.72); }
.banner .top .linkbtn { color: var(--accent); }
.banner .top .btn.ghost { color: rgba(255,255,255,.85); } .banner .top .btn.ghost:hover { color: #fff; }
/* admin header sits on the page background, so it uses the ink colors */
header.top { color: var(--ink); padding: 6px 4px 14px; }
header.top .btn.ghost { color: var(--ink); border: 1px solid var(--line); }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.switch { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; border-radius: 10px; padding: 6px 10px; }
/* the balance shimmers: a slow sweep of lime and gold across white */
.shimmer { background: linear-gradient(100deg, #ffffff 0%, #ffffff 30%, #c6ff8f 45%, #ffe9a3 55%, #ffffff 70%, #ffffff 100%); background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: shimmer 4.5s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -140% 0; } }
@media (prefers-reduced-motion: reduce) { .shimmer, .blob { animation: none; } }
.grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid { grid-template-columns: 1.1fr .9fr; } }

/* loading + login */
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login { min-height: 80vh; min-height: 80dvh; display: grid; place-items: center; }
.login-card { width: min(360px, 100%); text-align: center; background: var(--card); border-radius: var(--radius); padding: 32px 24px; box-shadow: var(--shadow); }
.login-card .logo { font-size: 40px; } .login-card h1 { font-size: 26px; margin: 6px 0 4px; }
.login-card form { display: grid; gap: 10px; margin-top: 18px; }
.login-card input { text-align: center; font-size: 22px; letter-spacing: .3em; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.error { color: var(--red); margin: 0; font-size: 13px; }

/* hero */
.hero { color: #fff; max-width: 640px; }
.hero-label { font-size: 13px; opacity: .8; font-weight: 500; }
.hero-total { font-size: clamp(38px, 10vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 14px; opacity: .9; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.hero-stats > div { background: rgba(255,255,255,.12); backdrop-filter: blur(6px); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.hero-stats .k { font-size: 11.5px; opacity: .8; } .hero-stats .v { font-weight: 700; font-size: 16px; color: var(--accent); font-variant-numeric: tabular-nums; }

/* windows */
.windows { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 12px; }
.win { border: 1px solid var(--line); border-radius: 14px; padding: 8px 4px; text-align: center; background: transparent; color: var(--ink); display: grid; gap: 2px; }
.win .n { font-size: 11px; color: var(--muted); font-weight: 600; }
.win .r { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.win .e { font-size: 11px; color: var(--green); font-variant-numeric: tabular-nums; }
.win.active { background: var(--green-soft); border-color: var(--green); }
.win.partial .n::after { content: "*"; }
.chart-wrap { position: relative; }
#chart { width: 100%; height: 190px; display: block; }
.chart-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
#chart { touch-action: pan-y; cursor: crosshair; }
.chart-tip { position: absolute; top: 6px; left: 0; transform: translateX(-50%); background: var(--ink); color: var(--card); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none; }
.chart-tip small { font-weight: 500; opacity: .75; }

/* accounts */
.accounts { display: grid; gap: 10px; }
.acct { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.acct .name { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.acct .name a { color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; }
.acct .bal { font-weight: 800; font-size: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.acct .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.acct .meta b { color: var(--ink); font-weight: 600; }
.acct .wins { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; gap: 6px 12px; }
.acct .wins em { font-style: normal; color: var(--green); }
.hero-sub b { color: var(--accent); }
.pill { background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.footnote { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

/* ledger */
.ledger { display: grid; }
.lrow { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--bg); }
.lrow .ic.in { background: var(--green-soft); }
.lrow .t { font-weight: 600; font-size: 14px; } .lrow .s { font-size: 12px; color: var(--muted); }
.lrow .amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.lrow .amt.in { color: var(--green); }
.lrow .s a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.empty { color: var(--muted); padding: 16px 0; text-align: center; }

/* dream */
.field { display: grid; gap: 8px; margin: 14px 0; font-size: 14px; }
.field > span { color: var(--muted); } .field b { color: var(--ink); }
.money-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--bg); }
.money-input span { color: var(--muted); font-weight: 600; }
.money-input input { border: 0; background: transparent; padding: 12px 6px; width: 100%; font-size: 18px; font-weight: 700; color: var(--ink); outline: none; }
input[type=range] { width: 100%; accent-color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.chip.active { background: var(--green-soft); border-color: var(--green); color: var(--green); font-weight: 600; }
.dream-result { margin-top: 8px; background: var(--bg); border-radius: 16px; padding: 16px; }
.dream-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dream-line { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.dream-bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.bar-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--muted); border-radius: 999px; transition: width .3s; }
.bar i.green { background: var(--green); }
.dream-compare { margin-top: 12px; line-height: 1.5; }
.foot { text-align: center; padding: 18px 8px 0; line-height: 1.5; }

/* admin + forms */
.text { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); color: var(--ink); width: 100%; font-size: 14px; }
.text:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.login-card .text { text-align: center; letter-spacing: 0; font-size: 16px; }
.login-card details summary { cursor: pointer; } .login-card details .row { margin-top: 8px; }
.row { display: flex; gap: 8px; align-items: center; } .row .text { flex: 1; min-width: 0; }
.grow { flex: 1; display: grid; gap: 6px; }
.person { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 12px; display: grid; gap: 10px; }
.person-head { display: flex; gap: 10px; align-items: flex-start; }
.person-head .name { font-weight: 700; font-size: 16px; }
.person-auth { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.invite { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.invite code { word-break: break-all; font-size: 12px; flex: 1; }
.pill.warn { background: #fdf0d5; color: #8a5a00; } @media (prefers-color-scheme: dark) { .pill.warn { background: #3a2d10; color: #f0c060; } }
.accounts-edit { display: grid; gap: 10px; }
.acct-edit { display: grid; gap: 6px; background: var(--bg); border-radius: 12px; padding: 10px; }
.acct-edit .text { background: var(--card); }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.sticky-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 14px; }
.pk-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); } .pk-row:last-child { border-bottom: 0; }
code { background: var(--bg); padding: 1px 5px; border-radius: 6px; font-size: 12px; }

/* refresh + install */
.linkbtn { background: none; border: 0; color: var(--green); font-weight: 600; cursor: pointer; padding: 0 4px; font-size: 12.5px; }
.linkbtn[disabled] { opacity: .6; cursor: default; }
.install-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.install-icon { width: 48px; height: 48px; border-radius: 12px; }
.install-how { margin-top: 10px; line-height: 1.6; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.install-how b { color: var(--ink); }

/* pull to refresh */
/* The indicator and page share one offset. Never use the global .loading class. */
html { --pull-offset:0px; overscroll-behavior-y:none; }
.ptr { position:fixed; left:0; right:0; top:env(safe-area-inset-top); height:var(--pull-offset); min-height:0; overflow:hidden; display:flex; align-items:center; justify-content:center; gap:8px; background:var(--bg); color:var(--ink); font-size:12px; font-weight:500; white-space:nowrap; z-index:5; pointer-events:none; transition:height .2s ease-out; }
.app { transform:translateY(var(--pull-offset)); transition:transform .2s ease-out; }
.ptr-dragging .ptr,.ptr-dragging .app { transition:none; }
.ptr .ptr-icon { display:inline-block; width:16px; text-align:center; transition:transform .2s; }
.ptr.ready .ptr-icon { transform:rotate(180deg); }
.ptr.refreshing .ptr-icon { font-size:0; width:14px; height:14px; border:2px solid var(--line); border-top-color:var(--green); border-radius:50%; animation:spin .8s linear infinite; }
@media(prefers-reduced-motion:reduce) { .app,.ptr,.ptr .ptr-icon { transition:none; } }

/* collapsible ledger */
.card-head.toggle { width: 100%; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.ledger-card .chev { display: inline-block; transition: transform .2s; }
.ledger-card.collapsed .chev { transform: rotate(-90deg); }
.ledger-card.collapsed .card-head { margin-bottom: 0; }

/* live ticker in the hero */
.hero-stats .tick { font-size: 11px; color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; }
.hero-stats .tick b { color: var(--accent); font-weight: 600; }
/* monthly recap */
.month-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.month-now > div { background: var(--bg); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.month-now .k { font-size: 11.5px; color: var(--muted); } .month-now .v { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.month-now .v.pos { color: var(--green); }
/* one shared grid for the header and every month row, so columns truly line up */
.months { display: grid; grid-template-columns: auto auto auto 1fr; align-items: stretch; font-size: 13.5px; }
.mrow { display: contents; }
.mrow > * { display: flex; align-items: center; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.mrow > *:last-child { padding-right: 0; }
.mrow:last-child > * { border-bottom: 0; }
.mrow.head > * { padding-top: 0; padding-bottom: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.months .mrow.head > * { color: var(--muted); }
.months .mrow .i { justify-content: flex-end; }
.mrow .m { font-weight: 600; white-space: nowrap; }
.mrow .i { text-align: right; color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.mrow .f { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: left; white-space: nowrap; }
.mrow .m small { font-weight: 500; font-size: 11px; }

.arr { font-style: normal; font-weight: 700; display: inline-block; width: 16px; height: 16px; line-height: 16px; border-radius: 5px; text-align: center; font-size: 11px; margin-right: 3px; vertical-align: -2px; }
.arr.in { background: var(--green-soft); color: var(--green); }
.arr.out { background: var(--line); color: var(--muted); }
.month-now { margin-bottom: 12px; }
.mrow .f { color: var(--ink); }

/* share button: iMessage-style bubble + share arrow */
.btn.share { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 9px; font-size: 13px; background: var(--green-soft); color: var(--green); box-shadow: none; }
.btn.share svg { width: 18px; height: 18px; }
.btn.share .ic-msg { fill: #34c759; }
.btn.share .ic-share { fill: var(--green); }

/* flip card (hero) */
.flip { position: relative; perspective: 700px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: #fff; font: inherit; -webkit-tap-highlight-color: transparent; min-height: 78px; }
.flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.7,.2,1); animation: nudge 7s ease-in-out infinite; }
.flip.flipped .flip-inner { transform: rotateY(180deg); animation: none; }
.flip.rest .flip-inner { animation: none; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: rgba(255,255,255,.12); backdrop-filter: blur(6px); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; }
.face.back { transform: rotateY(180deg); }
.face .k { font-size: 11.5px; opacity: .8; } .face .v { font-weight: 700; font-size: 16px; color: var(--accent); font-variant-numeric: tabular-nums; }
.face .s { font-size: 11px; opacity: .8; }
.dots { position: absolute; right: 10px; bottom: 9px; display: flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.35); } .dots i.on { background: var(--accent); }
@keyframes nudge { 0%, 88%, 100% { transform: rotateY(0); } 92% { transform: rotateY(-14deg); } 96% { transform: rotateY(6deg); } }
@media (prefers-reduced-motion: reduce) { .flip-inner { animation: none; transition: none; } }

/* add / take out money */
.money-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.qr-wrap { display: grid; place-items: center; margin: 12px 0; }
#qr { background: #fff; padding: 10px; border-radius: 14px; box-shadow: var(--shadow); line-height: 0; }
#qr canvas, #qr img, #qr svg { width: 168px; height: 168px; }
.addr-row { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.addr-row code { flex: 1; font-size: 11.5px; word-break: break-all; background: none; padding: 0; }
.how { margin-top: 12px; font-size: 13px; color: var(--muted); } .how summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.how ol { padding-left: 18px; line-height: 1.6; } .how b { color: var(--ink); }
.pending-box { background: var(--green-soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 10px; }
.fee-note { font-size: 11px; opacity: .75; }

.processing { display: flex; gap: 12px; align-items: center; background: var(--green-soft); border-radius: 12px; padding: 10px 12px; margin-top: 10px; font-size: 13.5px; }
.spinner.small { width: 20px; height: 20px; border-width: 2.5px; flex: none; border-top-color: var(--green); }

/* onboarding checklist */
.onboard { display: grid; gap: 4px; background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.onboard .step { display: flex; gap: 8px; align-items: baseline; }
.onboard .tick { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; background: var(--line); color: var(--muted); }
.onboard .step.done .tick { background: var(--green); color: #fff; }
.onboard .step.done .t { color: var(--muted); text-decoration: line-through; }
.onboard .hint { color: var(--muted); font-size: 12px; }

/* ways to add money */
.ways { display: grid; gap: 8px; margin-bottom: 12px; }
.way { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: var(--ink); font: inherit; cursor: pointer; }
.way b { display: block; font-size: 14px; } .way small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.way-ic { font-size: 22px; flex: none; }
.way-dd { display: block; }
.way-dd summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; } .way-dd summary::-webkit-details-marker { display: none; }
.way-dd ol b, .way-dd p b { display: inline; font-size: inherit; }
.way-dd ol { padding-left: 18px; line-height: 1.6; font-size: 13px; color: var(--muted); margin: 10px 0 4px; } .way-dd ol b, .way-dd p b { color: var(--ink); }
.way-dd p { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

.earns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.earns > div { background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.earns .k { display: block; font-size: 11px; color: var(--muted); } .earns .v { font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }

/* Stash savings journal — shared light and dark visual system. */
:root { --bg:#f7f5ef; --card:#fffef9; --ink:#20382e; --muted:#667168; --line:#dce1d7; --green:#32613c; --green-soft:#e8efdf; --accent:#d2f88a; --hero-a:#193e30; --radius:24px; --shadow:none; --dream-bg:#eeebf8; --dream-ink:#3d3458; --dream-muted:#6b627c; --dream-line:#d8d1e6; }
@media(prefers-color-scheme:dark) { :root { --bg:#151b18; --card:#1d2520; --ink:#f1f2e9; --muted:#a6b2a6; --line:#354239; --green:#b6dd95; --green-soft:#2c3d2d; --hero-a:#193e30; --dream-bg:#2b2737; --dream-ink:#f1eaff; --dream-muted:#bbb1cd; --dream-line:#4e435e; } }
.app { max-width:1120px; padding:24px 24px calc(32px + env(safe-area-inset-bottom)); }
h1,h2,.dream-big { font-family:Georgia,'Times New Roman',serif; font-weight:400; letter-spacing:-.04em; }
h2 { font-size:28px; line-height:1.1; }
.card { padding:26px; margin-bottom:20px; }
.card-head { align-items:center; margin-bottom:20px; }
.banner { background:#193e30; padding:28px 32px 30px; border-radius:28px; margin-bottom:28px; }
.banner::after { content:''; position:absolute; width:360px; height:360px; border:1px solid #d2f88a25; border-radius:50%; right:-110px; top:-130px; box-shadow:0 0 0 45px #d2f88a08,0 0 0 90px #d2f88a06; pointer-events:none; z-index:-1; }
.blob { display:none; }
.top { padding-bottom:30px; }
.eyebrow { font-size:16px; font-weight:500; }
.logo-sm { width:38px; height:38px; border-radius:50%; box-shadow:none; }
.hero { max-width:none; }
.hero-label { text-transform:uppercase; letter-spacing:.15em; font-size:10px; }
.hero-total { font-size:clamp(44px,8vw,78px); font-weight:500; letter-spacing:-.055em; margin:10px 0; }
.hero-sub { font-size:13px; line-height:1.6; max-width:440px; }
.shimmer { animation-duration:8s; animation-iteration-count:2; }
.hero-stats { max-width:600px; margin-top:28px; gap:24px; }
.hero-stats>div,.face { background:transparent; backdrop-filter:none; border-radius:0; border-top:1px solid #ffffff30; padding:16px 0 6px; }
.hero-stats .v,.face .v { font-size:23px; font-weight:500; }
.flip { min-height:102px; }
.flip-inner { animation-iteration-count:2; }
.dots { right:0; bottom:4px; }
.grid { grid-template-columns:minmax(0,1fr); gap:0 28px; }
.grid>.col { display:contents; }
.earnings-card { order:1; }
#money-card { order:2; padding:18px 24px; background:var(--green-soft); }
.dream { order:3; background:var(--dream-bg); color:var(--dream-ink); --muted:var(--dream-muted); --line:var(--dream-line); }
.accounts-card { order:4; }
.ledger-card { order:5; }
.earnings-card,.accounts-card,.ledger-card { background:transparent; padding-left:4px; padding-right:4px; }
.acct { border:0; border-bottom:1px solid var(--line); border-radius:0; padding:18px 0; }
.acct:last-child { border-bottom:0; }
.accounts { gap:0; }
.acct .name { font-size:14px; font-weight:500; }
.acct .bal { font-size:22px; font-weight:500; }
.month-now { gap:0; margin-bottom:24px; }
.month-now>div { background:transparent; border-radius:0; padding:4px 14px; border-left:1px solid var(--line); }
.month-now>div:first-child { border-left:0; padding-left:0; }
.month-now .v { font-size:21px; font-weight:500; }
.mrow>* { padding-top:12px; padding-bottom:12px; }
.money-disclosure>summary { display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; list-style:none; font-weight:600; min-height:28px; }
.money-disclosure>summary::-webkit-details-marker { display:none; }
.money-hint { font-size:12px; font-weight:400; }
.money-disclosure[open]>summary { margin-bottom:20px; }
.dream .field { margin:22px 0; }
.dream .money-input { background:transparent; border:0; border-bottom:1px solid var(--dream-line); border-radius:0; padding:0; }
.dream .money-input input { color:var(--dream-ink); font-size:30px; font-weight:500; padding-left:8px; }
.dream .money-input:focus-within { border-bottom-color:var(--dream-ink); }
.dream .field b,.dream .bar-row b { color:var(--dream-ink); }
.dream .earns { gap:0; }
.dream .earns>div { background:transparent; border-radius:0; padding-left:0; }
.dream .earns .v { color:var(--dream-ink); font-size:17px; font-weight:500; }
.dream .chip { border-color:var(--dream-line); color:var(--dream-ink); border-radius:10px; min-height:42px; }
.dream .chip.active { background:var(--dream-ink); border-color:var(--dream-ink); color:var(--dream-bg); }
.dream .btn.share { background:transparent; color:var(--dream-ink); padding-right:0; }
.dream-result { background:transparent; border-radius:0; border-top:1px solid var(--dream-line); padding:22px 0 0; margin-top:22px; }
.dream-big { font-size:clamp(40px,6vw,58px); }
.bar { height:6px; }
.dream .bar i.green { background:var(--dream-ink); }
.dream-compare { line-height:1.65; }
.btn { box-shadow:none; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--green); outline-offset:4px; }
.banner button:focus-visible,.banner a:focus-visible { outline-color:var(--accent); }
.login-card { border:1px solid var(--line); }
.login-card h1 { font-size:42px; }
@media(min-width:900px) {
 .grid { grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); align-items:start; }
 .earnings-card { grid-column:1; grid-row:1; }
 #money-card { grid-column:1; grid-row:2; }
 .accounts-card { grid-column:1; grid-row:3; }
 .ledger-card { grid-column:1; grid-row:4; }
 .dream { grid-column:2; grid-row:1 / span 4; }
}
@media(max-width:520px) {
 .app { padding:14px 18px calc(24px + env(safe-area-inset-bottom)); }
 .banner { padding:22px 20px 24px; border-radius:24px; }
 .top { padding-bottom:22px; }
 .top .eyebrow { font-size:15px; }
 .top-actions { width:auto; }
 .hero-stats { gap:18px; }
 .hero-stats .v,.face .v { font-size:19px; }
 .hero-stats .tick { font-size:10px; }
 .card { padding:22px 18px; }
 .earnings-card,.accounts-card,.ledger-card { padding-left:0; padding-right:0; }
 h2 { font-size:26px; }
 .month-now .v { font-size:18px; }
 .mrow>* { padding-right:8px; font-size:12px; }
 .mrow .f { font-size:11px; }
 .dream .card-head { gap:4px; }
 .btn.share { gap:3px; font-size:12px; }
 .dream .ic-msg { display:none; }
 .dream .earns .v { font-size:15px; }
}

/* Only one interest face is ever visible; keep text out of 3D compositing. */
.flip { perspective:none; min-height:124px; }
.flip-inner,.flip.flipped .flip-inner,.flip.rest .flip-inner { transform:none; animation:none; transition:none; transform-style:flat; }
.face,.face.back { transform:none; backface-visibility:visible; -webkit-backface-visibility:visible; display:none; padding-bottom:18px; }
.flip:not(.flipped) .face.front,.flip.flipped .face.back { display:grid; animation:interest-appear .18s ease-out; }
.face .s { line-height:1.4; overflow-wrap:anywhere; }
.hero-stats>div { align-content:start; }
.hero-stats .tick { display:block; line-height:1.5; }
.hero-stats .tick b { display:inline-block; min-width:7ch; }
@keyframes interest-appear { from { opacity:.35; } to { opacity:1; } }
@media(prefers-reduced-motion:reduce) { .flip:not(.flipped) .face.front,.flip.flipped .face.back { animation:none; } }
