@charset "UTF-8";
html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background-color: #1a1a1a;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
}

#app {
  height: 100%;
  width: 100%;
}

#canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  overflow: hidden;
  border: 0;
  padding: 0;
  margin: 0;
}

#application-canvas {
  flex-grow: 1;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
#application-canvas.drag-hover {
  cursor: grab;
}
#application-canvas.drag-active {
  cursor: grabbing;
}
#application-canvas.drag-rotate-hover {
  cursor: ew-resize;
}
#application-canvas.drag-rotate-active {
  cursor: ew-resize;
}

/* Spinner */
#spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
}

.spinner-circle {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
/* Scene loading overlay — hides canvas during share URL loading, fades out when ready */
#scene-loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: #0e0e10;
  z-index: 99; /* above all UI panels (90) but below spinner (100) */
  transition: opacity 0.4s ease-out;
  pointer-events: none;
}

#scene-loading-overlay.ready {
  opacity: 0;
}

/* Drop overlay */
#drop-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}

#drop-overlay span {
  color: white;
  font-size: 24px;
  font-weight: 300;
}

#ar-link {
  display: none;
}

/* Radial Menu */
#radial-menu {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}
#radial-menu.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
#radial-menu .radial-segment {
  fill: rgba(35, 35, 38, 0.92);
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  transition: fill 0.12s ease, stroke 0.12s ease;
}
#radial-menu .radial-segment.active {
  fill: rgba(70, 130, 255, 0.75);
  stroke: rgba(70, 130, 255, 0.9);
}
#radial-menu .radial-segment.hovered {
  fill: rgba(70, 130, 255, 0.75);
  stroke: rgba(70, 130, 255, 0.9);
}
#radial-menu .radial-segment.active.hovered {
  fill: rgba(35, 35, 38, 0.92);
  stroke: rgba(255, 255, 255, 0.08);
}
#radial-menu .radial-segment.delete.hovered {
  fill: rgba(220, 50, 50, 0.75);
  stroke: rgba(220, 50, 50, 0.9);
}
#radial-menu .radial-icon {
  position: absolute;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s ease;
}
#radial-menu .radial-icon.active {
  color: #fff;
}
#radial-menu .radial-icon.hovered {
  color: #fff;
}
#radial-menu .radial-icon.active.hovered {
  color: rgba(255, 255, 255, 0.85);
}
#radial-menu .radial-label {
  position: absolute;
  transform: translate(-50%, -50%);
  opacity: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
  transition: opacity 0.12s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
#radial-menu .radial-label.active {
  opacity: 1;
}
#radial-menu .radial-label.hovered {
  opacity: 1;
}
#radial-menu .radial-label.delete.hovered {
  color: rgba(255, 130, 130, 0.95);
}

/* Mode Toggle */
.mode-toggle {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 0;
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mode-toggle .mode-btn {
  padding: 6px 18px;
  border: none;
  outline: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}
.mode-toggle .mode-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}
.mode-toggle .mode-btn.active {
  color: #fff;
  background: rgba(70, 130, 255, 0.7);
}
.mode-toggle .mode-btn + .mode-btn {
  border-left: none;
}

/* Preview Toggles — top-right corner, visible only in preview mode */
.preview-toggles {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  gap: 4px;
}
.preview-toggles .preview-toggle-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.85);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.preview-toggles .preview-toggle-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}
.preview-toggles .preview-toggle-btn.active {
  color: #fff;
  background: rgba(70, 130, 255, 0.5);
  border-color: rgba(70, 130, 255, 0.6);
}

/* Fullscreen button — bottom-right corner, visible only in preview/share mode */
.fullscreen-btn.preview-toggle-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 100;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.85);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.fullscreen-btn.preview-toggle-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}
.fullscreen-btn.preview-toggle-btn.active {
  color: #fff;
  background: rgba(70, 130, 255, 0.5);
  border-color: rgba(70, 130, 255, 0.6);
}

/* XR buttons — bottom-left corner, visible only in preview/share mode */
.xr-btn.preview-toggle-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 100;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.85);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.xr-btn.preview-toggle-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

.xr-btn-vr.preview-toggle-btn {
  left: 52px;
}

/* Play overlay — full-screen overlay with centered Play button */
.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.play-overlay.fade-out {
  opacity: 0;
}

.play-overlay-btn {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.play-overlay-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.08);
}
.play-overlay-btn:active {
  transform: scale(0.95);
}
.play-overlay-btn svg {
  pointer-events: none;
}

/* Top-right action buttons — Share & Optimize (Studio mode) */
.top-right-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  gap: 6px;
}
.top-right-actions .action-btn {
  height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.85);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.top-right-actions .action-btn svg {
  flex-shrink: 0;
}
.top-right-actions .action-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.top-right-actions .action-btn.action-btn--primary {
  background: rgba(70, 130, 255, 0.4);
  border-color: rgba(70, 130, 255, 0.5);
  color: #fff;
}
.top-right-actions .action-btn.action-btn--primary:hover {
  background: rgba(70, 130, 255, 0.55);
  border-color: rgba(70, 130, 255, 0.7);
}
.top-right-actions .action-btn.saving {
  pointer-events: none;
  opacity: 0.7;
}
.top-right-actions .action-btn .btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Left Panel Container — wraps project header + hierarchy panel */
#left-panel-container {
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 260px;
  display: none;
  flex-direction: column;
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  z-index: 90;
  overflow: visible;
}
#left-panel-container.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Project Header */
#project-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
}
#project-header .project-back-link {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  transition: color 0.15s;
}
#project-header .project-back-link:hover {
  color: rgba(255, 255, 255, 0.8);
}
#project-header .project-name-input {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(70, 130, 255, 0.5);
  border-radius: 4px;
  padding: 1px 6px;
  outline: none;
  flex: 1;
  min-width: 0;
  font-family: inherit;
}
#project-header .project-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
#project-header .project-save-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
  padding: 0;
}
#project-header .project-save-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}
#project-header .project-save-btn.saving {
  opacity: 0.5;
  pointer-events: none;
}
#project-header .save-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}
#project-header .save-status.saved {
  background: rgba(80, 200, 100, 0.8);
}
#project-header .save-status.unsaved {
  background: rgba(255, 180, 50, 0.8);
}
#project-header .save-status.saving {
  background: rgba(70, 130, 255, 0.8);
  animation: save-pulse 0.8s ease-in-out infinite;
}
#project-header .project-menu-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
  padding: 0;
}
#project-header .project-menu-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

