:root {
  --canvas-opacity: 1;
}

* {
  margin: 0;
  padding: 0;
  touch-action: none;
}

body {
  overflow: hidden;
  font-family: "Arial", sans-serif;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

canvas {
  opacity: var(--canvas-opacity);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

.hidden {
  display: none !important;
}

.spacer {
  flex-grow: 1;
}

#ui {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#ui * {
  pointer-events: auto;
}

/* branding link for third-party embeds */
#supersplatBranding {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  color: #fff;
}
#supersplatBranding > svg {
  height: 16px;
  width: auto;
  flex-shrink: 0;
  padding: 8px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.3);
}
#supersplatBranding > svg > g.stroke {
  fill: black;
  stroke: black;
  stroke-width: 2;
  stroke-linejoin: round;
  opacity: 0.4;
}
#supersplatBranding > svg > g.fill {
  fill: currentColor;
  stroke: none;
}
#supersplatBranding > span {
  font-size: 14px;
  font-weight: bold;
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.4), 1px -1px 0 rgba(0, 0, 0, 0.4), -1px 1px 0 rgba(0, 0, 0, 0.4), 1px 1px 0 rgba(0, 0, 0, 0.4);
}

/* poster */
#poster {
  display: none;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--poster-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.16);
}

/* loadingWrap */
#loadingWrap {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(11, 11, 13, 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}
#loadingWrap, #loadingWrap * {
  pointer-events: none;
}
#loadingWrap > #loadingLabel {
  font-size: 14px;
  font-weight: 600;
  color: #ececea;
}
#loadingWrap > #loadingText {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #8d8f94;
}
#loadingWrap > #loadingBar {
  width: 100%;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  overflow: hidden;
  background: linear-gradient(90deg, #35d3f2 var(--progress, 0%), rgba(255, 255, 255, 0.1) var(--progress, 0%));
}

/* controlsWrap */
#controlsWrap {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 140px);
  display: flex;
  flex-direction: column;
}
#controlsWrap.faded-in {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}
#controlsWrap.faded-out {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.5s, opacity 0.5s ease-out;
}
#controlsWrap > #timelineContainer {
  height: 30px;
  cursor: pointer;
}
#controlsWrap > #timelineContainer > #line {
  width: 100%;
  height: 50%;
  border-bottom: 4px solid #d9d9d9;
}
#controlsWrap > #timelineContainer > #handle {
  position: absolute;
  top: 16.5px;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 2px solid #d9d9d9;
  border-radius: 50%;
  background-color: #FFAF50;
}
#controlsWrap > #timelineContainer > #time {
  position: absolute;
  top: 0;
  padding: 2px 4px;
  transform: translate(-50%, -100%);
  font-size: 12px;
  border-radius: 4px;
  color: #fff;
  background-color: rgba(40, 40, 40, 0.5);
}
#controlsWrap > #buttonsContainer {
  display: flex;
  gap: 8px;
}
#controlsWrap > #buttonsContainer .buttonGroup {
  display: flex;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}
