.circle-btn.tiny {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.circle-btn.tiny svg {
  width: 16px;
  height: 16px;
}

:root {
  --primary: #14b8a6;
  --primary-soft: rgba(20, 184, 166, 0.16);
  --bg: #020617;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* để full-screen không bị dôi chiều cao */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER (hiện anh đang comment HTML nên phần này không ảnh hưởng) */

.app-header {
  display: flex;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at top left, var(--primary-soft), #020617);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--primary);
  color: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9), 0 10px 25px rgba(15, 23, 42, 0.8);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

/* MAIN + VIEWER */

.app-main {
  flex: 1;
  min-height: 0;
}

/* ✅ SỬA Ở ĐÂY: dùng 100vh + padding = 0 để không bị dải đen */
.viewer-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 0;
  overflow: hidden;
  background: #000;
}

.viewer-wrapper iframe {
  width: 100%;
  height: 100%;
  border-radius: 0;              /* nếu thích bo góc thì đổi lại 14px */
  border: none;
  background: #000;
  display: block;
}

/* ===== DUAL VIEWER (Day/Night) – 2 iframe chồng lên nhau ===== */
.viz4d-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
  transition: opacity 0.5s ease;
}

.viz4d-frame.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.viz4d-frame.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Hotspot / vModal-embed mở trong iframe → ẩn overlay custom của parent */
.viewer-wrapper.is-viz4d-popup-open .custom-side-menu,
.viewer-wrapper.is-viz4d-popup-open .tour-bar,
.viewer-wrapper.is-viz4d-popup-open .right-toolbar-panel,
.viewer-wrapper.is-viz4d-popup-open .area-nav,
.viewer-wrapper.is-viz4d-popup-open .viewer-topright {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.viewer-wrapper.is-viz4d-popup-open .viz4d-frame.is-active {
  z-index: 2;
}

/* ===== MASK CHE UI GỐC ===== */

/* Cột bên phải – che hết icon xanh */
.viewer-mask-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px; /* đủ rộng để che cả cột icon */
  background: rgba(15, 23, 42, 0.96);
  border-left: 1px solid rgba(148, 163, 184, 0.5);
  z-index: 9000;
}

/* Góc trên trái – che nút (i) info */
.viewer-mask-top-left {
  position: absolute;
  left: 0;
  top: 0;
  width: 90px;
  height: 90px;
  background: rgba(15, 23, 42, 0.96);
  border-bottom-right-radius: 24px;
  border-right: 1px solid rgba(148, 163, 184, 0.4);
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  z-index: 9000;
}

/* ===== CustomSideMenu — khớp viz4d #CustomSideMenu (.custom-side-menu) ===== */
.custom-side-menu {
  position: absolute;
  left: 2px;
  top: 4px;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0;
  background: #35424678;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid #c0e0e1c9;
  border-radius: 13px;
  pointer-events: auto;
  max-height: calc(100% - 20px);
  overflow-y: auto;
  overflow-x: hidden;
}

.custom-side-menu::-webkit-scrollbar {
  width: 3px;
}

.custom-side-menu::-webkit-scrollbar-track {
  background: transparent;
}

.custom-side-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
}

.custom-side-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

.custom-side-menu-item {
  pointer-events: all;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  margin: 0 4px;
  color: #ffffff;
}

.custom-side-menu-item.single-panel {
  width: 48px;
  height: 48px;
}

.custom-side-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.custom-side-menu-item:hover .custom-side-menu-label {
  color: #ffffff;
}

.custom-side-menu-item:active {
  transform: scale(0.95);
}

.custom-side-menu-item.active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.custom-side-menu-item.active .custom-side-menu-label {
  color: #ffffff;
}

.custom-side-menu-item.active .custom-side-menu-icon-svg {
  fill: #ffffff;
}

.custom-side-menu-item-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  padding: 4px;
}

.custom-side-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.custom-side-menu-icon-svg {
  width: 100%;
  height: 100%;
  fill: #ffffff;
  transition: fill 0.25s ease;
}

.custom-side-menu-item:hover .custom-side-menu-icon-svg {
  fill: #ffffff;
}

.custom-side-menu-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.25s ease;
}

.custom-side-menu-item:hover .custom-side-menu-icon-img {
  filter: drop-shadow(0px 0px 8px rgba(255, 255, 255, 0.6));
}

.custom-side-menu-label {
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: -0.2px;
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  width: 100%;
  opacity: 1;
  text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.9);
  transition: color 0.25s ease;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 992px) {
  .custom-side-menu {
    gap: 8px;
  }

  .custom-side-menu-icon {
    width: 24px;
    height: 24px;
  }

  .custom-side-menu-label {
    font-size: 11px;
  }
}

