body.immersive-view #nav{position:fixed;top:auto;left:auto;right:auto;inset-inline-start:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));max-width:calc(100% - 24px);box-sizing:border-box;gap:6px;flex-wrap:nowrap;z-index:8;transition:opacity .25s}body.immersive-view #nav button{font-size:13px;min-height:44px;padding:8px 10px;white-space:nowrap}#immersive-sheet[hidden]{display:none!important}#immersive-sheet{position:fixed;z-index:12;inset-inline-end:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));width:min(380px,calc(100vw - 24px));max-height:calc(100dvh - 24px);box-sizing:border-box;background:#111c28f5;border:1px solid #ffffff30;border-radius:18px;box-shadow:0 12px 40px #0007;display:flex;flex-direction:column;overflow:hidden}#immersive-sheet header{display:flex;align-items:center;gap:10px;padding:12px;border-bottom:1px solid #ffffff20}#immersive-sheet header strong{flex:1;min-width:0}#immersive-sheet button,#immersive-sheet select{min-height:44px;border:1px solid #ffffff30;background:#233448;color:white;border-radius:9px;padding:9px;font:inherit;max-width:100%;box-sizing:border-box;white-space:normal}#immersive-sheet button:focus-visible,#immersive-sheet select:focus-visible{outline:3px solid #d8b46a;outline-offset:2px}#immersive-sheet .immersive-content{overflow:auto;overscroll-behavior:contain;padding:12px;min-height:0}#immersive-sheet section{display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid #ffffff18;padding-bottom:14px;margin-bottom:12px;min-width:0}#immersive-sheet h3{width:100%;font-size:14px;color:#d8b46a;margin:0 0 4px}#immersive-sheet label{display:grid;gap:6px;width:100%}#immersive-sheet [hidden]{display:none!important}#immersive-sheet #tour-language{position:static!important;max-width:100%;z-index:auto}#immersive-sheet #scene-menu,#immersive-sheet #floorpanel,#immersive-sheet #tour-comparison{inset:auto;max-height:40dvh;max-width:100%;overflow:auto;box-sizing:border-box}#immersive-sheet .immersive-share{width:100%;min-width:0;padding:10px;box-sizing:border-box;direction:ltr}body.immersive-idle #nav{opacity:0;pointer-events:none}body.immersive-view:has(#popup[style*="block"]) #nav,body.immersive-view:has(dialog[open]) #nav{opacity:0;pointer-events:none}body.immersive-no-points .hotspot:not(.video-surface){visibility:hidden!important;pointer-events:none!important}body.immersive-no-labels .hot-label{display:none}body.immersive-view .hot-label{max-width:160px;overflow-wrap:anywhere;white-space:normal;line-height:1.4}body.immersive-view #media{max-width:calc(100% - 24px);box-sizing:border-box;bottom:max(68px,calc(env(safe-area-inset-bottom) + 68px));flex-wrap:wrap}body.immersive-view #logo{pointer-events:none;max-width:25vw}body.immersive-view #tour-music-panel{inset-inline-end:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));max-height:calc(100dvh - 100px)}
@media(max-width:767px){#immersive-sheet{top:auto;bottom:0;left:0;right:0;width:100%;max-height:72dvh;border-radius:20px 20px 0 0;padding-bottom:env(safe-area-inset-bottom)}#immersive-sheet header{padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right))}body.immersive-view .hot-icon{width:clamp(30px,calc(var(--hot-size) * .8),46px);height:clamp(30px,calc(var(--hot-size) * .8),46px)}body.immersive-view .hot-label{max-width:96px;font-size:12px;padding:4px 6px}body.immersive-view #nav button{max-width:100px}body.immersive-view .collab-panel,body.immersive-view .voice-room-panel{max-width:calc(100vw - 16px);max-height:80dvh;box-sizing:border-box}body.immersive-view #floorpanel{display:none}body.immersive-view .voice-room-dock,body.immersive-view .collab-dock{max-width:calc(100vw - 24px);box-sizing:border-box}body.immersive-view #popup{max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)}}
@media(prefers-reduced-motion:reduce){body.immersive-view #nav{transition:none}}

body.immersive-view #popup{z-index:25}body.immersive-view #tour-music-panel{z-index:24}body.immersive-view #nav{flex-wrap:wrap}body.immersive-view #immersive-sheet #floorpanel{display:block}body.immersive-view.immersive-idle #media{opacity:0;pointer-events:none}body.immersive-view .hotspot.immersive-occluded{opacity:0;pointer-events:none}body.immersive-view #nav button:disabled{opacity:.4}

#immersive-sheet .immersive-qr{width:160px;max-width:100%;height:auto;display:block;margin:auto}body.immersive-view #immersive-sheet{padding-inline:env(safe-area-inset-left) env(safe-area-inset-right)}

#immersive-sheet [data-immersive-disabled=true]{display:none!important}
.floating-tour-panel{position:fixed;z-index:7;box-sizing:border-box;background:#14202df0;border:1px solid #ffffff40;border-radius:14px;overflow:auto;overscroll-behavior:contain;padding:8px}.floating-tour-panel[hidden]{display:none!important}.floating-tour-panel header{display:flex;gap:4px;position:sticky;top:0;background:#14202d;z-index:1}.floating-tour-panel button{background:#233448;color:white;border:1px solid #ffffff30;min-height:36px;border-radius:8px;cursor:pointer}.floating-tour-panel .panel-grip{flex:1;min-width:0;touch-action:none;cursor:move;font-size:12px}.floating-panel-body{padding-top:8px}.floating-panel-body .immersive-qr{display:block;width:100%;height:auto;background:white;shape-rendering:crispEdges}.floating-panel-body input[type=range]{width:100%;box-sizing:border-box}.floating-tour-panel.minimized{padding:0;width:44px!important;height:44px}.floating-tour-panel.minimized .panel-grip{min-height:42px;font-size:23px}.floating-tour-panel #floorpanel{display:block!important;position:static!important;inset:auto!important;width:100%!important;max-height:none!important;box-sizing:border-box}.floating-tour-panel #floorpanel[hidden]{display:none!important}.floating-tour-panel button:focus-visible{outline:3px solid #d8b46a}body.immersive-view:has(#popup[style*="block"]) .floating-tour-panel,body.immersive-view:has(dialog[open]) .floating-tour-panel{visibility:hidden}.floating-tour-panel .floating-panel-body[hidden]{display:none!important}

:root{--panel-safe-left:env(safe-area-inset-left,0px);--panel-safe-right:env(safe-area-inset-right,0px);--panel-safe-top:env(safe-area-inset-top,0px);--panel-safe-bottom:env(safe-area-inset-bottom,0px)}

/* Restore the original standalone map; never place it in the QR frame. */
body.immersive-view #floorpanel{display:block;position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(80px,calc(env(safe-area-inset-bottom) + 80px));width:200px;max-width:calc(100vw - 32px);max-height:45dvh;overflow:auto;box-sizing:border-box;z-index:7}
body.immersive-view #floorpanel[hidden]{display:none!important}
body.immersive-view #floorpanel.floor-enlarged{width:min(440px,calc(100vw - 32px));max-height:70dvh}
.floor-panel-controls{display:flex;gap:4px;margin-bottom:6px}.floor-panel-controls button{font-size:12px;min-height:32px;flex:1;border:1px solid #ffffff40;background:#233448;color:white;border-radius:6px}
#floorpanel img{height:auto;object-fit:contain}
@media(max-width:500px){body.immersive-view #floorpanel{width:135px}}
/* Independent map image and gestures: header drag never pans the map. */
.floor-map-viewport{overflow:hidden;position:relative;touch-action:none;direction:ltr}.floor-map-viewport>div{transform-origin:center center;will-change:transform}.floor-map-viewport.zoomed{cursor:grab}.floor-map-tools{display:flex;gap:6px;padding:4px 0}.floor-map-tools button{min-width:36px}.floating-tour-panel[data-panel=floors] #floorpanel{padding:0;background:transparent}.floating-tour-panel[data-panel=floors] .floating-panel-body{overflow:hidden}.floating-tour-panel[data-panel=floors] img{width:100%;height:auto;display:block}
/* A content-sized native modal, independent of tour/session layers. */
#gallery-lightbox[open]{inset:auto!important;margin:auto!important;display:flex!important;flex-direction:column;gap:6px;width:min(960px,calc(100vw - 16px));height:auto!important;max-height:calc(100dvh - 16px)!important;padding:10px!important;border-radius:14px;background:#1c2530!important;box-shadow:0 20px 70px #0008;box-sizing:border-box;overflow:hidden;padding-top:max(10px,env(safe-area-inset-top))!important;padding-bottom:max(10px,env(safe-area-inset-bottom))!important}
#gallery-lightbox .gallery-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px;flex-shrink:0}#gallery-lightbox .gallery-status,#gallery-lightbox .gallery-close{position:static!important;inset:auto!important;float:none!important}#gallery-lightbox .gallery-close{width:36px!important;height:36px!important;font-size:24px!important;flex:none;line-height:1;padding:0}
#gallery-lightbox .gallery-view-controls{display:flex;gap:6px;flex-wrap:wrap;flex-shrink:0}#gallery-lightbox .gallery-view-controls button{min-height:32px;border:1px solid #ffffff40;border-radius:7px;background:#263748;color:white;padding:4px 9px}#gallery-lightbox .gallery-stage{display:grid;position:relative!important;inset:auto!important;width:100%;flex-shrink:1;min-height:0;overflow:hidden;touch-action:none;background:#222e3b;border-radius:8px}#gallery-lightbox .gallery-stage img{width:100%;height:100%;max-width:100%;max-height:100%;animation:none;transform-origin:center;object-fit:contain}
#gallery-lightbox .gallery-arrow{position:absolute!important;top:50%!important;bottom:auto!important;width:36px!important;height:36px!important;z-index:3;font-size:24px}#gallery-lightbox .gallery-prev{left:12px!important}#gallery-lightbox .gallery-next{right:12px!important}#gallery-lightbox .gallery-caption{position:static!important;padding:0 4px;max-height:48px;overflow:auto;text-align:center;flex-shrink:0;font-size:13px;margin:0;overflow-wrap:anywhere}
.lightbox-thumbnails{display:flex;gap:6px;overflow-x:auto;overflow-y:hidden;max-width:100%;flex-shrink:0;direction:ltr;padding:4px}.lightbox-thumbnails button{padding:0;flex:0 0 48px;height:40px;border:2px solid transparent;border-radius:5px;background:#263748;overflow:hidden}.lightbox-thumbnails button[aria-current=true]{border-color:#d8b46a}.lightbox-thumbnails img{width:100%;height:100%;object-fit:contain}.lightbox-thumbnails[hidden]{display:none!important}
body:has(#gallery-lightbox[open]) .voice-room-dock,body:has(#gallery-lightbox[open]) .voice-room-panel,body:has(#gallery-lightbox[open]) .collab-dock,body:has(#gallery-lightbox[open]) .collab-panel,body:has(#popup[style*="block"]) .voice-room-dock,body:has(#popup[style*="block"]) .voice-room-panel,body:has(#popup[style*="block"]) .collab-dock,body:has(#popup[style*="block"]) .collab-panel{visibility:hidden;pointer-events:none}
.album-stage .gallery-thumb{height:auto!important;max-height:60dvh;aspect-ratio:auto;background:transparent;padding:0}.album-stage .gallery-thumb img{width:100%;height:auto;max-height:60dvh!important;object-fit:contain!important}.album-thumbnails{display:flex;overflow-x:auto;overflow-y:hidden}.album-thumbnails button{flex:none}#popup:has(.gallery-grid) #content{padding-top:54px}
body:has(#gallery-lightbox[open]) .voice-dock,body:has(#gallery-lightbox[open]) .voice-speaking-toast,body:has(#popup[style*="block"]) .voice-dock,body:has(#popup[style*="block"]) .voice-speaking-toast{visibility:hidden;pointer-events:none}
.panel-resize{display:block;margin-inline-start:auto;width:32px;min-height:28px!important;touch-action:none;cursor:nwse-resize}
/* Floor dimensions are owned by the panel, not by the image's natural height. */
.floating-tour-panel[data-panel=floors]{display:flex;flex-direction:column;overflow:hidden;padding:8px;min-height:0}
.floating-tour-panel[data-panel=floors] header{position:static;flex:0 0 30px;min-height:0;align-items:center}
.floating-tour-panel[data-panel=floors] header button{min-height:28px;height:28px;padding:2px 7px;font-size:12px;line-height:1.2;white-space:nowrap}
.floating-tour-panel[data-panel=floors] header .panel-grip{overflow:hidden;text-overflow:ellipsis;min-width:0}
.floating-tour-panel[data-panel=floors] .floating-panel-body{flex:1;min-height:0;display:flex;padding-top:4px}
.floating-tour-panel[data-panel=floors] #floorpanel{display:flex!important;flex-direction:column;flex:1;min-height:0;height:100%;overflow:hidden!important}
.floating-tour-panel[data-panel=floors] #floorpanel select{flex:0 0 30px;height:30px;min-height:0;max-width:100%;font-size:12px;padding:3px 6px;text-overflow:ellipsis}
.floating-tour-panel[data-panel=floors] .floor-map-tools{flex:0 0 28px;padding:3px 0;gap:4px}
.floating-tour-panel[data-panel=floors] .floor-map-tools button{min-height:26px;height:26px;min-width:28px;padding:2px 5px;font-size:12px}
.floating-tour-panel[data-panel=floors] .floor-map-viewport{display:grid;place-items:center;flex:1;min-height:0;overflow:hidden}
.floating-tour-panel[data-panel=floors] .floor-map-viewport img{width:100%;height:100%;object-fit:contain;display:block}
.floating-tour-panel[data-panel=floors] .floor-map-viewport button{min-height:0!important;width:24px!important;height:24px!important;aspect-ratio:1;padding:0!important;font-size:11px!important;line-height:1;border-width:2px!important;box-sizing:border-box;box-shadow:0 1px 5px #0009}
.floating-tour-panel[data-panel=floors] .floor-map-viewport button[aria-current=location]{outline:2px solid #147bd1;outline-offset:2px}
.floating-tour-panel .panel-resize{position:absolute;z-index:3;opacity:.5;background:transparent;border:0;min-height:0!important;min-width:0!important;box-sizing:border-box;padding:0;touch-action:none}
.floating-tour-panel .panel-resize-e,.floating-tour-panel .panel-resize-w{top:36px;bottom:10px;width:6px;height:auto;cursor:ew-resize}
.floating-tour-panel .panel-resize-e{right:0}.floating-tour-panel .panel-resize-w{left:0}
.floating-tour-panel .panel-resize-n,.floating-tour-panel .panel-resize-s{left:10px;right:10px;width:auto;height:6px;cursor:ns-resize}
.floating-tour-panel .panel-resize-n{top:0}.floating-tour-panel .panel-resize-s{bottom:0}
.floating-tour-panel .panel-resize-se,.floating-tour-panel .panel-resize-sw,.floating-tour-panel .panel-resize-ne,.floating-tour-panel .panel-resize-nw{width:8px;height:8px}
.floating-tour-panel .panel-resize-se{right:0;bottom:0;cursor:nwse-resize}.floating-tour-panel .panel-resize-sw{left:0;bottom:0;cursor:nesw-resize}.floating-tour-panel .panel-resize-ne{right:0;top:0;cursor:nesw-resize}.floating-tour-panel .panel-resize-nw{left:0;top:0;cursor:nwse-resize}
.floating-tour-panel.minimized .panel-resize{display:none}
body.immersive-view .video-surface.immersive-occluded{opacity:1;pointer-events:auto}
.hotspot .hot-label,.hotspot .surface-edit,.hotspot .inline-card{font-family:var(--label-font,Tahoma,Arial,sans-serif);color:var(--label-color,#fff);font-weight:var(--label-weight,500);letter-spacing:var(--label-spacing,0);text-align:var(--label-align,start);background:var(--label-background,#14202dbb);border:var(--label-border-width,0) solid var(--label-border,#64748b);border-radius:var(--label-radius,6px);box-shadow:var(--label-shadow,0 2px 8px #0004);font-size:var(--label-size,14px);line-height:1.5;unicode-bidi:plaintext;overflow-wrap:anywhere}
.hotspot .hot-label{position:absolute;margin:0;top:calc(100% + 6px);left:50%;width:max-content;min-width:0;max-width:min(240px,calc(100vw - 24px));white-space:normal;padding:3px 7px;transform:translate(calc(-50% + var(--label-shift-x,0px)),var(--label-shift-y,0px))}
.hotspot[data-label-placement=top] .hot-label{top:auto;bottom:calc(100% + 6px)}.hotspot[data-label-placement=left] .hot-label{top:50%;left:auto;right:calc(100% + 6px);transform:translate(var(--label-shift-x,0px),calc(-50% + var(--label-shift-y,0px)))}.hotspot[data-label-placement=right] .hot-label{top:50%;left:calc(100% + 6px);transform:translate(var(--label-shift-x,0px),calc(-50% + var(--label-shift-y,0px)))}
.hotspot[data-label-template=glass] .hot-label{backdrop-filter:blur(5px)}.hotspot[data-label-template=card] .hot-label{padding:8px 12px;max-width:min(300px,80vw)}
.hotspot[data-label-mode=hover] .hot-label,.hotspot[data-label-mode=click]:not(.label-revealed) .hot-label{visibility:hidden}.hotspot[data-label-mode=hover]:hover .hot-label,.hotspot[data-label-mode=hover]:has(:focus-visible) .hot-label{visibility:visible}
.hotspot .surface-edit{font-size:12px;max-width:180px;width:max-content;padding:3px 7px;bottom:-26px;border:0;white-space:normal}
.hotspot .hot-icon[data-variant=dimensional]{box-shadow:inset 0 2px 2px #fff8,inset 0 -3px 5px #0005,0 4px 8px #0005;background:linear-gradient(155deg,#ffffff44,#0002),var(--hot-color)}
.hotspot .hot-icon[data-motion=pulse]{animation:boyas-pulse 2s ease-in-out infinite}.hotspot .hot-icon[data-motion=glow]{animation:boyas-glow 2s ease-in-out infinite}.hotspot .hot-icon[data-motion=directional] svg{animation:boyas-direction 1.8s ease-in-out infinite}
@keyframes boyas-pulse{50%{scale:1.07}}@keyframes boyas-glow{50%{filter:brightness(1.3)}}@keyframes boyas-direction{50%{translate:0 -3px}}
@media(prefers-reduced-motion:reduce){.hotspot .hot-icon,.hotspot .hot-icon svg{animation:none!important}}
@media(max-width:767px){.hotspot .hot-label{font-size:clamp(11px,var(--label-size),18px);max-width:min(180px,60vw)}}
.hotspot[data-label-template] .inline-card h3,.hotspot[data-label-template] .inline-card p{font-size:inherit;color:inherit;letter-spacing:inherit;text-align:inherit}.hotspot[data-label-template] .inline-card h3[hidden],.hotspot .hot-label[hidden],.hotspot .surface-edit[hidden]{display:none!important}
#content[data-label-template] p,#content[data-label-template] h2{font-family:var(--label-font);font-size:var(--label-size);font-weight:var(--label-weight);letter-spacing:var(--label-spacing);text-align:var(--label-align);color:var(--label-color);unicode-bidi:plaintext;overflow-wrap:anywhere}
.hotspot[data-label-mode=hover] .inline-card h3,.hotspot[data-label-mode=click]:not(.label-revealed) .inline-card h3{visibility:hidden}.hotspot[data-label-mode=hover]:hover .inline-card h3,.hotspot[data-label-mode=hover]:has(:focus-visible) .inline-card h3{visibility:visible}

/* A detached floor root is never a second legacy viewer. */
#floorpanel[hidden]{display:none!important}
.voice-dock,.collab-dock{max-width:calc(100vw - 24px);flex-wrap:wrap;box-sizing:border-box}
.voice-dock button,.collab-dock button{min-height:32px}

/* Resizable utility panels stay inside the viewport on desktop. */
@media (min-width: 768px) and (pointer: fine) {
  #immersive-sheet:not([hidden]), .collab-panel:not([hidden]), .voice-room-panel:not([hidden]) {
    resize: both; overflow: auto; min-width: 280px; min-height: 200px;
    max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px);
  }
  .voice-room-panel.voice-embedded { resize: none; min-width: 0; min-height: 0; }
}
