/* SCVA visualization and intervention: each equation stays with its purpose. */
.aw-scva { margin: 0 0 24px; padding: 20px; border: 1px solid #dfe5ea; border-radius: 16px; background: #fff; color: #263445; }
.aw-scva-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.aw-scva-case { min-width: 0; }
.aw-scva-case h3 { margin: 0 0 12px; text-align: center; font-size: 18px; font-weight: 500; line-height: 1.4; }
.aw-scva-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: center; }
.aw-scva-label { font-size: 14px; font-weight: 500; line-height: 1.4; text-align: center; }
.aw-scva-map-label { grid-column: 2 / 5; }
.aw-scva-grid img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 3px; }
.aw-scva-case p { margin: 12px auto 0; max-width: 470px; text-align: center; font-size: 15px; line-height: 1.5; color: #6b7685; }
.aw-scva-legend { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 13px; line-height: 20px; color: #6b7685; }
.aw-scva-legend > span:first-child { margin-right: 6px; color: #263445; font-weight: 500; }
.aw-scva-scale { width: 112px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, #000080, #0000ff, #00ffff, #ffff00, #ff0000, #800000); }
.aw-method-equation { min-width: 0; }
.aw-scva-formula { margin: 20px 0; text-align: center; font-size: 20px; color: #263445; }
.aw-scva-formula .katex-display { margin: 0; padding: 3px 0; }
@media (max-width: 900px) {
  .aw-scva-comparison { grid-template-columns: 1fr; gap: 24px; }
  .aw-scva-case + .aw-scva-case { border-top: 1px solid #e5e9ed; padding-top: 20px; }
}
@media (max-width: 600px) {
  .aw-scva { padding: 14px; border-radius: 12px; }
  .aw-scva-grid { gap: 5px; }
  .aw-scva-label { font-size: 12px; }
  .aw-scva-formula { font-size: 19px; }
  .aw-scva-formula .katex-display { font-size: 1em; }
}

/* One shared canvas; the three controls follow the same animation timeline. */
.aw-method-container { max-width: 1240px !important; margin-top: 24px; }
.awcr { margin: 0; padding: 20px; border: 1px solid #dfe5ea; border-radius: 16px; background: #fff; box-shadow: 0 4px 20px #26344504; color: #263445; }
.awcr-toolbar { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid #e5e9ed; }
.awcr-control { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 32px; padding: 5px; background: transparent; color: #5c7b68; border: 0; border-radius: 5px; cursor: pointer; transition: color .15s, background .15s; }
.awcr-control:hover { color: #345840; background: #f0f5f1; }
.awcr-control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.awcr-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1; min-width: 0; }
.awcr-stage { --stage-progress: 100%; position: relative; display: grid; place-items: center; min-width: 0; height: 38px; padding: 0 20px; border: 0; background: transparent; color: #758079; cursor: pointer; }
.awcr-stage + .awcr-stage { margin-left: -12px; }
.awcr-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.awcr-stage-outline { fill: #fbfcfb; stroke: #cbd5ce; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.awcr-stage-fill { fill: #edf3ee; stroke: #b7c9bd; stroke-width: 1.2; vector-effect: non-scaling-stroke; clip-path: inset(0 calc(100% - var(--stage-progress)) 0 0); }
.awcr-stage span { position: relative; font-size: 12px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; }
.awcr-stage[aria-current="step"] { color: #365e43; }
.awcr-stage[aria-current="step"] .awcr-stage-outline, .awcr-stage:hover .awcr-stage-outline { stroke: #91ab9a; }
.awcr-control:focus-visible, .awcr-stage:focus-visible { outline: 2px solid #6d8e77; outline-offset: 3px; }
.awcr-viewport { width: 100%; max-width: 1184px; height: 212px; margin: 18px auto 0; overflow: hidden; }
.awcr-row { position: relative; display: grid; grid-template-columns: 292px 420px 288px; gap: 12px; width: 1024px; padding-bottom: 4px; transform: scale(var(--diagram-scale, 1)); transform-origin: top left; }
.awcr-motion-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.awcr-motion-trails { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.awcr-particle { position: absolute; left: 0; top: 0; display: block; opacity: 0; border-radius: 2px; box-shadow: 0 0 0 1.5px #fff, 0 0 8px var(--particle-color); }
.awcr-particle.is-round { border-radius: 50%; }
.awcr-panel { min-width: 0; }
.awcr-caption { height: 20px; margin: 8px 0 0; font-size: 13px; line-height: 20px; text-align: center; white-space: nowrap; color: #6b7685; }
.awcr-math { display: inline-block; white-space: nowrap; line-height: 1.3; }
.awcr .katex { font-size: 1em; }
.awcr-subhead { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; text-align: center; white-space: nowrap; }
.awcr-input-grid, .awcr-anchor-grid, .awcr-update-grid { display: grid; height: 180px; padding: 4px 0; min-width: 0; }
.awcr-input-grid { grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1fr) 82px; grid-template-rows: 22px minmax(0, 1fr) minmax(0, 1fr); gap: 5px 6px; align-items: center; }
.awcr-set-label { justify-self: center; font-size: 15px; }
.awcr-input-label { justify-self: center; font-size: 15px; }
.awcr-photo { position: relative; width: 100%; max-width: 88px; aspect-ratio: 4 / 3; justify-self: center; border-radius: 3px; overflow: hidden; background: #f1f4f8; }
.awcr-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.awcr-mask-image { position: absolute; inset: 0; }
.awcr-scan { position: absolute; inset: 0 0 auto; height: 2px; opacity: 0; background: #d9fff2; box-shadow: 0 0 8px 2px #6be3c5; pointer-events: none; }
.awcr-elements { grid-column: 4; grid-row: 2 / 4; display: flex; justify-content: center; align-items: center; gap: 6px; height: 100%; }
.awcr-legend { display: grid; gap: 9px; }
.awcr-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 17px; }
.awcr-legend-item i { width: 11px; height: 11px; flex-shrink: 0; border-radius: 2px; }
.awcr-brace { display: block; width: 9px; height: 100%; overflow: visible; }
.awcr-brace path, .awcr-arrow path { fill: none; stroke: #8190a3; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.awcr-element-brace { height: 76px; transform: rotate(180deg); }
.awcr-arrow { display: block; width: 100%; height: 16px; overflow: visible; }
.awcr-pair { display: grid; grid-template-rows: 1fr 1fr; align-items: center; justify-items: center; gap: 10px; height: 100%; min-width: 0; }
.awcr-anchor { --token-size: 8px; }
.awcr-anchor-grid { grid-template-columns: 14px 14px 26px 14px 12px 14px minmax(0, 1fr) 8px 18px 78px; grid-template-rows: 22px minmax(0, 1fr); gap: 6px 3px; align-items: center; }
.awcr-token-heading { grid-column: 4 / 7; grid-row: 1; text-align: center; font-size: 16px; }
.awcr-attention-heading { grid-column: 7; grid-row: 1; }
.awcr-source-views { grid-column: 1; grid-row: 2; font-size: 15px; }
.awcr-enter-arrows { grid-column: 2; grid-row: 2; }
.awcr-backbone { position: relative; grid-column: 3; grid-row: 2; display: flex; align-items: center; justify-content: center; height: 128px; overflow: hidden; border: 1px solid #e2c47d; border-radius: 4px; background: #fff8e5; color: #796023; }
.awcr-backbone > span { position: relative; z-index: 1; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; font-weight: 500; }
.awcr-encoder-light { position: absolute; inset: 0; opacity: 0; background: linear-gradient(180deg, transparent, #f5d174, transparent); }
.awcr-exit-arrows { grid-column: 4; grid-row: 2; }
.awcr-semantic-tokens { grid-column: 5; grid-row: 2; display: grid; grid-template-rows: 1fr 1fr; gap: 10px; height: 100%; }
.awcr-semantic-strip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.awcr-semantic-strip i { display: block; width: var(--token-size); height: var(--token-size); border-radius: 1px; background: var(--mark-color); }
.awcr-semantic-strip.is-round i { border-radius: 50%; }
/* Equal visual tokens; the original LaTeX and accessible MathML stay intact. */
.awcr-token-glyph { display: inline-block; width: var(--token-size); height: var(--token-size); vertical-align: calc(.25em - var(--token-size) / 2); overflow: hidden; text-indent: 100%; background: currentColor; border-radius: 1px; }
.awcr-token-glyph.is-round { border-radius: 50%; }
.awcr-score-arrows { grid-column: 6; grid-row: 2; }
.awcr-scores { grid-column: 7; grid-row: 2; display: grid; grid-template-rows: repeat(3, 1fr); align-items: center; justify-self: center; width: max-content; height: 100%; min-width: 0; }
.awcr-score { display: flex; justify-content: flex-start; align-items: center; justify-self: start; width: max-content; height: 36px; padding: 3px 8px; border: 1px solid transparent; border-radius: 4px; font-size: 14px; }
.awcr-score.is-anchor { background: #fff7dd; border-color: #e8cf8b; }
.awcr-score-brace { grid-column: 8; grid-row: 2; height: 126px; }
.awcr-max { position: relative; grid-column: 9; grid-row: 2; height: 16px; }
.awcr-max > .awcr-math { position: absolute; left: 50%; bottom: 15px; transform: translateX(-50%); font-size: 11px; }
.awcr-anchor-value { grid-column: 10; grid-row: 2; display: flex; justify-content: center; align-items: center; font-size: 14px; }
.awcr-update-grid { grid-template-columns: 38px 18px max-content 18px 38px; grid-template-rows: 22px minmax(0, 1fr); gap: 6px; align-items: center; justify-content: center; }
.awcr-before-heading { grid-column: 1; grid-row: 1; text-align: center; font-size: 16px; }
.awcr-gradient-heading { grid-column: 3; grid-row: 1; }
.awcr-after-heading { grid-column: 5; grid-row: 1; text-align: center; font-size: 16px; }
.awcr-bank { grid-row: 2; height: 100%; }
.awcr-bank.is-input { grid-column: 1; }
.awcr-bank.is-updated { grid-column: 5; }
.awcr-vector-row { display: flex; align-items: center; justify-content: center; gap: 4px; }
.awcr-vector { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; gap: 3px; padding: 4px 3px; border: 1px solid #b6c2d0; border-radius: 3px; }
.awcr-vector i { display: block; width: 9px; height: 9px; background: #aeb9c8; border-radius: 1px; }
.awcr-vector.is-round i { border-radius: 50%; }
.awcr-bank.is-updated .awcr-vector { border-color: #dfbd69; background: #fffcf4; }
.awcr-bank.is-updated i { background: #efb72e; }
.awcr-update-in-arrows { grid-column: 2; grid-row: 2; }
.awcr-update-out-arrows { grid-column: 4; grid-row: 2; }
.awcr-gradients { grid-column: 3; grid-row: 2; display: grid; grid-template-rows: 1fr 1fr; gap: 10px; height: 100%; }
.awcr-gradient-row { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.awcr-vector.is-latent { padding: 4px 0; border-color: transparent; }
.awcr-gradient-formula { position: relative; z-index: 4; font-size: 14px; }
@media (max-width: 600px) {
  .awcr { padding: 14px; border-radius: 12px; }
  .awcr-toolbar { gap: 6px; padding-bottom: 12px; }
  .awcr-control { flex-basis: 22px; width: 22px; padding: 3px; }
  .awcr-stage { height: 34px; padding: 0 10px; }
  .awcr-stage span { font-size: 10px; letter-spacing: .5px; }
  .awcr-stage + .awcr-stage { margin-left: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  .awcr-control { visibility: hidden; transition: none; }
}
