/* Method · Read out: one latent token -> linear + pixel shuffle -> a 16 × 16 patch of real output pixels.
   Built by js/readout.js inside #readout-demo; the heights below are fixed so nothing shifts when it is built. */
.readout-demo {
  position: relative; margin-top: 14px; height: 240px; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 236px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.rd-stage { position: relative; min-width: 0; height: 100%; }
.rd-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the plate under the output values (positioned by the script); follows the page theme */
.rd-plate { position: absolute; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; }

.rd-lab { position: absolute; white-space: nowrap; pointer-events: none; }
.rd-grid-lab { transform: translateX(-50%); text-align: center; font: 12px/1.4 var(--font); color: var(--muted); }
.rd-grid-lab b { display: block; font-size: 13px; font-weight: 600; color: var(--fg); }
.rd-op { transform: translate(-50%, -100%); font: 500 13px/1.2 var(--font); color: var(--text); text-align: center; }
.rd-op2 { color: var(--text); white-space: normal; }
.rd-tag {
  transform: translateY(-50%); font: 600 10.5px/1 var(--font); letter-spacing: .04em; padding: 4px 7px; border-radius: 5px;
  background: var(--chip); color: var(--fg);
}
.rd-hand { transform: translate(-100%, -50%); font: 500 19px/1 var(--hand); color: var(--fg); }
.rd-compact .rd-hand { transform: translateX(-50%); color: var(--fg); }
.rd-compact .rd-grid-lab { transform: none; text-align: left; }
.rd-op, .rd-hand, .rd-fact > * { opacity: 0; }

.rd-fact {
  margin: 0; padding: 24px 24px 52px; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.rd-fact b { font: 800 46px/1 var(--font); letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.rd-fact span { font: 600 15.5px/1.35 var(--font); color: var(--fg); max-width: 14ch; text-wrap: balance; }

.rd-replay {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px;
  font: 600 12.5px/1 var(--font); color: var(--muted); background: var(--bg); border: 1px solid var(--line);
  padding: 6px 11px 6px 9px; border-radius: 999px; cursor: pointer; transition: color .15s, border-color .15s;
}
.rd-replay:hover { color: var(--fg); border-color: var(--muted); }
.rd-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.readout-demo:has(.rd-replay[hidden]) .rd-fact { padding-right: 20px; }
@media (max-width: 440px) {
  .rd-fact { padding-right: 60px; }
  .rd-replay { padding: 0; width: 32px; height: 32px; justify-content: center; }
  .rd-replay-txt { display: none; }
}

/* narrower: the fact goes under the strip */
@media (max-width: 899px) {
  .readout-demo { height: 316px; grid-template-columns: minmax(0, 1fr); grid-template-rows: 240px 76px; }
  .rd-fact { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 120px 0 20px; border-left: 0; border-top: 1px solid var(--line); }
  .rd-fact b { font-size: 36px; }
  .rd-fact span { max-width: none; font-size: 14.5px; }
  .rd-replay { bottom: 23px; }
}
@media (max-width: 599px) {
  .readout-demo { height: 290px; grid-template-rows: 214px 76px; }
  .rd-fact { padding: 0 104px 0 16px; }
  .rd-fact b { font-size: 32px; }
  .rd-fact span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .rd-replay { transition: none; } }
