/* ═══════════════════════════════════════════════════
   CZElectro — Component Visual Styles
   Board components, terminals, LED glow, motor spin,
   buzzer, speaker, relay, AC appliances, sparks,
   battery sim, groups, badges, animations
   ═══════════════════════════════════════════════════ */

/* ── Board Components ── */
.board-component {
    position: absolute;
    cursor: grab;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.15s;
    overflow: visible !important;
}

/* Kill transitions during drag — position updates must be instant */
.board-component.cz-dragging {
    transition: none !important;
}

.board-component:active {
    cursor: grabbing;
}

.board-component svg {
    overflow: visible;
}

.board-component.selected {
    outline: .5px dashed var(--accent);
    outline-offset: 4px;
    filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.3));
}

/* Simplify filter during drag — drop-shadow is expensive per-frame */
.board-component.selected.cz-dragging {
    filter: none;
}

/* Grouped component indicator */
.board-component.grouped {
    /* outline: .5px dashed rgba(139, 92, 246, 0.4); */
    outline-offset: 4px;
}

.board-component.grouped.selected {
    outline: .5px dashed #8b5cf6;
    outline-offset: 4px;
}

/* Group label badge — floats above group bounding box */
.group-label-badge {
    position: absolute;
    transform: translateX(-50%);
    z-index: 20;
    font-size: 9px;
    font-weight: 500;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.09);
    /* border: 1px solid rgba(139, 92, 246, 0.3); */
    border-radius: 6px;
    padding: 2px 8px;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(6px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.group-label-badge.group-selected {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
    pointer-events: auto;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

/* Group label live-edit input */
.group-label-input {
    background: transparent;
    border: none;
    outline: none;
    color: #e9d5ff;
    font-size: 9px;
    font-weight: 500;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    width: 100%;
    text-align: center;
    padding: 0;
    caret-color: #a78bfa;
}

.group-label-input::placeholder {
    color: rgba(196, 181, 253, 0.4);
    font-style: italic;
}

/* ── Terminals ── */
.terminal {
    position: absolute;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 35% 35%, #fcd34d, #b45309);
    border: 2px solid #78350f;
    border-radius: 50%;
    cursor: crosshair;
    pointer-events: auto;
    z-index: 15;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transition: transform 0.2s var(--transition-smooth), background 0.2s, border-color 0.2s, opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

/* Show terminals on component hover */
.board-component:hover .terminal {
    opacity: 1;
}

/* Label inside terminal circle — also hidden, shown on hover */
.terminal::after {
    content: attr(data-label);
    font-size: 8px;
    font-weight: 900;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    color: #1c1917;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Show labels on component hover or terminal hover */
.board-component:hover .terminal::after,
.terminal:hover::after {
    opacity: 1;
}

.terminal:hover {
    transform: scale(1.4);
    background: radial-gradient(circle at 35% 35%, #4ade80, #166534);
    border-color: #064e3b;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.6), 0 2px 6px rgba(0, 0, 0, 0.5);
    opacity: 1;
    z-index: 25;
}

.terminal.connected {
    background: radial-gradient(circle at 35% 35%, #60a5fa, #1e3a8a);
    border-color: #1e40af;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Terminal label tooltip */
.terminal-label {
    position: absolute;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 16;
}

/* ── Component States ── */

/* Switch toggle — clear ON/OFF visual */
.board-component .switch-lever {
    transform-origin: 40px 30px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.board-component.switch-closed .switch-lever {
    transform: rotate(30deg);
}

.board-component.switch-closed .switch-lever rect {
    fill: #22c55e;
    stroke: #15803d;
}

/* LED DIM — low current, faint glow */
.board-component.led-dim .led-bulb {
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.4));
}

.board-component.led-dim .led-glow-ring {
    fill-opacity: 0.15;
}

/* LED ON — normal brightness */
.board-component.led-on .led-bulb {
    filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
}

.board-component.led-on .led-glow-ring {
    fill-opacity: 0.5;
}

/* LED BRIGHT — near max, intense glow + pulse */
.board-component.led-bright .led-bulb {
    filter: drop-shadow(0 0 35px rgba(250, 204, 21, 1)) brightness(1.3);
}

.board-component.led-bright .led-glow-ring {
    fill-opacity: 0.8;
    animation: glowPulse 0.8s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from { fill-opacity: 0.6; }
    to { fill-opacity: 1; }
}

/* RGB LED — same gradient glow as other LEDs, color cycles via JS */
.board-component.led-rgb-active .led-bulb {
    fill: url(#ledGlowRGB) !important;
}

.board-component.led-rgb-active .led-glow-ring {
    fill-opacity: 0 !important;
}

/* Broken — shake + dark */
.board-component.comp-broken {
    animation: shake 0.5s ease-out;
}

/* Suppress shake animation during state restore to prevent rotation flash */
.board-component.comp-broken.restoring {
    animation: none !important;
}

@keyframes shake {
    0%, 100% { translate: 0 0; }
    10% { translate: -4px -2px; }
    20% { translate: 4px 2px; }
    30% { translate: -3px 1px; }
    40% { translate: 3px -1px; }
    50% { translate: -2px 0; }
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.board-component.led-broken .led-bulb {
    fill: #1a1a1a !important;
    stroke: #333;
    stroke-width: 1;
    filter: none !important;
    opacity: 0.5;
}

.board-component.led-broken .led-glow-ring {
    fill-opacity: 0 !important;
}

/* ── Fuse Blown — wire breaks visibly ── */
.board-component.fuse-blown .fuse-wire {
    stroke-dasharray: 8 14 !important;
    stroke: #666 !important;
    stroke-width: 1 !important;
    animation: fuseFlicker 0.3s ease-out;
}

@keyframes fuseFlicker {
    0% { stroke: #fbbf24; stroke-width: 3; }
    50% { stroke: #ef4444; stroke-width: 2; }
    100% { stroke: #666; stroke-width: 1; }
}

/* Fuse glass darkens */
.board-component.fuse-blown svg rect:first-of-type {
    fill: rgba(80, 80, 80, 0.3) !important;
}

/* Motor broken — dark and still */
.board-component.comp-broken .motor-spin {
    animation: none !important;
}

.board-component.comp-broken .motor-spin line {
    stroke: #444 !important;
}

.board-component.comp-broken .motor-shaft {
    fill: #333 !important;
    filter: none !important;
}

/* ── Broken Badge — persistent damage indicator ── */
.broken-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    font-size: 7px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.4);
    animation: brokenPulse 2s ease-in-out infinite;
}

@keyframes brokenPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ── Motor Active — visible spinning ── */
.board-component.motor-active .motor-spin {
    transform-origin: 35px 32px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Motor glow when active */
.board-component.motor-active .motor-shaft {
    fill: #fbbf24;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

/* Motor reversed — orange tint to indicate reversed polarity */
.board-component.motor-reversed .motor-shaft {
    fill: #f97316;
    filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.7));
}

@keyframes badgeFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Buzzer Active — vibration effect ── */
.board-component.buzzer-active {
    animation: vibrate 0.06s linear infinite;
}

.board-component.buzzer-active circle:first-of-type {
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.5));
}

@keyframes vibrate {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 0.5px); }
    50% { transform: translate(0.5px, -1px); }
    75% { transform: translate(-0.5px, -0.5px); }
    100% { transform: translate(1px, 0.5px); }
}

/* ── Speaker Active — cone vibration + sound waves ── */
.board-component.speaker-active .speaker-cone {
    transform-origin: 35px 35px;
}

@keyframes speakerVibrate {
    0% { transform: scale(1); }
    100% { transform: scale(1.06); }
}

.board-component.speaker-active .speaker-wave.sw1 {
    stroke: rgba(74, 222, 128, 0.6);
    animation: soundWave 0.6s ease-in-out infinite;
}
.board-component.speaker-active .speaker-wave.sw2 {
    stroke: rgba(74, 222, 128, 0.4);
    animation: soundWave 0.6s ease-in-out 0.3s infinite;
}

@keyframes soundWave {
    0%, 100% { opacity: 0; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(3px); }
}

.board-component.speaker-active circle:nth-of-type(1) {
    filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.4));
}

/* ── Relay Active — coil energized glow ── */
.board-component.relay-active circle {
    fill: #4ade80;
    filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.6));
}
.board-component.relay-active rect:first-of-type {
    stroke: #4ade80;
}

/* Burn notice popup */
.burn-notice {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    font-size: 10px;
    font-family: 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    animation: burnNotice 3s ease-out forwards;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.5);
}

