:root{--text:#1f2430;--text-muted:#6b7280;--bg:#f5f5f7;--panel-bg:#fff;--border:#d8d8de;--accent:#2563eb;--accent-hover:#1d4ed8;--danger:#dc2626;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;color:var(--text);background:var(--bg);font:15px/1.4 system-ui,Segoe UI,Roboto,sans-serif}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial;--text:#e5e7eb;--text-muted:#9ca3af;--bg:#14161c;--panel-bg:#1c1f27;--border:#30333d;--accent:#3b82f6;--accent-hover:#60a5fa}}*{box-sizing:border-box}body,h1,h2,h3{margin:0}button{font:inherit;cursor:pointer;border:1px solid var(--border);background:var(--panel-bg);color:var(--text);border-radius:6px;padding:6px 12px}button:hover:not(:disabled){border-color:var(--accent)}button:disabled{cursor:not-allowed;opacity:.5}input[type=text]{font:inherit;border:1px solid var(--border);background:var(--panel-bg);color:var(--text);border-radius:6px;padding:6px 10px}.app{grid-template-rows:auto auto 1fr;grid-template-columns:1fr clamp(230px,22vw,400px);gap:16px;min-height:100vh;padding:16px;display:grid}.app-header{z-index:20;background:color-mix(in srgb, var(--panel-bg) 80%, transparent);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);flex-wrap:wrap;grid-column:1/-1;justify-content:space-between;align-items:center;gap:16px;margin:-8px 0 0;padding:8px 0;display:flex;position:sticky;top:0}.clear-selection-button{border:1px solid var(--danger);color:var(--danger);white-space:nowrap;background:0 0;border-radius:6px;padding:6px 12px}.clear-selection-button:hover{background:color-mix(in srgb, var(--danger) 12%, transparent)}.export-error{color:var(--danger);background:color-mix(in srgb, var(--danger) 12%, transparent);border:1px solid var(--danger);border-radius:6px;grid-column:1/-1;padding:8px 12px}.export-bar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.export-bar-notes{resize:vertical;min-height:2.2em;font:inherit;flex:100%}.export-bar-checkbox{color:var(--text-muted);align-items:center;gap:4px;font-size:13px;display:flex}.visibility-panel-wrap{position:relative}.visibility-panel{z-index:10;border:1px solid var(--border);background:var(--panel-bg);border-radius:8px;flex-direction:column;gap:12px;width:280px;max-height:70vh;padding:12px;display:flex;position:absolute;top:calc(100% + 6px);right:0;overflow-y:auto;box-shadow:0 8px 24px #0003}.visibility-panel h4{color:var(--text-muted);margin:0 0 6px;font-size:13px}.visibility-panel-row{align-items:center;gap:6px;font-size:13px;display:flex}.visibility-panel-shots{flex-direction:column;gap:4px;margin:0 0 8px;padding:0;list-style:none;display:flex}.visibility-panel-shots .visibility-panel-row{justify-content:space-between}.shot-active{font-weight:600}.visibility-panel-empty{color:var(--text-muted);margin:0 0 8px;font-size:13px}.restore-banner{border:1px solid var(--accent);background:color-mix(in srgb, var(--accent) 12%, transparent);border-radius:6px;flex-wrap:wrap;grid-column:1/-1;justify-content:space-between;align-items:center;gap:16px;padding:10px 12px;display:flex}.restore-banner-actions{flex-shrink:0;gap:8px;display:flex}.export-hint{color:var(--text-muted);font-size:13px}.toolbar{border:1px solid var(--border);background:var(--panel-bg);border-radius:8px;flex-wrap:wrap;grid-column:1/-1;align-items:center;gap:16px;padding:10px 12px;display:flex}.toolbar-group{align-items:center;gap:6px;display:flex}.inline-field{color:var(--text-muted);align-items:center;gap:6px;font-size:13px;display:flex}.inline-field input{width:64px}.inline-field input.opacity-slider{width:110px}.ground-toggle{color:var(--text-muted);white-space:nowrap;align-items:center;gap:3px;font-size:11px;display:flex}.swatch--round{border-radius:50%}.toolbar button.active{border-color:var(--accent);color:var(--accent)}.board-area{top:var(--board-area-sticky-top,0px);grid-template-columns:1fr 1fr;align-self:start;align-items:start;gap:16px;display:grid;position:sticky}.board-panel{border:1px solid var(--border);background:var(--panel-bg);border-radius:8px;flex-direction:column;gap:8px;padding:12px;display:flex}.board-panel-header{justify-content:space-between;align-items:center;gap:8px;display:flex}.board-panel-header h2{margin:0}.board-panel-actions{align-items:center;gap:8px;display:flex}.board-canvas-wrap{line-height:0}.uploader{border:2px dashed var(--border);text-align:center;color:var(--text-muted);cursor:pointer;border-radius:8px;padding:24px}.uploader:hover{border-color:var(--accent)}.board-canvas{border:1px solid var(--border);background:#111;border-radius:4px;width:100%;height:auto;display:block}.board-area.fit-viewport .board-canvas{width:auto;max-width:100%;height:auto;max-height:calc(var(--viewport-fit-max-height,70vh) - 70px);margin:0 auto}.board-area.fit-viewport .board-canvas-wrap.is-zoomed{width:100%;height:calc(var(--viewport-fit-max-height,70vh) - 70px)}.board-area.fit-viewport .board-canvas-wrap.is-zoomed .board-canvas{width:100%;max-width:none;height:100%;max-height:none;margin:0}.tool-trace .board-canvas{cursor:crosshair}.tool-via .board-canvas,.tool-hole .board-canvas,.tool-testpoint .board-canvas,.tool-package .board-canvas{cursor:copy}.tool-pad .board-canvas{cursor:cell}.pad-shape{fill-opacity:.85;cursor:pointer}.via-marker{cursor:pointer}.via-marker--via.via-marker--linked{fill:#22c55e}.via-marker--via.via-marker--unlinked{fill:#f59e0b}.via-marker--hole{fill:#00000073}.via-marker--hole.via-marker--linked{stroke:#22c55e}.via-marker--hole.via-marker--unlinked{stroke:#f59e0b}.trace-pending{stroke:#38bdf8;stroke-dasharray:6 4;stroke-linecap:round;opacity:.85}.via-snap-target{fill:none;stroke:#38bdf8;stroke-width:2px;opacity:.9}.pad-shape.draggable{cursor:move}.pad-shape.picked,.via-marker.picked{outline-offset:2px;outline:2px dashed #38bdf8}.component-outline{fill:none;stroke:#94a3b8;stroke-width:1.5px;stroke-dasharray:4 3;cursor:pointer}.component-label{fill:#f8fafc;stroke:#000000d9;paint-order:stroke fill;cursor:pointer;font-family:inherit;font-weight:600}.pad-snap-target{fill:none;stroke:#38bdf8;stroke-width:2px;stroke-dasharray:5 3;opacity:.9}.size-preview-mark{fill:none;stroke:#38bdf8;stroke-linecap:round;opacity:.75}.ground{stroke:#e2e8f0;stroke-dasharray:3 2}.overlap-highlight{fill:none;stroke:#fbbf24;stroke-width:3px;stroke-dasharray:6 4;animation:.6s linear infinite overlap-marching}@keyframes overlap-marching{to{stroke-dashoffset:-10px}}.size-hint{fill:#f8fafc;stroke:#000000d9;paint-order:stroke fill;font-family:inherit;font-weight:600}.via-marker--ghost{fill:none;stroke:#38bdf8;stroke-width:1.5px;stroke-dasharray:4 3;opacity:.9}.selected{outline:2px solid var(--accent);outline-offset:1px}.dimmed{opacity:.18;transition:opacity .15s}.flash{animation:.9s ease-out flash-pulse}@keyframes flash-pulse{0%{filter:drop-shadow(0 0 0 var(--accent)) drop-shadow(0 0 0 var(--accent))}30%{filter:drop-shadow(0 0 10px var(--accent)) drop-shadow(0 0 18px var(--accent))}to{filter:drop-shadow(0 0 #0000)drop-shadow(0 0 #0000)}}.sidebar{flex-direction:column;gap:16px;display:flex}.sidebar-section{border:1px solid var(--border);background:var(--panel-bg);border-radius:8px;padding:12px}.sidebar-section-header{cursor:pointer;text-align:left;width:100%;color:inherit;background:0 0;border:none;align-items:center;gap:8px;padding:0;display:flex}.sidebar-section-header h3{flex:1;margin:0}.sidebar-section-caret{color:var(--text-muted);width:10px;font-size:11px}.sidebar-section-count{color:var(--text-muted);font-variant-numeric:tabular-nums;font-size:12px}.sidebar-section-body{max-height:40vh;overflow-y:auto}.item-list{flex-direction:column;gap:6px;margin:8px 0 0;padding:0;list-style:none;display:flex}.item-list li{border-radius:6px;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:4px 6px;display:flex}.item-list li.selected{background:color-mix(in srgb, var(--accent) 12%, transparent);outline:none}.item-list input[type=text]{flex:7em;min-width:0}.width-input{flex-shrink:0;width:5.5em}.scale-panel{flex-direction:column;gap:8px;margin-top:8px;display:flex}.field{min-width:0;color:var(--text-muted);flex-direction:column;flex:1;gap:2px;font-size:12px;display:flex}.field input,.field select{width:100%;min-width:0}.field-row{gap:8px;display:flex}.checkbox-field{min-width:0;color:var(--text-muted);flex:1;align-items:center;gap:6px;font-size:12px;display:flex}.checkbox-field input{flex-shrink:0}.item-id{cursor:pointer;overflow-wrap:anywhere;min-width:0;color:var(--text-muted);font-size:13px}.list-empty{color:var(--text-muted);margin:8px 0 0;font-size:13px}.swatch{border-radius:50%;flex-shrink:0;width:12px;height:12px;display:inline-block}.via-swatch.linked{background:#22c55e}.via-swatch.unlinked{background:#f59e0b}.via-swatch--hole{background:0 0;box-shadow:inset 0 0 0 3px}.via-swatch--hole.linked{color:#22c55e}.via-swatch--hole.unlinked{color:#f59e0b}.modal-backdrop{z-index:10;background:#00000080;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.modal{background:var(--panel-bg);border:1px solid var(--border);border-radius:8px;flex-direction:column;gap:8px;min-width:260px;max-width:360px;padding:16px;display:flex}.align-overlay{background:var(--panel-bg);border:1px solid var(--border);border-radius:8px;flex-direction:column;gap:12px;width:min(880px,92vw);max-height:92vh;padding:16px;display:flex;overflow-y:auto}.align-overlay-header h2{margin:0 0 4px}.align-hint{color:var(--text-muted);margin:0;font-size:13px}.align-picking{cursor:crosshair}.align-corner{fill:#38bdf8;stroke:#0b1220;stroke-width:1.5px}.align-corner-label{fill:#38bdf8;paint-order:stroke;stroke:#0b1220;stroke-width:3px;font-weight:600}.align-overlay-actions{justify-content:flex-end;gap:8px;display:flex}.schematic-view{background:var(--panel-bg);border:1px solid var(--border);border-radius:8px;flex-direction:column;gap:12px;width:min(1200px,94vw);max-height:92vh;padding:16px;display:flex;overflow-y:auto}.schematic-view-header h2{margin:0 0 4px}.schematic-view-body{border:1px solid var(--border);background:#fff;border-radius:6px;padding:8px;overflow:auto}.schematic-render svg{max-width:100%;height:auto;display:block}
