/* Keep the teacher's book-access dialog inside the screen. */
.portal-book-access-dialog {
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

/* Keep the title and instructions in place while the book list moves. */
.portal-book-access-dialog > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.portal-book-access-dialog > div:nth-child(2) > div.space-y-2 {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 0.25rem;
}
