:root {
  color-scheme: dark;
  --navy: #062c3a;
  --navy-2: #0a4b5e;
  --paper: #f6f2e7;
  --ink: #17343d;
  --muted: #61777d;
  --sea: #167b8b;
  --sea-dark: #0a596b;
  --sand: #d59135;
  --line: rgba(23,52,61,.15);
  --header-height: 74px;
  --panel-width: 400px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #041820; }
button { font: inherit; -webkit-tap-highlight-color: transparent; }

.photo3d-shell { display: grid; grid-template-columns: var(--panel-width) minmax(0,1fr); grid-template-rows: var(--header-height) minmax(0,1fr); width: 100%; height: 100dvh; background: #041820; }
.photo3d-header { z-index: 40; grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; min-width: 0; padding: 9px 18px; color: white; background: radial-gradient(circle at 24% -120%,rgba(123,216,219,.35),transparent 37%),linear-gradient(112deg,#062c3a,#0a4b5e 66%,#083947); border-bottom: 1px solid rgba(255,255,255,.1); box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.header-icon-button { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; padding: 0; color: white; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.19); border-radius: 12px; cursor: pointer; }
.header-icon-button:hover, .header-icon-button:focus-visible { background: rgba(255,255,255,.17); border-color: rgba(255,255,255,.4); }
.header-icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.photo3d-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: white; text-decoration: none; }
.photo3d-brand img { flex: 0 0 auto; filter: drop-shadow(0 5px 12px rgba(0,0,0,.22)); }
.photo3d-brand img.site-logo { object-fit: cover; background: #f5f0e7; border: 2px solid rgba(255,255,255,.74); border-radius: 7px; }
.photo3d-brand > span { display: grid; min-width: 0; line-height: 1.15; }
.photo3d-brand small { margin-bottom: 3px; color: #a7eaeb; font-size: .66rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.photo3d-brand strong { overflow: hidden; font-size: clamp(1rem,2vw,1.2rem); text-overflow: ellipsis; white-space: nowrap; }
.photo3d-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.photo3d-header .access-button, .header-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 7px 11px; color: white; font: inherit; font-size: .75rem; font-weight: 760; text-decoration: none; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 11px; cursor: pointer; }
.photo3d-header .access-button { background: rgba(213,145,53,.16); border-color: rgba(245,204,133,.38); }
.photo3d-header .access-button:hover, .photo3d-header .access-button:focus-visible, .header-link:hover, .header-link:focus-visible { background: rgba(255,255,255,.17); outline: 3px solid rgba(255,255,255,.12); }
.photo3d-header .access-button.is-unlocked { background: rgba(64,174,132,.18); border-color: rgba(146,235,198,.42); }

.photo3d-panel { z-index: 30; grid-column: 1; grid-row: 2; min-height: 0; padding: 25px 22px 28px; overflow: auto; color: var(--ink); background: radial-gradient(circle at 112% 0%,rgba(123,216,219,.18),transparent 31%),var(--paper); border-right: 1px solid rgba(255,255,255,.24); box-shadow: 13px 0 38px rgba(0,0,0,.16); transition: transform 220ms cubic-bezier(.2,.8,.2,1),opacity 180ms ease; }
.eyebrow { margin: 0 0 6px; color: var(--sea); font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.photo3d-intro h1 { margin: 0 0 8px; font-size: 1.42rem; line-height: 1.16; letter-spacing: -.025em; }
.photo3d-intro > p:last-child { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.48; }
.evidence-card { display: grid; gap: 7px; margin: 18px 0; padding: 14px 15px; color: #4f6469; font-size: .73rem; line-height: 1.45; background: #eceee5; border-left: 4px solid var(--sand); border-radius: 0 11px 11px 0; }
.evidence-card strong { color: var(--ink); font-size: .8rem; }
.evidence-card p { margin: 0; }
.selected-room { display: grid; gap: 4px; padding: 14px; color: white; background: linear-gradient(125deg,#083f50,#0b6473); border-radius: 12px; box-shadow: 0 9px 22px rgba(10,89,107,.2); }
.selected-room span { color: #b9e9e8; font-size: .65rem; }
.selected-room strong { font-size: .92rem; }
.selected-room small { color: #cde7e5; font-size: .68rem; line-height: 1.35; }
.control-section { padding: 17px 0; border-top: 1px solid var(--line); }
.control-section h2 { margin: 0 0 10px; font-size: .83rem; letter-spacing: .01em; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-heading span { color: var(--muted); font-size: .63rem; }
.perspective-list { display: flex; flex-wrap: wrap; gap: 7px; }
.perspective-button { min-height: 36px; padding: 7px 9px; color: #536d74; font-size: .7rem; font-weight: 760; background: rgba(255,255,255,.62); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.perspective-button:hover, .perspective-button:focus-visible { background: white; border-color: rgba(22,123,139,.38); outline: none; }
.perspective-button.is-active { color: white; background: linear-gradient(115deg,var(--sea-dark),var(--sea)); border-color: transparent; }
.movement-pad { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.movement-pad button { min-height: 38px; padding: 7px; color: #536d74; font-size: .71rem; font-weight: 760; background: rgba(255,255,255,.62); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.movement-pad button:first-child { grid-column: 2; }
.movement-pad button:nth-child(2) { grid-column: 1; }
.movement-pad button:nth-child(3) { grid-column: 2; }
.movement-pad button:nth-child(4) { grid-column: 3; }
.movement-pad button:nth-child(5) { grid-column: 2; }
.movement-pad button:hover, .movement-pad button:focus-visible { color: var(--sea-dark); background: white; border-color: rgba(22,123,139,.38); outline: none; }
.control-note { margin: 9px 0 0; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.room-section { padding-bottom: 0; }
.room-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.room-floor-heading { grid-column: 1 / -1; margin: 7px 0 0; color: var(--sea-dark); font-size: .64rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.room-button { display: grid; grid-template-columns: 27px minmax(0,1fr); align-items: center; gap: 7px; min-height: 48px; padding: 7px; color: var(--ink); text-align: left; background: rgba(255,255,255,.62); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.room-button:hover, .room-button:focus-visible { background: white; border-color: rgba(22,123,139,.38); outline: none; }
.room-button.is-active { color: white; background: linear-gradient(115deg,var(--sea-dark),var(--sea)); border-color: transparent; }
.room-button.is-private { color: #704719; background: rgba(213,145,53,.09); border-style: dashed; }
.room-button > span { display: grid; place-items: center; width: 27px; height: 27px; color: var(--sea-dark); font-size: .66rem; font-weight: 850; background: rgba(22,123,139,.1); border-radius: 8px; }
.room-button.is-active > span { color: white; background: rgba(255,255,255,.16); }
.room-button div { min-width: 0; }
.room-button strong, .room-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-button strong { font-size: .69rem; }
.room-button small { margin-top: 2px; color: var(--muted); font-size: .6rem; }
.room-button.is-active small { color: #ccebea; }

.photo3d-stage { position: relative; z-index: 1; grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(circle at 50% 24%,#155464 0,#0a3543 38%,#041820 78%); }
.photo3d-canvas { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.photo3d-canvas.is-dragging { cursor: grabbing; }
.photo3d-canvas canvas { display: block; width: 100%; height: 100%; }
.photo3d-legend { position: absolute; z-index: 4; top: 17px; right: 17px; display: flex; gap: 12px; padding: 8px 11px; color: rgba(255,255,255,.8); font-size: .65rem; background: rgba(4,29,38,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; backdrop-filter: blur(8px); pointer-events: none; }
.photo3d-legend span { display: inline-flex; align-items: center; gap: 6px; }
.photo3d-legend i { width: 11px; height: 11px; border: 1px solid rgba(255,255,255,.8); }
.photo3d-legend b { width: 10px; height: 10px; background: #d59135; border: 2px solid white; border-radius: 50%; }
.photo3d-position { position: absolute; z-index: 4; left: 17px; top: 17px; padding: 8px 11px; color: white; font-size: .68rem; font-weight: 720; background: rgba(4,29,38,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 9px; backdrop-filter: blur(8px); pointer-events: none; }
.photo3d-hint { position: absolute; z-index: 4; bottom: 22px; left: 50%; max-width: calc(100% - 28px); padding: 10px 15px; color: white; font-size: .72rem; font-weight: 720; text-align: center; background: rgba(4,29,38,.76); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; box-shadow: 0 8px 26px rgba(0,0,0,.22); backdrop-filter: blur(9px); transform: translateX(-50%); pointer-events: none; transition: opacity 240ms ease,transform 240ms ease; }
.photo3d-hint.is-hidden { opacity: 0; transform: translate(-50%,8px); }
.photo3d-loading, .photo3d-error { position: absolute; z-index: 12; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 24px; color: white; text-align: center; background: radial-gradient(circle at center,#165364,#061d26 72%); transition: opacity 220ms ease,visibility 220ms ease; }
.photo3d-loading.is-hidden { visibility: hidden; opacity: 0; }
.photo3d-loading span { width: 37px; height: 37px; background: #7bd8db; border: 2px solid white; box-shadow: 10px 10px 0 rgba(213,145,53,.52); animation: room-load 1.2s ease-in-out infinite alternate; }
.photo3d-error[hidden] { display: none; }
.photo3d-error span { color: #cde7e5; font-size: .78rem; }
@keyframes room-load { to { transform: rotate(45deg) scale(.82); } }
.photo3d-scrim { display: none; }

@media (min-width: 901px) {
  .photo3d-shell:not(.is-panel-open) { grid-template-columns: 0 minmax(0,1fr); }
  .photo3d-shell:not(.is-panel-open) .photo3d-panel { opacity: 0; transform: translateX(-100%); pointer-events: none; }
}

@media (max-width: 900px) {
  :root { --header-height: 68px; --panel-width: 390px; }
  .photo3d-shell { grid-template-columns: minmax(0,1fr); }
  .photo3d-header { padding: 8px 12px; }
  .photo3d-brand img { width: 45px; height: 45px; }
  .photo3d-panel { position: fixed; top: var(--header-height); bottom: 0; left: 0; width: min(var(--panel-width),calc(100% - 38px)); transform: translateX(-105%); }
  .photo3d-shell.is-panel-open .photo3d-panel { transform: translateX(0); }
  .photo3d-scrim { position: fixed; z-index: 20; inset: var(--header-height) 0 0; display: block; padding: 0; background: rgba(2,18,24,.58); border: 0; opacity: 1; transition: opacity 180ms ease; }
  .photo3d-shell:not(.is-panel-open) .photo3d-scrim { visibility: hidden; opacity: 0; pointer-events: none; }
  .photo3d-stage { grid-column: 1; }
}

@media (max-width: 700px) {
  .photo3d-brand small { font-size: .55rem; letter-spacing: .08em; }
  .photo3d-brand strong { font-size: .88rem; }
  .photo3d-header-actions { gap: 5px; }
  .photo3d-header .access-button, .header-link { width: 39px; min-height: 39px; padding: 0; }
  .photo3d-header .access-button span { font-size: 0; }
  .photo3d-header .access-button span::first-letter { font-size: .9rem; }
  .header-link span { font-size: .68rem; }
  .photo3d-header-actions .header-link:nth-of-type(2) { display: none; }
  .header-icon-button { width: 39px; height: 39px; }
  .photo3d-legend { top: 10px; right: 10px; }
  .photo3d-position { top: 10px; left: 10px; }
  .photo3d-hint { bottom: 16px; }
}

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