.md-sidebar__scrollwrap {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--md-default-fg-color--light) transparent;
}

@media only screen and (max-width: 76.234375em) {
  .md-sidebar--primary .md-nav__list {
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
  }
}

/* Keep each desktop index within the viewport, independently of article length. */
@media only screen and (min-width: 60em) {
  .md-sidebar--secondary {
    align-self: flex-start;
    position: sticky;
    top: var(--md-header-height, 2.4rem);
  }

  .md-sidebar--secondary .md-sidebar__scrollwrap {
    max-height: calc(100vh - var(--md-header-height, 2.4rem) - 2.4rem);
    max-height: calc(100dvh - var(--md-header-height, 2.4rem) - 2.4rem);
  }
}

@media only screen and (min-width: 76.25em) {
  .md-main__inner {
    max-width: none;
    margin-top: 0;
  }

  .md-sidebar {
    width: 13rem;
  }

  .md-sidebar--primary {
    align-self: flex-start;
    position: sticky;
    top: var(--md-header-height, 2.4rem);
  }

  .md-sidebar--primary .md-sidebar__scrollwrap {
    max-height: calc(100vh - var(--md-header-height, 2.4rem) - 2.4rem);
    max-height: calc(100dvh - var(--md-header-height, 2.4rem) - 2.4rem);
  }

  .md-content__inner {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  .md-nav__title {
    display: none;
  }
}
