/* Low-bit weight projections: loaded only on its Learn page, after style.css. */
.qp-fmts { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.chip.qp-fmt { font-size: 12px; color: var(--quiet); transition: color .3s, border-color .3s, box-shadow .3s; }
.chip.qp-fmt.on { color: var(--fg); border-color: var(--red); box-shadow: 0 0 0 3px var(--glow-red); }

/* The plot: a gutter for the axis names, then 64 columns. Rows: scale chips, weights, x, bytes. */
.qp-plot { position: relative; height: 214px; }
.qp-axis { position: absolute; left: 0; width: 34px; font: 11px var(--mono); color: var(--quiet); }
.qp-axis.w { top: 74px; }
.qp-axis.x { top: 156px; }
.qp-axis.b { top: 194px; }
.qp-cols { position: absolute; top: 0; bottom: 0; left: 40px; right: 0; }
.qp-chiprow { position: absolute; top: 0; left: 0; right: 0; height: 20px; opacity: 0; transition: opacity .4s; }
.qp-chiprow.in { opacity: 1; }
.qp-scale { position: absolute; top: 0; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 11px/20px var(--mono); color: var(--soft); text-align: center; box-sizing: border-box; }
.qp-frames { position: absolute; top: 22px; bottom: 30px; left: 0; right: 0; opacity: 0; transition: opacity .4s; }
.qp-frames.in { opacity: 1; }
.qp-frame { position: absolute; top: 0; bottom: 0; border: 1px dashed var(--border-strong); border-radius: 7px; box-sizing: border-box; }
.qp-warea { position: absolute; top: 28px; height: 112px; left: 0; right: 0; }
.qp-xarea { position: absolute; top: 146px; height: 32px; left: 0; right: 0; opacity: 0; transition: opacity .5s; }
.qp-xarea.in { opacity: 1; }
.qp-barea { position: absolute; top: 190px; height: 22px; left: 0; right: 0; }
.qp-zero { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.qp-bar, .qp-xbar { position: absolute; width: calc(100% / 64 - 2px); margin-left: 1px; border-radius: 1.5px; background: var(--soft); transition: top .6s cubic-bezier(.3, .7, .2, 1), height .6s cubic-bezier(.3, .7, .2, 1), background .4s; }
.qp-bar.max { background: var(--red); }
.qp-warea.snapped .qp-bar { background: var(--purple); }
.qp-orig { position: absolute; width: calc(100% / 64); height: 2px; margin-top: -1px; background: var(--fg); opacity: 0; transition: opacity .4s; }
.qp-warea.snapped .qp-orig { opacity: .7; }
.qp-xbar { background: var(--quiet); }
.qp-xarea.coded .qp-xbar { background: var(--purple); }
.qp-grid { position: absolute; top: 0; bottom: 0; opacity: 0; transition: opacity .5s; pointer-events: none; }
.qp-grid.in { opacity: 1; }
.qp-line { position: absolute; left: 3px; right: 3px; height: 1px; background: var(--border-strong); }
.qp-sweep { position: absolute; top: 24px; height: 158px; left: 0; width: calc(100% / 64); border-radius: 3px; background: var(--glow); box-shadow: inset 0 0 0 1px var(--purple); opacity: 0; transition-property: left; transition-timing-function: linear; pointer-events: none; }
.qp-sweep.go { opacity: 1; }
.qp-bytes { display: flex; height: 100%; border-radius: 5px; overflow: hidden; }
.qp-byte { flex: 1 1 0; min-width: 0; display: grid; place-items: center; overflow: hidden; border-right: 1px solid var(--bg); background: var(--surface-2); font: 10px var(--mono); color: transparent; transition: background .4s, color .4s; }
.qp-byte.fill { background: var(--surface-2); color: var(--soft); }
.qp-bytes:not(.dense) .qp-byte { border-right: 1px solid var(--border-strong); background: var(--surface); }
.qp-bytes:not(.dense) .qp-byte.fill { box-shadow: inset 0 -2px 0 var(--purple); }
.qp-bytes.dense .qp-byte { font-size: 8.5px; letter-spacing: -.02em; }
.qp-bytes.dense .qp-byte.fill { box-shadow: inset 0 -2px 0 var(--purple); }

.qp-note { margin: 0; min-height: 1.5em; font: 12.5px/1.5 var(--mono); color: var(--soft); }
.qp-prods { position: relative; height: 38px; margin-left: 40px; }
.qp-prod { position: absolute; top: 0; display: grid; justify-items: center; gap: 2px; padding: 0 4px; box-sizing: border-box; font: 12px var(--mono); color: var(--soft); white-space: nowrap; }
.qp-sum, .qp-res { opacity: 0; transform: translateY(-4px); transition: opacity .4s, transform .4s; }
.qp-prod.sum .qp-sum, .qp-prod.res .qp-res { opacity: 1; transform: none; }
.qp-res b { color: var(--red); font-weight: 600; }

@media (max-width: 600px) {
  .qp-plot { height: 196px; }
  .qp-axis { width: 30px; font-size: 9.5px; }
  .qp-axis.w { top: 64px; }
  .qp-axis.x { top: 140px; }
  .qp-axis.b { top: 178px; }
  .qp-cols { left: 32px; }
  .qp-warea { height: 96px; }
  .qp-xarea { top: 130px; }
  .qp-barea { top: 176px; height: 18px; }
  .qp-frames { bottom: 26px; }
  .qp-sweep { height: 140px; }
  .qp-bar, .qp-xbar { width: calc(100% / 64 - 1px); margin-left: .5px; }
  .qp-scale { padding: 0 2px; font-size: 10px; }
  .qp-bytes .qp-byte, .qp-bytes.dense .qp-byte { font-size: 0; }
  .qp-note { min-height: 3em; font-size: 11.5px; }
  .qp-prods { margin-left: 32px; height: 34px; }
  .qp-prod.narrow .qp-what { display: none; }
  .qp-prod { font-size: 10.5px; }
  .qp-prod.narrow .qp-mul { display: none; }
  .chip.qp-fmt { padding: 2px 7px; font-size: 11px; }
  .qp-meter { min-height: 44px; align-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .qp-bar, .qp-xbar, .qp-sweep { transition: none; }
}
