* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -ms-text-size-adjust: none;
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -ms-content-zooming: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

html, body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  background-color: #000;
  color: #fff;
}

a, a:hover, a:active, a:visited {
  text-decoration: none;
  color: inherit;
}

#pano {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#titleBar {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 40px;
  height: 40px;
  text-align: center;
  background-color: rgb(58,68,84);
  background-color: rgba(58,68,84,0.8);
}

.mobile #titleBar {
  height: 50px;
  right: 50px;
}

/* If there is a fullscreen button the title bar must make space for it */
body.fullscreen-enabled #titleBar {
  right: 80px;
}

body.fullscreen-enabled.mobile #titleBar {
  right: 100px;
}

/* If there are multiple scenes the title bar must make space for the scene list toggle */
body.multiple-scenes #titleBar {
  left: 40px;
}

body.multiple-scenes.mobile #titleBar {
  left: 50px;
}

#titleBar .sceneName {
  display: none;
}

#fullscreenToggle {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 5px;
  background-color: rgb(103,115,131);
  background-color: rgba(103,115,131,0.8);
}

.mobile #fullscreenToggle {
  width: 50px;
  height: 50px;
}

body.fullscreen-enabled #fullscreenToggle {
  display: block;
}

#fullscreenToggle .icon {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
}

.mobile #fullscreenToggle .icon {
  top: 10px;
  right: 10px;
}

#fullscreenToggle .icon.on {
  display: none;
}

#fullscreenToggle .icon.off {
  display: block;
}

#fullscreenToggle.enabled .icon.on {
  display: block;
}

#fullscreenToggle.enabled .icon.off {
  display: none;
}

#autorotateToggle {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 5px;
  background-color: rgb(103,115,131);
  background-color: rgba(103,115,131,0.8);
}

.mobile #autorotateToggle {
  width: 50px;
  height: 50px;
}

/* If there is a fullscreen button, autorotate must placed a bit to the left */
body.fullscreen-enabled #autorotateToggle {
  right: 40px;
}

body.fullscreen-enabled.mobile #autorotateToggle {
  right: 50px;
}

#autorotateToggle .icon {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
}

.mobile #autorotateToggle .icon {
  top: 10px;
  right: 10px;
}

#autorotateToggle .icon.on {
  display: none;
}

#autorotateToggle .icon.off {
  display: block;
}

#autorotateToggle.enabled .icon.on {
  display: block;
}

#autorotateToggle.enabled .icon.off {
  display: none;
}

#sceneListToggle {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  padding: 5px;
  background-color: rgb(103,115,131);
  background-color: rgba(103,115,131,0.8);
  z-index: 4;
}

#sceneListToggle.enabled {
  background-color: transparent;
}

.mobile #sceneListToggle {
  width: 50px;
  height: 50px;
}

#sceneListToggle .text {
  position: absolute;
  top: 5px;
  left: 15px;
  width: 100%;
  line-height: 30px;
}

#sceneListToggle .icon {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
}

.mobile #sceneListToggle .icon {
  top: 10px;
  right: 10px;
}

#sceneListToggle .icon.on {
  display: none;
}

#sceneListToggle .icon.off {
  display: block;
}

#sceneListToggle.enabled .icon.on {
  display: block;
}

#sceneListToggle.enabled .icon.off {
  display: none;
}

#rightPanelToggle {
  --map-box-width: min(34vw, 520px);
  --map-box-height: min(38vh, 390px);
  --title-bar-height: 40px;
  position: fixed;
  top: calc(var(--title-bar-height) + 12px + var(--map-box-height) / 2);
  right: 0;
  width: 50px;
  height: 50px;
  padding: 0;
  background-color: transparent;
  z-index: 1003;
  pointer-events: auto;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}

.mobile #rightPanelToggle {
  --map-box-width: min(78vw, 420px);
  --map-box-height: min(36vh, 340px);
  --title-bar-height: 50px;
  width: 50px;
  height: 50px;
}