@keyframes burnNotice {
    0% { opacity: 0; transform: translateX(-50%) translateY(5px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-15px); }
}

/* ── Spark / Explosion Overlay ── */
.spark-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 50;
}

.spark-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 6px #fbbf24, 0 0 12px #f59e0b;
    animation: sparkFly 0.6s ease-out forwards;
}

@keyframes sparkFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

.smoke-puff {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(120, 120, 120, 0.7), transparent);
    animation: smokePuff 1.2s ease-out forwards;
    pointer-events: none;
    z-index: 49;
}

@keyframes smokePuff {
    0% { transform: scale(0.3) translateY(0); opacity: 0.8; }
    100% { transform: scale(2.5) translateY(-40px); opacity: 0; }
}

/* ── Current flow animation on wires ── */
.wire-flow {
    stroke-dasharray: 8 6;
    animation: flowDash 0.6s linear infinite;
}

@keyframes flowDash {
    to { stroke-dashoffset: -14; }
}

/* Pause flow animations during drag for performance */
.cz-drag-active .wire-flow {
    animation-play-state: paused;
}

/* ── Component value badge ── */
.comp-badge {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-family: 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
}


/* ── Charge Controller States ── */
.scc-active {
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.5));
}
.scc-protecting {
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
    animation: sccPulse 1.2s ease-in-out infinite;
}
@keyframes sccPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4)); }
    50% { filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.8)); }
}

