:root {
  --accent: #18b5b0;
  --accent-dark: #0f9490;
  --accent-glow: rgba(24, 181, 176, 0.55);
  --burgundy: #6b2838;
  --burgundy-dark: #4a1522;
  --burgundy-mid: #7b2d42;
  --burgundy-soft: #f5e8eb;
  --burgundy-accent: #8b3a4f;
  --text-on-dark: #fff;
  --panel-bg: #fff;
  --panel-text: #1a1d21;
  --bottom-grad: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  --top-grad: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0a0c0e;
  color: var(--text-on-dark);
  font-family: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  overflow: hidden;
}

.tour-page {
  position: fixed;
  inset: 0;
  background: #000;
}

.viewer-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

#panorama {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.viewer-chrome {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.viewer-chrome > * {
  pointer-events: auto;
}

.viewer-chrome.ui-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── 상단 ── */
.viewer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--top-grad);
  pointer-events: none;
}

.brand,
.top-right-col {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100% - 200px));
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.brand-text {
  text-align: left;
}

.brand-tag {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.02em;
}

.brand h1 {
  margin: 0;
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.top-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.94);
  color: #2a2f36;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}

.top-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.top-btn .caret {
  margin-left: -2px;
  opacity: 0.55;
}

.campus-panel-nav-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.campus-panel-nav-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid #e8ecef;
  background: #fff;
}

.panel-tree-hint {
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  color: #8b9499;
  background: #fafbfc;
  border-bottom: 1px solid #e8ecef;
}

.campus-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.campus-tree-building {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8ecef;
}

.campus-tree-floor {
  border-top: 1px solid #eef1f3;
}

.campus-tree-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: #fff;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #1a2a3a;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.campus-tree-toggle:hover {
  background: #f4fbfb;
}

.campus-tree-toggle--floor {
  padding-left: 28px;
  font-size: 13px;
  font-weight: 600;
  background: #fafbfc;
}

.campus-tree-toggle--floor:hover {
  background: #f0fafa;
}

.campus-tree-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid #8b9499;
  border-bottom: 2px solid #8b9499;
  transform: rotate(-45deg);
  transition: transform 0.2s;
  margin-right: 2px;
}

.campus-tree-toggle.is-open .campus-tree-chevron {
  transform: rotate(45deg);
}

.campus-tree-name {
  flex: 1;
  min-width: 0;
}

.campus-tree-meta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #8b9499;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0f2f4;
}

.campus-tree-children {
  background: #fafbfc;
}

.campus-tree-scenes {
  padding: 6px 8px 8px 36px;
}

.campus-scene-card--tree {
  margin-bottom: 4px;
  padding: 10px 12px;
}

.campus-nav-head-text {
  flex: 1;
  min-width: 0;
}

.campus-nav-head-text strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.campus-nav-crumb {
  display: block;
  font-size: 11px;
  color: #8b9499;
  margin-bottom: 2px;
}

.campus-nav-back {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid #dde3e6;
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.campus-nav-back:hover {
  background: #f0fafa;
}

.campus-nav-back[hidden] {
  display: none;
}

.campus-nav {
  overflow-y: auto;
  flex: 1;
}

.campus-nav-panel {
  padding: 10px;
}

.campus-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.campus-nav-item:hover {
  background: #f0fafa;
}

.campus-nav-item.active {
  background: #e0f7f6;
  color: var(--accent-dark);
}

.campus-nav-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.campus-nav-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.campus-nav-label small {
  font-size: 11px;
  font-weight: 500;
  color: #8b9499;
}

.campus-scene-card {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: #f3f5f7;
  color: var(--panel-text);
  cursor: pointer;
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  gap: 0 12px;
  align-items: start;
  transition: background 0.15s;
}

.campus-scene-card:hover {
  background: var(--burgundy-soft);
}

.campus-scene-card.active {
  background: linear-gradient(135deg, var(--burgundy-mid) 0%, var(--burgundy) 100%);
  color: #fff;
}

.campus-scene-card small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  grid-column: 2;
}

.campus-scene-card.active small {
  color: rgba(255, 255, 255, 0.85);
}

.campus-scene-card .scene-num {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(107, 40, 56, 0.12);
  color: var(--burgundy);
  font-size: 12px;
  font-weight: 800;
}

