:root {
  --paper: #f2eee6;
  --ink: #171715;
  --ink-soft: #6d685f;
  --line: rgba(24, 23, 20, 0.18);
  --panel: rgba(244, 240, 233, 0.9);
  --panel-solid: #f4f0e9;
  --on-image: #fffdf8;
  --on-image-soft: rgba(255, 253, 248, 0.68);
  --on-image-line: rgba(255, 253, 248, 0.2);
  --on-image-panel: rgba(12, 12, 11, 0.62);
  --copper: #c57249;
  --copper-bright: #dc875c;
  --copper-deep: #82472d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  --font-fa: "Vazirmatn", "IRANSansX", Tahoma, Arial, sans-serif;
  --font-en: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #10100f;
  --ink: #f3eee5;
  --ink-soft: #aaa298;
  --line: rgba(244, 239, 230, 0.16);
  --panel: rgba(16, 16, 15, 0.9);
  --panel-solid: #151513;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { width: 100%; min-width: 320px; min-height: 100%; }

html { background: #0b0b0a; }

body {
  margin: 0;
  overflow: hidden;
  overflow: clip;
  background: #0b0b0a;
  color: var(--ink);
  font-family: var(--font-fa);
  line-height: 1.65;
  overscroll-behavior: none;
}

html[lang="en"] body { font-family: var(--font-en); }

button,
a { color: inherit; -webkit-tap-highlight-color: transparent; }

button { border: 0; font: inherit; }
button:not(:disabled),
a[href] { cursor: pointer; }
a { text-decoration: none; }

svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--copper-bright); outline-offset: 3px; }
::selection { background: var(--copper); color: #fff; }

.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed;
  z-index: 5000;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  padding: 10px 16px;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.2s ease;
}

.skip-link:focus { transform: translateY(0); }

.virtual-visit,
.viewer-shell { width: 100%; height: 100dvh; min-height: 540px; }

.viewer-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  background: #11110f;
  color: var(--on-image);
  user-select: none;
}

.panorama-canvas,
.panorama-fallback,
.panorama-fallback img,
.viewer-scrim,
.scene-flash { position: absolute; inset: 0; width: 100%; height: 100%; }

.panorama-canvas {
  z-index: -5;
  display: block;
  cursor: grab;
  touch-action: none;
  background: #171714;
}

.panorama-canvas:active { cursor: grabbing; }

.panorama-fallback { z-index: -6; display: none; overflow: hidden; background: #171714; }
.panorama-fallback img { object-fit: cover; transform: scale(1.08); transition: transform 0.4s var(--ease), object-position 0.2s linear; }
.viewer-shell.is-fallback .panorama-canvas { display: none; }
.viewer-shell.is-fallback .panorama-fallback { display: block; }

.viewer-scrim {
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 5, 4, 0.72), transparent 24%, transparent 58%, rgba(5, 5, 4, 0.78) 100%),
    linear-gradient(90deg, rgba(3, 3, 3, 0.32), transparent 25%, transparent 75%, rgba(3, 3, 3, 0.22));
}

.scene-flash {
  z-index: 180;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  background: #0d0d0c;
  transition: opacity 0.42s var(--ease);
}

