/*===================================================================
   Premium Modern CSS for Marzipano Virtual Tour
   - Clean, luxury real-estate glass-morphism UI
   - Typography: Outfit (UI) & Playfair Display (Display/Accent)
   - Palette: Matching uniquebuildingcontractors.com (Green-dark, Terracotta, Off-white)
 ===================================================================*/

/* ──────────────────────────────────────────────────────────────
   DESIGN TOKENS & VARIABLES
────────────────────────────────────────────────────────────── */
:root {
  /* Brand Palette from main website */
  --green-primary: #bfde7b;
  --green-light: #e5f2b6;
  --green-dark: #4d5932;
  --cream: #f9f4e8;
  --terracotta: #d9bca3;
  --charcoal: #14170d;
  --gold-accent: #c4a07a;
  
  --bg-white: #ffffff;
  --bg-offwhite: #fbf9f4;
  --bg-soft: #f4f2eb;
  
  --text-dark: #1e2511;
  --text-secondary: #4d5932;
  --text-muted: #828f64;
  --text-light: #a6b588;
  
  /* Gradients */
  --gradient-gold: linear-gradient(135deg, #d9bca3 0%, #bfde7b 100%);
  --gradient-dark: linear-gradient(135deg, rgba(20, 23, 13, 0.95) 0%, rgba(35, 41, 23, 0.98) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(251, 249, 244, 0.82) 0%, rgba(244, 242, 235, 0.9) 100%);
  
  /* Typography */
  --font-ui: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Playfair Display", Georgia, serif;
  
  /* Glassmorphism Options */
  --glass-bg: rgba(251, 249, 244, 0.85);
  --glass-border: rgba(77, 89, 50, 0.12);
  --blur-ui: blur(20px);
  
  /* Border Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(20, 23, 13, 0.04);
  --shadow-md: 0 12px 36px rgba(20, 23, 13, 0.08);
  --shadow-lg: 0 24px 64px rgba(20, 23, 13, 0.15);
  --shadow-glow: 0 0 20px rgba(191, 222, 123, 0.4);
  
  /* Sizes */
  --ctrl-size: 50px;
  --sidebar-width: 320px;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-med: 300ms;
  --dur-slow: 450ms;
}

/* ──────────────────────────────────────────────────────────────
   BASE RESET & LAYOUT
────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100vw;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  background-color: var(--charcoal);
  color: var(--text-dark);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: var(--green-primary);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-track {
  background: rgba(20, 23, 13, 0.05);
}

#pano {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

/* ──────────────────────────────────────────────────────────────
   FLOATING HEADER & SCENE TITLE
────────────────────────────────────────────────────────────── */
#titleBar {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  height: var(--ctrl-size);
  pointer-events: none;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-med) var(--ease-out);
}

#titleBar .sceneName {
  display: inline-flex;
  align-items: center;
  pointer-events: auto;
  height: 100%;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: var(--gradient-glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  color: var(--green-dark);
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  transition: all var(--dur-med) var(--ease-out);
  white-space: nowrap;
}

#titleBar .sceneName::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-primary);
  box-shadow: 0 0 10px var(--green-primary);
  margin-right: 12px;
  animation: pulseGlowing 2s infinite ease-in-out;
}

@keyframes pulseGlowing {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* Spacing Adjustments when elements exist */
body.multiple-scenes #titleBar {
  /* Offset to leave space for menu on left and settings on right */
  max-width: calc(100vw - 320px);
}

/* ──────────────────────────────────────────────────────────────
   TOP HUD BUTTONS (SYSTEM CONTROLS)
────────────────────────────────────────────────────────────── */
#sceneListToggle,
#architectToggle,
#autorotateToggle,
#fullscreenToggle {
  position: absolute;
  top: 24px;
  width: var(--ctrl-size);
  height: var(--ctrl-size);
  border-radius: var(--radius-pill);
  background: var(--gradient-glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  transition: all var(--dur-fast) var(--ease-out);
  z-index: 101;
}

#sceneListToggle:hover,
#architectToggle:hover,
#autorotateToggle:hover,
#fullscreenToggle:hover {
  background: var(--green-light);
  border-color: var(--green-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#sceneListToggle:active,
#architectToggle:active,
#autorotateToggle:active,
#fullscreenToggle:active {
  transform: translateY(0);
}

#sceneListToggle .icon,
#architectToggle .icon,
#architectToggle .icon-svg,
#autorotateToggle .icon,
#fullscreenToggle .icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  /* Green Dark filter for standard icons */
  filter: brightness(0) saturate(100%) invert(31%) sepia(21%) saturate(601%) hue-rotate(42deg) brightness(96%) contrast(90%);
  stroke: var(--green-dark); /* For SVG icons */
  transition: all var(--dur-fast) var(--ease-out);
}

