/* Voice stays beside the workspace, without changing the page layout. */
.copilot-panel{
 position:fixed;z-index:30;top:88px;right:18px;
 width:min(380px,calc(100vw - 36px));max-height:calc(100dvh - 108px);
 padding:18px;overflow:auto;overscroll-behavior:contain;
 background:#f8faff;border:1px solid #d8e1f3;border-radius:16px;
 box-shadow:0 14px 45px #23365b26;
}
.copilot-panel .copilot-heading{margin-bottom:10px;align-items:flex-start}
.copilot-panel .copilot-heading h2{font-size:20px;line-height:1.3;margin:5px 0 0}
.copilot-panel .copilot-heading .eyebrow{font-size:12px;letter-spacing:1.2px}
.copilot-panel #copilot-collapse{width:44px;height:44px}
.copilot-panel :is(.copilot-hint,.copilot-privacy){font-size:14px;line-height:1.5;margin:8px 0 0}
.copilot-panel .copilot-privacy{color:#657084}
.copilot-panel .copilot-controls{gap:8px;margin-top:16px}
.copilot-panel .copilot-controls .button{min-height:44px;font-size:14px}
.copilot-panel #copilot-status{flex-basis:100%;font-size:14px;line-height:1.5}
.copilot-panel :is(.copilot-key,.copilot-conversation){margin-top:12px}
.copilot-panel :is(.copilot-key,.copilot-conversation)>summary{cursor:pointer;min-height:36px;padding:8px 0;font-size:14px;color:#52627a}
.copilot-panel summary:focus-visible{outline:3px solid #7190ff;outline-offset:2px;border-radius:4px}
.copilot-panel .copilot-key input{font-size:16px}
.copilot-panel .copilot-key p{font-size:14px;line-height:1.5}
.copilot-panel .copilot-transcript{max-height:180px;font-size:14px;line-height:1.6}
.copilot-panel .copilot-transcript:empty::before{content:'Your conversation will appear here.';color:#657084}
.has-active-voice .viewer-panel,.has-active-voice .manual-panel{scroll-margin-top:16px}

/* Keep the launcher prominent, including while a voice session is active. */
#copilot-toggle.copilot-mic{background:var(--blue)!important;border-color:var(--blue)!important;color:#fff}
#copilot-toggle.copilot-mic:hover{background:#2445d1!important}
.copilot-mic>svg{display:none}
.copilot-mic #copilot-indicator{color:inherit}
.engine .copilot-launcher-home{margin:20px 14px 0}
.engine .copilot-launcher-home>#copilot-toggle{width:100%;min-height:44px}


@media(min-width:851px){
 .engine .manual-panel>#copilot-quick-end{display:flex;width:calc(100% - 28px);margin:8px 14px 0;min-height:44px}
 .engine .manual-panel>.copilot-panel{position:static;width:auto;max-height:none;margin:20px 14px 0;padding:14px;border-radius:10px;box-shadow:none}
 .engine .manual-panel>.copilot-panel .copilot-heading h2{font-size:18px}
 .engine .manual-panel>.copilot-panel .copilot-heading{gap:8px}
 .engine .manual-panel>.copilot-panel .copilot-controls .button{flex:1}
}

@media(max-width:850px){
 .copilot-panel{top:auto;right:12px;bottom:max(12px,env(safe-area-inset-bottom,0px));width:calc(100vw - 24px);max-height:55dvh;padding:16px}
 body.engine[data-state="guide"]{padding-bottom:calc(10rem + env(safe-area-inset-bottom,0px))}
 .engine[data-state="guide"] #copilot-quick-end{display:none!important}
 .engine[data-state="guide"] .copilot-panel{bottom:calc(10rem + env(safe-area-inset-bottom,0px));max-height:min(55dvh,calc(100dvh - 11rem - env(safe-area-inset-bottom,0px)))}
}

/* Live guide captions stay inside the model viewport and allow gestures through. */
.copilot-subtitles{position:absolute;z-index:3;left:50%;bottom:54px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);padding:6px 10px;background:rgba(24,31,48,.9);color:#fff;border-radius:10px;box-shadow:0 3px 14px #17223820;pointer-events:none;text-align:center}
.copilot-subtitle-text{max-width:54ch;max-height:2.8em;overflow:hidden;overflow-wrap:anywhere;font-size:13px;line-height:1.4}
@media(max-width:850px){
 .copilot-subtitles{bottom:50px;max-width:calc(100% - 24px);padding:6px 10px}
}

/* Voice opens from the playback bar, leaving the instructions unobstructed. */
@media(max-width:850px){
 .player>.copilot-mic{position:relative;flex:none;width:44px;min-width:44px;height:44px;padding:10px!important}
 .player>.copilot-mic>svg{display:block}
 .player>.copilot-mic .copilot-launcher-label{display:none}
 .player>.copilot-mic #copilot-indicator{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 .player>.copilot-mic.voice-active::after{content:'';position:absolute;top:4px;right:4px;width:7px;height:7px;border-radius:50%;background:#8cffb0;box-shadow:0 0 0 2px var(--blue)}
 .engine .copilot-launcher-home{display:none}
 .player:has(>.copilot-mic){display:grid;grid-template-columns:44px 44px 44px minmax(0,1fr) 44px;gap:4px 8px}
 .player:has(>.copilot-mic) .timeline{grid-column:1/-1;grid-row:1;min-width:0}
 .player:has(>.copilot-mic)>button{grid-row:2;min-height:44px;height:auto}
 .player:has(>.copilot-mic)>#prev{grid-column:1;width:44px}
 .player:has(>.copilot-mic)>#play{grid-column:2;width:44px}
 .player:has(>.copilot-mic)>#speed{grid-column:3}
 .player:has(>.copilot-mic)>#next{grid-column:4;min-width:0;max-width:none;white-space:normal}
 .player:has(>.copilot-mic)>#copilot-toggle{grid-column:5}
 .engine[data-state="guide"] .player{grid-template-columns:44px 44px 44px minmax(0,1fr) 44px}
}