#rightPanelToggle .icon {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
}

#rightPanelToggle.enabled {
  right: 4px;
  width: 40px;
  height: 40px;
  background-color: rgba(103, 115, 131, 0.8);
}

#rightPanelToggle.enabled .icon {
  top: 2px;
  right: 2px;
  width: 36px;
  height: 36px;
}

.mobile #rightPanelToggle .icon {
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
}

.mobile #rightPanelToggle.enabled .icon {
  top: 3px;
  right: 3px;
  width: 44px;
  height: 44px;
}

#rightPanelToggle .icon.on {
  display: none;
}

#rightPanelToggle .icon.off {
  display: block;
}

#rightPanelToggle.enabled .icon.on {
  display: block;
}

#rightPanelToggle.enabled .icon.off {
  display: none;
}

/* Original map panel size (right sidebar)
#rightPanel {
  --right-panel-width: 20%;
  --title-bar-height: 40px;
  position: absolute;
  top: var(--title-bar-height);
  right: calc(-1 * var(--right-panel-width));
  width: var(--right-panel-width);
  height: calc(100% - var(--title-bar-height));
  padding-top: 0;
  margin-right: 0;
  overflow: hidden;
  background-color: rgb(58,68,84);
  background-color: rgba(58,68,84,0.8);
  -webkit-transition: margin-right 0.5s ease-in-out;
  transition: margin-right 0.5s ease-in-out;
  z-index: 1001;
}

#rightPanel.enabled {
  margin-right: var(--right-panel-width);
}

.mobile #rightPanel {
  --title-bar-height: 50px;
  top: var(--title-bar-height);
  right: -100%;
  width: 100%;
  height: calc(100% - var(--title-bar-height));
  padding-top: 0;
}

.mobile #rightPanel.enabled {
  margin-right: 100%;
}
*/

#rightPanel {
  --map-box-width: min(40vw, 600px);
  --map-box-height: min(48vh, 480px);
  --title-bar-height: 40px;
  position: fixed;
  top: calc(var(--title-bar-height) + 12px);
  left: auto;
  right: 4px;
  width: var(--map-box-width);
  height: var(--map-box-height);
  padding: 0;
  overflow: visible;
  background-color: transparent;
  z-index: 1001;
  pointer-events: none;
}

#rightPanel.enabled {
  pointer-events: none;
}

/* Hide the compact map while the expand modal is open so floor tabs are not
   double-composited (looks like bold/broken text after expand → back). */
body.map-expand-open #rightPanel .rightPanelContent {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  -webkit-transition: none !important;
  transition: none !important;
}

#rightPanel .rightPanelContent {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 10px;
  overflow: hidden;
  border-radius: 18px;
  /* Opaque panel — backdrop-filter over the panorama + heavy SVG made floor-tab
     text look bold/smeared after expand → collapse → floor switch. */
  background: linear-gradient(180deg, #fcf8f2 0%, #f4ede3 100%);
  box-shadow: 0 22px 48px rgba(28, 22, 16, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-transform: translateX(28px) scale(0.96);
  transform: translateX(28px) scale(0.96);
  -webkit-transition: opacity 0.38s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.45s;
  transition: opacity 0.38s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.45s;
}

#rightPanel.enabled .rightPanelContent {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  -webkit-transform: translateX(0) scale(1);
  transform: translateX(0) scale(1);
  -webkit-transition: opacity 0.38s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
  transition: opacity 0.38s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

#rightPanel .rightPanelContent img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

#rightPanelCustomViewport {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.5);
  touch-action: none;
  pointer-events: auto;
}

