:root {
  --vt-navy: #0a1520;
  --vt-gold: #c49a2a;
  --vt-gold-light: #e8c567;
  --vt-text: #f8fafc;
  --vt-muted: rgba(255,255,255,.55);
  --vt-glass: rgba(8, 14, 22, .72);
  --vt-glass-soft: rgba(0, 0, 0, .32);
  --vt-border: rgba(255,255,255,.12);
  --vt-ui-h: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--vt-navy);
  color: var(--vt-text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.vtour-body { overflow: hidden; }

.vtour-app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.vtour-stage {
  position: absolute;
  inset: 0;
}
.vtour-viewer { width: 100%; height: 100%; touch-action: none; }
.vtour-viewer .pnlm-container { background: var(--vt-navy); touch-action: none; }

/* Loader — icon only */
.vtour-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 21, 32, .45);
  z-index: 10;
  transition: opacity .25s;
  pointer-events: none;
}
.vtour-loader.is-hidden { opacity: 0; }
.vtour-loader-ring {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--vt-gold-light);
  border-radius: 50%;
  animation: vtourSpin .7s linear infinite;
}
@keyframes vtourSpin { to { transform: rotate(360deg); } }

.vtour-viewer .pnlm-grab { cursor: grab; }
.vtour-viewer .pnlm-grabbing { cursor: grabbing; }

/* Hint — ẩn sau vài giây */
.vtour-hint {
  position: absolute;
  left: 50%;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 11;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, .88);
  background: rgba(0, 0, 0, .42);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  pointer-events: none;
  white-space: nowrap;
  opacity: 1;
  transition: opacity .5s ease;
}
.vtour-hint.is-hidden { opacity: 0; }
.vtour-chrome.is-idle .vtour-hint { opacity: 0; }

/* Floating chrome — auto hide */
.vtour-chrome {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  transition: opacity .35s ease;
}
.vtour-chrome.is-idle { opacity: 0; }
.vtour-chrome.is-idle .vtour-scene-label { opacity: 0; }
.vtour-chrome.is-idle .vtour-toolbar-wrap { opacity: 0; pointer-events: none; }
.vtour-chrome > * { pointer-events: auto; }

.vtour-topbar {
  display: contents;
}
#vtourSceneBadge {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  z-index: 13;
  min-height: var(--vt-ui-h);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--vt-glass-soft);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.vtour-scene-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--vt-gold-light);
  font-variant-numeric: tabular-nums;
}
.vtour-home-link {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  z-index: 13;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--vt-ui-h);
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: var(--vt-glass-soft);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s, border-color .18s;
}
.vtour-home-link:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(196, 154, 42, .35);
  color: var(--vt-gold-light);
}
#vtourSceneBadge {
  left: max(108px, calc(8px + env(safe-area-inset-left) + 100px));
}
.vtour-topbar-actions {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  z-index: 13;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--vt-glass-soft);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
}
.vtour-icon-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}
.vtour-icon-btn:hover { background: rgba(255,255,255,.1); }
.vtour-icon-btn.is-active {
  background: rgba(196, 154, 42, .22);
  color: var(--vt-gold-light);
}

.vtour-scene-label {
  position: absolute;
  left: 50%;
  top: max(8px, env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 12;
  max-width: min(240px, calc(100% - 120px));
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  border: none;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85), 0 0 10px rgba(0, 0, 0, .45);
  pointer-events: none;
  opacity: 1;
  transition: opacity .4s;
}
.vtour-scene-label:empty { display: none; }
.vtour-scene-label.is-fade { opacity: 0; }

.vtour-toolbar-wrap {
  position: absolute;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 12;
  transition: opacity .35s ease;
}
.vtour-nav-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  min-width: 160px;
  max-width: min(260px, calc(100vw - 24px));
  max-height: min(38vh, 220px);
  padding: 4px;
  border-radius: 12px;
  background: rgba(8, 14, 22, .92);
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.vtour-nav-pop[hidden] { display: none !important; }
.vtour-nav-strip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: min(36vh, 208px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vtour-nav-strip::-webkit-scrollbar { display: none; }
.vtour-nav-chip {
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background .15s;
}
.vtour-nav-chip:hover { background: rgba(255, 255, 255, .1); }
.vtour-nav-chip:active { background: rgba(255, 255, 255, .14); }

.vtour-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border-radius: 999px;
  background: var(--vt-glass-soft);
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
}
.vtour-tool-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .12s;
}
.vtour-tool-btn:hover { background: rgba(255,255,255,.1); }
.vtour-tool-btn:active { transform: scale(.92); }
.vtour-tool-btn.is-active {
  background: rgba(196, 154, 42, .22);
  color: var(--vt-gold-light);
}