@keyframes save-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
/* Project Dropdown Menu */
.project-dropdown {
  min-width: 180px;
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 310;
}

.project-dropdown-item {
  position: relative;
  padding: 6px 14px;
  font-size: 12px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.1s;
}
.project-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.project-dropdown-item .submenu-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.project-dropdown-about {
  gap: 8px;
  justify-content: flex-start;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}
.project-dropdown-about:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Embed Features Submenu */
.project-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: -4px;
  min-width: 180px;
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 320;
}

.project-dropdown-item.has-submenu:hover > .project-submenu {
  display: block;
}

.submenu-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.submenu-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.submenu-checkbox-item input[type=checkbox] {
  accent-color: rgba(70, 130, 255, 0.8);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Dropdown separator */
.project-dropdown-separator {
  height: 1px;
  margin: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
}

/* Toast notification — top-left, just right of the left panel header */
.viewer-toast {
  position: fixed;
  top: 22px;
  left: 297px; /* ~25px gap from left panel edge */
  transform: translateY(-10px);
  background: rgba(30, 30, 30, 0.95);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 500;
  pointer-events: none;
  white-space: nowrap;
}
.viewer-toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.viewer-toast {
  /* Color variants — muted tones with matching border */
}
.viewer-toast.toast-success {
  background: rgba(30, 50, 35, 0.95);
  border-color: rgba(80, 160, 90, 0.35);
  color: rgba(160, 220, 170, 0.95);
}
.viewer-toast.toast-error {
  background: rgba(50, 28, 28, 0.95);
  border-color: rgba(180, 80, 80, 0.35);
  color: rgba(230, 160, 160, 0.95);
}
.viewer-toast.toast-warning {
  background: rgba(50, 42, 25, 0.95);
  border-color: rgba(180, 150, 60, 0.35);
  color: rgba(230, 210, 140, 0.95);
}
.viewer-toast {
  /* info = default (neutral dark) — no extra class needed */
}

/* When hierarchy-panel is inside the left-panel-container, override its standalone styles */
#left-panel-container #hierarchy-panel {
  position: relative;
  left: auto;
  top: auto;
  bottom: auto;
  width: auto;
  max-height: none;
  background: transparent;
  border: none;
  border-radius: 0;
  opacity: 1;
  transform: none;
  transition: none;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* Hierarchy Panel */
#hierarchy-panel {
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 260px;
  display: none;
  flex-direction: column;
  max-height: calc(100% - 24px);
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  z-index: 90;
  overflow: hidden;
}
#hierarchy-panel.visible {
  opacity: 1;
  transform: translateX(0);
}
#hierarchy-panel .hierarchy-header {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#hierarchy-panel .hierarchy-header .project-name {
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
#hierarchy-panel .hierarchy-header .project-name:hover {
  color: #fff;
}
#hierarchy-panel .hierarchy-header .project-name-input {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(70, 130, 255, 0.5);
  border-radius: 4px;
  padding: 1px 6px;
  outline: none;
  width: 100%;
  font-family: inherit;
  box-sizing: border-box;
}
#hierarchy-panel {
  /* ── Panel Tabs (Hierarchy / Tools) ── */
}
#hierarchy-panel .panel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
  margin: 0 10px;
}
#hierarchy-panel .panel-tab {
  flex: 1;
  padding: 10px 0 7px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: color 0.15s, border-color 0.15s;
}
#hierarchy-panel .panel-tab:hover {
  color: rgba(255, 255, 255, 0.65);
}
#hierarchy-panel .panel-tab.active {
  color: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(70, 130, 255, 0.8);
}
#hierarchy-panel .panel-tab-content {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#hierarchy-panel .panel-tab-content.active {
  display: flex;
}
#hierarchy-panel {
  /* ── Tools Tab ── */
}
#hierarchy-panel .tools-container {
  overflow-y: auto;
  flex: 1 1 auto;
  padding-top: 4px;
}
#hierarchy-panel .tools-container::-webkit-scrollbar {
  width: 5px;
}
#hierarchy-panel .tools-container::-webkit-scrollbar-track {
  background: transparent;
}
#hierarchy-panel .tools-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
#hierarchy-panel .tools-section:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#hierarchy-panel .tools-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
#hierarchy-panel .tools-section-header:hover {
  background: rgba(255, 255, 255, 0.04);
}
#hierarchy-panel .tools-section-icon {
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
}
#hierarchy-panel .tools-section-title {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  flex: 1;
}
#hierarchy-panel .tools-section-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  transition: transform 0.15s;
}
#hierarchy-panel .tools-section-content {
  overflow: hidden;
  max-height: 800px;
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out, padding 0.25s ease-out;
  opacity: 1;
  padding: 10px 14px 12px;
}
#hierarchy-panel .tools-section-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}
#hierarchy-panel .tools-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
#hierarchy-panel .tools-action-btn svg {
  flex-shrink: 0;
}
#hierarchy-panel .tools-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}
#hierarchy-panel .tools-action-btn.active {
  background: rgba(70, 130, 255, 0.15);
  border-color: rgba(70, 130, 255, 0.4);
  color: rgba(70, 130, 255, 0.95);
}
#hierarchy-panel .tools-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}
#hierarchy-panel .tools-checkbox-row input[type=checkbox] {
  accent-color: #6495ff;
  margin: 0;
  cursor: pointer;
}
#hierarchy-panel .tools-checkbox-row:hover {
  color: rgba(255, 255, 255, 0.9);
}
#hierarchy-panel .hierarchy-search {
  flex: 0 0 auto;
  position: relative;
  margin: 8px 10px;
}
#hierarchy-panel .hierarchy-search .hierarchy-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  pointer-events: none;
}
#hierarchy-panel .hierarchy-search .hierarchy-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px 7px 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
#hierarchy-panel .hierarchy-search .hierarchy-search-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
#hierarchy-panel .hierarchy-search .hierarchy-search-input:focus {
  border-color: rgba(70, 130, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}
