/* s04 — Bài toán quy mô (scale + fair three-way comparison) */
#s04 > .src { bottom: 58px; font-size: 14px; max-width: 1680px; }
.s04 { position: relative; }
.s04-head { position: absolute; left: 0; top: 0; width: 760px; }
.s04-head h2 { font-size: 64px; transition: font-size .7s var(--ease-out); white-space: nowrap; }
#s04.s04-cmp .s04-head h2 { font-size: 52px; }
#s04.s04-cmp .s04-head h2 br { display: none; }
.s04-lead { transition: opacity .4s; }
#s04.s04-cmp .s04-lead { opacity: 0; }
.s04-lead { font-size: 30px; margin-top: 14px; }

/* step 0: facts + zoom canvas */
.s04-facts { position: absolute; left: 0; top: 290px; width: 640px; display: flex; flex-direction: column; gap: 26px; }
.s04-fact { border-left: 3px solid var(--line2); padding-left: 24px; }
.s04-fact b { display: block; font: 800 64px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.s04-fact b small { font-size: 28px; font-weight: 600; color: var(--ink2); letter-spacing: 0; }
.s04-fact span { display: block; font-size: 23px; color: var(--ink2); margin-top: 6px; line-height: 1.3; }
.s04-fact span i { color: var(--ink3); font-size: 19px; }
.s04-fact.yr { border-left-color: var(--cyan); opacity: 0; }

.s04-scale { position: absolute; left: 680px; top: 0; width: 1000px; height: 880px; transform-origin: 70% 40%; }
.s04-cv { position: absolute; left: 0; top: 0; width: 1000px; height: 640px; background: radial-gradient(closest-side, rgba(12, 34, 25, .9), rgba(4, 11, 8, 0)); }
.s04-count { position: absolute; left: 0; top: 664px; display: flex; align-items: baseline; gap: 18px; }
.s04-count span { font: 500 18px var(--mono); color: var(--ink3); letter-spacing: .08em; text-transform: uppercase; }
.s04-count b { font: 800 60px/1 var(--font); color: var(--cyan); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.s04-lad { position: absolute; left: 0; right: 0; top: 752px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.s04-lad > div { border-top: 3px solid var(--line); padding-top: 10px; transition: border-color .4s, opacity .4s; opacity: .45; }
.s04-lad > div.past { opacity: .75; border-color: rgba(76, 201, 240, .35); }
.s04-lad > div.on { opacity: 1; border-color: var(--cyan); }
.s04-lad b { display: block; font-size: 20px; font-weight: 700; }
.s04-lad span { display: block; font: 500 16px/1.3 var(--mono); color: var(--ink3); margin-top: 4px; }
.s04-lad > div.on span { color: var(--cyan); }
.s04-replay { all: unset; position: absolute; right: 8px; top: 10px; font: 500 16px var(--mono); color: var(--ink3); padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(4, 12, 9, .6); cursor: pointer; }
.s04-replay:hover { color: var(--ink); border-color: var(--line2); }
.s04-note { position: absolute; left: 0; right: 0; top: 606px; font: 500 17px var(--mono); color: var(--cyan); text-align: center; opacity: 0; transition: opacity .8s; }
#s04.s04-zdone .s04-note { opacity: .85; }
.s04-scale, .s04-facts { transition: opacity .5s var(--ease-io), transform .6s var(--ease-io), visibility 0s; }
#s04.s04-cmp .s04-scale, #s04.s04-cmp .s04-facts { opacity: 0 !important; transform: scale(.96); visibility: hidden; pointer-events: none; transition: opacity .45s var(--ease-io), transform .6s var(--ease-io), visibility 0s .5s; }
#s04.active .s04-facts .s04-fact:not(.yr) { animation: rs-enter 1s var(--ease-out) both; }
#s04.active .s04-facts .s04-fact:nth-child(2) { animation-delay: .25s; } #s04.active .s04-facts .s04-fact:nth-child(3) { animation-delay: .45s; }
#s04.s04-cmp .s04-facts .s04-fact { animation: none !important; }

/* scale chip (steps 1–3) */
.s04-chip { position: absolute; right: 0; top: 4px; display: flex; gap: 20px; align-items: center; background: var(--panel); border: 1px solid rgba(76, 201, 240, .3); border-radius: 18px; padding: 14px 24px 14px 14px; }
.s04-mini { width: 132px; height: 132px; border-radius: 8px; }
.s04-chip b { display: block; font: 800 34px/1.1 var(--font); font-variant-numeric: tabular-nums; }
.s04-chip span { display: block; font-size: 19px; color: var(--ink2); margin-bottom: 8px; }
.s04-chip b.c-cyan { font-size: 26px; }
.s04-chip b.c-cyan span { display: inline; font-size: inherit; color: inherit; margin: 0; }

/* matrix */
.s04-matrix { position: absolute; left: 0; right: 0; top: 172px; display: grid; grid-template-columns: 400px 540px repeat(6, 1fr); grid-template-rows: 92px repeat(3, 140px); }
.s04-hd { border-bottom: 1px solid var(--line2); display: flex; align-items: flex-end; padding-bottom: 12px; }
.s04-hd-ap { font-size: 22px; color: var(--ink2); }
.s04-hd-ap b { color: var(--ink); margin-left: 6px; }
.s04-hd-cost { flex-direction: column; align-items: stretch; justify-content: flex-end; padding: 0 20px 10px; gap: 8px; }
.s04-hd-t { font-size: 21px; font-weight: 700; }
.s04-hd-t .dim { font-weight: 400; font-size: 18px; }
.s04-hd-cap { justify-content: center; text-align: center; font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.s04-slider { display: flex; align-items: center; gap: 14px; font: 500 16px var(--mono); color: var(--ink3); }
.s04-slider:hover { transform: none; }
.s04-slider output { font: 800 28px/1 var(--font); color: var(--cyan); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.s04-range { -webkit-appearance: none; appearance: none; flex: 1; height: 8px; border-radius: 4px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--cyan) 0 var(--p, 100%), rgba(170, 230, 200, .18) var(--p, 100%) 100%); }
.s04-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #e9fbff; border: 4px solid var(--cyan); box-shadow: 0 0 18px rgba(76, 201, 240, .6); }
.s04-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #e9fbff; border: 4px solid var(--cyan); }

.s04-ap { grid-column: 1; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; padding-right: 16px; transition: opacity .6s; }
.s04-r-a.s04-ap { grid-row: 2; } .s04-r-b.s04-ap { grid-row: 3; } .s04-r-c.s04-ap { grid-row: 4; }
.s04-ap-t { font-size: 24px; font-weight: 700; line-height: 1.2; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.s04-ap-t i { font: 700 17px/1 var(--mono); font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid var(--violet); color: var(--violet); }
.s04-r-c .s04-ap-t i { border-color: var(--cyan); color: var(--cyan); }
.s04-ap-s { font-size: 18px; color: var(--ink3); margin-top: 8px; line-height: 1.35; }
.s04-ap-s .tag { font-size: 14px; padding: 4px 10px; margin-right: 4px; }
.s04-unreal { display: inline-block; margin-right: 6px; font: 600 14px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--red); border: 1px solid rgba(255, 77, 94, .6); padding: 5px 9px; border-radius: 999px; }

.s04-costcol { grid-column: 2; grid-row: 2 / 5; position: relative; padding: 0 20px; transition: opacity .6s; }
.s04-bars { width: 500px; height: 450px; overflow: visible; display: block; }
.s04-grid { stroke: rgba(170, 230, 200, .07); stroke-width: 1; }
.s04-grid.major { stroke: rgba(170, 230, 200, .16); }
.s04-tick { font: 500 15px var(--mono); fill: var(--ink3); }
.s04-track { stroke: rgba(170, 230, 200, .12); stroke-width: 2; }
.s04-pill { fill: var(--violet); opacity: .9; }
.s04-bar-a .s04-pill { fill: rgba(167, 139, 250, .35); stroke: var(--violet); stroke-width: 1.5; stroke-dasharray: 5 4; }
.s04-bar-c .s04-pill { fill: var(--cyan); filter: drop-shadow(0 0 8px rgba(76, 201, 240, .8)); }
.s04-val { font: 700 20px var(--font); fill: var(--ink); }
.s04-ml { font: 500 14px var(--mono); fill: var(--ink3); transition: opacity .3s; }
.s04-cheap { position: absolute; left: 130px; top: 126px; white-space: nowrap; font: 700 17px var(--mono); color: var(--amber); letter-spacing: .04em; border: 1px solid rgba(255, 176, 32, .5); border-radius: 8px; padding: 4px 10px; background: rgba(20, 14, 0, .55); }

.s04-cell { border-bottom: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 0 4px; transition: opacity .6s; }
.s04-mk { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 800 26px/1 var(--font); }
.s04-mk.ok { color: #04140c; background: var(--green); box-shadow: 0 0 22px rgba(62, 224, 143, .45); }
.s04-mk.no { color: var(--red); border: 2px solid rgba(255, 77, 94, .7); background: rgba(255, 77, 94, .08); }
.s04-cap { font-size: 15px; line-height: 1.2; color: var(--ink3); max-width: 116px; }
.s04-cell .s04-cap[data-step] { opacity: 0; transition: opacity .5s; }
.s04-cell .s04-cap.shown { opacity: 1; }
.s04-hint { position: absolute; left: 560px; top: 560px; }
#s04.s04-final .s04-hint, #s04.s04-final .s04-cheap { opacity: 0 !important; }

/* row c highlight + final emphasis */
.s04-matrix::before { content: ''; position: absolute; left: -16px; right: -16px; top: 372px; height: 140px; border-radius: 14px; background: linear-gradient(90deg, rgba(76, 201, 240, .10), rgba(76, 201, 240, .03)); border: 1px solid rgba(76, 201, 240, .22); pointer-events: none; transition: all .6s; }
#s04.s04-final .s04-matrix::before { background: linear-gradient(90deg, rgba(76, 201, 240, .18), rgba(76, 201, 240, .06)); border-color: rgba(76, 201, 240, .6); box-shadow: 0 0 50px rgba(76, 201, 240, .18); }
#s04.s04-final .s04-costcol, #s04.s04-final .costcap { opacity: .28; }
#s04.s04-final .s04-r-a, #s04.s04-final .s04-r-b { opacity: .62; }
#s04.s04-final .s04-r-c.s04-cell, #s04.s04-final .s04-r-c.s04-ap { opacity: 1; }
#s04.s04-final .s04-r-c.costcap { opacity: .28; }

/* punchline */
.s04-punch { position: absolute; left: 0; right: 0; top: 752px; display: grid; grid-template-columns: 1fr 800px; gap: 24px; align-items: center; }
.s04-p1 { display: flex; flex-direction: column; gap: 4px; }
.s04-p-a { font-size: 26px; color: var(--ink2); }
.s04-p-b { font-size: 34px; font-weight: 800; letter-spacing: -.01em; }
.s04-p-b b { color: var(--cyan); }
.s04-p-c { font-size: 20px; color: var(--violet); margin-top: 2px; }
.s04-p2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 26px; background: rgba(20, 16, 4, .55); border: 1px solid rgba(242, 193, 78, .35); border-radius: 16px; padding: 12px 22px; }
.s04-p2 > div { display: flex; align-items: center; gap: 12px; }
.s04-p2 b { font: 800 46px/1 var(--font); }
.s04-p2 span { font-size: 17px; white-space: nowrap; line-height: 1.25; color: var(--ink2); }
.s04-p2 span i { color: var(--ink3); }
.s04-p2 p { grid-column: 1 / -1; margin: 4px 0 0; font-size: 19px; color: var(--ink); }
.s04-p2 p b { font: inherit; font-weight: 700; color: var(--gold); }

/* prediction card (step 1, hidden once the answer is shown) */
.s04-ask { position: absolute; left: 0; right: 0; top: 250px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 26px; }
#s04.s04-ans .s04-ask { opacity: 0 !important; visibility: hidden; transition: opacity .4s, visibility 0s .4s; }
.s04-ask .quote { margin: 0; font-size: 66px; color: var(--ink); }
.s04-ask-q { font-size: 32px; color: var(--ink2); }
.s04-ask-q b { color: var(--violet); }
.s04-opts { display: flex; gap: 24px; margin-top: 6px; }
.s04-opts button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 14px; font-size: 28px; font-weight: 600; padding: 20px 30px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line2); }
.s04-opts button b { font: 800 26px/1 var(--mono); color: var(--violet); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(167, 139, 250, .6); }
.s04-opts button.picked { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(167, 139, 250, .35), 0 20px 60px rgba(167, 139, 250, .18); }
.s04-ask .hint { margin-top: 10px; }
.s04-p-c b { color: var(--gold); }

/* QA pass: projector legibility (dark greys wash out) */
#s04 > .src { font-size: 15px; color: var(--ink3); }
.s04-ap-s { font-size: 19px; color: var(--ink2); }
.s04-cap { font-size: 17px; color: var(--ink2); max-width: 130px; }
.s04-ml { font-size: 16px; fill: var(--ink2); }
.s04-tick { font-size: 16px; fill: var(--ink2); }
.s04-hd-cap { font-size: 19px; }
.s04-slider { font-size: 17px; color: var(--ink2); }
.s04-lad span { font-size: 17px; color: var(--ink2); }
.s04-count span { color: var(--ink2); }
.s04-p-c { font-size: 24px; }
.s04-p2 span { font-size: 18px; color: var(--ink); }
.s04-p2 p { font-size: 20px; }
.s04-fact span i { color: var(--ink2); }
.s04-p2 { display: block; padding: 14px 22px; }
.s04-p2 p { margin: 0; font-size: 21px; line-height: 1.35; color: var(--ink); }
.s04-p2 p.n { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(242, 193, 78, .25); font-size: 19px; color: var(--ink2); }
.s04-p2 p.n .tag { font-size: 14px; padding: 4px 11px; margin-right: 8px; vertical-align: 2px; }
.s04-punch { top: 712px; }
.s04-p2 p { font-size: 19px; }
.s04-p2 p.n { font-size: 17px; margin-top: 8px; padding-top: 8px; }
.s04-tick { font-size: 15px; }
.s04-ap-s { font-size: 18px; }
/* glossary chips: A with the opening facts (step 0), B in the free header space from step 1 */
.s04-gl1 { left: 0; top: 670px; width: 640px; transition: opacity .45s var(--ease-io), visibility 0s; }
/* polish: the zoom ends by revealing the '≈ 109 tỷ' fact in this same spot → retire the chips then */
#s04.s04-cmp .s04-gl1, #s04.s04-zdone .s04-gl1 { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, visibility 0s .3s; }
.s04-gl2 { left: 836px; top: 4px; width: 384px; opacity: 0; visibility: hidden; transition: opacity .6s var(--ease-out) .3s, visibility 0s .3s; }
#s04.s04-cmp .s04-gl2 { opacity: 1; visibility: visible; }
