/* 10. bölüm: mantık kapıları ve Boole cebiri */

.c10-ptitle { font-family: var(--f-display); font-stretch: 85%; font-size: 0.75rem; color: var(--muted); }
.c10-hint { margin: 0; font-family: var(--f-display); font-stretch: 92%; font-size: 0.82rem; color: var(--silk-2); line-height: 1.35; }
.c10-hint.good { color: var(--copper-2); }
.c10-hint.bad { color: #ffc08a; }
.c10-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.c10-chips .chip { font-family: var(--f-display); font-size: 0.8rem; }
.chip.c10-c1 { border-color: var(--v1); color: #ffb3bf; background: rgba(255, 79, 106, 0.12); }
.chip.c10-c0 { border-color: var(--v0); color: #b9cdff; background: rgba(76, 134, 255, 0.1); }
.c10-ov { display: inline-block; border-top: 1.5px solid currentColor; padding-top: 1px; line-height: 1.1; }
.c10-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.c10-hot { position: absolute; z-index: 2; background: transparent; border: 0; padding: 0; border-radius: 8px; cursor: pointer; touch-action: manipulation; }
.c10-hot:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 1px; }
table.truth.c10-tt td { font-variant-numeric: tabular-nums; }
table.truth.c10-tt th.c10-sep, table.truth.c10-tt td.c10-sep { border-left: 1px solid var(--line); }
table.truth.c10-tt td.c10-mark { color: var(--heat); font-weight: 700; padding-left: 4px; padding-right: 4px; min-width: 1.4em; }
table.truth.c10-tt tr.c10-diff td { background: rgba(255, 138, 42, 0.13); }
table.truth.c10-tt tr.c10-diff.cur td { background: rgba(255, 138, 42, 0.24); }
table.truth.c10-tt td.c10-x { color: var(--muted); }

/* ---------- 1) ikili sayılar ---------- */
.c10-bin { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 22px 18px; }
.c10-byte { display: grid; grid-template-columns: repeat(8, minmax(34px, 62px)); column-gap: 10px; row-gap: 8px; justify-items: center; align-items: center; }
.c10-pv { display: flex; flex-direction: column; align-items: center; line-height: 1.1; color: var(--muted); transition: color 0.2s; }
.c10-pv b { font-family: var(--f-mono); font-size: 1rem; font-weight: 600; }
.c10-pv small { font-family: var(--f-mono); font-size: 0.66rem; opacity: 0.8; }
.c10-pv.on { color: var(--silk); }
.c10-pv.on b { color: var(--copper-2); }
.c10-led { width: 26px; height: 26px; border-radius: 50%; background: rgba(76, 134, 255, 0.2); border: 2px solid var(--v0); transition: background 0.18s, box-shadow 0.18s; }
.c10-led.on { background: var(--v1); border-color: #ff8fa0; box-shadow: 0 0 14px 4px rgba(255, 79, 106, 0.55), 0 0 2px 1px rgba(255, 220, 225, 0.6) inset; }
.c10-led.carry { outline: 2.5px solid var(--amp); outline-offset: 4px; }
.c10-dip {
  position: relative; display: grid; grid-template-columns: repeat(8, minmax(34px, 62px)); column-gap: 10px; justify-items: center;
  padding: 22px 12px 10px; margin: 0 -12px; border-radius: 6px;
  background: linear-gradient(#123d30, #0d3125); border: 1.5px solid rgba(239, 238, 226, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.c10-dipon { position: absolute; left: 12px; top: 4px; font-family: var(--f-display); font-stretch: 85%; font-weight: 700; font-size: 0.66rem; color: var(--silk-2); letter-spacing: 0.04em; }
.c10-dipon::after { content: "↑"; margin-left: 4px; }
.c10-sw {
  position: relative; width: 30px; height: 62px; border-radius: 4px; cursor: pointer; padding: 0;
  background: #071a13; border: 1.5px solid rgba(239, 238, 226, 0.25); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
  touch-action: manipulation;
}
.c10-sw:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 3px; }
.c10-knob {
  position: absolute; left: 3px; right: 3px; top: 30px; height: 26px; border-radius: 3px;
  background: linear-gradient(#f6f5ea, #c9cdbd); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.6);
  transition: top 0.16s cubic-bezier(.3, .7, .4, 1.3);
}
.c10-sw.on .c10-knob { top: 3px; }
.c10-sw.on { border-color: rgba(255, 79, 106, 0.7); }
.c10-swn { position: absolute; left: 0; right: 0; bottom: -17px; font-family: var(--f-mono); font-size: 0.6rem; color: var(--muted); }
.c10-dig { font-family: var(--f-mono); font-size: 1.5rem; font-weight: 700; margin-top: 8px; }
.c10-dig.b1 { color: var(--v1); }
.c10-dig.b0 { color: var(--v0); }
.c10-nib { width: 100%; display: flex; flex-direction: column; align-items: center; border-top: 2px solid rgba(239, 238, 226, 0.3); padding-top: 4px; margin-top: 2px; position: relative; }
.c10-nib::before, .c10-nib::after { content: ""; position: absolute; top: -2px; width: 2px; height: 7px; background: rgba(239, 238, 226, 0.3); }
.c10-nib::before { left: 0; }
.c10-nib::after { right: 0; }
.c10-nib b { font-family: var(--f-mono); font-size: 1.15rem; color: var(--gold); }
.c10-nib small { font-family: var(--f-display); font-stretch: 85%; font-size: 0.68rem; color: var(--muted); }
.c10-byte.shift .c10-dig, .c10-byte.shift .c10-knob { animation: c10-shift 0.35s ease-out; }
@keyframes c10-shift { from { transform: translateX(28px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.c10-sum { margin: 0; font-family: var(--f-mono); font-size: 1.05rem; color: var(--silk-2); text-align: center; min-height: 1.4em; }
.c10-sum b { color: var(--copper-2); font-weight: 600; }
.c10-sum span { color: var(--silk); font-weight: 700; font-size: 1.2rem; }
.c10-binm { justify-content: center; }
.c10-binm .meter { min-width: 118px; }
.c10-num { width: 5.2em; font-family: var(--f-mono); font-size: 0.95rem; padding: 0.35em 0.5em; border-radius: 6px; border: 1.5px solid rgba(239, 238, 226, 0.3); background: var(--mask); color: var(--silk); }
.c10-num:focus { outline: none; border-color: var(--copper-2); }

/* ---------- 2) temel kapılar ---------- */
.c10-gctl { padding-right: 120px; }
.c10-gctl .seg { flex-wrap: wrap; }
.c10-gates { grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 12px 20px; }
.c10-gates > .c10-gpane:first-child { grid-column: 1; grid-row: 1; }
.c10-gates > .c10-gpane + .c10-gpane { grid-column: 1; grid-row: 2; }
.c10-gates > .c10-ginfo { grid-column: 2; grid-row: 1; align-self: end; }
.c10-gates > .c10-tpanel { grid-column: 2; grid-row: 2; padding-top: 8px; }
.c10-gpane { min-height: 200px; border: 1px dashed rgba(239, 238, 226, 0.12); border-radius: 8px; }
.c10-ginfo { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.c10-ghead { display: flex; align-items: baseline; gap: 10px; }
.c10-gname { margin: 0; font-family: var(--f-display); font-stretch: 112%; font-weight: 800; font-size: 1.7rem; color: var(--silk); line-height: 1; }
.c10-gtr { font-family: var(--f-display); font-stretch: 90%; font-weight: 650; color: var(--copper-2); font-size: 0.95rem; }
.c10-gexpr { margin: 0; font-family: var(--f-mono); font-size: 1.1rem; color: var(--gold); }
.c10-gdesc { margin: 0; font-size: 0.92rem; color: var(--silk); line-height: 1.4; }
.c10-gedesc { margin: 0; font-size: 0.84rem; color: var(--silk-2); line-height: 1.4; }
.c10-tpanel { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.c10-tpanel table.truth { min-width: 180px; }
.c10-tpanel table.truth tr { cursor: pointer; }
.c10-tpanel table.truth tr:hover td { background: rgba(239, 238, 226, 0.05); }
.c10-tpanel table.truth tr.cur td { background: rgba(212, 147, 90, 0.2); }
.c10-tpanel table.truth td.c10-y { font-weight: 800; border-left: 1px solid var(--line); }
.c10-tpanel .c10-hint { font-size: 0.74rem; color: var(--muted); }

/* ---------- 3) De Morgan ---------- */
.c10-dm { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 14px 20px; }
.c10-dmleft { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding-top: 4px; }
.c10-presets { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 64px; }
.c10-pre { font-family: var(--f-display); font-stretch: 92%; font-weight: 650; font-size: 0.8rem; padding: 0.35em 0.75em; border-radius: 999px; border: 1.5px solid rgba(239, 238, 226, 0.25); background: var(--mask-3); color: var(--silk-2); cursor: pointer; }
.c10-pre:hover { border-color: var(--copper); }
.c10-pre.on { background: var(--silk); color: var(--mask); border-color: var(--silk); }
.c10-el { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); align-items: center; gap: 2px 10px; font-family: var(--f-display); font-stretch: 90%; font-size: 0.85rem; color: var(--silk-2); }
.c10-expr { font-family: var(--f-mono); font-size: 1.05rem; padding: 0.4em 0.6em; border-radius: 6px; border: 1.5px solid rgba(239, 238, 226, 0.3); background: var(--mask); color: var(--silk); min-width: 0; }
.c10-expr:focus { outline: none; border-color: var(--copper-2); }
.c10-expr.bad { border-color: var(--heat); }
.c10-err { grid-column: 2; color: #ffc08a; font-family: var(--f-display); font-size: 0.75rem; min-height: 0; }
.c10-err:empty { display: none; }
.c10-verdict { margin: 2px 0 0; font-family: var(--f-display); font-weight: 700; font-stretch: 92%; font-size: 0.95rem; padding: 4px 12px; border-radius: 6px; border: 1.5px solid transparent; align-self: flex-start; }
.c10-verdict:empty { display: none; }
.c10-verdict.good { color: #b9cdff; border-color: var(--v0); background: rgba(76, 134, 255, 0.14); }
.c10-verdict.bad { color: #ffc08a; border-color: var(--heat); background: rgba(255, 138, 42, 0.14); }
.c10-tscroll { min-height: 0; overflow: auto; }
.c10-cmp th, .c10-cmp td { padding: 3px 9px; }
.c10-dmright { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-width: 0; min-height: 0; }
.c10-bpane { flex: none; height: clamp(250px, 44vh, 380px); }
.c10-bpane canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.c10-abrow { display: flex; justify-content: center; gap: 8px; }
.c10-same { margin: 0; font-family: var(--f-display); font-stretch: 92%; font-weight: 650; font-size: 0.9rem; color: #b9cdff; text-align: center; }

/* ---------- 4) NAND bulmacası ---------- */
.c10-nctl { padding-right: 120px; }
.c10-nctl .seg button { min-width: 3.2em; }
.c10-nand { grid-template-rows: auto auto; gap: 18px; align-content: center; }
.c10-npane { min-height: 220px; aspect-ratio: 30 / 12; max-height: 62vh; }
.c10-npane canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.c10-hotlayer { position: absolute; inset: 0; }
.c10-hot.pend { box-shadow: 0 0 0 2px rgba(240, 176, 122, 0.5); }
.c10-nside { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; gap: 10px 24px; align-items: start; padding: 0 4px; }
.c10-nside .c10-nrow { grid-column: 1; grid-row: 1; }
.c10-nside .c10-hint { grid-column: 1; grid-row: 2; font-size: 0.9rem; max-width: 46ch; }
.c10-nside .c10-nstatus { grid-column: 1; grid-row: 3; font-size: 1rem; }
.c10-nside table.truth { grid-column: 2; grid-row: 1 / span 3; font-size: 0.95rem; }
.c10-cnt { font-family: var(--f-mono); font-size: 0.82rem; white-space: nowrap; }
.c10-nstatus { margin: 0; font-family: var(--f-display); font-stretch: 92%; font-weight: 650; font-size: 0.92rem; color: var(--silk); }
.c10-nstatus.good { color: var(--copper-2); }
.c10-nside table.truth th, .c10-nside table.truth td { padding: 4px 12px; }

/* ---------- 5) perceptron ---------- */
.c10-perc { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(150px, 0.48fr); gap: 12px 18px; }
.c10-ppane { min-height: 260px; }
.c10-ppane canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.c10-pside { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding-top: 28px; }
.c10-pfn { display: flex; flex-direction: column; gap: 4px; }
.c10-pform { margin: 0; font-family: var(--f-mono); font-size: 0.78rem; color: var(--silk-2); line-height: 1.4; }
.c10-pform b { color: var(--copper-2); font-weight: 600; }
.c10-psl { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-display); font-stretch: 92%; font-size: 0.88rem; }
.c10-psl label { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) 3.4em; align-items: center; gap: 8px; color: var(--silk-2); }
.c10-psl label input { width: 100%; }
.c10-psl .val { font-family: var(--f-mono); font-size: 0.84rem; color: var(--silk); text-align: right; }
.c10-pbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.c10-pbtns .btn { font-size: 0.84rem; padding: 0.42em 0.8em; }
.c10-histwrap { display: flex; flex-direction: column; gap: 4px; }
.c10-hist { display: flex; align-items: flex-end; gap: 3px; height: 42px; border-bottom: 1px solid var(--line); }
.c10-hist span { width: 8px; background: var(--heat); border-radius: 2px 2px 0 0; opacity: 0.85; }
.c10-hist span.zero { background: var(--v0); }
.c10-pnote { margin: 0; font-family: var(--f-display); font-stretch: 92%; font-size: 0.86rem; color: var(--silk-2); line-height: 1.35; min-height: 2.6em; }
.c10-pnote.good { color: var(--copper-2); font-weight: 650; }
.c10-pnote.bad { color: #ffc08a; font-weight: 650; }
.c10-xpane { grid-column: 1 / span 2; min-height: 150px; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .c10-bin { padding: 34px 10px 14px; gap: 14px; }
  .c10-byte, .c10-dip { grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: 5px; }
  .c10-byte { width: 100%; }
  .c10-dip { padding: 20px 8px 10px; margin: 0 -4px; }
  .c10-sw { width: 26px; height: 56px; }
  .c10-knob { top: 27px; height: 24px; }
  .c10-pv b { font-size: 0.82rem; }
  .c10-led { width: 20px; height: 20px; }
  .c10-dig { font-size: 1.15rem; }
  .c10-binm .meter { min-width: 0; flex: 1 1 40%; }
  .c10-gctl { padding-right: 96px; }
  .c10-gates { grid-template-columns: 1fr; grid-template-rows: 200px 250px auto auto; }
  .c10-gates > * { grid-column: auto !important; grid-row: auto !important; }
  .c10-dm { grid-template-columns: 1fr; }
  .c10-presets { padding-right: 84px; }
  .c10-bpane { min-height: 260px; flex: none; height: 270px; }
  .c10-nctl { padding-right: 96px; }
  .c10-npane { aspect-ratio: auto; height: 540px; max-height: none; }
  .c10-nside { grid-template-columns: 1fr; grid-template-rows: none; }
  .c10-nside > * { grid-column: auto !important; grid-row: auto !important; }
  .c10-perc { grid-template-columns: 1fr; grid-template-rows: 340px auto 190px; }
  .c10-pside { padding-top: 0; }
  .c10-xpane { grid-column: auto; }
}
