/* =====================================================================
   overlay.css — Lớp A (trang cha, đè lên iframe Viz4D)
   - HUD caption chạy theo bước tour
   - Modal Floorplan 2D (ảnh thật + căn hộ tương tác)
   - Layer trải nghiệm căn hộ (iframe V-Touch fullscreen)
   Accent #5fe0e6 trên nền tối kính mờ.
   ===================================================================== */

:root {
  --ov-accent: #5fe0e6;
  --ov-bg: rgba(10, 14, 18, 0.72);
  --ov-border: rgba(255, 255, 255, 0.12);
  --u-1bd: #f2c14e; /* 1BD */
  --u-2bd: #5fe0e6; /* 2BD */
  --u-3bd: #c98bff; /* 3BD */
}

/* ---------- HUD caption (Lớp A) ---------- */
.tour-hud {
  position: absolute;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%) translateY(8px);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(82vw, 560px);
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ov-bg);
  border: 1px solid var(--ov-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  color: #eef3f6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.45, 0.05, 0.2, 1);
  z-index: 9502;
}
.tour-hud.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tour-hud .hud-step {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: 0.12em; color: var(--ov-accent); white-space: nowrap;
}
.tour-hud .hud-sep { width: 1px; height: 15px; background: rgba(255, 255, 255, 0.18); }
.tour-hud .hud-txt {
  font-size: 13px; letter-spacing: 0.02em; color: rgba(238, 243, 246, 0.92);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Nút Cảnh quan / Mặt bằng căn (trong right-toolbar) ---------- */
#btn-floorplan.is-active,
#btn-sitemap.is-active {
  color: var(--ov-accent);
  border-color: var(--ov-accent);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8), 0 0 18px rgba(95, 224, 230, 0.35);
}

/* ---------- Modal Floorplan ---------- */
.fp-backdrop {
  position: fixed; inset: 0;
  background: rgba(3, 6, 12, 0.6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 9590;
}
.fp-backdrop.show { opacity: 1; pointer-events: auto; }

.floorplan-panel {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -48%) scale(0.98);
  width: min(1120px, 94vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  border-radius: 18px;
  background: var(--ov-bg);
  border: 1px solid var(--ov-border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.45, 0.05, 0.2, 1);
  z-index: 9600;
}
.floorplan-panel.open {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.fp-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ov-border);
}
.fp-title {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(238, 243, 246, 0.72);
  margin-right: auto;
}
.fp-legend { display: flex; gap: 12px; }
.fp-legend .lg {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-family: "Space Mono", monospace;
  color: rgba(238, 243, 246, 0.65);
}
.fp-legend .lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fp-legend .t1 i { background: var(--u-1bd); }
.fp-legend .t2 i { background: var(--u-2bd); }
.fp-legend .t3 i { background: var(--u-3bd); }

