/* Global search (Ctrl/Cmd+K) scrolling.
   Kept outside site.css because site.css is generated from src/site.scss.

   The search panel scrolls natively: the dialog is a flex column capped at the
   viewport height, the header stays put and the results area takes the rest and
   scrolls. The panel layout is put back into normal flow so its height is the
   content height (the autocomplete theme positions it absolutely, which is what
   left nothing to scroll once PerfectScrollbar was removed). */
.aa-DetachedOverlay .aa-DetachedContainer {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-block-size: min(720px, calc(100dvh - 2rem));
}

.aa-DetachedOverlay .aa-DetachedFormContainer {
  flex: 0 0 auto;
}

.aa-DetachedOverlay .aa-Panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.aa-DetachedOverlay .aa-PanelLayout {
  position: static !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* The shortcut bar sticks to the bottom of the scrolling panel. */
.aa-DetachedOverlay .search-command-footer {
  position: sticky;
  bottom: 0;
}

@media (max-width: 575.98px) {
  .aa-DetachedOverlay .aa-DetachedContainer {
    max-block-size: calc(100dvh - 1rem);
  }
}
