/* Navigation, disclosure and action controls have distinct visual identities.
   Selectors follow existing aria-selected, .active, open and aria-expanded state. */
html:root body .workspace-tabs [role=tab],
html:root body #tools [data-tool]{position:relative;background:transparent;border-color:transparent;border-radius:0;box-shadow:none;color:var(--lab-muted);font-weight:500;transition:color .15s,border-color .15s}
html:root body .workspace-tabs [role=tab]::after,
html:root body #tools [data-tool]::after{content:'';position:absolute;bottom:0;left:10px;right:10px;height:2px;background:transparent;pointer-events:none}
html:root body .workspace-tabs [role=tab]:hover,
html:root body #tools [data-tool]:hover{background:transparent;color:var(--lab-text);border-color:transparent}
html:root body .workspace-tabs [role=tab]:hover::after,
html:root body #tools [data-tool]:hover::after{background:var(--lab-border)}
html:root body .workspace-tabs [role=tab][aria-selected=true],
html:root body #tools [data-tool].active{background:transparent;color:var(--lab-accent);border-color:transparent;box-shadow:none;font-weight:700}
html:root body .workspace-tabs [role=tab][aria-selected=true]::after,
html:root body #tools [data-tool].active::after{background:var(--lab-accent)}
html:root body #tools{border-bottom:1px solid var(--lab-border);gap:4px}
html:root body .workspace-tabs{box-shadow:none}
/* Folder silhouettes are decorative layers: they never clip hit areas or focus rings. */
html:root body .catalog-group{background:transparent;border:0;border-radius:0;box-shadow:none;overflow:visible}
html:root body .catalog-group summary{position:relative;isolation:isolate;background:transparent;border:0;border-radius:0;padding:11px 12px;color:var(--lab-muted);overflow-wrap:break-word}
html:root body .catalog-group summary::before{content:'';position:absolute;inset:0 8px 0 0;z-index:-1;pointer-events:none;background:linear-gradient(var(--lab-border),var(--lab-border)) top/100% 1px no-repeat,var(--lab-control);clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,0 100%);border-left:1px solid var(--lab-border);border-bottom:1px solid var(--lab-border)}
html:root body .catalog-group summary:hover{background:transparent;color:var(--lab-text)}
html:root body .catalog-group[open] summary{color:var(--lab-accent);background:transparent}
html:root body .catalog-group[open] summary::before{background:linear-gradient(var(--lab-accent),var(--lab-accent)) top/100% 2px no-repeat,var(--lab-raised);border-left-color:var(--lab-accent);border-bottom:0}
html:root body .catalog-group[open] .catalog-items{background:var(--lab-raised);border:1px solid var(--lab-border);border-top:0;border-left-color:var(--lab-accent);border-radius:0 0 4px 4px}
/* Instrument label tabs attach directly to the housing; utilities remain separate. */
html:root body .workshop-panel{border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
html:root body .panel-head{background:transparent;border:0;padding:8px;position:relative;gap:2px}
html:root body .panel-head .panel-toggle{position:relative;isolation:isolate;background:transparent;border:0;border-radius:0;box-shadow:none;color:var(--lab-muted)}
html:root body .panel-head .panel-toggle::before{content:'';position:absolute;inset:-8px -4px -8px -8px;z-index:-1;pointer-events:none;clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,0 100%);background:linear-gradient(var(--lab-border),var(--lab-border)) top/100% 1px no-repeat,var(--lab-control);border-left:1px solid var(--lab-border);border-bottom:1px solid var(--lab-border)}
html:root body .panel-head .panel-toggle[aria-expanded=true]{color:var(--lab-accent)}
html:root body .panel-head .panel-toggle[aria-expanded=true]::before{background:linear-gradient(var(--lab-accent),var(--lab-accent)) top/100% 2px no-repeat,var(--lab-raised);border-left-color:var(--lab-accent);border-bottom:0}
html:root body .panel-head .panel-toggle:hover{color:var(--lab-text)}
html:root body .panel-head button:not(.panel-toggle){position:relative;background:var(--lab-control);border:1px solid var(--lab-border);border-radius:3px;box-shadow:none}
html:root body .workshop-panel>.panel-body{background:var(--lab-panel);border:1px solid var(--lab-border);border-left-color:var(--lab-accent);border-radius:0 0 4px 4px}
html:root body .meter.workshop-panel>.panel-body{background:#0d1d2a}
html:root body .workshop-panel:has(.panel-toggle[aria-expanded=true])>.panel-head{background:linear-gradient(transparent calc(100% - 1px),var(--lab-border) 0)}
/* Supplemental disclosures share the attached-label treatment, not instrument buttons. */
html:root body :is(.model,.inspector-help)>summary{border-left:2px solid var(--lab-border);padding-left:10px;color:var(--lab-muted)}
html:root body :is(.model,.inspector-help)[open]>summary{border-left-color:var(--lab-accent);color:var(--lab-accent)}
/* Real actions remain tangible recessed controls. */
html:root body button:not([role=tab]):not([data-tool]):not(.panel-toggle){box-shadow:inset 0 1px 2px #00000012;border-radius:5px 2px 5px 2px}
html:root body button:disabled{box-shadow:none}
@media(prefers-reduced-motion:reduce){html:root body .workspace-tabs [role=tab],html:root body #tools [data-tool]{transition:none}}
/* Override the earlier shared active-button rule, whose :is() includes an ID selector. */
html:root body .workspace-tabs [role=tab][aria-selected=true]{background:transparent!important;color:var(--lab-accent)!important;box-shadow:none!important;border-color:transparent!important}
/* A detachable meter retains its real controls and its original sidebar slot. */
html:root body [data-panel=meter]>.panel-head>.panel-toggle{touch-action:none;user-select:none;cursor:grab}
html:root body .panel-head .meter-dock{font-size:11px;padding:6px;min-height:32px}
html:root body .meter-probes{display:flex;gap:6px;margin:0 0 10px}
html:root body .meter-probes button{flex:1;min-width:0;font-size:13px;background:#1b3042;color:#edf5f9;border-color:#345269;min-height:40px}
html:root body .meter-probes button.active{border-color:#00c8e8;box-shadow:inset 0 -2px #00c8e8;color:#00c8e8}
html:root body .floating-meter{position:fixed;z-index:500;width:310px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);display:flex;flex-direction:column;filter:drop-shadow(0 8px 16px #0006);margin:0}
html:root body .floating-meter>.panel-head{flex:none;background:var(--lab-panel)}
html:root body .floating-meter>.panel-body{min-height:0;overflow:auto;overscroll-behavior:contain}
html:root body .floating-meter .panel-grip,html:root body .floating-meter [data-up],html:root body .floating-meter [data-down]{display:none}

.harness-choice{display:flex;gap:8px;margin:8px 0}.harness-choice button:first-child{flex:1;text-align:left}.wire-swatch{display:inline-block;width:32px;height:5px;margin-right:10px;vertical-align:middle}