.fp-btn {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--ov-border); background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 243, 246, 0.7);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.fp-btn:hover { background: rgba(95, 224, 230, 0.14); color: #fff; border-color: rgba(95, 224, 230, 0.5); }
.fp-btn svg { width: 16px; height: 16px; display: block; }

/* Nút quay về màn cảnh quan */
.fp-back {
  width: auto; padding: 0 11px 0 8px; gap: 5px;
  font: inherit; font-size: 11.5px; letter-spacing: 0.04em;
}

.fp-body { padding: 14px; overflow: visible; }
.fp-stage { position: relative; line-height: 0; }
.fp-img {
  display: block; width: 100%; height: auto;
  border-radius: 12px;
  user-select: none; -webkit-user-drag: none;
  filter: saturate(1.02);
}
.fp-units {
  position: absolute; inset: 0; width: 100%; height: 100%;
}

/* Vùng căn hộ */
.fp-unit { cursor: pointer; }
.fp-unit-shape {
  fill: rgba(148, 163, 184, 0.06);           /* tint rất nhẹ lúc nghỉ */
  stroke: rgba(255, 255, 255, 0.14); stroke-width: 1.5;
  transition: fill 0.18s ease, stroke 0.18s ease;
}
/* màu phân loại hiện nhẹ lúc nghỉ (khớp legend) */
.fp-unit.t1 .fp-unit-shape { fill: rgba(242, 193, 78, 0.12); stroke: rgba(242, 193, 78, 0.35); }
.fp-unit.t2 .fp-unit-shape { fill: rgba(95, 224, 230, 0.12); stroke: rgba(95, 224, 230, 0.35); }
.fp-unit.t3 .fp-unit-shape { fill: rgba(201, 139, 255, 0.12); stroke: rgba(201, 139, 255, 0.35); }
/* đậm khi hover */
.fp-unit.t1:hover .fp-unit-shape { fill: rgba(242, 193, 78, 0.32); stroke: var(--u-1bd); stroke-width: 2.4; }
.fp-unit.t2:hover .fp-unit-shape { fill: rgba(95, 224, 230, 0.30); stroke: var(--u-2bd); stroke-width: 2.4; }
.fp-unit.t3:hover .fp-unit-shape { fill: rgba(201, 139, 255, 0.30); stroke: var(--u-3bd); stroke-width: 2.4; }

.fp-unit-label {
  fill: rgba(255, 255, 255, 0.72);
  font: 700 22px "Space Mono", monospace;
  letter-spacing: 0.04em;
  paint-order: stroke; stroke: rgba(3, 6, 12, 0.6); stroke-width: 4px;
  transition: fill 0.18s ease;
  pointer-events: none;
}
.fp-unit:hover .fp-unit-label { fill: #fff; }


/* Tooltip căn hộ */
.fp-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 14px));
  padding: 7px 11px; border-radius: 9px;
  background: rgba(6, 10, 14, 0.92);
  border: 1px solid rgba(95, 224, 230, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity 0.15s ease;
  z-index: 5;
}
.fp-tip.show { opacity: 1; }
.fp-tip b { display: block; font-size: 13px; color: #fff; line-height: 1.3; }
.fp-tip span { font-size: 11px; color: var(--ov-accent); font-family: "Space Mono", monospace; }

.fp-foot {
  padding: 9px 16px 13px;
  font-size: 11.5px; color: rgba(238, 243, 246, 0.5);
  border-top: 1px solid var(--ov-border);
  display: flex; align-items: center; gap: 8px;
}
.fp-foot .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ov-accent); box-shadow: 0 0 8px var(--ov-accent); flex-shrink: 0;
}

/* ---------- Layer trải nghiệm căn hộ (iframe V-Touch) ---------- */
.unit-exp {
  position: fixed; inset: 0;
  background: #05070b;
  z-index: 9800;
  opacity: 0; visibility: hidden;
  transform: scale(1.02);
  transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s cubic-bezier(0.45, 0.05, 0.2, 1);
}
.unit-exp.show { opacity: 1; visibility: visible; transform: scale(1); }

.ue-bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.85), rgba(5, 7, 11, 0));
  z-index: 3; pointer-events: none;
}
.ue-bar .ue-btn, .ue-bar .ue-title { pointer-events: auto; }
.ue-title {
  margin: 0 auto;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #eef3f6; font-weight: 600;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.ue-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: rgba(10, 14, 18, 0.7);
  border: 1px solid var(--ov-border);
  color: #eef3f6; cursor: pointer;
  font-size: 12.5px; letter-spacing: 0.04em;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.ue-btn svg { width: 17px; height: 17px; }
.ue-btn:hover { background: rgba(95, 224, 230, 0.14); border-color: rgba(95, 224, 230, 0.6); transform: translateY(-1px); }
.ue-close { width: 38px; padding: 0; justify-content: center; }

.ue-frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; background: #05070b;
}

.ue-loader {
  position: absolute; inset: 0; z-index: 2;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: rgba(238, 243, 246, 0.8);
  font-size: 13px; letter-spacing: 0.06em;
  background: #05070b;
}
.ue-loader.show { display: flex; }
.ue-spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(95, 224, 230, 0.18);
  border-top-color: var(--ov-accent);
  animation: ueSpin 0.9s linear infinite;
}
@keyframes ueSpin { to { transform: rotate(360deg); } }