.map-zoom-control {
  position: absolute;
  top: 42%;
  right: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 44px;
  padding: 8px 0 10px;
  border-radius: 22px;
  background-color: rgba(36, 42, 51, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(16, 18, 22, 0.28);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  pointer-events: auto;
}

.mobile .map-zoom-control {
  right: 10px;
  width: 48px;
  border-radius: 24px;
}

.map-zoom-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile .map-zoom-button {
  width: 36px;
  height: 36px;
}

.map-zoom-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.no-touch .map-zoom-button:hover,
.map-zoom-button:focus {
  background-color: rgba(103, 115, 131, 0.7);
  outline: none;
}

.map-zoom-button:active {
  background-color: rgba(103, 115, 131, 0.95);
}

.map-zoom-track {
  position: relative;
  width: 4px;
  height: 96px;
  margin: 6px 0;
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
}

.mobile .map-zoom-track {
  height: 104px;
  width: 5px;
}

.map-zoom-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background-color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  pointer-events: none;
}

.map-zoom-thumb {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  background-color: #fff;
  border: 2px solid rgba(36, 42, 51, 0.95);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.mobile .map-zoom-thumb {
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
}

.map-zoom-percent {
  margin-top: 4px;
  min-height: 14px;
  color: rgba(255, 255, 255, 0.92);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  user-select: none;
  pointer-events: none;
}

.mobile .map-zoom-percent {
  font-size: 11px;
  min-height: 15px;
}

.map-expand-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background-color: rgba(36, 42, 51, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(16, 18, 22, 0.24);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  -webkit-transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.map-expand-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.no-touch .map-expand-button:hover {
  background-color: rgba(48, 56, 68, 0.96);
  box-shadow: 0 10px 24px rgba(16, 18, 22, 0.3);
}

.map-expand-button:active {
  transform: scale(0.96);
}

.map-collapse-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background-color: rgba(36, 42, 51, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(16, 18, 22, 0.24);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  -webkit-transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.map-collapse-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.no-touch .map-collapse-button:hover {
  background-color: rgba(48, 56, 68, 0.96);
  box-shadow: 0 10px 24px rgba(16, 18, 22, 0.3);
}

.map-collapse-button:active {
  transform: scale(0.96);
}

.map-expand-modal {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 4px 16px 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Instant show/hide — fading over the right panel double-painted floor tabs. */
  -webkit-transition: none;
  transition: none;
}

/* Class display:flex otherwise beats the UA [hidden] rule and keeps expand
   floor-tabs in the layout tree after collapse. */
.map-expand-modal[hidden] {
  display: none !important;
}

.map-expand-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  -webkit-transition: none;
  transition: none;
}

.map-expand-backdrop {
  display: none;
}

.map-expand-dialog {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(94vw, 1120px);
  height: min(88vh, 860px);
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fcf8f2 0%, #f4ede3 100%);
  box-shadow: 0 28px 64px rgba(28, 22, 16, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: auto;
  /* No scale transform — fitting while scale(0.96) left the modal chrome/map misaligned. */
  -webkit-transform: none;
  transform: none;
}

.map-expand-modal.open .map-expand-dialog {
  -webkit-transform: none;
  transform: none;
}

.map-expand-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background-color: rgba(36, 42, 51, 0.92);
  box-shadow: 0 6px 18px rgba(16, 18, 22, 0.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.map-panel-close {
  top: 10px;
  right: 10px;
  z-index: 7;
}

.map-expand-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

.map-expand-dialog .map-floor-switch {
  margin-right: 44px;
}

.map-expand-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background-color: rgba(255, 255, 255, 0.5);
  touch-action: none;
}

.map-expand-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.map-expand-layer.dragging {
  cursor: grabbing;
}

.mobile .map-expand-modal {
  padding: 12px 4px 12px 12px;
}

.mobile .map-expand-dialog {
  width: min(96vw, 1120px);
  height: min(90vh, 860px);
  padding: 12px;
  border-radius: 16px;
}

body.map-expand-open {
  overflow: visible;
}

.map-floor-switch {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  margin-right: 44px;
  padding: 4px;
  border-radius: 999px;
  /* Opaque + isolated so tab glyphs are not composited through panel/SVG layers. */
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(36, 42, 51, 0.08);
  pointer-events: auto;
  isolation: isolate;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.map-floor-switch-btn {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 500;
  font-synthesis: none;
  line-height: 1.2;
  white-space: nowrap;
  color: rgba(36, 42, 51, 0.72);
  background: transparent;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-shadow: none;
  -webkit-transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.map-floor-switch-btn.active {
  color: #fff;
  font-weight: 600;
  background: rgba(36, 42, 51, 0.92);
  box-shadow: 0 4px 12px rgba(36, 42, 51, 0.18);
}

.no-touch .map-floor-switch-btn:hover:not(.active) {
  color: rgba(36, 42, 51, 0.92);
  background: rgba(36, 42, 51, 0.06);
}

.mobile .map-floor-switch-btn {
  font-size: 11px;
  padding: 8px 8px;
}

#rightPanelCustomMapLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

#rightPanelCustomMapLayer.dragging {
  cursor: grabbing;
}

#rightPanelCustomMap,
#mapExpandMap {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

#rightPanelCustomMap svg,
#mapExpandMap svg {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
}

#rightPanelCustomMap svg.map-waypoint-overlay,
#mapExpandMap svg.map-waypoint-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

#rightPanelCustomMap .map-waypoint-source,
#mapExpandMap .map-waypoint-source {
  opacity: 0;
  pointer-events: none;
}

#rightPanelCustomMap .map-waypoint,
#mapExpandMap .map-waypoint {
  pointer-events: none;
  fill: #2d4e9d;
  stroke: rgba(45, 78, 157, 0.35);
  stroke-width: 10px;
  paint-order: stroke fill;
  /* Stroke glow only — CSS filter/drop-shadow corrupts heavy floor-plan SVGs. */
  animation: none;
}

#rightPanelCustomMap .map-waypoint-hit,
#mapExpandMap .map-waypoint-hit {
  pointer-events: all;
  cursor: default;
}