#sceneListToggle {
  left: 24px;
}

/* Top Right Buttons Placement */
#architectToggle {
  right: 144px;
}
#autorotateToggle {
  right: 84px;
}
#fullscreenToggle {
  right: 24px;
  display: none;
}
body.fullscreen-enabled #fullscreenToggle {
  display: flex;
}

/* Active Toggle States */
#sceneListToggle.enabled,
#architectToggle.enabled,
#autorotateToggle.enabled {
  background: var(--green-primary);
  border-color: var(--green-dark);
  box-shadow: var(--shadow-glow);
}
#sceneListToggle.enabled .icon,
#architectToggle.enabled .icon-svg,
#autorotateToggle.enabled .icon {
  filter: brightness(0) saturate(100%) invert(31%) sepia(21%) saturate(601%) hue-rotate(42deg) brightness(30%) contrast(100%);
  stroke: var(--green-dark);
}

/* Handle toggle states for images inside buttons */
#autorotateToggle .icon.on,
#fullscreenToggle .icon.on,
#sceneListToggle .icon.on {
  display: none;
}
#autorotateToggle .icon.off,
#fullscreenToggle .icon.off,
#sceneListToggle .icon.off {
  display: block;
}
#autorotateToggle.enabled .icon.on,
#fullscreenToggle.enabled .icon.on,
#sceneListToggle.enabled .icon.on {
  display: block;
}
#autorotateToggle.enabled .icon.off,
#fullscreenToggle.enabled .icon.off,
#sceneListToggle.enabled .icon.off {
  display: none;
}

/* ──────────────────────────────────────────────────────────────
   SLIDEOUT SIDEBAR SCENE LIST
────────────────────────────────────────────────────────────── */
#sceneList {
  position: absolute;
  top: 0;
  left: calc(-1 * var(--sidebar-width));
  width: var(--sidebar-width);
  height: 100%;
  max-height: 100%;
  padding-top: 98px;
  padding-bottom: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--gradient-glass);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  box-shadow: var(--shadow-lg);
  z-index: 99;
  transition: all var(--dur-med) var(--ease-out);
  display: flex;
  flex-direction: column;
}

#sceneList.enabled {
  left: 0;
}

.sidebar-header {
  padding: 0 24px 20px 24px;
  border-bottom: 1px solid rgba(77, 89, 50, 0.08);
}

.sidebar-header h2 {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  font-size: 1.6rem;
  margin: 0 0 4px 0;
  color: var(--green-dark);
}

.sidebar-header p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

#sceneList .scenes {
  width: 100%;
  padding: 16px 12px;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#sceneList .scene {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

#sceneList .scene .scene-thumb {
  width: 70px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

#sceneList .scene .scene-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med) var(--ease-out);
}

#sceneList .scene .scene-meta-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

#sceneList .scene .scene-number {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#sceneList .scene .scene-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Hover & Active States */
#sceneList .scene:hover {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(77, 89, 50, 0.15);
  transform: translateX(4px);
}
#sceneList .scene:hover .scene-thumb img {
  transform: scale(1.1);
}

#sceneList .scene.current {
  background: var(--green-primary);
  border-color: var(--green-dark);
  box-shadow: var(--shadow-sm);
}
#sceneList .scene.current .scene-text {
  color: var(--green-dark);
}
#sceneList .scene.current .scene-number {
  color: var(--green-dark);
  opacity: 0.7;
}

body.single-scene #sceneList, 
body.single-scene #sceneListToggle {
  display: none !important;
}

/* ──────────────────────────────────────────────────────────────
   BOTTOM THUMBNAIL SLIDER
────────────────────────────────────────────────────────────── */
#thumbnailSlider {
  position: absolute;
  bottom: 24px;
  left: 24px;
  /* Make room for controls on right side if desktop */
  right: 280px; 
  height: 84px;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  transition: all var(--dur-med) var(--ease-out);
}

#thumbnailSlider .thumbnail-scene {
  flex: 0 0 100px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  padding: 0;
  transition: all var(--dur-fast) var(--ease-out);
  scroll-snap-align: start;
}

#thumbnailSlider .thumbnail-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med) var(--ease-out);
}

#thumbnailSlider .thumbnail-scene span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

#thumbnailSlider .thumbnail-scene:hover {
  transform: translateY(-2px);
  border-color: var(--green-light);
  box-shadow: var(--shadow-sm);
}

#thumbnailSlider .thumbnail-scene:hover img {
  transform: scale(1.08);
}

#thumbnailSlider .thumbnail-scene.current {
  border-color: var(--green-primary);
  box-shadow: var(--shadow-glow);
}

/* ──────────────────────────────────────────────────────────────
   NAVIGATION DOCK (HUD CAPSULE)
────────────────────────────────────────────────────────────── */
.view-controls-hud {
  position: absolute;
  bottom: 24px;
  right: 24px;
  height: 84px;
  padding: 0 16px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-med) var(--ease-out);
}

