/* Compact phone forms: keep 16px entry text and usable touch targets. */
@media(max-width:640px){
 #modal{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:94dvh;padding:12px;border-radius:10px}
 #modal .modal-head{margin-bottom:8px;gap:8px}
 #modal .modal-head h2{margin:0}
 #modal h2{font-size:18px;line-height:1.3;margin-bottom:12px}
 #modal h3{font-size:15px;margin-bottom:8px}
 #modal p{font-size:13px;line-height:1.4;margin:8px 0}
 #modal .field{font-size:13px;gap:4px;margin-bottom:10px}
 #modal .form-grid{gap:0}
 #modal input:not([type=checkbox]):not([type=radio]):not([type=file]),#modal select{font-size:16px;min-height:40px;height:40px;padding:7px 9px;min-width:0;max-width:100%;border-radius:6px}
 #modal textarea{font-size:16px;min-height:64px;padding:8px;max-width:100%}
 #modal .btn{font-size:13px;min-height:40px;padding:8px 10px;gap:5px;white-space:normal}
 #modal .actions{gap:6px}
 #modal small,#modal .footnote{font-size:12px;line-height:1.4}
 #modal .modal-footer{gap:8px;margin-top:12px}
 #modal .modal-footer .btn{flex:1}
 #modal .card{padding:12px;margin:10px 0}
 #modal .mr-entry-table tr{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:9px;margin:8px 0}
 #modal .mr-entry-table td{padding:0;width:auto;min-width:0}
 #modal .mr-entry-table td:nth-child(1),#modal .mr-entry-table td:nth-child(2){grid-column:1 / -1}
 #modal .mr-entry-table td:nth-child(5){font-size:12px;align-self:center}
 #modal .mr-entry-table td:nth-child(6){justify-self:end;align-self:center}
 #modal .mr-entry-table td::before{font-size:12px;margin-bottom:3px}
 #modal .mr-entry-table td:first-child input{margin-top:5px}
 #modal .mr-request-photo{margin-top:5px}
 #modal .mr-request-photo .actions{margin:4px 0}
 #modal .mr-request-photo [data-example-status]{overflow-wrap:anywhere}
 #modal #mr-work-search{margin-bottom:4px}
 #modal .save-status:empty,#modal .error:empty{display:none}
}

@media(max-width:640px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 #modal{box-sizing:border-box;overflow-x:hidden}
 #modal-content,#modal form,#modal .field,#modal .form-grid,#modal .scroll{min-width:0;max-width:100%;box-sizing:border-box}
 #modal .form-grid{grid-template-columns:minmax(0,1fr)}
 #modal .field{font-size:13px!important}
 #modal input:not([type=checkbox]):not([type=radio]),#modal select,#modal textarea{width:100%;box-sizing:border-box;min-width:0!important;max-width:100%;font-size:16px!important}
 #modal input[type=date]{display:block;appearance:none;-webkit-appearance:none;height:40px;min-height:40px;line-height:24px}
 #modal input[type=date]::-webkit-date-and-time-value{text-align:left;min-height:24px}
 #modal select{text-overflow:ellipsis}
 #modal .modal-head{margin-bottom:8px}
 #modal .modal-head h2{margin:0;font-size:18px!important}
 #modal #close-modal{width:36px;min-width:36px;min-height:36px;height:36px;padding:6px}
}
