/* Shieldy custom messages r18 — modal centering hotfix only.
   No data model, handlers, save/load logic, API or network changes. */

/* r17 let the outer native <dialog> shrink to auto width. On the cabinet's
   combined CSS this can leave its child panel anchored at the top-left.
   Pin the native dialog itself to the viewport and let auto margins center it. */
#cm510-preview-modal-r17.sh-auto-preview-modal[open]{
  position:fixed!important;
  inset:0!important;
  top:0!important;
  right:0!important;
  bottom:0!important;
  left:0!important;
  display:block!important;
  width:min(760px,calc(100vw - 32px))!important;
  min-width:0!important;
  max-width:760px!important;
  height:fit-content!important;
  min-height:0!important;
  max-height:calc(100dvh - 32px)!important;
  margin:auto!important;
  padding:0!important;
  overflow:visible!important;
  transform:none!important;
  box-sizing:border-box!important;
}

#cm510-preview-modal-r17.sh-auto-preview-modal[open] > .cm510-preview-modal-dialog-r17{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  max-height:calc(100dvh - 32px)!important;
  margin:0!important;
  box-sizing:border-box!important;
}

/* Keep centering stable when the browser falls back to the open attribute. */
#cm510-preview-modal-r17.sh-auto-preview-modal[open]:not(:modal){
  z-index:2147482500!important;
}

@media(max-width:600px){
  #cm510-preview-modal-r17.sh-auto-preview-modal[open]{
    width:calc(100vw - 24px)!important;
    max-width:calc(100vw - 24px)!important;
    max-height:calc(100dvh - 24px)!important;
  }
  #cm510-preview-modal-r17.sh-auto-preview-modal[open] > .cm510-preview-modal-dialog-r17{
    max-height:calc(100dvh - 24px)!important;
  }
}
