:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --surface: #14161d;
  --surface-2: #1a1d26;
  --surface-3: #222631;
  --line: #2b2f3a;
  --line-soft: #22252e;
  --text: #f5f6f8;
  --muted: #979da9;
  --muted-2: #6f7581;
  --accent: #7a6cf6;
  --accent-soft: #292641;
  --blue: #5b9df5;
  --green: #55d994;
  --yellow: #f0c15b;
  --red: #f73;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-width: 300px; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hidden { display: none !important; }
.app-shell { width: min(100%, 720px); min-height: 100vh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom)); }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 46px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.brand-mark, .profile-avatar, .setup-mark { display: grid; place-items: center; flex: 0 0 auto; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; font-size: 17px; }
.brand > span:last-child { display: grid; line-height: 1.1; }
.brand b { font-size: 16px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.avatar-button { position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); font-weight: 750; }
.live-dot { position: absolute; right: 0; bottom: 1px; width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--green); }

.month-switcher { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; width: min(100%, 260px); height: 42px; margin: 0 auto 16px; padding: 3px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); }
.icon-button, .month-label { height: 34px; border: 0; background: transparent; }
.icon-button { border-radius: 10px; color: var(--muted); font-size: 24px; line-height: 1; }
.icon-button:active { background: var(--surface-3); }
.month-label { min-width: 0; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.page { display: none; animation: page-in .22s ease both; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.hero-card { overflow: hidden; padding: 20px; border: 1px solid #303344; border-radius: var(--radius-xl); background: #181a24; box-shadow: var(--shadow); }
.hero-topline { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.privacy-button { width: 32px; height: 32px; padding: 7px; border: 0; border-radius: 10px; background: #222531; color: var(--muted); }
.hero-amount { overflow-wrap: anywhere; margin: 10px 0 20px; font-size: clamp(36px, 10vw, 54px); font-weight: 760; letter-spacing: -.055em; line-height: 1.05; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 15px; background: var(--line); }
.hero-stats > div { min-width: 0; padding: 12px; background: #20232d; }
.hero-stats span, .hero-stats strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-stats span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.hero-stats strong { overflow: visible; font-size: clamp(10px, 3.15vw, 14px); letter-spacing: -.025em; text-overflow: clip; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.quick-entry { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px 12px; margin-top: 12px; padding: 15px; border: 1px solid #33304f; border-radius: 20px; background: var(--accent-soft); }
.quick-icon { display: grid; place-items: center; grid-row: span 1; width: 42px; height: 42px; border-radius: 14px; background: var(--accent); color: #fff; }
.quick-icon svg { width: 21px; height: 21px; fill: currentColor; stroke: none; }
.quick-copy { align-self: center; min-width: 0; }
.quick-copy strong, .quick-copy span { display: block; }
.quick-copy strong { font-size: 15px; }
.quick-copy span { margin-top: 3px; color: #aaa7c8; font-size: 12px; }
.quick-control { display: flex; grid-column: 1 / -1; gap: 8px; min-width: 0; }
.quick-control input { width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid #403c60; outline: 0; border-radius: 14px; background: #171822; color: var(--text); font-size: 16px; }
.quick-control input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(122,108,246,.15); }
.quick-control button { display: grid; place-items: center; flex: 0 0 48px; height: 48px; padding: 0; border: 0; border-radius: 14px; background: var(--accent); color: #fff; }
.quick-control button:disabled { opacity: .5; }
.quick-control svg { width: 22px; height: 22px; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 2px 12px; }
.section-heading > div { min-width: 0; }
.section-kicker { margin: 0 0 5px; color: #8f85f9; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.section-heading h2, .page-title h1, .sheet-title-row h2 { margin: 0; letter-spacing: -.025em; }
.section-heading h2 { font-size: 21px; }
.text-button { flex: 0 0 auto; padding: 6px 0; border: 0; background: transparent; color: #a99ffc; font-size: 13px; font-weight: 700; }
.count-badge { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }

.account-carousel { display: grid; grid-auto-columns: minmax(238px, 78%); grid-auto-flow: column; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 1px 1px 7px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.account-carousel::-webkit-scrollbar { display: none; }
.account-card { position: relative; min-width: 0; min-height: 152px; overflow: hidden; padding: 17px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); scroll-snap-align: start; text-align: left; }
.account-card::after { content: "›"; position: absolute; right: 16px; top: 15px; color: var(--muted-2); font-size: 24px; }
.account-card:active { transform: scale(.985); }
.account-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: #252936; color: var(--blue); font-size: 13px; font-weight: 800; }
.account-card.savings .account-icon { color: var(--green); }
.account-card.credit .account-icon { color: var(--red); }
.account-name, .account-balance, .account-meta { display: block; }
.account-name { margin: 16px 0 5px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-balance { margin: 0; overflow-wrap: anywhere; font-size: 23px; font-weight: 750; letter-spacing: -.025em; }
.account-meta { display: block; margin-top: 7px; overflow: hidden; color: var(--muted-2); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.savings-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.savings-ring { display: grid; place-items: center; width: 88px; height: 88px; border: 7px solid #292c36; border-top-color: var(--accent); border-right-color: var(--accent); border-radius: 50%; }
.savings-ring > div { display: grid; text-align: center; }
.savings-ring strong { font-size: 17px; }
.savings-ring span { color: var(--muted); font-size: 10px; }
.savings-copy { min-width: 0; }
.savings-copy > strong { display: block; margin: 7px 0 3px; overflow-wrap: anywhere; font-size: 24px; letter-spacing: -.025em; }
.savings-copy p { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.status-chip { display: inline-block; max-width: 100%; overflow: hidden; padding: 5px 8px; border-radius: 8px; background: #292d39; color: var(--muted); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.status-chip.good { background: #173427; color: var(--green); }
.status-chip.warning { background: #392f19; color: var(--yellow); }
.status-chip.danger { background: #3b2023; color: var(--red); }
.micro-progress, .budget-progress { overflow: hidden; background: #292c35; }
.micro-progress { height: 5px; border-radius: 99px; }
.micro-progress span, .budget-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .45s ease; }

.budget-stack, .limits-list, .transactions-list, .report-bars { display: grid; gap: 9px; }
.budget-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-width: 0; padding: 14px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--surface); }
.budget-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.budget-dot.good, .budget-progress .good { background: var(--green); }
.budget-dot.warning, .budget-progress .warning { background: var(--yellow); }
.budget-dot.danger, .budget-progress .danger { background: var(--red); }
.budget-main { min-width: 0; }
.budget-name-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.budget-name-line strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.budget-name-line span { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.budget-progress { height: 4px; margin-top: 8px; border-radius: 99px; }
.budget-remaining { display: grid; max-width: 88px; text-align: right; }
.budget-remaining strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.budget-remaining span { color: var(--muted-2); font-size: 9px; }

.transactions-list { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--surface); gap: 0; }
.transaction { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; min-width: 0; padding: 13px 12px; border-bottom: 1px solid var(--line-soft); }
.transaction:last-child { border-bottom: 0; }
.transaction-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: #282b35; color: var(--red); font-size: 18px; }
.transaction-icon.income { background: #193126; color: var(--green); }
.transaction-icon.transfer { background: #242842; color: #9e96fa; }
.transaction-copy, .transaction-amount { min-width: 0; }
.transaction-copy strong, .transaction-copy span, .transaction-amount strong, .transaction-amount span { display: block; }
.transaction-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-copy span { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-amount { max-width: 112px; text-align: right; }
.transaction-amount strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-amount span { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.delete-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted-2); font-size: 20px; }
.delete-button:active { background: #3b2023; color: var(--red); }
.empty-card { padding: 20px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 13px; text-align: center; }

.page-title { margin: 8px 2px 18px; }
.page-title h1 { font-size: 31px; }
.page-title > p:last-child, .page-title > div > p:last-child { max-width: 520px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.plan-editor-card { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px; border: 1px solid #35314f; border-radius: 19px; background: var(--accent-soft); }
.plan-orb { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: var(--accent); font-size: 19px; font-weight: 800; }
.plan-editor-copy { min-width: 0; }
.plan-editor-copy span, .plan-editor-copy strong, .plan-editor-copy p { display: block; }
.plan-editor-copy > span { color: #aaa7c8; font-size: 11px; }
.plan-editor-copy strong { margin-top: 3px; font-size: 17px; }
.plan-editor-copy p { margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.small-button, .export-button { flex: 0 0 auto; border: 1px solid #454066; border-radius: 12px; background: #201e31; color: #c2bcff; font-size: 12px; font-weight: 750; }
.small-button { padding: 9px 10px; }
.limits-list { margin-top: 12px; }
.limit-card { min-width: 0; overflow: hidden; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.limit-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.limit-title-row h3 { margin: 0; overflow-wrap: anywhere; font-size: 16px; }
.limit-title-row p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.limit-total { display: grid; max-width: 145px; text-align: right; }
.limit-total strong { overflow-wrap: anywhere; font-size: 12px; }
.limit-total span { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.limit-card > .budget-progress { height: 6px; margin: 13px 0; }
.sublimits { display: grid; }
.sublimit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; gap: 9px; align-items: center; min-width: 0; min-height: 48px; border-top: 1px solid var(--line-soft); }
.sublimit-name { min-width: 0; }
.sublimit-name strong, .sublimit-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sublimit-name strong { font-size: 12px; }
.sublimit-name span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.sublimit-value { max-width: 105px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.edit-icon { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; background: #21242d; color: var(--muted); font-size: 17px; line-height: 1; letter-spacing: 1px; }
.add-category-button { width: 100%; height: 40px; margin-top: 10px; border: 1px dashed #3c4050; border-radius: 12px; background: transparent; color: #a8aeb9; font-size: 12px; font-weight: 700; }

.report-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.export-button { display: flex; align-items: center; gap: 7px; margin-top: 6px; padding: 10px 12px; }
.export-button svg { width: 16px; height: 16px; }
.report-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.report-summary > div { min-width: 0; padding: 13px 11px; border: 1px solid var(--line-soft); border-radius: 15px; background: var(--surface); }
.report-summary span, .report-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-summary span { color: var(--muted); font-size: 10px; }
.report-summary strong { margin-top: 6px; font-size: 14px; }
.report-card { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.report-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.report-card-head > div { min-width: 0; }
.report-card-head span, .report-card-head strong { display: block; }
.report-card-head span { color: var(--muted); font-size: 10px; }
.report-card-head strong { margin-top: 4px; font-size: 22px; }
.report-bar-row { display: grid; grid-template-columns: minmax(0, 120px) minmax(50px, 1fr) auto; gap: 9px; align-items: center; min-width: 0; }
.report-bar-row > span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: #292c35; }
.report-bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.report-bar-row strong { max-width: 92px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.history-heading { margin-top: 24px; }

.profile-card { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.profile-avatar { width: 54px; height: 54px; border-radius: 18px; font-size: 22px; }
.profile-card > div:nth-child(2) { min-width: 0; }
.profile-card strong, .profile-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card strong { font-size: 16px; }
.profile-card span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.profile-status { padding: 6px 8px; border-radius: 8px; background: #173427; color: var(--green) !important; font-size: 9px !important; font-weight: 800; }
.settings-card { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.settings-heading { display: flex; justify-content: space-between; gap: 14px; }
.settings-heading > div { min-width: 0; }
.settings-heading strong, .settings-heading span { display: block; }
.settings-heading strong { font-size: 15px; }
.settings-heading span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.settings-heading > b { color: var(--green); font-size: 13px; }
.settings-heading > b.invalid { color: var(--red); }
.percentage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 15px 0; }
.percentage-grid label { min-width: 0; padding: 10px; border: 1px solid var(--line-soft); border-radius: 13px; background: #101219; }
.percentage-grid label:last-child { grid-column: 1 / -1; }
.percentage-grid label > span { display: block; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.percentage-grid label > div { display: flex; align-items: center; margin-top: 4px; }
.percentage-grid input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 18px; font-weight: 750; }
.percentage-grid b { color: var(--muted); }
.setting-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.setting-line label:first-child { min-width: 0; }
.setting-line strong, .setting-line span { display: block; }
.setting-line strong { font-size: 12px; }
.setting-line label:first-child span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.setting-line input[type=time] { width: 82px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #101219; color: var(--text); font-size: 11px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { position: relative; width: 40px; height: 24px; border-radius: 99px; background: #31343e; transition: background .2s ease; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.action-list { padding: 0; overflow: hidden; }
.action-list > button, .sheet-actions button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; }
.action-list > button:last-child, .sheet-actions button:last-child { border-bottom: 0; }
.action-list button > span { min-width: 0; }
.action-list strong, .action-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-list strong { font-size: 12px; }
.action-list small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.action-list b, .sheet-actions b { color: var(--muted-2); font-size: 21px; }

.primary-button { width: 100%; min-height: 48px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 800; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.tabbar { position: fixed; z-index: 50; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; align-items: center; width: min(calc(100% - 20px), 680px); min-height: 62px; padding: 6px; border: 1px solid #30333d; border-radius: 22px; background: rgba(20, 22, 29, .96); box-shadow: 0 16px 45px rgba(0,0,0,.42); transform: translateX(-50%); }
.tab-button { display: flex; align-items: center; justify-content: center; flex: .75 1 0; gap: 0; min-width: 0; height: 48px; padding: 0 7px; overflow: hidden; border: 0; border-radius: 16px; background: transparent; color: var(--muted); transition: flex .22s ease, color .2s ease, background .2s ease; }
.tab-button svg { flex: 0 0 auto; width: 21px; height: 21px; }
.tab-button span { width: 0; overflow: hidden; opacity: 0; font-size: 11px; font-weight: 750; white-space: nowrap; transition: width .22s ease, margin .22s ease, opacity .15s ease; }
.tab-button.active { flex: 1.45 1 0; background: var(--accent-soft); color: #c2bcff; }
.tab-button.active span { width: auto; margin-left: 6px; opacity: 1; }
.quick-tab { position: relative; display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; margin: 0 4px; padding: 0; border: 0; border-radius: 17px; background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(122,108,246,.34); transition: transform .2s ease; }
.quick-tab:active { transform: scale(.92) rotate(5deg); }
.quick-tab svg { width: 23px; height: 23px; stroke-width: 2.2; }

dialog { color: var(--text); }
.bottom-sheet { width: min(100%, 720px); max-width: none; max-height: 94dvh; margin: auto auto 0; padding: 0; overflow: visible; border: 0; background: transparent; }
.bottom-sheet::backdrop { background: rgba(2,3,6,.7); backdrop-filter: blur(4px); }
.sheet-frame { max-height: 94dvh; overflow-x: hidden; overflow-y: auto; padding: 9px 17px calc(18px + env(safe-area-inset-bottom)); border: 1px solid #323642; border-bottom: 0; border-radius: 26px 26px 0 0; background: #15171e; box-shadow: 0 -24px 70px rgba(0,0,0,.36); }
.small-sheet .sheet-frame { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 16px; border-radius: 99px; background: #3b3f4a; }
.sheet-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.sheet-title-row h2 { font-size: 24px; }
.sheet-close { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0 0 3px; border: 0; border-radius: 11px; background: #252832; color: var(--muted); font-size: 24px; }
.recognition-chip { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 11px; border: 1px solid #28513d; border-radius: 13px; background: #173126; }
.recognition-chip > span { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 9px; background: var(--green); color: #092015; font-weight: 900; }
.recognition-chip div { min-width: 0; }
.recognition-chip strong, .recognition-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recognition-chip strong { color: var(--green); font-size: 11px; }
.recognition-chip small { margin-top: 2px; color: #9fb7aa; font-size: 10px; }
.recognition-chip.needs-review { border-color: #5b4623; background: #312817; }
.recognition-chip.needs-review > span { background: var(--yellow); color: #2e2105; }
.recognition-chip.needs-review strong { color: var(--yellow); }
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 15px 0; padding: 4px; border-radius: 14px; background: #22252e; }
.segment { min-width: 0; height: 38px; padding: 0 8px; overflow: hidden; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.segment.active { background: #353149; color: #d2ceff; }
.amount-field, .field { display: grid; gap: 7px; min-width: 0; }
.amount-field > span, .field > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.amount-field > div { display: flex; align-items: center; height: 66px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; background: #101219; }
.amount-field input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 32px; font-weight: 750; letter-spacing: -.03em; }
.amount-field b { color: var(--muted); font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 13px; }
.full-width { grid-column: 1 / -1; }
.field input, .field select { width: 100%; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid var(--line); outline: 0; border-radius: 13px; background: #101219; color: var(--text); font-size: 13px; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.save-button { margin-top: 15px; }
.account-sheet-balance { margin: 12px 0 18px; font-size: 34px; font-weight: 760; letter-spacing: -.04em; }
.account-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.account-actions button { display: grid; place-items: center; min-width: 0; min-height: 86px; padding: 10px 5px; border: 1px solid var(--line); border-radius: 16px; background: #101219; }
.account-actions span { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 8px; border-radius: 11px; background: var(--accent-soft); color: #b7afff; font-size: 18px; }
.account-actions strong { max-width: 100%; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sheet-actions { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #101219; }
.sheet-actions button { font-size: 13px; }
.sheet-actions .danger-action { color: var(--red); }
.safe-delete-note, .setup-footnote { margin: 12px 4px 0; color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; }
.setup-sheet .sheet-frame { padding-top: 22px; }
.setup-mark { width: 58px; height: 58px; margin-bottom: 16px; border-radius: 19px; font-size: 24px; }
.setup-copy h2 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.setup-copy > p:last-child { margin: 8px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.setup-accounts { display: grid; gap: 8px; margin-bottom: 12px; }
.setup-account { display: grid; grid-template-columns: minmax(0, 1fr) 126px; gap: 10px; align-items: center; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 13px; background: #101219; }
.setup-account label { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.setup-account div { display: flex; align-items: center; min-width: 0; }
.setup-account input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-weight: 700; text-align: right; }
.setup-account b { margin-left: 5px; color: var(--muted); }

.loading-state { display: grid; gap: 12px; }
.skeleton { min-height: 110px; border-radius: 20px; background: #171921; animation: pulse 1.2s ease-in-out infinite alternate; }
.skeleton-hero { min-height: 210px; }
.skeleton-input { min-height: 128px; }
.skeleton-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@keyframes pulse { to { background: #20232c; } }
.error-state { display: grid; justify-items: center; padding: 70px 18px; text-align: center; }
.error-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: #3b2023; color: var(--red); font-size: 24px; font-weight: 900; }
.error-state h1 { margin: 17px 0 7px; font-size: 22px; }
.error-state p { max-width: 420px; margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.error-state .primary-button { width: auto; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 11px 15px; border: 1px solid #3b4050; border-radius: 13px; background: #242730; color: var(--text); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s ease, transform .2s ease; font-size: 12px; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: #663137; background: #3b2023; color: #ffd1d5; }

@media (min-width: 620px) {
  .app-shell { padding-inline: 24px; }
  .account-carousel { grid-auto-columns: minmax(250px, 42%); }
  .quick-entry { grid-template-columns: 42px minmax(0, 1fr) minmax(230px, .9fr); align-items: center; }
  .quick-control { grid-column: auto; }
  .report-bar-row { grid-template-columns: 150px minmax(80px, 1fr) 110px; }
}

@media (max-width: 370px) {
  .app-shell { padding-inline: 11px; }
  .hero-card { padding: 16px; }
  .hero-stats > div { padding: 10px 8px; }
  .hero-stats strong { font-size: 12px; }
  .savings-card { grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .savings-ring { width: 74px; height: 74px; }
  .transaction { grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 7px; padding-inline: 9px; }
  .transaction-amount { max-width: 88px; }
  .tab-button { padding-inline: 5px; }
  .tab-button.active { flex-grow: 1.25; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
}

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