.view-control-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(77, 89, 50, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.view-control-btn:hover {
  background: var(--green-light);
  border-color: var(--green-primary);
  transform: translateY(-2px);
}

.view-control-btn:active {
  transform: translateY(0);
}

.view-control-btn .icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) saturate(100%) invert(31%) sepia(21%) saturate(601%) hue-rotate(42deg) brightness(96%) contrast(90%);
}

/* Hide controls on mobile/small viewports */
@media (max-width: 800px) {
  #thumbnailSlider {
    right: 24px; /* Expand to full width */
  }
  .view-controls-hud {
    display: none !important;
  }
}

/* ──────────────────────────────────────────────────────────────
   PANORAMA HOTSPOTS
────────────────────────────────────────────────────────────── */
/* Link Hotspots (Portal Arrows) */
.link-hotspot {
  width: 50px;
  height: 50px;
  margin: -25px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
}

.link-hotspot-icon {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.22));
  transition: transform var(--dur-med) var(--ease-out);
}

.link-hotspot:hover .link-hotspot-icon {
  transform: scale(1.15);
}

.link-hotspot-tooltip {
  position: absolute;
  left: 50%;
  bottom: 105%;
  transform: translateX(-50%) translateY(4px);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--green-dark);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease-out);
}

.link-hotspot:hover .link-hotspot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Info Hotspots */
.info-hotspot {
  cursor: default;
}

.info-hotspot .info-hotspot-header {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: var(--green-dark);
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-med) var(--ease-out);
}

/* Double-pulse rings */
.info-hotspot .info-hotspot-header::before,
.info-hotspot .info-hotspot-header::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--green-primary);
  opacity: 0;
  pointer-events: none;
  animation: hotspotPulse 2s infinite ease-out;
}

.info-hotspot .info-hotspot-header::after {
  animation-delay: 1s;
}

@keyframes hotspotPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.info-hotspot-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.info-hotspot-icon {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

.info-hotspot-title-wrapper {
  position: absolute;
  left: 36px;
  top: -3px;
  height: 38px;
  width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: width var(--dur-med) var(--ease-out), padding var(--dur-med) var(--ease-out);
}

/* Visible / Open state styling */
.info-hotspot.visible .info-hotspot-header {
  width: 250px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-md);
}

.info-hotspot.visible .info-hotspot-header::before,
.info-hotspot.visible .info-hotspot-header::after {
  animation: none;
  opacity: 0;
}

.info-hotspot.visible .info-hotspot-title-wrapper {
  width: 170px;
  padding: 0 12px;
}

.info-hotspot-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-hotspot-close-wrapper {
  position: absolute;
  right: 0;
  top: -3px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease-out);
}

.info-hotspot.visible .info-hotspot-close-wrapper {
  opacity: 1;
  pointer-events: auto;
}

.info-hotspot-close-icon {
  width: 12px;
  height: 12px;
  filter: brightness(0) saturate(100%) invert(31%) sepia(21%) saturate(601%) hue-rotate(42deg) brightness(96%) contrast(90%);
  cursor: pointer;
}

/* Info Panel Desktop Content Card */
.info-hotspot-text {
  position: absolute;
  bottom: 41px;
  left: 0;
  width: 340px;
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  color: var(--text-dark);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 100;
}

.info-hotspot.visible .info-hotspot-text {
  display: block;
  animation: fadeIn var(--dur-med) var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.info-hotspot-description {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
}

/* Gallery Grid */
.info-hotspot-gallery {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.info-hotspot-gallery.single {
  grid-template-columns: 1fr;
}

.info-hotspot-figure {
  margin: 0;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16/10;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  background: rgba(0,0,0,0.05);
}
.info-hotspot-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med) var(--ease-out);
}
.info-hotspot-figure:hover img {
  transform: scale(1.06);
}

.info-hotspot-enlarge {
  position: absolute;
  inset: 0;
  background: rgba(77, 89, 50, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}
.info-hotspot-figure:hover .info-hotspot-enlarge {
  opacity: 1;
}
.info-hotspot-enlarge img {
  width: 22px;
  height: 22px;
  filter: invert(1);
}

/* Info Stats table list */
.info-hotspot-stats {
  margin-top: 14px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
}

.info-hotspot-stats dt {
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--green-dark);
  border-bottom: 1px solid rgba(77, 89, 50, 0.08);
}

.info-hotspot-stats dd {
  margin: 0;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(77, 89, 50, 0.08);
}

/* Remove bottom borders on last row of table */
.info-hotspot-stats dt:last-of-type,
.info-hotspot-stats dd:last-of-type {
  border-bottom: none;
}

