.tour-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip-light {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.24);
}

.chip-light.is-active {
  background: #A8D437;
  color: #0E3A66;
  border-color: #A8D437;
}

.tour-stage-shell {
  border-radius: var(--radius-outer);
  background: var(--navy-deep);
  padding: 12px;
  border: 1px solid rgba(14, 58, 102, 0.25);
  box-shadow: 0 24px 56px -18px rgba(9, 40, 71, 0.42);
}

.tour-visual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tour-3d-pane {
  position: relative;
  height: 255px;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 60% 35%, #164f87 0%, #092847 72%, #061b31 100%);
}

.tour-3d-canvas {
  position: absolute;
  inset: 0;
  cursor: grab;
}

.tour-3d-canvas:active {
  cursor: grabbing;
}

.tour-pane-badge,
.tour-elev-badge {
  position: absolute;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(9, 40, 71, 0.82);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.tour-pane-badge {
  top: 10px;
  left: 10px;
}

.tour-elev-badge {
  bottom: 10px;
  right: 10px;
  color: #A8D437;
}

#palermo-map-pane.map-viewport {
  position: relative;
  height: 235px;
  min-height: 235px;
  border-radius: 14px;
  overflow: hidden;
}

#palermo-map {
  position: absolute;
  inset: 0;
}

[data-mode="3d"] #palermo-map-pane {
  display: none;
}

[data-mode="3d"] .tour-3d-pane {
  height: 430px;
}

[data-mode="map"] .tour-3d-pane {
  display: none;
}

[data-mode="map"] #palermo-map-pane {
  height: 430px;
  min-height: 430px;
}

.tour-video-dock {
  position: relative;
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  background: #061b31;
}

.tour-video-dock video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.tour-video-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(9, 40, 71, 0.94);
}

.btn-video-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-video-mini.is-on {
  background: rgba(168, 212, 55, 0.18);
  border-color: #A8D437;
  color: #A8D437;
}

.tour-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.tour-progress-fill {
  height: 100%;
  width: 0%;
  background: #A8D437;
  transition: width 120ms linear;
}

#load-palermo-map,
.tour-map-notice {
  position: absolute;
  z-index: 2;
  left: 12px;
}

#load-palermo-map {
  top: 12px;
}

.tour-map-notice {
  top: 8px;
  right: 58px;
  width: fit-content;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 0.84rem;
  pointer-events: none;
}

.tour-map-hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-inner);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tour-map-hud span {
  display: block;
  color: #A8D437;
  font-size: 0.78rem;
  font-weight: 700;
}

.tour-drag-hint {
  color: rgba(255, 255, 255, 0.72) !important;
  font-weight: 500 !important;
  font-size: 0.74rem !important;
}

.tour-map-credit {
  margin: 8px 4px 0;
  color: var(--ink-secondary);
  font-size: 0.8rem;
}

.editorial-chapter {
  display: grid;
  gap: 14px;
  padding: 28px 0 34px;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 95px;
  opacity: 0.78;
  transition: opacity 260ms ease, border-color 260ms ease;
}

.editorial-chapter.is-active {
  opacity: 1;
  border-bottom-color: var(--lime);
}

.chapter-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.photo-organic-frame {
  margin: 4px 0;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
}

.photo-organic-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
  .editorial-chapter:hover .photo-organic-frame img {
    transform: scale(1.03);
  }
}

.chapter-context {
  padding: 14px 16px;
  border-left: 4px solid var(--lime);
  background: rgba(14, 58, 102, 0.04);
  border-radius: 0 14px 14px 0;
  font-size: 0.9rem;
}

.chapter-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.chapter-close-banner {
  margin-top: 24px;
  padding: 28px;
  border-radius: var(--radius-outer);
  background: var(--navy);
  color: #FFFFFF;
  display: grid;
  gap: 10px;
}

.scrolly-layout:has(#map-column[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

#map-column {
  scroll-margin-top: 95px;
}

.cm-map-pin {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #0E3A66;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14, 58, 102, 0.45);
}

.cm-map-pin.is-active-pin {
  z-index: 1;
  background: #A8D437;
  color: #0E3A66;
}

@media (max-width: 960px) {
  .tour-3d-pane {
    height: 210px;
  }
  #palermo-map-pane.map-viewport {
    height: 200px;
    min-height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editorial-chapter {
    opacity: 1;
    transition: none;
  }
  .photo-organic-frame img {
    transition: none;
  }
}
