/* Desktop density only. Existing phone/tablet layouts retain their original rules. */
@media (min-width:1024px){
 .page{--data-row-pad-y:4px;--data-row-pad-x:8px;--data-row-action-h:28px}
 .page .line,.page .summary-row,.page .settings-pane .line,.page .groupbody .line,.page .plan-row-body .line{min-height:36px;padding-block:4px;gap:6px;line-height:1.3}
 .page .table-scroll table th,.page .table-scroll table td,.page .ledger th,.page .ledger td{height:36px;padding:4px 8px;vertical-align:middle;line-height:1.3}
 .page .table-scroll table th,.page .ledger th{height:34px}
 .page .actions>button{min-height:30px;padding:4px 10px;font-size:12px;line-height:1.3}
 .page .line>.actions,.page .record-actions,.page td>.actions,.page .month-value-row>.actions{display:inline-flex;align-items:center;gap:4px;flex-wrap:nowrap;margin:0;width:auto;max-width:none}
 .page .line>.actions button,.page .record-actions button,.page td>.actions button,.page .month-value-row>.actions button{min-height:28px;height:28px;padding:3px 8px;line-height:1.2;font-size:12px;white-space:nowrap;flex:0 0 auto}
 .page .actions .icon-btn,.page .record-actions .icon-btn{width:28px;min-width:28px;flex-basis:28px;padding:0}
 .page .stat{padding:10px 12px;min-height:0}.page .stats{gap:8px;margin-bottom:10px}
 .page .head{margin-bottom:10px}.page .panel{margin-bottom:10px}.page .ledger-note{margin-block:1px;line-height:1.3}
 #month .month-work-head{margin-bottom:10px;gap:8px}
 #month .month-section-head{padding:6px 12px;min-height:38px}
 #month .month-section .groupbody{padding:0 12px 5px}
 #month .month-expense-groups{gap:6px;padding-top:5px}
 #month .month-value-row{grid-template-columns:24px minmax(150px,1fr) minmax(120px,.7fr) minmax(150px,.9fr) minmax(70px,auto);min-height:36px;padding-block:4px;align-items:center}
 #month .month-value-row>.actions{justify-self:end;justify-content:flex-end;width:auto;max-width:none}
 #month .month-value-row>strong small{display:inline;margin-inline-start:6px}
 #month .month-value-row.remaining-saving{padding:7px 12px;min-height:42px}
 #month .month-value-row.remaining-saving>.actions{gap:5px}
 #savings .savings-ledger td:last-child{white-space:nowrap}
 #savings .savings-ledger td:last-child>.record-actions,#savings .savings-ledger td:last-child>span{display:inline-flex;vertical-align:middle;align-items:center;gap:4px}
 #savings .savings-ledger td:last-child>.record-actions{margin-inline-end:4px}
 #savings .savings-move-check{display:inline-flex;align-items:center;gap:4px;width:auto;margin:0;font-size:12px;line-height:1}
 #savings .savings-move-check input{width:16px;height:16px;min-height:0;margin:0;padding:0}
 #savings .savings-move-button{min-height:28px;height:28px;padding:3px 8px;font-size:12px;line-height:1.2}
 #savings .savings-move-toolbar{gap:8px;margin-block:7px}
 #savings .savings-move-toolbar button{min-height:30px;padding:4px 10px}
 #bankAccounts .bank-account-details,#reports .bank-statement .bank-account-details{padding:6px 10px;margin-bottom:8px}
 #bankAccounts .bank-account-buttons{gap:6px;margin-bottom:9px}
 #bankAccounts .bank-account-button{padding:6px 10px;min-height:32px;line-height:1.3}
 #bankAccounts .bank-linked-accounts,#reports .bank-linked-accounts{gap:4px 16px}
 #bankAccounts .bank-linked-account,#reports .bank-linked-account{padding:3px 0;min-height:34px}
 #bankAccounts .bank-breakdown,#reports .bank-breakdown{padding:10px 12px}
 #bankAccounts .bank-breakdown h2,#reports .bank-breakdown h2{margin-block:0 6px}
 #bankAccounts .bank-ledger th,#bankAccounts .bank-ledger td,#reports .bank-ledger th,#reports .bank-ledger td{padding:4px 8px}
 #bankAccounts .bank-ledger .ledger-note,#reports .bank-ledger .ledger-note{display:inline;margin-inline-start:6px}
 #bankAccounts .bank-account-details:has(.desktop-bank-withdraw) .bank-readonly{display:none}
 #bankAccounts .bank-linked-account b[data-negative]{color:var(--red)}
 .desktop-bank-balance-note{font-size:12px;line-height:1.5;margin:6px 0 0;color:var(--muted)}
 .desktop-bank-balance-note span{white-space:nowrap}
 .desktop-bank-withdraw{margin-inline-start:auto;min-height:30px;padding:4px 14px}
 .desktop-bank-withdraw-dialog{width:min(540px,calc(100% - 32px));max-height:85dvh;overflow:auto;border:1px solid var(--border);border-radius:14px;padding:18px;background:var(--card);color:var(--text)}
 .desktop-bank-withdraw-dialog::backdrop{background:#1c2a3499}.desktop-bank-withdraw-dialog label{display:grid;gap:7px;margin-block:14px}.desktop-bank-withdraw-dialog p{line-height:1.6}
 #plan .plan-column-heading{padding-block:5px}#plan .plan-value-row{min-height:36px;padding-block:4px}
 #plan .plan-value-row>.actions{width:auto;max-width:none;justify-content:flex-end;flex-wrap:nowrap}
 #reportBox .report-row,#reports .report-row{padding-block:5px;gap:4px 12px;min-height:36px}
 #reports .report-account{padding-block:5px}.page .withdrawal-reason-row{padding:6px 10px;gap:6px}
 #loans .loan-ledger th,#loans .loan-ledger td{padding:4px 8px;line-height:1.3;height:36px}
 #loans .loan-month-actions{display:flex;gap:4px;flex-wrap:nowrap;margin:0}
 #loans .loan-month-actions button{min-height:28px;height:28px;padding:3px 8px}
 .page .wealth-account-actions{margin-bottom:8px}.page .wealth-top-actions{margin-bottom:8px}
 #reminders .reminder-meta{margin-top:8px;padding-top:6px;gap:12px}#reminders .reminder-details{margin-top:8px;padding-top:6px}
}
@media (max-width:1023px){.desktop-bank-withdraw,.desktop-bank-balance-note{display:none!important}}

/* Month columns/collapse are restricted to desktop; phone rows are rendered unchanged. */
@media (min-width:1024px){
 #month #monthGroups{--month-desktop-columns:24px minmax(150px,1fr) 125px 125px 110px 160px}
 #month #monthGroups .desktop-month-row,#month #monthGroups .desktop-month-columns{display:grid;grid-template-columns:var(--month-desktop-columns);gap:6px;align-items:center;padding-inline:0;min-width:0}
 #month #monthGroups .desktop-month-columns{min-height:32px;padding-block:5px;border-bottom:1px solid var(--border);font-size:12px;font-weight:700;color:var(--muted)}
 #month #monthGroups .desktop-month-row>.actions{width:160px;max-width:160px;justify-self:end;justify-content:flex-end;flex-wrap:nowrap;margin:0}
 #month #monthGroups .desktop-month-number{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:13px}
 #month #monthGroups .desktop-month-difference[data-sign="positive"]{color:var(--green)}
 #month #monthGroups .desktop-month-difference[data-sign="negative"]{color:var(--red)}
 #month #monthGroups .desktop-month-difference[data-sign="neutral"]{color:var(--muted)}
 #month .desktop-month-partial{font-size:10px;color:var(--muted);margin-inline-start:4px}
 #month .desktop-month-complete{font-size:11px;color:var(--green);white-space:nowrap}
 #month .desktop-month-toggle{min-width:36px;min-height:28px;height:28px;padding:3px 7px;font-size:12px;line-height:1.2;white-space:nowrap}
 #month .desktop-month-collapsed>.month-section-head{border-bottom:0}
 #month .desktop-month-collapsed>.month-expense-category-head{border-bottom:0}
 #month #monthGroups .month-expense-groups{padding-top:5px}
}

@media(min-width:1024px){#month .desktop-month-toggle{display:inline-grid;place-items:center;padding:3px}#month .desktop-month-toggle svg{display:block;transition:transform .15s ease}#month .desktop-month-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}}

@media(min-width:1024px){
 #month.workflow-page{padding-top:6px}
 #month .month-work-head{grid-template-columns:minmax(150px,1fr) auto minmax(170px,1fr);gap:8px;margin-bottom:7px;align-items:center}
 #month .month-title-block{display:flex;align-items:center;gap:8px;min-width:0}
 #month .month-title-block h1{font-size:20px;line-height:1.25}
 #month .month-title-block .page-purpose{order:2;font-size:10px;line-height:1.2;padding:2px 4px;margin:0;white-space:nowrap}
 #month .month-current{min-width:190px;padding:4px 8px;border-radius:9px;min-height:30px}
 #month .month-current strong{font-size:14px}
 #month .month-options{display:none}
 #month .desktop-month-toolbar{display:flex;gap:5px;align-items:center;justify-content:flex-end;justify-self:end}
 #month .desktop-month-toolbar button{width:30px;min-width:30px;height:30px;min-height:30px;padding:0;display:inline-grid;place-items:center;border-radius:8px}
 #month .desktop-month-toolbar button svg{display:block}
 #monthStats{gap:7px;margin-bottom:7px;grid-template-columns:repeat(5,minmax(0,1fr))}
 #monthStats .stat{position:relative;min-height:62px;padding:6px 10px;border-radius:10px;text-align:right;line-height:1.25}
 #monthStats .stat>span:first-child{font-size:11px;line-height:1.25;margin:0;padding-inline-end:10px}
 #monthStats .stat b{font-size:19px;line-height:1.25;margin-top:3px}
 #monthStats .stat small{font-size:10px}
 #monthStats .stat .detail-hint{display:none}
 #monthStats .stat::after{content:'‹';position:absolute;inset-inline-end:7px;top:6px;color:var(--muted);font-size:16px;line-height:1}
 #month .month-value-row.remaining-saving{padding:4px 10px;min-height:36px;margin-bottom:7px}
 #month .month-section{margin-bottom:7px}
 #month .month-section-head{min-height:36px;padding:4px 10px}
}
@media (min-width:1024px){
 #month:has(.desktop-month-remaining-card) #remainingTransfer{display:none}
 #monthStats:has(.desktop-month-remaining-card){grid-template-columns:repeat(6,minmax(0,1fr))}
 #monthStats .desktop-month-remaining-card{position:relative;padding:6px 10px 34px;min-height:82px;height:auto}
 .desktop-month-remaining-card>.actions{position:absolute;inset-inline-end:7px;bottom:5px;top:auto;gap:4px;flex-wrap:nowrap}
 .desktop-month-remaining-card>.actions button{width:29px;height:29px;min-height:29px;padding:4px}
 #monthStats .desktop-remaining-note{position:absolute;inset-inline-start:10px;bottom:9px;font-size:10px;line-height:13px;display:block}
 .desktop-bank-reconciliation{padding:10px 12px;margin-block:10px}
 .recon-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
 .recon-head h2{font-size:16px;margin:0;margin-inline-end:auto}
 .recon-head label,.recon-entry label{display:flex;align-items:center;gap:7px;font-size:12px}
 .recon-head input,.recon-entry input{width:160px;min-height:32px;height:32px;padding:4px 7px}
 [data-recon]{width:33px;height:33px;min-height:33px;padding:5px;display:inline-flex;align-items:center;justify-content:center}
 .recon-values{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:10px}
 .recon-values>span{display:grid;gap:4px;font-size:12px;background:#f5f7f7;padding:8px;border-radius:8px}
 .recon-values bdi{font-weight:700;font-size:15px}
 .recon-note,.recon-history,.desktop-bank-reconciliation>[data-recon-message]{font-size:12px;margin:7px 0}
 .recon-entry{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
 .recon-history summary{cursor:pointer}
 .desktop-recon-dialog{width:min(560px,90vw);border:1px solid #ddd;border-radius:14px;padding:20px;color:#293945}
 .desktop-recon-dialog::backdrop{background:#14243280}
 .desktop-recon-dialog label{display:grid;gap:6px;margin-block:12px}
 .desktop-recon-dialog input,.desktop-recon-dialog textarea{width:100%;box-sizing:border-box}
 .desktop-recon-dialog p{font-size:14px;line-height:1.7}
 [data-recon-error]{color:#a22}
}
@media(max-width:1023px){.desktop-bank-reconciliation,.desktop-month-remaining-card,.desktop-recon-dialog{display:none!important}}
@media(min-width:1024px){
 .desktop-month-remaining-card .month-action-label{display:none}
 #month .desktop-month-remaining-card .month-icon-action svg{display:block;width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
 #monthStats .desktop-month-remaining-card::after{content:none}
}

@media(min-width:1024px){
 #monthStats{align-items:stretch}
 #monthStats>.stat,#monthStats>.desktop-month-remaining-card{box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:14px 23px;align-content:center;align-items:center;column-gap:4px;row-gap:3px;height:62px;min-height:62px;max-height:62px;padding:7px 10px;text-align:start}
 #monthStats>.stat>span:first-child{grid-column:1/-1;grid-row:1;margin:0;font-size:11px;line-height:14px;white-space:nowrap}
 #monthStats>.stat>b{grid-column:1;grid-row:2;justify-self:start;margin:0;font-size:19px;line-height:23px;white-space:nowrap}
 #monthStats>.stat>small:not(.desktop-remaining-note){grid-column:2;grid-row:2;justify-self:end;align-self:baseline;margin:0;font-size:10px;line-height:23px}
 #monthStats>.desktop-month-remaining-card>span:first-child{padding-inline-end:48px}
 #monthStats .desktop-month-remaining-card>.actions{top:4px;bottom:auto;inset-inline-end:6px;gap:3px;height:22px}
 #monthStats .desktop-month-remaining-card>.actions button{display:inline-grid;place-items:center;width:22px;min-width:22px;height:22px;min-height:22px;padding:3px;border-radius:6px;font-size:0}
 #month .desktop-month-remaining-card>.actions button svg{display:block;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
 #monthStats .desktop-remaining-note{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
@media(min-width:1024px){
 #month #monthStats:has(.desktop-month-remaining-card){grid-template-columns:repeat(6,minmax(0,1fr))!important}
 #month #monthStats .desktop-month-remaining-card>.actions button{height:22px!important;min-height:22px!important;max-height:22px!important;box-sizing:border-box}
}

@media(min-width:1024px){
 #reminderBell{display:inline-grid;place-items:center;padding:0}
 #reminderBell svg{display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
 #month #monthStats .desktop-month-remaining-card>.actions{position:absolute!important;top:5px!important;bottom:auto!important;inset-inline-end:6px!important;margin:0!important;padding:0!important;align-items:center;align-self:start;gap:3px}
 #month #monthStats .desktop-month-remaining-card>.actions button{padding:0!important;margin:0!important;line-height:1!important;display:inline-grid!important;place-items:center;align-items:center;justify-items:center;flex:0 0 22px}
 #month #monthStats .desktop-month-remaining-card>.actions button svg{width:14px!important;height:14px!important;min-width:14px;margin:0!important;overflow:visible}
 #month #monthStats>.stat>b{font-size:16px;line-height:22px}
 #month #monthStats>.stat>span:first-child{font-size:10px}
 #month .month-section-head{font-size:13px}
 #month .month-section-head .month-section-title{font-size:15px}
 #month .month-section-head .month-section-title strong{font-size:15px}
 #month .month-section-head .month-section-total{font-size:14px}
 #month .month-work-head h1{font-size:19px}
 #month .desktop-month-row{font-size:12px}
 #month .desktop-month-columns{font-size:11px}
}

/* Shared desktop typography and summary geometry; media boundary preserves phone layouts. */
@media(min-width:1024px){
 :root{--ops-fs-page-title:19px;--ops-fs-section-title:15px;--ops-fs-subtitle:14px;--ops-fs-body:12px;--ops-fs-table:12px;--ops-fs-table-head:11px;--ops-fs-label:11px;--ops-fs-meta:10px;--ops-fs-button:12px;--ops-fs-badge:10px;--ops-fs-kpi:16px;--ops-fs-footer:10px}
 main .page{font-size:12px}
 main .page .head h1{font-size:19px}
 main .page .panel h2,main .page .group>summary{font-size:15px}
 main .page .card h3{font-size:14px}
 main .page .amount{font-size:16px}
 main .page .ledger td,main .page .table-scroll td,main .page .line,main .page .summary-row{font-size:12px}
 main .page .ledger th,main .page .table-scroll th{font-size:11px}
 main .page button,main .page input,main .page select,main .page textarea{font-size:12px}
 main .page .stats{gap:7px!important;margin-bottom:7px!important;align-items:stretch}
 main .page .stats>.stat{position:relative;box-sizing:border-box;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:14px 23px!important;align-content:center!important;align-items:center!important;column-gap:4px!important;row-gap:3px!important;height:62px!important;min-height:62px!important;max-height:62px!important;padding:7px 10px!important;border-radius:10px!important;text-align:start!important;min-width:0}
 main .page .stats>.stat>span:first-child{grid-column:1/-1!important;grid-row:1!important;margin:0!important;font-size:10px!important;line-height:14px!important}
 main .page .stats>.stat>b{grid-column:1!important;grid-row:2!important;justify-self:start!important;margin:0!important;font-size:16px!important;line-height:22px!important;white-space:nowrap}
 main .page .stats>.stat>small:not(.desktop-remaining-note){grid-column:2!important;grid-row:2!important;justify-self:end!important;align-self:baseline!important;margin:0!important;font-size:10px!important;line-height:23px!important}
 main .page .stats>.stat .detail-hint{display:none!important}
 main .page:not(#month) .stats>.summary-stat::after{content:'‹';position:absolute;inset-inline-end:7px;top:6px;color:var(--muted);font-size:16px;line-height:1}
 main .page:not(#month) .stats>.summary-stat>span:first-child{padding-inline-end:10px}
 #bankAccounts .bank-account-name,#savings .savings-account-bank{font-size:12px}
 #bankAccounts .bank-linked-account b,#bankAccounts .bank-breakdown-total b{font-size:14px}
 #bankAccounts .bank-breakdown h2,#savings .school-savings-title-line h2{font-size:15px}
 #bankAccounts .bank-account-button,#savings .savings-account-button{font-size:12px}
 #savings .school-year-card strong{font-size:16px}
 #savings .school-year-card-title{font-size:12px}
 #savings .school-year-card{padding:7px 10px;border-radius:10px;gap:3px 7px}
 .desktop-bank-reconciliation .recon-values bdi{font-size:16px}
 .desktop-bank-reconciliation .recon-values>span{font-size:10px;border:1px solid var(--border);border-radius:10px;min-height:62px;align-content:center;gap:4px}
}
@media(min-width:1024px){
 main .page .maintenance-invoices-head h2{font-size:15px}
 main .page .maintenance-stats{gap:7px;margin-bottom:7px;align-items:stretch}
 main .page .maintenance-stats>span{display:grid;grid-template-rows:14px 23px;align-content:center;row-gap:3px;height:62px;min-height:62px;padding:7px 10px;border-radius:10px;font-size:10px;line-height:14px}
 main .page .maintenance-stats strong{font-size:16px;line-height:22px;margin:0}
 main .page .maintenance-invoice-card>summary strong{font-size:12px}
 main .page .maintenance-invoice-card>summary{padding:8px 10px}
}

@media(min-width:1024px){
 body .desktop-action-button{box-sizing:border-box!important;position:relative;display:inline-grid!important;place-items:center!important;align-items:center!important;justify-items:center!important;width:30px!important;min-width:30px!important;max-width:30px!important;height:30px!important;min-height:30px!important;max-height:30px!important;padding:0!important;gap:0!important;flex:0 0 30px!important;font-size:0!important;line-height:1!important;vertical-align:middle;border-radius:8px!important;overflow:visible!important}
 body .desktop-action-button>*{display:none!important}
 body .desktop-action-button::before{content:''!important;display:block!important;width:16px!important;height:16px!important;position:static!important;inset:auto!important;margin:0!important;transform:none!important;pointer-events:none;background:currentColor;mask-image:var(--desktop-action-mask);-webkit-mask-image:var(--desktop-action-mask);mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center;mask-size:contain;-webkit-mask-size:contain}
 body .desktop-action-button::after{content:none!important}
 body .desktop-action-button[hidden],body .desktop-action-button.hidden{display:none!important}
 body .desktop-action-button:focus-visible{outline:3px solid var(--amber);outline-offset:2px}
 main .page .actions,main .page .record-actions{gap:5px;align-items:center}
 main .page .actions:has(>.desktop-action-button){flex-wrap:wrap}
 main .page td>.record-actions:has(>.desktop-action-button){flex-wrap:nowrap}
 main .page .head>.desktop-action-button,main .page .panel>.desktop-action-button{align-self:center}
 main .page .desktop-month-toolbar button,main .page [data-recon]{width:30px;min-width:30px;height:30px;min-height:30px;padding:0;border-radius:8px}
 /* The compact remaining-month card retains its smaller, centred icon controls. */
 #monthStats .desktop-month-remaining-card>.actions button{width:22px;min-width:22px;height:22px;min-height:22px}
}

@media(min-width:1024px){
 #receivables .wealth-account-actions>.table-scroll{flex:0 0 100%;width:100%;min-width:0;margin-top:3px}
 #control #programCards .card>.actions{display:inline-flex;vertical-align:middle;margin-top:8px;margin-inline-end:5px}
 #control #programCards .card>.record-actions{display:inline-flex;vertical-align:middle;margin-top:8px}
}

@media(min-width:1024px){
 #month .month-work-head{position:sticky;top:66px;z-index:15;background:var(--bg);padding-block:7px;box-shadow:0 2px 0 var(--border)}
 #month .desktop-month-pending-count{display:inline-flex;align-items:center;flex:none;font-size:10px;line-height:18px;white-space:nowrap;padding:0 6px;border-radius:6px;background:var(--amberbg);color:var(--amber);font-weight:700}
 #month .desktop-month-pending-count[data-pending="0"]{background:var(--greenbg);color:var(--green)}
 #month .month-section,#month .month-expense-category{scroll-margin-top:128px}
}

@media(min-width:1024px) and (max-width:1120px){
 html:has(#month.page.active),body:has(#month.page.active):not(.mobile-nav-open){overflow-x:clip;overflow-y:visible}
}
