/* Compact room toolbar; every existing display control keeps its ID and handler. */
:root{--vs-surface:#f9fbf3f5;--vs-border:#d6dccd;--vs-ink:#24382b;--vs-ink-2:#5d6f60;--vs-hover:#e7ecdf;--vs-active:#254c38;--vs-shadow:0 4px 18px #0003}
.room-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;pointer-events:none}
.view-icon{display:inline-flex;width:18px;height:18px;flex:none;color:inherit}.view-icon svg{width:18px;height:18px}
.view-switch,.display-switch{position:relative;pointer-events:auto}
.view-fab,.layer-link{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:0 12px;border:1px solid var(--vs-border);border-radius:9px;background:var(--vs-surface);color:var(--vs-ink);font:inherit;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:var(--vs-shadow);cursor:pointer;pointer-events:auto}
.view-fab:hover,.layer-link:hover{background:var(--vs-hover)}
.view-fab[aria-expanded=true],#btn-display[aria-expanded=true]{background:var(--vs-active);color:#fff;border-color:var(--vs-active)}
.room-toolbar button:focus-visible,.layer-panel input:focus-visible,.layer-panel select:focus-visible{outline:2px solid #729e7e;outline-offset:3px}
.room-toolbar button:disabled{opacity:.55;cursor:wait}
.view-chevron{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none;margin-right:-2px;transition:transform .15s ease}.view-chevron svg{display:block;width:14px;height:14px}.view-fab[aria-expanded=true] .view-chevron{transform:rotate(180deg)}
/* Aerial view tools: explode, Show in room and the class legend, on the left under the view button. Absolute,
   so the overlay height (and the route map placed from it) does not change. */
.aerial-tools{position:absolute;top:calc(100% + 8px);left:0;width:250px;max-height:calc(100dvh - 300px);overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px;padding:10px 12px;border:1px solid var(--vs-border);border-radius:12px;background:var(--vs-surface);color:var(--vs-ink);box-shadow:var(--vs-shadow);font-size:12px;line-height:16px;pointer-events:auto}
.layer-explode{font-weight:600}.layer-explode input[type=range]{flex:1;min-width:0;margin:0;accent-color:var(--vs-active);cursor:pointer}
.aerial-tools .class-legend{margin:0;padding:8px;max-width:none;border-color:var(--vs-border);background:#e9eee2;color:var(--vs-ink)}
.view-menu{position:absolute;top:calc(100% + 8px);left:0;width:250px;padding:5px;display:flex;flex-direction:column;gap:3px;border:1px solid var(--vs-border);border-radius:10px;background:#f9fbf3;box-shadow:var(--vs-shadow);z-index:31;pointer-events:auto}
.view-item{display:grid;grid-template-columns:20px 1fr;align-items:center;column-gap:9px;row-gap:3px;min-height:55px;padding:8px 10px;text-align:left;border:0;border-radius:7px;background:transparent;color:var(--vs-ink);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.view-item svg{grid-row:1/3;width:18px;height:18px}.view-item small{grid-column:2;font-size:10px;font-weight:400;opacity:.8}.view-item:hover{background:var(--vs-hover)}.view-item.active{background:var(--vs-active);color:#fff}
.layer-seg{display:flex;gap:2px;padding:3px;border:1px solid var(--vs-border);border-radius:9px;background:var(--vs-surface);box-shadow:var(--vs-shadow);pointer-events:auto}
.layer-seg button{display:flex;align-items:center;gap:5px;min-height:32px;padding:0 9px;border:0;border-radius:6px;background:transparent;color:var(--vs-ink-2);font:inherit;font-size:12px;cursor:pointer}
.layer-seg button:hover{background:var(--vs-hover);color:var(--vs-ink)}.layer-seg button.active{background:var(--vs-active);color:#fff;font-weight:600}
.layer-panel{position:absolute;top:calc(100% + 8px);right:0;width:280px;max-height:min(480px,calc(100dvh - 220px));overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:14px;padding:12px;border:1px solid var(--vs-border);border-radius:12px;background:#f9fbf3;color:var(--vs-ink);box-shadow:var(--vs-shadow);font-size:12px;line-height:16px;pointer-events:auto;z-index:30}
.display-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.display-heading strong{font-size:13px}.display-heading button{width:28px;height:28px;border:0;border-radius:6px;background:var(--vs-hover);color:var(--vs-ink);font-size:19px;cursor:pointer}
.layer-group{display:flex;flex-direction:column;gap:3px}.layer-heading{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--vs-ink-2);margin-bottom:4px}.layer-group label{display:flex;align-items:center;gap:8px;min-height:28px;cursor:pointer}.layer-group input[type=checkbox]{accent-color:var(--vs-active);width:15px;height:15px;margin:0}
.layer-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:28px}.layer-select{font:inherit;padding:4px 6px;border:1px solid var(--vs-border);border-radius:6px;background:#fff;color:var(--vs-ink)}
.layer-mini-seg{display:flex;gap:2px;padding:2px;border-radius:7px;background:#e9eee2}.layer-mini-seg button{min-height:26px;border:0;border-radius:5px;background:transparent;color:var(--vs-ink-2);font-size:11px;padding:3px 7px;cursor:pointer}.layer-mini-seg button.active{background:#fff;color:var(--vs-active);font-weight:600;box-shadow:0 1px 2px #0002}
.layer-panel .class-legend{margin:0;padding:8px;border-color:#d6dccd;background:#e9eee2;color:var(--vs-ink)}
.room-view-summary{display:flex;flex-wrap:wrap;align-items:center;gap:5px 14px;margin-top:9px;color:#e8f2e9;font-size:11px;line-height:18px;text-shadow:0 1px 4px #000}.room-view-summary>span{background:#172b21c9;border-radius:5px;padding:2px 7px}.room-filter-summary{display:inline-flex;align-items:center;gap:7px}.room-filter-summary .layer-counts{font-size:11px;max-width:none;opacity:1}
#btn-show-all{padding:0;border:0;border-bottom:1px solid #a3caae;background:none;color:#c5ebcd;font:inherit;cursor:pointer;pointer-events:auto}
.room-activity-controls{margin-top:7px}.room-activity-controls:has(>button:not([hidden])){padding-bottom:2px}
.view-menu[hidden],.layer-panel[hidden],.layer-aerial[hidden],.layer-ceiling[hidden],.room-fill-toggle[hidden],#btn-show-all[hidden]{display:none!important}
.route-map-panel{top:calc(var(--room-controls-height,70px) + 28px);max-height:max(120px,calc(100% - var(--room-controls-height,70px) - 180px))}
.left-sidebar>.filter-group{flex-shrink:0}
@media(max-width:1100px){.room-toolbar{gap:6px}.view-fab,.layer-link{padding:0 9px}.layer-seg button{padding:0 7px}}
@media(max-width:650px){.view-fab,.layer-link{font-size:11px;min-height:36px;padding:0 8px}.aerial-tools{width:200px;font-size:11px;padding:8px 10px;gap:9px}.aerial-tools .view-icon{display:none}.layer-seg button{font-size:11px;min-height:28px;padding:0 6px}.room-toolbar .view-icon{display:none}.view-menu{width:220px}.layer-panel{position:fixed;top:110px;left:auto;right:12px;width:min(280px,calc(100vw - 24px));max-height:calc(100dvh - 240px)}.room-view-summary{font-size:10px;line-height:16px;gap:4px}.room-filter-summary .layer-counts{font-size:10px}}
