*{box-sizing:border-box}body{margin:0;background:#f5f2e9;color:#17251c;font:14px/1.45 system-ui,Segoe UI,sans-serif}button,input{font:inherit}button,.button{cursor:pointer;border:1px solid #bdcbbd;border-radius:8px;background:#fff;padding:8px 11px;color:#063d24;font-weight:700}button:focus-visible,input:focus-visible{outline:3px solid #ffbd30;outline-offset:2px}header{background:#063d24;color:white;padding:22px max(18px,calc((100vw - 1420px)/2));display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}header h1{font-size:29px;margin:2px 0}header p{margin:0;color:#d5e9da}header small{letter-spacing:2px;color:#f8d34b}header button,header .button{background:#064d2d;border-color:#6c997c;color:white}header .actions{display:flex;gap:7px;flex-wrap:wrap}main{max-width:1460px;margin:auto;padding:18px}.panel{background:#fff;border:1px solid #d9dfd4;border-radius:14px;padding:18px;margin-bottom:16px;min-width:0}.row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}h2{font-size:18px;color:#063d24;margin:0}p{margin:3px 0 10px;color:#53645a}nav{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}nav button.active{background:#063d24;color:white}#months button.active,.week-buttons button.active{background:#ffcf36;color:#152318;border-color:#e0ac00}.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}.cards article{border-radius:13px;padding:17px;min-height:132px;display:flex;flex-direction:column;gap:6px}.cards strong{font-size:clamp(22px,2.5vw,34px)}.cards span{font-size:12px}.orange{background:#fa8c17;color:#171e16}.income{background:#d8f5df;color:#063d24;border:1px solid #90cfa5}.expense{background:#fbe1dd;color:#8b1b16;border:1px solid #edb4a9}.ending{background:#063d24;color:white}.week-panel{border:2px solid #8cba91}.week-buttons{display:flex;gap:6px;flex-wrap:wrap}.week-buttons button{font-size:12px;padding:7px 9px}.week-totals{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:16px 0}.week-totals div{padding:13px;background:#f2f6ef;border-radius:10px}.week-totals strong{display:block;font-size:22px}.week-totals small{color:#4b6655}.week-list{display:grid;grid-template-columns:1fr 1fr;gap:12px}.week-list>div{border:1px solid #e0e8dc;border-radius:10px;padding:12px}.week-list h3{margin:0 0 9px;color:#063d24}.line{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px solid #e9eee8}.line small{color:#657368}.line strong{white-space:nowrap}.tables{display:grid;grid-template-columns:1fr 1.35fr;gap:14px}.primary{background:#063d24;color:#fff;border-color:#063d24}.table-nav{display:flex;justify-content:flex-end;gap:5px;margin:9px 0 0}.table-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:12px;min-width:530px}th{text-align:left;background:#eaf1e8;color:#063d24}td,th{padding:8px;border-bottom:1px solid #e4ebe2}td input[type=number]{width:92px}td input[type=date]{width:122px}td input{border:1px solid #d5ded4;border-radius:7px;padding:6px}td button{font-size:11px;padding:5px 7px}td a{color:#006c39}.chart{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:20px 0}.chartweek{text-align:center}.bars{height:145px;display:flex;align-items:end;justify-content:center;gap:6px;border-bottom:1px solid #bcc9bd}.bar{width:30%;border-radius:5px 5px 0 0;min-height:2px}.bar.in{background:#15934b}.bar.out{background:#e44837}.chartweek small{font-size:11px}.all-week{margin:9px 0;border:1px solid #dce8d8;border-radius:9px;padding:10px}.all-week summary{cursor:pointer;font-weight:700}.foot{text-align:center;font-size:12px}dialog{border:1px solid #b9cdbb;border-radius:13px;width:min(460px,94vw);padding:20px}dialog::backdrop{background:#091a13a8}dialog label{display:block;margin:12px 0;font-weight:600}dialog label input{display:block;width:100%;padding:10px;margin-top:5px;border:1px solid #c5d3c4;border-radius:7px}.close{font-size:24px;border:0}.muted{color:#657368;font-size:12px}.warn{background:#fff5cd;padding:9px;border-radius:8px}@media(max-width:850px){.cards{grid-template-columns:repeat(2,1fr)}.tables,.week-list{grid-template-columns:1fr}.week-totals{grid-template-columns:1fr 1fr}header{padding:16px}main{padding:10px}}@media(max-width:420px){.cards{gap:6px}.cards article{padding:10px;min-height:112px}.cards strong{font-size:21px}.week-totals{grid-template-columns:1fr}}
/* Build 9 private sign-in */
body:not(.signed-in) > header,body:not(.signed-in) > main,body:not(.signed-in) > dialog{display:none!important}
.auth-gate{min-height:100vh;display:grid;place-items:center;padding:24px;background:#f6f1e8}
.auth-card{width:min(440px,100%);padding:30px;border-radius:18px;background:white;box-shadow:0 16px 50px #0002;display:grid;gap:16px}
.auth-card label{display:grid;gap:6px;font-weight:600}.auth-card input{width:100%;padding:12px;border:1px solid #aaa;border-radius:8px}
.auth-card button{padding:13px}.auth-card p{line-height:1.5}#loginError,.sync-error{color:#9a1721;font-weight:600}
body.signed-in .auth-gate{display:none}.sync-error{padding:14px;border:2px solid #b9232e;background:#fff0ef;border-radius:8px}
#cloudStatus{font-size:12px;max-width:260px;overflow-wrap:anywhere}
body.signed-in:not(.cloud-ready) main .tables,body.signed-in:not(.cloud-ready) main .week-panel{pointer-events:none;opacity:.55}

/* Build 10 mobile-first spending tracker */
.spend-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:9px;margin:15px 0}.spend-card{display:flex;flex-direction:column;text-align:left;gap:7px;padding:13px;min-height:85px}.spend-card strong{font-size:19px}.spend-card.chosen{border:2px solid #086037;background:#e6f4e9}.spend-detail{border:1px solid #dce6dc;border-radius:12px;padding:14px;background:#fcfdfa}.spend-detail h3{margin:0 0 4px}.spend-form{display:grid;grid-template-columns:1fr 1fr 1.5fr auto;align-items:end;gap:9px;margin:15px 0}.spend-form label{display:flex;flex-direction:column;gap:5px;font-weight:600}.spend-form input{width:100%;min-width:0;padding:10px;border:1px solid #c3d1c5;border-radius:7px}.spend-form button{padding:10px}.spend-entry{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #e3eae3;padding:8px 0}.spend-entry-actions{display:flex;align-items:center;gap:7px}.spend-entry-actions .tiny{font-size:11px;padding:5px 7px}.spend-subtotal{display:flex;justify-content:space-between;font-weight:700;padding:12px 0;border-top:1px solid #cbd8cc}.spend-report{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}.spend-report>div{padding:14px;border-radius:10px;background:#eaf5ed}.spend-report small,.spend-report strong{display:block}.spend-report strong{font-size:24px;margin-top:5px}.spend-weeks{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.spend-week{background:#f3f5f0;border-radius:8px;padding:10px}.spend-week span,.spend-week strong{display:block}.actual-week{font-weight:700;color:#0b6239;margin-bottom:12px}@media(max-width:750px){.spend-form{grid-template-columns:1fr 1fr}.spend-form label:nth-child(3),.spend-form button{grid-column:1/-1}.spend-weeks{grid-template-columns:repeat(2,1fr)}}@media(max-width:420px){.spend-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.spend-card{padding:10px}.spend-entry{align-items:flex-start;flex-direction:column}.spend-entry-actions{width:100%;justify-content:flex-end}.spend-report{grid-template-columns:1fr}}

/* Build 12: separate-page Best of Both financial center */
body{background:#f4f3ef;color:#172c35}header{background:#172c35}header small{color:#d9c59a}header p{color:#cbd8d7}h2{color:#173d45}.panel{border-color:#dce3df;box-shadow:0 2px 10px #172c3509}.primary,nav button.active{background:#174c51;color:white;border-color:#174c51}.ending{background:#174c51}.orange{background:#eee4d4}.income{background:#dcefe6}.expense{background:#f5e6e0}.page-nav{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0 20px}.page-nav button{border-radius:12px;padding:12px 17px;background:#fff;color:#173d45}.page-nav button.active{background:#174c51;color:white}.page-heading{margin:12px 2px 18px}.page-heading small{font-size:11px;letter-spacing:2px;color:#657c79;font-weight:800}.page-heading h2{font-size:26px;margin:5px 0}.page-heading p{margin:3px 0}.budget-page[hidden]{display:none!important}.budget-page .cards{margin-top:0}.budget-page .tables{margin-bottom:14px}.ledger-scroll{overflow:auto;margin-top:18px}.ledger-table{font-size:13px;min-width:630px}.ledger-table th{background:#e9f0ef}.ledger-table td:nth-child(n+3){text-align:right;font-variant-numeric:tabular-nums}.ledger-table th:nth-child(n+3){text-align:right}.ledger-opening{background:#f0f3ed;font-weight:800}.ledger-note{font-size:12px;padding-top:12px;color:#697575}.spend-form input[type=date],td input[type=date],dialog input[type=date]{max-width:155px;min-width:0;font-size:13px;padding:7px}#spendForm label:first-child{max-width:165px}@media(max-width:700px){.page-nav{display:grid;grid-template-columns:1fr 1fr;gap:7px}.page-nav button{font-size:12px;padding:11px 7px}.page-heading h2{font-size:23px}.budget-page .cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Build 13 CyberVault-inspired login (appearance only) */
.auth-gate{padding:24px;background:radial-gradient(circle at 0% 10%,#12452e,#061d14 72%)}
.vault-login{display:grid;grid-template-columns:1fr 1fr;width:min(1180px,100%);min-height:650px;border:1px solid #315447;border-radius:34px;overflow:hidden;box-shadow:0 25px 80px #0004}
.vault-brand{background:#071f16;color:white;padding:clamp(26px,4vw,60px);display:flex;flex-direction:column;align-items:flex-start}
.vault-tag{border:1px solid #315447;border-radius:16px;padding:18px;font-weight:800;background:#ffffff0b}.vault-intro{margin-top:60px;color:#63e5b0;letter-spacing:3px;font-size:12px}.vault-brand h1{font-size:clamp(30px,4vw,58px);line-height:1.06;margin:20px 0}.vault-brand h1 em{font-style:normal;color:#64e1ae}.vault-brand p{color:#b9d4c6;font-size:17px;max-width:420px}.vault-foot{margin-top:auto;color:#82bfa7;font-size:12px}
.vault-login .auth-card{width:100%;border-radius:0;box-shadow:none;background:#f8faf8;padding:clamp(25px,5vw,60px);align-content:center;gap:13px}.vault-login .auth-card h2{font-size:30px;color:#061e17}.vault-login .auth-card small{letter-spacing:3px;color:#066447}.vault-login .auth-card label{font-size:12px;letter-spacing:1px;color:#314f49}.vault-login .auth-card input{font-size:15px;letter-spacing:0}.vault-login .auth-card .primary{background:#006c4d;border:0;color:white;margin-top:12px}.vault-key{background:#d4fae7;border-radius:15px;padding:14px;width:max-content;font-size:23px}.vault-hint{font-size:12px;color:#61786e}.paid-badge{display:inline-block;border-radius:30px;background:#dcf8e5;color:#0d6a37;padding:5px 9px;font-weight:800;margin-right:4px}.signout-actions{display:grid;gap:8px;margin-top:18px}.signout-actions button{padding:12px}
@media(max-width:740px){.vault-login{grid-template-columns:1fr;min-height:auto;border-radius:22px}.vault-brand{padding:24px}.vault-intro{margin-top:20px}.vault-brand h1{font-size:31px}.vault-brand p{font-size:13px}.vault-foot{display:none}.vault-login .auth-card{padding:24px}.auth-gate{padding:12px}}

.security-panel{max-width:850px;margin:auto}.security-card{background:#fff;border:1px solid #dce3df;border-radius:14px;padding:22px;margin:15px 0}.security-card h3{margin:0 0 9px;color:#173d45}.security-form{display:grid;gap:12px;max-width:500px;margin-top:15px}.security-form label{display:grid;gap:6px;font-weight:650}.security-form input{width:100%;box-sizing:border-box;padding:12px;border:1px solid #c6d5d0;border-radius:8px;font-size:16px}.security-form button{justify-self:start}.security-card details{margin-top:16px}.security-card summary{cursor:pointer;font-weight:700;color:#174c51}.security-card .muted{color:#617477;font-size:13px}.security-form [role=status]{min-height:18px;font-size:14px}button:disabled{opacity:.6;cursor:wait}

/* Build 16: visible totals and read-only calculated monthly carryover */
.budget-total-row td{font-weight:700;background:#edf2ed;border-top:2px solid #aebfb0;padding:13px 10px;white-space:nowrap}.budget-total-row.ending-total td{background:#e0efea;color:#144d50}.carryover-derived{display:inline-block;padding:10px 8px;min-width:90px}.carryover-note{font-size:11px;color:#51645e}

.archive-actions{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}.archive-panel{border:1px solid #d5dadb;border-radius:10px;padding:12px;margin-top:10px}.archive-panel summary{cursor:pointer;font-weight:700}.archive-line{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 0;border-bottom:1px solid #e3e5e6}.archive-line span{flex:1;min-width:170px}#archiveView{max-height:65vh;overflow:auto}#archiveView .line{display:flex;justify-content:space-between;gap:15px;padding:6px 0;border-bottom:1px solid #eee}
.ledger-today{outline:2px solid #b45309;outline-offset:-2px;background:#fff5db!important}
