.tour-scene.is-active { background: var(--cream); animation: tour-fade .2s ease both; }
.tour-stage { border-radius: 8px; }
.tour-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tour-hotspot { position: absolute; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }

.tour-tv-side { right: 7%; top: 26%; width: 14%; height: 20%; }

.tour-kitchen-entry { left: 37%; top: 24%; width: 25%; height: 14%; }
.tour-map { left: 6.5%; top: 18%; width: 13%; height: 20%; }
.tour-oven { left: 59.8%; top: 19.3%; width: 14.3%; height: 18.1%; }
.tour-hover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.tour-oven .tour-hover-art { height: 111%; }
.tour-table .tour-hover-art { inset: 1% auto auto 12%; width: 76%; height: 66%; }
.tour-hotspot:is(.tour-oven, .tour-table):focus-visible { background: transparent; }
:is(.tour-oven, .tour-table):focus-visible .tour-hover-art { opacity: 1; }
@media (hover: hover) {
  .tour-hotspot:is(.tour-oven, .tour-table):hover { background: transparent; }
  :is(.tour-oven, .tour-table):hover .tour-hover-art { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-hover-art { transition: none; }
}
.tour-mirror { left: 21%; top: 16%; width: 22%; height: 31%; }
.tour-tv-front { left: 36%; top: 24%; width: 29%; height: 22%; }
.tour-nav { flex-wrap: wrap; gap: 0 clamp(4px, 2vw, 24px); min-height: 60px; padding: 6px 8px; overflow: visible; }
.tour-nav .nav-item { min-height: 44px; padding: 8px 10px; color: var(--ink); font-size: 14px; }
.tour-nav .nav-item { position: relative; }
.tour-nav .is-current { font-weight: 700; }
.tour-nav .is-current::after { content: ""; position: absolute; inset: auto 10px 3px; height: 2px; border-radius: 2px; background: #b76c76; }
.tour-back { position: absolute; top: 10px; left: 10px; z-index: 2; min-height: 44px; padding: 8px 13px; background: var(--cream); border: 0; border-radius: 6px; cursor: pointer; }
.tour-back::before { content: "‹"; margin-inline-end: 6px; }
.tour-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.tour-dialog { color: var(--ink); width: min(680px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 2px solid #998477; border-radius: 16px 12px 18px 10px; background: var(--cream); box-shadow: 8px 10px 0 rgba(85,74,66,.16); overflow: auto; }
.tour-dialog[open] { animation: tour-fade .2s ease both; }
.tour-dialog::backdrop { background: rgba(66,53,46,.48); }
.tour-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 1; padding: 12px 16px; background: var(--cream); border-bottom: 1px dashed #c4b09b; }
.tour-dialog-head h2 { margin: 0; font-size: clamp(20px, 4vw, 26px); }
.tour-dialog button { min-width: 44px; min-height: 44px; border: 1px solid #a48c79; border-radius: 12px; background: #fffaf1; padding: 8px 14px; cursor: pointer; }
.tour-dialog button:hover { background: #f6dfdc; }
.tour-dialog button:disabled { opacity: .45; cursor: default; }
.tour-dialog button:focus-visible, .tour-nav button:focus-visible { outline: 3px solid #72526d; }
.tour-dialog-body { padding: 20px; text-align: center; }
.tour-dialog[data-kind="map"] { width: min(1236px, calc(100vw - 24px)); border: 0; }
.tour-dialog[data-kind="map"] .tour-dialog-body { padding: 0; }
.tour-map-image { display: block; width: 100%; height: auto; }
.tour-empty { margin: 25px 0; padding: 30px 10px; font-size: 18px; line-height: 1.7; }
.tour-dialog[data-kind="video"] {
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - 20px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.tour-dialog[data-kind="video"]::backdrop { background: #36292bbd; }
.tour-dialog[data-kind="video"] .tour-dialog-head {
  position: static;
  padding: 0 4px 10px;
  border: 0;
  color: #fff5e5;
  background: transparent;
}
.tour-dialog[data-kind="video"] .tour-dialog-head h2 { font-size: 19px; }
.tour-dialog[data-kind="video"] #tourDialogClose { color: #513e57; }
.tour-dialog[data-kind="video"] .tour-dialog-body { padding: 0 4px 10px; }
.tour-tv-cabinet {
  --screen-ratio: .5625;
  --cabinet-edge: clamp(9px, 2vw, 17px);
  --fascia-height: 42px;
  display: grid;
  width: max-content;
  padding: var(--cabinet-edge);
  border: 2px solid #513e57;
  border-radius: 25px 24px 29px 23px;
  background: #aa91b9 url('assets/room-tour/television-crayon.webp') center / cover;
  box-shadow: inset 0 0 0 3px #e1c9e367, inset 0 -7px #67486a40, 0 6px #513b52;
}
.tour-tv-cabinet video {
  display: block;
  width: min(
    calc((100dvh - 142px - var(--fascia-height)) * var(--screen-ratio)),
    calc(100vw - 36px - 2 * var(--cabinet-edge)),
    660px
  );
  aspect-ratio: var(--screen-ratio);
  object-fit: contain;
  border-radius: 10px;
  background: #302630;
  box-shadow: 0 0 0 3px #574257;
}
.tour-tv-fascia {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  height: var(--fascia-height);
  padding: 7px 3px 0;
  box-sizing: border-box;
}
.tour-tv-dial {
  width: 25px;
  box-sizing: border-box;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid #674b67;
  border-radius: 50%;
  background: #ead3b7;
  box-shadow: 1px 2px #674b67;
}
.tour-tv-dial::before {
  content: '';
  width: 60%;
  height: 2px;
  background: #795971;
  transform: rotate(-42deg);
}
.tour-tv-speaker {
  width: 36px;
  height: 20px;
  border-radius: 3px;
  background: repeating-linear-gradient(to bottom, #694e6b 0 2px, transparent 2px 6px);
}
.tour-video-error { padding: 12px; }
.tour-dialog[data-kind="video"] .tour-video-error { color: #fff5e5; }
@keyframes tour-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) { .tour-nav { gap: 0; } .tour-nav .nav-item { font-size: 13px; padding: 8px; } .tour-back { top: 6px; left: 6px; font-size: 13px; } .tour-dialog-body { padding: 14px; } }
@media (prefers-reduced-motion: reduce) { .tour-scene.is-active, .tour-dialog[open] { animation: none; } }
.tour-table {
  left: var(--plate-left, 48.2%);
  top: var(--plate-top, 63.4%);
  width: var(--plate-width, 15.2%);
  height: var(--plate-height, 6.8%);
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
}

.tour-dialog[data-kind="plate-memory"] {
  width: min(1040px, calc(100vw - 24px), calc((100dvh - 100px) * 1.5));
  max-height: calc(100dvh - 24px);
  border: 1px solid #b39485;
  box-shadow: 0 12px 48px #4d302f54;
  overflow: hidden;
}
.tour-dialog[data-kind="plate-memory"] .tour-dialog-head {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
}
.tour-dialog[data-kind="plate-memory"] #tourDialogTitle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tour-dialog[data-kind="plate-memory"] #tourDialogClose {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 25px;
  line-height: 1;
}
.tour-dialog[data-kind="plate-memory"] .tour-dialog-body { padding: 0; }
.plate-memory-canvas {
  position: relative;
  container-type: size;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  background:
    url('assets/room-tour/plate-memories/plate.webp') center / auto 89% no-repeat;
}
.plate-memory-canvas::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  background: url('assets/room-tour/plate-memories/cutlery-slim.webp') center / 122% 57% no-repeat;
}
.plate-memory-prints {
  position: absolute;
  inset: 0 14%;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.plate-memory-canvas.is-draggable { cursor: grab; }
.plate-memory-canvas.is-dragging { cursor: grabbing; }
.plate-memory-print {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(28.6cqw, 45cqh);
  height: min(29.9cqw, 45cqh);
  pointer-events: none;
}
.plate-memory-print img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #5e3e2a30);
}
.plate-memory-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.plate-memory-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 5vw, 44px);
  padding: 5px 10px;
  min-height: 54px;
  background: #fff7ec;
}
.plate-memory-nav button { font-size: 25px; line-height: 1; }
.plate-memory-nav output { font-variant-numeric: tabular-nums; }
@media (max-width: 600px) and (orientation: portrait) {
  .plate-memory-canvas { aspect-ratio: 6 / 5; background-size: auto 79%; }
  .plate-memory-print { width: min(27.3cqw, 43cqh); height: min(33.8cqw, 43cqh); }
}
.tour-dialog[data-kind="plate-memory"] { background: transparent; border: 0; box-shadow: none; }
.tour-dialog[data-kind="plate-memory"]::backdrop { background: #392a25a6; }
.plate-memory-nav {
  width: fit-content;
  margin-inline: auto;
  gap: 14px;
  border: 1px solid #b39485;
  border-radius: 12px;
}

.tour-dialog[data-kind="map"] {
  width: min(1440px, calc(100vw - 24px));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.tour-dialog[data-kind="map"] .tour-dialog-head {
  height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 5;
}
.tour-dialog[data-kind="map"] .tour-dialog-head h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.tour-dialog[data-kind="map"] #tourDialogClose { position: absolute; top: 8px; right: 8px; }
.map-layout {
  position: relative;
  display: grid;
  align-items: center;
  width: min(100%, 1140px);
  margin: auto;
  padding: 48px clamp(12px, 3vw, 42px) 26px;
}
.map-layout.has-place {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 36%);
  gap: clamp(20px, 5vw, 64px);
}
.tour-map-canvas { min-width: 0; }
.map-art {
  display: block;
  width: min(100%, 112dvh);
  margin: auto;
  overflow: visible;
  filter: drop-shadow(0 8px 20px #221c2429);
}
.map-art { transform-origin: top left; }
.map-art .map-region {
  fill: transparent;
  stroke: none;
  outline: none;
  cursor: pointer;
  transition: fill .16s ease;
}
@media (hover: hover) {
  .map-art .map-region:hover { fill: #fff7e478; }
}
.map-art .map-region:focus-visible { fill: #fff7e478; }
.map-location-dot {
  fill: #784d59;
  stroke: #fff0d4;
  stroke-width: 1.4px;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  transition: fill .16s ease, stroke .16s ease;
}
.map-region:is(:hover, :focus-visible, [aria-pressed="true"]) + .map-location-dot {
  fill: #fff0d4;
  stroke: #784d59;
}
.map-detail {
  min-width: 0;
  color: #fff7e8;
  text-align: left;
  text-shadow: 0 1px 4px #251c24;
}
.map-connector {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.map-connector path {
  fill: none;
  stroke: #f8e4c8;
  stroke-width: 1.15px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1px #392a34);
}
.map-story h2 { margin: 0 0 12px; font-size: clamp(25px, 3vw, 42px); line-height: 1.13; }
.map-story h2:focus { outline: none; }
.map-photo {
  display: flex;
  align-items: center;
  height: min(39dvh, 330px);
}
.map-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  object-fit: contain;
}
.map-story blockquote { margin: 14px 0 8px; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.65; }
.tour-dialog[data-kind="map"]::backdrop {
  background: #302736a8;
  backdrop-filter: blur(5px);
}
.tour-dialog[data-kind="map"] button {
  background: transparent;
  border: 0;
  color: #fff7e8;
  text-shadow: 0 1px 4px #251c24;
}
.tour-dialog[data-kind="map"] button:hover { text-decoration: underline; }
.map-layout.has-place { padding-bottom: 0; }
.map-footer { padding: 0 8px 14px; text-align: right; }
.tour-dialog[data-kind="map"] :is(#tourDialogClose, .map-footer button) {
  text-align: right;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
@media (max-width: 660px) {
  .map-layout.has-place { grid-template-columns: 1fr; gap: 20px; }
  .map-detail { width: min(100%, 440px); margin: auto; }
  .map-photo { height: min(37dvh, 310px); }
}
@media (prefers-reduced-motion: reduce) { .map-art .map-region, .map-location-dot { transition: none; } }
