/* R128 R3 R4 R3 - unified mobile modal/preview fit */
@media (max-width:900px){
:root{
--r128-safe-top:max(8px,env(safe-area-inset-top,0px));
--r128-safe-right:max(8px,env(safe-area-inset-right,0px));
--r128-safe-bottom:max(8px,env(safe-area-inset-bottom,0px));
--r128-safe-left:max(8px,env(safe-area-inset-left,0px));
}
:where([role="dialog"],.modal,.modal-content,.pto-records-modal,.pto-records-modal-card,.pto-modal,.pto-modal-card,.pto-qual-modal,.pto-qual-modal-card,.managerial-modal,.managerial-modal-card){
max-width:calc(100vw - var(--r128-safe-left) - var(--r128-safe-right))!important;
box-sizing:border-box!important;
}
:where([role="dialog"],.modal-content,.pto-records-modal-card,.pto-modal-card,.pto-qual-modal-card,.managerial-modal-card){
max-height:calc(100dvh - var(--r128-safe-top) - var(--r128-safe-bottom))!important;
overflow-y:auto!important;
overscroll-behavior:contain;
-webkit-overflow-scrolling:touch;
padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))!important;
}
:where([role="dialog"],.modal-content,.pto-records-modal-card,.pto-modal-card,.pto-qual-modal-card,.managerial-modal-card) :where(img,canvas,svg,iframe,object,embed){
max-width:100%!important;height:auto;box-sizing:border-box;
}
:where(.pto-pdf-preview,.pto-pdf-preview-frame,.pdf-preview,[class*="pdf-preview"],[class*="preview-document"]){
max-width:100%!important;overflow-x:auto!important;box-sizing:border-box!important;
}
:where(.pto-pdf-preview,.pto-pdf-preview-frame,.pdf-preview,[class*="pdf-preview"],[class*="preview-document"]) :where(img,canvas){
display:block;max-width:100%!important;height:auto!important;object-fit:contain!important;margin-inline:auto;
}
}
@supports not (height:100dvh){
@media (max-width:900px){
:where([role="dialog"],.modal-content,.pto-records-modal-card,.pto-modal-card,.pto-qual-modal-card,.managerial-modal-card){
max-height:calc(100vh - 16px)!important;
}
}
}