#hierarchy-panel .hierarchy-tree {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0;
}
#hierarchy-panel .hierarchy-tree::-webkit-scrollbar {
  width: 5px;
}
#hierarchy-panel .hierarchy-tree::-webkit-scrollbar-track {
  background: transparent;
}
#hierarchy-panel .hierarchy-tree::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
#hierarchy-panel .hierarchy-tree::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Hierarchy Context Menu */
.hierarchy-context-menu {
  position: fixed;
  z-index: 300;
  min-width: 120px;
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.hierarchy-context-menu .hierarchy-context-item {
  padding: 6px 14px;
  font-size: 12px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s, color 0.1s;
}
.hierarchy-context-menu .hierarchy-context-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.hierarchy-context-menu .hierarchy-context-item.delete:hover {
  background: rgba(220, 50, 50, 0.7);
  color: #fff;
}
.hierarchy-context-menu .hierarchy-context-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 8px;
}

/* Fit View Button — bottom of canvas, offset for panel */
.fit-view-btn {
  position: absolute;
  bottom: 16px;
  /* center between hierarchy panel right edge and transform panel left edge */
  /* panel: 12px + 260px + 2px border = 274px from each side */
  left: calc(274px + (100% - 274px - 274px) / 2);
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  cursor: pointer;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease-out, background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
  white-space: nowrap;
}
.fit-view-btn.visible {
  opacity: 1;
}
.fit-view-btn:hover {
  background: rgba(50, 50, 50, 0.9);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.fit-view-btn:active {
  background: rgba(70, 130, 255, 0.3);
  border-color: rgba(70, 130, 255, 0.5);
}
.fit-view-btn .fit-view-kbd {
  font-size: 10px;
  font-family: inherit;
  padding: 1px 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
  margin-left: 2px;
}
.fit-view-btn {
  /* Push up when animation panel is visible */
}
.fit-view-btn.anim-pushed {
  bottom: 62px;
}

.tree-node-row {
  display: flex;
  align-items: center;
  height: 28px;
  padding-left: 6px;
  padding-right: 6px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  white-space: nowrap;
  user-select: none;
  transition: background 0.08s;
}
.tree-node-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.tree-node-row.selected {
  background: rgba(70, 130, 255, 0.25);
  color: #fff;
}
.tree-node-row.selected-secondary {
  background: rgba(70, 130, 255, 0.13);
  color: rgba(255, 255, 255, 0.9);
}
.tree-node-row.ancestor-hidden {
  opacity: 0.3;
}

/* Indent guides */
.tree-indent {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  display: inline-block;
}

.tree-indent-line {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.07);
}

.tree-expand-arrow {
  flex: 0 0 18px;
  text-align: center;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: color 0.1s;
}
.tree-expand-arrow:hover {
  color: rgba(255, 255, 255, 0.7);
}
.tree-expand-arrow.leaf {
  visibility: hidden;
}

.tree-node-icon {
  flex: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  margin-right: 4px;
}

.tree-node-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node-name-input {
  flex: 1 1 auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(100, 149, 237, 0.6);
  border-radius: 3px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  padding: 0 4px;
  margin: -1px 0;
  outline: none;
  min-width: 0;
}

.tree-eye-toggle {
  flex: 0 0 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
  padding: 0;
  border-radius: 4px;
}
.tree-eye-toggle:hover {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.06);
}
.tree-eye-toggle.hidden-entity {
  color: rgba(255, 100, 100, 0.5);
  opacity: 1;
}

.tree-node-row:hover .tree-eye-toggle {
  opacity: 1;
}

.tree-node-children {
  display: none;
}

/* Transform Panel (right side) */
#transform-panel {
  position: absolute;
  right: 12px;
  top: 88px;
  width: 260px;
  display: none;
  flex-direction: column;
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  z-index: 90;
  overflow: hidden;
}
#transform-panel.visible {
  opacity: 1;
  transform: translateX(0);
}
#transform-panel .transform-header {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#transform-panel .transform-body {
  padding: 10px 10px;
}
#transform-panel .transform-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
#transform-panel .transform-row:last-child {
  margin-bottom: 0;
}
#transform-panel .transform-row-icon {
  flex: 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
}
#transform-panel .transform-row-icon.clickable {
  flex: 0 0 20px;
  padding: 4px;
  margin: -4px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}
#transform-panel .transform-row-icon.clickable:hover {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.06);
}
#transform-panel .transform-row-icon.clickable.active {
  color: rgba(70, 130, 255, 0.85);
}
#transform-panel .transform-row-icon.clickable.active:hover {
  color: rgb(70, 130, 255);
  background: rgba(70, 130, 255, 0.12);
}
#transform-panel .transform-fields {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: center;
}
#transform-panel .transform-chain-link {
  flex: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.2);
  transition: color 0.15s;
  padding: 2px 0;
  order: 0;
}
#transform-panel .transform-chain-link.active {
  color: rgba(70, 130, 255, 0.75);
}
#transform-panel .transform-chain-link:hover {
  color: rgba(255, 255, 255, 0.5);
}
#transform-panel .transform-chain-link:hover.active {
  color: rgb(70, 130, 255);
}
#transform-panel .transform-field {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
#transform-panel .transform-field:focus-within {
  border-color: rgba(70, 130, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}
#transform-panel .transform-field.readonly {
  opacity: 0.6;
}
#transform-panel .transform-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 5px 2px 5px 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  text-align: right;
  outline: none;
  -moz-appearance: textfield;
}
#transform-panel .transform-input::-webkit-inner-spin-button, #transform-panel .transform-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#transform-panel .transform-input[readonly] {
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
}
#transform-panel .transform-axis-label {
  flex: 0 0 auto;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  user-select: none;
  cursor: ew-resize;
}
#transform-panel .transform-axis-label.axis-x {
  color: rgba(255, 90, 90, 0.7);
}
#transform-panel .transform-axis-label.axis-y {
  color: rgba(90, 220, 90, 0.7);
}
#transform-panel .transform-axis-label.axis-z {
  color: rgba(90, 130, 255, 0.7);
}

