/* Menu sections scroll within the cream panel; the surrounding scene stays put.
   Keep this geometry during the tour so returning preserves the scroll position. */
html:has(body[data-view]:not([data-view="home"])) {
  height: 100%;
  overflow: hidden;
}
body[data-view]:not([data-view="home"]) {
  --panel-top: calc(200 * var(--u, 1px));
  --panel-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
}
/* The backdrop is visual while a section is open. Keep krpano's own touch
   handlers from swallowing the tap that dismisses the panel. Restore them
   immediately in the interactive tour, including the Circus room preview. */
body[data-view]:not([data-view="home"]):not(.tour-mode) .panorama,
body[data-view]:not([data-view="home"]):not(.tour-mode) .panorama * {
  pointer-events: none !important;
}
body[data-view]:not([data-view="home"]) #content-view {
  position: fixed;
  inset: var(--panel-top) var(--gutter) auto
    calc(var(--gutter) + var(--sidebar-width) + 32px);
  width: auto;
  max-width: 1280px;
  height: auto;
  max-height: calc(100dvh - var(--panel-top) - var(--panel-bottom));
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #9dc347 transparent;
  scroll-padding-block: 20px;
  -webkit-overflow-scrolling: touch;
}
/* Programmatic region focus enables PageDown/Space. Child controls keep their
   own visible keyboard focus rings. */
#content-view:focus { outline: none; }
#content-view::-webkit-scrollbar { width: 8px; }
#content-view::-webkit-scrollbar-thumb {
  border: 2px solid var(--paper);
  border-radius: 12px;
  background: #9dc347;
}
#content-view::-webkit-scrollbar-track {
  margin-block: 24px;
  background: transparent;
}

@media (max-width: 1024px), (max-width: 1100px) and (max-height: 550px) {
  body[data-view]:not([data-view="home"]) {
    --panel-top: calc(104px + env(safe-area-inset-top, 0px));
    --panel-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  body[data-view]:not([data-view="home"]) #content-view {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
  }
  body[data-view]:not([data-view="home"]) .header-slot,
  body[data-view]:not([data-view="home"]) .header {
    height: calc(88px + env(safe-area-inset-top, 0px));
  }
  body[data-view]:not([data-view="home"]) .brand {
    top: calc(10px + env(safe-area-inset-top, 0px));
    width: 150px;
  }
  body[data-view]:not([data-view="home"]) .header-tuft {
    top: calc(100% - 48px);
    width: 82px;
    opacity: .9;
  }
  body[data-view]:not([data-view="home"]) .header .decor-image {
    width: 150px;
    opacity: .8;
  }
}
