.hero-menu {
  position: absolute;
  top: max(.5rem, calc(env(titlebar-area-height, 0px) + .5rem), env(safe-area-inset-top, 0px));
  right: max(clamp(.75rem, 2.5vw, 2.5rem), env(safe-area-inset-right, 0px));
  z-index: 8;
  display: flex;
  align-items: center;
  gap: clamp(.25rem, 1vw, 1rem);
  width: max-content;
  max-width: calc(100% - 2rem);
  box-sizing: border-box;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: 500 .9375rem/1.25 system-ui, sans-serif;
  text-shadow: 0 1px 2px #000, 0 0 5px rgb(0 0 0 / .8);
  -webkit-app-region: no-drag;
}
.hero-menu a, .hero-menu summary, .hero-menu button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .45rem .6rem;
  border: 0;
  border-radius: .65rem;
  color: inherit;
  background: transparent;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.hero-menu .presentation-control { flex: none; justify-content: center; width: 44px; padding: 0; }
.hero-menu .presentation-control svg { filter: drop-shadow(0 1px 2px #000); }
.hero-menu .presentation-control[data-fullscreen] { font-size: 1.45rem; }
.hero-menu .hero-menu-brand, .hero-menu .brand { font-weight: 700; letter-spacing: .02em; }
.hero-menu .brand { gap: .4rem; }
.hero-menu .brand img { width: 40px; height: auto; }
.hero-menu .brand small { font: inherit; letter-spacing: inherit; text-transform: none; }
.hero-menu a:hover, .hero-menu summary:hover, .hero-menu button:hover { text-decoration: underline; }
.hero-menu-panel a:hover { background: rgb(255 255 255 / .16); }
.hero-menu :is(a, summary, button):focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.hero-menu-primary { display: flex; }
.hero-menu details { padding: 0; margin: 0; border: 0; }
.hero-menu summary { list-style: none; }
.hero-menu summary::-webkit-details-marker { display: none; }
.hero-menu summary::after { content: ""; width: .4rem; height: .4rem; margin: -.18rem 0 0 .5rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.hero-menu details[open] summary::after { transform: rotate(225deg); margin-top: .18rem; }
.hero-menu-panel {
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  max-height: min(64vh, 30rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .45rem;
  border: 1px solid rgb(255 255 255 / .28);
  border-radius: 1rem;
  background: #17272a;
  text-shadow: none;
  box-shadow: 0 8px 24px #07141540;
}
.hero-menu-chapters { border-top: 1px solid rgb(255 255 255 / .22); margin-top: .25rem; padding-top: .25rem; }
.hero-menu-panel a { display: flex; white-space: normal; }
.hero-menu .mobile-only, .hero-menu-compact, .hero-menu [hidden] { display: none; }
@media (max-width: 60rem) {
  .hero-menu .mobile-only, .hero-menu-compact { display: block; }
  .hero-menu-primary { display: none; }
}
@media (max-width: 24rem) {
  .hero-menu { top: max(3.25rem, calc(env(titlebar-area-height, 0px) + .5rem), env(safe-area-inset-top, 0px)); }
}
@media (max-width: 360px) {
  .hero-menu { gap: 0; padding-inline: .25rem; max-width: calc(100% - 1rem); }
  .hero-menu .hero-menu-brand, .hero-menu summary { padding-inline: .35rem; }
}
@media print { .hero-menu { display: none; } }
