:root {
  --surface: #efe3cf;
  --surface-strong: #fff4df;
  --ink: #211812;
  --muted: #c8b99f;
  --line: rgba(238, 202, 146, .24);
  --line-strong: rgba(238, 202, 146, .46);
  --accent: #c88740;
  --accent-soft: rgba(200, 135, 64, .18);
  --warm: #f0c17a;
  --rain: #7ba8bd;
  --glass: rgba(28, 20, 14, .78);
  --dark-glass: rgba(13, 10, 8, .58);
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html {
  min-width: 320px;
  background: #120f0c;
  color-scheme: light;
  scroll-behavior: smooth;
}
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--surface-strong);
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid rgba(229, 184, 119, .9);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; }
h1, h2, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 8px 10px;
  background: var(--surface-strong);
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.ai-disclosure {
  display: none;
  position: fixed;
  right: 32px;
  bottom: 20px;
  z-index: 130;
  max-width: calc(100vw - 40px);
  padding: 6px 8px;
  border: 1px solid rgba(238, 202, 146, .24);
  border-radius: 3px;
  background: rgba(18, 13, 10, .68);
  color: rgba(255, 235, 205, .76);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

html[data-scene="dialogue"] .ai-disclosure {
  display: block;
}

@media (max-width: 720px) {
  .ai-disclosure {
    right: 64px;
    bottom: 70px;
    max-width: calc(100vw - 24px);
    padding: 5px 7px;
    font-size: 10px;
  }
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  background: linear-gradient(180deg, rgba(12, 9, 7, .44), rgba(12, 9, 7, 0));
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  color: var(--surface-strong);
  text-decoration: none;
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .38));
}
.scene-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 24px);
  padding: 5px 0;
  border: 0;
  background: transparent;
}
.scene-nav button {
  position: relative;
  min-height: 28px;
  min-width: 0;
  padding: 0 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 244, 227, .68);
  font-size: 13px;
  line-height: 1;
  letter-spacing: .03em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .28);
  transition: color 160ms ease, transform 160ms ease;
}
.scene-nav button:hover,
.scene-nav button.is-current {
  color: var(--surface-strong);
  transform: translateY(-1px);
}
.scene-nav button:hover {
  color: var(--warm);
}
.scene-nav button.is-current {
  color: var(--surface-strong);
}
.scene-nav button.is-current::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--warm);
  content: "";
}
.scene-nav button.is-current::before {
  position: absolute;
  top: 1px;
  left: -8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 0 3px rgba(240, 193, 122, .14);
  content: "";
}

.stage {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #161616;
}
.scene-media,
.scene-media img,
.scene-media video,
.scene-vignette,
.scene-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scene-media {
  z-index: -3;
  overflow: hidden;
  background: #1b1b1b;
}
.scene-media img {
  opacity: 0;
  object-fit: cover;
  object-position: 50% 50%;
  filter: brightness(1.08) saturate(1.04) contrast(1.01);
  transform: scale(1.002);
  transition: opacity 560ms var(--ease), filter 760ms var(--ease), transform 1050ms var(--ease);
}
.scene-media video {
  opacity: 0;
  object-fit: cover;
  object-position: 50% 50%;
  filter: brightness(1.08) saturate(1.04) contrast(1.01);
  transform: scale(1.002);
  pointer-events: none;
  transition: opacity 560ms var(--ease), filter 760ms var(--ease), transform 1050ms var(--ease);
}
.scene-media img.is-active,
.scene-media video.is-active {
  opacity: 1;
}
html[data-scene="studio"] .scene-media img,
html[data-scene="works"] .scene-media img,
html[data-scene="journey"] .scene-media img,
html[data-scene="dialogue"] .scene-media img,
html[data-scene="contact"] .scene-media img,
html[data-scene="studio"] .scene-media video {
  filter: brightness(1.1) saturate(1.04) contrast(1.01);
}
html.is-switching .scene-media img,
html.is-switching .scene-media video {
  opacity: .16;
  filter: brightness(.78) saturate(.82) contrast(.98);
  transform: scale(1.014);
}
.scene-vignette {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .16) 0%, rgba(0, 0, 0, .02) 35%, rgba(0, 0, 0, .02) 68%, rgba(0, 0, 0, .1) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, .01) 45%, rgba(255, 226, 184, .06) 100%);
  pointer-events: none;
}
.door-transition {
  position: fixed;
  inset: 0;
  z-index: 120;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: #090705;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}
.door-transition video,
.door-transition-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.door-transition video {
  object-fit: cover;
  object-position: 50% 50%;
  filter: brightness(1.02) saturate(.96);
}
.door-transition-shade {
  background: #070503;
  opacity: 0;
  transition: opacity 420ms var(--ease);
}
html.is-door-transitioning .door-transition {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}
html.is-door-transition-dark .door-transition-shade {
  opacity: .88;
}
.scene-grid {
  display: none;
  opacity: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .35) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .6), transparent 42%, transparent 100%);
  pointer-events: none;
}

