/* FINOVA unified modal viewport layout — presentation only. */
@media (min-width: 576px) {
  body .modal .modal-dialog.modal-lg,
  body .modal .modal-dialog.modal-xl {
    width: calc(100% - 32px) !important;
    max-width: min(1360px, calc(100vw - 32px)) !important;
    margin: 16px auto !important;
  }
}
@media (max-width: 575.98px) {
  body .modal .modal-dialog { margin: 8px auto !important; width: calc(100% - 16px) !important; }
}
/* Keep the complete dialog within the viewport, with a single primary content scroll. */
body .modal .modal-dialog:not(.modal-sm) {
  max-height: calc(100dvh - 32px) !important;
}
body .modal .modal-dialog:not(.modal-sm) > .modal-content {
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100dvh - 32px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body .modal .modal-dialog:not(.modal-sm) > .modal-content > .modal-header,
body .modal .modal-dialog:not(.modal-sm) > .modal-content > .modal-footer {
  flex: 0 0 auto !important;
}
body .modal .modal-dialog:not(.modal-sm) > .modal-content > .modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
}
/* Prevent tab navigation from clipping on narrow screens. */
body .modal .modal-dialog:not(.modal-sm) .nav-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