.scc-status {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-weight: 800;
    white-space: nowrap;
    pointer-events: none;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 20;
    animation: badgeFadeIn 0.25s ease-out;
}

.scc-active .scc-status {
    color: #4ade80;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.scc-protecting .scc-status {
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

/* ── Power Badge ── */
.power-badge {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-weight: 800;
    color: #22d3ee;
    white-space: nowrap;
    pointer-events: none;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(34, 211, 238, 0.3);
    z-index: 20;
}

/* ── Component Power On/Off Toggle ── */
.board-component.powered-off {
    opacity: 1;
    filter: none;
    transition: opacity 0.3s, filter 0.3s;
}

.power-on-off-badge {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-weight: 800;
    color: #4ade80;
    white-space: nowrap;
    pointer-events: none;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(74, 222, 128, 0.4);
    z-index: 25;
    animation: badgeFadeIn 0.2s ease-out;
    cursor: pointer;
}

.power-on-off-badge.off {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
    animation: noAcBlink 2s ease-in-out infinite;
}

/* ── Motor Direction Badge ── */
.motor-dir-badge {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-weight: 800;
    color: #a78bfa;
    white-space: nowrap;
    pointer-events: none;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(167, 139, 250, 0.3);
    z-index: 20;
    animation: badgeFadeIn 0.3s ease-out;
}
.motor-dir-badge.reversed {
    color: #fb923c;
    border-color: rgba(251, 146, 44, 0.3);
}

/* ── MCB States ── */
.board-component.mcb-tripped {
    animation: mcbTrip 0.3s ease-out;
}

@keyframes mcbTrip {
    0% { transform: scale(1); }
    30% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.mcb-trip-badge {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    pointer-events: none;
    z-index: 10;
}

.board-component.mcb-active {
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.35));
}

/* ── kWh Meter States ── */
.meter-disc-group {
    transform-origin: 40px 63px;
}

@keyframes meterSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.board-component.meter-active {
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.3));
}

.board-component.meter-active .meter-led {
    animation: meterLedBlink 0.8s ease-in-out infinite;
}

@keyframes meterLedBlink {
    0%, 100% { fill: #22c55e; filter: drop-shadow(0 0 3px rgba(34, 197, 94, 0.8)); }
    50% { fill: #15803d; filter: none; }
}

/* ── PLN Source States ── */
.board-component.pln-active {
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.4));
}

.board-component.pln-active .pln-led {
    animation: plnLedPulse 1.2s ease-in-out infinite;
}

@keyframes plnLedPulse {
    0%, 100% { fill: #22c55e; filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.9)); }
    50% { fill: #16a34a; filter: drop-shadow(0 0 2px rgba(34, 197, 94, 0.4)); }
}

/* ── ATS States ── */
.board-component.ats-pln-mode {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.3));
}

.board-component.ats-plts-mode {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.3));
}

.board-component .ats-arm {
    transition: all 0.5s ease;
}

.board-component.ats-pln-mode .ats-pln-led {
    animation: plnLedPulse 1.2s ease-in-out infinite;
}

.board-component.ats-plts-mode .ats-plts-led {
    animation: pltsLedPulse 1.2s ease-in-out infinite;
}

@keyframes pltsLedPulse {
    0%, 100% { fill: #22c55e; filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.9)); }
    50% { fill: #16a34a; filter: drop-shadow(0 0 2px rgba(34, 197, 94, 0.4)); }
}

.ats-mode-badge {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    pointer-events: none;
    z-index: 10;
}

/* ── AC Appliance States ── */
.ac-active {
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.4));
}

