:root {
  --bg: #0c0f14;
  --bg-elevated: #141820;
  --bg-hover: #1c2230;
  --border: #2a3142;
  --text: #e8ecf4;
  --text-muted: #8b95a8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  transition: background 0.15s;
}

button:hover {
  background: var(--accent-hover);
}

button.ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

button.ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

input,
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field {
  margin-bottom: 0.85rem;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* Info hotspot modal (viewer + editor preview) */
.info-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.info-modal.hidden {
  display: none !important;
}

.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--info-backdrop, rgba(0, 0, 0, 0.55));
  backdrop-filter: blur(4px);
}

.info-modal__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: calc(100vw - 2rem);
  background: var(--info-body-bg, var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  animation: info-modal-in 0.2s ease-out;
}

@keyframes info-modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--info-header-bg, transparent);
  color: var(--info-header-text, inherit);
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal__head h3 {
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
  color: inherit;
}

.modal__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 1.2rem;
  line-height: 1;
}

.modal__close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.modal__body {
  padding: 1rem;
  overflow-y: auto;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.modal__foot {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.modal__card--sm { width: 280px; max-height: 220px; }
.modal__card--md { width: 420px; max-height: 340px; }
.modal__card--lg { width: 560px; max-height: 460px; }
.modal__card--xl { width: 720px; max-height: 580px; }

.info-modal__card .modal__body {
  flex: 1;
  min-height: 0;
}

.info-modal__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.info-modal__photo-wrap {
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-hover);
  min-height: 80px;
}

.info-modal__photo-wrap--error {
  padding: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-modal__photo {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  vertical-align: middle;
}

.info-modal__slider {
  position: relative;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--info-body-bg, var(--bg-hover));
}

.info-modal__slider-viewport {
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.info-modal__slider-track {
  display: flex;
  transition: transform 0.28s ease-out;
  will-change: transform;
}

.info-modal__slider-slide {
  flex: 0 0 100%;
  min-width: 100%;
}

.info-modal__slider-slide .info-modal__photo-wrap {
  border-radius: 0;
  min-height: 140px;
}

.info-modal__slider-slide .info-modal__photo {
  max-height: 220px;
  width: 100%;
  object-fit: cover;
}

.info-modal__slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--info-body-bg, rgba(0, 0, 0, 0.55));
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  opacity: 0.92;
}

.info-modal__slider-nav:hover {
  background: var(--accent);
  color: #fff;
}

.info-modal__slider-prev {
  left: 0.4rem;
}

.info-modal__slider-next {
  right: 0.4rem;
}

.info-modal__slider-dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem 0.35rem;
}

.info-modal__slider-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border, rgba(255, 255, 255, 0.35));
  cursor: pointer;
}

.info-modal__slider-dot--active,
.info-modal__slider-dot:hover {
  background: var(--accent);
}

.info-modal__slider-caption {
  padding: 0.35rem 0.75rem 0.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
}

.skin-info-slider .info-modal__slider {
  margin: -1rem -1rem 0.75rem;
  border-radius: 0;
}

.info-modal__text {
  white-space: pre-wrap;
  line-height: 1.5;
}

.info-modal__text:not(:first-child) {
  margin-top: 0.25rem;
}

.info-modal__video-wrap {
  margin-bottom: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.info-modal__video {
  display: block;
  width: 100%;
  max-height: 280px;
  background: #000;
}

.info-modal__audio-wrap {
  margin-bottom: 0.75rem;
}

.info-modal__audio {
  display: block;
  width: 100%;
}

.info-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.info-lightbox__img {
  max-width: min(96vw, 1200px);
  max-height: 86vh;
  object-fit: contain;
  user-select: none;
}

.info-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.info-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.info-lightbox__nav.hidden {
  display: none;
}

.info-lightbox__prev {
  left: 0.75rem;
}

.info-lightbox__next {
  right: 0.75rem;
}

.info-lightbox__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
}

