/* 論理回路の部品（w-c3-logic.js） */
.w-c3-logic { background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 14px; padding: 12px; margin: 8px 0 14px; }
.lg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.lg-lab { font-size: 0.88rem; font-weight: 700; color: var(--sub, #4b5563); }
.lg-chip { font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; min-height: 44px; padding: 4px 12px; border: 2px solid var(--line, #e2e8f0); background: #fff; border-radius: 999px; color: var(--sub, #4b5563); }
.lg-chip[aria-pressed="true"] { border-color: var(--blue, #2563eb); color: var(--blue-d, #1d4ed8); background: var(--blue-l, #eaf1ff); }
.lg-f { margin: 0 0 4px; font-size: 0.95rem; color: var(--ink, #1f2937); }
.lg-f b { color: var(--navy, #1e3a8a); }
.lg-svg svg { width: 100%; max-width: 600px; height: auto; display: block; margin: 0 auto; }
.lg-wire { fill: none; stroke: #94a3b8; stroke-width: 2.5; stroke-linejoin: round; transition: stroke .2s, stroke-width .2s; }
.lg-wire.on { stroke: #f59e0b; stroke-width: 5; }
.lg-dot { fill: #94a3b8; stroke: none; }
.lg-dot.on { fill: #f59e0b; }
.lg-gate { fill: #fff; stroke: #1f2937; stroke-width: 2.5; stroke-linejoin: round; }
.lg-back { fill: none; }
.lg-in { cursor: pointer; }
.lg-in circle { fill: #fff; stroke: #94a3b8; stroke-width: 2.5; }
.lg-in.on circle { fill: #fff4dc; stroke: #f59e0b; stroke-width: 3.5; }
.lg-v { font: 700 17px/1 var(--mono, monospace); fill: #4b5563; }
.lg-in.on .lg-v, .lg-out.on .lg-v { fill: #b45309; }
.lg-n { font: 700 16px/1 inherit; font-family: inherit; fill: #1f2937; }
.lg-mid { font: 700 15px/1 var(--mono, monospace); fill: #4b5563; }
.lg-mid.on { fill: #b45309; }
.lg-out circle { fill: #fff; stroke: #94a3b8; stroke-width: 2.5; transition: fill .2s; }
.lg-out.on circle { fill: #fde68a; stroke: #f59e0b; stroke-width: 3.5; }
.lg-rays line { stroke: #f59e0b; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.lg-out.on .lg-rays line { opacity: 1; }
.lg-ctrl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 4px; }
.lg-b { font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer; min-height: 44px; padding: 6px 14px; border-radius: 10px; border: 2px solid var(--blue, #2563eb); background: #fff; color: var(--blue-d, #1d4ed8); }
.lg-b[aria-pressed="true"] { background: #fff4dc; border-color: #f59e0b; color: #b45309; }
.lg-say { text-align: center; font: 700 0.98rem/1.5 var(--mono, monospace); color: var(--ink, #1f2937); margin: 4px 0 8px; min-height: 1.5em; }
.lg-tblwrap { overflow-x: auto; }
.lg-tbl { border-collapse: collapse; margin: 0 auto; font-family: var(--mono, monospace); font-size: 1rem; }
.lg-tbl caption { caption-side: top; font-family: inherit; font-size: 0.85rem; color: var(--sub, #4b5563); padding-bottom: 4px; }
.lg-tbl th, .lg-tbl td { border: 1px solid #cbd5e1; padding: 6px 10px; text-align: center; min-width: 2em; }
@media (max-width: 480px) { .lg-tbl th, .lg-tbl td { padding: 6px 7px; min-width: 1.6em; } }
.lg-tbl th { background: #f1f5f9; }
.lg-tbl th.mid, .lg-tbl td.mid { color: #64748b; background: #f8fafc; }
.lg-tbl th.out { background: #eaf1ff; color: #1e3a8a; }
.lg-tbl td.out { font-weight: 700; }
.lg-tbl th.in + th.mid, .lg-tbl td.in + td.mid, .lg-tbl th.in + th.out, .lg-tbl td.in + td.out, .lg-tbl th.mid + th.out, .lg-tbl td.mid + td.out { border-left: 3px solid #1f2937; }
.lg-tbl th.mk, .lg-tbl td.mk { border: none; background: none; min-width: 1.6em; text-align: left; color: #b45309; font-weight: 700; font-family: inherit; font-size: 0.85rem; padding-left: 6px; }
.lg-tbl tbody tr { cursor: pointer; }
.lg-tbl tbody tr.now td:not(.mk) { background: #fff4dc; }
.lg-tbl tbody tr.now td.out { color: #b45309; }
.lg-tbl tbody tr:focus-visible { outline: 3px solid var(--blue, #2563eb); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) {
  .lg-wire, .lg-out circle { transition: none; }
}