.ac-no-inverter {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.no-ac-badge {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-weight: 800;
    color: #f87171;
    white-space: nowrap;
    pointer-events: none;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.5);
    z-index: 20;
    animation: noAcBlink 1.5s ease-in-out infinite;
}

@keyframes noAcBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Battery Simulation ── */
.battery-bar {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    height: 14px;
    background: #0f172a;
    border-radius: 7px;
    border: 2px solid #475569;
    overflow: hidden;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.battery-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease, background 0.5s ease;
    box-shadow: 0 0 8px currentColor;
}
.battery-pct {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.7);
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    z-index: 20;
}
.battery-dead {
    filter: grayscale(0.8) brightness(0.5);
}
.battery-dead::after {
    content: attr(data-dead-label);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 900;
    color: #ef4444;
    text-shadow: 0 0 6px #000;
    z-index: 20;
    pointer-events: none;
}

/* Simulation Controls */
.sim-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
}
.sim-label {
    font-size: 11px;
    color: #94a3b8;
    margin-right: 4px;
    font-weight: 600;
}
.sim-btn {
    padding: 2px 8px;
    border: 1px solid #475569;
    background: #1e293b;
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
}
.sim-btn:hover {
    background: #334155;
    color: #e2e8f0;
}
.sim-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #60a5fa;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}
.sim-reset {
    margin-left: 4px;
}
.sim-reset:hover {
    background: #dc2626;
    border-color: #f87171;
    color: #fff;
}
.sim-divider {
    color: #475569;
    font-size: 14px;
    margin: 0 2px;
}
.sim-day.active {
    background: #d97706;
    border-color: #f59e0b;
    color: #fff;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.sim-night.active {
    background: #4338ca;
    border-color: #818cf8;
    color: #fff;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* Sim Panel */
.sim-panel {
    padding: 0 12px;
    font-size: 10px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
    white-space: nowrap;
    overflow-x: auto;
}
.sim-panel-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sim-clock-wrap {
    flex-shrink: 0;
}
.sim-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sim-header {
    color: #60a5fa;
    font-weight: 700;
}
.sim-power {
    color: #f59e0b;
    font-weight: 600;
}
.sim-batt {
    color: #e2e8f0;
}

/* ── Mobile Touch — tap-to-show terminals ── */
@media (max-width: 768px), (hover: none) {
    /* Slightly larger touch target when revealed */
    .terminal {
        width: 20px;
        height: 20px;
    }

    /* Show terminals when component has .show-terminals class (tap-toggled via JS) */
    .board-component.show-terminals .terminal {
        opacity: 1;
    }

    .board-component.show-terminals .terminal::after {
        opacity: 1;
        font-size: 9px;
    }
}

/* ── Voltmeter States ── */
.board-component.vm-active {
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.35));
}

.board-component.vm-active .vm-screen-bg {
    fill: #0a1a12;
    animation: vmScreenFlicker 3s ease-in-out infinite;
}

@keyframes vmScreenFlicker {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.95; }
    97% { opacity: 0.9; }
    98% { opacity: 0.7; }
    99% { opacity: 0.95; }
}

.board-component.vm-active .vm-indicator {
    fill: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.6);
}

/* Multimeter reading badge above component */
.vm-badge {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
    font-weight: 800;
    color: #4ade80;
    white-space: nowrap;
    pointer-events: none;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(34, 197, 94, 0.4);
    z-index: 20;
    animation: badgeFadeIn 0.25s ease-out;
    text-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

/* ═══════════════════════════════════════════════════
   New Components — Active States & Animations
   ═══════════════════════════════════════════════════ */

/* ── DC Fan — spinning blades ── */
.board-component.fan-active .fan-spin {
    transform-origin: 27.5px 25px;
}

.board-component.fan-active {
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.35));
}

/* ── Servo Motor — active glow ── */
.board-component.servo-active {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.board-component.servo-active .servo-indicator {
    fill: #22c55e;
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.8));
}

@keyframes servoSweep {
    0%, 100% { transform: rotate(-45deg); }
    50% { transform: rotate(45deg); }
}

.board-component.servo-active .servo-arm {
    animation: servoSweep 2s ease-in-out infinite;
}

/* ── 7-Segment Display — active segments glow ── */
.board-component.seg7-active .seg-active {
    fill: #ef4444 !important;
    filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.8));
}

.board-component.seg7-active {
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.3));
}