.door-title {
  position: absolute;
  left: clamp(24px, 4vw, 70px);
  bottom: clamp(28px, 6.5vh, 82px);
  z-index: 6;
  display: grid;
  width: min(470px, calc(100vw - 48px));
  color: var(--surface-strong);
  text-shadow: 0 3px 18px rgba(0, 0, 0, .46), 0 1px 2px rgba(0, 0, 0, .24);
}
html:not([data-scene="door"]) .door-title { display: none; }
.door-title::before {
  width: 64px;
  height: 1px;
  margin-bottom: 12px;
  background: rgba(255, 238, 202, .72);
  content: "";
}
.door-title strong {
  margin-top: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 5.4vw, 82px);
  font-weight: 560;
  letter-spacing: .015em;
  line-height: .84;
}
.door-title span {
  margin-top: 19px;
  color: rgba(255, 244, 227, .92);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 560;
  letter-spacing: .22em;
  line-height: 1;
}
.door-title em {
  margin-top: 12px;
  font-style: normal;
  color: rgba(255, 244, 227, .72);
  font-size: clamp(13px, 1.15vw, 16px);
  letter-spacing: .1em;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.hotspot {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--surface-strong);
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.hotspot-right,
.hotspot-left { transform: translate(-50%, -50%); }
.hotspot-dot {
  position: relative;
  display: block;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 238, 202, .96);
  border-radius: 50%;
  background: rgba(52, 34, 20, .72);
  box-shadow: 0 0 0 8px rgba(228, 181, 113, .2), 0 12px 28px rgba(0, 0, 0, .38), inset 0 0 0 4px rgba(212, 154, 84, .2);
}
.hotspot-dot::before {
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(255, 240, 208, .72);
  border-radius: 50%;
  background: rgba(240, 193, 122, .24);
  content: "";
}
.hotspot-dot::after {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(228, 181, 113, .6);
  border-radius: 50%;
  content: "";
  animation: breathe 1800ms ease-in-out infinite;
}
.hotspot-label {
  position: absolute;
  top: 50%;
  display: block;
  padding: 2px 0 4px;
  border-bottom: 1px solid rgba(255, 235, 205, .56);
  border-radius: 0;
  background: rgba(28, 20, 14, .3);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  color: rgba(255, 244, 227, .92);
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}
.hotspot-right .hotspot-label { left: calc(100% + 4px); }
.hotspot-left .hotspot-label { right: calc(100% + 4px); }
.hotspot:hover .hotspot-dot,
.hotspot:focus-visible .hotspot-dot {
  background: var(--accent);
  transform: scale(1.08);
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes breathe {
  0%, 100% { opacity: .28; transform: scale(.88); }
  50% { opacity: .9; transform: scale(1.12); }
}

.scene-embedded {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.journey-installation,
.contact-inscription {
  position: absolute;
}
.journey-installation {
  inset: 0;
  color: #3a2a1d;
  text-shadow: none;
}
.journey-card,
.journey-education,
.journey-hobby {
  position: absolute;
  pointer-events: none;
}
.journey-card {
  display: grid;
  gap: 4px;
  width: min(178px, 11.6vw);
  min-height: 92px;
  padding: 13px 12px 11px;
  border: 1px solid rgba(113, 79, 45, .28);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(238, 216, 180, .86), rgba(218, 187, 136, .78));
  box-shadow: 0 10px 24px rgba(63, 37, 18, .18), inset 0 1px 0 rgba(255, 250, 225, .42);
  transform: rotate(-1deg);
}
.journey-card::before,
.journey-education::before {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 22px;
  height: 20px;
  border: 1px solid rgba(89, 61, 34, .38);
  border-radius: 2px 2px 6px 6px;
  background: linear-gradient(180deg, #ad7a3e, #6e4727);
  box-shadow: 0 5px 8px rgba(65, 38, 18, .2);
  content: "";
  transform: translateX(-50%);
}
.journey-card img {
  width: 74px;
  height: 24px;
  object-fit: contain;
  object-position: left center;
}
.journey-card span,
.journey-card small,
.journey-education small {
  color: rgba(58, 42, 29, .66);
  font-size: 10px;
  line-height: 1.25;
}
.journey-card b,
.journey-education b {
  color: #2d2118;
  font-size: 11px;
  line-height: 1.28;
}
.journey-card-1 { left: 13.5%; top: 41.4%; }
.journey-card-2 { left: 27.6%; top: 41.4%; transform: rotate(1deg); }
.journey-card-3 { left: 41.7%; top: 41.4%; }
.journey-card-4 { left: 55.8%; top: 41.4%; transform: rotate(1.2deg); }
.journey-education {
  display: grid;
  place-items: center;
  gap: 4px;
  width: min(150px, 9.8vw);
  min-height: 86px;
  padding: 12px 10px 10px;
  border: 1px solid rgba(72, 54, 43, .32);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(60, 68, 70, .82), rgba(42, 45, 43, .78));
  box-shadow: 0 12px 26px rgba(27, 17, 10, .22), inset 0 1px 0 rgba(255, 239, 200, .12);
  color: rgba(255, 235, 205, .88);
  text-align: center;
}
.journey-education span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(236, 190, 116, .4);
  border-radius: 50%;
  color: #f0c17a;
  font-size: 15px;
  font-weight: 820;
}
.journey-education b { color: rgba(255, 242, 220, .92); }
.journey-education small { color: rgba(255, 232, 198, .7); }
.journey-education-1 { left: 66.2%; top: 14.8%; }
.journey-education-2 { left: 76.8%; top: 14.8%; }
.journey-hobby {
  min-height: 28px;
  padding: 5px 10px 6px;
  border: 1px solid rgba(122, 78, 32, .38);
  border-radius: 999px;
  background: rgba(72, 45, 22, .76);
  color: rgba(255, 236, 204, .9);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: .03em;
  box-shadow: 0 8px 18px rgba(63, 37, 18, .18);
}
.journey-hobby-1 { left: 7.5%; top: 70.4%; }
.journey-hobby-2 { left: 80.4%; top: 42.2%; }
.journey-hobby-3 { left: 45.4%; top: 58.2%; }
.contact-inscription {
  top: 43.2%;
  left: 28.8%;
  right: auto;
  display: grid;
  gap: 7px;
  width: min(410px, 25vw);
  padding: 6px 14px 10px;
  color: #4b301d;
  text-align: left;
  text-shadow: none;
  pointer-events: auto;
}
.contact-inscription span {
  color: rgba(224, 188, 124, .72);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
}
.contact-inscription-line {
  display: block;
  width: 100%;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid rgba(224, 188, 124, .28);
  background: transparent;
  color: rgba(255, 235, 203, .9);
  font-size: clamp(18px, 1.34vw, 25px);
  font-weight: 560;
  letter-spacing: .02em;
  text-align: left;
}
.contact-inscription-line:hover {
  color: #fff8e9;
  border-bottom-color: rgba(240, 193, 122, .58);
}
.contact-inscription small {
  color: rgba(224, 188, 124, .58);
  font-size: 11px;
}

.scene-sheet {
  position: absolute;
  top: auto;
  right: auto;
  bottom: clamp(26px, 4vh, 42px);
  left: clamp(22px, 3vw, 42px);
  z-index: 12;
  width: min(410px, calc(100vw - 56px));
  max-height: calc(100svh - 132px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(238, 202, 146, .24);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(33, 24, 18, .82), rgba(23, 16, 12, .74));
  box-shadow: var(--shadow);
  color: var(--surface-strong);
  backdrop-filter: blur(16px) saturate(.92);
}
.scene-sheet.is-semantic-only:not(:focus):not(:focus-within) {
  width: 1px;
  height: 1px;
  max-height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.scene-sheet.is-semantic-only:focus,
.scene-sheet.is-semantic-only:focus-within {
  outline: 2px solid rgba(229, 184, 119, .9);
  outline-offset: 3px;
}
html[data-scene="door"] .scene-sheet {
  top: auto;
  right: clamp(24px, 4vw, 58px);
  bottom: clamp(36px, 8vh, 88px);
  width: min(330px, calc(100vw - 48px));
}
html[data-scene="journey"] .scene-sheet { width: min(510px, calc(100vw - 56px)); }
html[data-scene="dialogue"] .scene-sheet {
  width: min(440px, calc(100vw - 56px));
  max-height: calc(100svh - 136px);
}
.scene-sheet[hidden] { display: none !important; }
.scene-sheet.is-dialogue {
  top: auto;
  right: auto;
  bottom: clamp(74px, 10vh, 112px);
  left: clamp(22px, 3vw, 42px);
  width: min(390px, calc(100vw - 60px));
  max-height: calc(100svh - 132px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(238, 202, 146, .28);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(29, 21, 16, .82), rgba(18, 13, 10, .72));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 235, 205, .08);
  color: var(--surface-strong);
  backdrop-filter: blur(16px) saturate(.9);
}
.scene-sheet.is-dialogue .sheet-kicker { color: var(--warm); }
.scene-sheet.is-dialogue .sheet-lead,
.scene-sheet.is-dialogue .chat-form label { color: rgba(255, 235, 205, .68); }
.scene-sheet.is-dialogue h1 { font-size: clamp(27px, 3vw, 40px); color: var(--surface-strong); }
.scene-sheet.is-dialogue .chat-yudan {
  border: 1px solid rgba(212, 154, 84, .24);
  background: rgba(212, 154, 84, .14);
  color: rgba(255, 244, 227, .92);
}
.scene-sheet.is-dialogue .chat-visitor { background: rgba(0, 0, 0, .42); color: var(--surface-strong); }
.scene-sheet.is-dialogue .chat-form { border-top-color: rgba(255, 235, 205, .2); }
.scene-sheet.is-dialogue .chat-row input {
  border-color: rgba(255, 235, 205, .3);
  background: rgba(15, 11, 9, .45);
  color: var(--surface-strong);
}
.scene-sheet.is-dialogue .chat-row input::placeholder { color: rgba(255, 235, 205, .45); }
.scene-sheet.is-dialogue .chat-row button { border-color: var(--accent); background: var(--accent); color: #26170d; }
.sheet-kicker,
.detail-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
}
.scene-sheet h1 {
  margin-top: 7px;
  color: var(--surface-strong);
  font-size: clamp(26px, 2.8vw, 42px);
  line-height: 1.05;
}
.sheet-lead {
  margin-top: 10px;
  color: rgba(255, 235, 205, .68);
  font-size: 14px;
  line-height: 1.7;
}
.sheet-body { margin-top: 16px; }
.sheet-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.68;
}
.entry-stack {
  display: grid;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.entry-line {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}
.entry-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.primary-button,
.quiet-button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 720;
}
.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #26170d;
}
.primary-button:hover { background: #b9783a; }
.quiet-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--surface-strong);
}
.quiet-button:hover { background: rgba(22, 22, 22, .06); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.feature-item {
  min-height: 86px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .54);
}
.feature-item b {
  display: block;
  font-size: 13px;
}
.feature-item p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.work-list {
  display: grid;
  gap: 8px;
}
.work-entry {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 70px;
  padding: 13px;
  border: 1px solid rgba(255, 235, 205, .2);
  border-radius: 6px;
  background: rgba(212, 154, 84, .1);
  color: var(--surface-strong);
  text-align: left;
}
.work-entry span {
  font-size: 16px;
  font-weight: 780;
}
.work-entry small {
  color: rgba(255, 235, 205, .62);
  font-size: 12px;
}
.work-entry:hover {
  border-color: rgba(212, 154, 84, .42);
  background: rgba(212, 154, 84, .18);
}

