:root {
  color-scheme: dark;
  --bg:#1c221d; --surface:#2a3028; --text:#eceee3; --muted:#aab2a0;
  --line:#e0e6cd24; --blue:#b4c395; --green:#b4c395; --glass:#262e24e8;
  --shadow:0 4px 18px #0b100e26;
  font-size:13px;
}
body {background:var(--bg);overflow:hidden}
body > main {height:100dvh;min-height:0;position:relative}
.sidebar {display:none!important}
.workspace,.map-panel,.canvas-stage {width:100%;height:100%;min-height:0;background:var(--bg)}
.workspace {position:absolute;inset:0}
.topbar {position:absolute;inset:12px 14px auto;height:auto;min-height:36px;padding:0;border:0;background:none;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;pointer-events:none;z-index:12}
.topbar-identity,.top-actions {pointer-events:auto;gap:6px}
.topbar-identity {padding:0 4px 0 9px;background:var(--glass);border:1px solid var(--line);border-radius:10px;height:36px;box-shadow:var(--shadow)}
.product-brand {gap:7px;white-space:nowrap;font-size:13px}
.product-brand img {width:23px;height:23px;filter:grayscale(1) sepia(.5);border-radius:7px}
.breadcrumbs {display:block;padding:0 8px;margin-left:5px;border-left:1px solid var(--line);font-size:12px}
select,input {background:var(--surface);color:var(--text);border-color:var(--line)}
button {min-height:34px;padding:6px 10px;border-radius:8px;gap:6px;transition:background .12s,color .12s;box-shadow:none}
button:active {transform:scale(.97)}
button:hover {background:#dce7c414}
button:focus-visible,select:focus-visible {outline:2px solid #ccdfaa;outline-offset:2px}
.quiet,.primary,.scene-camera-tools,.scene-perspective,.map-controls,.view-switch,.floor-switch {background:var(--glass);color:var(--text);border:1px solid var(--line);box-shadow:var(--shadow);backdrop-filter:none}
.primary:hover,.quiet:hover {background:#3e4937}
.tool-button.active,.quiet.active,.map-controls button.active {background:#b4c395;color:#20291c;border-color:#b4c395}
.connection {display:flex;align-items:center;justify-self:end;min-width:0;max-width:100%;margin:0;border:0;background:var(--glass);min-height:34px;height:auto;padding:7px 11px;border-radius:8px;font-size:11px;line-height:1.4;color:var(--text);gap:7px;white-space:nowrap;pointer-events:auto}
.connection > span {min-width:0;overflow:hidden;text-overflow:ellipsis}
#room-visitors {flex:none;font-size:10px;line-height:1.4;color:var(--muted);border-left:1px solid var(--line);padding-left:7px}
.connection i {flex:none;background:#acbe88}
.connection.live {color:var(--text)}
.top-actions svg,#tools-toggle svg {width:16px;height:16px}
#tools-toggle {width:34px;padding:6px}
.map-heading {top:60px;left:auto;right:14px;gap:6px;pointer-events:none}
.map-heading > div:first-child {display:none}
.map-heading-tools {pointer-events:auto;gap:6px}
.view-switch,.floor-switch {border-radius:8px;padding:2px;gap:2px}
.view-switch button,.floor-switch button {min-height:28px;padding:3px 10px;color:var(--muted);font-size:11px;border-radius:6px}
.view-switch button.active,.floor-switch button.active {background:#afbe95;color:#20291c;box-shadow:none}
.scene-tools {top:103px;right:14px;left:auto;gap:6px;align-items:flex-end}
.scene-camera-tools,.scene-perspective {padding:2px;border-radius:8px;gap:2px;color:var(--text)}
.scene-tools button,.scene-tools select {min-height:27px;padding:3px 8px;font-size:11px;border:0;background:none;color:var(--text);box-shadow:none}
.scene-tools button.active {color:#d3e4b5;background:#ffffff12}
.scene-perspective label {display:none}
.scene-perspective select {max-width:145px}
.scene-tools option {background:#2a3028;color:var(--text)}
.map-controls {right:14px;bottom:52px;width:34px;padding:2px;border-radius:9px}
.map-controls button {min-height:30px;width:28px;padding:0;border-radius:6px;font-size:18px;color:var(--text)}
.map-controls > span {background:var(--line);margin:3px 2px}
.north {right:24px;top:210px;color:#cdd7bc;opacity:.6;text-shadow:0 1px 3px #000}
.map-badge {bottom:12px;top:auto;left:14px;background:none;padding:0;border:0;box-shadow:none;color:#c3ccb9;font-size:10px;text-shadow:0 1px 3px #111}
.map-badge.live {color:#c3ccb9}
.map-footer {position:absolute;left:14px;bottom:34px;padding:0;min-height:0;background:none;border:0;box-shadow:none;backdrop-filter:none;gap:12px;color:#b6bfad;font-size:10px;pointer-events:none;text-shadow:0 1px 3px #111}
.map-footer .map-help {font-size:10px;color:#a3ad98}
.map-coordinate {bottom:12px;right:60px;pointer-events:none;color:var(--muted)}
.map-coordinate span {background:none;box-shadow:none;padding:0}
.map-notice {top:65px;max-width:calc(100% - 180px);background:#303a2be8;border:1px solid var(--line);color:#d5dfc7;font-size:11px;box-shadow:none;padding:7px 12px}
.scene-loading {background:#1c221def;color:var(--text);font-size:13px}
.scene-label,.scene-label.selected {background:none!important;border:0!important;box-shadow:none!important;backdrop-filter:none;padding:0 2px;min-height:14px;line-height:15px;white-space:nowrap;max-width:none;overflow:visible;color:var(--marker-color);font-size:11px;font-weight:500;text-shadow:0 1px 2px #101710,0 -1px 2px #101710;pointer-events:none;contain:layout style}
.scene-label.selected {font-size:11px}
.scene-label:hover {transform:none}
.scene-labels {pointer-events:none}
.focus-toggle {position:absolute;right:14px;bottom:12px;width:34px;min-height:30px;padding:2px;background:var(--glass);color:var(--text);border:1px solid var(--line);z-index:15;font-size:23px;line-height:1}
body.focus-mode .topbar,body.focus-mode .map-heading,body.focus-mode .scene-tools,body.focus-mode .map-footer,body.focus-mode .map-badge,body.focus-mode .map-controls,body.focus-mode .map-coordinate,body.focus-mode .north {display:none}
.intel-panel {display:none;position:absolute;right:14px;top:60px;bottom:52px;width:270px;padding:16px;background:#252e23f5;border:1px solid var(--line);border-radius:12px;z-index:14;box-shadow:var(--shadow);backdrop-filter:none}
body.tools-open .intel-panel {display:flex}
.intel-heading h2 {font-size:14px;gap:6px;color:var(--text)}
#tools-close {margin-left:auto;padding:0;width:24px;min-height:24px;color:var(--muted);font-size:20px}
.metrics {margin:14px 0;padding-bottom:14px;border-color:var(--line)}
.metrics strong {font-size:24px;color:#e1ead4}
.section-line {border-color:var(--line)}
.section-line h3 {font-size:11px;color:#c2cfb2}
.section-line > span {color:#8e9b81;font-size:10px}
.layers label,.observer,.target-description small,.target-distance {color:var(--muted)}
.switch {background:#525c4a}.layers input:checked + .switch {background:#9bb47a}
.target-row {padding:9px 5px;border-color:var(--line);border-radius:6px}
.target-description strong {color:var(--text);font-size:12px}
.target-row.active {background:#b4c3951a;border-color:#b4c39555}
.target-row:hover {background:#ffffff09}
.target-glyph,.target-row.teammate .target-glyph {color:#adcaee}
.target-row.vehicle .target-glyph,.legend-dot.vehicle {color:#ed9874}
.legend-dot.vehicle {background:#ed9874}
.target-row.box .target-glyph {color:#549688}
.observer {border-color:var(--line);font-size:10px}
dialog {background:#283025;color:var(--text);border:1px solid var(--line);box-shadow:0 25px 90px #0007}
dialog::backdrop {background:#10180ec9;backdrop-filter:blur(8px)}
.entry-form,.entry-art {background:#263024}
.entry-form .primary {background:#b4c395;color:#20291c}
.entry-form .product-brand {color:var(--text)}
.entry-form .field input {background:#1d251c;border-color:var(--line);color:var(--text)}
.entry-form .field,.muted,.dialog-heading small {color:var(--muted)}
.entry-top,.entry-caption {color:#eef3e5}
.entry-map {filter:sepia(.25) saturate(.65)}
.toast,.tooltip {background:#303c29;color:#e8eedf;border-color:var(--line)}
.tooltip {background:none;border:0;box-shadow:none;backdrop-filter:none;text-shadow:0 1px 3px #101810;pointer-events:none}
.waiting-state {position:absolute;inset:0;display:grid;place-items:center;background:var(--bg);color:var(--muted);font-size:16px;letter-spacing:.08em}
body.waiting-for-data .topbar,body.waiting-for-data .workspace,body.waiting-for-data #toast {display:none}
@media(max-width:700px) {
 .topbar {inset:8px 8px auto;min-height:32px;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center}
 .topbar-identity {height:32px;padding-left:6px;gap:3px;justify-self:start;min-width:0;max-width:100%}
 .product-brand {font-size:11px;gap:4px}.product-brand strong{font-size:11px}.topbar .product-brand img{display:none}
 .breadcrumbs {margin-left:1px;padding:0 6px;font-size:11px;overflow:hidden;text-overflow:ellipsis}
 .top-actions {position:static;left:auto;right:auto;bottom:auto;grid-column:1/-1;justify-self:end;gap:4px;flex-wrap:nowrap}
 .top-actions button,.top-actions .tool-button {min-height:32px;padding:5px 7px}
 .top-actions #connect-open {margin-left:0}
 .top-actions .tool-button span {display:none}
 .connection {min-height:32px;padding:6px 8px;gap:5px;font-size:10px;max-width:48vw;text-align:left}
 #room-visitors {font-size:9px;padding-left:5px}.connection i{width:4px;height:4px}
 #tools-toggle {width:30px}
 .map-heading {top:86px;right:8px;left:auto}
 .scene-tools {top:125px;right:8px;gap:4px}
 .scene-tools button,.scene-tools select {min-height:25px;font-size:10px}
 .map-controls {right:8px;bottom:47px}
 .focus-toggle {right:8px;bottom:8px}
 .north {right:18px;top:218px}
 .map-footer {left:10px;bottom:29px;gap:10px}.map-help {display:none}
 .map-badge {left:10px;bottom:9px;font-size:9px}
 .intel-panel {top:86px;right:8px;bottom:47px;width:min(270px,calc(100vw - 16px))}
 .map-notice {top:125px;left:10px;transform:none;max-width:calc(100% - 135px);font-size:10px}
 .canvas-stage[data-view="3d"] .map-notice {bottom:55px;top:auto;transform:none}
 .scene-camera-tools,.scene-perspective {background:var(--glass)}
}
@media(prefers-reduced-motion:reduce) {button {transition:none}button:active{transform:none}}

#calibrate-open {min-height:32px;font-size:11px;padding:4px 10px;pointer-events:auto}


/* Keep the map under native gestures and put touch controls inside display cutouts. */
html, body {overscroll-behavior:none}
#map-canvas {user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
@media (pointer:coarse) {
 .topbar {top:max(12px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right))}
 .map-heading {right:max(8px,env(safe-area-inset-right))}
 .top-actions button,.top-actions .tool-button,#tools-toggle {min-width:44px;min-height:44px}
 .floor-switch button,#calibrate-open {min-height:44px}
 .map-controls {right:max(8px,env(safe-area-inset-right));bottom:calc(66px + env(safe-area-inset-bottom));width:48px}
 .map-controls button {width:44px;min-height:44px}
 .focus-toggle {right:max(8px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));width:48px;min-height:44px}
 .map-coordinate {right:72px;bottom:calc(12px + env(safe-area-inset-bottom))}
 #tools-close {width:44px;min-height:44px}
 .layers label,.target-row {min-height:44px}
 .field input,.field select,.field textarea {font-size:16px}
}
@media (max-width:700px) and (pointer:coarse) {
 .topbar {top:max(8px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right))}
 .topbar-identity,.connection {min-height:44px}
 .map-heading {top:calc(110px + env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right))}
 .north {top:calc(170px + env(safe-area-inset-top));right:24px}
 .map-footer {left:max(10px,env(safe-area-inset-left));bottom:calc(30px + env(safe-area-inset-bottom))}
 .map-badge {left:max(10px,env(safe-area-inset-left));bottom:calc(9px + env(safe-area-inset-bottom))}
 .intel-panel {top:calc(110px + env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));bottom:calc(66px + env(safe-area-inset-bottom));max-width:calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right))}
 .map-notice {top:calc(164px + env(safe-area-inset-top))}
}
