/* Shared Oddsprig Index appearance. The light palette matches Main's reviewed
   menu and stays the same in both page themes. Component selectors and
   !important declarations outrank the later oddsprig-theme.css.
   Header placement below is scoped to verified, hostname-free page hooks.
   Unmapped headers must retain their old per-site placement stylesheet. */

html:root body details.site-index[data-site-index-menu],
html:root body details.site-index[data-site-index-menu] > summary,
html:root body details.site-index[data-site-index-menu] > .site-index-links,
html:root body details.site-index[data-site-index-menu] > .site-index-links > a,
html:root body select[data-site-index] {
  box-sizing: border-box;
  font: 600 14px/1.5 system-ui, sans-serif !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-shadow: none !important;
  animation: none !important;
  transition: none !important;
}

html:root body details.site-index[data-site-index-menu] {
  display: inline-block !important;
  flex: 0 0 auto;
  width: 104px !important;
  min-width: 104px !important;
  max-width: 100%;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1e3339 !important;
  color-scheme: light !important;
  overflow: visible !important;
}

html:root body details.site-index[data-site-index-menu][open] {
  z-index: 1001;
}

html:root body details.site-index[data-site-index-menu] > summary {
  display: flex !important;
  position: relative;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 1px solid #a1b3af !important;
  border-radius: 5px !important;
  background: #f4f0e6 !important;
  box-shadow: none !important;
  color: #1e3339 !important;
  cursor: pointer;
  list-style: none !important;
  text-align: left !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transform: none !important;
}

html:root body details.site-index[data-site-index-menu] > summary::-webkit-details-marker {
  display: none !important;
}

html:root body details.site-index[data-site-index-menu] > summary::marker {
  content: "";
}

html:root body details.site-index[data-site-index-menu] > summary::before {
  content: none !important;
}

html:root body details.site-index[data-site-index-menu] > summary::after {
  content: "" !important;
  box-sizing: content-box;
  display: block !important;
  position: static !important;
  flex: none;
  width: 7px !important;
  height: 7px !important;
  margin: -4px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  background: transparent !important;
  transform: rotate(45deg) !important;
  animation: none !important;
  transition: none !important;
}

html:root body details.site-index[data-site-index-menu][open] > summary::after {
  margin-top: 4px !important;
  transform: rotate(225deg) !important;
}

html:root body details.site-index[data-site-index-menu][open] > summary,
html:root body details.site-index[data-site-index-menu] > summary:hover {
  border-color: #688450 !important;
}

html:root body details.site-index[data-site-index-menu] > summary:focus-visible,
html:root body details.site-index[data-site-index-menu] > .site-index-links > a:focus-visible,
html:root body select[data-site-index]:focus-visible {
  outline: 3px solid #688450 !important;
  outline-offset: 3px;
}

html:root body details.site-index[data-site-index-menu] > .site-index-links {
  position: absolute !important;
  inset: calc(100% + 6px) 0 auto auto !important;
  z-index: 1000;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  width: 200px !important;
  min-width: 0 !important;
  max-width: calc(100vw - 32px) !important;
  height: auto !important;
  max-height: min(360px, calc(100vh - 80px)) !important;
  max-height: min(360px, calc(100dvh - 80px)) !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  margin: 0 !important;
  padding: 6px !important;
  border: 1px solid #a1b3af !important;
  border-radius: 5px !important;
  background: #f4f0e6 !important;
  box-shadow: 0 8px 24px #1e333926 !important;
  color: #1e3339 !important;
  text-align: left !important;
  transform: none !important;
}

html:root body details.site-index[data-site-index-menu]:not([open]) > .site-index-links {
  display: none !important;
}

html:root body details.site-index[data-site-index-menu] > .site-index-links > a {
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 44px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1e3339 !important;
  text-align: left !important;
  text-decoration: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  transform: none !important;
}

/* Suppress decorative underlines/arrows added by a host site's nav rules. */
html:root body details.site-index[data-site-index-menu] > .site-index-links > a::before,
html:root body details.site-index[data-site-index-menu] > .site-index-links > a::after {
  content: none !important;
}

