/* v159 — iOS-safe modal scrolling and permanent escape navigation */
html.workops-modal-open{overflow:hidden!important;overscroll-behavior:none!important}
body.workops-modal-open{overflow:hidden!important;overscroll-behavior:none!important}

#modal.open{overflow:hidden!important;overscroll-behavior:none!important;inset:0!important}
#modal>.sheet{display:flex!important;flex-direction:column!important;overflow:hidden!important;min-height:0!important}
#modal.open>.sheet{height:min(92svh,820px)!important;max-height:min(92svh,820px)!important}
#modal>.sheet>.sheet-grip{flex:0 0 auto}
#modal .sheet-head{flex:0 0 auto!important;position:relative!important;z-index:20!important;background:#171c31!important;border-bottom:1px solid #303957!important;padding:4px 2px 12px!important;margin:0!important}
#modal .sheet-head h2{color:#fff!important;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#modal .sheet-head button{flex:0 0 auto!important;display:grid!important;place-items:center!important;min-width:44px!important;width:44px!important;height:44px!important;background:#252b43!important;border:1px solid #46506c!important;color:#fff!important;font-size:26px!important;line-height:1!important}
#modalBody{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-y:contain!important;scrollbar-gutter:stable;padding-bottom:28px!important}
#modalBody>.quick-book-form{padding-bottom:max(18px,env(safe-area-inset-bottom,0px))}

/* Never allow the Quick Book title/close area to become part of the scrolling region. */
#modal>.sheet.quick-book-sheet{overflow:hidden!important}
#modal>.sheet.quick-book-sheet #modalBody{overflow-y:auto!important}
#modal .sticky-actions,#modal .modal-actions{position:sticky!important;bottom:0!important;z-index:30!important;background:#171c31!important;border-top:1px solid #3b435e!important;padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important;pointer-events:auto!important}
#modal .quote-copy-toggle{position:relative;z-index:1}
#modal>.sheet.quick-book-sheet .sticky-actions{position:sticky!important;bottom:0!important;z-index:30!important;background:#171c31!important;border-top:1px solid #3b435e!important;padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important}
#modal .quote-card label,
#modal .quote-builder-v3 label,
#modal #invoiceForm label,
#modal .quote-customer-card label,
#modal .quote-card small,
#modal #invoiceForm small{color:#3b465c!important}
.app-shell .list-row>.badge{width:max-content;max-width:100%;justify-self:start;align-self:center;white-space:nowrap}
.app-shell .list-row>.badge[class]:not(.badge-due):not(.badge-complete){letter-spacing:.02em}
.app-shell .badge{width:max-content}
#quotesList .badge,
#invoicesList .badge{width:auto;min-width:0;padding:5px 10px!important;font-size:11px!important}
#quotesList .list-row .badge,
#invoicesList .list-row .badge{text-transform:capitalize}
body.doc-viewer-open .doc-viewer-frame,
body.doc-viewer-open iframe{overflow:auto!important;touch-action:pan-y}
#modal>.sheet.quick-book-sheet .quick-price-section{padding-bottom:18px!important}
#modal>.sheet.quick-book-sheet .quick-book-summary{margin-bottom:14px!important}
#modal>.sheet.quick-book-sheet .quick-more{margin-bottom:18px!important}

#modal .workops-sheet-footer{flex:0 0 auto!important;position:relative!important;z-index:40!important;background:#171c31!important;border-top:1px solid #3b435e!important;padding:10px 0 max(10px,env(safe-area-inset-bottom,0px))!important}
#modal .workops-sheet-footer .sticky-actions,
#modal .workops-sheet-footer .modal-actions{position:static!important;margin:0!important;padding-bottom:0!important;background:transparent!important;border-top:0!important}
@media(max-width:900px){
  #modal{padding:0!important;align-items:flex-end!important;justify-content:stretch!important;inset:0!important;height:100%!important;max-height:100svh!important}
  #modal.open>.sheet,#modal>.sheet{width:100%!important;height:100%!important;max-height:100%!important;border-radius:0!important;padding:calc(8px + env(safe-area-inset-top,0px)) 14px 0!important;box-sizing:border-box!important}
  #modal>.sheet>.sheet-grip{display:none!important}
  #modal .sheet-head{min-height:58px!important;padding:4px 0 10px!important;align-items:center!important}
  #modal .sheet-head h2{font-size:21px!important}
  #modalBody{padding:0 0 12px!important;touch-action:pan-y!important}
}

@supports not (height:100svh){
  @media(max-width:900px){#modal{max-height:100vh!important}#modal.open>.sheet{height:min(92vh,820px)!important;max-height:min(92vh,820px)!important}}
}