#rightPanelCustomMap .map-waypoint-hit.map-waypoint-clickable,
#mapExpandMap .map-waypoint-hit.map-waypoint-clickable {
  cursor: pointer;
}

body.admin-pins-active #rightPanelCustomMap .map-waypoint-hit,
body.admin-pins-active #mapExpandMap .map-waypoint-hit {
  cursor: pointer;
}

body.admin-pins-active #rightPanelCustomMap .map-waypoint.map-waypoint-unassigned,
body.admin-pins-active #mapExpandMap .map-waypoint.map-waypoint-unassigned {
  stroke: rgba(45, 212, 191, 0.9);
  stroke-width: 8px;
}

#rightPanelCustomMap .map-waypoint.map-waypoint-assigning,
#mapExpandMap .map-waypoint.map-waypoint-assigning {
  stroke: rgba(251, 191, 36, 0.95);
  stroke-width: 10px;
}

#rightPanelCustomMap .map-waypoint.map-waypoint-hover,
#mapExpandMap .map-waypoint.map-waypoint-hover {
  fill: #243f82;
  stroke: rgba(45, 78, 157, 0.45);
  stroke-width: 12px;
}

#rightPanelCustomMap .map-waypoint.map-waypoint-active,
#mapExpandMap .map-waypoint.map-waypoint-active {
  fill: #16a34a;
  stroke: rgba(22, 163, 74, 0.4);
  stroke-width: 12px;
}

/* One-shot arrive pulse only — infinite waypoint animations previously
   corrupted nearby UI over heavy floor-plan SVGs in Chromium. */
@keyframes map-waypoint-arrive-glow {
  0%, 100% {
    stroke: rgba(22, 163, 74, 0.35);
    stroke-width: 12px;
  }
  50% {
    stroke: rgba(34, 197, 94, 0.75);
    stroke-width: 22px;
  }
}

#rightPanelCustomMap .map-waypoint.map-waypoint-active.map-waypoint-arrive,
#mapExpandMap .map-waypoint.map-waypoint-active.map-waypoint-arrive {
  animation: map-waypoint-arrive-glow 1.1s ease-in-out 4;
}

