:root { color-scheme: dark; background: #323038; --surface: #f9f8f8; --ink: #323038; --accent: #a1bbca; }
* { box-sizing: border-box; }
html, body, main { width: 100%; height: 100%; margin: 0; overflow: hidden; }
#building-view {
    position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh;
    display: block; margin: 0; padding: 0; border: 0; border-radius: 0;
    background: #323038; cursor: pointer; -webkit-tap-highlight-color: transparent;
    appearance: none; -webkit-appearance: none;
}
#building-view:focus-visible { outline: 3px solid #a1bbca; outline-offset: -6px; }
#building-poster, #building-poster img, #building-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
}
#building-poster img { display: block; object-fit: cover; }
#building-canvas { visibility: hidden; pointer-events: none; }
#building-view[data-ready="true"] #building-canvas { visibility: visible; }
#building-view[data-ready="true"] #building-poster { visibility: hidden; }
#building-spaces { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 1; }
#building-view[data-phase="turning"] ~ #building-spaces { visibility: hidden; }
#building-spaces polygon {
    pointer-events: auto; cursor: pointer; fill: #a1bbca; fill-opacity: .2;
    stroke: #f9f8f8; stroke-width: 1; vector-effect: non-scaling-stroke;
}
#building-spaces polygon:hover, #building-spaces polygon:focus-visible {
    fill-opacity: .65; stroke: #323038; stroke-width: 2; outline: none;
}
.building-brand {
    position: fixed; top: max(24px, env(safe-area-inset-top)); left: max(24px, env(safe-area-inset-left));
    z-index: 2; display: flex; align-items: center; min-height: 44px;
}
.building-brand img { display: block; width: 132px; height: 32px; }
.building-brand:focus-visible, .building-controls button:focus-visible, #space-plan-close:focus-visible {
    outline: 3px solid var(--ink); outline-offset: 3px;
}
.building-controls {
    position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
    z-index: 2; display: flex; gap: 4px; padding: 6px; border-radius: 16px;
    border: 1px solid rgb(249 248 248 / .65); background: rgb(249 248 248 / .74);
    box-shadow: 0 8px 24px rgb(50 48 56 / .14); backdrop-filter: blur(16px);
}
.building-controls button, #space-plan-close {
    display: grid; place-items: center; width: 48px; height: 48px; border: 0;
    border-radius: 10px; padding: 0; color: var(--ink); background: transparent; cursor: pointer;
}
.building-controls button:hover, #space-plan-close:hover { background: var(--surface); }
.building-controls button:active { background: var(--accent); }
.building-controls svg, #space-plan-close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#space-plan {
    width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
    padding: 28px; border: 1px solid #dedede; border-radius: 16px;
    background: var(--surface); color: var(--ink); font: 400 1rem/1.5 Manrope, sans-serif;
    box-shadow: 0 24px 80px rgb(50 48 56 / .22); overflow: auto;
}
#space-plan::backdrop { background: rgb(50 48 56 / .2); }
#space-plan-close { position: absolute; top: 12px; right: 12px; }
.space-plan-heading { margin-bottom: 24px; padding-right: 44px; }
.space-plan-label { margin: 0 0 6px; font-size: .75rem; color: #65616d; }
#space-plan-title { margin: 0; font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
#space-plan-image { display: block; width: 100%; max-height: 65dvh; object-fit: contain; }
#space-plan-image[hidden] { display: none; }
#space-plan-message { margin: 16px 0 0; }
@media (max-width: 768px) {
    .building-brand { top: max(16px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }
    .building-brand img { width: 116px; height: auto; }
    .building-controls { bottom: max(16px, env(safe-area-inset-bottom)); }
    #space-plan { padding: 24px 16px; }
}
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.fallback {
    position: fixed; bottom: 1rem; left: 1rem; right: 1rem; margin: 0;
    padding: 1rem; color: #f9f8f8; background: #323038; font: 1rem/1.5 system-ui, sans-serif;
}
.fallback a { color: #a1bbca; }
