/* s04b — Ba cỗ máy làm việc thế nào. Colours: Hansen = grey/white, Hệ 1 = cyan, LLM = violet, human = gold. */
#s04b { background: radial-gradient(1000px 700px at 12% 60%, rgba(236, 247, 240, .045), transparent 70%), radial-gradient(900px 700px at 80% 30%, rgba(76, 201, 240, .05), transparent 70%); }
.s04b { --hs: #dfe8e3; --hs2: rgba(223, 232, 227, .55); }
.c-hs { color: var(--hs); }
.tag.hs { color: var(--hs); }

/* ── header ── */
.s04b-head { position: absolute; left: 0; top: 0; right: 0; }
.s04b-head h2 { font-size: 60px; }
.s04b-lead { position: absolute; right: 0; bottom: 4px; margin: 0; font-size: 30px; color: var(--ink2); }
.s04b-lead b { color: var(--ink); font-weight: 600; }

/* ── the shared tile ── */
.s04b-tile { position: absolute; left: 0; top: 136px; width: 300px; height: 740px; display: flex; flex-direction: column; gap: 12px; }
.s04b-tile .tag { align-self: flex-start; }
.s04b-tt b { display: block; font-size: 30px; line-height: 1.15; }
.s04b-tt span { display: block; font-size: 20px; color: var(--ink3); margin-top: 2px; }
.s04b-im { position: relative; width: 290px; height: 290px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line2); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.s04b-im img { width: 100%; height: 100%; display: block; }
.s04b-im em { position: absolute; left: 10px; top: 10px; font: 500 17px/1 var(--mono); font-style: normal; padding: 6px 10px; border-radius: 7px; background: rgba(4, 12, 9, .8); color: var(--ink2); }
.s04b-im.after em { color: var(--cyan); }
.s04b-tf { font-size: 18px; color: var(--ink3); }
.s04b .pxA, .s04b .pxB { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid var(--cyan); box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), 0 0 16px var(--cyan); pointer-events: none; }
.s04b .pxB { border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .6); }
.h1map .pxA::after, .h1map .pxB::after { position: absolute; left: -26px; top: -8px; font: 700 18px/1 var(--mono); color: var(--cyan); text-shadow: 0 0 6px #000, 0 0 3px #000; content: 'A'; }
.h1map .pxB::after { content: 'B'; color: #fff; top: -10px; }
.s04b-ghost { position: absolute; z-index: 8; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); pointer-events: none; opacity: 0; visibility: hidden; }

/* ── lanes (accordion; top/height animated by JS) ── */
.s04b-lanes { position: absolute; left: 336px; top: 136px; width: 1344px; height: 740px; }
.s04b-lane { --lc: var(--hs); position: absolute; left: 0; right: 0; top: 0; height: 234px; overflow: hidden; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--lc); transition: border-color .5s, background .5s, box-shadow .5s; }
.s04b-lane.L1 { top: 0; } .s04b-lane.L2 { top: 253px; --lc: var(--cyan); } .s04b-lane.L3 { top: 506px; --lc: var(--violet); }
.s04b-lane.open { background: var(--panel2); box-shadow: 0 24px 80px rgba(0, 0, 0, .45), 0 0 0 1px color-mix(in srgb, var(--lc) 35%, transparent); }
.s04b-lane.wait { opacity: .55; }
.s04b-lane > div { position: absolute; inset: 0; transition: opacity .5s var(--ease-out); }
.s04b-lane .f-open, .s04b-lane .f-row { opacity: 0; pointer-events: none; }
.s04b-lane.open .f-sum { opacity: 0; }
.s04b-lane.open .f-open { opacity: 1; pointer-events: auto; transition-delay: .2s; }
.s04b[data-st="4"] .s04b-lane .f-sum { opacity: 0; }
.s04b[data-st="4"] .s04b-lane .f-row { opacity: 1; transition: opacity .7s var(--ease-out) .35s; }
.s04b[data-st="4"] .s04b-lane.L2 .f-row { transition-delay: .5s; } .s04b[data-st="4"] .s04b-lane.L3 .f-row { transition-delay: .65s; }