.map-pins {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  width: 50px;
  height: 50px;
  -webkit-transform: translate(-50%, -100%);
  transform: translate(-50%, -100%);
  pointer-events: auto;
}

.map-pin-clickable {
  cursor: pointer;
}

.map-pin-label {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 100%;
  margin-bottom: 4px;
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  color: #fff;
  background-color: rgb(58,68,84);
  background-color: rgba(58,68,84,0.92);
  border-radius: 4px;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  pointer-events: none;
}

.map-pin-active .map-pin-label {
  display: block;
}

.map-pin img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.mobile #rightPanel {
  --map-box-width: min(86vw, 460px);
  --map-box-height: min(42vh, 400px);
  --title-bar-height: 50px;
  top: calc(var(--title-bar-height) + 10px);
  left: auto;
  right: 4px;
}

.mobile #rightPanel .rightPanelContent {
  padding: 10px;
  border-radius: 16px;
}

@media (prefers-reduced-motion: reduce) {
  #rightPanel .rightPanelContent,
  #rightPanel.enabled .rightPanelContent,
  #rightPanelToggle,
  #rightPanelToggle .icon {
    -webkit-transition: none;
    transition: none;
  }

  #rightPanel .rightPanelContent {
    -webkit-transform: none;
    transform: none;
  }
}

:root {
  --scene-list-width: 300px;
  --scene-list-bg: rgba(18, 18, 18, 0.72);
}

#sceneList {
  position: absolute;
  top: 0;
  left: calc(-1 * var(--scene-list-width));
  padding-top: 40px;
  width: var(--scene-list-width);
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--scene-list-bg);
  border: 0;
  outline: none;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  z-index: 3;
  -webkit-transition: left 0.5s ease-in-out;
  transition: left 0.5s ease-in-out;
}

.lang-switcher {
  position: absolute;
  top: 6px;
  right: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: auto;
}

.mobile .lang-switcher {
  top: 10px;
  right: 12px;
}

.lang-switcher-btn {
  min-width: 34px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  -webkit-transition: background-color 0.18s ease, color 0.18s ease;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.lang-switcher-btn.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.no-touch .lang-switcher-btn:hover:not(.is-active) {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
}

.scene-list-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 4px;
}

.scene-list-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #fff;
  flex: 0 0 auto;
}

.scene-list-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.scene-list-search {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 12px 10px;
}

.scene-list-search input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  cursor: text;
  -webkit-appearance: none;
  appearance: none;
  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.scene-list-search input::placeholder {
  color: #8a8a8a;
}

.scene-list-search-icon {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 16px;
  height: 16px;
  color: #9a9a9a;
  pointer-events: none;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}

#sceneList .scenes {
  flex: 1 1 auto;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 4px 0 16px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background-color: transparent;
}

#sceneList .scenes::-webkit-scrollbar {
  display: none;
}

#sceneList .scene-group {
  list-style: none;
}

#sceneList .scene-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.no-touch #sceneList .scene-group-header:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

#sceneList .scene-group + .scene-group .scene-group-header {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

#sceneList .scene-group-chevron {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  color: #fff;
}

#sceneList .scene-group-chevron svg {
  display: block;
  width: 12px;
  height: 12px;
  -webkit-transition: -webkit-transform 0.2s ease;
  transition: transform 0.2s ease;
}

#sceneList .scene-group.expanded .scene-group-chevron svg {
  -webkit-transform: rotate(180deg);
  transform: rotate(180deg);
}

#sceneList .scene-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

#sceneList .scene-group.expanded .scene-group-items {
  display: block;
}

#sceneList .scene-group-items > li {
  list-style: none;
}

.mobile #sceneList {
  --mobile-scene-list-width: min(50vw, 320px);
  width: var(--mobile-scene-list-width);
  height: 100%;
  max-height: 100%;
  left: calc(-1 * var(--mobile-scene-list-width));
  padding-top: 50px;
  margin: 0;
  pointer-events: none;
  visibility: hidden;
  -webkit-transition: left 0.5s ease-in-out, visibility 0s linear 0.5s;
  transition: left 0.5s ease-in-out, visibility 0s linear 0.5s;
}

