/* Bu araca özgü devre çizimi ve düzenleme kontrolleri. */
.logic-example-row { display: flex; align-items: stretch; gap: 8px; }
.logic-example-row select { min-width: 0; flex: 1; }
.logic-button { border: 1px solid var(--border-color); border-radius: 7px; background: var(--bg-card); color: var(--text-title); padding: 8px 12px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; min-height: 40px; }
.logic-button:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.logic-button:disabled { opacity: .4; cursor: default; }
.logic-task { border-left: 3px solid var(--color-primary); padding: 10px 12px; background: #f5f3ff; color: var(--text-title); font-size: .9rem; border-radius: 0 6px 6px 0; }
.logic-palette { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.logic-add { display: flex; gap: 6px; align-items: center; min-width: 0; min-height: 65px; padding: 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); text-align: left; color: var(--text-title); cursor: pointer; }
.logic-add:hover { border-color: var(--color-primary); background: #f5f3ff; }
.logic-add strong { display: block; font-size: .8rem; }
.logic-add small { display: block; font-size: .6rem; color: var(--text-muted); line-height: 1.3; }
.logic-palette-symbol { flex: 0 0 36px; height: 30px; color: var(--color-primary); }
.logic-palette-symbol svg { width: 100%; height: 100%; }
.logic-add-plus { color: var(--text-muted); margin-left: auto; font-size: 1rem; }
.logic-diagram { padding: 16px; scroll-margin-top: 90px; }
.logic-diagram-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.logic-diagram-heading h2 { margin: 0; }
.logic-count { font-size: .75rem; color: var(--text-muted); }
.logic-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.logic-toolbar #logicClear { margin-left: auto; }
.logic-connect-help { margin: 10px 0; }
.logic-viewport { overflow: auto; border: 1px solid var(--border-color); border-radius: 8px; background: #f8fafc; overscroll-behavior-x: contain; }
.logic-board { display: block; width: 100%; min-width: 620px; height: auto; user-select: none; font-family: 'Inter', sans-serif; }
.logic-node .logic-body { fill: white; stroke: #64748b; stroke-width: 1.8; }
.logic-node.is-selected .logic-selection { stroke: #4f46e5; stroke-dasharray: 4 3; fill: #eef2ff; fill-opacity: .65; }
.logic-selection { fill: transparent; stroke: transparent; }
.logic-handle { cursor: grab; touch-action: none; outline: none; }
.logic-handle:active { cursor: grabbing; }
.logic-handle:focus-visible .logic-selection { stroke: #4f46e5; stroke-width: 3; }
.logic-node-label { fill: #334155; font-size: 13px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.logic-node-type { fill: #475569; font-size: 11px; text-anchor: middle; pointer-events: none; }
.logic-port { cursor: crosshair; outline: none; touch-action: none; }
.logic-port .logic-port-dot { fill: white; stroke: #64748b; stroke-width: 2; }
.logic-port .logic-port-hit { fill: transparent; stroke: transparent; }
.logic-port.is-pending .logic-port-dot, .logic-port:focus-visible .logic-port-hit { stroke: #4f46e5; stroke-width: 3; }
.logic-port.is-pending .logic-port-dot { fill: #ddd6fe; }
.logic-port-value { font-size: 11px; font-weight: 700; fill: #475569; pointer-events: none; }
.logic-wire { fill: none; stroke: #94a3b8; stroke-width: 2.5; pointer-events: none; }
.logic-wire.is-one { stroke: #059669; stroke-width: 3; }
.logic-wire.is-unknown { stroke: #94a3b8; stroke-dasharray: 6 5; }
.logic-wire-hit { fill: none; stroke: transparent; stroke-width: 15; cursor: pointer; outline: none; }
.logic-wire-hit:hover, .logic-wire-hit:focus-visible { stroke: #ef4444; stroke-opacity: .25; }
.logic-switch { cursor: pointer; outline: none; }
.logic-switch rect { fill: #e2e8f0; stroke: #94a3b8; }
.logic-switch.is-one rect { fill: #d1fae5; stroke: #059669; }
.logic-switch:focus-within rect { stroke: #4f46e5; stroke-width: 3; }
.logic-input-button { display: block; width: 100%; height: 100%; opacity: 0; border: 0; cursor: pointer; touch-action: manipulation; }
.logic-bit { font-size: 22px; font-weight: 700; fill: #334155; text-anchor: middle; pointer-events: none; }
.logic-lamp { fill: #e2e8f0; stroke: #94a3b8; stroke-width: 2; }
.logic-lamp.is-one { fill: #d1fae5; stroke: #059669; }
.logic-lamp.is-unknown { fill: #f1f5f9; stroke-dasharray: 4 3; }
.logic-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .72rem; color: var(--text-muted); padding-top: 12px; }
.logic-legend span { display: inline-flex; align-items: center; gap: 5px; }
.logic-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.logic-dot.is-one { background: #059669; }.logic-dot.is-zero { background: #94a3b8; }.logic-dot.is-unknown { border: 1px dashed #64748b; }
.logic-result { font-size: 1rem; font-weight: 700; color: var(--text-title); padding-top: 14px; }
.logic-status { margin: 12px 0; min-height: 3em; font-size: .85rem; color: var(--text-muted); }
.logic-status.is-error { color: #b91c1c; }
#logicInspector { margin: 16px 0; }
#logicGateHelp { font-size: .88rem; }
#logicConnections .form-group { margin-top: 14px; margin-bottom: 0; }
#logicGateTable { max-width: 280px; margin-top: 14px; }
#logicGateTable:empty { display: none; }
#logicGateTable table { font-size: .8rem; }
#logicTruth .table-inner { max-height: 380px; overflow: auto; }
#logicTruth .detail-table th, #logicTruth .detail-table td { text-align: center; white-space: nowrap; }
#logicTruth .logic-current td { background: #eef2ff; color: #3730a3; font-weight: 700; }
.logic-table-note { padding: 0 16px 12px; }
.logic-pan-hint { display: none; }
.logic-empty { fill: #64748b; font-size: 16px; text-anchor: middle; }
.result-actions-image-root .logic-board { min-width: 0; }
.result-actions-image-root .logic-viewport { overflow: visible; }
.result-actions-image-root .logic-toolbar, .result-actions-image-root .logic-connect-help { display: none; }
@media (max-width: 420px) {
    .logic-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .logic-add small { font-size: .62rem; }
    .logic-diagram { padding: 12px; }
    .logic-example-row { flex-wrap: wrap; }
    .logic-example-row select { flex-basis: 100%; }
    .logic-example-row button { width: 100%; }
}
@media (max-width: 700px) { .logic-pan-hint { display: block; } }
@media print {
    .logic-toolbar, .logic-connect-help, .logic-pan-hint, .logic-status, #logicInspector { display: none !important; }
    .logic-viewport { overflow: visible !important; border: 0; }
    .logic-board { min-width: 0 !important; width: 100%; }
    .logic-diagram { padding: 0; }
    .logic-board { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    #logicTruth .table-inner { max-height: none; overflow: visible; }
}
