/* 13. bölüm (1–4): latch, flip-flop, sayaç, kaydırmalı yazmaç */

.c13-ptitle { font-family: var(--f-display); font-stretch: 85%; font-size: 0.75rem; color: var(--muted); }
.c13-panel { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.c13-note { margin: 2px 0 0; font-family: var(--f-display); font-stretch: 92%; font-size: 0.84rem; color: var(--silk-2); line-height: 1.35; }
.c13-note.ok { color: var(--copper-2); }
.c13-lawrap { display: flex; flex-direction: column; gap: 5px; min-height: 0; min-width: 0; }
.c13-labody { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.c13-sch { min-height: 0; }
.c13-flag { min-width: 0; }
.ovl { text-decoration: overline; }

table.truth.c13-tt { width: 100%; }
table.truth.c13-tt th, table.truth.c13-tt td { padding: 4px 8px; }
table.truth.c13-tt td { font-variant-numeric: tabular-nums; color: var(--silk); }
table.truth.c13-tt td.b1 { color: var(--v1); }
table.truth.c13-tt td.b0 { color: var(--v0); }
table.truth.c13-tt td.c13-st { font-family: var(--f-display); font-stretch: 92%; color: var(--silk-2); text-align: left; }
table.truth.c13-tt td.c13-prev { font-family: var(--f-display); font-stretch: 90%; color: var(--copper-2); }

/* LED'ler */
.c13-leds { display: flex; gap: 14px; align-items: flex-end; }
.c13-ledc { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.c13-ledc small { font-family: var(--f-mono); font-size: 0.74rem; color: var(--silk-2); }
.c13-led {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.18), transparent 45%), #3a1820;
  border: 2px solid #5a2a33; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.45);
  transition: background 0.08s, box-shadow 0.08s;
}
.c13-led.big { width: 38px; height: 38px; }
.c13-led.on {
  background: radial-gradient(circle at 35% 32%, #ffe1e6, #ff4f6a 48%, #c22540);
  border-color: #ff8a9c; box-shadow: 0 0 18px 4px rgba(255, 79, 106, 0.55), inset 0 -3px 6px rgba(120, 0, 20, 0.35);
}

/* 1) SR latch */
.c13-sr { grid-template-rows: minmax(0, 1.5fr) minmax(150px, 1fr); }
.c13-row { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 16px; min-height: 0; }
.c13-row .c13-panel { padding-top: 34px; }

/* 2) D latch / flip-flop */
.c13-dff { grid-template-rows: minmax(0, 1.15fr) auto minmax(170px, 1fr); }
.c13-meters .meter { min-width: 96px; }

/* 3) sayaç */
.c13-cntsplit { grid-template-rows: minmax(0, 0.9fr) auto minmax(190px, 1.15fr); }
.c13-mid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.c13-cnt { gap: 10px; }
.c13-cnt .meters .meter { min-width: 0; }
.c13-wrap { align-self: flex-start; }
table.truth.c13-jk { max-width: 330px; }
table.truth.c13-jk th, table.truth.c13-jk td { padding: 2px 8px; }
.c13-jkbox .c13-note { font-size: 0.8rem; }

/* 4) kaydırmalı yazmaç */
.c13-shsplit { grid-template-rows: minmax(0, 1fr) auto minmax(190px, 1.05fr); }
.c13-shmid { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.c13-strip { padding: 6px 14px; border-radius: 8px; background: rgba(6, 21, 15, 0.55); box-shadow: inset 0 0 0 1px rgba(239, 238, 226, 0.1); }
.c13-shmid .c13-note { flex: 1 1 170px; margin: 0; }
.c13-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

@media (max-width: 860px) {
  .c13-sr { grid-template-rows: auto 220px; }
  .c13-row { grid-template-columns: 1fr; grid-template-rows: 280px auto; }
  .c13-row .c13-panel { padding-top: 0; }
  .c13-dff { grid-template-rows: 260px auto 230px; }
  .c13-cntsplit { grid-template-rows: 170px auto 250px; }
  .c13-mid { grid-template-columns: 1fr; }
  .c13-shsplit { grid-template-rows: 190px auto 260px; }
  .c13-leds { gap: 10px; }
}