#controlsWrap > #buttonsContainer .buttonGroup:not(:has(> :not(.hidden))) {
  display: none;
}
#controlsWrap > #buttonsContainer {
  /* controlButton */
}
#controlsWrap > #buttonsContainer .controlButton {
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 0;
  cursor: pointer;
  color: #E0DCDD;
  background-color: transparent;
}
#controlsWrap > #buttonsContainer .controlButton:hover {
  color: #fff;
}
#controlsWrap > #buttonsContainer .controlButton {
  /* icon styling */
}
#controlsWrap > #buttonsContainer .controlButton > svg {
  display: block;
  margin: auto;
}
#controlsWrap > #buttonsContainer .controlButton > svg > g.stroke {
  fill: none;
  stroke: black;
  stroke-width: 2;
  stroke-linejoin: round;
  opacity: 0.4;
}
#controlsWrap > #buttonsContainer .controlButton > svg > g.fill {
  fill: currentColor;
  stroke: none;
}
#controlsWrap > #buttonsContainer .controlButton {
  /* active highlight for simple toggle buttons (e.g. voxel overlay) */
}
#controlsWrap > #buttonsContainer .controlButton.active:not(.toggle) {
  color: #A259FF;
}
#controlsWrap > #buttonsContainer .controlButton {
  /* camera toggle styling */
}
#controlsWrap > #buttonsContainer .controlButton.toggle {
  background: linear-gradient(90deg, transparent 0%, transparent 50%, #A259FF 50%, #A259FF 100%);
  background-size: 200% 100%;
  background-position: 100% 0%;
  background-repeat: no-repeat;
  transition: background-position 0.1s ease-in-out;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.left {
  border-radius: 4px 0px 0px 4px;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.left:not(.active) {
  background-position: 0% 0%;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.middle {
  border-radius: 0;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.middle:not(.active) {
  background-position: 0% 0%;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.right {
  border-radius: 0px 4px 4px 0px;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.right:not(.active) {
  background-position: 200% 0%;
}

/* settingsPanel */
#settingsPanel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 14px;
  color: #E0DCDD;
  background-color: #333;
}
#settingsPanel > .settingsRow {
  display: flex;
  gap: 4px;
  width: 100%;
}
#settingsPanel > .settingsRow > button {
  flex-grow: 1;
  height: 34px;
  padding: 0 20px;
  border: 0;
  cursor: pointer;
  color: #E0DCDD;
  background-color: #141414;
}
#settingsPanel > .settingsRow > button:hover {
  color: #fff;
}
#settingsPanel > .settingsRow > div {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  cursor: pointer;
  color: #AAA;
}
#settingsPanel > .settingsRow > div.checkMark {
  width: 16px;
}
#settingsPanel > .settingsRow > div.checkMark:not(.active) {
  color: #333;
}
#settingsPanel > .settingsRow > div:hover {
  color: #E0DCDD;
}
#settingsPanel > .divider {
  width: 100%;
  height: 1px;
  margin: 8px 0;
  background-color: #666;
}

/* infoPanel */
#infoPanel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}
#infoPanel > #infoPanelContent {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translate(-50%, 0);
  min-height: 280px;
  min-width: 320px;
  padding: 8px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  color: #E0DCDD;
  background-color: rgba(51, 51, 51, 0.8);
}
#infoPanel > #infoPanelContent > #tabs {
  display: flex;
  gap: 16px;
  padding: 8px;
  border-radius: 22px;
  background-color: #282828;
}
#infoPanel > #infoPanelContent > #tabs > .tab {
  padding: 8px;
  border-radius: 16px;
  cursor: pointer;
  flex-grow: 1;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  color: #E0DCDD;
  transition: background-color 250ms ease;
}
#infoPanel > #infoPanelContent > #tabs > .tab:hover {
  background-color: #444;
}
#infoPanel > #infoPanelContent > #tabs > .tab.active {
  background-color: #444;
}
#infoPanel > #infoPanelContent > #infoPanels {
  padding: 16px;
}
#infoPanel > #infoPanelContent > #infoPanels h1 {
  font-size: 14px;
  font-weight: bold;
  padding: 0 0 6px 0;
  color: #fff;
}
#infoPanel > #infoPanelContent > #infoPanels .control-item {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  line-height: 1.5;
}
#infoPanel > #infoPanelContent > #infoPanels .control-item > .control-action {
  text-align: left;
}
#infoPanel > #infoPanelContent > #infoPanels .control-item > .control-key {
  text-align: right;
}
#infoPanel > #infoPanelContent > #infoPanels .control-spacer {
  border-bottom: 1px dashed #666;
  margin: 10px 0;
}

#joystickBase {
  position: absolute;
  width: 112px;
  height: 112px;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  border-radius: 56px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
  touch-action: none;
}
#joystickBase > #joystick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 25px;
  background: rgba(236, 236, 234, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

#tooltip {
  display: none;
  position: absolute;
  border-radius: 4px;
  padding: 4px 4px;
  font-size: 12px;
  color: #E0DCDD;
  background-color: #282828;
}

#annotations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

#annotations * {
  pointer-events: auto;
}

