/* Digital Systems Lab – the breadboard (static/labkit/digital-board.js). */
.dg-modes { display: flex; gap: 6px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.dg-modes button { padding: 10px 16px; border-bottom: 3px solid transparent; font-weight: 600; font-size: 15px; color: var(--muted); }
.dg-modes button.is-on { color: var(--ink); border-bottom-color: rgb(var(--c-accent-1, 30 74 59)); }
.dg-wrap { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.dg-wrap[hidden] { display: none; }
@media (max-width: 900px) { .dg-wrap { grid-template-columns: 1fr; } }
.dg-side { display: flex; flex-direction: column; gap: 12px; }
.dg-missions { display: flex; flex-direction: column; gap: 6px; }
.dg-missions .lk-btn { justify-content: flex-start; text-align: left; }
.dg-missions .lk-btn.is-on { border-color: rgb(var(--c-accent-1, 30 74 59)); background: rgb(var(--c-accent-1-tint, 237 230 212)); font-weight: 600; }
.dg-task { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }
.dg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-help { margin: 8px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.dg-tray { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dg-tray-btn { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 600; }
.dg-tray-btn:disabled { opacity: .35; cursor: not-allowed; }
.dg-board { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; touch-action: none; user-select: none; }
.dg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.dg-bar .lk-btn.is-on { background: #dc2626; border-color: #dc2626; color: #fff; }

/* the parts */
.dg-part { cursor: grab; }
.dg-part.is-sel .dg-gate, .dg-part.is-sel .dg-switch, .dg-part.is-sel .dg-chip, .dg-part.is-sel .dg-led { stroke: #f59e0b; stroke-width: 3; }
.dg-gate { fill: #e0f2fe; stroke: #0f172a; stroke-width: 2.2; }
.dg-gate-line { fill: none; stroke: #0f172a; stroke-width: 2.2; }
.dg-bubble { fill: #fff; stroke: #0f172a; stroke-width: 2; }
.dg-gate-t { font: 700 10px "JetBrains Mono", ui-monospace, monospace; fill: #0f172a; pointer-events: none; }
.dg-switch { fill: #cbd5e1; stroke: #475569; stroke-width: 2; transition: fill .15s ease; }
.dg-switch.is-on { fill: #22c55e; }
.dg-knob { fill: #fff; stroke: #475569; stroke-width: 1.5; transition: cx .15s ease; }
.dg-chip { fill: #1e293b; stroke: #0f172a; stroke-width: 2; }
.dg-chip-t { font: 700 12px "JetBrains Mono", monospace; fill: #fde68a; pointer-events: none; }
.dg-led { fill: #7f1d1d; stroke: #450a0a; stroke-width: 2; }
.dg-led.is-on { fill: #f87171; }
.dg-glow { fill: rgba(248, 113, 113, .35); }
.dg-label { font: 700 16px Inter, system-ui, sans-serif; fill: #0f172a; pointer-events: none; }
.dg-leg { stroke: #475569; stroke-width: 3; }
.dg-pin { fill: #fff; stroke: #0f172a; stroke-width: 2; cursor: crosshair; }
.dg-pin.is-out { fill: #fde68a; }
.dg-pin:hover { fill: rgb(var(--c-accent-1, 30 74 59)); }

/* the wires: a 1 glows green and moves; a 0 is dark */
.dg-wire { fill: none; stroke: #64748b; stroke-width: 4; stroke-linecap: round; pointer-events: none; }
.dg-wire.is-off { stroke: #334155; }
.dg-wire.is-on { stroke: #22c55e; stroke-dasharray: 12 8; animation: dg-flow .6s linear infinite; filter: drop-shadow(0 0 4px rgba(34, 197, 94, .7)); }
.dg-wire.is-sel { stroke: #f59e0b; }
.dg-wire.is-drawing { stroke: rgb(var(--c-accent-1, 30 74 59)); stroke-dasharray: 6 6; }
.dg-wire-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; }
@keyframes dg-flow { to { stroke-dashoffset: -20; } }
.dg-bit { font: 700 12px "JetBrains Mono", monospace; fill: rgb(var(--c-accent-1-dark, 9 37 28)); pointer-events: none; }

/* the truth table */
.dg-tt { width: 100%; margin-top: 10px; border-collapse: collapse; font: 13px "JetBrains Mono", monospace; text-align: center; }
.dg-tt th, .dg-tt td { padding: 3px 6px; border: 1px solid var(--line); }
.dg-tt tr.ok td { background: #f0fdf4; }
.dg-tt tr.bad td { background: #fef2f2; }
.dg-tt small { color: #b91c1c; }