.campus-scene-card.active .scene-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.campus-scene-card strong {
  grid-column: 2;
  font-size: 14px;
}

/* ── 층 선택 (VR 투어) ── */
.floor-rail {
  position: absolute;
  left: clamp(10px, 2vw, 18px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(62vh, 380px);
  pointer-events: auto;
}

.floor-rail[hidden] {
  display: none;
}

.floor-rail-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
}

.floor-rail-building {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  letter-spacing: 0.02em;
}

.floor-rail-now {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.floor-rail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.floor-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 56px;
  padding: 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(18, 10, 14, 0.52);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.floor-rail-btn:hover:not(.is-active) {
  background: rgba(55, 22, 32, 0.72);
  border-color: rgba(255, 220, 210, 0.35);
  transform: translateX(2px);
}

.floor-rail-btn.is-active {
  background: linear-gradient(145deg, rgba(123, 45, 66, 0.92) 0%, rgba(74, 21, 34, 0.95) 100%);
  border-color: rgba(255, 220, 210, 0.55);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: default;
}

.floor-rail-btn-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.floor-rail-btn-count {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.78;
  line-height: 1;
}

.floor-rail-btn.is-active .floor-rail-btn-count {
  opacity: 0.92;
}

/* ── 하단 ── */
.viewer-bottom {
  padding: 0 0 16px;
  background: var(--bottom-grad);
  pointer-events: none;
}

.viewer-bottom > * {
  pointer-events: auto;
}

.control-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.ctrl-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #444;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ctrl-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.zoom-label {
  min-width: 44px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #333;
}

.ctrl-divider {
  width: 1px;
  height: 20px;
  background: #ddd;
  margin: 0 2px;
}

.thumb-carousel {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  max-width: 100%;
}

.thumb-nav {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  margin-bottom: 28px;
  transition: background 0.15s, transform 0.15s;
}

.thumb-nav:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: scale(1.06);
}

.thumb-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.thumb-track-wrap {
  flex: 1;
  max-width: min(840px, calc(100vw - 100px));
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.thumb-track-wrap.is-dragging {
  cursor: grabbing;
}

.thumb-track-wrap.is-dragging .thumb-item {
  pointer-events: none;
}

.thumb-track {
  display: flex;
  gap: 14px;
  padding: 4px 8px 0;
  transition: transform 0.35s ease;
  will-change: transform;
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.thumb-item {
  flex: 0 0 auto;
  width: 148px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
}

.thumb-item .thumb-img {
  display: block;
  width: 148px;
  height: 92px;
  border-radius: 6px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, transform 0.2s;
  background: #1a2030 center/cover no-repeat;
}

.thumb-item:hover .thumb-img {
  transform: translateY(-2px);
}

.thumb-item.active .thumb-img {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow), 0 4px 16px rgba(0, 0, 0, 0.45);
}

.thumb-item .thumb-label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.show-ui-btn {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}

.show-ui-btn[hidden] {
  display: none;
}

/* Pannellum 기본 UI 숨김 — 커스텀 컨트롤 사용 */
#panorama .pnlm-controls-container,
#panorama .pnlm-compass,
#panorama .pnlm-panorama-info {
  display: none !important;
}

.loading {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: #0a0c0e;
  font-size: 15px;
  color: #e8eaed;
}

.loading.hidden { display: none; }

/* ── 사이드 패널 (목록보기) ── */
.scene-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(340px, 92vw);
  height: 100vh;
  z-index: 30;
  background: #fff;
  color: var(--panel-text);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scene-panel.open {
  transform: translateX(0);
}

.panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(20, 8, 12, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.panel-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #e8ecef;
  background: #f7f9fa;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-pin {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8b9499;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.panel-pin:hover {
  background: #eef1f3;
  color: #555;
}

.panel-pin.is-pinned {
  color: var(--burgundy);
  background: var(--burgundy-soft);
}

.top-btn.is-active {
  box-shadow: inset 0 0 0 2px rgba(24, 181, 176, 0.55);
}

.panel-head strong {
  font-size: 16px;
}

.panel-head button {
  border: 0;
  background: transparent;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

#sceneList {
  list-style: none;
  margin: 0;
  padding: 10px;
}

#sceneList li button {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: #f3f5f7;
  color: var(--panel-text);
  cursor: pointer;
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  gap: 0 12px;
  align-items: start;
  transition: background 0.15s;
}