.scene-flash i {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-block-start-color: var(--copper-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.viewer-shell.is-transitioning .scene-flash { opacity: 1; }

/* Loading */
.boot-screen {
  position: absolute;
  z-index: 1000;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(circle at 50% 50%, rgba(197, 114, 73, 0.12), transparent 34%),
    #0d0d0c;
  color: #f4efe6;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.boot-screen.is-complete { opacity: 0; visibility: hidden; }

.boot-mark {
  display: grid;
  grid-template-columns: repeat(2, 14px);
  gap: 3px;
  margin-block-end: 24px;
  transform: rotate(45deg);
}

.boot-mark i { width: 14px; aspect-ratio: 1; border: 1px solid currentColor; }
.boot-mark i:first-child,
.boot-mark i:last-child { background: currentColor; }
.boot-screen p { margin: 0; font-family: var(--font-en); font-size: 0.62rem; letter-spacing: 0.23em; }
.boot-screen strong { font-family: var(--font-en); font-size: clamp(2.4rem, 6vw, 5.5rem); font-weight: 400; line-height: 1; }
.boot-screen small { color: rgba(255, 255, 255, 0.52); font-size: 0.7rem; }
.boot-line { width: min(280px, 56vw); height: 1px; overflow: hidden; background: rgba(255, 255, 255, 0.15); }
.boot-line i { display: block; width: 0; height: 100%; background: var(--copper-bright); transition: width 0.18s ease; }

/* Header */
.visit-header {
  position: absolute;
  z-index: 110;
  inset-block-start: 0;
  inset-inline: 0;
  height: 80px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-inline: clamp(18px, 3vw, 46px);
  border-block-end: 1px solid var(--on-image-line);
  background: linear-gradient(180deg, rgba(7, 7, 6, 0.44), rgba(7, 7, 6, 0.05));
}

.visit-brand { justify-self: start; display: flex; align-items: center; gap: 13px; color: var(--on-image); }
.brand-symbol { display: grid; grid-template-columns: repeat(2, 10px); gap: 2px; transform: rotate(45deg); }
.brand-symbol i { width: 10px; aspect-ratio: 1; border: 1px solid currentColor; }
.brand-symbol i:first-child,
.brand-symbol i:last-child { background: currentColor; }
.visit-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.visit-brand strong { font-size: 0.78rem; font-weight: 700; }
.visit-brand small { margin-block-start: 6px; color: var(--on-image-soft); font-family: var(--font-en); font-size: 0.45rem; letter-spacing: 0.14em; }

.visit-location {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--on-image-soft);
  font-family: var(--font-en);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.visit-location i,
.scene-caption p i { width: 5px; height: 5px; border-radius: 50%; background: var(--copper-bright); box-shadow: 0 0 0 5px rgba(197, 114, 73, 0.14); }

.visit-header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.language-switch { display: flex; align-items: center; height: 36px; padding: 3px; border: 1px solid var(--on-image-line); background: rgba(8, 8, 7, 0.24); backdrop-filter: blur(12px); }
.language-switch button { width: 34px; height: 28px; padding: 0; background: transparent; color: var(--on-image-soft); font-family: var(--font-en); font-size: 0.54rem; font-weight: 700; }
.language-switch button[aria-pressed="true"] { background: var(--on-image); color: #111; }

.icon-button,
.exit-button { height: 36px; border: 1px solid var(--on-image-line); background: rgba(8, 8, 7, 0.24); backdrop-filter: blur(12px); }
.icon-button { width: 36px; display: grid; place-items: center; }
.icon-button svg { width: 17px; height: 17px; }
.theme-sun { display: none; }
html[data-theme="light"] .theme-sun { display: block; }
html[data-theme="light"] .theme-moon { display: none; }
.exit-button { display: flex; align-items: center; gap: 9px; padding-inline: 13px; font-size: 0.66rem; }
.exit-button svg { width: 17px; height: 17px; }
[dir="rtl"] .exit-button svg { transform: scaleX(-1); }

/* Route and scene navigation */
.route-switch {
  position: absolute;
  z-index: 105;
  inset-block-start: 98px;
  inset-inline-start: 50%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-width: 330px;
  transform: translateX(-50%);
  border: 1px solid var(--on-image-line);
  background: rgba(8, 8, 7, 0.45);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(18px) saturate(1.2);
}

[dir="rtl"] .route-switch { transform: translateX(50%); }

.route-switch button {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-inline-end: 1px solid var(--on-image-line);
  background: transparent;
  color: var(--on-image-soft);
  transition: color 0.25s ease, background 0.25s ease;
}

.route-switch button:last-child { border-inline-end: 0; }
.route-switch button[aria-current="page"] { background: rgba(255, 255, 255, 0.12); color: var(--on-image); }
.route-switch button > span { font-family: var(--font-en); font-size: 0.5rem; color: var(--copper-bright); }
.route-switch b { justify-self: start; font-size: 0.73rem; }
.route-switch small { display: flex; gap: 4px; font-family: var(--font-en); font-size: 0.5rem; }
.route-switch small i { font-family: var(--font-fa); font-style: normal; }

.scene-skip {
  position: absolute;
  z-index: 75;
  inset-block-start: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  transform: translateY(-50%);
  border: 1px solid var(--on-image-line);
  background: rgba(8, 8, 7, 0.4);
  color: var(--on-image-soft);
  font-size: 0.6rem;
  backdrop-filter: blur(14px);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--ease);
}

.scene-skip:hover { background: rgba(8, 8, 7, 0.7); color: var(--on-image); }
.scene-skip--previous { inset-inline-start: 20px; }
.scene-skip--next { inset-inline-end: 20px; }
.scene-skip svg { width: 16px; height: 16px; }
.scene-skip--previous svg { transform: scaleX(-1); }
[dir="rtl"] .scene-skip--previous svg { transform: none; }
[dir="rtl"] .scene-skip--next svg { transform: scaleX(-1); }

/* Hotspots */
.hotspot-layer { position: absolute; z-index: 65; inset: 0; pointer-events: none; }
.tour-hotspot {
  --hotspot-color: var(--copper-bright);
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  transform: translate(-50%, -50%);
  background: transparent;
  color: var(--on-image);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
}

.tour-hotspot.is-visible { opacity: 1; }
.tour-hotspot:hover { transform: translate(-50%, -50%) scale(1.04); }
.tour-hotspot__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 50%;
  background: rgba(8, 8, 7, 0.54);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(9px);
}

.tour-hotspot__dot::before,
.tour-hotspot__dot::after { content: ""; position: absolute; inset: -7px; border: 1px solid var(--hotspot-color); border-radius: 50%; opacity: 0.65; animation: hotspot-pulse 2.3s ease-out infinite; }
.tour-hotspot__dot::after { animation-delay: 1.15s; }
.tour-hotspot svg { width: 17px; height: 17px; color: var(--hotspot-color); }
.tour-hotspot__label { display: flex; flex-direction: column; align-items: flex-start; min-width: max-content; padding: 7px 11px; background: rgba(8, 8, 7, 0.58); backdrop-filter: blur(9px); }
.tour-hotspot__label b { font-size: 0.67rem; }
.tour-hotspot__label small { color: var(--on-image-soft); font-family: var(--font-en); font-size: 0.45rem; letter-spacing: 0.09em; }
.tour-hotspot[data-kind="nav"] .tour-hotspot__dot { background: var(--copper-deep); }
.tour-hotspot[data-kind="product"] { --hotspot-color: #f3d59e; }

/* Scene information */
.scene-caption {
  position: absolute;
  z-index: 70;
  inset-inline-end: clamp(24px, 4vw, 64px);
  inset-block-end: 112px;
  width: min(460px, 42vw);
  text-align: end;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.scene-caption p { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin: 0 0 10px; color: var(--on-image-soft); font-family: var(--font-en); font-size: 0.53rem; letter-spacing: 0.14em; }
.scene-caption p i { order: 2; }
.scene-caption h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 3.2rem); font-weight: 400; line-height: 1.18; letter-spacing: -0.035em; }
.scene-caption > span { display: block; margin-block-start: 8px; color: var(--on-image-soft); font-size: 0.7rem; }

.scene-rail {
  position: absolute;
  z-index: 72;
  inset-block-start: 166px;
  inset-block-end: 108px;
  inset-inline-start: 24px;
  width: 248px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--on-image-line);
  background: rgba(8, 8, 7, 0.52);
  backdrop-filter: blur(18px) saturate(1.2);
  transition: width 0.35s var(--ease), background 0.25s ease;
}

.scene-rail header { height: 46px; flex: 0 0 46px; display: flex; align-items: center; justify-content: space-between; padding-inline: 14px; border-block-end: 1px solid var(--on-image-line); color: var(--on-image-soft); font-size: 0.62rem; }
.scene-rail header button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; background: transparent; }
.scene-rail header button i,
.scene-rail header button i::before { width: 12px; height: 1px; background: currentColor; }
.scene-rail header button i { position: relative; }
.scene-rail header button i::before { content: ""; position: absolute; inset: 0; transform: rotate(90deg); transition: transform 0.25s ease; }
.scene-rail-list { flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.scene-rail.is-collapsed { width: 50px; }
.scene-rail.is-collapsed header { padding-inline: 11px; }
.scene-rail.is-collapsed header > span,
.scene-rail.is-collapsed .scene-rail-list { display: none; }
.scene-rail.is-collapsed header button i::before { transform: rotate(0); }

.rail-scene {
  width: 100%;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border-block-end: 1px solid var(--on-image-line);
  background: transparent;
  color: var(--on-image-soft);
  text-align: start;
}

.rail-scene img { width: 62px; height: 42px; object-fit: cover; filter: saturate(0.65) brightness(0.75); }
.rail-scene span { min-width: 0; display: flex; flex-direction: column; }
.rail-scene b { overflow: hidden; color: inherit; font-size: 0.63rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.rail-scene small { margin-block-start: 3px; font-family: var(--font-en); font-size: 0.43rem; letter-spacing: 0.08em; }
.rail-scene > i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.rail-scene[aria-current="true"] { background: rgba(255, 255, 255, 0.1); color: var(--on-image); }
.rail-scene[aria-current="true"] img { filter: none; }
.rail-scene[aria-current="true"] > i { background: var(--copper-bright); }

.compass { position: absolute; z-index: 68; inset-inline-end: 36px; inset-block-start: 104px; width: 42px; height: 42px; display: grid; place-items: center; color: var(--on-image-soft); }
.compass svg { width: 42px; height: 42px; opacity: 0.75; }
.compass i { position: absolute; width: 1px; height: 13px; inset-block-start: 8px; background: var(--copper-bright); transform-origin: 50% 13px; }
.compass span { position: absolute; inset-block-start: -11px; font-family: var(--font-en); font-size: 0.42rem; }

/* Bottom controls */
.bottom-deck {
  position: absolute;
  z-index: 90;
  inset-inline: clamp(18px, 3vw, 44px);
  inset-block-end: 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 22px;
}

.map-trigger {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid var(--on-image-line);
  background: var(--on-image-panel);
  color: var(--on-image);
  backdrop-filter: blur(16px);
}
.map-trigger svg { width: 21px; height: 21px; color: var(--copper-bright); }
.map-trigger span { display: flex; flex-direction: column; align-items: flex-start; }
.map-trigger b { font-size: 0.65rem; }
.map-trigger small { margin-block-start: 2px; color: var(--on-image-soft); font-size: 0.48rem; }

.viewer-controls { justify-self: center; display: flex; height: 52px; border: 1px solid var(--on-image-line); background: var(--on-image-panel); backdrop-filter: blur(16px); }
.viewer-controls button { position: relative; min-width: 48px; display: grid; place-items: center; padding: 0; border-inline-end: 1px solid var(--on-image-line); background: transparent; color: var(--on-image-soft); }
.viewer-controls button:last-child { border-inline-end: 0; }
.viewer-controls button:hover,
.viewer-controls button.is-active { color: var(--on-image); background: rgba(255, 255, 255, 0.08); }
.viewer-controls svg { width: 18px; height: 18px; }
.viewer-controls .control-wide { grid-template-columns: auto auto; gap: 8px; min-width: 124px; padding-inline: 13px; }
.viewer-controls .control-wide span { font-size: 0.58rem; }
.auto-play { display: none; }
.control-wide:not(.is-active) .auto-pause { display: none; }
.control-wide:not(.is-active) .auto-play { display: block; }
.sound-on { display: none; }
[data-action="sound"][aria-pressed="true"] .sound-on { display: block; }
[data-action="sound"][aria-pressed="true"] .sound-off { display: none; }

.view-angle { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; margin: 0; color: var(--on-image-soft); font-size: 0.52rem; }
.view-angle b { color: var(--on-image); font-family: var(--font-en); font-size: 1rem; font-weight: 500; }

.gesture-guide {
  position: absolute;
  z-index: 60;
  inset-inline-start: 50%;
  inset-block-end: 82px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  transform: translateX(-50%);
  color: var(--on-image-soft);
  font-size: 0.58rem;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
[dir="rtl"] .gesture-guide { transform: translateX(50%); }
.gesture-guide.is-hidden { opacity: 0; }
.gesture-guide i { width: 22px; height: 13px; border: 1px solid currentColor; border-radius: 10px; }
.gesture-guide i::after { content: ""; display: block; width: 3px; height: 3px; margin: 2px auto 0; border-radius: 50%; background: currentColor; animation: guide-drag 1.6s ease-in-out infinite; }

.webgl-status { position: absolute; z-index: 60; inset-inline-end: 36px; inset-block-end: 82px; color: var(--on-image-soft); font-family: var(--font-en); font-size: 0.42rem; letter-spacing: 0.12em; }

/* Insight */
.insight-panel {
  position: absolute;
  z-index: 130;
  inset-block-start: 96px;
  inset-inline-end: 24px;
  width: min(380px, calc(100vw - 48px));
  max-height: calc(100dvh - 198px);
  overflow: auto;
  padding: 28px;
  transform: translateX(calc(100% + 40px));
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.2);
  transition: transform 0.5s var(--ease);
}
[dir="rtl"] .insight-panel { transform: translateX(calc(-100% - 40px)); }
.insight-panel.is-open { transform: translateX(0); }
.insight-close { position: absolute; inset-block-start: 16px; inset-inline-end: 16px; width: 36px; height: 36px; display: grid; place-items: center; background: transparent; color: var(--ink-soft); }
.insight-close svg { width: 18px; height: 18px; }
.insight-panel > p:first-of-type { margin: 0 0 18px; color: var(--copper); font-family: var(--font-en); font-size: 0.52rem; font-weight: 700; letter-spacing: 0.16em; }
.insight-panel h2 { max-width: 290px; margin: 0; font-size: clamp(1.45rem, 2.2vw, 2.2rem); font-weight: 500; line-height: 1.35; letter-spacing: -0.03em; }
.insight-panel h2 + p { margin: 18px 0; color: var(--ink-soft); font-size: 0.78rem; line-height: 1.95; }
.insight-panel dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 22px 0; background: var(--line); }
.insight-panel dl div { padding: 14px; background: var(--panel-solid); }
.insight-panel dt { font-family: var(--font-en); font-size: 1.05rem; }
.insight-panel dd { margin: 3px 0 0; color: var(--ink-soft); font-size: 0.58rem; }
.insight-panel > a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding-inline: 15px; background: var(--ink); color: var(--paper); font-size: 0.67rem; }
.insight-panel > a svg { width: 16px; height: 16px; }
[dir="rtl"] .insight-panel > a svg { transform: scaleX(-1); }