/* ──────────────────────────────────────────────────────────────
   LIGHTBOX VIEWPORT (IMAGE GALLERIES)
────────────────────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 23, 13, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn var(--dur-fast) forwards;
}

#lightbox img {
  max-width: 90%;
  max-height: 85%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transform: scale(0.95);
  animation: scaleUp var(--dur-med) var(--ease-out) forwards;
}

@keyframes scaleUp {
  to { transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.lightbox-close img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

/* ──────────────────────────────────────────────────────────────
   SVG BOUNDARY LAYER (SITE OUTLINES)
────────────────────────────────────────────────────────────── */
#parcelOverlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.parcel-polygon-fill {
  fill: rgba(191, 222, 123, 0.08);
  stroke: none;
  transition: fill 0.3s ease;
}

.parcel-polygon-line {
  fill: none;
  stroke: var(--green-primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8, 6;
  animation: dashOffset 40s linear infinite;
  filter: drop-shadow(0 0 6px rgba(191, 222, 123, 0.8));
}

@keyframes dashOffset {
  to {
    stroke-dashoffset: -1000;
  }
}

.parcel-polygon-point {
  fill: #ffffff;
  stroke: var(--green-dark);
  stroke-width: 3;
  r: 5;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.parcel-polygon-point:first-child {
  fill: var(--green-primary);
  r: 7;
}

.parcel-polygon-label {
  fill: var(--green-dark);
  stroke: var(--cream);
  stroke-width: 4;
  paint-order: stroke;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
}

/* ──────────────────────────────────────────────────────────────
   ARCHITECT MODE (CAD PANEL)
────────────────────────────────────────────────────────────── */
.parcel-controls {
  position: absolute;
  right: 24px;
  bottom: 124px;
  z-index: 102;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 340px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--gradient-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--blur-ui);
  -webkit-backdrop-filter: var(--blur-ui);
  color: #ffffff;
  transition: all var(--dur-med) var(--ease-out);
  animation: fadeIn var(--dur-med) var(--ease-out);
}

.parcel-controls button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) ease;
}

.parcel-controls button:hover {
  background: var(--green-primary);
  color: var(--green-dark);
  border-color: var(--green-primary);
  transform: translateY(-1px);
}

.parcel-controls button.enabled {
  background: #c94a38;
  color: #fff;
  border-color: #c94a38;
}

.parcel-status {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
  margin-top: 4px;
}

.parcel-output {
  display: none;
  width: 100%;
  min-height: 110px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  color: var(--green-light);
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  resize: vertical;
  user-select: text;
  -webkit-user-select: text;
}
.parcel-output.visible {
  display: block;
}

body.parcel-editing #pano {
  cursor: crosshair;
}
body.parcel-editing #parcelOverlay {
  z-index: 10;
}

/* ──────────────────────────────────────────────────────────────
   MOBILE & RESPONSIVE RULES
────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Floating header on mobile */
  #titleBar {
    top: 16px;
    height: 44px;
    left: 70px;
    right: 120px;
    transform: none;
    max-width: none !important;
  }
  
  #titleBar .sceneName {
    font-size: 0.95rem;
    padding: 0 16px;
    width: 100%;
    justify-content: center;
  }
  
  #sceneListToggle,
  #architectToggle,
  #autorotateToggle,
  #fullscreenToggle {
    top: 16px;
    width: 44px;
    height: 44px;
  }
  
  /* Positions adjustments for mobile toggles */
  #sceneListToggle { left: 16px; }
  #fullscreenToggle { right: 16px; }
  #autorotateToggle { right: 16px; }
  #architectToggle { right: 16px; }
  
  body.fullscreen-enabled #autorotateToggle { right: 68px; }
  body.fullscreen-enabled #architectToggle { right: 120px; }
  
  /* Full screen scene list drawer on mobile */
  #sceneList {
    width: 100%;
    left: -100%;
    padding-top: 80px;
  }
  
  #sceneList.enabled {
    left: 0;
  }
  
  #sceneList .scene {
    height: 60px;
  }
  
  /* Bottom Thumbnail ribbon tweaks */
  #thumbnailSlider {
    left: 12px;
    right: 12px;
    bottom: 16px;
    height: 76px;
    padding: 8px 10px;
  }
  #thumbnailSlider .thumbnail-scene {
    flex: 0 0 85px;
    height: 56px;
  }

  /* Architect mode CAD panel positioning for mobile */
  .parcel-controls {
    left: 12px;
    right: 12px;
    bottom: 104px;
    width: auto;
    padding: 14px;
  }
  
  /* MOBILE BOTTOM SHEET FOR HOTSPOT DETAIL PANELS */
  .info-hotspot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 23, 13, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    display: flex;
    align-items: flex-end; /* Align sheet to bottom */
  }
  
  .info-hotspot-modal.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s 0s;
  }
  
  /* The Sheet Panel Container */
  .info-hotspot-modal .info-hotspot-text {
    position: relative;
    width: 100%;
    max-height: 75vh;
    bottom: 0;
    left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: none;
    border-top: 1px solid var(--glass-border);
    padding: 24px;
    background: var(--bg-offwhite);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
    overflow-y: auto;
    display: block !important;
    transform: translateY(100%);
    transition: transform var(--dur-med) var(--ease-out);
  }
  
  .info-hotspot-modal.visible .info-hotspot-text {
    transform: translateY(0);
  }
  
  /* Add drag indicator line for native sheet feel */
  .info-hotspot-modal .info-hotspot-text::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: rgba(77, 89, 50, 0.2);
  }
  
  /* Setup mock header elements within sheet text */
  .info-hotspot-modal .info-hotspot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(77, 89, 50, 0.08);
    padding-bottom: 12px;
    position: relative;
  }
  
  .info-hotspot-modal .info-hotspot-title-wrapper {
    position: relative;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    padding: 0;
    display: block;
  }
  
  .info-hotspot-modal .info-hotspot-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--green-dark);
  }
  
  .info-hotspot-modal .info-hotspot-close-wrapper {
    position: relative;
    right: 0;
    top: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(77, 89, 50, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: auto;
  }
  
  .info-hotspot-modal .info-hotspot-close-icon {
    filter: brightness(0) saturate(100%) invert(31%) sepia(21%) saturate(601%) hue-rotate(42deg) brightness(96%) contrast(90%);
    width: 14px;
    height: 14px;
  }
  
  /* Disable original header click when modal open, handles via sheet close button */
  .info-hotspot-modal .info-hotspot-icon-wrapper {
    display: none;
  }
}