#sceneList li button:hover {
  background: var(--burgundy-soft);
}

#sceneList li button.active {
  background: linear-gradient(135deg, var(--burgundy-mid) 0%, var(--burgundy) 100%);
  color: #fff;
}

#sceneList li small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  grid-column: 2;
}

#sceneList li button.active small {
  color: rgba(255, 255, 255, 0.85);
}

#sceneList .scene-num {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(107, 40, 56, 0.12);
  color: var(--burgundy);
  font-size: 12px;
  font-weight: 800;
}

#sceneList li button.active .scene-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

#sceneList li button strong {
  grid-column: 2;
  font-size: 14px;
}

/* ── 핫스팟 ── */
.pnlm-hotspot {
  font-family: inherit !important;
}

.pnlm-hotspot.pnlm-scene {
  opacity: 1 !important;
  z-index: 5 !important;
  filter: drop-shadow(0 0 6px var(--accent-glow)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.pnlm-hotspot.pnlm-scene:hover {
  filter: drop-shadow(0 0 10px rgba(24, 181, 176, 1)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

#panorama .pnlm-hotspot.pnlm-scene.pnlm-tooltip > span {
  display: none !important;
}

/* ── 공간소개 보기 (화면 우측 상단 고정) ── */
.intro-fixed-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #8b2942;
  border-radius: 6px;
  padding: 10px 16px 10px 12px;
  background: rgba(255, 255, 255, 0.97);
  color: #5c1f30;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(92, 31, 48, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.intro-fixed-btn[hidden] {
  display: none !important;
}

.intro-fixed-btn:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 6px 22px rgba(92, 31, 48, 0.45);
}

.intro-fixed-btn .intro-plus {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #a63d56 0%, #7b2d42 100%);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
}

/* ── 신축예정 조감도 모달 ── */
.new-plan-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(20, 8, 12, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
}

.new-plan-modal[hidden] {
  display: none;
}

.new-plan-dialog {
  width: min(960px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  color: #1a1d21;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.new-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #4a1522 0%, #7b2d42 48%, #5c1f30 100%);
  color: #fff;
  flex-shrink: 0;
}

.new-plan-head-text h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.new-plan-head-text p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.88;
}

.new-plan-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.new-plan-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.new-plan-body {
  padding: 14px 16px 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.new-plan-body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e8ecef;
}

.new-plan-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: #6b7280;
}

/* ── 공간소개 모달 ── */
.intro-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.intro-modal[hidden] {
  display: none;
}

.intro-dialog {
  width: min(480px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #1a1d21;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  animation: introIn 0.28s ease;
}

@keyframes introIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.intro-header {
  position: relative;
  flex-shrink: 0;
  padding: 22px 18px 30px;
  background: linear-gradient(135deg, #4a1522 0%, #7b2d42 48%, #5c1f30 100%);
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 0 100%);
}

.intro-header-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, #fff 1px, transparent 1px);
  background-size: 28px 28px, 36px 36px;
  pointer-events: none;
}

.intro-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.intro-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.intro-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 28px;
}

.intro-header-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.intro-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.intro-modal-sub {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.03em;
}

.intro-modal-sub:empty {
  display: none;
}

.intro-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 24px;
}

.intro-preview {
  margin: 0 0 16px;
}

.intro-preview img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e0e4e8;
  display: block;
}

.intro-content {
  font-size: 14px;
  line-height: 1.75;
  color: #333;
}

.intro-content p {
  margin: 0 0 12px;
}

.intro-content ul {
  margin: 0;
  padding-left: 1.2em;
}

.intro-content li {
  margin-bottom: 10px;
}

.intro-content li:last-child {
  margin-bottom: 0;
}

.intro-empty {
  color: #888;
  font-style: italic;
}

/* ── 캠퍼스 랜딩 (첫 화면) ── */
.campus-landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
}

.campus-landing[hidden] {
  display: none;
}

.campus-landing--leaving {
  animation: campusLandingOut 0.42s ease forwards;
  pointer-events: none;
}

@keyframes campusLandingOut {
  to {
    opacity: 0;
    transform: scale(1.01);
  }
}

.campus-landing-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(145deg, #3d1219 0%, #6b2838 42%, #4a1522 100%);
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
}