/* annotationNav */
#annotationNav {
  pointer-events: none;
}
#annotationNav.faded-in {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}
#annotationNav.faded-out {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.5s, opacity 0.5s ease-out;
}
#annotationNav > button {
  pointer-events: auto;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E0DCDD;
  background-color: rgba(0, 0, 0, 0.3);
}
#annotationNav > button:hover {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.5);
}
#annotationNav > button > svg {
  display: block;
}
#annotationNav > button > svg > g.stroke {
  fill: none;
  stroke: black;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.4;
}
#annotationNav > button > svg > g.fill {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#annotationNav.desktop {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.6);
}
#annotationNav.desktop > button {
  width: 34px;
  height: 34px;
  background-color: transparent;
}
#annotationNav.desktop > button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
#annotationNav.desktop > #annotationInfo {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  white-space: nowrap;
  width: 240px;
}
#annotationNav.desktop > #annotationInfo > #annotationNavTitle {
  font-size: 14px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
}
#annotationNav.touch {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
#annotationNav.touch > #annotationInfo {
  display: none;
}
#annotationNav.touch > button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 80px;
  background-color: rgba(0, 0, 0, 0.3);
}
#annotationNav.touch > button:active {
  background-color: rgba(0, 0, 0, 0.4);
}
#annotationNav.touch > #annotationPrev {
  left: max(0px, env(safe-area-inset-left));
  border-radius: 0 6px 6px 0;
}
#annotationNav.touch > #annotationNext {
  right: max(0px, env(safe-area-inset-right));
  border-radius: 6px 0 0 6px;
}

