:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #121826;
  --muted: #6b7280;
  --line: #e7eaf0;
  --primary: #0d4f46;
  --primary-2: #17685d;
  --primary-soft: #e9f5f1;
  --income: #0f766e;
  --income-soft: #e6f5f3;
  --expense: #b45309;
  --expense-soft: #fff4df;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --blue: #275efe;
  --blue-soft: #edf2ff;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --sidebar: 260px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #101a2b;
  --surface-2: #152238;
  --text: #edf2f7;
  --muted: #9da9bc;
  --line: #24334a;
  --primary: #53bba7;
  --primary-2: #78cdbd;
  --primary-soft: #173931;
  --income: #59c7b3;
  --income-soft: #16382f;
  --expense: #f6b85f;
  --expense-soft: #402d15;
  --danger: #ff8d86;
  --danger-soft: #42201f;
  --blue: #8ba4ff;
  --blue-soft: #1e2b58;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }
input, select { color: var(--text); background: var(--surface); }
svg { width: 19px; height: 19px; stroke-width: 1.9; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 26px 18px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.brand-wrap { display: flex; gap: 12px; align-items: center; padding: 0 8px 28px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #0d4f46, #1f7568); color: #fff; font-weight: 800; box-shadow: 0 10px 24px rgba(13,79,70,.24); }
.brand-mark.large { width: 54px; height: 54px; border-radius: 17px; font-size: 22px; margin-bottom: 18px; }
.brand-name { font-weight: 800; letter-spacing: .12em; font-size: 14px; }
.brand-tagline { font-size: 11px; margin-top: 4px; color: var(--muted); }
.sidebar-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; color: var(--muted); background: transparent; padding: 12px 13px; border-radius: 12px; text-align: left; transition: .2s ease; }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.local-note { display: flex; gap: 9px; padding: 11px; font-size: 11px; line-height: 1.4; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; }
.local-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--primary); }

