/* Exact MEDCORE document interaction: one-finger native scrolling, two-finger page zoom. */
html.mrph-medcore-reader-open,
body.mrph-medcore-reader-open {
  overscroll-behavior-y: auto !important;
  touch-action: pan-y !important;
}

.mrph-medcore-scroll-host {
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
}

.mrph-medcore-scroll-host > .medcore-summary-viewer-page,
.mrph-medcore-scroll-host .medcore-summary-viewer-page {
  overflow: visible !important;
  touch-action: pan-y !important;
}

.medcore-summary-document-shell:not(:fullscreen),
.medcore-summary-document-shell:not(:fullscreen) .medcore-summary-pdf-layout,
.medcore-summary-document-shell:not(:fullscreen) .medcore-summary-pdf-main {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.medcore-summary-document-shell:not(:fullscreen) .medcore-summary-pdf-stage:not(.is-medcore-zoomed) {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  overscroll-behavior-y: auto !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: auto !important;
}

.medcore-summary-document-shell:not(:fullscreen) .medcore-summary-pdf-stage > [data-medcore-page-zoom="true"] {
  touch-action: pan-y !important;
  pointer-events: auto !important;
}

.medcore-summary-pdf-stage.is-medcore-pinching,
.medcore-summary-pdf-stage.is-medcore-zoomed {
  overflow: auto !important;
  overscroll-behavior: auto !important;
  touch-action: none !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
}

.medcore-summary-pdf-stage.is-medcore-zoomed > [data-medcore-page-zoom="true"] {
  max-width: none !important;
}

.medcore-summary-document-shell:fullscreen {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.medcore-summary-document-shell:fullscreen .medcore-summary-pdf-layout.is-ready {
  grid-template-columns: minmax(0, 1fr) 132px !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.medcore-summary-document-shell:fullscreen .medcore-summary-pdf-main {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.medcore-summary-document-shell:fullscreen .medcore-summary-pdf-stage {
  position: relative !important;
  display: grid !important;
  place-items: start center !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 10px 12px 18px !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  overscroll-behavior: auto !important;
  touch-action: pan-x pan-y !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-behavior: auto !important;
}

.medcore-summary-document-shell:fullscreen .medcore-summary-pdf-stage > [data-medcore-page-zoom="true"] {
  position: relative !important;
  display: block !important;
  width: min(100%, 1280px) !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 auto !important;
  transform-origin: 50% 0 !important;
  touch-action: pan-x pan-y !important;
  overscroll-behavior: auto !important;
  pointer-events: auto !important;
}

.medcore-summary-document-shell:fullscreen .medcore-summary-pdf-stage.is-medcore-zoomed,
.medcore-summary-document-shell:fullscreen .medcore-summary-pdf-stage.is-medcore-pinching {
  overflow-x: auto !important;
  overflow-y: auto !important;
  overscroll-behavior: auto !important;
  touch-action: pan-x pan-y !important;
}

.medcore-summary-document-shell:fullscreen .medcore-summary-pdf-stage.is-medcore-zoomed > [data-medcore-page-zoom="true"] {
  max-width: none !important;
  max-height: none !important;
  touch-action: pan-x pan-y !important;
}

.medcore-summary-document-shell:fullscreen .medcore-summary-page-rail {
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

.medcore-summary-document-shell:fullscreen .medcore-summary-page-thumbnails {
  height: 100% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 760px) {
  .medcore-summary-document-shell:fullscreen .medcore-summary-pdf-layout.is-ready {
    grid-template-columns: 1fr !important;
  }

  .medcore-summary-document-shell:fullscreen .medcore-summary-page-rail {
    display: none !important;
  }

  .medcore-summary-document-shell:fullscreen .medcore-summary-pdf-stage {
    padding: 8px 8px 16px !important;
  }
}
