/* cohort: Platform A, M3 selective disclosure (the question as a predicate program, one bit out) and M4 ZK cohort (GeT-RM calls through
   nullifiers, counts, noise and release). Layout and data marks only. Core components (.mod-head .figbox .sheet .readout .rd-cell .meter
   .stat .opt .switch .btn .act .stepper .tag .key .syn-chip .note .fnote details.sources) keep their own styles.
   v5 (the films' look): warm-grey marks with a fine ink outline, the phenotype scale from the --ph-* tokens, true in ink and false in
   mid warm grey, the one bit that leaves the device in orange, labels in Figtree caps, the figures' hints in Newsreader italic. */

.co { container: co / inline-size; }
.co-box { margin: 32px 0 0; }
.co-box > .fig, .co-sbox > .fig { container: co-fig / inline-size; }
.co-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 16px 24px; }
.co-foot .fnote { margin: 0; }
.co-foot details.sources { margin-top: 8px; }
.co-foot code, .co-dfig code { font-family: var(--mono); font-size: 12px; }
.co-sh { display: flex; align-items: center; gap: 8px; }
.co-sh svg { flex: none; color: var(--ink); }
.co .co-mu { color: var(--muted); }

/* ---------- M3: the question and its program bytes ---------- */
.co-qt { margin: 0; max-width: 34em; }
.co-prog { margin-top: 12px; }
.co-bytes { display: flex; flex-wrap: wrap; gap: 2px; --dur: 504ms; }
.co-bytes i { width: 8px; height: 8px; flex: none; background: var(--g3); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); }
.co-bytes i.bh { background: var(--ink); }
.co-bytes i.bp { background: var(--blue-500); }
/* The legend's "ops" square follows the op bytes (warm grey; the header stays ink) */
.co-bkey > span:nth-child(3) > i { background: var(--g3); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); }
.co-pmeta { margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.co-bkey { margin-top: 6px; }

/* ---------- M3: the device (a warm-grey region framed in ink, as in the How diagram), the wire, the sponsor ---------- */
.co-split { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); margin-top: 24px; align-items: stretch; }
.co-side { min-width: 0; padding: 16px; transition: background var(--t2); }
.co-priv { background: var(--g1); border: 1.25px solid var(--ink); }
.co-pub { background: var(--white); border: 1.25px solid var(--ink); align-self: start; }
.co-side > .co-sh { margin: 0 0 12px; }
.co-priv > .co-sh svg { color: var(--ink); }
.co-pg + .co-pg { margin-top: 12px; }
.co-pg > .k { margin: 0 0 4px; }
.co-pg ul, .co-pg ol { margin: 0; padding: 0; list-style: none; }
.co-row { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 0 5px 8px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; line-height: 1.4; transition: background var(--t3) var(--ease); }
.co-row::before { content: ""; position: absolute; left: 0; top: -1px; bottom: 0; width: 2px; background: transparent; transition: background var(--t2); }
.co-row > span:first-child { min-width: 0; color: var(--muted); }
.co-row.live { background: var(--white); }
.co-row.live::before { background: var(--signal); }
.co-row.was::before { background: var(--ink); }
.co-v { text-align: right; white-space: nowrap; color: var(--ink); transition: color var(--t2); }
.co-v.na { color: var(--muted); }

