/* Teal HUD refinement. Existing scene, navigation, login and editor stay intact. */
#topbar,body[data-level="campus"] #topbar { background:linear-gradient(180deg,rgba(2,12,15,.98),rgba(3,15,18,.84)); border-bottom:1px solid rgba(78,204,184,.18); box-shadow:0 4px 28px #0003; }
.brand-mark,body[data-level="campus"] .brand-mark { border-color:#50dfc8; box-shadow:0 0 15px #48e6cf20; }
.lvl-tab.active,body[data-level="campus"] .lvl-tab.active { color:#adf9ec; border-color:#46cbb64d; background:linear-gradient(125deg,#28ac9633,#0a242a66); box-shadow:inset 0 -2px #54dfc8; }
#panel-left,body[data-level="campus"] #panel-left { width:300px; left:18px; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; scrollbar-color:#30615e transparent; pointer-events:auto; gap:14px; padding:0 0 10px; }
#panel-right,body[data-level="campus"] #panel-right { width:280px; right:18px; gap:16px; }
.panel,body[data-level="campus"] .panel,body[data-level="campus"] .tree-panel,body[data-level="campus"] #panel-right .panel,body[data-level="campus"] #panel-right .dashboard-panel,body:not([data-level="campus"]) #panel-right .panel,body:not([data-level="campus"]) #panel-left .panel { border:0; border-radius:3px; background:linear-gradient(100deg,rgba(3,17,23,.88),rgba(3,18,24,.59)); box-shadow:inset 0 1px rgba(95,203,186,.18); padding:13px; backdrop-filter:blur(6px); }
.panel h3,body[data-level="campus"] .panel h3,body[data-level="campus"] #panel-right .dashboard-panel h3 { font-size:13px; letter-spacing:1px; border-bottom:1px solid #5f9e982b; color:#d7eeeb; padding-bottom:10px; margin-bottom:12px; }
.panel h3::before,body[data-level="campus"] .panel h3::before { width:7px; height:7px; border-radius:1px; transform:rotate(45deg); background:#52dfc6; box-shadow:0 0 9px #52dfc640; margin-right:9px; }
.ctx-title,body[data-level="campus"] .ctx-title { font-size:19px; color:#e5f8f3; }
.ctx-sub,body[data-level="campus"] .ctx-sub { font-size:11px; color:#799f9f; }
.ctx-hint { display:none; }
.ctx-meta { gap:8px; }
body[data-level="campus"] .tree-panel { max-height:none; flex:none; }
.tree { max-height:220px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#326761 transparent; margin-top:12px; border-top:1px solid #4e9c8f26; padding-top:8px; }
.tree-item,body[data-level="campus"] .tree-item { border-radius:2px; min-height:32px; font-size:11px; }
.tree-item.active,body[data-level="campus"] .tree-item.active { color:#86efda; background:linear-gradient(90deg,#219d8729,transparent); border-color:#50c6b333; }
.tree-item .dot { background:#4c9f94; }
.campus-kpi b,body[data-level="campus"] .campus-kpi b,.stat b { color:#d3fff1; text-shadow:0 0 14px #39cfa32b; }
.health-gauge-value b { color:#b0fce2; }
.alarm-item,body[data-level="campus"] .alarm-item { border-radius:2px; background:linear-gradient(90deg,#17333250,transparent); }
.btn-editor,.btn-ai,body[data-level="campus"] .btn-editor,body[data-level="campus"] .btn-ai { border-radius:3px; border-color:#4aa19450; background:linear-gradient(120deg,#1437318c,#091d238c); }
#agent-presence { border-radius:4px; border-color:#4c9b902e; background:linear-gradient(120deg,#031920eb,#06181de3); box-shadow:0 8px 30px #0003,inset 0 1px #79e9ce26; }
#agent-presence header { border-color:#54beaa21; }
#agent-presence header strong { color:#d0fff2; font-size:13px; }
#agent-presence .agent-card { border-radius:2px; border:0; border-left:2px solid #456d67; background:#1c433a22; min-height:90px; }
#agent-presence .agent-card.active { border-left-color:#50e2bc; background:linear-gradient(90deg,#1f967429,#0e302b22); }
#agent-presence button { border-radius:3px; border-color:#4aa19466; background:#173831; }
.spatial-alarm { border-bottom:1px solid #4e9c8f26; padding-bottom:12px; }
.spatial-heading { display:flex; align-items:center; justify-content:space-between; gap:7px; margin-bottom:9px; }
.spatial-heading strong { font-size:12px; font-weight:600; color:#d6fbf4; letter-spacing:.7px; }
.spatial-heading>span { color:#638d95; border:1px solid #43897e4d; border-radius:3px; padding:1px 5px; font-size:9px; }
.spatial-context { display:grid; grid-template-columns:1fr 1fr; gap:5px; margin-bottom:6px; }
.spatial-alarm select { min-width:0; max-width:100%; font:10px/1.5 'Microsoft YaHei',sans-serif; color:#a1c6c7; background:#0a242a; border:1px solid #4e9c8f30; border-radius:3px; padding:5px 4px; }
.spatial-map-wrap { display:grid; grid-template-columns:27px minmax(0,1fr); gap:5px; }
.spatial-floors { align-self:center; max-height:170px; overflow-y:auto; scrollbar-width:none; border:1px solid #479b8d4a; border-radius:4px; }
.spatial-floors button { display:block; width:100%; min-height:26px; padding:4px 1px; background:#051a21; border:0; border-bottom:1px solid #5c9b9221; color:#7a9fa5; font:11px Consolas,monospace; cursor:pointer; }
.spatial-floors button[aria-pressed="true"] { color:#65ffdc; background:#14675850; box-shadow:inset 2px 0 #5df2d0; }
.spatial-floors button:disabled { color:#465e64; cursor:default; }
.spatial-map { position:relative; min-width:0; background:radial-gradient(ellipse at center,#134b4c2b,transparent 72%); }
.spatial-plan { width:100%; height:auto; display:block; overflow:hidden; }
.spatial-wall { fill:none; stroke:#7bd8e0; stroke-width:2; filter:drop-shadow(0 0 2px #299cbd); }
.spatial-window { fill:none; stroke:#30d9e7; stroke-width:3; }
.spatial-door { fill:none; stroke:#4dd8d4; stroke-width:1; }
.spatial-aisle { fill:none; stroke:#66aeb5; stroke-width:1; stroke-dasharray:3 4; opacity:.35; }
.spatial-room-label { fill:#8cbac6; font-size:9px; text-anchor:middle; letter-spacing:1px; }
.spatial-rack { cursor:pointer; outline:none; }
.rack-shadow { fill:#0008; }
.rack-body { fill:url(#spatial-rack); stroke:#3f7786; stroke-width:.8; }
.spatial-rack.normal .rack-body { fill:#123a59; stroke:#4caddb; }
.spatial-rack.normal .rack-led { stroke:#52c9ff; }
.rack-grill { fill:none; stroke:#67838e; stroke-width:.8; opacity:.6; }
.rack-led { fill:none; stroke:#4ce9d9; stroke-width:1.5; }
.rack-number { text-anchor:middle; fill:#6b9da7; font-size:7px; font-family:Consolas,monospace; }
.spatial-rack.critical .rack-body { fill:#8c431f; stroke:#ff9d45; }
.spatial-rack.warning .rack-body,.spatial-rack.offline .rack-body { stroke:#d1a15f; }
.spatial-rack.selected .rack-body { stroke:#ff9a38; stroke-width:1.8; filter:drop-shadow(0 0 4px #ff7b2480); }
.spatial-rack:focus-visible .rack-body,.spatial-rack:hover .rack-body { stroke:#adfff0; stroke-width:2; }
.spatial-beacon { fill:#ff9e32; stroke:#ffda9f; stroke-width:1; }
.spatial-pulse { fill:none; stroke:#ff9a38; stroke-width:1.4; transform-box:fill-box; transform-origin:center; animation:spatial-pulse 2.4s ease-out infinite; }
@keyframes spatial-pulse { 0%,100% { opacity:.2; transform:scale(.9); } 45% { opacity:.95; transform:scale(1.18); } }
.spatial-compass { fill:#80c5cd; text-anchor:middle; font:8px Consolas,monospace; }.spatial-north { fill:#5cd9de; }
.spatial-zoom { position:absolute; right:4px; bottom:6px; display:flex; border:1px solid #3f8f8155; border-radius:3px; overflow:hidden; }
.spatial-zoom button,.spatial-target button { background:#0b2e32; border:0; color:#79e8d0; cursor:pointer; font:11px 'Microsoft YaHei',sans-serif; padding:4px 7px; }
.spatial-zoom button:disabled,.spatial-target button:disabled { opacity:.4; cursor:default; }
.spatial-target { display:flex; gap:4px; align-items:stretch; margin-top:5px; }
.spatial-target select { flex:1; width:0; }.spatial-target button { border:1px solid #4ca99550; border-radius:3px; white-space:nowrap; padding:4px 5px; }
.spatial-alarm :focus-visible { outline:2px solid #83ffe2; outline-offset:2px; }
@media(max-width:1180px) { #panel-left,body[data-level="campus"] #panel-left { width:248px; left:12px; }#panel-right,body[data-level="campus"] #panel-right { width:238px; right:12px; }#agent-presence { width:calc(100vw - 554px); min-width:0; top:82px; bottom:auto; }.spatial-plan { min-height:178px; }.spatial-heading strong { font-size:11px; }#level-tabs .lvl-tab { min-width:0; padding:7px 9px; } }
@media(max-width:760px) { #panel-left,body[data-level="campus"] #panel-left { width:220px; left:10px; top:128px; max-height:calc(100dvh - 190px); }#panel-right,body[data-level="campus"] #panel-right { width:210px; right:10px; top:128px; }#agent-presence { top:76px; left:50%; width:calc(100vw - 28px); max-width:480px; }#agent-presence .agent-presence-body { max-height:280px; }#topbar,body[data-level="campus"] #topbar { flex-wrap:wrap; height:auto; min-height:68px; padding-bottom:6px; }.topbar-right { gap:5px; }.clock-box { display:none; } }
@media(prefers-reduced-motion:reduce) { .spatial-pulse { animation:none; } }
/* Dark liquid-glass treatment: retain the app's original --bg and cyan palette. */
.panel,body[data-level="campus"] .panel,body[data-level="campus"] .tree-panel,body[data-level="campus"] #panel-right .panel,body[data-level="campus"] #panel-right .dashboard-panel,body:not([data-level="campus"]) #panel-right .panel,body:not([data-level="campus"]) #panel-left .panel {
 border:1px solid rgba(118,185,207,.15); border-radius:10px;
 background:linear-gradient(135deg,rgba(10,31,44,.66),rgba(3,15,25,.54) 52%,rgba(8,25,37,.65));
 box-shadow:inset 0 1px 0 rgba(201,239,247,.14),inset 1px 0 rgba(154,211,228,.035),inset 0 -1px rgba(8,14,22,.65),0 10px 32px rgba(0,5,12,.2);
 backdrop-filter:blur(12px) saturate(1.08); -webkit-backdrop-filter:blur(12px) saturate(1.08);
}
.liquid-surface { -webkit-backdrop-filter:blur(12px) saturate(1.12);backdrop-filter:blur(12px) saturate(1.12); }
#topbar.liquid-surface,body[data-level="campus"] #topbar.liquid-surface { background:linear-gradient(110deg,rgba(9,24,37,.78),rgba(3,13,23,.66) 60%,rgba(13,31,44,.72)); box-shadow:inset 0 1px rgba(210,245,255,.13),0 6px 30px #0003; border-bottom-color:rgba(136,211,231,.16); }
#bottom-bar.liquid-surface { background:linear-gradient(120deg,rgba(16,40,53,.68),rgba(4,17,29,.57)); border:1px solid rgba(168,223,235,.18); box-shadow:inset 0 1px rgba(221,252,255,.16),0 10px 30px #0003; border-radius:10px; padding:9px 13px; }
#info-card.liquid-surface { background:linear-gradient(135deg,rgba(18,44,61,.82),rgba(6,20,35,.84)); border:1px solid rgba(145,213,233,.25);box-shadow:inset 0 1px rgba(218,247,255,.18),0 20px 55px #0005; }
#agent-presence.liquid-surface { border-radius:10px; border-color:rgba(144,219,227,.2); background:linear-gradient(130deg,rgba(13,37,49,.76),rgba(4,19,31,.7)); box-shadow:inset 0 1px rgba(212,249,255,.17),inset 1px 0 rgba(170,230,242,.04),0 12px 35px #0003; }
#agent-presence .agent-card { border-radius:5px; background:rgba(93,164,188,.035); }
#agent-presence .agent-card.active { border-left-color:var(--cyan);background:linear-gradient(100deg,rgba(43,171,181,.14),rgba(23,71,91,.035)); }
.spatial-map { background:radial-gradient(ellipse at center,rgba(31,111,139,.14),rgba(2,13,23,.18) 75%); border:1px solid rgba(101,179,206,.1); border-radius:6px;box-shadow:inset 0 1px rgba(177,229,244,.035); }
.spatial-zoom button,.spatial-target button { background:linear-gradient(130deg,rgba(24,78,93,.8),rgba(10,37,54,.8));color:#8ce7e4; }
.spatial-target select,.spatial-context select { background:rgba(8,29,43,.66); color:#a4c4d0; }
.btn-editor:hover,.btn-ai:hover,.spatial-target button:hover:not(:disabled) { transform:translateY(-1px); box-shadow:inset 0 1px rgba(211,247,255,.15),0 4px 16px rgba(28,173,190,.12); }
@supports not (backdrop-filter:blur(1px)) { .panel,body[data-level="campus"] .panel,#agent-presence.liquid-surface,#topbar.liquid-surface { background:rgba(5,20,33,.94); } }

.spatial-callout{pointer-events:none}.spatial-callout path{fill:none;stroke:#ff9a38;stroke-width:1}.spatial-callout rect{fill:#17242ee8;stroke:#ff9a38;stroke-width:1}.spatial-callout text{fill:#ffb15a;font:8px Consolas,monospace;text-anchor:middle}
@media(min-width:1200px){body[data-level="cabinet"] #info-card{left:336px}}

body.twin-ui-ready #loader { inset:auto;left:50%;bottom:76px;transform:translateX(-50%);width:auto;max-width:400px;height:auto;z-index:8;flex-direction:row;gap:9px;padding:8px 14px;border:1px solid rgba(105,176,199,.15);border-radius:6px;background:rgba(5,19,30,.82);pointer-events:none;backdrop-filter:blur(7px); }
body.twin-ui-ready #loader .loader-ring{width:15px;height:15px;border-width:2px;flex-shrink:0}body.twin-ui-ready #loader p{font-size:10px;letter-spacing:1px;margin:0}body.twin-ui-ready:not([data-level="campus"]) #loader{display:none}

#panel-left>.panel{flex-shrink:0}.tree-panel{flex:none;overflow:visible;min-height:auto}

#agent-presence{width:min(640px,calc(100vw - 690px));min-width:0}#agent-presence .agent-card{min-height:70px;padding:8px;gap:5px}#agent-presence .agent-cards{padding:8px;gap:7px}#agent-presence header{padding:9px 12px}#agent-presence footer{padding:4px 12px 7px}#agent-presence .agent-human-line{margin-bottom:7px}#agent-presence .agent-activity{padding:6px 12px}
@media(max-width:1180px){#agent-presence{width:calc(100vw - 554px)}}@media(max-width:760px){#agent-presence{width:calc(100vw - 28px)}}

/* Restore the approved gradient open-ring gauge at every navigation level. */
body:not([data-level="campus"]) .health-gauge{position:relative;width:108px;height:108px;flex:none}
body:not([data-level="campus"]) #health-gauge-canvas{display:block;width:108px;height:108px}
body:not([data-level="campus"]) .health-gauge-value{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}
body:not([data-level="campus"]) .health-gauge-value b{color:#dffbf5;font:600 19px/1 var(--mono);letter-spacing:-.5px}
body:not([data-level="campus"]) .health-gauge-value span{margin-top:6px;color:#90a9bb;font-size:10px;letter-spacing:.7px}
@media(max-width:1180px){body:not([data-level="campus"]) .health-gauge,body:not([data-level="campus"]) #health-gauge-canvas{width:92px;height:92px}}

/* Agent workspace: transparent glass shell, distinct task surfaces, restrained detail. */
#agent-presence.liquid-surface,#agent-presence{border:1px solid rgba(164,216,232,.2);border-radius:12px;background:linear-gradient(135deg,rgba(13,34,49,.52),rgba(4,17,29,.31) 65%,rgba(14,35,48,.42));box-shadow:inset 0 1px rgba(221,249,255,.14),inset 1px 0 rgba(188,233,246,.04),0 16px 48px rgba(0,4,13,.28)}
#agent-presence header{padding:10px 13px;border-bottom:1px solid rgba(166,218,233,.1);background:linear-gradient(110deg,rgba(18,43,59,.48),rgba(8,24,38,.2));border-radius:12px 12px 0 0}
#agent-presence header>div{gap:8px}#agent-presence header strong{font-size:13px;font-weight:600;letter-spacing:.4px;color:#e9f5fb;text-shadow:0 1px 4px #0003}#agent-presence header small{font-size:9px;letter-spacing:.3px;color:#7694a6;border:1px solid rgba(140,185,204,.12);border-radius:4px;padding:1px 5px;background:rgba(3,14,25,.2)}
#agent-presence button[data-agent-action="fold"]{display:grid;place-items:center;width:28px;height:28px;padding:0;flex-shrink:0;border:0;border-radius:5px;background:transparent;color:#94afbf;box-shadow:none}
#agent-presence button[data-agent-action="fold"]:hover{background:rgba(137,194,214,.08);color:#d6f8ff}#agent-presence button[data-agent-action="fold"] svg{transition:transform .2s ease}#agent-presence button[data-agent-action="fold"][aria-expanded="false"] svg{transform:rotate(180deg)}
#agent-presence .agent-presence-body{background:linear-gradient(180deg,rgba(3,15,27,.06),rgba(3,14,25,.2));border-radius:0 0 12px 12px}
#agent-presence .agent-cards{gap:8px;padding:12px 12px 10px}
#agent-presence .agent-card{position:relative;padding:11px 10px 10px;gap:11px;min-height:112px;border:1px solid rgba(133,186,209,.12);border-top-color:rgba(171,217,235,.21);border-radius:7px;background:linear-gradient(145deg,rgba(9,26,41,.82),rgba(6,20,33,.67));box-shadow:inset 0 1px rgba(203,239,255,.035),0 3px 9px #0002}
#agent-presence .agent-card:hover{border-color:rgba(104,210,213,.36);background:linear-gradient(145deg,rgba(13,38,54,.88),rgba(8,27,40,.74))}
#agent-presence .agent-card.active{border-color:rgba(89,206,203,.25);border-top-color:rgba(113,235,218,.65);background:linear-gradient(145deg,rgba(14,51,61,.86),rgba(7,29,42,.76));box-shadow:inset 0 1px rgba(143,255,233,.09),0 0 18px rgba(28,149,158,.045)}
#agent-presence .agent-card-name{display:block}#agent-presence .agent-card-name b{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:600;color:#e6f4fa;line-height:1.4;white-space:nowrap;letter-spacing:.2px}
#agent-presence .agent-step{font:10px/1 Consolas,monospace;letter-spacing:.3px;color:#597a8d;font-weight:400}
#agent-presence .agent-card-name em{display:flex;align-items:center;gap:5px;margin:7px 0 0 19px;font-size:9px;font-weight:400;color:#7897a6;letter-spacing:.2px;line-height:1}
#agent-presence .agent-card-name em:before{content:'';width:3px;height:3px;flex-shrink:0;border-radius:50%;background:#69818e}
#agent-presence .agent-card.active .agent-card-name em{color:#79d7ce}#agent-presence .agent-card.active .agent-card-name em:before{background:var(--cyan);box-shadow:0 0 5px #52d4c050}
#agent-presence .agent-card .agent-card-detail{display:block;font-size:10px;font-weight:400;line-height:1.85;color:#8aa8ba;letter-spacing:.1px}
#agent-presence .agent-metric-number{font:500 17px/1.2 Consolas,monospace;color:#e2f3fb;letter-spacing:-.4px;margin:0 2px}
#agent-presence .agent-card.active .agent-metric-number{color:#b7f5eb}
#agent-presence .agent-human-line{margin:0 12px 11px;padding:8px 9px;gap:8px;border-radius:6px;border:1px solid transparent;background:rgba(7,20,32,.18);color:#7998a8;font-size:10px}
#agent-presence .agent-human-line[data-needed="true"]{color:#c4ae80;background:linear-gradient(100deg,rgba(109,77,26,.18),rgba(30,27,22,.12));border-color:rgba(192,147,68,.12)}
#agent-presence .agent-human-line b{font:600 17px/1 Consolas,monospace;color:#ffe0a2;margin:0 3px}
#agent-presence .agent-human-line button{padding:5px 8px;border-radius:4px;font-size:10px;font-weight:500;color:#d4bf90;border:1px solid rgba(208,164,87,.31);background:linear-gradient(120deg,rgba(94,73,34,.26),rgba(41,37,28,.18));box-shadow:inset 0 1px rgba(255,225,170,.04)}
#agent-presence .agent-human-line button:hover:not(:disabled){border-color:rgba(224,186,121,.58);background:rgba(116,87,38,.22)}
#agent-presence .agent-activity{padding:8px 13px;border-top:1px solid rgba(154,197,217,.075);background:rgba(4,15,26,.1)}
#agent-presence .agent-activity summary{font-size:10px;color:#7e9aaa;line-height:1.6}
#agent-presence .agent-activity li button{background:rgba(4,19,32,.62);border:1px solid rgba(134,189,214,.08);border-radius:5px;padding:8px;margin-bottom:6px}
#agent-presence .agent-activity li b{color:#acc4d2;font-size:10px;font-weight:500}#agent-presence .agent-activity li span{color:#7292a4;font-size:10px}
#agent-presence footer{font-size:9px;color:#526f82;padding:6px 13px 10px;letter-spacing:.3px}
#agent-presence footer button{border:0;padding:3px 0;background:transparent;color:#6d96a6;font-size:9px;box-shadow:none}#agent-presence footer button:hover{color:#a3dedc;border:0;background:transparent}
@media(max-width:1180px){#agent-presence .agent-card{padding:10px 8px;gap:9px;min-height:120px}#agent-presence .agent-cards{gap:6px;padding:10px}#agent-presence .agent-card-name b{font-size:11px;gap:5px}#agent-presence .agent-step{font-size:9px}#agent-presence .agent-card-name em{margin-left:16px}#agent-presence .agent-metric-number{font-size:16px}#agent-presence .agent-card .agent-card-detail{font-size:10px}#agent-presence .agent-human-line{margin:0 10px 10px;padding:8px 7px;gap:5px;font-size:10px}#agent-presence .agent-human-line button{font-size:9px;padding:5px 6px}}
@media(prefers-reduced-motion:reduce){#agent-presence button[data-agent-action="fold"] svg{transition:none}}

#agent-presence .agent-activity{background:rgba(4,15,26,.3)}#agent-presence .agent-activity summary{color:#93acbb}#agent-presence footer{color:#829dad;background:linear-gradient(180deg,rgba(4,15,26,.12),rgba(4,15,26,.3));border-radius:0 0 12px 12px}

/* Promote the active alarm selector; use an icon-only location action. */
.spatial-target{gap:6px;margin-top:9px;align-items:stretch}
.spatial-target select[data-spatial-alert]{height:36px;padding:7px 9px;color:#e3f2fa;font-size:12px;font-weight:500;line-height:1.5;border:1px solid rgba(116,191,213,.43);border-top-color:rgba(177,226,240,.5);border-radius:7px;background:linear-gradient(135deg,rgba(33,77,98,.86),rgba(12,41,60,.88));box-shadow:inset 0 1px rgba(218,246,255,.08),0 4px 13px rgba(0,7,17,.2);color-scheme:dark;cursor:pointer}
.spatial-target select[data-spatial-alert]:hover{border-color:rgba(133,221,231,.64);background:linear-gradient(135deg,rgba(40,91,109,.91),rgba(15,49,67,.94))}
.spatial-target select[data-spatial-alert]:focus-visible{border-color:#76e3dc;outline:2px solid rgba(91,213,207,.24);outline-offset:2px}
.spatial-target select[data-spatial-alert] option{background:#102a3b;color:#d9edf5;font-size:12px}
.spatial-target button[data-spatial-locate]{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;padding:0;border-radius:7px;color:#a2f3e8;border:1px solid rgba(104,207,201,.45);border-top-color:rgba(173,242,228,.55);background:linear-gradient(135deg,rgba(34,114,124,.55),rgba(18,62,82,.78));box-shadow:inset 0 1px rgba(214,253,247,.09),0 4px 13px rgba(0,7,17,.17)}
.spatial-target button[data-spatial-locate]:hover:not(:disabled){color:#dcfff7;border-color:rgba(140,240,221,.72);background:linear-gradient(135deg,rgba(42,133,138,.66),rgba(24,81,98,.85));transform:none}
.spatial-target button[data-spatial-locate] svg{display:block}.spatial-target select[data-spatial-alert]:disabled{opacity:.45;cursor:default}
/* Reference-based Agent split flow; scoped to the existing presence dock. */
#agent-presence{width:min(660px,calc(100vw - 32px));min-width:0;border-radius:9px;border-color:rgba(51,190,189,.3);background:linear-gradient(120deg,rgba(3,28,37,.88),rgba(4,20,29,.83));box-shadow:inset 0 1px rgba(120,242,230,.11),0 12px 42px #0006}
#agent-presence header{padding:5px 12px;border-bottom:0;background:transparent;border-radius:9px 9px 0 0}#agent-presence header strong{font-size:12px}#agent-presence header small{font-size:8px}#agent-presence header .agent-live-dot{background:#32d9cb;box-shadow:0 0 8px #22cebc55;border-radius:1px;transform:rotate(45deg);width:6px;height:6px}#agent-presence button[data-agent-action="fold"]{width:23px;height:23px}
#agent-presence .agent-presence-body{max-height:min(380px,calc(100dvh - 180px));background:transparent}
#agent-presence .agent-flow{display:grid;grid-template-columns:minmax(0,1.18fr)30px minmax(0,1.2fr)22px minmax(0,.95fr);grid-template-rows:38px 38px;gap:8px 0;padding:2px 12px 5px;align-items:stretch}
#agent-presence .agent-flow button{min-width:0;border:1px solid rgba(52,159,165,.2);border-radius:5px;background:linear-gradient(130deg,rgba(4,41,49,.72),rgba(4,25,33,.86));box-shadow:inset 0 1px rgba(62,204,194,.04);text-align:left;padding:6px 8px;display:flex;align-items:center;gap:8px;color:#d7eeef;line-height:1.3}
#agent-presence .agent-flow button:hover:not(:disabled){border-color:#36d6c488;background:rgba(8,53,59,.88)}#agent-presence .agent-flow button:disabled{opacity:.64}#agent-presence .agent-flow button:focus-visible{outline:2px solid #66dfd0;outline-offset:2px}
#agent-presence .flow-icon{display:inline-block;flex:0 0 auto;width:20px;height:20px;background:currentColor;mask:var(--flow-icon) center/contain no-repeat;-webkit-mask:var(--flow-icon) center/contain no-repeat;color:#1dd6d2}
.flow-icon-file-text{--flow-icon:url('/vendor/tabler-icons/file-text.svg')}.flow-icon-settings{--flow-icon:url('/vendor/tabler-icons/settings.svg')}.flow-icon-user{--flow-icon:url('/vendor/tabler-icons/user.svg')}.flow-icon-circle-check{--flow-icon:url('/vendor/tabler-icons/circle-check.svg')}.flow-icon-arrow-right{--flow-icon:url('/vendor/tabler-icons/arrow-right.svg')}
#agent-presence .flow-analysis{grid-column:1;grid-row:1/3;gap:9px!important;border-color:rgba(24,190,192,.29)!important}#agent-presence .flow-analysis>.flow-icon{width:30px;height:30px}#agent-presence .flow-analysis-copy{display:flex;flex-direction:column;gap:3px;min-width:0}#agent-presence .agent-flow strong{font-size:10px;letter-spacing:.2px;font-weight:600;color:#d2eaed}#agent-presence .agent-flow small{font-size:9px;color:#759ca7;white-space:nowrap;font-weight:400}
#agent-presence .flow-analysis-metrics{display:flex;align-items:baseline;gap:4px;white-space:nowrap}#agent-presence .flow-analysis-metrics b{font:600 21px/1.2 Consolas,'Microsoft YaHei',sans-serif;color:#edfaff;letter-spacing:-.5px}#agent-presence .flow-analysis-metrics .flow-icon{width:15px;height:15px;align-self:center;margin:0 1px}#agent-presence .flow-analysis-copy>small{font-size:8px}
#agent-presence .agent-flow-split{grid-column:2;grid-row:1/3;width:100%;height:100%;overflow:visible}#agent-presence .flow-automatic{grid-column:3;grid-row:1}#agent-presence .flow-human{grid-column:3;grid-row:2;border-color:rgba(164,116,32,.26)!important;background:linear-gradient(125deg,rgba(47,37,14,.32),rgba(18,26,25,.75))!important}#agent-presence .flow-lane>span:not(.flow-icon){display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}#agent-presence .flow-lane small{font-size:8px;overflow:hidden;text-overflow:ellipsis}#agent-presence .flow-lane>b{font:600 22px/1 Consolas,monospace;color:#26ddd5}#agent-presence .flow-human .flow-icon,#agent-presence .flow-human strong,#agent-presence .flow-human>b{color:#e0b24c}
#agent-presence .agent-flow-next{grid-column:4;grid-row:1/3;width:100%;height:100%;overflow:visible}#agent-presence .flow-track{fill:none;stroke:#219f9b;stroke-width:1.4;stroke-linejoin:round;stroke-linecap:round}#agent-presence .flow-track-human{stroke:#98762d}#agent-presence .flow-stream{fill:none;stroke:#7affea;stroke-width:2;stroke-linecap:round;stroke-dasharray:3 19;opacity:0}#agent-presence .flow-stream-human{stroke:#ffe19a}
#agent-presence .agent-flow[data-running="true"] .agent-flow-split .flow-stream:not(.flow-stream-human),#agent-presence .agent-flow[data-auto-running="true"] .agent-flow-next .flow-stream,#agent-presence .agent-flow[data-human-running="true"] .flow-stream-human{opacity:.9;animation:agent-route-flow 1.8s linear infinite}#agent-presence .flow-stream-human{animation-delay:.45s}
#agent-presence .flow-verification{grid-column:5;grid-row:1;gap:6px!important}#agent-presence .flow-verification>span:last-child{display:flex;flex-direction:column;gap:3px;min-width:0}#agent-presence .flow-verification small{font-size:8px;overflow:hidden;text-overflow:ellipsis}#agent-presence .flow-human-cta{grid-column:5;grid-row:2;align-self:center;justify-content:center;gap:4px!important;padding:5px 6px!important;color:#e4b64e!important;border-color:#8f6924!important;background:linear-gradient(100deg,#58431970,#29281580)!important;font-size:10px;box-shadow:inset 0 0 10px #e6ad1710!important}#agent-presence .flow-human-cta .flow-icon{width:14px;height:14px;color:#deb95c}
#agent-presence .agent-flow-summary{display:none}#agent-presence .agent-activity{border:0;padding:3px 13px 7px;background:transparent}#agent-presence .agent-activity summary{font-size:10px;color:#94b5c0}#agent-presence .agent-activity summary b{color:#d1efeb;font-weight:600}#agent-presence .agent-activity:not([open])~footer{display:none}#agent-presence .agent-activity[open]{border-top:1px solid #68c6cb12}#agent-presence footer{border-radius:0 0 9px 9px}
@keyframes agent-route-flow{to{stroke-dashoffset:-44}}
@media(min-width:1181px){#agent-presence{width:min(660px,calc(100vw - 670px));min-width:430px}}
@media(max-width:760px){#agent-presence{width:min(660px,calc(100vw - 28px));max-width:none;top:76px}}
@media(max-width:580px){#agent-presence .agent-flow{grid-template-columns:minmax(0,1fr)20px minmax(0,1.1fr);grid-template-rows:40px 40px 38px;gap:6px 0}#agent-presence .flow-analysis{grid-column:1;grid-row:1/3;padding:7px!important;gap:5px!important}#agent-presence .flow-analysis>.flow-icon{width:22px;height:22px}#agent-presence .flow-analysis-metrics{gap:3px;flex-wrap:wrap}#agent-presence .flow-analysis-metrics b{font-size:18px}#agent-presence .flow-analysis-copy>small{white-space:normal;font-size:8px}#agent-presence .flow-automatic,#agent-presence .flow-human{grid-column:3}#agent-presence .flow-verification{grid-column:1;grid-row:3}#agent-presence .flow-human-cta{grid-column:3;grid-row:3}#agent-presence .agent-flow-next{display:none}#agent-presence .flow-lane>b{font-size:21px}#agent-presence .flow-lane .flow-icon{width:17px;height:17px}#agent-presence .agent-flow button{gap:5px;padding:5px 6px}#agent-presence .flow-lane small{font-size:7px}#agent-presence .agent-flow strong{font-size:10px}}
@media(prefers-reduced-motion:reduce){#agent-presence .flow-stream{animation:none!important;opacity:0!important}}
#agent-presence .flow-icon-badge{display:grid;place-items:center;flex-shrink:0;width:36px;height:36px;border:1px solid #20b7be38;border-radius:50%;background:radial-gradient(circle at 40% 30%,#0d5b6540,#052e3820);box-shadow:inset 0 0 10px #20b7be0c}#agent-presence .flow-icon-badge .flow-icon{width:23px;height:23px}#agent-presence .agent-activity summary{list-style:none;display:flex;align-items:center;gap:4px}#agent-presence .agent-activity summary::-webkit-details-marker{display:none}#agent-presence .agent-activity summary:before{content:'';display:inline-block;flex-shrink:0;width:5px;height:5px;margin-right:3px;border-radius:50%;background:#2cd9ce;box-shadow:0 0 5px #27c9c94d}@media(max-width:580px){#agent-presence .flow-icon-badge{width:25px;height:25px}#agent-presence .flow-icon-badge .flow-icon{width:18px;height:18px}#agent-presence .agent-activity summary{font-size:9px;gap:2px}}

/* One-time sequential metric presentation; no business-state changes. */
#agent-presence .agent-flow{position:relative}#agent-presence .flow-count-presentation{position:absolute;z-index:2;display:block;pointer-events:none;text-align:left;white-space:nowrap}#agent-presence .flow-route-presentation{pointer-events:none}

/* Remove the side-panel collapse handles. */
#toggle-panel-left,#toggle-panel-right{display:none!important}