/* Drawer — scene list */
.vtour-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 86vw);
  height: 100%;
  background: rgba(10, 16, 24, .94);
  border-left: 1px solid var(--vt-border);
  z-index: 30;
  transform: translateX(100%);
  transition: transform .28s ease;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
}
.vtour-drawer.is-open { transform: translateX(0); }
.vtour-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.vtour-drawer-head__label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, .75);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vtour-drawer-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(196, 154, 42, .18);
  border: 1px solid rgba(196, 154, 42, .35);
  font-size: 10px;
  font-weight: 700;
  color: var(--vt-gold-light);
  font-variant-numeric: tabular-nums;
}
.vtour-drawer-head .vtour-icon-btn {
  width: 28px;
  height: 28px;
  font-size: 18px;
}
.vtour-scene-list {
  overflow: auto;
  padding: 8px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.vtour-scene-item {
  display: grid;
  grid-template-columns: 26px 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background .18s, border-color .18s, transform .12s;
}
.vtour-scene-item:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .1);
}
.vtour-scene-item.is-active {
  background: rgba(196, 154, 42, .14);
  border-color: rgba(196, 154, 42, .5);
  box-shadow: inset 3px 0 0 var(--vt-gold);
}
.vtour-scene-item:active { transform: scale(.99); }
.vtour-scene-item__idx {
  font-size: 11px;
  font-weight: 700;
  color: var(--vt-muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.vtour-scene-item.is-active .vtour-scene-item__idx {
  color: var(--vt-gold-light);
}
.vtour-scene-item__thumb {
  width: 76px;
  height: 42px;
  border-radius: 7px;
  overflow: hidden;
  background: #1a2a3c;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.vtour-scene-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.vtour-scene-item__title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vtour-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 25;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.vtour-drawer-backdrop:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

/* Hotspots — Kuula-style: ring + label always visible */
.pnlm-hotspot-base.vtour-hotspot {
  width: 0;
  height: 0;
  cursor: pointer;
  z-index: 2;
}
.pnlm-hotspot-base.vtour-hotspot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .35);
  animation: vtourHsPulse 2.6s ease-in-out infinite;
  transition: transform .2s, border-color .2s, background .2s;
}
.pnlm-hotspot-base.vtour-hotspot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .4);
  transition: transform .2s;
}
.pnlm-hotspot-base.vtour-hotspot:hover::before {
  transform: scale(1.1);
  border-color: #fff;
  background: rgba(255, 255, 255, .22);
  animation: none;
}
.pnlm-hotspot-base.vtour-hotspot:hover::after {
  transform: scale(1.15);
}
.pnlm-hotspot-base.vtour-hotspot span {
  position: absolute !important;
  left: 50% !important;
  top: auto !important;
  bottom: 100% !important;
  transform: translateX(-50%) !important;
  margin: 0 0 10px 0 !important;
  width: auto !important;
  max-width: min(220px, 42vw) !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: .01em !important;
  line-height: 1.3 !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  opacity: 1 !important;
  pointer-events: none !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .9),
    0 0 12px rgba(0, 0, 0, .55) !important;
  transition: transform .2s, text-shadow .2s !important;
}
.pnlm-hotspot-base.vtour-hotspot:hover span {
  transform: translateX(-50%) scale(1.04) !important;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 1),
    0 0 16px rgba(0, 0, 0, .7) !important;
}
@keyframes vtourHsPulse {
  0%, 100% { transform: scale(1); opacity: .95; }
  50% { transform: scale(1.1); opacity: .72; }
}
.pnlm-hotspot-base.vtour-hotspot.vtour-hotspot-guide::before {
  border-color: var(--vt-gold-light);
  background: rgba(196, 154, 42, .28);
  animation: vtourHsGuide 1.4s ease-in-out infinite;
}
@keyframes vtourHsGuide {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232, 197, 103, .55); }
  50% { transform: scale(1.14); box-shadow: 0 0 0 10px rgba(232, 197, 103, 0); }
}

