/* Whole-figure canvas above the unchanged original room image. */
.room-scene > .fixed-facility-cast,
.fixed-facility-cast {
 position: absolute;
 inset: 0;
 display: block;
 width: 100%;
 height: 100%;
 z-index: 3;
 pointer-events: none;
 background: transparent;
}
.fixed-facility-cast[data-cast-ready="pending"],
.fixed-facility-cast[data-cast-ready="error"] { visibility: hidden; }
/* Only the parent may elect to hide an original, complete fallback figure. */
.wm-resident[data-fixed-cast-hidden="true"] {
 visibility: hidden !important;
 pointer-events: none !important;
}
/* A missing/unvalidated overlay must not deform or remove fallback artwork. */
.room-scene:not([data-fixed-cast-ready="true"]) .wm-resident[data-fixed-cast-hidden="true"] {
 visibility: visible !important;
}

/* Preserve the existing centered absolute .room-scene geometry. No filter stack. */
.fixed-facility-cast{filter:none!important;transform:none!important;animation:none!important;transition:none!important;image-rendering:auto}
.fixed-cast-dialog{width:max-content;border:1px solid #758771;border-radius:12px;padding:18px;background:#142119;color:#e1e8d4;max-width:96vw;max-height:94dvh;overflow:auto;box-shadow:0 20px 80px #000b}
.fixed-cast-dialog::backdrop{background:#050c09bb}
.fixed-cast-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 12px}
.fixed-cast-heading h2{font-size:19px;margin:0 0 5px}.fixed-cast-heading p{font-size:12px;color:#a7b7a2;margin:0}
.fixed-cast-heading .secondary-button{width:auto;min-width:66px;margin:0}
.room-scene.fixed-cast-enlarged{position:relative;left:auto;top:auto;transform:none;width:min(920px,calc(100vw - 74px),calc((100dvh - 280px)*var(--cast-ratio)));height:auto;aspect-ratio:var(--cast-ratio);border:1px solid #4e6548;border-radius:6px;overflow:hidden}
.fixed-cast-note{font-size:11px;line-height:1.7;color:#a9b9a0;margin:11px 0 0}

.facility-view-toolbar{display:grid;grid-template-columns:auto minmax(130px,1fr) auto;align-items:center;gap:8px;margin:0 0 12px}
.facility-view-toolbar .secondary-button{width:auto;margin:0;white-space:nowrap;padding:7px 10px;min-height:34px;font-size:12px}
.facility-view-toolbar select{min-width:0;width:100%;height:34px;border:1px solid #61745d;border-radius:5px;background:#1d3025;color:#dbe8cf;padding:5px 9px;font-size:12px}
.world-tools .facility-gallery-open{width:auto;margin:0;padding:5px 8px;font-size:11px;min-height:30px;white-space:nowrap}
.fixed-cast-heading>div{min-width:0}
@media(max-width:600px){.fixed-cast-dialog{padding:12px;max-width:96vw}.room-scene.fixed-cast-enlarged{width:min(920px,calc(100vw - 54px),calc((100dvh - 285px)*var(--cast-ratio)))}.fixed-cast-heading{gap:10px}.fixed-cast-heading h2{font-size:17px}.facility-view-toolbar{gap:5px;grid-template-columns:auto minmax(105px,1fr) auto}.facility-view-toolbar .secondary-button{padding:7px;font-size:11px}}

/* The cave cutaway mask belongs only to the base overview, never to an enlarged inspection. */
.room-scene.fixed-cast-enlarged{mask-image:none!important;-webkit-mask-image:none!important;clip-path:none;filter:none!important}