.main-content { grid-column: 2; width: min(1480px, calc(100vw - var(--sidebar))); padding: 0 34px 64px; }
.topbar { position: sticky; top: 0; z-index: 12; min-height: 94px; display: flex; align-items: center; justify-content: space-between; padding: 18px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); }
.eyebrow, .section-kicker { margin: 0 0 5px; font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
.topbar h1 { font-size: 27px; margin: 0; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.icon-btn, .month-button, .secondary-btn, .danger-btn, .primary-btn, .text-btn { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .2s ease; }
.icon-btn { width: 43px; height: 43px; border-radius: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.icon-btn:hover, .month-button:hover { color: var(--text); transform: translateY(-1px); }
.month-button { height: 43px; padding: 0 14px; border-radius: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line); font-weight: 650; }
.primary-btn { min-height: 43px; padding: 0 16px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 750; box-shadow: 0 8px 20px rgba(13,79,70,.16); }
.primary-btn:hover { background: var(--primary-2); transform: translateY(-1px); }
.primary-btn.full { width: 100%; }
.large-btn { min-height: 52px; }
.secondary-btn { min-height: 43px; padding: 0 14px; border-radius: 12px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; }
.danger-btn { min-height: 43px; padding: 0 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.text-btn { background: none; color: var(--primary); padding: 7px 0; font-weight: 700; }
.text-btn svg { width: 15px; height: 15px; }

.view { display: none; animation: fadeUp .28s ease both; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .75fr); gap: 18px; }
.hero-card { min-height: 290px; padding: 30px; border-radius: var(--radius-xl); color: #fff; background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 30%), linear-gradient(135deg, #0b3f39 0%, #0f5a50 58%, #1d7164 100%); box-shadow: 0 22px 55px rgba(13,79,70,.22); display: flex; flex-direction: column; }
.hero-topline { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: rgba(255,255,255,.76); }
.status-pill { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.12); color: #fff; padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.hero-amount { font-size: clamp(44px, 5vw, 72px); line-height: 1; letter-spacing: -.055em; margin: 28px 0 10px; font-weight: 800; }
.hero-card > p { color: rgba(255,255,255,.7); margin: 0; font-size: 13px; }
.budget-meter-wrap { margin-top: auto; padding-top: 28px; }
.budget-meter-label, .budget-meter-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: rgba(255,255,255,.72); }
.budget-meter-label strong { color: #fff; font-size: 13px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.15); margin: 10px 0; }
.progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; transition: width .5s ease; }
.summary-stack { display: grid; gap: 10px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: grid; grid-template-columns: 46px 1fr; gap: 13px; align-items: center; min-height: 88px; }
.metric-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; }
.metric-icon.income { background: var(--income-soft); color: var(--income); }
.metric-icon.expense { background: var(--expense-soft); color: var(--expense); }
.metric-icon.savings { background: var(--blue-soft); color: var(--blue); }
.metric-card span { display: block; color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; font-size: 21px; margin: 3px 0 2px; letter-spacing: -.03em; }
.metric-card small { color: var(--muted); font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 22px; box-shadow: 0 4px 20px rgba(15,23,42,.02); }
.span-2 { grid-column: span 2; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { font-size: 17px; margin: 0; letter-spacing: -.025em; }
.chart-wrap { position: relative; height: 255px; }
.chart-wrap.large { height: 320px; }
.chart-wrap.doughnut { height: 260px; }
.spark-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }

.category-progress-list { display: grid; gap: 16px; }
.category-row-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 12px; margin-bottom: 8px; }
.category-row-top span { color: var(--muted); }
.category-row-top strong { font-size: 11px; }
.category-row .progress-track { background: var(--surface-2); margin: 0; height: 7px; }
.category-row .progress-track > span { background: var(--primary); }
.category-row.over .progress-track > span { background: var(--danger); }
.empty-state { padding: 32px 18px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.empty-state svg { margin-bottom: 9px; color: var(--primary); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 5px; }

.transaction-list { display: grid; gap: 2px; }
.transaction-item { display: grid; grid-template-columns: 42px 1fr auto auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.transaction-item:last-child { border-bottom: 0; }
.tx-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.tx-icon.expense { color: var(--expense); background: var(--expense-soft); }
.tx-icon.income { color: var(--income); background: var(--income-soft); }
.tx-icon.transfer { color: var(--blue); background: var(--blue-soft); }
.tx-copy strong { display: block; font-size: 13px; }
.tx-copy span { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; }
.tx-amount { text-align: right; font-weight: 780; font-size: 12px; }
.tx-amount.income { color: var(--income); }
.tx-amount.expense { color: var(--text); }
.tx-date { color: var(--muted); font-size: 10px; min-width: 54px; text-align: right; }
.delete-tx { width: 31px; height: 31px; display: grid; place-items: center; color: var(--muted); border: 0; background: transparent; border-radius: 9px; opacity: 0; }
.transaction-item:hover .delete-tx { opacity: 1; }
.delete-tx:hover { color: var(--danger); background: var(--danger-soft); }
.compact .transaction-item { grid-template-columns: 38px 1fr auto; }
.compact .delete-tx, .compact .tx-date { display: none; }

.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.insight-card { padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.insight-card strong { display: block; font-size: 12px; margin-bottom: 6px; }
.insight-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.insight-card .insight-value { display: inline-flex; align-items: center; gap: 5px; margin-top: 13px; font-weight: 800; font-size: 12px; color: var(--primary); }

.toolbar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.search-box { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 9px; padding: 0 11px; min-height: 42px; background: var(--surface-2); border-radius: 12px; color: var(--muted); }
.search-box input { width: 100%; background: transparent; border: 0; outline: 0; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 0; border-radius: 999px; padding: 9px 13px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.chip.active { background: var(--primary-soft); color: var(--primary); }
.section-grid { display: grid; gap: 18px; }
.transactions-layout { grid-template-columns: minmax(0, 2fr) minmax(250px, .75fr); }
.transaction-table-panel { min-height: 520px; }
.mini-summary { align-self: start; position: sticky; top: 110px; }
.summary-number { font-size: 34px; line-height: 1; letter-spacing: -.04em; margin: 10px 0; font-weight: 800; }
.summary-line { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.summary-line:last-child { border-bottom: 0; }
.summary-line span { color: var(--muted); }

.budget-layout { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); align-items: start; }
.budget-summary-column { display: grid; gap: 18px; position: sticky; top: 110px; }
.soft-badge { background: var(--primary-soft); color: var(--primary); padding: 8px 11px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.income-target-box { padding: 18px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 17px; margin-bottom: 18px; }
.income-target-box label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 9px; }
.currency-input { display: flex; align-items: center; gap: 8px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--surface); }
.currency-input span { color: var(--muted); font-size: 12px; font-weight: 750; }
.currency-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-weight: 750; }
.budget-form-list { display: grid; gap: 10px; margin-bottom: 18px; }
.budget-input-row { display: grid; grid-template-columns: 1fr 145px; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.budget-input-copy { display: flex; align-items: center; gap: 11px; }
.category-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.budget-input-copy strong { display: block; font-size: 12px; }
.budget-input-copy span { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }

.page-section-head { margin-bottom: 18px; }
.page-section-head h2 { font-size: 22px; }
.accounts-grid, .goals-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.account-card, .goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 19px; }
.account-card-top, .goal-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.account-card-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.account-card h3, .goal-card h3 { margin: 14px 0 4px; font-size: 13px; }
.account-card p, .goal-card p { margin: 0; color: var(--muted); font-size: 10px; }
.account-balance { font-size: 25px; font-weight: 800; letter-spacing: -.035em; margin-top: 18px; }
.account-overview { margin-top: 18px; }
.overview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.overview-stat { background: var(--surface-2); border-radius: 16px; padding: 16px; }
.overview-stat span { display: block; color: var(--muted); font-size: 10px; }
.overview-stat strong { display: block; font-size: 20px; margin-top: 5px; }
.icon-action { width: 32px; height: 32px; border: 0; background: var(--surface-2); border-radius: 9px; color: var(--muted); display: grid; place-items: center; }
.icon-action:hover { color: var(--danger); background: var(--danger-soft); }
.goal-progress { margin: 17px 0 9px; }
.goal-progress .progress-track { margin: 0; background: var(--surface-2); }
.goal-progress .progress-track > span { background: var(--primary); }
.goal-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.goal-actions { margin-top: 15px; display: flex; gap: 8px; }
.goal-actions button { flex: 1; min-height: 36px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); background: var(--surface-2); font-size: 10px; font-weight: 750; }

.analytics-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.analytics-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 17px; }
.analytics-card span { display: block; color: var(--muted); font-size: 10px; }
.analytics-card strong { display: block; margin: 6px 0 4px; font-size: 22px; letter-spacing: -.035em; }
.analytics-card small { color: var(--muted); font-size: 10px; }
.analytics-list { display: grid; gap: 12px; }
.analytics-list-row { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 11px; }
.analytics-list-row:last-child { border: 0; padding-bottom: 0; }
.analytics-list-row span { color: var(--muted); }