html:root body details.site-index[data-site-index-menu] > .site-index-links > a[aria-current="page"] {
  background: #e6ead8 !important;
  box-shadow: inset 2px 0 #688450 !important;
}

html:root body details.site-index[data-site-index-menu] > .site-index-links > a:hover {
  background: #e6ead8 !important;
}

/* Keep the legacy select usable on pages that still use it. */
html:root body select[data-site-index] {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #a1b3af;
  border-radius: 5px;
  background: #f4f0e6 !important;
  color: #1e3339 !important;
  color-scheme: light !important;
  font-weight: 400 !important;
}

/* Colour lock. Later host/theme rules (oddsprig-theme.css light theme) were
   repainting the trigger and panel #e5edf0/#a1b3af on every site but Music.
   The two :not(#id) guards match every page but add ID-level specificity
   (2,0,0), so these colour-only declarations outrank class/attribute theme
   selectors in both page themes. No layout or placement properties here. */
html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] {
  background-color: transparent !important;
  background-image: none !important;
  color: #1e3339 !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > summary,
html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > .site-index-links {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: #a1b3af !important;
  background-color: #f4f0e6 !important;
  background-image: none !important;
  color: #1e3339 !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > summary {
  box-shadow: none !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > .site-index-links {
  box-shadow: 0 8px 24px #1e333926 !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu][open] > summary,
html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > summary:hover {
  border-color: #688450 !important;
  background-color: #f4f0e6 !important;
  color: #1e3339 !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > summary:focus-visible,
html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > .site-index-links > a:focus-visible,
html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body select[data-site-index]:focus-visible {
  outline-color: #688450 !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > .site-index-links > a,
html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > .site-index-links > a:visited {
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #1e3339 !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > .site-index-links > a:hover {
  background-color: #e6ead8 !important;
  color: #1e3339 !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body details.site-index[data-site-index-menu] > .site-index-links > a[aria-current="page"] {
  background-color: #e6ead8 !important;
  box-shadow: inset 2px 0 #688450 !important;
  color: #1e3339 !important;
}

html:root:not(#oddsprig-si-lock-a):not(#oddsprig-si-lock-b) body select[data-site-index] {
  background-color: #f4f0e6 !important;
  color: #1e3339 !important;
}

/* Only the component's dimensions change together on phones. Placement is
   supplied separately by the original per-site header rules below. */
@media (max-width: 650px) {
  html:root body details.site-index[data-site-index-menu] {
    width: 80px !important;
    min-width: 80px !important;
  }

  html:root body details.site-index[data-site-index-menu] > summary {
    gap: 8px !important;
    padding-inline: 10px !important;
  }
}

/* Main, Games, Learning and Music shared these desktop header values.
   Hooks: Main's shared shell/home brand; Games' home class/home brand/local
   nav label; Learning and Music's accessible brand labels. No text matching. */
:is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])) details.site-index[data-site-index-menu],
:is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])) details.site-index[data-site-index-menu],
.site-header:has(> nav[aria-label="Games navigation"]) details.site-index[data-site-index-menu],
.site-header:has(> .brand[aria-label="Oddsprig Learning home"]) details.site-index[data-site-index-menu],
.site-header:has(> .brand[aria-label="Oddsprig Music home"]) details.site-index[data-site-index-menu] {
  position: relative;
}

:is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])):has(details.site-index[data-site-index-menu]),
:is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])):has(details.site-index[data-site-index-menu]),
.site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]),
.site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]),
.site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) {
  box-sizing: border-box;
  min-height: 64px;
  padding-block: 8px;
  flex-wrap: wrap;
  gap: 4px 24px;
}

:is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])) > nav:has(details.site-index[data-site-index-menu]),
:is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])) > nav:has(details.site-index[data-site-index-menu]),
.site-header:has(> nav[aria-label="Games navigation"]) > nav:has(details.site-index[data-site-index-menu]),
.site-header:has(> .brand[aria-label="Oddsprig Learning home"]) > nav:has(details.site-index[data-site-index-menu]),
.site-header:has(> .brand[aria-label="Oddsprig Music home"]) > nav:has(details.site-index[data-site-index-menu]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-left: auto;
}

