/* ============================================================
   AA — week 7 animation extras (anim-w7.js). Theme tokens only.
   ============================================================ */
.anim .w7-small { font-size: .82rem; color: var(--muted); margin: .5rem 0 .7rem; }
.anim .w7-small code, .anim .w7-fb code { font-size: .78em; }
.anim .w7-gap { margin-top: .8rem; }
.anim .w7-good { color: var(--green); font-weight: 500; }
.anim .w7-bad { color: var(--red); font-weight: 500; }
.anim .w7-code { max-height: none; }
.anim button.w7-tog[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.anim button.w7-right { border-color: var(--green); color: var(--green); background: var(--green-soft); opacity: 1; }
.anim button.w7-wrong { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.anim .w7-fb { font-size: .85rem; margin: .4rem 0 0; }
.anim .w7-fb:empty { display: none; }
.anim .w7-seg1, .anim .w7-seg2 { display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; max-width: 100%; }
.anim .w7-seg1 .seg, .anim .w7-seg2 .seg { flex-wrap: wrap; }

/* two code blocks side by side */
.w7-codes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }

/* Task 2 */
.anim .w7-formula { font-family: var(--font-mono); font-size: 1.05rem; color: var(--accent); margin: 0 0 .7rem; }
.w7-share { display: flex; height: 34px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--bg-soft); }
.w7-part { height: 100%; display: grid; place-items: center; min-width: 0; transition: width .35s ease; overflow: hidden; }
.w7-part span { font-family: var(--font-mono); font-size: .68rem; font-weight: 700; color: var(--bg); white-space: nowrap; padding: 0 .3rem; }
.w7-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .45rem; vertical-align: -1px; }
.w7-quiz { margin-top: .9rem; padding: .7rem .8rem; border: 1px dashed var(--border-strong); border-radius: 10px; }
.w7-quiz > p:first-child { margin: 0 0 .5rem; font-size: .88rem; }
.w7-quiz .anim-opts { margin-bottom: 0; }

/* Task 4 tallies */
.w7-tally { display: grid; grid-template-columns: 11.5rem 1fr 2.2rem; gap: .5rem; align-items: center; margin-top: .3rem; }
.w7-tally .lab { font-family: var(--font-mono); font-size: .66rem; color: var(--muted); }
.w7-tally b { font-family: var(--font-mono); font-size: .8rem; color: var(--heading); text-align: right; }
.w7-track { display: block; height: 14px; border-radius: 4px; background: var(--bg-soft); border: 1px solid var(--border); overflow: hidden; }
.w7-track i { display: block; height: 100%; width: 0; transition: width .25s ease; }

/* Task 5 grid */
.w7-gridwrap { display: flex; flex-direction: column; align-items: center; }
.w7-axis { font-family: var(--font-mono); font-size: .62rem; color: var(--muted); margin-bottom: .2rem; }
.w7-grid { display: grid; gap: 3px; width: 100%; }
.w7-rl { font-family: var(--font-mono); font-size: .52rem; color: var(--muted); align-self: center; white-space: nowrap; }
.w7-cell { display: block; aspect-ratio: 1; border-radius: 3px; border: 1px solid var(--border); background: var(--surface-2); transition: background .2s, border-color .2s, transform .2s; }
.w7-cell.never { background: repeating-linear-gradient(45deg, var(--surface) 0 3px, transparent 3px 6px); border-style: dashed; opacity: .6; }
.w7-cell.row { border-color: var(--blue); }
.w7-cell.on { background: var(--accent); border-color: var(--accent); }
.w7-cell.cur { background: var(--blue); border-color: var(--blue); transform: scale(1.12); }

/* Task 6 lanes */
.w7-lane { margin-top: .8rem; }
.w7-lane-h { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); margin-bottom: .3rem; }
.w7-lane-h .who { color: var(--heading); }
.w7-bar { height: 20px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border); overflow: hidden; }
.w7-bar i { display: block; height: 100%; transition: width .3s ease; }
.w7-lane.add .w7-bar i { background: var(--blue); }
.w7-lane.half .w7-bar i { background: linear-gradient(90deg, var(--blue), var(--accent)); }
.w7-ticks { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; margin-top: .45rem; }
.w7-ticks i { display: block; height: 14px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); transition: background .2s; }
.w7-ticks i.on { background: var(--accent); border-color: var(--accent); }
.w7-ticks i.off { visibility: hidden; }
.w7-chain { font-family: var(--font-mono); font-size: .68rem; line-height: 1.8; margin-top: .4rem; color: var(--muted); min-height: 1.8em; word-break: break-word; }
.w7-chain b { color: var(--heading); font-weight: 400; }
.anim pre.w7-con { min-height: 4rem; max-height: none; overflow-x: auto; white-space: pre; }
.w7-dbl { margin-top: .9rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.w7-dbl .anim-opts { margin: .35rem 0 0; }
.w7-dout { font-family: var(--font-mono); font-size: .75rem; color: var(--text); }
.w7-dout b { color: var(--accent); }

@media (max-width: 640px) {
  .w7-codes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .anim .w7-seg2, .anim .w7-seg1 { display: block; width: 100%; }
  .anim .w7-seg2 .lab, .anim .w7-seg1 .lab { display: block; margin-bottom: .25rem; }
  .anim .w7-seg2 .seg { display: grid; grid-template-columns: 1fr 1fr; }
  .anim .w7-seg1 .seg { display: grid; grid-template-columns: 1fr; }
  .anim .w7-seg2 .seg button, .anim .w7-seg1 .seg button { border: 0; box-shadow: inset 0 0 0 .5px var(--border-strong); }
  .w7-tally { grid-template-columns: 7.5rem 1fr 2rem; }
  .w7-ticks { grid-template-columns: repeat(15, 1fr); }
  .w7-rl { font-size: .45rem; }
}
@media (max-width: 560px) {
  .w7-host .anim-table th, .w7-host .anim-table td { padding: .3rem .22rem; font-size: .62rem; }
  .w7-host pre.ct-out { font-size: .64rem; }
}
/* the site-wide "table { min-width: 460px }" would force sideways scrolling on phones */
.w7-host .anim-table { min-width: 0; }
@media (max-width: 560px) {
  .w7-host .ct-code { font-size: .68rem; }
}
@media (max-width: 560px) {
  .w7-host .anim-table td:first-child { white-space: nowrap; }
}
