
:where(html:has([data-nav-dialog]), [data-nav-scroll-root]) {
  scrollbar-gutter: stable;
}

html:has([data-nav-dialog][open]),
html:has([data-nav-dialog][open]) [data-nav-scroll-root] {
  overflow: hidden;
}

[data-nav-dialog]:not([open]),
[data-nav-category-panel][hidden] {
  display: none !important;
}

[data-nav-dialog] {
  max-inline-size: calc(100vw - 28px);
  max-block-size: calc(100dvh - 28px);
  overflow: auto;
  overscroll-behavior: contain;
}

#site-menu-dialog[data-nav-dialog] {
  position: fixed;
  inset: 0 auto 0 0;
  margin: 0;
  box-sizing: border-box;
  inline-size: min(78vw, 26rem);
  max-inline-size: none;
  block-size: 100dvh;
  max-block-size: none;
}

#site-menu-dialog::backdrop {
  background: rgb(3 19 25 / 59%);
  backdrop-filter: blur(5px);
}

[data-nav-toc] a[aria-current="location"] {
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

:where([data-nav-category], [data-nav-open], [data-nav-close], [data-nav-search] button, [data-nav-dialog] a):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

html[data-nav-font-adjusted] {
  font-size: calc(100% * var(--nav-reading-scale));
}

html[data-nav-spacing] :where([data-nav-reading-content]) :is(p, li, dd, td, th, figcaption, summary) {
  line-height: 1.75;
  letter-spacing: 0.02em;
  word-spacing: 0.08em;
}

html[data-nav-text-enlarged] .search {
  height: auto;
  min-height: 37px;
}

html[data-nav-text-enlarged] .search input {
  padding-block: 0.15em;
}

html[data-nav-text-enlarged] :is([data-nav-reading-content], [data-nav-dialog]) {
  overflow-wrap: anywhere;
}

html[data-nav-text-enlarged] .hero .attribution {
  flex-wrap: wrap;
}

html[data-nav-text-enlarged] .hero .rating {
  flex: none;
}

@media (751px <= width <= 1060px) {
  html[data-nav-text-enlarged] {
    --header-height: calc(56px + 2.5rem);
  }

  html[data-nav-text-enlarged] .toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-content: center;
    gap: 0.25rem 0.35rem;
  }

  html[data-nav-text-enlarged] .toolbar > .menu { grid-area: 1 / 1; }
  html[data-nav-text-enlarged] .toolbar > .brand { grid-area: 1 / 2; }
  html[data-nav-text-enlarged] .toolbar > .tools { grid-area: 1 / 3; }

  html[data-nav-text-enlarged] .toolbar > .desk-search {
    grid-area: 2 / 1 / 3 / -1;
    width: min(420px, 100%);
  }
}

@media (max-width: 750px) {
  html[data-nav-text-enlarged] .tools .button {
    font-size: 0.625rem;
  }

  html[data-nav-text-large] {
    --header-height: calc(54px + 1.9rem);
  }

  html[data-nav-text-large] .toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    row-gap: 4px;
  }

  html[data-nav-text-large] .toolbar > .tools {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

