/* Mobile overlay bounds. Presentation only; keep native dialog focus and every
   original order control inside its existing delegated-handler scope. */
@media(max-width:760px), (max-width:960px) and (max-height:500px){
 /* Explicit physical AND logical edges replace conflicting legacy RTL widths,
    auto margins and bottom-sheet offsets. No translate/zoom compensation. */
 body.horizon118.horizon120 :is(dialog,#orderIntentDialog,#pathChoiceDialog,#orderDialog,#quoteDialog,#photoLibrary128,#orderPreviewDialog,#mobileSections122,#editOrderDialog,#manualInvoiceDialog,#stageChoiceDialog):not(.image-viewer){
  box-sizing:border-box!important;
  position:fixed!important;
  inset:auto max(8px,env(safe-area-inset-right,0px)) max(8px,env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))!important;
  inset-inline-start:auto!important;
  inset-inline-end:auto!important;
  /* RTL inline-start is right; use physical edges last for either direction. */
  left:max(8px,env(safe-area-inset-left,0px))!important;
  right:max(8px,env(safe-area-inset-right,0px))!important;
  margin:0!important;
  width:auto!important;
  min-width:0!important;
  max-width:calc(100vw - 16px)!important;
  max-height:calc(100vh - 16px)!important;
  max-height:calc(100dvh - max(8px,env(safe-area-inset-top,0px)) - max(8px,env(safe-area-inset-bottom,0px)))!important;
  border-radius:16px!important;
  transform:none!important;
  translate:none!important;
  animation:none!important;
  overflow:auto!important;
  overscroll-behavior:contain;
 }
 body.horizon118.horizon120 :is(#orderIntentDialog,#pathChoiceDialog)[open]{display:flex!important;flex-direction:column!important;overflow:hidden!important}
 body.horizon118.horizon120 :is(#orderIntentDialog,#pathChoiceDialog)>:is(header,.modal-head){flex:0 0 auto!important;gap:10px!important;min-width:0!important;padding:10px 12px!important}
 body.horizon118.horizon120 :is(#orderIntentDialog,#pathChoiceDialog)>:is(header,.modal-head) :is(h2,h3){min-width:0;overflow-wrap:anywhere;line-height:1.5!important;font-size:1rem!important}
 body.horizon118.horizon120 :is(#orderIntentDialog,#pathChoiceDialog)>:is(header,.modal-head) button{flex-shrink:0;min-height:44px!important}
 body.horizon118.horizon120 :is(#orderIntentDialog .quote-intent-grid,#pathChoiceDialog .path-choice-grid){box-sizing:border-box!important;flex:1 1 auto!important;min-height:0!important;max-height:none!important;min-width:0!important;max-width:100%!important;overflow:auto!important;overscroll-behavior:contain;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;padding:12px!important}
 body.horizon118.horizon120 #orderIntentDialog .quote-intent-choice{min-width:0!important;width:100%!important;box-sizing:border-box!important;min-height:88px!important;padding:14px!important;gap:6px!important;white-space:normal!important;overflow-wrap:anywhere}
 body.horizon118.horizon120 #orderIntentDialog .quote-intent-choice strong{font-size:1.05rem!important;line-height:1.5!important}
 body.horizon118.horizon120 #orderIntentDialog .quote-intent-choice span{font-size:.85rem!important;line-height:1.65!important}

 /* Anchor the menu to the complete action row, not the small RTL trigger.
    Its contents can scroll without clipping labels or blocking the close/back UI. */
 body.workspace124.horizon118.horizon120 #detailView .order-identity-row83>.accounting-actions{position:relative!important;display:flex!important;flex:1 1 100%!important;width:100%!important;min-width:0!important;max-width:100%!important;align-items:center!important}
 body.workspace124.horizon118.horizon120 #detailView .accounting-actions>.order-tools83{position:static!important;min-width:0!important;max-width:100%!important;flex:1 1 138px!important}
 body.workspace124.horizon118.horizon120 #detailView .order-tools83>summary{width:100%!important;white-space:normal!important;min-height:44px!important;height:auto!important}
 body.workspace124.horizon118.horizon120 #detailView .order-tools-list83{position:absolute!important;inset:calc(100% + 6px) 0 auto!important;inset-inline:0!important;box-sizing:border-box!important;width:auto!important;min-width:0!important;max-width:100%!important;max-height:45vh!important;max-height:45dvh!important;overflow:auto!important;overscroll-behavior:contain;margin:0!important;padding:6px!important;gap:4px!important;z-index:60!important}
 body.workspace124.horizon118.horizon120 #detailView .order-tools-list83>.btn{box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:100%!important;min-height:44px!important;white-space:normal!important;overflow-wrap:anywhere;line-height:1.5!important;text-align:start!important}
 body.workspace124.horizon118.horizon120 #detailView .detail-page-head:has(.order-tools83[open]){position:relative!important;z-index:60!important;overflow:visible!important}
 body.workspace124.horizon118.horizon120 #detailView:has(.order-tools83[open]) .order-action-dock100{visibility:hidden!important}
}