/* summary face */
.f-sum { display: grid; grid-template-columns: 440px 1fr 240px; align-items: center; padding: 0 30px 0 28px; gap: 24px; }
.f-sum .ft { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 6px; align-items: center; }
.f-sum .ft .tag { justify-self: start; }
.f-sum .ft b { font-size: 28px; line-height: 1.12; white-space: nowrap; }
.s04b .tag { white-space: nowrap; }
.f-sum .ft i { grid-column: 1 / -1; font-style: normal; font-size: 21px; color: var(--ink3); white-space: nowrap; }
.f-sum .fl { font-size: 24px; line-height: 1.3; color: var(--ink2); }
.f-sum .fl .ln { display: none; }
.f-sum .fl .sk { font: 500 24px var(--mono); color: var(--ink4); letter-spacing: .02em; }
.f-sum .fl .sk i { font-style: normal; color: var(--lc); margin: 0 10px; }
.f-sum .fl .sk em { font-style: normal; display: inline-block; min-width: 120px; text-align: center; padding: 6px 0; border: 1px dashed var(--line2); border-radius: 10px; }
.f-sum .fr { position: relative; text-align: right; align-self: stretch; }
.f-sum .fr > div { position: absolute; right: 0; top: 50%; transform: translateY(-50%); white-space: nowrap; opacity: 0; transition: opacity .6s; }
.f-sum .fr b { display: block; font: 800 48px/1 var(--font); color: var(--lc); letter-spacing: -.02em; }
.f-sum .fr span { display: block; font-size: 20px; color: var(--ink3); margin-top: 4px; }
.f-sum .fr .rq b { color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--lc) 60%, transparent); }
.s04b[data-st="0"] .f-sum .fr .rq { opacity: 1; }
.s04b-lane.done .fl .sk, .s04b-lane.wait .fl .sk { display: none; }
.s04b-lane.done .fl .ln { display: block; }
.s04b-lane.done .fr .rv { opacity: 1; }

