/* Keep upstream colors and typography; normalize the documentation layout. */
:root { --doc-max-width: 100%; --doc-max-width--desktop: 100%; }
.navbar-brand .site-brand { display: flex; align-items: center; gap: .5rem; }
.navbar-brand .site-logo { width: 56px; height: 56px; max-height: none; flex-shrink: 0; object-fit: contain; }
.site-logo-light { display: block; }
.site-logo-dark { display: none; }
@media screen {
  html.dark-theme .site-logo-light { display: none; }
  html.dark-theme .site-logo-dark { display: block; }
}
@media screen {
  .header .navbar { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 1rem; box-sizing: border-box; }
  .navbar .navbar-brand { padding: 0; min-width: 0; height: auto; }
  .navbar-brand .navbar-item:first-child { font-size: clamp(1rem, 3vw, 1.22rem); }
  .navbar .theme-toggler { position: relative; top: auto; right: auto; margin: 0; flex-shrink: 0; }
  .navbar > .navbar-item { display: flex; align-items: center; padding: 1rem; }
  .navbar .theme-toggler .icon { width: 24px; height: 24px; }
  .navbar .theme-toggler .icon svg { width: 1em; height: 1em; }
  .theme-toggler:focus-within, button:focus-visible { outline: 2px solid var(--link-font-color); outline-offset: 3px; }
  .body main.article { min-width: 0; }
  main > .content { overflow: visible; }
  .doc { box-sizing: border-box; width: 100%; min-width: 0; margin: 0; padding: 0 1.5rem 3rem; }
  .breadcrumbs-container { position: static; margin: 0; padding: 1rem 0; }
  .nav { background: var(--nav-background); }
  .nav .panels { min-height: 0; }
  .nav-panel-menu { flex: 1; min-height: 0; height: auto; overflow: auto; }
  .nav-menu { min-height: 0; padding: 1rem; }
  .nav-panel-menu .context { display: flex; align-items: center; justify-content: space-between; gap: .5rem; position: static; width: auto; margin: 0 0 1rem; padding: 0 0 .75rem; }
  .nav-list { padding: 0; }
  .nav-list .nav-list { margin-left: 1rem; }
  .nav-link, .nav-text { display: block; padding: .5rem .6rem; }
  .nav-item-toggle { top: .35rem; left: 0; margin: 0; }
  .nav-item-toggle + .nav-link, .nav-item-toggle + .nav-text { padding-left: 1.6rem; }
  .nav-collapse { flex: 0 0 40px; margin: 0; }
  #nav-toggle-2 { display: none; }
  .toolbar { gap: .5rem; padding: 0 .5rem; }
  .nav-backdrop { display: none; }
}
@media screen and (max-width: 1023.5px) {
  .nav-container { top: calc(var(--navbar-height) + var(--toolbar-height)); bottom: 0; width: min(20rem, 90vw); z-index: 102; }
  .nav-container { height: calc(100dvh - var(--navbar-height) - var(--toolbar-height)); background: var(--nav-background); }
  .nav-container .nav { height: 100%; box-shadow: 3px 0 12px #0003; }
  .nav-container .nav-menu { opacity: 1; visibility: inherit; }
  body.nav-sm .nav-panel-menu { overflow: auto; }
  .nav-collapse { display: none; }
  .nav-container.is-active #nav-toggle-2 { display: block; position: absolute; right: .4rem; top: .55rem; }
  .nav-panel-menu .context { padding-right: 2.5rem; }
  .nav-backdrop.is-active { display: block; position: fixed; inset: calc(var(--navbar-height) + var(--toolbar-height)) 0 0; background: #0006; z-index: 101; }
  html.is-clipped--nav { overflow: hidden; }
  .doc { padding: 0 1rem 2rem; }
  .doc table.tableblock { display: block; max-width: 100%; overflow-x: auto; }
}
@media screen and (min-width: 1024px) {
  .nav-container { width: var(--nav-width); }
  body.nav-sm .nav-container { width: 60px; z-index: 1; }
  .nav-container .nav { height: calc(100dvh - var(--navbar-height)); }
  .doc { flex: 1; }
}
@media screen and (min-width: 1024px) and (max-width: 1279px) {
  aside.sidebar { display: none; }
  .toc.embedded { display: block; }
}

/* The upstream specification layout hides the first section after the TOC.
   Our page title and first section are distinct, so keep both visible. */
.doc > h1#page-title + aside + #preamble + .sect1 > h2:first-child,
.doc > h1#page-title + aside + .sect1 > h2:first-child {
  display: block;
}
