.tour-page {
  --tour-bg: #0d0d10;
  --tour-panel: rgba(19, 19, 18, 0.78);
  --tour-line: rgba(255, 255, 255, 0.14);
  --tour-text: #fffaf0;
  --tour-muted: #b7b0a3;
  --tour-gold: #d6b46c;
  min-height: 100svh;
  overflow: hidden;
  background: var(--tour-bg);
  color: var(--tour-text);
  font-family: Inter, "SF Pro Display", Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tour-page * {
  box-sizing: border-box;
}

.tour-page button {
  font: inherit;
}

:where([hidden]) {
  display: none !important;
}

.tour-shell,
.tour-viewer {
  position: fixed;
  inset: 0;
}

.tour-viewer {
  z-index: 0;
  background: #111;
}

.tour-flat-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(48, 46, 42, 0.32), transparent 62%),
    #111;
}

.tour-flat-frame {
  position: relative;
  width: min(100vw, calc(100svh * 16 / 9));
  max-height: 100svh;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.tour-flat-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tour-flat-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tour-flat-hotspot {
  position: absolute;
  z-index: 1;
  min-width: 112px;
  height: 42px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
}

.tour-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.58), transparent 34%, transparent 70%, rgba(0, 0, 0, 0.30)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.26), transparent 38%, rgba(0, 0, 0, 0.38));
}

.tour-topbar,
.tour-panel,
.tour-loading {
  position: fixed;
  z-index: 5;
}

.tour-topbar {
  left: 24px;
  right: 24px;
  top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.tour-back,
.tour-title {
  pointer-events: auto;
}

.tour-back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--tour-line);
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.68);
  color: var(--tour-text);
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(22px) saturate(1.12);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.tour-back svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tour-back:hover,
.tour-back:focus-visible {
  border-color: rgba(214, 180, 108, 0.54);
  background: rgba(214, 180, 108, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.tour-title {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--tour-line);
  border-radius: 16px;
  background: rgba(20, 20, 19, 0.66);
  text-align: right;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(22px) saturate(1.12);
}

.tour-title span {
  color: var(--tour-gold);
  font-size: 12px;
  font-weight: 850;
}

.tour-title h1 {
  margin: 0;
  color: var(--tour-text);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.2;
}

.tour-title__notice {
  max-width: 340px;
  margin: 5px 0 0;
  color: var(--tour-muted);
  font-size: 11px;
  font-weight: 620;
  line-height: 1.35;
  text-align: right;
}

.tour-panel {
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100% - 48px));
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--tour-line);
  border-radius: 22px;
  background: var(--tour-panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(28px) saturate(1.14);
}

.tour-panel__head {
  display: grid;
  gap: 4px;
}

.tour-panel__head span {
  color: var(--tour-gold);
  font-size: 12px;
  font-weight: 850;
}

.tour-panel__head strong {
  color: var(--tour-text);
  font-size: 24px;
  line-height: 1.1;
}

.tour-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.tour-specs div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--tour-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.tour-specs dt,
.tour-specs dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-specs dt {
  color: var(--tour-muted);
  font-size: 11px;
  font-weight: 780;
}

.tour-specs dd {
  margin-top: 4px;
  color: var(--tour-text);
  font-size: 13px;
  font-weight: 820;
}

.tour-plan {
  position: relative;
  height: 154px;
  overflow: hidden;
  border: 1px solid var(--tour-line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(214, 180, 108, 0.16), transparent 42%),
    rgba(255, 255, 255, 0.045);
}

.tour-plan__core {
  display: none;
}

.tour-plan__points,
.tour-plan__rooms,
.tour-plan-point {
  position: absolute;
  z-index: 1;
}

.tour-plan__points,
.tour-plan__rooms {
  inset: 0;
}

.tour-plan-room {
  position: absolute;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 250, 240, 0.62);
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.tour-plan-room[data-room^="window"] {
  font-size: 0;
  border-color: rgba(155, 216, 255, 0.34);
}

.tour-plan-room[data-room="living"] {
  background: rgba(214, 180, 108, 0.09);
}

.tour-plan-room[data-room="kitchen"] {
  background: rgba(112, 202, 255, 0.08);
}

.tour-plan-room[data-room="bedroom"] {
  background: rgba(139, 199, 130, 0.08);
}

.tour-plan-room[data-room="bath"] {
  background: rgba(170, 178, 194, 0.08);
}

.tour-plan-room[data-room="window-south"] {
  align-items: center;
  justify-content: center;
  color: rgba(155, 216, 255, 0.82);
  background: rgba(112, 202, 255, 0.10);
}

.tour-plan-room[data-room="window-west"],
.tour-plan-room[data-room="window-east"] {
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: rgba(155, 216, 255, 0.82);
  background: rgba(112, 202, 255, 0.10);
}

.tour-plan-room.is-active {
  border-color: rgba(214, 180, 108, 0.66);
  background: rgba(214, 180, 108, 0.16);
  color: var(--tour-text);
}

.tour-plan-point {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 250, 240, 0.86);
  border-radius: 999px;
  background: rgba(214, 180, 108, 0.80);
  box-shadow: 0 0 0 5px rgba(214, 180, 108, 0.14);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  z-index: 2;
}