.timeline {
  display: grid;
  gap: 8px;
}
.timeline-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .6);
}
.timeline-card img {
  width: 78px;
  max-height: 45px;
  object-fit: contain;
  object-position: left center;
}
.timeline-meta,
.timeline-role,
.timeline-detail {
  color: var(--muted);
  font-size: 12px;
}
.timeline-card h2 {
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.28;
}
.timeline-role {
  margin-top: 2px;
  color: var(--ink);
  font-weight: 720;
}
.timeline-detail {
  margin-top: 7px;
  line-height: 1.58;
}
.partner-chip {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(212, 154, 84, .3);
  border-radius: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 720;
}

.education-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.education-panel h2 {
  font-size: 14px;
}
.education-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.school-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
}
.education-item b { font-size: 13px; }
.education-item p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.interest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.interest-row span,
.detail-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .52);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.chat-shell { display: grid; gap: 12px; }
.chat-log {
  display: grid;
  gap: 8px;
  max-height: min(320px, calc(100svh - 340px));
  overflow: auto;
  padding-right: 4px;
}
.chat-log p {
  width: fit-content;
  max-width: 90%;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.55;
}
.chat-yudan {
  background: var(--accent-soft);
  color: var(--ink);
}
.chat-yudan.chat-pending {
  color: var(--muted);
  font-style: italic;
}
.chat-yudan.chat-error {
  border: 1px solid rgba(214, 115, 84, .38);
  background: rgba(214, 115, 84, .14);
}
.chat-visitor {
  justify-self: end;
  background: #161616;
  color: #fff;
}
.chat-row button:disabled,
.chat-row input:disabled {
  cursor: wait;
  opacity: .64;
}
.chat-form {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.chat-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.chat-row {
  display: flex;
  gap: 7px;
}
.chat-row input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  padding: 0 11px;
  font-size: 13px;
}
.chat-row input::placeholder { color: rgba(22, 22, 22, .42); }
.chat-row button {
  min-width: 66px;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 760;
}

.contact-card {
  display: grid;
  gap: 9px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.contact-plane {
  width: 58px;
  color: var(--accent);
}
.contact-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .6);
  color: var(--ink);
  text-align: left;
}
.contact-line span {
  color: var(--muted);
  font-size: 12px;
}
.contact-line b {
  overflow-wrap: anywhere;
  font-size: 15px;
}
.contact-line:hover {
  border-color: rgba(212, 154, 84, .42);
  background: var(--accent-soft);
}
.contact-location {
  color: var(--muted);
  font-size: 13px;
}

.back-button {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 16;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(238, 202, 146, .32);
  border-radius: 50%;
  background: rgba(25, 18, 13, .46);
  color: rgba(255, 244, 227, .86);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
  font-size: 13px;
  font-weight: 760;
  backdrop-filter: blur(14px);
}
.back-button svg {
  width: 20px;
  height: 20px;
}
.back-button:hover {
  border-color: var(--warm);
  background: rgba(36, 24, 16, .68);
  color: var(--surface-strong);
}
.back-button[hidden] { display: none; }

.detail-dialog {
  width: min(1080px, calc(100vw - 38px));
  max-height: calc(100svh - 38px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}
.detail-dialog::backdrop {
  background: rgba(8, 6, 4, .72);
  backdrop-filter: blur(6px) saturate(.7);
}
.detail-frame {
  position: relative;
  padding: 26px;
  border: 1px solid rgba(238, 202, 146, .3);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(35, 26, 19, .96), rgba(22, 15, 11, .94));
  box-shadow: 0 34px 90px rgba(0, 0, 0, .34);
  color: var(--surface-strong);
  backdrop-filter: blur(18px);
  max-height: calc(100svh - 38px);
  overflow: auto;
}
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 235, 205, .34);
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 244, 227, .82);
  font-size: 12px;
}
.dialog-close:hover { background: rgba(22, 22, 22, .06); }
.detail-content .detail-kicker { color: var(--warm); }
.detail-content h2 { color: var(--surface-strong); }
.detail-content .detail-summary { color: rgba(255, 235, 205, .72); }
.detail-content .detail-list li { color: rgba(255, 244, 227, .88); }
.detail-content .detail-list li::before { background: var(--accent); }
.detail-content .detail-tags span {
  border-color: rgba(255, 235, 205, .24);
  background: rgba(212, 154, 84, .1);
  color: rgba(255, 235, 205, .86);
}
.detail-status {
  margin-top: 10px;
  color: rgba(255, 235, 205, .58);
  font-size: 12px;
  line-height: 1.6;
}
.detail-content h2 {
  max-width: 720px;
  margin-top: 7px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
}
.detail-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  margin-top: 22px;
}
.detail-visual {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 22px;
  border: 1px solid rgba(238, 202, 146, .22);
  border-radius: 6px;
  background: rgba(16, 12, 9, .42);
}
.detail-visual img {
  max-width: 190px;
  max-height: 150px;
  object-fit: contain;
}
.detail-summary {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}
.detail-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.detail-list li {
  position: relative;
  padding-left: 16px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
.detail-list li::before {
  position: absolute;
  top: .72em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.detail-gallery figure {
  overflow: hidden;
  border: 1px solid rgba(238, 202, 146, .22);
  border-radius: 5px;
  background: rgba(16, 12, 9, .42);
}
.detail-gallery img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 320;
  max-width: min(360px, calc(100vw - 44px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 235, 205, .34);
  border-radius: 3px;
  background: rgba(30, 23, 18, .92);
  color: var(--surface-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.noscript-note {
  margin: 0;
  padding: 12px 18px;
  background: var(--surface);
  color: var(--ink);
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }
  .scene-nav {
    justify-self: stretch;
    overflow-x: auto;
  }
  .scene-nav button { flex: 1 0 auto; }
  .scene-sheet {
    right: 16px;
    width: min(390px, calc(100vw - 32px));
  }
}

@media (max-width: 720px) {
  body { background: var(--surface); color: var(--ink); }
  .stage {
    min-height: 100svh;
    overflow: visible;
    padding-top: min(65svh, 590px);
    background: var(--surface);
  }
  .scene-media {
    height: min(65svh, 590px);
    bottom: auto;
  }
  .scene-media img,
  .scene-media video { object-position: 54% 50%; }
  html[data-scene="door"] .scene-media img,
  html[data-scene="door"] .scene-media video { object-position: 68% 50%; }
  .door-transition video { object-position: 68% 50%; }
  html[data-scene="studio"] .scene-media img,
  html[data-scene="studio"] .scene-media video { object-position: 42% 50%; }
  html[data-scene="works"] .scene-media img { object-position: 52% 50%; }
  html[data-scene="journey"] .scene-media img { object-position: 32% 48%; }
  html[data-scene="dialogue"] .scene-media img { object-position: 66% 50%; }
  html[data-scene="contact"] .scene-media img { object-position: 49% 50%; }
  .scene-vignette {
    background:
      linear-gradient(0deg, rgba(0, 0, 0, .42), rgba(0, 0, 0, .02) 50%),
      linear-gradient(90deg, rgba(0, 0, 0, .2), transparent);
  }
  .scene-grid { display: none; }
  .door-title {
    top: calc(min(65svh, 590px) - 184px);
    bottom: auto;
    left: 16px;
    width: calc(100vw - 32px);
  }
  .door-title strong { font-size: clamp(42px, 15vw, 70px); }
  .hotspot-layer {
    height: min(65svh, 590px);
    bottom: auto;
  }
  .hotspot-label {
    max-width: none;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.2;
  }
  .scene-embedded {
    height: min(65svh, 590px);
    bottom: auto;
  }
  .journey-card,
  .journey-education,
  .journey-hobby {
    transform: scale(.72);
    transform-origin: top left;
  }
  .contact-inscription {
    top: 16%;
    left: 8%;
    right: auto;
    width: 68vw;
    gap: 5px;
  }
  .contact-inscription span { font-size: 9px; }
  .contact-inscription-line {
    padding-bottom: 7px;
    font-size: 16px;
  }
  .scene-sheet,
  html[data-scene="door"] .scene-sheet,
  html[data-scene="dialogue"] .scene-sheet,
  html[data-scene="journey"] .scene-sheet {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: auto;
    max-height: none;
    margin: 14px 14px 22px;
    box-shadow: none;
  }
  .back-button {
    position: fixed;
    left: 14px;
    top: calc(min(65svh, 590px) + 12px);
    bottom: auto;
  }
  .feature-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .timeline-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .timeline-card img { width: 64px; }
  .chat-row { flex-wrap: wrap; }
  .chat-row button { width: 100%; }
  .detail-frame { padding: 20px; }
  .dialog-close {
    position: static;
    margin-left: auto;
    margin-bottom: 14px;
    display: block;
  }
  .detail-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.site-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.scene-nav {
  justify-self: end;
}

.brand-logo {
  width: 32px;
  height: 32px;
}

.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px 0 12px;
  border: 1px solid rgba(255, 235, 205, .22);
  border-radius: 999px;
  background: rgba(19, 14, 10, .62);
  color: rgba(255, 244, 227, .88);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .03em;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(12px);
}

.music-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--warm);
}

.music-toggle.is-on {
  border-color: rgba(240, 193, 122, .36);
  background: rgba(34, 24, 16, .78);
}

.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 380;
  display: grid;
  place-items: center;
  gap: 14px;
  background:
    radial-gradient(circle at center, rgba(35, 24, 16, .86), rgba(15, 11, 8, .98));
  color: var(--surface-strong);
  transition: opacity 280ms var(--ease), visibility 280ms var(--ease);
}