/* ===================================================================
   White Glass Luxury Refresh
   This final layer overrides the generated tour skin with a cleaner,
   brighter and more polished interface.
=================================================================== */
:root {
  --premium-white: rgba(255, 255, 255, 0.72);
  --premium-white-strong: rgba(255, 255, 255, 0.9);
  --premium-white-soft: rgba(255, 255, 255, 0.46);
  --premium-border: rgba(255, 255, 255, 0.56);
  --premium-border-dark: rgba(23, 26, 31, 0.1);
  --premium-ink: #14171d;
  --premium-muted: #5d6470;
  --premium-gold: #d8b46c;
  --premium-gold-deep: #9d7440;
  --premium-shadow: 0 24px 70px rgba(7, 11, 18, 0.22);
  --premium-shadow-soft: 0 14px 38px rgba(7, 11, 18, 0.15);
  --premium-blur: blur(24px) saturate(1.35);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.52));
  --glass-bg: var(--premium-white);
  --glass-border: var(--premium-border);
  --green-primary: var(--premium-gold);
  --green-light: rgba(255, 255, 255, 0.82);
  --green-dark: var(--premium-ink);
  --text-dark: var(--premium-ink);
  --text-secondary: #343944;
  --text-muted: var(--premium-muted);
  --shadow-sm: 0 10px 28px rgba(7, 11, 18, 0.12);
  --shadow-md: var(--premium-shadow-soft);
  --shadow-lg: var(--premium-shadow);
  --shadow-glow: 0 0 0 1px rgba(216, 180, 108, 0.24), 0 16px 44px rgba(216, 180, 108, 0.28);
  --ctrl-size: 52px;
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}

body::before {
  top: 0;
  height: 170px;
  background: linear-gradient(180deg, rgba(5, 7, 10, 0.34), rgba(5, 7, 10, 0));
}

body::after {
  bottom: 0;
  height: 190px;
  background: linear-gradient(0deg, rgba(5, 7, 10, 0.36), rgba(5, 7, 10, 0));
}

#titleBar .sceneName,
#sceneListToggle,
#architectToggle,
#autorotateToggle,
#fullscreenToggle,
#thumbnailSlider,
.view-controls-hud,
#sceneList,
.info-hotspot-text,
.link-hotspot-tooltip {
  background: var(--gradient-glass);
  border: 1px solid var(--premium-border);
  box-shadow: var(--premium-shadow-soft);
  backdrop-filter: var(--premium-blur);
  -webkit-backdrop-filter: var(--premium-blur);
}

#titleBar .sceneName {
  min-width: 136px;
  justify-content: center;
  padding: 0 30px;
  color: var(--premium-ink);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

#titleBar .sceneName::before {
  width: 28px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--premium-gold), transparent);
  box-shadow: 0 0 18px rgba(216, 180, 108, 0.9);
  margin-right: 12px;
  animation: premiumLinePulse 2.6s ease-in-out infinite;
}

@keyframes premiumLinePulse {
  0%, 100% { opacity: 0.45; transform: scaleX(0.76); }
  50% { opacity: 1; transform: scaleX(1); }
}

