/* Shared dialog geometry and page-overlay boundaries. No surface/theme changes. */
html body.vf-modal-active > .vf-modal-page-layer {
  isolation: isolate !important;
  z-index: 0 !important;
}
html body .modal.vf-modal-managed {
  --bs-modal-zindex: var(--vf-modal-layer, 2147483600);
  z-index: var(--vf-modal-layer, 2147483600) !important;
  isolation: isolate;
}
html body .modal-backdrop {
  z-index: var(--vf-backdrop-layer, 2147483599) !important;
}
html body.vf-modal-active > :is(.vf-detached-publisher-emoji-menu, .tox-tinymce-aux, .select2-container--open, .datepicker, .daterangepicker, .flatpickr-calendar) {
  z-index: 2147483646 !important;
}
@media (min-width: 768px) {
  html body .vf-modal-managed > .modal-dialog { --vf-dialog-width: 560px; }
  html body.vf-modal-active :is(#modal, .modal).vf-modal-managed > .modal-dialog:not([class*="modal-fullscreen"]) {
    box-sizing: border-box !important;
    width: calc(100vw - 32px) !important;
    max-width: min(var(--vf-dialog-width), calc(100vw - 32px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  html body :is(#modal, .modal).vf-modal-managed > .modal-dialog.modal-sm { --vf-dialog-width: 430px; }
  html body :is(#modal, .modal).vf-modal-managed > .modal-dialog.modal-lg { --vf-dialog-width: 860px; }
  html body :is(#modal, .modal).vf-modal-managed > .modal-dialog.modal-xl { --vf-dialog-width: 1120px; }
  html body :is(#modal, .modal).vf-modal-managed > .modal-dialog:has(.vf-modal-confirm-header) { --vf-dialog-width: 430px; }
  html body :is(#modal, .modal).vf-modal-managed > .modal-dialog:has(.vf-event-application-form) { --vf-dialog-width: 1120px; }
  html body :is(#modal, .modal).vf-modal-managed:is(.js_modal-publisher, .vf-forge-modal) > .modal-dialog { --vf-dialog-width: 860px; }
  /* Forge uses its existing full-screen mobile/tablet layout up to 850px. */
  html body :is(#modal, .modal).vf-modal-managed.vf-forge-modal > .modal-dialog {
    max-width: min(860px, calc(100vw - 32px)) !important;
  }
}
@media (min-width: 768px) and (max-width: 850px) {
  html body :is(#modal, .modal).vf-modal-managed.vf-forge-modal > .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
  }
}