.loader-overlay img {
  width: min(160px, 42vw);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35));
}

.loader-overlay p {
  color: rgba(255, 244, 227, .92);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .18em;
  text-align: center;
}

html.is-ready .loader-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.door-title {
  width: min(390px, calc(100vw - 48px));
  color: var(--surface-strong);
}

.door-title::before {
  width: 48px;
  margin-bottom: 10px;
  opacity: .86;
}

.door-title strong {
  font-family: Baskerville, "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(38px, 4.4vw, 64px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: .92;
}

.door-title span {
  margin-top: 16px;
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 500;
  letter-spacing: 0;
}

.door-title em {
  margin-top: 7px;
  color: rgba(255, 244, 227, .78);
  font-size: clamp(12px, 1vw, 14px);
  font-style: normal;
  letter-spacing: 0;
}

.hotspot {
  gap: 2px;
}

.hotspot-dot {
  width: 46px;
  height: 46px;
  border-width: 3px;
  box-shadow: 0 0 0 7px rgba(228, 181, 113, .16), 0 14px 30px rgba(0, 0, 0, .42), inset 0 0 0 4px rgba(212, 154, 84, .16);
}

.hotspot-dot::before {
  inset: 14px;
}

.hotspot-label {
  font-size: 14px;
}

.hotspot-right .hotspot-label { left: calc(100% + 2px); }
.hotspot-left .hotspot-label { right: calc(100% + 2px); }

.back-button {
  top: auto;
  bottom: 22px;
  left: 22px;
  width: auto;
  height: auto;
  min-height: 44px;
  padding: 0 15px 0 13px;
  border-radius: 999px;
  gap: 8px;
  border-color: rgba(245, 205, 144, .48);
  background: rgba(20, 15, 11, .82);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 244, 227, .1);
}

.back-label {
  font-size: 13px;
  font-weight: 760;
  letter-spacing: .03em;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px 18px;
  }

  .scene-nav {
    justify-self: end;
    gap: 12px;
  }

  .music-toggle {
    justify-self: end;
  }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 12px 14px 0;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .scene-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    gap: 16px;
    overflow-x: auto;
    padding: 6px 0 9px;
    scrollbar-width: none;
  }

  .scene-nav::-webkit-scrollbar { display: none; }

  .scene-nav button { flex: 0 0 auto; }

  .music-toggle {
    grid-column: 3;
    grid-row: 1;
    width: 36px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
  }

  .music-toggle span { display: none; }

  .stage {
    padding-top: 0;
    overflow: hidden;
    background: #120f0c;
  }

  .scene-media {
    height: 100svh;
    bottom: auto;
  }

  .hotspot-layer {
    height: 100svh;
    bottom: auto;
  }

  .door-title {
    left: 16px;
    bottom: 16px;
    top: auto;
    width: calc(100vw - 32px);
  }

  .back-button {
    position: fixed;
    top: 94px;
    left: 14px;
    bottom: auto;
    min-height: 42px;
    padding: 0 13px 0 11px;
  }

  .scene-sheet,
  html[data-scene="door"] .scene-sheet,
  html[data-scene="dialogue"] .scene-sheet,
  html[data-scene="journey"] .scene-sheet {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    top: auto;
    width: auto;
    max-height: min(48svh, 360px);
    margin: 0;
  }

  html[data-scene="dialogue"] .scene-sheet {
    right: auto;
    width: min(320px, calc(100vw - 28px));
    max-height: 250px;
    padding: 14px;
  }

  html[data-scene="dialogue"] .sheet-body { margin-top: 0; }
  html[data-scene="dialogue"] .chat-log { max-height: 72px; }
  html[data-scene="dialogue"] .chat-form label { margin-bottom: 5px; }

  .detail-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
  }

  .detail-frame {
    max-height: calc(100svh - 20px);
  }
}

*, *::before, *::after { letter-spacing: 0 !important; }

/* v17: image-gated circular loading and delayed scene hotspots */
.loader-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  gap: 20px;
  background: #15100c;
}

.loader-overlay::before,
.loader-overlay::after {
  position: absolute;
  right: 8vw;
  left: 8vw;
  height: 1px;
  background: rgba(228, 181, 113, .14);
  content: "";
}

.loader-overlay::before { top: 9vh; }
.loader-overlay::after { bottom: 9vh; }

.loader-progress {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
}

.loader-progress img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .28));
}

.loader-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}

.loader-ring-track,
.loader-ring-value {
  fill: none;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.loader-ring-track { stroke: rgba(240, 193, 122, .16); }

.loader-ring-value {
  stroke: rgba(240, 193, 122, .88);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 900ms cubic-bezier(.22, .7, .2, 1);
}

html.is-loading .loader-ring-value { stroke-dashoffset: 18; }

html.is-complete .loader-ring-value {
  stroke-dashoffset: 0;
  transition-duration: 320ms;
}

.loader-overlay p {
  display: grid;
  gap: 4px;
  color: rgba(255, 244, 227, .72);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.loader-overlay p span { font-weight: 500; }
.loader-overlay p strong {
  color: rgba(255, 244, 227, .94);
  font-family: Baskerville, "Iowan Old Style", "Times New Roman", serif;
  font-size: 16px;
  font-weight: 400;
}

.loader-retry {
  min-width: 88px;
  min-height: 40px;
  border: 1px solid rgba(240, 193, 122, .52);
  background: transparent;
  color: rgba(255, 244, 227, .94);
  cursor: pointer;
  font: inherit;
}

.loader-retry[hidden] { display: none; }
.loader-retry:focus-visible { outline: 2px solid #f0c17a; outline-offset: 3px; }
.loader-retry:disabled { cursor: wait; opacity: .56; }
.loader-overlay.is-error .loader-ring-value { stroke: rgba(240, 193, 122, .38); }

.hotspot,
.hotspot-right,
.hotspot-left {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 8px));
  transition:
    opacity 320ms var(--ease),
    transform 320ms var(--ease);
  transition-delay: 0ms;
}

html.hotspots-ready .hotspot,
html.hotspots-ready .hotspot-right,
html.hotspots-ready .hotspot-left {
  opacity: 1;
  transform: translate(-50%, -50%);
  transition-delay: calc(var(--hotspot-index, 0) * 55ms);
}

html.hotspots-interactive .hotspot { pointer-events: auto; }

.music-toggle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 235, 205, .28);
  border-radius: 50%;
  background: rgba(20, 14, 10, .7);
  color: rgba(255, 244, 227, .82);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.music-toggle:hover {
  border-color: rgba(240, 193, 122, .62);
  color: var(--surface-strong);
  transform: translateY(-1px);
}

.music-toggle:active { transform: translateY(0) scale(.96); }
.music-toggle svg { width: 15px; height: 15px; }
.music-toggle .music-wave { display: none; }
.music-toggle .music-muted { display: block; }
.music-toggle.is-on {
  border-color: rgba(240, 193, 122, .5);
  background: rgba(38, 25, 15, .84);
  color: var(--warm);
}
.music-toggle.is-on .music-wave { display: block; }
.music-toggle.is-on .music-muted { display: none; }
.music-toggle.is-blocked { animation: music-awaiting 1.8s ease-in-out infinite; }
.music-toggle.is-error { opacity: .48; }