#sceneListToggle,
#architectToggle,
#autorotateToggle,
#fullscreenToggle {
  color: var(--premium-ink);
  overflow: hidden;
}

#sceneListToggle::before,
#architectToggle::before,
#autorotateToggle::before,
#fullscreenToggle::before,
.view-control-btn::before,
.thumbnail-scene::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.12));
  pointer-events: none;
}

#sceneListToggle::after,
#architectToggle::after,
#autorotateToggle::after,
#fullscreenToggle::after,
.view-control-btn::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.82) 50%, transparent 62%);
  opacity: 0;
  transform: translateX(-50%) rotate(12deg);
  transition: transform 520ms var(--ease-out), opacity 220ms ease;
  pointer-events: none;
}

#sceneListToggle:hover::after,
#architectToggle:hover::after,
#autorotateToggle:hover::after,
#fullscreenToggle:hover::after,
.view-control-btn:hover::after {
  opacity: 0.65;
  transform: translateX(50%) rotate(12deg);
}

#sceneListToggle:hover,
#architectToggle:hover,
#autorotateToggle:hover,
#fullscreenToggle:hover,
.view-control-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(216, 180, 108, 0.48);
  color: var(--premium-gold-deep);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--premium-shadow-soft), 0 0 0 4px rgba(216, 180, 108, 0.12);
}

#sceneListToggle.enabled,
#architectToggle.enabled,
#autorotateToggle.enabled,
#fullscreenToggle.enabled {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(250, 238, 210, 0.78));
  border-color: rgba(216, 180, 108, 0.72);
  color: var(--premium-gold-deep);
}

#sceneListToggle .icon,
#architectToggle .icon-svg,
#autorotateToggle .icon,
#fullscreenToggle .icon,
.view-control-btn .icon-svg {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  filter: none;
  stroke: currentColor;
  color: currentColor;
}

#autorotateToggle.enabled .icon.on {
  animation: premiumSpin 4s linear infinite;
  transform-origin: center;
}

@keyframes premiumSpin {
  to { transform: rotate(360deg); }
}

#sceneList {
  border-right-color: rgba(255, 255, 255, 0.64);
}

.sidebar-header {
  border-bottom-color: rgba(20, 23, 29, 0.08);
}

.sidebar-header h2 {
  color: var(--premium-ink);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.sidebar-header p,
#sceneList .scene .scene-number {
  color: var(--premium-muted);
  letter-spacing: 0.12em;
}

#sceneList .scene {
  position: relative;
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 8px 22px rgba(7, 11, 18, 0.08);
  overflow: hidden;
}

#sceneList .scene::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 99px;
  background: var(--premium-gold);
  opacity: 0;
  transform: scaleY(0.4);
  transition: all var(--dur-med) var(--ease-out);
}

#sceneList .scene:hover,
#sceneList .scene.current {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(216, 180, 108, 0.48);
  transform: translateX(6px);
}

#sceneList .scene.current::after {
  opacity: 1;
  transform: scaleY(1);
}

#sceneList .scene.current .scene-thumb,
#thumbnailSlider .thumbnail-scene.current {
  box-shadow: 0 0 0 2px rgba(216, 180, 108, 0.82), 0 18px 34px rgba(7, 11, 18, 0.16);
}

#thumbnailSlider {
  height: 90px;
  padding: 12px 18px;
  border-radius: 20px;
}

#thumbnailSlider .thumbnail-scene {
  flex-basis: 112px;
  height: 66px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(7, 11, 18, 0.12);
}

#thumbnailSlider .thumbnail-scene span {
  padding: 18px 7px 7px;
  background: linear-gradient(0deg, rgba(5, 7, 10, 0.72), rgba(5, 7, 10, 0));
  font-size: 0.72rem;
  font-weight: 600;
}

#thumbnailSlider .thumbnail-scene:hover {
  border-color: rgba(216, 180, 108, 0.62);
  transform: translateY(-5px);
}

.view-controls-hud {
  height: 90px;
  border-radius: 20px;
}

.view-control-btn {
  position: relative;
  color: var(--premium-ink);
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.56);
  overflow: hidden;
}

.link-hotspot {
  width: 54px;
  height: 54px;
  margin: -27px;
}

.link-hotspot-icon {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--premium-gold-deep);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.28) 48%, rgba(255, 255, 255, 0.1) 70%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(7, 11, 18, 0.22), 0 0 0 5px rgba(255, 255, 255, 0.14);
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}

.link-hotspot-icon::before,
.link-hotspot-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1px solid rgba(216, 180, 108, 0.68);
  opacity: 0;
  animation: premiumHotspotPulse 2.8s ease-out infinite;
}

.link-hotspot-icon::after {
  animation-delay: 1.2s;
}

.link-hotspot-glyph {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 4px 10px rgba(157, 116, 64, 0.26));
  animation: premiumFloat 3.2s ease-in-out infinite;
}