/* Minimap */
.vtour-minimap {
  position: absolute;
  left: max(8px, env(safe-area-inset-left));
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  z-index: 14;
  width: min(200px, 42vw);
  border-radius: 12px;
  background: rgba(8, 14, 22, .9);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  overflow: hidden;
  transform: translateY(8px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.vtour-minimap.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.vtour-chrome.is-minimap-open { opacity: 1; }
.vtour-minimap__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 6px 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.vtour-minimap__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
}
.vtour-minimap__head .vtour-icon-btn { width: 24px; height: 24px; font-size: 16px; }
.vtour-minimap__body { padding: 6px 8px 8px; }
.vtour-minimap__body svg { display: block; width: 100%; height: auto; }
.vtour-minimap__outline {
  fill: rgba(255, 255, 255, .04);
  stroke: rgba(255, 255, 255, .18);
  stroke-width: .6;
}
.vtour-minimap__floor-label {
  font-size: 3.2px;
  font-weight: 700;
  fill: rgba(255, 255, 255, .35);
  letter-spacing: .08em;
}
.vtour-minimap__dot {
  cursor: pointer;
  stroke: rgba(255, 255, 255, .85);
  stroke-width: .9;
  fill: rgba(255, 255, 255, .25);
  transition: fill .15s, stroke .15s, r .15s;
}
.vtour-minimap__dot:hover { fill: rgba(255, 255, 255, .5); }
.vtour-minimap__dot.is-current {
  fill: var(--vt-gold);
  stroke: #fff;
  stroke-width: 1.1;
}
.vtour-minimap__dot.is-next {
  fill: rgba(196, 154, 42, .45);
  stroke: var(--vt-gold-light);
  animation: vtourMapPulse 1.5s ease-in-out infinite;
}
.vtour-minimap__dot.is-visited {
  fill: rgba(255, 255, 255, .12);
  stroke: rgba(255, 255, 255, .35);
}
@keyframes vtourMapPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.vtour-minimap__tip {
  font-size: 3px;
  font-weight: 600;
  fill: #fff;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.vtour-minimap__dot.is-current + .vtour-minimap__tip,
.vtour-minimap__dot.is-next + .vtour-minimap__tip { opacity: 1; }

/* Guided tour bar */
.vtour-guided {
  position: absolute;
  left: 50%;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 13;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 16px));
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: rgba(8, 14, 22, .92);
  border: 1px solid rgba(196, 154, 42, .45);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.vtour-guided[hidden] { display: none !important; }
.vtour-guided__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.vtour-guided__step {
  font-size: 9px;
  font-weight: 700;
  color: var(--vt-gold-light);
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
}
.vtour-guided__label {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vtour-guided__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.vtour-guided__btn {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: background .15s;
}
.vtour-guided__btn:hover { background: rgba(255, 255, 255, .14); }
.vtour-guided__btn--primary {
  background: rgba(196, 154, 42, .35);
  color: var(--vt-gold-light);
  padding: 6px 12px;
}
.vtour-guided__btn--primary:hover { background: rgba(196, 154, 42, .5); }
.vtour-chrome.is-guided .vtour-hint { opacity: 0; }
.vtour-chrome.is-guided .vtour-minimap {
  bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}

/* Legacy fallback if cssClass missing */
.pnlm-hotspot-base:not(.vtour-hotspot) { cursor: pointer; }

.pnlm-load-box, .pnlm-load-button,
.pnlm-controls, .pnlm-zoom-controls, .pnlm-compass,
.pnlm-panorama-info, .pnlm-about-msg {
  display: none !important;
}

@media (max-width: 480px) {
  .vtour-hint {
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
    white-space: normal;
    text-align: center;
    font-size: 10px;
    line-height: 1.35;
  }
  .vtour-minimap {
    width: min(168px, 46vw);
    bottom: calc(50px + env(safe-area-inset-bottom, 0px));
  }
  .vtour-guided {
    flex-direction: column;
    align-items: stretch;
    border-radius: 14px;
    bottom: calc(50px + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px;
  }
  .vtour-guided__actions { justify-content: flex-end; }
  .vtour-scene-label { max-width: calc(100% - 120px); font-size: 10px; }
  .vtour-tool-btn { width: 30px; height: 30px; }
  .vtour-nav-pop { max-width: calc(100vw - 16px); }
  .vtour-drawer { width: min(280px, 92vw); }
  .vtour-scene-item {
    grid-template-columns: 24px 68px minmax(0, 1fr);
    gap: 8px;
    padding: 6px;
  }
  .vtour-scene-item__thumb { width: 68px; height: 38px; }
  .vtour-scene-item__title { font-size: 11px; }
  .vtour-home-link__text { display: none; }
  .vtour-home-link { padding: 0 8px; }
  #vtourSceneBadge { left: max(48px, calc(8px + env(safe-area-inset-left) + 40px)); }
}