/* Delete Confirmation Dialog */
#delete-confirm {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}
#delete-confirm .delete-dialog {
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 20px 28px;
  text-align: center;
  color: #fff;
}
#delete-confirm .delete-dialog p {
  margin: 0 0 16px;
  font-size: 14px;
}
#delete-confirm .delete-dialog button {
  padding: 8px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin: 0 4px;
}
#delete-confirm .delete-dialog .btn-confirm {
  background: #dc3232;
  color: white;
}
#delete-confirm .delete-dialog .btn-confirm:hover {
  background: #e64545;
}
#delete-confirm .delete-dialog .btn-cancel {
  background: #444;
  color: white;
}
#delete-confirm .delete-dialog .btn-cancel:hover {
  background: #555;
}

/* Settings Panel (right side, below transform) */
#settings-panel {
  position: absolute;
  right: 12px;
  top: 286px;
  width: 260px;
  max-height: calc(100% - 298px);
  display: none;
  flex-direction: column;
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  border-radius: 12px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  z-index: 90;
  overflow: hidden;
}
#settings-panel.visible {
  opacity: 1;
  transform: translateX(0);
}
#settings-panel {
  /* Suppressed by material-editor when an entity is selected */
}
#settings-panel.suppressed {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(20px) !important;
}
#settings-panel .settings-body {
  overflow-y: auto;
  padding: 0;
  /* Invisible scrollbar — scrolling works, bar hidden */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
#settings-panel .settings-body::-webkit-scrollbar {
  display: none;
}
#settings-panel .settings-body { /* Chrome/Safari */ }
#settings-panel .settings-section:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#settings-panel .settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
#settings-panel .settings-section-header:hover {
  background: rgba(255, 255, 255, 0.04);
}
#settings-panel .settings-section-header {
  /* Fill rounded corners on first and last items */
}
.settings-section:first-child > #settings-panel .settings-section-header {
  border-radius: 12px 12px 0 0;
}
.settings-section:last-child > #settings-panel .settings-section-header {
  border-radius: 0 0 12px 12px;
}
.settings-section:first-child:last-child > #settings-panel .settings-section-header {
  border-radius: 12px;
}
#settings-panel .settings-section-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
#settings-panel .settings-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
#settings-panel .settings-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
#settings-panel .settings-reset-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}
#settings-panel .settings-section-header:hover .settings-reset-btn {
  opacity: 1;
}
#settings-panel .settings-section-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}
#settings-panel .settings-section-content {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out, padding 0.25s ease-out;
  opacity: 1;
  padding: 6px 14px 8px;
}
#settings-panel .settings-section-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}
#settings-panel .settings-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 4px;
}
#settings-panel .settings-row:last-child {
  margin-bottom: 0;
}
#settings-panel .settings-row:has(.settings-toggle) {
  margin-bottom: 8px;
}
#settings-panel .settings-label {
  flex: 0 0 auto;
  max-width: 120px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#settings-panel .settings-info {
  flex: 0 0 auto;
  margin-left: -2px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  cursor: default;
}
#settings-panel {
  /* Separator */
}
#settings-panel .settings-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 10px 0;
}
#settings-panel {
  /* Toggle switch */
}
#settings-panel .settings-toggle {
  flex: 0 0 auto;
}
#settings-panel .settings-toggle-track {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
#settings-panel .settings-toggle-track.active {
  background: rgba(70, 130, 255, 0.7);
}
#settings-panel .settings-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
#settings-panel .settings-toggle-track.active .settings-toggle-thumb {
  transform: translateX(14px);
}
#settings-panel {
  /* Checkbox */
}
#settings-panel .settings-checkbox-row {
  cursor: pointer;
  user-select: none;
}
#settings-panel .settings-checkbox {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
#settings-panel .settings-checkbox.checked {
  border-color: rgba(70, 130, 255, 0.8);
  background: rgba(70, 130, 255, 0.7);
}
#settings-panel .settings-checkmark {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s;
}
.settings-checkbox.checked #settings-panel .settings-checkmark {
  opacity: 1;
}
#settings-panel .settings-checkbox-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
#settings-panel {
  /* Slider */
}
#settings-panel .settings-slider-group {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
#settings-panel .settings-slider {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}
#settings-panel .settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(70, 130, 255, 0.9);
  cursor: pointer;
  border: none;
}
#settings-panel .settings-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(70, 130, 255, 0.9);
  cursor: pointer;
  border: none;
}
#settings-panel .settings-slider-value {
  width: 44px;
  flex: 0 0 44px;
  padding: 3px 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  text-align: center;
  outline: none;
}
#settings-panel .settings-slider-value:focus {
  border-color: rgba(70, 130, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}
