:root { color-scheme: dark; --navy: #07182e; --panel: #10253e; --line: #ffffff15; --muted: #a4b5c9; --cyan: #63dcff; --amber: #ffc354; --green: #62dfa5; --cell: 80px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 55% 0, #133752 0, transparent 65%), var(--navy); color: #edf6ff; font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; opacity: .35; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
button, input, select { border-radius: 9px; }
h1, h2, h3, p { margin: 0; }
.skip-link { position: absolute; z-index: 100; top: -80px; padding: 14px; background: var(--amber); color: var(--navy); }
.skip-link:focus { top: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 84px; padding: 16px 30px; border-bottom: 1px solid var(--line); background: #061324b0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 46px; border-radius: 13px; background: var(--amber); color: var(--navy); font-size: 44px; font-weight: 800; line-height: 1; }
.brand strong { display: block; font-size: 23px; letter-spacing: -.8px; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: 1.5px; }
.header-links { display: flex; align-items: center; gap: 22px; font-size: 12px; }
.header-links a:hover { color: var(--cyan); }
.poc-badge { padding: 7px 10px; border: 1px solid #ffc35440; border-radius: 6px; color: var(--amber); font-size: 10px; letter-spacing: 1px; }
.app-shell { display: grid; grid-template-columns: 230px minmax(480px, 1fr) 250px; align-items: start; gap: 20px; max-width: 1800px; margin: 0 auto; padding: 26px 24px 40px; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: #10253ef2; }
.eyebrow { color: var(--cyan); font-size: 9px; font-weight: 700; letter-spacing: 1.6px; line-height: 1.6; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-heading h2 { margin-top: 3px; font-size: 24px; letter-spacing: -.8px; }
.count-badge { padding: 5px 8px; border-radius: 8px; background: #ffffff0b; color: var(--muted); font-size: 10px; white-space: nowrap; }
.library { padding: 20px 15px; }
.library-hint, .library-footnote { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.search-label { display: block; margin-top: 20px; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.search { width: 100%; min-width: 0; padding: 10px; border: 1px solid #ffffff20; background: #07182e; color: white; font-size: 12px; }
.palette { max-height: calc(100vh - 350px); min-height: 300px; overflow-y: auto; margin-top: 16px; padding: 0 5px 0 0; scrollbar-width: thin; scrollbar-color: #35506d transparent; }
.palette-group { margin: 18px 0 9px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.palette-group:first-child { margin-top: 0; }
.palette-items { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.palette-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 105px; padding: 10px 5px; border: 1px solid #ffffff12; background: #ffffff04; color: #d8e6f6; font-size: 10px; line-height: 1.4; touch-action: none; user-select: none; }
.palette-block:hover, .palette-block[aria-pressed="true"] { border-color: var(--cyan); background: #63dcff12; }
.palette-block img { width: 55px; height: 55px; object-fit: contain; pointer-events: none; }
.palette-block[data-type="battery"] img { width: 70px; }
.empty-search { color: var(--muted); padding: 20px 0; font-size: 12px; }
.workspace { min-width: 0; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 20px; }
.workspace-heading h1 { margin-top: 6px; font-size: clamp(23px, 2.3vw, 33px); font-weight: 650; letter-spacing: -1px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 11px 18px; border: 1px solid transparent; font-weight: 650; font-size: 12px; }
.run-button { flex-shrink: 0; background: var(--amber); color: var(--navy); box-shadow: 0 4px 20px #ffc35414; }
.run-button[aria-pressed="true"] { background: var(--green); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; margin-bottom: 14px; border-radius: 12px; }
.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.toolbar label { color: var(--muted); font-size: 10px; margin-right: 2px; }
select, .tool-button { min-height: 34px; padding: 7px 10px; border: 1px solid #ffffff1a; background: #07182e55; color: #dfebf9; font-size: 11px; }
select { max-width: 170px; }
.tool-button:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.toolbar-divider { height: 18px; width: 1px; margin-inline: 4px; background: var(--line); }
.preset-info { margin-bottom: 14px; padding: 15px 18px; }
.preset-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.preset-heading h3 { font-size: 13px; font-weight: 600; }
.preset-heading > span { color: var(--cyan); font-size: 10px; }
.preset-heading > a { margin-left: auto; color: var(--muted); font-size: 10px; }
.preset-heading > a:hover { color: var(--cyan); }
.preset-info > p { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.preset-info[data-mode="layout"] { border-color: #ffc35440; }
.preset-info[data-mode="layout"] #preset-mode { color: var(--amber); }
.board-frame { overflow: hidden; background: #102137; }
.board-header, .board-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; color: var(--muted); font-size: 9px; letter-spacing: .3px; }
.board-header { border-bottom: 1px solid var(--line); }
.connection-dot { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--green); }
.board-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: #35506d transparent; }
.circuit-board { position: relative; width: calc(var(--cell) * var(--board-columns, 10)); height: calc(var(--cell) * var(--board-rows, 10)); margin: 16px auto; border: 1px solid #36516d; border-radius: 8px; background-color: #0b1b2c; background-image: radial-gradient(circle, #3e5978 1px, transparent 1px), linear-gradient(#ffffff06 1px, transparent 1px), linear-gradient(90deg, #ffffff06 1px, transparent 1px); background-size: var(--cell) var(--cell); background-position: 0 0, -1px -1px, -1px -1px; }
.board-cell { position: absolute; width: var(--cell); height: var(--cell); border: 0; border-radius: 0; background: transparent; color: #0000; }
.board-cell:hover { background: #63dcff08; }
.board-cell:focus-visible { outline-offset: -5px; background: #63dcff10; }
.placed-block { position: absolute; z-index: 2; border: 0; border-radius: 10px; background: #0f243630; color: white; padding: 0; touch-action: none; user-select: none; cursor: grab; }
.placed-block:active { cursor: grabbing; }
.placed-block.is-selected { z-index: 3; background: #63dcff10; }
.selection-highlight { position: absolute; z-index: 6; inset: 1px; border: 3px solid var(--cyan); border-radius: 9px; box-shadow: 0 0 12px #63dcff66; pointer-events: none; }
.placed-block img { position: absolute; object-fit: fill; pointer-events: none; border-radius: 0; }
.placed-block .motor-rotor { width: 74px; height: 74px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.placed-block.is-active .motor-rotor { animation: motor-spin .7s linear infinite; }
.is-paused .placed-block .motor-rotor { animation-play-state: paused; }
@keyframes motor-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.placed-block.is-active:not([data-type^="led-"]) img { filter: brightness(1.2) drop-shadow(0 0 7px #62dfa550); }
.placed-block.is-led-on::after { content: ''; position: absolute; inset: 28%; border-radius: 50%; pointer-events: none; background: #ffed7fa0; box-shadow: 0 0 12px 9px #ffd34388, 0 0 36px 12px #ffd34345; opacity: var(--brightness, 1); }
.placed-block[data-type="tact"]::before { position: absolute; z-index: 3; top: 50%; left: 50%; width: 36%; aspect-ratio: 1; border-radius: 21%; background: linear-gradient(145deg, #ca7890, #a95370); box-shadow: inset 2px 2px 4px #ffffff33, inset -3px -3px 5px #631f3538, 0 3px 4px #390e1d38; content: ''; pointer-events: none; transform: translate(-50%, -50%); transition: transform .1s ease, filter .1s ease, box-shadow .1s ease; }
.placed-block[data-type="tact"].is-pressed::before { filter: brightness(.78) saturate(.9); box-shadow: inset 3px 3px 6px #49142661, inset -1px -1px 2px #ffffff1f, 0 1px 1px #390e1d2e; transform: translate(-50%, -50%) scale(.84); }
.terminal { position: absolute; z-index: 4; display: grid; place-items: center; width: 12px; height: 12px; transform: translate(-50%, -50%); border: 2px solid #0b1b2c; border-radius: 50%; background: #ffbf5c; color: #07182e; font-size: 9px; font-weight: 800; pointer-events: none; }
.terminal.is-connected { background: var(--green); }
.terminal.is-polar { width: 16px; height: 16px; }
.placement-preview { position: absolute; z-index: 8; border: 2px dashed var(--green); border-radius: 10px; background: #62dfa520; pointer-events: none; }
.placement-preview.is-invalid { border-color: #ff7f7f; background: #ff7f7f20; }
.board-footer { flex-wrap: wrap; border-top: 1px solid var(--line); line-height: 1.6; }
kbd { padding: 2px 4px; border: 1px solid #ffffff20; border-radius: 4px; color: #d7e6f6; font: inherit; }
.status-panel { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 17px 20px; }
.status-indicator { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; background: #73849b; }
.status-panel strong { font-size: 13px; font-weight: 650; }
.status-panel p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.status-panel[data-status="powered"] .status-indicator { background: var(--green); box-shadow: 0 0 15px #62dfa560; }
.status-panel[data-status="short"] .status-indicator, .status-panel[data-status="error"] .status-indicator { background: #ff7f7f; }
.status-panel[data-status="open"] .status-indicator { background: var(--amber); }
.status-panel[data-status="discharging"] .status-indicator { background: var(--cyan); }
.time-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.time-controls output { color: var(--cyan); white-space: nowrap; font-variant-numeric: tabular-nums; }
.time-controls .tool-button { min-height: 26px; padding: 4px 7px; font-size: 9px; }
.waveform-panel { padding: 16px 20px; margin-top: 14px; }
.waveform-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 11px; }
.waveform-heading h3 { font-size: 12px; font-weight: 600; }
.waveform-legend { display: flex; gap: 16px; color: var(--amber); }
.waveform-legend > span:last-child { color: var(--cyan); }
.waveform-legend b { padding-left: 4px; font-weight: 500; font-variant-numeric: tabular-nums; }
.waveform-panel svg { display: block; width: 100%; height: 100px; margin-top: 12px; }
.waveform-grid { fill: none; stroke: #ffffff10; stroke-width: 1; }
.waveform-line { fill: none; stroke: var(--amber); stroke-width: 2; vector-effect: non-scaling-stroke; }
.waveform-line:last-child { stroke: var(--cyan); }
.waveform-panel > p { color: var(--muted); font-size: 10px; line-height: 1.6; margin-top: 4px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.steps p { display: flex; align-items: start; gap: 9px; }
.steps b { color: #496683; font-size: 21px; font-weight: 400; }
.steps span { color: var(--muted); font-size: 10px; line-height: 1.6; }
.steps strong { display: block; margin-bottom: 4px; color: #dce9f7; font-size: 11px; font-weight: 600; }
.save-status { margin-top: 22px; color: #728da8; font-size: 10px; }
.inspector-column { display: grid; gap: 16px; }
.inspector, .measurements { padding: 22px 18px; }
.inspector h2, .measurements h2 { margin-top: 5px; font-size: 18px; font-weight: 650; letter-spacing: -.4px; }
.inspector-placeholder { display: grid; place-items: center; min-height: 145px; margin-top: 15px; padding: 20px 10px; border: 1px dashed #ffffff20; border-radius: 12px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.8; }
.inspector-image { display: block; width: 95px; height: 95px; margin: 22px auto 14px; object-fit: contain; }
.inspector-name { text-align: center; font-size: 15px; }
.inspector-actions { display: flex; gap: 7px; margin-top: 16px; }
.inspector-actions button { flex: 1; }
.parameter { margin-top: 18px; }
.parameter label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.parameter output { color: var(--cyan); font-weight: 650; white-space: nowrap; }
input[type="range"] { width: 100%; margin: 12px 0 0; accent-color: var(--cyan); }
.toggle-button { width: 100%; margin-top: 18px; background: #ffffff0a; border-color: #ffffff20; color: #e5f2ff; touch-action: none; }
.toggle-button[aria-pressed="true"] { border-color: var(--green); color: var(--green); }
.momentary-control { transition: transform .1s ease, background .1s ease, box-shadow .1s ease; }
.momentary-control[aria-pressed="true"] { background: #eaff70; color: var(--navy); box-shadow: inset 0 3px 5px #505d0047; transform: translateY(3px) scale(.98); }
.component-note { margin-top: 18px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.component-reading { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--cyan); font-size: 11px; line-height: 1.7; }
.measurements dl { margin: 22px 0 0; }
.measurements dl > div { padding: 13px 0; border-top: 1px solid var(--line); }
.measurements dt { color: var(--muted); font-size: 11px; }
.measurements dd { margin: 4px 0 0; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.measurements dd small { color: var(--muted); font-size: 12px; font-weight: 400; }
.measurement-note { color: var(--muted); font-size: 10px; line-height: 1.7; }
.model-notes { padding: 18px; background: #14283b; }
.model-notes summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.model-notes p { margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.model-notes .model-tag { color: var(--amber); font-size: 8px; letter-spacing: .6px; }
.toast { position: fixed; z-index: 100; bottom: 25px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 14px 20px; border: 1px solid #ffffff30; border-radius: 12px; background: #173a52; color: #fff; box-shadow: 0 10px 30px #0005; font-size: 12px; }
.drag-preview { position: fixed; z-index: 99; width: 64px; height: 64px; pointer-events: none; opacity: .85; transform: translate(-50%, -50%); }
.drag-preview img { width: 100%; height: 100%; object-fit: contain; }
@media (min-width: 1550px) { .app-shell { grid-template-columns: 250px minmax(0, 1fr) 270px; gap: 24px; } }
@media (max-width: 1200px) { .app-shell { grid-template-columns: 200px minmax(0, 1fr); } .inspector-column { grid-column: 2; grid-template-columns: 1fr 1fr; align-items: start; } .model-notes { grid-column: 1 / -1; } }
@media (max-width: 760px) { .topbar { padding: 14px 16px; min-height: 74px; } .brand strong { font-size: 20px; } .brand small { font-size: 10px; } .brand-mark { width: 35px; height: 40px; } .header-links { gap: 8px; } .header-links a { display: none; } .poc-badge { font-size: 8px; padding: 6px; } .app-shell { display: flex; flex-direction: column; padding: 18px 12px 30px; gap: 18px; } .library, .workspace, .inspector-column { width: 100%; } .library { padding: 15px; } .library-hint { margin-top: 7px; } .search-label { margin-top: 12px; } .palette { display: flex; gap: 8px; min-height: 0; max-height: none; overflow-x: auto; padding-bottom: 8px; } .palette-group { display: none; } .palette-items { display: contents; } .palette-block { min-width: 85px; min-height: 96px; max-width: 85px; } .library-footnote { display: none; } .workspace-heading { margin-top: 0; } .workspace-heading h1 { font-size: 25px; } .workspace-heading .eyebrow { font-size: 8px; } .run-button { padding-inline: 12px; } .board-header, .board-footer { padding: 12px; font-size: 8px; } .board-header > span:first-child { max-width: 210px; } .board-scroll { max-height: 455px; } .board-scroll:focus-visible { outline-offset: -3px; } .inspector-column { grid-template-columns: 1fr 1fr; gap: 12px; } .inspector, .measurements { padding: 18px 12px; } .inspector h2, .measurements h2 { font-size: 16px; } .steps { gap: 10px; } .steps p { gap: 6px; } .steps b { font-size: 18px; } .steps strong { font-size: 10px; } .steps span { font-size: 9px; } }
@media (max-width: 380px) { .inspector-column { grid-template-columns: 1fr; } .workspace-heading h1 { font-size: 23px; } .workspace-heading { gap: 8px; } }
@media (max-width: 760px) { .palette-block { touch-action: pan-x; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }

.language-switcher { display: flex; align-items: center; gap: .75rem; font-size: .85rem; }
.language-switcher a { color: inherit; padding: .35rem .1rem; }
.language-switcher a[aria-current] { font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.topbar { flex-wrap: wrap; }
.topbar .language-switcher { order: 1; }
