/* Shared two-state navigation and sticky jump contract, 25 August 2026. */
body[data-bt-template] .bt-public-header {
  position: relative !important;
  top: auto !important;
  z-index: 4000 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body[data-bt-template] .page-jump {
  position: sticky !important;
  top: 0 !important;
  z-index: 3900 !important;
}

body[data-bt-template] main [id] {
  scroll-margin-top: 76px;
}

/* Closed term explainers must not widen the page. Medium-width explainers use
   a viewport-contained sheet instead of an off-screen absolute panel. */
.bt-term-popover {
  display: none;
}

.bt-term-help:hover .bt-term-popover,
.bt-term-help:focus-within .bt-term-popover,
.bt-term-help.is-open .bt-term-popover {
  display: block;
}

.bt-public-mobile-nav {
  position: relative;
  z-index: 4100;
}

.bt-public-mobile-nav > summary {
  position: relative;
  z-index: 2;
  cursor: pointer;
  list-style: none;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
}

.bt-public-mobile-nav > summary::-webkit-details-marker {
  display: none;
}

.bt-public-mobile-nav:not([open]) > nav {
  display: none !important;
}

.bt-public-mobile-nav[open] > nav {
  position: absolute;
  z-index: 4200;
  top: calc(100% + 8px);
  right: 0;
  display: grid !important;
  box-sizing: border-box;
  width: min(320px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 96px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: #ffffff;
  border: 1px solid #dce5ef;
}

.bt-public-mobile-nav[open] > nav a {
  box-sizing: border-box;
  min-width: 0;
  pointer-events: auto;
  overflow-wrap: anywhere;
}

@media (min-width: 1281px) {
  body[data-bt-template]:not(.bt-compact-header-page) .bt-public-desktop-nav,
  body[data-bt-template]:not(.bt-compact-header-page) .bt-public-actions {
    display: flex !important;
  }

  body[data-bt-template]:not(.bt-compact-header-page) .bt-public-mobile-nav {
    display: none !important;
  }
}

@media (max-width: 1280px) {
  body[data-bt-template]:not(.bt-compact-header-page) .bt-public-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  body[data-bt-template]:not(.bt-compact-header-page) .bt-public-desktop-nav,
  body[data-bt-template]:not(.bt-compact-header-page) .bt-public-actions {
    display: none !important;
  }

  body[data-bt-template]:not(.bt-compact-header-page) .bt-public-mobile-nav {
    display: block !important;
  }
}

@media (min-width: 621px) and (max-width: 1100px) {
  .bt-term-popover {
    position: fixed;
    right: 16px;
    bottom: 24px;
    left: auto;
    width: min(340px, calc(100vw - 32px));
    max-height: 45vh;
    overflow: auto;
  }
}

@media (max-width: 620px) {
  .bt-term-popover {
    position: fixed;
    right: 16px;
    bottom: 82px;
    left: 16px;
    width: auto;
    max-height: 45vh;
    overflow: auto;
  }
}

@media (max-width: 420px) {
  .bt-public-mobile-nav[open] > nav {
    width: min(304px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-public-mobile-nav,
  .bt-public-mobile-nav > nav {
    scroll-behavior: auto;
  }
}
