/* A single selected branch fills the section. Copy uses the shared page gutter;
   the photo buffers stay fixed while branch selection and slide arrows stay live. */
.selected-preview #door.selected-space {
  --space-height: clamp(660px, 52vw, 1000px);
  --space-copy-width: clamp(360px, calc(39.5vw - var(--page-edge) - 30px), 480px);
  --space-rail-inset: 6px;
  --space-heading-overhang: .025em;
  --space-shade: 18 13 10;
  min-height: 0;
  color: #fff4dc;
  background: #15110e;
}
.selected-preview #door.selected-space::before { display: none; }
.selected-preview #door .selected-space__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'copy' 'tools';
  grid-template-rows: min-content min-content;
  align-content: center;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: var(--space-height);
  gap: 24px 0;
  margin: 0;
  padding: clamp(72px, 7vw, 112px) var(--page-edge);
  overflow: hidden;
  isolation: isolate;
}
.selected-preview #door .selected-space__stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(var(--space-shade) / 70%) 0%, rgb(var(--space-shade) / 56%) 30%, rgb(var(--space-shade) / 26%) 47%, rgb(var(--space-shade) / 0%) 70%);
}
.selected-preview #door .selected-space__copy {
  position: relative;
  z-index: 2;
  grid-area: copy;
  container-type: inline-size;
  width: min(100%, var(--space-copy-width));
  min-width: 0;
  min-height: 0;
  align-self: start;
  padding: 0;
  color: #fff4dc;
  text-align: left;
  pointer-events: none;
}
.selected-preview #door .selected-space__copy h2 {
  margin: 0;
  color: inherit;
  font-family: var(--font-display, Pretendard, sans-serif);
  font-size: clamp(48px, 4.67vw, 82px);
  font-size: clamp(38px, min(4.67vw, 16.5cqi), 82px);
  font-weight: 800;
  font-synthesis: none;
  line-height: 1.14;
  letter-spacing: -.045em;
  text-wrap: balance;
  word-break: keep-all;
}
.selected-preview #door .selected-space__copy h2 span {
  display: block;
  position: relative;
  inset-inline-start: calc(-1 * var(--space-heading-overhang));
}
.selected-preview #door .selected-space__copy > p:not([hidden]) {
  position: relative;
  left: 5px;
  margin: 26px 0 32px;
  color: inherit;
  font-size: clamp(17px, 1.4vw, 22px);
  font-weight: 600;
  line-height: 1.65;
  word-break: keep-all;
}
.selected-preview #door .selected-space__branch-nav {
  pointer-events: auto;
  width: min(100%, 480px);
  min-width: 0;
  margin-inline: 0;
  padding-inline: 0;
}
.selected-preview #door .selected-space__copy .branch-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  gap: 4px;
  margin: 0;
  padding: var(--space-rail-inset);
  border: 0;
  border-radius: 999px;
  background: #fff4dc;
  box-shadow: 0 4px 12px rgb(18 28 19 / 12%);
}
.selected-preview #door .selected-space__copy .branch-links button {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #073f33;
  font-family: Pretendard, sans-serif;
  font-size: clamp(14px, 1.15vw, 19px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.025em;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  text-shadow: none;
  box-shadow: none;
  transform: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .2s ease, color .2s ease, box-shadow .16s ease;
}
.selected-preview #door .selected-space__copy .branch-links button:active {
  box-shadow: inset 0 0 0 2px rgb(7 63 51 / 20%);
}
.selected-preview #door .selected-space__copy .branch-links button[aria-pressed=true] {
  background: var(--orange, #ff8a24);
  color: #073f33;
  font-weight: 800;
}
@media (hover: hover) {
  .selected-preview #door .selected-space__copy .branch-links button:not([aria-pressed=true]):hover {
    background: rgb(16 75 65 / 14%);
  }
}
.selected-preview #door .branch-links button:focus-visible {
  outline: 3px solid #073f33;
  outline-offset: -4px;
  box-shadow: none;
}
.selected-preview #door .selected-space__visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  grid-area: auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  aspect-ratio: auto;
  overflow: hidden;
  background: #15110e;
}
.selected-preview #door .selected-space__tour-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  touch-action: pan-y pinch-zoom;
}
.selected-preview #door .selected-space__tour-layer:focus-visible {
  outline: 3px solid #fff4dc;
  outline-offset: -6px;
}
.selected-preview #door .selected-space__tour-layer > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 960ms cubic-bezier(.4,0,.2,1);
}
/* The decoded-image controller owns opacity during each blend. Avoid a second
   CSS transition when its animation effects are released at the final frame. */
