/* Shared assistant surface. Preserve native controls and full source portraits. */
html.sa-panel-fit :is(.app,.main-layout,.agent-panel,.sa-agent-actions,.sa-portrait-slot,.chat-panel,.chat-box){transition:none!important;}
html.sa-panel-fit:has(body .app),html.sa-panel-fit body:has(>.app){height:100%!important;min-height:0!important;overflow:hidden!important;background:#11161e!important;}
html.sa-panel-fit:root body .app{--page:#11161e;--panel:#151c26;--surface:#1b2531;--text:#e2e8ef;--muted:#98a6b6;--line:#2a3542;--line-strong:#364453;display:flex!important;flex-direction:column!important;width:100%!important;max-width:100%!important;height:100dvh!important;min-height:0!important;max-height:100dvh!important;margin:0!important;padding:8px!important;gap:8px!important;overflow:hidden!important;background:var(--page)!important;color:var(--text);border-radius:8px;box-shadow:none!important;}
html.sa-panel-fit:root body:not(.transcript-open) .app{height:100dvh!important;}
html.sa-panel-fit:root body .app>.app-header{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-start!important;flex:0 0 auto!important;padding:0!important;gap:6px 10px!important;}
html.sa-panel-fit:root body .app>.app-header>div:first-child,html.sa-panel-fit:root body .app>.app-header .avatar-mode-controls{display:contents!important;}
html.sa-panel-fit:root body .app>.app-header h1{order:1!important;flex:0 1 auto!important;min-width:0!important;max-width:calc(100% - 122px)!important;margin:0!important;font-size:20px!important;line-height:1.25!important;font-weight:600!important;letter-spacing:-.02em;}
html.sa-panel-fit:root body .app>.app-header .system-status{order:4!important;flex:0 0 auto!important;gap:8px!important;margin:0 0 0 auto!important;font-size:11px!important;font-weight:500!important;color:#a8b4c2;}
html.sa-panel-fit:root body .system-status-dot{width:6px!important;height:6px!important;box-shadow:none!important;}
html.sa-panel-fit:root body .app>.app-header .sa-settings-toggle{order:3!important;flex:0 0 34px!important;width:34px!important;height:34px!important;min-height:34px!important;margin:0!important;padding:6px!important;align-self:center!important;border:1px solid #334151!important;border-radius:6px!important;background:#1a222d!important;box-shadow:none!important;}
html.sa-panel-fit:root body .sa-settings-toggle svg{width:19px;height:19px;}
html.sa-panel-fit:root body .app>.app-header :is(.sa-header-transcript,#scadaTrackerLink){order:2!important;flex:0 0 auto!important;width:auto!important;height:34px!important;min-height:34px!important;margin:0!important;padding:6px 10px!important;font-size:12px!important;font-weight:500!important;border:1px solid #334151!important;border-radius:6px!important;background:#1a222d!important;color:#c4ceda!important;box-shadow:none!important;}
html.sa-panel-fit:root body .transcript-badge{min-width:16px!important;height:16px!important;padding:0 4px!important;line-height:16px!important;font-size:10px!important;background:#354456!important;color:#dce5ef!important;box-shadow:none!important;}
html.sa-panel-fit:root body .app>.app-header .sa-title-link{display:inline!important;padding:0!important;color:inherit!important;text-decoration:none;border:0!important;border-bottom:1px solid #4e687366!important;border-radius:0!important;background:transparent!important;font:inherit!important;}
.sa-title-link>span{font-size:.7em;color:#91a6b8;}.sa-title-secondary{color:#bac4d0;}
html.sa-panel-fit:root body .main-layout{display:flex!important;flex-direction:column!important;flex:1 1 0%!important;min-height:0!important;height:auto!important;gap:8px!important;overflow:hidden!important;}
html.sa-panel-fit:root body:not(.transcript-open) .main-layout{flex:1 1 0%!important;}
html.sa-panel-fit:root body .agent-panel,html.sa-panel-fit:root body.transcript-open .agent-panel{display:grid!important;grid-template-areas:'agent actions'!important;grid-template-columns:var(--sa-portrait-column,50%) minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;flex:0 0 var(--sa-agent-card-height,180px)!important;height:var(--sa-agent-card-height,180px)!important;min-height:0!important;max-height:none!important;padding:8px!important;gap:12px!important;align-items:stretch!important;overflow:hidden!important;border:1px solid #293543!important;border-radius:8px!important;background:#151c26!important;box-shadow:none!important;transition:none!important;}
html.sa-panel-fit:root body .sa-portrait-slot{grid-area:agent!important;position:relative!important;align-self:stretch!important;justify-self:stretch!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;}
html.sa-panel-fit:root body .sa-portrait-slot>.agent-orb{position:absolute!important;inset:50% auto auto 0!important;width:var(--sa-portrait-width,100%)!important;height:var(--sa-portrait-height,100%)!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;margin:0!important;padding:0!important;overflow:hidden!important;transform:translateY(-50%)!important;border:1px solid #344151!important;border-radius:6px!important;box-shadow:none!important;animation:none!important;}
html.sa-panel-fit:root body .agent-orb>:is(.agent-orb-image,.agent-orb-video,.agent-orb-freeze,.sa-waiting-video){position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:contain!important;object-position:center!important;transform:none!important;}
html.sa-panel-fit:root body .sa-agent-actions{grid-area:actions!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-self:center!important;height:var(--sa-actions-height,100%)!important;min-width:0!important;min-height:0!important;gap:10px!important;}
html.sa-panel-fit:root body .agent-status{display:flex!important;align-items:center!important;flex:0 0 20px!important;height:20px!important;min-height:0!important;width:auto!important;margin:0!important;padding:0!important;gap:7px!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;color:#d1dae5!important;font-size:clamp(11px,calc(var(--sa-actions-height,180px)/35),16px)!important;line-height:20px!important;font-weight:500!important;}
html.sa-panel-fit:root body .agent-status .status-dot{width:6px!important;height:6px!important;box-shadow:none!important;}
html.sa-panel-fit:root body .controls{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:minmax(0,1fr) minmax(0,1fr) auto!important;flex:1 1 0%!important;align-items:stretch!important;align-content:start!important;min-width:0!important;min-height:0!important;height:auto!important;gap:6px!important;}
html.sa-panel-fit:root body .controls .control-btn{position:static!important;transform:none!important;min-height:0!important;height:100%!important;max-height:none!important;margin:0!important;padding:4px 8px!important;border:1px solid #354354!important;border-radius:6px!important;background:#202b38!important;color:#cbd5e1!important;font-size:clamp(11px,calc(var(--sa-actions-height,180px)/24),18px)!important;line-height:1.2!important;font-weight:500!important;box-shadow:none!important;filter:none!important;text-shadow:none!important;}
html.sa-panel-fit:root body .controls .control-btn:disabled{opacity:.55!important;}
html.sa-panel-fit:root body .controls .conversation{grid-column:1/-1!important;background:#20374b!important;border-color:#36546d!important;color:#e0eaf3!important;}
html.sa-panel-fit:root body .controls .talk-toggle.active{background:#1c312b!important;border-color:#35594b!important;color:#96d2b5!important;}
html.sa-panel-fit:root body .controls :is(.danger,[data-state='stoppable']){background:#40282d!important;border-color:#79505a!important;color:#f4c1c9!important;}
html.sa-panel-fit:root body .controls .conversation.active{background:#234339!important;border-color:#427260!important;}
html.sa-panel-fit:root body .controls .conversation-status{display:none!important;}
html.sa-panel-fit:root body .controls .piper-status{display:block!important;visibility:visible!important;grid-column:1/-1!important;min-height:0!important;max-height:28px!important;margin:0!important;padding:0!important;overflow:hidden!important;color:#8798ab!important;text-align:left!important;font-size:clamp(10px,calc(var(--sa-actions-height,180px)/50),12px)!important;line-height:1.4!important;}
html.sa-panel-fit:root body .chat-panel{display:flex!important;flex-direction:column!important;flex:0 0 auto!important;min-height:0!important;height:auto!important;padding:0!important;gap:4px!important;overflow:hidden!important;}
html.sa-panel-fit:root body.transcript-open .chat-panel{flex:1 1 0%!important;}
html.sa-panel-fit:root body .chat-box{display:none!important;min-width:0!important;}
html.sa-panel-fit:root body.transcript-open .chat-box{display:block!important;flex:1 1 0%!important;min-height:0!important;height:auto!important;max-height:none!important;overflow:auto!important;overscroll-behavior:contain;padding:8px!important;border:1px solid #293543!important;border-radius:6px!important;background:#101720!important;}
html.sa-panel-fit:root body .input-area{display:grid!important;position:static!important;grid-template-columns:46px minmax(0,1fr) 58px!important;flex:0 0 auto!important;transform:none!important;width:100%!important;margin:0!important;padding:0!important;gap:6px!important;}
html.sa-panel-fit:root body .input-wrap{position:relative!important;order:0!important;grid-column:2!important;min-width:0!important;width:100%!important;}
html.sa-panel-fit:root body #micButton{grid-column:1!important;}
html.sa-panel-fit:root body #sendButton{grid-column:3!important;background:#315e80!important;border-color:#477594!important;color:#f1f6fa!important;}
html.sa-panel-fit:root body :is(#micButton,#sendButton,#userInput){box-sizing:border-box!important;min-height:38px!important;height:38px!important;padding:6px 8px!important;font-size:12px!important;font-weight:500!important;border:1px solid #334151!important;border-radius:6px!important;background:#18212c!important;color:#dce4ee!important;box-shadow:none!important;}
html.sa-panel-fit:root body #userInput{width:100%!important;min-width:0!important;padding-left:36px!important;background:#101720!important;}
html.sa-panel-fit:root body #userInput::placeholder{color:#7f91a5!important;}
html.sa-panel-fit:root body #micButton.listening{background:#b42332!important;border-color:#f87171!important;color:#fff!important;}
html.sa-panel-fit:root body #sendButton{background:#315e80!important;border-color:#477594!important;color:#f1f6fa!important;}
html.sa-panel-fit:root body .report-toolbar{flex:0 0 auto!important;display:flex!important;flex-wrap:wrap!important;align-items:center!important;padding:5px 6px!important;margin:0!important;gap:4px 8px!important;border:1px solid #293543!important;border-radius:6px!important;background:#151c26!important;font-size:11px!important;box-shadow:none!important;}
html.sa-panel-fit:root body .report-toolbar>div{flex:1 1 150px!important;}.report-toolbar p{margin:2px 0!important;font-size:10px!important;line-height:1.15!important;}
html.sa-panel-fit:root body .report-toolbar :is(button,a){min-height:26px!important;padding:4px 6px!important;font-size:11px!important;border-radius:5px!important;box-shadow:none!important;}
html.sa-panel-fit:root body .sa-settings-panel{z-index:100!important;width:min(300px,calc(100vw - 16px))!important;border-color:#354354!important;border-radius:8px!important;background:#18212c!important;box-shadow:0 12px 28px #0006!important;}
html.sa-panel-fit:root body .sa-settings-panel .sa-settings-field[hidden]{display:none!important;}
html.sa-panel-fit:root body .sa-settings-panel .sa-settings-archive{display:block!important;width:100%!important;min-width:0!important;}
html.sa-panel-fit:root body .sa-settings-archive>summary{list-style:none;cursor:pointer;padding:9px!important;border:1px solid #354354!important;border-radius:6px!important;font-size:13px!important;}
.sa-settings-archive>summary::after{content:'⌄';float:right;}
html.sa-panel-fit:root body .sa-settings-archive .chat-archive-menu{position:static!important;display:grid;min-width:0!important;margin-top:6px!important;box-shadow:none!important;}
html.sa-panel-fit:root body .sa-settings-panel .process-context-tools{display:grid!important;gap:8px!important;padding:0!important;border:0!important;background:none!important;}
html.sa-panel-fit:root body .process-context-label{display:none!important;}
html.sa-panel-fit:root body .sa-settings-panel .process-context-tools select{width:100%!important;min-height:36px!important;font-size:12px!important;}
html.sa-panel-fit:root body .training-mode-bar{flex:0 0 auto!important;padding:3px 6px!important;font-size:11px!important;}
html.sa-panel-fit:root body .training-workspace{flex:0 0 auto!important;min-height:0!important;max-height:min(30dvh,220px)!important;overflow:auto!important;border-radius:6px!important;}
@media(max-width:480px){html.sa-panel-fit:root body .app>.app-header h1{font-size:17px!important;}html.sa-panel-fit:root body .controls .control-btn{padding:2px 3px!important;font-size:11px!important;}}
@media(max-height:560px){
 html.sa-panel-fit:root body .app{padding:6px!important;gap:6px!important;}
 html.sa-panel-fit:root body .main-layout{gap:6px!important;}
 html.sa-panel-fit:root body .app>.app-header h1{font-size:17px!important;}
 html.sa-panel-fit:root body .agent-panel,html.sa-panel-fit:root body.transcript-open .agent-panel{padding:6px!important;gap:10px!important;}
 html.sa-panel-fit:root body .controls .control-btn{font-size:clamp(11px,calc(var(--sa-actions-height,180px)/24),18px)!important;}
 html.sa-panel-fit:root body .agent-status{font-size:clamp(11px,calc(var(--sa-actions-height,180px)/35),16px)!important;}
 html.sa-panel-fit:root body .system-status{font-size:10px!important;gap:6px!important;}
 html.sa-panel-fit:root body .training-workspace{max-height:clamp(28px,calc(100dvh - 320px),90px)!important;padding:4px!important;gap:3px!important;}
 html.sa-panel-fit:root body .training-intro h2,html.sa-panel-fit:root body .training-intro p span{display:none!important;}
 html.sa-panel-fit:root body .training-intro p{margin:0!important;font-size:11px!important;}
 html.sa-panel-fit:root body .training-area-field{display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;}
 html.sa-panel-fit:root body .training-area-field label{font-size:10px!important;}
 html.sa-panel-fit:root body #trainingArea{flex:1!important;min-width:0!important;min-height:25px!important;height:25px!important;padding:2px!important;font-size:11px!important;}
 html.sa-panel-fit:root body .training-lessons{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3px!important;}
 html.sa-panel-fit:root body .training-lessons button{min-height:27px!important;padding:3px!important;gap:2px!important;}
 html.sa-panel-fit:root body .training-lessons strong{font-size:10px!important;}
 html.sa-panel-fit:root body .training-lessons :is(small,b,button>span){display:none!important;}
}
@media(max-height:360px){
 /* Keep the saved-report actions available while giving the answer room. */
 html.sa-panel-fit:root body.transcript-open .report-toolbar{flex-wrap:nowrap!important;overflow-x:auto!important;padding:2px 4px!important;}
 html.sa-panel-fit:root body.transcript-open .report-toolbar>div{display:none!important;}
 html.sa-panel-fit:root body.transcript-open .report-toolbar :is(button,a){flex:0 0 auto!important;width:auto!important;}
 html.sa-panel-fit:root body.transcript-open .progress-container{height:14px!important;min-height:0!important;margin:0!important;padding:0 4px!important;overflow:hidden!important;}
 html.sa-panel-fit:root body.transcript-open .progress-label{height:10px!important;margin:0!important;font-size:9px!important;line-height:10px!important;}
 html.sa-panel-fit:root body.transcript-open .progress-bar{height:2px!important;margin-top:1px!important;}
 html.sa-panel-fit:root body .training-mode-bar{display:none!important;}
 html.sa-panel-fit:root body.transcript-open .chat-box{padding:4px!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .chat-panel{gap:2px!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .pdf-chip{height:18px!important;min-height:0!important;margin:0!important;padding:1px 6px!important;gap:4px!important;font-size:10px!important;line-height:1.1!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .progress-container{height:12px!important;min-height:0!important;margin:0!important;padding:0 4px!important;overflow:hidden!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .progress-label{height:10px!important;margin:0!important;font-size:9px!important;line-height:10px!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .progress-bar{height:2px!important;margin-top:1px!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .report-toolbar{padding:2px 4px!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .report-toolbar p{display:none!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .pdf-chip-remove{width:14px!important;height:14px!important;min-height:0!important;padding:0!important;}
 html.sa-panel-fit:root body .app:has(#pdfChip:not(.hidden)) .training-workspace{max-height:24px!important;padding:2px 4px!important;}
 html.sa-panel-fit:root body .app:has(.agent-panel[data-compact="true"])>.app-header :is(.sa-settings-toggle,.sa-header-transcript,#scadaTrackerLink){height:28px!important;min-height:28px!important;}
 html.sa-panel-fit:root body .app:has(.agent-panel[data-compact="true"]) .agent-panel{padding:4px!important;gap:6px!important;}
 html.sa-panel-fit:root body .app:has(.agent-panel[data-compact="true"]) .sa-agent-actions{gap:4px!important;}
 html.sa-panel-fit:root body .app:has(.agent-panel[data-compact="true"]) .agent-status{flex-basis:18px!important;height:18px!important;font-size:10px!important;}
 html.sa-panel-fit:root body .app:has(.agent-panel[data-compact="true"]) .controls{grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:var(--sa-control-height,24px)!important;flex:0 0 auto!important;gap:3px!important;}
 html.sa-panel-fit:root body .app:has(.agent-panel[data-compact="true"]) .controls .conversation{grid-column:auto!important;}
 html.sa-panel-fit:root body .app:has(.agent-panel[data-compact="true"]) .control-btn{font-size:10px!important;padding:2px 3px!important;}
 html.sa-panel-fit:root body .app:has(.agent-panel[data-compact="true"]) .piper-status{display:none!important;}
}
