/* Moneta V9.3 production stylesheet; ordered to preserve pre-existing CSS cascade. */

/* styles.css */
:root{--bg:#f7f8fb;--ink:#242833;--muted:#9297a6;--sub:#686e7e;--line:#eaecf1;--accent:#f36d5d;--green:#31ad8b;--purple:#8d7ded;--shadow:0 8px 32px rgba(25,35,60,.025);--radius:19px;--side:240px;font-family:Inter,"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,sans-serif;color:var(--ink);font-synthesis:none;-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}body{margin:0;background:var(--bg);min-width:320px;font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}input,select,textarea{color:var(--ink)}a{color:inherit}svg{display:block}.icon{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.sprite{height:0;width:0;position:absolute;overflow:hidden}.app-shell{min-height:100vh;display:flex}.sidebar{width:var(--side);flex:0 0 var(--side);background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:33px 18px 20px;min-height:100vh;position:sticky;top:0;height:100vh;z-index:10}.brand{display:flex;align-items:center;gap:11px;padding:0 13px 48px}.brand-mark{width:38px;height:38px;color:var(--accent)}.brand-mark svg{width:100%;height:100%}.brand-name{font-size:21px;font-weight:800;letter-spacing:-1px;line-height:1}.brand-name span{color:var(--accent)}.brand-sub{font-size:9px;color:#a3a7b0;letter-spacing:1.65px;margin-top:6px;font-weight:800}.nav-caption{color:#adb1bc;font-size:10px;letter-spacing:1.3px;font-weight:750;padding:0 15px;margin-bottom:14px}.main-nav{display:flex;flex-direction:column;gap:5px}.nav-item{width:100%;height:47px;border:0;background:transparent;display:flex;align-items:center;gap:13px;padding:0 15px;text-align:left;border-radius:11px;color:#777e8d;font-weight:600;transition:background .15s,color .15s}.nav-item .icon{width:19px;height:19px;stroke-width:1.7}.nav-item:hover{background:#f9f8f8;color:#383d49}.nav-item.active{background:#fff0ed;color:#ed6455}.nav-item.active .icon{stroke-width:2.15}.sidebar-spacer{flex:1}.tip-card{background:#fff5f2;border-radius:15px;padding:18px 15px;margin:15px 3px}.tip-icon{display:flex;width:32px;height:32px;border-radius:10px;background:#fff;color:var(--accent);align-items:center;justify-content:center;margin-bottom:13px}.tip-head{font-weight:800;font-size:13px}.tip-card p{color:#92817d;font-size:11.5px;line-height:1.6;margin:7px 0 0}.local-status{display:flex;align-items:center;gap:8px;padding:10px 13px 0;color:#9399a6;font-size:11px}.status-dot{width:7px;height:7px;border-radius:50%;background:#4fc8a7}.main-layout{min-width:0;flex:1}.topbar{height:105px;display:flex;align-items:center;justify-content:space-between;padding:17px 39px 14px;border-bottom:1px solid var(--line);background:#fff;gap:16px}.topbar-kicker{display:block;color:#a3a6b2;font-size:10px;font-weight:750;letter-spacing:1.5px;margin-bottom:6px}.topbar h1{font-size:23px;letter-spacing:-.65px;margin:0;font-weight:750}.topbar-actions{display:flex;align-items:center;gap:16px}.month-control{display:flex;align-items:center;justify-content:space-between;gap:5px;background:#f8f8fa;border:1px solid #f0f0f2;border-radius:11px;padding:4px 6px;height:42px;min-width:196px;font-weight:700;font-size:12px}.icon-button{border:0;background:none;display:flex;align-items:center;justify-content:center;color:#8b90a0;border-radius:8px;width:32px;height:32px}.icon-button:hover{background:#eeeef2;color:#343946}.icon-button .icon{width:17px;height:17px}.button{height:42px;display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap;border-radius:10px;padding:0 17px;font-weight:700;font-size:12px;border:1px solid transparent;transition:transform .15s,background .15s,box-shadow .15s}.button:active{transform:translateY(1px)}.button .icon{width:16px;height:16px}.button-primary{background:var(--accent);color:#fff;box-shadow:0 5px 14px rgba(243,109,93,.16)}.button-primary:hover{background:#e95e4d}.button-secondary{background:#fff;color:#3d4351;border:1px solid #e9eaf0}.button-secondary:hover{background:#f8f9fc}.button-danger{background:#fff4f3;color:#c8473f;border-color:#ffdad5}.button-danger:hover{background:#ffe8e4}main{padding:35px 39px 60px;max-width:1660px;margin:auto}.page{display:none;animation:enter .23s ease}.page.is-active{display:block}@keyframes enter{from{opacity:.7;transform:translateY(3px)}to{opacity:1;transform:none}}.page-heading,.section-intro{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:27px}.eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:800;color:var(--accent);margin-bottom:9px}.page-heading h2,.section-intro h2{font-size:24px;letter-spacing:-.8px;margin:0 0 7px;font-weight:770}.page-heading p,.section-intro p{color:var(--muted);font-size:12.5px;margin:0}.sun-symbol{color:#ffc975;font-size:24px}.date-pill{display:flex;align-items:center;gap:9px;border:1px solid var(--line);padding:11px 13px;border-radius:10px;color:#707585;background:#fff;font-size:11px;font-weight:650}.date-pill .icon{width:15px;height:15px}.demo-banner{background:#fff3df;color:#925e1e;border:1px solid #f9e6bf;border-radius:11px;padding:13px 16px;margin:0 0 20px;font-size:12px;display:flex;justify-content:space-between;align-items:center;gap:16px}.demo-banner[hidden]{display:none}.demo-banner button{border:0;background:none;color:#9d631e;font-size:12px;font-weight:800;display:inline-flex;align-items:center;white-space:nowrap;gap:4px}.demo-banner .icon{width:13px;height:13px}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px;margin-bottom:19px}.stat-card{position:relative;overflow:hidden;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:23px 23px 19px;min-height:167px;box-shadow:var(--shadow)}.stat-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11.5px;color:#7e8491;font-weight:650;position:relative;z-index:1}.stat-symbol{height:35px;width:35px;border-radius:11px;display:flex;align-items:center;justify-content:center}.stat-symbol .icon{width:18px;height:18px;stroke-width:2}.stat-symbol.dark{background:rgba(255,255,255,.15);color:#fff}.stat-symbol.mint,.setting-icon.mint{background:#e5f8f1;color:#1eac87}.stat-symbol.peach,.setting-icon.peach{background:#fff0e9;color:#ed8060}.stat-symbol.lilac,.setting-icon.lilac{background:#f1eeff;color:#8a74e6}.stat-number{position:relative;z-index:1;font-size:27px;font-weight:800;letter-spacing:-1.3px;margin-top:14px;line-height:1.2;white-space:nowrap}.stat-desc{position:relative;z-index:1;display:flex;align-items:center;gap:6px;color:#a2a7b4;font-size:11px;margin-top:13px;line-height:1.2}.mini-dot{height:7px;width:7px;border-radius:50%;display:inline-block}.mini-dot.green{background:#25b38b}.mini-dot.coral{background:#fa8d79}.balance-card{background:#303b53;color:#fff;border-color:#303b53}.balance-card .stat-head,.balance-card .stat-desc{color:#bfc8d7}.balance-art{position:absolute;bottom:-30px;right:-18px;width:180px;height:105px;display:flex;align-items:flex-end;gap:9px;opacity:.20;transform:rotate(-10deg)}.balance-art span{background:#b6c9e7;border-radius:6px 6px 0 0;flex:1}.balance-art span:nth-child(1){height:25%}.balance-art span:nth-child(2){height:43%}.balance-art span:nth-child(3){height:29%}.balance-art span:nth-child(4){height:55%}.balance-art span:nth-child(5){height:44%}.balance-art span:nth-child(6){height:74%}.balance-art span:nth-child(7){height:93%}.insights-grid{display:grid;grid-template-columns:minmax(0,1.52fr) minmax(300px,1fr);gap:18px;margin-bottom:19px}.surface{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.flow-panel,.breakdown-panel{min-height:354px;padding:24px}.surface-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.surface-head h3{margin:0 0 7px;font-size:15px;letter-spacing:-.3px;font-weight:760}.surface-head p{font-size:11.5px;color:#a1a5b2;margin:0;line-height:1.4}.chart-legend{display:flex;gap:13px;margin-top:2px}.chart-legend span{display:flex;gap:6px;align-items:center;font-size:10.5px;color:#949aa6}.legend-square{height:8px;width:8px;border-radius:3px;display:inline-block}.legend-square.in{background:#75c8b1}.legend-square.out{background:#f8a18f}.bar-chart{height:250px;display:grid;grid-template-columns:42px 1fr;gap:11px;margin-top:23px}.chart-y{height:215px;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;padding-bottom:1px;color:#a9adb7;font-size:10px}.chart-body{min-width:0;height:250px;position:relative}.chart-grid{position:absolute;top:0;left:0;right:0;height:215px;display:flex;flex-direction:column;justify-content:space-between;pointer-events:none}.chart-grid span{border-top:1px dashed #edf0f3;width:100%}.chart-bars{position:absolute;top:0;left:0;right:0;height:215px;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));align-items:end;gap:10px;padding:0 4px}.chart-pair{display:flex;justify-content:center;align-items:flex-end;gap:5px;height:100%;max-width:100px;width:100%;margin:auto}.chart-bar{width:21%;min-width:8px;max-width:23px;border-radius:6px 6px 2px 2px;height:var(--bar-height);transition:height .3s ease;position:relative}.chart-bar.income{background:#74c7b1}.chart-bar.expense{background:#f6a091}.chart-bar:hover{filter:saturate(1.5)}.chart-months{position:absolute;left:0;right:0;top:227px;display:grid;grid-template-columns:repeat(6,1fr);gap:10px;color:#a4a9b4;font-size:10px;text-align:center}.donut-wrap{display:flex;justify-content:center;margin:22px 0 21px}.donut{height:168px;width:168px;background:conic-gradient(#eff1f5 0 100%);border-radius:50%;display:grid;place-items:center}.donut-hole{width:124px;height:124px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.025)}.donut-hole small{font-size:10px;color:#a6aab4;margin-bottom:6px}.donut-hole strong{font-size:17px;letter-spacing:-.5px}.breakdown-legend{display:grid;grid-template-columns:1fr 1fr;gap:11px 13px}.breakdown-legend-item{display:flex;justify-content:space-between;align-items:center;gap:8px;min-width:0;color:#858b98;font-size:10.5px}.breakdown-legend-item .name{display:flex;align-items:center;gap:7px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakdown-legend-item .swatch{height:8px;width:8px;border-radius:3px;flex:0 0 8px}.breakdown-legend-item strong{color:#444959;font-size:10.5px;font-weight:700}.recent-panel{padding:24px}.text-link{border:0;background:transparent;color:var(--accent);font-size:11.5px;font-weight:750;display:flex;align-items:center;gap:5px}.text-link .icon{width:14px;height:14px}.recent-list{margin-top:15px}.recent-item{display:flex;align-items:center;gap:12px;padding:14px 0;border-top:1px solid #f0f1f4}.recent-item:first-child{border-top:0}.tx-icon{width:39px;height:39px;border-radius:12px;background:#f4f5f8;color:#66748b;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:15px;flex:0 0 auto}.tx-icon.income{background:#eaf7f1;color:#2ca880}.tx-icon.expense{background:#fff0ed;color:#f17c69}.tx-icon.transfer{background:#f1efff;color:#8879da}.tx-details{flex:1;min-width:0}.tx-title{font-weight:750;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tx-meta{color:#a1a6b2;font-size:10.5px;margin-top:5px}.tx-amount{font-weight:750;font-size:12.5px;white-space:nowrap}.tx-amount.income{color:#299f7f}.tx-amount.expense{color:#e57565}.tx-amount.transfer{color:#747c8d}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#9aa0ae;text-align:center;min-height:190px}.empty-illustration{width:48px;height:48px;border-radius:17px;background:#fff2ee;color:#ed7a69;display:grid;place-items:center;margin-bottom:13px}.empty-state strong{color:#454b5a;font-size:13px;margin-bottom:5px}.empty-state p{font-size:11.5px;margin:0;max-width:320px;line-height:1.7}.empty-state .button{margin-top:18px}.section-intro{margin-bottom:24px}.section-intro h2{font-size:24px}.section-pill{background:#fff;border:1px solid var(--line);border-radius:9px;padding:10px 14px;color:#89909f;font-size:11px;font-weight:650}.ledger-surface{overflow:hidden;min-height:390px}.filters{padding:20px 23px;display:flex;justify-content:space-between;gap:15px;align-items:center;border-bottom:1px solid var(--line)}.search-field,.filter-select-wrap{display:flex;align-items:center;gap:9px;border:1px solid #e9ebef;background:#fafbfc;border-radius:10px;height:39px;padding:0 12px;color:#a0a5b1}.search-field{width:min(380px,100%)}.search-field .icon,.filter-select-wrap .icon{height:16px;width:16px}.search-field input{width:100%;border:0;background:transparent;outline:0;font-size:12px}.search-field input::placeholder{color:#adb1bd}.filter-select-wrap select{appearance:none;border:0;outline:0;background:transparent;font-weight:650;font-size:11px;color:#717889;min-width:82px}.table-scroll{overflow-x:auto}.ledger-table{border-collapse:collapse;width:100%;min-width:720px}.ledger-table th{text-align:left;background:#fafbfd;color:#a5aab5;font-size:10px;font-weight:800;letter-spacing:.55px;text-transform:uppercase;padding:15px 23px}.ledger-table td{padding:16px 23px;border-top:1px solid #f0f1f4;font-size:12px;color:#7d8491}.ledger-table .right{text-align:right}.ledger-table .row-title{font-weight:750;color:#303644;display:flex;align-items:center;gap:11px}.ledger-table .tx-icon{height:35px;width:35px;border-radius:11px;font-size:13px}.tx-category{font-size:11px;color:#798191}.row-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px}.row-actions button{width:30px;height:30px;border:0;background:transparent;color:#a0a5af;display:grid;place-items:center;border-radius:7px}.row-actions button:hover{background:#f2f3f5;color:#353b49}.row-actions .icon{width:16px;height:16px}.table-empty{padding:60px 15px!important;text-align:center!important;color:#a5aab5!important}.budget-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;padding:27px;margin-bottom:18px}.budget-summary>div:not(.budget-summary-progress){display:flex;flex-direction:column;gap:9px}.budget-summary span{font-size:11px;color:#9ba0ae}.budget-summary strong{font-size:24px;letter-spacing:-.7px}.budget-summary-progress{height:8px;border-radius:30px;background:#f0f1f5;grid-column:1/-1;overflow:hidden}.budget-summary-progress span{display:block;height:100%;background:#f6a08e;border-radius:30px;transition:width .3s}.budget-grid,.account-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px}.budget-card,.account-card{padding:23px}.budget-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.category-badge{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;font-size:18px;flex:0 0 auto}.budget-card h3{font-size:13px;margin:0;font-weight:750}.budget-card p{color:#9ca1af;font-size:11px;margin:6px 0 0}.budget-card-bottom{display:flex;justify-content:space-between;gap:7px;align-items:center;margin-top:24px;font-size:11px;color:#a0a6b2}.budget-card-bottom strong{color:#444a58;font-size:12px}.progress-track{height:7px;border-radius:30px;background:#f0f2f6;overflow:hidden;margin-top:12px}.progress-fill{height:100%;border-radius:30px;background:var(--fill);width:var(--percent)}.progress-fill.over{background:#e65e55}.budget-card-footer{display:flex;justify-content:space-between;align-items:center;gap:9px;margin-top:12px;color:#a0a4b1;font-size:10.5px}.small-btn{background:#f6f7f9;color:#6e7788;border:0;border-radius:8px;padding:8px 11px;font-size:11px;font-weight:700}.small-btn:hover{background:#eeeff3}.account-totals{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:18px}.small-stat{display:flex;flex-direction:column;gap:10px;padding:23px}.small-stat span{color:#989fac;font-size:11px}.small-stat strong{font-size:23px;letter-spacing:-.6px}.account-card-head{display:flex;justify-content:space-between;align-items:center;gap:9px}.account-card .account-title{margin:0;font-size:13px;font-weight:750}.account-card .account-type{margin:6px 0 0;color:#a5a9b5;font-size:11px}.account-card .account-value{font-size:25px;letter-spacing:-.8px;font-weight:800;margin-top:27px}.account-card .account-note{font-size:11px;color:#a0a6b3;margin-top:8px}.account-card .account-value.debt{color:#dc7362}.account-avatar{height:39px;width:39px;border-radius:12px;background:#eef1ff;color:#827add;display:grid;place-items:center}.account-avatar.credit{background:#fff0e8;color:#e88962}.account-avatar .icon{height:20px;width:20px}.info-strip{display:flex;gap:12px;background:#f0f3fa;border-radius:12px;margin-top:20px;padding:15px 18px;color:#737c8b;font-size:11.5px;line-height:1.6}.info-strip .icon{color:#8090b1}.settings-stack{display:flex;flex-direction:column;gap:15px;max-width:990px}.setting-card{padding:22px 24px;display:flex;align-items:center;gap:18px}.setting-icon{display:grid;place-items:center;height:45px;width:45px;border-radius:13px;flex:0 0 45px}.setting-icon.red{background:#fff0f0;color:#d85959}.setting-copy{flex:1;min-width:0}.setting-copy h3{font-size:13px;margin:0 0 6px}.setting-copy p{font-size:11.5px;line-height:1.55;margin:0;color:#999fad}.setting-copy code{font-size:11px;color:#667085;background:#f2f4f8;border-radius:4px;padding:2px 4px}.setting-detail{margin-top:9px;font-size:10px;color:#a5abb6}.setting-detail span{margin:0 5px}.fine-print{display:flex;align-items:center;gap:8px;color:#a6abb5;font-size:11px;margin:20px 6px}.fine-print .icon{width:16px;height:16px}.modal-overlay{position:fixed;inset:0;background:rgba(25,29,45,.47);backdrop-filter:blur(4px);z-index:100;display:flex;align-items:center;justify-content:center;padding:20px}.modal-overlay[hidden]{display:none}.modal{background:#fff;width:min(510px,100%);max-height:min(90vh,830px);overflow-y:auto;border-radius:21px;box-shadow:0 35px 110px rgba(18,22,35,.2);padding:28px}.modal-head{display:flex;justify-content:space-between;align-items:start;margin-bottom:24px}.modal-head h2{font-size:22px;letter-spacing:-.6px;margin:0}.modal-head .eyebrow{margin-bottom:7px}.close-button{background:#f5f6f8;width:32px;height:32px}.type-switch{display:grid;grid-template-columns:repeat(3,1fr);background:#f5f6f9;padding:4px;border-radius:10px;gap:4px;margin-bottom:23px}.type-switch button{height:36px;border:0;background:transparent;border-radius:8px;color:#868d9e;font-size:12px;font-weight:750}.type-switch button.active{background:#fff;color:#e97564;box-shadow:0 2px 8px rgba(0,0,0,.04)}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.field{display:flex;flex-direction:column;gap:8px;margin-bottom:17px;min-width:0}.field.full{grid-column:1/-1}.field label{font-size:11.5px;font-weight:750;color:#545b6b}.field input,.field select{height:43px;border-radius:10px;border:1px solid #e6e8ee;background:#fff;outline:0;padding:0 12px;font-size:12.5px;width:100%;min-width:0}.field input:focus,.field select:focus{border-color:#ef9d90;box-shadow:0 0 0 3px rgba(243,109,93,.08)}.field-help{color:#a5a9b4;font-size:10px;margin:0}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px;padding-top:18px;border-top:1px solid #f0f1f3}.form-error{color:#d4574e;font-size:11px;margin:0 0 10px;min-height:13px}.toast{position:fixed;right:22px;bottom:24px;padding:13px 18px;background:#303b53;color:#fff;border-radius:11px;font-size:12px;font-weight:650;box-shadow:0 12px 35px rgba(20,25,45,.17);z-index:200;opacity:0;transform:translateY(12px);pointer-events:none;transition:all .2s}.toast.show{opacity:1;transform:translateY(0)}.toast.error{background:#d65f56}
@media(max-width:1280px){:root{--side:215px}main{padding:30px 28px 45px}.topbar{padding:17px 28px}.stat-card{padding:20px 17px}.stat-number{font-size:23px}.flow-panel,.breakdown-panel{padding:20px}.stats-grid{gap:12px}.insights-grid{gap:12px}.budget-grid,.account-grid{gap:12px}}
@media(max-width:1000px){.stats-grid{grid-template-columns:repeat(2,1fr)}.insights-grid{grid-template-columns:1fr}.breakdown-panel{display:grid;grid-template-columns:1fr 190px 1.1fr;align-items:center;min-height:220px}.breakdown-panel .surface-head{align-self:start}.breakdown-panel .donut-wrap{margin:0}.breakdown-panel .breakdown-legend{grid-template-columns:1fr}.budget-grid,.account-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){:root{--side:0px}.app-shell{display:block}.sidebar{position:fixed;bottom:0;left:0;right:0;top:auto;width:100%;height:66px;min-height:0;background:#fff;padding:5px 7px;box-shadow:0 -4px 15px rgba(30,40,60,.04);border-top:1px solid var(--line);border-right:0}.brand,.nav-caption,.sidebar-spacer,.sidebar-bottom{display:none}.main-nav{flex-direction:row;justify-content:space-around;gap:2px;height:100%}.nav-item{height:55px;flex:1;min-width:0;flex-direction:column;justify-content:center;gap:4px;padding:5px 0;font-size:9px}.nav-item .icon{width:19px;height:19px}.nav-item.active{background:#fff1ef}.topbar{height:87px;padding:14px 17px}.topbar h1{font-size:20px}.topbar-kicker{font-size:9px}.topbar-actions{gap:7px}.month-control{min-width:145px;height:38px;font-size:10px;padding:2px 2px}.icon-button{width:27px;height:28px}.topbar .button{height:38px;width:38px;padding:0;font-size:0}.topbar .button .icon{height:20px;width:20px}main{padding:22px 16px 100px}.page-heading h2,.section-intro h2{font-size:21px}.page-heading{margin-bottom:18px}.date-pill{display:none}.stats-grid{gap:11px;margin-bottom:12px}.stat-card{min-height:139px;padding:16px 13px;border-radius:15px}.stat-head{font-size:10px}.stat-symbol{height:28px;width:28px;border-radius:9px}.stat-symbol .icon{height:15px;width:15px}.stat-number{font-size:21px;letter-spacing:-.9px;margin-top:14px}.stat-desc{font-size:10px;margin-top:10px}.insights-grid{gap:12px;margin-bottom:12px}.surface{border-radius:15px}.flow-panel,.breakdown-panel{padding:18px;min-height:auto}.flow-panel{height:335px}.bar-chart{height:235px}.breakdown-panel{display:block}.breakdown-panel .donut-wrap{margin:22px 0}.breakdown-panel .breakdown-legend{grid-template-columns:1fr 1fr}.recent-panel{padding:18px}.section-intro{align-items:flex-start}.section-pill{padding:8px;font-size:10px}.filters{padding:13px;gap:9px}.search-field{width:60%}.filter-select-wrap{min-width:110px}.budget-grid,.account-grid{grid-template-columns:1fr 1fr;gap:11px}.budget-card,.account-card{padding:17px}.account-totals{gap:9px}.small-stat{padding:16px 12px}.small-stat span{font-size:10px}.small-stat strong{font-size:17px}.budget-summary{padding:20px;gap:10px}.budget-summary strong{font-size:18px}.budget-summary span{font-size:10px}.setting-card{flex-wrap:wrap;gap:12px;padding:18px}.setting-card .button{margin-left:57px}.modal-overlay{padding:10px}.modal{padding:23px 20px;border-radius:17px}.toast{bottom:77px;left:16px;right:16px;text-align:center}.demo-banner{flex-direction:column;align-items:flex-start}}
@media(max-width:420px){.budget-grid,.account-grid{grid-template-columns:1fr}.month-control{min-width:133px}.stats-grid{gap:8px}.stat-card{padding:14px 11px}.stat-number{font-size:19px}.stat-head{font-size:9px}.stat-desc{font-size:9px}.chart-legend{gap:7px}.chart-legend span{font-size:9px}.date-pill{display:none}.field-grid{grid-template-columns:1fr}.field.full{grid-column:1}.modal-actions .button{flex:1}}
/* Honor semantic hidden state even on flex containers. */
.month-control[hidden]{display:none}


/* theme.css */
/* Moneta V2 • blue / white bento theme with system-independent dark mode */
:root {
  --bg:#f7f9ff;
  --ink:#172744;
  --sub:#5c6980;
  --muted:#8490a6;
  --line:#e7edfa;
  --accent:#1460ea;
  --green:#11a586;
  --purple:#8165ec;
  --shadow:0 10px 25px rgba(30,72,143,.035);
  --radius:18px;
  --surface:#fff;
  --soft:#f5f8ff;
  --divider:#eaf0f9;
}
body{background:var(--bg);color:var(--ink)}
.sidebar{background:var(--surface);border-color:var(--line)}
.brand-name{font-size:23px;letter-spacing:-1.1px}
.brand-name span{color:var(--accent)}
.brand-mark{color:#1460ea}
.brand-sub,.nav-caption{color:#91a0bb}
.nav-item{color:#6c7a90}
.nav-item:hover{background:#f2f6ff;color:#1a59ca}
.nav-item.active{background:#eaf1ff;color:#1257d9;font-weight:760}
.tip-card{background:#edf4ff}
.tip-head{color:#1b4eaf}
.tip-card p{color:#6c80a4}
.tip-icon{color:#1460ea}
.topbar{background:linear-gradient(111deg,#1354d9 0%,#1466ed 60%,#3484ff 100%);border-color:transparent;color:#fff;box-shadow:0 10px 22px rgba(35,91,201,.1)}
.topbar-kicker{color:#b8d5ff;letter-spacing:1.8px}
.topbar h1{color:#fff;font-weight:800}
.topbar .month-control{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.18);color:#fff;backdrop-filter:blur(8px)}
.topbar .icon-button{color:#eef5ff}
.topbar .icon-button:hover{background:rgba(255,255,255,.18);color:#fff}
.topbar .button-primary{background:#fff;color:#145bdf;border-color:transparent;box-shadow:0 5px 15px rgba(0,36,102,.13)}
.topbar .button-primary:hover{background:#eaf1ff}
.theme-toggle{height:41px;display:flex;align-items:center;gap:8px;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.13);border-radius:11px;color:#fff;padding:0 13px;white-space:nowrap;font-size:11.5px;font-weight:750;transition:background .15s}
.theme-toggle:hover{background:rgba(255,255,255,.24)}
.theme-toggle .icon{width:16px;height:16px}
main{padding-top:31px}
.eyebrow{color:var(--accent)}
.page-heading h2,.section-intro h2{font-weight:800;letter-spacing:-.7px}
.page-heading p,.section-intro p{color:var(--muted)}
.date-pill,.section-pill{border-color:var(--line);background:var(--surface);color:var(--sub)}
.surface,.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.stats-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.stat-card{min-height:165px;padding:22px 21px}
.stat-head{color:var(--sub)}
.stat-number{color:var(--ink);font-size:26px}
.stat-desc{color:var(--muted);line-height:1.5}
.stat-card:nth-child(2){background:linear-gradient(132deg,#ffffff 56%,#e8faf5 100%)}
.stat-card:nth-child(3){background:linear-gradient(132deg,#ffffff 56%,#fff0f3 100%)}
.stat-card:nth-child(4){background:linear-gradient(132deg,#ffffff 56%,#f0eaff 100%)}
.stat-card:nth-child(2)::after,.stat-card:nth-child(3)::after,.stat-card:nth-child(4)::after{content:'';position:absolute;top:0;left:22px;right:22px;height:3px;border-radius:0 0 9px 9px}
.stat-card:nth-child(2)::after{background:#13b995}.stat-card:nth-child(3)::after{background:#f77991}.stat-card:nth-child(4)::after{background:#9579f1}
.balance-card,.stat-card.balance-card{background:linear-gradient(130deg,#165bdc 0%,#3386fb 100%);color:#fff;border-color:transparent}
.balance-card .stat-number{color:#fff}
.balance-card .stat-head,.balance-card .stat-desc{color:#e3eefd}
.balance-card .stat-symbol.dark{background:rgba(255,255,255,.2)}
.balance-art{opacity:.24}
.stat-symbol.mint,.setting-icon.mint{background:#e4f9f3;color:#079b7d}
.stat-symbol.peach,.setting-icon.peach{background:#ffebf0;color:#dc617b}
.stat-symbol.lilac,.setting-icon.lilac{background:#f0ebff;color:#805dde}
.setting-icon.blue{background:#e7efff;color:#1460ea}
.flow-panel,.breakdown-panel,.recent-panel{border-radius:20px}
.surface-head h3{color:var(--ink)}
.surface-head p,.chart-legend span{color:var(--muted)}
.legend-square.in,.chart-bar.income{background:#16b997}
.legend-square.out,.chart-bar.expense{background:#669cff}
.chart-grid span{border-color:var(--divider)}
.chart-y,.chart-months{color:var(--muted)}
.donut-hole{background:var(--surface)}
.donut-hole small{color:var(--muted)}
.donut-hole strong{color:var(--ink)}
.breakdown-legend-item{color:var(--sub)}
.breakdown-legend-item strong{color:var(--ink)}
.recent-item{border-color:var(--divider)}
.tx-title,.empty-state strong,.account-card .account-title,.budget-card h3{color:var(--ink)}
.tx-meta,.account-card .account-type,.budget-card p,.account-card .account-note{color:var(--muted)}
.tx-icon.expense{background:#eaf1ff;color:#2b68d8}
.tx-icon.income{background:#def9f2;color:#079c7b}
.tx-icon.transfer{background:#eeeaff;color:#7351d4}
.tx-amount.expense{color:#e1627d}.tx-amount.income{color:#059c77}
.filters{border-color:var(--line)}
.search-field,.filter-select-wrap{background:var(--soft);border-color:var(--line);color:var(--sub)}
.search-field input,.filter-select-wrap select{color:var(--ink)}
.ledger-table th{background:var(--soft);color:var(--muted)}
.ledger-table td{border-color:var(--divider);color:var(--sub)}
.ledger-table .row-title{color:var(--ink)}
.ledger-table tr:hover td{background:rgba(30,102,223,.018)}
.tx-category{color:var(--sub)}
.row-actions button:hover{background:var(--soft);color:var(--ink)}
.review-tag{display:inline-block;margin-left:7px;padding:3px 7px;border-radius:6px;font-size:10px;font-weight:750;background:#fff0d6;color:#925b13;vertical-align:middle}
.text-link{color:var(--accent)}
.budget-summary span,.small-stat span,.budget-card-bottom,.budget-card-footer{color:var(--muted)}
.budget-card-bottom strong,.budget-summary strong,.small-stat strong{color:var(--ink)}
.budget-summary-progress,.progress-track{background:var(--divider)}
.budget-summary-progress span{background:#4c88f4}
.small-btn,.close-button{background:var(--soft);color:var(--sub)}
.small-btn:hover,.close-button:hover{background:var(--divider)}
.account-avatar{background:#e7efff;color:#3479e8}
.account-avatar.credit{background:#fff0f4;color:#ea6687}
.account-card .account-value{color:var(--ink)}
.account-card .account-value.debt{color:#e56482}
.info-strip{background:#edf4ff;color:#526c9f}
.info-strip .icon{color:#4375d4}
.setting-copy p,.setting-detail,.fine-print{color:var(--muted)}
.setting-copy code{color:var(--sub);background:var(--soft)}
.button-primary{background:#1460ea;box-shadow:0 5px 15px rgba(20,96,234,.15)}
.button-primary:hover{background:#1252c7}
.button-secondary{background:var(--surface);color:var(--ink);border-color:var(--line)}
.button-secondary:hover{background:var(--soft)}
.modal{background:var(--surface);color:var(--ink)}
.modal-actions{border-color:var(--divider)}
.type-switch{background:var(--soft)}
.type-switch button{color:var(--muted)}
.type-switch button.active{background:var(--surface);color:var(--accent)}
.field label{color:var(--sub)}
.field input,.field select{border-color:var(--line);background:var(--surface);color:var(--ink)}
.field input:focus,.field select:focus{border-color:#1460ea;box-shadow:0 0 0 3px rgba(20,96,234,.1)}
.field-help{color:var(--muted)}
.toast{background:#173b75}
.import-banner{display:flex;align-items:center;gap:14px;padding:17px 19px;margin-bottom:21px;background:#edf4ff;border:1px solid #d6e5ff;border-radius:16px;color:#27559e}
.import-banner[hidden]{display:none}
.import-banner-mark{background:#d8e8ff;color:#1460ea;border-radius:12px;display:grid;place-items:center;flex:0 0 37px;height:37px}
.import-banner-copy{flex:1;min-width:0}
.import-banner-copy strong{font-size:12.5px;color:#1b4691}
.import-banner-copy p{font-size:11.5px;line-height:1.55;margin:5px 0 0;color:#607eaf}
.review-link{background:#fff;color:#1460ea;border:1px solid #d8e6fc;border-radius:10px;padding:11px 13px;display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:11px;font-weight:800}
.review-link:hover{background:#f8fbff}
.review-link .icon{width:14px;height:14px}
/* Dark palette */
:root[data-theme="dark"]{
 color-scheme:dark;
 --bg:#0c1526;--ink:#ecf2ff;--sub:#b2bfd8;--muted:#90a0bd;--line:#243656;--accent:#74a7ff;--green:#39cfad;--purple:#ae94ff;--shadow:0 10px 28px rgba(0,0,0,.14);--surface:#152239;--soft:#1b2d49;--divider:#283954;
}
[data-theme="dark"] .sidebar{background:#101c31}
[data-theme="dark"] .brand-mark{color:#6ca1ff}
[data-theme="dark"] .brand-sub,[data-theme="dark"] .nav-caption{color:#7d91b4}
[data-theme="dark"] .nav-item{color:#a6b6d1}
[data-theme="dark"] .nav-item:hover{background:#1d3556;color:#d3e2ff}
[data-theme="dark"] .nav-item.active{background:#203e6d;color:#94bfff}
[data-theme="dark"] .tip-card{background:#1a3154}
[data-theme="dark"] .tip-icon{background:#263f67;color:#bdd8ff}
[data-theme="dark"] .tip-head{color:#d3e3ff}
[data-theme="dark"] .tip-card p{color:#a6bcdf}
[data-theme="dark"] .topbar{background:linear-gradient(115deg,#122e71,#174baa 65%,#2463c7)}
[data-theme="dark"] .topbar-kicker{color:#bfd5ff}
[data-theme="dark"] .topbar .button-primary{background:#dceaff;color:#17479d}
[data-theme="dark"] .topbar .button-primary:hover{background:#fff}
[data-theme="dark"] .stat-card:nth-child(2){background:linear-gradient(125deg,#152239 55%,#173f40)}
[data-theme="dark"] .stat-card:nth-child(3){background:linear-gradient(125deg,#152239 55%,#44283d)}
[data-theme="dark"] .stat-card:nth-child(4){background:linear-gradient(125deg,#152239 55%,#302a58)}
[data-theme="dark"] .stat-card.balance-card{background:linear-gradient(125deg,#1751ae,#2b70d6);border-color:#2760b9}
[data-theme="dark"] .stat-card.balance-card .stat-head,[data-theme="dark"] .balance-card .stat-desc{color:#dae9ff}
[data-theme="dark"] .stat-symbol.mint,[data-theme="dark"] .setting-icon.mint{background:#184a42;color:#60e0c1}
[data-theme="dark"] .stat-symbol.peach,[data-theme="dark"] .setting-icon.peach{background:#4e2c40;color:#ff9ab1}
[data-theme="dark"] .stat-symbol.lilac,[data-theme="dark"] .setting-icon.lilac{background:#362c63;color:#b3a0ff}
[data-theme="dark"] .setting-icon.blue{background:#243c67;color:#92bdff}
[data-theme="dark"] .review-tag{background:#573e1f;color:#ffcc78}
[data-theme="dark"] .tx-icon.expense{background:#253f67;color:#a9c8ff}
[data-theme="dark"] .tx-icon.income{background:#18493e;color:#81e8c8}
[data-theme="dark"] .tx-icon.transfer{background:#34305c;color:#b7a7ff}
[data-theme="dark"] .tx-amount.expense{color:#ff95ac}
[data-theme="dark"] .tx-amount.income{color:#76e0c0}
[data-theme="dark"] .account-avatar{background:#263e66;color:#92b9ff}
[data-theme="dark"] .account-avatar.credit{background:#4b293f;color:#ff9ab8}
[data-theme="dark"] .account-card .account-value.debt{color:#ff9eb0}
[data-theme="dark"] .info-strip{background:#1a3154;color:#bbd1f3}
[data-theme="dark"] .info-strip .icon{color:#9dbdff}
[data-theme="dark"] .import-banner{background:#1c3253;border-color:#294b7a;color:#d6e6ff}
[data-theme="dark"] .import-banner-mark{background:#274671;color:#afcfff}
[data-theme="dark"] .import-banner-copy strong{color:#e1ebff}
[data-theme="dark"] .import-banner-copy p{color:#abbfe1}
[data-theme="dark"] .review-link{background:#234373;color:#d7e7ff;border-color:#3763a0}
[data-theme="dark"] .review-link:hover{background:#2d5184}
[data-theme="dark"] .setting-icon.red{background:#522b3a;color:#ff9db2}
[data-theme="dark"] .button-danger{background:#3a2534;color:#ffb2c2;border-color:#67394c}
[data-theme="dark"] .type-switch button.active{box-shadow:0 2px 10px rgba(0,0,0,.15)}
[data-theme="dark"] .modal-overlay{background:rgba(3,9,20,.72)}
[data-theme="dark"] .field input::placeholder{color:#8698b9}
[data-theme="dark"] .ledger-table tr:hover td{background:#1b2c45}
[data-theme="dark"] select option{background:#152239;color:#eef2ff}
[data-theme="dark"] .empty-illustration{background:#27365c;color:#a4c2ff}
[data-theme="dark"] .account-card .account-note{color:#97a9c8}
[data-theme="dark"] .setting-copy code{background:#213451}
[data-theme="dark"] .mini-dot{filter:brightness(1.15)}
@media(max-width:1000px){.theme-toggle span{display:none}.theme-toggle{width:40px;padding:0;justify-content:center}}
@media(max-width:760px){
 .sidebar{background:var(--surface);border-color:var(--line)}
 [data-theme="dark"] .sidebar{background:#101c31}
 .topbar{height:86px;padding:14px 16px}
 .topbar-actions{gap:7px}
 .theme-toggle{height:38px;width:34px;flex:0 0 34px}
 .topbar .month-control{height:38px;min-width:132px;padding:1px}
 .topbar .month-control .icon-button{width:25px}
 .topbar .button{background:#fff;color:#145bdf}
 main{padding:21px 15px 100px}
 .stats-grid{gap:10px}
 .stat-card{padding:16px 13px;min-height:137px}
 .stat-number{font-size:20px}
 .import-banner{align-items:flex-start;flex-wrap:wrap;padding:14px;gap:10px}
 .review-link{margin-left:47px}
 .nav-item.active{background:#e8f0ff;color:#1b57cb}
 [data-theme="dark"] .nav-item.active{background:#203e6d;color:#94bfff}
}
@media(max-width:450px){
 .topbar .month-control{min-width:116px;font-size:9px}
 .topbar-actions{gap:5px}
 .theme-toggle{width:30px;flex-basis:30px}
 .stat-number{font-size:19px}
 .stat-card{border-radius:14px}
 .topbar h1{font-size:19px}
 .import-banner-mark{display:none}
 .review-link{margin-left:0}
}

html[data-theme="dark"] .sidebar .nav-item.active{background:#203e6d !important;color:#b4d1ff !important}


/* responsive.css */
/* Moneta V4 — fluid, mobile-first layout.  No device-model specific rules. */
/* Shared safeguards: content sizes to its own container, not an assumed viewport. */
html { scroll-behavior: smooth; }
body { min-width: 0; max-width: 100%; overflow-x: clip; }
.app-shell, .main-layout, main, .page, .surface, .stat-card, .topbar-left,
.topbar-actions, .import-banner-copy, .tx-details, .setting-copy { min-width: 0; }
.main-layout { width: 100%; container-type: inline-size; container-name: moneta-canvas; }
main { width: min(100%, 1480px); margin-inline: auto; }
.page-heading > div, .section-intro > div, .surface-head > div { min-width: 0; }
.button, .nav-item, .theme-toggle, .month-control, .row-actions button,
.review-link { touch-action: manipulation; }
:focus-visible { outline: 3px solid #7aafff; outline-offset: 3px; }
button, select { -webkit-tap-highlight-color: transparent; }
.stat-number, .small-stat strong, .budget-summary strong, .account-value {
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stat-card { min-width: 0; }
.stat-head > span:first-child { min-width: 0; overflow-wrap: break-word; }
.stat-symbol { flex: 0 0 auto; }
.stat-number { max-width: 100%; white-space: nowrap; line-height: 1.15; letter-spacing: -.05em; }
.stat-desc { overflow-wrap: break-word; }
/* Summary cards follow available content width. Wide viewports can have 4; narrow workspaces 2. */
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 226px), 1fr)); gap: 14px; }
.stat-card { min-height: 152px; padding: clamp(16px,2cqw,24px); }
.stat-number { font-size: clamp(19px,2.1cqw,28px); }
.insights-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.surface-head { flex-wrap: wrap; gap: 10px 18px; }
.chart-legend { flex-wrap: wrap; }
.bar-chart { width: 100%; max-width: 100%; min-width: 0; }
.chart-body { min-width: 0; }
.chart-bars { gap: clamp(2px, 1cqw, 12px); }
.chart-months { gap: clamp(2px,1cqw,12px); }
.breakdown-panel { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.breakdown-panel .donut-wrap { width: 100%; margin: 15px 0; }
.donut { width: clamp(154px,23cqw,190px); height: clamp(154px,23cqw,190px); flex: 0 0 auto; }
.donut-hole { width: 73%; height: 73%; }
.breakdown-panel .breakdown-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px 16px; }
.breakdown-legend-item { min-width: 0; gap: 6px; }
.breakdown-legend-item .name { min-width: 0; display: flex; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.breakdown-legend-item strong { flex: 0 0 auto; }
.recent-item { min-width: 0; }
.recent-item .tx-details { min-width: 0; }
.tx-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { overflow-wrap: break-word; line-height: 1.5; }
.tx-amount { flex: 0 0 auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.budget-grid, .account-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 14px; }
.account-totals { grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); gap: 12px; }
.budget-summary { grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); gap: 12px; }
.small-stat, .budget-card, .account-card { min-width: 0; }
.account-card .account-value { overflow-wrap: anywhere; }
.filters { flex-wrap: wrap; }
.search-field { min-width: 0; flex: 1 1 210px; }
.filter-select-wrap { min-width: 0; flex: 0 1 210px; }
.filter-select-wrap select { max-width: 100%; }
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ledger-table { width: 100%; min-width: 690px; }
.ledger-table th, .ledger-table td { padding-inline: clamp(10px,1.5vw,22px); }
.ledger-table .row-title { min-width: 0; }
.row-title-text { max-width: 290px; min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setting-card { min-width: 0; }
.setting-card .button { max-width: 100%; }
.modal { max-width: 100%; }
.modal-overlay { overscroll-behavior: contain; }
/* Keep the last page content visible above the bottom navigation & phone home indicator. */
@media (max-width: 959px) {
  :root { --side: 0px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; inset-inline: 0; z-index: 30;
    display: block; width: 100%; height: calc(66px + env(safe-area-inset-bottom, 0px)); min-height: 0;
    padding: 5px max(8px, env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));
    border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,25,75,.12);
    background: var(--surface); }
  html[data-theme="dark"] .sidebar { background: #101c31; }
  .brand,.nav-caption,.sidebar-spacer,.sidebar-bottom { display: none; }
  .main-nav { height: 100%; width: 100%; display: flex; flex-direction: row; gap: clamp(2px,1vw,8px); align-items: stretch; }
  .nav-item { display: flex; flex: 1 1 20%; min-width: 0; max-width: none; height: 56px;
    flex-direction: column; gap: 3px; align-items: center; justify-content: center;
    padding: 5px 1px; border-radius: 11px; font-size: clamp(9px,1.6vw,11px); line-height: 1.25; }
  .nav-item .icon { width: 20px; height: 20px; }
  .topbar { min-height: 84px; height: auto; padding: 14px clamp(16px,3vw,30px); }
  .topbar-actions { gap: 9px; }
  .theme-toggle { flex-shrink: 0; width: 40px; height: 40px; padding: 0; justify-content: center; }
  .theme-toggle span { display: none; }
  .topbar .month-control { flex-shrink: 0; min-width: 156px; height: 40px; }
  .topbar .button-primary { flex-shrink: 0; }
  main { padding: 24px clamp(16px,3vw,30px) calc(104px + env(safe-area-inset-bottom,0px)); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-card { min-height: 146px; }
  .stat-number { font-size: clamp(20px,3.4cqw,28px); }
  .breakdown-panel .donut-wrap { margin-block: 19px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom,0px)); }
}
/* Phone-first: navigation and controls breathe; content never assumes a 390px phone. */
@media (max-width: 599px) {
  .topbar { display: grid; grid-template-columns: minmax(0,1fr) 42px 42px;
    grid-template-rows: auto 42px; align-items: center; column-gap: 9px; row-gap: 12px;
    padding: 17px clamp(12px,3.7vw,20px) 15px; }
  .topbar-left { grid-column: 1; grid-row: 1; }
  .topbar h1 { font-size: clamp(19px,5.1vw,24px); }
  .topbar-actions { display: contents; }
  .topbar .theme-toggle { grid-column: 2; grid-row: 1; width: 42px; height: 42px; }
  .topbar .button-primary { grid-column: 3; grid-row: 1; width: 42px; min-width: 42px; height: 42px; padding: 0; }
  .topbar .button-primary span { display: none; }
  .topbar .button-primary .icon { width: 21px; height: 21px; }
  .topbar .month-control { grid-column: 1 / -1; grid-row: 2; height: 42px;
    width: 100%; min-width: 0; max-width: none; padding: 2px 8px; font-size: 12px; }
  .month-control .icon-button { height: 36px; width: 38px; }
  #monthLabel { min-width: 0; white-space: nowrap; font-size: clamp(11px,3vw,13px); }
  main { padding: 21px clamp(12px,3.7vw,20px) calc(102px + env(safe-area-inset-bottom,0px)); }
  .page-heading { align-items: flex-start; margin-bottom: 20px; }
  .page-heading h2 { font-size: clamp(20px,5.5vw,26px); line-height: 1.2; }
  .page-heading p,.section-intro p { line-height: 1.55; }
  .date-pill { display: none; }
  .section-intro { flex-wrap: wrap; gap: 9px; }
  .section-intro h2 { font-size: 22px; }
  .import-banner { display: grid; grid-template-columns: minmax(0,1fr); padding: 16px; gap: 10px; }
  .import-banner-mark { display: none; }
  .import-banner .review-link { width: 100%; min-height: 42px; margin: 0; justify-content: center; }
  .import-banner-copy strong { font-size: 12px; }
  .import-banner-copy p { font-size: 11.5px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .stat-card { padding: clamp(12px,3.3vw,18px); min-height: 146px; border-radius: 16px; }
  .stat-head { font-size: 10px; gap: 7px; }
  .stat-symbol { height: 28px; width: 28px; border-radius: 9px; }
  .stat-symbol .icon { width: 15px; height: 15px; }
  .stat-number { margin-top: 16px; font-size: clamp(16px,4.6vw,23px); }
  .stat-desc { font-size: 10px; margin-top: 10px; }
  .surface { border-radius: 16px; }
  .flow-panel, .breakdown-panel, .recent-panel { padding: 18px clamp(13px,3.7vw,20px); }
  .flow-panel { height: auto; min-height: 330px; }
  .bar-chart { grid-template-columns: 34px minmax(0,1fr); gap: 7px; height: 248px; }
  .chart-y { font-size: 9px; }
  .chart-bars, .chart-months { gap: 3px; }
  .chart-pair { gap: 3px; }
  .chart-bar { min-width: 4px; }
  .chart-legend { gap: 7px 13px; }
  .chart-legend span { font-size: 10px; }
  .breakdown-panel .donut-wrap { margin: 18px 0; }
  .breakdown-panel .breakdown-legend { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 14px; }
  .breakdown-legend-item { font-size: 10px; }
  .recent-item { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; }
  .recent-item .tx-icon { width: 36px; height: 36px; flex: none; }
  .recent-item .tx-amount { font-size: 11px; }
  .recent-panel .surface-head { align-items: flex-start; }
  .filters { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; padding: 12px; }
  .search-field,.filter-select-wrap { width: 100%; min-width: 0; }
  .filter-select-wrap select { width: 100%; }
  /* Transaction cards, avoiding an unreadable sideways table on phones. */
  .ledger-surface { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .ledger-surface .filters { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); margin-bottom: 12px; }
  .table-scroll { overflow: visible; }
  .ledger-table, .ledger-table tbody { display: block; width: 100%; min-width: 0; }
  .ledger-table thead { display: none; }
  .ledger-table tbody tr:not(.empty-row) { display: grid; width: 100%; grid-template-columns: minmax(0,1fr) auto; gap: 12px 10px;
    padding: 16px 14px; margin-bottom: 10px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
  .ledger-table tbody td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; text-align: left; }
  .ledger-table tbody td:not(.ledger-identity)::before { content: attr(data-label); display: block; color: var(--muted); margin-bottom: 4px;
    font-size: 9px; letter-spacing: .35px; text-transform: uppercase; font-weight: 750; }
  .ledger-table tbody td.ledger-identity { grid-column: 1/-1; border-bottom: 1px solid var(--divider); padding-bottom: 12px; }
  .ledger-table .row-title { display: flex; gap: 9px; min-width: 0; }
  .ledger-table .row-title-text { min-width: 0; max-width: none; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; font-size: 12px; }
  .ledger-table td[data-label="Date"] { grid-column: 1; }
  .ledger-table td[data-label="Category"] { grid-column: 2; text-align: right; }
  .ledger-table td[data-label="Account"] { grid-column: 1/-1; }
  .ledger-table td.ledger-amount { grid-column: 1; }
  .ledger-table td.ledger-actions { grid-column: 2; text-align: right; }
  .ledger-table .row-actions { justify-content: flex-end; }
  .ledger-table .row-actions button { width: 40px; height: 40px; border-radius: 10px; background: var(--soft); }
  .ledger-table tbody tr.empty-row { display: block; background: var(--surface); border-radius: 15px; }
  .ledger-table tbody tr.empty-row td { display: block; }
  .ledger-table .table-empty { text-align: center; padding: 30px 12px !important; }
  .ledger-pagination { display: flex; flex-direction: column; gap: 10px; align-items: stretch; background: var(--surface);
    border: 1px solid var(--line); border-radius: 14px; padding: 15px; text-align: center; }
  .ledger-pagination .button { width: 100%; }
  .account-totals { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .account-totals .small-stat:last-child { grid-column: 1/-1; }
  .budget-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .budget-summary > div:nth-child(3) { grid-column: 1/-1; }
  .budget-grid,.account-grid { grid-template-columns: minmax(0,1fr); }
  .setting-card { display: grid; grid-template-columns: 42px minmax(0,1fr); padding: 18px; gap: 12px; }
  .setting-card .setting-icon { grid-column: 1; grid-row: 1; }
  .setting-card .setting-copy { grid-column: 2; grid-row: 1; }
  .setting-card .button { margin: 0; width: 100%; grid-column: 1/-1; grid-row: 2; min-height: 42px; }
  .modal-overlay { padding: max(12px,env(safe-area-inset-top,0px)) 12px max(12px,env(safe-area-inset-bottom,0px)); }
  .modal { width: 100%; max-height: min(90dvh,860px); padding: 22px 18px; overflow-y: auto; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .field.full { grid-column: 1; }
  .toast { inset-inline: 12px; text-align: center; }
}
/* Narrow screens including foldables: a single legible summary column. */
@media (max-width: 359px) {
  .stats-grid { grid-template-columns: minmax(0,1fr); }
  .stat-card { min-height: 127px; }
  .stat-number { font-size: clamp(21px,7vw,26px); }
  .stat-head { font-size: 12px; }
  .topbar { grid-template-columns: minmax(0,1fr) 39px 39px; column-gap: 7px; }
  .topbar .theme-toggle, .topbar .button-primary { width: 39px; min-width: 39px; }
  .nav-item { font-size: 9px; letter-spacing: -.15px; }
  .nav-item .icon { width: 19px; height: 19px; }
  .chart-legend { gap: 4px 9px; }
  .chart-legend span { font-size: 9px; }
  .breakdown-panel .breakdown-legend { grid-template-columns: minmax(0,1fr); }
  .recent-item { grid-template-columns: 32px minmax(0,1fr); }
  .recent-item .tx-icon { width: 32px; height: 32px; }
  .recent-item .tx-amount { grid-column: 2; justify-self: start; }
  .account-totals,.budget-summary { grid-template-columns: minmax(0,1fr); }
  .account-totals .small-stat:last-child, .budget-summary > div:nth-child(3) { grid-column: auto; }
  .ledger-table tbody tr:not(.empty-row) { padding: 14px 12px; }
  .ledger-table .row-actions { gap: 6px; }
  .ledger-table .row-actions button { width: 36px; height: 38px; }
}
/* Tablet portrait and laptops with tighter working areas: donut and legend share a row only when space permits. */
@container moneta-canvas (min-width: 690px) and (max-width: 1059px) {
  .breakdown-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,1fr); align-items: center; gap: 10px; }
  .breakdown-panel .surface-head { grid-column: 1/-1; }
  .breakdown-panel .breakdown-legend { grid-template-columns: minmax(0,1fr); }
}
/* Two chart cards side by side only when the actual content column has ample space. */
@container moneta-canvas (min-width: 1060px) {
  .insights-grid { grid-template-columns: minmax(0,1.55fr) minmax(0,.95fr); }
  .breakdown-panel .breakdown-legend { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
/* Fixed sidebar returns on spacious screens. Its width is part of available content width. */
@media (min-width: 960px) {
  :root { --side: clamp(210px,17vw,244px); }
  .app-shell { display: flex; }
  .sidebar { width: var(--side); flex: 0 0 var(--side); position: sticky; height: 100dvh; min-height: 0; top: 0; }
  .main-layout { flex: 1 1 0; }
  .topbar { padding-inline: clamp(22px,3vw,42px); }
  .topbar-actions { gap: clamp(8px,1.2vw,16px); }
  main { padding-inline: clamp(20px,3vw,44px); }
  .stats-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,226px),1fr)); }
}
@media (min-width: 960px) and (max-width: 1140px) {
  .topbar .button-primary span { display: none; }
  .topbar .button-primary { width: 42px; padding: 0; }
  .theme-toggle span { display: none; }
  .theme-toggle { width: 42px; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* features.css */
/* Mobile-first labeled graph and Google Pay upload features */
.graph-mode-control{display:flex;align-items:center;gap:6px;margin:12px 0 6px;flex-wrap:wrap}
.mode-chip{border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:999px;padding:8px 13px;font:inherit;font-size:12px;cursor:pointer}
.mode-chip.active{background:#2063d8;border-color:#2063d8;color:#fff}
.labeled-chart{min-width:0;width:100%;padding:5px 0 10px}
.labeled-chart[hidden],.donut-wrap[hidden],#importPreview[hidden],#importOverlay[hidden]{display:none!important}
.labeled-chart svg{display:block;width:100%;height:auto;max-height:395px;overflow:visible}
.pie-label{fill:var(--ink);font-family:inherit;font-size:19px;font-weight:700}
.pie-percent{fill:var(--muted);font-family:inherit;font-size:16px}
.graph-empty{text-align:center;color:var(--muted);padding:50px 12px}
.import-modal{width:min(720px,100%);max-height:min(94dvh,880px);overflow-y:auto}
.import-modal-content{padding:2px 23px 24px}
.import-intro{font-size:13px;line-height:1.7;color:var(--muted);margin-bottom:16px}
.upload-drop{border:2px dashed #80a6ef;border-radius:17px;background:rgba(54,122,245,.055);min-height:142px;padding:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;cursor:pointer;color:var(--ink)}
.upload-drop .icon{width:27px;height:27px;color:#3975f6}
.upload-drop small,.import-filename{font-size:12px;color:var(--muted)}
#importOverlay input[type=file]{position:absolute;width:1px;height:1px;opacity:0}
.import-filename{min-height:16px;overflow-wrap:anywhere}
.import-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:16px 0}
.import-kpis>div{border:1px solid var(--line);border-radius:11px;padding:12px 10px;min-width:0;background:var(--surface)}
.import-kpis small{display:block;color:var(--muted);font-size:10px;margin-bottom:7px}
.import-kpis strong{font-size:21px;font-weight:800;color:var(--ink)}
.import-sums{display:flex;flex-wrap:wrap;gap:7px 20px;font-size:12px;color:var(--muted)}
.import-sums b{color:var(--ink)}
.import-good{color:#0da682;font-size:12px;font-weight:650;margin-block:12px}
.import-warning{color:#d38a19;font-size:12px;margin-block:12px}
.import-blockers{background:rgba(250,73,108,.08);color:#e06c79;padding:12px;border-radius:12px;font-size:12px;margin:10px 0}
.import-blockers ul{margin:7px 0 0;padding-left:20px}
.import-preview-scroll{overflow-x:auto;max-height:245px;overflow-y:auto;border:1px solid var(--line);border-radius:10px;margin-top:14px}
.import-preview-scroll .ledger-table{min-width:490px;width:100%;font-size:11px}
.import-preview-scroll .ledger-table th,.import-preview-scroll .ledger-table td{padding:10px}
#importOverlay .modal-actions{position:sticky;bottom:-24px;background:var(--surface);padding:15px 0 0;flex-wrap:wrap}
.gpay-setting{border-color:#79a9f5!important}
@media (max-width:600px){
 .import-modal{width:100%;max-height:calc(100dvh - 32px);border-radius:18px}
 .import-modal-content{padding:4px 15px 15px}
 .import-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
 .import-preview-scroll .ledger-table{display:table!important;width:100%!important;min-width:490px!important}
 .import-preview-scroll .ledger-table thead{display:table-header-group!important}
 .import-preview-scroll .ledger-table tbody{display:table-row-group!important}
 .import-preview-scroll .ledger-table tr{display:table-row!important}
 .import-preview-scroll .ledger-table td{display:table-cell!important}
 .labeled-chart svg{max-height:none}
 .pie-label{font-size:11.5px}.pie-percent{font-size:11px}
}

.pie-inside,.pie-inside-percent{font-family:inherit;font-size:12px;font-weight:800;fill:#fff;paint-order:stroke;stroke:rgba(0,0,0,.18);stroke-width:2px;stroke-linejoin:round}
.pie-inside-percent{font-size:11px;font-weight:700}
@media(max-width:620px){.labeled-chart svg{width:min(100%,320px);margin-inline:auto}.breakdown-panel .breakdown-legend{font-size:12px}.breakdown-legend-item{font-size:11px!important}}

.banner-actions,.section-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.banner-actions .review-link{min-height:39px;white-space:nowrap;margin:0}
.section-actions .button{min-height:39px;padding:9px 12px}
@media(max-width:600px){.banner-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.banner-actions .review-link{min-width:0;width:100%;padding:9px 7px;gap:5px;font-size:11px}.section-actions{width:100%}.section-actions .button{margin-left:auto}}
@media(max-width:320px){.banner-actions{grid-template-columns:minmax(0,1fr)}}
/* Import account mapping proposal: no changes occur before confirmation */
.import-account-notice{margin:12px 0;padding:14px;border:1px solid rgba(43,144,255,.35);border-radius:14px;background:rgba(47,132,230,.09);color:var(--ink);overflow-wrap:anywhere}
.import-account-notice strong{display:block;margin-bottom:8px}
.import-account-notice ul{margin:0 0 9px 0;padding-left:21px}
.import-account-notice li{padding:3px 0}
.import-account-notice li span{opacity:.75}
.import-account-notice p{font-size:13px;line-height:1.5;margin:0;opacity:.85}


/* v67.css */
/* Moneta V6 + V7. Content-first cards; no device-model media queries. */
.v67-card-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:13px;margin-bottom:16px; }
.v67-kpi { padding:20px;min-width:0;display:flex;flex-direction:column;gap:10px; }
.v67-kpi span {font-size:12px;color:var(--muted);font-weight:650;}
.v67-kpi strong {font-size:clamp(19px,2.2vw,29px);line-height:1.18;letter-spacing:-.03em;overflow-wrap:anywhere;}
.v67-kpi small {font-size:11px;line-height:1.45;color:var(--muted);}
.v67-kpi.v67-warn {border-color:#f4b845;}
.v67-two-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,430px),1fr));gap:16px;margin-bottom:16px;}
.v67-panel {padding:clamp(16px,2.2vw,26px);margin-bottom:16px;min-width:0;}
.v67-two-grid>.v67-panel {margin-bottom:0;}
.v67-panel .surface-head {margin-bottom:18px;}
.v67-panel h4 {font-size:13px;margin:20px 0 12px;}
.v67-panel button {touch-action:manipulation;}
.v67-empty {font-size:13px;color:var(--muted);line-height:1.6;padding:15px 0;}
.v67-list-row {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 0;border-bottom:1px solid var(--divider);font-size:13px;min-width:0;}
.v67-list-row:last-child {border-bottom:0;}
.v67-list-row>span:first-child {min-width:0;overflow-wrap:anywhere;flex:1;}
.v67-list-row span small {display:block;color:var(--muted);margin-top:5px;font-size:11px;line-height:1.4;overflow-wrap:anywhere;}
.v67-list-row strong {overflow-wrap:anywhere;}
.v67-list-row strong.expense {color:#df687a;}.v67-list-row strong.income {color:#0bb79a;}
.v67-counts {text-align:right;white-space:nowrap;}
.v67-inline-actions {display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px;margin-bottom:5px;}
.v67-amount-actions {display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;text-align:right;}
.v67-tiny-btn {font-size:11px;border:1px solid var(--line);background:var(--soft);color:var(--text);padding:9px 10px;border-radius:9px;min-height:34px;cursor:pointer;}
.v67-goal {padding-bottom:8px;margin-bottom:7px;border-bottom:1px solid var(--divider);}.v67-goal .progress-track {margin:0 0 9px;}
.v67-footnote {font-size:12px;color:var(--muted);line-height:1.6;margin-top:10px;}
.v67-insight-message {padding:15px;border-radius:12px;background:var(--soft);display:flex;flex-direction:column;gap:6px;margin-bottom:11px;}
.v67-insight-message strong {font-size:15px;}.v67-insight-message span {font-size:12px;color:var(--muted);line-height:1.5;}
.v67-insight-message.v67-warn {border-left:3px solid #eead37;}
.v67-calendar {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin:10px 0 18px;}
.v67-weekday {text-align:center;font-size:10px;font-weight:700;color:var(--muted);padding:5px 0;}
.v67-day {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:var(--surface);border:1px solid var(--line);border-radius:10px;min-width:0;min-height:52px;padding:5px 2px;color:var(--text);cursor:pointer;font-variant-numeric:tabular-nums;}
.v67-day small {color:var(--muted);font-size:9px;white-space:nowrap;}
.v67-day.chosen {outline:2px solid #4383f3;outline-offset:-2px;}
.v67-day-heading {display:flex;gap:10px;justify-content:space-between;align-items:center;padding:12px 0;color:var(--text);font-size:12px;border-top:1px solid var(--divider);flex-wrap:wrap;}
.v67-day-heading span {color:var(--muted);}
.v67-more-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:12px;}
.v67-more-grid button {font:inherit;font-weight:700;text-align:left;padding:22px;display:flex;align-items:center;justify-content:space-between;color:var(--text);cursor:pointer;min-height:72px;}
.nav-mobile-more {display:none;}
.v67-bulk {display:flex;flex-wrap:wrap;align-items:center;gap:13px;padding:12px 16px;margin-bottom:12px;}
.v67-bulk>span {font-size:12px;color:var(--muted);margin-right:auto;}
.v67-check-label {display:flex;align-items:center;gap:8px;font-size:12px;font-weight:650;cursor:pointer;line-height:1.5;}
.v67-check-label input,.v67-row-select {width:18px;height:18px;accent-color:#2574f4;cursor:pointer;flex:0 0 auto;}
.ledger-table th.v67-checkbox-head,.ledger-table td.v67-checkbox-cell {width:34px;min-width:34px;text-align:center;padding-right:2px;}
.v67-purpose {display:block;color:var(--muted);font-size:10px;margin-top:6px;}
.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;}
@media(max-width:959px){
  .main-nav .nav-item[data-nav="budgets"],.main-nav .nav-item[data-nav="accounts"],.main-nav .nav-item[data-nav="settings"]{display:none;}
  .main-nav .nav-mobile-more{display:flex;}
  .main-nav .nav-item{flex-basis:20%;}
}
@media(max-width:599px){
  .v67-card-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .v67-kpi {padding:14px;gap:9px;}.v67-kpi strong{font-size:clamp(15px,4.2vw,21px);}.v67-kpi span{font-size:10px;}.v67-kpi small{font-size:10px;}
  .v67-two-grid {grid-template-columns:minmax(0,1fr);gap:12px;}
  .v67-panel {padding:15px;margin-bottom:12px;}
  .v67-list-row {align-items:flex-start;flex-wrap:wrap;gap:9px;}
  .v67-list-row .v67-amount-actions {width:100%;justify-content:flex-start;text-align:left;}
  .v67-calendar {gap:3px;}.v67-day {min-height:44px;border-radius:8px;}.v67-day small{font-size:8px;}
  .v67-bulk {padding:13px;}.v67-bulk .button{width:100%;}
  .ledger-table tbody tr:not(.empty-row){grid-template-columns:34px minmax(0,1fr) auto;}
  .ledger-table tbody td.v67-checkbox-cell{grid-column:1;grid-row:1;display:flex;align-items:center;min-height:35px;}
  .ledger-table tbody td.v67-checkbox-cell::before {display:none;}
  .ledger-table tbody td.ledger-identity {grid-column:2/-1;grid-row:1;padding-bottom:10px;}
  .ledger-table tbody td[data-label="Date"]{grid-column:1/3;}
  .ledger-table tbody td[data-label="Category"]{grid-column:3;}
  .ledger-table tbody td[data-label="Account"]{grid-column:1/-1;}
  .ledger-table tbody td.ledger-amount{grid-column:1/3;}
  .ledger-table tbody td.ledger-actions{grid-column:3;}
}
@media(max-width:359px){.v67-card-grid{grid-template-columns:minmax(0,1fr);} .v67-day{min-height:38px;} .v67-day small{font-size:7px;}}
@media print {.sidebar,.topbar,.v67-bulk,.v67-tiny-btn,.button,.toast {display:none!important;}.page{break-inside:avoid;}body{background:#fff;color:#111;}}

.v67-credit-detail[hidden] { display:none!important; }


/* categories.css */
/* Category management: fluid, mobile-first layout */
.category-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:18px;align-items:start}
.category-group{padding:20px;min-width:0}
.category-group .surface-head{gap:12px;flex-wrap:wrap}
.category-items{display:grid;gap:8px;margin-top:14px}
.category-item{display:flex;gap:10px;align-items:center;padding:11px 8px;border-radius:12px;border:1px solid var(--border,#e6eafa);min-width:0}
.category-avatar{width:40px;height:40px;display:grid;place-items:center;font-size:20px;border-radius:12px;flex:0 0 auto}
.category-info{display:grid;min-width:0;flex:1;gap:3px}
.category-info strong{font-size:13px;overflow-wrap:anywhere}
.category-info small{color:var(--text-muted,#8490a8);font-size:11px}
.category-item .small-btn{flex:0 0 auto}
.category-remove{color:#e05a74}
.category-picker{display:flex;gap:8px;align-items:center;min-width:0}
.category-picker select{min-width:0;flex:1;width:100%}
.category-picker .button{padding-inline:12px;min-width:44px;min-height:42px;flex:0 0 auto}
.inline-category-panel{border:1px solid var(--border,#dde7f5);background:var(--surface,#fff);border-radius:12px;padding:12px;margin-top:9px;display:grid;gap:8px}
.inline-category-panel[hidden]{display:none!important}
.inline-category-options{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.inline-category-options input[type=color]{width:44px;height:42px;padding:3px;flex:0 0 44px}
@media(max-width:460px){.category-group{padding:15px}.category-item{flex-wrap:wrap}.category-item .small-btn{min-height:36px}.category-info{flex-basis:calc(100% - 90px)}}

@media(max-width:959px){.main-nav .nav-item[data-nav="categories"]{display:none}}
html[data-theme="dark"] .category-item{border-color:#293b55}
html[data-theme="dark"] .inline-category-panel{background:#132239;border-color:#34425b}
/* V7.2: mobile-first, searchable, locally bundled category icon chooser */
.category-vector{width:1.15em;height:1.15em;display:block;stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.85;flex-shrink:0}
.category-avatar .category-vector,.category-badge .category-vector{width:22px;height:22px}
.tx-icon .category-vector{width:20px;height:20px}
.icon-picker{min-width:0;grid-column:1/-1;display:grid;gap:10px}
.icon-picker-selection{display:flex;align-items:center;gap:12px;min-width:0;padding:11px;background:var(--surface-secondary,#f7f9fc);border:1px solid var(--border,#e5e9f2);border-radius:13px}
.icon-preview{display:grid;place-items:center;width:51px;height:51px;flex:0 0 51px;background:#e9f0ff;color:#2769dd;border-radius:13px;font-size:27px}
.icon-preview .category-vector{width:27px;height:27px}
.icon-picker-selection-text{flex:1;min-width:0;display:grid;gap:3px}
.icon-picker-selection-text strong{font-size:12.5px}
.icon-picker-selection-text small{font-size:10.5px;color:var(--muted,#818a9a);line-height:1.35}
.icon-picker-expand{height:38px;padding-inline:11px;white-space:nowrap}
.icon-picker-body{display:grid;gap:9px;min-width:0}
.icon-picker-body[hidden]{display:none!important}
.icon-picker-search-label{position:relative;display:flex;align-items:center}
.icon-picker-search-glyph{position:absolute;left:12px;font-size:21px;pointer-events:none;color:var(--muted,#7f8da8)}
.icon-picker-search-label input{height:42px;width:100%;padding:0 12px 0 35px;background:var(--surface,#fff);border-radius:11px;border:1px solid var(--border,#e5e9f2);font-size:12px;outline:none;color:var(--ink)}
.icon-picker-search-label input:focus{border-color:#3975f6;box-shadow:0 0 0 3px rgba(57,117,246,.1)}
.icon-picker-filters{display:flex;align-items:center;gap:6px;overflow-x:auto;max-width:100%;padding:0 0 5px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.icon-picker-filters button{font-size:11px;white-space:nowrap;padding:7px 10px;border:1px solid var(--border,#e5e9f2);background:var(--surface,#fff);color:var(--muted,#64748b);border-radius:30px;font-weight:700;flex:0 0 auto;min-height:34px}
.icon-picker-filters button.active{border-color:#3b75f6;background:#e9f0ff;color:#235fce}
.icon-picker-result{font-size:10.5px;color:var(--muted,#8b96aa);margin:0}
.icon-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(43px,1fr));gap:6px;max-height:210px;min-height:76px;overflow-y:auto;overscroll-behavior:contain;padding:2px 4px 4px 2px;scrollbar-width:thin}
.icon-option{display:grid;place-items:center;aspect-ratio:1;min-height:43px;border-radius:11px;background:var(--surface,#fff);border:1px solid var(--border,#e1e7f1);font-size:22px;transition:background .12s,border-color .12s,transform .12s;color:var(--ink)}
.icon-option span{display:grid;place-items:center}
.icon-option .category-vector{width:23px;height:23px}
.icon-option:focus-visible{outline:3px solid #2563eb;outline-offset:1px}
.icon-option:hover{background:#eff5ff;border-color:#99baff}
.icon-option.selected{background:#e5efff;border:2px solid #2563eb;color:#2259bd}
.icon-picker-empty{grid-column:1/-1;display:grid;place-items:center;padding:22px 10px;color:var(--muted);font-size:12px;text-align:center}
.icon-picker-custom{display:grid;gap:6px;font-size:11.5px;color:var(--muted,#738298);font-weight:650}
.icon-picker-custom input{height:41px;width:100%;padding:0 11px;background:var(--surface,#fff);border:1px solid var(--border,#e5e9f2);border-radius:10px;font-size:18px;color:var(--ink)}
html[data-theme="dark"] .icon-picker-selection{background:#19283c;border-color:#35435a}
html[data-theme="dark"] .icon-preview{background:#26416b;color:#b4ccff}
html[data-theme="dark"] .icon-picker-filters button.active,html[data-theme="dark"] .icon-option.selected{background:#203f6a;border-color:#6e9cff;color:#b9d0ff}
html[data-theme="dark"] .icon-option:hover{background:#223951;border-color:#6789b7}
@media(max-width:520px){.icon-picker-selection{gap:9px;padding:8px}.icon-preview{width:43px;height:43px;flex-basis:43px}.icon-picker-selection-text small{font-size:9.5px}.icon-picker-expand{padding:0 8px;font-size:10px}.icon-picker-grid{grid-template-columns:repeat(auto-fill,minmax(40px,1fr));gap:5px;max-height:180px}.icon-option{min-height:42px}}
#categoryForm .modal-actions{position:sticky;bottom:-28px;z-index:5;background:var(--surface,#fff);margin:10px -28px -28px;padding:14px 28px max(20px,env(safe-area-inset-bottom,0px));box-shadow:0 -8px 22px rgba(12,33,67,.04)}
@media(max-width:760px){#categoryForm .modal-actions{bottom:-23px;margin:10px -20px -23px;padding:12px 20px max(18px,env(safe-area-inset-bottom,0px))}}


/* reminders.css */
/* Moneta V7.3: progressive disclosure and small-screen reminders. */
.context-details {position:relative;display:inline-flex;vertical-align:middle;margin-top:3px;min-width:0;}
.context-trigger {display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:28px;min-width:28px;padding:3px 7px;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:9px;cursor:pointer;list-style:none;font-size:11px;font-weight:650;}
.context-trigger::-webkit-details-marker,.compact-import-info summary::-webkit-details-marker,.reminder-peek summary::-webkit-details-marker{display:none;}
.context-trigger .icon{width:15px;height:15px;}
.context-details[open] {display:flex;flex-wrap:wrap;max-width:100%;}
.context-details[open]>.context-explanation{width:100%;flex-basis:100%;padding:8px 10px;margin:6px 0 0!important;background:var(--soft);border-radius:9px;font-size:12px;line-height:1.45;color:var(--muted);overflow-wrap:anywhere;}
.context-details:not([open])>.context-explanation{display:none;}
.context-word{font-size:10px;}
.page-heading .context-details,.section-intro .context-details{margin-top:6px;}
.surface-head .context-details{margin-top:4px;}
.surface-head .context-word{display:none;}
.compact-import-info,.reminder-peek{max-width:100%;position:relative;display:inline-block;vertical-align:top;margin:0 7px 9px 0;color:var(--text);}
.compact-import-info[hidden],.reminder-peek[hidden]{display:none!important;}
.compact-import-info>summary,.reminder-peek>summary{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--surface);color:var(--muted);padding:6px 10px;border-radius:999px;font-size:11px;font-weight:750;line-height:1.2;list-style:none;cursor:pointer;min-height:32px;}
.compact-import-info>summary .icon{height:14px;width:14px;color:#3678ef;}
.compact-import-body,.reminder-peek>div{position:absolute;z-index:18;top:calc(100% + 6px);left:0;width:min(355px,calc(100vw - 36px));padding:14px 15px;background:var(--surface);box-shadow:0 15px 42px rgba(6,22,53,.19);border:1px solid var(--line);border-radius:13px;color:var(--text);}
.compact-import-body strong{font-size:12px;line-height:1.5;display:block;}
.compact-import-body p{font-size:11.5px;line-height:1.5;margin:7px 0 12px;color:var(--muted);}
.compact-info-actions{display:flex;flex-wrap:wrap;gap:8px;}
.compact-info-actions .button{padding:8px 12px;min-height:34px;}
.reminder-peek>summary{border-color:#a8d2f7;background:var(--soft);color:var(--text);}
.reminder-peek>summary #reminderCount{display:grid;place-items:center;border-radius:20px;background:#246cdb;color:white;height:18px;min-width:18px;padding:0 3px;font-size:10px;}
.reminder-peek>div{width:min(335px,calc(100vw - 36px));}
.reminder-mini-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:7px 0;}
.reminder-mini-row strong{display:block;font-size:12px;}.reminder-mini-row small{display:block;color:var(--muted);font-size:11px;margin-top:4px;}
.reminder-small-action,.reminder-open-planning{border:0;background:transparent;color:#3076e9;cursor:pointer;font-weight:750;font-size:11px;min-height:35px;padding:5px;}
.reminder-open-planning{width:100%;text-align:left;}
.reminder-payment-row{align-items:flex-start;}
.reminder-paid-btn{border:1px solid #8fdccb;border-radius:9px;min-height:35px;background:#e5f8f1;color:#087963;padding:8px 10px;font-weight:750;font-size:11px;cursor:pointer;white-space:nowrap;}
.reminder-paid-btn.is-paid{background:var(--soft);border-color:var(--line);color:var(--muted);}
.reminder-prefs-form{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;margin-top:12px;}
.reminder-prefs-form label{font-size:12px;font-weight:650;display:flex;align-items:center;gap:8px;flex:1 1 225px;color:var(--text);min-width:0;}
.reminder-prefs-form input[type=checkbox]{width:19px;height:19px;accent-color:#266fef;flex:none;}
.reminder-prefs-form select{height:38px;max-width:168px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:9px;padding:5px 8px;}
.reminder-prefs-form small{flex:1 1 100%;color:var(--muted);font-size:11px;line-height:1.4;}
.reminder-prefs-form .button{min-height:38px;}
/* Optimize first fold: remove redundant visual hierarchy and avoid large notices at every screen size. */
#overviewPage>.page-heading{margin-bottom:10px;}
#overviewPage>.page-heading .eyebrow{display:none;}
#overviewPage>.page-heading h2{font-size:clamp(19px,2.3vw,26px);line-height:1.22;}
#overviewPage>.stats-grid{margin-top:4px;}
#demoBanner:not([hidden]){font-size:11px;padding:9px 12px;margin-bottom:10px;}
.v67-kpi{position:relative;}
.v67-kpi .mini-info{margin-top:0;}
.v67-kpi .mini-info summary{font-size:10px;cursor:pointer;list-style:none;color:var(--muted);}
.v67-kpi .mini-info summary::-webkit-details-marker{display:none;}
.v67-kpi .mini-info[open] small{display:block;margin-top:5px;color:var(--muted);line-height:1.4;}
@media(max-width:599px){
  #overviewPage>.page-heading{margin-bottom:8px;}
  #overviewPage>.page-heading h2{font-size:clamp(19px,5vw,23px);}
  .context-word{display:none;}
  .setting-card.reminders-settings-card{display:block;}
  .setting-card.reminders-settings-card .setting-icon{display:none;}
  .setting-card.reminders-settings-card .button{margin:0;}
  .reminder-prefs-form{gap:13px;}
  .reminder-prefs-form label{flex:1 1 100%;}
  .compact-import-info,.reminder-peek{margin-bottom:7px;}
  .compact-import-info>summary,.reminder-peek>summary{font-size:10px;min-height:30px;padding:5px 9px;}
  .reminder-peek>div,.compact-import-body{position:relative;top:auto;left:auto;margin:7px 0 0;width:min(100%,calc(100vw - 28px));}
  .reminder-payment-row .v67-amount-actions{gap:6px;}
  .reminder-payment-row .v67-amount-actions strong{width:100%;}
}
@media(prefers-reduced-motion:reduce){.compact-import-info,.reminder-peek{scroll-behavior:auto;}}
/* Five useful bottom-nav destinations, irrespective of device model. Categories remain in More. */
@media(max-width:959px){.main-nav .nav-item[data-nav="categories"]{display:none!important;}}
/* Keep the key numbers above the fold on short mobile viewports. */
@media(max-width:599px){
  .topbar-kicker{display:none;}
  .topbar{row-gap:8px!important;padding-block:11px!important;}
  main{padding-top:12px!important;}
  #overviewPage>.stats-grid{gap:9px;}
  #overviewPage>.stats-grid .stat-card{min-height:128px;padding-block:13px;}
  #overviewPage>.stats-grid .stat-number{margin-top:10px;}
  #overviewPage>.stats-grid .stat-desc{margin-top:9px;}
}


/* faq.css */
/* Moneta V7.4: no extra vertical hint strips; FAQs own instructional copy. */
.compact-import-info,.context-details,#importBanner,#demoBanner,#accountWarning{display:none!important}
.page-heading>div>p,.section-intro>div>p,.surface-head>div>p,.setting-copy>p,.fine-print,.v67-footnote{display:none!important}
.page-heading,.section-intro{margin-bottom:12px!important}
.page-heading h2,.section-intro h2{margin:0;display:inline;vertical-align:middle}
.section-intro>div{min-width:0}
.faq-icon-btn{height:28px;width:28px;flex:0 0 auto;display:inline-grid;place-items:center;border:0;background:transparent;border-radius:10px;color:var(--muted);cursor:pointer;padding:4px;vertical-align:middle;margin-left:5px}
.faq-icon-btn:hover,.faq-icon-btn:focus-visible{background:var(--soft);color:var(--text);outline-offset:2px}
.faq-icon-btn .icon{height:16px;width:16px}
.overview-title-row{display:flex;align-items:center;flex-wrap:wrap;gap:2px 3px;min-width:0}
.overview-title-row h2{flex:0 1 auto;min-width:0}
.title-reminder{margin:0 0 0 2px!important;align-self:center;flex:0 0 auto;position:relative}
.title-reminder>summary{min-height:27px!important;padding:3px 6px!important;border:0!important;background:transparent!important;border-radius:9px!important;color:var(--muted)!important;font-size:11px!important}
.title-reminder>summary .icon{height:15px;width:15px}
.title-reminder>summary #reminderCount{height:17px;min-width:17px;font-size:10px}
.title-reminder>div{position:absolute!important;top:calc(100% + 9px)!important;left:auto!important;right:0!important;width:min(320px,calc(100vw - 34px))!important;margin:0!important;z-index:30!important;max-height:60vh;overflow:auto}
.recurring-setup-link{display:block;width:100%;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--text);padding:12px;text-align:left;font-size:12px;cursor:pointer;margin-top:8px;line-height:1.5}
.reminder-paid-btn:disabled{opacity:.48;cursor:not-allowed}
.faq-panel{max-width:900px;padding:clamp(16px,3vw,30px)}
.faq-search-label{font-size:12px;font-weight:750;display:block;margin-bottom:10px;color:var(--text)}
.faq-search-field{height:46px;display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:12px;background:var(--soft);padding:0 13px;min-width:0}
.faq-search-field .icon{height:17px;width:17px;flex:none;color:var(--muted)}
.faq-search-field input{min-width:0;width:100%;border:0;outline:0;background:transparent;font:inherit;font-size:14px;color:var(--text)}
.faq-count{display:block;font-size:11px;color:var(--muted);padding:13px 0 7px}
.faq-item{border-bottom:1px solid var(--line);color:var(--text);min-width:0}
.faq-item>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 2px;min-height:55px}
.faq-item>summary::-webkit-details-marker{display:none}
.faq-item>summary small{display:block;font-size:10px;letter-spacing:.3px;color:var(--muted);margin-bottom:5px}
.faq-item>summary strong{display:block;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.faq-chevron{font-size:19px;font-weight:500;color:var(--muted);flex:none;line-height:1}
.faq-item[open] .faq-chevron{transform:rotate(45deg)}
.faq-item>p{margin:0;padding:0 18px 15px 2px;font-size:12.5px;line-height:1.65;color:var(--muted);overflow-wrap:anywhere}
.faq-no-results{padding:20px 0;font-size:13px;color:var(--muted)}
@media(max-width:959px){.main-nav .nav-item[data-nav="faq"]{display:none!important}}
@media(max-width:599px){.faq-panel{padding:15px}.faq-icon-btn{margin-left:3px}.page-heading,.section-intro{margin-bottom:10px!important}.overview-title-row h2{font-size:clamp(18px,5vw,22px)}.title-reminder>div{right:-12px!important}}

/* No extra per-tile info row; lookup is in Help & FAQ. */
.v67-kpi .mini-info{display:none!important}
/* Preserve compact controls at any resolution, including narrow phones. */
@media(max-width:360px){.overview-title-row{gap:2px}.overview-title-row h2{font-size:18px!important}.faq-icon-btn{height:26px;width:26px}.title-reminder>summary{min-height:26px!important}}

/* Insights: preserve key warnings and comparison values without paragraph-sized cards. */
.v67-insight-message{padding:9px 12px!important;margin-bottom:7px!important;gap:0!important;border-radius:10px!important}
.v67-insight-message span{display:none!important}


/* v8.css */
/* V8: mobile-first install/security controls; never use fixed device widths. */
.v8-settings-actions{display:flex;gap:8px;flex-wrap:wrap;min-width:0}
.v8-settings-actions .button{min-height:44px}
@media(max-width:720px){.v8-settings-actions{width:100%}.v8-settings-actions .button{flex:1 1 125px}}
@supports (padding: max(0px)){.mobile-bottom-nav,.bottom-nav{padding-bottom:max(8px,env(safe-area-inset-bottom))}}
/* Narrow and folding viewports: allow the canvas to shrink below legacy 320px. */
html,body{min-width:0}
#installMonetaButton[hidden],#signOutButton[hidden]{display:none!important}
@media(max-width:380px){.v8-settings-actions{flex-direction:column}.v8-settings-actions .button{width:100%;flex-basis:auto}}


/* layout-fixes.css */
/* Moneta V8.1 — Height-aware, zoom-safe shell and content safeguards.
   Loaded after existing themes; fixes apply by AVAILABLE SPACE, not device model. */
@media (min-width: 960px) {
  .sidebar {
    height: 100dvh;
    min-height: 0;
    box-sizing: border-box;
    padding: clamp(12px, 2.3vh, 26px) 14px clamp(12px, 2vh, 20px);
    overflow: hidden;
    isolation: isolate;
  }
  .sidebar .brand {
    flex: 0 0 auto;
    padding: 0 9px clamp(14px, 3vh, 35px);
  }
  .sidebar .nav-caption {
    flex: 0 0 auto;
    margin-bottom: 9px;
    padding-inline: 12px;
  }
  /* Only the navigation scrolls when the visible window is too short.
     Its items never shrink into unreadable, clipped rows. */
  .sidebar .main-nav {
    min-height: 0;
    flex: 0 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
    scroll-padding-block: 6px;
    padding: 2px 2px 4px;
    gap: 4px;
  }
  .sidebar .main-nav .nav-item {
    flex: 0 0 auto;
    min-height: 43px;
    height: 43px;
    padding-inline: 12px;
    overflow-wrap: anywhere;
  }
  .sidebar .sidebar-spacer { flex: 1 1 0; min-height: 0; }
  .sidebar .sidebar-bottom { flex: 0 0 auto; min-width: 0; }
  .sidebar .tip-card { margin: 11px 2px 7px; padding: 13px 13px; }
  .sidebar .tip-icon { margin-bottom: 8px; }
  .sidebar .local-status { padding: 8px 9px 0; font-size: 10.5px; line-height: 1.4; }
}
/* Decorative motivation never competes with navigation or reaches below the fold.
   Hide it based on vertical space, including browser zoom and split-window use. */
@media (min-width: 960px) and (max-height: 960px) {
  .sidebar .tip-card { display: none; }
  .sidebar .brand { padding-bottom: clamp(11px, 2.5vh, 25px); }
  .sidebar .main-nav .nav-item { min-height: 42px; height: 42px; }
  .sidebar .local-status { padding-top: 9px; }
}
@media (min-width: 960px) and (max-height: 600px) {
  .sidebar { padding-block: 10px; }
  .sidebar .brand { padding-bottom: 10px; }
  .sidebar .nav-caption { margin-bottom: 5px; }
  .sidebar .main-nav { gap: 2px; }
  .sidebar .main-nav .nav-item { height: 39px; min-height: 39px; }
  .sidebar .local-status { padding-top: 5px; }
}
@media (min-width: 960px) and (max-height: 420px) {
  .sidebar .brand { padding-bottom: 5px; }
  .sidebar .nav-caption { margin-bottom: 3px; }
  .sidebar .local-status { font-size: 10px; padding-top: 3px; }
}
/* Prevent numbers/text inside clipped colored cards from disappearing under zoom,
   reduced content width and very large INR balances. */
.stat-card { height: auto; }
.stat-card .stat-number {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  max-width: 100%;
}
.stat-card .stat-head, .stat-card .stat-desc { min-width: 0; overflow-wrap: anywhere; }
.account-card .account-value, .small-stat strong, .budget-summary strong {
  overflow-wrap: anywhere;
}
/* Any visually hidden phone/keyboard navigation must not hide the page's end. */
@media (max-width: 959px) {
  .sidebar .main-nav { overflow: visible; }
  .main-layout main {
    padding-bottom: max(calc(110px + env(safe-area-inset-bottom, 0px)), 22px);
  }
}
/* Modals remain scrollable at short heights, with buttons still reachable. */
.modal-overlay { min-height: 0; }
.modal-overlay .modal {
  max-height: min(90dvh, 830px);
  overscroll-behavior-y: contain;
  overflow-y: auto;
}
@media (max-height: 540px) {
  .modal-overlay { align-items: flex-start; overflow-y: auto; }
  .modal-overlay .modal { max-height: calc(100dvh - 24px); }
}
/* Labels near graphs and cards should wrap instead of getting cut off. */
.surface-head, .section-intro, .page-heading { min-width: 0; }
.surface-head h3, .section-intro h2, .page-heading h2 { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  .sidebar .main-nav { scroll-behavior: auto; }
}
/* Avoid a 3+1 orphan summary card row on laptop/tablet widths.
   Columns respond to real workspace width after the sidebar is subtracted. */
@container moneta-canvas (min-width: 500px) and (max-width: 1029px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) and (max-width: 1100px) {
  .sidebar .brand-sub { font-size: 8px; letter-spacing: .9px; white-space: nowrap; }
}


/* v82.css */
.v82-profile-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr));gap:16px;margin:14px 0 20px}
.v82-profile-card,.v82-income-card{padding:clamp(16px,2vw,24px);min-width:0;margin-bottom:16px}
.v82-profile-card h3,.v82-income-card h3{margin:0 0 14px}
.v82-disabled-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.v82-disabled-grid input{opacity:.6;cursor:not-allowed;background:var(--surface-2,#f1f5fa)}
.v82-help{font-size:12px;line-height:1.5;opacity:.7;margin:12px 0}
.v82-source{display:flex;align-items:center;gap:12px;justify-content:space-between;min-width:0;padding:13px 0;border-bottom:1px solid var(--line,#e4e9f3)}
.v82-source:last-child{border-bottom:0}
.v82-source-main{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.v82-source-icon{display:grid;place-items:center;flex:0 0 35px;height:35px;border-radius:10px;background:#e5efff;color:#1760db}
.v82-source-main>div{min-width:0}.v82-source-main strong,.v82-source-main small{display:block;overflow-wrap:anywhere}
.v82-source-main small{font-size:12px;opacity:.68;margin-top:5px}
.v82-source-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.v82-allocation{display:grid;gap:8px}.v82-allocation>div{display:flex;justify-content:space-between;gap:10px;padding:11px 0;border-bottom:1px solid var(--line,#e4e9f3)}
.v82-allocation-total{font-weight:700}.v82-bank-summary{margin:5px 0 14px;font-size:13px;line-height:1.4}
@media(max-width:680px){.v82-disabled-grid{grid-template-columns:1fr 1fr}.v82-source{align-items:flex-start;flex-wrap:wrap}.v82-source-actions{width:100%;justify-content:flex-start;padding-left:43px}.v82-profile-card,.v82-income-card{padding:14px}}
@media(max-width:350px){.v82-disabled-grid{grid-template-columns:1fr}.v82-source-actions{padding-left:0}}

/* Keep the mobile tab bar to its primary destinations; Profile lives under More. */
@media(max-width:1023px){.main-nav .nav-item[data-nav="profile"]{display:none!important}}


/* V9.3: No JS geometry measurement needed to keep entire financial amounts visible. */
.stat-card .stat-number { white-space: normal; overflow-wrap:anywhere; word-break:normal; max-width:100%; }
@media (prefers-reduced-motion: reduce) { .page { animation:none; } }