:root {
  color-scheme:dark;
  --bg:#0d1117;
  --header:#0b0f14;
  --surface:#161b22;
  --surface-hover:#21262d;
  --border:#30363d;
  --border-strong:#484f58;
  --text:#ffffff;
  --soft:#c9d1d9;
  --muted:#8b949e;
  --accent:#58a6ff;
  --accent-hover:#79c0ff;
  --accent-surface:rgba(88,166,255,.14);
  --accent-faint:rgba(88,166,255,.07);
  --teal:#56d4dd;
  --danger:#ffa198;
  --danger-border:rgba(248,81,73,.4);
  --danger-surface:rgba(248,81,73,.14);
  --canvas:var(--bg);
  --ink:var(--soft);
  --mono:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;
  --sans:Arial,Helvetica,sans-serif;
  font-family:var(--sans);
  font-synthesis:none
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-size:13px;
  -webkit-font-smoothing:antialiased
}
button,input,select,textarea {
  font:inherit
}
button,a,input,select,textarea {
  touch-action:manipulation
}
button {
  cursor:pointer
}
button:disabled {
  cursor:default;
  opacity:.35
}
button,input,textarea,select {
  outline:none
}
button:focus-visible,a:focus-visible,select:focus-visible,textarea:focus-visible,input:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px
}
button {
  border:0
}
button svg,.local-note svg {
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.5;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex-shrink:0
}
a {
  color:inherit;
  text-decoration:none
}
h1,h2,h3,p {
  margin:0
}
[hidden] {
  display:none!important
}
button {
  transition:background .16s,color .16s,border-color .16s,box-shadow .16s,transform .16s
}
kbd {
  font:10px var(--mono);
  border:1px solid currentColor;
  border-radius:6px;
  padding:1px 4px;
  opacity:.8;
  white-space:nowrap
}
.eyebrow {
  display:block;
  font-family:var(--mono);
  font-size:9px;
  letter-spacing:1.4px;
  line-height:1.6;
  color:var(--muted)
}
.status-dot {
  display:inline-block;
  width:5px;
  height:5px;
  background:var(--teal);
  border-radius:50%;
  flex-shrink:0
}
.site-header {
  position:sticky;
  top:0;
  z-index:30;
  min-height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:20px 8%;
  background:var(--header);
  border-bottom:1px solid var(--border)
}
.site-brand {
  flex-shrink:0;
  color:var(--text);
  font-size:30px;
  line-height:35px;
  font-weight:700
}
.site-nav {
  display:flex;
  align-items:center;
  gap:30px
}
.site-nav a {
  color:var(--text);
  font-size:16px;
  font-weight:600;
  line-height:20px;
  white-space:nowrap;
  transition:color .18s ease
}
.site-nav a:hover {
  color:var(--accent-hover)
}
.site-nav a[aria-current="page"] {
  color:var(--accent)
}
.app-header {
  height:91px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  border-bottom:1px solid var(--border);
  background:var(--bg);
  gap:20px
}
.header-identity,.header-actions,.file-actions {
  display:flex;
  align-items:center
}
.tool-heading .eyebrow {
  font-size:8px;
  letter-spacing:1.5px;
  color:var(--muted)
}
h1 {
  font-size:18px;
  line-height:1.6;
  letter-spacing:-.6px;
  font-weight:600
}
h1 span {
  font:10px var(--mono);
  letter-spacing:1.3px;
  color:var(--muted);
  margin-left:9px
}
.header-actions {
  gap:29px;
  min-width:0
}
.save-indicator {
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--soft);
  font-size:11px;
  white-space:nowrap
}
.file-actions {
  gap:7px;
  min-width:0;
  flex-wrap:wrap;
  justify-content:flex-end
}
.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:35px;
  padding:8px 11px;
  border-radius:10px;
  font-size:11px;
  font-weight:550;
  white-space:nowrap
}
.button-quiet {
  background:transparent;
  color:var(--soft);
  border:1px solid var(--border)
}
.button-quiet:hover {
  background:var(--surface-hover);
  border-color:var(--border-strong)
}
.button-primary {
  background:var(--accent);
  color:var(--bg);
  border:1px solid var(--accent);
  box-shadow:0 2px 7px rgba(0, 0, 0, 0.2)
}
.button-primary:hover {
  background:var(--accent-hover);
  border-color:var(--accent-hover);
  transform:translateY(-1px)
}
.button-secondary {
  background:var(--surface-hover);
  color:var(--soft);
  border:1px solid var(--border-strong)
}
.button-secondary:hover {
  background:var(--surface-hover);
  border-color:var(--border-strong)
}
.button-danger {
  background:transparent;
  color:var(--danger);
  border:1px solid var(--danger-border)
}
.button-danger:hover {
  background:var(--danger-surface);
  color:var(--danger)
}
.workspace {
  display:grid;
  grid-template-columns:238px minmax(340px,1fr) 302px;
  min-height:calc(100dvh - 204px)
}
.sidebar {
  background:var(--surface);
  padding:27px 20px 19px
}
.component-sidebar {
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column
}
.panel-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px
}
.panel-heading h2 {
  font-size:17px;
  font-weight:600;
  letter-spacing:-.7px;
  margin-top:4px
}
.section-number {
  font:25px var(--mono);
  font-weight:300;
  color:var(--border-strong);
  letter-spacing:-1px
}
.panel-description {
  margin:14px 0 23px;
  font-size:11px;
  line-height:1.9;
  color:var(--muted);
  letter-spacing:-.15px
}
.component-palette {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px
}
.component-card {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:80px;
  padding:9px 4px 8px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  color:var(--soft);
  user-select:none;
  -webkit-user-select:none
}
.component-card>svg {
  width:51px;
  height:32px;
  stroke:var(--soft);
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
  fill:none;
  flex-shrink:0;
  margin-bottom:6px
}
.component-card>span {
  font-size:10px;
  font-weight:500;
  display:flex;
  align-items:center;
  gap:4px;
  white-space:nowrap
}
.component-card small {
  font:8px var(--mono);
  color:var(--muted)
}
.component-card:hover {
  background:var(--surface-hover);
  border-color:var(--border-strong);
  transform:translateY(-1px)
}
.component-card.active,.component-card[aria-pressed=true] {
  background:var(--accent-surface);
  border-color:var(--accent);
  box-shadow:inset 0 0 0 1px var(--accent-surface)
}
.component-card.active>svg {
  stroke:var(--accent-hover)
}
.component-card.active small {
  color:var(--accent)
}
.selection-section {
  padding:23px 0 21px;
  border-bottom:1px solid var(--border)
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}
.section-heading h3 {
  font-size:11px;
  font-weight:600
}
.tiny-label {
  color:var(--muted);
  font:8px var(--mono);
  letter-spacing:.8px
}
.selection-hint {
  color:var(--muted);
  font-size:10px;
  margin-top:12px;
  line-height:1.8
}
.selection-section:has(#selection-panel:not([hidden])) .selection-hint {
  display:none
}
.property-fields {
  display:grid;
  grid-template-columns:.9fr 1.1fr;
  gap:8px;
  margin:14px 0 10px
}
.property-fields label {
  display:block;
  font-size:10px;
  color:var(--muted)
}
.property-fields input {
  width:100%;
  height:34px;
  display:block;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--bg);
  color:var(--soft);
  font:12px var(--mono);
  padding:7px 9px;
  margin-top:6px
}
.property-fields input:focus {
  border-color:var(--accent)
}
.property-actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px
}
.property-actions .button {
  font-size:10px;
  min-height:31px;
  padding:6px
}
.property-actions svg {
  width:14px;
  height:14px
}
.property-actions kbd {
  font-size:8px;
  padding:0 3px
}
.placed-section {
  padding-top:21px;
  flex:1;
  min-height:130px
}
.placed-list {
  margin-top:13px;
  max-height:240px;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:var(--border-strong) transparent
}
.placed-list:empty:after {
  content:"배치된 부품이 없습니다.";
  display:block;
  font-size:10px;
  color:var(--muted);
  padding:4px 0
}
.placed-list button,.component-row {
  display:flex;
  width:100%;
  align-items:center;
  justify-content:space-between;
  text-align:left;
  border:1px solid transparent;
  border-radius:8px;
  background:transparent;
  color:var(--soft);
  padding:7px 8px;
  font:11px var(--mono);
  gap:8px
}
.placed-list button:hover,.component-row:hover {
  background:var(--surface-hover)
}
.placed-list button.active,.component-row.active {
  background:var(--accent-surface);
  border-color:var(--accent);
  color:var(--accent)
}
.placed-list button span:last-child,.component-row span:last-child {
  color:var(--muted);
  font-size:10px
}
.local-note {
  display:flex;
  gap:8px;
  align-items:flex-start;
  border-top:1px solid var(--border);
  padding-top:17px;
  margin-top:24px;
  color:var(--muted)
}
.local-note svg {
  width:17px;
  height:17px;
  color:var(--teal);
  margin-top:1px
}
.local-note p {
  font-size:9px;
  line-height:1.9
}
.canvas-panel {
  min-width:0;
  display:flex;
  flex-direction:column;
  background:var(--canvas);
  color:var(--ink)
}
.canvas-toolbar {
  height:59px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  padding:0 19px;
  border-bottom:1px solid var(--border);
  gap:13px;
  background:var(--surface)
}
.mode-tools,.history-tools {
  display:flex;
  align-items:center;
  gap:3px
}
.tool-button {
  display:flex;
  align-items:center;
  gap:6px;
  background:transparent;
  color:var(--muted);
  border-radius:8px;
  font-size:10px;
  padding:8px 9px;
  min-height:31px;
  white-space:nowrap
}
.tool-button svg {
  width:15px;
  height:15px;
  stroke-width:1.6
}
.tool-button kbd {
  font-size:8px;
  padding:0 3px;
  margin-left:3px;
  opacity:.7
}
.tool-button.active {
  color:var(--accent);
  background:var(--accent-surface)
}
.tool-button:hover {
  background:var(--surface-hover)
}
.tool-button.active:hover {
  background:var(--accent-surface)
}
.history-tools {
  border-left:1px solid var(--border);
  padding-left:11px
}
.icon-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  width:28px;
  height:29px;
  color:var(--muted);
  background:transparent;
  flex-shrink:0
}
.icon-button:hover {
  color:var(--text);
  background:var(--surface-hover)
}
.icon-button svg {
  width:17px;
  height:17px
}
.canvas-toolbar-end {
  margin-left:auto
}
.text-button {
  font-size:10px;
  color:var(--muted);
  background:transparent;
  white-space:nowrap;
  padding:8px
}
.text-button:hover {
  color:var(--danger);
  background:var(--danger-surface);
  border-radius:6px
}
.canvas-wrap {
  flex:1;
  min-height:550px;
  position:relative;
  overflow:hidden;
  background-color:var(--canvas);
  isolation:isolate
}
.canvas-document-label {
  position:absolute;
  top:23px;
  left:26px;
  z-index:2;
  pointer-events:none;
  display:flex;
  align-items:center;
  gap:7px;
  font-size:10px;
  color:var(--muted)
}
.document-dot {
  height:5px;
  width:5px;
  background:var(--teal);
  border-radius:50%
}
.canvas-document-label>span:last-child {
  font:8px var(--mono);
  letter-spacing:.7px;
  color:var(--muted);
  margin-left:8px
}
#canvas {
  display:block;
  position:absolute;
  inset:0;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  overflow:visible
}
.command-preview {
  fill:none;
  stroke:#58a6ff;
  stroke-width:2.4;
  stroke-linecap:round;
  stroke-linejoin:round;
  opacity:.65;
  pointer-events:none
}
#canvas[data-tool=wire] {
  cursor:crosshair
}
#canvas[data-tool=pan] {
  cursor:grab
}
#canvas.is-panning {
  cursor:grabbing
}
.zoom-controls {
  position:absolute;
  bottom:22px;
  left:23px;
  background:rgba(22, 27, 34, 0.94);
  backdrop-filter:blur(8px);
  border:1px solid var(--border);
  box-shadow:0 3px 12px rgba(0, 0, 0, 0.2);
  border-radius:10px;
  display:flex;
  align-items:center;
  gap:2px;
  padding:4px;
  z-index:2
}
.zoom-controls .icon-button {
  width:25px;
  height:25px
}
.zoom-controls #zoom-label {
  font:10px var(--mono);
  min-width:41px;
  text-align:center;
  color:var(--muted)
}
.zoom-divider {
  height:15px;
  width:1px;
  background:var(--border);
  margin:0 4px
}
.canvas-corner {
  position:absolute;
  bottom:31px;
  right:25px;
  pointer-events:none;
  color:var(--muted);
  font:8px var(--mono);
  letter-spacing:1.1px
}
.canvas-status {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:35px;
  flex-shrink:0;
  padding:6px 19px;
  background:var(--surface);
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:9px
}
#status-message {
  display:flex;
  align-items:center;
  gap:7px;
  line-height:1.6
}
#status-message .status-dot {
  width:4px;
  height:4px;
  background:var(--teal)
}
.circuit-stats {
  display:flex;
  align-items:center;
  gap:16px;
  white-space:nowrap;
  color:var(--muted);
  font:9px var(--mono)
}
.circuit-stats strong {
  font-weight:500;
  color:var(--soft);
  margin-left:3px
}
.grid-stat {
  font-size:8px;
  color:var(--muted);
  border-left:1px solid var(--border);
  padding-left:15px
}
.component {
  cursor:grab
}
.component:active {
  cursor:grabbing
}
.component-symbol {
  stroke:var(--text);
  stroke-width:2.3;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round
}
.component-label {
  font:600 15px var(--mono);
  fill:var(--text);
  pointer-events:none
}
.component-value {
  font:12px var(--mono);
  fill:var(--soft);
  pointer-events:none
}
.mos-pin-label {
  fill:var(--soft)
}
.wire {
  stroke:var(--teal);
  stroke-width:2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
  cursor:pointer
}
.wire:hover {
  stroke:var(--accent);
  stroke-width:3
}
.wire.selected {
  stroke:var(--accent);
  stroke-width:3
}
.component.selected .component-symbol {
  stroke:var(--accent)
}
.component.selected .component-label {
  fill:var(--accent)
}
.component .selection-box {
  fill:var(--accent-faint);
  stroke:var(--accent);
  stroke-dasharray:5 4;
  stroke-width:1
}
.pin {
  fill:var(--canvas);
  stroke:var(--teal);
  stroke-width:1.5;
  cursor:crosshair
}
.pin:hover,.pin.active {
  fill:var(--accent);
  stroke:var(--accent);
  stroke-width:2
}
.preview-wire {
  stroke:var(--accent);
  stroke-width:2;
  fill:none;
  stroke-dasharray:6 5;
  pointer-events:none
}
.junction {
  fill:var(--teal)
}
.component .symbol-fill {
  fill:var(--canvas)
}
.component.selected .symbol-fill {
  fill:var(--canvas)
}
.netlist-sidebar {
  border-left:1px solid var(--border);
  display:flex;
  flex-direction:column;
  padding:27px 20px 19px
}
.netlist-sidebar .panel-description {
  margin-bottom:24px
}
.field-label {
  font-size:10px;
  color:var(--muted);
  display:block;
  margin-bottom:9px
}
.select-wrap {
  position:relative
}
.select-wrap select {
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  height:38px;
  padding:0 33px 0 11px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--soft);
  font-size:11px
}
.select-wrap>svg {
  width:14px;
  height:14px;
  position:absolute;
  right:12px;
  top:12px;
  fill:none;
  stroke:var(--soft);
  stroke-width:1.5;
  pointer-events:none
}
.editor-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:25px 0 10px;
  gap:8px
}
.editor-heading>label {
  font:10px var(--mono);
  letter-spacing:1.3px;
  color:var(--soft)
}
.editor-heading>span {
  display:flex;
  align-items:center;
  gap:5px;
  font:7px var(--mono);
  letter-spacing:.4px;
  color:var(--teal)
}
.editor-heading .status-dot {
  width:3px;
  height:3px
}
.netlist-editor {
  display:flex;
  flex-direction:column;
  min-height:260px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--bg);
  overflow:hidden;
  box-shadow:inset 0 2px 7px rgba(0, 0, 0, 0.25)
}
.netlist-editor textarea {
  color:var(--soft);
  background:transparent;
  width:100%;
  flex:1;
  min-height:226px;
  resize:vertical;
  padding:17px 14px 12px;
  border:none;
  font:12px/2 var(--mono);
  letter-spacing:.1px;
  tab-size:2;
  scrollbar-width:thin;
  scrollbar-color:var(--border-strong) transparent;
  white-space:pre
}
.netlist-editor:focus-within {
  border-color:var(--accent)
}
.netlist-editor textarea:focus-visible {
  outline:none
}
.editor-footer {
  border-top:1px solid var(--border);
  padding:8px 12px;
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font:8px var(--mono);
  line-height:1.2
}
.netlist-actions {
  display:flex;
  gap:8px;
  margin-top:12px
}
.netlist-actions .button {
  font-size:10px;
  flex:1;
  min-height:36px;
  padding:8px
}
.netlist-actions .button svg {
  width:15px;
  height:15px
}
.syntax-help {
  border-top:1px solid var(--border);
  margin-top:25px;
  padding-top:19px
}
.syntax-help summary {
  cursor:pointer;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:10px;
  color:var(--soft);
  user-select:none
}
.syntax-help summary::-webkit-details-marker {
  display:none
}
.syntax-help summary>svg {
  width:13px;
  height:13px;
  fill:none;
  stroke:var(--muted);
  stroke-width:1.5;
  transform:rotate(-90deg);
  transition:transform .2s
}
.syntax-help[open] summary>svg {
  transform:rotate(0)
}
.syntax-body {
  margin-top:14px;
  color:var(--muted);
  font-size:10px;
  line-height:1.9
}
.syntax-body>code {
  color:var(--muted);
  background:var(--surface-hover);
  border:1px solid var(--border);
  border-radius:6px;
  font:9px/1.6 var(--mono);
  display:block;
  padding:8px;
  letter-spacing:-.3px;
  white-space:nowrap
}
.syntax-body>p {
  margin-top:11px;
  font-size:10px;
  word-break:keep-all
}
.syntax-body code {
  font-family:var(--mono)
}
.syntax-example {
  display:flex;
  align-items:center;
  gap:11px;
  border-left:2px solid var(--border-strong);
  padding-left:9px;
  margin:13px 0;
  color:var(--soft);
  font-size:9px
}
.syntax-example>span {
  color:var(--muted);
  font-size:9px
}
.syntax-example>code {
  font-size:10px
}
.syntax-body .muted {
  color:var(--muted);
  font-size:9px;
  line-height:1.8
}
.netlist-bottom {
  display:flex;
  align-items:center;
  gap:13px;
  margin-top:auto;
  padding-top:31px;
  color:var(--muted)
}
.little-cross {
  font-size:31px;
  font-weight:200;
  color:var(--teal);
  line-height:1
}
.netlist-bottom p {
  font-size:10px;
  line-height:1.9;
  letter-spacing:-.1px
}
.netlist-bottom strong {
  font-weight:500;
  color:var(--muted)
}
.app-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:37px;
  padding:8px 22px;
  gap:16px;
  background:var(--header);
  border-top:1px solid var(--border);
  color:var(--muted);
  font:8px var(--mono);
  letter-spacing:.6px
}
.app-footer>span:first-child {
  display:flex;
  align-items:center;
  gap:7px
}
.footer-mark {
  height:4px;
  width:4px;
  border:1px solid var(--border-strong)
}
.app-footer p {
  font-family:var(--sans);
  font-size:9px;
  letter-spacing:0;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:5px
}
.app-footer i {
  font-style:normal;
  margin:0 4px;
  color:var(--muted)
}
.app-footer kbd {
  font-size:8px;
  border-color:var(--border-strong);
  opacity:.85;
  line-height:1.2;
  padding:1px 3px
}
.footer-version {
  font-size:7px;
  color:var(--muted);
  letter-spacing:1px
}
.capture-dialog {
  width:min(1100px, calc(100vw - 48px));
  max-height:calc(100dvh - 48px);
  margin:auto;
  padding:0;
  overflow:auto;
  border:1px solid var(--border-strong);
  border-radius:14px;
  background:var(--surface);
  color:var(--text);
  box-shadow:0 24px 100px rgba(0,0,0,.55);
  scrollbar-width:thin;
  scrollbar-color:var(--border-strong) transparent
}
.capture-dialog::backdrop {
  background:rgba(0,0,0,.72);
  backdrop-filter:blur(4px)
}
.cadence-content {
  padding: 18px 24px 16px;
  color: #c9d1d9;
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
}
.cadence-content p { margin: 0 0 12px; }
.cadence-content label { display: block; margin-bottom: 6px; font-weight: 600; }
.cadence-content textarea {
  display: block;
  width: 100%;
  height: min(34vh, 260px);
  resize: vertical;
  padding: 12px;
  color: #c9d1d9;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  font: 12px/1.5 monospace;
  white-space: pre;
}
#cadence-info { color: #8b949e; margin: 8px 0 0; }
.capture-dialog[open] {
  display:flex;
  flex-direction:column
}
.capture-heading {
  flex-shrink:0;
  padding:22px 24px 18px;
  border-bottom:1px solid var(--border)
}
.capture-heading .eyebrow {
  color:var(--accent);
  font-size:9px;
  letter-spacing:1.1px
}
.capture-heading h2 {
  margin-top:5px;
  font-size:21px;
  line-height:1.5;
  font-weight:600
}
.capture-heading p {
  margin-top:7px;
  color:var(--muted);
  font-size:12px;
  line-height:1.7
}
.capture-preview {
  min-width:0;
  min-height:260px;
  max-height:calc(100dvh - 290px);
  margin:20px 24px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
  background:#ffffff;
  color:#172b42;
  scrollbar-width:thin;
  scrollbar-color:#8b949e #ffffff
}
.capture-preview>svg {
  display:block;
  max-width:100%;
  height:auto;
  margin:auto
}
.capture-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  flex-shrink:0;
  gap:16px;
  padding:16px 24px;
  border-top:1px solid var(--border);
  background:var(--bg)
}
.capture-options {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  min-width:0;
  gap:10px 16px
}
.capture-options label {
  display:flex;
  align-items:center;
  gap:9px;
  color:var(--soft);
  font-size:12px
}
.capture-options select {
  min-height:34px;
  padding:6px 28px 6px 10px;
  border:1px solid var(--border-strong);
  border-radius:8px;
  background:var(--surface);
  color:var(--text);
  font:12px var(--mono)
}
#capture-info {
  min-width:0;
  color:var(--muted);
  font-size:11px;
  line-height:1.7;
  overflow-wrap:anywhere
}
#capture-info.error {
  color:var(--danger)
}
.capture-actions {
  display:flex;
  gap:8px;
  margin-left:auto
}
.capture-actions .button {
  min-height:36px;
  padding:9px 15px;
  font-size:12px
}
@media(min-width:1600px) {
  .workspace {
    grid-template-columns:264px minmax(450px,1fr) 326px
  }
  .sidebar {
    padding-left:25px;
    padding-right:25px
  }
  .component-card {
    min-height:87px
  }
  .canvas-wrap {
    min-height:650px
  }
  .netlist-editor {
    min-height:300px
  }
  .netlist-editor textarea {
    min-height:266px
  }
}
@media(max-width:1190px) {
  .app-header {
    padding:0 20px
  }
  .header-actions {
    gap:15px
  }
  .save-indicator {
    font-size:10px
  }
  .workspace {
    grid-template-columns:210px minmax(290px,1fr) 270px
  }
  .sidebar {
    padding-left:15px;
    padding-right:15px
  }
  .component-card>span {
    font-size:9px;
    gap:3px
  }
  .component-card>svg {
    width:45px
  }
  .component-card small {
    font-size:7px
  }
  .canvas-toolbar {
    padding:0 12px;
    gap:8px
  }
  .tool-button {
    padding:8px 7px;
    gap:4px
  }
  .tool-button kbd {
    display:none
  }
  .history-tools {
    padding-left:6px
  }
  .canvas-status {
    padding:6px 12px
  }
  .grid-stat {
    display:none
  }
  .circuit-stats {
    gap:9px
  }
  .canvas-document-label {
    left:20px
  }
  .canvas-document-label>span:last-child {
    display:none
  }
  .syntax-body>code {
    font-size:8px;
    letter-spacing:-.5px
  }
  .editor-heading>span {
    font-size:6px
  }
  .header-actions .button {
    font-size:10px;
    padding:8px
  }
  .app-footer {
    padding:8px 15px
  }
  .app-footer>span:first-child {
    font-size:7px
  }
  .footer-version {
    display:none
  }
}
@media(max-width:980px) {
  .app-header {
    height:82px;
    padding:0 18px;
    gap:15px
  }
  .tool-heading h1 {
    font-size:16px
  }
  .tool-heading h1>span {
    display:none
  }
  .tool-heading .eyebrow {
    font-size:7px
  }
  .save-indicator {
    display:none
  }
  .file-actions {
    gap:5px
  }
  .workspace {
    grid-template-columns:185px minmax(300px,1fr) 240px;
    min-height:calc(100dvh - 195px)
  }
  .panel-heading h2 {
    font-size:15px
  }
  .panel-heading .eyebrow {
    font-size:7px;
    letter-spacing:1px
  }
  .section-number {
    font-size:21px
  }
  .panel-description {
    font-size:10px;
    margin-top:12px
  }
  .component-palette {
    gap:5px
  }
  .component-card {
    min-height:73px
  }
  .component-card>span {
    font-size:8px;
    flex-direction:column;
    gap:3px
  }
  .component-card>svg {
    width:40px;
    height:26px;
    margin-bottom:5px
  }
  .component-card small {
    font-size:7px
  }
  .tiny-label {
    font-size:6px;
    letter-spacing:.5px
  }
  .sidebar {
    padding-left:13px;
    padding-right:13px
  }
  .section-heading h3 {
    font-size:10px
  }
  .canvas-toolbar {
    padding:0 10px;
    gap:6px
  }
  .tool-button span {
    display:none
  }
  .tool-button {
    padding:7px 9px
  }
  .canvas-toolbar .icon-button {
    width:24px
  }
  .text-button {
    padding:6px;
    font-size:9px
  }
  .canvas-document-label {
    font-size:9px;
    left:17px
  }
  .canvas-corner {
    font-size:6px;
    right:14px
  }
  .canvas-status {
    font-size:8px;
    gap:6px;
    padding-left:10px;
    padding-right:10px
  }
  .circuit-stats {
    font-size:8px;
    gap:6px
  }
  .netlist-actions .button {
    font-size:9px;
    padding:7px 5px;
    gap:4px
  }
  .netlist-actions .button svg {
    width:12px
  }
  .editor-heading>span {
    font-size:5px;
    letter-spacing:0
  }
  .editor-heading>label {
    font-size:9px
  }
  .syntax-body>code {
    font-size:7px;
    padding:7px 6px
  }
  .syntax-body>p {
    font-size:9px
  }
  .netlist-editor textarea {
    font-size:11px;
    padding:14px 11px
  }
  .property-actions .button {
    font-size:9px
  }
  .local-note p {
    font-size:8px
  }
  .local-note {
    gap:5px
  }
  .app-footer p {
    font-size:8px;
    gap:4px
  }
  .app-footer i {
    margin:0 2px
  }
}
@media(max-width:800px) {
  .site-header {
    min-height:0;
    flex-direction:column;
    align-items:center;
    gap:14px;
    padding:17px 20px 14px
  }
  .site-nav {
    width:100%;
    justify-content:center;
    gap:30px
  }
  .site-nav a {
    padding:5px 0
  }
  .app-header {
    height:auto;
    min-height:78px;
    flex-wrap:wrap;
    padding:16px 16px 13px;
    gap:14px
  }
  .header-identity {
    width:100%;
    justify-content:flex-start
  }
  .tool-heading {
    display:flex;
    align-items:baseline;
    gap:9px
  }
  .tool-heading>.eyebrow {
    display:none
  }
  .tool-heading h1 {
    font-size:16px
  }
  .tool-heading h1>span {
    display:inline;
    font-size:8px
  }
  .header-actions {
    width:100%;
    justify-content:space-between;
    flex-wrap:wrap;
    row-gap:10px
  }
  .save-indicator {
    display:flex;
    font-size:9px
  }
  .file-actions .button {
    min-height:32px;
    font-size:9px;
    padding:6px 8px
  }
  .file-actions .button svg {
    width:13px;
    height:13px
  }
  .workspace {
    grid-template-columns:175px minmax(0,1fr);
    min-height:0
  }
  .component-sidebar {
    grid-column:1;
    grid-row:1
  }
  .canvas-panel {
    grid-column:2;
    grid-row:1;
    min-height:640px
  }
  .canvas-wrap {
    min-height:545px
  }
  .netlist-sidebar {
    grid-column:1/-1;
    grid-row:2;
    border-left:0;
    border-top:1px solid var(--border);
    padding:23px 24px;
    display:grid;
    grid-template-columns:1fr 1fr;
    column-gap:28px;
    align-content:start
  }
  .netlist-sidebar .panel-heading {
    grid-column:1
  }
  .netlist-sidebar .panel-description {
    grid-column:1;
    margin-bottom:18px
  }
  .netlist-sidebar>.field-label {
    grid-column:1
  }
  .netlist-sidebar .select-wrap {
    grid-column:1
  }
  .netlist-sidebar .editor-heading {
    grid-column:2;
    grid-row:1;
    margin:0 0 12px;
    align-self:end
  }
  .netlist-sidebar .netlist-editor {
    grid-column:2;
    grid-row:2/7;
    min-height:240px
  }
  .netlist-sidebar .netlist-editor textarea {
    min-height:205px;
    font-size:12px
  }
  .netlist-sidebar .netlist-actions {
    grid-column:2;
    grid-row:7
  }
  .netlist-sidebar .syntax-help {
    grid-column:1;
    grid-row:5/9;
    margin-top:22px
  }
  .netlist-sidebar .syntax-body>code {
    font-size:9px;
    letter-spacing:-.2px
  }
  .netlist-sidebar .netlist-bottom {
    display:none
  }
  .netlist-sidebar .editor-heading>span {
    font-size:7px
  }
  .netlist-sidebar .netlist-actions .button {
    font-size:11px
  }
  .netlist-sidebar .syntax-body>p {
    font-size:10px
  }
  .app-footer {
    flex-wrap:wrap;
    gap:9px;
    padding:13px 16px
  }
  .app-footer>span:first-child {
    font-size:7px
  }
  .app-footer p {
    font-size:9px
  }
  .desktop-break {
    display:none
  }
  .placed-section {
    min-height:110px
  }
  .placed-list {
    max-height:150px
  }
  .local-note {
    margin-top:18px
  }
  .canvas-toolbar .tool-button {
    padding:7px 10px
  }
  .canvas-toolbar {
    gap:9px
  }
  .canvas-status {
    font-size:8px
  }
  .canvas-corner {
    font-size:7px
  }
}
@media(max-width:560px) {
  .site-header {
    gap:10px;
    padding:14px 12px 11px
  }
  .site-brand {
    font-size:26px;
    line-height:31px
  }
  .site-nav {
    gap:clamp(16px, 4vw, 24px)
  }
  .site-nav a {
    font-size:14px
  }
  .app-header {
    padding:14px 12px 12px;
    gap:12px
  }
  .tool-heading h1 {
    font-size:16px
  }
  .tool-heading h1>span {
    font-size:7px;
    margin-left:7px
  }
  .header-actions {
    align-items:flex-start;
    flex-direction:column;
    gap:10px
  }
  .save-indicator {
    font-size:8px;
    gap:5px
  }
  .file-actions {
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    width:100%;
    gap:7px
  }
  .file-actions .button {
    font-size:11px;
    padding:8px;
    gap:6px;
    min-height:36px
  }
  .file-actions .button svg {
    width:15px;
    height:15px
  }
  .capture-dialog {
    width:calc(100vw - 20px);
    max-height:calc(100dvh - 20px);
    border-radius:12px
  }
  .capture-heading {
    padding:18px 16px 15px
  }
  .capture-heading h2 {
    font-size:19px
  }
  .capture-heading p {
    font-size:11px
  }
  .capture-preview {
    min-height:190px;
    max-height:calc(100dvh - 320px);
    margin:14px 12px;
    border-radius:8px
  }
  .capture-footer {
    align-items:stretch;
    flex-direction:column;
    gap:14px;
    padding:14px 16px
  }
  .capture-options {
    justify-content:space-between;
    gap:9px 12px
  }
  #capture-info {
    font-size:10px
  }
  .capture-actions {
    width:100%;
    margin-left:0
  }
  .capture-actions .button {
    flex:1
  }
  .workspace {
    display:flex;
    flex-direction:column
  }
  .component-sidebar {
    padding:15px 12px;
    display:block;
    border-right:0;
    border-bottom:1px solid var(--border)
  }
  .component-sidebar>.panel-heading {
    display:none
  }
  .component-sidebar>.panel-description {
    font-size:10px;
    margin:0 0 11px
  }
  .component-palette {
    grid-template-columns:repeat(9,minmax(0,1fr));
    gap:5px
  }
  .component-card {
    min-height:61px;
    padding:6px 2px;
    border-radius:8px
  }
  .component-card>svg {
    width:34px;
    height:24px;
    margin-bottom:5px
  }
  .component-card>span {
    font-size:7px;
    gap:2px;
    line-height:1.3
  }
  .component-card small {
    display:none
  }
  .component-card[data-component=C]>span {
    font-size:6px
  }
  .component-sidebar .selection-section {
    padding:14px 0 0;
    border-bottom:0
  }
  .selection-section>.section-heading {
    display:none
  }
  .selection-hint {
    font-size:9px;
    margin-top:0;
    color:var(--muted)
  }
  .selection-section:has(#selection-panel:not([hidden]))>.section-heading {
    display:flex;
    margin-bottom:10px
  }
  .property-fields {
    display:flex;
    gap:9px;
    margin:0 0 9px
  }
  .property-fields label {
    flex:1
  }
  .property-fields input {
    height:31px;
    margin-top:4px;
    font-size:11px
  }
  .property-actions {
    display:flex
  }
  .property-actions>.button {
    min-width:90px
  }
  .placed-section,.local-note {
    display:none
  }
  .canvas-panel {
    min-height:555px
  }
  .canvas-toolbar {
    height:49px;
    padding:0 12px;
    gap:13px
  }
  .tool-button {
    font-size:9px;
    gap:5px!important;
    padding:7px 9px!important
  }
  .canvas-toolbar .tool-button span {
    display:inline
  }
  .history-tools {
    padding-left:9px
  }
  .canvas-toolbar .icon-button {
    width:25px
  }
  .canvas-toolbar .text-button {
    font-size:9px;
    padding:6px 4px
  }
  .canvas-wrap {
    min-height:470px
  }
  .canvas-document-label {
    top:17px;
    left:17px;
    font-size:8px
  }
  .canvas-status {
    padding:7px 12px;
    min-height:35px;
    font-size:8px
  }
  .circuit-stats {
    font-size:8px;
    gap:10px
  }
  .canvas-corner {
    font-size:6px;
    bottom:28px;
    right:16px;
    letter-spacing:.7px
  }
  .zoom-controls {
    bottom:17px;
    left:15px
  }
  .netlist-sidebar {
    display:block;
    padding:24px 18px
  }
  .netlist-sidebar .panel-heading .eyebrow {
    font-size:8px
  }
  .netlist-sidebar .panel-heading h2 {
    font-size:17px
  }
  .netlist-sidebar .panel-description {
    font-size:11px;
    line-height:1.8;
    margin-top:12px;
    margin-bottom:20px
  }
  .netlist-sidebar .editor-heading {
    margin:23px 0 10px
  }
  .netlist-sidebar .netlist-editor {
    min-height:220px
  }
  .netlist-sidebar .netlist-editor textarea {
    min-height:185px;
    font-size:12px;
    padding:15px
  }
  .netlist-sidebar .netlist-actions {
    margin-top:11px
  }
  .netlist-sidebar .syntax-help {
    margin-top:23px
  }
  .netlist-sidebar .syntax-body>code {
    font-size:10px;
    padding:9px
  }
  .app-footer {
    padding:14px 16px;
    gap:10px
  }
  .app-footer>span:first-child {
    font-size:7px
  }
  .app-footer p {
    font-size:8px;
    flex-wrap:wrap;
    gap:4px;
    line-height:1.7
  }
  .app-footer kbd {
    font-size:7px
  }
  .app-footer i {
    margin:0 1px
  }
}
.tool-heading>.eyebrow {
  font-family:var(--sans);
  font-size:9px;
  letter-spacing:0;
  color:var(--muted)
}
#canvas {
  background:var(--canvas)
}
#canvas.wire-mode {
  cursor:crosshair
}
#canvas.pan-mode {
  cursor:grab
}
#canvas.placing {
  cursor:copy
}
#canvas-wrap.drag-over {
  box-shadow:inset 0 0 0 3px var(--accent)
}
.canvas-background {
  pointer-events:all
}
.component-hit {
  fill:transparent;
  stroke:transparent;
  stroke-width:1
}
.component.selected .component-hit {
  fill:var(--accent-faint);
  stroke:var(--accent);
  stroke-dasharray:5 4
}
.component:hover .component-hit {
  fill:var(--accent-faint)
}
.component.selected:hover .component-hit {
  fill:var(--accent-surface)
}
.component:focus {
  outline:none
}
.component:focus-visible .component-hit {
  stroke:var(--accent);
  stroke-dasharray:3 3
}
.wire-hit {
  fill:none;
  stroke:transparent!important;
  stroke-width:16;
  pointer-events:stroke
}
.wire-line {
  stroke:var(--teal);
  stroke-width:2.2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none
}
.wire:hover .wire-line {
  stroke:var(--accent);
  stroke-width:3
}
.wire.selected .wire-line {
  stroke:var(--accent);
  stroke-width:3
}
.placed-list .empty-list {
  color:var(--muted);
  font-size:10px;
  line-height:1.8;
  margin:4px 0
}
#status-message.error {
  color:var(--danger)
}
#status-message.error:before {
  content:"!";
  font-weight:700;
  color:var(--danger)
}
.placed-list .placed-component.active {
  background:var(--accent-surface);
  border-color:var(--accent);
  color:var(--accent)
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    scroll-behavior:auto!important;
    transition:none!important
  }
}
@media(min-width:801px) {
  .workspace {
    height:calc(100dvh - 204px);
    min-height:420px
  }
  .sidebar {
    min-height:0;
    overflow-y:auto;
    scrollbar-width:thin;
    scrollbar-color:var(--border-strong) transparent
  }
  .canvas-panel {
    min-height:0
  }
  .canvas-wrap {
    min-height:0
  }
}
@media(min-width:801px) and (max-width:980px) {
  .workspace {
    height:calc(100dvh - 195px)
  }
}
.component-card[data-component="NMOS"]>span,.component-card[data-component="PMOS"]>span {
  flex-direction:column;
  gap:2px
}
.syntax-example code {
  overflow-wrap:anywhere;
  white-space:normal
}
