/* Phone layouts keep actions reachable without enlarging whole rows. */
.mobile-record-table .mobile-cell-label{display:none}
.phone-field{display:contents}.phone-field-label{display:none}
@media(max-width:720px){
 #view input,#view select,#modalroot input:not([type="checkbox"]):not([type="radio"]),#modalroot select{min-height:44px!important}
 .invoice-editor .invoice-party{width:100%;gap:14px!important}.invoice-editor .invoice-meta{gap:12px!important}.invoice-editor .invoice-meta .field{grid-template-columns:1fr!important;gap:4px}.invoice-editor .invoice-meta .field label{text-align:left!important}
 #view .invoice-editor .invoice-party>.field,#modalroot .invoice-editor .invoice-party>.field{height:auto!important;min-height:0!important;margin:0!important}.invoice-editor .invoice-meta .field>span{text-align:left!important}
 .invoice-editor .sale-lines-head{display:none!important}
 .invoice-editor .sale-lines{overflow:visible!important;padding:0 14px}
 #view .invoice-editor .sale-line,#modalroot .invoice-editor .sale-line{min-width:0!important;width:100%!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:10px!important;padding:12px!important;margin-bottom:12px;border:1px solid #dce5ed;border-radius:8px;position:relative}
 .invoice-editor .sale-line>*{border:0!important;padding:0!important;min-width:0!important}.invoice-editor .sale-line .invoice-row-number{grid-column:1/-1;min-height:44px;padding-right:50px!important;font-weight:700}.invoice-row-number::before{content:'Item ';margin-right:4px}
 .invoice-editor .sale-line .line-picker{grid-column:1/-1;min-width:0!important;width:100%}.invoice-editor .sale-line input{width:100%!important;min-width:0!important;border:1px solid #ccd3db!important;border-radius:6px!important}
 .invoice-editor .sale-line .invoice-unit{align-self:end;min-height:44px}.invoice-editor .sale-line .line-amount{grid-column:1/-1;justify-content:space-between}.invoice-editor .sale-line .line-amount::before{content:'Amount';font-weight:500;color:#778796}
 .invoice-editor .sale-line .line-remove{position:absolute;right:10px;top:10px}.phone-field-label{display:block;font-size:11px;color:#627488;margin-bottom:4px}.invoice-editor .sale-line .phone-field{display:block}
 #view .invoice-editor .line-results,#modalroot .invoice-editor .line-results{width:100%!important;max-width:100%!important}.compact-picker-head{display:none!important}
 #view .line-results .compact-product-option,#modalroot .line-results .compact-product-option{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;min-height:60px!important}.compact-product-option>span:first-child{grid-column:1/-1}
 #view button,#modalroot button,.topbar button{min-height:44px!important;height:auto!important;line-height:1.35!important;max-width:100%;white-space:normal;overflow-wrap:anywhere}
 #view button.close,#modalroot button.close,.topbar button.iconbutton,#view .sale-line button.line-remove,#modalroot .sale-line button.line-remove{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important}
 #modalroot .modal-head button[aria-label="Close"],#modalroot button[aria-label="Remove line"],#modalroot button[aria-label="Remove product row"]{width:44px!important;min-width:44px!important;padding:0!important}
 .topbar{position:relative!important}.panel-head,.page-head,.warehouse-actions,.sales-row-actions,.party-detail-actions,.invoice-editor .sale-actions>div{flex-wrap:wrap;gap:8px}
 .panel-head>div,.page-head>div,.panel,.table-panel,.settings-body,.party-detail{min-width:0;max-width:100%}
 .panel-sub,.setting-row small{white-space:normal;overflow-wrap:anywhere}.table-toolbar .filters,.sales-filters{flex-wrap:wrap;max-width:100%}
 .warehouse-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}.warehouse-actions button{width:100%!important;min-width:0!important}
 #view .receipt-list table,#view .receipt-list tbody,#view .receipt-list tr,#view .receipt-list td{display:block;width:100%!important;min-width:0!important;white-space:normal!important;height:auto!important}
 #view .receipt-list .tablewrap{overflow:visible}.receipt-list tr{padding:12px!important}.receipt-list td{overflow-wrap:anywhere}
 #view .receipt-list td:last-child:not([colspan]){display:flex;flex-wrap:wrap;gap:8px;padding-top:8px}
 #view .receipt-list td button{width:auto!important;flex:0 1 auto;min-width:88px;max-width:100%;margin:0!important}
 #view .receipt-list td[colspan]::before{content:none}
 #view .mobile-record-table{table-layout:auto!important;min-width:0!important;width:100%!important;white-space:normal!important}
 #view .mobile-record-table thead{display:none}
 #view .mobile-record-table tbody{display:block;width:100%}
 #view .mobile-record-table tr{display:grid;grid-template-columns:minmax(0,1fr);padding:12px;border-bottom:1px solid var(--line);gap:7px;width:100%!important}
 #view .mobile-record-table td{display:flex!important;align-items:baseline;gap:10px;padding:0!important;border:0;min-width:0!important;width:100%!important;white-space:normal!important;overflow-wrap:anywhere;text-align:left!important}
 #view .mobile-record-table .mobile-cell-label{display:block;flex:0 0 90px;color:#778796;font-weight:600;font-size:11px}
 #view .mobile-record-table td[data-label="Actions"]{flex-wrap:wrap;align-items:center;padding-top:4px!important}
 #view .mobile-record-table td[data-label="Actions"] .mobile-cell-label{display:none}
 #view .mobile-record-table td>select{width:auto;max-width:calc(100% - 100px)}
 #view .mobile-record-table td[colspan]{display:block!important}.mobile-record-table td[colspan] .mobile-cell-label{display:none!important}
 #view .transaction-edit-button{margin:0!important;width:auto!important;flex:0 1 auto}
 .modal-back{padding:6px!important}.modal{max-height:calc(100dvh - 12px)!important}.modal-head{gap:10px;padding:12px!important}.modal-head h2{min-width:0;overflow-wrap:anywhere}.modal-foot{padding-bottom:env(safe-area-inset-bottom)}
 .invoice-editor .sale-actions{gap:8px;flex-wrap:wrap;padding:12px!important}.invoice-editor .sale-actions>div{display:flex;flex-wrap:wrap;gap:8px;max-width:100%}.invoice-editor .sale-actions button{min-width:0!important;flex:1 1 auto}
 .invoice-title{flex-wrap:wrap;gap:8px}.invoice-payment{padding-left:0;border:0;flex-wrap:wrap}.invoice-editor .sale-fields{min-height:0!important;padding:16px!important}.invoice-meta,.invoice-party>.field{width:100%!important;max-width:100%}.invoice-editor .sale-bottom{padding:16px!important;gap:16px}
 .setting-row{gap:12px;flex-wrap:wrap}.settings-body{padding:16px!important}.access-heading{flex-wrap:wrap}.access-counts>div{min-width:0;flex:1 1 90px}.access-login{margin:20px 12px;padding:20px;max-width:calc(100% - 24px)}
 .toast{left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));max-width:calc(100% - 24px);white-space:normal}
}
@media(max-width:360px){.stats,.module-summary{grid-template-columns:1fr!important}.top-actions{flex-wrap:wrap}.top-company-select{max-width:calc(100vw - 150px)!important}.mobile-record-table .mobile-cell-label{flex-basis:78px}}
@media print{.mobile-cell-label{display:none!important}}