/* open face */
.f-open .oh { position: absolute; left: 28px; right: 28px; top: 18px; display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.f-open .oh b { font-size: 34px; letter-spacing: -.01em; }
.f-open .oh i { font-style: normal; font-size: 22px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; }
.f-open .stages { position: absolute; left: 28px; right: 28px; top: 74px; height: 290px; display: flex; align-items: flex-start; }
.f-open .st { flex: none; width: var(--w); display: flex; flex-direction: column; }
.L1 .s1, .L3 .s1 { --w: 390px; } .L1 .s2, .L3 .s2 { --w: 410px; } .L1 .s3, .L3 .s3 { --w: 400px; }
.L2 .s1 { --w: 300px; } .L2 .s2 { --w: 600px; } .L2 .s3 { --w: 300px; }
.f-open .st label { font: 600 18px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lc); margin-bottom: 12px; white-space: nowrap; }
.f-open .viz { position: relative; height: 190px; display: flex; align-items: center; gap: 16px; }
.f-open .st p { margin: 10px 0 0; font-size: 24px; line-height: 1.25; color: var(--ink2); }
.f-open .st p b { color: var(--ink); font-weight: 600; }
.s04b-arr { flex: none; width: 37px; height: 40px; margin-top: 118px; }
.s04b-arr path { fill: none; stroke: var(--lc); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.f-open .ob { position: absolute; left: 28px; right: 28px; top: 372px; height: 96px; display: flex; gap: 26px; align-items: stretch; font-size: 24px; line-height: 1.27; }
.ob-pc { display: flex; flex-direction: column; justify-content: center; gap: 4px; flex: 1; }
.ob-pc .ok { color: var(--green); } .ob-pc .no { color: var(--amber); }
.ob-pc.ok1 { flex: 0 0 330px; }
.ob-gl { flex: 0 0 560px; padding: 8px 18px; border-radius: 12px; background: rgba(223, 232, 227, .06); border-left: 3px solid var(--hs); color: var(--ink2); display: flex; align-items: center; }
.ob-gl b { color: var(--ink); }
.ob-sp { flex: 0 0 300px; color: var(--ink2); line-height: 1.22; } .ob-sp b { font-weight: 800; } .ob-sp span { color: var(--ink3); }
.ob-jev { flex: 1; position: relative; padding: 8px 18px 7px; border-radius: 12px; border: 1px dashed rgba(76, 201, 240, .5); background: rgba(76, 201, 240, .05); color: var(--ink2); }
.ob-jev i { font-style: normal; color: var(--ink3); }
.ob-jev .jt { display: block; font: 600 16px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; } .ob-jev > b:first-child { color: var(--cyan); }

/* lane 1 visuals */
.v-ls .ls-stack { position: relative; flex: none; width: 150px; height: 150px; margin: 18px 0 0 22px; }
.v-ls .ls-stack i { position: absolute; inset: 0; border-radius: 8px; border: 1px solid var(--hs2); background: rgba(223, 232, 227, .07); }
.v-ls .ls-stack canvas { position: absolute; inset: 0; width: 150px; height: 150px; border-radius: 8px; image-rendering: pixelated; border: 1px solid var(--hs); }
.v-ls .ls-yrs { display: flex; flex-direction: column; gap: 8px; }
.v-ls .ls-yrs b { font: 700 24px var(--mono); color: var(--hs); }
.v-ls .ls-yrs span { font-size: 20px; color: var(--ink3); }
.v-ls .ticks { display: flex; gap: 2px; height: 26px; align-items: flex-end; }
.v-ls .ticks i { width: 5px; height: 100%; border-radius: 2px; background: rgba(223, 232, 227, .14); transition: background .3s, height .3s; }
.v-ls .ticks i.on { background: var(--hs); }
.v-dt .dt-samp { flex: none; width: 140px; display: flex; flex-direction: column; gap: 10px; }
.v-dt .dt-samp span { font-size: 20px; line-height: 1.2; color: var(--gold); }
.v-dt .dots { display: grid; grid-template-columns: repeat(6, 16px); gap: 6px; }
.v-dt .dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(242, 193, 78, .35); transform: scale(.6); transition: all .35s var(--ease-back); }
.v-dt .dots i.on { background: var(--gold); border-color: var(--gold); transform: none; }
.v-dt .dots i.n.on { background: transparent; border-color: var(--gold); }
.v-dt .dt-tree { width: 260px; height: 156px; overflow: visible; }
.dt-tree .e { stroke: rgba(223, 232, 227, .22); stroke-width: 3; fill: none; transition: stroke .4s; }
.dt-tree .n, .dt-tree .lf { fill: #0b1a14; stroke: rgba(223, 232, 227, .4); stroke-width: 2.5; transition: all .4s; }
.dt-tree .on { stroke: var(--hs); } .dt-tree .n.on, .dt-tree .lf.on { fill: var(--hs); filter: drop-shadow(0 0 8px rgba(255, 255, 255, .6)); }
.v-hout { gap: 14px; }
.v-hout figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.v-hout canvas { width: 128px; height: 128px; border-radius: 8px; image-rendering: pixelated; border: 1px solid var(--line2); }
.v-hout figcaption { font-size: 19px; color: var(--ink2); white-space: nowrap; }
.ly-leg { display: flex; flex-direction: column; gap: 8px; font: 500 17px var(--mono); color: var(--ink3); margin-bottom: 26px; }
.ly-leg span { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ly-leg i { width: 16px; height: 16px; border-radius: 4px; } .ly-leg .g { background: rgb(118, 128, 124); } .ly-leg .y { background: rgb(255, 225, 80); } .ly-leg .r { background: rgb(255, 65, 30); }

/* lane 2 visuals */
.f-open .v-bands { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
.v-bands .bh, .v-bands .br { display: grid; grid-template-columns: 46px repeat(6, 38px); gap: 4px; align-items: center; }
.v-bands .bh span { font-size: 18px; color: var(--ink2); text-align: center; white-space: nowrap; }
.v-bands .bh .g3 { grid-column: span 3; border-bottom: 2px solid var(--line2); padding-bottom: 3px; }
.v-bands .bh .g3.ir { color: var(--cyan); border-color: rgba(76, 201, 240, .6); }
.v-bands .br span { font: 600 17px var(--mono); color: var(--ink2); }
.v-bands canvas { width: 38px; height: 38px; border-radius: 4px; image-rendering: pixelated; opacity: .08; transform: scale(.7); transition: opacity .4s, transform .5s var(--ease-back); }
.v-bands canvas.on { opacity: 1; transform: none; }
.f-open .v-gbm { flex-direction: column; align-items: stretch; justify-content: center; gap: 10px; }
.v-gbm .feat { display: flex; gap: 8px; }
.v-gbm .feat span { font-size: 21px; padding: 3px 11px; border-radius: 999px; border: 1px solid rgba(76, 201, 240, .4); color: var(--ink2); white-space: nowrap; }
.v-gbm .q { display: flex; align-items: baseline; gap: 12px; font-size: 24px; white-space: nowrap; transition: opacity .3s; }
.v-gbm .q em { font: 600 18px var(--mono); font-style: normal; color: var(--ink3); min-width: 82px; }
.v-gbm .q .qt { color: var(--ink); } .v-gbm .q .qa { color: var(--cyan); font-weight: 700; }
.v-gbm .forest { display: flex; gap: 4px; align-items: flex-end; height: 26px; }
.v-gbm .forest svg { width: 16px; height: 22px; fill: rgba(76, 201, 240, .14); transition: fill .25s; }
.v-gbm .forest svg.on { fill: var(--cyan); }
.v-gbm .forest span { margin-left: 10px; font: 600 18px var(--mono); color: var(--ink3); white-space: nowrap; }
.v-gbm .bar { display: grid; grid-template-columns: 200px 1fr 62px; gap: 12px; align-items: center; }
.v-gbm .bar span { font-size: 19px; color: var(--ink2); white-space: nowrap; }
.v-gbm .bar .tr { position: relative; height: 14px; border-radius: 7px; background: rgba(170, 230, 200, .08); }
.v-gbm .bar .tr i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--cyan); }
.v-gbm .bar.B .tr i { background: rgba(236, 247, 240, .5); }
.v-gbm .bar .tr u { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--gold); border-radius: 2px; }
.v-gbm .bar b { font: 700 22px var(--mono); text-align: right; color: var(--ink2); }
.v-gbm .bar.flag b { color: var(--cyan); } .v-gbm .bar.pass b { color: var(--ink3); }
.v-h1out { gap: 16px; }
.v-h1out .h1map { position: relative; flex: none; width: 150px; height: 150px; }
.v-h1out canvas { width: 150px; height: 150px; border-radius: 8px; image-rendering: pixelated; border: 1px solid rgba(76, 201, 240, .5); }
.v-h1out .gate { display: flex; flex-direction: column; gap: 2px; }
.v-h1out .gate b { font: 700 24px var(--mono); color: var(--gold); white-space: nowrap; }
.v-h1out .gate b.c-cyan { color: var(--cyan); margin-top: 12px; font-size: 30px; }
.v-h1out .gate span { font-size: 20px; color: var(--ink2); }

