/* Circuit Lab — a quiet desktop workspace. UI-only preferences never alter circuits. */
:root{--ink:#1d1d1f;--muted:#737780;--green:#007aff;--light:#eaf3ff;--line:#e6e8ec;--bg:#f5f5f7;--blue:#007aff;--radius:14px;--mono:ui-monospace,SFMono-Regular,Menlo,monospace;color-scheme:light}
body{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC",sans-serif;background:var(--bg);color:var(--ink);font-size:13px;-webkit-font-smoothing:antialiased}
button,input,select{font-family:inherit}
button{border:1px solid #dedfe3;border-radius:8px;padding:7px 11px;background:white;color:#45464c;font-size:12px;min-height:32px;display:inline-flex;gap:6px;align-items:center;justify-content:center;transition:background .15s,color .15s,box-shadow .15s,transform .15s}
button:hover{background:#eceef2;border-color:#d8dade}
button:active:not(:disabled){transform:scale(.97)}
button:disabled{opacity:.3}
button.primary{background:#007aff;border-color:#007aff;color:white;font-weight:550;box-shadow:0 1px 2px #0048881a}
button.primary:hover{background:#006ee6;border-color:#006ee6}
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #007aff66;outline-offset:3px}
.quiet,.icon-button{background:transparent;border-color:transparent}
.icon-button{width:32px;height:32px;padding:7px;flex-shrink:0}
.ui-icon{width:17px;height:17px;display:inline-block;vertical-align:middle;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.topbar{height:62px;gap:13px;padding:0 20px;background:#ffffffda;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border-bottom:1px solid #0000000b}
.brand{gap:8px;min-width:119px}
.brand-icon{width:27px;height:27px;border-radius:8px;background:linear-gradient(145deg,#2994ff,#006be0);box-shadow:0 2px 6px #007aff21;display:grid;place-items:center;color:white}
.brand-icon .ui-icon{width:21px;height:21px;stroke-width:1.8}
.brand strong{font-size:15px;letter-spacing:-.35px;font-weight:620}
.brand em{display:none}
.project-name{gap:9px;min-width:100px;border-left:1px solid var(--line);padding-left:20px;margin-left:6px}
.project-icon{display:flex;color:#8c929d}
.project-name input{font-size:12px;width:210px;max-width:25vw;min-width:70px;font-weight:500;text-overflow:ellipsis;padding:5px 0}
.project-name #saveState{display:block;font-size:10px;white-space:nowrap;color:#8e939c}
.top-actions{gap:6px;flex-shrink:0}
.top-actions button{font-size:12px;min-height:32px}
.top-actions #runBtn{padding:7px 13px;min-width:100px}
.history-actions{display:flex;align-items:center;border-right:1px solid var(--line);padding-right:8px;margin-right:5px}
.history-actions button{border:0;width:29px;padding:6px}
.appbody{height:calc(100vh - 62px);min-height:0}
.sidebar{background:#f0f1f4cc;border-right:1px solid #e4e5e9;width:176px;padding:25px 12px 14px;gap:0;overflow:auto;transition:width .2s,padding .2s;scrollbar-width:thin}
.side-label{color:#8a8e97;font-size:10px;font-weight:550;letter-spacing:.1px;margin:0 10px 10px}
.side-label span{font-size:9px;color:#969ba3;letter-spacing:0}
nav{gap:5px}
nav button{width:100%;height:36px;justify-content:flex-start;font-size:12px;font-weight:450;gap:11px;border:0;background:transparent;padding:0 11px;color:#4b5059;border-radius:8px;white-space:nowrap}
nav button>.ui-icon{width:17px;height:17px;color:#8b919d}
nav button span{font-size:inherit;width:auto}
nav button.active{background:#dfeaff;color:#0069d9;font-weight:550}
nav button.active>.ui-icon{color:#007aff}
nav button small,nav button[data-view=pcb]{display:none}
.side-divider{background:transparent;height:1px;margin:17px 0}
.search-wrap{position:relative;margin:0 3px}
.search-wrap>span{position:absolute;left:9px;top:8px;color:#a0a4ac;display:flex}
.search-wrap .ui-icon{width:14px;height:14px}
.search{font-size:11px;width:100%;height:32px;padding:7px 8px 7px 29px;background:#e6e8ed91;border:1px solid transparent;border-radius:7px;color:#42474f;outline:none}
.search:focus{background:#fff;border-color:#c8dbf4}
.search::placeholder{color:#979ba4}
.library{gap:6px;margin:10px 3px 0;grid-template-columns:1fr 1fr}
.library button{display:flex;flex-direction:row;gap:6px;align-items:center;justify-content:flex-start;padding:8px;min-height:38px;border:1px solid #e4e6eac9;border-radius:8px;background:#ffffffa6;font-size:11px;color:#59616b}
.library button:hover{background:white;border-color:#c2d7f1;box-shadow:0 2px 5px #162a4010}
.library .symbol{font-size:17px;width:20px;height:20px;line-height:20px;color:#6b7b91;display:flex;align-items:center;justify-content:center}
.library .symbol .ui-icon{width:21px;height:21px;stroke-width:1.5}
.library small{display:none}
.library-empty{grid-column:1/-1;font-size:11px;color:#858b95;padding:15px 7px;line-height:1.8}
.templates{gap:3px}
.templates button{padding:6px 10px;min-height:30px;font-size:11px;text-align:left;justify-content:flex-start;border:0;background:transparent;color:#747b86}
.templates button .ui-icon{width:14px;height:14px;color:#9ba6b5}
.templates button span{margin:0}
.templates button:hover{background:#e6e9ef;color:#454b56}
.sidebar-bottom{padding-top:20px;margin-top:auto}
.sidebar-bottom>button{font-size:11px;gap:9px;min-height:34px;padding:7px 10px;color:#717986;border:0;background:transparent}
.sidebar-bottom>button>span:first-child{margin:0;display:flex;color:#8993a2}
.sidebar-bottom>button>span:last-child{font-size:9px;color:#858f9d}
.sidebar-bottom .help-link{margin:1px 0 0}
.sidebar-bottom .help-link .ui-icon{width:16px}
.local-note{font-size:9px;color:#969da8;padding:14px 10px 0;display:flex;align-items:center;gap:6px}
.dot{width:5px;height:5px;background:#37a56e}
.hide-sidebar .sidebar{width:0;padding-left:0;padding-right:0;border:0;overflow:hidden}
.hide-sidebar .sidebar>*{visibility:hidden}
main{padding:22px 22px 0;overflow:auto;min-width:0}
.workspace-header{margin-bottom:17px;gap:12px;min-height:50px}
h1{font-size:26px;font-weight:650;letter-spacing:-.9px;line-height:1.2}
.eyebrow{display:none}
#viewSubtitle{font-size:11px;color:#898e97;margin:7px 0 0;line-height:1.5}
.workspace-actions{display:flex;align-items:center;gap:10px}
.layout-picker{display:flex;padding:3px;background:#e8e9ee;border:1px solid #e2e4e9;border-radius:9px;gap:2px}
.layout-picker button{border:0;background:transparent;min-height:28px;padding:5px 10px;font-size:11px;color:#7d838e;border-radius:6px;gap:5px}
.layout-picker button .ui-icon{width:14px;height:14px}
.layout-picker button[aria-pressed=true]{background:#fff;color:#353a43;box-shadow:0 1px 4px #1f28321a}
.workspace-actions>.icon-button{color:#7c8591}
.sync-strip{height:27px;margin-bottom:12px;gap:10px;font-size:10px}
.sync-flow{gap:10px;color:#8a929e}
.sync-flow #syncBadge{font-weight:450;color:#5a7c6a}
.sync-divider{height:10px;width:1px;background:#d9dee5}
.engine-pill{border:0;background:transparent;padding:0;gap:5px;border-radius:0;font-size:10px}
.engine-pill select{color:#6f7f92;font-family:var(--mono);font-size:10px;max-width:120px}
.engine-pill>span{font-size:9px;color:#a3a9b2;border:0;padding-left:0}
.workbench-grid{display:grid;grid-template-columns:minmax(0,1fr) 208px;gap:16px;align-items:stretch}
.workbench-surface{min-width:0}
.editor-layout{height:350px;min-height:0;display:flex;gap:12px;border:0;background:transparent;border-radius:0;overflow:visible}
.drawing-panel,.pcb-panel{flex:1;min-width:0;min-height:0;border:1px solid #e1e4e9;border-radius:var(--radius);overflow:hidden;background:white;box-shadow:0 2px 4px #171b2503}
.drawing-panel{border-right:1px solid #e1e4e9}
.pcb-panel{background:#202a28;display:flex;flex-direction:column}
.editor-caption{height:42px;padding:0 13px;border-bottom:1px solid #eff0f4;background:white;flex-shrink:0}
.editor-caption strong{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:550}
.editor-caption strong>span{display:flex;margin:0;color:#8a96a7}
.editor-caption strong .ui-icon{width:15px;height:15px}
.editor-caption button{min-height:28px;height:28px;width:28px;padding:6px;font-size:13px;color:#9aa2ad}
.editor-caption .linked-label{font-size:9px;color:#959da7;font-variant-numeric:tabular-nums}
.canvas-toolbar{height:43px;gap:4px;padding:5px 8px;background:#fbfcfd;border-bottom:1px solid #eff0f4;flex-shrink:0}
.segmented{display:flex;gap:1px;padding:2px;background:#f0f2f5;border-radius:7px}
.segmented button,.canvas-toolbar .tool-cluster button{height:29px;min-height:29px;padding:5px 6px;border:0;background:transparent;border-radius:5px;font-size:10px;gap:5px;color:#848d9a}
.segmented button .ui-icon{width:15px;height:15px}
.segmented button span{display:none;font-size:10px;margin:0}
.segmented button.active{background:white;color:#007aff;box-shadow:0 1px 4px #22304b12}
.tool-cluster{gap:1px}
.tool-cluster button .ui-icon{width:15px;height:15px}
.tool-cluster button:hover{color:#36475e;background:#eef1f6}
.canvas-wrap{background:#fff;min-height:0;flex:1;overflow:hidden}
.canvas-wrap #circuitCanvas{width:100%;height:100%;min-height:0;background:white;user-select:none}
#circuitCanvas .circuit-component>g{stroke:#526071}
#circuitCanvas .circuit-component text{fill:#485463}
#circuitCanvas .circuit-component text+text{fill:#7f8b99}
#circuitCanvas .circuit-component.selected .selection-box{fill:#edf5ff;stroke:#a5caff;stroke-width:1;stroke-dasharray:none}
#circuitCanvas .pin{stroke:#7f92ac;fill:#fff;stroke-width:1.4}
#circuitCanvas .pin:hover{fill:#d6e9ff;stroke:#007aff;stroke-width:2.2}
.canvas-zoom{right:10px;bottom:10px;border:1px solid #e1e5ec;background:#ffffffeb;backdrop-filter:blur(12px);border-radius:8px;box-shadow:0 2px 9px #18304f08;padding:2px;display:flex;align-items:center;gap:0;color:#84909f;z-index:2}
.canvas-zoom button{width:25px;height:25px;min-height:25px;padding:5px;border:0;border-radius:5px;background:transparent}
.canvas-zoom button:hover{background:#eef3fa;color:#007aff}
.canvas-zoom button .ui-icon{width:13px;height:13px}
.canvas-zoom span:not(.zoom-separator){width:35px;font-size:9px;text-align:center;font-variant-numeric:tabular-nums}
.zoom-separator{display:block;width:1px;height:12px;background:#e2e6ed;margin:0 2px}
.canvas-footer{height:28px;min-height:28px;padding:0 11px;font-size:9px;color:#959eaa;border-color:#edf0f4;white-space:nowrap;overflow:hidden}
.canvas-footer #toolHint{display:none}
.board-tools{background:#fbfcfd;gap:4px}
.board-tools .segmented button{font-size:10px;padding:5px 6px;min-height:29px}
.board-tools .segmented button .ui-icon{width:14px;height:14px}
.board-tools select{font-family:inherit;color:#7f8a99;font-size:10px;min-height:28px;max-width:60px;width:60px;padding:0 2px;outline-color:#007aff;background:transparent;border:0}
.board-tools>button{width:27px;height:29px;min-height:29px;padding:6px;font-size:12px;border:0;background:transparent;color:#8994a3;border-radius:5px}
.board-tools>button .ui-icon{width:15px;height:15px}
.board-canvas-wrap{min-height:0;flex:1;position:relative}
#boardCanvas{min-height:0;height:100%;width:100%;user-select:none}
.board-legend{left:9px;top:9px;bottom:auto;gap:4px;font-size:8px;color:#a6b6b0;opacity:.8}
.board-legend span{width:8px;margin-left:3px}
.board-zoom{border-color:#56635e65;background:#2a3533de;color:#c6d0cb;box-shadow:0 2px 9px #0002}
.board-zoom button{color:#c5cec9}
.board-zoom button:hover{background:#ffffff12;color:#fff}
.board-zoom .zoom-separator{background:#6a7b733d}
.board-footer{background:#202a28;border-color:#3a46413d;color:#92a59a;font-size:8px}
.board-footer>span:last-child{display:none}
.route-hint{background:#202a28;font-size:8px;line-height:1.3;padding:3px 10px 7px;min-height:0;color:#96a89e;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.board-health{min-height:39px;margin:0;padding:8px 2px 0;background:transparent;border:0;border-radius:0;gap:8px;font-size:9px}
.board-health>div{gap:9px;flex-wrap:nowrap}
.board-health button{font-size:9px;min-height:25px;padding:3px 5px;border:0;white-space:nowrap}
.board-health .ui-icon{width:13px;height:13px}
.drc-label{font-family:inherit;font-size:9px;color:#8e97a3}
.drc-ok{color:#638673}
.drc-warn{color:#a5916d}
.drc-error{color:#c1694b}
.drc-pending{color:#919ba8}
#drcSummary{flex-wrap:wrap;gap:8px;min-width:0}
.wave-panel{margin-top:12px;border:1px solid #e1e4e9;border-radius:var(--radius);background:white;box-shadow:0 2px 4px #171b2503}
.wave-panel .panel-header{height:44px;min-height:44px;padding:8px 14px;gap:7px;border-bottom:1px solid #f0f1f4}
.panel-header>div{gap:8px}
.panel-header strong{font-size:12px;font-weight:550}
.panel-symbol{font-size:0;color:#8a98ab;display:flex}
.panel-symbol .ui-icon{height:17px;width:17px}
.analysis-shortcut{font-size:9px;color:#7e91aa;background:#f3f6fa;border:0;border-radius:5px;min-height:21px;padding:3px 7px}
.analysis-shortcut:hover{background:#e4efff;color:#007aff}
.panel-header .subtle{font-size:9px;color:#a0a7b1;white-space:nowrap}
.result-controls{gap:3px!important}
.result-controls button{min-height:26px;font-size:10px;padding:4px 5px}
.result-controls button .ui-icon{width:14px;height:14px}
.result-controls .icon-button{width:26px;height:26px}
.plot{height:153px;padding:0 8px}
.plot .legend{top:10px;right:18px;gap:12px}
.legend button{min-height:20px;font-size:9px;color:#7d8c9e;padding:0}
.legend i{width:12px;height:2px}
.plot svg text{fill:#8a94a3;font-size:10px}
.plot line{stroke:#eef1f5}
.plot-tooltip{background:#242c39eb;box-shadow:0 3px 15px #08132624;border-radius:8px;font-size:10px}
.metrics{gap:20px;padding:12px 17px;background:#fafbfc;border-top:1px solid #edf0f5;flex-wrap:wrap}
.metric{flex:1;min-width:70px}
.metric span{color:#959daa;font-size:9px;line-height:1.4;margin-bottom:6px}
.metric strong{font-size:14px;font-weight:500;color:#495b74;font-family:var(--mono);letter-spacing:-.25px}
#miniMetrics .metric:nth-child(-n+2){display:none}
.full-plot{height:490px}
.full-plot .plot-tooltip{font-size:11px}
.inspector{width:auto;min-width:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid #e1e4e9;padding:0;background:#fff;border-radius:var(--radius);box-shadow:0 2px 4px #171b2503}
.inspector-heading{height:43px;min-height:43px;display:flex;padding:0 13px;margin:0;align-items:center;border-bottom:1px solid #eff0f4;font-size:12px}
.inspector-heading strong{font-weight:550}
.inspector-heading .icon-button{width:26px;height:26px;min-height:26px;padding:5px;color:#9aa2ad}
.inspector-heading .ui-icon{width:14px;height:14px}
.inspector-tabs{display:flex;gap:1px;margin:13px 12px 0;background:#f0f1f4;padding:3px;border-radius:8px}
.inspector-tabs button{flex:1;min-height:28px;padding:5px 9px;border:0;border-radius:6px;background:transparent;font-size:11px;color:#989eaa}
.inspector-tabs button[aria-selected=true]{background:#fff;color:#495462;box-shadow:0 1px 4px #142c4212}
.inspector-scroll{padding:18px 14px;flex:1;min-height:0;overflow:auto;scrollbar-width:thin}
.selected-title{gap:10px;align-items:center;margin-bottom:22px}
.selected-title strong{border-radius:9px;background:#edf4ff;color:#3c77bf;padding:0;width:38px;height:38px;display:grid;place-items:center;font-size:13px;font-weight:500}
.selected-title span{font-size:12px;font-weight:500;color:#4f5966}
.selected-title small{font-size:9px;color:#a1a8b2;font-weight:400;margin-top:5px}
.inspector label{font-size:10px;color:#9098a4;gap:7px;margin-bottom:14px;line-height:1.4}
.inspector input,.inspector select{font-size:12px;color:#525e70;padding:9px 10px;height:35px;width:100%;border:1px solid #e1e5ec;border-radius:7px;background:#fbfcfe;box-shadow:0 1px 2px #14293f03;outline:none;transition:border-color .15s,box-shadow .15s}
.inspector input:focus,.inspector select:focus{border-color:#6aafff;box-shadow:0 0 0 3px #007aff12;background:#fff}
.inspector input:invalid{border-color:#dba390}
.property-label{border-top:1px solid #eff1f5;padding-top:19px;margin:21px 0 16px;font-size:11px;font-weight:500;color:#5f6c7f}
.property-label span{font-size:8px;font-weight:400;color:#a0a7b1;float:right;line-height:16px}
.xy-fields{gap:8px}
.pin-nets{gap:7px;flex-wrap:wrap;margin-top:5px}
.pin-nets button{font-family:var(--mono);font-size:10px;background:#f5f8fc;border-color:#e9eef5;min-height:29px;padding:4px 8px;color:#9aa8b8;gap:1px}
.pin-nets strong{color:#6185b1;font-size:10px;margin-left:6px}
.pin-nets button.active{background:#e7f1ff;border-color:#a6cbff}
.inspector-footnote{display:flex;align-items:center;gap:6px;border-top:1px solid #eff1f5;padding:13px 12px;color:#a1a9b5;font-size:9px;min-height:43px;background:#fcfdff}
.inspector-footnote .ui-icon{width:13px;height:13px}
.settings-title{font-size:12px;font-weight:550;margin-bottom:20px;color:#546173}
.auto-row{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #eff1f5;margin-top:21px;padding-top:20px;margin-bottom:23px}
.auto-row strong{display:block;font-size:11px;color:#626e7d;font-weight:500}
.auto-row small{display:block;font-size:9px;color:#a1aab6;margin-top:6px}
.inspector label.switch{position:relative;display:block;width:32px;height:19px;margin:0;flex-shrink:0}
.switch input{position:absolute;inset:0;width:32px;height:19px;opacity:0;margin:0;cursor:pointer;z-index:1}
.switch span{width:32px;height:19px;display:block;border-radius:20px;background:#d6dce4;transition:background .15s}
.switch span:after{content:'';position:absolute;left:2px;top:2px;width:15px;height:15px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0002;transition:transform .15s}
.switch input:checked+span{background:#34c759}
.switch input:checked+span:after{transform:translateX(13px)}
.switch input:focus-visible+span{outline:3px solid #007aff66;outline-offset:3px}
.secondary-action{width:100%;font-size:11px;background:#f4f8ff;border-color:#dce9fc;color:#3f7fc8}
.microcopy{font-size:10px;line-height:1.9;color:#a3aab5;margin-top:15px}
.empty-props{font-size:11px;color:#9aa4b2;line-height:2.1;padding:8px 2px}
.workspace-hint{display:flex;align-items:center;justify-content:center;gap:8px;min-height:29px;padding-top:8px;color:#a1a9b4;font-size:9px}
.workspace-hint .ui-icon{width:12px;height:12px}
.workspace-hint button{font-size:9px;min-height:22px;padding:1px 6px;color:#3c86de}
.statusbar{font-size:8px;color:#adb3bd;padding:10px 0 12px}
.status-sep{color:#d6dae1}
.inline-error{background:#fff8f1;border:1px solid #f3dec8;border-radius:10px;color:#9c7854;font-size:11px;padding:11px 14px;line-height:1.7}
.focus-pcb .editor-layout,.focus-schematic .editor-layout{height:420px}
.focus-pcb .drawing-panel,.focus-schematic .pcb-panel{display:none}
.focus-pcb .inspector{width:auto}
.focus-pcb #boardCanvas{min-height:0}
.focus-pcb .board-tools{justify-content:flex-start;gap:12px}
.focus-pcb .board-tools select{max-width:85px;width:85px}
.focus-pcb .board-tools button{font-size:11px}
.focus-pcb .route-hint{font-size:10px;min-height:24px}
.focus-pcb .board-legend{font-size:9px;top:15px;left:15px;bottom:auto}
.focus-schematic .segmented button span,.hide-inspector .segmented button span,.hide-sidebar .segmented button span{display:inline}
.hide-inspector .workbench-grid{grid-template-columns:minmax(0,1fr)}
.hide-inspector .inspector{display:none}
.hide-inspector #toggleInspector{color:#9ba5b2}
.view:not(#schematicView){border-radius:var(--radius);border-color:#e1e4e9}
.view:not(#schematicView)>.panel-header{min-height:50px}
.notice{background:#f6f9fd;color:#8896a8;border-color:#edf1f6;font-size:11px}
.view .full-plot{height:490px}
dialog{border:1px solid #ffffff80;border-radius:18px;box-shadow:0 30px 120px #16233d35;color:#424c5a;background:#fffffffa;max-height:82vh}
dialog::backdrop{background:#15243c35;backdrop-filter:blur(7px)}
.modal-header{padding:18px 22px;border-color:#eef0f5}
.modal-header h2{font-size:17px;font-weight:600;color:#3e4858}
.modal-header button{min-height:28px;color:#a0a8b4}
.modal-header+div{padding:20px 22px 24px}
#modalBody p{font-size:12px;line-height:1.9;color:#7c899b}
#modalBody pre{background:#f4f6f9;color:#62758c;border-radius:9px;padding:16px}
.connection-row{border-color:#edf1f6;padding:15px 0}
.connection-row span{color:#8a97a8}
.connection-row em{background:#eff7f3;color:#66937a}
#modalBody .option{border-color:#e7ebf1;border-radius:10px;padding:13px 14px;font-size:12px;background:#fbfcfe;color:#4f6079}
#modalBody .option:hover{background:#f1f6ff;border-color:#bdd8fa}
#modalBody .option small{font-size:10px;color:#9ba7b7}
#toast{background:#253247ed!important;backdrop-filter:blur(16px);border:1px solid #ffffff1a;border-radius:12px;font-size:12px;box-shadow:0 8px 25px #15345625;bottom:24px}
.error-banner{background:#fff7f2;color:#b17d60;border-radius:9px}
.metric-table th{color:#8799ae}
.metric-table td{color:#586d88}
.metric-table td,.metric-table th{border-color:#edf1f6}
.wire-ghost{pointer-events:none;stroke:#007aff;opacity:.65}
.wire-selected{stroke:#007aff!important}
.is-panning,.is-panning *{cursor:grabbing!important}
.can-pan #circuitCanvas,.can-pan #boardCanvas{cursor:grab}
.can-pan #circuitCanvas *,.can-pan #boardCanvas *{cursor:grab!important}
#uiTooltip{position:fixed;z-index:100;pointer-events:none;max-width:260px;font-size:10px;padding:7px 10px;background:#253348ef;color:#fff;border:1px solid #ffffff16;border-radius:7px;box-shadow:0 3px 10px #10234020;white-space:nowrap}
.spin{animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}
}
@media(min-width:1450px){.sidebar{width:190px;padding:27px 15px}
.workbench-grid{grid-template-columns:minmax(0,1fr) 230px;gap:20px}
.editor-layout{height:410px;gap:16px}
.segmented button span{display:inline}
.segmented button,.board-tools .segmented button{padding:5px 9px}
.board-tools select{width:74px;max-width:74px}
main{padding:25px 28px 0}
.plot{height:175px}
.full-plot{height:550px}
.inspector-scroll{padding:21px 18px}
.inspector input,.inspector select{font-size:13px}
.inspector label{font-size:11px}
.canvas-footer,.board-footer{font-size:10px}
.route-hint{font-size:9px}
.library button{font-size:12px}
.templates button{font-size:12px}
.topbar{padding:0 24px}
.project-name input{width:300px;max-width:28vw}
.board-health{font-size:10px}
.board-health button{font-size:10px}
.drc-label{font-size:10px}
.panel-header .subtle{font-size:10px}
}
@media(max-width:1200px){.project-name #saveState{display:none}
.project-name input{width:190px}
.topbar{gap:11px}
.sidebar{width:165px;padding:22px 10px 12px}
main{padding:20px 16px 0}
.workbench-grid{grid-template-columns:minmax(0,1fr) 198px;gap:12px}
.editor-layout{gap:10px;height:350px}
.inspector-scroll{padding:17px 12px}
.editor-caption{padding:0 10px}
.canvas-toolbar{padding:5px 6px}
.board-tools .segmented button{font-size:0;padding:5px 6px!important}
.board-tools .segmented button .ui-icon{width:16px;height:16px}
.board-tools select{font-size:9px;width:50px;max-width:50px}
.board-tools>button{width:25px;padding:5px!important}
.board-health>div{gap:6px}
.board-health{font-size:8px;gap:5px}
.board-health button{font-size:8px;padding:3px 4px}
.drc-label{font-size:8px}
.wave-panel .panel-header{padding:7px 11px}
.result-controls{gap:0!important}
.panel-header>div{gap:6px}
.result-controls button{font-size:9px}
.panel-header .subtle{font-size:8px}
.metrics{gap:14px;padding:12px 14px}
.metric strong{font-size:13px}
.metric span{font-size:8px}
.layout-picker button{padding:5px 8px}
.workspace-actions{gap:6px}
.focus-pcb .board-tools .segmented button{font-size:11px}
.focus-pcb .board-tools select{font-size:11px}
.focus-pcb .board-tools>button{width:30px}
}
@media(max-width:1000px){.project-name input{width:160px}
.project-name{padding-left:13px}
.top-actions #saveBtn{display:none}
.top-actions #projectsBtn{font-size:0;width:32px;padding:6px}
.sidebar{width:150px;padding:22px 8px 12px}
.library button{padding:7px 6px;gap:4px;font-size:10px}
.library .symbol{width:18px}
.workbench-grid{grid-template-columns:minmax(0,1fr) 180px;gap:10px}
.editor-layout{gap:8px;height:330px}
.inspector-scroll{padding:16px 11px}
.canvas-toolbar{gap:2px;padding:5px}
.canvas-toolbar .tool-cluster button{padding:5px 4px}
.board-tools>button{width:23px}
.linked-label{display:none}
.workspace-header{margin-bottom:14px}
.layout-picker button{font-size:10px;gap:4px;padding:5px 7px}
.layout-picker button .ui-icon{display:none}
.workbench-surface .subtle{display:none}
.board-health{align-items:flex-start;gap:3px}
.board-health>div{flex-wrap:wrap}
.board-health>div:last-child{justify-content:flex-end;flex-shrink:0;gap:0}
.drc-label{display:none}
.canvas-footer{font-size:8px}
h1{font-size:24px}
.brand{min-width:0}
.brand strong{font-size:14px}
.topbar{gap:9px;padding:0 14px}
.history-actions{padding-right:5px;margin-right:0}
.top-actions{gap:3px}
.top-actions #runBtn{min-width:90px;padding:7px 9px}
.top-actions #exportBtn{padding:7px 8px}
}
@media(max-width:850px){.sidebar{width:56px;padding:22px 7px}
.sidebar nav button{font-size:0;gap:0;padding:9px;width:40px}
.sidebar nav button>.ui-icon{width:19px;height:19px}
.side-label,.side-divider,.search-wrap,.library,.templates,.sidebar-bottom{display:none}
.workbench-grid{grid-template-columns:minmax(0,1fr)}
.inspector{display:none}
.show-small-inspector .inspector{display:flex;position:fixed;z-index:10;top:80px;right:18px;width:235px;height:calc(100vh - 110px);max-height:650px;box-shadow:0 15px 60px #1b314d2a}
.show-small-inspector .inspector:before{display:none}
.editor-layout{height:360px;display:flex}
.drawing-panel,.pcb-panel{height:auto}
.inspector-scroll #properties,.inspector-scroll #pcbProperties{grid-column:auto;grid-row:auto}
.inspector-heading{display:flex;grid-column:auto}
.inspector-tabs{display:flex}
.inspector label{display:flex}
.property-label{margin:21px 0 16px;padding-top:19px;border-top:1px solid #eff1f5}
.canvas-toolbar .segmented button span{display:inline}
.board-tools .segmented button{font-size:10px}
.board-health{font-size:9px}
.board-health button{font-size:9px}
.drc-label{display:inline}
.history-actions{display:none}
.project-name input{width:170px;max-width:28vw}
.brand strong{font-size:14px}
.brand{min-width:115px}
.engine-pill>span{display:none}
.focus-pcb .inspector{width:235px}
.workspace-hint{font-size:8px}
.view:not(#schematicView) .panel-header>div{flex-wrap:wrap}
.hide-inspector .inspector{display:none}
}
@media(max-width:560px){.topbar{height:56px;padding:0 10px;gap:8px}
.appbody{height:calc(100vh - 56px)}
.brand{min-width:0}
.brand strong{display:none}
.project-name{display:flex;padding-left:0;border:0;margin:0;min-width:0}
.project-icon{display:none}
.project-name input{font-size:11px;max-width:34vw;width:150px}
.top-actions #projectsBtn,.top-actions #exportBtn{display:none}
.top-actions #runBtn{min-width:81px;font-size:11px;padding:6px 8px}
.topbar #toggleSidebar{width:25px;padding:4px}
.sidebar{display:none}
main{padding:18px 12px 0}
.workspace-header{min-height:44px;margin-bottom:12px}
.workspace-actions{gap:4px}
.workspace-actions>.icon-button{width:28px}
h1{font-size:22px}
#viewSubtitle{font-size:10px}
.layout-picker{padding:2px}
.layout-picker button{padding:5px 7px;font-size:9px;min-height:26px}
.sync-strip{font-size:9px;margin-bottom:10px}
.editor-layout{display:flex;flex-direction:column;height:auto;gap:12px}
.drawing-panel,.pcb-panel{flex:none;height:330px}
.canvas-toolbar .segmented button span{display:inline}
.board-tools .segmented button{font-size:10px!important}
.board-tools select{width:65px;max-width:65px}
.board-health{padding-top:8px;min-height:42px}
.board-health>div{gap:6px}
.board-health>div:last-child{gap:0}
.drc-label{display:none}
.wave-panel .panel-header{height:44px;padding:8px 12px}
.metric strong{font-size:12px}
.metric span{font-size:8px}
.workspace-hint{gap:5px;font-size:8px}
.focus-pcb .editor-layout,.focus-schematic .editor-layout{height:410px}
.focus-pcb .pcb-panel,.focus-schematic .drawing-panel{height:100%}
.canvas-footer,.board-footer{font-size:9px}
.inspector .inspector-heading{grid-column:auto}
.focus-pcb .board-tools .segmented button{font-size:11px!important}
.show-small-inspector .inspector{top:68px;right:12px;height:calc(100vh - 90px)}
.statusbar{font-size:8px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
/* Keep labels intact and the desktop overview within a normal laptop window. */
.library button{flex-direction:column;justify-content:center;gap:5px;white-space:nowrap;min-height:53px;padding:7px 4px;font-size:11px}
.library .symbol{width:21px;height:20px}
.canvas-zoom .zoom-separator{width:1px;height:12px;flex-shrink:0;margin:0 2px}
.editor-layout{height:clamp(300px,calc(100vh - 545px),410px)}
.plot{height:148px}
.board-legend{font-size:8px;top:8px}
.inspector .microcopy{color:#8d99aa}
.focus-pcb .editor-layout,.focus-schematic .editor-layout{height:clamp(360px,calc(100vh - 480px),520px)}
@media(min-width:1450px){.editor-layout{height:clamp(350px,calc(100vh - 540px),470px)}
.plot{height:175px}
}
@media(max-width:850px){.editor-layout{height:350px}
.focus-pcb .editor-layout,.focus-schematic .editor-layout{height:420px}
}
@media(max-width:560px){.editor-layout{height:auto}
.focus-pcb .editor-layout,.focus-schematic .editor-layout{height:410px}
}

/* Secondary controls stay legible without competing with the canvas. */
.inspector label{color:#747f8e}
.selected-title small,.property-label span{color:#8692a1}
.templates button{color:#646f7e}
.canvas-footer{color:#7c8999}
.board-health{font-size:10px}
.board-health button,.drc-label{font-size:10px}
.drc-ok{color:#597462}
.metric span{color:#788595;font-size:9px}
.panel-header .subtle{color:#8290a1;font-size:9px}
.board-legend{color:#c6d2cb}
.route-hint,.board-footer{color:#b1c1b7}
