#ibn-doors{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden}
#ibn-doors svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.ibn-door{fill:rgba(221,186,106,.008);stroke:rgba(255,235,190,.06);stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:none}
.ibn-door.ibn-hover{fill:rgba(221,186,106,.035);stroke:rgba(255,235,190,.22)}
.ibn-door-label{position:absolute;left:0;top:0;display:inline-flex;align-items:center;justify-content:center;gap:7px;max-width:200px;min-width:44px;min-height:44px;box-sizing:border-box;padding:8px 12px;border:0;border-radius:11px;background:transparent;color:#fff;font-family:inherit;font-size:12px;font-weight:600;line-height:1.4;pointer-events:none;cursor:pointer;white-space:normal;text-align:start;isolation:isolate}
.ibn-door-label::before{content:'';position:absolute;inset:4px 0;z-index:-1;border:1px solid rgba(231,196,117,.28);border-radius:11px;background:rgba(18,28,57,.84);backdrop-filter:blur(8px);box-shadow:0 3px 10px #0003;transition:background .15s,border-color .15s}
.ibn-door-label>span:first-child{flex:0 0 auto;font-size:16px;line-height:1;color:#e7c475;font-weight:500}
.ibn-door-name{min-width:0}
.ibn-door-copy{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0}
.ibn-door-action{font-size:9px;font-weight:500;line-height:1.3;color:#e7c475}
.ibn-door-label .ibn-door-icon{width:19px;height:19px;flex:0 0 19px}
#ibn-doors .ibn-door-icon svg{position:static;width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ibn-destination-space{color:#182544}
.ibn-destination-space::before{background:rgba(250,246,235,.94);border-color:rgba(231,196,117,.75)}
.ibn-destination-space .ibn-door-action,.ibn-destination-space .ibn-door-icon{color:#795b22}
.ibn-door-label.ibn-hover::before,.ibn-door-label:focus-visible::before{background:rgba(24,39,78,.95);border-color:rgba(231,196,117,.7)}
/* Keep each destination type readable in normal, hovered and keyboard states.
   The generic navy hover must never cover the space card's dark text. */
.ibn-door-label.ibn-destination-space.ibn-hover::before,.ibn-door-label.ibn-destination-space:focus-visible::before{background:rgba(255,252,244,.98);border-color:#b88b37}
.ibn-door-label.ibn-destination-space .ibn-door-name{color:#182544}
.ibn-door-label.ibn-destination-space>.ibn-door-icon,.ibn-door-label.ibn-destination-space .ibn-door-action{color:#795b22}
.ibn-door-label.ibn-destination-room .ibn-door-name{color:#fff}
.ibn-door-label:focus-visible{outline:3px solid #e7c475;outline-offset:3px}
.ibn-door-cursor{cursor:pointer!important}
#pano-hotspot-overlay.ibn-replaced{visibility:hidden;pointer-events:none}
#ibn-map{position:fixed;left:16px;bottom:212px;z-index:15;width:min(330px,calc(100vw - 32px));background:rgba(247,242,232,.94);color:#182544;border:1px solid #d7cbb7;border-radius:16px;box-shadow:0 8px 30px #0002;backdrop-filter:blur(12px);font-family:inherit;overflow:hidden}
#ibn-map[hidden],#ibn-doors[hidden],.ibn-door-label[hidden],#ibn-map-body[hidden]{display:none!important}
.ibn-toggle{border:0;background:none;color:inherit;display:flex;align-items:center;gap:9px;min-height:44px;width:100%;padding:10px 12px;font-family:inherit;cursor:pointer;text-align:start}
.ibn-map-title{font-size:12px;font-weight:700;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ibn-toggle>span:first-child{font-size:21px;color:#8d692d}.ibn-chevron{font-size:18px}
.ibn-plan{padding:6px}.ibn-plan svg{display:block;width:100%;height:auto;border-radius:8px;overflow:hidden;background:#ded8cc}
.ibn-room{fill:#e7c4750b;stroke:#fff7;stroke-width:5;cursor:pointer;outline:none}
.ibn-room:hover,.ibn-room:focus{fill:#e7c47570;stroke:#ffe6a6;stroke-width:10}.ibn-room.ibn-selected{fill:#e7c47540;stroke:#ffe6a6;stroke-width:9}
.ibn-cone{fill:#182f7399;stroke:#fff9;stroke-width:4;pointer-events:none}.ibn-position{fill:#d5a958;stroke:white;stroke-width:8;pointer-events:none}
.ibn-direction{fill:none;stroke:#fff;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;filter:drop-shadow(0 1px 2px #182544)}
.ibn-note{margin:4px 12px 9px;font-size:10px;line-height:1.6;color:#584d3d}
.ibn-room-select{display:flex;align-items:center;gap:8px;padding:0 12px 10px;font-size:11px}
.ibn-room-select select{flex:1;min-width:0;min-height:44px;border:1px solid #cabb9f;border-radius:9px;background:#fff;color:#182544;font-family:inherit;padding:4px 8px}
.ibn-plan-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 12px 3px}
.ibn-plan-tools-title{font-size:11px;font-weight:600;color:#584d3d}
#ibn-names-toggle{min-height:44px;padding:6px 12px;border:1px solid #cabb9f;border-radius:9px;background:#fff9;color:#182544;font-family:inherit;font-size:11px;font-weight:600;line-height:1.4;cursor:pointer}
#ibn-names-toggle:hover{background:#fff}
#ibn-names-toggle:focus-visible{outline:3px solid #a97828;outline-offset:2px}
#ibn-names-toggle[aria-pressed=false]{background:transparent}
.ibn-plan-canvas{position:relative;container-type:inline-size}
#ibn-plan-names{position:absolute;inset:0;pointer-events:none;overflow:hidden;border-radius:8px}
#ibn-plan-names[hidden]{display:none!important}
.ibn-plan-name{position:absolute;top:0;left:0;box-sizing:border-box;width:max-content;padding:3px 5px;border:1px solid #dfd3bd;border-radius:5px;background:rgba(255,252,245,.95);box-shadow:0 1px 4px #0002;color:#182544;font-family:inherit;font-size:10px;font-weight:700;line-height:1.2;text-align:center;white-space:normal;overflow-wrap:normal;pointer-events:auto;cursor:pointer}
.ibn-plan-name.ibn-name-selected{background:#182544;color:#fff;border-color:#e7c475}
.ibn-name-leader{stroke:#e7c475;stroke-width:1.5;vector-effect:non-scaling-stroke;pointer-events:none}
.ibn-name-anchor{fill:#e7c475;stroke:#fff;stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:none}
@container(max-width:380px){.ibn-plan-name{font-size:9px;padding:2px 4px}}
@container(min-width:480px){.ibn-plan-name{font-size:11px}}
@media(min-width:900px){#ibn-map{bottom:144px}}
@media(max-width:600px){#ibn-map{left:12px;bottom:calc(212px + env(safe-area-inset-bottom));width:calc(100vw - 24px)}.ibn-note{font-size:11px}.ibn-toggle{min-height:44px}.ibn-door-label{max-width:150px;font-size:11px;padding:8px 6px;gap:1px}.ibn-door-label>span:first-child{font-size:14px}}
@media(max-width:600px) and (max-height:650px){#ibn-map-body{max-height:calc(100dvh - 390px);overflow:auto}}
@media(max-height:550px){#ibn-map{top:92px;bottom:auto;left:auto;right:72px;width:260px}#ibn-map-body{max-height:calc(100dvh - 216px);overflow:auto}.ibn-room-select{padding-bottom:6px}}
@media(prefers-reduced-motion:reduce){#ibn-map *{scroll-behavior:auto}.ibn-door-label::before{transition:none}}

/* Trial chrome: three complete scene names, location left, scene / zoom right. */
body.panorama-mode{--ibn-edge:20px;--ibn-footer:calc(20px + env(safe-area-inset-bottom));--ibn-rail-bottom:var(--ibn-footer);--ibn-rail-height:68px}
body.panorama-mode #pano-scenes-toggle{left:auto!important;right:var(--ibn-edge)!important;bottom:var(--ibn-footer)!important;min-width:96px!important;height:44px!important;min-height:44px!important;max-height:none!important;padding:0 12px!important;border-radius:13px!important}
body.panorama-mode #pano-scenes-toggle span{display:inline!important}
body.panorama-mode #pano-controls{position:fixed!important;left:auto!important;right:var(--ibn-edge)!important;top:auto!important;bottom:calc(var(--ibn-footer) + 56px)!important;gap:6px;z-index:37}
body.panorama-mode #pano-controls.visible{display:flex!important}
body.panorama-mode #pano-controls .pc-btn{width:44px;height:44px;min-width:44px;min-height:44px}
body.panorama-mode #pano-scenes-rail{left:50%!important;right:auto!important;bottom:var(--ibn-rail-bottom)!important;top:auto!important;width:min(640px,calc(100vw - 560px))!important;height:var(--ibn-rail-height)!important;min-height:var(--ibn-rail-height)!important;max-height:none!important;transform:translateX(-50%)!important;box-sizing:border-box;gap:6px;padding:6px;border-radius:14px}
body.panorama-mode #pano-scenes-rail #pano-room-list.visible{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));direction:inherit;gap:6px;overflow:hidden!important;height:100%;flex:1;min-width:0;background:transparent!important;border:0!important;box-shadow:none!important}
body.panorama-mode #pano-scenes-rail .room-item{min-width:0!important;max-width:none!important;width:100%;height:100%;padding:6px!important;gap:7px!important;box-sizing:border-box;justify-content:center;border-radius:10px}
body.panorama-mode #pano-scenes-rail .room-item[hidden]{display:none!important}
body.panorama-mode #pano-scenes-rail .room-info{min-width:0;flex:1}
body.panorama-mode #pano-scenes-rail .room-name{max-width:none!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;line-height:1.45;font-size:12px!important;text-align:center}
body.panorama-mode #pano-scenes-rail .pano-scene-step{width:44px!important;flex:0 0 44px!important;height:44px!important;min-height:44px}
body.panorama-mode #ibn-map{left:var(--ibn-edge)!important;right:auto!important;top:auto!important;bottom:var(--ibn-footer)!important;width:230px;max-width:calc(100vw - 132px);border-radius:13px}
body.panorama-mode .ibn-toggle{padding:8px 10px;gap:6px;min-height:44px}
body.panorama-mode .ibn-map-title{font-size:11px}
body.panorama-mode #ibn-map-body{max-height:calc(100dvh - 150px);overflow:auto}
@media(max-width:1100px){
  body.panorama-mode{--ibn-edge:12px;--ibn-footer:calc(12px + env(safe-area-inset-bottom));--ibn-rail-bottom:calc(var(--ibn-footer) + 68px);--ibn-rail-height:72px}
  body.panorama-mode #pano-scenes-rail{width:min(640px,calc(100vw - 24px))!important}
  body.panorama-mode #ibn-map:has(.ibn-toggle[aria-expanded=true]){bottom:calc(var(--ibn-rail-bottom) + var(--ibn-rail-height) + 12px)!important}
  body.panorama-mode #ibn-map-body{max-height:calc(100dvh - 300px)}
}
@media(max-width:600px){
  body.panorama-mode{--ibn-rail-bottom:calc(var(--ibn-footer) + 112px);--ibn-rail-height:80px}
  body.panorama-mode #pano-controls{flex-direction:row}
  body.panorama-mode #pano-scenes-rail{gap:3px;padding:5px}
  body.panorama-mode #pano-scenes-rail #pano-room-list.visible{gap:3px}
  body.panorama-mode #pano-scenes-rail .room-item{padding:4px!important;gap:2px!important;flex-direction:column}
  body.panorama-mode #pano-scenes-rail .room-name{font-size:11px!important;line-height:1.3}
  body.panorama-mode #pano-scenes-rail .pano-scene-step{width:44px!important;flex-basis:44px!important}
  body.panorama-mode #ibn-map{width:220px}
  body.panorama-mode #ibn-map-body{max-height:calc(100dvh - 352px)}
}
@media(max-height:550px){
  body.panorama-mode #pano-scenes-rail{--ibn-rail-height:60px;width:min(570px,calc(100vw - 24px))!important}
  body.panorama-mode #ibn-map-body{max-height:calc(100dvh - 275px)}
}

/* Keep the closed location chip compact; enlarge the opened plan only. */
body.panorama-mode #ibn-map:has(.ibn-toggle[aria-expanded=true]){
  width:min(520px,calc(100vw - 2 * var(--ibn-edge)));
  max-width:none;
  bottom:calc(var(--ibn-rail-bottom) + var(--ibn-rail-height) + 12px)!important;
}
/* On wide screens the opened location plan shares the scene rail baseline.
   Reserve its width so the three scene cards cannot slide underneath it. */
@media(min-width:1101px){
  body.panorama-mode #ibn-map:has(.ibn-toggle[aria-expanded=true]){
    bottom:var(--ibn-rail-bottom)!important;
  }
  body.panorama-mode:has(#ibn-map .ibn-toggle[aria-expanded=true]) #pano-scenes-rail{
    left:auto!important;
    right:calc(var(--ibn-edge) + 108px)!important;
    width:min(640px,calc(100vw - 520px - 2 * var(--ibn-edge) - 120px))!important;
    transform:none!important;
  }
}
@media(max-height:550px){
  body.panorama-mode #ibn-map:has(.ibn-toggle[aria-expanded=true]){
    width:min(520px,calc(100vw - 2 * var(--ibn-edge)),max(180px,calc((100dvh - var(--ibn-rail-bottom) - var(--ibn-rail-height) - 152px) * 2.45 + 14px)));
  }
  body.panorama-mode #ibn-map-body{
    max-height:max(40px,calc(100dvh - var(--ibn-rail-bottom) - var(--ibn-rail-height) - 140px));
  }
}

/* Official viewer chrome: preserve the established imagery and navigation. */
/* One plan entry point: the location chip. The duplicate top button is removed
   from the markup; this guard also covers older cached markup. */
body #pano-tour-plan-toggle { display:none!important; }

/* Compact scene dock, with 44px controls and complete room names. */
body.panorama-mode { --ibn-rail-height:64px; }
body.panorama-mode #pano-scenes-rail {
  width:min(520px,calc(100vw - 560px))!important;
}
body.panorama-mode #pano-scenes-rail .room-item {
  min-height:44px!important;
}
body.panorama-mode #pano-scenes-rail .room-name {
  font-size:12px!important;
  line-height:1.35;
}

@media (max-width:1100px) and (min-width:601px) {
  body.panorama-mode { --ibn-rail-height:64px; }
  /* Keep a clear right-hand lane for the vertical zoom buttons. */
  body.panorama-mode #pano-scenes-rail {
    width:min(520px,calc(100vw - 132px))!important;
  }
}
@media (max-width:600px) {
  body.panorama-mode { --ibn-rail-height:72px; }
  body.panorama-mode #pano-scenes-rail {
    width:calc(100vw - 24px)!important;
  }
  body.panorama-mode #pano-scenes-rail .room-name {
    font-size:11px!important;
  }
}
@media (min-width:1101px) {
  body.panorama-mode:has(#ibn-map .ibn-toggle[aria-expanded=true]) #pano-scenes-rail {
    width:min(520px,calc(100vw - 520px - 2 * var(--ibn-edge) - 120px))!important;
  }
}

/* Image tabs on tablets should fit their two labels, not span the screen. */
@media (min-width:601px) and (max-width:1024px) {
  body #topbar {
    left:50%!important; right:auto!important;
    width:max-content!important; max-width:calc(100vw - 24px)!important;
    min-height:56px!important; height:56px!important;
    transform:translateX(-50%)!important;
  }
  body #topbar .topbar-sections { flex:0 1 auto; gap:3px; }
  body #topbar .topbar-sections>.topbar-btn,
  body #topbar .topbar-sections>.topbar-menu-wrap {
    flex:0 0 auto;
  }
  body #topbar .topbar-btn,
  body #topbar .topbar-menu-wrap .topbar-btn {
    height:44px!important; min-height:44px!important;
    padding:0 10px!important; flex-direction:row!important; gap:6px!important;
  }
  body #topbar .tb-label { width:auto!important; white-space:nowrap; font-size:11px!important; }
  body #render-nav {
    left:50%!important; right:auto!important;
    width:max-content!important; max-width:calc(100vw - 24px)!important;
    height:54px!important; min-height:54px!important; max-height:54px!important;
    transform:translateX(-50%)!important; margin:0!important;
    padding:4px!important; gap:4px!important;
  }
  body #render-nav .rn-track { flex:0 1 auto; }
  body #render-nav .rn-btn {
    min-height:44px!important; height:44px!important;
    padding:0 13px!important; font-size:12px!important;
  }
  body #render-nav .rn-step {
    width:44px!important; height:44px!important; flex-basis:44px!important;
  }
}

/* Opening a sheet or menu must not leave another interactive dock over it. */
body:has(#units-dropdown.visible) #render-nav {
  visibility:hidden!important; pointer-events:none!important;
}
@media (max-width:1024px) {
  body.compact-panel-open #render-nav {
    visibility:hidden!important; pointer-events:none!important;
  }
  body.compact-panel-open #right-panel {
    max-height:min(58dvh,500px,calc(100dvh - 200px))!important;
    overflow-y:auto;
  }
}

/* A short landscape screen cannot accommodate a map and a second dock.
   Give the opened mini-plan a usable scrollable sheet, keeping its close,
   label toggle and room selection available. */
@media (max-height:550px) {
  body.panorama-mode { --ibn-rail-height:60px; }
  body.panorama-mode #pano-scenes-rail {
    width:min(520px,calc(100vw - 132px))!important;
  }
  body.panorama-mode #ibn-map:has(.ibn-toggle[aria-expanded=true]) {
    left:var(--ibn-edge)!important; top:auto!important;
    bottom:var(--ibn-footer)!important;
    width:min(360px,calc(100vw - 132px))!important;
  }
  body.panorama-mode #ibn-map-body {
    max-height:calc(100dvh - 140px)!important;
    overflow-y:auto; overscroll-behavior:contain;
  }
  body.panorama-mode:has(#ibn-map .ibn-toggle[aria-expanded=true]) #pano-scenes-rail {
    display:none!important;
  }
}

/* Mobile follow-up: keep facade cards separate from mobile docks and menus. */
/* Descendants have their own visibility rules; hide the entire subtree while
   retaining its geometry so opening a menu does not change facade framing. */
body:has(#units-dropdown.visible) #render-nav,
body:has(#units-dropdown.visible) #render-nav * {
  visibility:hidden!important;
  pointer-events:none!important;
}
@media (max-width:1024px) {
  body.compact-panel-open #render-nav,
  body.compact-panel-open #render-nav * {
    visibility:hidden!important;
    pointer-events:none!important;
  }
}
/* Floor labels use the reserved right-hand rail in a short landscape view.
   Keep the logo in the left tool row instead of covering the roof card. */
@media (max-width:1024px) and (max-height:520px) and (orientation:landscape) {
  body.floor-image-fit #logo-chip {
    left:124px!important;
    right:auto!important;
    top:20px!important;
  }
}

/* Mobile follow-up: keep facade cards separate from mobile docks and menus. */
/* Descendants have their own visibility rules; hide the entire subtree while
   retaining its geometry so opening a menu does not change facade framing. */
body:has(#units-dropdown.visible) #render-nav,
body:has(#units-dropdown.visible) #render-nav *,
body:has(#floor-units-panel.visible) #render-nav,
body:has(#floor-units-panel.visible) #render-nav * {
  visibility:hidden!important;
  pointer-events:none!important;
}
body:has(#units-dropdown.visible) #floor-selector-layer,
body:has(#units-dropdown.visible) #floor-selector-layer * {
  visibility:hidden!important;
  pointer-events:none!important;
}
@media (max-width:1024px) {
  body.compact-panel-open #render-nav,
  body.compact-panel-open #render-nav * {
    visibility:hidden!important;
    pointer-events:none!important;
  }
}
/* Floor labels use the reserved right-hand rail in a short landscape view.
   Keep the logo in the left tool row instead of covering the roof card. */
@media (max-width:1024px) and (max-height:520px) and (orientation:landscape) {
  body.floor-image-fit #logo-chip {
    left:124px!important;
    right:auto!important;
    top:20px!important;
  }
}

/* A smaller facade must not leave flat empty bands on tall phones. Keep the
   sharp original image foreground; use the same photo softly behind it. */
@media (max-width:600px) and (orientation:portrait) {
  body.floor-image-fit:not(.panorama-mode) #app { isolation:isolate; }
  body.floor-image-fit:not(.panorama-mode) #app::before {
    content:"";
    position:absolute;
    inset:0;
    z-index:-1;
    pointer-events:none;
    background-image:var(--floor-backdrop);
    background-size:cover;
    background-position:center;
    filter:blur(14px);
    opacity:.65;
    transform:scale(1.04);
  }
}

/* Compact plan names; retain the live location dot and direction indicator.
   Room labels and SVG hit areas remain interactive. */
#ibn-plan-names .ibn-plan-name {
  font-size:9px;
  line-height:1.2;
  padding:2px 4px;
}
@container (max-width:380px) {
  #ibn-plan-names .ibn-plan-name {
    font-size:8px;
    padding:2px 3px;
  }
}
#ibn-map .ibn-name-anchor,
#ibn-map .ibn-name-leader {
  display:none!important;
}

/* Blue identifies interactive tour destinations. Information-only labels
   remain unchanged; door/arrow icons still distinguish Enter from Move. */
#ibn-doors button.ibn-door-label {
  color:#fff;
}
#ibn-doors button.ibn-door-label::before {
  background:rgba(26,45,103,.97);
  border-color:#7896d5;
}
#ibn-doors button.ibn-door-label .ibn-door-name {
  color:#fff;
}
#ibn-doors button.ibn-door-label .ibn-door-action,
#ibn-doors button.ibn-door-label>.ibn-door-icon {
  color:#f0cf82;
}
#ibn-doors button.ibn-door-label.ibn-hover::before,
#ibn-doors button.ibn-door-label:hover::before,
#ibn-doors button.ibn-door-label:focus-visible::before {
  background:#244786;
  border-color:#b2c8f3;
}
