/* Touch readability for financial lists and dialogs; editing grids retain their own scrolling. */
@media screen and (max-width:1050px){
 html:not([data-layout="desktop"]) :is(#module-window,#order-dialog,#payment-dialog,#customer-settlement-dialog,#purchase-cheques-dialog,#cheque-wallet-dialog,#all-records-dialog){line-height:1.5;max-width:100vw;box-sizing:border-box}
 html:not([data-layout="desktop"]) :is(#module-window,#order-dialog,#payment-dialog,#customer-settlement-dialog,#purchase-cheques-dialog,#cheque-wallet-dialog,#all-records-dialog) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea){font-size:16px!important;min-height:44px;box-sizing:border-box;max-width:100%}
 html:not([data-layout="desktop"]) :is(#module-window,#order-dialog,#payment-dialog,#customer-settlement-dialog,#purchase-cheques-dialog,#cheque-wallet-dialog,#all-records-dialog) button{min-height:44px;line-height:1.35;white-space:normal}
 html:not([data-layout="desktop"]) :is(#module-window,#order-dialog,#payment-dialog,#customer-settlement-dialog,#purchase-cheques-dialog,#cheque-wallet-dialog,#all-records-dialog) :is(p,small){font-size:13px;line-height:1.5}
 html:not([data-layout="desktop"]) :is(.customer-settlement-content,.purchase-cheques-content,.payment-detail-row) label{font-size:14px;line-height:1.4}
 html:not([data-layout="desktop"]) .finance-touch-cards :is(td,th){font-size:14px!important;line-height:1.5}
 html:not([data-layout="desktop"]) :is(#payment-dialog,#customer-settlement-dialog) .dialog-actions{position:sticky;bottom:0;z-index:20;background:#fff;padding:12px 0 max(8px,env(safe-area-inset-bottom));border-top:1px solid #dce2ed;gap:10px}
 html:not([data-layout="desktop"]) :is(#payable-period-day,#payable-period-week,#payable-period-month,#payable-period-year,#receivable-period-day,#receivable-period-week,#receivable-period-month,#receivable-period-year){white-space:nowrap}
}
@media screen and (max-width:760px){
 html:not([data-layout="desktop"]) table.finance-touch-cards{display:block;width:100%;min-width:0!important;max-width:100%;table-layout:auto}
 html:not([data-layout="desktop"]) table.finance-touch-cards thead,html:not([data-layout="desktop"]) table.finance-touch-cards tbody{display:block;width:100%}
 html:not([data-layout="desktop"]) table.finance-touch-cards thead>tr:not(.debt-totals){display:none}
 html:not([data-layout="desktop"]) table.finance-touch-cards .debt-totals{display:block;padding:10px;border-radius:8px}
 html:not([data-layout="desktop"]) table.finance-touch-cards .debt-totals th{display:block;min-width:0;width:auto;text-align:left}
 html:not([data-layout="desktop"]) table.finance-touch-cards tbody>tr{display:block;box-sizing:border-box;width:100%;margin:10px 0;padding:10px 12px;border:1px solid #d5dfe8;border-radius:10px;background:#fff}
 html:not([data-layout="desktop"]) table.finance-touch-cards tbody td{display:block;box-sizing:border-box;min-width:0!important;max-width:100%;width:auto!important;position:relative;min-height:44px;padding:9px 0 9px 42%!important;border:0!important;text-align:left!important;white-space:normal;overflow-wrap:anywhere}
 html:not([data-layout="desktop"]) table.finance-touch-cards td[data-label]::before{content:attr(data-label);position:absolute;left:0;top:10px;width:39%;font-size:12px;font-weight:700;line-height:1.4;color:#526078;white-space:normal}
 html:not([data-layout="desktop"]) table.finance-touch-cards td[colspan]{padding-left:0!important}
 html:not([data-layout="desktop"]) table.finance-touch-cards td.row-actions{display:flex;flex-wrap:wrap;gap:8px;padding-left:0!important}
 html:not([data-layout="desktop"]) table.finance-touch-cards td.row-actions::before{position:static;flex-basis:100%;width:100%}
 html:not([data-layout="desktop"]) table.finance-touch-cards td.row-actions button{flex:1 1 90px;min-width:44px}
 html:not([data-layout="desktop"]) table.finance-touch-cards td input[type="number"]{width:100%!important;min-width:0}
 html:not([data-layout="desktop"]) :is(.payable-period-totals,.receivable-period-totals){gap:8px;font-size:14px;line-height:1.4}
 html:not([data-layout="desktop"]) :is(.payable-period-totals,.receivable-period-totals)>strong{padding:10px;border:1px solid #e4e8ed;border-radius:8px;background:#fafbfd;min-width:0}
 html:not([data-layout="desktop"]) :is(.payable-period-totals,.receivable-period-totals)>strong span{display:block;margin-top:3px;font-size:16px}
}
@media screen and (max-width:480px){html:not([data-layout="desktop"]) .customer-settlement-filters{grid-template-columns:repeat(2,minmax(0,1fr))}html:not([data-layout="desktop"]) .customer-settlement-filters>label:first-child:has(#customer-settlement-person){grid-column:1/-1}html:not([data-layout="desktop"]) #customer-settlement-history-button{grid-column:1/-1}html:not([data-layout="desktop"]) .customer-settlement-period>fieldset,html:not([data-layout="desktop"]) #customer-settlement-filter{grid-column:1/-1}html:not([data-layout="desktop"]) #customer-settlement-dialog .customer-settlement-period fieldset{min-height:44px}html:not([data-layout="desktop"]) #payment-dialog .dialog-actions>button{flex:1 1 100px}}

@media screen and (max-width:760px){html:not([data-layout="desktop"]) table.finance-touch-cards thead>tr:has(input[type="checkbox"]){display:block}html:not([data-layout="desktop"]) table.finance-touch-cards thead>tr:has(input[type="checkbox"])>th{display:none}html:not([data-layout="desktop"]) table.finance-touch-cards thead>tr:has(input[type="checkbox"])>th:has(input[type="checkbox"]){display:block;padding:10px;min-height:44px}}

html #customer-settlement-dialog details.finance-period-details{padding:0;border:0;margin:10px 0}html #customer-settlement-dialog details.finance-period-details>summary{display:none}@media screen and (max-width:760px){html:not([data-layout="desktop"]) #customer-settlement-dialog details.finance-period-details>summary{display:list-item;list-style-position:inside;padding:12px;border:1px solid #d5dfe8;border-radius:8px;min-height:44px;box-sizing:border-box;font-size:14px;font-weight:600;color:#305d6e;background:#f8fafc;cursor:pointer}html:not([data-layout="desktop"]) #customer-settlement-dialog details.finance-period-details .customer-settlement-period{margin:10px 0}}
