/* Version 2: layouts are designed for phones, then expanded for desktop. */
:root{--bg:#f6f5ef;--ink:#183b35;--muted:#64746d;--green:#175a47;--line:#e2e7df;--radius:20px}
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;line-height:1.45}
h1,h2,h3,.money{font-family:inherit}button,input,select,textarea{touch-action:manipulation}input,select,textarea{font-size:16px!important}button{transition:background-color .15s,opacity .15s,transform .15s}button:active:not(:disabled){transform:scale(.98)}button:disabled{cursor:default}
.main{min-width:0}.topbar{gap:16px}.view-enter>*{min-width:0}.card,.metric{min-width:0;background:var(--paper)}.section-head{flex-wrap:wrap}.section-head h2{font-size:17px}.subtle{font-size:13px;line-height:1.65}.text-button{font-size:13px;min-height:44px}.row-body strong{font-size:14px}.row-body small,.row-end small{font-size:12px;line-height:1.5}.row-end{font-size:14px}.row{gap:12px}.icon-button{min-width:44px;min-height:44px}.button{min-height:48px}.metric strong{font-size:clamp(19px,2vw,28px);overflow-wrap:anywhere}.metric small{font-size:12px}.metric p{font-size:11px;color:var(--muted);margin-top:8px}.filters input,.filters select{background:var(--paper);color:var(--ink)}.form label{font-size:13px}.form input,.form select{min-height:48px}.form-segments button{min-height:44px;font-size:14px}.form .amount{font-size:44px!important}.form-error:empty{display:none}.form-error:not(:empty){padding:12px;background:#b94c4410;border-radius:12px}.form:has(.form-error:not(:empty)) input:invalid{border-color:var(--red)}.sheet-head h2{font-size:21px}.sheet-head .icon-button{min-width:44px;min-height:44px}.entry-details summary,.optional-setup summary{min-height:44px;display:flex;align-items:center;gap:8px;font-size:13px}.draft-status{font-size:11px!important;text-align:center}.floating-add{display:none}
.simple-home{gap:18px}.simple-home>.runway-card{grid-column:1/-1}.runway-card{background:#eaf0e7;border-color:#d9e4d5;padding:26px}.dark .runway-card{background:var(--soft);border-color:var(--line)}.runway-card .section-head{margin-bottom:12px}.runway-card h2{margin-bottom:10px;font-size:24px}.runway-card>p{font-size:14px;color:var(--muted)}.runway-card>.button{margin-top:18px}.runway-number{font-size:clamp(32px,8vw,46px);font-weight:750;letter-spacing:-1.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.negative{color:#ad423b}.runway-explanation{margin-top:20px;font-size:13px}.runway-explanation summary{min-height:44px;cursor:pointer}.runway-explanation dl{margin:6px 0 14px}.runway-explanation dl>div{display:flex;justify-content:space-between;gap:14px;padding:9px 0;border-bottom:1px solid var(--line)}.runway-explanation dt{min-width:0}.runway-explanation dd{margin:0;font-weight:650;white-space:nowrap}.runway-explanation p{font-size:12px;color:var(--muted);line-height:1.65}.runway-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;border-top:1px solid var(--line);padding-top:10px;font-size:12px}.runway-footer span{min-width:0}.balance-card{background:#163e35;min-height:0;padding:23px}.balance-card .money{font-size:36px}.balance-plan{gap:4px;padding-top:13px;margin-top:12px}.balance-plan>span:not(:first-child){margin-top:6px}.balance-plan strong{font-size:21px}.review-shortcut{grid-column:1/-1;display:flex;align-items:center;gap:18px}.review-shortcut>div{flex:1}.review-shortcut h2{font-size:16px}.draft-banner{width:100%;display:flex;gap:12px;align-items:center;padding:16px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:16px;margin-bottom:18px;text-align:left}.draft-banner span{flex:1}.draft-banner small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.period-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:var(--soft);padding:4px;border-radius:14px;gap:3px;width:min(440px,100%)}.period-tabs button{border:0;background:none;border-radius:10px;min-height:44px;font-size:13px;color:var(--muted)}.period-tabs .active{background:var(--paper);color:var(--ink);font-weight:700;box-shadow:0 2px 5px #173e3510}.report-toolbar{display:grid;gap:14px;margin-bottom:20px}.report-date-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.report-date-row input{min-height:46px;min-width:0;max-width:210px;border:1px solid var(--line);border-radius:12px;padding:9px;background:var(--paper);color:var(--ink)}.report-date-row .icon-button{font-size:24px}.filter-summary{display:flex;align-items:center;gap:12px;font-size:13px;color:var(--muted)}.report-legend{display:flex;gap:20px;font-size:13px;color:var(--muted);margin-bottom:16px}.report-legend span{display:flex;align-items:center;gap:7px}.report-legend i{width:10px;height:10px;border-radius:50%}.income-dot{background:#218663}.expense-dot{background:#c06b38}.report-chart{display:block;width:100%;height:auto;min-width:0;stroke:none}.report-chart .chart-grid{stroke:var(--line);stroke-width:1}.report-chart .chart-label{font:10px system-ui;fill:var(--muted);stroke:none}.report-chart polyline{fill:none;stroke-width:3;stroke-linejoin:round;stroke-linecap:round}.report-chart .income-line{stroke:#218663}.report-chart .expense-line{stroke:#c06b38;stroke-dasharray:5 4}.report-chart .income-point{fill:#218663}.report-chart .expense-point{fill:#c06b38}.report-breakdown{display:grid;margin-top:10px}.report-breakdown button{display:flex;align-items:center;gap:12px;text-align:left;border:0;border-bottom:1px solid var(--line);background:none;color:var(--ink);padding:14px 0;min-height:48px}.report-breakdown button>span:first-child{flex:1}.report-breakdown small{display:block;font-size:12px}.category-report{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;text-align:left;width:100%;background:none;border:0;padding:12px 0;color:var(--ink);min-height:60px}.category-report small{display:block;font-size:11px;color:var(--muted);margin-top:4px}.category-report>strong{font-size:14px}.category-report>i{grid-column:1/-1;height:6px;background:var(--soft);border-radius:6px;overflow:hidden}.category-report b{height:100%;display:block;background:#81a17b;border-radius:6px}.report-entries{margin-top:20px}.report-footnote{font-size:12px;color:var(--muted);line-height:1.7;margin:18px 4px}.report-metrics .metric:last-child{background:var(--soft)}
.plan-tabs{overflow:auto;max-width:100%;border-radius:14px;margin-bottom:18px}.plan-tabs button{min-height:44px;white-space:nowrap}.money-calendar{margin-top:18px}.timeline-row{display:flex;align-items:center;gap:12px;padding:16px 0;border-bottom:1px solid var(--line);font-size:13px}.timeline-row>div{flex:1;min-width:0}.timeline-row strong{overflow-wrap:anywhere}.timeline-row small{display:block;color:var(--muted);font-size:12px;margin-top:5px}.timeline-dot{width:10px;height:10px;background:#83a477;border-radius:50%;flex-shrink:0}.timeline-dot.late{background:#bf7766}.salary-marker{background:var(--soft);padding:14px;border-radius:12px}.purchase-preview{padding:22px;background:var(--soft);border-radius:16px}.purchase-preview small{font-size:13px}.purchase-preview strong{display:block;font-size:34px;margin:10px 0;overflow-wrap:anywhere}.purchase-preview p{font-size:13px;color:var(--muted);line-height:1.65}.promise-note{background:var(--soft);padding:12px;border-radius:12px;margin-top:14px;font-size:13px}.promise-note small{display:block;color:var(--muted);margin-top:5px}.form-context{font-size:12px;color:var(--muted);display:flex;gap:8px;align-items:center;padding:10px;background:var(--soft);border-radius:10px}
@media (min-width:801px){.report-chart{max-height:280px}.main{max-width:1550px}.runway-card{display:block}.floating-add{display:none}.review-shortcut .button{flex-shrink:0}}
@media (max-width:800px){
 html,body{width:100%;min-height:100%;overflow-x:clip}body.app-ready{padding-bottom:0}.main{width:100%;max-width:680px;padding:16px 16px calc(150px + env(safe-area-inset-bottom));margin-inline:auto}.topbar{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:14px;margin-bottom:22px}.mobile-brand{grid-column:1;grid-row:1;min-width:0}.mobile-brand .wordmark{width:180px!important;max-width:100%;height:40px!important}.top-actions{display:contents}.top-actions>.icon-button{grid-column:2;grid-row:1;width:44px;height:44px}.money-spaces{grid-column:1/-1;grid-row:2;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;border-radius:14px;background:var(--soft)}.money-spaces:has([data-action=collector]){grid-template-columns:repeat(3,minmax(0,1fr))}.money-spaces button{display:flex;justify-content:center;min-height:44px;padding:8px 5px;font-size:12px;border-radius:10px;min-width:0;gap:5px}.money-spaces svg{width:16px;height:16px}.money-spaces button.active{background:var(--paper);font-weight:700}.greeting{margin-bottom:18px}.greeting h1{font-size:25px}.greeting p{font-size:13px;max-width:none}.simple-home{display:flex!important;flex-direction:column;gap:16px}.simple-home>.runway-card{order:-1}.balance-card{padding:21px;border-radius:20px}.balance-card .money{font-size:34px}.balance-top{font-size:13px}.balance-footer strong{font-size:17px}.balance-footer label{font-size:12px}.balance-plan small{font-size:12px}.balance-plan>span{font-size:12px}.card{padding:20px;border-radius:20px}.page-title{margin-bottom:20px}.page-title h1{font-size:26px;line-height:1.2;letter-spacing:-.8px;margin-top:6px}.page-title p{font-size:13px;line-height:1.65}.bottom-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:8px 8px max(8px,env(safe-area-inset-bottom));box-shadow:0 -3px 18px #173e3508;z-index:20}.bottom-nav button{min-width:0;min-height:52px;font-size:11px;border-radius:12px;gap:5px;padding:6px}.bottom-nav button svg{width:22px;height:22px}.bottom-nav button.active{background:var(--soft);color:var(--green)}.bottom-nav .add-nav{display:none}.floating-add{display:flex;align-items:center;justify-content:center;gap:7px;position:fixed;right:18px;bottom:calc(84px + env(safe-area-inset-bottom));min-height:48px;padding:0 18px;border:0;border-radius:24px;background:var(--green);color:white;box-shadow:0 5px 18px #173e3525;z-index:18;font-size:14px;font-weight:650}.floating-add svg{width:21px}.floating-add:disabled{opacity:.5}.metrics{gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}.metrics>.metric:last-child:nth-child(odd){grid-column:1/-1}.metric{padding:16px;border-radius:16px}.metric strong{font-size:23px;letter-spacing:-.6px}.metric small{font-size:12px}.report-metrics .metric:last-child{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px}.report-metrics .metric:last-child strong{grid-column:2;grid-row:1/3;margin:0}.report-metrics .metric:last-child p{grid-column:1;margin:0}.report-date-row{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px}.report-date-row input{width:100%;max-width:none;min-width:0}.report-date-row>.text-button{justify-content:center}.report-date-row>.text-button:last-child{grid-column:3}.report-date-row>.text-button:nth-last-child(2){grid-column:1/3;justify-content:flex-start}.period-tabs{width:100%;border-radius:13px}.period-tabs button{font-size:13px}.report-toolbar{gap:12px}.report-legend{font-size:12px}.report-entries .row{flex-wrap:wrap}.report-entries .row-end{white-space:normal;overflow-wrap:anywhere;max-width:42%}.two-col{grid-template-columns:minmax(0,1fr);gap:16px}.row-body strong{font-size:14px}.row-body small{font-size:12px}.row-end{font-size:14px}.row-end small{font-size:11px}.quick-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.quick-item{min-height:48px;font-size:12px;min-width:0;overflow-wrap:anywhere;padding:10px}.daily-card .button{margin-top:10px}.daily-check{min-height:52px;font-size:13px}.section-head .text-button{padding-right:0}.review-shortcut{align-items:flex-start;flex-wrap:wrap}.review-shortcut .button{width:100%}.filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.filters input,.filters select{min-width:0;width:100%;min-height:48px}.filters #search{grid-column:1/-1}.filters>.scope-switch{grid-column:1/-1;overflow:auto}.filters>.scope-switch button{min-height:44px;white-space:nowrap}.filters>.button{min-width:0}.form-grid{grid-template-columns:minmax(0,1fr)}dialog{width:100%;max-width:680px;max-height:calc(100dvh - 12px);margin:auto auto 0;border-radius:24px 24px 0 0;padding:18px 20px max(22px,env(safe-area-inset-bottom));overscroll-behavior:contain;scroll-padding-top:72px;scroll-padding-bottom:90px;overflow:auto}dialog:before{content:'';display:block;width:36px;height:4px;background:var(--line);border-radius:4px;margin:0 auto 14px}.sheet-head{position:sticky;top:-18px;background:var(--bg);padding:14px 0 10px;z-index:5;margin-bottom:12px}.form{gap:15px}.form>.button[type=submit]{position:sticky;bottom:-1px;z-index:3;box-shadow:0 -8px 16px var(--bg);min-height:50px}.form .amount{font-size:42px!important}.form-segments{flex:1}.payment-grid{display:flex;flex-wrap:wrap;gap:7px}.payment-chip{min-height:44px;font-size:12px;padding:9px 11px}.form-context{font-size:12px}.entry-top{gap:10px}.entry-more-menu summary{min-height:44px;display:flex;align-items:center;font-size:13px}.entry-details .form-grid{grid-template-columns:1fr}.note{font-size:13px;line-height:1.65}.timeline-row{flex-wrap:wrap;gap:10px}.timeline-row>div{min-width:130px}.timeline-row>.icon-button{min-width:44px}.timeline-row>.text-button{margin-left:auto}.collection-mode .room-toolbar{gap:14px}.collection-mode .room-toolbar h2{font-size:24px}.collection-mode .room-buttons{display:flex;flex-wrap:wrap;gap:8px;width:100%}.collection-list-row{padding:18px 0}.collection-person strong{font-size:16px}.collection-person small,.collection-row-amount>small{font-size:12px}.collection-row-amount>strong{font-size:23px}.collection-row-amount .text-button{font-size:13px;min-height:48px}.collection-ledger .filters{grid-template-columns:1fr}.collection-ledger .filters input,.collection-ledger .filters select{font-size:16px}.collection-detail-totals{gap:18px;flex-wrap:wrap}.debt-actions{display:grid;grid-template-columns:1fr;gap:8px}.receipt-actions{display:flex;flex-wrap:wrap}.room-tools>div{max-width:calc(100vw - 40px)}#toast{bottom:calc(145px + env(safe-area-inset-bottom));font-size:13px;line-height:1.5;max-width:calc(100vw - 32px);width:max-content;padding:14px 16px}.auth-shell{padding:16px;min-height:100dvh}.auth-layout{border-radius:24px}.auth-art{padding:24px}.auth-art h1{font-size:30px}.auth-form{padding:24px}.auth-form h2{font-size:24px}.auth-form>p{font-size:13px}.setting{flex-wrap:wrap}.setting>div{flex:1;min-width:170px}.setting p{font-size:13px}.setting h3{font-size:15px}.borrower-link{min-height:56px}.borrower-link small{font-size:12px}.budget-row>div:first-child{gap:10px;flex-wrap:wrap}.budget-row small{font-size:12px}
}
@media (max-width:360px){.main{padding-inline:12px}.card{padding:17px}.money-spaces button{font-size:11px}.runway-card{padding:20px}.runway-number{font-size:34px}.balance-card .money{font-size:32px}.runway-footer{flex-wrap:wrap}.runway-explanation dl>div{flex-wrap:wrap}.runway-explanation dd{margin-left:auto}.report-metrics .metric:last-child{display:block}.report-metrics .metric:last-child strong{margin-top:8px}.report-metrics .metric:last-child p{margin-top:6px}.metric{padding:13px}.metric strong{font-size:21px}.row .category-icon{width:34px;height:34px}.form .amount{font-size:38px!important}dialog{padding-inline:16px}.quick-items{grid-template-columns:1fr}.timeline-row>div{min-width:110px}}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}button:active{transform:none!important}.view-enter{animation:none}}

@media (max-width:800px){body:has(dialog[open]){overflow:hidden}.keyboard-open .bottom-nav,.keyboard-open .floating-add{display:none}}

[hidden]{display:none!important}.view-static>*{min-width:0}
.report-group-label{font-size:12px;font-weight:650;color:var(--muted)}.report-window-label{display:grid;gap:6px;font-size:12px;font-weight:600;color:var(--muted);max-width:440px}.report-window-label select{width:100%;min-width:0;min-height:46px;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:var(--paper);color:var(--ink);font:inherit;font-size:16px}.report-anchor-label{display:grid;gap:4px;font-size:11px;color:var(--muted);min-width:0}.report-selection{font-size:12px;line-height:1.6;color:var(--muted);margin:0}.chart-hit{fill:transparent;stroke:none}.chart-date-point{fill:var(--muted);stroke:none}.report-chart-point{cursor:pointer;outline:none}.report-chart-point:hover .chart-hit,.report-chart-point:focus .chart-hit{fill:var(--soft)}.report-chart-point:focus .chart-hit{stroke:var(--green);stroke-width:1}.report-chart-hint{font-size:12px;line-height:1.6;color:var(--muted);margin:10px 0 14px}.report-chart-paging{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;margin:12px 0}.report-chart-paging>span{text-align:center;font-size:12px;line-height:1.5;overflow-wrap:anywhere}.report-chart-paging small{display:block;font-size:10px;color:var(--muted)}.report-chart-paging .button{min-height:44px;padding:8px 10px;font-size:12px}
@media (max-width:800px){.report-window-label{max-width:none}.report-date-row>.text-button:nth-last-child(2),.report-date-row>.text-button:last-child{grid-column:auto;justify-content:center}.report-date-row>.text-button{padding:8px 4px;min-height:44px}.report-chart-paging{grid-template-columns:1fr 1fr}.report-chart-paging>span{grid-column:1/-1;grid-row:1}.report-chart-paging .button{width:100%}}