/* ---------- Breadcrumb wayfinding ---------- */
.nav-crumb {
  position: absolute; top: 16px; left: 16px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--ov-bg); border: 1px solid var(--ov-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  font-size: 12.5px; z-index: 9610;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.nav-crumb.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.crumb-seg {
  background: none; border: none; padding: 0; cursor: pointer;
  color: rgba(238, 243, 246, 0.7); font: inherit; letter-spacing: 0.03em;
  transition: color 0.15s ease;
}
.crumb-seg:hover { color: var(--ov-accent); }
.crumb-seg.current { color: #fff; font-weight: 600; cursor: default; }
.crumb-sep { color: rgba(255, 255, 255, 0.3); }

/* ---------- Hiệu ứng chuyển cảnh khi drill-in ---------- */
.nav-fx {
  position: fixed; inset: 0; z-index: 9700; pointer-events: none;
  opacity: 0; transition: opacity 0.35s ease;
  background: radial-gradient(ellipse at 50% 50%, rgba(3, 6, 12, 0) 30%, rgba(3, 6, 12, 0.72) 100%);
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
}
.nav-fx.show {
  opacity: 1;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* ---------- TẦNG 1: Panel bản đồ (2 màn tách biệt) ---------- */
.minimap-panel {
  position: absolute; left: 16px; bottom: 16px;
  width: min(430px, 54vw);
  display: flex; flex-direction: column;
  border-radius: 16px;
  background: var(--ov-bg); border: 1px solid var(--ov-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden; z-index: 9600;
  opacity: 0; transform: translateY(16px) scale(0.98); transform-origin: bottom left;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.45, 0.05, 0.2, 1);
}
.minimap-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.mm-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 8px; border-bottom: 1px solid var(--ov-border);
}

/* --- Segmented tabs: Cảnh quan | Mặt bằng căn --- */
.mm-tabs {
  position: relative; flex: 1 1 auto;
  display: flex; padding: 3px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--ov-border);
}
.mm-tab-slider {
  /* width:50% + left:3px khớp chính xác hộp của từng tab (% tính theo
     content-box của .mm-tabs, vốn đã trừ padding 3px hai bên) */
  position: absolute; top: 3px; left: 3px;
  width: 50%; height: calc(100% - 6px);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(95, 224, 230, 0.26), rgba(95, 224, 230, 0.1));
  border: 1px solid rgba(95, 224, 230, 0.5);
  box-shadow: 0 0 14px rgba(95, 224, 230, 0.2);
  transition: transform 0.32s cubic-bezier(0.45, 0.05, 0.2, 1);
}
.minimap-panel.tab-floor .mm-tab-slider { transform: translateX(100%); }
.mm-tab {
  position: relative; z-index: 1; flex: 1 1 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 6px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap; color: rgba(238, 243, 246, 0.55);
  transition: color 0.22s ease;
}
.mm-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.mm-tab.active { color: #fff; }
.mm-tab:not(.active):hover { color: rgba(238, 243, 246, 0.85); }

/* --- 2 màn, chỉ 1 màn hiển thị tại một thời điểm --- */
.mm-views { position: relative; }
.mm-view { display: none; }
.mm-view.is-on { display: block; animation: mmViewIn 0.28s ease both; }
@keyframes mmViewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.mm-x {
  width: 24px; height: 24px; border-radius: 7px;
  border: 1px solid var(--ov-border); background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 243, 246, 0.7); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mm-x:hover { background: rgba(95, 224, 230, 0.14); color: #fff; border-color: rgba(95, 224, 230, 0.5); }
.mm-x svg { width: 14px; height: 14px; }

.mm-body { position: relative; padding: 10px; }
.mm-svg { width: 100%; height: auto; display: block; border-radius: 10px; }

/* Khối tháp chỉ còn là NGỮ CẢNH của màn cảnh quan — không bắt click nữa,
   nhờ vậy các điểm cảnh quan nằm trên nó không bị "cướp" sự kiện. */
.mm-building {
  fill: rgba(95, 224, 230, 0.1);
  stroke: rgba(95, 224, 230, 0.32); stroke-width: 1;
  pointer-events: none;
}
.mm-building-label {
  fill: rgba(255, 255, 255, 0.45);
  font: 700 8px "Space Mono", ui-monospace, monospace;
  letter-spacing: 0.16em; text-anchor: middle; pointer-events: none;
}

.mm-area { cursor: pointer; }
/* vòng bắt chạm vô hình, rộng hơn chấm nhiều lần → dễ bấm, kể cả trên mobile */
.mm-area .mm-hit { fill: transparent; }
.mm-area .mm-dot { fill: rgba(255, 255, 255, 0.9); transition: fill 0.2s ease; }
.mm-area .mm-ring {
  fill: none; stroke: rgba(255, 255, 255, 0.4); stroke-width: 1.2;
  opacity: 0.6; transition: stroke 0.2s ease;
}
.mm-area:hover .mm-dot { fill: var(--ov-accent); }
.mm-area:hover .mm-ring { stroke: var(--ov-accent); opacity: 1; }
.mm-area.active .mm-dot { fill: var(--ov-accent); }
.mm-area.active .mm-ring {
  stroke: var(--ov-accent); opacity: 1;
  transform-origin: center; transform-box: fill-box;
  animation: mmPulse 1.8s ease-in-out infinite;
}
@keyframes mmPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.7); opacity: 0.2; }
}

