/* Overvue on the web (/app/): log in, then the app's Home as a dashboard.
   Built on the site's tokens (style.css), so light and dark follow the theme switch. */

.i { width: 1em; height: 1em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }
.app-page main { min-height: calc(100vh - 65px); }
.app-state { padding: 56px 0 88px; }
.app-state[hidden] { display: none !important; }
.app-state[data-state="loading"], .dash-loading { display: grid; place-items: center; min-height: 50vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header account menu: the avatar opens name, email and Log out ---------- */
.acct { position: relative; display: flex; align-items: center; }
.nav [hidden] { display: none !important; } /* hidden beats .btn and .acct display rules */
.acct-btn { display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.acct-btn:focus { outline: none; }
.acct-btn img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.acct-btn .acct-avatar { transition: box-shadow .15s ease; }
.acct-btn:hover .acct-avatar, .acct-btn[aria-expanded="true"] .acct-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--border-strong); }
.acct-btn:focus-visible { outline: none; }
.acct-btn:focus-visible .acct-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.acct-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; background: var(--surface-high); border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 700; }
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct-avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.acct-menu { position: absolute; top: calc(100% + 12px); right: 0; z-index: 60; width: min(300px, calc(100vw - 32px)); padding: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .55); }
:root[data-theme="light"] .acct-menu { box-shadow: 0 24px 48px -24px rgba(12, 40, 48, .35); }
.acct-who { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.acct-id { display: grid; gap: 2px; min-width: 0; }
.acct-id b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-id small { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-id small:empty { display: none; }
.acct-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; font-size: 14.5px; font-weight: 600; text-align: left; cursor: pointer; }
.acct-item:hover, .acct-item:focus-visible { background: var(--surface-high); outline: none; }
.acct-item .i { font-size: 17px; color: var(--text-dim); }

/* ---------- Log in ---------- */
.login { display: grid; place-items: start center; padding-left: 16px; padding-right: 16px; }
.login-card { width: 100%; max-width: 420px; padding: 36px 32px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 28px; text-align: center; }
.login-mark { margin: 0 auto 18px; width: 44px; height: 44px; }
.login-card h1 { font-size: 28px; letter-spacing: -0.02em; }
.login-sub { margin: 10px auto 26px; color: var(--text-dim); font-size: 15.5px; line-height: 1.5; max-width: 330px; }
.btn-google { width: 100%; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.btn-google:hover { background: #f8f9fa; }
.btn-google svg { width: 20px; height: 20px; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--text-dim); font-size: 13px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-form { display: grid; gap: 14px; text-align: left; }
.field { display: grid; gap: 7px; }
.field span { font-size: 14px; font-weight: 600; color: var(--text-soft); }
.field input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.login-msg { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.45; color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.login-msg.ok { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.login-msg[hidden] { display: none; }
.btn-block { width: 100%; justify-content: center; margin-top: 4px; }
.btn[disabled] { opacity: .65; cursor: progress; }
.link-btn { justify-self: center; border: 0; background: none; padding: 4px; color: var(--accent); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 14px; line-height: 1.5; text-wrap: balance; }
.login-foot p { margin: 0; }
.login-foot .login-note { margin-top: 6px; font-size: 12.5px; opacity: .85; }
.login-foot a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }

/* ---------- Dashboard ---------- */
/* The app's SurfaceCard: the lead card (glow) is deeper than the rest in the dark
   theme and the usual card in the light one, with a short accent bar on its top
   edge; tonal cards sit back on the soft fill with no hairline. */
:root { --lead-bg: #060b0c; --tonal-bg: #172629; }
:root[data-theme="black"] { --tonal-bg: #151b1d; }
:root[data-theme="light"] { --lead-bg: var(--surface); --tonal-bg: #e7efef; }
.dash { padding-top: 40px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.dash-head h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.dash-date { margin-bottom: 6px; color: var(--text-dim); font-size: 14.5px; }
.dash-tools { display: flex; gap: 8px; flex-shrink: 0; }
.tool-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tool-btn:hover { color: var(--text); border-color: var(--border-strong); }
.tool-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 16px; border-radius: 14px; font-size: 14.5px; color: var(--text-soft); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.demo-banner[hidden] { display: none; }
.demo-banner .i { color: var(--accent); }
.demo-banner a { color: var(--accent); font-weight: 600; }
.dash-note { margin-top: 28px; text-align: center; color: var(--text-dim); font-size: 13.5px; }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.dash-grid.one { grid-template-columns: minmax(0, 640px); justify-content: center; }
.dcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 22px; min-width: 0; }
/* Folding cards: every card in a row is as tall as the row; long ones show what fits and fade into a chevron. */
.dcard[data-fold] .dcard-body { max-height: var(--fold-h, 452px); overflow: hidden; margin-bottom: 12px; }
.dcard.clipped .dcard-body { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent); }
.dcard.open .dcard-body { max-height: none; }
.fold { display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: center; margin-top: auto; padding: 7px 14px 7px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-high); color: var(--text-soft); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.fold:hover { color: var(--text); border-color: var(--border-strong); }
.fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold[hidden] { display: none; }
.fold .i { transition: transform .2s ease; }
.dcard.open .fold .i { transform: rotate(180deg); }
.dcard.nw { position: relative; background: var(--lead-bg); }
.dcard.nw::before { content: ""; position: absolute; top: 0; left: 24px; width: 40px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.dcard.month .sublbl { margin-top: 22px; }
.dcard.month .hint { margin-top: 22px; }
.dcard.nw, .dcard.activity { grid-column: span 2; }
.dcard-head { margin-bottom: 16px; }
.dcard-head h2 { font-size: 17px; letter-spacing: -0.01em; }
.dcard-head p { margin-top: 3px; color: var(--text-dim); font-size: 13.5px; }
.muted { color: var(--text-dim); }
.small { font-size: 13px; }
.pos { color: var(--accent); }
.neg { color: var(--red); }
.warn { color: var(--amber); }
.big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: var(--surface-high); color: var(--text-dim); font-size: 13.5px; line-height: 1.45; }
.hint .i { margin-top: 2px; }
.sublbl { margin: 18px 0 6px; color: var(--text-dim); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sublbl .muted { text-transform: none; letter-spacing: 0; font-weight: 600; }
.lbl { color: var(--text-dim); font-size: 14.5px; font-weight: 500; }

/* Hide amounts */
.amt.hid { color: var(--text-dim) !important; letter-spacing: .06em; }

/* Net worth */
.hero-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 56px; align-items: center; }
.hero-amt { margin: 6px 0 10px; font-size: clamp(36px, 5vw, 50px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.2; }
.pill.pos { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pill.neg { background: color-mix(in srgb, var(--red) 14%, transparent); }
.trend { margin: 0; }
.trend svg { display: block; width: 100%; height: auto; max-height: 280px; overflow: visible; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trend-area { fill: var(--accent); opacity: .12; }
.trend-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.trend-dot.now { stroke-width: 2.5; }
.trend .gl { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.trend .ax { fill: var(--text-dim); font-size: 11px; }
.trend figcaption { margin-top: 2px; text-align: right; padding-right: 50px; color: var(--text-dim); font-size: 12px; }
.nwbar { display: flex; gap: 3px; height: 10px; margin-top: 22px; border-radius: 999px; overflow: hidden; }
.nwbar i { min-width: 6px; }
.legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 18px; margin-top: 16px; }
.legend div { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; }
.legend .lg-l { color: var(--text-dim); }
.legend .amt { margin-left: auto; font-weight: 600; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* This month */
.figs3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.figs3 div { display: grid; gap: 4px; min-width: 0; align-content: start; } /* amounts on one line, whatever sits under Saved */
.figs3 small { color: var(--text-dim); font-size: 13px; }
.figs3 .amt { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.fig-sub { font-size: 12.5px; font-weight: 600; }
.rate { margin-top: 22px; }
.toplist { list-style: none; display: grid; gap: 12px; }
.toplist li { display: flex; align-items: center; gap: 12px; }
.toplist .cat { gap: 6px; }
.toplist .prog { height: 6px; }
.badge.sm { width: 32px; height: 32px; font-size: 15px; }
.rate-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; color: var(--text-dim); }
.rate-top b { color: var(--text); font-size: 15px; }
.prog { height: 8px; border-radius: 999px; background: var(--surface-high); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* Budget */
.snap { display: flex; align-items: center; gap: 22px; }
.ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--surface-high); }
.ring-fg { stroke-linecap: round; }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-c b { font-size: 21px; letter-spacing: -0.02em; }
.ring-c small { color: var(--text-dim); font-size: 12px; }
.rows { flex: 1; display: grid; gap: 9px; min-width: 0; }
.rows div { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.rows span { color: var(--text-dim); }
.rows .amt { font-weight: 600; white-space: nowrap; }
.forecast { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.fc-amt { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.bchart { display: block; width: 100%; height: auto; max-height: 220px; margin-top: 12px; overflow: visible; }
.bchart .gl { stroke: var(--border); stroke-width: 1; }
.bchart .ax { fill: var(--text-dim); font-size: 10px; }
.bchart .today { stroke: var(--border-strong); stroke-dasharray: 3 3; }
.bchart .tlabel { fill: var(--text-dim); font-size: 10px; }
.bchart .bline { stroke: #9370db; stroke-width: 1.5; stroke-dasharray: 6 4; }
.bchart .cdot { fill: var(--surface); stroke-width: 2.5; }
.fc-status { margin-top: 10px; font-size: 14px; font-weight: 600; }

/* Lists: accounts, coming up, activity */
.badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--text); border: 1px solid var(--border); overflow: hidden; font-size: 19px; }
.badge.logo { border-color: transparent; }
.badge.logo img { width: 100%; height: 100%; object-fit: cover; }
.badge.white { background: #fff; }
.badge.white img { object-fit: contain; padding: 6px; }
.badge.tint { border-color: transparent; color: var(--tint); background: color-mix(in srgb, var(--tint) var(--badge-a, 18%), transparent); }
.badge.sq { border-radius: 12px; border: 0; color: var(--tint, var(--text)); background: color-mix(in srgb, var(--tint, var(--text)) 14%, transparent); font-size: 18px; }
.tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tx b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx small { color: var(--text-dim); font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tx small .sep { opacity: .7; }
.acct-tag { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.acct-tag img { width: 14px; height: 14px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.acct-tag .i { font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--surface-high); color: var(--text-soft); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.warn { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.chip.soon { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.list, .grp ul, .catlist { list-style: none; }
.list li, .grp li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.list .amt, .grp .amt { font-weight: 600; white-space: nowrap; }
.end { display: grid; justify-items: end; gap: 4px; }

.grp { border-top: 1px solid var(--border); }
.groups > .grp:first-child { border-top: 0; }
.grp.single { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.grp.single .amt { font-size: 15.5px; font-weight: 600; white-space: nowrap; }
.grp summary { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; list-style: none; }
.grp summary::-webkit-details-marker { display: none; }
.grp summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.grp summary .amt { font-size: 15.5px; }
.chev { color: var(--text-dim); transition: transform .15s ease; }
.grp[open] .chev { transform: rotate(90deg); }
.grp ul { margin: 0 0 6px 18px; padding-left: 16px; border-left: 2px solid var(--border); }
.grp li { padding: 9px 0; }
.grp li .badge { width: 34px; height: 34px; font-size: 16px; }

.catlist li { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.cat-bot { display: flex; align-items: center; gap: 10px; }
.cat-bot .prog { flex: 1; height: 6px; }
.cat-bot .share { width: auto; min-width: 30px; }
.donut { position: relative; width: 168px; height: 168px; margin: 4px auto 14px; }
.donut svg { width: 100%; height: 100%; }
.donut circle { fill: none; stroke-width: 16; }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.donut-c small { color: var(--text-dim); font-size: 13px; }
.donut-c .amt { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.chip.up { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.chip.down { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chip .i { font-size: 11px; }
.end .time { color: var(--text-dim); font-size: 12px; }
.list.boxed { border: 1px solid var(--border); border-radius: 18px; padding: 0 14px; }
.cat { flex: 1; min-width: 0; display: grid; gap: 7px; }
.cat-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.cat-top b { font-weight: 600; }
.share { width: 40px; text-align: right; color: var(--text-dim); font-size: 13px; font-weight: 600; }

.day + .day { margin-top: 8px; }
.day-head { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text-dim); font-size: 13px; font-weight: 600; }

/* Goals: a row across the grid, one tile per goal still going */
.dcard.goals { grid-column: 1 / -1; }
.goal-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.goal-list li { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 18px; }
.goal-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.goal-body b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-body .prog { height: 5px; }
.goal-body small { color: var(--text-dim); font-size: 12.5px; line-height: 1.35; }
.pct { flex-shrink: 0; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in srgb, var(--text) 4%, transparent); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pct.close { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* Empty and error states */
.dcard.empty { padding: 40px 32px; text-align: center; background: var(--tonal-bg); border-color: transparent; }
.dcard.empty h2 { font-size: 22px; letter-spacing: -0.015em; }
.dcard.empty p { margin: 10px auto 0; max-width: 460px; color: var(--text-dim); font-size: 15.5px; line-height: 1.55; }
.dcard.empty .btn { margin-top: 18px; }
.dcard.empty a { color: var(--accent); }
.empty-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 16px; border-radius: 50%; background: var(--surface-high); color: var(--accent); font-size: 26px; }

@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dcard.month { grid-column: span 2; }
  .hero-top { grid-template-columns: auto minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dcard.nw, .dcard.activity, .dcard.month { grid-column: auto; }
  .hero-top { grid-template-columns: minmax(0, 1fr); }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .app-state { padding: 32px 0 64px; }
  .login-card { padding: 28px 20px 22px; border-radius: 24px; }
  .dcard { padding: 18px; border-radius: 20px; }
  .dcard.nw::before { left: 20px; }
  .goal-list { grid-template-columns: minmax(0, 1fr); }
  .tool-btn span { display: none; }
  .tool-btn { padding: 9px 11px; }
  .figs3 .amt { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.lim { height: 4px; margin-top: 6px; border-radius: 999px; background: var(--surface-high); overflow: hidden; }
.lim i { display: block; height: 100%; border-radius: inherit; }