/* ── Transistor / MOSFET — active indicator ── */
.board-component.transistor-active {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.4));
}

.board-component.transistor-active .transistor-indicator,
.board-component.mosfet-active .mosfet-indicator {
    fill: #a855f7;
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.8));
}

.board-component.mosfet-active {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.4));
}

/* ── Op-Amp — active ── */
.board-component.opamp-active {
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.4));
}

.board-component.opamp-active .opamp-indicator {
    fill: #60a5fa;
    filter: drop-shadow(0 0 4px rgba(96, 165, 250, 0.8));
}

/* ── SCR / Triac — active (conducting) ── */
.board-component.scr-active,
.board-component.triac-active {
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
}

.board-component.scr-active .scr-indicator,
.board-component.triac-active .triac-indicator {
    fill: #fbbf24;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.8));
}

/* ── Push Button — pressed state ── */
.board-component.pushbtn-pressed .pushbtn-cap {
    transform: translateY(2px);
    fill: #dc2626 !important;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.6));
}

.board-component.pushbtn-pressed .pushbtn-indicator {
    fill: #22c55e;
}

/* ── Ammeter — active display (reuses voltmeter styles) ── */
.board-component.am-active {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.board-component.am-active .am-indicator {
    fill: #3b82f6;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.8));
}

/* ── Arduino — power LED blink ── */
.board-component.arduino-active {
    filter: drop-shadow(0 0 8px rgba(0, 150, 136, 0.35));
}

.board-component.arduino-active .arduino-led {
    fill: #22c55e;
    animation: arduinoLedBlink 1s ease-in-out infinite;
}

@keyframes arduinoLedBlink {
    0%, 100% { fill: #22c55e; filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.9)); }
    50% { fill: #15803d; filter: none; }
}

/* ── Arduino — flashed indicator (code stored in chip) ── */
.board-component.arduino-flashed .arduino-indicator {
    fill: #f59e0b;
    filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.8));
}

/* Running = green blink (overrides orange) */
.board-component.arduino-running .arduino-indicator {
    fill: #22c55e;
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.9));
    animation: arduinoLedBlink 1s ease-in-out infinite;
}

.board-component.arduino-running {
    filter: drop-shadow(0 0 8px rgba(0, 150, 136, 0.35));
}

/* ── Transformer — active hum glow ── */
.board-component.trafo-active {
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.35));
}

.board-component.trafo-active .trafo-indicator {
    fill: #f59e0b;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.8));
}

/* ── Voltage Regulator — active LED ── */
.board-component.vreg-active {
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.35));
}

.board-component.vreg-active .vreg-indicator {
    fill: #22c55e;
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.8));
}

/* ── LDR / Thermistor / Varistor — active glow ── */
.board-component.sensor-active {
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.35));
}

.board-component.sensor-active .sensor-indicator {
    fill: #facc15;
    filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.8));
}

/* ── Crystal Oscillator — active pulse ── */
.board-component.crystal-active {
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.3));
}

@keyframes crystalPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.board-component.crystal-active .crystal-indicator {
    fill: #60a5fa;
    animation: crystalPulse 0.5s ease-in-out infinite;
}

/* ── Photodiode — light detection glow ── */
.board-component.photodiode-active {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.35));
}

.board-component.photodiode-active .photodiode-indicator {
    fill: #a855f7;
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.8));
}

/* ── Zener Diode — conducting glow ── */
.board-component.zener-active {
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.35));
}

.board-component.zener-active .zener-indicator {
    fill: #fbbf24;
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.8));
}

/* ── Inductor — energized glow ── */
.board-component.inductor-active {
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.35));
}

/* ── DPDT Switch — position indicator ── */
.board-component.dpdt-pos-a .dpdt-arm {
    transform: rotate(-15deg);
}

.board-component.dpdt-pos-b .dpdt-arm {
    transform: rotate(15deg);
}

/* ── Terminal Block — connected glow ── */
.board-component.tblock-active {
    filter: drop-shadow(0 0 4px rgba(148, 163, 184, 0.3));
}

