/* Hidden-state drafters: loaded only on its Learn page, after style.css. Columns are positions; the bands (the
   target's layers, the tokens, the drafter) share one column layout, set by --hsd-n (columns) and --hsd-g (gutter). */
.hsd-target { display: grid; gap: 8px; }
.hsd-target .label, .hsd-dwrap .label { margin-bottom: 0; }
.hsd-dwrap { display: grid; gap: 8px; }
.hsd-band { position: relative; --hsd-g: 30px; --hsd-cell: 10px; --hsd-gap: 3px; }
.hsd-grid { height: calc(10 * var(--hsd-cell) + 9 * var(--hsd-gap)); }
.hsd-toks, .hsd-drafter { height: 28px; }
.hsd-col, .hsd-slot { position: absolute; top: 0; bottom: 0; width: calc((100% - var(--hsd-g)) / var(--hsd-n)); transition: left .7s cubic-bezier(.3, .7, .2, 1), opacity .5s; }
.hsd-col { display: flex; flex-direction: column-reverse; align-items: center; gap: var(--hsd-gap); }
.hsd-slot { display: flex; align-items: center; justify-content: center; }
.hsd-out { opacity: 0; }
.hsd-new { animation: hsd-fade .6s ease-out both; }
@keyframes hsd-fade { from { opacity: 0; } }

/* The target's layers: one cell per layer and position, layer 1 at the bottom. */
.hsd-cell { flex: none; width: min(64%, 46px); height: var(--hsd-cell); border: 1px solid var(--border); border-radius: 3px; background: var(--surface-2); transition: background .35s, border-color .35s, box-shadow .3s; }
.hsd-cell.run { background: var(--border-strong); border-color: var(--border-strong); }
.hsd-cell.tap { border-color: var(--border-strong); }
.hsd-cell.tap.run { background: var(--purple); border-color: var(--purple); }
.hsd-lab { position: absolute; left: 0; height: var(--hsd-cell); line-height: var(--hsd-cell); font: 600 10px var(--mono); color: var(--purple); }

/* Tokens at each position. */
.hsd-tok { width: calc(100% - 6px); max-width: 78px; min-width: 0; padding: 3px 2px; overflow: hidden; text-overflow: ellipsis; transition: background .35s, border-color .35s, color .35s, box-shadow .3s; }
.hsd-tok.empty { border-style: dashed; border-color: var(--border); background: none; color: transparent; }
.hsd-tok.ctx { color: var(--quiet); }
.hsd-tok.pend { border-color: var(--soft); color: var(--fg); }
.hsd-tok.draft { border-style: dashed; border-color: var(--purple); color: var(--purple); }
.hsd-tok.ok { border-color: var(--red); background: var(--red); color: var(--bg); }
.hsd-tok.fix { border-color: var(--red); color: var(--red); font-weight: 700; }
.hsd-tok.miss { border-style: dashed; color: var(--quiet); text-decoration: line-through; }
.hsd-tok.mask { border-style: dashed; color: var(--quiet); font-style: italic; }

/* The drafter: what it holds at each position (the target's taps, or its own hidden state), or one block pass. */
.hsd-dc { display: grid; place-items: center; width: calc(100% - 6px); max-width: 78px; height: 26px; border: 1px dashed var(--border); border-radius: 7px; font: 11.5px var(--mono); color: var(--quiet); transition: background .35s, border-color .35s, color .35s, box-shadow .3s, opacity .4s; }
.hsd-dc.taps { border-style: solid; border-color: var(--purple); background: var(--purple); color: var(--bg); }
.hsd-dc.own { border-color: var(--purple); background: var(--glow); color: var(--purple); }
.hsd-dc.junk { border-color: var(--border-strong); }
.hsd-drafter.block .hsd-dc { opacity: 0; }
.hsd-block { position: absolute; top: 0; bottom: 0; width: calc(4 * (100% - var(--hsd-g)) / var(--hsd-n) - 6px); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--purple); border-radius: 7px; font: 11.5px var(--mono); color: var(--fg); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .5s, background .4s; }
.hsd-drafter.block .hsd-block { opacity: 1; }
.hsd-block.on { background: var(--glow); }
.hsd-block.on::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--glow), transparent); animation: hsd-scan 1.1s ease-out 1; }
@keyframes hsd-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.hsd-hl { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--purple); }
.hsd-pop { animation: hsd-pop .45s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes hsd-pop { from { opacity: 0; transform: translateY(-6px); } }

@media (max-width: 600px) {
  .hsd-band { --hsd-g: 22px; --hsd-cell: 9px; }
  .hsd-lab { font-size: 9px; }
  .hsd-tok { padding: 3px 1px; font-size: 11.5px; }
  .hsd-dc, .hsd-block { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .hsd-new, .hsd-pop, .hsd-block.on::after { animation: none; }
}