.link-hotspot:hover .link-hotspot-icon {
  transform: scale(1.12);
  box-shadow: 0 22px 54px rgba(7, 11, 18, 0.26), 0 0 0 9px rgba(216, 180, 108, 0.16);
}

.link-hotspot:hover .link-hotspot-glyph {
  animation-duration: 1.2s;
}

.icon-stroke,
.icon-orbit,
.icon-inner-orbit {
  stroke: currentColor;
}

.icon-fill {
  fill: currentColor;
}

.icon-fill.soft,
.icon-stroke.soft {
  opacity: 0.55;
}

.icon-orbit {
  opacity: 0.62;
  stroke-dasharray: none;
  animation: none;
  transform-origin: center;
}

.icon-inner-orbit {
  display: none;
}

@keyframes premiumHotspotPulse {
  0% { opacity: 0.72; transform: scale(0.78); }
  100% { opacity: 0; transform: scale(1.45); }
}

@keyframes premiumFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes premiumDash {
  to { stroke-dashoffset: -48; transform: rotate(360deg); }
}

.link-hotspot-tooltip {
  bottom: 112%;
  color: var(--premium-ink);
  border-radius: 999px;
  padding: 8px 14px;
}

.info-hotspot .info-hotspot-header {
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: var(--premium-gold-deep);
  box-shadow: 0 14px 34px rgba(7, 11, 18, 0.2), 0 0 0 5px rgba(255, 255, 255, 0.18);
}

.info-hotspot .info-hotspot-header::before,
.info-hotspot .info-hotspot-header::after {
  border-color: rgba(216, 180, 108, 0.72);
}

.info-hotspot-icon {
  width: 23px;
  height: 23px;
  filter: none;
  animation: premiumFloat 3.2s ease-in-out infinite;
}

@keyframes premiumSpark {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.88; }
  50% { transform: scale(1.08) rotate(8deg); opacity: 1; }
}

.info-hotspot.visible .info-hotspot-header {
  width: 272px;
  height: 46px;
  color: var(--premium-ink);
  background: var(--premium-white-strong);
  border-color: rgba(216, 180, 108, 0.36);
}

.info-hotspot-title-wrapper {
  left: 42px;
  height: 46px;
}

.info-hotspot.visible .info-hotspot-title-wrapper {
  width: 182px;
}

.info-hotspot-title {
  color: var(--premium-ink);
}

.info-hotspot-close-wrapper {
  width: 46px;
  height: 46px;
  color: var(--premium-muted);
}

.info-hotspot-close-icon,
.lightbox-close-icon,
.info-hotspot-enlarge-icon {
  width: 18px;
  height: 18px;
  filter: none;
  color: currentColor;
}

.info-hotspot-text {
  width: 360px;
  border-radius: 0 18px 18px 18px;
}

.info-hotspot-description {
  color: var(--premium-muted);
}

.info-hotspot-figure {
  border-radius: 12px;
}

.info-hotspot-enlarge {
  color: #fff;
  background: linear-gradient(135deg, rgba(8, 11, 16, 0.22), rgba(157, 116, 64, 0.7));
}

.info-hotspot-stats {
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(20, 23, 29, 0.08);
}

.info-hotspot-stats dt,
.info-hotspot-stats dd {
  border-bottom-color: rgba(20, 23, 29, 0.07);
}

.info-hotspot-stats dt {
  color: var(--premium-gold-deep);
}

#lightbox {
  background: rgba(8, 10, 13, 0.72);
}

.lightbox-close {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: var(--premium-blur);
  -webkit-backdrop-filter: var(--premium-blur);
}

.parcel-polygon-fill {
  fill: rgba(255, 255, 255, 0.14);
}

.parcel-polygon-line {
  stroke: var(--premium-gold);
  filter: drop-shadow(0 0 7px rgba(216, 180, 108, 0.82));
}

.parcel-polygon-point {
  stroke: var(--premium-gold-deep);
}

.parcel-polygon-label {
  fill: #fff;
  stroke: rgba(10, 12, 16, 0.42);
}

.parcel-controls {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.56));
  border-color: rgba(255, 255, 255, 0.58);
  color: var(--premium-ink);
}

.parcel-controls button {
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(20, 23, 29, 0.1);
  color: var(--premium-ink);
}

.parcel-controls button:hover,
.parcel-controls button.enabled {
  background: linear-gradient(135deg, #f4dc9e, #d8b46c);
  border-color: rgba(157, 116, 64, 0.36);
  color: #17130a;
}

.parcel-status {
  color: var(--premium-muted);
}

.parcel-output {
  background: rgba(20, 23, 29, 0.78);
  color: #ffe7ad;
}

@media (max-width: 800px) {
  #thumbnailSlider {
    right: 24px;
  }
}