@media (max-width: 990px) {
  .custom-side-menu-item {
    width: 50px;
    height: 50px;
  }

  .custom-side-menu-item.single-panel {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 768px) {
  .custom-side-menu {
    padding: 4px 0;
    gap: 4px;
  }

  .custom-side-menu-item {
    width: 40px;
    height: 40px;
  }

  .custom-side-menu-item.single-panel {
    width: 40px;
    height: 40px;
  }

  .custom-side-menu-item-inner {
    width: 40px;
    padding: 2px;
  }

  .custom-side-menu-icon {
    width: 18px;
    height: 18px;
  }

  .custom-side-menu-label {
    font-size: 9px;
  }
}

/* Legacy video button styles kept for reference — menu dùng custom-side-menu */
.viewer-topleft {
  display: none;
}

.video-menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 70px;
  padding: 10px 8px 8px;
  border: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 8px 20px rgba(15, 23, 42, 0.75);
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    box-shadow 0.15s ease;
}

.video-menu-btn:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: translateY(-1px);
}

.video-menu-btn:active {
  transform: translateY(0) scale(0.98);
}

.video-menu-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.video-menu-btn__icon img,
.video-menu-btn__icon-img {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
}

.video-menu-btn__label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
}

/* ===== POPUP VIDEO (khớp kích thước video, không header) ===== */
.video-modal {
  --video-modal-inset-y: 9vh;
  --video-modal-inset-top: calc(9vh + 44px);
  --video-modal-inset-x: 2.5vw;
  --video-modal-max-scale: 0.9;
  --video-modal-radius: 14px;
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--video-modal-inset-top) var(--video-modal-inset-x)
    var(--video-modal-inset-y);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.video-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.video-modal__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  transform: scale(0.94);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    width 0.25s ease,
    height 0.25s ease;
}

.video-modal.is-open .video-modal__stage {
  transform: scale(1);
  opacity: 1;
}

/* Khung video khớp pixel video — shadow tím nổi khối */
.video-modal__panel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  border-radius: var(--video-modal-radius);
  border: 1px solid rgba(167, 139, 250, 0.14);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 16px 40px rgba(0, 0, 0, 0.46),
    0 32px 72px rgba(0, 0, 0, 0.52),
    0 0 52px rgba(139, 92, 246, 0.2),
    0 28px 64px rgba(99, 102, 241, 0.16);
}

.video-modal__viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.video-modal__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Nút đóng neo theo stage (= đúng chiều rộng video), sát cạnh phải */
.video-modal__close {
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(167, 139, 250, 0.38);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 0 18px rgba(139, 92, 246, 0.42),
    0 4px 16px rgba(0, 0, 0, 0.38);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.video-modal__close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(196, 181, 253, 0.62);
  box-shadow:
    0 0 24px rgba(139, 92, 246, 0.55),
    0 6px 20px rgba(0, 0, 0, 0.42);
  transform: scale(1.06);
}

.video-modal__close:active {
  transform: scale(0.96);
}

.video-modal__player,
.video-modal__iframe {
  display: block;
  width: 100%;
  border: none;
  background: #000;
  vertical-align: top;
}

.video-modal__player {
  height: auto;
}

.video-modal__iframe {
  height: 100%;
}

.video-modal__player[hidden],
.video-modal__iframe[hidden] {
  display: none;
}

@media (max-width: 768px) {
  .video-modal {
    --video-modal-inset-y: 8vh;
    --video-modal-inset-top: 8vh;
    --video-modal-inset-x: 0;
    --video-modal-max-scale: 0.94;
    --video-modal-radius: 12px;
  }

  /* Mobile: nút X overlay góc phải trên video */
  .video-modal__close {
    top: 12px;
    right: 12px;
    bottom: auto;
    margin-bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(167, 139, 250, 0.35);
  }
}

@media (max-height: 520px) {
  .video-modal {
    --video-modal-inset-y: 6vh;
    --video-modal-inset-top: calc(6vh + 28px);
    --video-modal-max-scale: 0.88;
  }

  .video-modal__close {
    top: 8px;
    right: 8px;
    bottom: auto;
    margin-bottom: 0;
  }
}

/* Embed modal (Maps / PDF) — cùng shell & animation với video-modal */
.embed-modal {
  z-index: 9600;
}

.embed-modal .video-modal__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* ===== Safari / iOS overrides (Chrome giữ CSS mặc định ở trên) ===== */
html.is-safari,
html.is-ios {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-safari body,
html.is-ios body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  width: 100%;
}

html.is-safari .app,
html.is-ios .app {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  height: 100dvh;
  height: -webkit-fill-available;
  overflow: hidden;
}

html.is-safari .viewer-wrapper,
html.is-ios .viewer-wrapper {
  height: 100dvh;
  height: -webkit-fill-available;
}