.recurring-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.recurring-list { display: grid; gap: 10px; }
.recurring-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 17px; display: grid; grid-template-columns: 44px 1fr auto auto; gap: 12px; align-items: center; }
.recurring-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.recurring-copy strong { display: block; font-size: 12px; }
.recurring-copy span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.recurring-amount { font-weight: 800; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card { align-self: start; }
.settings-card label, .stack-form label, .form-grid label { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 11px; font-weight: 650; }
.settings-card input, .settings-card select, .stack-form input, .stack-form select, .form-grid input, .form-grid select { width: 100%; min-height: 44px; border: 1px solid var(--line); outline: 0; border-radius: 12px; padding: 0 12px; background: var(--surface); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.roadmap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.roadmap-list li { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface-2); border-radius: 12px; color: var(--muted); font-size: 11px; }
.roadmap-list svg { color: var(--primary); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(5,11,20,.48); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; animation: modalFade .18s ease both; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: min(520px, 100%); max-height: min(760px, 92vh); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: var(--shadow); position: relative; }
.modal-card h2 { margin: 0 0 22px; font-size: 23px; letter-spacing: -.035em; }
.modal-close { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); margin-bottom: 18px; }
.segmented button { border: 0; min-height: 39px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; }
.segmented button.active { color: var(--text); background: var(--surface); box-shadow: 0 3px 10px rgba(15,23,42,.06); }
.amount-input-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 25px 10px; margin-bottom: 15px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 18px; }
.amount-input-wrap span { font-size: 18px; font-weight: 800; color: var(--muted); }
.amount-input-wrap input { width: min(280px, 70%); text-align: center; border: 0; outline: 0; background: transparent; font-size: 42px; letter-spacing: -.05em; font-weight: 800; }
.amount-input-wrap input::placeholder { color: color-mix(in srgb, var(--muted) 45%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
.form-grid .full-span { grid-column: 1 / -1; }
.stack-form .currency-input input { min-height: auto; padding: 0; border: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.onboarding { background: radial-gradient(circle at 30% 15%, rgba(62,150,133,.18), transparent 30%), rgba(5,11,20,.72); }
.onboarding-card { width: min(650px, 100%); padding: 34px; }
.onboarding-card h2 { font-size: clamp(28px, 4vw, 40px); max-width: 520px; margin-bottom: 10px; }
.onboarding-copy { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 30px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #101827; color: #fff; border-radius: 999px; padding: 11px 16px; font-size: 11px; font-weight: 700; box-shadow: 0 12px 30px rgba(0,0,0,.2); transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.bottom-nav, .fab { display: none; }

@media (max-width: 1100px) {
  :root { --sidebar: 220px; }
  .main-content { padding-inline: 22px; }
  .hero-grid { grid-template-columns: 1fr; }
  .summary-stack { grid-template-columns: repeat(3, 1fr); }
  .metric-card { grid-template-columns: 40px 1fr; }
  .metric-icon { width: 40px; height: 40px; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
  .insight-grid { grid-template-columns: 1fr; }
  .accounts-grid, .goals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { width: 100%; padding: 0 16px 42px; }
  .topbar { min-height: 78px; }
  .topbar h1 { font-size: 22px; }
  .desktop-add { display: none; }
  .month-button span { display: none; }
  .summary-stack { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .metric-card { display: block; min-height: 98px; padding: 13px; }
  .metric-icon { width: 34px; height: 34px; margin-bottom: 12px; border-radius: 11px; }
  .metric-icon svg { width: 17px; height: 17px; }
  .metric-card strong { font-size: 17px; }
  .metric-card small { display: none; }
  .dashboard-grid, .transactions-layout, .budget-layout, .settings-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .budget-summary-column, .mini-summary { position: static; }
  .analytics-metrics { grid-template-columns: 1fr 1fr; }
  .accounts-grid, .goals-grid { grid-template-columns: 1fr 1fr; }
  .toolbar-card { align-items: stretch; flex-direction: column; }
  .search-box { max-width: none; }
  .transaction-item { grid-template-columns: 40px 1fr auto; }
  .tx-date { display: none; }
  .delete-tx { opacity: 1; width: 28px; height: 28px; grid-column: 3; }
  .tx-amount { grid-column: 3; grid-row: 1; }
  .transaction-item .delete-tx { display: none; }
  .bottom-nav { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); min-height: 66px; display: grid; grid-template-columns: 1fr 1fr 66px 1fr 1fr; align-items: center; border-radius: 20px; padding: 7px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); box-shadow: 0 16px 45px rgba(15,23,42,.14); backdrop-filter: blur(18px); }
  .bottom-item { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; gap: 3px; font-size: 9px; }
  .bottom-item svg { width: 19px; height: 19px; }
  .bottom-item.active { color: var(--primary); font-weight: 800; }
  .fab { position: fixed; z-index: 60; display: grid; place-items: center; left: 50%; transform: translateX(-50%); bottom: max(27px, calc(env(safe-area-inset-bottom) + 17px)); width: 54px; height: 54px; border-radius: 18px; border: 5px solid var(--bg); background: var(--primary); color: #fff; box-shadow: 0 12px 26px rgba(13,79,70,.26); }
  .fab svg { width: 23px; height: 23px; }
}

@media (max-width: 560px) {
  .topbar-actions { gap: 6px; }
  .icon-btn, .month-button { width: 40px; height: 40px; padding: 0; }
  .hero-card { min-height: 305px; padding: 22px; }
  .hero-amount { font-size: 46px; margin-top: 36px; }
  .hero-topline { align-items: flex-start; gap: 10px; }
  .status-pill { white-space: nowrap; }
  .summary-stack { grid-template-columns: 1fr 1fr; }
  .summary-stack .metric-card:last-child { grid-column: 1 / -1; }
  .summary-stack .metric-card:last-child { display: grid; grid-template-columns: 38px 1fr; min-height: 76px; }
  .summary-stack .metric-card:last-child .metric-icon { margin-bottom: 0; }
  .panel { padding: 18px; border-radius: 20px; }
  .chart-wrap { height: 225px; }
  .chart-wrap.large { height: 260px; }
  .accounts-grid, .goals-grid, .analytics-metrics { grid-template-columns: 1fr; }
  .overview-stats, .recurring-summary { grid-template-columns: 1fr; }
  .budget-input-row { grid-template-columns: 1fr 120px; }
  .recurring-item { grid-template-columns: 40px 1fr auto; }
  .recurring-item .icon-action { display: none; }
  .form-grid, .two-col { grid-template-columns: 1fr; }
  .amount-input-wrap input { font-size: 36px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); }
  .onboarding { align-items: center; padding: 14px; }
  .onboarding-card { border-radius: 24px; padding: 26px 20px; max-height: 94vh; }
  .toast { bottom: 100px; }
}