/* 3DGS — ориентация в сцене */
.splat-orientation-hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 40;
  max-width: min(420px, calc(100% - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(12, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8eaef;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.splat-orientation-hud__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.splat-orientation-hud__mode {
  font-weight: 600;
  color: #a5b4fc;
}
.splat-orientation-hud__home {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}
.splat-orientation-hud__home:hover {
  background: rgba(255, 255, 255, 0.16);
}
.splat-orientation-hud__coords {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: rgba(232, 234, 239, 0.88);
}
.splat-orientation-hud__hint {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(232, 234, 239, 0.72);
}

/* Полноэкранная галерея (hotspot type=gallery) */
body.photo-gallery-open {
  overflow: hidden;
}

.photo-gallery {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
}

.photo-gallery__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.photo-gallery__title {
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-gallery__tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.photo-gallery__mode-btn,
.photo-gallery__close {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.photo-gallery__mode-btn:hover,
.photo-gallery__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.photo-gallery__mode-btn--active {
  background: rgba(139, 92, 246, 0.55);
}

.photo-gallery__close {
  font-size: 1.5rem;
}

.photo-gallery__body {
  flex: 1;
  min-height: 0;
  position: relative;
}

.photo-gallery__grid {
  height: 100%;
  overflow: auto;
  padding: 1rem;
}

.photo-gallery__grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  max-width: 1200px;
  margin: 0 auto;
}

.photo-gallery__thumb {
  display: block;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.photo-gallery__thumb:hover {
  border-color: rgba(139, 92, 246, 0.7);
}

.photo-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-gallery__scroll {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 3.5rem 2.5rem;
}

.photo-gallery__scroll.hidden {
  display: none;
}

.photo-gallery__scroll-img {
  max-width: min(96vw, 1200px);
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  user-select: none;
}

.photo-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.photo-gallery__nav.hidden {
  display: none;
}

.photo-gallery__prev {
  left: 0.75rem;
}

.photo-gallery__next {
  right: 0.75rem;
}

.photo-gallery__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.preview-icon-info::before {
  content: 'i';
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
  font-size: 1.1rem;
}
.preview-icon-pin::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 28%;
  left: 50%;
  margin-left: -4px;
  box-shadow: 0 10px 0 -2px var(--accent);
}
.preview-icon-camera::before {
  content: '';
  width: 18px;
  height: 12px;
  border: 2px solid var(--accent);
  border-radius: 2px;
  position: absolute;
  top: 32%;
  left: 50%;
  margin-left: -9px;
}
.preview-icon-camera::after {
  content: '';
  width: 8px;
  height: 8px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 38%;
  left: 50%;
  margin-left: -4px;
}
.preview-icon-star::before {
  content: '★';
  color: var(--accent);
  font-size: 1.2rem;
}
.preview-icon-chat::before {
  content: '…';
  font-size: 1.4rem;
  letter-spacing: 2px;
  color: var(--accent);
}
.preview-icon-play::before {
  content: '';
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid var(--accent);
  position: absolute;
  top: 34%;
  left: 52%;
  margin-left: -6px;
}
.preview-icon-link::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 34%;
  left: 42%;
}
.preview-icon-link::after {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 42%;
  left: 52%;
}
.preview-icon-eye::before {
  content: '';
  width: 20px;
  height: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 36%;
  left: 50%;
  margin-left: -10px;
}
.preview-icon-eye::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 42%;
  left: 50%;
  margin-left: -3px;
}
.preview-icon-door::before {
  content: '';
  width: 16px;
  height: 20px;
  border: 2px solid var(--accent);
  position: absolute;
  top: 28%;
  left: 50%;
  margin-left: -8px;
}
.preview-icon-door::after {
  content: '';
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 58%;
}

.preview-arrow-chevron::before {
  content: '▲';
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}
.preview-arrow-circle::before {
  content: '▲';
  color: var(--accent);
  font-size: 0.65rem;
}
.preview-arrow-circle::after {
  content: '';
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.75;
}
.preview-arrow-right::before {
  content: '→';
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
}
.preview-arrow-double::before {
  content: '▲▲';
  color: var(--accent);
  font-size: 0.6rem;
  letter-spacing: -3px;
  font-weight: 700;
}

/* Карта сцен */
.scene-map-panel {
  margin-top: 0.25rem;
}

.scene-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.scene-map-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.scene-map-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.scene-map-card.active {
  border-color: var(--scene-map-active, var(--accent));
  background: color-mix(in srgb, var(--scene-map-active, var(--accent)) 14%, transparent);
}

.scene-map-card__thumb {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.scene-map-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-map-card__name {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-map-card__meta {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.scene-map-links {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.scene-map-links__title {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.scene-map-links ul {
  list-style: none;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.info-modal__audio-wrap {
  margin-bottom: 0.75rem;
}

.info-modal__audio {
  display: block;
  width: 100%;
}

.info-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.info-lightbox__img {
  max-width: min(96vw, 1200px);
  max-height: 86vh;
  object-fit: contain;
}

.info-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.info-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
}

.info-lightbox__nav.hidden {
  display: none;
}

.info-lightbox__prev {
  left: 0.75rem;
}

.info-lightbox__next {
  right: 0.75rem;
}

.info-lightbox__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.tour-start-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 10, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Стартовый экран: скрыть chrome viewer до «Начать тур» */
html.tour-start-active .top-bar,
html.tour-start-active .route-nav,
html.tour-start-active .hotspot-groups,
html.tour-start-active .scene-panel,
html.tour-start-active .viewer-brand,
html.tour-start-active .skin-overlay-root,
#app.tour-start-pending .top-bar,
#app.tour-start-pending .route-nav,
#app.tour-start-pending .hotspot-groups,
#app.tour-start-pending .scene-panel,
#app.tour-start-pending .viewer-brand,
#app.tour-start-pending .skin-overlay-root {
  visibility: hidden !important;
  pointer-events: none !important;
}

html.tour-start-active #panorama,
#app.tour-start-pending #panorama {
  visibility: hidden;
}

.tour-start-screen__card {
  max-width: 520px;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.tour-start-screen__cover {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #000;
  max-height: 200px;
}

.tour-start-screen__cover img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.tour-start-screen__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.tour-start-screen__desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tour-start-screen__btn {
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.route-nav {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.3rem;
  background: rgba(12, 15, 20, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.route-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.route-nav__btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--accent);
}

.route-nav__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.route-nav__icon {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.85;
}

.route-nav__counter {
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 3.25rem;
  padding: 0.35rem 0.65rem;
  text-align: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.hotspot-groups {
  position: fixed;
  top: 4.5rem;
  right: 0.75rem;
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: min(360px, 90vw);
  padding: 0.35rem 0.5rem;
  background: rgba(12, 15, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.72rem;
}

.hotspot-groups__label {
  color: var(--text-muted);
}

.hotspot-groups__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--bg-hover);
  cursor: pointer;
}

.panorama-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.panorama-bloom {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s;
  mix-blend-mode: screen;
}

#panorama {
  position: relative;
}

.scene-map-floor {
  position: relative;
  min-height: 160px;
  background: var(--bg-hover);
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.scene-map-floor--has-image {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  aspect-ratio: 4 / 3;
  min-height: 120px;
  border-style: solid;
}

.scene-map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 56px;
}

.scene-map-pin__thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #000;
  position: relative;
}

.scene-map-pin.active .scene-map-pin__thumb {
  border-color: var(--scene-map-active, var(--accent));
}

.scene-map-pin__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-map-pin__label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  max-width: 72px;
  text-align: center;
}

.scene-map-poi {
  position: absolute;
  bottom: 2px;
  right: 2px;
  display: flex;
  gap: 2px;
}

.scene-map-poi__badge {
  font-size: 0.55rem;
  padding: 1px 4px;
  border-radius: 4px;
  color: #fff;
}

.scene-map-poi__badge--info {
  background: #3b82f6;
}

.scene-map-poi__badge--link {
  background: #22c55e;
}

.scene-map-poi__badge--gallery {
  background: #8b5cf6;
}

.info-modal__md-p {
  margin: 0 0 0.5rem;
}

.info-modal__md-list {
  margin: 0 0 0.5rem 1rem;
  padding: 0;
}

.info-external-link {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) * 0.75);
  background: var(--info-cta-bg, var(--accent));
  color: var(--info-cta-text, #fff) !important;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s, transform 0.1s;
}

.info-external-link:hover {
  background: var(--info-cta-hover, var(--accent-hover));
  color: var(--info-cta-text, #fff) !important;
  transform: translateY(-1px);
}

.info-modal__hero {
  margin: -1rem -1rem 0.75rem;
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-hover);
  max-height: 220px;
}

.info-modal__hero-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.info-modal__hero--error {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.skin-info-hero .info-modal__card .modal__body {
  padding-top: 1rem;
}

.info-modal__block-heading {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--info-header-bg, var(--accent));
}

.info-modal__block-heading:first-child,
.info-modal__hero + .info-modal__block-heading {
  margin-top: 0;
}

.info-modal__block-text {
  margin-top: 0.25rem;
}

.info-modal__divider {
  border: 0;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  margin: 0.75rem 0;
}

.info-modal__bullets {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.info-modal__bullets li {
  margin-bottom: 0.25rem;
}

.info-modal__features {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  margin: 0.35rem 0 0.65rem;
  font-size: 0.875rem;
}

.info-modal__feature {
  display: contents;
}

.info-modal__feature-label {
  color: var(--text-muted, rgba(255, 255, 255, 0.65));
}

.info-modal__feature-value {
  font-weight: 600;
  text-align: right;
}

.scene-item--drag {
  opacity: 0.5;
}

.scene-item__actions {
  display: flex;
  gap: 0.25rem;
}

.embed-presets {
  margin-top: 0.75rem;
}

.embed-presets__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.effects-panel .effects-block {
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.effects-panel .effects-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.effects-block__title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.effects-slider {
  display: block;
  margin-bottom: 0.55rem;
}

.effects-slider span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.effects-slider input[type='range'] {
  width: 100%;
}

.effects-place-btn {
  width: 100%;
  margin: 0.35rem 0 0.5rem;
  border-color: #d97706;
  color: #fbbf24;
}

.effects-place-btn:hover {
  background: rgba(217, 119, 6, 0.15);
  color: #fcd34d;
}

.effects-readout {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.effects-save-btn {
  width: 100%;
  margin-bottom: 0.75rem;
}

.flare-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.flare-list__item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.flare-list__select {
  flex: 1;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
}

.flare-list__item--active .flare-list__select {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.12);
}

.flare-list__remove {
  flex-shrink: 0;
  min-width: 1.75rem;
  padding: 0.2rem 0.4rem;
}

.flare-list-actions {
  margin-bottom: 0.65rem;
}

.flare-editor {
  padding-top: 0.35rem;
}

.flare-level-hint {
  margin-top: -0.25rem;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.field-row {
  display: block;
  margin-bottom: 0.55rem;
}

.field-row span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.field-row input[type='text'],
.field-row select {
  width: 100%;
}

.flare-custom-spots {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.flare-custom-spots__title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.flare-custom-spot-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.flare-custom-spot {
  padding: 0.5rem;
  margin-bottom: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.flare-custom-spot__tex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.flare-custom-spot__tex-name {
  flex: 1;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flare-custom-spot__remove {
  margin-left: auto;
}

.effects-panel .effects-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.35rem;
}

.effects-row--map label {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}

.effects-row--map input {
  width: 100%;
}

/* Hotspot tooltip + viewer UI v0.3 */
.hotspot-tooltip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  transform: translate(-50%, -100%);
  max-width: 220px;
  padding: 0.35rem 0.6rem;
  background: rgba(12, 15, 20, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar__logo {
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.top-bar__actions button.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

.editor-toolbar .tool-btn.active#btn-safe-mode {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.hotspot-toolbar {
  margin-bottom: 0.65rem;
}

.hotspot-search {
  width: 100%;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}

.hotspot-toolbar__safe {
  margin-bottom: 0.25rem;
}

.youtube-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.youtube-modal__card {
  width: min(960px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.youtube-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.youtube-modal__head h3 {
  font-size: 0.95rem;
}

.youtube-modal__body {
  position: relative;
  padding-top: 56.25%;
  background: #000;
}

.youtube-modal__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* —— Tour menu (krpano Menu lite) —— */
.tour-menu {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.tour-menu--open {
  pointer-events: auto;
}

.tour-menu__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--menu-width, 320px);
  max-width: 92vw;
  background: var(--menu-bg, rgba(18, 22, 28, 0.94));
  color: var(--menu-text, #f0f4f8);
  border-radius: 0 var(--menu-radius, 12px) var(--menu-radius, 12px) 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  transform: translateX(0);
  transition: transform 0.25s ease;
}

.tour-menu__panel.hidden {
  transform: translateX(-105%);
  pointer-events: none;
}

.tour-menu__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tour-menu__title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.tour-menu__back,
.tour-menu__close {
  flex-shrink: 0;
}

.tour-menu__logo-wrap {
  padding: 0.75rem;
  text-align: center;
}

.tour-menu__logo {
  max-height: 56px;
  max-width: 100%;
  object-fit: contain;
}

.tour-menu__search {
  padding: 0.5rem 0.75rem;
}

.tour-menu__search-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
}

.tour-menu__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.75rem 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--menu-gap, 8px);
}

.tour-menu__empty {
  padding: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
}

.tour-menu__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.tour-menu__btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.tour-menu__btn--head {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.7rem 0.75rem;
}

.tour-menu__btn--thumbnail,
.tour-menu__btn--picture {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.tour-menu__btn-thumb {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
}

.tour-menu__btn--picture .tour-menu__btn-thumb {
  height: 96px;
}

.tour-menu__btn--thumbnail .tour-menu__btn-label,
.tour-menu__btn--picture .tour-menu__btn-label {
  padding: 0.45rem 0.65rem;
}

.tour-menu__btn-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.tour-menu__btn-label {
  flex: 1;
}

.tour-menu__btn-chevron {
  opacity: 0.55;
  font-size: 1.1rem;
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.media-modal__card {
  background: var(--surface, #1a1f28);
  border-radius: 12px;
  max-width: 96vw;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.media-modal__card--image {
  max-width: min(920px, 96vw);
}

.media-modal__card--url {
  width: min(960px, 96vw);
  height: min(80vh, 720px);
}

.media-modal__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.media-modal__head h3 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
}

.media-modal__body {
  flex: 1;
  overflow: auto;
  padding: 0.75rem;
  position: relative;
  min-height: 120px;
}

.media-modal__image {
  max-width: 100%;
  max-height: 75vh;
  display: block;
  margin: 0 auto;
}

.media-modal__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Easy HTML Lightbox–style overlays */
body.html-lightbox-open {
  overflow: hidden;
}

.html-lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.html-lightbox--url-fs {
  padding: 0;
  background: #1e1e1e;
}

.html-lightbox--instant {
  animation: html-lightbox-in 0.18s ease-out;
}

@keyframes html-lightbox-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.html-lightbox--url-fs .html-lightbox__card {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 0;
  box-shadow: none;
}

.html-lightbox--url-fs .html-lightbox__head {
  flex-shrink: 0;
  min-height: 40px;
  background: #1e1e1e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.html-lightbox--url-fs .html-lightbox__body {
  flex: 1;
  min-height: 0;
  padding: 0;
}

.html-lightbox--url-fs .html-lightbox__iframe,
.html-lightbox--url-fs.html-lightbox--video .html-lightbox__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}

.html-lightbox--video:not(.html-lightbox--url-fs) .html-lightbox__body {
  min-height: 360px;
}

.html-lightbox__card {
  background: #1e1e1e;
  color: #f4f4f5;
  border-radius: 10px;
  max-width: 96vw;
  max-height: 94vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  position: relative;
}

.html-lightbox__card--zoom {
  width: min(960px, 96vw);
  height: min(85vh, 720px);
}

.html-lightbox__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.html-lightbox__title {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.html-lightbox__ext-link {
  font-size: 0.78rem;
  color: #a78bfa;
  text-decoration: none;
}

.html-lightbox__ext-link:hover {
  text-decoration: underline;
}

.html-lightbox__close {
  border: 0;
  background: transparent;
  color: #a1a1aa;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.html-lightbox__close:hover {
  color: #fff;
}

.html-lightbox__body {
  flex: 1;
  overflow: auto;
  position: relative;
  min-height: 100px;
}

.html-lightbox--url .html-lightbox__body,
.html-lightbox--video .html-lightbox__body {
  min-height: 280px;
}

.html-lightbox__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}

.html-lightbox__video {
  width: 100%;
  max-height: 75vh;
  display: block;
  margin: 0 auto;
  background: #000;
}

.html-lightbox__image {
  max-width: 100%;
  max-height: 78vh;
  display: block;
  margin: 0 auto;
}

.html-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.html-lightbox__nav.hidden {
  display: none;
}

.html-lightbox__prev {
  left: 8px;
}

.html-lightbox__next {
  right: 8px;
}

.html-lightbox__counter {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  z-index: 2;
}

.html-lightbox__zoom-stage {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: #141414;
}

.html-lightbox__zoom-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}

.html-lightbox__infobox {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
}

.html-lightbox__infobox-media {
  position: relative;
  min-height: 160px;
}

.html-lightbox__infobox-img {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  background: #111;
}

.html-lightbox__infobox-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #d4d4d8;
}

.menu-editor__subtitle {
  font-size: 0.85rem;
  margin: 0.75rem 0 0.35rem;
  color: var(--text-muted);
}

.menu-tree__item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.menu-tree__select {
  flex: 1;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  font-size: 0.85rem;
  cursor: pointer;
}

.menu-tree__select--active {
  border-color: var(--accent, #3d8bfd);
  background: rgba(61, 139, 253, 0.12);
}

.menu-tree__add-child,
.menu-tree__remove {
  flex-shrink: 0;
  padding: 0.2rem 0.45rem;
}

.menu-item-editor {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}

