:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --ink: #171a17;
  --muted: #747a74;
  --line: #e5e8e2;
  --accent: #1f6f4a;
  --accent-soft: #e8f3ec;
  --income: #357e57;
  --outflow: #bd6b5d;
  --outflow-muted: #c78770;
  --outflow-warm: #b9966a;
  --save: #5b8f9b;
  --invest: #7489af;
  --save-invest: #7489af;
  --sankey-surface: #ffffff;
  --sankey-border: #e4e9e4;
  --danger: #a84444;
  --shadow: 0 10px 30px rgba(30, 38, 31, 0.05);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111513;
  --card: #1a201c;
  --ink: #edf2ee;
  --muted: #9da89f;
  --line: #303a32;
  /* Green is reserved for actions and genuinely positive financial signals.
     Supporting surfaces stay neutral so those signals retain their meaning. */
  --accent: #8fb799;
  --accent-soft: #262d28;
  --income: #719b7b;
  --outflow: #c98274;
  --outflow-muted: #b98d7a;
  --outflow-warm: #ad9671;
  --save: #80aab4;
  --invest: #92a4c5;
  --save-invest: #92a4c5;
  --sankey-surface: #202720;
  --sankey-border: #354238;
  --danger: #eb9691;
  --shadow: 0 10px 30px rgba(0,0,0,.16);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.auth-screen { isolation: isolate; position: relative; min-height: 100dvh; display: grid; place-items: center; overflow: hidden; padding: 28px 20px; background: #f5f7f3; }
.auth-halo { position: absolute; z-index: -1; width: min(72vw, 760px); aspect-ratio: 1; border-radius: 50%; filter: blur(2px); opacity: .68; }
.auth-halo-one { top: -44%; left: -23%; background: radial-gradient(circle, #d9ecdf 0, rgba(217,236,223,0) 68%); }.auth-halo-two { right: -34%; bottom: -48%; background: radial-gradient(circle, #e5eee2 0, rgba(229,238,226,0) 69%); }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid rgba(218,224,216,.92); border-radius: 28px; background: rgba(255,255,255,.88); box-shadow: 0 28px 72px rgba(25,42,29,.1), 0 2px 5px rgba(25,42,29,.025); backdrop-filter: blur(18px); }
.auth-brand { padding: 0; margin-bottom: 36px; }.auth-card h1 { margin: 10px 0 12px; font-size: clamp(34px, 8vw, 43px); line-height: .99; letter-spacing: -.065em; }.auth-card h1 em { color: var(--accent); font-style: normal; }
.auth-kicker { display: flex; align-items: center; gap: 7px; color: #5f7564; font-size: 10px; font-weight: 760; letter-spacing: .12em; }.auth-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px #e8f3ec; }
.auth-intro { max-width: 320px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }.auth-preview { position: relative; min-height: 148px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; margin: 28px 0 23px; padding: 18px; border: 1px solid #e8eee8; border-radius: 18px; background: linear-gradient(140deg, #f6faf6 0%, #fff 80%); }.auth-preview > div { position: relative; z-index: 1; display: grid; gap: 3px; }.auth-preview span { color: #7d877e; font-size: 9px; font-weight: 760; letter-spacing: .11em; }.auth-preview strong { font-size: 28px; letter-spacing: -.055em; }.auth-preview small { color: var(--accent); font-size: 11px; font-weight: 700; }.auth-preview svg { position: absolute; right: 0; bottom: 0; left: 0; width: 100%; height: 82px; }
.auth-divider { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; color: #8c938c; font-size: 10px; font-weight: 680; letter-spacing: .06em; text-transform: uppercase; }.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: #e9ede8; }.google-signin-wrap { min-height: 42px; display: flex; justify-content: center; }.google-signin-wrap > div { width: 100% !important; }.google-signin-wrap iframe { width: 100% !important; }.auth-signup-note { margin: 9px 0 0; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.4; }.auth-message { min-height: 18px; margin-top: 12px; color: var(--danger); text-align: center; font-size: 12px; line-height: 1.4; }.auth-note { margin: 16px 0 0; color: #899089; text-align: center; font-size: 11px; }.auth-note span { color: var(--accent); font-size: 15px; vertical-align: -1px; }
.demo-preview-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 12px; padding: 12px 16px; border: 1px solid #dfe6df; border-radius: 12px; background: #fff; color: #36523e; font-weight: 720; font-size: 13px; transition: border-color .18s, background .18s, transform .18s; }.demo-preview-button:hover { border-color: #b9cfbe; background: #f7fbf8; }.demo-preview-button:active { transform: translateY(1px); }.demo-preview-button span { color: var(--accent); font-size: 17px; line-height: 0; }.auth-demo-note { margin: 8px 0 -1px; color: #8b928b; text-align: center; font-size: 11px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; padding: 28px 18px; background: #f0f2ee; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 750; padding: 0 8px 28px; }
.brand-home { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 10px; }.brand-home:hover { color: var(--accent); }.brand-home:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 36%, transparent); outline-offset: 2px; }
.cashflow-controls { display: flex; align-items: center; gap: 7px; }.diagram-expand { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--muted); cursor: pointer; }.diagram-expand svg { width: 15px; height: 15px; }.diagram-expand:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 24%, var(--line)); }.diagram-expand:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent); outline-offset: 2px; }
.cashflow-payroll > div { flex: 1; grid-template-columns: minmax(0, 1fr) auto; }.cashflow-payroll p { max-width: 58ch; }
@media (min-width: 700px) { .cashflow-payroll { width: fit-content; max-width: min(680px, 100%); padding: 8px 4px; border: 0; border-radius: 0; background: transparent; }.cashflow-payroll:hover { background: transparent; transform: none; }.cashflow-payroll-mark { width: 28px; height: 28px; border-radius: 9px; }.cashflow-payroll > div { flex: 0 1 auto; }.cashflow-payroll-chevron { margin-left: 2px; font-size: 18px; } }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: white; font-size: 14px; }
.nav { display: grid; gap: 5px; }
.nav-item { border: 0; background: transparent; color: #4d534d; border-radius: 12px; padding: 11px 12px; text-align: left; display: flex; align-items: center; gap: 10px; }
.nav-item:hover, .nav-item.active { background: white; color: var(--ink); }
.nav-item.active { box-shadow: 0 2px 10px rgba(20,30,20,.04); }
.sidebar-footer { margin-top: auto; }
.tiny { color: var(--muted); font-size: 11px; text-align: center; margin-top: 10px; }
.main { margin-left: 230px; padding: 36px 46px 64px; max-width: 1440px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 28px; }
.profile-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 5px -7px; padding: 5px 7px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 650; }.profile-back:hover { color: var(--ink); background: rgba(110,125,112,.09); }.profile-back svg { width: 15px; height: 15px; }
h1,h2,h3,p { margin-top: 0; }
h1 { font-size: 30px; margin-bottom: 0; letter-spacing: -0.03em; }
h2 { font-size: 20px; margin-bottom: 0; letter-spacing: -0.02em; }
h3 { font-size: 16px; }
.eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.top-actions { display: flex; gap: 10px; }
input[type="month"], .search { border: 1px solid var(--line); background: white; border-radius: 12px; padding: 10px 12px; color: var(--ink); outline: none; }
.primary { border: 0; background: var(--ink); color: white; padding: 11px 15px; border-radius: 12px; font-weight: 650; box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.primary:hover { transform: translateY(-1px); }
.secondary { background: white; color: var(--ink); }
.text-button { border: 0; background: transparent; color: var(--accent); font-weight: 650; padding: 4px; }
.notice { margin: -8px 0 20px; padding: 12px 14px; border-radius: 12px; background: #fff4d6; color: #705919; border: 1px solid #f2dfaa; font-size: 13px; }
.app-status { display: inline-flex; align-items: center; gap: 8px; margin: -8px 0 18px; color: var(--muted); font-size: 12px; font-weight: 650; }.app-status::before { content: ''; width: 7px; height: 7px; border: 2px solid #bdd0c1; border-top-color: var(--accent); border-radius: 50%; animation: clarity-spin .7s linear infinite; }@keyframes clarity-spin { to { transform: rotate(360deg); } }
.loading-skeleton { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .7fr); gap: 18px; }.skeleton-hero, .skeleton-stack, .skeleton-insight { border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }.skeleton-hero { min-height: 310px; padding: 24px; }.skeleton-copy { display: grid; gap: 12px; }.skeleton-copy i, .skeleton-copy b, .skeleton-copy em, .skeleton-chart, .skeleton-stack > div, .skeleton-insight { background: linear-gradient(100deg, var(--card) 15%, color-mix(in srgb, var(--line) 72%, var(--card)) 45%, var(--card) 75%); background-size: 220% 100%; animation: clarity-skeleton 1.35s ease-in-out infinite; }.skeleton-copy i { width: 74px; height: 11px; border-radius: 99px; }.skeleton-copy b { width: min(54%, 250px); height: 43px; border-radius: 9px; }.skeleton-copy em { width: 145px; height: 12px; border-radius: 99px; }.skeleton-chart { height: 142px; margin-top: 39px; border-radius: 14px; }.skeleton-stack { display: grid; align-content: center; gap: 28px; padding: 24px; }.skeleton-stack > div { height: 55px; border-radius: 10px; }.skeleton-insight { min-height: 126px; }.loading-skeleton .skeleton-insight { grid-column: span 1; }@keyframes clarity-skeleton { to { background-position: -120% 0; } }.initial-loading .view.active { display: none; }
.hidden { display: none !important; }
.view { display: none; }
.view.active { display: block; }
.investment-hero { margin-bottom: 16px; }.investment-total-card { display: flex; align-items: center; justify-content: space-between; padding: 25px; }.investment-total-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }.investment-total-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 19px; color: var(--accent); background: var(--accent-soft); font-size: 30px; }.investment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.investment-card, .positions-card { padding: 21px; }.allocation-list, .investment-accounts { display: grid; margin-top: 14px; }.allocation-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 11px 0; font-size: 13px; }.allocation-row + .allocation-row, .investment-account-row + .investment-account-row { border-top: 1px solid var(--line); }.allocation-row > div { display: flex; align-items: center; gap: 8px; min-width: 0; }.allocation-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }.allocation-1 { background: #7ea98b; }.allocation-2 { background: #d5a75f; }.allocation-3 { background: #b88692; }.allocation-4 { background: #9ca9bd; }.allocation-row strong, .investment-account-row b, .position-row b { font-variant-numeric: tabular-nums; }.allocation-row i { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 99px; background: #edf0eb; }.allocation-row i b { display: block; height: 100%; border-radius: inherit; background: var(--accent); }.investment-account-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 0; }.investment-account-row div { display: grid; gap: 3px; min-width: 0; }.investment-account-row strong, .position-row strong { font-size: 13px; }.investment-account-row span, .position-row span { color: var(--muted); font-size: 11px; }.positions-card { margin-top: 16px; }.position-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }.position-row > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }.position-row strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }.position-symbol { display: grid; width: 33px; height: 33px; place-items: center; overflow: hidden; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 800; }.positions-empty { margin: 17px 0 3px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 18px; }
.networth-card { padding: 24px 24px 14px; min-height: 310px; }
.card-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.hero-number { font-size: clamp(38px, 5vw, 62px); font-weight: 760; letter-spacing: -0.055em; margin-top: 9px; }
.hero-number.small { font-size: 40px; }
.delta { min-height: 36px; margin-top: 6px; color: var(--accent); font-size: 13px; font-weight: 650; line-height: 1.4; }
.line-chart { height: 150px; margin-top: 18px; }
.line-chart svg { width: 100%; height: 100%; overflow: visible; }
.split-card { padding: 24px; display: grid; align-content: center; gap: 28px; }
.networth-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }.networth-insight { min-height: 126px; padding: 20px 22px; }.networth-insight strong { display: block; margin-top: 8px; font-size: 24px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }.networth-insight p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }.runway-insight { display: flex; align-items: center; justify-content: space-between; gap: 16px; }.runway-mark { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-size: 23px; }@media (max-width: 760px) { .networth-insights { grid-template-columns: 1fr; gap: 14px; } }
.monthly-review { min-height: auto; border-color: #dfe9e1; background: linear-gradient(135deg, #fbfdfb, #fff); }.goal-insight, .connection-attention { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: auto; }.goal-insight .text-button, .connection-attention .text-button { flex: 0 0 auto; color: var(--accent); font-size: 12px; font-weight: 700; }.goal-progress { display: block; width: min(260px, 100%); height: 6px; margin-top: 13px; overflow: hidden; border-radius: 99px; background: #e7ede7; }.goal-progress b { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }.connection-attention { padding: 20px 22px; border-color: #eadfc8; background: #fffdf8; }.connection-attention strong { font-size: 17px; }
.clarity-checkin { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-top: 18px; padding: 20px 22px; border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 66%, var(--card)), var(--card) 56%); }.clarity-checkin strong { display: block; margin-top: 5px; font-size: 18px; letter-spacing: -.025em; }.clarity-checkin p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }.clarity-checkin .text-button { color: var(--accent); font-size: 12px; font-weight: 750; white-space: nowrap; }.checkin-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: var(--accent); color: #fff; font-size: 18px; font-weight: 800; }.clarity-checkin[data-tone="watch"] .checkin-mark { color: #755a1d; background: #f5e4b7; }.clarity-checkin[data-tone="attention"] .checkin-mark { color: #fff; background: var(--danger); }@media (max-width: 620px) { .clarity-checkin { grid-template-columns: auto minmax(0, 1fr); align-items: start; }.clarity-checkin .text-button { grid-column: 2; justify-self: start; padding-left: 0; } }
.metric { font-size: 30px; font-weight: 720; margin-top: 7px; letter-spacing: -.035em; }
.divider { height: 1px; background: var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 34px 2px 14px; }
.csp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.csp-card { padding: 18px; }
.csp-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; font-weight: 680; }
.csp-amount { font-size: 23px; font-weight: 720; letter-spacing: -.03em; margin: 16px 0 4px; }
.csp-sub { font-size: 12px; color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: #edf0eb; overflow: hidden; margin-top: 14px; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: inherit; }
.progress.over > span { background: var(--danger); }
.account-list { overflow: hidden; }
.account-preview-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.account-preview-item { display: grid; gap: 4px; padding: 18px; border-right: 1px solid var(--line); }
.account-preview-item:last-child { border-right: 0; }
.account-preview-item > span, .account-preview-item small { color: var(--muted); font-size: 12px; }
.account-preview-item strong { font-size: 20px; letter-spacing: -.03em; }
.account-preview-item.asset { border-top: 3px solid var(--accent); }
.account-preview-item.debt { border-top: 3px solid #d8a1a1; }
.account-preview-details { border-top: 1px solid var(--line); }
.account-preview-details summary { padding: 13px 18px; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 650; }
.account-preview-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.account-preview-group { display: grid; gap: 4px; padding: 14px 18px; background: #fbfcfa; }
.account-preview-group span { color: var(--muted); font-size: 12px; }
.account-preview-group strong { font-size: 16px; letter-spacing: -.02em; }
.account-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.account-row:last-child { border-bottom: 0; }
.account-meta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); font-weight: 800; }
.account-name { font-weight: 650; font-size: 14px; }
.account-inst { font-size: 12px; color: var(--muted); margin-top: 2px; }
.account-balance { font-weight: 720; font-variant-numeric: tabular-nums; }
.spending-head { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.income-card { padding: 22px; }
.target-card { padding: 14px 16px; }
.target-card { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; }
.target-summary { font-size: 30px; font-weight: 720; margin: 12px 0; letter-spacing: -.04em; }
.subtle, .legend-note { color: var(--muted); font-size: 12px; }
.sankey-card { margin-top: 16px; padding: 22px; }
.card-top { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.range-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 2px 16px; }
.range-control { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f4f6f2; }
.range-control button { border: 0; border-radius: 7px; padding: 5px 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.range-control button:hover { color: var(--ink); }
.range-control button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(30, 38, 31, .1); }
#sankey { min-height: 330px; margin-top: 18px; }
#sankey svg { width: 100%; height: auto; display: block; }
.sankey-label { font-size: 12px; fill: #4a504a; }
.sankey-value { font-size: 12px; font-weight: 700; fill: #191d19; }
.transaction-card { overflow: hidden; }
.transaction-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfcfa; }
.search { width: min(280px, 42vw); }
.tx-row { display: grid; grid-template-columns: 40px minmax(180px, 1fr) auto 36px; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.tx-row:last-child { border-bottom: 0; }
.tx-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #edf0eb; color: #5b625a; font-weight: 800; }
.tx-icon.fixed { background: #eef2ec; color: #55734e; }
.tx-icon.savings, .tx-icon.investments, .tx-icon.income { background: var(--accent-soft); color: var(--accent); }
.tx-icon.guilt_free { background: #f8f1e7; color: #9b6c32; }
.tx-icon.transfer { background: #f1f2f0; color: #727a72; }
.tx-main { min-width: 0; }
.tx-merchant { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-date, .tx-account { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tx-actions { display: grid; justify-items: end; gap: 4px; }
.tx-amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-amount.income { color: var(--accent); }
.bucket-select { border: 0; border-radius: 8px; padding: 2px 0; background: transparent; color: var(--muted); font-size: 11px; max-width: 110px; min-width: 0; text-align-last: right; }
.exclude-button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: white; color: var(--muted); }
.exclude-button.active { background: #f2eeee; color: var(--danger); }
.accounts-summary:empty { display: none; }
.account-actions { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; }.account-actions button { padding: 8px 10px; border-radius: 9px; font-size: 12px; font-weight: 680; }.account-actions span { color: var(--muted); font-size: 11px; }
.accounts-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.accounts-summary div { display: grid; gap: 5px; padding: 16px 18px; border-right: 1px solid var(--line); }
.accounts-summary div:last-child { border-right: 0; }
.accounts-summary span { color: var(--muted); font-size: 12px; font-weight: 600; }
.accounts-summary strong { font-size: 22px; letter-spacing: -.03em; }
.account-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.account-tile { padding: 19px; }
.account-tile .account-balance { font-size: 25px; margin-top: 18px; }
.account-type { display: inline-block; margin-top: 10px; padding: 4px 8px; border-radius: 999px; background: #f1f3ef; color: var(--muted); font-size: 11px; }
.setup-card { margin-top: 18px; padding: 20px; }
.setup-card p { color: var(--muted); max-width: 640px; line-height: 1.55; }
.code-row code { display: inline-block; background: #f1f3ef; padding: 9px 11px; border-radius: 10px; font-size: 12px; }
dialog { border: 0; border-radius: 22px; padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.2); width: min(520px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); overflow: auto; }
dialog::backdrop { background: rgba(10,15,10,.28); backdrop-filter: blur(3px); }
#targetForm { padding: 28px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; }
.icon-button { border: 0; background: #f2f3f1; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
.form-grid label { color: var(--muted); font-size: 12px; display: grid; gap: 7px; }
.form-grid input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.dialog-total { padding: 12px 0 18px; color: var(--muted); }
.full { width: 100%; }
.mobile-nav { display: none; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.chart-empty { min-height: 150px; display: grid; place-content: center; gap: 7px; text-align: center; color: var(--muted); font-size: 12px; }
.chart-empty span { color: var(--accent); font-size: 26px; line-height: 1; }

/* The mark is a single clear financial path, ending in a highlighted present point. */
.brand-mark { overflow: hidden; }.brand-mark svg { width: 19px; height: 19px; }

@media (max-width: 1000px) {
  .csp-grid { grid-template-columns: repeat(2, 1fr); }
  .account-grid { grid-template-columns: repeat(2, 1fr); }
  .tx-row { grid-template-columns: 40px minmax(150px, 1fr) auto 36px; }
}
/* A 768px device has only 538px of usable content with the desktop sidebar.
   Give tablets the full canvas and the touch navigation instead of allowing
   adjacent dashboard cards to overlap their controls. */
@media (min-width: 761px) and (max-width: 1000px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 30px 28px 118px; max-width: none; }
  .hero-grid, .loading-skeleton, .investment-focus-grid { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 20; left: 18px; right: 18px; bottom: 14px; height: 66px; border: 1px solid var(--line); border-radius: 20px; padding: 7px; background: rgba(255,255,255,.92); box-shadow: 0 10px 35px rgba(0,0,0,.1); backdrop-filter: blur(18px); display: grid; grid-template-columns: repeat(5, 1fr); }
  .mobile-nav button { display: grid; place-items: center; gap: 3px; border: 0; border-radius: 14px; color: var(--muted); background: transparent; font-weight: 600; }
  .mobile-nav button span { font-size: 10px; }
  .mobile-nav button.active { color: var(--ink); background: #f3f5f1; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 24px 16px 132px; }
  .topbar { align-items: flex-start; }
  .top-actions { align-items: stretch; }
  #connectButton { width: 44px; font-size: 0; padding: 0; }
  #connectButton::after { content: '+'; font-size: 22px; }
  .hero-grid, .spending-head { grid-template-columns: 1fr; }
  .networth-insights { grid-template-columns: 1fr; }
  .split-card { grid-template-columns: 1fr 1px 1fr; gap: 18px; }
  .divider { width: 1px; height: auto; }
  .networth-card { min-height: 290px; }
  .line-chart { height: 132px; }
  .csp-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .csp-card { padding: 15px; }
  .csp-target-amount { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .accounts-summary { margin-bottom: 18px; }
  .account-preview-summary { grid-template-columns: 1fr; }
  .account-preview-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .account-preview-item:last-child { border-bottom: 0; }
  .range-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .transaction-toolbar { align-items: center; padding: 12px; }
  .transaction-toolbar .range-control button { padding: 5px 6px; }
  .search { width: 120px; }
  .tx-row { grid-template-columns: 38px minmax(0, 1fr) auto 32px; gap: 10px; padding: 12px; }
  .tx-icon { width: 36px; height: 36px; border-radius: 11px; }
  .bucket-select { max-width: 90px; }
  .mobile-nav { position: fixed; z-index: 20; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 66px; border-radius: 20px; padding: 7px; background: rgba(255,255,255,.92); backdrop-filter: blur(18px); border: 1px solid var(--line); box-shadow: 0 10px 35px rgba(0,0,0,.1); display: grid; grid-template-columns: repeat(5, 1fr); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); border-radius: 14px; display: grid; justify-items: center; align-content: center; gap: 3px; }
  .mobile-nav button span { font-size: 10px; }
  .mobile-nav button.active { color: var(--ink); background: #f3f5f1; }
}
@media (max-width: 460px) {
  .auth-screen { padding: 18px; }.auth-card { padding: 27px 23px; border-radius: 24px; }.auth-brand { margin-bottom: 30px; }.auth-preview { min-height: 136px; margin: 24px 0 21px; }
  h1 { font-size: 26px; }
  .topbar { gap: 10px; }
  input[type="month"] { max-width: 145px; }
  .hero-number { font-size: 44px; }
  .metric { font-size: 24px; }
  .csp-grid { grid-template-columns: 1fr; }
  .section-heading { margin-top: 28px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* v2 refinements */
.positive { color: var(--accent) !important; }
.negative { color: var(--danger) !important; }

.chart-context { min-height: 17px; margin-top: 8px; color: var(--muted); font-size: 11px; }
/* Scrub metadata must reserve its line even before a point is selected;
   otherwise toggling it moves the chart under a stationary pointer. */
#netWorthChartContext.hidden, #investmentChartContext.hidden { display: block !important; visibility: hidden; }
.line-chart { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }.line-chart *, .portfolio-chart, .portfolio-chart * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
.scrub-line { stroke: #aab0aa; stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; transition: opacity .12s ease; }
.chart-unavailable { fill: var(--line); opacity: .46; }.chart-unavailable-label { fill: var(--muted); font-size: 10px; font-weight: 650; }
.chart-unavailable-line { stroke: var(--line); stroke-width: 2; stroke-dasharray: 3 5; stroke-linecap: round; }.chart-start-line { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }.chart-start-point { fill: var(--card); stroke: var(--accent); stroke-width: 4; }.chart-start-value { fill: var(--ink); font-size: 11px; font-weight: 720; }.chart-start-detail { fill: var(--muted); font-size: 10px; font-weight: 600; }
/* Keep selected-date metadata in its own reserved line. Making it an
   overlay caused it to collide with the chart's top Y-axis label. */
.networth-card .chart-context { pointer-events: none; }
.scrub-dot { fill: #fff; stroke: var(--accent); stroke-width: 3; opacity: 0; transition: opacity .12s ease; vector-effect: non-scaling-stroke; }
.scrub-line.visible, .scrub-dot.visible { opacity: 1; }
.chart-tooltip { position: absolute; top: 4px; transform: translateX(-50%); pointer-events: none; background: rgba(23,26,23,.92); color: white; padding: 6px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.chart-grid { stroke: #e8ece7; stroke-width: 1; }.chart-axis-label { fill: #7b827a; font-size: 10px; font-weight: 600; }
.networth-separator { color: var(--muted); }

.target-caption { display: none; }
.target-breakdown { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0; }
.target-item { display: grid; justify-items: center; gap: 2px; padding: 5px 2px; color: var(--muted); font-size: 10px; text-align: center; }
.target-item strong { color: var(--ink); font-size: 14px; }

.account-group-block + .account-group-block { border-top: 1px solid var(--line); }
.account-group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px 8px; background: #fbfcfa; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.account-group-head span:last-child { font-size: 12px; letter-spacing: 0; }
.account-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.account-collection { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.account-collection-head { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 15px 14px 12px; list-style: none; }
.account-collection-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.account-collection-icon svg { width: 19px; height: 19px; }
.account-collection.debt .account-collection-icon { background: #f8eeee; color: var(--danger); }
.account-collection-head h2 { margin: 0; font-size: 17px; }
.account-collection-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.account-collection-total { display: grid; justify-items: end; gap: 2px; padding-right: 16px; font-variant-numeric: tabular-nums; }.account-collection-total span { color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }.account-collection-total strong { font-size: 14px; }
.account-collection-items { display: grid; }
.account-group-more { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 11px 14px; background: #fbfcfa; color: var(--accent); text-align: left; font-size: 12px; font-weight: 700; }.account-group-more:hover { background: var(--accent-soft); }
.account-item { display: flex; align-items: flex-start; gap: 11px; padding: 15px 16px; }
.account-item + .account-item { border-top: 1px solid var(--line); }
.institution-logo, .institution-fallback { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; object-fit: contain; overflow: hidden; }
.institution-logo { padding: 3px; }
.institution-fallback { color: #68726a; background: #f7f9f6; }
.institution-fallback svg { width: 18px; height: 18px; }
.account-copy { min-width: 0; flex: 1; }
.account-item .account-name { font-size: 14px; font-weight: 690; }
.account-item .account-inst { margin-top: 2px; font-size: 11px; }
.account-inline-balance { margin-top: 8px; font-size: 17px; font-weight: 740; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.account-rename { align-self: center; width: 29px; height: 29px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 16px; opacity: .58; }.account-item:hover .account-rename, .account-rename:focus-visible { opacity: 1; }.account-rename:hover { border-color: var(--line); background: #f7f9f6; color: var(--accent); }
.nickname-dialog { width: min(390px, calc(100vw - 36px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: white; box-shadow: 0 24px 70px rgba(22,34,24,.22); }.nickname-dialog::backdrop { background: rgba(18,27,20,.34); backdrop-filter: blur(3px); }.nickname-dialog form { position: relative; padding: 25px; }.nickname-dialog h2 { margin: 5px 0 7px; font-size: 24px; letter-spacing: -.04em; }.nickname-dialog p { margin: 0 0 19px; color: var(--muted); font-size: 13px; line-height: 1.5; }.nickname-dialog input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px; outline: none; color: var(--ink); background: #fbfcfa; }.nickname-dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }.dialog-close { position: absolute; top: 15px; right: 16px; width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 22px; line-height: 1; }.dialog-close:hover { background: #f2f4f0; }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }.dialog-actions button { border: 0; padding: 9px 12px; border-radius: 10px; font-weight: 700; }.dialog-actions .secondary { border: 1px solid var(--line); }
.connections-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.58); }
.connections-panel summary { padding: 13px 15px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 680; }
.connections-panel[open] summary { border-bottom: 1px solid var(--line); }
.connection-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px; }
.connection-row + .connection-row { border-top: 1px solid var(--line); }
.connection-actions { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }.reconnect-button { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 9px; padding: 7px 9px; font: inherit; font-size: 11px; font-weight: 750; }
.connection-row > div { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13px; font-weight: 650; }
.connection-logo, .connection-fallback { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: white; object-fit: contain; padding: 2px; }
.connection-fallback { padding: 0; color: var(--muted); background: #f5f7f4; font-size: 12px; }
.connection-status { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }.connection-status.stale, .connection-status.attention { color: #9a6b22; }
.connection-demo-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.unlink-button { border: 0; border-radius: 8px; padding: 6px 8px; color: var(--red); background: var(--red-soft); font-size: 11px; font-weight: 700; }
.unlink-button:disabled { opacity: .55; }
.profile-button { height: 38px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 19px; padding: 0 11px; background: white; color: var(--muted); font-size: 15px; }.profile-button b { font-size: 12px; }
.topbar #monthLabel { display: none; }
.profile-connect { margin: -6px 8px 16px 0; }
.appearance-setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 18px 20px; }.appearance-setting p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }.theme-toggle { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }.theme-toggle input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }.theme-toggle i { position: relative; width: 38px; height: 23px; border: 1px solid #cfd8d0; border-radius: 99px; background: #e8ede8; pointer-events: none; transition: background .18s ease, border-color .18s ease; }.theme-toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(18,28,20,.2); transition: transform .18s ease; }.theme-toggle input:checked + i { border-color: var(--accent); background: var(--accent); }.theme-toggle input:checked + i::after { transform: translateX(15px); }.theme-toggle input:focus-visible + i { outline: 3px solid rgba(77,155,104,.32); outline-offset: 3px; }

/* Paired bars make income and spending directly comparable without occlusion. */
.trend-key i, .trend-detail i { width: 8px; height: 8px; border-radius: 3px; }.trend-detail .income { background: #5b9a70; }.trend-detail .spend { background: #c87862; }.trend-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; min-height: 30px; margin-top: 15px; color: var(--muted); font-size: 11px; }.trend-detail > span { flex-basis: 100%; font-weight: 680; }.trend-detail strong, .trend-detail b { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 12px; }.trend-detail b { margin-left: auto; }.spending-trend { margin-top: 6px; }.trend-bars { position: static; display: flex; align-items: end; justify-content: center; gap: 3px; width: min(36px, 100%); height: 100%; }.trend-bar { position: static; display: block; width: calc(50% - 2px); min-height: 0; border-radius: 6px 6px 2px 2px; }.trend-bar.income { z-index: auto; inset-inline: auto; background: #5b9a70; opacity: .82; }.trend-bar.spending { z-index: auto; left: auto; width: calc(50% - 2px); background: #c87862; }.trend-column.active .trend-bar.income, .trend-column:hover .trend-bar.income { background: #287143; opacity: 1; }.trend-column.active .trend-bar.spending, .trend-column:hover .trend-bar.spending { background: #aa4f42; }

/* Investments: lead with a calm portfolio picture, then reveal detail on demand. */
.portfolio-card { padding: 24px; }.portfolio-total { margin-top: 8px; font-size: clamp(38px, 5vw, 58px); font-weight: 760; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }.portfolio-chart { height: 190px; margin-top: 17px; touch-action: pan-y; user-select: none; }.portfolio-chart svg { width: 100%; height: 100%; display: block; }.investment-focus-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr); gap: 16px; margin-top: 16px; }.allocation-card, .investment-card { padding: 21px; }.allocation-visual { display: flex; align-items: center; gap: 26px; min-height: 210px; margin-top: 8px; }.investment-donut { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 158px; aspect-ratio: 1; border-radius: 50%; }.investment-donut::before { content: ''; position: absolute; inset: 25px; border-radius: 50%; background: white; }.investment-donut span { position: relative; z-index: 1; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.3; }.investment-allocation { display: grid; width: 100%; gap: 3px; }.investment-allocation-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; width: 100%; padding: 8px 7px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; font-size: 12px; }.investment-allocation-row:hover, .investment-allocation-row.active { background: var(--accent-soft); }.investment-allocation-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }.investment-allocation-row:first-child i { opacity: 0; }.investment-allocation-row small { color: var(--muted); }.investment-allocation-row strong { font-size: 12px; font-variant-numeric: tabular-nums; }.investment-accounts { margin-top: 12px; }.investment-account-row { padding: 13px 0; }.holdings-card { margin-top: 16px; overflow: hidden; }.holdings-card summary { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 720; }.holdings-card summary::-webkit-details-marker { display: none; }.holdings-card summary small { color: var(--muted); font-size: 12px; font-weight: 600; }.holdings-card[open] summary { border-bottom: 1px solid var(--line); }.holdings-controls { padding: 13px 18px; background: #fbfcfa; border-bottom: 1px solid var(--line); }.holdings-controls select { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: white; color: var(--ink); font-size: 12px; }.position-row { padding: 14px 18px; }.position-value { display: grid; justify-items: end; gap: 3px; min-width: 0; }.position-value small { font-size: 11px; white-space: nowrap; }.income-transaction .transaction-plan b { color: var(--accent); }
@media (max-width: 760px) { .investment-focus-grid { grid-template-columns: 1fr; }.allocation-visual { gap: 18px; }.investment-donut { width: 138px; }.portfolio-chart { height: 168px; } }
@media (max-width: 420px) { .allocation-visual { align-items: flex-start; flex-direction: column; }.investment-donut { width: 150px; }.investment-allocation { margin-bottom: 4px; } }
.position-class-select { width: max-content; max-width: 100%; margin-top: 6px; border: 0; padding: 0; color: var(--muted); background: transparent; font: inherit; font-size: 11px; cursor: pointer; }.position-class-select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; border-radius: 3px; }

/* A visual focal point for the portfolio, without adding a decorative dashboard. */
.portfolio-card { position: relative; overflow: hidden; border-color: #dce9df; background: linear-gradient(135deg, #f6fbf7 0%, #fff 54%); box-shadow: 0 16px 40px rgba(31,111,74,.08); }.portfolio-card::after { content: ''; position: absolute; width: 250px; height: 250px; right: -100px; top: -145px; border-radius: 50%; background: radial-gradient(circle, rgba(54,136,88,.17) 0, rgba(54,136,88,0) 70%); pointer-events: none; }.portfolio-card > * { position: relative; z-index: 1; }.portfolio-total { color: #155a39; }.portfolio-chart { position: relative; border-top: 1px solid rgba(31,111,74,.11); padding-top: 12px; }.allocation-card { border-color: #e0e9df; }.investment-donut { box-shadow: inset 0 0 0 1px rgba(23,26,23,.03), 0 12px 27px rgba(38,74,48,.10); }.investment-donut::after { content: ''; position: absolute; inset: -7px; border: 1px solid rgba(31,111,74,.12); border-radius: inherit; pointer-events: none; }.investment-allocation-row { transition: background .16s ease, transform .16s ease; }.investment-allocation-row:hover { transform: translateX(2px); }.investment-card { background: linear-gradient(150deg, #fff 0%, #fafcf9 100%); }.investment-card .card-label { color: #526657; }.holdings-card summary { transition: background .16s ease; }.holdings-card summary:hover { background: #f7faf7; }
.portfolio-snapshot { min-height: 150px; display: flex; align-items: center; gap: 15px; padding: 18px 4px; }.portfolio-snapshot-mark { display: grid; flex: 0 0 auto; width: 47px; height: 47px; place-items: center; border-radius: 15px; color: var(--accent); background: var(--accent-soft); font-size: 23px; }.portfolio-snapshot strong { font-size: 15px; letter-spacing: -.015em; }.portfolio-snapshot p { max-width: 370px; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.investment-donut, .spending-donut { cursor: pointer; }.investment-donut span { display: grid; gap: 3px; padding: 0 14px; }.investment-donut span strong { color: var(--ink); font-size: 16px; letter-spacing: -.045em; line-height: 1.1; }.investment-donut span small { color: var(--muted); font-size: 10px; line-height: 1.25; }.spending-donut span small { max-width: 94px; margin-top: 2px; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.15; }.investment-donut:focus-visible, .spending-donut:focus-visible { outline: 3px solid rgba(31,111,74,.28); outline-offset: 4px; }
.demo-setting, .beta-help { margin-top: 16px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }.demo-setting p, .beta-help p { margin: 5px 0 0; max-width: 500px; color: var(--muted); font-size: 13px; line-height: 1.45; }.demo-toggle, .beta-help .secondary { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-weight: 700; text-decoration: none; }
.data-controls { margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.58); }.data-controls summary { padding: 13px 15px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 680; }.data-controls[open] summary { border-bottom: 1px solid var(--line); }.data-controls > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 15px; }.data-controls p { flex-basis: 100%; margin: 0 0 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }.data-controls button { border-radius: 9px; padding: 8px 10px; font-size: 12px; font-weight: 680; }.danger-button { color: var(--red); }
.spending-hero-card { padding: 24px; }.spending-total { margin-top: 8px; font-size: clamp(40px, 5vw, 60px); font-weight: 760; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }.spending-context { margin: 8px 0 0; color: var(--muted); font-size: 13px; }.spending-visual-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }.spending-mix-card, .spending-trend-card { padding: 22px; }.spending-mix-content { display: flex; align-items: center; gap: 28px; min-height: 218px; }.spending-donut { width: 164px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; position: relative; }.spending-donut::before { content: ''; position: absolute; inset: 25px; border-radius: 50%; background: white; }.spending-donut span { position: relative; z-index: 1; display: grid; text-align: center; color: var(--muted); font-size: 11px; }.spending-donut strong { color: var(--ink); font-size: 24px; letter-spacing: -.04em; }.spending-legend { display: grid; width: 100%; gap: 10px; }.legend-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }.legend-row i { width: 8px; height: 8px; border-radius: 50%; }.legend-row strong { font-variant-numeric: tabular-nums; }.spending-trend-card { margin-top: 16px; }.trend-key { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 650; }.trend-key span { display: inline-flex; align-items: center; gap: 5px; }.trend-key i { width: 8px; height: 8px; border-radius: 3px; }.trend-key .income { background: #5b9a70; }.trend-key .spend { background: #c87862; }.spending-trend { height: 170px; display: flex; align-items: end; gap: 9px; margin-top: 18px; padding-top: 14px; }.trend-column { height: 100%; min-width: 22px; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; border: 0; background: transparent; padding: 0; }.trend-bars { position: relative; width: min(32px, 100%); height: 100%; }.trend-bar { position: absolute; bottom: 0; border-radius: 7px 7px 3px 3px; transition: background .15s ease, opacity .15s ease; }.trend-bar.income { z-index: 1; inset-inline: 0; background: #5b9a70; opacity: .68; }.trend-bar.spending { z-index: 2; left: 16%; width: 68%; background: #c87862; }.trend-column.active .trend-bar.income, .trend-column:hover .trend-bar.income { background: #287143; opacity: .9; }.trend-column.active .trend-bar.spending, .trend-column:hover .trend-bar.spending { background: #aa4f42; }.spending-empty { color: var(--muted); font-size: 13px; line-height: 1.5; }
.spending-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 12px; font-weight: 650; }.spending-summary span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }.spending-summary .income-flow { color: var(--accent); }.spending-summary .spend-flow { color: #ae5547; }.spending-summary .save-flow, .spending-summary .retirement-flow { color: var(--muted); }.spending-summary .negative { color: var(--danger); }.spending-summary i { width: 7px; height: 7px; border-radius: 3px; background: #5b9a70; }.spending-summary .spend-flow i { background: #c87862; }.spending-summary .save-flow i { background: var(--save-invest); }.spending-summary .retirement-flow i { background: #8391ae; }.spending-summary small { color: var(--muted); font-size: 10px; font-weight: 600; }.spending-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.cashflow-headline { margin-top: 1px; color: var(--accent); font-size: 13px; font-weight: 720; }.cashflow-headline.negative { color: var(--danger); }
.cashflow-visual-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--muted); font-size: 11px; font-weight: 650; }.cashflow-payroll { display: flex; width: 100%; align-items: center; gap: 11px; margin-top: 13px; padding: 11px 13px; border: 1px solid #dce3ec; border-radius: 13px; color: inherit; background: #f8fafc; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }.cashflow-payroll:hover { border-color: #b9c8d8; background: #f4f7fb; transform: translateY(-1px); }.cashflow-payroll:focus-visible { outline: 3px solid color-mix(in srgb, var(--save-invest) 32%, transparent); outline-offset: 3px; }.cashflow-payroll-mark { display: grid; flex: 0 0 auto; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: #e9edf5; color: var(--save-invest); font-size: 17px; font-weight: 800; }.cashflow-payroll div { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; min-width: 0; }.cashflow-payroll span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .07em; }.cashflow-payroll strong { color: var(--ink); font-size: 15px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }.cashflow-payroll p { grid-column: 1 / -1; margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }.cashflow-payroll-chevron { margin-left: auto; color: var(--muted); font-size: 22px; font-style: normal; line-height: 1; }html[data-theme="dark"] .cashflow-payroll { border-color: #39414c; background: #20241f; }html[data-theme="dark"] .cashflow-payroll:hover { border-color: #505c6c; background: #252b28; }html[data-theme="dark"] .cashflow-payroll-mark { background: #28303a; }
.cashflow-sankey { height: 232px; margin-top: 18px; padding-top: 14px; overflow: hidden; border-top: 1px solid var(--line); }.cashflow-sankey svg { width: 100%; height: 100%; display: block; overflow: visible; }.cashflow-label { fill: #6e766f; font-size: 11px; font-weight: 700; }.cashflow-value { fill: #202420; font-size: 12px; font-weight: 760; }.cashflow-share { fill: #7b827b; font-size: 9px; font-weight: 700; }.cashflow-target { cursor: pointer; }.cashflow-target:hover rect { filter: brightness(.94); }.cashflow-target:hover .cashflow-label { fill: var(--accent); }
.cashflow-sankey:fullscreen { box-sizing: border-box; width: min(1100px, 100vw); height: min(680px, 100vh); padding: 42px; background: var(--card); border: 0; }.cashflow-sankey:fullscreen svg { height: 100%; }
.cashflow-dialog { width: min(980px, calc(100vw - 24px)); height: min(680px, calc(100vh - 24px)); border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); padding: 0; }.cashflow-dialog::backdrop { background: rgba(17,22,18,.5); }.cashflow-dialog header { display:flex; justify-content:space-between; align-items:center; padding:16px 18px; font-weight:750; }.cashflow-dialog #cashflowDialogContent { height:calc(100% - 60px); overflow:auto; padding:0 12px 12px; }.cashflow-dialog svg { width:100%; height:auto; min-height:320px; display:block; }
@media (max-width: 460px) { .cashflow-sankey { height: 116px; }.cashflow-label, .cashflow-value { font-size: 9px; } }
.cashflow-target:focus-visible rect:first-child { stroke: var(--accent); stroke-width: 2px; }

/* The flow is the primary category visual, so it earns enough space to read. */
.cashflow-sankey { height: 232px; margin-top: 18px; padding-top: 14px; }
.cashflow-label { font-size: 11px; font-weight: 700; }.cashflow-value { font-size: 12px; font-weight: 760; }
@media (max-width: 460px) { .cashflow-sankey { height: 218px; }.cashflow-label { font-size: 10px; }.cashflow-value { font-size: 11px; } }
.spending-transactions { scroll-margin-top: 16px; }
.recurring-card { margin-top: 16px; overflow: hidden; }.recurring-card summary { display: flex; justify-content: space-between; padding: 17px 21px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 720; }.recurring-card summary::-webkit-details-marker { display: none; }.recurring-card summary small { color: var(--muted); font-size: 11px; font-weight: 650; }.recurring-card[open] summary { border-bottom: 1px solid var(--line); }.recurring-card button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 21px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; cursor: pointer; }.recurring-card button:last-child { border-bottom: 0; }.recurring-card button:hover { background: var(--accent-soft); }.recurring-card span { display: grid; gap: 3px; min-width: 0; }.recurring-card small { color: var(--muted); font-size: 11px; }.recurring-card strong { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Compare two equal-width bars rather than disguising one as an overlay. */
.trend-bars { display: flex; align-items: end; gap: 3px; width: min(34px, 100%); }
.trend-bar { position: relative; bottom: auto; flex: 1 1 0; min-width: 0; }
.trend-bar.income { inset-inline: auto; opacity: .78; }
.trend-bar.spending { left: auto; width: auto; }

/* The monthly view deliberately uses one diverging bar per month: above the
   baseline means cash left; below means cash outflow exceeded income. */
.spending-trend { display: block; height: 210px; padding: 0; overflow: hidden; }
.spending-trend svg { width: 100%; height: 100%; display: block; overflow: visible; }
.trend-grid { stroke: var(--line); stroke-width: 1; }.trend-grid.zero { stroke: var(--muted); stroke-width: 1.4; }.trend-axis, .trend-month { fill: var(--muted); font-size: 10px; font-weight: 650; }.spending-trend .trend-column { display: inline; cursor: pointer; }.trend-column rect { transition: filter .15s ease, stroke .15s ease; }.trend-column:hover rect { filter: brightness(.9); }.trend-column.active rect, .trend-column:focus-visible rect { stroke: var(--ink); stroke-width: 2px; }

/* Holdings begin as a short portfolio preview; per-holding settings stay tucked
   behind the row a person intentionally opens. */
.holdings-card { margin-top: 16px; overflow: hidden; }
.holdings-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 19px 20px 14px; }.holdings-head .spending-context { margin-bottom: 0; }.holdings-head select { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: white; color: var(--ink); font-size: 12px; }
.holdings-list { border-top: 1px solid var(--line); }.holding-row { display: block; border-bottom: 1px solid var(--line); }.holding-row summary { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 12px; align-items: center; gap: 11px; padding: 13px 20px; cursor: pointer; list-style: none; }.holding-row summary::-webkit-details-marker { display: none; }.holding-row summary::after { content: '›'; grid-column: 4; grid-row: 1; justify-self: end; color: var(--muted); font-size: 18px; transition: transform .16s ease; }.holding-row[open] summary::after { transform: rotate(90deg); }.holding-copy { display: grid; min-width: 0; gap: 3px; }.holding-copy strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }.holding-copy span { overflow: hidden; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }.holding-row .position-value { margin-right: 0; }.holding-detail { display: flex; align-items: center; min-height: 44px; margin: -2px 20px 12px 73px; padding: 9px 10px; border-radius: 9px; background: #f7faf7; color: var(--muted); font-size: 12px; }.holding-detail label { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }.holding-detail select { max-width: 190px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: white; color: var(--ink); font-size: 12px; }.holdings-more { width: 100%; padding: 13px 20px; border: 0; background: #fbfcfa; color: var(--accent); font-size: 13px; font-weight: 650; text-align: left; }.holdings-more:hover { background: var(--accent-soft); }
@media (max-width: 560px) { .holdings-head { align-items: center; padding-inline: 16px; }.holdings-head .spending-context { display: none; }.holding-row summary { padding-inline: 16px; }.holding-detail { margin-left: 61px; margin-right: 16px; }.holdings-more { padding-inline: 16px; } }

.holding-row .position-symbol { width: 42px; height: 36px; font-size: 9px; font-weight: 700; letter-spacing: -.04em; }.holding-ticker { color: var(--ink); font-size: 15px !important; font-weight: 600 !important; letter-spacing: -.02em; }.holding-weight { display: flex; align-items: center; gap: 7px; margin-top: 5px; }.holding-weight > i { display: block; width: min(86px, 100%); height: 5px; overflow: hidden; border-radius: 99px; background: #e4ebe4; }.holding-weight > i b { display: block; height: 100%; border-radius: inherit; background: var(--accent); }.holding-weight > span { color: var(--muted); font-size: 10px; font-weight: 650; }.holding-detail { display: grid; align-items: start; gap: 3px; }.holding-detail > strong { color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.35; }.holding-detail > span { color: var(--muted); font-size: 11px; }.holding-detail label { margin-top: 5px; }
.holding-account-list { display: grid; width: 100%; margin-top: 7px; overflow: hidden; border: 1px solid #e1e7e1; border-radius: 8px; background: white; }.holding-account { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 9px; }.holding-account + .holding-account { border-top: 1px solid #e8ede8; }.holding-account > div { display: grid; min-width: 0; gap: 1px; }.holding-account span { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }.holding-account small { color: var(--muted); font-size: 10px; }.holding-account b { font-size: 11px; font-variant-numeric: tabular-nums; }.holding-account select { max-width: 128px; padding: 5px 6px; font-size: 11px; }
.unclassified-account-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px 20px; border-bottom: 1px solid var(--line); }.unclassified-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--muted); background: #edf1ed; font-size: 16px; font-weight: 750; }.unclassified-account-row > div:nth-child(2), .unclassified-actions { display: grid; min-width: 0; gap: 3px; }.unclassified-actions { justify-items: end; }.unclassified-account-row strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.unclassified-account-row span { color: var(--muted); font-size: 11px; line-height: 1.35; }.unclassified-account-row b { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }.manual-holding-button, .manual-holding-remove { border: 0; border-radius: 7px; padding: 5px 7px; color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }.manual-holding-remove { color: var(--muted); background: #edf1ed; }.manual-holding-button:hover, .manual-holding-remove:hover { filter: brightness(.96); }.manual-holding-controls { display: grid; justify-items: end; gap: 4px; }.manual-holding-controls select { max-width: 128px; padding: 5px 6px; font-size: 11px; }
.manual-holding-dialog label { display: grid; gap: 5px; margin-top: 12px; color: var(--muted); font-size: 11px; font-weight: 650; }.manual-holding-dialog input, .manual-holding-dialog select { box-sizing: border-box; width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; color: var(--ink); background: #fbfcfa; font: inherit; font-weight: 500; }.manual-holding-dialog select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#manualAccountDialog label, #goalDialog label { display: grid; gap: 5px; margin-top: 12px; color: var(--muted); font-size: 11px; font-weight: 650; }#manualAccountDialog input, #manualAccountDialog select, #goalDialog input, #goalDialog select { box-sizing: border-box; width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; color: var(--ink); background: #fbfcfa; font: inherit; font-weight: 500; }

/* Shared interaction and hierarchy rules: content leads, controls support it. */
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(31,111,74,.24); outline-offset: 2px; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; }.nav-item .nav-icon { color: #778078; }.nav-item.active .nav-icon { color: var(--accent); }
.profile-button { width: 38px; padding: 0; justify-content: center; color: #5e685f; }.profile-button svg { width: 18px; height: 18px; }.profile-button:hover { color: var(--accent); border-color: #c8d9ca; background: #f8fbf8; }
.card-label { font-size: 11px; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }.spending-context { font-size: 12px; line-height: 1.45; }
.topbar { margin-bottom: 24px; }.topbar h1 { letter-spacing: -.045em; }.card { box-shadow: 0 8px 26px rgba(30,38,31,.045); }.card-top { align-items: flex-start; }
.split-card .metric, .accounts-summary strong { font-weight: 680; }.accounts-summary { border-radius: 18px; }.account-collection { border-radius: 18px; box-shadow: 0 6px 20px rgba(30,38,31,.04); }
@media (max-width: 760px) { .mobile-nav .nav-icon { width: 19px; height: 19px; }.mobile-nav button { font-weight: 600; }.mobile-nav button.active .nav-icon { color: var(--accent); }.topbar { margin-bottom: 20px; }.card-label { font-size: 10px; }.spending-context { font-size: 11px; }.profile-button { width: 40px; height: 40px; border-radius: 50%; }.accounts-summary div { padding: 14px 12px; }.accounts-summary strong { font-size: 19px; } }

.retirement-hero { padding: 24px; overflow: hidden; border-color: #dce9df; background: linear-gradient(135deg, #f5faf6 0%, #fff 62%); }.retirement-total, .retirement-spend-number { margin-top: 8px; font-size: clamp(36px, 5vw, 56px); font-weight: 760; letter-spacing: -.055em; font-variant-numeric: tabular-nums; color: #155a39; }.retirement-age-chip, .retirement-assumption { align-self: flex-start; padding: 7px 10px; border-radius: 99px; background: #e8f3ec; color: var(--accent); font-size: 11px; font-weight: 700; white-space: nowrap; }.retirement-path { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 24px; }.retirement-milestone { display: grid; gap: 5px; padding: 13px; border: 1px solid #e3eae3; border-radius: 13px; background: rgba(255,255,255,.8); color: var(--ink); text-align: left; }.retirement-milestone.featured { border-color: #bcd6c2; background: white; box-shadow: 0 8px 18px rgba(31,111,74,.08); }.retirement-milestone span, .retirement-milestone small { color: var(--muted); font-size: 10px; font-weight: 650; }.retirement-milestone strong { font-size: 16px; letter-spacing: -.03em; }.retirement-milestone i { height: 5px; overflow: hidden; border-radius: 99px; background: #e5ebe5; }.retirement-milestone i b { display: block; height: 100%; border-radius: inherit; background: var(--accent); }.retirement-spend { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 21px 24px; }.retirement-spend-number { font-size: 30px; color: var(--ink); }.retirement-adjust { margin-top: 16px; overflow: hidden; }.retirement-adjust summary { display: flex; justify-content: space-between; padding: 18px 20px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 700; }.retirement-adjust summary::-webkit-details-marker { display: none; }.retirement-adjust summary small { color: var(--muted); font-size: 11px; font-weight: 600; }.retirement-adjust > p { margin: 0; padding: 0 20px 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }.retirement-form { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 10px; padding: 14px 20px 20px; border-top: 1px solid var(--line); background: #fbfcfa; }.retirement-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 650; }.retirement-form input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px; background: white; color: var(--ink); }.retirement-form .primary { align-self: end; white-space: nowrap; }
@media (max-width: 760px) { .mobile-nav { grid-template-columns: repeat(5, 1fr); }.mobile-nav button span { font-size: 9px; }.retirement-path { grid-template-columns: repeat(2, 1fr); }.retirement-spend { align-items: flex-start; flex-direction: column; gap: 8px; }.retirement-assumption { align-self: auto; }.retirement-form { grid-template-columns: 1fr 1fr; }.retirement-form .primary { grid-column: 1 / -1; } }
@media (max-width: 560px) { .holding-detail { margin-left: 73px; } }
.legend-row { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }.legend-row:hover { color: var(--accent); }.spending-transactions { margin-top: 16px; overflow: hidden; }.spending-transactions summary { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; cursor: pointer; font-size: 14px; font-weight: 720; list-style: none; }.spending-transactions summary::-webkit-details-marker { display: none; }.spending-transactions summary small { color: var(--muted); font-size: 12px; font-weight: 600; }.spending-transactions[open] summary { border-bottom: 1px solid var(--line); }.spending-transaction-controls { display: flex; gap: 8px; padding: 14px 18px; background: #fbfcfa; border-bottom: 1px solid var(--line); }.spending-transaction-controls select { border: 1px solid var(--line); border-radius: 9px; background: white; padding: 7px 9px; color: var(--ink); font-size: 12px; }.spending-transaction-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }.spending-transaction-row:last-child { border-bottom: 0; }.spending-transaction-row > div { min-width: 0; display: grid; gap: 3px; }.spending-transaction-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }.spending-transaction-row span { color: var(--muted); font-size: 11px; }.spending-transaction-row b { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }.transaction-plan { max-width: 124px; min-width: 0; }
.allocation-toggle { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: #f0f3ef; }.allocation-toggle button { width: 26px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; }.allocation-toggle button.active { color: var(--ink); background: white; box-shadow: 0 1px 3px rgba(20,30,20,.08); }
.transaction-plan { display: grid; justify-items: end; gap: 5px; }.transaction-plan select { max-width: 120px; border: 0; background: transparent; color: var(--muted); font-size: 11px; text-align-last: right; }

@media (max-width: 760px) {
  .section-heading .eyebrow { display: none; }
  .account-groups { grid-template-columns: 1fr; gap: 8px; }
  .investment-grid { grid-template-columns: 1fr; }
  .spending-visual-grid { grid-template-columns: 1fr; }.spending-mix-content { gap: 18px; }.spending-donut { width: 142px; }
  .target-breakdown { grid-template-columns: 1fr 1fr; }
  #sankey { min-height: 0; }
}

@media (max-width: 460px) {
  .target-breakdown { grid-template-columns: repeat(4, 1fr); }
}

/* Dark mode uses layered charcoal surfaces—not black and white—so the visual
   hierarchy stays quiet and extended reading remains comfortable. */
html[data-theme="dark"] body, html[data-theme="dark"] .auth-screen { background: var(--bg); }
html[data-theme="dark"] .sidebar { background: #151a17; }
html[data-theme="dark"] .nav-item { color: #b5bdb6; }
html[data-theme="dark"] .profile-back:hover { color: var(--ink); background: #252e27; }
html[data-theme="dark"] .nav-item:hover, html[data-theme="dark"] .nav-item.active { background: #222a24; color: var(--ink); }
html[data-theme="dark"] .secondary, html[data-theme="dark"] input, html[data-theme="dark"] select { border-color: var(--line); background: #202720; color: var(--ink); }
html[data-theme="dark"] .mobile-nav { border-color: #303a32; background: rgba(23,29,25,.95); }
html[data-theme="dark"] .mobile-nav button { color: #9da89f; }
html[data-theme="dark"] .mobile-nav button.active { background: #263128; color: var(--ink); }
html[data-theme="dark"] .range-control, html[data-theme="dark"] .allocation-toggle { background: #222a24; }
html[data-theme="dark"] .range-control button.active, html[data-theme="dark"] .allocation-toggle button.active { background: #303b32; color: var(--ink); box-shadow: none; }
html[data-theme="dark"] .retirement-hero, html[data-theme="dark"] .portfolio-card { border-color: #363f38; background: linear-gradient(135deg, #1d221f 0%, #1a201c 62%); }
html[data-theme="dark"] .retirement-milestone, html[data-theme="dark"] .retirement-milestone.featured { border-color: #354239; background: #202820; box-shadow: none; }
html[data-theme="dark"] .retirement-age-chip, html[data-theme="dark"] .retirement-assumption, html[data-theme="dark"] .retirement-info-target { background: #262d28; }
html[data-theme="dark"] .retirement-total, html[data-theme="dark"] .retirement-info-target strong { color: #8bcaa0; }
html[data-theme="dark"] .holding-detail, html[data-theme="dark"] .holding-account-list, html[data-theme="dark"] .holdings-more, html[data-theme="dark"] .spending-transaction-controls, html[data-theme="dark"] .retirement-form { border-color: var(--line); background: #202720; }
html[data-theme="dark"] .holding-account, html[data-theme="dark"] .holding-account-list { background: #1c231e; }
html[data-theme="dark"] .investment-donut::before, html[data-theme="dark"] .spending-donut::before { background: var(--card); }
html[data-theme="dark"] .account-collection, html[data-theme="dark"] .accounts-summary { background: var(--card); }
html[data-theme="dark"] .account-group-more { background: #1e261f; }
html[data-theme="dark"] .institution-logo, html[data-theme="dark"] .institution-fallback, html[data-theme="dark"] .connection-logo, html[data-theme="dark"] .connection-fallback { border-color: var(--line); background: #252d27; }
html[data-theme="dark"] .connections-panel { border-color: var(--line); background: #1a201c; }
html[data-theme="dark"] .data-controls { border-color: var(--line); background: #1a201c; }
html[data-theme="dark"] .theme-toggle i { border-color: #4a554b; background: #303a32; }
html[data-theme="dark"] .theme-toggle i::after { background: #dfe8e0; }
html[data-theme="dark"] dialog, html[data-theme="dark"] .nickname-dialog, html[data-theme="dark"] .retirement-info-dialog { border-color: #374239; background: #1b211d; }
html[data-theme="dark"] .retirement-info-head, html[data-theme="dark"] .retirement-info-footer { border-color: var(--line); background: #202720; }
html[data-theme="dark"] .retirement-info-target { border-color: var(--line); }
html[data-theme="dark"] .dialog-close:hover { background: #2a332c; }
html[data-theme="dark"] .connection-onboarding-dialog { border-color: #374239; background: #1b211d; }html[data-theme="dark"] .onboarding-steps > div { border-color: var(--line); background: #202720; }html[data-theme="dark"] .update-toast { border-color: #3b4b3e; background: #202820; color: var(--ink); }
@media (max-width: 560px) { .appearance-setting { padding-inline: 16px; }.theme-toggle > span { display: none; } }

/* Tapping a milestone teaches the term without making the retirement view denser. */
.retirement-milestone { cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.retirement-milestone:hover { transform: translateY(-2px); border-color: #bcd6c2; box-shadow: 0 8px 18px rgba(31,111,74,.09); }
.retirement-info-dialog { width: min(410px, calc(100vw - 32px)); overflow: hidden; padding: 0; border: 1px solid #dbe4dc; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 20px 60px rgba(22,34,24,.18); }
.retirement-info-dialog::backdrop { background: rgba(25,34,26,.24); backdrop-filter: blur(2px); }
.retirement-info-dialog form { display: grid; }
.retirement-info-head { position: relative; display: flex; align-items: center; min-height: 54px; padding: 0 20px; border-bottom: 1px solid #e8ede8; background: #fbfcfa; }
.retirement-info-head .card-label { color: #607163; }
.retirement-info-head .dialog-close { position: static; margin-left: auto; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 50%; font-size: 20px; }
.retirement-info-head .dialog-close:hover { border-color: var(--line); background: white; color: var(--ink); }
.retirement-info-body { padding: 22px 20px 19px; }
.retirement-info-dialog h2 { margin: 0 0 9px; font-size: 24px; font-weight: 710; letter-spacing: -.045em; }
.retirement-info-dialog #retirementInfoDescription { margin: 0; color: #657067; font-size: 14px; line-height: 1.55; }
.retirement-info-target { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 21px; padding: 13px 0; border-top: 1px solid #e8ede8; border-bottom: 1px solid #e8ede8; }
.retirement-info-target span { color: var(--muted); font-size: 12px; font-weight: 650; }
.retirement-info-target strong { color: #155a39; font-size: 20px; font-weight: 730; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.retirement-info-note { margin: 13px 0 0; color: #7b847c; font-size: 11px; line-height: 1.45; }
.retirement-info-footer { display: flex; justify-content: flex-end; padding: 13px 20px; border-top: 1px solid #e8ede8; background: #fbfcfa; }
.retirement-info-footer .primary { min-width: 88px; padding-block: 9px; border-radius: 10px; }
@media (max-width: 560px) { .retirement-info-dialog { width: min(410px, calc(100vw - 24px)); border-radius: 17px; }.retirement-info-head { padding-inline: 18px; }.retirement-info-body { padding-inline: 18px; }.retirement-info-footer { padding-inline: 18px; }.retirement-info-footer .primary { width: 100%; } }

/* A short post-connection explanation prevents a blank or one-point chart from
   feeling like an error. It appears once, then stays out of the way. */
.connection-onboarding-dialog { width: min(430px, calc(100vw - 30px)); padding: 0; overflow: hidden; border: 1px solid #dbe4dc; border-radius: 20px; color: var(--ink); background: var(--card); box-shadow: 0 24px 70px rgba(22,34,24,.22); }.connection-onboarding-dialog::backdrop { background: rgba(18,27,20,.34); backdrop-filter: blur(3px); }.connection-onboarding-dialog form { padding: 27px; }.connection-onboarding-dialog h2 { margin: 11px 0 8px; font-size: 27px; line-height: 1.04; letter-spacing: -.05em; }.connection-onboarding-dialog p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }.connection-onboarding-mark { display: grid; width: 38px; height: 38px; place-items: center; margin-bottom: 20px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-size: 20px; font-weight: 800; }.onboarding-steps { display: grid; gap: 7px; margin: 21px 0; }.onboarding-steps > div { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #e7ece7; border-radius: 12px; background: #fbfcfa; }.onboarding-steps i { display: grid; flex: 0 0 auto; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-style: normal; font-weight: 750; }.onboarding-steps span { display: grid; gap: 2px; }.onboarding-steps strong { font-size: 12px; }.onboarding-steps small { color: var(--muted); font-size: 11px; line-height: 1.35; }.update-toast { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 15px; border: 1px solid #d9e3da; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 12px 36px rgba(19,30,21,.16); font-size: 12px; font-weight: 650; }.update-toast button { border: 0; border-radius: 9px; padding: 7px 9px; background: var(--accent); color: white; font: inherit; font-size: 11px; font-weight: 750; }@media (max-width: 760px) { .update-toast { right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); left: 14px; justify-content: space-between; }.connection-onboarding-dialog form { padding: 23px 20px; } }

/* Keep component-specific light gradients from punching bright holes through
   the dark palette. These sit last intentionally, after component styles. */
html[data-theme="dark"] .investment-card { border-color: var(--line); background: #1a201c; }
html[data-theme="dark"] .investment-card .card-label { color: #a8b5aa; }
html[data-theme="dark"] .allocation-card { border-color: var(--line); background: var(--card); }
html[data-theme="dark"] .holdings-card summary:hover { background: #222a24; }
html[data-theme="dark"] .retirement-info-dialog { border-color: #374239; background: #1b211d; }
html[data-theme="dark"] .retirement-info-head, html[data-theme="dark"] .retirement-info-footer { border-color: var(--line); background: #202720; }
html[data-theme="dark"] .retirement-info-head .card-label, html[data-theme="dark"] .retirement-info-dialog #retirementInfoDescription, html[data-theme="dark"] .retirement-info-note { color: var(--muted); }
html[data-theme="dark"] .retirement-info-head .dialog-close:hover { background: #2a332c; }

/* In low light, the balance is the visual destination. Chart furniture and
   decorative green stay restrained so they cannot outrank that number. */
html[data-theme="dark"] .portfolio-card { border-color: #363f38; background: linear-gradient(135deg, #1d221f 0%, #1a201c 68%); box-shadow: 0 12px 30px rgba(0,0,0,.14); }
html[data-theme="dark"] .portfolio-card::after { opacity: .28; }
html[data-theme="dark"] .portfolio-card .card-label { color: #aeb9b0; }
html[data-theme="dark"] .portfolio-total { color: #f0f4f0; }
html[data-theme="dark"] .portfolio-card .spending-context, html[data-theme="dark"] .portfolio-card .chart-context { color: #9ba69d; }
html[data-theme="dark"] .portfolio-chart { border-color: rgba(135,174,144,.12); }
html[data-theme="dark"] .chart-grid { stroke: #2d3930; }
html[data-theme="dark"] .chart-axis-label { fill: #889489; }
html[data-theme="dark"] .scrub-line { stroke: #6f7d72; }
html[data-theme="dark"] .scrub-dot { fill: #1a201c; }

/* Full dark-surface audit: interactive controls must never inherit the light
   theme's white surfaces or use the light text token as a background. */
html[data-theme="dark"] .primary { background: #2d744a; color: #f5f8f5; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
html[data-theme="dark"] .primary:hover { background: #368456; }
html[data-theme="dark"] .brand-mark { background: #2d744a; color: #f5f8f5; }
html[data-theme="dark"] .profile-button { border-color: #3a463d; background: #202720; color: #b6c0b8; }
html[data-theme="dark"] .profile-button:hover { border-color: #4c7357; background: #273128; color: #a7d9b4; }
html[data-theme="dark"] .account-preview-group, html[data-theme="dark"] .account-group-head, html[data-theme="dark"] .transaction-toolbar { border-color: var(--line); background: #202720; }
html[data-theme="dark"] .accounts-summary, html[data-theme="dark"] .account-collection { background: var(--card); }
html[data-theme="dark"] .account-type, html[data-theme="dark"] .code-row code, html[data-theme="dark"] .tx-icon { background: #273029; color: #b6c0b8; }
html[data-theme="dark"] .exclude-button { border-color: var(--line); background: #202720; }
html[data-theme="dark"] .exclude-button.active { background: #422b2c; color: var(--danger); }
html[data-theme="dark"] .account-rename:hover { background: #273128; }
html[data-theme="dark"] .sankey-label, html[data-theme="dark"] .cashflow-label { fill: #a7b1a9; }
html[data-theme="dark"] .sankey-value, html[data-theme="dark"] .cashflow-value { fill: #e5ebe6; }
html[data-theme="dark"] .cashflow-share { fill: #a7b1a9; }
html[data-theme="dark"] .cashflow-flow { stroke-opacity: .25; }
html[data-theme="dark"] .auth-screen { background: #111513; }
html[data-theme="dark"] .auth-card { border-color: #344036; background: rgba(26,32,28,.94); box-shadow: 0 28px 72px rgba(0,0,0,.2); }
html[data-theme="dark"] .auth-halo-one { background: radial-gradient(circle, rgba(46,116,74,.24) 0, rgba(46,116,74,0) 68%); }
html[data-theme="dark"] .auth-halo-two { background: radial-gradient(circle, rgba(67,89,69,.2) 0, rgba(67,89,69,0) 69%); }
html[data-theme="dark"] .auth-preview { border-color: #344036; background: linear-gradient(140deg, #1c281f 0%, #1a201c 80%); }
html[data-theme="dark"] .auth-kicker, html[data-theme="dark"] .auth-preview span, html[data-theme="dark"] .auth-divider, html[data-theme="dark"] .auth-note, html[data-theme="dark"] .auth-demo-note { color: var(--muted); }
html[data-theme="dark"] .auth-kicker i { box-shadow: 0 0 0 4px #262d28; }
html[data-theme="dark"] .auth-divider::before, html[data-theme="dark"] .auth-divider::after { background: var(--line); }
html[data-theme="dark"] .demo-preview-button { border-color: #3a493d; background: #202720; color: var(--ink); }
html[data-theme="dark"] .demo-preview-button:hover { border-color: #52735b; background: #273128; }

/* Dark mode is intentionally neutral. Green is a signal for an action or a
   positive financial event—not a wash behind every piece of information. */
html[data-theme="dark"] .card,
html[data-theme="dark"] .account-collection,
html[data-theme="dark"] .accounts-summary,
html[data-theme="dark"] .connections-panel,
html[data-theme="dark"] .data-controls,
html[data-theme="dark"] dialog,
html[data-theme="dark"] .nickname-dialog,
html[data-theme="dark"] .retirement-info-dialog,
html[data-theme="dark"] .auth-card { border-color: #353936; background: #1c1f1d; }
html[data-theme="dark"] .portfolio-card,
html[data-theme="dark"] .retirement-hero { background: #1c1f1d; }
html[data-theme="dark"] .portfolio-card::after { display: none; }
html[data-theme="dark"] .retirement-milestone,
html[data-theme="dark"] .retirement-milestone.featured,
html[data-theme="dark"] .holding-detail,
html[data-theme="dark"] .holding-account,
html[data-theme="dark"] .holding-account-list,
html[data-theme="dark"] .holdings-more,
html[data-theme="dark"] .spending-transaction-controls,
html[data-theme="dark"] .retirement-form,
html[data-theme="dark"] .account-preview-group,
html[data-theme="dark"] .account-group-head,
html[data-theme="dark"] .transaction-toolbar { border-color: #353936; background: #222522; }
html[data-theme="dark"] .auth-halo { display: none; }
/* Public legal pages deliberately use the same quiet visual system as the app. */
.legal-page { width: min(680px, calc(100% - 40px)); margin: clamp(44px, 10vh, 96px) auto; color: var(--ink); line-height: 1.65; }
.legal-page h1 { margin: 16px 0 28px; font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -.055em; }
.legal-page h2 { margin: 32px 0 8px; font-size: 1.05rem; }
.legal-page p { color: var(--muted); }
.legal-page a { color: var(--green); font-weight: 700; }
.legal-kicker, .legal-updated { color: var(--subtle); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.legal-back { text-decoration: none; }
.auth-legal { margin: 14px 0 0; color: var(--subtle); font-size: .78rem; }
.auth-legal a { color: inherit; text-decoration: none; }
.auth-legal a:hover { color: var(--green); }
.auth-legal span { margin: 0 7px; }

/* Retirement is a short path, not a wall of calculator inputs. */
.retirement-ladder-heading { margin-top: 24px; }
.retirement-ladder-heading, .retirement-lifestyles-tools { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }.retirement-ladder-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.retirement-path { margin-top: 12px; }
.retirement-milestone.complete { border-color: #c6dfcc; background: #f8fcf8; }
.retirement-lifestyles { display: grid; gap: 16px; margin-top: 16px; padding: 21px 24px; }
.retirement-lifestyles-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.retirement-lifestyle-paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.retirement-lifestyle { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafcf9; }
.retirement-lifestyle.featured { border-color: #bcd6c2; background: #f5faf6; }
.retirement-lifestyle span, .retirement-lifestyle small { color: var(--muted); font-size: 10px; font-weight: 650; }
.retirement-lifestyle strong { font-size: 18px; letter-spacing: -.035em; }
.retirement-milestone em { color: var(--accent); font-size: 10px; font-style: normal; font-weight: 750; }
.retirement-method { position: relative; flex: 0 0 auto; }.retirement-method summary { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--card); cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }.retirement-method summary::-webkit-details-marker { display: none; }.retirement-method summary:hover { border-color: #a9c2af; color: var(--accent); }.retirement-method > div { position: absolute; z-index: 4; right: 0; bottom: 28px; width: min(300px, calc(100vw - 40px)); padding: 15px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--card); box-shadow: 0 12px 30px rgba(20,30,20,.12); }.retirement-method-popover > strong { display: block; font-size: 12px; }.retirement-method-popover > p { margin: 5px 0 11px; color: var(--muted); font-size: 11px; line-height: 1.4; }.retirement-method-popover ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }.retirement-method-popover li { display: grid; gap: 2px; padding: 8px 9px; border-radius: 9px; background: var(--surface); }.retirement-method-popover li b { font-size: 10px; }.retirement-method-popover li span, .retirement-method-popover > small { color: var(--muted); font-size: 10px; line-height: 1.35; }.retirement-method-popover > small { display: block; margin-top: 10px; }
html[data-theme="dark"] .retirement-lifestyles { background: #1c1f1d; }
html[data-theme="dark"] .retirement-milestone.complete, html[data-theme="dark"] .retirement-lifestyle, html[data-theme="dark"] .retirement-lifestyle.featured { border-color: #353936; background: #222522; }
@media (max-width: 760px) { .retirement-lifestyles-head { align-items: flex-start; flex-direction: column; gap: 8px; }.retirement-lifestyle-paths { grid-template-columns: 1fr; } }