.mm-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 10px));
  padding: 5px 9px; border-radius: 7px; white-space: nowrap;
  background: rgba(6, 10, 14, 0.92); border: 1px solid rgba(95, 224, 230, 0.5);
  font-size: 11.5px; color: #fff; pointer-events: none;
  opacity: 0; transition: opacity 0.15s ease; z-index: 5;
}
.mm-tip.show { opacity: 1; }

/* ---------- MÀN B: sơ đồ 6 tháp A1–A6 ---------- */
.mm-body--site { padding: 10px; }
.mm-site {
  position: relative; line-height: 0;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--ov-border);
  background: #0c1611;
}
/* Ảnh aerial thật (nếu có) — JS gỡ bỏ khi file không tồn tại */
.mm-site-img {
  display: block; width: 100%; height: auto;
  filter: saturate(1.04) brightness(0.9);
  user-select: none; -webkit-user-drag: none;
}
.mm-site-svg { display: block; width: 100%; height: auto; }
/* khi có ảnh thật: SVG chồng lên ảnh, nền sơ đồ hoá tắt đi */
.mm-site.has-photo .mm-site-svg { position: absolute; inset: 0; height: 100%; }
.mm-site.has-photo #mmSiteBase { display: none; }
.mm-site:not(.has-photo) .mm-site-img { display: none; }

.mm-site-bound {
  fill: none; stroke: rgba(95, 224, 230, 0.22);
  stroke-width: 3; stroke-dasharray: 14 12; pointer-events: none;
}

/* Block tháp — mục tiêu bấm lớn, rõ ràng */
.mm-tower { cursor: pointer; }
.mm-tower-shape {
  fill: rgba(95, 224, 230, 0.3);
  stroke: rgba(140, 240, 245, 0.85); stroke-width: 4;
  transition: fill 0.18s ease, stroke 0.18s ease, stroke-width 0.18s ease;
}
.mm-tower:hover .mm-tower-shape,
.mm-tower.hot .mm-tower-shape {
  fill: rgba(95, 224, 230, 0.62);
  stroke: #ffffff; stroke-width: 7;
}
.mm-tower-label {
  fill: #ffffff;
  font: 700 34px "Space Mono", ui-monospace, monospace;
  letter-spacing: 0.04em; text-anchor: middle; dominant-baseline: central;
  paint-order: stroke; stroke: rgba(3, 6, 12, 0.8); stroke-width: 7px;
  pointer-events: none;
}

/* Hàng chip A1–A6: chọn chính xác kể cả khi block nhỏ */
.mm-foot--towers { display: flex; align-items: center; gap: 10px; }
.mm-foot-cap {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(238, 243, 246, 0.42); white-space: nowrap;
}
.mm-chips { display: flex; gap: 6px; flex: 1 1 auto; }
.mm-chip {
  flex: 1 1 0; height: 30px; border-radius: 8px;
  border: 1px solid var(--ov-border); background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 243, 246, 0.72); cursor: pointer;
  font: 600 11.5px/1 "Space Mono", ui-monospace, monospace; letter-spacing: 0.06em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.mm-chip:hover, .mm-chip.hot {
  background: rgba(95, 224, 230, 0.2); border-color: rgba(95, 224, 230, 0.65);
  color: #fff; transform: translateY(-1px);
}