/* Menu trái: fixed + GPU layer để không bị iframe che (WebKit iOS) */
html.is-safari .custom-side-menu,
html.is-ios .custom-side-menu {
  position: fixed;
  left: max(2px, env(safe-area-inset-left, 0px));
  top: max(4px, env(safe-area-inset-top, 0px));
  z-index: 9500;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  isolation: isolate;
  /* Nền đặc fallback khi backdrop-filter không ổn định trên Safari */
  background: rgba(53, 66, 70, 0.88);
}

/* Modal đóng: gỡ khỏi flow document (tránh Panel/Video ở cuối trang khi scroll) */
html.is-safari .video-modal:not(.is-open),
html.is-ios .video-modal:not(.is-open) {
  display: none !important;
}

html.is-safari .video-modal.is-open,
html.is-ios .video-modal.is-open {
  display: flex;
}

/* sr-only: clip-path thay clip:rect (Safari mới) */
html.is-safari .video-modal__sr-only,
html.is-ios .video-modal__sr-only {
  clip-path: inset(50%);
  clip: rect(0 0 0 0);
}

/* Trong iframe welcome: ép modal fixed gắn viewport iframe */
html.is-safari.in-iframe .video-modal.is-open,
html.is-ios.in-iframe .video-modal.is-open {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

html.is-safari.in-iframe .viz4d-frame.is-active,
html.is-ios.in-iframe .viz4d-frame.is-active {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* ===== CỤM ĐIỀU KHIỂN GÓC TRÊN PHẢI (Day/Night + Info) ===== */
.viewer-topright {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  z-index: 9500;
}

/* Nút Day/Night (sun/moon) */
.daynight-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.8),
    0 8px 20px rgba(15, 23, 42, 0.9);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.daynight-btn:hover {
  background: rgba(0, 0, 0, 0.78);
  border-color: #ffffff;
  transform: translateY(-1px);
}

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

.daynight-btn svg {
  position: absolute;
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.daynight-btn #icon-sun {
  color: #ffd766;
}

.daynight-btn #icon-moon {
  color: #cbd5e1;
}

/* Đang Day → hiện mặt trời, ẩn mặt trăng */
.daynight-btn.is-day #icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.daynight-btn.is-day #icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.35);
}

/* Đang Night → hiện mặt trăng, ẩn mặt trời */
.daynight-btn.is-night #icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.daynight-btn.is-night #icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.35);
}

/* Trạng thái đang tải viewer đích (lần switch đầu tiên) */
.daynight-btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.daynight-btn.is-loading::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: dn-spin 0.7s linear infinite;
}

@keyframes dn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ✅ Custom Info (logo + brand) – nằm trong cụm .viewer-topright nên bỏ absolute */
.viewer-topright .viewer-brand-info {
  position: static;
  top: auto;
  right: auto;
  left: auto;
}

.viewer-brand-info {
  position: absolute;
  top: 16px;
  right: 16px;   /* 👈 chuyển sang góc phải */
  left: auto;    /* 👈 bỏ cố định bên trái */

  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border-radius: 999px;

  background: transparent;
  border: 1px solid transparent;
  backdrop-filter: none;
  z-index: 9500;
  cursor: pointer;
  transition:
    padding 0.2s ease,
    gap 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}


/* Logo circle (icon thông tin dự án) */
.viewer-brand-info .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.8),
    0 8px 20px rgba(15, 23, 42, 0.9);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.viewer-brand-info .brand-logo svg {
  display: block;
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Mặc định: thu gọn text, chỉ còn logo */
.brand-text {
  overflow: hidden;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  transition:
    max-width 0.25s ease,
    opacity 0.2s ease,
    margin-left 0.2s ease;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--muted, #9ca3af);
}

/* Khi hover: mở rộng pill + hiện text */
.viewer-brand-info:hover {
  padding: 8px 14px;
  gap: 8px;
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(14px);
}

.viewer-brand-info:hover .brand-logo {
  background: rgba(0, 0, 0, 0.75);
  border-color: #ffffff;
  transform: translateY(-1px);
}

.viewer-brand-info:hover .brand-text {
  max-width: 220px; /* tuỳ anh chỉnh dài hơn/ngắn hơn */
  opacity: 1;
  margin-left: 6px;
}

/* ===== NÚT TRÒN TRONG SUỐT (ICON MỚI) ===== */

.circle-btn {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease;
}

.circle-btn svg {
  width: 24px;
  height: 24px;
  display: block;
  stroke: currentColor;
  color: inherit;
}

.circle-btn.small svg {
  width: 20px;
  height: 20px;
}

.circle-btn.small {
  width: 46px;
  height: 46px;
  font-size: 16px;
}

.circle-btn:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: #ffffff;
  transform: translateY(-1px);
}

