/* Movable workspace overlays share the scene's coordinate system. */
#scene-readout[data-minimized=true]{display:none!important}
#readout-restore{position:absolute;right:3%;top:22px;z-index:17;background:#16323beF;border:1px solid #557d85;color:#d9eeeb;border-radius:9px;padding:10px 15px;font-size:14px;min-height:44px}
body[data-atlas=true] .monitoring-ui,body:not([data-near=true]) .monitoring-ui{display:none!important}
#viewport [data-moved=true]{position:absolute!important;left:var(--panel-x)!important;top:var(--panel-y)!important;right:auto!important;bottom:auto!important;transform:none!important;margin:0!important}
#viewport .panel-dragging{z-index:29!important;box-shadow:0 14px 40px #0008;user-select:none}
#viewport .panel-grip{touch-action:none;cursor:grab;flex:0 0 28px;min-width:28px;min-height:32px;width:28px!important;padding:0!important;margin:0!important;font-size:23px!important;line-height:1;background:transparent;border:0;color:#9bbec3;border-radius:5px;align-self:center}
#viewport .panel-grip:active{cursor:grabbing}#viewport .panel-grip:focus-visible{outline:2px solid #a0eadb;outline-offset:1px}
#scene-readout .panel-head{gap:3px}#scene-readout #readout-toggle{flex:1;min-width:0;font-size:13px}#scene-readout #readout-toggle span{font-size:13px}#readout-minimize,#readout-size{flex:0 0 28px}
#scene-replay .replay-head>.panel-grip{flex:0 0 24px;min-width:24px}
#alert-dock{position:absolute;left:3%;bottom:24px;z-index:16}
#alert-toggle{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-height:44px;max-width:230px;padding:10px 13px;color:#e5f1ee;background:#102830ed;border:1px solid var(--alert-color,#547d80);border-radius:10px;font-size:14px}
#alert-toggle i{width:9px;height:9px;flex:none;background:var(--alert-color,#2f8f8a);border-radius:50%;box-shadow:0 0 12px var(--alert-color,#2f8f8a)}#alert-toggle b{font-size:15px}#alert-toggle small{font-size:12px;color:var(--alert-color,#b5cacc)}
#alert-panel{position:absolute;left:3%;bottom:82px;width:330px;max-width:calc(100% - 24px);max-height:calc(100% - 180px);overflow:auto;overscroll-behavior:contain;z-index:18;background:#102830f5;border:1px solid #496c74;border-radius:12px;padding:12px;box-shadow:0 12px 34px #0005;color:#d9e8e8;scrollbar-width:thin}
#alert-panel .panel-head{position:sticky;top:-12px;z-index:2;display:flex;align-items:center;gap:8px;background:#102830;padding:7px 0}#alert-panel .panel-head strong{font-size:17px;flex:1}#alert-close{width:36px;height:36px;background:transparent;color:#cde6e5;border:0;font-size:24px}
.alert-context{font-size:11px;letter-spacing:1px;margin:8px 0 4px;color:#9ebdc2}#alert-time{font-size:13px;color:#daece8}.alert-caption{font-size:12px;line-height:1.6;color:#9ebdc2;margin:9px 0 12px}#alert-empty{font-size:14px}
#alert-list{display:grid;gap:8px}.alert-row{display:grid;gap:6px;text-align:left;width:100%;padding:12px;background:#19363e;border:1px solid #335660;border-left:3px solid var(--alert-color);border-radius:7px;color:#dbece9}.alert-row strong{font-size:14px;color:var(--alert-color)}.alert-row span{font-size:13px}.alert-row small{font-size:12px;color:#b9d1d0;line-height:1.5}
#alert-toast{position:absolute;left:3%;bottom:82px;width:300px;max-width:calc(100% - 24px);z-index:17;background:#102830f2;border:1px solid var(--alert-color,#547d80);border-radius:10px;padding:12px 40px 10px 12px;color:#e2f0ec;box-shadow:0 10px 30px #0005}
#alert-toast-text{font-size:13px;line-height:1.6}#alert-toast-open{font-size:13px;margin-top:8px;padding:6px 10px;min-height:36px;background:#204750;color:#ddf3ee;border:1px solid #577e85;border-radius:5px}#alert-toast-close{position:absolute;right:4px;top:4px;width:32px;height:32px;background:transparent;color:#dcefea;border:0;font-size:23px}
@media(max-width:700px),(pointer:coarse) and (max-width:1100px),(max-height:520px) and (max-width:1100px){
 #readout-restore{top:113px;right:12px}#scene-readout{width:246px}#scene-readout .panel-head{gap:1px}#scene-readout #readout-toggle{font-size:12px}#scene-readout #readout-toggle span{font-size:11px}
 #viewport .panel-grip{min-height:44px}#panels-reset{min-width:36px}#bridge-toolbar{gap:3px}
 #alert-dock{left:12px;bottom:218px}#alert-toggle{padding:7px 10px;max-width:180px;font-size:13px}
 #alert-panel{left:12px;top:113px;bottom:auto;width:300px;max-height:calc(100% - 275px)}#alert-toast{left:12px;bottom:270px;width:275px}
 #scene-replay .replay-head{position:relative;padding-left:26px}#scene-replay .replay-head>.panel-grip{position:absolute;left:0;top:0;width:22px!important;min-width:22px}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 #scene-readout{top:62px;width:246px;max-height:calc(100% - 143px)}#readout-restore{top:62px}#alert-dock{bottom:138px}#alert-panel{top:62px;max-height:calc(100% - 143px)}#alert-toast{bottom:190px;width:300px}
 #scene-replay{grid-template-columns:396px 1fr}
}
@media(max-width:700px) and (orientation:portrait){
 #scene-replay .replay-head>div{padding-left:0}#scene-replay .replay-head>.panel-grip{grid-column:auto;display:block}
}
@media(max-width:700px),(pointer:coarse) and (max-width:1100px),(max-height:520px) and (max-width:1100px){
 body[data-near=true] .view-tools{bottom:calc(var(--replay-height,140px) + 20px)}
 #alert-dock{bottom:calc(var(--replay-height,140px) + 76px)}
 #alert-toast{bottom:calc(var(--replay-height,140px) + 128px)}
}

/* Readable workspace panels reserve the actual replay height, including translated text. */
#lang-toggle{font:inherit;font-size:14px;color:#d9eeeb;background:#102830;border:1px solid #496c74;border-radius:8px;padding:9px 12px;max-width:150px;min-height:40px}
#scene-readout .panel-head{position:sticky;top:0;background:#102830;z-index:3}
#viewport{direction:ltr}
html[dir=rtl] #atlas-story,html[dir=rtl] #story-caption,html[dir=rtl] #story-panel,html[dir=rtl] #scene-readout,html[dir=rtl] #bridge-tools,html[dir=rtl] #alert-panel,html[dir=rtl] #gesture-help{direction:rtl;text-align:right}
html[dir=rtl] .alert-row{text-align:right}html[dir=rtl] .eyebrow{letter-spacing:0}
#mini-position,.mini-readings b,.reading-grid b,#hud-frequency,#hud-quasi,#hud-time,#scene-time-label,.quasi-legend,#band-legend ol,.charts svg,#bridge-structure{direction:ltr;unicode-bidi:isolate}
@media(max-width:700px),(pointer:coarse) and (max-width:1100px),(max-height:600px) and (max-width:1100px){
 header{gap:8px;flex-wrap:wrap;height:auto;min-height:72px}header .brand small{display:none}header .brand{font-size:23px}header .dashboard-link,header #sources{font-size:12px;padding:5px}#lang-toggle{font-size:13px;max-width:115px;padding:7px}
 #bridge-toolbar{overflow-x:auto;white-space:nowrap;flex-wrap:nowrap;scrollbar-width:thin;max-width:calc(100% - 24px)}#bridge-toolbar button{flex-shrink:0}
 #scene-readout,#scene-readout.expanded,#bridge-tools,#alert-panel{max-height:max(90px,calc(100% - var(--replay-height,140px) - 135px));overflow-y:auto;overflow-x:hidden;scroll-padding-top:48px}
 #scene-readout .scene-alerts p{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere}
 #scene-readout .panel-head{flex-wrap:nowrap}#scene-readout #readout-toggle{white-space:normal;line-height:1.4}
 #scene-replay .replay-head{min-width:0}.replay-head label,.replay-head button{white-space:normal}.replay-head>div{min-width:0!important}.replay-head strong{white-space:normal!important}
 #scene-replay{max-height:40%;overflow-y:auto}#gesture-help{max-height:calc(100% - 90px);overflow:auto}
 .quasi-legend{flex-wrap:wrap;row-gap:8px!important}.line-key{flex-wrap:wrap}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 header{min-height:52px;flex-wrap:nowrap}
 #scene-readout,#scene-readout.expanded,#bridge-tools,#alert-panel{top:62px;max-height:max(80px,calc(100% - var(--replay-height,80px) - 82px))}
 #bridge-tools,#alert-panel{z-index:24;width:290px}
 #scene-readout{width:256px}#scene-readout.expanded{width:min(380px,calc(100% - 24px));z-index:25}
 #scene-replay{grid-template-columns:minmax(0,1fr) minmax(110px,.7fr);max-height:35%}.replay-head{display:flex;flex-wrap:wrap}.replay-head>div{flex:1 1 145px}.replay-head label{margin:0}.replay-head strong{font-size:12px}
 #alert-toast{bottom:calc(var(--replay-height,80px) + 10px);left:12px;max-height:120px;overflow-y:auto;max-width:calc(100% - 290px)}
 #alert-dock{bottom:calc(var(--replay-height,80px) + 64px)}
}

/* A small fiber-lit companion, with evidence handoff to the existing AI workspace. */
#assistant-toggle{position:absolute;right:22px;bottom:24px;z-index:19;display:flex;align-items:center;gap:8px;padding:6px 12px 6px 6px;border:1px solid #68aaab80;border-radius:40px;color:#deefeb;background:#12313bea;box-shadow:0 6px 24px #0005;font-size:13px;min-height:56px}
#assistant-toggle svg{width:48px;height:48px;flex:none;filter:drop-shadow(0 0 8px #67d2bd35)}
.bot-eyes{transform-origin:32px 33px;animation:bot-blink 7s infinite}@keyframes bot-blink{0%,44%,48%,100%{transform:scaleY(1)}46%{transform:scaleY(.15)}}
#assistant-panel{position:absolute;right:22px;bottom:94px;z-index:28;width:310px;max-width:calc(100% - 24px);max-height:calc(100% - 180px);overflow:auto;overscroll-behavior:contain;background:#102b35f8;color:#dceeea;border:1px solid #567c83;border-radius:16px;padding:15px;box-shadow:0 18px 50px #0006}
#assistant-panel .panel-head{display:flex;align-items:center;gap:6px;position:sticky;top:-15px;background:#102b35;z-index:2;padding:4px 0}#assistant-panel .panel-head strong{flex:1;font-size:16px}#assistant-close{background:transparent;color:#cce5e1;border:0;font-size:24px;min-width:38px;min-height:38px}
#assistant-panel p{font-size:13px;line-height:1.6;margin:10px 0;color:#abc6ca}#assistant-panel .assistant-greeting{font-size:19px;color:#ecf7f3;margin-top:16px}
#assistant-context{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.8 ui-monospace,monospace;padding:12px;background:#1b3b4480;border:1px solid #47697160;border-radius:9px;direction:ltr;unicode-bidi:isolate;user-select:text}
#assistant-copy,#assistant-panel>a{display:block;text-align:center;width:100%;box-sizing:border-box;margin:10px 0 0;padding:11px;font-size:13px;border-radius:8px;border:1px solid #59898c;background:#20454d;color:#d8eee8;text-decoration:none;min-height:42px}#assistant-panel>a{background:#b6e3d2;color:#153c3c;border-color:#b6e3d2}#assistant-status{display:block;font-size:12px;line-height:1.5;margin-top:8px}
html[dir=rtl] #assistant-panel{direction:rtl;text-align:right}
@media(prefers-reduced-motion:reduce){.bot-eyes{animation:none}}
@media(max-width:700px),(max-height:600px) and (max-width:1100px){
 #assistant-toggle{right:12px;bottom:20px;padding:4px;min-height:48px}#assistant-toggle svg{width:40px;height:40px}#assistant-toggle>span{display:none}
 body[data-near=true] #assistant-toggle{bottom:calc(var(--replay-height,140px) + 16px)}
 #assistant-panel{right:12px;top:62px;bottom:auto;max-height:calc(100% - 145px);width:310px}
 body[data-near=true] #assistant-panel{max-height:calc(100% - var(--replay-height,140px) - 88px)}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){body[data-near=true] #assistant-toggle{right:280px}}

/* Inline conversation keeps the bridge visible beside it. */
#assistant-panel{display:flex;flex-direction:column;width:380px;height:480px;max-height:calc(100% - 115px);padding:12px;overflow:hidden;box-sizing:border-box;bottom:82px}
#assistant-panel[hidden]{display:none}
#assistant-panel[data-expanded=true]{width:min(680px,calc(100% - 36px));height:calc(100% - 115px)}
#assistant-panel .panel-head{position:static;padding:0;flex:none}
#assistant-panel .panel-head button{border:0;background:transparent;color:#dceeea;min-width:38px;min-height:38px;font-size:23px}
#assistant-panel p{margin:5px 0;font-size:13px;flex:none}
#assistant-context-details{flex:none;font-size:12px;margin:5px 0}
#assistant-context-details summary{cursor:pointer;padding:6px 0;color:#9edbcc}
#assistant-context{max-height:90px;overflow:auto;font-size:11px;line-height:1.5;padding:8px;margin:0}
#assistant-messages{flex:1;min-height:50px;overflow:auto;overscroll-behavior:contain;padding:8px 0;scrollbar-width:thin;user-select:text}
.assistant-message{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.65;margin:8px 0;padding:10px 12px;border-radius:12px;background:#1e424b}
.assistant-message.user{background:#32615c;margin-inline-start:30px}
#assistant-status{flex:none;margin:4px 0;font-size:12px}
#assistant-form{flex:none;margin:0}
#assistant-input{display:block;width:100%;resize:none;box-sizing:border-box;background:#0c222c;color:#eff9f6;border:1px solid #547e83;border-radius:9px;padding:9px 11px;font:14px/1.5 system-ui;max-height:84px}
#assistant-input:focus{outline:2px solid #80d7c8;outline-offset:1px}
.assistant-actions{display:flex;justify-content:flex-end;gap:7px;padding-top:6px}
.assistant-actions button{min-height:38px;min-width:44px;border-radius:8px;border:1px solid #5c8b8b;padding:7px 14px;background:#b6e3d2;color:#153c3c;font-size:14px}
#assistant-voice{margin-inline-end:auto;background:#21434d;color:#d7efe8;display:flex;align-items:center;justify-content:center}
#assistant-voice[aria-pressed=true]{background:#a6454e;color:#fff}
@media(max-width:700px),(max-height:600px) and (max-width:1100px){
 #assistant-panel,body[data-near=true] #assistant-panel{top:10px;bottom:10px;right:10px;width:min(380px,calc(100% - 20px));height:calc(100% - 20px);max-height:calc(100% - 20px);z-index:40}
 #assistant-panel[data-expanded=true]{width:calc(100% - 20px);height:calc(100% - 20px)}
}
@media(orientation:landscape) and (max-height:600px){
 #assistant-panel,body[data-near=true] #assistant-panel{width:min(390px,55%)}
 #assistant-greeting{display:none}#assistant-context-details{margin:0}#assistant-context{max-height:45px}
 #assistant-input{font-size:16px;line-height:1.2;padding:5px 9px;height:38px}
 #assistant-panel .panel-head button{min-height:30px}.assistant-actions button{min-height:32px;padding:4px 12px}
}