/* Map */
.map-overlay {
  position: absolute;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 56px);
  opacity: 0;
  visibility: hidden;
  background: rgba(6, 6, 5, 0.72);
  backdrop-filter: blur(18px);
  transition: opacity 0.35s ease, visibility 0.35s;
}
.map-overlay.is-open { opacity: 1; visibility: visible; }
.map-overlay:focus { outline: 0; }
.map-sheet { width: min(1120px, 100%); max-height: 100%; overflow: auto; background: var(--panel-solid); color: var(--ink); box-shadow: var(--shadow); }
.map-sheet > header { display: flex; justify-content: space-between; align-items: flex-start; padding: clamp(20px, 3vw, 34px); border-block-end: 1px solid var(--line); }
.map-sheet > header p { margin: 0 0 6px; color: var(--copper); font-family: var(--font-en); font-size: 0.52rem; letter-spacing: 0.17em; }
.map-sheet h2 { margin: 0; font-size: clamp(1.3rem, 2.5vw, 2.3rem); font-weight: 500; }
.map-sheet > header button { width: 42px; height: 42px; display: grid; place-items: center; background: transparent; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr); min-height: 470px; }
.campus-map { position: relative; min-height: 470px; overflow: hidden; border-inline-end: 1px solid var(--line); background: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px), color-mix(in srgb, var(--paper) 85%, #cabca9); background-size: 36px 36px; }
.campus-map::before { content: ""; position: absolute; inset: 13%; border: 1px dashed var(--line); border-radius: 52% 48% 47% 53%; transform: rotate(-4deg); }
.map-building { position: absolute; display: grid; place-items: center; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel-solid) 86%, transparent); color: var(--ink-soft); font-size: 0.62rem; }
.map-building--factory { inset-inline-start: 12%; inset-block-start: 24%; width: 56%; height: 44%; transform: skewY(-4deg); }
.map-building--showroom { inset-inline-end: 10%; inset-block-start: 34%; width: 22%; height: 30%; border-radius: 45% 5% 45% 5%; }
.map-path { position: absolute; height: 2px; background: var(--copper); transform-origin: 0 50%; opacity: 0.65; }
.map-path--a { inset-inline-start: 25%; inset-block-start: 52%; width: 42%; transform: rotate(-6deg); }
.map-path--b { inset-inline-start: 62%; inset-block-start: 48%; width: 22%; transform: rotate(18deg); }
.map-node { position: absolute; width: 30px; height: 30px; display: grid; place-items: center; transform: translate(-50%, -50%); border: 1px solid var(--copper); border-radius: 50%; background: var(--panel-solid); color: var(--ink); font-family: var(--font-en); font-size: 0.52rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.map-node[data-group="showroom"] { border-color: var(--ink); }
.map-node[aria-current="true"] { background: var(--copper); color: #fff; }
.map-north { position: absolute; inset-inline-end: 22px; inset-block-start: 22px; font-family: var(--font-en); font-size: 0.54rem; }
.map-index { padding: 28px; }
.map-index > p { margin: 0 0 18px; color: var(--ink-soft); font-size: 0.68rem; }
.map-index > div { display: grid; }
.map-index button { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-block-end: 1px solid var(--line); background: transparent; color: var(--ink-soft); text-align: start; }
.map-index button > span { font-family: var(--font-en); font-size: 0.5rem; color: var(--copper); }
.map-index button b { font-size: 0.67rem; font-weight: 500; }
.map-index button i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.map-index button[aria-current="true"] { color: var(--ink); }
.map-index button[aria-current="true"] i { background: var(--copper); }
.map-sheet > footer { display: flex; justify-content: space-between; gap: 20px; padding: 15px 28px; border-block-start: 1px solid var(--line); color: var(--ink-soft); font-size: 0.56rem; }
.map-sheet > footer b { font-family: var(--font-en); font-weight: 500; }

.toast { position: absolute; z-index: 500; inset-inline-start: 50%; inset-block-end: 92px; min-width: 220px; padding: 11px 16px; transform: translate(-50%, 18px); background: var(--panel-solid); color: var(--ink); box-shadow: var(--shadow); text-align: center; font-size: 0.65rem; opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s var(--ease); }
[dir="rtl"] .toast { transform: translate(50%, 18px); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
[dir="rtl"] .toast.is-visible { transform: translate(50%, 0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hotspot-pulse { 0% { transform: scale(0.75); opacity: 0; } 28% { opacity: 0.55; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes guide-drag { 0%,100% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }

@media (max-width: 980px) {
  .visit-header { grid-template-columns: auto 1fr auto; }
  .visit-location { justify-self: center; }
  .scene-rail { width: 220px; }
  .scene-caption { width: min(420px, 48vw); }
  .viewer-controls .control-wide { min-width: 50px; grid-template-columns: 1fr; padding: 0; }
  .viewer-controls .control-wide span { display: none; }
  .map-layout { grid-template-columns: 1fr; }
  .campus-map { min-height: 380px; border-inline-end: 0; border-block-end: 1px solid var(--line); }
  .map-index > div { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
}

@media (max-width: 720px) {
  .virtual-visit,
  .viewer-shell { min-height: 460px; }
  .visit-header { height: 64px; grid-template-columns: auto 1fr; padding-inline: 12px; }
  .visit-location { display: none; }
  .visit-brand strong,
  .visit-brand small { display: none; }
  .brand-symbol { grid-template-columns: repeat(2, 8px); }
  .brand-symbol i { width: 8px; }
  .visit-header-actions { justify-self: end; gap: 5px; }
  .language-switch { height: 32px; }
  .language-switch button { width: 28px; height: 24px; font-size: 0.48rem; }
  .icon-button { width: 32px; height: 32px; }
  .exit-button { width: 32px; height: 32px; justify-content: center; padding: 0; }
  .exit-button span { display: none; }

  .route-switch { inset-block-start: 76px; min-width: 274px; }
  .route-switch button { min-height: 44px; gap: 7px; padding: 6px 9px; }
  .route-switch small { display: none; }

  .scene-skip { width: 40px; height: 40px; justify-content: center; padding: 0; border-radius: 50%; }
  .scene-skip span { display: none; }
  .scene-skip--previous { inset-inline-start: 10px; }
  .scene-skip--next { inset-inline-end: 10px; }

  .scene-caption { inset-inline: 18px; inset-block-end: 130px; width: auto; text-align: start; }
  .scene-caption p { justify-content: flex-start; }
  .scene-caption h1 { font-size: clamp(1.45rem, 7vw, 2.2rem); }

  .scene-rail { inset-block-start: auto; inset-block-end: 74px; inset-inline-start: 12px; width: 46px; height: 46px; }
  .scene-rail header { height: 44px; flex-basis: 44px; padding-inline: 9px; border-block-end: 0; }
  .scene-rail header > span,
  .scene-rail-list { display: none; }
  .scene-rail.is-mobile-open { inset-inline: 12px; inset-block-end: 72px; width: calc(100% - 24px); height: 238px; background: rgba(8, 8, 7, 0.88); }
  .scene-rail.is-mobile-open header { padding-inline: 12px; border-block-end: 1px solid var(--on-image-line); }
  .scene-rail.is-mobile-open header > span { display: block; }
  .scene-rail.is-mobile-open .scene-rail-list { display: grid; grid-template-columns: repeat(7, 124px); overflow-x: auto; overflow-y: hidden; }
  .scene-rail.is-mobile-open .rail-scene { grid-template-columns: 1fr; align-content: start; padding: 8px; border-inline-end: 1px solid var(--on-image-line); }
  .scene-rail.is-mobile-open .rail-scene img { width: 100%; height: 86px; }
  .scene-rail.is-mobile-open .rail-scene > i { display: none; }

  .compass { inset-block-start: 132px; inset-inline-end: 18px; transform: scale(.82); }
  .bottom-deck { inset-inline: 10px; inset-block-end: 10px; grid-template-columns: 42px 1fr; gap: 7px; }
  .map-trigger { width: 42px; min-height: 46px; justify-content: center; padding: 0; }
  .map-trigger span { display: none; }
  .viewer-controls { justify-self: stretch; width: 100%; height: 46px; }
  .viewer-controls button { min-width: 0; flex: 1; }
  .view-angle { display: none; }
  .gesture-guide { inset-block-end: 68px; max-width: 72vw; text-align: center; }
  .webgl-status { display: none; }

  .tour-hotspot__label { padding: 5px 8px; }
  .tour-hotspot__label b { font-size: 0.58rem; }
  .tour-hotspot__label small { display: none; }
  .tour-hotspot__dot { width: 34px; height: 34px; flex-basis: 34px; }

  .insight-panel { inset-block-start: auto; inset-inline: 0; inset-block-end: 0; width: 100%; max-height: 72dvh; padding: 28px 22px 78px; transform: translateY(105%); }
  [dir="rtl"] .insight-panel { transform: translateY(105%); }
  .insight-panel.is-open { transform: translateY(0); }

  .map-overlay { padding: 10px; }
  .map-sheet > header { padding: 18px; }
  .map-layout { min-height: 0; }
  .campus-map { min-height: 310px; }
  .map-index { padding: 18px; }
  .map-index > div { grid-template-columns: 1fr; }
  .map-sheet > footer { display: none; }
  .toast { inset-block-end: 68px; }
}

@media (max-width: 390px) {
  .route-switch { min-width: 250px; }
  .route-switch b { font-size: 0.66rem; }
  .scene-caption > span { max-width: 75vw; }
  .viewer-controls button[data-action="share"] { display: none; }
  .gesture-guide { font-size: 0.51rem; }
}

@media (max-height: 650px) and (min-width: 721px) {
  .visit-header { height: 66px; }
  .route-switch { inset-block-start: 78px; }
  .scene-rail { inset-block-start: 142px; inset-block-end: 82px; }
  .scene-caption { inset-block-end: 86px; }
  .bottom-deck { inset-block-end: 10px; }
  .gesture-guide,
  .webgl-status { display: none; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 920px) {
  .route-switch { inset-block-start: 72px; min-width: 250px; }
  .scene-caption { inset-block-end: 66px; width: 42vw; }
  .scene-caption h1 { font-size: 1.35rem; }
  .scene-caption > span { display: none; }
  .scene-rail { inset-block-end: 10px; }
  .insight-panel { inset-block-start: 70px; inset-block-end: 8px; width: 360px; max-height: none; padding-bottom: 24px; transform: translateX(calc(100% + 30px)); }
  [dir="rtl"] .insight-panel { transform: translateX(calc(-100% - 30px)); }
  .insight-panel.is-open { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