.mobile #sceneList.enabled {
  left: 0;
  margin: 0;
  pointer-events: auto;
  visibility: visible;
  -webkit-transition: left 0.5s ease-in-out, visibility 0s linear 0s;
  transition: left 0.5s ease-in-out, visibility 0s linear 0s;
}

.mobile #sceneList .scenes {
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: transparent;
}

#sceneList.enabled {
  left: 0;
  margin: 0;
}

#sceneList .scene {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 0;
}

#sceneList .scene-group-items .scene .text {
  padding-left: 28px;
}

#sceneList .scene .text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  width: 100%;
  height: auto;
  padding: 8px 12px 8px 10px;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  color: #f2f2f2;
}

#sceneList .scene .text.scene-text-3-lines {
  padding-top: 14px;
  padding-bottom: 14px;
  line-height: 1.5;
}

.mobile #sceneList .scene .text {
  padding-top: 10px;
  padding-bottom: 10px;
}

.mobile #sceneList .scene .text.scene-text-3-lines {
  padding-top: 16px;
  padding-bottom: 16px;
}

.no-touch #sceneList .scene:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#sceneList .scene.current {
  background-color: rgba(255, 255, 255, 0.12);
}

#sceneList .scene-hidden,
#sceneList li.scene-hidden {
  display: none;
}

/* Hide scene list when only a single scene exists */
body.single-scene #sceneList, body.single-scene #sceneListToggle {
  display: none;
}

/* Link hotspot */

.link-hotspot {
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  opacity: 0.9;
  -webkit-transition: opacity 0.2s;
  transition: opacity 0.2s;
}

.no-touch .link-hotspot:hover {
  opacity: 1;
}

.mobile .link-hotspot {
  width: 70px;
  height: 70px;
}