.campus-landing-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 75% 65% at 50% 42%, rgba(255, 255, 255, 0.07) 0%, transparent 68%);
}

.campus-landing-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.08;
  background-image: radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, #fff 1px, transparent 1px);
  background-size: 28px 28px, 36px 36px;
}

.campus-landing-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(132vmin, 1080px);
  height: min(132vmin, 1080px);
  object-fit: contain;
  transform: translate(-50%, -50%);
  opacity: 0.17;
  filter: brightness(1.55) saturate(0.5);
  pointer-events: none;
  user-select: none;
}

.campus-landing-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(1180px, 96vw);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: clamp(16px, 3vh, 40px) clamp(16px, 3vw, 28px);
  gap: 0;
  overflow: hidden;
}

.campus-landing-content {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.campus-landing-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  padding: clamp(12px, 1.8vh, 18px);
  gap: 0;
  border-radius: 22px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.05) 38%,
    rgba(0, 0, 0, 0.14) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
}

.campus-landing-sidebar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: clamp(124px, 15vw, 156px);
  margin-left: clamp(10px, 1.6vw, 16px);
  padding: clamp(6px, 1vh, 10px) clamp(6px, 0.8vw, 8px) clamp(8px, 1vh, 12px);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  gap: 10px;
}

.campus-landing-card-badge {
  flex-shrink: 0;
  width: clamp(56px, 7vh, 68px);
  height: clamp(56px, 7vh, 68px);
  margin: 0 auto clamp(4px, 0.8vh, 8px);
  pointer-events: none;
}

.campus-landing-card-badge img,
#landingLogo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 68px;
  max-height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.4));
}

.campus-landing-map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.4vh, 14px);
  border-radius: 16px;
  background: linear-gradient(180deg, #faf6ee 0%, #efe7d6 100%);
  box-shadow:
    inset 0 0 0 1px rgba(130, 100, 65, 0.14),
    inset 0 2px 12px rgba(255, 255, 255, 0.55);
}

.campus-landing-map-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

#landingMapSpots,
.map-stage #mapSpots {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.campus-landing-map-stage img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(72dvh, 680px);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(80, 60, 35, 0.12);
}

.landing-spot {
  position: absolute;
  border: none;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  box-shadow: none;
  animation: none;
  transition: none;
}

.landing-spot:hover,
.landing-spot:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.landing-spot.active {
  background: transparent;
  border: none;
  box-shadow: none;
}

.landing-spot--empty {
  cursor: not-allowed;
}

.landing-spot--empty:hover {
  transform: none;
  background: transparent;
}

.landing-spot span {
  display: none;
}

.landing-spot--code-bon,
.landing-spot--code-sil,
.landing-spot--code-play,
.landing-spot--code-gym,
.landing-spot--code-dorm {
  border: none;
  background: transparent;
}

.campus-landing-side-tools {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-height: 0;
}

.campus-landing-chips {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
}

.landing-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: clamp(12px, 1.5vh, 13px);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
}

.landing-chip::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e8a0a8;
  box-shadow: none;
}

