/* Keep the legacy sidebar intact while header navigation is enabled. */
html body.atlas-header-navigation .wayfarer-shell > .wayfarer-sidebar { display: none !important; }
html body.atlas-header-navigation .wayfarer-shell > .wayfarer-main { margin-left: 0; width: 100%; }
/* Keep navigation above page filters (30), but below dialogs and the dice roller. */
html body.atlas-header-navigation > .atlas-topbar { width: 100% !important; margin-left: 0 !important; --atlas-brand-inset: clamp(24px, 5vw, 72px); padding-left: var(--atlas-brand-inset); box-sizing: border-box; z-index: 100; }
/* Float beneath the brand, keeping a small viewport inset on narrow screens. */
.atlas-navigation { position: relative; flex: 0 0 auto; }
.atlas-navigation__trigger { display: flex; align-items: center; gap: 9px; padding: 5px 10px; border: 1px solid transparent; border-radius: 9px; color: var(--wf-navy, #102a50); background: transparent; cursor: pointer; }
.atlas-navigation__trigger:hover, .atlas-navigation__trigger[aria-expanded="true"] { border-color: var(--accent-gold, #a47a2b); background: color-mix(in srgb, var(--accent-gold, #a47a2b) 9%, transparent); }
.atlas-navigation__trigger .wayfarer-brand__compass { display: block; width: 44px; height: 44px; }
.atlas-navigation__trigger .wayfarer-brand__compass [fill]:not([fill="none"]) { fill: currentColor; }
.atlas-navigation__trigger .wayfarer-brand__compass [stroke]:not([stroke="currentColor"]) { stroke: currentColor; }
.atlas-navigation__wordmark { font: 600 15px/1.05 var(--font-heading, Georgia, serif); letter-spacing: .12em; text-transform: uppercase; text-align: left; }
.atlas-navigation__chevron { font-size: 18px; }
.atlas-navigation__panel { position: fixed; inset: auto; margin: 0; transform: none; width: min(280px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 120px)); overflow: hidden; padding: 0; box-sizing: border-box; border: 1px solid #b99452; border-radius: 16px; background: linear-gradient(160deg, #0a2634, #031622); box-shadow: 0 20px 50px rgb(0 0 0 / 32%), 0 4px 12px rgb(0 0 0 / 18%); scrollbar-width: thin; scrollbar-color: #b99452 #031622; }
.atlas-navigation__panel[hidden] { display: none; }
.atlas-navigation .wayfarer-nav { max-height: inherit; overflow-y: auto; padding: 10px; box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #b99452 #031622; }
.atlas-navigation .wayfarer-nav__heading { margin: 12px 10px 6px; padding: 0; color: #d8b66b; font: 650 10px/1.5 Inter, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.atlas-navigation .sidebar-sort__section + .sidebar-sort__section { margin-top: 10px; padding-top: 6px; border-top: 1px solid rgb(216 182 107 / 25%); }
.atlas-navigation .wayfarer-nav__link { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 7px; color: #eee7d9; font: 17px/1.25 var(--font-heading, Georgia, serif); text-decoration: none; }
.atlas-navigation .wayfarer-nav__link:hover, .atlas-navigation .wayfarer-nav__link.is-active { color: #fff; background: #244c4c; }
.atlas-navigation .sidebar-sort__handle { color: #d8b66b; }
.atlas-navigation :is(button, a):focus-visible { outline: 2px solid #d8b66b; outline-offset: 2px; }
.atlas-header-navigation .atlas-topbar__form { margin-right: auto; min-width: 0; }
html[data-tabletop-search] .atlas-navigation { display: none; }
@media (max-width: 600px) {
  html body.atlas-header-navigation > .atlas-topbar { --atlas-brand-inset: 12px; gap: 10px; padding-inline: 12px; }
  .atlas-navigation__wordmark { display: none; }
  .atlas-navigation__trigger { gap: 4px; padding-inline: 4px; }
  .atlas-navigation__trigger .wayfarer-brand__compass { width: 36px; height: 36px; }
}

/* The page shell owns the rail inset; the body and header never inherit it. */
html body.atlas-header-navigation.atlas-navigation-pinned { padding-left: 0 !important; }

/* Reuse the dropdown itself as the pinned navigation rail. */
.atlas-navigation__heading-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 6px; }
.atlas-navigation .atlas-navigation__heading-row .wayfarer-nav__heading { margin-block: 0; }
.atlas-navigation__pin { display: grid; place-items: center; width: 30px; height: 30px; padding: 4px; border: 0; border-radius: 7px; background: transparent; color: #d8b66b; cursor: pointer; }
.atlas-navigation__pin:hover { background: #244c4c; color: #fff; }
.atlas-navigation__unpin-mark { display: none; }
.atlas-navigation__pin[aria-pressed="true"] .atlas-navigation__unpin-mark { display: block; }
.atlas-navigation__panel { display: flex; flex-direction: column; }
.atlas-navigation .wayfarer-nav { min-height: 0; }
.atlas-navigation__panel--pinned { z-index: 100; }
html body.atlas-header-navigation.atlas-navigation-pinned > .wayfarer-shell { margin-left: 312px; width: calc(100% - 312px); }
html[data-tabletop-popup] body.atlas-navigation-pinned > .wayfarer-shell { margin-left: 0; width: 100%; }
@media (max-width: 700px) {
  html body.atlas-header-navigation.atlas-navigation-pinned > .wayfarer-shell { margin-left: 0; width: 100%; }
}
