@media(max-width:1024px){
 #purchase-order-items .po-item-fields,.po-header-block .po-item-fields,#purchase-receipt-form>.po-item-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 #supply-dialog:has(#purchase-order-items) input:not([type=checkbox]),#supply-dialog:has(#purchase-order-items) select,#purchase-receipt-dialog input,#purchase-receipt-dialog select,#purchase-order-grade-dialog input:not([type=checkbox]){font-size:16px;min-height:44px}
 #purchase-receipt-dialog td input,#purchase-receipt-dialog td select,#purchase-order-grade-dialog input[type=number]{font-size:16px;min-height:44px;border:1px solid #dce2ed;border-radius:8px;padding:10px;color:#26344b;background:white}
 #purchase-receipt-dialog td input:disabled,#purchase-receipt-dialog td select:disabled{background:#f2f6f6;color:#6b7785}
 #purchase-receipt-dialog,#purchase-order-grade-dialog{scroll-padding-top:100px;scroll-padding-bottom:90px}
 #purchase-receipt-dialog input,#purchase-receipt-dialog select,#purchase-order-grade-dialog input{scroll-margin-block:100px}
 .po-header-block label:has(input[type=email]){grid-column:1/-1}
 #purchase-controls-list,#purchase-order-items,.purchase-order-item,.po-item-purchases{min-width:0;overflow-wrap:anywhere}
 #purchase-controls-list .panel-head{flex-wrap:wrap}
}
@media(max-width:700px){
 #purchase-controls-list table.touch-cards,#purchase-receipt-dialog table.touch-cards,#purchase-order-grade-dialog table.touch-cards,#pedidos-compra table.touch-cards{display:block;min-width:0;width:100%;border-collapse:separate}
 .touch-cards thead{display:none}
 .touch-cards tbody{display:block;width:100%}
 .touch-cards tbody tr{display:block;width:100%;margin:10px 0;padding:10px;border:1px solid #d4dfe4;border-radius:9px;background:white}
 .touch-cards tbody td{display:grid;grid-template-columns:minmax(95px,38%) minmax(0,1fr);align-items:center;gap:10px;padding:8px 0!important;border:0!important;min-width:0;text-align:left!important;white-space:normal;overflow-wrap:anywhere}
 .touch-cards tbody td[data-label]::before{content:attr(data-label);font-size:12px;font-weight:600;color:#526078;line-height:1.4}
 .touch-cards tbody td[colspan]{display:block}
 #purchase-receipt-dialog table.touch-cards td input,#purchase-receipt-dialog table.touch-cards td select,#purchase-order-grade-dialog table.touch-cards td input[type=number]{width:100%;min-width:0;max-width:100%;min-height:44px;font-size:16px;box-sizing:border-box}
 .touch-cards button{width:100%;min-height:44px;white-space:normal}
 #purchase-order-grade-dialog .touch-cards input[type=checkbox]{width:22px;height:22px;margin:11px;min-height:22px}
 #purchase-controls-list .table-wrap,#purchase-receipt-dialog .table-wrap,#purchase-order-grade-dialog .table-wrap{min-width:0;width:100%;max-width:100%}
 #purchase-receipt-dialog,#purchase-order-grade-dialog{width:calc(100vw - 8px);max-width:calc(100vw - 8px);max-height:calc(100dvh - 8px);padding:12px 12px max(12px,env(safe-area-inset-bottom));margin:auto}
 #purchase-receipt-dialog .detail-head,#purchase-order-grade-dialog .detail-head,#supply-dialog:has(#purchase-order-items) .detail-head{flex-wrap:nowrap!important;align-items:center;gap:6px}
 #purchase-receipt-dialog .detail-head h2,#purchase-order-grade-dialog .detail-head h2,#supply-dialog:has(#purchase-order-items) .detail-head h2{flex:1;min-width:0;font-size:18px;line-height:1.25;overflow-wrap:anywhere}
 #purchase-receipt-dialog .detail-head>button,#purchase-order-grade-dialog .detail-head>button,#supply-dialog:has(#purchase-order-items) .detail-head>button{flex-shrink:0;min-height:44px}
 .purchase-confirmed-control summary,#purchase-receipt-new>summary,.po-receipt-draft summary{min-height:44px;padding:8px 0;line-height:1.5;overflow-wrap:anywhere}
 #purchase-receipt-form .dialog-actions,#purchase-order-grade-dialog .dialog-actions,#supply-dialog:has(#purchase-order-items) .dialog-actions{position:sticky;bottom:-1px;z-index:5;background:white;border-top:1px solid #dce2ed;padding:10px 0 max(10px,env(safe-area-inset-bottom));margin-bottom:0;flex-wrap:wrap}
 #purchase-receipt-confirm{width:100%;min-height:48px;white-space:normal;font-size:15px}
 #purchase-order-grade-dialog [data-grade-apply]{width:100%;min-height:44px}
 #supply-dialog:has(#purchase-order-items) .dialog-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #supply-dialog:has(#purchase-order-items) .dialog-actions button{width:100%;min-height:44px;min-width:0;padding:8px;white-space:normal}
 .po-grand-total{flex-wrap:wrap;justify-content:space-between;gap:8px;padding:12px}
}
@media(max-width:600px){
 #purchase-order-items .po-item-fields,.po-header-block .po-item-fields,#purchase-receipt-form>.po-item-fields{grid-template-columns:minmax(0,1fr)}
 .po-item-fields .po-material{grid-column:1/-1}
 #purchase-order-items>.panel-head>[data-po-add],.po-item-purchases button{width:100%;min-height:44px;white-space:normal}
 #purchase-controls-list{padding:10px}
}
@media(pointer:coarse){
 .po-header-block .po-payment-option,.po-balance-options label,.po-item-purchases label{min-height:44px}
 #purchase-receipt-dialog button,#purchase-order-grade-dialog button{min-height:44px}
}
