/* After42 workflow figure (Figure 3): diagram, step details, and a step-by-step example. */
.aw { margin: 2.2rem 0 1.8rem; }
.aw-card { background: #ffffff; border: 1px solid var(--rule-soft); border-radius: 16px; padding: 14px 18px 16px; box-shadow: 0 1px 3px var(--shadow); }
.aw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 4px; }
.aw-title { font-family: var(--serif); font-size: 1.14rem; color: var(--ink); }
.aw-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-card); }
.aw-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 0; border-radius: 999px; background: none; color: var(--ink-soft); font: 500 0.76rem/1 var(--mono); letter-spacing: 0.02em; cursor: pointer; }
.aw-tab svg { width: 11px; height: 11px; }
.aw-tab[aria-selected="true"] { background: #fff; color: var(--green-deep); box-shadow: 0 1px 2px rgba(31, 60, 50, 0.14); }
.aw-tab:focus-visible, .aw-btn:focus-visible, .aw-seg:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- diagram ---------- */
.aw-diagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.aw-band { fill: rgba(63, 143, 116, 0.05); }
.aw-band.b1 { fill: rgba(46, 110, 102, 0.085); }
.aw-band.b2 { fill: rgba(218, 146, 152, 0.14); }
.aw-band-t { font: 500 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; fill: var(--ink-soft); }
.aw-band-t tspan.n { fill: var(--green-deep); font-weight: 600; }
.aw-round { font: 600 10px var(--mono); letter-spacing: 0.06em; fill: var(--green-deep); transition: opacity 0.3s; }
.aw-round-bg { fill: #fff; stroke: var(--green); stroke-width: 1; transition: opacity 0.3s; }
.aw-edge { fill: none; stroke: #a9bfb5; stroke-width: 1.5; transition: stroke 0.3s, stroke-width 0.3s; }
.aw-edge.loop { stroke: var(--green); stroke-dasharray: 4 4; }
.aw-edge.on { stroke: var(--green-deep); stroke-width: 2.2; stroke-dasharray: none; }
.aw-elabel { font: 10px var(--mono); fill: var(--ink-soft); letter-spacing: 0.03em; }
.aw-elabel.on { fill: var(--green-deep); font-weight: 600; }
.aw-node { cursor: pointer; outline: none; }
.aw-tile { fill: #fff; stroke: #b5cac0; stroke-width: 1.2; transition: fill 0.25s, stroke 0.25s; }
.aw-ico { fill: none; stroke: var(--green-deep); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.25s; }
.aw-label { font: 13px var(--text); fill: var(--ink); transition: fill 0.25s; }
.aw-halo { fill: none; stroke: var(--green); stroke-width: 1.4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.aw-node:hover .aw-tile, .aw-node:focus-visible .aw-tile { fill: #edf6f1; stroke: var(--green-deep); }
.aw-node:focus-visible .aw-halo { opacity: 0.8; }
.aw-node.done .aw-tile { fill: #eef6f2; stroke: var(--green); }
.aw-node.sel .aw-tile, .aw-node.on .aw-tile { fill: var(--green-deep); stroke: var(--green-deep); }
.aw-node.sel .aw-ico, .aw-node.on .aw-ico { stroke: #fff; }
.aw-node.sel .aw-label, .aw-node.on .aw-label { fill: var(--green-deep); font-weight: 600; }
.aw-node.on .aw-halo { animation: aw-halo 1.9s ease-out 3; }
.aw-dim .aw-node:not(.on):not(.done):not(.sel) { opacity: 0.55; }
.aw-node { transition: opacity 0.3s; }
.aw-idle { fill: var(--green); opacity: 0.6; }
.aw-token { fill: var(--green-deep); stroke: #fff; stroke-width: 2; }
@keyframes aw-halo { 0% { opacity: 0.75; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }

/* ---------- panel ---------- */
.aw-panel { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--rule-soft); }
.aw-panel.story { min-height: 21rem; }
.aw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: 16px 26px; align-items: start; }
.aw-kicker { font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-deep); }
.aw-h { margin: 0.25rem 0 0.5rem; font-family: var(--serif); font-size: 1.36rem; font-weight: 500; line-height: 1.2; color: var(--ink); }
.aw-p { margin: 0 0 0.75rem; font-size: 0.96rem; line-height: 1.58; color: var(--ink); }
.aw-p a { color: var(--green-deep); }
.aw-quote { margin: 0 0 0.75rem; padding: 0.5rem 0.8rem; border-left: 2px solid var(--blossom); background: var(--blossom-soft); border-radius: 0 8px 8px 0; font-size: 0.92rem; line-height: 1.5; font-style: italic; color: var(--ink); }
.aw-quote.goal { border-left-color: var(--green); background: var(--bg-card); font-style: normal; font-family: var(--serif); font-size: 1rem; }
.aw-quote.goal span { margin: 0 0 0.3rem; color: var(--green-deep); }
.aw-quote span { display: block; margin-top: 0.25rem; font: normal 0.68rem var(--mono); letter-spacing: 0.06em; color: var(--blossom-deep); text-transform: uppercase; }
.aw-io { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 12px; align-items: center; margin: 0.2rem 0 0.4rem; }
.aw-io dt { font: 500 0.64rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.aw-io dd { margin: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.aw-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 6px; border-radius: 999px; background: var(--bg-card); color: var(--ink); font-size: 0.8rem; line-height: 1.3; }
.aw-chip svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--green-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aw-chip.x { background: var(--blossom-soft); color: var(--blossom-deep); }
.aw-chip.x svg { stroke: var(--blossom-deep); }
.aw-nav { display: flex; gap: 8px; align-items: center; margin-top: 0.6rem; font: 0.72rem var(--mono); color: var(--ink-soft); }
.aw-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--rule-soft); border-radius: 999px; background: #fff; color: var(--green-deep); font: 500 0.72rem/1.2 var(--mono); cursor: pointer; }
.aw-btn:hover { border-color: var(--green); background: #f3f9f6; }
.aw-btn[disabled] { opacity: 0.35; cursor: default; }
.aw-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aw-btn.solid { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.aw-btn.solid:hover { background: #255d56; }
.aw-ill { position: relative; padding: 6px; border: 1px solid var(--rule-soft); border-radius: 12px; background: #f7f9f9; }
.aw-ill svg { display: block; width: 100%; height: auto; }
.aw-ill-tag { margin-right: 0.45rem; font: 0.6rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); opacity: 0.8; }
.aw-cap { margin: 0.45rem 0.2rem 0; font-size: 0.8rem; line-height: 1.45; color: var(--ink-soft); }

/* overview: three phases */
.aw-phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0.4rem 0 0.9rem; }
.aw-phase { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 11px 12px; border: 1px solid var(--rule-soft); border-radius: 12px; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.aw-phase:hover, .aw-phase:focus-visible { border-color: var(--green); background: #f5faf7; outline: none; }
.aw-phase .ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-card); }
.aw-phase .ic svg { width: 20px; height: 20px; fill: none; stroke: var(--green-deep); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.aw-phase b { font: 600 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-deep); }
.aw-phase span { font-size: 0.86rem; line-height: 1.45; color: var(--ink); }
.aw-phase.p2 .ic { background: rgba(218, 146, 152, 0.2); }

/* example: the question card */
.aw-setup { margin: 4px 0 2px; font-size: 0.84rem; line-height: 1.5; color: var(--ink-soft); }
.aw-panel .katex { font-size: 1em; }
.aw-q { margin: 0.1rem 0 0.75rem; padding: 10px 13px 11px; border: 1px solid var(--rule); border-left: 3px solid var(--green); border-radius: 10px; background: #fff; }
.aw-q-tag { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font: 500 0.64rem var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-soft); }
.aw-q-text { margin-top: 5px; font-family: var(--serif); font-size: 1.1rem; line-height: 1.4; color: var(--ink); }
.aw-q-old { margin: 4px 0 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--rule); font-family: var(--serif); font-size: 0.95rem; line-height: 1.38; color: var(--ink-soft); }
.aw-q-old s { text-decoration: none; background: linear-gradient(var(--blossom-deep), var(--blossom-deep)) no-repeat 0 55% / 0 1.3px; animation: aw-strike 0.7s 0.5s ease-out forwards; }
.aw-q-old.gone { animation: aw-fade-old 0.6s 1.3s forwards; }
.aw-q mark { background: none; color: inherit; padding: 0; }
.aw-q mark.new { background: linear-gradient(rgba(63, 143, 116, 0.24), rgba(63, 143, 116, 0.24)) no-repeat 0 88% / 0 42%; animation: aw-sweep 0.9s 1.2s ease-out forwards; }
.aw-q mark.bad { text-decoration: underline wavy var(--blossom-deep) 1.2px; text-underline-offset: 4px; }
.aw-q mark.hard { text-decoration: underline var(--blossom-deep) 2px; text-underline-offset: 4px; }
.aw-note { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; padding: 2px 8px; border-radius: 6px; background: var(--blossom-soft); color: var(--blossom-deep); font: 0.68rem/1.5 var(--mono); letter-spacing: 0.02em; animation: aw-rise 0.5s 0.6s both; }
.aw-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--green-deep); color: #fff; letter-spacing: 0.06em; animation: aw-stamp 0.45s 0.9s both; }
.aw-badge svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.aw-badge.keep { background: #fff; color: var(--green-deep); box-shadow: inset 0 0 0 1px var(--green); }
.aw-ver { display: inline-flex; gap: 4px; align-items: center; }
.aw-ver i { font-style: normal; padding: 1px 6px; border-radius: 4px; background: var(--bg-card); color: var(--ink-soft); }
.aw-ver i.cur { background: var(--green-tint); color: var(--green-deep); font-weight: 600; }
.aw-precise { margin: -0.3rem 0 0.75rem; font-size: 0.86rem; }
.aw-precise summary { cursor: pointer; color: var(--green-deep); font: 0.72rem var(--mono); }
.aw-precise p { margin: 0.4rem 0 0; line-height: 1.55; color: var(--ink); }

/* example: stepper */
.aw-stepper { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--rule-soft); }
.aw-stepper[hidden] { display: none; }
.aw-track { flex: 1; display: flex; gap: 10px; min-width: 0; }
.aw-grp { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.aw-segs { display: flex; gap: 4px; }
.aw-seg { flex: 1; padding: 7px 0; border: 0; background: none; cursor: pointer; }
.aw-seg i { display: block; height: 4px; border-radius: 2px; background: var(--rule-soft); overflow: hidden; }
.aw-seg i::after { content: ""; display: block; height: 100%; width: 0; background: var(--green); border-radius: 2px; }
.aw-seg.done i::after { width: 100%; }
.aw-seg.cur i::after { width: 100%; background: var(--green-deep); }
.aw-seg.cur.run i::after { width: 0; animation: aw-fill var(--dur, 9s) linear forwards; }
.aw-seg:hover i { background: rgba(31, 60, 50, 0.2); }
.aw-grp-l { font: 0.62rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-grp.cur .aw-grp-l { color: var(--green-deep); font-weight: 600; }
.aw-ctrl { display: flex; gap: 6px; }
.aw-ctrl .aw-btn { padding: 6px 8px; }
.aw-ctrl .aw-btn.solid { padding: 6px 10px; }

/* ---------- illustrations (viewBox 320 x 190) ---------- */
.aw-ill .a { animation: aw-rise 0.5s var(--d, 0s) both; }
.aw-ill .pop { animation: aw-pop 0.45s var(--d, 0s) both; transform-box: fill-box; transform-origin: center; }
.aw-ill .dim { animation: aw-dim 0.5s var(--d, 0s) both; }
.aw-ill .fly { animation: aw-fly 0.7s var(--d, 0s) cubic-bezier(.2, .8, .3, 1) both; }
.aw-ill .draw { stroke-dasharray: var(--len, 200); stroke-dashoffset: var(--len, 200); animation: aw-draw 0.9s var(--d, 0s) ease-out forwards; }
.aw-ill .glow { animation: aw-glow 0.6s var(--d, 0s) both; }
.aw-ill text { font-family: var(--mono); font-size: 9.5px; fill: var(--ink-soft); letter-spacing: 0.02em; }
.aw-ill text.s { font-family: var(--text); font-size: 11.5px; fill: var(--ink); letter-spacing: 0; }
.aw-ill text.big { font-family: var(--serif); font-size: 22px; fill: var(--ink-soft); }
.aw-ill text.g { fill: var(--green-deep); font-weight: 600; }
.aw-ill text.r { fill: var(--blossom-deep); font-weight: 600; }
.aw-ill text.au { fill: #8a6a22; font-weight: 600; }
.aw-ill .card { fill: #fff; stroke: #b9ccc3; stroke-width: 1.2; }
.aw-ill .card.hi { stroke: var(--green); stroke-width: 2; }
.aw-ill .ring { fill: none; stroke: var(--green); stroke-width: 2; }
.aw-ill .white { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.aw-ill .ln { stroke: #cfdcd5; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.aw-ill .ln.g { stroke: rgba(63, 143, 116, 0.55); }
.aw-ill .ink { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.aw-ill .jade { fill: none; stroke: var(--green-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.aw-ill .rose { fill: none; stroke: var(--blossom-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.aw-ill .soft { fill: none; stroke: #a9bfb5; stroke-width: 1.4; stroke-linecap: round; }
.aw-ill .dash { fill: none; stroke: #9db4aa; stroke-width: 1.3; stroke-dasharray: 3 4; }
.aw-ill .box { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 4 4; }
.aw-ill .gr line { stroke: #8ea79c; stroke-width: 1.4; }
.aw-ill .gr circle { fill: #fff; stroke: var(--ink-soft); stroke-width: 1.3; }
.aw-ill .gr.faint line { stroke: #c4d3cc; }
.aw-ill .gr.faint circle { stroke: #b2c3bb; }
.aw-ill .tri polygon { fill: rgba(196, 165, 90, 0.2); stroke: #b08a35; stroke-width: 1.6; stroke-linejoin: round; }
.aw-ill .tri circle { fill: #fff; stroke: #b08a35; stroke-width: 1.4; }
.aw-ill .tri.lit polygon { animation: aw-gold 0.6s var(--d, 0s) both; }
.aw-ill .fillg { fill: var(--green-deep); }
.aw-ill .fillt { fill: var(--bg-card); }
.aw-ill .fillr { fill: var(--blossom-soft); }

@keyframes aw-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes aw-pop { 0% { opacity: 0; transform: scale(0.5); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes aw-dim { to { opacity: 0.18; } }
@keyframes aw-fly { from { opacity: 0; transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.3); } to { opacity: 1; transform: none; } }
@keyframes aw-draw { to { stroke-dashoffset: 0; } }
@keyframes aw-glow { from { opacity: 0.25; } to { opacity: 1; } }
@keyframes aw-gold { from { fill: rgba(196, 165, 90, 0); } to { fill: rgba(196, 165, 90, 0.42); } }
@keyframes aw-strike { to { background-size: 100% 1.3px; } }
@keyframes aw-fade-old { to { opacity: 0.55; } }
@keyframes aw-sweep { to { background-size: 100% 42%; } }
@keyframes aw-stamp { 0% { opacity: 0; transform: scale(1.6) rotate(-6deg); } 100% { opacity: 1; transform: none; } }
@keyframes aw-fill { to { width: 100%; } }

@media (max-width: 640px) {
  .aw-card { padding: 12px 12px 14px; border-radius: 14px; }
  .aw-grid { grid-template-columns: minmax(0, 1fr); }
  .aw-phases { grid-template-columns: minmax(0, 1fr); }
  .aw-panel { min-height: 0; }
  .aw-h { font-size: 1.22rem; }
  .aw-track { gap: 6px; }
  .aw-grp-l { display: none; }
  .aw-stepper { align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .aw *, .aw *::after { animation-duration: 0.01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .aw-node.on .aw-halo { animation: none !important; }
  .aw-seg.cur.run i::after { animation-duration: var(--dur, 9s) !important; }
}
