/* Keep the learning header and save action inside the current viewport. */
html:root body.app-shell-page #learning-profile-dialog {
  box-sizing: border-box;
  height: min(860px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
}

#learning-profile-dialog > .category-settings-dialog-shell {
  box-sizing: border-box;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

#learning-profile-dialog .category-settings-dialog-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Expanded learning context belongs to the same scroll surface. */
#learning-profile-dialog .runtime-prompt-preview pre {
  max-height: none;
  overflow: visible;
  overflow-wrap: anywhere;
}
