:root{--ink:#20392d;--muted:#64736a;--line:#e0e7e0;--accent:#2d6c4d;--paper:#fff;--bg:#f5f7f4;--soft:#edf4ee;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;font-size:14px;line-height:1.45}button,input,select{font:inherit;color:inherit}button{border:0;background:none;cursor:pointer;touch-action:manipulation}button:disabled{opacity:.55;cursor:wait}input,select{min-width:0}button,input,select{outline:none}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #4b9270;outline-offset:3px}[hidden]{display:none!important}.sr-only,.category-hint{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.header{height:62px;display:flex;align-items:center;gap:24px;padding:0 max(24px,calc((100vw - 1360px)/2));background:white;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:9px;text-decoration:none;color:inherit;font-size:21px;font-weight:700;letter-spacing:-.7px}.brand small{display:none}.brand-symbol{width:32px;height:32px;border-radius:10px;background:var(--accent);display:grid;place-items:center;color:white;font-size:22px}.header-tools{display:flex;gap:8px;margin-left:auto;align-items:center}.help-button{height:34px;width:34px;border:1px solid var(--line);border-radius:50%;color:var(--muted)}.demo-badge{font-size:10px;background:#fff5da;color:#896622;padding:4px 7px;border-radius:5px}.view-tabs{display:flex;gap:3px;background:var(--soft);padding:3px;border-radius:9px}.view-tabs button{padding:7px 12px;border-radius:6px;font-size:13px;min-height:34px;color:var(--muted)}.view-tabs .active{background:white;color:var(--accent);font-weight:650;box-shadow:0 1px 4px #243b2010}
main{max-width:1360px;padding:16px 24px 64px;margin:auto}.scope-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;min-height:36px}.owners{display:flex;gap:5px}.owners>button{display:flex;align-items:center;gap:8px;padding:8px 12px;min-height:38px;border-radius:8px;color:var(--muted);border:1px solid transparent;font-size:13px}.owners>button.selected{color:var(--ink);background:white;border-color:var(--line);box-shadow:0 1px 3px #16302308}.owner-icon{height:21px;width:21px;background:var(--soft);display:grid;place-items:center;border-radius:6px;font-size:11px;color:var(--accent)}.owner-count{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.storage-note{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);max-width:190px;text-align:right;padding:7px 9px;border-radius:7px}.storage-note::before{content:'○';color:#81938a}.storage-note.is-synced::before{content:'✓';color:var(--accent)}.storage-note.has-issue{background:#fff2df;color:#885825}.storage-note.has-issue::before{content:'!';font-weight:700}.storage-note[aria-busy=true]::before{content:'↻'}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:18px;align-items:start}.ledger,.entry-panel{background:white;border:1px solid var(--line);border-radius:12px}.ledger{overflow:hidden}.ledger-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 16px 12px}.ledger-toolbar h2{margin:0;font-size:13px;font-weight:600;color:var(--muted)}.ledger-toolbar h2 span{font-size:11px;background:var(--soft);padding:2px 6px;margin-left:4px;border-radius:5px}.ledger-toolbar p{margin:5px 0 0;color:var(--muted);font-size:11px}.ledger-toolbar p strong{font-size:20px;color:var(--ink);font-weight:650;letter-spacing:-.4px}.ledger-filters{display:flex;gap:8px;align-items:center}.ledger-filters input{width:clamp(150px,17vw,240px);height:36px;border:1px solid var(--line);border-radius:7px;background:#fafcf9;padding:8px 10px;font-size:12px}.order-button{white-space:nowrap;font-size:11px;min-height:36px;padding:5px;color:var(--muted)}.ledger-scope{display:flex;gap:7px;align-items:center;padding:0 16px 13px;flex-wrap:wrap}.ledger-scope select{background:white;border:1px solid var(--line);border-radius:6px;padding:6px 9px;font-size:12px;max-width:200px;height:33px}.text-button{font-size:12px;color:var(--accent);padding:5px 0}.text-button:hover{text-decoration:underline}.day-heading{display:flex;justify-content:space-between;align-items:center;padding:7px 16px;background:#f6f9f5;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}.day-heading strong{font-weight:600}.expense-line{display:flex;align-items:center;gap:4px;padding:0 9px 0 16px;border-top:1px solid #edf1eb;min-height:39px}.expense-line:hover{background:#f9fbf7}.expense-edit{display:grid;grid-template-columns:112px minmax(0,1fr) 14px 36px minmax(65px,auto);gap:9px;align-items:center;flex:1;min-width:0;text-align:left;padding:8px 0;touch-action:manipulation}.row-category{display:flex;align-items:center;gap:4px;min-width:0;padding:3px 6px;border-radius:5px;font-size:10px;line-height:1.15}.row-category-name,.expense-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.expense-description{font-size:13px}.row-category.uncategorized{background:none;border-color:transparent;color:var(--muted)}.row-category.uncategorized .row-category-name{font-size:9px}.row-tag{font-size:10px;color:#58749b;margin-left:8px}.split-badge{font-size:13px;color:var(--accent)}.expense-amount{white-space:nowrap;text-align:right;font-size:13px;font-weight:650;font-variant-numeric:tabular-nums}.expense-amount small{font-size:10px;color:var(--muted);font-weight:400;margin-left:3px}.payment-tag{font-size:10px;line-height:1.5;text-align:center;color:#256392;background:#deedff;border:1px solid #9fc3e9;border-radius:4px;padding:0 4px}.payment-tag.cash{color:#aa4338;background:#ffe5e0;border-color:#eab3aa}.row-more{height:34px;min-width:26px;font-size:19px;color:var(--muted);border-radius:5px}.row-more:hover{background:var(--soft)}.load-more{width:100%;padding:13px;font-size:12px;border-top:1px solid var(--line);color:var(--accent)}.empty-ledger{padding:34px 20px;text-align:center;color:var(--muted);font-size:12px}.empty-ledger strong{display:block;color:var(--ink);font-size:16px;margin-bottom:8px;font-weight:600}
.entry-panel{padding:16px;position:sticky;top:16px;scroll-margin-top:12px}.entry-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.entry-heading h2{font-size:14px;font-weight:650;margin:0;white-space:nowrap}.entry-modes{display:flex;padding:3px;background:var(--soft);border-radius:7px;flex-shrink:0}.entry-modes button{white-space:nowrap;min-height:30px;padding:5px 8px;border-radius:5px;font-size:11px;color:var(--muted)}.entry-modes button.active{background:white;color:var(--ink);box-shadow:0 1px 3px #16302312}.entry-fields{display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px;align-items:center}.amount-input{display:flex;align-items:center;gap:5px;height:44px;border:1px solid #cbd9cf;background:#fafcf9;border-radius:8px;padding:0 9px}.amount-input input{border:0;background:none;width:100%;height:42px;font-size:25px;font-weight:550;letter-spacing:-.7px;font-variant-numeric:tabular-nums;padding:0}.amount-input input::placeholder{color:#8a9b8e}.amount-input>span{font-size:11px;color:var(--muted)}.amount-input:focus-within{outline:2px solid #4b9270;outline-offset:2px}.amount-input input:focus-visible{outline:none}.description-block{position:relative}.description-block>input{height:44px;padding:9px 11px;width:100%;border:1px solid var(--line);border-radius:8px;font-size:14px;background:#fafcf9}input::placeholder{color:#78887e;opacity:1}.amount-preview{display:none;font-size:12px;color:var(--accent);margin-top:6px}.amount-preview.calculated{display:block}.amount-preview:empty{display:none}#suggestions{position:absolute;z-index:8;top:calc(100% + 4px);left:0;right:0;background:white;border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 24px #17302619;overflow:hidden}#suggestions button{display:flex;flex-wrap:wrap;gap:3px 9px;width:100%;padding:10px;text-align:left;font-size:13px}#suggestions button span{color:var(--muted);font-size:11px}#suggestions button:hover,#suggestions .highlight{background:var(--soft)}
.entry-meta{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:10px}.date-controls{position:relative;min-width:0}.date-input-row{display:flex;gap:3px;align-items:center}.date-input-row>button{display:grid;place-items:center;min-width:29px;height:34px;font-size:18px;background:#f7faf5;border:1px solid var(--line);border-radius:6px}#date-text{border:1px solid var(--line);border-radius:6px;height:34px;width:92px;font-size:13px;padding:5px 7px;background:white}#date-text[aria-invalid=true]{border-color:#b45144}.payment-control{display:flex;border:1px solid var(--line);padding:2px;border-radius:7px}.payment-control button{height:30px;padding:4px 10px;font-size:12px;border-radius:4px;color:var(--muted)}.payment-control [data-payment=Cash].active{color:#a8392e;background:#ffd9d2}.payment-control [data-payment=Card].active{color:#235f92;background:#cfe5ff}#date-error{font-size:12px;color:#a44238;margin:6px 0}
#date-menu{position:absolute;z-index:10;top:calc(100% + 6px);left:0;width:280px;max-width:calc(100vw - 52px);padding:12px;background:white;border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 35px #17302620}.calendar-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:7px}.calendar-heading strong{font-size:13px;text-transform:capitalize;font-weight:650}.calendar-heading button{height:32px;width:32px;background:var(--soft);border-radius:6px;font-size:23px}.calendar-weekdays,#calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}.calendar-weekdays span{text-align:center;font-size:11px;color:var(--muted);padding:4px}.calendar-weekdays,#calendar-days{font-variant-numeric:tabular-nums}#calendar-days button{height:33px;border-radius:6px;font-size:13px}#calendar-days button:hover{background:var(--soft)}#calendar-days .outside{color:#849589}#calendar-days .today{box-shadow:inset 0 0 0 1px #75a889}#calendar-days .selected{background:var(--accent);color:white}.date-shortcuts{display:flex;justify-content:center;gap:7px;margin:10px 0 4px}.date-shortcuts button{padding:5px 14px;min-height:32px;border:1px solid var(--line);border-radius:6px;font-size:12px}#calendar-close{width:100%;font-size:11px}
.category-picker{margin:12px 0}.category-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:7px}.category-heading label{font-size:11px;color:var(--muted)}#category-search{width:150px;height:30px;border:1px solid var(--line);border-radius:6px;background:#fafcf9;font-size:12px;padding:5px 8px}#category-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}#category-options button,#category-results button,.row-category,.part-category{background:color-mix(in srgb,var(--category-color) 17%,white);border:1px solid color-mix(in srgb,var(--category-color) 40%,white);color:color-mix(in srgb,var(--category-color) 77%,#16271d)}#category-options button{display:flex;align-items:center;gap:3px;min-width:0;min-height:32px;padding:5px 6px;border-radius:6px;font-size:11px;line-height:1.2;text-align:left}#category-options button.active{border-color:var(--category-color);box-shadow:inset 0 0 0 1px var(--category-color);background:color-mix(in srgb,var(--category-color) 26%,white);font-weight:650}#category-options button:hover{background:color-mix(in srgb,var(--category-color) 23%,white)}.category-text{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.category-emoji{flex:0 0 auto}.mobile-selected,#category-options .category-all{display:none}.is-split .category-picker{display:none}
.tag-tools{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:9px 0}.tag-chips{display:flex;gap:5px;flex-wrap:wrap}.tag-chip{display:inline-flex;align-items:center;gap:6px;color:#476993;border:1px solid #cbd9ef;background:#eef3fc;border-radius:6px;font-size:11px;padding:4px 7px;overflow-wrap:anywhere}.tag-tools #tag-open{font-size:11px;padding:3px 5px;min-height:28px}.tag-tools #tag-editor{display:flex;gap:5px;align-items:center;width:100%}#tag-input{height:36px;border:1px solid var(--line);border-radius:6px;padding:7px 9px;width:100%;font-size:13px}#tag-add{height:36px;width:36px;flex-shrink:0;background:var(--soft);border-radius:6px;font-size:19px;color:var(--accent)}.split-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:7px 0}.split-top .text-button{font-size:12px}#split-balance{font-size:11px;color:var(--accent);text-align:right}.split-part{display:grid;grid-template-columns:minmax(0,1fr) 105px 74px 24px;gap:5px;border:1px solid var(--line);background:#fafcf9;padding:6px;border-radius:8px;margin-bottom:6px}.split-part>input{min-width:0;width:100%;height:35px;padding:6px 8px;border:1px solid var(--line);border-radius:5px;background:white;font-size:12px}.part-bottom{display:contents}.part-bottom .part-category,.part-bottom input{width:100%;min-width:0;height:35px;padding:5px 6px;border-radius:5px;font-size:11px}.part-bottom input{border:1px solid var(--line);font-size:13px;background:white;font-variant-numeric:tabular-nums}.part-category{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:left}.part-category span{float:right}.part-remove{grid-column:4;grid-row:1;align-self:stretch;font-size:20px;color:var(--muted);border-radius:4px}.part-remove:hover{background:#fee7e1;color:#ae4b3b}.remainder-field{color:var(--accent)!important;background:var(--soft)!important}.is-split .entry-fields{display:block}.is-split .amount-field{max-width:150px}.is-split .amount-label{position:static!important;width:auto!important;height:auto!important;clip:auto!important;white-space:normal!important;margin:0 0 5px!important;overflow:visible!important;font-size:11px;color:var(--muted)}#add-part{font-size:12px;margin:2px 0 8px}#form-error{font-size:12px;color:#973e32;background:#fff0eb;border:1px solid #f0d2c7;border-radius:7px;padding:9px 10px;margin:9px 0}.save-button{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:44px;background:var(--accent);color:white;border-radius:8px;padding:11px 13px;font-size:13px;font-weight:550}.save-button:hover:not(:disabled){background:#21543b}.save-button kbd{font-family:inherit;font-size:10px;opacity:.75;font-weight:400}.repeat-section{border-top:1px solid var(--line);margin-top:12px;padding-top:9px}.repeat-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:11px;margin-bottom:7px}.repeat-heading button{font-size:11px;white-space:nowrap}.repeat-heading kbd{display:none}#repeat-items{display:flex;flex-wrap:wrap;gap:5px}#repeat-items button{max-width:100%;border:1px solid var(--line);border-radius:6px;padding:5px 8px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#f8fbf5}#repeat-items button:hover{background:var(--soft)}.demo-note{font-size:11px;color:var(--muted)}
#category-backdrop{position:fixed;inset:0;z-index:39;background:#193d2947}#category-popover{position:fixed;z-index:40;max-height:calc(100dvh - 24px);padding:12px;background:white;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 40px #17302630;overflow:hidden}.picker-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;font-size:14px}.picker-heading button{height:32px;width:32px;font-size:22px;border-radius:6px;background:var(--soft)}#category-filter{width:100%;height:38px;border:1px solid var(--line);border-radius:7px;padding:7px 9px;font-size:14px;background:#fafcf9}#category-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:8px;max-height:280px;overflow:auto;overscroll-behavior:contain;padding:2px}#category-results button{min-width:0;min-height:38px;display:flex;align-items:center;gap:4px;padding:6px;border-radius:6px;text-align:left;font-size:11px}#category-results .category-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#category-results button.active,#category-results .highlight{outline:2px solid var(--category-color);outline-offset:-2px;background:color-mix(in srgb,var(--category-color) 26%,white)}#category-results>p{grid-column:1/-1;color:var(--muted);font-size:12px}body.editing-open,body.picker-open{overflow:hidden}
.toast{position:fixed;z-index:30;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100vw - 24px);display:flex;align-items:center;gap:12px;color:white;background:#203e2d;border-radius:10px;padding:12px 14px;box-shadow:0 8px 28px #17302630;font-size:12px}.toast span{overflow:hidden;text-overflow:ellipsis;max-height:3em}.toast button{color:#d6ecc7;white-space:nowrap}.toast button:last-child{height:28px;min-width:24px;font-size:20px}.quick-add{position:fixed;bottom:max(18px,env(safe-area-inset-bottom));right:16px;z-index:16;color:white;background:var(--accent);font-size:14px;font-weight:600;border-radius:30px;min-height:46px;padding:10px 18px;box-shadow:0 5px 24px #17302630}dialog{width:calc(100% - 28px);max-width:460px;max-height:calc(100dvh - 28px);border:1px solid var(--line);border-radius:14px;padding:20px;color:var(--ink);box-shadow:0 15px 60px #17302630}dialog::backdrop{background:#183b2b55;backdrop-filter:blur(2px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}.dialog-heading h2{margin:0;font-size:18px}.icon-button{font-size:22px;height:34px;min-width:34px;border-radius:6px}.icon-button:hover{background:var(--soft)}#help-dialog p{font-size:13px;line-height:1.65}.demo-tools{display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid var(--line);padding-top:12px;font-size:11px;color:var(--muted)}#edit-dialog{width:500px;max-width:calc(100vw - 24px);padding:0;overflow:auto}#edit-dialog .entry-panel{border:0;width:100%;position:static;padding:18px}#edit-dialog .entry-modes,#edit-dialog .repeat-section{display:none}#cancel-edit{padding:5px 8px;border:1px solid var(--line);border-radius:6px;font-size:12px}#edit-dialog #save{position:sticky;bottom:0;box-shadow:0 0 0 5px white}.detail-meta{font-size:12px;line-height:1.8;color:var(--muted);margin-bottom:10px}.detail-part{display:flex;justify-content:space-between;gap:10px;border-top:1px solid var(--line);padding:10px 0;font-size:13px}.detail-part small{display:block;font-size:11px;color:var(--muted);margin-top:3px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.dialog-actions button,.small-primary{padding:9px 12px;border:1px solid var(--line);border-radius:7px;font-size:13px}.small-primary{color:white;background:var(--accent);border-color:var(--accent)}.danger-button{color:#a94439}.sync-conflict{border-top:1px solid var(--line);padding:12px 0;font-size:13px}.sync-conflict button{margin:4px 0}
.chart-tooltip{position:fixed;z-index:50;pointer-events:none;background:#203e2d;color:white;border:1px solid #375c43;border-radius:9px;padding:10px 12px;max-width:min(260px,calc(100vw - 16px));box-shadow:0 8px 24px #17302626}.chart-tooltip>strong,.chart-tooltip>span,.chart-tooltip>small{display:block}.chart-tooltip>strong{font-size:12px;font-weight:500}.chart-tooltip>span{font-size:21px;font-weight:650;font-variant-numeric:tabular-nums;margin-top:2px}.chart-tooltip small{font-size:11px;color:#d2e4d5;font-weight:400}
@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr) 380px;gap:14px}.ledger-toolbar{flex-wrap:wrap}.ledger-filters{width:100%}.ledger-filters input{width:auto;flex:1}.entry-panel{padding:14px}#category-options{grid-template-columns:repeat(3,minmax(0,1fr))}#category-options button{font-size:11px}.expense-edit{grid-template-columns:88px minmax(0,1fr) 8px 34px minmax(55px,auto);gap:6px}.row-category{font-size:9px}.row-category-name{font-size:9px}.row-tag{display:none}.split-part{grid-template-columns:minmax(0,1fr) 96px 66px 22px}}
@media(max-width:730px){.header{height:56px;padding:0 14px;gap:10px}.brand{font-size:17px;gap:6px;letter-spacing:-.5px}.brand-symbol{height:27px;width:27px;border-radius:8px;font-size:19px}.view-tabs{margin-left:auto;padding:2px;gap:0}.view-tabs button{font-size:12px;padding:6px 9px;min-height:36px}.header-tools{margin:0}.help-button{width:30px;height:30px}.header-tools .demo-badge{display:none}main{padding:12px 12px 85px}.scope-bar{gap:4px;margin-bottom:12px;min-height:38px}.owners{flex:1;gap:3px}.owners>button{flex:1;justify-content:center;gap:5px;padding:7px 5px;font-size:12px;min-height:38px}.owner-count{display:none}.owner-icon{width:18px;height:18px;font-size:10px}.storage-note{max-width:108px;font-size:10px;padding:5px;gap:4px}.storage-note.is-synced{font-size:0;width:30px;height:30px;justify-content:center}.storage-note.is-synced::before{font-size:16px}.workspace{display:flex;flex-direction:column;gap:16px}.entry-panel{order:-1;width:100%;position:static;padding:12px;scroll-margin-top:12px}.entry-heading{margin-bottom:11px}.entry-heading h2{font-size:13px}.entry-modes button{min-height:32px;font-size:11px;padding:5px 8px}.entry-fields{grid-template-columns:100px minmax(0,1fr)}.description-block>input{font-size:16px;padding:8px 10px}.amount-input input{font-size:25px}.entry-meta{gap:5px}.date-input-row>button{width:28px;min-width:28px;height:36px}#date-text{width:88px;height:36px;font-size:16px;padding:5px}.payment-control button{height:32px;min-height:32px;padding:5px 9px}.category-heading #category-search{display:none}.mobile-selected{display:block;max-width:72%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--ink);min-height:28px;border:1px solid var(--line);background:var(--soft);padding:3px 7px;border-radius:6px}#category-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}#category-options button{display:none;font-size:12px}#category-options .quick-category,#category-options .category-all{display:flex;min-height:39px;padding:5px 6px}#category-options .category-all{justify-content:space-between;color:var(--accent);background:#f3f7ef;border:1px solid #cedccd}.tag-tools{margin:7px 0}.tag-chip{min-height:30px}.tag-tools #tag-open{min-height:30px}#tag-input{height:38px;font-size:16px}#tag-add{height:38px}.split-part{grid-template-columns:minmax(0,1fr) 28px;gap:5px;padding:7px}.split-part>input{grid-column:1;grid-row:1;min-height:38px;height:38px;font-size:16px}.part-remove{grid-column:2;grid-row:1/3}.part-bottom{display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:6px;grid-column:1;grid-row:2}.part-bottom .part-category{font-size:12px;min-height:38px;height:38px;padding:5px 8px}.part-bottom input{font-size:16px;height:38px;min-height:38px;padding:5px 8px}.split-top .text-button{min-height:30px;font-size:12px}.save-button{min-height:46px}.save-button kbd{display:none}.repeat-heading{font-size:10px}.repeat-heading button{font-size:10px}#repeat-items button{min-height:31px;font-size:11px;padding:5px 7px}.ledger{width:100%}.ledger-toolbar{padding:14px 12px 9px;gap:9px}.ledger-toolbar h2{font-size:12px}.ledger-toolbar p strong{font-size:21px}.ledger-filters{gap:5px}.ledger-filters input{font-size:16px;height:38px;flex:1;min-width:0}.order-button{font-size:12px;min-height:38px;padding:5px 7px}.ledger-scope{padding:0 12px 12px;gap:5px}.ledger-scope select{flex:1;min-width:0;max-width:100%;font-size:12px;height:36px}.expense-line{padding:0 7px 0 12px;min-height:43px;gap:2px}.expense-edit{grid-template-columns:24px minmax(0,1fr) 10px 36px minmax(60px,auto);gap:6px;padding:9px 0}.row-category{padding:3px;min-height:24px;justify-content:center;font-size:13px}.row-category-name{display:none}.expense-description{font-size:13px}.expense-amount{font-size:13px}.row-more{min-width:30px;min-height:38px}.payment-tag{font-size:10px}.day-heading{padding:7px 12px;font-size:11px}.load-more{min-height:44px}.repeat-section{padding-top:9px;margin-top:11px}.toast{gap:8px;font-size:12px}.toast span{max-width:60vw}.toast button{min-height:30px}.calendar-heading button{height:36px;width:36px}#calendar-days button{height:34px}.date-shortcuts button{height:34px}#category-popover{left:8px!important;right:8px;width:auto;top:auto!important;bottom:8px;max-height:70dvh;display:flex;flex-direction:column;padding:12px 12px max(12px,env(safe-area-inset-bottom));border-radius:15px}.picker-heading{flex-shrink:0}.picker-heading button{width:36px;height:36px}#category-filter{font-size:16px;height:40px;flex-shrink:0}#category-results{max-height:none;overflow:auto;min-height:0}#category-results button{min-height:43px;font-size:12px}#edit-dialog{margin:auto auto 10px;max-height:calc(100dvh - 20px);border-radius:16px}#edit-dialog .entry-panel{padding:14px}.dialog-actions button{min-height:40px}}
@media(max-width:360px){.brand>span:last-child{display:none}.header{gap:12px}.view-tabs{margin-left:0}.header-tools{margin-left:auto}.entry-heading h2{font-size:12px}.entry-modes button{padding:4px 6px;font-size:10px}.entry-fields{grid-template-columns:92px minmax(0,1fr)}.entry-meta{flex-wrap:wrap}.payment-control{margin-left:auto}.owner-icon{display:none}#category-options button{font-size:11px}}
@media(any-pointer:fine){.category-heading #category-search{display:block}.category-heading .mobile-selected{display:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

.entry-extras{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 10px;margin:6px 0 9px}.entry-extras .tag-tools,.entry-extras .split-top{margin:0}.entry-extras .tag-tools{flex:1;min-width:0}.entry-extras:has(#tag-editor:not([hidden])) .tag-tools{flex-basis:100%}.entry-extras .split-top{margin-left:auto}.entry-extras:has(.tag-chip) .split-top{flex-shrink:0}.entry-extras #split-balance{max-width:130px}

/* Shared navigation: one stable place for the view and the expense scope. */
.header{position:sticky;top:0;z-index:20;height:62px;background:#fff;border-bottom:1px solid var(--line)}
.header .scope-bar{margin:0 0 0 14px;min-height:0;gap:0}.header .owners{gap:2px;padding:3px;border:1px solid var(--line);border-radius:9px;background:#f7faf5}.header .owners>button{border:0;min-height:32px;padding:6px 12px;border-radius:6px;font-size:12px;white-space:nowrap}.header .owners>button.selected{background:var(--accent);color:white;box-shadow:none}.header .owner-icon,.header .owner-count{display:none}.header .header-tools{display:flex;align-items:center;gap:8px}.header .storage-note{max-width:160px}.header button:disabled{opacity:.55;cursor:default}.entry-panel{top:78px;scroll-margin-top:78px}
@media(max-width:900px) and (min-width:731px){.header{padding-inline:16px;gap:10px}.header .scope-bar{margin-left:0}.header .owners>button{padding-inline:8px}.header .storage-note.is-synced{font-size:0;max-width:28px}.header .storage-note.is-synced::before{font-size:16px}.brand>span:last-child{display:none}}
@media(max-width:730px){.header{height:auto;min-height:56px;flex-wrap:wrap;gap:0 8px;padding:8px 12px 9px}.header .scope-bar{order:3;flex:0 0 100%;margin:7px 0 0}.header .owners{width:100%;gap:3px;padding:3px}.header .owners>button{flex:1;min-height:35px;padding:5px 6px;font-size:12px}.header .header-tools{gap:4px}.header .storage-note{max-width:30px;width:30px;min-height:30px;font-size:0;padding:4px;justify-content:center}.header .storage-note::before{font-size:16px}.header .storage-note.has-issue::before{font-size:16px}.header .storage-note.has-issue{font-size:0}.entry-panel{scroll-margin-top:116px}.header .view-tabs{margin-left:auto}.header .view-tabs button{padding:6px 8px}.header .brand{font-size:16px}}
@media(max-width:360px){.header .brand>span:last-child{display:none}.header .view-tabs{margin-left:auto}.header .owners>button{font-size:11px}.header .header-tools{margin-left:0}}

/* Statistics: one surface, with detail revealed where it is requested. */
.stats-panel{scroll-margin-top:78px;max-width:1120px;margin:0 auto}
.stats-dashboard{background:white;border:1px solid var(--line);border-radius:14px;padding:24px 28px;font-variant-numeric:tabular-nums}
.dashboard-toolbar,.period-nav,.dashboard-filters,.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px}
.dashboard-toolbar{margin-bottom:20px}.period-nav{justify-content:flex-start;gap:8px;min-width:0}.period-nav>button{width:32px;height:36px;flex-shrink:0;border-radius:7px;font-size:23px;color:var(--muted)}.period-nav>button:hover{background:var(--soft)}.period-nav h2{font-size:22px;letter-spacing:-.5px;text-transform:capitalize;margin:0;font-weight:650}.dashboard-filters{gap:16px}.dashboard-filters select{border:0;border-bottom:1px solid var(--line);background:white;padding:7px 2px;max-width:190px;font-size:12px}.dashboard-filters .text-button{min-height:36px}
.period-picker{position:relative}.period-picker summary{display:flex;align-items:center;gap:8px;cursor:pointer;list-style:none;border-radius:5px;min-height:36px}.period-picker summary::-webkit-details-marker{display:none}.period-picker summary>span{color:var(--muted)}.period-picker summary:focus-visible{outline:2px solid #4b9270;outline-offset:3px}.period-popover{position:absolute;z-index:8;top:calc(100% + 8px);left:0;background:white;border:1px solid var(--line);box-shadow:0 8px 30px #17302620;border-radius:9px;padding:12px;min-width:220px}.period-popover label{display:block;font-size:11px;color:var(--muted);margin-bottom:5px}.period-popover input{border:1px solid var(--line);border-radius:6px;background:white;padding:8px;width:100%;font-size:16px}.stats-back{font-size:12px;color:var(--accent);padding:0 0 16px;text-transform:capitalize;min-height:32px}
.spending-summary{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);align-items:start;gap:24px;padding-bottom:24px}.spending-total>span,.investment-total>span{font-size:12px;color:var(--muted)}.spending-total>strong{display:block;font-size:40px;font-weight:650;letter-spacing:-1.3px;line-height:1.4}.spending-total>strong small,.investment-total>strong small{font-size:13px;font-weight:400;letter-spacing:0;color:var(--muted)}.spending-total>small,.investment-total>small{font-size:11px;color:var(--muted)}.period-comparison{font-size:12px;color:var(--ink);margin:4px 0 7px}.period-comparison>span{color:var(--muted)}.investment-total{padding-left:24px;border-left:1px solid var(--line);margin-top:2px}.investment-total>strong{display:block;font-size:26px;font-weight:550;color:#72568b;line-height:1.6;letter-spacing:-.5px}.investment-total p{font-size:11px;color:var(--muted);margin:3px 0 9px}.investment-total>small>strong{font-size:11px;font-weight:550;color:var(--ink)}
.section-title{margin-bottom:12px;gap:8px}.section-title h3{margin:0;font-size:14px;font-weight:650}.section-title small{color:var(--muted);font-size:10px;text-align:right}.year-strip{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 0;margin-bottom:24px}.year-link{font-size:13px;font-weight:650;padding:4px 0;min-height:28px}.year-link span{color:var(--muted);margin-left:5px}.year-chart{display:flex;gap:7px;min-width:0;height:110px}.year-month{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:5px;position:relative;padding:4px;border-radius:6px;color:var(--muted);text-transform:capitalize}.year-month:hover,.year-month.selected,.year-month.inspected{background:#eff5ed}.year-month.selected{color:var(--accent);box-shadow:inset 0 -2px var(--accent)}.month-value{font-size:10px;white-space:nowrap;line-height:14px}.month-track{position:relative;width:100%;height:64px}.month-track:after{content:'';position:absolute;top:var(--chart-zero);left:0;right:0;border-top:1px solid var(--line)}.month-bar{position:absolute;left:20%;width:60%;background:#a8cbb5;border-radius:3px 3px 0 0;z-index:1}.month-bar.negative{background:#ac92c0;border-radius:0 0 3px 3px}.year-month.selected .month-bar,.year-month:hover .month-bar{background:var(--accent)}.year-month.selected .month-bar.negative,.year-month:hover .month-bar.negative{background:#72568b}.month-name{font-size:11px;line-height:16px}
.dashboard-body{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:36px}.dashboard-aside{min-width:0;display:flex;flex-direction:column;gap:28px}.category-summary{min-width:0}.category-group{border-bottom:1px solid #edf1eb}.category-row{display:grid;grid-template-columns:27px minmax(0,1fr) auto 70px 14px;align-items:center;gap:8px;width:100%;min-height:49px;padding:8px 5px;text-align:left;background:linear-gradient(to right,color-mix(in srgb,var(--category-color) 17%,white) var(--category-fill),transparent var(--category-fill));border-radius:5px}.category-row:hover,.expanded .category-row{background:linear-gradient(to right,color-mix(in srgb,var(--category-color) 24%,white) var(--category-fill),#f8faf7 var(--category-fill))}.category-marker{display:grid;place-items:center;width:26px;height:26px;border-radius:6px;background:color-mix(in srgb,var(--category-color) 18%,white);font-size:14px}.stats-category-name{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stats-category-amount{text-align:right;white-space:nowrap}.stats-category-amount strong{display:block;font-size:13px;font-weight:650}.stats-category-amount small{font-size:10px;color:var(--muted);font-weight:400}.category-chevron{font-size:15px;text-align:right;color:var(--muted)}.category-detail{padding:10px 8px 8px;background:#fafcf9}.category-detail-heading{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--muted);gap:8px}.category-detail-heading button{font-size:21px;min-width:32px;min-height:32px}.category-transaction{display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:9px;align-items:center;text-align:left;width:100%;padding:10px 0;border-top:1px solid var(--line)}.category-transaction:hover{background:var(--soft)}.transaction-date{font-size:10px;color:var(--muted)}.transaction-description{font-size:12px;overflow-wrap:anywhere;min-width:0}.transaction-description>small{display:block;margin-top:3px;font-size:10px;color:var(--muted)}.category-transaction>strong{font-size:12px;white-space:nowrap;font-weight:600}.category-transaction>strong small{font-size:10px;font-weight:400;color:var(--muted)}.stats-footnote{font-size:10px;color:var(--muted);line-height:1.6;margin:12px 0 0}.stats-empty{font-size:13px;color:var(--muted);padding:20px 0}
.annual-table{width:100%;border-collapse:collapse;font-size:12px}.annual-table th,.annual-table td{padding:10px 3px;text-align:right;border-bottom:1px solid #edf1eb;white-space:nowrap}.annual-table th:first-child{text-align:left}.annual-table thead th{font-size:10px;font-weight:400;color:var(--muted)}.annual-table tbody th{font-weight:500}.annual-table button{color:var(--accent);padding:3px 0;min-height:28px;font-size:12px;text-transform:capitalize}.payment-summary{display:flex;gap:18px;flex-wrap:wrap;color:var(--muted);font-size:11px;margin-top:12px}.payment-summary .payment-tag{margin-right:4px}.annual-table-wrap{overflow:auto}.annual-table tfoot th,.annual-table tfoot td{font-weight:650;border-top:1px solid var(--line);border-bottom:0}.annual-table strong{font-weight:600}.table-investment{display:block;color:#72568b;font-size:9px;font-weight:400;margin-top:2px}
@media(max-width:900px){.dashboard-body{gap:22px}.stats-dashboard{padding:20px}.category-row{grid-template-columns:25px minmax(0,1fr) auto 56px 12px;gap:5px}.month-value{font-size:9px}.year-chart{gap:3px}.year-month{padding-inline:2px}}
@media(max-width:730px){.stats-panel{scroll-margin-top:116px}.stats-dashboard{padding:15px 14px;border-radius:11px}.dashboard-toolbar{flex-wrap:wrap;gap:6px;margin-bottom:18px}.period-nav{width:100%;justify-content:space-between;gap:4px}.period-nav h2{font-size:20px;text-align:center}.period-nav>button{height:38px;min-width:34px}.dashboard-filters{width:100%;gap:12px;justify-content:space-between}.dashboard-filters select{max-width:calc(100% - 45px);font-size:12px}.dashboard-filters .text-button{min-height:30px;padding:4px 0}.spending-summary{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:12px;padding-bottom:18px}.spending-total>strong{font-size:30px;letter-spacing:-.8px}.spending-total>span,.investment-total>span{font-size:11px}.investment-total{padding-left:12px}.investment-total>strong{font-size:21px;line-height:1.8}.investment-total>small{display:block;font-size:10px}.investment-total>small>strong{display:block;font-size:11px}.investment-total p{font-size:10px;margin:3px 0 7px}.period-comparison{font-size:11px;line-height:1.5}.period-comparison>span{display:block;font-size:10px}.spending-total>small{font-size:10px;line-height:1.5;display:block}.year-strip{padding:12px 0;margin-bottom:20px}.year-chart{height:89px;gap:2px}.year-month{padding:3px 1px;gap:4px}.month-value{display:none}.month-track{height:60px}.month-name{font-size:9px}.section-title{margin-bottom:10px}.section-title h3{font-size:13px}.section-title small{font-size:9px;max-width:120px}.dashboard-body{grid-template-columns:1fr;gap:24px}.dashboard-aside{gap:22px}.category-row{grid-template-columns:25px minmax(0,1fr) auto 55px 12px;min-height:50px;gap:5px;padding:7px 2px}.stats-category-name{font-size:12px}.stats-category-amount strong{font-size:12px}.category-summary>.stats-footnote{margin-top:10px}.category-detail{padding:8px 4px}.category-transaction{gap:6px;grid-template-columns:40px minmax(0,1fr) auto}.annual-table{font-size:11px}.annual-table th,.annual-table td{padding:8px 3px}.annual-table button{font-size:11px;min-height:32px}.table-investment{font-size:8px}.period-popover{left:50%;transform:translateX(-50%)}.chart-tooltip{max-width:240px;padding:9px 11px}}
@media(max-width:360px){.stats-dashboard{padding:14px 10px}.period-nav h2{font-size:18px}.spending-total>strong{font-size:26px}.investment-total>strong{font-size:18px}.category-row{grid-template-columns:23px minmax(0,1fr) auto 44px 10px;gap:4px}.stats-category-name{font-size:11px}.stats-category-amount strong{font-size:11px}.annual-table th,.annual-table td{padding:8px 2px}.annual-table{font-size:10px}}

/* Family perspective stays visible; the owner picker belongs to expense entry only. */
.stats-open .header{height:62px;min-height:62px;flex-wrap:nowrap}
.family-band{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;padding:0 0 22px}.family-contribution{min-width:0}.source-label{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:6px}.source-label::before{content:'';height:6px;width:6px;flex-shrink:0;border-radius:50%;background:var(--source-color)}.source-Comune{--source-color:#387353}.source-David{--source-color:#4078a7}.source-Maria{--source-color:#8a64a9}.family-contribution>strong{display:block;font-size:21px;font-weight:600;margin-top:4px;letter-spacing:-.4px}.family-contribution>strong small{font-size:10px;font-weight:400;color:var(--muted);letter-spacing:0}.source-investment{display:block;font-size:10px;color:#72568b;margin-top:4px}
.dashboard-body{display:block}.dashboard-aside{gap:12px;margin-top:28px}.period-comparison-table{margin-bottom:26px}.dashboard-aside .period-comparison-table{margin-bottom:0}.category-columns,.category-row{display:grid;grid-template-columns:minmax(130px,1.5fr) repeat(4,minmax(80px,1fr)) 14px;gap:12px;align-items:center}.category-columns{font-size:11px;color:var(--muted);padding:8px 5px;border-bottom:1px solid var(--line);margin-bottom:3px}.category-columns>span:not(:first-child),.category-columns>strong{text-align:right}.category-columns>strong{font-weight:600}.category-columns [class^=source-]{color:var(--source-color)}.category-row{min-height:49px;padding:7px 5px;border-left:3px solid var(--category-color)}.stats-category-name{display:flex;align-items:center;gap:8px;min-width:0;font-size:14px;font-weight:550}.category-marker{flex-shrink:0}.category-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stats-category-amount strong{font-size:14px}.owner-amount{text-align:right;font-size:13px;white-space:nowrap}.owner-amount.is-zero{color:#7d8c82}.category-detail{padding-top:5px}.annual-table th,.annual-table td{padding:8px 5px}.annual-table thead [class^=source-]{color:var(--source-color)}.annual-table td>small,.annual-table td>strong>small{display:block;font-size:9px;color:#72568b;font-weight:400;margin-top:3px}.annual-table .selected-period{background:var(--soft)}.annual-table .selected-period button{font-weight:650}.annual-table tbody button{min-height:32px}.period-comparison-table .annual-table tfoot{background:#f7faf5}.payment-summary{margin-top:0}.period-comparison-table .section-title small{white-space:nowrap}
@media(max-width:900px){.category-columns,.category-row{grid-template-columns:minmax(110px,1.5fr) repeat(4,minmax(65px,1fr)) 12px;gap:8px}}
@media(max-width:730px){.stats-open .header{height:56px;min-height:56px;padding-block:8px}.stats-open .stats-panel{scroll-margin-top:68px}.family-band{gap:10px;padding-bottom:16px}.family-contribution>strong{font-size:17px;letter-spacing:-.3px}.source-label{font-size:10px;gap:4px}.source-investment{font-size:9px;line-height:1.5}.category-columns,.category-row{grid-template-columns:minmax(65px,1.35fr) repeat(4,minmax(42px,1fr)) 10px;gap:4px;padding-inline:2px}.category-columns{font-size:9px;min-height:31px}.category-row{min-height:47px}.stats-category-name{font-size:12px;gap:4px}.category-marker{width:16px;height:22px;font-size:11px;background:none}.stats-category-amount strong{font-size:12px}.stats-category-amount small{font-size:10px}.owner-amount{font-size:11px}.category-chevron{font-size:13px}.annual-table th,.annual-table td{padding:8px 3px}.annual-table td>small,.annual-table td>strong>small{font-size:8px;white-space:normal}.annual-table thead th{font-size:9px}.annual-table tbody button{min-height:32px}.annual-table{font-size:11px}.dashboard-aside{margin-top:24px}.period-comparison-table{margin-bottom:22px}}
@media(max-width:360px){.family-contribution>strong{font-size:15px}.family-contribution>strong small{font-size:9px}.family-band{gap:7px}.category-marker{display:none}.category-columns,.category-row{grid-template-columns:minmax(55px,1.4fr) repeat(4,minmax(39px,1fr)) 9px;gap:3px}.stats-category-name{font-size:11px}.stats-category-amount strong{font-size:11px}.owner-amount{font-size:10px}.annual-table{font-size:10px}.annual-table th,.annual-table td{padding:8px 2px}}

/* Explicit month/year scope; the database contains one calendar year. */
.period-controls{display:flex;align-items:center;gap:20px;min-width:0}.stats-range{display:flex;flex-shrink:0;padding:3px;gap:3px;border:1px solid var(--line);border-radius:8px;background:#f4f7f3}.stats-range button{font-size:13px;min-height:34px;padding:6px 12px;border-radius:5px;white-space:nowrap;color:var(--muted)}.stats-range button[aria-pressed=true]{background:var(--accent);color:white;font-weight:550}.period-nav>button:disabled{cursor:default;opacity:.25}.annual-heading h2{text-transform:none}.annual-table .upcoming-period{color:var(--muted)}.category-summary>.section-title h3{font-size:16px}
@media(max-width:900px){.period-controls{gap:10px}.stats-range button{padding-inline:9px}.dashboard-filters{gap:10px}}
@media(max-width:730px){.period-controls{width:100%;flex-direction:column;align-items:stretch;gap:12px}.stats-range{align-self:flex-start}.stats-range button{min-height:36px;font-size:13px;padding-inline:14px}.annual-heading{justify-content:flex-start}.annual-controls{flex-direction:row;justify-content:space-between;gap:8px}.annual-controls .period-nav{width:auto}.annual-heading h2{font-size:20px}.category-summary>.section-title h3{font-size:15px}.category-columns{font-size:10px}.stats-category-name{gap:3px}.category-marker{display:none}.category-columns,.category-row{grid-template-columns:minmax(74px,1.5fr) repeat(4,minmax(42px,1fr)) 10px}}
@media(max-width:360px){.category-columns,.category-row{grid-template-columns:minmax(64px,1.5fr) repeat(4,minmax(39px,1fr)) 9px;gap:3px}.category-columns{font-size:9px}}

/* Readable comparisons with compact, optional detail. */
.dashboard-body{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:28px;align-items:start}.dashboard-aside{margin-top:0}.category-columns,.category-row{grid-template-columns:minmax(100px,1.5fr) repeat(4,minmax(58px,1fr)) 12px;gap:7px}.category-row,.category-row:hover,.expanded .category-row{background:transparent;border-left:0;padding:9px 2px;min-height:58px}.category-row:hover,.expanded .category-row{background:#f5f8f3}.stats-category-name{position:relative;flex-wrap:wrap;padding-bottom:9px;gap:5px;font-size:14px;overflow:visible}.category-label{flex:1;min-width:0}.category-bar{position:absolute;bottom:0;left:0;height:4px;min-width:1px;border-radius:4px;background:var(--category-color)}.category-marker{display:none}.stats-category-amount strong{font-size:14px}.owner-amount{font-size:13px}.category-change{display:block;font-size:10px!important;color:#45664e!important}.spending-insights{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:0 0 26px;align-items:start}.insight{padding:14px 16px;border:1px solid #dfe7dd;border-radius:9px;background:#fafcf8;min-width:0}.insight h3{font-size:13px;margin:0 0 12px;font-weight:600}.insight p{font-size:12px;margin:8px 0;line-height:1.5}.insight>small,.insight-details p,.insight-details>small{font-size:11px;color:#55695b;line-height:1.5}.insight-value{display:flex;width:100%;align-items:baseline;gap:4px;font-size:24px;font-weight:600;text-align:left}.insight-value small{font-size:11px;font-weight:400}.insight-value span{margin-left:auto;font-size:15px;color:var(--accent)}.food-amounts{display:grid;grid-template-columns:1fr 1fr;gap:10px}.food-amounts button{text-align:left;min-height:42px}.food-amounts span{display:block;font-size:11px;color:#526957}.food-amounts strong{display:block;font-size:17px;margin-top:4px}.food-amounts small{font-size:10px;font-weight:400}.food-meter{height:6px;border-radius:4px;background:#268755;overflow:hidden;margin-top:10px}.food-meter span{display:block;height:100%;background:#db8640}.insight-details summary{cursor:pointer;font-size:11px;color:var(--accent);padding:5px 0;min-height:28px}.food-table{width:100%;border-collapse:collapse;font-size:11px}.food-table th,.food-table td{text-align:right;padding:6px 2px;border-bottom:1px solid var(--line)}.food-table th:first-child{text-align:left}.food-table thead th{font-size:9px;font-weight:500}.food-table button{min-height:28px;color:var(--accent);text-transform:capitalize}.partial-month .month-bar,.partial-month .mini-track i{background:repeating-linear-gradient(135deg,#448863 0 4px,#b8d7c3 4px 8px)}.future-month{opacity:.6}.category-trend{margin:12px 0 16px;border-bottom:1px solid var(--line);padding-bottom:12px}.category-trend .section-title strong{font-size:12px}.category-trend .section-title small{font-size:10px;max-width:none}.category-mini-chart{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:4px}.mini-month{min-width:0;text-align:center;border-radius:4px}.mini-month:hover{background:var(--soft)}.mini-month>span{font-size:9px;display:block;white-space:nowrap}.mini-month>small{font-size:10px;color:var(--muted);text-transform:capitalize;display:block}.mini-track{height:40px;position:relative;margin:5px 0;display:block}.mini-track:after{content:'';position:absolute;top:var(--chart-zero);left:0;right:0;border-top:1px solid var(--line)}.mini-track i{position:absolute;width:60%;left:20%;background:var(--category-color);border-radius:2px;z-index:1}.mini-track i.negative{background:#8759a1}.category-matrix{margin-top:24px;border-top:1px solid var(--line);padding-top:12px}.category-matrix>summary{cursor:pointer;font-size:14px;font-weight:600;padding:8px 0;min-height:36px}.category-matrix>summary span{font-size:11px;color:var(--muted);font-weight:400;margin-left:10px}.matrix-scroll{overflow:auto;margin-top:10px}.category-matrix table{border-collapse:collapse;min-width:940px;width:100%;font-size:11px}.category-matrix th,.category-matrix td{padding:8px 5px;text-align:right;border-bottom:1px solid var(--line);white-space:nowrap}.category-matrix th:first-child{position:sticky;left:0;background:white;text-align:left;z-index:1;min-width:110px}.category-matrix button{min-height:28px;color:var(--accent);text-align:inherit}.category-matrix thead th{font-weight:500}.category-matrix tbody th{font-weight:500}.month-value{font-size:11px;color:#304b39}.month-bar{background:#5d9d75}
@media(max-width:1050px){.dashboard-body{grid-template-columns:1fr}.dashboard-aside{margin-top:8px}.category-columns,.category-row{grid-template-columns:minmax(120px,1.5fr) repeat(4,minmax(65px,1fr)) 12px;gap:8px}}
@media(max-width:730px){.spending-insights{grid-template-columns:1fr;gap:8px;margin-bottom:22px}.insight{padding:12px 14px}.insight h3{margin-bottom:8px}.insight-value{font-size:21px}.insight p{margin:5px 0}.food-amounts strong{font-size:18px}.category-columns,.category-row{grid-template-columns:minmax(74px,1.5fr) repeat(4,minmax(42px,1fr)) 10px;gap:4px}.stats-category-name{font-size:13px}.category-row{min-height:58px}.stats-category-amount strong{font-size:13px}.owner-amount{font-size:12px}.category-change{font-size:9px!important}.category-mini-chart{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px 5px}.mini-month>span{font-size:11px}.category-matrix{display:none}.category-trend .section-title{align-items:start}.category-trend .section-title small{max-width:170px}}
@media(max-width:360px){.category-columns,.category-row{grid-template-columns:minmax(64px,1.5fr) repeat(4,minmax(38px,1fr)) 9px;gap:3px}.stats-category-name,.stats-category-amount strong{font-size:12px}.owner-amount{font-size:11px}}

.category-group,.category-row{scroll-margin-top:80px}.food-amounts button:disabled{cursor:default;color:inherit}.food-amounts button:not(:disabled):hover,.insight-value:hover{color:var(--accent)}
@media(max-width:730px){.spending-insights{grid-template-columns:repeat(2,minmax(0,1fr))}.food-insight{grid-column:1/-1}.insight-value{font-size:19px;gap:3px;flex-wrap:wrap}.insight-value span{display:none}.insight h3{font-size:12px}.insight>small{font-size:10px}.category-group,.category-row{scroll-margin-top:70px}}

@media(max-width:730px){.spending-insights>.insight:last-child:nth-child(4){grid-column:1/-1}}

/* Category history stays separate from the overview, including on small phones. */
#category-dialog{max-width:740px;width:calc(100% - 24px);padding:22px;overscroll-behavior:contain}#category-dialog .dialog-heading{position:sticky;top:-22px;background:white;z-index:2;padding-top:12px;padding-bottom:10px;margin-top:-12px}#category-dialog .category-trend{margin:14px 0 10px}.category-dialog-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px}.category-dialog-toolbar select,.compare-toolbar select{border:1px solid #cbd8cb;border-radius:6px;background:white;color:var(--ink);padding:7px 9px;font-size:14px;min-height:38px;max-width:100%}.category-dialog-toolbar>strong{font-size:23px;white-space:nowrap}.category-dialog-toolbar small{font-size:12px;font-weight:400}.dialog-family{display:flex;gap:18px;flex-wrap:wrap;margin-top:12px;font-size:12px}.dialog-family strong{margin-left:4px}.mini-month.selected{background:#e7f1e4;box-shadow:inset 0 -2px var(--accent)}.category-comparison,.year-outlook{border-top:1px solid var(--line);padding-top:22px;margin-top:26px}.compare-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.compare-toolbar>label{font-size:12px;display:flex;gap:6px;align-items:center}.compare-picker{position:relative;margin-left:auto}.compare-picker summary{cursor:pointer;min-height:38px;display:flex;align-items:center;color:var(--accent);font-size:13px}.compare-picker>div{position:absolute;z-index:5;right:0;background:white;border:1px solid var(--line);box-shadow:0 8px 25px #17302620;border-radius:8px;padding:10px;width:240px;max-height:310px;overflow:auto}.compare-picker label{display:flex;gap:8px;align-items:center;min-height:34px;font-size:13px}.compare-picker input{accent-color:var(--accent);width:17px;height:17px}.line-legend{display:flex;gap:18px;flex-wrap:wrap;margin:16px 0 8px;font-size:12px}.line-legend>span:before{content:'';display:inline-block;vertical-align:middle;width:20px;border-top:3px solid var(--series-color);margin-right:6px}.line-legend>.dashed:before{border-top-style:dashed}.line-chart-scroll{overflow-x:auto}.comparison-chart{display:block;width:100%;height:auto;min-width:470px;max-height:270px}.comparison-chart [data-chart-point]{cursor:pointer;outline:none}.comparison-chart [data-chart-point]:focus-visible circle:last-child,.comparison-chart .inspected circle:last-child{stroke-width:4;r:6px}.compare-table-scroll{overflow:auto}.compare-table{border-collapse:collapse;width:100%;font-size:13px;font-variant-numeric:tabular-nums}.compare-table th,.compare-table td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}.compare-table th:first-child{text-align:left}.compare-table th{font-weight:550}.compare-table button{min-height:30px;text-transform:capitalize;color:var(--accent)}.outlook-numbers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.outlook-numbers span{font-size:12px;color:#526957;display:block}.outlook-numbers strong{font-size:25px;display:block;margin-top:6px}.outlook-numbers small{font-size:12px;font-weight:400}.year-change{font-size:13px;line-height:1.7}.outlook-method summary{font-size:12px;color:var(--accent);cursor:pointer;min-height:32px}.outlook-method p{font-size:12px;line-height:1.7;color:#526957;max-width:800px}
@media(max-width:730px){#category-dialog{padding:14px;max-height:calc(100dvh - 20px)}#category-dialog .dialog-heading{top:-14px}.category-dialog-toolbar{gap:8px}.category-dialog-toolbar>strong{font-size:19px}.category-dialog-toolbar select{font-size:14px;min-width:0;max-width:65%}.dialog-family{gap:10px;font-size:11px}.category-comparison,.year-outlook{margin-top:22px;padding-top:18px}.category-comparison .section-title small,.year-outlook .section-title small{max-width:none;font-size:10px}.compare-toolbar{gap:7px}.compare-toolbar select{font-size:13px;padding:6px}.compare-picker{margin-left:0}.compare-picker>div{left:0;right:auto}.line-legend{gap:10px;font-size:11px}.compare-table th,.compare-table td{padding:7px 6px;font-size:12px}.outlook-numbers{grid-template-columns:1fr 1fr;gap:14px}.outlook-numbers>div:last-child{grid-column:1/-1}.outlook-numbers strong{font-size:21px}.outlook-numbers span{font-size:11px}.year-change{font-size:12px}.year-chart{overflow-x:auto;height:110px;gap:5px}.year-month{min-width:48px;flex:1}.month-value{display:block;font-size:10px}.month-name{font-size:10px}.spending-insights>.insight:last-child:nth-child(4){grid-column:1/-1}}

.annual-shortcuts{display:flex;gap:16px;flex-wrap:wrap;margin:-10px 0 18px}.annual-shortcuts button{font-size:12px;color:var(--accent);min-height:32px}.category-comparison,.year-outlook{scroll-margin-top:78px}

.chart-scroll-hint{display:none}@media(max-width:730px){.compact-chart .comparison-chart{min-width:0}.chart-scroll-hint{display:block;font-size:10px;color:var(--muted);margin:3px 0 10px}.line-chart-scroll{scrollbar-width:thin}}

.history-months{margin:12px 0}.history-months>summary{display:flex;justify-content:space-between;gap:10px;cursor:pointer;color:var(--accent);font-size:13px;min-height:38px;align-items:center}.history-months>summary span{font-size:11px;color:var(--muted)}@media(max-width:400px){.history-months>summary{flex-wrap:wrap}.history-months .compare-table th,.history-months .compare-table td{font-size:11px;padding-inline:3px}}

.trends-dashboard>.year-outlook{margin-top:0;padding-top:0;border-top:0}.historical-categories{border-top:1px solid var(--line);margin-top:26px;padding-top:22px;scroll-margin-top:78px}.history-controls{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.history-controls select{border:1px solid #cbd8cb;background:white;border-radius:6px;padding:8px 10px;min-height:38px;font-size:14px;max-width:100%}.historical-caption{font-size:13px;line-height:1.6;margin:14px 0;color:#526957}.history-totals td small{display:block;font-size:10px;color:var(--muted);margin-top:3px}.history-totals th:first-child{min-width:135px}.history-totals th button{color:var(--ink);text-transform:none;text-align:left}.history-totals .selected-period{background:#f0f6ed}.history-totals th,.history-totals td{white-space:normal}.history-totals td{white-space:nowrap}@media(max-width:730px){.annual-controls{flex-wrap:wrap}.annual-controls .stats-range{flex:0 0 auto}.history-controls{gap:8px}.history-controls select{font-size:13px;min-width:0}.historical-categories{margin-top:22px;padding-top:18px}.history-totals th:first-child{min-width:100px}.history-totals th,.history-totals td{font-size:11px;padding-inline:4px}.historical-caption{font-size:12px}.historical-categories>.section-title small{max-width:none}}

/* One shared entry modal; the ledger gets the full screen. */
.workspace{display:block;max-width:1120px;margin:0 auto}.add-open{background:var(--accent);color:white;border-radius:7px;min-height:34px;padding:7px 13px;font-size:12px;font-weight:600;white-space:nowrap}.entry-open{overflow:hidden}#edit-dialog{width:520px;max-height:calc(100dvh - 32px);overscroll-behavior:contain}#edit-dialog .entry-heading{gap:8px}#edit-dialog .entry-heading h2{flex:1}#edit-dialog:not(:has(.entry-owners[hidden])) .entry-modes{display:flex}#edit-dialog:not(:has(.entry-owners[hidden])) .repeat-section:not([hidden]){display:block}#cancel-edit{border:0;font-size:22px;padding:0;min-width:32px;min-height:32px;color:var(--muted);border-radius:6px}#cancel-edit:hover{background:var(--soft)}.entry-owners{display:flex;gap:3px;background:#f4f7f1;padding:3px;border-radius:7px;margin:0 0 12px}.entry-owners button{flex:1;border-radius:5px;min-height:32px;font-size:12px;color:var(--muted)}.entry-owners button.selected{background:white;color:var(--accent);font-weight:600;box-shadow:0 1px 4px #17302616}#edit-dialog .toast{z-index:60}#edit-dialog .entry-panel{scroll-margin-top:0}.workspace .ledger{width:100%}
@media(max-width:730px){.header .add-open{display:none}.workspace{padding-bottom:60px}#edit-dialog{width:calc(100% - 16px);max-width:520px;max-height:calc(100dvh - 16px);margin:auto auto 8px;border-radius:16px}#edit-dialog .entry-panel{padding:14px;padding-bottom:max(14px,env(safe-area-inset-bottom))}#edit-dialog .entry-heading{gap:5px}#edit-dialog .entry-heading h2{font-size:13px}#edit-dialog .entry-modes button{padding:4px 6px;font-size:10px}.entry-owners{margin-bottom:10px}#edit-dialog #save{position:static}.entry-owners button{min-height:34px}}

/* Stable, quiet totals for the selected family ledger. */
.ledger-toolbar>div:first-child{min-width:0}.ledger-toolbar #ledger-total{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px;margin:7px 0 0;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.ledger-toolbar #ledger-total>span{white-space:nowrap}.ledger-toolbar #ledger-total>span+span{border-left:1px solid var(--line);padding-left:12px}.ledger-toolbar #ledger-total strong{font-size:14px;font-weight:600;letter-spacing:0;color:#3b5545}.ledger-toolbar #ledger-total strong small{font-size:10px;font-weight:400;color:var(--muted)}.ledger-selection{margin-left:auto;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
@media(max-width:730px){.ledger-toolbar>div:first-child{width:100%}.ledger-toolbar #ledger-total{font-size:10px;gap:5px 8px}.ledger-toolbar #ledger-total strong{font-size:12px}.ledger-toolbar #ledger-total>span+span{padding-left:8px}.ledger-toolbar #ledger-total strong small{font-size:9px}.ledger-selection{margin-left:0}}

.sheets-open{width:30px;min-width:30px;height:30px;display:grid;place-items:center;border-radius:6px;color:var(--accent)}.sheets-open:hover{background:var(--soft)}#sheets-dialog p{font-size:13px;line-height:1.6}#sheets-dialog .sheets-help{font-size:12px;color:var(--muted)}.sheets-actions{display:flex;align-items:center;gap:16px;margin:18px 0}.sheets-actions .small-primary{padding:10px 14px;border-radius:7px;min-height:42px}.sheets-warning{color:#976335}div.sheets-warning{background:#fff8ec;border:1px solid #edddbd;padding:12px;border-radius:8px;margin-top:14px}.sheets-warning>button{display:flex;justify-content:space-between;gap:14px;width:100%;text-align:left;padding:10px 0;border-top:1px solid #edddbd;font-size:12px}.sheets-warning>button strong{white-space:nowrap}.sheets-warning summary{cursor:pointer;font-size:12px}.sheets-warning p{margin:6px 0}#sheets-dialog button:disabled{opacity:.55;cursor:default}

body.auth-locked>.header,body.auth-locked>main,body.auth-locked>.quick-add,body.auth-locked>.toast{display:none}.auth-screen{min-height:100dvh;display:grid;place-items:center;padding:24px}.auth-screen form{width:100%;max-width:340px;background:white;border:1px solid var(--line);border-radius:14px;padding:26px}.auth-screen h1{font-size:20px;margin:18px 0 24px;letter-spacing:-.4px}.auth-screen label{display:block;font-size:12px;color:var(--muted);margin-bottom:7px}.auth-screen input{width:100%;font-size:16px;min-height:44px;border:1px solid var(--line);border-radius:7px;padding:10px 12px}.auth-screen .auth-note{font-size:11px;line-height:1.6;color:var(--muted);margin:14px 0 0}.auth-screen #auth-error{color:#a34e3a;font-size:12px;line-height:1.5;min-height:18px;margin:10px 0}.auth-screen .save-button{margin:0}.auth-screen .save-button:disabled{opacity:.6}#auth-forget{margin:6px 0 14px}
