/* ============================================================
   AA — week 6 animation extras (anim-w6.js). Theme tokens only.
   ============================================================ */
.anim .w6-small { font-size: .82rem; color: var(--muted); margin: 0 0 .7rem; }
.anim .w6-small code { font-size: .78em; }
.anim .w6-gap { margin-top: .8rem; }
.anim .w6-good { color: var(--green); font-weight: 500; }
.anim .w6-bad { color: var(--red); font-weight: 500; }
.anim .w6-code { max-height: none; margin-bottom: .2rem; }

/* Task 1 cards */
.w6-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.w6-card { border: 1px solid var(--border); border-radius: 10px; padding: .55rem .6rem .6rem; background: var(--surface); transition: border-color .2s, box-shadow .2s; min-width: 0; }
.w6-card.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.w6-card-h { font-family: var(--font-display); font-size: 1.35rem; color: var(--heading); line-height: 1; }
.anim .vbars.w6-mini { height: 54px; gap: 5px; margin: .35rem 0 .45rem; border-bottom: 1px solid var(--border-strong); }
.anim .vbars.w6-mini .vb { transition: opacity .3s ease, background .2s; }
.w6-rows { display: flex; flex-direction: column; gap: 2px; }
.w6-row { display: grid; grid-template-columns: 1.7rem 1fr; gap: .3rem; align-items: center; font-family: var(--font-mono); font-size: .68rem; padding: .08rem .2rem; border-radius: 4px; min-height: 1.3rem; }
.w6-row.on { background: var(--blue-soft); }
.w6-row > span:nth-child(2) { color: var(--heading); overflow-wrap: anywhere; }
.w6-between { height: 1.05rem; text-align: right; font-family: var(--font-mono); font-size: .66rem; line-height: 1.05rem; padding-right: .2rem; border-radius: 4px; }
.w6-between::before { content: ""; }
.w6-between.on { background: var(--accent-soft); }
.w6-chip { color: var(--accent); font-weight: 700; white-space: nowrap; }
.w6-verdict { display: grid; grid-template-columns: 1fr; gap: .25rem; margin-top: .5rem; }
.anim .w6-verdict button { padding: .3rem .25rem; font-size: .64rem; min-height: 28px; }
.anim button.w6-right { border-color: var(--green); color: var(--green); background: var(--green-soft); opacity: 1; }
.anim button.w6-wrong { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.anim .w6-fb { font-size: .76rem; margin: .45rem 0 0; min-height: 1em; }
.anim .w6-fb:empty { display: none; }

/* Task 2: code on top, variables and output side by side */
.w6-wide .ct { grid-template-columns: minmax(0, 1fr); }
.w6-wide .ct-side { display: grid; grid-auto-flow: column; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: .8rem; row-gap: .35rem; }
.w6-wide .ct-code { max-height: none; }
@media (max-width: 560px) {
  .w6-wide .ct-side { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
}

/* toggles */
.anim button.w6-tog[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.anim button.w6-tog[aria-pressed="false"] { text-decoration: line-through; opacity: .75; }
.anim .w6-badge { margin-top: .5rem; }
.w6-quiz { margin-top: .8rem; padding: .7rem .8rem; border: 1px dashed var(--border-strong); border-radius: 10px; }
.w6-quiz > p:first-child { margin: 0 0 .5rem; font-size: .88rem; }
.w6-quiz .anim-opts { margin-bottom: .45rem; }
.anim .w6-quiz .anim-opts .lab { flex-basis: 100%; }

/* Task 5 / 6 two-column layout */
.w6-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: .8rem; align-items: start; }
.anim pre.w6-con { max-height: none; min-height: 6.5rem; font-size: .68rem; overflow-x: auto; white-space: pre; }
.anim .w6-two canvas.w6-plot { margin-top: .35rem; }
.w6-check { margin-top: .7rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.w6-check .ct-h { width: 100%; }

/* Task 6 lanes */
.w6-lane { min-width: 0; }
.w6-lane .ct-h { margin-bottom: .35rem; overflow-wrap: anywhere; }
.w6-two:has(.w6-lane) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.w6-sbars { display: flex; flex-direction: column; gap: 5px; margin-top: .6rem; }
.w6-sbar { display: grid; grid-template-columns: 5.2rem 1fr; gap: .4rem; align-items: center; transition: opacity .3s; }
.w6-sbar.off { opacity: .15; }
.w6-sbar .lab { font-family: var(--font-mono); font-size: .62rem; color: var(--muted); text-align: right; }
.w6-track { display: flex; height: 16px; border-radius: 4px; background: var(--bg-soft); border: 1px solid var(--border); overflow: hidden; }
.w6-track i, .w6-k { display: block; height: 100%; transition: width .3s ease; }
.w6-track i.work, .w6-k.work { background: var(--blue); }
.w6-track i.over, .w6-k.over { background: var(--border-strong); }
.w6-track i.noise, .w6-k.noise { background: var(--red); }
.anim .w6-lane .w6-small { margin: .5rem 0 0; }
.anim .w6-key { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; }
.anim .w6-key > span { white-space: nowrap; }
.w6-k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

@media (max-width: 760px) {
  .w6-two, .w6-two:has(.w6-lane) { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .w6-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w6-row { font-size: .64rem; grid-template-columns: 1.4rem 1fr; }
  .anim .w6-seg2 .seg { display: grid; grid-template-columns: 1fr 1fr; }
  .anim .w6-seg1 .seg { display: grid; grid-template-columns: 1fr; }
  .anim .w6-seg2 .seg button, .anim .w6-seg1 .seg button { border: 0; box-shadow: inset 0 0 0 .5px var(--border-strong); }
  .anim .w6-seg2, .anim .w6-seg1 { width: 100%; }
  .anim .w6-seg2 .lab, .anim .w6-seg1 .lab { display: block; margin-bottom: .25rem; }
}
@media (max-width: 560px) {
  .w6-wide .anim-table th:nth-child(2), .w6-wide .anim-table td:nth-child(2) { display: none; }
}
@media (max-width: 560px) {
  .w6-host .anim-table th, .w6-host .anim-table td { padding: .3rem .22rem; font-size: .62rem; }
  .w6-host pre.ct-out { font-size: .64rem; }
}
/* the site-wide "table { min-width: 460px }" would force sideways scrolling on phones */
.w6-host .anim-table { min-width: 0; }
@media (max-width: 560px) {
  .w6-host .ct-code { font-size: .68rem; }
}
@media (max-width: 560px) {
  .w6-host .anim-table td:first-child { white-space: normal; }
}
