/* Body-level legacy dialogs escape the transformed .wrap stacking context. */
body > .modal-backdrop {
  position:fixed;
  inset:0;
  z-index:2147483000;
  width:auto;
  height:auto;
  margin:0;
  padding:16px;
  align-items:center;
  justify-content:center;
  overflow:auto;
  overscroll-behavior:contain;
  transform:none;
}
body > .modal-backdrop > .modal-card {
  width:min(680px,100%);
  min-width:0;
  max-height:calc(100vh - 32px);
  max-height:calc(100dvh - 32px);
  margin:auto;
  overflow:auto;
  overscroll-behavior:contain;
}
body > .modal-backdrop > .modal-card > :is(h1,h2,h3):first-of-type {
  padding-right:30px;
}
body.vial-legacy-modal-open {
  overflow:hidden;
}
@media (max-width:480px) {
  body > .modal-backdrop {padding:8px;}
  body > .modal-backdrop > .modal-card {
    max-height:calc(100vh - 16px);
    max-height:calc(100dvh - 16px);
    padding:14px;
  }
  body > .modal-backdrop .modal-actions {flex-wrap:wrap;}
}