.link-hotspot-icon {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.link-hotspot-tooltip {
  position: absolute;
  left: 100%;
  top: 14px; /* ( 60 - (16 + 2*8) ) / 2 */

  margin-left: 3px;

  font-size: 16px;

  max-width: 300px;

  padding: 8px 10px;

  border-radius: 5px;

  background-color: rgb(58,68,84);
  background-color: rgba(58,68,84,0.8);

  color: #fff;

  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;

  cursor: pointer;

  opacity: 0;

  -ms-transform: translateX(-8px);
  -webkit-transform: translateX(-8px);
  transform: translateX(-8px);

  -webkit-transition: -ms-transform 0.3s,
                      -webkit-transform 0.3s,
                      transform 0.3s,
                      opacity 0.3s;
  transition: -ms-transform 0.3s,
              -webkit-transform 0.3s,
              transform 0.3s,
              opacity 0.3s;
}

.mobile .link-hotspot {
  top: 19px; /* ( 70 - (16 + 2*8) ) / 2 */
}

.no-touch .link-hotspot:hover .link-hotspot-tooltip {
  opacity: 1;
  -ms-transform: translateX(0);
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

/* Prevent tooltip from triggering */
.link-hotspot-tooltip {
  pointer-events: none;
}
.no-touch .link-hotspot:hover .link-hotspot-tooltip {
  pointer-events: all;
}

/* Fallback mode without pointer-events (IE8-10) */
.tooltip-fallback .link-hotspot-tooltip {
  display: none;
}
.no-touch .tooltip-fallback .link-hotspot:hover .link-hotspot-tooltip {
  display: block;
}

/* Info hotspot */

.info-hotspot {
  line-height: 1.2em;
  opacity: 0.9;
  -webkit-transition: opacity 0.2s 0.2s;
  transition: opacity 0.2s 0.2s;
}

.no-touch .info-hotspot:hover {
  opacity: 1;
  -webkit-transition: opacity 0.2s;
  transition: opacity 0.2s;
}

.info-hotspot.visible {
  opacity: 1;
}

/* Desktop: circular info trigger only (no expanding header bar) */
.info-hotspot .info-hotspot-header {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background-color: rgb(103,115,131);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.mobile .info-hotspot .info-hotspot-header {
  width: 50px;
  height: 50px;
  border-radius: 25px;
}

.info-hotspot .info-hotspot-icon-wrapper {
  width: 40px;
  height: 40px;
}

.mobile .info-hotspot .info-hotspot-icon-wrapper {
  width: 50px;
  height: 50px;
}

.info-hotspot .info-hotspot-icon {
  width: 90%;
  height: 90%;
  margin: 5%;
}

/* Desktop side card — opens to the right of the marker */
.desktop .info-hotspot-card {
  --info-card-width: 440px;
  --info-card-height: 220px;
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  width: var(--info-card-width);
  height: var(--info-card-height);
  display: flex;
  flex-direction: row;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  background: #cfcfcf;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-transform: translate(8px, -50%);
  transform: translate(8px, -50%);
  -webkit-transition: opacity 0.25s ease, visibility 0s 0.25s, -webkit-transform 0.25s ease;
  transition: opacity 0.25s ease, visibility 0s 0.25s, transform 0.25s ease;
  z-index: 1;
}

.desktop .info-hotspot.visible .info-hotspot-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  -webkit-transform: translate(0, -50%);
  transform: translate(0, -50%);
  -webkit-transition: opacity 0.25s ease, visibility 0s 0s, -webkit-transform 0.25s ease;
  transition: opacity 0.25s ease, visibility 0s 0s, transform 0.25s ease;
}

.desktop .info-hotspot-media {
  flex: 1 1 50%;
  width: 50%;
  min-width: 0;
  background: #4a4a4a;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.desktop .info-hotspot-media .info-modal-figure,
.desktop .info-hotspot-media figure {
  margin: 0;
  width: 100%;
  height: 100%;
}

.desktop .info-hotspot-media > *:not(:first-child) {
  display: none;
}

.desktop .info-hotspot-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.desktop .info-hotspot-panel {
  flex: 1 1 50%;
  width: 50%;
  min-width: 0;
  position: relative;
  background: #d4d4d4;
  color: #1a1a1a;
  padding: 28px 32px 16px 18px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.desktop .info-hotspot-panel .info-hotspot-close-wrapper {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  background: transparent;
  border-radius: 0;
  visibility: visible;
  -ms-transform: none;
  -webkit-transform: none;
  transform: none;
  z-index: 2;
}

.desktop .info-hotspot-panel .info-hotspot-close-icon {
  width: 100%;
  height: 100%;
  margin: 0;
  /* SVG strokes are white; darken for light panel */
  filter: brightness(0);
  opacity: 0.75;
}

.desktop .info-hotspot-panel .info-hotspot-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  color: #111;
  margin: 0 0 10px;
  padding-right: 8px;
  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.desktop .info-hotspot-panel .info-hotspot-body {
  flex: 1 1 auto;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  color: #222;
  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.desktop .info-hotspot-panel .info-hotspot-body p {
  margin: 0 0 8px;
}

.desktop .info-hotspot-panel .info-hotspot-body p:last-child {
  margin-bottom: 0;
}

/* Hide desktop card chrome on mobile; mobile uses fullscreen modal */
.mobile .info-hotspot-card {
  display: none;
}

/* Info hotspot modal (mobile) */

.desktop .info-hotspot-modal {
  display: none;
}

.info-hotspot-modal {
  top: 0;
  left: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 11000 !important;
  background-color: rgba(0,0,0,.5);
  line-height: 1.2em;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.2s ease-in-out 0.5s,
                      visibility 0s 0.7s;
  transition: opacity 0.2s ease-in-out 0.5s,
              visibility 0s 0.7s;
}

.info-hotspot-modal.visible {
  opacity: 1;
  visibility: visible;
  -webkit-transition: opacity 0.2s ease-in-out,
                      visibility 0s 0s;
  transition: opacity 0.2s ease-in-out,
              visibility 0s 0s;
}

.info-hotspot-modal .info-hotspot-header {
  position: absolute;
  top: 60px;
  left: 10px;
  right: 10px;
  width: auto;
  height: 50px;
  background-color: rgb(103,115,131);
  background-color: rgba(103,115,131,0.8);
  opacity: 0;
  -webkit-transition: opacity 0.3s ease-in-out 0.2s;
  transition: opacity 0.3s ease-in-out 0.2s;
}

.info-hotspot-modal.visible .info-hotspot-header {
  opacity: 1;
  -webkit-transition: opacity 0.3s ease-in-out 0.2s;
  transition: opacity 0.3s ease-in-out 0.2s;
}

.info-hotspot-modal .info-hotspot-icon-wrapper {
  width: 50px;
  height: 50px;
}

.info-hotspot-modal .info-hotspot-icon {
  width: 90%;
  height: 90%;
  margin: 5%;
}

.info-hotspot-modal .info-hotspot-title-wrapper {
  position: absolute;
  top: 0;
  left: 50px;
  right: 50px;
  width: auto;
  height: 50px;
  padding: 0 10px;
}

.info-hotspot-modal .info-hotspot-title-wrapper:before {
  content: '';
  display: inline-block;
  vertical-align: middle;
  height: 100%;
}

.info-hotspot-modal .info-hotspot-title {
  display: inline-block;
  vertical-align: middle;

  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.info-hotspot-modal .info-hotspot-close-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  background-color: rgb(78,88,104);
  background-color: rgba(78,88,104,0.8);
  cursor: pointer;
}

.info-hotspot-modal .info-hotspot-close-icon {
  width: 70%;
  height: 70%;
  margin: 15%;
}

.info-hotspot-modal .info-hotspot-text {
  position: absolute;
  top: 110px;
  bottom: 10px;
  left: 10px;
  right: 10px;
  padding: 10px;
  background-color: rgb(58,68,84);
  background-color: rgba(58,68,84,0.8);
  overflow-y: auto;
  opacity: 0;
  -webkit-transition: opacity 0.3s ease-in-out;
  transition: opacity 0.3s ease-in-out;

  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.info-hotspot-modal.visible .info-hotspot-text {
  opacity: 1;
  -webkit-transition: opacity 0.3s ease-in-out 0.4s;
  transition: opacity 0.3s ease-in-out 0.4s;
}

/* Info hotspot mini modal content (mobile modal body) */

.info-modal-content {
  color: #eee;
}

.info-modal-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.info-modal-gallery:has(> .info-modal-figure:only-child) {
  grid-template-columns: 1fr;
}

.info-modal-figure {
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.info-modal-figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.info-modal-body {
  font-size: 13px;
  line-height: 1.5;
}

.info-modal-body p {
  margin: 0 0 10px;
}

.info-modal-body p:last-child {
  margin-bottom: 0;
}

.mobile .info-hotspot-modal .info-hotspot-text:has(.info-modal-content) .info-modal-gallery {
  grid-template-columns: 1fr;
}

/* View control buttons */

.viewControlButton {
  display: none;
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 40px;
  height: 40px;
  padding: 5px;
  background-color: rgb(103,115,131);
  background-color: rgba(103,115,131,0.8);
}

body.view-control-buttons .viewControlButton {
  display: block;
}

/* Hide controls when width is too small */
@media (max-width: 600px) {
  body.view-control-buttons .viewControlButton {
    display: none;
  }
}

.viewControlButton .icon {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
}

/* Center is at margin-left: -20px */
.viewControlButton-1 {
  margin-left: -145px;
}
.viewControlButton-2 {
  margin-left: -95px;
}
.viewControlButton-3 {
  margin-left: -45px;
}
.viewControlButton-4 {
  margin-left: 5px;
}
.viewControlButton-5 {
  margin-left: 55px;
}
.viewControlButton-6 {
  margin-left: 105px;
}