.tour-plan-point:hover,
.tour-plan-point:focus-visible,
.tour-plan-point.is-active {
  background: #fffaf0;
  outline: none;
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 0 0 7px rgba(214, 180, 108, 0.24);
}

.tour-plan-point--window {
  width: 12px;
  height: 12px;
  border-color: rgba(227, 247, 255, 0.88);
  background: rgba(112, 202, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(112, 202, 255, 0.14);
}

.tour-plan-point--window:hover,
.tour-plan-point--window:focus-visible,
.tour-plan-point--window.is-active {
  box-shadow: 0 0 0 7px rgba(112, 202, 255, 0.22);
}

.tour-room-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tour-room-button,
.tour-window-button,
.tour-window-option {
  min-height: 38px;
  border: 1px solid var(--tour-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--tour-text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tour-room-button {
  padding: 0 13px;
  font-size: 12px;
  font-weight: 760;
}

.tour-room-button:hover,
.tour-room-button:focus-visible,
.tour-room-button.is-active,
.tour-window-option:hover,
.tour-window-option:focus-visible,
.tour-window-option.is-active,
.tour-window-option.is-nearest,
.tour-window-button:hover,
.tour-window-button:focus-visible {
  border-color: rgba(214, 180, 108, 0.58);
  background: rgba(214, 180, 108, 0.13);
  outline: none;
  transform: translateY(-1px);
}

.tour-window-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tour-window-option {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 7px 8px;
  text-align: center;
}

.tour-window-option span,
.tour-window-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-window-option span {
  font-size: 12px;
  font-weight: 850;
}

.tour-window-option small {
  color: var(--tour-muted);
  font-size: 10px;
  font-weight: 720;
}

.tour-window-option.is-active {
  background: rgba(214, 180, 108, 0.24);
}

.tour-window-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 15px;
  font-weight: 820;
}

.tour-window-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tour-hotspot {
  min-width: 112px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255, 250, 240, 0.68);
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.74);
  color: #fffaf0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.tour-hotspot span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tour-gold);
  box-shadow: 0 0 0 6px rgba(214, 180, 108, 0.18);
}

.tour-hotspot strong {
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.tour-hotspot--window {
  border-color: rgba(112, 202, 255, 0.70);
}

.tour-hotspot--window span {
  background: #9bd8ff;
  box-shadow: 0 0 0 6px rgba(112, 202, 255, 0.18);
}

.tour-page.is-point-transitioning .tour-viewer {
  cursor: progress;
}

.tour-page.is-point-transitioning .tour-room-button,
.tour-page.is-point-transitioning .tour-plan-point,
.tour-page.is-point-transitioning .tour-window-option {
  opacity: 0.72;
}

.tour-loading {
  left: 50%;
  top: 50%;
  padding: 12px 16px;
  border: 1px solid var(--tour-line);
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.72);
  color: var(--tour-text);
  font-size: 13px;
  font-weight: 800;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(18px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.tour-loading--message {
  width: min(420px, calc(100% - 40px));
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  text-align: center;
}

.tour-loading--message strong {
  font-size: 15px;
}

.tour-loading--message span {
  color: var(--tour-muted);
  font-size: 13px;
  line-height: 1.35;
}

.tour-loading--message a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 0 14px;
  border: 1px solid rgba(214, 180, 108, 0.58);
  border-radius: 999px;
  background: rgba(214, 180, 108, 0.14);
  color: var(--tour-text);
  text-decoration: none;
}

.tour-loading.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.tour-unavailable {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100% - 40px));
  display: grid;
  gap: 12px;
  padding: 26px;
  border: 1px solid rgba(214, 180, 108, 0.42);
  border-radius: 24px;
  background: rgba(20, 20, 19, 0.86);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(24px) saturate(1.14);
}

.tour-unavailable strong {
  font-size: 20px;
}

.tour-unavailable p {
  margin: 0;
  color: var(--tour-muted);
  font-size: 14px;
  line-height: 1.45;
}

.tour-unavailable a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(214, 180, 108, 0.58);
  border-radius: 999px;
  background: rgba(214, 180, 108, 0.14);
  color: var(--tour-text);
  text-decoration: none;
}

.tour-marker-debug {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 8;
  min-height: 36px;
  max-width: min(420px, calc(100% - 36px));
  padding: 0 14px;
  border: 1px solid rgba(112, 202, 255, 0.58);
  border-radius: 999px;
  background: rgba(7, 12, 16, 0.78);
  color: #dff4ff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media print {
  .tour-marker-debug {
    display: none;
  }
}

@media (max-width: 760px) {
  .tour-topbar {
    left: 12px;
    right: 12px;
    top: 12px;
    align-items: flex-start;
  }

  .tour-title {
    max-width: calc(100% - 132px);
    padding: 10px 12px;
  }

  .tour-title h1 {
    font-size: 15px;
  }

  .tour-title__notice {
    max-width: 220px;
    font-size: 10px;
  }

  .tour-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 44svh;
    overflow-y: auto;
    padding: 14px;
    border-radius: 20px;
  }

  .tour-panel__head strong {
    font-size: 20px;
  }

  .tour-plan {
    height: 126px;
  }

  .tour-specs {
    grid-template-columns: 1fr;
  }

  .tour-window-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-back,
  .tour-room-button,
  .tour-window-button,
  .tour-plan-point {
    transition: none;
  }
}