.landing-chip--code-sil::before { background: #e07830; }
.landing-chip--code-play::before { background: #3dad5a; }
.landing-chip--code-gym::before { background: #4a88e8; }
.landing-chip--code-dorm::before { background: #8b62e0; }

.landing-chip:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 220, 210, 0.55);
  transform: translateX(-2px);
}

.landing-chip:disabled,
.landing-chip--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.landing-chip--newplan {
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
}

.landing-chip--newplan::before {
  display: none;
}

.landing-chip--newplan .landing-chip-text span {
  font-size: 11px;
  letter-spacing: -0.03em;
  word-break: keep-all;
}

.landing-chip-thumb {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.landing-chip-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
}

.landing-chip-text small {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
}

.campus-landing-toast {
  margin: 8px 0 0;
  padding: 8px 14px;
  font-size: 12px;
  color: #9a4d12;
  background: rgba(255, 200, 120, 0.35);
  border: 1px solid rgba(200, 140, 60, 0.35);
  border-radius: 8px;
  text-align: center;
  flex-shrink: 0;
}

.campus-landing-toast[hidden] { display: none; }

.campus-landing-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  max-width: min(400px, 100%);
  margin-top: clamp(12px, 1.8vh, 16px);
  flex-shrink: 0;
}

.campus-landing-link {
  flex: 1 1 0;
  min-width: 88px;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2px 12px;
  background: none;
  border: none;
  border-radius: 0;
  text-decoration: none;
  box-shadow: none;
  transition: opacity 0.15s;
}

.campus-landing-link:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.campus-landing-link:hover {
  opacity: 0.82;
}

.campus-landing-link-icon,
.campus-landing-link-img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.campus-landing-link-icon {
  color: rgba(255, 255, 255, 0.92);
}

.campus-landing-link-icon svg {
  display: block;
}

.campus-landing-link-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.campus-landing-link:hover .campus-landing-link-label {
  color: #fff;
}

.campus-landing-visits {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 2px 0 0;
  padding: 8px 6px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.campus-landing-visits[hidden] {
  display: none;
}

.campus-landing-visit-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.2;
}

.campus-landing-visit-item em {
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 9px;
  color: rgba(255, 220, 210, 0.75);
}

.campus-landing-visit-item strong {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-left: auto;
}

.campus-landing-visit-item span {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.8;
  margin-left: 2px;
}

.campus-landing-visit-divider {
  display: none;
}

@media (max-width: 768px) {
  .campus-landing-inner {
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
    gap: 0;
    overflow: hidden;
    justify-content: center;
    max-width: 100%;
  }

  .campus-landing-bg::before {
    background:
      linear-gradient(
        180deg,
        rgba(45, 12, 18, 0.12) 0%,
        rgba(45, 12, 18, 0.28) 50%,
        rgba(30, 8, 14, 0.55) 100%
      ),
      radial-gradient(ellipse 80% 55% at 50% 42%, rgba(255, 255, 255, 0.05) 0%, transparent 68%);
  }

  .campus-landing-watermark {
    width: min(128vmin, 560px);
    height: min(128vmin, 560px);
    opacity: 0.15;
    filter: brightness(1.45) saturate(0.45);
  }

  .campus-landing-content {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
  }

  .campus-landing-card {
    position: relative;
    flex-direction: column;
    padding: 10px;
    border-radius: 16px;
    max-height: calc(100dvh - 48px);
  }

  .campus-landing-sidebar {
    width: 100%;
    margin-left: 0;
    padding: 0 4px 4px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0;
  }

  .campus-landing-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    width: 42px;
    height: 42px;
    margin: 0;
  }

  .campus-landing-card-badge img,
  #landingLogo {
    max-width: 42px;
    max-height: 42px;
  }

  .campus-landing-map-wrap {
    padding: 8px;
    flex: 1;
    min-height: 0;
  }

  .campus-landing-map-stage img {
    max-height: min(50dvh, 400px);
  }

  .campus-landing-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }

  .landing-chip {
    width: 100%;
    min-width: 0;
    flex: none;
    justify-content: center;
    padding: 11px 8px;
    font-size: 12px;
    border-radius: 10px;
    background: rgba(55, 18, 28, 0.94);
    border-color: rgba(255, 210, 200, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  }

  .landing-chip:hover:not(:disabled) {
    transform: none;
    background: rgba(75, 28, 40, 0.96);
  }

  .campus-landing-side-tools {
    margin-top: 6px;
    padding: 10px;
    gap: 8px;
    border-radius: 12px;
    background: rgba(35, 10, 15, 0.55);
  }

  .landing-chip--newplan {
    grid-column: auto;
    justify-content: flex-start;
    margin: 0;
    padding: 10px 12px;
  }

  .campus-landing-visits {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 6px 4px 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .campus-landing-visit-item {
    gap: 5px;
  }

  .campus-landing-visit-item strong {
    margin-left: 0;
    font-size: 13px;
  }

  .campus-landing-links {
    margin-top: 10px;
    max-width: 100%;
  }

  .new-plan-dialog {
    max-height: 94vh;
  }

  .intro-fixed-btn {
    align-self: flex-end;
    gap: 5px;
    padding: 5px 10px 5px 7px;
    font-size: 11px;
    border-width: 1.5px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(92, 31, 48, 0.28);
  }

  .intro-fixed-btn .intro-plus {
    width: 16px;
    height: 16px;
    font-size: 12px;
  }

  .new-plan-head-text h2 {
    font-size: 15px;
  }

  .campus-landing-link {
    min-width: 0;
    max-width: none;
    padding: 2px 8px;
  }

  .campus-landing-link-icon,
  .campus-landing-link-img {
    width: 26px;
    height: 26px;
  }

  .campus-landing-link-label {
    font-size: 10px;
  }

  .scene-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: min(82dvh, 100%);
    max-height: 82dvh;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.38);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .scene-panel.open {
    transform: translateY(0);
  }

  .panel-head {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top, 14px));
    background: linear-gradient(135deg, var(--burgundy-dark) 0%, var(--burgundy-mid) 100%);
    color: #fff;
    border-bottom: none;
  }

  .panel-head strong {
    font-size: 17px;
    color: #fff;
  }

  .panel-head button {
    color: rgba(255, 255, 255, 0.75);
  }

  .panel-head button:hover {
    color: #fff;
  }

  .panel-pin {
    color: rgba(255, 255, 255, 0.7);
  }

  .panel-pin:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  .panel-pin.is-pinned {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
  }

  .panel-tree-hint {
    margin: 0;
    padding: 12px 16px;
    padding-left: max(16px, env(safe-area-inset-left, 16px));
    padding-right: max(16px, env(safe-area-inset-right, 16px));
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
    background: var(--burgundy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .campus-nav-panel {
    padding: 12px 14px 16px;
    padding-left: max(14px, env(safe-area-inset-left, 14px));
    padding-right: max(14px, env(safe-area-inset-right, 14px));
    -webkit-overflow-scrolling: touch;
  }

  .campus-scene-card--tree {
    padding: 12px 14px;
  }

  .panel-backdrop {
    display: block;
  }
}

@media (max-height: 640px) {
  .campus-landing-inner {
    padding-top: 8px;
  }

  .campus-landing-map-stage img {
    max-height: min(42dvh, 300px);
  }

  .campus-landing-card-badge {
    width: 32px;
    height: 32px;
    top: 10px;
    right: 10px;
  }

  .campus-landing-card-badge img,
  #landingLogo {
    max-width: 32px;
    max-height: 32px;
  }

  .landing-chip {
    padding: 8px 6px;
    font-size: 11px;
  }
}