#settings-panel {
  /* Scene picker button (e.g., DOF Focus Point) */
}
#settings-panel .settings-picker-btn {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
#settings-panel .settings-picker-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
}
#settings-panel .settings-picker-btn.active {
  background: rgba(70, 130, 255, 0.2);
  border-color: rgba(70, 130, 255, 0.5);
  color: #6495ff;
}
#settings-panel {
  /* Select / dropdown */
}
#settings-panel .settings-select {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
#settings-panel .settings-select:focus {
  border-color: rgba(70, 130, 255, 0.5);
}
#settings-panel .settings-select option {
  background: #2c2c2c;
  color: rgba(255, 255, 255, 0.9);
}
#settings-panel {
  /* Color input */
}
#settings-panel .settings-color-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
#settings-panel .settings-color-hex {
  width: 64px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  outline: none;
}
#settings-panel .settings-color-hex:focus {
  border-color: rgba(70, 130, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* ── Custom Color Picker ──────────────────────── */
.color-picker-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: pointer;
  flex: 0 0 24px;
  transition: border-color 0.12s;
}
.color-picker-swatch:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.color-picker-popup {
  position: fixed;
  z-index: 400;
  padding: 10px;
  background: rgba(30, 30, 30, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-picker-sv {
  width: 160px;
  height: 120px;
  border-radius: 4px;
  cursor: crosshair;
  display: block;
}

.color-picker-hue {
  width: 160px;
  height: 12px;
  border-radius: 6px;
  cursor: pointer;
  display: block;
}

.color-picker-hex {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  outline: none;
  text-align: center;
}
.color-picker-hex:focus {
  border-color: rgba(70, 130, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* Fixed tooltip (appended to body, escapes overflow:hidden) */
.settings-tooltip {
  position: fixed;
  padding: 4px 8px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  max-width: 200px;
  white-space: normal;
  pointer-events: none;
  z-index: 500;
}

/* Animation Panel — bottom bar for animation playback */
#animation-panel {
  position: absolute;
  bottom: 12px;
  left: 50%;
  right: auto;
  height: 36px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  opacity: 0;
  transform: translateX(-50%) translateY(60px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  z-index: 90;
  user-select: none;
}
#animation-panel.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#animation-panel {
  /* In studio mode, same centering */
}
#animation-panel.studio-layout {
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(0);
}
#animation-panel.studio-layout:not(.visible) {
  transform: translateX(-50%) translateY(60px);
}
#animation-panel .anim-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0;
  flex: 0 0 28px;
  transition: background 0.12s, color 0.12s;
}
#animation-panel .anim-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
#animation-panel .anim-btn.playing, #animation-panel .anim-btn.active {
  color: rgba(70, 130, 255, 0.9);
}
#animation-panel .anim-turntable-section {
  display: flex;
  align-items: center;
}
#animation-panel .anim-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
#animation-panel .anim-separator {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 1px;
}
#animation-panel .anim-entity-select {
  flex: 0 0 auto;
  min-width: 80px;
  max-width: 140px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  margin-right: 4px;
}
#animation-panel .anim-entity-select option {
  background: #2c2c2c;
  color: rgba(255, 255, 255, 0.9);
}
#animation-panel .anim-track-select {
  flex: 0 0 auto;
  min-width: 80px;
  max-width: 160px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
#animation-panel .anim-track-select option {
  background: #2c2c2c;
  color: rgba(255, 255, 255, 0.9);
}
#animation-panel .anim-scrubber {
  flex: 1;
  min-width: 60px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}
#animation-panel .anim-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(70, 130, 255, 0.9);
  cursor: pointer;
  border: none;
}
#animation-panel .anim-scrubber::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(70, 130, 255, 0.9);
  cursor: pointer;
  border: none;
}
#animation-panel .anim-time {
  flex: 0 0 auto;
  font-size: 10px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
#animation-panel .anim-speed-select {
  flex: 0 0 auto;
  width: 52px;
  padding: 4px 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  text-align: center;
}
#animation-panel .anim-speed-select option {
  background: #2c2c2c;
  color: rgba(255, 255, 255, 0.9);
}

/* Animation Panel — mobile responsive */
@media (max-width: 520px) {
  #animation-panel {
    gap: 4px;
    padding: 0 8px;
  }
  #animation-panel .anim-controls {
    gap: 4px;
  }
  #animation-panel .anim-separator {
    display: none;
  }
  #animation-panel .anim-speed-select {
    display: none;
  }
  #animation-panel .anim-time {
    display: none;
  }
  #animation-panel .anim-entity-select {
    min-width: 50px;
    max-width: 90px;
    font-size: 10px;
    padding: 2px 4px;
  }
  #animation-panel .anim-track-select {
    min-width: 50px;
    max-width: 100px;
    font-size: 10px;
    padding: 2px 4px;
  }
  #animation-panel .anim-scrubber {
    min-width: 40px;
  }
  #animation-panel .anim-btn {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
  }
}
/* Model URLs Dialog */
.model-urls-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.model-urls-dialog {
  width: 480px;
  max-width: calc(100% - 40px);
  max-height: calc(100% - 80px);
  overflow-y: auto;
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.model-urls-dialog::-webkit-scrollbar {
  width: 5px;
}
.model-urls-dialog::-webkit-scrollbar-track {
  background: transparent;
}
.model-urls-dialog::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.model-urls-header {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 14px;
}

.model-urls-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 16px;
  line-height: 1.4;
}

.model-urls-row {
  margin-bottom: 12px;
}
.model-urls-row:last-of-type {
  margin-bottom: 16px;
}

.model-urls-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-urls-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.model-urls-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}
.model-urls-input:focus {
  border-color: rgba(70, 130, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}
.model-urls-input.blob-url {
  color: rgba(255, 180, 80, 0.8);
}

.model-urls-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.model-urls-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.model-urls-btn.cancel {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}
.model-urls-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.model-urls-btn.save {
  background: rgba(70, 130, 255, 0.7);
  color: #fff;
}
.model-urls-btn.save:hover {
  background: rgba(70, 130, 255, 0.85);
}
.model-urls-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Share Project Dialog */
.share-dialog {
  width: 520px;
}

.share-section-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  margin-top: 4px;
}

