:root {
  --ink: #1b1f2a;
  --muted: #5b6275;
  --line: #e3e6ee;
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --blue: #3337a8;
  --blue-soft: #e9eafb;
  --green: #1e7a57;
  --green-soft: #e3f3ec;
  --red: #b3363a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 8px 24px rgba(20, 24, 40, .06);
  --maxw: 1180px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.62; font-size: 17px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--blue-soft); padding: .08em .35em; border-radius: 5px; }
pre code { background: none; padding: 0; font-size: .86em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; }
.wrap.narrow { max-width: 900px; }
p.narrow, .lead.narrow { margin-left: auto; margin-right: auto; }

/* Navigation */
.topnav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topnav.scrolled { border-bottom-color: var(--line); }
.topnav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.navlinks { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a { color: var(--muted); font-size: 14.5px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.navlinks a:hover, .navlinks a.active { color: var(--blue); background: var(--blue-soft); text-decoration: none; }

/* Hero */
.hero { text-align: center; padding: 48px 0 28px; background: radial-gradient(1200px 380px at 50% -80px, #eef0ff 0%, rgba(238, 240, 255, 0) 70%); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12.5px; font-weight: 700; color: var(--green); margin: 0 0 10px; }
.hero h1 { margin: 0; font-size: clamp(42px, 7vw, 72px); line-height: 1.02; letter-spacing: -.03em; font-weight: 850; }
.t2w { background: linear-gradient(92deg, var(--blue) 0%, #5a3fb0 45%, var(--green) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { font-size: clamp(19px, 2.4vw, 25px); color: #2b3042; margin: 12px auto 22px; max-width: 820px; line-height: 1.35; font-weight: 500; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; font-size: 17.5px; font-weight: 600; }
.authors sup, .affils sup, .notes sup { font-weight: 500; color: var(--blue); }
.affils { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; color: var(--muted); margin-top: 6px; font-size: 15.5px; }
.notes { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; color: var(--muted); margin-top: 4px; font-size: 13px; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 30px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; transition: transform .12s, background .12s; }
.btn:hover { background: var(--blue); text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }
.btn .emoji { font-size: 17px; line-height: 1; }
.btn small { font-weight: 500; opacity: .75; font-size: 12px; }
.btn.disabled { background: #8b90a0; cursor: default; }
.btn.disabled:hover { background: #8b90a0; transform: none; }
.teaser { margin: 0 auto; max-width: 1120px; }
.teaser img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
.teaser-section { padding: 40px 0 8px; }
.teaser-section figcaption { max-width: 1120px; margin-left: auto; margin-right: auto; }

/* Hero montage video */
.hero-video { position: relative; max-width: 1120px; margin: 0 auto; }
.hero-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #0e101a; box-shadow: 0 2px 6px rgba(20, 24, 40, .08), 0 24px 60px rgba(20, 24, 40, .16); border: 1px solid #23263a; }
.vid-toggle { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.28); background: rgba(10, 12, 22, .55); color: #fff; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s, background .12s; }
.hero-video:hover .vid-toggle, .vid-toggle:focus-visible, .hero-video.paused .vid-toggle { opacity: 1; }
.vid-toggle:hover { background: rgba(10, 12, 22, .8); }
.vid-toggle svg { width: 18px; height: 18px; }
.vid-toggle .i-play, .hero-video.paused .vid-toggle .i-pause { display: none; }
.hero-video.paused .vid-toggle .i-play { display: block; }
.hero-video-cap { font-size: 14.5px; color: var(--muted); margin: 12px auto 0; max-width: 900px; line-height: 1.55; }
.hero-video-cap b { color: var(--ink); }

figure { margin: 0; }
figcaption { font-size: 14.5px; color: var(--muted); margin-top: 12px; line-height: 1.55; text-align: left; }
figcaption b { color: var(--ink); }
img[data-zoom] { cursor: zoom-in; }

/* Stats */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; padding: 26px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.stat { text-align: center; padding: 6px 4px; }
.stat .num { font-size: 32px; font-weight: 800; letter-spacing: -.02em; color: var(--blue); line-height: 1.1; }
.stat:nth-child(3) .num, .stat:nth-child(4) .num { color: var(--green); }
.stat .lbl { font-size: 13.5px; color: #3a4052; margin-top: 6px; line-height: 1.35; }
.stat .vs { color: var(--muted); font-size: 12.5px; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }
h2 { font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 18px; text-align: center; }
h3.sub { font-size: 23px; margin: 56px 0 14px; letter-spacing: -.01em; text-align: center; }
.lead { font-size: 18.5px; color: #33394a; text-align: center; margin-bottom: 36px; }
.note { font-size: 15px; color: var(--muted); }
#overview p { text-align: justify; hyphens: auto; }

/* Problem */
.problem-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 36px; align-items: start; }
.problem-cards { display: grid; gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 19px; display: flex; gap: 10px; align-items: baseline; }
.card p { margin: 0; color: #33394a; }
.tag { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-size: 14px; font-weight: 700; }
.question { margin: 4px 0 0; padding: 20px 24px; border-left: 4px solid var(--blue); background: var(--blue-soft); border-radius: 0 var(--radius) var(--radius) 0; font-size: 19px; font-style: italic; color: #22265c; font-weight: 500; }
.side-fig img { border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }

/* Method */
figure.wide { margin: 8px auto 0; }
figure.wide img { border-radius: var(--radius); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
figure.wide.compact { max-width: 1040px; margin-top: 30px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 40px 0; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; position: relative; box-shadow: var(--shadow); }
.step-num { width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.step:nth-child(3) .step-num { background: var(--green); }
.step:nth-child(4) .step-num { background: #2a7a6e; }
.step h3 { margin: 0 0 8px; font-size: 17.5px; line-height: 1.3; }
.step p { margin: 0; font-size: 15px; color: #3a4052; }
.two-col { display: grid; grid-template-columns: .95fr 1.05fr; gap: 36px; align-items: center; margin: 12px 0 44px; }
.two-col figure img { border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.callouts { display: grid; gap: 14px; }
.callout { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; background: linear-gradient(180deg, #fff, #fafbff); }
.callout h4 { margin: 0 0 4px; font-size: 16px; color: var(--blue); }
.callout p { margin: 0; font-size: 15px; color: #3a4052; }

/* Results */
.results-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 32px; align-items: center; margin-top: 26px; }
.results-grid.flip { grid-template-columns: 1fr 1fr; }
.results-grid > *, .problem-grid > *, .two-col > * { min-width: 0; }
.narrow-col p { margin-top: 0; }
.chart { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.chart-legend { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.key { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-left: 8px; }
.key.reach, .bar.reach { background: #c9cdf0; }
.key.wf, .bar.wf { background: var(--blue); }
.bar-row { display: grid; grid-template-columns: 138px 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.bar-row .name { font-size: 14px; font-weight: 600; color: #33394a; }
.bar-row.ours .name { color: var(--green); }
.bar-row.ours .bar.wf { background: var(--green); }
.bar-row.ours .bar.reach { background: #b9e2cf; }
.bars { display: grid; gap: 3px; }
.bar { height: 16px; width: calc((100% - 46px) * var(--v) / 100); border-radius: 4px; position: relative; transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.chart:not(.in) .bar { width: 0; }
.bar em { position: absolute; left: calc(100% + 6px); top: -1px; font-style: normal; font-size: 12px; font-weight: 600; color: #3a4052; white-space: nowrap; }
.chart-note { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table-wrap.scroll { margin-top: 18px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.rtable caption { caption-side: top; text-align: left; font-size: 13.5px; color: var(--muted); padding: 14px 16px 6px; }
.rtable th, .rtable td { padding: 8px 12px; text-align: center; white-space: nowrap; }
.rtable th { font-size: 13px; color: #3a4052; font-weight: 700; border-bottom: 1px solid var(--line); }
.rtable thead tr:first-child th { border-bottom: 1px solid var(--line); }
.rtable td:first-child, .rtable th:first-child { text-align: left; }
.rtable tbody tr + tr td { border-top: 1px solid #f0f1f6; }
.rtable tr.ours td { background: var(--green-soft); font-weight: 700; color: #134d37; }
.rtable tr.hl td { background: var(--blue-soft); }
.rtable tr.group td { background: #f3f4f8; font-size: 12.5px; font-style: italic; color: var(--muted); padding: 5px 12px; }
.rtable tr.control td { color: var(--muted); font-style: italic; }
.rtable.dense { font-size: 13.5px; }
.rtable.dense th, .rtable.dense td { padding: 7px 9px; }
.rtable.roster td, .rtable.release td { white-space: normal; text-align: left; }
.rtable.roster td:last-child { font-weight: 600; color: var(--green); }

/* Environments */
.homes { display: grid; grid-template-columns: repeat(10, 1fr); gap: 12px; margin-top: 20px; }
.home { text-align: center; }
.home img { border-radius: 10px; border: 1px solid var(--line); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); aspect-ratio: 420 / 909; object-fit: cover; transition: transform .15s; }
.home img:hover { transform: translateY(-2px) scale(1.02); }
.home span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.25; }
.bench { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.bench-item { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-weight: 700; font-size: 15.5px; }
.bench-item .num { font-size: 28px; font-weight: 800; color: var(--blue); min-width: 58px; }
.bench-item small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }

/* Case studies */
.tabs, .subtabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tabs { margin-bottom: 18px; }
.tab, .subtab { border: 1px solid var(--line); background: #fff; color: #33394a; font: inherit; font-size: 14.5px; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: all .12s; }
.tab:hover, .subtab:hover { border-color: var(--blue); color: var(--blue); }
.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.subtab { font-size: 13.5px; padding: 5px 13px; }
.subtab.active { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.subtabs:empty { display: none; }
.case { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px 16px; }
.case-desc { max-width: 900px; margin: 0 auto 14px; font-size: 15px; color: #3a4052; text-align: center; }
.subtabs { margin-bottom: 14px; }
.pager { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; }
.pframe { display: flex; justify-content: center; min-height: 320px; }
.pframe img { max-height: 78vh; width: auto; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); transition: opacity .18s; }
.pframe img.loading { opacity: .35; }
.pbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 28px; line-height: 1; color: #33394a; cursor: pointer; display: grid; place-items: center; padding-bottom: 3px; }
.pbtn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pbtn:disabled { opacity: .3; cursor: default; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #d4d7e3; border: 0; padding: 0; cursor: pointer; }
.dot.active { background: var(--blue); width: 22px; border-radius: 6px; }

/* Source trace: every recorded frame at once */
.strace { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.strace-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfbfe, #fff); }
.strace-frames { list-style: none; margin: 0; padding: 22px 24px 8px; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 22px 12px; }
.sframe { min-width: 0; }
.sframe img { width: 100%; border-radius: 8px; border: 1px solid var(--line); background: #f3f4f8; cursor: zoom-in; transition: transform .15s, box-shadow .15s; }
.sframe img:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 24, 40, .14); }
.sframe.end img { border-color: #9fd3bd; }
.sframe-meta { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; font-size: 12px; line-height: 1.2; }
.sframe-n { font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
.sframe-type { font-weight: 600; color: var(--muted); }
.sframe.end .sframe-type { color: var(--green); }
.sframe-cap { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: #3a4052; overflow-wrap: anywhere; }
.strace-hint { margin: 0; padding: 6px 24px 16px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 1080px) {
  .strace-frames { display: flex; overflow-x: auto; scroll-snap-type: x proximity; gap: 14px; padding: 18px 20px 8px; }
  .sframe { flex: 0 0 136px; scroll-snap-align: start; }
}

/* Trajectory viewer */
.tabs.apps { gap: 6px; margin-bottom: 20px; }
.case-evidence { margin: -4px auto 24px; color: var(--muted); font-size: 14px; }
.verification-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 0 10px; }
.verification-time { color: #5c6481; font-size: 12px; line-height: 1.5; margin: 0 0 8px; }
.goal-zh p { overflow-wrap: anywhere; }
.tab.app { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; }
.tab.app img { width: 22px; height: 48px; object-fit: cover; object-position: top; border-radius: 4px; border: 1px solid var(--line); background: #fff; }
.tab.app.active img { border-color: rgba(255,255,255,.5); }
.traj { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.traj-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfbfe, #fff); }
.traj-kicker { font-size: 13.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-en { margin: 8px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--ink); max-width: 900px; }
.goal-zh { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.goal-zh summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 13px; }
.goal-zh p { margin: 6px 0 0; line-height: 1.6; max-width: 900px; }
.traj-attempts { display: flex; flex-direction: column; gap: 8px; min-width: 210px; }
.traj-attempts[hidden] { display: none; }
.attempt { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13.5px; font-weight: 600; color: #33394a; cursor: pointer; text-align: left; }
.attempt .att-score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; }
.attempt.ok .att-score { background: var(--green-soft); color: var(--green); }
.attempt.ko .att-score { background: #fbe9e9; color: var(--red); }
.attempt.active { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.traj-body { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 0; }
.traj-screen { padding: 20px 20px 16px; border-right: 1px solid var(--line); background: #f6f7fb; display: flex; flex-direction: column; align-items: center; }
.phone { width: 100%; max-width: 330px; border-radius: 26px; padding: 8px; background: #14161f; box-shadow: 0 10px 30px rgba(20, 24, 40, .22), inset 0 0 0 1px rgba(255,255,255,.08); }
.phone img { width: 100%; aspect-ratio: 860 / 1768; object-fit: cover; border-radius: 19px; background: #fff; transition: opacity .15s; cursor: zoom-in; }
.phone img.loading { opacity: .5; }
.traj-nav { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 6px; width: 100%; max-width: 360px; margin-top: 14px; }
.traj-nav .pbtn { width: 36px; height: 36px; font-size: 24px; }
.traj-steps { position: relative; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.traj-steps::-webkit-scrollbar { display: none; }
.stepdot { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #5b6275; font: 700 11.5px var(--font); cursor: pointer; padding: 0; position: relative; transition: all .12s; }
.stepdot.seen { background: #eceef7; }
.stepdot.gain { border-color: #9fd3bd; }
.stepdot.gain::after { content: ""; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); border: 1.5px solid #fff; }
.stepdot.loss::after { content: ""; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 1.5px solid #fff; }
.stepdot.term { border-radius: 50%; }
.stepdot.active { background: var(--blue); color: #fff; border-color: var(--blue); transform: scale(1.08); }
.traj-controls { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 360px; margin-top: 10px; }
.play { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px 6px 12px; font: 600 13.5px var(--font); color: #33394a; cursor: pointer; }
.play:hover { border-color: var(--blue); color: var(--blue); }
.play .i-pause, .play.on .i-play { display: none; }
.play.on .i-pause { display: inline; }
.play .i-play, .play .i-pause { font-size: 11px; }
.traj-pos { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.traj-panel { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.screen-label { margin: 0 0 12px; font-size: 12px; font-weight: 650; color: var(--muted); text-align: center; }
.screen-label span { display: block; font-size: 11px; font-weight: 400; }
.cp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 12px; color: var(--muted); font-size: 11.5px; }
.cp-change { margin-left: auto; font-weight: 800; }
button:focus-visible, summary:focus-visible, a:focus-visible, pre:focus-visible { outline: 3px solid #7377d8; outline-offset: 3px; }
.panel-block { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.panel-block.grow { flex: 1; border-bottom: 0; }
.panel-lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.panel-sub { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12.5px; color: var(--blue); }
.think { font-size: 14px; line-height: 1.6; color: #2b3042; white-space: pre-wrap; max-height: 210px; overflow-y: auto; padding: 12px 14px; background: #f8f9fd; border: 1px solid #edeff6; border-radius: 10px; font-family: var(--font); }
.cps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 4px 18px; }
.cps li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.4; color: #8a90a2; padding: 3px 0; transition: color .2s; }
.cp-dot { flex: none; width: 15px; height: 15px; margin-top: 2px; border-radius: 50%; border: 1.5px solid #cfd3e0; background: #fff; position: relative; transition: all .2s; }
.cps li.hit { color: var(--ink); }
.cps li.hit .cp-dot { background: var(--green); border-color: var(--green); }
.cps li.hit .cp-dot::after { content: ""; position: absolute; left: 4px; top: 1.5px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cps li.new { color: var(--green); font-weight: 600; }
.cps li.new .cp-dot { box-shadow: 0 0 0 4px rgba(30, 122, 87, .18); animation: pop .35s ease-out; }
.cps li.lost { color: var(--red); text-decoration: line-through; }
.cps li.lost .cp-dot { border-color: var(--red); }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }
.reward { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.reward[hidden], .screen-label span[hidden] { display: none; }
.reward-bar { flex: 1; height: 8px; background: #edeff6; border-radius: 999px; overflow: hidden; }
.reward-bar div { height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width .35s cubic-bezier(.2, .7, .2, 1); }
.reward-bar div.done { background: var(--green); }
.reward-bar div.partial { background: var(--red); }
.reward b { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 34px; text-align: right; }
.traj.fail .traj-pos { color: var(--red); }

/* Code */
.code-block { position: relative; background: #151826; border-radius: 12px; margin: 14px 0; }
.code-block pre { margin: 0; padding: 18px 20px; overflow-x: auto; color: #dfe3f5; line-height: 1.55; }
.copy { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.1); color: #dfe3f5; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; padding: 4px 10px; font: 600 12px var(--font); cursor: pointer; }
.copy:hover { background: rgba(255,255,255,.2); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 14.5px; color: var(--muted); }
.footer b { color: var(--ink); }
.footer .small { font-size: 13px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12, 14, 24, .9); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 48px 20px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1600px, 100%); width: auto; height: auto; border-radius: 8px; background: #fff; margin: auto; }
.lb-close { position: fixed; top: 12px; right: 18px; background: none; border: 0; color: #fff; font-size: 38px; line-height: 1; cursor: pointer; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .homes { grid-template-columns: repeat(5, 1fr); }
  .bench { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  body { font-size: 16px; }
  .problem-grid, .two-col, .results-grid, .results-grid.flip { grid-template-columns: 1fr; }
  .side-fig { max-width: 420px; margin: 0 auto; }
  .section { padding: 54px 0; }
  .navlinks a { padding: 6px 7px; font-size: 13.5px; }
  .traj-head { grid-template-columns: 1fr; }
  .traj-attempts { flex-direction: row; flex-wrap: wrap; }
  .traj-body { grid-template-columns: 1fr; }
  .traj-screen { border-right: 0; border-bottom: 1px solid var(--line); }
  .phone { max-width: 280px; }
  .think { max-height: 170px; }
  .vid-toggle { opacity: 1; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .homes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .home { min-width: 0; overflow-wrap: anywhere; }
  .panel-lbl { flex-wrap: wrap; gap: 4px 10px; }
  .panel-sub { flex-shrink: 0; }
  .bench { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 34px 1fr 34px; gap: 4px; }
  .pbtn { width: 34px; height: 34px; font-size: 22px; }
  .brand { display: none; }
  .bar-row { grid-template-columns: 110px 1fr; }
  .bar-row .name { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .bar, .pframe img, .phone img, .sframe img, .stepdot, .cp-dot, .cps li { transition: none; }
  .sframe img:hover { transform: none; }
  .cps li.new .cp-dot { animation: none; }
}