.site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand,
.site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand,
.site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

:is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])) > nav:has(details.site-index[data-site-index-menu]) > a,
:is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])) > nav:has(details.site-index[data-site-index-menu]) > a,
.site-header:has(> nav[aria-label="Games navigation"]) > nav:has(details.site-index[data-site-index-menu]) > a,
.site-header:has(> .brand[aria-label="Oddsprig Learning home"]) > nav:has(details.site-index[data-site-index-menu]) > a,
.site-header:has(> .brand[aria-label="Oddsprig Music home"]) > nav:has(details.site-index[data-site-index-menu]) > a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 650px) {
  :is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])):has(details.site-index[data-site-index-menu]),
  :is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])):has(details.site-index[data-site-index-menu]),
  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]),
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]),
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) {
    position: relative;
    min-height: 56px;
    padding-block: 6px;
    align-items: center;
  }

  :is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])) > nav:has(details.site-index[data-site-index-menu]),
  :is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])) > nav:has(details.site-index[data-site-index-menu]),
  .site-header:has(> nav[aria-label="Games navigation"]) > nav:has(details.site-index[data-site-index-menu]),
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]) > nav:has(details.site-index[data-site-index-menu]),
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]) > nav:has(details.site-index[data-site-index-menu]) {
    position: static;
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    gap: 4px 12px;
  }

  /* Keep the old offsets; protect both axes from later theme insets. */
  :is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])) details.site-index[data-site-index-menu],
  :is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])) details.site-index[data-site-index-menu],
  .site-header:has(> nav[aria-label="Games navigation"]) details.site-index[data-site-index-menu],
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]) details.site-index[data-site-index-menu],
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]) details.site-index[data-site-index-menu] {
    position: absolute !important;
    top: 6px !important;
    right: 16px !important;
    bottom: auto !important;
    left: auto !important;
  }

  :is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])) details.site-index[data-site-index-menu],
  :is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])) details.site-index[data-site-index-menu] {
    right: 0 !important;
  }

  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]),
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]),
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) {
    flex-direction: row;
  }
}

/* Main's original compact brand and theme-control placement. These rules
   deliberately do not apply to Learning, Disco, Music or Games. */
@media (max-width: 650px) {
  :is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])):has(details.site-index[data-site-index-menu]) .oddsprig-theme-actions {
    position: absolute;
    top: 6px;
    right: 88px;
    margin-left: 0 !important;
  }

  :is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])):has(details.site-index[data-site-index-menu]) > .oddsprig-brand {
    min-width: 0;
    min-height: 44px;
    max-width: calc(100% - 208px);
    font-size: 22px;
    gap: 8px;
    white-space: nowrap;
  }

  :is(body.oddsprig-shared-shell .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig home"])):has(details.site-index[data-site-index-menu]) > .oddsprig-brand > .oddsprig-logo {
    width: 24px;
    height: 24px;
    margin: 0;
  }
}

/* Preserve Main's shared-shell/contact navigation gap override. */
body.oddsprig-shared-shell .oddsprig-nav-wrap > .oddsprig-main-nav:has(details.site-index[data-site-index-menu]) {
  gap: 4px 16px;
}

@media (max-width: 650px) {
  body.oddsprig-shared-shell .oddsprig-nav-wrap > .oddsprig-main-nav:has(details.site-index[data-site-index-menu]) {
    gap: 4px 12px;
  }
}

/* Games, Learning and Music used the same wider brand allowance and
   400px adjustments. Keep the no-span logo treatment (Chess) intact. */
@media (max-width: 650px) {
  :is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])):has(details.site-index[data-site-index-menu]) > .oddsprig-brand,
  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand,
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand,
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand {
    min-width: 0;
    min-height: 44px;
    max-width: calc(100% - 128px);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)),
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)),
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)) {
    position: relative;
    display: block;
    padding-left: 40px;
    line-height: 1.15;
  }

  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)) > .oddsprig-logo,
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)) > .oddsprig-logo,
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)) > .oddsprig-logo {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    margin: 0;
  }
}