/* The program run: one row per op, the value it pushes (T true, F false, U unknown), then the output bit */
.co-op { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) 20px; gap: 8px; align-items: center; padding: 5px 0 5px 8px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; line-height: 1.35; position: relative; transition: background var(--t3) var(--ease); }
.co-op::before { content: ""; position: absolute; left: 0; top: -1px; bottom: 0; width: 2px; background: transparent; transition: background var(--t2); }
.co-op.live { background: var(--white); }
.co-op.live::before { background: var(--signal); }
.co-oi { color: var(--muted); }
.co-on { color: var(--ink); }
.co-oa { min-width: 0; color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.co-res { border-top-color: var(--ink); }
/* Truth values: true in ink with paper text, false in mid warm grey with ink text, unknown hollow (same in every M3 figure) */
.co-tri { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font: 10.5px/1 var(--mono); background: var(--white); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-2); transition: opacity var(--t3) var(--ease), transform var(--t3) var(--ease); }
.co-tri.tT, .co-tri.o1 { background: var(--ink); color: var(--paper); box-shadow: none; }
.co-tri.tF, .co-tri.o0 { background: var(--blue-500); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); }
.co-mini { display: inline-flex; gap: 2px; }
.co-mini i { width: 7px; height: 7px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line-2); transition: background var(--t2), box-shadow var(--t2); }
.co-mini i.tT { background: var(--ink); box-shadow: none; }
.co-mini i.tF { background: var(--blue-500); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); }
/* Before and during the run: values appear as each op finishes, the answer when the bit arrives */
.co-pend .co-op:not(.done) .co-tri { opacity: 0; transform: translateY(3px); }
.co-pend .co-mini i:not(.on) { background: var(--white); box-shadow: inset 0 0 0 1px var(--line-2); }
.co-pend .co-ans { opacity: 0; }
.co-ans { transition: opacity var(--t3) var(--ease); }

/* Sponsor's view: what stays on the device becomes solid pixel bars (the program is public, its values are not) */
.co-masked .co-priv .co-v { color: transparent; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 8px); }
.co-masked .co-priv .co-v.na { background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 8px); }
.co-masked .co-priv .co-op:not(.co-res) .co-tri { color: transparent; background: var(--ink); box-shadow: none; }
.co-masked .co-priv .co-mini i { background: var(--ink); box-shadow: none; }
.co-masked .co-priv > .co-sh::after { content: "· never received"; color: var(--signal-ink); }
/* The wire leaves from the OUT row (--wy, set by cohort.js) */
.co-wire { position: relative; }
.co-wire::before { content: ""; position: absolute; left: 6px; right: 10px; top: var(--wy, 50%); border-top: 1.25px solid var(--ink); }
.co-wire::after { content: ""; position: absolute; right: 4px; top: calc(var(--wy, 50%) - 2.25px); border: 3.75px solid transparent; border-left: 6px solid var(--ink); border-right: 0; }
.co-wire .co-wl { position: absolute; left: 0; right: 0; top: calc(var(--wy, 50%) + 10px); margin: 0; text-align: center; }
.co-pkt { position: absolute; left: 6px; top: calc(var(--wy, 50%) - 5px); width: 10px; height: 10px; background: var(--signal); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); opacity: 0; }   /* the one bit that leaves */
.co-ans { padding: 0 0 12px; }
.co-ans b.yes { color: var(--ink); }
.co-kv { margin: 0; }
.co-kv > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); align-items: baseline; }
.co-kv dd { margin: 0; min-width: 0; font-size: 13px; line-height: 1.4; }
.co-kv dd small { display: block; margin-top: 2px; font-family: var(--font); font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.co-kv code { overflow-wrap: anywhere; }
.co-tally { margin-top: 24px; }
.meter.co-one { flex: none; }
.meter.co-one > i { flex: 0 0 6px; width: 6px; }
.co-why { margin-top: 12px; }
.co-why:empty { display: none; }
.co-cav { margin-top: 24px; max-width: none; }

/* ---------- M3 controls as a bar across the figure, so the figure keeps its full width ---------- */
.co-box { grid-template-columns: minmax(0, 1fr); }
.co-box > .co-cbar { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 32px; align-items: start; border-left: 0; border-top: 0; border-bottom: 1px solid var(--line); }
.co-dbox > .ctl > .switch { grid-column: 2; }
.co-samples .opt { min-width: 56px; justify-content: center; }
.co-sdesc { margin: 8px 0 0; color: var(--muted); }
.co-qs .opt { flex-direction: column; align-items: flex-start; gap: 2px; }

/* ---------- Status sheets: one ruled list per module ---------- */
.co-plan { margin-top: 24px; }
.co-road { list-style: none; margin: 0; padding: 0; }
.co-road li { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr) auto; gap: 4px 20px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.co-road li:first-child { padding-top: 0; }
.co-road b { font-weight: 500; font-size: 15px; line-height: 1.35; }
.co-road li > span:not(.tag) { font-size: 14px; line-height: 1.4; color: var(--muted); }
.co-road .tag { justify-self: end; }
.co-plan details.sources { margin-top: 24px; }

/* ---------- M4: the cohort figure (one square per contribution; warm-grey and orange squares with a fine ink outline, like the films' atoms) ---------- */
.co-sbox { margin: 32px 0 0; }
.co-stage { position: relative; min-height: 120px; outline-offset: 6px; touch-action: manipulation; cursor: pointer; transition: height var(--t3) var(--ease); }
.co-load { margin: 0; padding-top: 48px; }
.co-stage > i { position: absolute; left: 0; top: 0; width: var(--s, 14px); height: var(--s, 14px); transform-origin: 0 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); transition: background var(--t3) var(--ease), box-shadow var(--t3) var(--ease), opacity var(--t3) var(--ease); }
.co-stage > i.off, .co-stage > i.ns, .co-stage > i.sup { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.co-stage > i.seal { background: var(--ink); }
.co-stage > i.twin { box-shadow: inset 0 0 0 2px var(--signal); }
.co-stage > i.dup { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--signal); }
.co-stage > i.na { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); }
.co-stage > i.sel { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 1; }
.co-stage.co-snap > i, .co-stage.co-snap { transition: none; }
.co-lbl { position: absolute; inset: 0; pointer-events: none; }
.co-lbl > span { position: absolute; font-family: var(--mono); text-align: center; white-space: nowrap; }
.co-cv { font-size: 12px; line-height: 16px; color: var(--ink); transition: top var(--t3) var(--ease); }
.co-cv b { font-weight: 400; color: var(--muted); }
.co-cv.sup { color: var(--muted); }
.co-lbl > .co-cb { font-family: var(--font); font-weight: 500; font-size: 10.5px; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.co-base { height: 0; border-top: 1px solid var(--ink); }
.co-insp { margin: 16px 0 0; min-height: 1.4em; overflow-wrap: anywhere; }
/* The figures' hints ("Tap or hover a square.") are one-line captions: the films' Newsreader italic. Details stay in mono. */
.co .co-insp > .co-mu { font-family: var(--display); font-style: italic; font-size: 16px; line-height: 1.3; letter-spacing: -0.005em; }
.co-skey { margin-top: 8px; }
.key i.co-krej { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--signal); }
.key i.co-kna { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); }
.co-sread { margin-top: 24px; }
.co-sread .rd-v.mono { font-size: 13px; }