/* sceneNav: scene.html corner tab, options rail, FOV panel, auto-rotate */
@keyframes ghostSwipe {
  0% {
    transform: translateX(-130px);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  70% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
    opacity: 0;
  }
}
@keyframes ghostTrail {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  70% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ghostPinchA {
  0%, 15% {
    transform: translate(0, 0);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  75% {
    transform: translate(-46px, 46px);
    opacity: 1;
  }
  100% {
    transform: translate(-46px, 46px);
    opacity: 0;
  }
}
@keyframes ghostPinchB {
  0%, 15% {
    transform: translate(0, 0);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  75% {
    transform: translate(46px, -46px);
    opacity: 1;
  }
  100% {
    transform: translate(46px, -46px);
    opacity: 0;
  }
}
@keyframes ghostStick {
  0%, 10% {
    transform: translate(0, 0);
  }
  35%, 60% {
    transform: translate(0, -34px);
  }
  85%, 100% {
    transform: translate(0, 0);
  }
}
@keyframes ghostWheel {
  0%, 20% {
    transform: translateY(0);
    opacity: 1;
  }
  60% {
    transform: translateY(9px);
    opacity: 0.2;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes navToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
#sceneNav {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#sceneNav button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#sceneNav svg {
  display: block;
  fill: currentColor;
  pointer-events: none;
}
#sceneNav.fly .orbit-only, #sceneNav:not(.fly) .fly-only {
  display: none !important;
}
#sceneNav {
  /* ghost-finger onboarding */
}
#sceneNav #intro {
  position: absolute;
  inset: 0;
}
#sceneNav #intro, #sceneNav #intro * {
  pointer-events: none;
}
#sceneNav #intro.touch .desktopOnly, #sceneNav #intro:not(.touch) .touchOnly {
  display: none !important;
}
#sceneNav #intro .introStep {
  position: absolute;
  inset: 0;
}
#sceneNav #intro .introStep.scrim {
  background: rgba(6, 7, 8, 0.35);
}
#sceneNav #intro .ghostAnchor {
  position: absolute;
  width: 0;
  height: 0;
}
#sceneNav #intro .ghostFinger {
  position: absolute;
  left: -30px;
  top: -30px;
  width: 60px;
  height: 60px;
  box-sizing: border-box;
  border-radius: 30px;
  background: rgba(53, 211, 242, 0.25);
  border: 2px solid #35d3f2;
  box-shadow: 0 0 0 10px rgba(53, 211, 242, 0.1);
}
#sceneNav #intro .ghostFinger.swipe {
  animation: ghostSwipe 1.8s ease-in-out infinite;
}
#sceneNav #intro .ghostFinger.pinchA, #sceneNav #intro .ghostFinger.pinchB {
  left: -26px;
  top: -26px;
  width: 52px;
  height: 52px;
  box-shadow: none;
}
#sceneNav #intro .ghostFinger.pinchA {
  animation: ghostPinchA 1.8s ease-in-out infinite;
}
#sceneNav #intro .ghostFinger.pinchB {
  animation: ghostPinchB 1.8s ease-in-out infinite;
}
#sceneNav #intro .ghostFinger.stick {
  left: -25px;
  top: -25px;
  width: 50px;
  height: 50px;
  box-shadow: none;
  animation: ghostStick 1.8s ease-in-out infinite;
}
#sceneNav #intro .ghostTrail {
  position: absolute;
  left: -130px;
  top: -2px;
  width: 130px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(53, 211, 242, 0.8));
  transform-origin: 0 50%;
  animation: ghostTrail 1.8s ease-in-out infinite;
}
#sceneNav #intro .ghostRing {
  position: absolute;
  left: -56px;
  top: -56px;
  width: 112px;
  height: 112px;
  box-sizing: border-box;
  border-radius: 56px;
  border: 1.5px dashed rgba(53, 211, 242, 0.7);
}
#sceneNav #intro .ghostMouse {
  position: absolute;
  left: -18px;
  top: -28px;
  width: 36px;
  height: 56px;
  box-sizing: border-box;
  border-radius: 18px;
  border: 2px solid #35d3f2;
  background: rgba(53, 211, 242, 0.15);
}
#sceneNav #intro .ghostMouse > .ghostWheel {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 4px;
  height: 10px;
  margin-left: -2px;
  border-radius: 2px;
  background: #35d3f2;
  animation: ghostWheel 1.2s ease-in-out infinite;
}
#sceneNav #intro .ghostKeys {
  position: absolute;
  left: -58px;
  top: -40px;
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 4px;
}
#sceneNav #intro .ghostKeys > span {
  height: 36px;
  box-sizing: border-box;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(53, 211, 242, 0.25);
  border: 1.5px solid #35d3f2;
}
#sceneNav #intro .ghostKeys > span:empty {
  visibility: hidden;
}
#sceneNav #intro .introCopy,
#sceneNav #intro .ghostLabel {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
#sceneNav #intro .introCopy {
  left: 18px;
  right: 18px;
  gap: 6px;
}
#sceneNav #intro .introCopy > .title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}
#sceneNav #intro .introCopy > .sub {
  font-size: 13px;
  color: #c9cacd;
}
#sceneNav #intro .ghostLabel {
  left: -80px;
  top: 70px;
  width: 160px;
  gap: 2px;
}
#sceneNav #intro .ghostLabel.look {
  left: -110px;
  top: 44px;
}
#sceneNav #intro .ghostLabel > .kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #35d3f2;
}
#sceneNav #intro .ghostLabel > .title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}
#sceneNav #intro #introSkip {
  position: absolute;
  right: calc(14px + env(safe-area-inset-right));
  top: calc(var(--nav-h, 0px) + 14px + env(safe-area-inset-top));
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  border: 1px solid #1c1c1f;
  background: rgba(14, 14, 16, 0.92);
  color: #c9cacd;
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
}
#sceneNav {
  /* toast: mode change, under the top nav */
}
#sceneNav #navToast {
  position: absolute;
  left: 50%;
  top: calc(var(--nav-h, 0px) + 12px + env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid #1c1c1f;
  background: rgba(14, 14, 16, 0.92);
  color: #ececea;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}
#sceneNav #navToast.show {
  animation: navToastIn 0.2s ease-out;
}
#sceneNav {
  /* corner tab: right triangle in the bottom-right corner */
}
#sceneNav #cornerTab {
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(96px + env(safe-area-inset-right));
  height: calc(96px + env(safe-area-inset-bottom));
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  transition: background-color 0.15s;
}
#sceneNav #cornerTab > svg {
  position: absolute;
  right: calc(26px + env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom));
}
#sceneNav #cornerTab:hover {
  background: rgba(255, 255, 255, 0.22);
}
#sceneNav #cornerTab.open {
  background: #ececea;
  color: #111;
}
#sceneNav {
  /* auto-rotate play / pause, just left of the tab */
}
#sceneNav #autoRotateBtn {
  position: absolute;
  right: calc(100px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 48px;
  height: 48px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 14, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #ececea;
}
#sceneNav #autoRotateBtn:hover {
  background: rgba(14, 14, 16, 0.92);
}
#sceneNav {
  /* options rail: vertical in portrait, horizontal in landscape */
}
#sceneNav #rail {
  position: absolute;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(104px + env(safe-area-inset-bottom));
  width: 64px;
  padding: 8px 0;
  box-sizing: border-box;
  border-radius: 32px;
  background: rgba(14, 14, 16, 0.92);
  border: 1px solid #1c1c1f;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