/* ══════════════════════════════════════════════════ */
/* ── Arduino IDE Modal ── */
/* ══════════════════════════════════════════════════ */
#arduino-ide-modal {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.ard-ide-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
}
.ard-ide-container {
    position: relative; z-index: 1;
    width: 820px; max-width: 95vw; max-height: 90vh;
    background: #0d1117; border: 1px solid #30363d; border-radius: 12px;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(14,116,144,0.15);
    animation: ard-modal-in 0.25s ease-out;
}
@keyframes ard-modal-in {
    from { transform: scale(0.92) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.ard-ide-header {
    background: #161b22; border-bottom: 1px solid #30363d;
}
.ard-ide-toolbar-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px 6px; gap: 10px;
}
.ard-ide-toolbar-actions {
    display: flex; align-items: center; gap: 6px;
    padding: 0 16px 10px; flex-wrap: wrap;
}
.ard-toolbar-sep {
    width: 1px; height: 20px; background: #30363d; margin: 0 4px;
}
.ard-ide-title {
    display: flex; align-items: center; gap: 8px;
    font: 700 14px 'Inter', sans-serif; color: #e6edf3;
}
.ard-ide-icon { font-size: 18px; }
.ard-ide-comp-id {
    font: 500 10px monospace; color: #8b949e;
    background: #21262d; padding: 2px 6px; border-radius: 4px;
}
.ard-flash-badge {
    font: 600 10px 'Inter', sans-serif; color: #3fb950;
    background: rgba(63,185,80,0.12); border: 1px solid rgba(63,185,80,0.3);
    padding: 2px 8px; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 4px;
}
.ard-ide-status-inline {
    display: flex; align-items: center; gap: 5px;
    font: 500 10px 'Inter', sans-serif; color: #8b949e;
    margin-left: auto;
}
.ard-ide-actions {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ard-preset-select {
    font: 500 11px 'Inter', sans-serif; color: #c9d1d9;
    background: #21262d; border: 1px solid #30363d; border-radius: 6px;
    padding: 5px 8px; cursor: pointer; outline: none;
    max-width: 180px;
}
.ard-preset-select:hover { border-color: #58a6ff; }
.ard-btn {
    font: 600 11px 'Inter', sans-serif; border: none; border-radius: 6px;
    padding: 6px 14px; cursor: pointer; transition: all 0.2s;
}
.ard-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ard-btn-run { background: #238636; color: #fff; }
.ard-btn-run:hover:not(:disabled) { background: #2ea043; }
.ard-btn-stop { background: #da3633; color: #fff; }
.ard-btn-stop:hover:not(:disabled) { background: #f85149; }
.ard-btn-reset { background: #9e6a03; color: #fff; }
.ard-btn-reset:hover:not(:disabled) { background: #bb8009; }
.ard-btn-erase { background: #30363d; color: #8b949e; border: 1px solid #484f58; }
.ard-btn-erase:hover { background: #da3633; color: #fff; border-color: #da3633; }
.ard-btn-close {
    background: transparent; color: #8b949e; font-size: 16px;
    padding: 4px 8px; border: 1px solid #30363d; border-radius: 6px;
}
.ard-btn-close:hover { color: #f85149; border-color: #f85149; }
.ard-ide-body {
    display: flex; flex: 1; min-height: 0; overflow: hidden;
}
.ard-ide-editor-pane {
    flex: 1.6; display: flex; flex-direction: column;
    border-right: 1px solid #30363d;
}
.ard-ide-serial-pane {
    flex: 1; display: flex; flex-direction: column;
}
.ard-ide-pane-header {
    font: 600 11px 'Inter', sans-serif; color: #8b949e;
    padding: 6px 12px; background: #161b22; border-bottom: 1px solid #21262d;
    display: flex; align-items: center; justify-content: space-between;
}
.ard-btn-mini {
    font: 500 10px 'Inter', sans-serif; color: #8b949e;
    background: #21262d; border: 1px solid #30363d; border-radius: 4px;
    padding: 2px 8px; cursor: pointer;
}
.ard-btn-mini:hover { color: #c9d1d9; border-color: #58a6ff; }
.ard-code-editor {
    flex: 1; resize: none; border: none; outline: none;
    background: #0d1117; color: #c9d1d9;
    font: 13px/1.5 'JetBrains Mono','Cascadia Code','Consolas','Fira Code',monospace;
    padding: 12px; tab-size: 2;
    min-height: 350px;
    overflow-y: auto;
}
.ard-code-editor::selection { background: #264f78; }
.ard-code-editor::placeholder { color: #484f58; }
.ard-serial-output {
    flex: 1; margin: 0; overflow-y: auto;
    background: #010409; color: #3fb950;
    font: 12px/1.5 'JetBrains Mono','Cascadia Code','Consolas',monospace;
    padding: 10px; min-height: 200px;
    border: none; white-space: pre-wrap; word-break: break-all;
}
/* Syntax error banner */
.ard-error-banner {
    background: rgba(218,54,51,0.15); border: 1px solid #da3633;
    border-radius: 6px; margin: 6px 12px; padding: 8px 12px;
    font: 500 11px/1.5 'JetBrains Mono','Consolas',monospace;
    color: #f85149; white-space: pre-wrap;
    animation: ard-shake 0.3s ease;
}
@keyframes ard-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.ard-ide-status {
    padding: 5px 12px; background: #161b22; border-top: 1px solid #21262d;
    font: 500 10px 'Inter', sans-serif; color: #8b949e;
    display: flex; align-items: center; gap: 6px;
}
.ard-status-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #6b7280;
    display: inline-block;
}
.ard-status-dot.running { background: #3fb950; box-shadow: 0 0 6px rgba(63,185,80,0.5); animation: ard-pulse 1s ease infinite; }
@keyframes ard-pulse { 50% { opacity: 0.5; } }

/* ── Arduino IDE Scrollbars (dark theme) ── */
.ard-ide-container ::-webkit-scrollbar { width: 8px; height: 8px; }
.ard-ide-container ::-webkit-scrollbar-track { background: #0d1117; }
.ard-ide-container ::-webkit-scrollbar-thumb {
    background: #30363d; border-radius: 4px; border: 2px solid #0d1117;
}
.ard-ide-container ::-webkit-scrollbar-thumb:hover { background: #484f58; }
.ard-ide-container ::-webkit-scrollbar-corner { background: #0d1117; }
.ard-serial-output::-webkit-scrollbar-track { background: #010409; }
.ard-serial-output::-webkit-scrollbar-thumb { border-color: #010409; }

/* ══════════════════════════════════════════════════ */
/* ── Component Info Modal ── */
/* ══════════════════════════════════════════════════ */
.comp-info-modal {
    position: fixed; inset: 0; z-index: 99998;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease;
}
.comp-info-modal.ci-visible { opacity: 1; }
.ci-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
}
.ci-container {
    position: relative; z-index: 1;
    width: 480px; max-width: 92vw; max-height: 85vh;
    background: var(--bg-panel, #0d1117);
    border: 1px solid var(--border, #30363d);
    border-radius: 14px;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 40px rgba(59,130,246,0.08);
    transform: scale(0.92) translateY(16px);
    transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
}
.ci-visible .ci-container { transform: scale(1) translateY(0); }

.ci-header {
    background: var(--bg-deeper, #161b22);
    border-bottom: 1px solid var(--border, #30363d);
    padding: 16px 20px 12px;
}
.ci-title-row {
    display: flex; align-items: flex-start; gap: 14px;
}
.ci-preview {
    width: 56px; height: 56px; flex-shrink: 0;
    background: var(--bg-panel, #0d1117);
    border: 1px solid var(--border, #30363d);
    border-radius: 10px; padding: 6px;
    display: flex; align-items: center; justify-content: center;
}
.ci-preview svg { width: 100%; height: 100%; }
.ci-title-text { flex: 1; min-width: 0; }
.ci-name {
    font: 700 16px 'Inter', sans-serif;
    color: var(--text, #e6edf3); margin: 0;
}
.ci-spec {
    font: 500 12px 'Inter', sans-serif;
    color: #8b949e; margin-top: 2px;
}
.ci-meta {
    display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap;
}
.ci-category, .ci-id, .ci-type {
    font: 500 10px 'JetBrains Mono', monospace;
    padding: 2px 8px; border-radius: 6px;
}
.ci-category { background: rgba(59,130,246,0.12); color: #58a6ff; border: 1px solid rgba(59,130,246,0.25); }
.ci-id { background: rgba(139,148,158,0.1); color: #8b949e; border: 1px solid rgba(139,148,158,0.2); }
.ci-type { background: rgba(168,85,247,0.1); color: #a78bfa; border: 1px solid rgba(168,85,247,0.2); }
.ci-close {
    background: transparent; border: 1px solid var(--border, #30363d);
    color: #8b949e; font-size: 14px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; cursor: pointer; flex-shrink: 0;
    transition: all 0.15s; margin-top: 2px;
}
.ci-close:hover { color: #f85149; border-color: #f85149; }

.ci-status-bar {
    display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.ci-status-bad, .ci-status-off, .ci-status-good, .ci-status-info {
    font: 600 10px 'Inter', sans-serif;
    padding: 3px 10px; border-radius: 8px;
}
.ci-status-bad { background: rgba(248,81,73,0.15); color: #f85149; border: 1px solid rgba(248,81,73,0.3); }
.ci-status-off { background: rgba(139,148,158,0.1); color: #8b949e; border: 1px solid rgba(139,148,158,0.2); }
.ci-status-good { background: rgba(63,185,80,0.12); color: #3fb950; border: 1px solid rgba(63,185,80,0.3); }
.ci-status-info { background: rgba(59,130,246,0.1); color: #58a6ff; border: 1px solid rgba(59,130,246,0.25); }

.ci-body {
    overflow-y: auto; padding: 8px 0;
    max-height: 55vh;
}
.ci-section {
    padding: 10px 20px;
}
.ci-section + .ci-section { border-top: 1px solid var(--border, #21262d); }
.ci-section-title {
    font: 600 11px 'Inter', sans-serif;
    color: #58a6ff; margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.ci-props-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.ci-prop {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg-deeper, rgba(22,27,34,0.6));
    padding: 6px 10px; border-radius: 8px;
    border: 1px solid var(--border, #21262d);
}
.ci-prop-icon { font-size: 13px; flex-shrink: 0; }
.ci-prop-label { font: 500 10px 'Inter', sans-serif; color: #8b949e; flex: 1; }
.ci-prop-value {
    font: 700 11px 'JetBrains Mono', monospace;
    color: #e6edf3; text-align: right;
}

.ci-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.ci-flag {
    font: 600 10px 'Inter', sans-serif;
    padding: 4px 10px; border-radius: 8px;
    background: rgba(245,158,11,0.1); color: #f59e0b;
    border: 1px solid rgba(245,158,11,0.25);
}

.ci-terminals { display: flex; gap: 6px; flex-wrap: wrap; }
.ci-term {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg-deeper, rgba(22,27,34,0.6));
    padding: 5px 10px; border-radius: 8px;
    border: 1px solid var(--border, #21262d);
}
.ci-term-idx {
    font: 700 10px 'JetBrains Mono', monospace;
    color: #0d1117; background: #58a6ff;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.ci-term-label { font: 600 11px 'Inter', sans-serif; color: #e6edf3; }
.ci-term-pos { font: 400 9px 'JetBrains Mono', monospace; color: #6e7681; }

.ci-connections { display: flex; flex-direction: column; gap: 4px; }
.ci-conn-row {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-deeper, rgba(22,27,34,0.6));
    padding: 5px 10px; border-radius: 8px;
    border: 1px solid var(--border, #21262d);
    font: 500 11px 'Inter', sans-serif;
}
.ci-conn-pin {
    font: 700 10px 'JetBrains Mono', monospace;
    color: #a78bfa; background: rgba(168,85,247,0.12);
    padding: 1px 6px; border-radius: 4px;
}
.ci-conn-arrow { color: #6e7681; font-size: 12px; }
.ci-conn-target { color: #e6edf3; flex: 1; }

.ci-empty {
    font: 400 11px 'Inter', sans-serif;
    color: #6e7681; font-style: italic;
    padding: 4px 0;
}
.ci-pos {
    font: 500 11px 'JetBrains Mono', monospace;
    color: #8b949e;
}

/* ── Component Info Scrollbar ── */
.ci-body::-webkit-scrollbar { width: 6px; }
.ci-body::-webkit-scrollbar-track { background: transparent; }
.ci-body::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
.ci-body::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* Light theme overrides */
[data-theme="light"] .ci-container {
    background: #ffffff; border-color: #d1d5db;
    box-shadow: 0 24px 64px rgba(0,0,0,0.15), 0 0 40px rgba(59,130,246,0.06);
}
[data-theme="light"] .ci-header { background: #f8f9fa; border-color: #e5e7eb; }
[data-theme="light"] .ci-name { color: #1f2937; }
[data-theme="light"] .ci-preview { background: #f1f3f5; border-color: #d1d5db; }
[data-theme="light"] .ci-prop { background: rgba(241,243,245,0.8); border-color: #e5e7eb; }
[data-theme="light"] .ci-prop-value { color: #1f2937; }
[data-theme="light"] .ci-term { background: rgba(241,243,245,0.8); border-color: #e5e7eb; }
[data-theme="light"] .ci-term-label { color: #1f2937; }
[data-theme="light"] .ci-conn-row { background: rgba(241,243,245,0.8); border-color: #e5e7eb; }
[data-theme="light"] .ci-conn-target { color: #1f2937; }
[data-theme="light"] .ci-close { border-color: #d1d5db; color: #6b7280; }
[data-theme="light"] .ci-section + .ci-section { border-color: #e5e7eb; }

