/* WorkBuddy review, adapted to the approved UI. No canvas, scene, video or material selectors. */
:root {
  --ui-type-meta:12px; --ui-type-body:13px; --ui-type-control:14px;
  --ui-type-heading:16px; --ui-type-number:20px; --ui-type-title:28px;
  --ui-line:rgba(145,190,214,.16); --ui-line-hover:rgba(145,210,230,.32);
  --ui-ink:#e4f1f6; --ui-ink-secondary:#adc3d0; --ui-ink-meta:#94adbf;
}
body[data-ui-refinement] :is(button,input,select,textarea,a,summary,[tabindex]):focus-visible {
  outline:2px solid #91deee; outline-offset:3px;
}
body[data-ui-refinement] :is(input,select,textarea)[aria-invalid="true"] {
  border-color:#f1685b!important; box-shadow:0 0 0 2px rgba(241,104,91,.12);
}
body[data-ui-refinement] .ui-field-error { color:#f4a398; font-size:12px; line-height:1.5; }
body[data-ui-refinement] :is(.structure-scroll,#panel-right,.tree,.agent-presence-body,.ops-detail,.ops-ticket-list) {
  scrollbar-width:thin; scrollbar-color:rgba(120,200,235,.36) transparent; overscroll-behavior:contain;
}
body[data-ui-refinement] :is(.structure-scroll,#panel-right,.tree,.agent-presence-body,.ops-detail,.ops-ticket-list)::-webkit-scrollbar { width:6px; height:6px; }
body[data-ui-refinement] :is(.structure-scroll,#panel-right,.tree,.agent-presence-body,.ops-detail,.ops-ticket-list)::-webkit-scrollbar-thumb { background:rgba(120,200,235,.36); border-radius:6px; }

/* Editor: keep the existing narrow, clear glass and approved animated actions. */
body[data-ui-page="editor"] .editor-panel { border-color:var(--ui-line); padding:20px; }
body[data-ui-page="editor"] .panel-progress { flex-shrink:0; margin-bottom:20px; font-size:12px; gap:8px; }
body[data-ui-page="editor"] .view-title h1 { font-size:28px; line-height:1.28; letter-spacing:-.6px; }
body[data-ui-page="editor"] .view-title>span,
body[data-ui-page="editor"] .confirmation-hint { font-size:13px; line-height:1.65; color:var(--ui-ink-secondary); }
body[data-ui-page="editor"] .view-title.compact { margin-bottom:12px; }
body[data-ui-page="editor"] .upload-copy small { font-size:12px; white-space:normal; line-height:1.5; margin-top:4px; }
body[data-ui-page="editor"] .upload-copy b { font-size:14px; }
body[data-ui-page="editor"] .upload-hero { border-color:var(--ui-line-hover); }
body[data-ui-page="editor"] .upload-hero em { font-size:12px; min-width:68px; }
body[data-ui-page="editor"] .request-composer textarea { font-size:14px; line-height:1.7; }
body[data-ui-page="editor"] .composer:focus-within { border-color:rgba(107,212,244,.65); box-shadow:0 0 0 3px rgba(79,209,232,.16); }
body[data-ui-page="editor"] .composer-tip,
body[data-ui-page="editor"] .file-preview small,
body[data-ui-page="editor"] .project-tools>span,
body[data-ui-page="editor"] .resume-project small { font-size:12px; line-height:1.5; }
body[data-ui-page="editor"] .file-preview b { font-size:13px; }
body[data-ui-page="editor"] .request-examples button { font-size:12px; line-height:1.5; min-height:38px; border-color:var(--ui-line-hover); }
body[data-ui-page="editor"] .request-examples button:last-child { grid-column:1/-1; }
body[data-ui-page="editor"] :is(input,select):focus { border-color:rgba(107,212,244,.65); box-shadow:0 0 0 3px rgba(79,209,232,.16); outline:0; }

/* A real scroll region and separate action row. No field is hidden under a sticky footer. */
body[data-ui-page="editor"] .editor-panel:has(>.view[data-view="list"].active) { display:flex; flex-direction:column; overflow:hidden; }
body[data-ui-page="editor"] .view[data-view="list"].active { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; }
body[data-ui-page="editor"] .view[data-view="list"]>.view-title,
body[data-ui-page="editor"] .view[data-view="list"]>.confirmation-hint { flex-shrink:0; }
body[data-ui-page="editor"] .structure-scroll-shell { position:relative; flex:1; min-height:0; display:flex; }
body[data-ui-page="editor"] .structure-scroll { flex:1; min-width:0; overflow-y:auto; overflow-x:hidden; scrollbar-gutter:stable; padding-right:6px; scroll-padding:12px; }
body[data-ui-page="editor"] .structure-scroll-content { padding-bottom:20px; }
body[data-ui-page="editor"] .structure-scroll-more { position:absolute; left:0; bottom:0; width:100%; padding:10px 8px 2px; text-align:center; font-size:12px; color:#a3c6d5; background:linear-gradient(transparent,rgba(3,20,31,.96)); pointer-events:none; opacity:0; transition:opacity .15s; }
body[data-ui-page="editor"] .structure-scroll-shell[data-more="true"] .structure-scroll-more { opacity:1; }
body[data-ui-page="editor"] .editor-actionbar { flex:none; border-top:1px solid var(--ui-line); margin-top:4px; padding-top:12px; }
body[data-ui-page="editor"] .editor-actionbar .confirmation-actions { position:static; margin:0; padding:0; border:0; background:none; gap:10px; }
body[data-ui-page="editor"] .editor-actionbar #export-config-btn { margin:10px 0 0; padding:2px 0; font-size:12px; }
body[data-ui-page="editor"] .component-list>div { border-color:var(--ui-line); }
body[data-ui-page="editor"] .component-list strong { font-size:14px; line-height:1.5; }
body[data-ui-page="editor"] .component-list small { font-size:12px; line-height:1.65; }
body[data-ui-page="editor"] .component-total { font-size:12px; line-height:1.6; flex-wrap:wrap; gap:6px; }
body[data-ui-page="editor"] .component-total strong { font-size:13px; }
body[data-ui-page="editor"] .parameter-drawer { position:static; min-width:0; width:auto; border-color:var(--ui-line); margin:16px 0 0; padding:16px; }
body[data-ui-page="editor"] .drawer-head { margin-bottom:12px; padding-bottom:12px; }
body[data-ui-page="editor"] #parameter-save-status:not([data-state="invalid"]) { display:none; }
body[data-ui-page="editor"] .parameter-group-title { font-size:14px; margin:20px 0 12px; }
body[data-ui-page="editor"] .form-grid label,
body[data-ui-page="editor"] .room-edit label { font-size:12px; line-height:1.5; gap:6px; min-width:0; }
body[data-ui-page="editor"] .view[data-view="list"] :is(input,select) { font-size:14px; border-radius:8px; min-width:0; height:40px; }
body[data-ui-page="editor"] .form-grid { gap:12px; }
body[data-ui-page="editor"] .unit-input>span { top:12px; }
body[data-ui-page="editor"] .room-edit { padding:12px; border-color:var(--ui-line); }
body[data-ui-page="editor"] .room-edit strong { font-size:13px; }
body[data-ui-page="editor"] :is(#generate-btn,#apply-btn,#back-params-btn) { min-height:40px; font-size:14px; line-height:1.4; }
body[data-ui-page="editor"] .preview-spec { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
body[data-ui-page="editor"] .preview-spec>div { min-width:0; min-height:80px; padding:12px; border:1px solid var(--ui-line); border-radius:8px; }
body[data-ui-page="editor"] .preview-spec small { color:var(--ui-ink-meta); font-size:12px; line-height:1.5; }
body[data-ui-page="editor"] .preview-spec strong { font-size:14px; margin-top:7px; line-height:1.4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums; }
body[data-ui-page="editor"] .ui-stat-number { font-size:20px; line-height:1.3; font-weight:600; }
body[data-ui-page="editor"] .ui-stat-unit { margin-left:5px; font-size:12px; color:#b4cbd6; }
body[data-ui-page="editor"] .preview-actions { gap:10px; margin-top:16px; }
body[data-ui-page="editor"] .preview-actions>button.secondary { font-size:13px; font-weight:500; min-height:40px; border-radius:8px; border-color:var(--ui-line); }
body[data-ui-page="editor"] #export-current-glb { grid-column:1/-1; }
body[data-ui-page="editor"] .result-video-caption { font-size:12px; line-height:1.5; }
body[data-ui-page="editor"] #actual-preview-btn { font-size:12px; line-height:1.5; }

/* Viewer: same panels, same visual identity; readable text and quieter card borders. */
body[data-ui-refinement] :is(#panel-left,#panel-right) .panel { border-color:var(--ui-line); border-radius:12px; padding:16px; }
body[data-ui-refinement] :is(#panel-left,#panel-right) h3 { font-size:14px; line-height:1.4; letter-spacing:.4px; gap:6px; margin-bottom:12px; }
body[data-ui-refinement] :is(#panel-left,#panel-right) h3 :is(span,small,b) { font-size:12px; letter-spacing:0; }
body[data-ui-refinement] :is(#panel-left,#panel-right) :is(.ctx-sub,.ctx-hint,.ctx-meta span,.a-time,.a-loc,.a-action,.alarm-filter,.alarm-empty,.trend-x,.trend-val span,.health-gauge-value span,.ctx-enter-room) { font-size:12px; line-height:1.5; }
body[data-ui-refinement] :is(#panel-left,#panel-right) :is(.ctx-sub,.a-loc,.a-time,.trend-x,.health-gauge-value span) { color:var(--ui-ink-meta); }
body[data-ui-refinement] #panel-left .tree-item { font-size:13px; min-height:34px; line-height:1.5; padding-top:7px; padding-bottom:7px; }
body[data-ui-refinement] #panel-left .tree-item.sub2 { font-size:12px; }
body[data-ui-refinement] #panel-left :is(.campus-kpi span,.spatial-heading span,.spatial-floors button,[data-spatial-ticket]) { font-size:12px; }
body[data-ui-refinement] #panel-left .spatial-zoom button { font-size:14px; }
body[data-ui-refinement] #panel-right .trend-val small { font-size:12px; }
body[data-ui-refinement] #topbar :is(.lvl-tab,.btn-editor,.btn-ai,#btn-logout) { font-size:12px; }
body[data-ui-refinement] #panel-right :is(.trend-val,.health-gauge-value b) { font-size:20px; font-variant-numeric:tabular-nums; }
body[data-ui-refinement] #panel-right .alarm-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; min-height:92px; border:1px solid var(--ui-line); border-left-width:3px; border-radius:8px; padding:12px; background:rgba(26,49,63,.14); box-shadow:none; }
body[data-ui-refinement] #panel-right .alarm-item.critical { border-left-color:var(--crit); }
body[data-ui-refinement] #panel-right .alarm-item.warning { border-left-color:var(--warn); }
body[data-ui-refinement] #panel-right .alarm-item.offline { border-left-color:var(--offline); }
body[data-ui-refinement] #panel-right .alarm-item .a-dot { display:none; }
body[data-ui-refinement] #panel-right .alarm-item>div { min-width:0; }
body[data-ui-refinement] #panel-right .a-title { color:var(--ui-ink); font-size:13px; font-weight:600; line-height:1.55; }
body[data-ui-refinement] #panel-right .a-severity { color:var(--ui-ink-secondary); border:0; background:none; border-radius:0; padding:0; margin-right:6px; font-size:12px; font-weight:400; }
body[data-ui-refinement] #panel-right .a-detail { color:var(--ui-ink-secondary); font-size:12px; line-height:1.6; }
body[data-ui-refinement] #panel-right .a-loc { overflow-wrap:anywhere; }
body[data-ui-refinement] #panel-right .a-time { align-self:start; margin:0; white-space:nowrap; }
body[data-ui-refinement] #panel-right .alarm-item.located { outline:1px solid rgba(95,228,241,.6); outline-offset:-1px; background:rgba(45,169,188,.12); }
body[data-ui-refinement] #panel-right .alarm-item:hover { border-top-color:var(--ui-line-hover); border-right-color:var(--ui-line-hover); border-bottom-color:var(--ui-line-hover); background:rgba(43,93,116,.16); }
body[data-ui-refinement] :is(#panel-left,#panel-right) button { border-radius:8px; }
body[data-ui-refinement] #ai-modal :is(p,li,.ai-note,#ai-chips,footer) { font-size:12px; line-height:1.6; }
body[data-ui-refinement] #ai-body { font-size:13px; line-height:1.7; }

/* Agent and workorders: preserve all actions, expansion behaviour and semantic status colours. */
body[data-ui-refinement] #agent-presence { border-color:var(--ui-line-hover); }
body[data-ui-refinement] #agent-presence :is(small,button,.agent-card-name em,.agent-card>span:last-child,.agent-activity time,footer,.agent-brief-picker,.agent-brief-picker select,.agent-object-heading span,.agent-evidence-lines,.agent-evidence-lines dt,.agent-brief-actions button,.agent-provenance,.agent-business-detail>summary,.agent-focus-detail>summary,.agent-focus-detail>summary span,.agent-replay>summary,.agent-replay>summary span,.agent-duty-strip,.agent-duty-scope,.agent-collaboration-step,.flow-caption,.flow-kpi-label) { font-size:12px; line-height:1.5; }
body[data-ui-refinement] #agent-presence :is(.agent-card-name b,.agent-object-heading b,.agent-object-judgement) { font-size:14px; line-height:1.6; }
body[data-ui-refinement] #agent-presence .agent-presence-body { scrollbar-gutter:stable; }
body[data-ui-refinement] #agent-presence .agent-cards { gap:8px; padding:12px; }
body[data-ui-refinement] #agent-presence header { padding:10px 14px; min-height:44px; }
body[data-ui-refinement] #agent-presence header>div { min-width:0; }
body[data-ui-refinement] #agent-presence[data-folded="true"] header { border-bottom:0; }
body[data-ui-refinement] #agent-presence .ui-agent-summary { width:100%; font-size:12px; line-height:1.5; color:var(--ui-ink-secondary); font-variant-numeric:tabular-nums; }
body[data-ui-refinement] #agent-presence :is(.flow-stat,.flow-stage) { min-width:0; }
body[data-ui-refinement] #ops-dialog { font-size:13px; line-height:1.6; border-color:var(--ui-line-hover); }
body[data-ui-refinement] #ops-dialog :is(small,summary,time,dt,label,td,th,.ops-eyebrow,.ops-location,.ops-tags span,.ops-priority,.ops-ticket-top,.ops-list-heading span,.ops-intelligence-label,.ops-section-label,.ops-case-decision p,.ops-case-decision li,.ops-case-stages li,.ops-case-stages li span,.ops-footer,.ops-message,.ops-auto-metrics,.ops-question-answer,.ops-question small,.ops-question-examples button,.ops-section-heading>span,.ops-trend-heading,.ops-trend-heading strong,.ops-trend-empty span,.ops-ticket-trend>p,.ops-overview>summary span) { font-size:12px; line-height:1.6; }
body[data-ui-refinement] #ops-dialog :is(button,select,input,textarea,.ops-ticket>strong,.ops-reason,.ops-times dd,.ops-resolution,.ops-result,.ops-escalation,.ops-history li,.ops-history li>b,.ops-question strong) { font-size:13px; line-height:1.6; }
body[data-ui-refinement] #ops-dialog .ops-detail-heading button { font-size:12px!important; }
body[data-ui-refinement] #ops-dialog :is(.ops-toolbar button,.ops-tabs button,.ops-auto-controls button,.ops-link) { font-size:12px; min-height:34px; }
body[data-ui-refinement] #ops-dialog .ops-detail h4 { font-size:14px; line-height:1.6; }
body[data-ui-refinement] #ops-dialog .ops-kpi .ops-kpi-label { font-size:12px; line-height:1.5; }
body[data-ui-refinement] #ops-dialog .ops-kpi strong { font-size:28px; line-height:1.2; font-variant-numeric:tabular-nums; }
body[data-ui-refinement] #ops-dialog .ops-ticket { border-color:var(--ui-line); }
body[data-ui-refinement] #ops-dialog .ops-ticket.selected { border-color:rgba(106,207,202,.36); }
body[data-ui-refinement] #ops-dialog .ops-case-stages { flex-wrap:wrap; gap:10px; }
body[data-ui-refinement] #ops-dialog .ops-case-stages li span { width:21px; height:21px; line-height:19px; flex-shrink:0; }
body[data-ui-refinement] #ops-dialog .ops-ticket-top { flex-wrap:wrap; overflow-wrap:anywhere; }
body[data-ui-refinement] #ops-dialog .ops-times { gap:12px; }
@media(min-width:1280px) {
  body[data-ui-refinement] :is(#panel-left,#panel-right) { width:288px; }
}
@media(max-width:760px) {
  body[data-ui-page="editor"] .editor-panel { padding:16px; }
  body[data-ui-page="editor"] .view-title h1 { font-size:24px; }
  body[data-ui-page="editor"] .editor-head { gap:8px; }
  body[data-ui-page="editor"] .brand-lockup { min-width:0; gap:8px; }
  body[data-ui-page="editor"] .brand-lockup strong { font-size:14px; letter-spacing:0; }
  body[data-ui-page="editor"] .project-tools { gap:6px; }
  body[data-ui-page="editor"] .project-tools button { font-size:12px; padding:8px; max-width:88px; white-space:normal; line-height:1.4; }
  body[data-ui-page="editor"] .preview-actions { grid-template-columns:1fr; }
  body[data-ui-refinement] #agent-presence .agent-cards { grid-template-columns:1fr; }
  body[data-ui-refinement] #agent-presence .agent-card { min-height:0; }
  body[data-ui-refinement] #ops-dialog .ops-footer { max-height:64px; }
  body[data-ui-refinement] #ops-dialog .ops-auto-controls { flex-wrap:wrap; }
  body[data-ui-refinement] #ops-dialog .ops-auto-metrics { white-space:normal; flex-wrap:wrap; }
  body[data-ui-refinement] #mobile-alarm-peek b { font-size:13px; }
  body[data-ui-refinement] #mobile-alarm-peek small { font-size:12px; }
  body[data-ui-refinement] #ops-dialog .ops-case-stages li { flex-direction:row; }
}
@media(max-height:700px) {
  body[data-ui-page="editor"] .panel-progress { margin-bottom:12px; }
  body[data-ui-page="editor"] .view-title h1 { font-size:24px; }
}