.share-url-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.share-url-row .share-url-field {
  flex: 1;
  cursor: default;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.share-url-copy-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.share-url-copy-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.share-url-copy-icon.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.share-warning {
  font-size: 11px;
  color: rgba(255, 180, 80, 0.85);
  line-height: 1.4;
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.share-buttons-right {
  display: flex;
  gap: 8px;
}

.share-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.share-tab:hover {
  color: rgba(255, 255, 255, 0.7);
}
.share-tab.active {
  color: #fff;
  border-bottom-color: rgba(70, 130, 255, 0.8);
}

.share-tab-content {
  display: none;
}
.share-tab-content.active {
  display: block;
}

.share-buttons-left {
  display: flex;
  gap: 8px;
}

.share-toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-toggle-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

.share-toggle-track {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.share-toggle-track.active {
  background: rgba(70, 130, 255, 0.7);
}

.share-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.share-disabled-note {
  font-size: 11px;
  color: rgba(255, 180, 80, 0.85);
  line-height: 1.4;
  margin-bottom: 4px;
}

.embed-dimensions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.embed-dim-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.embed-dim-input {
  width: 64px;
  padding: 4px 8px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  text-align: center;
  outline: none;
}
.embed-dim-input:focus {
  border-color: rgba(70, 130, 255, 0.5);
}
.embed-dim-input {
  -moz-appearance: textfield;
}
.embed-dim-input::-webkit-outer-spin-button, .embed-dim-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.embed-code-textarea {
  width: 100%;
  min-height: 72px;
  padding: 8px;
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  line-height: 1.5;
}
.embed-code-textarea:focus {
  border-color: rgba(70, 130, 255, 0.5);
}
.embed-code-textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.project-info-dialog {
  width: 520px;
}

.project-info-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 16px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.project-info-section {
  margin-bottom: 4px;
}

.project-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 12px;
}

.project-info-label {
  color: rgba(255, 255, 255, 0.5);
}

.project-info-value {
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-info-diff-old {
  color: rgba(255, 255, 255, 0.35);
  text-decoration: line-through;
  font-size: 11px;
}

.project-info-diff-arrow {
  color: rgba(255, 255, 255, 0.25);
  font-size: 10px;
  margin: 0 2px;
}

.project-info-diff-new {
  color: #81c784;
  font-weight: 600;
}

.project-info-diff-pct {
  color: rgba(129, 199, 132, 0.7);
  font-size: 10px;
  margin-left: 2px;
}

.project-info-muted {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-style: italic;
}

.project-info-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-info-model-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.project-info-model-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.project-info-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.project-info-card-name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
}

.project-info-card-size {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.project-info-card-stats {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 6px;
}

.project-info-card-actions {
  display: flex;
  align-items: center;
  min-height: 26px;
}

.project-info-opt-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.project-info-opt-block + .project-info-opt-block {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.project-info-opt-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
  min-width: 60px;
}

.project-info-opt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

.project-info-optimize-btn {
  background: rgba(70, 130, 255, 0.15);
  border: 1px solid rgba(70, 130, 255, 0.3);
  color: rgba(130, 175, 255, 0.9);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.project-info-optimize-btn:hover {
  background: rgba(70, 130, 255, 0.25);
  border-color: rgba(70, 130, 255, 0.5);
}
.project-info-optimize-btn:disabled {
  cursor: default;
  opacity: 0.7;
}
.project-info-optimize-btn.optimizing {
  background: rgba(255, 200, 50, 0.1);
  border-color: rgba(255, 200, 50, 0.3);
  color: rgba(255, 220, 100, 0.9);
  animation: optimize-pulse 1.5s ease-in-out infinite;
}
.project-info-optimize-btn.optimize-all {
  padding: 6px 20px;
  font-size: 12px;
}
.project-info-optimize-btn.texture-optimize {
  background: rgba(80, 200, 120, 0.15);
  border-color: rgba(80, 200, 120, 0.3);
  color: rgba(120, 220, 150, 0.9);
}
.project-info-optimize-btn.texture-optimize:hover {
  background: rgba(80, 200, 120, 0.25);
  border-color: rgba(80, 200, 120, 0.5);
}
.project-info-optimize-btn.server-optimize {
  background: rgba(200, 130, 255, 0.15);
  border-color: rgba(200, 130, 255, 0.3);
  color: rgba(210, 170, 255, 0.9);
}
.project-info-optimize-btn.server-optimize:hover {
  background: rgba(200, 130, 255, 0.25);
  border-color: rgba(200, 130, 255, 0.5);
}

@keyframes optimize-pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}
.project-info-optimized {
  font-size: 11px;
  color: #81c784;
  font-weight: 500;
}

.project-info-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.project-info-close-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  padding: 6px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  margin-left: auto;
}
.project-info-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

/* ── Hotspots ── */
#hotspot-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}

.hotspot-marker {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.2s ease;
  transform: translate(-50%, -50%);
}
.hotspot-marker.occluded .hotspot-circle {
  opacity: 0.25;
}
.hotspot-marker.studio-mode {
  cursor: pointer;
}

.hotspot-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(70, 130, 255, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: "Helvetica Neue", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.15s, transform 0.15s, opacity 0.2s;
  user-select: none;
}
.hotspot-circle:hover {
  background: rgba(100, 160, 255, 0.95);
  transform: scale(1.15);
}

/* Hotspot Popup (Preview/Share) */
.hotspot-popup {
  position: absolute;
  pointer-events: auto;
  min-width: 180px;
  max-width: 280px;
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 85;
}
.hotspot-popup.visible {
  opacity: 1;
}
.hotspot-popup {
  /* Arrow / nose pointing at the hotspot marker */
}
.hotspot-popup::before {
  content: "";
  position: absolute;
  top: var(--arrow-top, 20px);
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.hotspot-popup {
  /* Arrow on the right edge → popup is on the LEFT of the marker */
}
.hotspot-popup.arrow-left::before {
  right: -7px;
  border-left: 7px solid rgba(30, 30, 30, 0.95);
}
.hotspot-popup {
  /* Arrow on the left edge → popup is on the RIGHT of the marker */
}
.hotspot-popup.arrow-right::before {
  left: -7px;
  border-right: 7px solid rgba(30, 30, 30, 0.95);
}

.hotspot-popup-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
}

.hotspot-popup-description {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}
.hotspot-popup-description a {
  color: rgba(70, 130, 255, 0.9);
  text-decoration: none;
}
.hotspot-popup-description a:hover {
  color: rgb(100, 160, 255);
  text-decoration: underline;
}

/* Guided Tour Bar */
.hotspot-tour-bar {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
}

.tour-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tour-nav-btn:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.tour-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.tour-hotspot-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

/* Hotspot Add Button (inside Settings → Scene section) */
.hotspot-add-row {
  margin-top: 4px;
}

.hotspot-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hotspot-add-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.hotspot-add-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}
.hotspot-add-btn.active {
  color: #fff;
  background: rgba(70, 130, 255, 0.35);
  border-color: rgba(70, 130, 255, 0.5);
}

/* Hotspot Edit Popover (Studio) */
.hotspot-edit-popover {
  position: absolute;
  pointer-events: auto;
  width: 240px;
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hotspot-edit-popover input, .hotspot-edit-popover textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.hotspot-edit-popover input:focus, .hotspot-edit-popover textarea:focus {
  border-color: rgba(70, 130, 255, 0.5);
}
.hotspot-edit-popover input::placeholder, .hotspot-edit-popover textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.hotspot-edit-popover textarea {
  resize: vertical;
  min-height: 48px;
}

.hotspot-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.hotspot-edit-actions button {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hotspot-edit-save-cam {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  flex: 1;
}
.hotspot-edit-save-cam:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}
.hotspot-edit-save-cam span {
  font-size: 11px;
}

.hotspot-edit-move {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
}
.hotspot-edit-move:hover {
  background: rgba(70, 130, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

.hotspot-edit-delete {
  background: rgba(220, 50, 50, 0.25);
  color: rgba(255, 130, 130, 0.9);
}
.hotspot-edit-delete:hover {
  background: rgba(220, 50, 50, 0.4);
}

/* Relocating marker pulse animation */
.hotspot-marker.relocating .hotspot-circle {
  animation: hotspot-pulse 1s ease-in-out infinite;
  border-color: rgba(70, 130, 255, 0.9);
}

@keyframes hotspot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}
/* Hotspot toggle in preview-toggles */
.hotspot-toggle-btn.preview-toggle-btn {
  /* inherits preview-toggle-btn styles */
}

/* Material Switcher toggle in preview-toggles */
.material-switcher-toggle-btn.preview-toggle-btn {
  /* inherits preview-toggle-btn styles */
}

/* ── Material Switcher Panel (Preview/Share) ── */
#material-switcher-panel {
  position: absolute;
  top: 52px;
  right: 12px;
  width: 240px;
  max-height: calc(100% - 120px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: rgba(30, 30, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#material-switcher-panel .material-switcher-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#material-switcher-panel .material-switcher-header svg {
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
#material-switcher-panel .material-switcher-body {
  overflow-y: auto;
  padding: 8px 0;
  flex: 1;
}
#material-switcher-panel .material-switcher-body::-webkit-scrollbar {
  width: 5px;
}
#material-switcher-panel .material-switcher-body::-webkit-scrollbar-track {
  background: transparent;
}
#material-switcher-panel .material-switcher-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
#material-switcher-panel .material-switcher-group {
  padding: 6px 12px;
}
#material-switcher-panel .material-switcher-group:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 10px;
  margin-bottom: 2px;
}
#material-switcher-panel .material-switcher-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#material-switcher-panel .material-switcher-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#material-switcher-panel .material-switcher-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
#material-switcher-panel .material-switcher-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
}
#material-switcher-panel .material-switcher-chip.active {
  background: rgba(70, 130, 255, 0.2);
  border-color: rgba(70, 130, 255, 0.45);
  color: #fff;
}
#material-switcher-panel .material-switcher-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ── Variants Switcher Panel (Preview/Share) ── */
.variants-switcher-toggle-btn.preview-toggle-btn {
  /* inherits preview-toggle-btn styles */
}

