/* DNA Zipper: a replication bench with a four-pair DNA window (HTML: every base is a real button). Bases always show
   their letter; color is extra. Old strand = solid backbone, new strand = dashed backbone. Light and dark. */
html {
  --dz-A: #2e8b57; --dz-T: #c2412d; --dz-G: #e3a72a; --dz-C: #2f6fb5; --dz-Gink: #2a1a05;
  --dz-old: #1f3d5c; --dz-new: #2f6fb5; --dz-bond: #7d8fa3; --dz-win1: #f4f8fd; --dz-win2: #e3edf8;
  --dz-ink: #10212b; --dz-panel-bg1: #f5f8fd; --dz-panel-bg2: #e7eef9; --dz-accent: #2f6fb5; --dz-ok: #13704a; --dz-bad: #b3261e;
  --dz-chip: #ffffff; --dz-chip-on: #dbe6f7; --dz-empty: #ffffff;
}
html[data-theme="dark"] {
  --dz-old: #c9dcf0; --dz-new: #8fb6ef; --dz-bond: #6f8297; --dz-win1: #16202c; --dz-win2: #101822;
  --dz-ink: #e6eef6; --dz-panel-bg1: #1b2330; --dz-panel-bg2: #141b26; --dz-accent: #8fb6ef; --dz-ok: #4fd08c; --dz-bad: #ff8a80;
  --dz-chip: #111822; --dz-chip-on: #24365a; --dz-empty: #0c121a;
}

