/* Peeerly · System Testing — slide deck
   Layout: a fixed 1280×720 stage scaled to fit the window (letterboxed), one slide visible at a time.
   Brand: Peeerly's tokens — periwinkle primary + sun / candy / mint / sky accents, Poppins + Plus Jakarta Sans. */

:root {
  --bg: #FAFAFF; --surface: #FFFFFF; --soft: #F0F1FF; --fg: #1E1B4B; --muted: #585C78; --line: #E2E3F4; --outer: #E7E8F7;
  --peri: #5B61E8; --peri-soft: #E4E5FF; --sun: #F2B11F; --sun-ink: #8A5A00; --sun-soft: #FFF1CC;
  --candy: #E8406F; --candy-soft: #FFE1EA; --mint: #0F9E76; --mint-soft: #D6F5EA; --sky: #1B93CC; --sky-soft: #DCF1FB;
  --term: #1E1B4B; --term-fg: #CFF7E6; --term-dim: #9EA1D8;
  --shadow: 0 1px 2px rgba(30,27,75,.06), 0 10px 28px rgba(30,27,75,.08);
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141332; --surface: #1C1B3D; --soft: #25244E; --fg: #F0F0FF; --muted: #A9ABCB; --line: #322F62; --outer: #0B0A1F;
  --peri: #9095FF; --peri-soft: #2C2C66; --sun: #FFCB52; --sun-ink: #FFCB52; --sun-soft: #3F3520;
  --candy: #FF6C98; --candy-soft: #46223A; --mint: #3FDBA9; --mint-soft: #143B34; --sky: #5CC8F5; --sky-soft: #173449;
  --term: #0B0A1F; --term-fg: #BDF5DE; --term-dim: #8A8DC4; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.28); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #141332; --surface: #1C1B3D; --soft: #25244E; --fg: #F0F0FF; --muted: #A9ABCB; --line: #322F62; --outer: #0B0A1F;
  --peri: #9095FF; --peri-soft: #2C2C66; --sun: #FFCB52; --sun-ink: #FFCB52; --sun-soft: #3F3520;
  --candy: #FF6C98; --candy-soft: #46223A; --mint: #3FDBA9; --mint-soft: #143B34; --sky: #5CC8F5; --sky-soft: #173449;
  --term: #0B0A1F; --term-fg: #BDF5DE; --term-dim: #8A8DC4; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.28); color-scheme: dark; }

/* ───────── base / stage ───────── */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--outer); color: var(--fg); font-family: var(--body); font-size: 19px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-size: 40px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }
li { margin: .2em 0; }
button { font: inherit; color: inherit; cursor: pointer; }
code, .mono { font-family: var(--mono); font-size: .86em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--peri); outline-offset: 2px; border-radius: 6px; }

.stage { position: fixed; left: 50%; top: 50%; width: 1280px; height: 720px; transform: translate(-50%, -50%) scale(var(--s, 1)); background: var(--bg); overflow: hidden; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
:fullscreen .stage, .stage.flat { border-radius: 0; box-shadow: none; }
.slide { position: absolute; inset: 0; padding: 48px 72px 64px; display: flex; flex-direction: column; gap: 22px; visibility: hidden; }
.slide.active { visibility: visible; z-index: 2; }
.slide.leaving { visibility: visible; z-index: 1; pointer-events: none; }
.stage-foot { position: absolute; left: 72px; right: 72px; bottom: 22px; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); z-index: 3; font-variant-numeric: tabular-nums; }
.stage.no-foot .stage-foot { display: none; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 20; background: transparent; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--peri), var(--candy), var(--sun)); transition: width .4s cubic-bezier(.2,.8,.2,1); }