@media (max-width: 400px) {
  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand,
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand,
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand {
    font-size: 24px;
    column-gap: 6px;
  }

  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand > .oddsprig-logo,
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand > .oddsprig-logo,
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand > .oddsprig-logo {
    width: 24px;
    height: 24px;
  }

  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand span,
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand span,
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand span {
    padding-inline-start: 30px;
  }

  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)),
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)),
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)) {
    padding-left: 30px;
  }

  .site-header:has(> nav[aria-label="Games navigation"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)) > .oddsprig-logo,
  .site-header:has(> .brand[aria-label="Oddsprig Learning home"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)) > .oddsprig-logo,
  .site-header:has(> .brand[aria-label="Oddsprig Music home"]):has(details.site-index[data-site-index-menu]) > .brand:has(> .oddsprig-logo):not(:has(> span)) > .oddsprig-logo {
    width: 24px;
    height: 24px;
  }

  :is(body.games-home .oddsprig-nav-wrap, .oddsprig-nav-wrap:has(> .oddsprig-brand[aria-label="Oddsprig Games home"])):has(details.site-index[data-site-index-menu]) > .oddsprig-brand {
    font-size: 25px;
  }
}

/* Games' existing local-navigation current-page cue. */
.site-header:has(> nav[aria-label="Games navigation"]) > nav[aria-label="Games navigation"] > a:is([aria-current="page"], [aria-current="true"]) {
  color: var(--accent, #c8e6a0);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* Disco's original, distinct header spacing. Its view-mode control and
   Navigation label identify the supplied page without a hostname or new HTML.
   Theme actions stay in host flow, as in the old Disco/Learning variants. */
body:has(#viewMode) > .site-header:has(> nav[aria-label="Navigation"]) details.site-index[data-site-index-menu] {
  position: relative;
}

body:has(#viewMode) > .site-header:has(> nav[aria-label="Navigation"]):has(details.site-index[data-site-index-menu]) {
  flex-wrap: wrap;
  gap: 14px 24px;
}

body:has(#viewMode) > .site-header:has(> nav[aria-label="Navigation"]) > nav:has(details.site-index[data-site-index-menu]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-left: auto;
}

@media (max-width: 650px) {
  body:has(#viewMode) > .site-header:has(> nav[aria-label="Navigation"]):has(details.site-index[data-site-index-menu]) {
    position: relative;
    align-items: flex-start;
    padding-block: 16px;
    row-gap: 12px;
  }

  body:has(#viewMode) > .site-header:has(> nav[aria-label="Navigation"]) > nav:has(details.site-index[data-site-index-menu]) {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    gap: 8px 14px;
  }

  body:has(#viewMode) > .site-header:has(> nav[aria-label="Navigation"]) details.site-index[data-site-index-menu] {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    bottom: auto !important;
    left: auto !important;
  }

  body:has(#viewMode) > .site-header:has(> nav[aria-label="Navigation"]):has(details.site-index[data-site-index-menu]) .brand {
    max-width: calc(100% - 135px);
    white-space: normal;
  }
}

@media (max-width: 400px) {
  body:has(#viewMode) > .site-header:has(> nav[aria-label="Navigation"]):has(details.site-index[data-site-index-menu]) .brand {
    font-size: 28px;
  }
}

/* All mapped phone triggers above sit at the header's right edge, so the
   panel's right:0 anchor stays on that same viewport side. max-width above
   leaves a 16px viewport gutter. Unmapped headers retain local placement. */

/* A fixed panel also stays inside short phone/landscape viewports. */
@media (max-height: 450px) {
  html:root body details.site-index[data-site-index-menu] > .site-index-links {
    position: fixed !important;
    inset: 60px 16px auto auto !important;
    max-height: calc(100vh - 76px) !important;
    max-height: calc(100dvh - 76px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:root body details.site-index[data-site-index-menu],
  html:root body details.site-index[data-site-index-menu] *,
  html:root body details.site-index[data-site-index-menu] > summary::after,
  html:root body select[data-site-index] {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  html:root body details.site-index[data-site-index-menu],
  html:root body select[data-site-index] {
    display: none !important;
  }
}