@media (orientation: landscape) {
  #sceneNav #rail {
    right: calc(160px + env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    height: 64px;
    padding: 0 8px;
    flex-direction: row;
  }
}
#sceneNav .railButton {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #c9cacd;
  touch-action: none;
}
#sceneNav .railButton:hover {
  background: rgba(255, 255, 255, 0.06);
}
#sceneNav .railButton:active, #sceneNav .railButton.pressed {
  background: rgba(255, 255, 255, 0.12);
}
#sceneNav .railButton.active {
  background: #35d3f2;
  color: #fff;
}
#sceneNav .railButton > span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #8d8f94;
}
#sceneNav .railButton > span.value {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: #ececea;
}
#sceneNav {
  /* view cube */
}
#sceneNav #viewCube {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  perspective: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#sceneNav #cube {
  width: 28px;
  height: 28px;
  position: relative;
  transform-style: preserve-3d;
}
#sceneNav #cube > .face {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ececea;
  cursor: pointer;
}
#sceneNav #cube > .face.front {
  background: #3a3c41;
  transform: translateZ(14px);
}
#sceneNav #cube > .face.back {
  background: #3a3c41;
  transform: rotateY(180deg) translateZ(14px);
}
#sceneNav #cube > .face.right {
  background: #2e3034;
  transform: rotateY(90deg) translateZ(14px);
}
#sceneNav #cube > .face.left {
  background: #2e3034;
  transform: rotateY(-90deg) translateZ(14px);
}
#sceneNav #cube > .face.top {
  background: #35d3f2;
  color: #fff;
  transform: rotateX(90deg) translateZ(14px);
}
#sceneNav #cube > .face.bottom {
  background: #26282b;
  transform: rotateX(-90deg) translateZ(14px);
}
#sceneNav {
  /* field of view panel, replaces the rail while open */
}
#sceneNav #fovPanel {
  position: absolute;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(104px + env(safe-area-inset-bottom));
  width: min(380px, 100% - 24px);
  box-sizing: border-box;
  padding: 12px 16px 16px;
  border-radius: 22px;
  background: rgba(14, 14, 16, 0.96);
  border: 1px solid #1c1c1f;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #ececea;
}
@media (orientation: landscape) {
  #sceneNav #fovPanel {
    right: calc(160px + env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: min(380px, 100% - 172px);
  }
}
#sceneNav #fovPanel .fovHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#sceneNav #fovPanel #fovBack {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  margin-left: -12px;
  padding: 0 8px 0 4px;
  font-size: 15px;
  font-weight: 600;
}
#sceneNav #fovPanel #fovBack > svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#sceneNav #fovPanel #fovValue {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #35d3f2;
}
#sceneNav #fovPanel #fovChips {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
#sceneNav #fovPanel #fovChips > button {
  height: 44px;
  border-radius: 12px;
  background: #1f1f23;
  color: #ececea;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
#sceneNav #fovPanel #fovChips > button.active {
  background: #35d3f2;
  color: #fff;
  font-weight: 600;
}
#sceneNav #fovPanel #fovTrack {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
#sceneNav #fovPanel #fovTrack > #fovLine {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
#sceneNav #fovPanel #fovTrack > #fovFill {
  position: absolute;
  left: 0;
  height: 4px;
  border-radius: 2px;
  background: #35d3f2;
  pointer-events: none;
}
#sceneNav #fovPanel #fovTrack > #fovThumb {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 14px;
  background: #ececea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
#sceneNav #fovPanel .fovCaptions {
  display: flex;
  justify-content: space-between;
  margin-top: -8px;
  font-size: 10px;
  font-weight: 500;
  color: #8d8f94;
}

#sceneNav.hero-controls > :not(#rail) {
  display: none !important;
}
#sceneNav.hero-controls #rail {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  bottom: auto;
  width: auto;
  height: 64px;
  padding: 0 8px;
  flex-direction: row;
  pointer-events: auto;
}
#sceneNav.hero-controls #rail > :not(#viewCube):not(#panBtn):not(#fitBtn) {
  display: none !important;
}
#sceneNav.hero-controls #panBtn, #sceneNav.hero-controls #fitBtn {
  width: 68px;
}
#sceneNav.hero-controls .railButton > span {
  font-size: 9px;
  letter-spacing: 0;
}
#sceneNav.hero-controls .face:focus-visible, #sceneNav.hero-controls .railButton:focus-visible {
  outline: 2px solid #35d3f2;
}

#sceneNav #viewCube, #sceneNav #panBtn {
  touch-action: none;
  cursor: grab;
}
#sceneNav #viewCube.dragging, #sceneNav #viewCube.dragging .face, #sceneNav #panBtn.dragging, #sceneNav #panBtn.dragging .face {
  cursor: grabbing;
}