.dz { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 10px; color: var(--tlg-text); font-size: 16px; }
.dz input, .dz button { font: inherit; }
.dz-controls { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding: 8px 12px;
  background: linear-gradient(var(--dz-panel-bg1), var(--dz-panel-bg2)); color: var(--dz-ink); border: 3px solid var(--dz-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.dz-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; overflow: auto; }
.dz-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dz-accent); }
.dz-step { display: grid; gap: 4px; }
.dz-step-b { display: grid; gap: 5px; }
.dz-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.dz-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--dz-accent); color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .dz-n { color: #0d1626; }
.dz-step.is-done .dz-n { background: var(--dz-ok); }
.dz-mark { margin-left: auto; font-weight: 800; white-space: nowrap; }
.dz-mark.is-ok { color: var(--dz-ok); }
.dz-mark.is-bad { color: var(--dz-bad); }
.dz-note, .dz-q { margin: 0; }
.dz-q { font-weight: 700; }

/* helicase slider */
.dz-slider { display: grid; }
.dz-slider-h { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.dz-slider-v { font-weight: 800; color: var(--dz-accent); white-space: nowrap; }
.dz-slider.is-unset .dz-slider-v { font-weight: 600; font-style: italic; color: var(--dz-ink); opacity: .8; }
.dz-slider input { width: 100%; min-height: 30px; margin: 0; accent-color: var(--dz-accent); cursor: pointer; }
.dz-slider input:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.dz-ticks { display: flex; justify-content: space-between; font-size: 16px; opacity: .85; padding: 0 4px; }

/* chips */
.dz-chips { display: grid; gap: 5px; }
.dz-chips--3 { grid-template-columns: repeat(3, 1fr); }
.dz-chip { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 0; padding: 4px 18px 4px 8px; border: 2px solid #8fa3c4;
  border-radius: 10px; background: var(--dz-chip); color: var(--dz-ink); font-size: 16px; line-height: 1.15; text-align: center; cursor: pointer; }
.dz-chips--1 .dz-chip { justify-content: flex-start; text-align: left; }
html[data-theme="dark"] .dz-chip { border-color: #4a5a76; }
.dz-chip:hover:not(:disabled) { border-color: var(--dz-accent); }
.dz-chip:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.dz-chip.is-on { border-color: var(--dz-accent); background: var(--dz-chip-on); font-weight: 700; box-shadow: inset 0 0 0 1px var(--dz-accent); }
.dz-chip-m { position: absolute; right: 5px; bottom: 3px; font-weight: 800; }
.dz-chip.is-key { border-color: var(--dz-ok); box-shadow: inset 0 0 0 2px var(--dz-ok); }
.dz-chip.is-key .dz-chip-m { color: var(--dz-ok); }
.dz-chip.is-wrong { border-color: var(--dz-bad); border-style: dashed; }
.dz-chip.is-wrong .dz-chip-m { color: var(--dz-bad); }
.dz-chip:disabled { cursor: default; opacity: 1; }

/* brief */
.dz-brief { flex: none; padding: 6px 12px; border: 2px solid var(--dz-accent); border-radius: 12px; background: var(--dz-panel-bg1); color: var(--dz-ink); }
.dz-brief p { margin: 0; line-height: 1.4; }

/* the window */
.dz-window { flex: none; display: grid; gap: 4px; padding: 8px 12px 10px; border: 3px solid var(--dz-old); border-radius: 14px; background: linear-gradient(var(--dz-win1), var(--dz-win2)); color: var(--dz-ink); }
.dz-forkrow { display: flex; justify-content: flex-end; }
.dz-forkrow.is-left { justify-content: flex-start; }
.dz-fork { padding: 1px 10px; border-radius: 999px; background: var(--dz-old); color: var(--dz-win1); font-weight: 800; }
.dz-grid, .dz-pickers { display: grid; grid-template-columns: 36px repeat(4, minmax(0, 1fr)) 36px; column-gap: 10px; align-items: start; }
.dz-pickers { margin-top: 2px; }
.dz-end { align-self: start; padding-top: 14px; font-weight: 800; font-size: 18px; text-align: center; }
.dz-col { position: relative; display: grid; justify-items: center; }
.dz-col::before { content: ''; position: absolute; left: -12px; right: -12px; top: 0; height: 6px; background: var(--dz-old); border-radius: 3px; }
.dz-col::after { content: ''; position: absolute; left: -12px; right: -12px; bottom: 0; height: 0; border-top: 5px dashed var(--dz-new); }
.dz-tile { position: relative; display: grid; place-items: center; width: min(100%, 70px); height: 50px; margin-top: 6px; border-radius: 8px; border: 2px solid rgba(0,0,0,.35); color: #fff;
  font-size: 26px; transition: transform .35s ease; }
.dz-tile b { line-height: 1; }
.dz-tile--new { margin: 0 0 7px; }
.dz-tile.is-empty { background: var(--dz-empty); border: 2px dashed var(--dz-bond); color: var(--dz-ink); }
.dz-tile.is-blocked { opacity: .55; }
.dz-b-A { background: var(--dz-A); }
.dz-b-T { background: var(--dz-T); }
.dz-b-G { background: var(--dz-G); color: var(--dz-Gink); }
.dz-b-C { background: var(--dz-C); }
.dz-tile-m { position: absolute; right: -6px; bottom: -10px; padding: 0 4px; border-radius: 6px; background: var(--dz-win1); font-size: 16px; font-weight: 800; }
.dz-tile.is-right .dz-tile-m { color: var(--dz-ok); }
.dz-tile.is-wrong { box-shadow: 0 0 0 3px var(--dz-bad); }
.dz-tile.is-wrong .dz-tile-m { color: var(--dz-bad); }
.dz-bond { display: flex; justify-content: center; gap: 8px; height: 26px; }
.dz-bond i { width: 3px; height: 100%; background: var(--dz-bond); border-radius: 2px; }
.dz-bond--2 i:nth-child(3) { display: none; }
.dz-col.is-open .dz-bond i { height: 30%; opacity: .45; }
.dz-col.is-open .dz-tile--old { transform: translateY(-4px); }
.dz-col.is-open .dz-tile--new { transform: translateY(4px); }
.dz-newends { display: flex; justify-content: space-between; padding: 0 2px; font-weight: 800; }
.dz-pick { grid-template-columns: 1fr 1fr; gap: 4px; }
.dz-pick:first-child { grid-column: 2; }
.dz-pick .dz-chip { padding: 2px; min-height: 40px; color: #fff; font-weight: 800; font-size: 18px; border: 2px solid rgba(0,0,0,.3); }
.dz-pick .dz-chip.dz-b-G { color: var(--dz-Gink); }
.dz-pick .dz-chip.is-on { box-shadow: 0 0 0 3px var(--dz-old); transform: scale(1.04); }
.dz-pick.is-closed .dz-chip { filter: saturate(.35); }
.dz-strand-labels { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.dz-strand-labels span { display: inline-flex; align-items: center; gap: 6px; }
.dz-sw { display: inline-block; width: 34px; height: 0; border-top: 6px solid var(--dz-old); }
.dz-sw--new { border-top: 5px dashed var(--dz-new); }
.dz-readout { margin: 0; padding: 4px 10px; border-radius: 8px; background: var(--dz-panel-bg2); color: var(--dz-ink); }
.dz-seq { font-size: 18px; letter-spacing: .05em; }
.dz-warn { color: var(--dz-bad); font-weight: 700; }
.dz-daughters { flex: none; }
.dz-daughters-svg { display: block; width: 100%; max-width: 560px; height: auto; }
.dz-t { font-family: var(--tlg-font); font-size: 16px; font-weight: 700; fill: var(--dz-ink); }
.dz-dstrand { fill: none; stroke-width: 5; stroke-linecap: round; }
.dz-dstrand--old { stroke: var(--dz-old); }
.dz-dstrand--new { stroke: var(--dz-new); stroke-dasharray: 9 6; }
.dz-dstrand--unset { stroke: var(--dz-bond); stroke-dasharray: 2 6; }
.dz-rung { stroke: var(--dz-bond); stroke-width: 2.5; }
.dz-about { flex: none; padding: 4px 10px; border: 1px solid var(--tlg-border); border-radius: 8px; }
.dz-about summary { cursor: pointer; min-height: 32px; font-weight: 700; display: flex; align-items: center; }
.dz-about p { margin: 4px 0; }
.dz-ex p { margin: 4px 0; }
.dz-exb { display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0 2px; border-radius: 6px; color: #fff; font-weight: 800; }
.dz-exb.dz-b-G { color: var(--dz-Gink); }

@media (max-width: 900px) {
  .dz { position: static; grid-template-columns: 1fr; }
  .dz-controls, .dz-right { overflow: visible; }
  .dz-grid, .dz-pickers { grid-template-columns: 26px repeat(4, minmax(0, 1fr)) 26px; column-gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .dz *, .dz *::before { animation: none !important; transition: none !important; }
}
/* a picked base keeps its own color (the generic .is-on background must not cover it) */
.dz-pick .dz-chip.dz-b-A { background: var(--dz-A); }
.dz-pick .dz-chip.dz-b-T { background: var(--dz-T); }
.dz-pick .dz-chip.dz-b-G { background: var(--dz-G); }
.dz-pick .dz-chip.dz-b-C { background: var(--dz-C); }
.dz-pick .dz-chip.is-on { border-color: var(--dz-ink); }

/* ───────────── version 2 (2026-11): .dz2 bench. The .dz rules above draw version 1 replays (legacy-v1.js). ───────────── */
.dz2 { position: absolute; inset: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; padding: 10px; color: var(--tlg-text); font-size: 16px; }
.dz2 input, .dz2 button { font: inherit; }
.dz2-controls { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; padding: 8px 12px;
  background: linear-gradient(var(--dz-panel-bg1), var(--dz-panel-bg2)); color: var(--dz-ink); border: 3px solid var(--dz-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.dz2-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.dz2-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--dz-accent); }
.dz2-step { display: grid; gap: 6px; }
.dz2-step-b { display: grid; gap: 6px; }
.dz2-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.dz2-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--dz-accent); color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .dz2-n { color: #0d1626; }
.dz2-step.is-done .dz2-n { background: var(--dz-ok); }
.dz2-mark { margin-left: auto; font-weight: 800; white-space: nowrap; }
.dz2-mark.is-ok { color: var(--dz-ok); }
.dz2-mark.is-bad { color: var(--dz-bad); }
.dz2-note, .dz2-q { margin: 0; line-height: 1.35; }
.dz2-q { font-weight: 700; }
.dz2-mono { font-family: var(--tlg-font-mono, ui-monospace, Menlo, monospace); letter-spacing: .04em; }
.dz2-msg { margin: 0; min-height: 1.3em; font-weight: 700; }
.dz2-msg.is-warn { color: var(--dz-bad); }
.dz2-brief { flex: none; padding: 6px 12px; border: 2px solid var(--dz-accent); border-radius: 12px; background: var(--dz-panel-bg1); color: var(--dz-ink); line-height: 1.4; }
.dz2-about { flex: none; padding: 4px 10px; border: 1px solid var(--tlg-border); border-radius: 8px; }
.dz2-about summary { cursor: pointer; min-height: 32px; font-weight: 700; display: flex; align-items: center; }
.dz2-about p { margin: 4px 0; }

/* chips, steppers, buttons */
.dz2-chips { display: grid; gap: 6px; }
.dz2-chips--2 { grid-template-columns: repeat(2, 1fr); }
.dz2-chips--3 { grid-template-columns: repeat(3, 1fr); }
.dz2-chips--4 { grid-template-columns: repeat(4, 1fr); }
.dz2-chip { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 0; padding: 4px 20px 4px 8px; border: 2px solid #8fa3c4;
  border-radius: 10px; background: var(--dz-chip); color: var(--dz-ink); font-size: 16px; line-height: 1.2; text-align: center; cursor: pointer; }
.dz2-chips--1 .dz2-chip { justify-content: flex-start; text-align: left; }
html[data-theme="dark"] .dz2-chip { border-color: #4a5a76; }
.dz2-chip:hover:not(:disabled) { border-color: var(--dz-accent); }
.dz2-chip:focus-visible, .dz2-btn:focus-visible, .dz2-stepbtn:focus-visible, .dz2-num:focus-visible, .dz2-pal:focus-visible, .dz2-tile:focus-visible, .dz2-heli:focus-visible,
.dz2-slot:focus-visible, .dz2-scard:focus-visible, .dz2-strandbtn:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.dz2-chip.is-on { border-color: var(--dz-accent); background: var(--dz-chip-on); font-weight: 700; box-shadow: inset 0 0 0 1px var(--dz-accent); }
.dz2-chip-m { position: absolute; right: 6px; bottom: 4px; font-weight: 800; }
.dz2-chip.is-key, .dz2-strandbtn.is-key { border-color: var(--dz-ok); box-shadow: inset 0 0 0 2px var(--dz-ok); }
.dz2-chip.is-key .dz2-chip-m { color: var(--dz-ok); }
.dz2-chip.is-wrong, .dz2-strandbtn.is-wrong { border-color: var(--dz-bad); border-style: dashed; }
.dz2-chip.is-wrong .dz2-chip-m { color: var(--dz-bad); }
.dz2-chip:disabled { cursor: default; opacity: 1; }
.dz2-tubes .dz2-chip { justify-content: flex-start; padding: 2px 22px 2px 4px; }
.dz2-tubes .dz2-tube { width: 40px; height: 78px; flex: none; }
.dz2-stepper { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; }
.dz2-stepper-l { font-weight: 700; }
.dz2-stepper-c { display: inline-flex; align-items: center; gap: 4px; }
.dz2-stepbtn { width: 44px; height: 44px; border: 2px solid #8fa3c4; border-radius: 10px; background: var(--dz-chip); color: var(--dz-ink); font-size: 22px; font-weight: 800; cursor: pointer; }
.dz2-num { width: 64px; height: 44px; border: 2px solid #8fa3c4; border-radius: 10px; background: var(--dz-chip); color: var(--dz-ink); text-align: center; font-size: 20px; font-weight: 800; -moz-appearance: textfield; }
.dz2-num::-webkit-inner-spin-button, .dz2-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dz2-num.is-right { border-color: var(--dz-ok); box-shadow: inset 0 0 0 2px var(--dz-ok); }
.dz2-num.is-wrong { border-color: var(--dz-bad); border-style: dashed; }
.dz2-key { grid-column: 1 / -1; color: var(--dz-ok); font-weight: 800; }
.dz2-unit { font-weight: 700; }
.dz2-btnrow { display: grid; grid-template-columns: 1fr 1.4fr; gap: 6px; }
.dz2-btn { min-height: 44px; padding: 4px 10px; border: 2px solid #8fa3c4; border-radius: 10px; background: var(--dz-chip); color: var(--dz-ink); font-weight: 700; cursor: pointer; }
.dz2-btn--go { border-color: var(--dz-accent); background: var(--dz-chip-on); }
.dz2-btn:disabled, .dz2-stepbtn:disabled, .dz2-num:disabled { opacity: .6; cursor: default; }

/* helicase meter */
.dz2-meter { display: grid; gap: 2px; padding: 6px 8px; border-radius: 10px; background: var(--dz-panel-bg2); border: 1px solid var(--tlg-border); }
.dz2-meter p { margin: 0; }
.dz2-count { font-size: 20px; }
.dz2-effort { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dz2-effort-l { font-weight: 700; }
.dz2-dots { display: inline-flex; gap: 4px; }
.dz2-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--dz-ink); background: var(--dz-ink); }
.dz2-dots i.is-broken { background: transparent; border-style: dashed; }
.dz2-energy { height: 12px; border-radius: 6px; background: var(--dz-chip); border: 1px solid var(--dz-bond); overflow: hidden; }
.dz2-energy span { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--dz-G), var(--dz-G) 6px, #c88a10 6px, #c88a10 12px); }

/* base palette */
.dz2-palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dz2-pal { display: grid; place-items: center; min-height: 56px; padding: 2px; border: 2px solid rgba(0,0,0,.35); border-radius: 10px; color: #fff; cursor: pointer; }
.dz2-pal b { font-size: 24px; line-height: 1; }
.dz2-pal span { font-size: 12px; font-weight: 700; }
.dz2-pal.dz2-b-G { color: var(--dz-Gink); }
.dz2-pal:disabled { opacity: .55; cursor: default; }

/* the bench */
.dz2-bench { flex: none; display: grid; gap: 4px; padding: 6px 10px 6px; border: 3px solid var(--dz-old); border-radius: 14px; background: linear-gradient(var(--dz-win1), var(--dz-win2)); color: var(--dz-ink); min-width: 0; }
.dz2-bench-h { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.dz2-bench-t { font-weight: 700; font-size: 16px; }
.dz2-forktag { padding: 1px 10px; border-radius: 999px; background: var(--dz-old); color: var(--dz-win1); font-weight: 800; }
.dz2-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; scrollbar-width: thin; }
.dz2-track { position: relative; display: grid; grid-template-columns: 40px repeat(var(--n), 60px) 40px; column-gap: 8px; width: max-content; padding-top: 4px; }
.dz2-col { position: relative; display: grid; grid-template-rows: 14px 52px 30px 52px 14px; justify-items: stretch; grid-row: 1; }
.has-helicase .dz2-col { grid-template-rows: 14px 52px 30px 52px 14px 12px 52px 14px; }
.dz2-r1 { grid-row: 1; } .dz2-r2 { grid-row: 2; } .dz2-r3 { grid-row: 3; } .dz2-r4 { grid-row: 4; } .dz2-r5 { grid-row: 5; }
.dz2-end { grid-row: 1; align-self: start; font-weight: 800; font-size: 15px; text-align: center; padding-top: 0; }
.dz2-end--top { margin-top: 0; }
.dz2-end--bot { margin-top: 144px; }
.is-gen .dz2-end { font-size: 13px; opacity: .8; }
/* backbones: one segment per column, with the strand's direction arrow */
.dz2-seg { position: relative; margin: 0 -4px; display: grid; place-items: center; }
.dz2-seg::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; }
.dz2-seg--old::before { border-top: 6px solid var(--dz-old); transform: translateY(-3px); }
.dz2-seg--new::before { border-top: 5px dashed var(--dz-new); transform: translateY(-2px); }
.dz2-arrow { position: relative; z-index: 1; font-size: 11px; line-height: 1; padding: 0 3px; background: var(--dz-win1); color: var(--dz-ink); border-radius: 4px; }
.dz2-tile { position: relative; display: grid; place-items: center; width: 52px; height: 52px; justify-self: center; border-radius: 9px; border: 2px solid rgba(0,0,0,.35); color: #fff; font-size: 26px; padding: 0; transition: transform .3s ease, opacity .3s ease; }
button.dz2-tile { cursor: pointer; }
.dz2-tile b { line-height: 1; }
.dz2-tile.is-empty { background: var(--dz-empty); border: 2px dashed var(--dz-bond); color: var(--dz-ink); }
.dz2-tile.is-locked { background: var(--dz-win2); border: 2px dotted var(--dz-bond); color: var(--dz-ink); font-size: 18px; cursor: not-allowed; }
.dz2-tile.is-sel { box-shadow: 0 0 0 4px var(--dz-accent); }
.dz2-tile-m { position: absolute; right: -8px; bottom: -12px; padding: 0 4px; border-radius: 6px; background: var(--dz-win1); font-size: 15px; font-weight: 800; white-space: nowrap; z-index: 2; }
.dz2-tile-m:empty { display: none; }
.dz2-tile.is-right .dz2-tile-m { color: var(--dz-ok); }
.dz2-tile.is-wrong { box-shadow: 0 0 0 3px var(--dz-bad); }
.dz2-tile.is-wrong .dz2-tile-m { color: var(--dz-bad); }
.dz2-b-A { background: var(--dz-A); }
.dz2-b-T { background: var(--dz-T); }
.dz2-b-G { background: var(--dz-G); color: var(--dz-Gink); }
.dz2-b-C { background: var(--dz-C); }
.dz2-tile.is-empty.dz2-b-A, .dz2-tile.is-locked { background-image: none; }
/* hydrogen bonds: lines that snap (dashed stubs with a gap) when broken */
.dz2-bond { position: relative; display: flex; justify-content: center; gap: 8px; height: 100%; }
.dz2-bond i { width: 4px; height: 100%; background: var(--dz-bond); border-radius: 2px; }
.dz2-bond--2 i:nth-child(3) { display: none; }
.dz2-bond i.is-broken { background: linear-gradient(var(--dz-bond) 0 30%, transparent 30% 70%, var(--dz-bond) 70%); opacity: .7; }
.dz2-hb { position: absolute; right: -2px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 800; opacity: .75; }
.dz2-col.is-working .dz2-bond i:not(.is-broken) { background: var(--dz-bad); }
/* helicase benches: closed pairs show the other old strand; opened pairs send it down and away */
.has-helicase .dz2-col .dz2-tile--partner { grid-row: 4; }
.has-helicase .dz2-col .dz2-pseg { grid-row: 5; }
.has-helicase .dz2-col .dz2-r4:not(.dz2-tile--partner), .has-helicase .dz2-col .dz2-r5 { display: none; }
.has-helicase .dz2-col.is-open .dz2-tile--partner { grid-row: 7; opacity: .85; }
.has-helicase .dz2-col.is-open .dz2-pseg { grid-row: 8; }
.has-helicase .dz2-col.is-open .dz2-r4, .has-helicase .dz2-col.is-open .dz2-r5 { display: grid; }
.has-helicase .dz2-col.is-open .dz2-tile--old.dz2-r2 { transform: translateY(-3px); }
.has-helicase .dz2-end--bot { margin-top: 144px; }
.dz2-heli { position: absolute; top: 60px; left: calc(48px + var(--x, 0) * 68px - 4px - 22px); width: 44px; height: 104px; display: grid; justify-items: center; align-content: start; gap: 2px;
  cursor: grab; touch-action: none; z-index: 3; transition: left .16s ease; }
.dz2-heli.is-drag { cursor: grabbing; }
.dz2-heli-w { width: 0; height: 0; border-left: 22px solid transparent; border-right: 22px solid transparent; border-top: 62px solid #ffd23f; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.dz2-heli.is-gc .dz2-heli-w { border-top-color: #f4a300; }
.dz2-heli-l { padding: 1px 4px; border-radius: 6px; background: #ffd23f; color: #2a1a05; font-size: 12px; font-weight: 800; border: 1px solid #8a6a00; }
.dz2-poly { position: absolute; top: 176px; left: calc(48px + var(--x, 0) * 68px - 40px); padding: 1px 5px; border-radius: 6px; background: var(--dz-new); color: #fff; font-size: 12px; font-weight: 800; transition: left .16s ease; z-index: 2; }
html[data-theme="dark"] .dz2-poly { color: #0d1626; }
.dz2-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.dz2-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dz2-sw { display: inline-block; width: 30px; height: 0; border-top: 6px solid var(--dz-old); flex: none; }
.dz2-sw--new { border-top: 5px dashed var(--dz-new); }
.dz2-readout { margin: 0; padding: 4px 10px; border-radius: 8px; background: var(--dz-panel-bg2); color: var(--dz-ink); }
.no-bottom .dz2-col { grid-template-rows: 14px 52px; }

/* cards, pictures, small svg */
.dz2-card { flex: none; padding: 8px 12px; border: 2px solid var(--dz-old); border-radius: 12px; background: var(--dz-win1); color: var(--dz-ink); }
.dz2-card p { margin: 2px 0; }
.dz2-card-h { font-weight: 800; }
.dz2-cnts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 20px; font-weight: 800; }
.dz2-cnt { display: inline-flex; align-items: center; gap: 6px; }
.dz2-exb { display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0 2px; border-radius: 6px; color: #fff; font-weight: 800; font-size: 17px; }
.dz2-exb.dz2-b-G { color: var(--dz-Gink); }
.dz2-seqrow { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.dz2-svg { display: block; width: 100%; height: auto; max-height: 260px; }
.dz2-ladder { max-width: 460px; }
.dz2-forksvg { max-width: 600px; }
.dz2-pic { flex: none; }
.dz2-pic .dz2-svg { max-width: 560px; }
.dz2-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dz2-models--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dz2-model { margin: 0; padding: 6px; border: 2px solid var(--tlg-border); border-radius: 12px; background: var(--dz-win1); }
.dz2-model figcaption { text-align: center; font-weight: 800; color: var(--dz-ink); }
.dz2-sb { stroke: rgba(0,0,0,.35); stroke-width: 1.5; }
.dz2-sb-A { fill: var(--dz-A); } .dz2-sb-T { fill: var(--dz-T); } .dz2-sb-G { fill: var(--dz-G); } .dz2-sb-C { fill: var(--dz-C); }
.dz2-sbgap { fill: var(--dz-empty); stroke: var(--dz-bond); stroke-width: 2; stroke-dasharray: 5 3; }
.dz2-svgb { fill: #fff; font-weight: 800; font-size: 19px; }
.dz2-svgb-G { fill: var(--dz-Gink); }
.dz2-arrowline { stroke: var(--dz-ink); stroke-width: 2.5; fill: none; }
.dz2-ahead { fill: var(--dz-ink); }
.dz2-sugar { fill: var(--dz-chip-on); stroke: var(--dz-ink); stroke-width: 2; }
.dz2-phos { fill: var(--dz-G); stroke: var(--dz-ink); stroke-width: 2; }
.dz2-nucwrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dz2-nuc { display: flex; align-items: center; gap: 10px; }
.dz2-nucsvg { width: 180px; }
.dz2-primer { fill: none; stroke: var(--dz-bad); stroke-width: 3.5; }
.dz2-primer.is-new { stroke-width: 5; }
.dz2-spot { fill: var(--dz-chip); stroke: var(--dz-ink); stroke-width: 2; }
.dz2-spot.is-key { stroke: var(--dz-ok); stroke-width: 4; }
.dz2-glass { fill: var(--dz-chip); stroke: var(--dz-ink); stroke-width: 2.5; }
.dz2-band { fill: var(--dz-ink); }
.dz2-tuberow { display: flex; gap: 20px; }
.dz2-tuberow .dz2-tube { width: 130px; }
/* daughters builder */
.dz2-tray { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dz2-scard { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 10px; border: 2px solid #8fa3c4; border-radius: 10px; background: var(--dz-chip); color: var(--dz-ink); text-align: left; cursor: grab; touch-action: none; }
.dz2-scard.is-picked { border-color: var(--dz-accent); box-shadow: 0 0 0 3px var(--dz-accent); }
.dz2-scard.is-used { opacity: .5; }
.dz2-scard.is-drag { cursor: grabbing; }
.dz2-mols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dz2-mol { display: grid; gap: 6px; padding: 8px; border: 2px solid var(--dz-old); border-radius: 12px; background: var(--dz-win1); color: var(--dz-ink); }
.dz2-mol-h { margin: 0; font-weight: 800; }
.dz2-slot { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border: 2px dashed var(--dz-bond); border-radius: 10px; background: var(--dz-empty); color: var(--dz-ink); cursor: pointer; font-weight: 700; }
.dz2-slot.is-full { border-style: solid; justify-content: flex-start; padding-left: 10px; }
.dz2-slot.is-target { border-color: var(--dz-accent); }
/* find the old strand */
.dz2-findmol { display: grid; gap: 6px; }
.dz2-strandbtn { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 26px 4px 10px; border: 3px solid var(--dz-bond); border-radius: 10px; background: var(--dz-chip); color: var(--dz-ink); cursor: pointer; text-align: left; flex-wrap: wrap; }
.dz2-strandbtn[aria-checked="true"] { border-color: var(--dz-accent); box-shadow: 0 0 0 2px var(--dz-accent); }
.dz2-strandbtn-l { font-weight: 800; min-width: 60px; }
.dz2-strandbtn.is-oldstrand { border-style: solid; border-color: var(--dz-old); }
.dz2-strandbtn.is-newstrand { border-style: dashed; border-color: var(--dz-new); }
.dz2-ex p { margin: 4px 0; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.dz2.is-locked .dz2-heli { cursor: default; }

@media (max-width: 900px) {
  .dz2 { position: static; grid-template-columns: 1fr; }
  .dz2-controls, .dz2-right { overflow: visible; }
  .dz2-models { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dz2 *, .dz2 *::before { animation: none !important; transition: none !important; }
}
/* a tile button keeps the tile's letter size; the polymerase tag sits on the new strand's backbone row */
.dz2 button.dz2-tile { font-size: 26px; }
.dz2 button.dz2-tile.is-locked { font-size: 18px; }
.dz2-poly { top: 146px; }
.dz2-tubes .dz2-chip { flex-direction: column; justify-content: flex-start; align-items: center; text-align: center; padding: 4px 6px 18px; min-height: 120px; }
.dz2-tubes .dz2-tube { width: 46px; height: 88px; }