/* lane 3 visuals */
.v-tok .tokim { position: relative; flex: none; width: 150px; height: 150px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(167, 139, 250, .5); }
.v-tok .tokim img { width: 100%; height: 100%; display: block; }
.v-tok .grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.v-tok .grid line { stroke: rgba(196, 181, 253, .85); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.v-tok .toks { display: flex; flex-direction: column; gap: 8px; }
.v-tok .sq { display: flex; flex-wrap: wrap; gap: 4px; width: 220px; }
.v-tok .sq i { width: 12px; height: 12px; border-radius: 2px; background: rgba(167, 139, 250, .14); transition: background .25s, transform .3s var(--ease-back); transform: scale(.6); }
.v-tok .sq i.on { background: var(--violet); transform: none; }
.v-tok .toks b { font: 600 19px var(--mono); color: var(--violet); }
.v-tok .pills { display: flex; flex-wrap: wrap; gap: 5px; width: 220px; }
.v-tok .pills span { font-size: 19px; padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(167, 139, 250, .25); color: var(--ink4); transition: all .25s; }
.v-tok .pills span.on { border-color: var(--violet); color: var(--ink); background: rgba(167, 139, 250, .12); }
.v-llm { gap: 14px; }
.s04b-net { width: 280px; height: 137px; flex: none; }
.s04b-net line { stroke: rgba(167, 139, 250, .14); stroke-width: 1; }
.s04b-net .nd { fill: #120f1f; stroke: rgba(167, 139, 250, .5); stroke-width: 2; transition: fill .2s; }
.s04b-net .nd.on { fill: var(--violet); }
.v-llm .nx { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.v-llm .nx span { font: 500 16px var(--mono); color: var(--ink3); white-space: nowrap; }
.v-llm .nx b { font-size: 28px; color: var(--violet); white-space: nowrap; }
.v-ans .bub { width: 100%; height: 166px; padding: 12px 16px; border-radius: 14px 14px 14px 4px; background: rgba(167, 139, 250, .08); border: 1px solid rgba(167, 139, 250, .45); font-size: 24px; line-height: 1.3; color: var(--ink); overflow: hidden; }
.v-ans .cur { display: inline-block; width: 3px; height: 26px; margin-left: 3px; vertical-align: -4px; background: var(--violet); animation: rs-blink 1s infinite; }

/* ── comparison table (step 4) ── */
.s04b-thead { position: absolute; left: 0; right: 0; top: 0; height: 46px; display: grid; grid-template-columns: 250px repeat(6, 1fr); align-items: end; padding: 0 0 8px 5px;
  font: 600 19px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); opacity: 0; transition: opacity .6s var(--ease-out); }
.s04b-thead span { padding: 0 18px; }
.s04b[data-st="4"] .s04b-thead { opacity: 1; transition-delay: .3s; }
.f-row { display: grid; grid-template-columns: 245px repeat(6, 1fr); align-items: center; font-size: 24px; line-height: 1.25; color: var(--ink2); }
.f-row > div { padding: 0 18px; border-left: 1px solid var(--line); height: 100%; display: flex; align-items: center; }
.f-row > div:not(.rn) > span { display: block; }
.f-row > div.rn { border-left: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding-left: 22px; }
.f-row .rn b { font-size: 30px; color: var(--ink); }
.f-row b { color: var(--ink); }
.f-row .y { color: var(--green); } .f-row .n { color: var(--amber); }
.s04b-punch { position: absolute; left: 0; right: 0; top: 566px; height: 170px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 18px;
  opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-out), transform 1s var(--ease-out); pointer-events: none; }
.s04b[data-st="4"] .s04b-punch { opacity: 1; transform: none; transition-delay: 1.1s; }
.s04b-punch .p0 { flex-basis: 100%; text-align: center; font-size: 40px; font-weight: 700; letter-spacing: -.01em; }
.s04b-punch .p1 { font-size: 34px; padding: 10px 24px; border-radius: 999px; border: 2px solid var(--pc); color: var(--ink); background: color-mix(in srgb, var(--pc) 10%, transparent); }
.s04b-punch .p1 b { color: var(--pc); }
.s04b-punch .hs { --pc: var(--hs); } .s04b-punch .c1 { --pc: var(--cyan); } .s04b-punch .c2 { --pc: var(--violet); }
.s04b-punch .hu { --pc: var(--gold); box-shadow: 0 0 40px rgba(242, 193, 78, .25); }
.s04b-src { max-width: 1680px; }

.ob-jev .jt b { color: var(--ink); }
.ob-jev .jf { display: flex; align-items: center; gap: 8px; }
.ob-jev .jf > span { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 5px 12px 4px; border-radius: 8px; background: rgba(76, 201, 240, .07); font-size: 18px; line-height: 1.2; color: var(--ink); }
.ob-jev .jf > span small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; color: var(--ink3); }
.ob-jev .jf > span.jv { border: 1px solid rgba(76, 201, 240, .7); }
.ob-jev .jf > span.jv b { color: var(--cyan); }
.ob-jev .jf > em { font-style: normal; color: var(--cyan); }