@keyframes music-awaiting {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 193, 122, 0); }
  50% { box-shadow: 0 0 0 5px rgba(240, 193, 122, .13); }
}

.back-button {
  min-height: 48px;
  padding: 0 17px 0 12px;
  border: 1px solid rgba(255, 224, 178, .7);
  border-radius: 6px;
  background: rgba(23, 16, 11, .92);
  color: #fff2dd;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 244, 227, .14);
}

.back-button svg {
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(240, 193, 122, .15);
  color: var(--warm);
}

.back-button:hover {
  border-color: rgba(255, 231, 194, .95);
  background: rgba(38, 25, 16, .96);
  transform: translateY(-2px);
}

.back-label { font-size: 13px; font-weight: 760; }

@media (max-width: 720px) {
  .music-toggle {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
  }

  html[data-scene="door"] .hotspot {
    left: 55% !important;
  }

  .back-button {
    min-height: 44px;
    padding: 0 13px 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-ring-value {
    transition-duration: .01ms !important;
  }

  .hotspot,
  .hotspot-right,
  .hotspot-left,
  html.hotspots-ready .hotspot,
  html.hotspots-ready .hotspot-right,
  html.hotspots-ready .hotspot-left {
    transform: translate(-50%, -50%);
    transition-delay: 0ms !important;
  }

  .music-toggle.is-blocked { animation: none !important; }
}

/* v20.4: compact dialogue dock */
html[data-scene="dialogue"] .scene-sheet.is-dialogue {
  top: auto;
  right: auto;
  bottom: clamp(72px, 9vh, 104px);
  left: clamp(22px, 3vw, 42px);
  width: min(420px, calc(100vw - 60px));
  max-height: min(560px, calc(100svh - 150px));
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(225, 174, 108, .22);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(28, 20, 15, .86), rgba(17, 12, 10, .78));
  box-shadow: 0 22px 64px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 237, 211, .06);
  color: var(--surface-strong);
  backdrop-filter: blur(18px) saturate(.88);
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue > .scene-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .sheet-body { margin-top: 0; }

html[data-scene="dialogue"] .chat-shell {
  display: grid;
  gap: 12px;
  min-height: 0;
}

html[data-scene="dialogue"] .chat-log {
  display: grid;
  gap: 8px;
  max-height: min(330px, calc(100svh - 330px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 8px 2px 0;
  color-scheme: dark;
  overscroll-behavior: contain;
  scrollbar-color: rgba(196, 137, 78, .34) transparent;
  scrollbar-width: thin;
}

html[data-scene="dialogue"] .chat-log::-webkit-scrollbar { width: 5px; }
html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-track { background: transparent; }
html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 99px;
  background: rgba(196, 137, 78, .3);
  background-clip: padding-box;
}
html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(221, 164, 98, .52);
  background-clip: padding-box;
}

html[data-scene="dialogue"] .chat-log p {
  width: fit-content;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.58;
}