/* Chú giải loại căn (dùng lại ở modal mặt bằng) */
.mm-legend { display: flex; gap: 9px; flex-shrink: 0; }
.mm-legend .lg {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-family: "Space Mono", ui-monospace, monospace;
  color: rgba(238, 243, 246, 0.6);
}
.mm-legend .lg i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.mm-legend .t1 i { background: var(--u-1bd); }
.mm-legend .t2 i { background: var(--u-2bd); }
.mm-legend .t3 i { background: var(--u-3bd); }

.mm-foot { padding: 10px 12px 12px; border-top: 1px solid var(--ov-border); }
.mm-foot--hint {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.02em; color: rgba(238, 243, 246, 0.5);
}
.mm-hint-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--ov-accent); box-shadow: 0 0 8px var(--ov-accent);
}
/* ---------- Toggle cấp cao: Trải nghiệm 3D <-> V-Touch ---------- */
.mode-switch {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  width: 420px; max-width: 92vw;
  display: flex; align-items: center;
  padding: 4px; border-radius: 999px;
  background: var(--ov-bg); border: 1px solid var(--ov-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 9900;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.mode-switch.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(-10px); }

/* con trượt nền chạy giữa 2 segment */
.mode-slider {
  position: absolute; top: 4px; left: 4px;
  width: calc(50% - 4px); height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(95, 224, 230, 0.28), rgba(95, 224, 230, 0.12));
  border: 1px solid rgba(95, 224, 230, 0.55);
  box-shadow: 0 0 18px rgba(95, 224, 230, 0.25);
  transition: transform 0.35s cubic-bezier(0.45, 0.05, 0.2, 1);
}
.mode-switch.on-vtouch .mode-slider { transform: translateX(100%); }

.mode-seg {
  position: relative; z-index: 1;
  flex: 1 1 0;                     /* 2 segment bằng nhau -> slider khớp 50% */
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
  color: rgba(238, 243, 246, 0.6);
  transition: color 0.25s ease;
}
.mode-seg svg { width: 17px; height: 17px; }
.mode-seg.active { color: #fff; }
.mode-seg:not(.active):hover { color: rgba(238, 243, 246, 0.85); }

/* ---------- Layer nền tảng V-Touch (Bảng hàng) ---------- */
.vtouch-layer {
  position: fixed; inset: 0; background: #05070b;
  z-index: 9820;
  opacity: 0; visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}
.vtouch-layer.show { opacity: 1; visibility: visible; }
.vt-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #05070b; }
.vt-loader {
  position: absolute; inset: 0; z-index: 2;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: rgba(238, 243, 246, 0.8); font-size: 13px; letter-spacing: 0.06em;
  background: #05070b;
}
.vt-loader.show { display: flex; }

@media (max-width: 640px) {
  .floorplan-panel { width: 96vw; }
  .fp-legend { display: none; }
  .fp-back span { display: none; }
  .fp-back { width: 28px; padding: 0; justify-content: center; }
  .fp-unit-label { font-size: 26px; }
  .tour-hud { bottom: 64px; }
  .minimap-panel { width: min(360px, 92vw); left: 10px; bottom: 10px; }
  .mm-tab { font-size: 11px; gap: 4px; padding: 7px 4px; }
  .mm-foot-cap { display: none; }
  .mm-chip { height: 28px; font-size: 11px; }
  .mm-tower-label { font-size: 42px; }
  .nav-crumb { top: 10px; left: 10px; }
  .mode-switch { top: 10px; }
  .mode-seg { padding: 8px 12px; font-size: 12px; }
  .mode-seg span { display: none; }   /* mobile: chỉ còn icon cho gọn */
  .mode-slider { width: calc(50% - 4px); }
}