.selected-preview #door .selected-space__stage[data-photo-motion="crossfade"] .selected-space__tour-layer > img {
  transition: none;
}
/* Source changes only target the hidden buffer; the old image remains in view. */
.selected-preview #door .selected-space__stage.is-detail-loading .selected-space__tour-layer > img[aria-hidden=true] {
  visibility: hidden;
  transition: none;
}
.selected-preview #door .selected-space__tools {
  position: relative;
  inset: auto;
  z-index: 2;
  grid-area: tools;
  justify-self: start;
  width: min(100%, var(--space-copy-width));
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #fff4dc;
  pointer-events: none;
}
.selected-preview #door .selected-space__tools :is(.room-status, .selected-space__load-status) {
  color: #fff4dc;
  padding: 0;
  margin: 0 0 14px;
  font-size: 14px;
}
.selected-preview #door .selected-space__tools :is(.room-status, .selected-space__load-status):not([hidden]) {
  position: absolute;
  inset: calc(100% + 12px) auto auto 0;
  width: max-content;
  max-width: min(280px, calc(100vw - 2 * var(--page-edge)));
  margin: 0;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgb(var(--space-shade) / 92%);
}
.selected-preview #door .selected-space__tools .room-controls {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.selected-preview #door .selected-space__tools .room-controls button {
  flex: 0 0 44px;
  gap: 0;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff4dc;
  background: transparent;
  font: 600 14px/1.4 Pretendard, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  box-shadow: none;
  transition: opacity 180ms ease;
}
.selected-preview #door .space-photo-count {
  display: inline-flex;
  align-items: baseline;
  justify-self: center;
  gap: 7px;
  margin: 0;
  color: #fff4dc;
  font-family: Pretendard, sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.selected-preview #door .space-photo-count strong {
  min-width: 1ch;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}
.selected-preview #door .space-photo-count__rest {
  color: rgb(255 244 220 / 72%);
  font-size: 16px;
  font-weight: 400;
}
@media (hover: hover) {
  .selected-preview #door .selected-space__tools .room-controls button:hover {
    background: transparent;
    opacity: .72;
  }
}
.selected-preview #door .selected-space__tools .room-controls button:active {
  background: transparent;
  opacity: .5;
}
.selected-preview #door .selected-space__tools .room-controls button:focus-visible {
  outline: 2px solid #fff4dc;
  outline-offset: -3px;
}
.selected-preview #door .selected-space__tools .room-controls button svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}
html[lang=en] .selected-preview #door .selected-space__copy h2 {
  --space-heading-overhang: 0em;
  font-family: Pretendard, sans-serif;
  font-size: clamp(30px, min(3.78vw, 12.5cqi), 67px);
  letter-spacing: -.03em;
}
html[lang=en] .selected-preview #door .branch-links button {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 14px;
}
@media (max-width: 1000px) {
  .selected-preview #door.selected-space { --space-height: 680px; }
  .selected-preview #door .selected-space__copy h2 { font-size: clamp(38px, 4.62vw, 48px); }
}
@media (max-width: 760px) {
  .selected-preview #door.selected-space { --space-height: 760px; --space-rail-inset: 4px; }
  .selected-preview #door .selected-space__stage {
    min-height: var(--space-height);
    padding: 80px var(--page-edge);
    gap: 10px 0;
  }
  .selected-preview #door .selected-space__copy { width: 100%; }
  .selected-preview #door .selected-space__tools {
    width: min(100%, 288px);
    justify-self: center;
  }
  .selected-preview #door .selected-space__stage::before {
    background: none;
  }
  .selected-preview #door .selected-space__tour-layer > img { object-position: 64% center; }
  /* Preserve the photograph's light; contrast follows the lettering only. */
  .selected-preview #door .selected-space__copy h2,
  .selected-preview #door .selected-space__copy > p:not([hidden]) {
    text-shadow: 0 2px 3px rgb(33 26 22 / 64%), 0 6px 18px rgb(33 26 22 / 52%);
  }
  .selected-preview #door .space-photo-count {
    text-shadow: 0 1px 3px rgb(33 26 22 / 85%), 0 3px 10px rgb(33 26 22 / 55%);
  }
  .selected-preview #door .selected-space__tools .room-controls button svg {
    filter: drop-shadow(0 1px 2px rgb(33 26 22 / 75%));
  }

  .selected-preview #door .selected-space__copy { text-align: center; }
  .selected-preview #door .selected-space__copy h2 {
    --space-heading-overhang: 0em;
    font-size: clamp(38px, 9.975vw, 57px);
  }
  .selected-preview #door .selected-space__copy > p:not([hidden]) {
    left: 0;
    margin: 22px auto 20px;
    font-size: 16px;
  }
  .selected-preview #door .selected-space__branch-nav {
    width: min(100%, 288px);
    margin-inline: auto;
  }
  .selected-preview #door .selected-space__copy .branch-links button {
    min-height: 34px;
    font-size: 13px;
    padding: 7px 4px;
  }
  html[lang=en] .selected-preview #door .selected-space__copy .branch-links button {
    min-height: 44px;
    padding: 6px 2px;
    font-size: 12px;
    overflow-wrap: normal;
    word-break: normal;
  }
}
@media (prefers-reduced-motion: reduce) {
  .selected-preview #door .selected-space__tour-layer > img,
  .selected-preview #door .selected-space__copy .branch-links button,
  .selected-preview #door .selected-space__tools .room-controls button,
  .selected-preview #door .selected-space__tools .room-controls button svg { transition: none; }
  .selected-preview #door .selected-space__tools .room-controls button svg { transform: none; }
}