/* ── 안내도 모달 ── */
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
}

.map-modal[hidden] { display: none; }

.map-dialog {
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  color: var(--panel-text);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.map-head button {
  border: 0;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 14px;
}

.map-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #6b7280;
}

.map-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  line-height: 0;
}

.map-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

.map-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  border-radius: 10px;
  display: block;
}

.map-spot {
  position: absolute;
  border: none;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  transition: none;
}

.map-spot:hover,
.map-spot:focus-visible {
  background: rgba(24, 181, 176, 0.12);
  outline: none;
}

.map-spot.active {
  background: transparent;
  border: none;
}

.map-spot span {
  display: none;
}

@media (max-width: 768px) {
  .viewer-top {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top, 10px));
  }

  .brand {
    max-width: 100%;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .top-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .thumb-item,
  .thumb-item .thumb-img {
    width: 120px;
  }

  .thumb-item .thumb-img {
    height: 76px;
  }

  .thumb-nav {
    width: 32px;
    height: 32px;
    margin-bottom: 24px;
  }

  .panel-backdrop {
    display: block;
  }

  .floor-rail {
    left: 8px;
    max-height: min(48vh, 280px);
  }

  .floor-rail-btn {
    min-width: 48px;
    padding: 8px 8px;
    border-radius: 10px;
  }

  .floor-rail-btn-name {
    font-size: 12px;
  }

  .floor-rail-building {
    font-size: 10px;
  }

  .floor-rail-now {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .brand img {
    width: 40px;
    height: 40px;
  }

  .top-btn span.label-text {
    display: none;
  }

  .thumb-track-wrap {
    max-width: calc(100vw - 96px);
  }

  .intro-dialog {
    max-height: 92vh;
  }

  .intro-header h2 {
    font-size: 17px;
  }

  .top-right-col {
    align-items: flex-end;
    width: 100%;
  }

  .intro-fixed-btn {
    width: auto;
    justify-content: flex-start;
    gap: 4px;
    padding: 4px 8px 4px 6px;
    font-size: 10px;
    border-width: 1.5px;
  }

  .intro-fixed-btn .intro-plus {
    width: 14px;
    height: 14px;
    font-size: 11px;
  }
}