html[data-scene="dialogue"] .chat-log .chat-yudan:first-child { max-width: 100%; }

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-yudan {
  border: 1px solid rgba(212, 154, 84, .18);
  background: rgba(120, 76, 42, .18);
  color: rgba(255, 241, 221, .9);
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-visitor {
  border: 1px solid rgba(255, 235, 205, .07);
  background: rgba(7, 6, 5, .48);
  color: rgba(255, 244, 227, .94);
}

html[data-scene="dialogue"] .chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

html[data-scene="dialogue"] .chat-suggestions[hidden] { display: none; }

html[data-scene="dialogue"] .chat-suggestion {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(223, 178, 117, .24);
  border-radius: 999px;
  background: rgba(74, 49, 31, .24);
  color: rgba(255, 236, 208, .74);
  font-size: 12px;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

html[data-scene="dialogue"] .chat-suggestion:hover {
  border-color: rgba(240, 193, 122, .48);
  background: rgba(108, 69, 40, .34);
  color: rgba(255, 244, 227, .94);
  transform: translateY(-1px);
}

html[data-scene="dialogue"] .chat-suggestion:disabled {
  cursor: wait;
  opacity: .52;
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-form {
  padding-top: 11px;
  border-top: 1px solid rgba(255, 235, 205, .13);
}

html[data-scene="dialogue"] .chat-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 235, 205, .2);
  border-radius: 7px;
  background: rgba(10, 8, 7, .38);
  color: rgba(255, 244, 227, .94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row input::placeholder {
  color: rgba(255, 235, 205, .38);
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row input:focus {
  border-color: rgba(240, 193, 122, .5);
  background: rgba(10, 8, 7, .52);
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(240, 193, 122, .48);
  border-radius: 7px;
  background: rgba(132, 82, 42, .58);
  color: #ffe5bd;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row button:hover {
  border-color: rgba(255, 220, 166, .76);
  background: rgba(169, 103, 49, .76);
  transform: translateY(-1px);
}

html[data-scene="dialogue"] .chat-row button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 720px) {
  html[data-scene="dialogue"] .chat-row { flex-wrap: nowrap; }
  html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row button { width: 44px; }
}

@media (max-width: 540px) {
  html[data-scene="dialogue"] .scene-sheet.is-dialogue {
    position: fixed;
    top: auto;
    right: auto;
    bottom: 14px;
    left: 14px;
    width: min(320px, calc(100vw - 28px));
    max-height: min(46svh, 390px);
    margin: 0;
    padding: 14px;
  }

  html[data-scene="dialogue"] .chat-log {
    max-height: min(190px, 25svh);
  }

  html[data-scene="dialogue"] .chat-suggestion {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }
}

/* v20.6: soft dialogue rail */
html[data-scene="dialogue"] .scene-sheet.is-dialogue {
  position: absolute;
  inset: 0;
  width: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--surface-strong);
  pointer-events: none;
  backdrop-filter: none;
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .sheet-body,
html[data-scene="dialogue"] .chat-shell {
  position: absolute;
  inset: 0;
  min-height: 0;
  margin: 0;
}

html[data-scene="dialogue"] .chat-shell {
  --composer-width: min(600px, 48vw);
  display: block;
}

html[data-scene="dialogue"] .chat-shell::before {
  position: absolute;
  top: 15%;
  bottom: 15%;
  left: 0;
  width: min(48vw, 680px);
  background: radial-gradient(ellipse at 12% 50%, rgba(9, 7, 6, .58) 0%, rgba(12, 9, 7, .34) 42%, rgba(12, 9, 7, 0) 76%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

html[data-scene="dialogue"] .chat-shell.is-active::before { opacity: 1; }

html[data-scene="dialogue"] .chat-intro,
html[data-scene="dialogue"] .chat-suggestions,
html[data-scene="dialogue"] .chat-form {
  position: absolute;
  left: 42%;
  width: var(--composer-width);
  transform: translateX(-50%);
}

html[data-scene="dialogue"] .chat-intro {
  bottom: clamp(158px, 19vh, 190px);
  display: grid;
  gap: 5px;
  color: rgba(255, 244, 228, .92);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .82);
}

html[data-scene="dialogue"] .chat-intro[hidden] { display: none; }

html[data-scene="dialogue"] .chat-intro strong {
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: clamp(20px, 1.8vw, 27px);
  font-weight: 520;
  line-height: 1.3;
}

html[data-scene="dialogue"] .chat-intro span {
  color: rgba(255, 235, 207, .68);
  font-size: 13px;
  line-height: 1.6;
}

html[data-scene="dialogue"] .chat-log {
  position: absolute;
  top: clamp(142px, 22vh, 210px);
  bottom: auto;
  left: clamp(36px, 5vw, 76px);
  display: grid;
  gap: 0;
  width: min(38vw, 540px);
  max-height: 48svh;
  padding: 20px 26px 20px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  color-scheme: dark;
  pointer-events: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(211, 156, 91, .34) transparent;
  scrollbar-width: thin;
  mask-image: linear-gradient(180deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

html[data-scene="dialogue"] .chat-log[hidden] { display: none !important; }
html[data-scene="dialogue"] .chat-log::-webkit-scrollbar { width: 4px; }
html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-track { background: transparent; }
html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-thumb {
  border: 0;
  border-radius: 99px;
  background: rgba(211, 156, 91, .3);
}

html[data-scene="dialogue"] .chat-message {
  position: relative;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 241, 220, .9);
  animation: dialogue-message-in 220ms var(--ease) both;
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-message.chat-yudan,
html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-message.chat-visitor {
  border: 0;
  background: transparent;
  color: inherit;
}

html[data-scene="dialogue"] .chat-message::before {
  position: absolute;
  top: 13px;
  bottom: -2px;
  left: 5px;
  width: 1px;
  background: linear-gradient(180deg, rgba(229, 177, 108, .48), rgba(229, 177, 108, .13));
  content: "";
}

html[data-scene="dialogue"] .chat-message:last-child::before { bottom: 8px; }

html[data-scene="dialogue"] .chat-message-marker {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border: 1px solid rgba(246, 204, 143, .74);
  border-radius: 50%;
  background: rgba(44, 28, 17, .94);
  box-shadow: 0 0 0 4px rgba(219, 154, 81, .08);
}

html[data-scene="dialogue"] .chat-visitor .chat-message-marker {
  border-color: rgba(151, 183, 196, .72);
  background: rgba(25, 37, 42, .94);
  box-shadow: 0 0 0 4px rgba(123, 168, 189, .08);
}

html[data-scene="dialogue"] .chat-message-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

html[data-scene="dialogue"] .chat-visitor .chat-message-body { padding-left: 18px; }

html[data-scene="dialogue"] .chat-message-role {
  color: rgba(235, 184, 115, .78);
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: .1em;
}

html[data-scene="dialogue"] .chat-visitor .chat-message-role { color: rgba(157, 192, 206, .8); }

html[data-scene="dialogue"] .chat-log .chat-message-copy {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 241, 221, .88);
  font-size: 13px;
  line-height: 1.68;
  text-wrap: pretty;
}

html[data-scene="dialogue"] .chat-visitor .chat-message-copy { color: rgba(231, 239, 240, .88); }
html[data-scene="dialogue"] .chat-pending .chat-message-copy { animation: dialogue-thinking 1.4s ease-in-out infinite; }
html[data-scene="dialogue"] .chat-error .chat-message-marker { border-color: rgba(222, 133, 100, .82); }
html[data-scene="dialogue"] .chat-error .chat-message-copy { color: rgba(255, 198, 176, .9); }

@keyframes dialogue-thinking {
  0%, 100% { opacity: .48; }
  50% { opacity: 1; }
}

@keyframes dialogue-message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

html[data-scene="dialogue"] .chat-retry,
html[data-scene="dialogue"] .chat-latest {
  min-height: 30px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(231, 180, 112, .42);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 223, 176, .86);
  font-size: 12px;
}

html[data-scene="dialogue"] .chat-retry {
  justify-self: start;
  min-width: 42px;
}

html[data-scene="dialogue"] .chat-latest {
  position: absolute;
  bottom: clamp(164px, 20vh, 196px);
  left: clamp(60px, 7vw, 104px);
  z-index: 2;
  min-width: 68px;
  pointer-events: auto;
}

html[data-scene="dialogue"] .chat-latest[hidden] { display: none; }

html[data-scene="dialogue"] .chat-suggestions {
  bottom: clamp(102px, 12vh, 120px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  pointer-events: auto;
}

html[data-scene="dialogue"] .chat-suggestion {
  min-height: 32px;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(232, 187, 126, .3);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 235, 207, .68);
  font-size: 12px;
}

html[data-scene="dialogue"] .chat-suggestion:hover {
  border-color: rgba(246, 205, 145, .72);
  background: transparent;
  color: rgba(255, 244, 228, .96);
  transform: translateY(-1px);
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-form {
  bottom: clamp(36px, 5vh, 48px);
  z-index: 3;
  padding: 0;
  border: 0;
  pointer-events: auto;
}

html[data-scene="dialogue"] .chat-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-height: 54px;
  padding: 5px;
  border: 1px solid rgba(239, 195, 132, .26);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(29, 21, 16, .78), rgba(15, 12, 10, .72));
  box-shadow: 0 18px 52px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 244, 227, .05);
  backdrop-filter: blur(15px) saturate(.9);
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row input {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 244, 227, .94);
  box-shadow: none;
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row input:focus {
  background: rgba(255, 235, 205, .035);
  box-shadow: inset 0 0 0 1px rgba(240, 193, 122, .2);
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row button {
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid rgba(240, 193, 122, .44);
  border-radius: 5px;
  background: rgba(115, 72, 39, .68);
  color: #ffe4b9;
}

html[data-scene="dialogue"] .back-button {
  top: auto;
  right: auto;
  bottom: clamp(18px, 3vh, 30px);
  left: clamp(18px, 2.5vw, 34px);
}

@media (min-width: 721px) and (max-width: 980px) {
  html[data-scene="dialogue"] .chat-intro { bottom: 204px; }
  html[data-scene="dialogue"] .chat-suggestions { bottom: 146px; }
  html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-form { bottom: 82px; }
}

@media (max-width: 720px) {
  html[data-scene="dialogue"] .chat-shell { --composer-width: calc(100vw - 28px); }

  html[data-scene="dialogue"] .chat-shell::before {
    top: 38svh;
    right: 0;
    bottom: 0;
    width: auto;
    background: linear-gradient(180deg, rgba(16, 12, 9, 0), rgba(16, 12, 9, .58) 24%, rgba(14, 10, 8, .9) 100%);
    opacity: 1;
  }

  html[data-scene="dialogue"] .chat-intro,
  html[data-scene="dialogue"] .chat-suggestions,
  html[data-scene="dialogue"] .chat-form {
    left: 14px;
    transform: none;
  }

  html[data-scene="dialogue"] .chat-intro {
    bottom: 216px;
    gap: 4px;
  }

  html[data-scene="dialogue"] .chat-intro strong { font-size: 19px; }
  html[data-scene="dialogue"] .chat-intro span { max-width: 330px; font-size: 12px; }

  html[data-scene="dialogue"] .chat-suggestions {
    bottom: 146px;
    gap: 5px 14px;
  }

  html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-form { bottom: 78px; }

  html[data-scene="dialogue"] .chat-log {
    top: 43svh;
    right: 14px;
    bottom: 148px;
    left: 14px;
    width: auto;
    max-height: none;
    padding: 18px 10px 12px 0;
  }

  html[data-scene="dialogue"] .chat-message { padding-bottom: 16px; }
  html[data-scene="dialogue"] .chat-visitor .chat-message-body { padding-left: 8px; }
  html[data-scene="dialogue"] .chat-log .chat-message-copy { font-size: 12.5px; line-height: 1.6; }

  html[data-scene="dialogue"] .chat-latest {
    right: 18px;
    bottom: 150px;
    left: auto;
  }

  html[data-scene="dialogue"] .back-button {
    position: fixed;
    top: auto;
    right: auto;
    bottom: clamp(18px, 3vh, 30px);
    left: clamp(18px, 2.5vw, 34px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-scene="dialogue"] .chat-shell::before,
  html[data-scene="dialogue"] .chat-message,
  html[data-scene="dialogue"] .chat-pending .chat-message-copy {
    animation: none !important;
    transition: none !important;
  }
}

/* v20.7: readable dialogue copy and quiet scrollbar */
html[data-scene="dialogue"] .chat-intro {
  color: rgba(255, 249, 239, .99);
  text-shadow: 0 2px 3px rgba(0, 0, 0, .72), 0 8px 26px rgba(0, 0, 0, .68);
}

html[data-scene="dialogue"] .chat-intro span {
  color: rgba(255, 240, 218, .9);
  text-shadow: 0 2px 3px rgba(0, 0, 0, .66), 0 5px 18px rgba(0, 0, 0, .54);
}

html[data-scene="dialogue"] .chat-message-role {
  color: rgba(255, 207, 140, .94);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .68);
}

html[data-scene="dialogue"] .chat-visitor .chat-message-role {
  color: rgba(202, 229, 237, .94);
}

html[data-scene="dialogue"] .chat-log .chat-message-copy {
  color: rgba(255, 248, 237, .96);
  text-shadow: 0 2px 5px rgba(0, 0, 0, .68), 0 4px 18px rgba(0, 0, 0, .4);
}

html[data-scene="dialogue"] .chat-visitor .chat-message-copy {
  color: rgba(244, 250, 250, .96);
}

html[data-scene="dialogue"] .chat-suggestion {
  color: rgba(255, 240, 216, .9);
  text-shadow: 0 2px 5px rgba(0, 0, 0, .68);
}

html[data-scene="dialogue"] .chat-log {
  scrollbar-color: transparent transparent;
}

html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-thumb {
  background: transparent;
  transition: background-color 180ms ease;
}

html[data-scene="dialogue"] .chat-log.is-scrolling,
html[data-scene="dialogue"] .chat-log:hover {
  scrollbar-color: rgba(229, 177, 108, .62) transparent;
}

html[data-scene="dialogue"] .chat-log.is-scrolling::-webkit-scrollbar-thumb,
html[data-scene="dialogue"] .chat-log:hover::-webkit-scrollbar-thumb {
  background: rgba(229, 177, 108, .62);
}

@media (prefers-reduced-motion: reduce) {
  html[data-scene="dialogue"] .chat-log::-webkit-scrollbar-thumb {
    transition: none;
  }
}

/* v20.9: dialogue flow layout */
html[data-scene="dialogue"] .chat-shell {
  --chat-left: clamp(28px, 5vw, 76px);
  --chat-width: min(620px, 48vw);
  position: absolute;
  top: 14%;
  right: auto;
  bottom: clamp(86px, 12vh, 104px);
  left: var(--chat-left);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: clamp(10px, 1.4vh, 16px);
  width: var(--chat-width);
  height: auto;
  min-height: 0;
  margin: 0;
  pointer-events: none;
}

html[data-scene="dialogue"] .chat-shell::before {
  top: -12%;
  right: -18%;
  bottom: -12%;
  left: -18%;
  width: auto;
  background: radial-gradient(ellipse at 20% 48%, rgba(9, 7, 6, .62) 0%, rgba(12, 9, 7, .3) 54%, rgba(12, 9, 7, 0) 82%);
  opacity: 1;
}

html[data-scene="dialogue"] .chat-intro,
html[data-scene="dialogue"] .chat-log,
html[data-scene="dialogue"] .chat-suggestions,
html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-form {
  position: static;
  inset: auto;
  left: auto;
  bottom: auto;
  width: auto;
  transform: none;
}

html[data-scene="dialogue"] .chat-intro {
  grid-row: 1;
  align-self: end;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 2px;
}

html[data-scene="dialogue"] .chat-log {
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 8px 24px 8px 4px;
  mask-image: none;
}

html[data-scene="dialogue"] .chat-message,
html[data-scene="dialogue"] .chat-message-body,
html[data-scene="dialogue"] .chat-message-copy {
  min-width: 0;
}

html[data-scene="dialogue"] .chat-message-copy {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

html[data-scene="dialogue"] .chat-suggestions {
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  min-width: 0;
  gap: 6px 18px;
  max-height: 76px;
  overflow: auto;
  pointer-events: auto;
}

html[data-scene="dialogue"] .chat-suggestion {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 2px 0 4px;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}

html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-form {
  grid-row: 3;
  z-index: 3;
  min-width: 0;
  padding: 0;
  border: 0;
  pointer-events: auto;
}

html[data-scene="dialogue"] .chat-latest {
  top: 8px;
  right: 0;
  bottom: auto;
  left: auto;
}

.door-transition {
  transition: opacity 140ms ease, visibility 0s linear 140ms;
}

/* v20.9: temporary portrait guidance and rotated landscape canvas */
.orientation-notice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 410;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(245, 205, 144, .42);
  border-radius: 999px;
  background: rgba(25, 18, 13, .92);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .3);
  color: rgba(255, 240, 215, .94);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.orientation-notice[hidden] { display: none; }
.orientation-notice.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.orientation-notice-icon {
  color: var(--warm);
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 980px) {
  html[data-scene="dialogue"] .chat-shell {
    --chat-width: min(560px, 58vw);
    top: 12%;
    bottom: clamp(76px, 18vh, 96px);
  }
}

@media (max-width: 720px) {
  html[data-scene="dialogue"] .chat-shell {
    --chat-width: 58vw;
    top: 12%;
    bottom: 76px;
    gap: 8px;
  }

  html[data-scene="dialogue"] .chat-log .chat-message-copy {
    font-size: 12px;
    line-height: 1.55;
  }

  html[data-scene="dialogue"] .chat-suggestions {
    max-height: 62px;
    gap: 4px 12px;
  }

  html[data-scene="dialogue"] .chat-suggestion {
    min-height: 25px;
    font-size: 11px;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  html.is-portrait-mobile,
  html.is-portrait-mobile body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  html.is-portrait-mobile .studio-app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vh;
    height: 100vw;
    width: 100svh;
    height: 100svw;
    transform: translateX(100vw) rotate(90deg);
    transform-origin: top left;
  }

  html.is-portrait-mobile .stage,
  html.is-portrait-mobile .scene-media,
  html.is-portrait-mobile .hotspot-layer {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  html.is-portrait-mobile .stage {
    padding-top: 0;
    overflow: hidden;
  }

  html.is-portrait-mobile .scene-sheet.is-semantic-only:focus,
  html.is-portrait-mobile .scene-sheet.is-semantic-only:focus-within {
    right: 130px;
  }

  html.is-portrait-mobile .site-header {
    position: fixed;
    inset: 0 auto auto 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 12px;
    width: 100vh;
    width: 100svh;
    padding: 10px 14px 8px;
    transform: translateX(100vw) rotate(90deg);
    transform-origin: top left;
  }

  html.is-portrait-mobile .brand {
    grid-column: 1;
    grid-row: 1;
  }

  html.is-portrait-mobile .scene-nav {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    gap: 10px;
    overflow: visible;
    padding: 0;
  }

  html.is-portrait-mobile .scene-nav button {
    flex: 0 0 auto;
  }

  html.is-portrait-mobile .music-toggle {
    grid-column: 3;
    grid-row: 1;
  }

  html.is-portrait-mobile .door-transition {
    position: absolute;
  }

  html.is-portrait-mobile[data-scene="dialogue"] .chat-shell {
    --chat-width: 58%;
    top: 68px;
    bottom: 76px;
    left: 4%;
    width: var(--chat-width);
  }

  html.is-portrait-mobile[data-scene="dialogue"] .chat-log {
    left: auto;
    right: auto;
    width: auto;
    padding-right: 18px;
  }

  html.is-portrait-mobile[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row input {
    font-size: 12px;
  }

  html.is-portrait-mobile .back-button {
    position: absolute;
    top: auto;
    right: auto;
    bottom: 5%;
    left: 3%;
  }
}

/* v20.10: one landscape coordinate system for compact mobile screens */
@media (max-width: 980px) and (max-height: 520px) and (orientation: landscape) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 14px 8px;
  }

  .brand,
  .scene-nav,
  .music-toggle {
    grid-row: 1;
  }

  .brand { grid-column: 1; }

  .brand-logo { width: 28px; }

  .scene-nav {
    grid-column: 2;
    justify-self: end;
    gap: clamp(7px, 1.6vw, 12px);
    overflow: visible;
    padding: 0;
  }

  .scene-nav button {
    flex: 0 0 auto;
    font-size: 11px;
  }

  .music-toggle {
    grid-column: 3;
    width: 32px;
    min-height: 32px;
  }

  html[data-scene="dialogue"] .chat-shell {
    top: max(68px, calc(env(safe-area-inset-top) + 56px));
    bottom: 76px;
  }
}

/* v20.11: distinct conversation starters */
html[data-scene="dialogue"] .chat-suggestions {
  grid-row: 2;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: start;
  gap: 10px 14px;
  min-width: 0;
  max-height: none;
  padding: 11px 13px;
  overflow: visible;
  border: 1px solid rgba(235, 190, 127, .26);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(30, 22, 17, .82), rgba(16, 13, 11, .72));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 241, 219, .045);
  pointer-events: auto;
  backdrop-filter: blur(13px) saturate(.86);
}

html[data-scene="dialogue"] .chat-suggestions[hidden] { display: none; }

html[data-scene="dialogue"] .chat-suggestions-label {
  padding-top: 4px;
  color: rgba(239, 192, 128, .82);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .62);
}

html[data-scene="dialogue"] .chat-suggestion-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  min-width: 0;
  max-height: 82px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
}