#variants-switcher-panel {
  position: absolute;
  top: 52px;
  right: 12px;
  width: 240px;
  max-height: calc(100% - 120px);
  z-index: 89;
  display: flex;
  flex-direction: column;
  background: rgba(30, 30, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#variants-switcher-panel .variants-switcher-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#variants-switcher-panel .variants-switcher-header svg {
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
#variants-switcher-panel .variants-switcher-body {
  overflow-y: auto;
  padding: 8px 0;
  flex: 1;
}
#variants-switcher-panel .variants-switcher-body::-webkit-scrollbar {
  width: 5px;
}
#variants-switcher-panel .variants-switcher-body::-webkit-scrollbar-track {
  background: transparent;
}
#variants-switcher-panel .variants-switcher-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
#variants-switcher-panel .variants-switcher-group {
  padding: 6px 12px;
}
#variants-switcher-panel .variants-switcher-group:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 10px;
  margin-bottom: 2px;
}
#variants-switcher-panel .variants-switcher-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#variants-switcher-panel .variants-switcher-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#variants-switcher-panel .variants-switcher-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
#variants-switcher-panel .variants-switcher-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
}
#variants-switcher-panel .variants-switcher-chip.active {
  background: rgba(70, 130, 255, 0.2);
  border-color: rgba(70, 130, 255, 0.45);
  color: #fff;
}

/* ── Variants Switcher Studio Tool Section ── */
.vs-tool-group {
  margin-top: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}
.vs-tool-group:not(:last-child) {
  margin-bottom: 6px;
}

.vs-tool-group-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.vs-tool-group-name {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  padding: 3px 6px;
  font-family: inherit;
  outline: none;
}
.vs-tool-group-name:focus {
  border-color: rgba(70, 130, 255, 0.5);
}

.vs-tool-delete-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  cursor: pointer;
  border-radius: 3px;
}
.vs-tool-delete-btn:hover {
  color: rgba(255, 100, 100, 0.9);
  background: rgba(255, 100, 100, 0.1);
}

.vs-tool-entity-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}
.vs-tool-entity-row.active {
  color: rgba(255, 255, 255, 0.85);
}
.vs-tool-entity-row.active .vs-tool-radio {
  background: rgba(70, 130, 255, 0.8);
  border-color: rgba(70, 130, 255, 0.9);
}
.vs-tool-entity-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.vs-tool-radio {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}

.vs-tool-entity-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-tool-remove-entity {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s;
  border-radius: 2px;
}
.vs-tool-entity-row:hover .vs-tool-remove-entity {
  opacity: 1;
}
.vs-tool-remove-entity:hover {
  color: rgba(255, 100, 100, 0.9);
}

.vs-tool-add-row {
  margin-top: 4px;
}

.vs-tool-entity-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  padding: 3px 6px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.vs-tool-entity-select:focus {
  border-color: rgba(70, 130, 255, 0.5);
}
.vs-tool-entity-select option {
  background: #2c2c2c;
  color: rgba(255, 255, 255, 0.85);
}

