/* Patient modal sizing is intentionally independent from the Facility workspace modal.
   Patient forms should size to their content on desktop and only use internal scrolling
   when validation, treatment history, or a smaller viewport requires it. */
@media (min-width: 981px) {
  dialog.app-modal.patient-modal[open] {
    height: fit-content !important;
    min-height: 0 !important;
    max-height: 78dvh;
  }

  .patient-modal > .facility-modal-shell {
    height: fit-content !important;
    min-height: 0 !important;
    max-height: 78dvh;
  }

  .patient-modal .facility-modal-form {
    height: fit-content !important;
    min-height: 0 !important;
    max-height: calc(78dvh - 76px);
    grid-template-rows: auto auto;
  }

  .patient-modal .patient-modal-body {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(78dvh - 142px);
    overflow-y: auto;
  }

  .patient-modal .patient-form-layout {
    min-height: 0 !important;
    height: auto !important;
  }

  .patient-modal .patient-form-main,
  .patient-modal .patient-form-side {
    height: auto !important;
  }

  .patient-modal .patient-form-side {
    grid-template-rows: auto auto;
  }

  .patient-modal .patient-history-section {
    height: auto !important;
    max-height: 320px;
    overflow-y: auto;
  }
}