/* ---------- M4: the steps column (nav, then parameters); on one-column layouts the nav sits above the figure ---------- */
.co-nav, .co-par { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.co-now .h4 { margin: 0 0 6px; }
.co-take { margin: 0; min-height: 4.4em; }
.co-steps .opt b { font: 400 11px var(--mono); color: var(--muted); margin-right: 4px; }
.co-steps .opt:disabled { cursor: default; opacity: .5; }
.co-rg .range { display: block; margin: 8px 0 2px; }
.co-rt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.co-rt output { color: var(--tone); }
.co-eps { text-transform: none; }
.co-dep { margin-top: 24px; max-width: 46em; }

/* ---------- M3: three published site sets, one square per site; an orange frame reads them in order ---------- */
.co-ss, .co-dp { margin: 24px 0 0; }
.co-sstop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 16px; }
.co-sstop .k { margin: 0; }
.co-sssamp .opt { min-width: 56px; justify-content: center; }
.co-ssb { position: relative; --q: 20px; outline-offset: 6px; }
.co-ssb > .co-load { padding: 24px 0; }
.co-ssr { display: grid; grid-template-columns: minmax(0, 10.5em) minmax(0, 1fr) auto; gap: 12px 24px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.co-ssr:first-child { border-top: 0; padding-top: 4px; }
.co-ssn { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.co-ssm { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font: 10.5px/1.3 var(--mono); letter-spacing: 0; color: var(--muted); }
.co-ssq { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; min-width: 0; }
.co-ssg { display: flex; flex-direction: column; gap: 6px; }
.co-sss { display: flex; gap: 4px; }
.co-sss i { width: var(--q); height: var(--q); flex: none; cursor: pointer; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); transition: background var(--t3) var(--ease), box-shadow var(--t3) var(--ease); }
.co-sss i.st { background: var(--ink); box-shadow: none; }
.co-sss i.sf { background: var(--blue-500); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); }
.co-sss i.su { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.co-sss i.sel { outline: 2px solid var(--ink); outline-offset: 2px; }
.co-ssgl { font: 500 10px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.co-sso { display: flex; align-items: center; gap: 10px; justify-self: end; min-width: 92px; }
.co-ssbit { white-space: nowrap; }
.co-lens { position: absolute; left: 0; top: 0; width: calc(var(--q) + 8px); height: calc(var(--q) + 8px); box-sizing: border-box; border: 2px solid var(--signal); opacity: 0; pointer-events: none; transition: transform 110ms var(--ease-io), opacity var(--t1); }
.co-lens.on { opacity: 1; }
.co-sskey { margin-top: 8px; }
/* The legend's "false" square follows the squares (mid warm grey; true stays ink) */
.co-sskey > span:nth-child(2) > i { background: var(--blue-500); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); }

/* ---------- M4: the privacy budget, two linked charts (ranges with a draggable k, release curves with a draggable ε) ---------- */
.co-dp { container: co-dp / inline-size; }
.co-dpg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.co-dpg > div { min-width: 0; }
.co-dpg > div > .k { margin: 0 0 12px; }
@container co-dp (min-width: 700px) { .co-dpg { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 40px; } }
.co-wh, .co-cur { position: relative; touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; outline-offset: 6px; }
.co-wh { --lc: 34px; --rc: 36px; --gp: 12px; padding: 28px 0 26px; }
.co-wh > .co-load { padding: 0; margin: 0; }
.co-whr { position: relative; z-index: 1; display: grid; grid-template-columns: var(--lc) minmax(0, 1fr) var(--rc); gap: var(--gp); align-items: center; height: 30px; }
.co-whr + .co-whr { border-top: 1px solid var(--line); }
.co-whl { display: flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; }
.co-whl i { width: 7px; height: 7px; flex: none; background: var(--mk); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); }
.co-wht { position: relative; height: 100%; }
.co-whw { position: absolute; top: 50%; height: 8px; margin-top: -4px; background: var(--g2); transition: left var(--t3) var(--ease), width var(--t3) var(--ease); }
.co-whc { position: absolute; top: 50%; width: 2px; height: 16px; margin: -8px 0 0 -1px; background: var(--ink); transition: left var(--t3) var(--ease); }
.co-whp { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .5); outline: 1.5px solid var(--white); transition: left var(--t3) var(--ease-io), background var(--t3), box-shadow var(--t3); }
.co-whp.sup { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.co-whv { font: 400 13px/1 var(--mono); text-align: right; }
.co-whr.sup .co-whv { color: var(--muted); }
.co-whk, .co-whax { position: absolute; left: calc(var(--lc) + var(--gp)); right: calc(var(--rc) + var(--gp)); pointer-events: none; }
.co-whk { z-index: 0; top: 28px; bottom: 26px; }
.co-whz { position: absolute; left: 0; top: 0; bottom: 0; background: var(--soft); transition: width var(--t3) var(--ease); }
.co-whkl { position: absolute; top: -6px; bottom: 0; width: 0; margin-left: -.75px; border-left: 1.5px dashed var(--ink); transform-origin: 50% 0; transition: left var(--t3) var(--ease); }
.co-whkt { position: absolute; top: -28px; transform: translateX(-50%); padding: 3px 6px; background: var(--white); border: 1px solid var(--ink); font: 10.5px/1 var(--mono); letter-spacing: .02em; white-space: nowrap; transition: left var(--t3) var(--ease); }
.co-whax { bottom: 4px; height: 14px; font: 10.5px/1 var(--mono); color: var(--muted); }
.co-whax span { position: absolute; transform: translateX(-50%); }
.co-cur svg { display: block; width: 100%; height: auto; overflow: visible; }
.co-cur .gl { stroke: var(--line); stroke-width: 1; }
.co-cur .ax { font: 10.5px var(--mono); letter-spacing: .05em; fill: var(--muted); }
.co-cur .ax.ink { fill: var(--ink); font-family: var(--font); font-weight: 500; letter-spacing: .08em; }
.co-cur .ln { fill: none; stroke-width: 1.75; stroke-linejoin: round; stroke-dasharray: 1; }
.co-cur .ln.b0 { stroke-width: 1.5; stroke-dasharray: 4 4; }
.co-er { transition: transform var(--t1) var(--ease); }
.co-er line { stroke: var(--ink); stroke-width: 1.5; }
.co-er .chip { fill: var(--white); stroke: var(--ink); stroke-width: 1; }
.co-er .chipt { font: 10.5px var(--mono); letter-spacing: .05em; fill: var(--ink); }
.co-cur .dot { stroke: var(--white); stroke-width: 1.5; transition: transform var(--t1) var(--ease); }
.co-cur .dot[data-b="0"] { stroke: var(--dash); }
.co-wh.co-snap *, .co-cur.co-snap * { transition: none; }
.co-dpkey { margin-top: 8px; }
.key i.co-kt { width: 2px; height: 12px; vertical-align: -2px; background: var(--ink); }
.key i.co-kr { width: 14px; height: 8px; vertical-align: 0; background: var(--g2); }
.key i.co-kk { width: 0; height: 12px; vertical-align: -2px; border-left: 1.5px dashed var(--ink); }
.co-dpr { margin-top: 24px; }

/* ---------- Responsive: the module's own width decides (the side tabs take 336px on small screens) ---------- */
@container co (max-width: 760px) {
  .co-box > .co-cbar { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .co-dbox > .ctl > .switch { grid-column: auto; }
  .co-road li { grid-template-columns: minmax(0, 1fr) auto; }
  .co-road li > span:not(.tag) { grid-column: 1; }
  .co-road .tag { grid-column: 2; grid-row: 1; }
}
@container co (max-width: 460px) {
  .co-foot { padding: 16px; }
}
@container co (max-width: 640px) {
  .co-ssr { grid-template-columns: minmax(0, 1fr) auto; }
  .co-ssq { grid-column: 1 / -1; grid-row: 2; }
  .co-ssb { --q: 18px; }
  .co-ssq { gap: 10px 12px; }
}
@container co-dp (max-width: 420px) {
  .co-wh { --lc: 28px; --rc: 30px; --gp: 8px; }
  .co-whr { height: 28px; }
}
/* Figure internals follow the figure's own width */
@container co-fig (max-width: 640px) {
  .co-split { grid-template-columns: 1fr; }
  .co-pg-g ul { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
  .co-wire { height: 56px; }
  .co-wire::before { left: 50%; right: auto; top: 4px; bottom: 8px; border-top: 0; border-left: 1.5px solid var(--ink); }
  .co-wire::after { left: calc(50% - 3px); right: auto; top: auto; bottom: 2px; border: 3.75px solid transparent; border-top: 6px solid var(--ink); border-bottom: 0; }
  .co-wire .co-wl { left: calc(50% + 16px); right: auto; top: 50%; transform: translateY(-50%); }
  .co-pkt { left: calc(50% - 4.25px); top: 4px; }
}
@container co-fig (max-width: 460px) {
  .co-pg-g ul { grid-template-columns: 1fr; }
  .co-kv > div { grid-template-columns: 1fr; gap: 2px; }
  .co-bytes i { width: 7px; height: 7px; }
}
@container co (max-width: 780px) {
  .co-sbox { grid-template-columns: minmax(0, 1fr); }
  .co-sbox > .co-sctl { display: contents; }
  .co-sbox .co-nav, .co-sbox .co-par { padding: 24px; background: var(--soft); }
  .co-sbox .co-nav { order: -1; border-bottom: 1px solid var(--line); }
  .co-sbox .co-par { border-top: 1px solid var(--line); }
  .co-sbox > .co-foot { order: 2; }
  .co-take { min-height: 0; }
}
@media (max-width: 760px) {
  .co-sbox .co-nav, .co-sbox .co-par { padding: 16px; gap: 16px; }
  .opts.co-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .co-steps .opt { justify-content: center; padding: 9px 4px; }
  .co-steps .opt span { display: none; }
  .co-steps .opt b { margin: 0; color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  .co-pkt, .co-lens { display: none; }
}
