:root {
  --ink: #18201d;
  --muted: #68716d;
  --paper: #f4f1ea;
  --panel: #fffdf8;
  --line: #dedbd2;
  --green: #173c35;
  --green-soft: #dce7df;
  --mint: #bcd8c8;
  --coral: #dd765f;
  --coral-soft: #f5ded7;
  --sand: #e6c990;
  --sand-soft: #f6ecd5;
  --blue: #6e92a3;
  --blue-soft: #dce8ed;
  --red: #bb5145;
  --shadow: 0 18px 50px rgba(35, 46, 41, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "DM Sans", sans-serif; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(221,118,95,.28); outline-offset: 2px; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 8px; font-size: 11px; line-height: 1; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.eyebrow--green { color: #507168; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--green); text-decoration: none; font-family: "Newsreader", serif; font-size: 23px; font-weight: 600; }
.brand--light { color: #fff9ec; }
.brand-mark { position: relative; width: 32px; height: 25px; display: inline-flex; flex: 0 0 auto; }
.brand-mark i { position: absolute; top: 3px; width: 17px; height: 20px; border: 2px solid currentColor; border-radius: 50% 50% 48% 52%; transform: rotate(-25deg); }
.brand-mark i:first-child { left: 2px; }
.brand-mark i:last-child { right: 2px; transform: rotate(25deg); }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 1.05fr) minmax(440px, .95fr); background: var(--panel); }
.login-brand { min-height: 100vh; padding: clamp(32px, 5vw, 72px); color: #fff9ec; background: var(--green); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 420px; height: 420px; right: -150px; bottom: -145px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); }
.login-copy { margin: auto 0; position: relative; z-index: 1; max-width: 610px; }
.login-copy h1 { font-family: "Newsreader", serif; font-size: clamp(48px, 6vw, 86px); line-height: .94; letter-spacing: -.04em; margin: 0 0 28px; font-weight: 500; }
.login-copy > p:last-child { max-width: 490px; color: rgba(255,249,236,.7); font-size: 17px; line-height: 1.65; }
.login-quote { width: min(380px, 100%); position: relative; z-index: 1; }
.login-quote span, .login-quote small { display: block; color: rgba(255,249,236,.62); font-size: 12px; }
.login-quote strong { display: block; margin: 7px 0 14px; font-size: 16px; }
.quote-progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.17); margin-bottom: 10px; overflow: hidden; }
.quote-progress i { display: block; height: 100%; background: var(--sand); border-radius: inherit; }
.login-panel { display: grid; place-items: center; padding: 40px clamp(24px, 6vw, 90px); }
.login-card { width: min(480px, 100%); }
.mobile-brand { display: none; }
.login-card h2 { font-family: "Newsreader", serif; font-weight: 600; font-size: 42px; letter-spacing: -.025em; margin: 0 0 8px; }
.login-helper { color: var(--muted); margin: 0 0 30px; }
.auth-tabs { margin-bottom: 18px !important; }
.cloud-auth-field { margin-bottom: 15px; }
.signup-only { margin-bottom: 15px; }
.signup-only small { color: var(--muted); font-weight: 400; }
.profile-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.profile-option { position: relative; border: 1px solid var(--line); border-radius: 15px; min-height: 82px; padding: 14px; display: flex; align-items: center; gap: 11px; cursor: pointer; transition: .2s ease; }
.profile-option:hover { transform: translateY(-1px); border-color: #afbbb5; }
.profile-option.is-selected { background: var(--green-soft); border-color: #9cb7a8; }
.profile-option input { position: absolute; opacity: 0; }
.profile-option strong, .profile-option small { display: block; }
.profile-option small { color: var(--muted); margin-top: 3px; font-size: 11px; }
.check-dot { width: 16px; height: 16px; border: 1px solid #aeb5b1; border-radius: 50%; margin-left: auto; }
.profile-option.is-selected .check-dot { border: 5px solid var(--green); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.avatar--renata { background: var(--coral-soft); color: #9e4d3c; }
.avatar--gabriel { background: var(--blue-soft); color: #416979; }
.field { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea, .filter-bar input, .filter-bar select, .month-select select { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 11px; padding: 13px 14px; outline: none; transition: border .2s, box-shadow .2s; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: #8ba99b; box-shadow: 0 0 0 3px rgba(139,169,155,.14); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 56px; }
.icon-button { position: absolute; right: 5px; top: 5px; border: 0; background: transparent; color: var(--green); padding: 8px; font-size: 12px; font-weight: 700; }
.form-error { min-height: 18px; color: var(--red); font-size: 12px; margin: 7px 0; }
.button { min-height: 43px; border-radius: 11px; border: 1px solid transparent; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 13px; transition: transform .18s, background .18s, box-shadow .18s; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--green); color: #fff; box-shadow: 0 6px 18px rgba(23,60,53,.16); }
.button--primary:hover { background: #214b43; }
.button--secondary { background: var(--sand-soft); color: #5d4823; border-color: #ead9b7; }
.button--ghost { background: transparent; border-color: var(--line); }
.button--light { background: #fff8e9; color: var(--green); }
.button--wide { width: 100%; margin-top: 2px; }
.demo-hint { text-align: center; color: var(--muted); font-size: 11px; margin-top: 15px; }

.app-shell { min-height: 100vh; }
.sidebar { width: 245px; height: 100vh; position: fixed; inset: 0 auto 0 0; z-index: 10; padding: 29px 22px 22px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.main-nav { display: grid; gap: 5px; margin-top: 49px; }
.nav-item { border: 0; background: transparent; border-radius: 10px; padding: 12px 13px; display: flex; align-items: center; gap: 12px; font-size: 13px; color: #5c6863; text-align: left; }
.nav-item:hover { background: #f1eee7; color: var(--ink); }
.nav-item.is-active { color: var(--green); background: var(--green-soft); font-weight: 700; }
.nav-icon { width: 21px; font-size: 19px; text-align: center; font-family: Arial, sans-serif; }
.side-goal { margin-top: auto; background: var(--green); color: #fff; border-radius: 15px; padding: 15px; display: flex; gap: 11px; }
.goal-icon { width: 30px; height: 30px; display: grid; place-items: center; background: rgba(255,255,255,.12); border-radius: 50%; }
.side-goal small, .side-goal strong { display: block; }
.side-goal small { color: rgba(255,255,255,.62); font-size: 10px; }
.side-goal strong { margin: 3px 0 8px; font-size: 13px; }
.mini-progress { height: 3px; width: 125px; background: rgba(255,255,255,.16); margin-bottom: 6px; }
.mini-progress i { display: block; height: 100%; width: 62%; background: var(--sand); }
.user-menu { margin-top: 14px; padding: 11px 2px; border: 0; border-top: 1px solid var(--line); background: transparent; display: flex; align-items: center; gap: 10px; text-align: left; }
.user-menu span:nth-child(2) { flex: 1; }
.user-menu strong, .user-menu small { display: block; }
.user-menu strong { font-size: 12px; }
.user-menu small { font-size: 10px; color: var(--muted); margin-top: 2px; }
.user-menu b { color: #89908d; }

.main-content { margin-left: 245px; min-height: 100vh; padding: 0 clamp(24px, 4vw, 58px) 70px; }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 31px; }
.topbar h1 { font-family: "Newsreader", serif; font-size: 30px; margin: 0; font-weight: 600; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.scope-switch { display: flex; gap: 3px; padding: 3px; background: #eae7df; border-radius: 10px; }
.scope-switch button { border: 0; background: transparent; border-radius: 7px; padding: 8px 11px; color: var(--muted); font-size: 10px; font-weight: 700; }
.scope-switch button.is-selected { background: var(--panel); color: var(--green); box-shadow: 0 2px 7px rgba(30,45,39,.08); }
.month-select select { min-width: 160px; background: transparent; padding: 11px 13px; font-size: 12px; font-weight: 600; }
.view { display: none; animation: viewIn .3s ease both; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } }
.balance-hero { min-height: 210px; border-radius: 22px; padding: 31px 36px; background: var(--green); color: #fff; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.balance-main { position: relative; z-index: 1; }
.overline { display: block; font-size: 12px; color: rgba(255,255,255,.63); margin-bottom: 8px; }
.balance-value { display: block; font-family: "Newsreader", serif; font-size: clamp(42px, 5vw, 64px); font-weight: 500; letter-spacing: -.035em; }
.trend-label { display: inline-block; margin-top: 14px; color: #c6dbc9; font-size: 11px; background: rgba(255,255,255,.08); border-radius: 20px; padding: 6px 10px; }
.balance-split { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid rgba(255,255,255,.15); }
.balance-split div { padding: 16px 27px; }
.balance-split div + div { border-left: 1px solid rgba(255,255,255,.15); }
.balance-split span, .balance-split strong { display: block; }
.balance-split span { color: rgba(255,255,255,.6); font-size: 11px; margin-bottom: 6px; }
.balance-split strong { font-size: 20px; }
.hero-decoration { position: absolute; right: -40px; top: -85px; width: 360px; height: 360px; opacity: .55; }
.hero-decoration i { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.hero-decoration i:nth-child(2) { inset: 55px; }
.hero-decoration i:nth-child(3) { inset: 110px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 16px 0; }
.metric-card { min-height: 138px; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 17px; }
.metric-card--highlight { background: var(--sand-soft); border-color: #e5d0a8; }
.metric-top { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.metric-top small { font-size: 11px; }
.metric-icon { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 12px; }
.metric-icon--sand { background: var(--sand-soft); color: #7b5f2b; }
.metric-icon--rose { background: var(--coral-soft); color: #9d5141; }
.metric-icon--blue { background: var(--blue-soft); color: #4e7382; }
.metric-card > strong { display: block; font-size: 22px; margin: 17px 0 6px; }
.metric-card > p { color: var(--muted); font-size: 10px; margin: 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: 16px; margin-bottom: 16px; }
.dashboard-grid--bottom { grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 23px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-heading h2, .section-heading h2, .insight-card h2 { font-family: "Newsreader", serif; font-size: 25px; letter-spacing: -.02em; line-height: 1.1; margin: 0; font-weight: 600; }
.chart-legend { display: flex; gap: 13px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot--income { background: var(--green); }
.dot--expense { background: var(--coral); }
.chart-wrap { width: 100%; min-height: 235px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #e6e2d9; stroke-width: 1; }
.chart-axis-text { fill: #7b837f; font: 10px "DM Sans", sans-serif; }
.chart-area { fill: rgba(23,60,53,.06); }
.chart-line-income { fill: none; stroke: var(--green); stroke-width: 2.5; }
.chart-line-expense { fill: none; stroke: var(--coral); stroke-width: 2.5; }
.chart-point-income { fill: var(--green); stroke: var(--panel); stroke-width: 2; }
.chart-point-expense { fill: var(--coral); stroke: var(--panel); stroke-width: 2; }
.text-button { border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; padding: 5px 0; }
.category-content { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 21px; }
.donut { --donut: conic-gradient(var(--green) 0 38%, var(--coral) 38% 64%, var(--sand) 64% 80%, var(--blue) 80% 91%, #c6c3b9 91% 100%); width: 145px; aspect-ratio: 1; border-radius: 50%; background: var(--donut); display: grid; place-items: center; }
.donut::before { content: ""; grid-area: 1/1; width: 96px; aspect-ratio: 1; border-radius: 50%; background: var(--panel); }
.donut > div { grid-area: 1/1; position: relative; z-index: 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 14px; }
.donut span { color: var(--muted); font-size: 9px; margin-top: 2px; }
.category-list { display: grid; gap: 12px; }
.category-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.category-row > i { width: 7px; height: 7px; border-radius: 50%; }
.category-row small { display: block; color: var(--muted); margin-top: 2px; }
.category-row strong { font-size: 11px; }
.upcoming-list { display: grid; }
.upcoming-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid #e9e5dc; }
.upcoming-item:first-child { border-top: 0; padding-top: 0; }
.date-box { width: 40px; height: 43px; border-radius: 9px; background: #f0ede5; display: grid; place-items: center; align-content: center; }
.date-box small { font-size: 8px; text-transform: uppercase; color: var(--muted); }
.date-box strong { font-size: 15px; line-height: 1; }
.upcoming-item div:nth-child(2) strong, .upcoming-item div:nth-child(2) small { display: block; }
.upcoming-item div:nth-child(2) strong { font-size: 12px; }
.upcoming-item div:nth-child(2) small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.upcoming-item > strong { font-size: 12px; }
.insight-card { border-radius: 17px; padding: 25px; background: var(--coral); color: #fff; position: relative; overflow: hidden; }
.insight-card::after { content: ""; position: absolute; width: 190px; height: 190px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; right: -80px; bottom: -90px; }
.insight-spark { display: grid; place-items: center; width: 35px; height: 35px; background: rgba(255,255,255,.15); border-radius: 50%; margin-bottom: 24px; }
.insight-card h2 { font-size: 28px; max-width: 300px; }
.insight-card > p:not(.eyebrow) { color: rgba(255,255,255,.78); font-size: 12px; line-height: 1.6; max-width: 380px; margin: 12px 0 24px; }

.section-heading { min-height: 100px; display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; }
.section-heading h2 { font-size: 36px; }
.section-heading > div > p:last-child { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.section-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.filter-bar { display: grid; grid-template-columns: minmax(230px, 1fr) 155px 150px 180px; gap: 10px; margin-bottom: 14px; }
.filter-bar select { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 11px 12px; font-size: 12px; }
.search-field { position: relative; }
.search-field span { position: absolute; left: 13px; top: 10px; font-size: 20px; color: var(--muted); }
.search-field input { padding-left: 39px; background: var(--panel); font-size: 12px; }
.table-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 14px 18px; background: #f8f5ee; white-space: nowrap; }
td { padding: 15px 18px; border-top: 1px solid #e9e5dc; vertical-align: middle; }
.align-right { text-align: right; }
.transaction-name { display: block; font-weight: 700; }
.transaction-note { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.category-tag, .owner-tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.category-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--tag-color); }
.owner-tag .avatar { width: 25px; height: 25px; font-size: 9px; }
.shared-avatar { background: var(--green-soft); color: var(--green); }
.amount-expense { color: #8f4036; }
.amount-income { color: #26705e; }
.delete-button { border: 0; background: transparent; color: #8b928f; font-size: 17px; padding: 5px; }
.delete-button:hover { color: var(--red); }
.table-footer { min-height: 52px; padding: 0 18px; display: flex; justify-content: space-between; align-items: center; background: #f8f5ee; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.table-footer strong { color: var(--ink); }

.account-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.account-summary-item { background: var(--green); color: #fff; border-radius: 16px; padding: 20px 22px; min-height: 105px; }
.account-summary-item:nth-child(2) { background: #253d48; }
.account-summary-item:nth-child(3) { background: var(--coral); }
.account-summary-item span, .account-summary-item strong { display: block; }
.account-summary-item span { color: rgba(255,255,255,.68); font-size: 10px; margin-bottom: 10px; }
.account-summary-item strong { font-family: "Newsreader", serif; font-size: 26px; font-weight: 600; }
.accounts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.account-card { min-height: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 20px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.account-card::after { content: ""; width: 110px; height: 110px; border-radius: 50%; background: var(--account-accent); opacity: .08; position: absolute; right: -30px; top: -35px; }
.account-card-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.bank-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--account-accent); font-family: "Newsreader", serif; font-size: 17px; }
.account-kind { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.account-card h3 { font-family: "Newsreader", serif; font-size: 21px; margin: 19px 0 2px; position: relative; z-index: 1; }
.account-card > small { color: var(--muted); font-size: 10px; }
.account-card-value { margin-top: auto; padding-top: 22px; }
.account-card-value span, .account-card-value strong { display: block; }
.account-card-value span { color: var(--muted); font-size: 9px; margin-bottom: 4px; }
.account-card-value strong { font-size: 20px; }
.account-card-meta { margin-top: 10px; padding-top: 10px; border-top: 1px solid #ebe7de; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.account-help { display: flex; gap: 14px; align-items: flex-start; background: var(--sand-soft); border-color: #e8d9ba; }
.account-help-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; flex: 0 0 auto; font-family: "Newsreader", serif; font-weight: 600; }
.account-help h3 { margin: 1px 0 5px; font-size: 13px; }
.account-help p { margin: 0; color: #695f4c; font-size: 11px; line-height: 1.55; }
.account-help > div { flex: 1; }
.invite-code { border: 1px solid #d8bd88; background: rgba(255,255,255,.45); border-radius: 11px; padding: 9px 12px; min-width: 135px; text-align: left; }
.invite-code span, .invite-code strong, .invite-code small { display: block; }
.invite-code span, .invite-code small { color: #756341; font-size: 8px; }
.invite-code strong { margin: 3px 0; color: var(--green); letter-spacing: .12em; font-size: 14px; }
.account-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.account-chip i { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 7px; background: var(--chip-color); color: #fff; font-style: normal; font-size: 8px; }

.planning-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-bottom: 16px; }
.budget-list { display: grid; gap: 20px; }
.budget-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 8px; }
.budget-top span { color: var(--muted); }
.budget-track { height: 7px; border-radius: 5px; background: #eae7df; overflow: hidden; }
.budget-track i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.budget-track i.is-warning { background: var(--coral); }
.bills-list { display: grid; }
.bill-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 11px; align-items: center; padding: 13px 0; border-top: 1px solid #e9e5dc; }
.bill-row:first-child { border-top: 0; padding-top: 0; }
.bill-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--sand-soft); display: grid; place-items: center; color: #725b2e; }
.bill-row strong, .bill-row small { display: block; }
.bill-row small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.bill-row > strong { font-size: 11px; }
.month-comparison { margin-bottom: 20px; }
.positive { color: #26705e; }
.negative { color: var(--red); }

.investment-hero { background: #253d48; color: #fff; border-radius: 20px; min-height: 200px; padding: 30px 36px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin-bottom: 16px; overflow: hidden; }
.investment-hero span { display: block; color: rgba(255,255,255,.65); font-size: 12px; }
.investment-hero strong { display: block; font-family: "Newsreader", serif; font-size: 48px; margin: 8px 0; }
.investment-hero p { font-size: 11px; color: #b7d5c5; }
.investment-bars { height: 130px; display: flex; align-items: end; justify-content: flex-end; gap: 10px; }
.investment-bar { width: 30px; border-radius: 7px 7px 2px 2px; background: var(--sand); position: relative; }
.investment-bar:nth-child(2n) { background: var(--mint); }
.investment-bar small { position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); font-size: 8px; }
.investment-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.investment-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid #e9e5dc; }
.investment-item:first-child { border-top: 0; padding-top: 0; }
.investment-symbol { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: #456d7c; font-weight: 700; }
.investment-item strong, .investment-item small { display: block; }
.investment-item small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.investment-value { text-align: right; }
.investment-value .positive, .investment-value .negative { font-size: 9px; margin-top: 3px; }
.goal-item { padding: 13px 0; border-top: 1px solid #e9e5dc; }
.goal-item:first-child { border-top: 0; padding-top: 0; }
.goal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.goal-top strong { font-size: 12px; }
.goal-top span { color: var(--muted); font-size: 10px; }
.goal-track { height: 8px; background: #eae7df; border-radius: 5px; overflow: hidden; }
.goal-track i { display: block; height: 100%; background: var(--coral); border-radius: inherit; }
.goal-item small { display: block; color: var(--muted); font-size: 9px; margin-top: 6px; }
.goal-owner { display: inline-flex !important; align-items: center; gap: 5px; margin: 0 0 7px !important; color: var(--green) !important; }
.goal-owner i { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); font-style: normal; font-size: 7px; }
.goal-monthly { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.goal-monthly > span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.goal-contribute { border: 0; background: var(--green-soft); color: var(--green); border-radius: 8px; padding: 7px 9px; font-size: 9px; font-weight: 700; white-space: nowrap; }

.insight-summary { background: var(--green); color: #fff; border-radius: 20px; padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 16px; }
.insight-summary h3 { font-family: "Newsreader", serif; font-size: 27px; margin: 0 0 7px; font-weight: 600; }
.insight-summary p { margin: 0; color: rgba(255,255,255,.7); font-size: 12px; }
.insight-summary strong { font-family: "Newsreader", serif; font-size: 38px; white-space: nowrap; }
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.saving-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.saving-card .saving-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: var(--sand-soft); margin-bottom: 28px; }
.saving-card h3 { font-family: "Newsreader", serif; font-size: 21px; margin: 0 0 9px; }
.saving-card p { color: var(--muted); font-size: 11px; line-height: 1.55; min-height: 50px; }
.saving-card strong { display: block; color: var(--green); font-size: 15px; margin-top: 17px; }
.projection-chart { min-height: 190px; }

.modal { width: min(570px, calc(100% - 30px)); max-height: calc(100vh - 30px); border: 0; border-radius: 19px; padding: 0; color: var(--ink); background: var(--panel); box-shadow: 0 30px 80px rgba(23,34,30,.25); }
.modal::backdrop { background: rgba(18,29,25,.55); backdrop-filter: blur(3px); }
.modal form { padding: 26px; }
.modal--wide { width: min(820px, calc(100% - 30px)); }
.modal--small { width: min(430px, calc(100% - 30px)); }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal-heading h2 { font-family: "Newsreader", serif; margin: 0; font-size: 28px; }
.modal-close { border: 0; background: #eeebe4; width: 32px; height: 32px; border-radius: 50%; font-size: 21px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #eeebe4; border-radius: 11px; margin-bottom: 18px; }
.segmented-control label { text-align: center; padding: 9px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented-control label.is-selected { background: var(--panel); box-shadow: 0 2px 8px rgba(30,45,39,.08); }
.segmented-control input { position: absolute; opacity: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.field--full { grid-column: 1 / -1; }
.field textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.import-intro { min-height: 112px; border: 1px dashed #bfc6c2; border-radius: 14px; padding: 19px; display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center; background: #f8f5ee; }
.import-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 20px; }
.import-intro strong, .import-intro small { display: block; }
.import-intro strong { font-size: 13px; }
.import-intro small { color: var(--muted); font-size: 10px; margin-top: 4px; line-height: 1.45; }
.import-settings { margin-top: 18px; }
.import-status { padding: 10px 12px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 11px; margin-bottom: 10px; }
.import-preview { max-height: 300px; border: 1px solid var(--line); border-radius: 11px; }
.import-preview th { position: sticky; top: 0; z-index: 1; }
.import-preview td, .import-preview th { padding: 10px 12px; }
.import-preview input[type="checkbox"] { accent-color: var(--green); }
.contribution-goal-name { margin: -7px 0 18px; color: var(--muted); font-size: 12px; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 50; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; transform: translateY(120px); opacity: 0; transition: .3s ease; box-shadow: var(--shadow); }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast span { color: var(--mint); }
.toast p { margin: 0; font-size: 12px; }
.mobile-nav { display: none; }
.empty-state { text-align: center; padding: 35px 15px; color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .dashboard-grid--bottom, .planning-grid, .investment-layout { grid-template-columns: 1fr; }
  .category-content { grid-template-columns: 170px 1fr; }
  .insight-grid { grid-template-columns: 1fr 1fr; }
  .accounts-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .topbar { flex-wrap: wrap; padding: 18px 0; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 780px) {
  body { background: #f6f3ed; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 28px 22px; align-items: center; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 55px; color: var(--green); font-family: "Newsreader", serif; font-size: 22px; }
  .login-card h2 { font-size: 36px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 0 16px 100px; }
  .topbar { min-height: 92px; position: sticky; top: 0; z-index: 5; margin: 0 -16px 22px; padding: 0 16px; background: rgba(246,243,237,.94); backdrop-filter: blur(12px); }
  .topbar h1 { font-size: 25px; }
  .topbar .eyebrow { display: none; }
  .topbar-actions .button { width: 42px; padding: 0; font-size: 0; }
  .topbar-actions .button span { font-size: 20px; }
  .month-select select { min-width: 122px; }
  .balance-hero { min-height: 250px; display: block; padding: 27px 24px; }
  .balance-value { font-size: 45px; }
  .balance-split { margin-top: 25px; border-left: 0; border-top: 1px solid rgba(255,255,255,.15); }
  .balance-split div { padding: 16px 0 0; }
  .balance-split div + div { padding-left: 18px; }
  .metrics-grid { display: flex; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .metric-card { min-width: 210px; }
  .panel { padding: 19px; }
  .dashboard-grid { display: block; }
  .dashboard-grid > * { margin-bottom: 14px; }
  .category-content { grid-template-columns: 135px 1fr; gap: 14px; }
  .donut { width: 130px; }
  .donut::before { width: 84px; }
  .section-heading { min-height: auto; margin: 15px 0 25px; align-items: flex-end; }
  .section-heading h2 { font-size: 31px; }
  .section-heading > .button, .section-heading > .section-actions .button { width: 43px; padding: 0; overflow: hidden; white-space: nowrap; font-size: 0; }
  .section-heading > .button span, .section-heading > .section-actions .button span { font-size: 20px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filter-bar select { min-width: 0; width: 100%; }
  th, td { padding: 13px; }
  .investment-hero { grid-template-columns: 1fr; padding: 25px; }
  .investment-bars { justify-content: flex-start; margin-top: 15px; }
  .insight-grid { grid-template-columns: 1fr; }
  .insight-summary { align-items: flex-start; }
  .insight-summary strong { font-size: 30px; }
  .account-summary { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr 1fr; }
  .mobile-nav { position: fixed; z-index: 20; display: grid; grid-template-columns: repeat(6, 1fr); align-items: center; left: 0; right: 0; bottom: 0; min-height: 71px; padding: 7px 7px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,253,248,.96); border-top: 1px solid var(--line); backdrop-filter: blur(15px); }
  .mobile-nav button { border: 0; background: transparent; color: #7b827f; display: grid; justify-items: center; gap: 3px; font-size: 19px; }
  .mobile-nav button small { font-size: 9px; }
  .mobile-nav button.is-active { color: var(--green); }
  .mobile-nav .mobile-add { width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: white; justify-self: center; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(23,60,53,.25); font-size: 25px; }
  .toast { right: 15px; left: 15px; bottom: 90px; }
}

@media (max-width: 500px) {
  .profile-picker { grid-template-columns: 1fr; }
  .mobile-brand { margin-bottom: 38px; }
  .topbar-actions { gap: 6px; }
  .topbar { min-height: 124px; align-content: center; }
  .scope-switch { order: 3; width: 100%; }
  .scope-switch button { flex: 1; }
  .month-select select { max-width: 115px; padding: 10px 8px; }
  .balance-hero { border-radius: 17px; }
  .balance-value { font-size: 40px; }
  .category-content { grid-template-columns: 1fr; justify-items: center; }
  .category-list { width: 100%; grid-template-columns: 1fr 1fr; }
  .chart-legend { display: none; }
  .insight-summary { display: block; }
  .insight-summary strong { margin-top: 20px; display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .modal form { padding: 21px; }
  .investment-hero strong { font-size: 39px; }
  .accounts-grid { grid-template-columns: 1fr; }
  .import-intro { grid-template-columns: 42px 1fr; }
  .import-intro .button { grid-column: 1 / -1; width: 100%; }
  .account-help { flex-wrap: wrap; }
  .invite-code { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