html[data-scene="dialogue"] .chat-suggestion-list::-webkit-scrollbar { width: 3px; }
html[data-scene="dialogue"] .chat-suggestion-list::-webkit-scrollbar-track { background: transparent; }
html[data-scene="dialogue"] .chat-suggestion-list::-webkit-scrollbar-thumb { background: transparent; }
html[data-scene="dialogue"] .chat-suggestion-list:hover {
  scrollbar-color: rgba(229, 177, 108, .44) transparent;
}
html[data-scene="dialogue"] .chat-suggestion-list:hover::-webkit-scrollbar-thumb {
  background: rgba(229, 177, 108, .44);
}

html[data-scene="dialogue"] .chat-suggestion {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 31px;
  padding: 3px 14px 4px 0;
  border: 0;
  border-bottom: 1px solid rgba(231, 182, 116, .2);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 241, 220, .88);
  font-size: 11.5px;
  line-height: 1.4;
  text-align: left;
  text-shadow: 0 2px 7px rgba(0, 0, 0, .64);
  white-space: normal;
}

html[data-scene="dialogue"] .chat-suggestion::after {
  position: absolute;
  top: 50%;
  right: 1px;
  color: rgba(235, 190, 127, .42);
  content: "\2197";
  font-size: 11px;
  transform: translateY(-50%);
  transition: color 160ms ease, transform 160ms ease;
}