@media (max-width: 600px) {
  #titleBar .sceneName {
    min-width: 0;
    font-size: 0.82rem;
    padding: 0 12px;
  }

  #titleBar .sceneName::before {
    width: 16px;
    margin-right: 8px;
  }

  #thumbnailSlider {
    height: 78px;
    border-radius: 16px;
  }

  #thumbnailSlider .thumbnail-scene {
    flex-basis: 88px;
    height: 58px;
  }

  .link-hotspot {
    width: 50px;
    height: 50px;
    margin: -25px;
  }

  .link-hotspot-icon {
    width: 50px;
    height: 50px;
  }

  .info-hotspot-modal .info-hotspot-text {
    background: rgba(255, 255, 255, 0.92);
    border-top-color: rgba(216, 180, 108, 0.34);
  }
}

/* Hide left sidebar and compact right-side view controls */
#sceneList,
#sceneListToggle {
  display: none !important;
}

body.multiple-scenes #titleBar {
  max-width: calc(100vw - 240px);
}

#thumbnailSlider {
  left: 24px;
  right: 230px;
}

.view-controls-hud {
  right: 18px;
  bottom: 22px;
  height: 68px;
  padding: 0 10px;
  gap: 6px;
  border-radius: 16px;
}

.view-control-btn {
  width: 34px;
  height: 34px;
}

.view-control-btn .icon-svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 800px) {
  #thumbnailSlider {
    right: 16px;
  }
}

@media (max-width: 600px) {
  #titleBar {
    left: 16px;
    right: 140px;
  }

  #thumbnailSlider {
    left: 12px;
    right: 12px;
  }
}

/* Final polish for preview carousel and view direction controls */
#thumbnailSlider {
  left: 24px;
  right: auto;
  bottom: 20px;
  width: max-content;
  max-width: calc(100vw - 260px);
  height: 76px;
  padding: 9px 12px;
  gap: 10px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.44)),
    rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 48px rgba(7, 11, 18, 0.16);
}

#thumbnailSlider .thumbnail-scene {
  flex: 0 0 96px;
  width: 96px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  box-shadow: 0 10px 22px rgba(7, 11, 18, 0.12);
  isolation: isolate;
}

#thumbnailSlider .thumbnail-scene::before {
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 42%),
    linear-gradient(0deg, rgba(7, 11, 18, 0.68), transparent 56%);
  opacity: 0.82;
  transition: opacity var(--dur-fast) ease;
}

#thumbnailSlider .thumbnail-scene img {
  transform: scale(1.02);
}

#thumbnailSlider .thumbnail-scene span {
  z-index: 2;
  bottom: 5px;
  padding: 0 8px;
  background: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.48);
}

#thumbnailSlider .thumbnail-scene:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 180, 108, 0.76);
  box-shadow: 0 16px 34px rgba(7, 11, 18, 0.18), 0 0 0 3px rgba(216, 180, 108, 0.12);
}

#thumbnailSlider .thumbnail-scene:hover::before {
  opacity: 0.58;
}

#thumbnailSlider .thumbnail-scene.current {
  border-color: rgba(216, 180, 108, 0.92);
  box-shadow: 0 0 0 2px rgba(216, 180, 108, 0.86), 0 14px 34px rgba(7, 11, 18, 0.2);
}

#thumbnailSlider .thumbnail-scene.current::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 3;
  width: 22px;
  height: 2px;
  border-radius: 99px;
  background: #f3d58d;
  box-shadow: 0 0 12px rgba(243, 213, 141, 0.9);
  transform: translateX(-50%);
}

.view-controls-hud {
  right: 18px;
  bottom: 20px;
  height: 58px;
  padding: 8px;
  gap: 5px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.64);
  box-shadow: 0 18px 46px rgba(7, 11, 18, 0.18);
}

.view-control-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #171a20;
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 8px 18px rgba(7, 11, 18, 0.08);
}

.view-control-btn::before {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.06));
}

.view-control-btn::after {
  display: none;
}

.view-control-btn:hover {
  color: var(--premium-gold-deep);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(216, 180, 108, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 12px 26px rgba(7, 11, 18, 0.16);
}

.view-control-btn:active {
  transform: translateY(0) scale(0.96);
}

.view-control-btn .icon-svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.7;
}

@media (max-width: 900px) {
  #thumbnailSlider {
    max-width: calc(100vw - 36px);
    right: 18px;
    width: auto;
  }

  .view-controls-hud {
    display: none !important;
  }
}

@media (max-width: 600px) {
  #thumbnailSlider {
    left: 12px;
    right: 12px;
    bottom: 14px;
    height: 70px;
    padding: 8px 9px;
  }

  #thumbnailSlider .thumbnail-scene {
    flex-basis: 84px;
    width: 84px;
    height: 52px;
  }
}
