html {
  scroll-padding-top: calc(var(--site-header-height, 64px) + 16px);
}

/* Preserve horizontal clipping without trapping the sticky header. */
html,
body {
  overflow-x: clip;
}

.tr-header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.tr-header .navbar {
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.tr-header.is-scrolled .navbar {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 6px 24px rgba(15, 23, 42, 0.05);
}

.api-doc-nav-wrap {
  top: var(--site-header-height, 64px);
}

@media (min-width: 768px) {
  .guide-sidebar,
  .guide-toc {
    top: calc(var(--site-header-height, 64px) + 24px);
    max-height: calc(100vh - var(--site-header-height, 64px) - 48px);
  }

  .api-list-sidebar {
    top: max(90px, calc(var(--site-header-height, 64px) + 24px));
  }

  .order-sidebar {
    top: max(108px, calc(var(--site-header-height, 64px) + 24px));
  }
}

@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .tr-header.is-scrolled .navbar {
    background-color: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
  }

  :root[data-theme="dark"] .tr-header.is-scrolled .navbar {
    background-color: rgba(41, 50, 62, 0.88);
  }
}

@media (max-width: 767px) {
  .tr-header .navbar-collapse.in {
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tr-header .navbar {
    transition: none;
  }
}
