/* Scoped ledger view: weekly columns, accessible horizontal scroll, and a fixed monthly total. */
#monthlyLayoutControls{display:flex;align-items:center;justify-content:space-between;gap:8px 12px;flex-wrap:wrap;margin:0 0 12px}
#monthlyLayoutControls[hidden],#monthlySpreadsheet[hidden],#monthlySheetEditPaydays[hidden]{display:none}
.monthlySheetToggle{display:flex;flex-wrap:wrap;gap:0}
#monthlyLayoutControls button{min-height:38px;border-radius:3px}
#monthlyLayoutControls .monthlySheetToggle button{margin:0}
#monthlyLayoutControls .monthlySheetToggle button+button{margin-left:-1px}
#monthlyLayoutControls .monthlySheetToggle button[aria-pressed=true]{position:relative;background:var(--pp-action,#285b63);border-color:transparent;color:#fff;font-weight:700}
html[data-theme=dark] #budgetApp #monthlyLayoutControls button[aria-pressed=true]{background:#70d4c4!important;color:#102520!important;border-color:#70d4c4!important}
#monthlyLayoutControls .monthlySheetToggle button:focus-visible{z-index:1}
#monthlySpreadsheet{--sheet-grid:#d4d8e0;--sheet-paper:#fff;--sheet-band:#e8e4f0;--sheet-total:#f2f4f8;--sheet-foot:#f8f9fc;--sheet-positive:#d9efe3;--sheet-positive-ink:#194936;--sheet-negative:#f8e0e0;--sheet-negative-ink:#74272d;--sheet-review:#fff1d9;--sheet-review-ink:#674611;margin:0 0 16px;color:var(--pp-ink);background:var(--sheet-paper);border:1px solid var(--sheet-grid);min-width:0}
html[data-theme=dark] #monthlySpreadsheet{--sheet-grid:#3c4a5f;--sheet-paper:#192535;--sheet-band:#323b54;--sheet-total:#253448;--sheet-foot:#222e40;--sheet-positive:#22463e;--sheet-positive-ink:#c2f4db;--sheet-negative:#4e2d39;--sheet-negative-ink:#ffcbd0;--sheet-review:#443623;--sheet-review-ink:#ffdaa0}
#monthlySpreadsheet{
 --sheet-expense-band:#e8eef8;--sheet-expense-last:#dce6f5;--sheet-expense-base:#f6f8fb;--sheet-expense-ink:#243659;
 --sheet-expense-muted:#35435a;--sheet-expense-rule:#65728b;
 --sheet-expense-summary:#dfe5f1;--sheet-expense-summary-last:#d3ddef
}
html[data-theme=dark] #monthlySpreadsheet{
 --sheet-expense-band:#273650;--sheet-expense-last:#304260;--sheet-expense-base:#202e42;--sheet-expense-ink:#e4ecfb;
 --sheet-expense-muted:#d6e1f3;--sheet-expense-rule:#91a4c5;
 --sheet-expense-summary:#374765;--sheet-expense-summary-last:#3c4f70
}
.monthlySheetHeading{padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:8px 24px;flex-wrap:wrap;border-bottom:1px solid var(--sheet-grid)}
.monthlySheetHeading h2{margin:0;font-size:clamp(1.3rem,2.4vw,1.8rem);line-height:1.1}
.monthlySheetHeading p{margin:0 0 4px;color:var(--pp-muted);font-size:.84rem;font-weight:650}
.monthlySheetBeginning{min-width:9rem;max-width:100%;display:grid;gap:2px;padding-left:12px;border-left:1px solid var(--sheet-grid);font-variant-numeric:tabular-nums}
.monthlySheetBeginning span{font-size:.84rem;color:var(--pp-muted)}
.monthlySheetBeginning strong{font-size:1.2rem;overflow-wrap:anywhere}
.monthlySheetHint,.monthlySheetReview,.monthlySheetMobileHint{margin:0;padding:10px 16px;font-size:.88rem;line-height:1.45}
.monthlySheetHint,.monthlySheetMobileHint{color:var(--pp-muted)}
.monthlySheetHint strong{color:var(--pp-ink)}
.monthlySheetReview{background:var(--sheet-review);color:var(--sheet-review-ink);border-top:1px solid var(--sheet-grid)}
.monthlySheetMobileHint{display:none}
.monthlySheetScroll{max-width:100%;overflow-x:auto;border-block:1px solid var(--sheet-grid)}
.monthlySheetScroll:focus-visible{outline:2px solid var(--pp-ink);outline-offset:-2px}
#monthlySpreadsheet .monthlySheetTable{width:100%;min-width:max(34rem,calc(20.7rem + var(--sheet-columns,5)*5.8rem));table-layout:fixed;border-collapse:separate;border-spacing:0;background:var(--sheet-paper);color:var(--pp-ink)}
#monthlySpreadsheet .monthlySheetTable :is(th,td){padding:6px 10px;border:0;border-right:1px solid var(--sheet-grid);border-bottom:1px solid var(--sheet-grid);line-height:1.28;font-size:.9rem}
#monthlySpreadsheet .monthlySheetTable :is(th,td):last-child{border-right:0}
#monthlySpreadsheet .monthlySheetTable tr:last-child td{border-bottom:0}
#monthlySpreadsheet .monthlySheetTable tfoot tr:not(:last-child) td{border-bottom:1px solid var(--sheet-grid)}
#monthlySpreadsheet .monthlySheetTable :is(thead,tfoot,tbody){background:var(--sheet-paper)}
#monthlySpreadsheet .monthlySheetTable thead th{padding-block:8px;text-transform:none;letter-spacing:0;background:var(--sheet-band);color:var(--pp-ink);font-weight:700;text-align:right;vertical-align:top}
#monthlySpreadsheet .monthlySheetTable thead th:first-child{width:12rem;text-align:left}
#monthlySpreadsheet .monthlySheetTable thead th:last-child{width:8.7rem}
#monthlySpreadsheet .monthlySheetTable thead small,.monthlySheetMissing{display:block;margin-top:3px;font-size:.77rem;color:var(--pp-muted);font-weight:500}
#monthlySpreadsheet .monthlySheetTable tbody th,#monthlySpreadsheet .monthlySheetTable tfoot th{text-align:left;font-weight:550}
#monthlySpreadsheet .monthlySheetTable .monthlySheetNumber{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
#monthlySpreadsheet .monthlySheetTable tr>th:first-child{position:sticky;left:0;z-index:1;background:var(--sheet-paper);overflow-wrap:anywhere}
#monthlySpreadsheet .monthlySheetTable tr>.monthlySheetTotal{position:sticky;right:0;z-index:1;background:var(--sheet-total);font-weight:700;box-shadow:-1px 0 0 var(--sheet-grid)}
#monthlySpreadsheet .monthlySheetTable thead tr>:is(th:first-child,th:last-child){z-index:2;background:var(--sheet-band)}
#monthlySpreadsheet .monthlySheetTable thead th[data-shared-week]{background:#d8eaf6}
#monthlySpreadsheet .monthlySheetTable thead th[data-shared-week] small:last-child{color:var(--pp-ink);font-weight:650}
#monthlySpreadsheet .monthlySheetTable .monthlySheetBand :is(th,td){border-bottom:1px solid var(--sheet-grid);background:var(--sheet-band);font-weight:750}
#monthlySpreadsheet .monthlySheetCategoryRow{
 --sheet-category-bg:var(--sheet-expense-band);
 --sheet-category-total-bg:var(--sheet-expense-last)
}
@supports(color:color-mix(in srgb,#000,#fff)){
 #monthlySpreadsheet .monthlySheetCategoryRow{
  --sheet-category-bg:color-mix(in srgb,var(--sheet-expense-color) 18%,var(--sheet-expense-base));
  --sheet-category-total-bg:color-mix(in srgb,var(--sheet-expense-color) 24%,var(--sheet-expense-base))
 }
}
#monthlySpreadsheet .monthlySheetTable .monthlySheetCategoryRow :is(th,td){
 background:var(--sheet-category-bg);color:var(--sheet-expense-ink);font-weight:700;
 border-top:2px solid var(--sheet-expense-rule)
}
#monthlySpreadsheet .monthlySheetTable .monthlySheetCategoryRow>th:first-child{background:var(--sheet-category-bg)}
#monthlySpreadsheet .monthlySheetTable .monthlySheetCategoryRow .monthlySheetTotal{background:var(--sheet-category-total-bg)}
#monthlySpreadsheet .monthlySheetCategoryRow .monthlySheetCategory{color:var(--sheet-expense-ink);font-weight:750}
#monthlySpreadsheet .monthlySheetExpenseSwatch{
 display:inline-block;width:.78em;height:.78em;margin-inline-end:.4em;border:1px solid var(--sheet-expense-rule);
 border-radius:2px;background:var(--sheet-expense-color)
}
#monthlySpreadsheet .monthlySheetCategoryRow :is(.monthlySheetCategory small,.monthlySheetMissing,.monthlySheetDash){color:var(--sheet-expense-muted)}
#monthlySpreadsheet .monthlySheetTable .monthlySheetRow-expense-total :is(th,td){
 background:var(--sheet-expense-summary);color:var(--sheet-expense-ink);font-weight:750;
 border-block:1px solid var(--sheet-grid)
}
#monthlySpreadsheet .monthlySheetTable .monthlySheetRow-expense-total>th:first-child{background:var(--sheet-expense-summary)}
#monthlySpreadsheet .monthlySheetTable .monthlySheetRow-expense-total .monthlySheetTotal{background:var(--sheet-expense-summary-last)}
#monthlySpreadsheet .monthlySheetRow-expense-total .monthlySheetMissing{color:var(--sheet-expense-muted)}
#monthlySpreadsheet .monthlySheetTable .monthlySheetBillRow th{padding-left:19px}
#monthlySpreadsheet .monthlySheetTable .monthlySheetBillRow th small{display:block;color:var(--pp-muted);font-size:.77rem;line-height:1.3;font-weight:500;margin:2px 0 0}
#monthlySpreadsheet .monthlySheetBillRow[hidden],#monthlySheetLinkStatus:empty{display:none}
#monthlySpreadsheet :is(.monthlySheetCategory,.monthlySheetBillLink){display:block;min-height:28px;max-width:100%;padding:3px 0;border:0;border-radius:0;box-shadow:none;background:none;color:var(--pp-ink);font-size:inherit;text-align:left;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
#monthlySpreadsheet .monthlySheetCategory i{display:inline-block;width:1rem;font-style:normal}
#monthlySpreadsheet .monthlySheetCategory i::before{content:'−'}
#monthlySpreadsheet .monthlySheetCategory[aria-expanded=false] i::before{content:'+'}
#monthlySpreadsheet .monthlySheetCategory small{font-size:.77rem;color:var(--pp-muted);font-weight:500}
#monthlySpreadsheet .monthlySheetBillLink{text-decoration:underline;text-underline-offset:2px;color:#185b63}
#monthlySheetLinkStatus{margin:0;padding:6px 14px;color:var(--pp-ink)}
#monthlySheetEntryDialog{width:min(28rem,calc(100vw - 24px));padding:0;max-height:calc(100dvh - 24px);overflow:auto}
#monthlySheetEntryDialog>.sectionhead,#monthlySheetEntryDialog .monthlySheetEntryBody{padding:12px 16px}
#monthlySheetEntryDialog h2{margin:0;overflow-wrap:anywhere}
#monthlySheetEntryDialog p{margin:0;color:var(--pp-muted)}
#monthlySheetEntryDialog dl{margin:8px 0 0}
#monthlySheetEntryDialog dl div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:6px 0;border-bottom:1px solid var(--pp-line)}
#monthlySheetEntryDialog dd{margin:0;text-align:right;overflow-wrap:anywhere}
#monthlySpreadsheet .monthlySheetTable .monthlySheetRow-subtotal :is(th,td){background:var(--sheet-total);font-weight:700;border-bottom:1px solid var(--sheet-grid)}
#monthlySpreadsheet .monthlySheetTable tfoot tr>:is(th,td){background:var(--sheet-foot)}
#monthlySpreadsheet .monthlySheetTable .monthlySheetRow-net :is(th,td){background:var(--sheet-total);padding-block:9px;font-weight:800;border-bottom:0}
#monthlySpreadsheet .monthlySheetTable .monthlySheetRow-net .monthlySheetPositive{background:var(--sheet-positive);color:var(--sheet-positive-ink)}
#monthlySpreadsheet .monthlySheetTable .monthlySheetRow-net .monthlySheetNegative{background:var(--sheet-negative);color:var(--sheet-negative-ink)}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetTable th{background:var(--sheet-paper)!important;border-color:var(--sheet-grid)!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetTable :is(thead,.monthlySheetBand) th{background:var(--sheet-band)!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetTable thead th[data-shared-week]{background:#334b63!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetTable tfoot th{background:var(--sheet-foot)!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetTable :is(.monthlySheetRow-subtotal,.monthlySheetRow-net) th{background:var(--sheet-total)!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetTable .monthlySheetCategoryRow th{background:var(--sheet-category-bg)!important;border-top-color:var(--sheet-expense-rule)!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetTable .monthlySheetRow-expense-total th{background:var(--sheet-expense-summary)!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet :is(.monthlySheetCategoryRow,.monthlySheetRow-expense-total) :is(.monthlySheetCategory small,.monthlySheetMissing,.monthlySheetDash){color:var(--sheet-expense-muted)!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet :is(.monthlySheetCategory,.monthlySheetBillLink){background:transparent!important;border:0!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetBillLink{color:#9bdbcf!important}
html[data-theme=dark] #budgetApp #monthlySpreadsheet .monthlySheetReview{color:var(--sheet-review-ink)!important}
.monthlySheetDash,.monthlySheetEmpty{color:var(--pp-muted)}
.monthlySheetVisuallyHidden{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:700px){
 #monthlyLayoutControls button{min-height:44px}
 .monthlySheetHeading,.monthlySheetHint,.monthlySheetReview,.monthlySheetMobileHint{padding-inline:10px}
 .monthlySheetHeading,.monthlySheetHint,.monthlySheetReview{padding-block:8px}
 .monthlySheetMobileHint{display:block;padding-block:3px 7px}
 #monthlySpreadsheet .monthlySheetTable thead th:first-child{width:8.5rem}
 #monthlySpreadsheet .monthlySheetTable thead th:last-child{width:7.25rem}
 #monthlySpreadsheet .monthlySheetTable{min-width:max(32rem,calc(15.75rem + var(--sheet-columns,5)*5.4rem))}
 #monthlySpreadsheet .monthlySheetTable :is(th,td){padding-inline:7px}
 #monthlySpreadsheet .monthlySheetTable .monthlySheetBillRow th{padding-left:12px}
 #monthlySpreadsheet :is(.monthlySheetCategory,.monthlySheetBillLink){min-height:44px}
 #monthlySheetEntryDialog button{min-height:44px}
}
@media(max-width:480px){
 #monthlySpreadsheet .monthlySheetTable tr>.monthlySheetTotal{position:static;box-shadow:none}
}