.controls { position: fixed; bottom: max(14px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity .4s, transform .4s; font-size: 14px; }
.controls.idle { opacity: 0; transform: translateX(-50%) translateY(10px); pointer-events: none; }
.controls button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 17px; display: grid; place-items: center; }
.controls button:hover { background: var(--soft); }
.controls span { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.controls .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.overview { position: fixed; inset: 0; z-index: 30; background: color-mix(in srgb, var(--outer) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: max(28px, env(safe-area-inset-top, 0px)) max(28px, env(safe-area-inset-right, 0px)) 28px max(28px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.ov-head { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto 20px; }
.ov-head h2 { font-size: 28px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; max-width: 1200px; margin: 0 auto; }
.ov-grid button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; transition: transform .2s, border-color .2s; }
.ov-grid button:hover { transform: translateY(-2px); border-color: var(--peri); }
.ov-grid button b { font-family: var(--mono); color: var(--peri); font-size: 13px; }
.ov-grid button.cur { border-color: var(--peri); box-shadow: 0 0 0 3px var(--peri-soft); }

/* ───────── shared ───────── */
.sh { display: grid; gap: 6px; }
.eyebrow { font-family: var(--display); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--peri); }
.lead { color: var(--muted); font-size: 21px; max-width: 34ch; }
.row { display: flex; align-items: center; } .between { justify-content: space-between; align-items: end; } .wrap { flex-wrap: wrap; }
.gap { gap: 14px; } .gap-s { gap: 8px; }
.muted { color: var(--muted); } .center { text-align: center; }
.tiny { font-size: 14px; color: var(--muted); margin-top: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.card h3 { margin-bottom: 8px; }
.card ul { color: var(--muted); font-size: 17px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; font-family: var(--display); letter-spacing: .02em; white-space: nowrap; }
.c-peri { background: var(--peri-soft); color: var(--peri); } .c-sun { background: var(--sun-soft); color: var(--sun-ink); } .c-candy { background: var(--candy-soft); color: var(--candy); }
.c-mint { background: var(--mint-soft); color: var(--mint); } .c-sky { background: var(--sky-soft); color: var(--sky); } .c-muted { background: var(--soft); color: var(--muted); }
.bg-peri { background: var(--peri); } .bg-sun { background: var(--sun); } .bg-candy { background: var(--candy); } .bg-mint { background: var(--mint); } .bg-sky { background: var(--sky); }
.t-peri { color: var(--peri); } .t-candy { color: var(--candy); } .t-mint { color: var(--mint); } .t-sky { color: var(--sky); } .t-sun { color: var(--sun); }
.btn { border: 0; border-radius: 999px; padding: 10px 20px; font-family: var(--display); font-weight: 600; font-size: 15px; background: var(--peri); color: #fff; display: inline-flex; align-items: center; gap: 8px; transition: transform .15s, filter .15s; justify-self: start; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: var(--soft); color: var(--fg); }
.foot-note { font-size: 18px; color: var(--muted); margin-top: auto; }
.foot-note b { color: var(--fg); }
.punch { margin-top: auto; font-size: 20px; padding: 16px 22px; border-radius: 16px; background: var(--soft); }
.legend { display: flex; gap: 18px; font-size: 14px; color: var(--muted); flex-wrap: wrap; align-items: center; margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; flex: 1; min-height: 0; }
.fbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 13px; font-size: 14px; font-weight: 600; transition: background .2s, color .2s; }
.fbtn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ───────── 1 title ───────── */
.s-title { justify-content: center; padding: 60px 80px; }
.blob { position: absolute; border-radius: 50%; z-index: 0; }
.b1 { width: 380px; height: 380px; background: var(--peri-soft); right: -110px; top: -140px; }
.b2 { width: 180px; height: 180px; background: var(--sun-soft); left: -60px; bottom: -70px; }
.b3 { width: 90px; height: 90px; background: var(--candy-soft); left: 46%; top: 60px; }
.title-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.s-title h1 { font-size: 96px; font-weight: 800; letter-spacing: -0.035em; line-height: .98; margin: 10px 0 20px; }
.s-title h1 span { color: var(--peri); }
.s-title .lead { margin-bottom: 22px; }
.hint { position: absolute; bottom: 30px; left: 80px; font-size: 14px; color: var(--muted); }
kbd { font-family: var(--mono); font-size: 12px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
.term { background: var(--term); color: var(--term-fg); border-radius: 18px; padding: 18px 20px; font-family: var(--mono); font-size: 14px; box-shadow: 0 24px 60px rgba(30,27,75,.3); position: relative; }
.term-bar { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; }
.term-bar i { width: 12px; height: 12px; border-radius: 50%; } .d1 { background: #FF6C98; } .d2 { background: #FFCB52; } .d3 { background: #3FDBA9; }
.term-bar span { margin-left: auto; color: var(--term-dim); font-size: 12px; }
.tl { display: grid; grid-template-columns: 52px 60px 1fr auto; gap: 8px; white-space: nowrap; padding: 2px 0; }
.tl .ok { color: #3FDBA9; font-weight: 600; } .tl .id { color: var(--term-dim); } .tl .code { color: #FFCB52; }
.tl.wait { visibility: hidden; }
.term-sum { margin-top: 10px; color: #FFCB52; font-weight: 600; }

/* ───────── 2 agenda ───────── */
.agenda { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; flex: 1; align-content: center; }
.ag { background: var(--soft); border-radius: 18px; padding: 22px; display: grid; gap: 6px; align-content: start; min-height: 170px; transition: transform .25s; }
.ag:hover { transform: translateY(-4px); }
.ag b { font-family: var(--display); font-size: 34px; color: var(--peri); line-height: 1; }
.ag p { color: var(--muted); font-size: 16px; }
.ag-wide { grid-column: span 1; background: var(--peri); color: #fff; } .ag-wide b, .ag-wide p { color: #fff; } .ag-wide p { opacity: .85; }

/* ───────── 3 failures ───────── */
.fail { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); display: grid; gap: 4px; align-content: start; position: relative; }
.fail .yr { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.fails { flex: 1; }
.fail .big { font-family: var(--display); font-size: 58px; line-height: 1; font-variant-numeric: tabular-nums; }
.fail .cap { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.fail h3 { font-size: 18px; }
.fail p:last-child { font-size: 15px; color: var(--muted); }

/* ───────── 4 V-model ───────── */
.vwrap { position: relative; flex: 1; min-height: 0; }
.vwrap svg { width: 100%; height: 100%; }
.vpath { fill: none; stroke: var(--line); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.vlinks line { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 7; opacity: .55; }
.vlinks line.hot { stroke: var(--peri); opacity: 1; stroke-width: 3; }
.vwrap .vcheck { position: absolute; transform: translate(-50%, -50%); font-style: normal; color: var(--peri); font-size: 15px; font-weight: 700; font-family: var(--display); background: var(--bg); padding: 0 8px; }
.vwrap svg path, .vwrap svg line { vector-effect: non-scaling-stroke; }
.vnodes span { position: absolute; transform: translate(-50%, -50%); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 6px 14px; font-weight: 700; font-size: 15px; white-space: nowrap; box-shadow: var(--shadow); }
.vnodes span.hot { background: var(--peri); color: #fff; border-color: var(--peri); }
.vnodes span.code { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ───────── 5 definition ───────── */
.def-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 26px; flex: 1; align-items: center; }
.quote { margin: 0; font-family: var(--display); font-size: 32px; line-height: 1.3; font-weight: 600; padding-left: 0; }
.quote b { color: var(--peri); }
.stack-col { display: grid; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ───────── 6 car analogy ───────── */
.car { align-items: stretch; }
.car .lv { min-height: 390px; }
.lv { background: var(--soft); border-radius: 20px; padding: 18px; display: grid; gap: 8px; align-content: start; border: 2px solid transparent; }
.lv.hot { border-color: var(--peri); background: var(--surface); box-shadow: var(--shadow); }
.lv svg { width: 100%; height: 140px; }
.lv h3 { font-size: 18px; }
.lv .pe { font-size: 15px; color: var(--muted); }
.lv .pe b { color: var(--fg); }
.gear-t { fill: none; stroke: var(--sky); stroke-width: 12; stroke-dasharray: 9 7; }
.gear-b { fill: var(--sky); } .gear-h { fill: var(--soft); }
.lv .g2 { stroke: var(--candy); } .lv .gear-b.g2 { fill: var(--candy); }
.lv:nth-child(1) .gear-t { stroke: var(--sky); }
.lv:nth-child(2) .gear-t:not(.g2) { stroke: var(--sun); } .lv:nth-child(2) .gear-b:not(.g2) { fill: var(--sun); }
.spin, .spin-r, .wheel { transform-box: fill-box; transform-origin: center; animation: spin 4s linear infinite; }
.spin-r { animation-direction: reverse; animation-duration: 3.4s; }
.wheel { animation-duration: .7s; }
@keyframes spin { to { transform: rotate(360deg); } }
.road { stroke: var(--muted); stroke-width: 3; stroke-dasharray: 16 12; animation: road .6s linear infinite; }
@keyframes road { to { stroke-dashoffset: 28; } }
.drive { animation: bob .5s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-2px); } }
.car-b { fill: var(--peri); } .car-w { fill: var(--surface); opacity: .85; }
.wheel circle { fill: var(--fg); } .wheel line { stroke: var(--surface); stroke-width: 3; }
.person { fill: var(--mint); opacity: .85; }
.ok-c { fill: var(--sun); } .ok-t { fill: none; stroke: #1E1B4B; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.pop { transform-box: fill-box; transform-origin: center; animation: pop 2s ease-in-out infinite; }
@keyframes pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ───────── 7 SUT ───────── */
.sut { display: grid; grid-template-columns: 380px 1fr; gap: 26px; flex: 1; min-height: 0; align-items: center; }
.feat-list { display: grid; gap: 10px; }
.feat { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: center; background: var(--soft); border-radius: 14px; padding: 10px 14px; }
.feat i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-style: normal; font-family: var(--display); font-weight: 700; }
.feat h3 { font-size: 16px; } .feat p { font-size: 14px; color: var(--muted); }
.arch svg { width: 100%; height: auto; max-height: 470px; display: block; }
.wires use { stroke: var(--line); stroke-width: 3; fill: none; }
.node rect { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.node.main rect { fill: var(--peri); stroke: var(--peri); }
.node text { fill: var(--fg); font-family: var(--display); font-weight: 600; font-size: 15px; text-anchor: middle; }
.node text.s { font-family: var(--body); font-weight: 500; font-size: 12px; fill: var(--muted); }
.node.main text { fill: #fff; } .node.main text.s { fill: #E4E5FF; }
.pk .k1 { fill: var(--peri); } .pk .k2 { fill: var(--mint); } .pk .k3 { fill: var(--candy); } .pk .k4 { fill: var(--sun); } .pk .k5 { fill: var(--sky); }

/* ───────── 8 types ───────── */
.types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; flex: 1; align-content: center; }
.ty { background: var(--soft); border-radius: 16px; padding: 16px; display: grid; gap: 10px; align-content: start; min-height: 150px; transition: transform .2s, background .2s; }
.ty:hover { transform: translateY(-4px); background: var(--surface); box-shadow: var(--shadow); }
.ty p { font-size: 16px; }

/* ───────── 9 plan ───────── */
.plan { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; flex: 1; align-content: center; }
.plan .card p { font-size: 15px; color: var(--muted); margin-top: 4px; }
.plan .card p b { color: var(--fg); }
.plan .wide { grid-column: 1 / -1; }
.plan .wide p { font-size: 17px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 2px; }

/* ───────── use cases ───────── */
.uc { display: grid; grid-template-columns: 1fr 56px 1.05fr; gap: 14px; flex: 1; min-height: 0; align-items: center; }
.arrow { display: grid; place-items: center; }
.arrow svg { width: 46px; } .arrow path { fill: none; stroke: var(--sun); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.flow-label { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.flow-ol, .flow-ul { font-size: 17px; }
.flow-ul { list-style: none; padding: 0; } .flow-ul b { font-family: var(--mono); color: var(--candy); margin-right: 6px; }
.atm-tcs { display: grid; gap: 10px; }
.atc { display: grid; grid-template-columns: 74px 1fr; gap: 2px 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); }
.atc em { grid-column: 2; font-style: normal; font-size: 14px; color: var(--muted); }
.who { display: flex; gap: 18px; margin-top: 10px; font-size: 15px; color: var(--muted); flex-wrap: wrap; }
.who b { color: var(--fg); }
.step { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 12px; display: flex; gap: 10px; align-items: baseline; font-size: 16px; margin-top: 6px; transition: border-color .25s, box-shadow .25s; }
.step .n { font-family: var(--mono); font-weight: 600; color: var(--peri); min-width: 24px; }
.step.alt .n { color: var(--candy); }
.step.on { border-color: var(--peri); box-shadow: 0 0 0 3px var(--peri-soft); }
.step.alt.on { border-color: var(--candy); box-shadow: 0 0 0 3px var(--candy-soft); }
.tcs { display: grid; gap: 10px; }
.tc { border-radius: 16px; padding: 12px 16px; background: var(--soft); border: 2px solid transparent; transition: border-color .3s, background .3s, transform .3s, box-shadow .3s; display: grid; gap: 4px; }
.tc p { font-size: 14px; color: var(--muted); }
.tc.on { border-color: var(--peri); background: var(--surface); transform: translateX(8px); box-shadow: var(--shadow); }
.tc.alt.on { border-color: var(--candy); }

/* ───────── BVA / ECP / DT ───────── */
.src { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.bva { width: 100%; height: auto; display: block; margin-top: 10px; }
.bva .axis { stroke: var(--muted); stroke-width: 2; }
.bva .okband { fill: var(--mint-soft); }
.bva text { font-family: var(--display); font-weight: 700; font-size: 16px; text-anchor: middle; }
.bva .lbl { font-family: var(--body); font-weight: 500; font-size: 12px; fill: var(--muted); }
table.mini { width: 100%; border-collapse: collapse; font-size: 15px; }
.mini th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mini td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.mini tr.warn td { background: var(--sun-soft); }
.dt-wrap { flex: 1; display: grid; align-items: center; }
table.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.dt th, .dt td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--line); transition: background .3s; }
.dt th { background: var(--soft); font-family: var(--display); font-size: 14px; }
.dt td:first-child, .dt th:first-child { text-align: left; font-weight: 600; }
.dt td.n { color: var(--candy); font-weight: 800; }
.dt tr.act td { font-weight: 700; } .a-ok { color: var(--mint); } .a-no { color: var(--candy); } .a-warn { color: var(--sun-ink); }
.dt tr.ex td { border-bottom: 0; font-size: 13px; }
.dt .col-on { background: var(--peri-soft); }

/* ───────── test table ───────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 640px; }
.table-box { flex: 1; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table.cases { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.cases th { text-align: left; font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--soft); padding: 7px 12px; }
.cases td { padding: 3px 12px; border-top: 1px solid var(--line); line-height: 1.35; }
.cases td:first-child { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.cases .chip { font-size: 10.5px; padding: 1px 8px; }

/* ───────── race ───────── */
.race { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; flex: 1; min-height: 0; }
.race > div:first-child { display: grid; grid-template-rows: auto 1fr; gap: 14px; }
.mode { display: flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 4px; }
.mode button { border: 0; background: transparent; border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; }
.mode button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); }
.arena { position: relative; border-radius: 18px; background: var(--soft); overflow: hidden; min-height: 300px; }
.who-box { position: absolute; top: 0; bottom: 0; margin: auto 0; height: 150px; width: 130px; text-align: center; display: grid; gap: 4px; justify-items: center; align-content: center; font-size: 15px; }
.who-box.a { left: 4%; } .who-box.b { right: 4%; }
.avatar { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 700; font-size: 24px; }
.res { min-height: 24px; font-family: var(--display); font-weight: 700; font-size: 14px; }
.seat { position: absolute; inset: 0; margin: auto; width: 160px; height: 160px; border-radius: 28px; background: var(--sun); color: #1E1B4B; display: grid; place-items: center; text-align: center; transition: background .4s, color .4s; box-shadow: 0 16px 34px color-mix(in srgb, var(--sun) 40%, transparent); }
.seat b { font-family: var(--display); font-size: 60px; line-height: 1; display: block; font-variant-numeric: tabular-nums; }
.seat small { font-size: 13px; font-weight: 600; }
.seat.full { background: var(--mint); color: #fff; } .seat.over { background: var(--candy); color: #fff; }
.packet { position: absolute; top: calc(50% - 10px); width: 20px; height: 20px; border-radius: 50%; opacity: 0; }
.packet.a { left: calc(4% + 116px); background: var(--mint); } .packet.b { right: calc(4% + 116px); background: var(--candy); }
.race-side { display: grid; grid-template-rows: 1fr auto; gap: 14px; min-height: 0; }
.log { font-family: var(--mono); font-size: 13px; background: var(--term); color: var(--term-fg); border-radius: 16px; padding: 14px 16px; overflow: hidden; }
.log div { white-space: pre; padding: 1px 0; }
.log .dim { color: var(--term-dim); } .log .good { color: #3FDBA9; } .log .bad { color: #FF8AAE; } .log .y { color: #FFCB52; }
.rw { background: var(--candy-soft); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; }
.rw p { font-size: 14px; }

/* ───────── pipeline ───────── */
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; cursor: pointer; }
.switch input { width: 44px; height: 26px; appearance: none; -webkit-appearance: none; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch input:checked { background: var(--candy); } .switch input:checked::after { left: 21px; }
.pipe-wrap { position: relative; margin-top: 18px; }
.pipe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.stage-box { text-align: center; padding: 20px 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); transition: border-color .35s, transform .35s, box-shadow .35s; }
.stage-box .ic { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; }
.stage-box .ic svg { width: 28px; height: 28px; }
.stage-box p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.stage-box .st { margin-top: 10px; min-height: 26px; }
.stage-box.active { border-color: var(--peri); transform: translateY(-8px); box-shadow: 0 14px 30px color-mix(in srgb, var(--peri) 25%, transparent); }
.stage-box.done { border-color: var(--mint); } .stage-box.fail { border-color: var(--candy); }
.token { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--peri); box-shadow: 0 0 0 7px color-mix(in srgb, var(--peri) 25%, transparent); opacity: 0; pointer-events: none; }
.token.bad { background: var(--candy); box-shadow: 0 0 0 7px color-mix(in srgb, var(--candy) 25%, transparent); }
.bug-slot { margin-top: auto; min-height: 140px; display: grid; align-items: end; }
.bug { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px 18px; border-radius: 18px; padding: 16px 20px; background: var(--candy-soft); border: 1px solid color-mix(in srgb, var(--candy) 35%, transparent); font-size: 15px; }
.bug small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--candy); font-weight: 700; font-family: var(--display); }
.bug .title { grid-column: 1 / -1; font-family: var(--display); font-weight: 700; font-size: 18px; }

/* ───────── timeline ───────── */
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; }
.tl-card h3 { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.tline { list-style: none; padding: 0; position: relative; margin-left: 8px; }
.tline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tline li { position: relative; padding-left: 28px; margin: 0 0 10px; font-size: 16px; }
.tline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--candy); }
.tline li:last-child::before { background: var(--candy); }
.lesson { background: var(--mint-soft); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.lesson b { color: var(--mint); }

/* ───────── lifecycle ───────── */
.lc-card { display: grid; place-items: center; padding: 10px; }
#lc { width: 100%; height: auto; max-height: 440px; }
.lc-edges path { fill: none; stroke: var(--muted); stroke-width: 2.5; opacity: .5; }
.lc-edges marker path { fill: var(--muted); stroke: none; }
.lc-edges path.re { stroke: var(--candy); stroke-dasharray: 6 6; opacity: 1; }
.re-t { fill: var(--candy); font-size: 12px; font-weight: 600; }
.lc-node rect { fill: var(--surface); stroke: var(--line); stroke-width: 2; transition: fill .25s, stroke .25s; }
.lc-node text { fill: var(--fg); font-family: var(--display); font-weight: 600; font-size: 14px; text-anchor: middle; }
.lc-node.on rect { fill: var(--peri); stroke: var(--peri); } .lc-node.on text { fill: #fff; }
.lc-node.closed.on rect { fill: var(--mint); stroke: var(--mint); }
.lc-tok { fill: var(--candy); stroke: var(--surface); stroke-width: 3; }
.matrix { display: grid; grid-template-columns: 26px 1fr 1fr; grid-template-rows: 1fr 1fr 26px; gap: 10px; height: 380px; }
.matrix .ax-y { grid-row: 1 / 3; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.matrix .ax-x { grid-column: 2 / 4; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.q { border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.q b { font-family: var(--display); font-size: 14px; } .q p { font-size: 15px; }
.matrix .hl { grid-column: 2; grid-row: 1; background: var(--sun-soft); }
.matrix .hh { grid-column: 3; grid-row: 1; background: var(--candy-soft); }
.matrix .ll { grid-column: 2; grid-row: 2; background: var(--soft); }
.matrix .lh { grid-column: 3; grid-row: 2; background: var(--sky-soft); }

/* ───────── coverage ───────── */
.cov { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; flex: 1; align-items: center; }
.bars { display: grid; gap: 14px; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.bar-row > span { font-weight: 700; font-size: 15px; }
.track { position: relative; height: 36px; border-radius: 10px; background: var(--soft); overflow: hidden; }
.track .d, .track .e { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; font-family: var(--mono); font-size: 13px; font-weight: 600; }
.track .d { background: var(--peri-soft); color: var(--peri); } .track .e { background: var(--peri); color: #fff; }
.lg-d { background: var(--peri-soft); } .lg-e { background: var(--peri); } .lg-m { background: transparent; border: 2px solid var(--peri); border-radius: 50% !important; }
.formula { padding: 14px 18px; border-radius: 14px; background: var(--soft); font-size: 16px; margin-bottom: 14px; }
.frac { display: inline-grid; text-align: center; vertical-align: middle; margin: 0 6px; font-size: 14px; }
.frac span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 6px; }
.rings { display: grid; gap: 12px; }
.ring { display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: center; padding: 12px 16px; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; } .ring .bg { stroke: var(--soft); } .ring .fg { stroke-linecap: round; }
.ring b { font-family: var(--display); font-size: 30px; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ring > div > span { font-size: 14px; color: var(--muted); } .ring strong { color: var(--fg); }

/* ───────── traceability ───────── */
.rtm-wrap { flex: 1; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table.rtm { border-collapse: collapse; width: 100%; height: 100%; font-size: 14px; }
.rtm th { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 8px 2px; background: var(--soft); font-weight: 600; }
.rtm th:first-child { text-align: left; padding-left: 16px; font-family: var(--display); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.rtm td { border-top: 1px solid var(--line); text-align: center; padding: 0 2px; }
.rtm td:first-child { text-align: left; padding: 6px 16px; white-space: nowrap; }
.rtm td:first-child b { font-family: var(--mono); color: var(--peri); margin-right: 8px; }
.rtm .cell { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; }
.rtm .cell.auto { background: var(--mint); } .rtm .cell.man { border: 2.5px solid var(--peri); }

/* ───────── stress strategies ───────── */
.tabs { display: flex; gap: 8px; }
.strat { display: grid; grid-template-columns: 1.25fr 1fr; gap: 26px; align-items: center; flex: 1; }
.profile { width: 100%; height: auto; display: block; }
.profile .axis, .chart .axis, #spikeSvg .axis { stroke: var(--line); stroke-width: 2; }
.profile .area { transition: d .7s cubic-bezier(.2,.8,.2,1), fill .4s; fill-opacity: .75; }
.profile text { fill: var(--muted); font-size: 11px; }
.strat-text { display: grid; gap: 10px; }
.strat-text h3 { font-size: 30px; }
.strat-text .scn { padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 16px; }
.strat-text code { display: block; font-size: 13px; background: var(--term); color: var(--term-fg); padding: 12px 14px; border-radius: 12px; white-space: pre; }

/* ───────── spike ───────── */
.spike-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; flex: 1; min-height: 0; align-items: center; }
#spikeSvg { width: 100%; height: auto; display: block; }
#spikeSvg text { fill: var(--muted); font-size: 12px; }
.cap { stroke: var(--mint); stroke-width: 2.5; stroke-dasharray: 8 6; }
#spikeSvg .cap-t { fill: var(--mint); font-weight: 700; }
.traffic { fill: none; stroke: var(--candy); stroke-width: 4; stroke-linecap: round; }
.boom { opacity: 0; transform-box: fill-box; transform-origin: center; }
.boom circle { fill: var(--candy); } #spikeSvg .boom text { fill: #fff; font-weight: 800; font-size: 14px; font-family: var(--display); }
.cases4 { display: grid; gap: 10px; }
.rc { border-radius: 14px; padding: 12px 16px; display: grid; gap: 3px; }
.rc b { font-family: var(--display); font-size: 16px; } .rc p { font-size: 14px; }
.rc.bad { background: var(--candy-soft); } .rc.good { background: var(--mint-soft); }

/* ───────── results chart ───────── */
.results { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; flex: 1; min-height: 0; align-items: center; }
.chart-box { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; }
.chart .grid { stroke: var(--line); }
.chart .thr { stroke: var(--candy); stroke-dasharray: 6 5; stroke-width: 1.5; } .chart .thr-label { fill: var(--candy); font-weight: 600; }
.chart .ln { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .pt { stroke: var(--surface); stroke-width: 2.5; cursor: pointer; transform-box: fill-box; transform-origin: center; }
.chart .pt:hover, .chart .pt:focus { r: 8; outline: none; }
.tip { position: absolute; pointer-events: none; background: var(--fg); color: var(--bg); padding: 6px 10px; border-radius: 10px; font-size: 13px; white-space: nowrap; transform: translate(-50%, -125%); opacity: 0; transition: opacity .15s; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat b { display: block; font-family: var(--display); font-size: 36px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat > span { font-size: 14px; color: var(--muted); }
.mini-stats .tiny { grid-column: 1 / -1; }

/* ───────── findings / lessons ───────── */
.finds { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1; align-content: center; }
.find { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--soft); }
.find.wide { grid-column: 1 / -1; background: var(--candy-soft); }
.find .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 800; font-family: var(--display); }
.find p { font-size: 15px; color: var(--muted); margin-top: 3px; } .find p b { color: var(--fg); }
.lessons { display: grid; gap: 16px; flex: 1; align-content: center; }
.ls { display: grid; grid-template-columns: 1fr 50px 1.25fr; align-items: center; gap: 10px; }
.lf { background: var(--candy-soft); border-radius: 16px; padding: 20px 22px; font-weight: 600; font-size: 19px; }
.la { text-align: center; font-size: 26px; color: var(--sun); font-weight: 800; }
.lt { background: var(--mint-soft); border-radius: 16px; padding: 20px 22px; font-size: 19px; }
.lt b { color: var(--mint); }

/* ───────── end ───────── */
.s-end { background: #1E1B4B; color: #fff; justify-content: center; padding: 60px 80px; }
.s-end .eyebrow { color: #FFCB52; }
.s-end h2 { font-size: 72px; font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 16px; }
.s-end .lead { color: #C9CBF5; max-width: 30ch; }
.end-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 50px; align-items: center; }
.takeaways { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.takeaways span { padding: 9px 18px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 15px; color: #fff; }
.takeaways .bg-peri { background: #5B61E8; } .takeaways .bg-mint { background: #0F9E76; } .takeaways .bg-candy { background: #E8406F; } .takeaways .bg-sky { background: #1B93CC; }
.qr { display: grid; justify-items: center; gap: 8px; text-align: center; }
.qr-box { background: #fff; padding: 18px; border-radius: 22px; width: 260px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr b { font-family: var(--display); font-size: 22px; } .qr span { color: #C9CBF5; font-size: 14px; }
.stage.on-end .stage-foot { color: #9EA1D8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.bva-kinds { display: grid; gap: 8px; margin-top: 16px; }
.bva-kinds p { font-size: 15px; padding: 9px 12px; border-radius: 10px; background: var(--soft); }
.bva-kinds b { color: var(--peri); margin-right: 6px; }