/* Material Editor Panel — replaces settings panel when entity is selected */
#material-panel {
  position: absolute;
  right: 12px;
  top: 286px;
  width: 260px;
  max-height: calc(100% - 298px);
  display: none;
  flex-direction: column;
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  border-radius: 12px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  z-index: 91;
  overflow: hidden;
}
#material-panel.visible {
  opacity: 1;
  transform: translateX(0);
}
#material-panel .material-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#material-panel .material-header-icon {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.4);
}
#material-panel .material-body {
  overflow-y: auto;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#material-panel .material-body::-webkit-scrollbar {
  display: none;
}
#material-panel .material-empty {
  padding: 16px 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
}
#material-panel {
  /* Material chip list */
}
#material-panel .material-list {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#material-panel .material-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  max-width: 120px;
}
#material-panel .material-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
#material-panel .material-chip.active {
  background: rgba(70, 130, 255, 0.2);
  border-color: rgba(70, 130, 255, 0.5);
  color: #fff;
}
#material-panel .material-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
#material-panel .material-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#material-panel {
  /* Inline rename input on double-click */
}
#material-panel .material-chip-rename {
  width: 60px;
  padding: 0 3px;
  margin: -1px 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(70, 130, 255, 0.5);
  border-radius: 3px;
  color: #fff;
  font-size: 10px;
  font-family: inherit;
  outline: none;
  line-height: 1.4;
}
#material-panel {
  /* Add variant "+" button (in header) */
}
#material-panel .material-add-btn {
  display: none;
  margin-left: auto;
  padding: 1px 7px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #999;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#material-panel .material-add-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
#material-panel {
  /* Reset button (in header) */
}
#material-panel .material-reset-btn {
  display: none;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #999;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#material-panel .material-reset-btn:hover {
  background: rgba(255, 100, 100, 0.15);
  border-color: rgba(255, 100, 100, 0.4);
  color: #f88;
}
#material-panel {
  /* Delete × on chip */
}
#material-panel .material-chip-delete {
  margin-left: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
#material-panel .material-chip-delete:hover {
  color: #f66;
}
#material-panel {
  /* Merge All button in group mode */
}
#material-panel .material-merge-btn {
  width: 100%;
  margin-top: 6px;
  padding: 5px 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
#material-panel .material-merge-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
#material-panel {
  /* Sections (Colors, PBR, Textures) */
}
#material-panel .material-section:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#material-panel .material-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
#material-panel .material-section-header:hover {
  background: rgba(255, 255, 255, 0.04);
}
#material-panel .material-section-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}
#material-panel .material-section-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}
#material-panel .material-section-content {
  overflow: hidden;
  max-height: 400px;
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out, padding 0.25s ease-out;
  opacity: 1;
  padding: 4px 14px 8px;
}
#material-panel .material-section-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}
#material-panel {
  /* Rows */
}
#material-panel .material-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  margin-bottom: 4px;
}
#material-panel .material-row:last-child {
  margin-bottom: 0;
}
#material-panel .material-label {
  flex: 0 0 75px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#material-panel {
  /* Color group (swatch + hex input) */
}
#material-panel .material-color-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
#material-panel .material-color-hex {
  width: 64px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  outline: none;
}
#material-panel .material-color-hex:focus {
  border-color: rgba(70, 130, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}
#material-panel {
  /* Slider controls */
}
#material-panel .material-slider-controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
#material-panel .material-slider {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}
#material-panel .material-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(70, 130, 255, 0.9);
  cursor: pointer;
  border: none;
}
#material-panel .material-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(70, 130, 255, 0.9);
  cursor: pointer;
  border: none;
}
#material-panel .material-slider-value {
  flex: 0 0 34px;
  font-size: 10px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
}
#material-panel {
  /* iOS-style toggle switch */
}
#material-panel .material-switch {
  flex: 0 0 auto;
}
#material-panel .material-switch-track {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
#material-panel .material-switch-track.active {
  background: rgba(70, 130, 255, 0.7);
}
#material-panel .material-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
#material-panel .material-switch-track.active .material-switch-thumb {
  transform: translateX(14px);
}
#material-panel {
  /* Texture info rows */
}
#material-panel .material-texture-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  margin-bottom: 2px;
}
#material-panel .material-texture-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
#material-panel .material-texture-value {
  font-size: 10px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  color: rgba(255, 255, 255, 0.45);
}
#material-panel .material-texture-none {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  font-style: italic;
  padding: 2px 0;
}
#material-panel {
  /* Checkbox (reuses settings-checkbox classes) */
}
#material-panel .settings-checkbox-row {
  cursor: pointer;
  user-select: none;
}
#material-panel .settings-checkbox {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
#material-panel .settings-checkbox.checked {
  border-color: rgba(70, 130, 255, 0.8);
  background: rgba(70, 130, 255, 0.7);
}
#material-panel .settings-checkmark {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s;
}
.settings-checkbox.checked #material-panel .settings-checkmark {
  opacity: 1;
}
#material-panel .settings-checkbox-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* ── Upgrade Prompt ──────────────────────────────── */
.upgrade-prompt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.upgrade-prompt-overlay.visible {
  opacity: 1;
}

.upgrade-prompt {
  background: #1e1e2e;
  border: 1px solid rgba(200, 130, 255, 0.3);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.upgrade-prompt .upgrade-prompt-icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.upgrade-prompt .upgrade-prompt-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}
.upgrade-prompt .upgrade-prompt-message {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 20px;
}
.upgrade-prompt .upgrade-prompt-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.upgrade-prompt .upgrade-prompt-btn {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.upgrade-prompt .upgrade-prompt-btn.primary {
  background: rgba(200, 130, 255, 0.8);
  color: #fff;
}
.upgrade-prompt .upgrade-prompt-btn.primary:hover {
  background: rgb(200, 130, 255);
}
.upgrade-prompt .upgrade-prompt-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}
.upgrade-prompt .upgrade-prompt-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ── Share Watermark ─────────────────────────────── */
.share-watermark {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 14px;
  z-index: 10000;
  pointer-events: auto;
  user-select: none;
}
.share-watermark .share-watermark-text {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}
.share-watermark .share-watermark-link {
  font-size: 11px;
  font-weight: 600;
  color: rgba(200, 130, 255, 0.9);
  text-decoration: none;
  transition: color 0.15s;
}
.share-watermark .share-watermark-link:hover {
  color: rgb(220, 160, 255);
}

/* Pro badge for gated features */
.pro-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(200, 130, 255, 0.9);
  background: rgba(200, 130, 255, 0.15);
  border: 1px solid rgba(200, 130, 255, 0.25);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 6px;
  vertical-align: middle;
}