html[data-scene="dialogue"] .chat-suggestion:hover,
html[data-scene="dialogue"] .chat-suggestion:focus-visible {
  border-color: rgba(246, 205, 145, .58);
  background: transparent;
  color: rgba(255, 249, 238, .98);
  transform: none;
}

html[data-scene="dialogue"] .chat-suggestion:hover::after,
html[data-scene="dialogue"] .chat-suggestion:focus-visible::after {
  color: rgba(246, 205, 145, .9);
  transform: translate(2px, -50%);
}

html[data-scene="dialogue"] .chat-suggestion:disabled {
  cursor: wait;
  opacity: .42;
}

@media (max-width: 720px), (max-width: 980px) and (max-height: 520px) {
  html[data-scene="dialogue"] .chat-suggestions {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 7px 9px;
    padding: 8px 10px;
  }

  html[data-scene="dialogue"] .chat-suggestions-label {
    padding-top: 3px;
    font-size: 9px;
  }

  html[data-scene="dialogue"] .chat-suggestion-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 7px;
    max-height: 64px;
  }

  html[data-scene="dialogue"] .chat-suggestion {
    min-height: 26px;
    padding: 2px 11px 3px 0;
    font-size: 9.5px;
    line-height: 1.3;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  html[data-scene="dialogue"] .chat-shell {
    top: 54px;
    bottom: 68px;
    gap: 6px;
  }

  html[data-scene="dialogue"] .chat-row {
    min-height: 48px;
    padding: 4px;
  }

  html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row input,
  html[data-scene="dialogue"] .scene-sheet.is-dialogue .chat-row button {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-scene="dialogue"] .chat-suggestion::after { transition: none; }
}

/* v20.13: make the welcome note, thread, and topic rail read as separate layers */
html[data-scene="dialogue"] .chat-intro {
  position: relative;
  padding: 0 0 11px 14px;
  border-left: 2px solid rgba(239, 190, 121, .58);
}

html[data-scene="dialogue"] .chat-intro-kicker {
  color: rgba(236, 183, 111, .72);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0 !important;
  line-height: 1;
  text-transform: uppercase;
}

html[data-scene="dialogue"] .chat-intro strong {
  display: block;
  margin-top: 6px;
}

html[data-scene="dialogue"] .chat-suggestions {
  border-left: 2px solid rgba(239, 190, 121, .5);
  background: linear-gradient(135deg, rgba(31, 22, 16, .9), rgba(13, 11, 9, .8));
}

html[data-scene="dialogue"] .chat-suggestion {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  column-gap: 7px;
}

html[data-scene="dialogue"] .chat-suggestion-index {
  padding-top: 1px;
  color: rgba(235, 184, 115, .62);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0 !important;
}

html[data-scene="dialogue"] .chat-suggestion-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

html[data-scene="dialogue"] .chat-log {
  padding-left: 10px;
  border-left: 1px solid rgba(220, 166, 101, .22);
}

html[data-scene="dialogue"] .chat-message-body {
  padding: 7px 10px;
  border-radius: 4px;
  background: rgba(14, 10, 8, .24);
}

html[data-scene="dialogue"] .chat-visitor .chat-message-body {
  background: rgba(20, 31, 35, .3);
}

@media (max-width: 720px), (max-width: 980px) and (max-height: 520px) {
  html[data-scene="dialogue"] .chat-intro { padding-left: 10px; }
  html[data-scene="dialogue"] .chat-intro-kicker { font-size: 8px; }
  html[data-scene="dialogue"] .chat-suggestion {
    grid-template-columns: 17px minmax(0, 1fr);
    column-gap: 4px;
  }
  html[data-scene="dialogue"] .chat-suggestion-index { font-size: 8px; }
  html[data-scene="dialogue"] .chat-log { padding-left: 6px; }
  html[data-scene="dialogue"] .chat-message-body { padding: 5px 7px; }
}

/* v20.16: three quiet dialogue suggestions */
html[data-scene="dialogue"] .chat-suggestions {
  display: block;
  min-width: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}

html[data-scene="dialogue"] .chat-suggestion-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: none;
  overflow: visible;
}

html[data-scene="dialogue"] .chat-suggestion {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 11px;
  overflow: visible;
  border: 1px solid rgba(235, 190, 127, .25);
  border-radius: 4px;
  background: rgba(24, 17, 13, .68);
  color: rgba(255, 241, 220, .9);
  font-size: 11.5px;
  line-height: 1.35;
  text-align: left;
  text-shadow: 0 2px 7px rgba(0, 0, 0, .58);
  white-space: normal;
  backdrop-filter: blur(8px);
}

html[data-scene="dialogue"] .chat-suggestion::after {
  content: none;
}

html[data-scene="dialogue"] .chat-suggestion:hover,
html[data-scene="dialogue"] .chat-suggestion:focus-visible {
  border-color: rgba(246, 205, 145, .62);
  background: rgba(45, 31, 22, .78);
  color: rgba(255, 249, 238, .98);
}

html.is-door-transition-dark .scene-media .is-active {
  opacity: 1;
  transition: none;
}

@media (max-width: 720px), (max-width: 980px) and (max-height: 520px) {
  html[data-scene="dialogue"] .chat-suggestion-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  html[data-scene="dialogue"] .chat-suggestion {
    min-height: 38px;
    padding: 6px 8px;
    font-size: 9.5px;
    line-height: 1.3;
  }
}

/* v20.17: compact dialogue breathing room */
@media (max-width: 720px), (max-width: 980px) and (max-height: 520px) {
  html[data-scene="dialogue"] .chat-shell {
    bottom: 76px;
  }

  html[data-scene="dialogue"] .chat-suggestion {
    min-height: 40px;
    font-size: 10.5px;
  }
}

@media (max-width: 980px) and (max-height: 360px) {
  html[data-scene="dialogue"] .chat-intro-kicker,
  html[data-scene="dialogue"] .chat-intro > span:not(.chat-intro-kicker) {
    display: none;
  }

  html[data-scene="dialogue"] .chat-intro {
    padding-bottom: 4px;
  }

  html[data-scene="dialogue"] .chat-intro strong {
    margin-top: 0;
  }
}

/* Task 4: delayed navigation status keeps the stable scene visible. */
.scene-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 140;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: min(420px, calc(100vw - 32px));
  min-height: 52px;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgba(240, 193, 122, .4);
  border-radius: 6px;
  background: rgba(18, 13, 10, .9);
  box-shadow: 0 20px 58px rgba(0, 0, 0, .36);
  color: rgba(255, 244, 227, .92);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
}

.scene-loading[hidden] { display: none; }

.scene-loading-mark {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(240, 193, 122, .28);
  border-top-color: rgba(255, 224, 178, .96);
  border-radius: 50%;
  animation: scene-loading-spin 850ms linear infinite;
}

.scene-loading p {
  min-width: 0;
  color: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.scene-loading button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(240, 193, 122, .52);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 228, 188, .96);
  font-size: 12px;
}

.scene-loading button[hidden] { display: none; }
.scene-loading.is-error .scene-loading-mark {
  border-color: rgba(222, 133, 100, .76);
  animation: none;
}

@keyframes scene-loading-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px), (max-width: 980px) and (max-height: 520px) {
  .scene-loading {
    min-width: min(360px, calc(100% - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-loading,
  .scene-loading-mark {
    animation: none !important;
    transition: none !important;
  }

  .scene-loading-mark { transform: none !important; }
}
