/* A calmer hierarchy and compact, app-like controls across all themes. */
body{background:radial-gradient(ellipse at 92% 0%,color-mix(in srgb,var(--soft) 60%,transparent),transparent 44%),var(--page)}
.app-shell{max-width:1500px;grid-template-columns:220px 1fr}
.sidebar{padding:32px 22px;background:color-mix(in srgb,var(--card) 94%,var(--page));border-color:var(--line)}
.brand{font-size:1.18rem;gap:11px}.brand small{font-size:.64rem;letter-spacing:.18em}
.desktop-nav{margin-top:44px;gap:5px}.nav-item{font-size:.9rem;min-height:48px;padding:13px 14px}
.nav-item.active{box-shadow:inset 3px 0 0 var(--green);font-weight:700}
.sidebar-foot{font-size:.82rem;padding:18px 12px}.sidebar-foot p{line-height:1.6}
.topbar{height:76px;border-bottom:0;background:transparent}.desktop-title{font-size:.7rem;letter-spacing:.16em}
main{padding-top:20px;max-width:1120px}.page-heading{margin-bottom:24px;align-items:center;flex-wrap:wrap}.page-heading>div:first-child{flex:1;min-width:150px}
h1{font-size:1.85rem;font-weight:720;letter-spacing:-.045em}.page-heading p{font-size:.86rem;line-height:1.5;margin-top:5px}
h2{font-size:1rem;font-weight:700}h3{font-weight:650}
.month-control{border-radius:24px;padding:4px 6px;box-shadow:0 2px 8px #00000003}.month-control button{border-radius:50%}.month-control strong{font-size:.82rem}
.panel,.budget-card,.bill-card,.summary-box{box-shadow:0 3px 16px #00000003;border-color:color-mix(in srgb,var(--line) 85%,var(--card))}
.panel{border-radius:20px}.panel-header{padding:23px 24px 13px}.panel-body{padding-bottom:20px}.panel-footer{padding:0 24px 16px}
.primary,.secondary{min-height:46px;border-radius:13px;font-size:.85rem;padding:12px 17px;transition:filter .15s,transform .15s}.primary:active,.secondary:active{transform:scale(.98)}
.icon-button{border-radius:12px;background:transparent;min-height:40px}
.balance-hero{display:block;border-radius:24px;margin-bottom:18px;padding:30px;box-shadow:0 10px 26px color-mix(in srgb,var(--navy) 15%,transparent)}
.balance-layout{display:flex;align-items:center;justify-content:space-between;gap:24px}.balance-layout>div:first-child{min-width:0}
.hero-eyebrow{font-size:.85rem}.hero-eyebrow svg{width:18px;height:18px}
.hero-number{font-size:3.15rem;font-weight:620;margin:10px 0 7px;line-height:1.15;letter-spacing:-.055em;overflow-wrap:anywhere}
.hero-sub{font-size:.82rem;line-height:1.6}.hero-stats{margin-top:26px;padding-top:21px;gap:20px}.hero-stats strong{font-size:1.15rem}.hero-stats span{font-size:.78rem}
.budget-dial{width:116px;height:116px;border-radius:50%;background:conic-gradient(var(--lime) var(--used),#ffffff20 0);padding:7px;flex-shrink:0}
.budget-dial>div{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--navy);border-radius:50%;gap:3px}
.budget-dial strong{font-size:1.35rem;color:var(--lime);font-weight:650}.budget-dial span{font-size:.78rem;color:var(--hero-muted)}
.quick-actions{display:flex;gap:10px;margin-bottom:26px}.quick-actions .primary{flex:1;max-width:240px}.quick-actions .secondary{flex:1;max-width:190px}.quick-actions .theme-emoji{font-size:18px}
.category-row{padding:18px 0;grid-template-columns:42px minmax(0,1fr) auto;gap:12px}.category-name{font-size:.9rem}.category-meta{font-size:.78rem}.category-money{font-size:.94rem}.category-money small{font-size:.75rem}
.category-icon{width:42px;height:42px;border-radius:13px}.category-icon svg{width:21px;height:21px}.category-name{overflow-wrap:anywhere}
.category-row:hover .category-name{color:var(--green)}.progress-track{height:5px;margin-top:9px}
.list-row{padding:17px 0}.row-title{display:block;font-size:.86rem}.row-detail{display:block;font-size:.78rem}.row-amount{font-size:.87rem}.row-main{min-width:0}
.date-tile{display:flex;flex-direction:column;justify-content:center;align-items:center;flex-shrink:0;border:1px solid var(--line);border-radius:12px;width:44px;height:46px;background:var(--page)}
.date-tile small{font-size:.65rem;color:var(--muted);line-height:1.3}.date-tile strong{font-size:1.15rem;line-height:1.3;font-weight:650}
.overview-footnote{font-size:.8rem;line-height:1.6;color:var(--muted);margin-top:24px;display:flex;align-items:flex-start;gap:8px}.overview-footnote svg{width:17px;height:17px;margin-top:3px}
.budget-alert{display:flex;align-items:center;gap:10px;margin:-5px 0 22px;padding:11px 15px;border:1px solid color-mix(in srgb,var(--red) 20%,transparent);border-radius:12px;color:var(--red);font-size:.84rem;background:var(--danger-bg)}.budget-alert>span{flex:1}.budget-alert svg{width:18px;height:18px}.budget-alert .text-button{color:var(--red)}
.summary-strip{gap:12px}.summary-box{border-radius:16px;padding:19px 21px}.summary-box strong{font-size:1.4rem;margin-top:7px}
.budget-grid{gap:16px}.budget-card{border-radius:20px;padding:22px}.budget-card-head{margin-bottom:20px}.budget-remaining strong{font-size:1.8rem}
.rollover-note{font-size:.8rem;line-height:1.65;border:1px solid color-mix(in srgb,var(--green) 8%,transparent)}
.subscription-summary{border:1px solid var(--line);border-radius:22px;padding:26px;background:var(--card);box-shadow:0 3px 16px #00000003;margin-bottom:25px}
.subscription-summary-main{display:flex;align-items:center;gap:17px}.subscription-summary-icon{display:grid;place-items:center;width:62px;height:62px;border-radius:19px;background:var(--soft);color:var(--green);flex-shrink:0}.subscription-summary-icon svg{width:28px;height:28px}.subscription-summary-icon .theme-emoji{font-size:29px;width:32px;height:32px}
.summary-label{font-size:.82rem;color:var(--muted)}.subscription-summary-number{font-size:2.4rem;letter-spacing:-.05em;font-weight:650;line-height:1.35;overflow-wrap:anywhere}.subscription-summary-number>span{font-size:1rem;color:var(--muted);font-weight:450;letter-spacing:0;margin-left:7px}.subscription-summary-main p{font-size:.8rem;color:var(--muted);margin-top:2px}.subscription-summary-main>div:last-child{min-width:0}
.subscription-summary-stats{display:grid;grid-template-columns:1fr 1fr;gap:20px;border-top:1px solid var(--line);margin-top:24px;padding-top:19px}.subscription-summary-stats span{display:block;font-size:.79rem;color:var(--muted)}.subscription-summary-stats strong{display:block;font-size:1.13rem;font-weight:650;margin-top:6px}
.subscription-list{display:grid;grid-template-columns:1fr 1fr;gap:15px}.subscription-card{border:1px solid var(--line);border-radius:18px;background:var(--card);padding:19px;box-shadow:0 3px 16px #00000003;min-width:0}.subscription-card-top{display:flex;align-items:center;gap:12px}.subscription-card h3{font-size:.94rem;overflow-wrap:anywhere}.subscription-card .row-detail{font-size:.76rem}.subscription-card .icon-button{width:32px;height:36px;min-height:36px;border:0}.subscription-card .icon-button svg{width:17px;height:17px}
.service-mark{display:grid;place-items:center;width:45px;height:45px;font-size:1.5rem;border-radius:14px;flex-shrink:0}.subscription-price{white-space:nowrap;text-align:right}.subscription-price strong{font-size:1rem;font-weight:700}.subscription-price span{display:block;color:var(--muted);font-size:.75rem;margin-top:3px}
.subscription-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);margin-top:17px;padding-top:15px}.subscription-card-bottom .secondary{font-size:.76rem;padding:9px 11px;min-height:38px;white-space:nowrap}.renewal-detail{font-size:.79rem;line-height:1.5;color:var(--muted)}.renewal-detail small{font-size:.74rem;display:block;margin-top:3px}.renewal-tag{font-size:.74rem;color:var(--muted);white-space:nowrap}.subscription-card .paid-tag{font-size:.75rem;white-space:nowrap}.subscription-card .paid-tag svg{width:17px;height:17px}.subscription-cancelled .service-mark{filter:grayscale(1);opacity:.7}
.subscription-detail-head{display:flex;align-items:center;gap:16px;margin-bottom:20px}.subscription-detail-head .service-mark{width:60px;height:60px;font-size:2rem}.subscription-detail-head h1{font-size:2.3rem}.subscription-detail-head p{font-size:.85rem;margin-top:4px}
.form-hint{font-size:.79rem;color:var(--muted);line-height:1.6;margin:-7px 0 18px}.form-field input,.form-field select{border-radius:12px}.form-field input[name=amount]{font-size:1.4rem;font-weight:650;min-height:56px}.modal-head{padding-top:22px}.modal-body .form-actions{position:sticky;bottom:0;background:var(--card);padding-top:12px;margin-top:10px}
.settings-section{max-width:690px}.theme-grid{gap:14px}
@media(max-width:1100px){.app-shell{grid-template-columns:205px 1fr}.subscription-list{grid-template-columns:1fr}.balance-hero{padding:26px}.hero-number{font-size:2.8rem}.budget-dial{width:100px;height:100px}}
@media(max-width:800px){.app-shell{display:block}.topbar{height:72px;padding:0 20px}main{padding:14px 20px 112px}.page-heading{align-items:center;margin-bottom:22px}h1{font-size:1.65rem}.page-heading p{font-size:.81rem;max-width:220px}.month-control{padding:3px}.month-control strong{font-size:.78rem;min-width:82px}.month-control button{width:28px;height:32px}.balance-hero{padding:24px 22px;border-radius:23px}.balance-layout{gap:16px}.hero-number{font-size:2.8rem;letter-spacing:-.055em}.hero-sub{font-size:.78rem}.budget-dial{width:84px;height:84px;padding:5px}.budget-dial strong{font-size:1.1rem}.budget-dial span{font-size:.7rem}.hero-stats{margin-top:22px;padding-top:18px;gap:12px}.hero-stats strong{font-size:1rem}.hero-stats span{font-size:.74rem}.quick-actions{margin-bottom:23px}.quick-actions .primary,.quick-actions .secondary{max-width:none;min-height:48px;font-size:.84rem;padding:12px 14px}.panel-header{padding:22px 22px 12px}.panel-body{padding-left:22px;padding-right:22px}.content-grid{gap:19px}.stack{gap:19px}.category-row{padding:18px 0}.bottom-nav{grid-template-columns:repeat(5,minmax(0,1fr));padding:8px 4px max(10px,env(safe-area-inset-bottom))}.bottom-nav .nav-item{padding:8px 2px 5px;gap:7px;min-height:62px;box-shadow:none;min-width:0;justify-content:flex-start}.bottom-nav .nav-label{font-size:12px;line-height:1.1;min-height:27px;display:flex;align-items:flex-start;justify-content:center;text-align:center;display:block;max-width:100%;overflow-wrap:normal}.bottom-nav .nav-item svg,.bottom-nav .nav-item .theme-emoji{height:21px;width:21px}.subscription-summary{padding:23px 21px}.subscription-summary-main{gap:14px}.subscription-summary-icon{width:53px;height:53px;border-radius:16px}.subscription-summary-number{font-size:2rem}.subscription-summary-stats{margin-top:21px;padding-top:17px;gap:12px}.subscription-summary-stats strong{font-size:1.05rem}.subscription-list{grid-template-columns:1fr}.subscription-card{padding:19px}.subscription-card .row-detail{font-size:.76rem}.subheading{gap:10px}.subheading .primary{font-size:.8rem;padding:11px 13px}.bill-card{padding:19px}.bill-date{min-width:47px}.bill-actions .primary{min-height:42px}.summary-box{padding:16px}.summary-box strong{font-size:1.2rem}.settings-section{margin-bottom:19px}.overview-footnote{font-size:.77rem}.hero-eyebrow .theme-emoji{font-size:18px}.toast{bottom:105px}}
@media(max-width:400px){main{padding-left:16px;padding-right:16px}.topbar{padding:0 16px}.hero-number{font-size:2.45rem}.balance-layout{gap:10px}.budget-dial{width:74px;height:74px}.hero-stats strong{font-size:.94rem}.hero-stats span{font-size:.7rem}.hero-sub{font-size:.75rem}.subscription-card-top{gap:10px}.subscription-card{padding:16px}.service-mark{width:39px;height:39px;border-radius:12px;font-size:1.3rem}.subscription-card h3{font-size:.87rem}.subscription-card .icon-button{width:28px;flex-shrink:0}.subscription-price strong{font-size:.9rem}.subscription-price span{font-size:.72rem}.subscription-card .row-detail{font-size:.72rem}.subscription-card-bottom{gap:8px}.renewal-detail{font-size:.76rem}.renewal-tag{font-size:.71rem;white-space:normal;text-align:right}.subscription-summary-number{font-size:1.9rem}.subscription-summary-stats span{font-size:.75rem}.summary-box{padding:13px}.summary-box strong{font-size:1.05rem}.form-grid{gap:10px}}
@media(max-width:350px){.budget-dial{width:66px;height:66px}.hero-number{font-size:2.1rem}.hero-eyebrow{font-size:.76rem}.hero-stats{gap:8px}.hero-stats strong{font-size:.85rem}.page-heading{flex-wrap:wrap;gap:12px}.page-heading p{max-width:none}.quick-actions .primary,.quick-actions .secondary{font-size:.78rem;padding:12px 10px}.subscription-card .row-detail{font-size:.72rem}.subscription-card-top{flex-wrap:wrap}.subscription-card-top .subscription-price{margin-left:auto}.subscription-card-top .row-main{flex-basis:calc(100% - 62px)}.subscription-card-top .icon-button{margin-left:0}.subscription-card-bottom .secondary{font-size:.74rem}.subheading{flex-wrap:wrap}.summary-strip{gap:8px}.summary-box{padding:11px}.summary-box strong{font-size:.95rem}.summary-box span{font-size:.72rem}}
@media(prefers-reduced-motion:reduce){.primary,.secondary{transition:none}}
.reset-section{border-color:color-mix(in srgb,var(--red) 25%,var(--line))}.reset-section .panel-header{padding-bottom:6px}.reset-section h2{color:var(--red)}.reset-section .settings-row{border:0}.reset-section .danger{white-space:nowrap;font-size:.82rem;min-height:46px;border:1px solid color-mix(in srgb,var(--red) 20%,transparent)}
.reset-counts{display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:14px 16px;background:var(--page);border:1px solid var(--line);border-radius:12px;font-size:.82rem;color:var(--muted);margin-bottom:17px}.reset-backup{display:flex;align-items:center;gap:14px;border-bottom:1px solid var(--line);padding:0 0 18px;margin-bottom:20px}.reset-backup p{flex:1;color:var(--muted);font-size:.82rem;line-height:1.55}.reset-backup .secondary{font-size:.79rem;flex-shrink:0;padding:11px 13px}.reset-form .form-actions .primary{background:var(--red)!important;color:var(--card)!important}.reset-form input[name=confirmation]{letter-spacing:.12em;font-weight:600}
@media(max-width:800px){.bottom-nav{grid-template-columns:repeat(6,minmax(0,1fr))}.bottom-nav .nav-label{overflow-wrap:anywhere}.reset-section .settings-row{flex-wrap:wrap}.reset-section .settings-row>div{flex-basis:100%}.reset-section .danger{width:100%}.reset-backup{flex-wrap:wrap}.reset-backup p{flex-basis:100%}.reset-backup .secondary{min-height:44px}}
.privacy-screen #main,.privacy-screen dialog{visibility:hidden}.passkey-login{margin-top:35px}.passkey-login .login-mark{display:grid;place-items:center;width:58px;height:58px;border-radius:18px;background:var(--soft);color:var(--green);margin:6px 0 20px}.passkey-login .login-mark svg{width:28px;height:28px}.passkey-login h1{font-size:1.6rem}.passkey-login .panel-body{padding-top:24px}.passkey-login .primary{width:100%;margin-top:12px}.passkey-message{font-size:.83rem;color:var(--muted);line-height:1.6;margin:0 0 16px}.security-section .settings-row{flex-wrap:wrap}.security-section .settings-row>div{min-width:180px}.security-section .secondary{min-width:110px}

/* Envelope balances share the existing monthly allocation and rollover model. */
.envelope-card{overflow:hidden;border-top:3px solid color-mix(in srgb,var(--green) 38%,var(--card));padding:22px;min-width:0}
.envelope-open{display:block;width:100%;padding:0;background:transparent;color:var(--ink);text-align:left;border:0;border-radius:8px}
.envelope-open:focus-visible{outline:2px solid var(--green);outline-offset:6px}
.envelope-open .budget-card-head{display:flex;align-items:center;gap:12px}
.envelope-name{font-size:1rem;font-weight:650;flex:1;overflow-wrap:anywhere;min-width:0}
.envelope-open .budget-card-head>svg,.envelope-open .budget-card-head>.theme-emoji{width:18px;height:18px;flex-shrink:0;color:var(--muted)}
.envelope-open .budget-remaining{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.envelope-open .progress-track{display:block;margin:16px 0 20px;height:6px}
.envelope-amounts{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.envelope-amounts small{display:block;color:var(--muted);font-size:.75rem;margin-bottom:7px;line-height:1.4}
.envelope-amounts strong{display:block;font-size:.98rem;font-weight:600;overflow-wrap:anywhere}
.envelope-carry{display:flex;align-items:center;gap:7px;margin-top:17px;line-height:1.5;flex-wrap:wrap}
.envelope-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.envelope-actions .secondary{min-height:44px;font-size:.79rem;padding:10px 12px}.envelope-actions .text-button{min-height:44px;font-size:.79rem}
.envelope-detail-balance{display:flex;align-items:center;gap:15px;margin-top:10px}.envelope-detail-balance strong{font-size:2rem;display:block;overflow-wrap:anywhere}.envelope-detail-balance>div{min-width:0}.envelope-detail-balance>div>span{display:block;margin-top:5px;color:var(--muted);font-size:.81rem;line-height:1.5}
.envelope-detail-actions{display:flex;flex-wrap:wrap;gap:10px}.envelope-detail-actions button{flex:1;min-height:46px;font-size:.84rem}
.envelope-history-title{font-size:.95rem;margin:27px 0 8px}.envelope-card:hover{border-top-color:var(--green)}
@media(max-width:800px){.envelope-card{padding:20px}.envelope-name{font-size:.95rem}.envelope-open .budget-remaining strong{font-size:1.9rem}.bottom-nav .nav-item[data-view=budgets] .nav-label{font-size:11px}}
@media(max-width:350px){.envelope-card{padding:18px}.envelope-actions{gap:8px}.envelope-detail-actions button{flex-basis:100%}}