/* Play/Pause icon handled by SVG, not ::before */

/* TOUR BAR – GIỮA ĐÁY, CHE TOUR GỐC */

.tour-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  padding: 10px 18px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;

  /* background: rgba(15, 23, 42, 0.85); */
  /* border: 0.5px solid rgba(148, 163, 184, 0.7); */
  /* backdrop-filter: blur(14px); */
  z-index: 9500;
}

.tour-label {
  font-size: 13px;
  color: #ffffff;
  margin-right: 4px;
  justify-content: center;
  align-self: center;
}

.tour-step,
.tour-speed {
  font-size: 13px;
  padding: 4px 12px;
}

.tour-speed {
  cursor: pointer;
  border: none;
  background: transparent;
  color: #ffffff;
  transition: opacity 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
}

.tour-speed:hover {
  opacity: 0.7;
}

.tour-speed option {
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
}

/* PANEL BÊN PHẢI – ICON MỚI ĐẶT LÊN MASK */

.right-toolbar-panel {
  position: absolute;
  right: 10px;
  bottom: 10px;
  /* nền & border đã nằm ở viewer-mask-right, ở đây để trong suốt */
  background: transparent;
  border: none;
  z-index: 9501; /* cao hơn mask để thấy nút mới */
}

.right-toolbar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* override size mặc định cho panel bên phải */
.circle-btn {
  border: 0.5px solid rgba(255, 255, 255, 0.9);
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.button-group {
  display: flex;
  gap: 8px;
  padding-top: 5px;
  padding-bottom: 5px;
  align-items: center;
  background: transparent;
  border-radius: 20px;
  backdrop-filter: blur(3px);
}

.button-control {
  width: 30px;
  height: 30px;
  font-size: 13px;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease;
}

/* ===== AREA NAV BUTTONS (Prev / Next Area) ===== */

/* Trạng thái mặc định: nút dính mép, chỉ lộ phần đầu tròn với icon */
.area-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;

  height: 40px;
  width: 40px;            /* khi thu gọn: gần như chỉ là "đầu tròn" */
  padding: 0 10px;
  overflow: hidden;
  z-index: 9500;
  pointer-events: auto;

  /* màu đồng bộ icon: nền tối trong suốt + viền trắng */
  background: rgba(0, 0, 0, 0.3);
  border: 0.5px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;

  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;

  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.3),
    0 8px 18px rgba(15, 23, 42, 0.7);

  transition:
    width 0.22s ease,
    padding 0.22s ease,
    gap 0.22s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

/* Bên trái: dính vào mép trái, bo tròn bên phải */
.area-nav--left {
  left: -5px;
  flex-direction: row;                /* text bên trái, icon bên phải */
  border-radius: 0 999px 999px 0;     /* phẳng bên trái, tròn bên phải */
}

/* Bên phải: dính vào mép phải, bo tròn bên trái */
.area-nav--right {
  right: -5px;
  flex-direction: row-reverse;        /* icon sát mép phải */
  border-radius: 999px 0 0 999px;     /* tròn bên trái, phẳng bên phải */
}

/* Icon luôn hiển thị */
.area-nav__icon svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* Label: mặc định ẩn hoàn toàn (chỉ còn phần bo tròn có icon) */
.area-nav__label {
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  transition:
    max-width 0.22s ease,
    opacity 0.16s ease,
    margin 0.2s ease;
}

/* Khi hover: kéo pill vào trong, hiện chữ, vẫn dính mép */
.area-nav:hover {
  width: 150px;                        /* độ dài pill khi hover */
  padding: 0 16px;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.6),
    0 12px 24px rgba(15, 23, 42, 0.9);
}

.area-nav:hover .area-nav__label {
  max-width: 110px;                    /* đủ cho "Prev Area"/"Next Area" */
  opacity: 1;
  margin: 0 4px;
}

.area-nav:active {
  transform: translateY(-50%) scale(0.96);
}

/* ===== STATE CHO ICON TOOLBAR BÊN PHẢI ===== */

/* MẶC ĐỊNH: ĐẬM (ON) */
.right-toolbar .circle-btn.tiny {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.6);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.8),
    0 8px 20px rgba(15, 23, 42, 0.9);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.right-toolbar .circle-btn.tiny svg {
  stroke: currentColor;
}

/* OFF: NHẠT (khi có class .is-inactive) */
.right-toolbar .circle-btn.tiny.is-inactive {
  color: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.18);
  box-shadow: none;
}

/* Hover: cả ON/OFF đều sáng hơn một tí */
.right-toolbar .circle-btn.tiny:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: #ffffff;
  transform: translateY(-1px);
}


