:root {
  --ink: #1d1d1f;
  --text: #33363b;
  --muted: #6e6e73;
  --line: #e3e6ea;
  --soft: #f5f7fa;
  --accent: #2A5594;       /* COMPASS blue (paper figures) */
  --accent-2: #5F92D3;     /* COMPASS-waypoint */
  --accent-soft: #e8eff9;
  --base: #BC4C3B;         /* base policy (paper figures) */
  --vox: #5FA864;          /* VoxPoser */
  --online: #A8C6EC;       /* online agent */
  --lang: #d9a441;         /* COMPASS-language */
  --col: 880px;
  --wide: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
b { color: var(--ink); font-weight: 600; }
/* The method name as in the paper and the video: Times (TeX Gyre Termes), "C" + "OMPASS" at 0.8 size, #3F78C0. */
@font-face { font-family: Termes; src: url(../fonts/texgyretermes-regular.otf) format("opentype"); font-weight: 100 500; font-display: swap; }
@font-face { font-family: Termes; src: url(../fonts/texgyretermes-bold.otf) format("opentype"); font-weight: 600 900; font-display: swap; }
.sc { font-family: Termes, "Nimbus Roman", "Times New Roman", Times, serif; color: #3F78C0; font-variant: normal; letter-spacing: 0; white-space: nowrap; }
.sc small { font-size: .8em; }
.muted { color: var(--muted); font-weight: 400; }
.m { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .88em; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 64px 16px 28px; }
.title {
  margin: 0;
  font-size: clamp(52px, 9vw, 92px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--accent);
}
.title .sc { font-weight: 700; letter-spacing: 0; }
.subtitle {
  margin: 18px auto 0;
  max-width: 820px;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
}
.authors { margin: 22px auto 4px; max-width: 760px; font-size: 17px; line-height: 1.7; color: var(--ink); }
.authors a, .authors span { white-space: nowrap; margin-left: .55em; }
.authors a { color: var(--accent); }
.authors > :first-child { margin-left: 0; }
.authors sup, .affils sup, .venue sup { font-size: .68em; }
.affils { margin: 0 0 2px; font-size: 15px; color: var(--ink); }
.venue { margin: 0; color: var(--muted); font-size: 15px; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 15px; font-weight: 500;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; background: var(--accent); transform: translateY(-1px); }
.btn[aria-disabled="true"] { background: #8a8d93; cursor: default; }
.btn[aria-disabled="true"]:hover { transform: none; background: #8a8d93; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- videos ---------- */
.demo { max-width: var(--wide); margin: 8px auto 0; padding: 0 16px; }
.video-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #eef1f5;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 40px rgba(20,40,80,.10);
}
.video-frame video { display: block; width: 100%; height: auto; }
.demo .video-frame video { aspect-ratio: 16 / 9; }
.demo .video-frame iframe.yt { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.video-frame.small { box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(20,40,80,.08); }
.video-frame.small video { aspect-ratio: 16 / 9; }
.video-frame.cmp video { aspect-ratio: 1888 / 702; background: #f4f6f9; }
.sound-badge {
  position: absolute; left: 16px; top: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(20,24,30,.78); color: #fff;
  font: 600 14px/1 Inter, system-ui, sans-serif; letter-spacing: .01em;
  pointer-events: none;
  transition: opacity .3s ease;
}
.sound-badge svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bigplay {
  position: absolute; left: 50%; top: 81%; transform: translate(-50%, -50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 0; background: none; cursor: pointer; color: #fff;
  font: 600 15px/1 Inter, system-ui, sans-serif; text-shadow: 0 1px 6px rgba(0,0,0,.45);
  transition: opacity .25s ease, transform .2s ease;
}
.bigplay .ring {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92); box-shadow: 0 6px 28px rgba(0,0,0,.28);
  transition: transform .2s ease, background .2s ease;
}
.bigplay .ring svg { width: 36px; height: 36px; margin-left: 5px; fill: var(--accent); }
.bigplay:hover .ring { transform: scale(1.07); background: #fff; }
.video-frame.playing .bigplay { opacity: 0; pointer-events: none; }
.video-frame.playing .sound-badge { opacity: 0; }

/* ---------- layout ---------- */
.wrap { max-width: var(--col); margin: 0 auto; padding: 0 16px; }
section.wrap { margin-top: 64px; }
h2 {
  margin: 0 0 14px;
  font-size: clamp(25px, 3.2vw, 32px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
h3 { color: var(--ink); }
h3.sub { margin: 40px 0 8px; font-size: 20px; font-weight: 650; }
p { margin: 0 0 14px; }

.tldr { margin-top: 36px !important; }
.tldr p {
  margin: 0;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  border-radius: 0 10px 10px 0;
  font-size: 18px;
}
.hl { color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px !important; }
.stat { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.stat .num { font-size: 30px; font-weight: 750; color: var(--accent); line-height: 1.15; white-space: nowrap; }
.stat .num .from { color: var(--base); font-weight: 600; }
.stat .lbl { margin-top: 6px; font-size: 14px; line-height: 1.4; color: var(--muted); }

/* ---------- figures ---------- */
.fig { margin: 22px 0 6px; }
.fig img { display: block; width: 100%; height: auto; }
figcaption, .caption { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin-top: 10px; }

/* ---------- method ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.step { padding: 18px 18px 6px; border-radius: 12px; background: var(--soft); }
.step h3 { margin: 8px 0 6px; font-size: 18px; line-height: 1.3; }
.step p { font-size: 15px; line-height: 1.55; }
.step-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.step-tag.a { background: #dceafb; color: #2f5f9e; }
.step-tag.b { background: #fbdcd3; color: #a6432c; }
.step-tag.c { background: #ddf1de; color: #3e7e47; }


/* ---------- tasks ---------- */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0 14px; }
.tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff;
  font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.tab .cap { font-size: 12.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.tab .nm { font-size: 16px; font-weight: 600; color: var(--ink); }
.tab:hover { border-color: #b9c6d8; }
.tab.active { border-color: var(--accent); background: var(--accent-soft); }
.tab.active .cap { color: var(--accent); }
.instruction {
  margin: 0 auto 12px; max-width: var(--col); text-align: center;
  font-size: 17px; font-style: italic; color: var(--ink);
}
.instruction::before { content: "Instruction: "; font-style: normal; font-weight: 600; color: var(--muted); font-size: 14px; letter-spacing: .02em; }
.task-info { display: grid; grid-template-columns: 300px 1fr; gap: 26px; max-width: var(--col); margin: 18px auto 0; }
.task-info p { font-size: 16px; }
.score { padding-top: 4px; }
.sc-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14.5px; }
.sc-row .who { font-weight: 600; color: var(--ink); }
.sc-row .bar { height: 10px; border-radius: 6px; background: #edf0f4; overflow: hidden; }
.sc-row .bar i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.sc-row.base .bar i { background: var(--base); }
.sc-row.ours .bar i { background: var(--accent); }
.sc-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.sc-cap { font-size: 13px; color: var(--muted); }

/* ---------- charts ---------- */
.chart-card { margin-top: 20px; padding: 16px 18px 10px; border: 1px solid var(--line); border-radius: 12px; }
.chart-card.flat { margin-top: 8px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #eef1f5; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px;
  font: 500 14px/1 Inter, system-ui, sans-serif; color: var(--muted); cursor: pointer;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--text); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; width: 16px; border-radius: 2px; }
.legend i.dash { height: 0; width: 16px; border-top: 3px dashed #6e6e73; border-radius: 0; background: none !important; }
.legend.small { justify-content: center; margin: 4px 0 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: Inter, system-ui, sans-serif; }
.chart .bar-rect { transition: y .5s cubic-bezier(.2,.8,.2,1), height .5s cubic-bezier(.2,.8,.2,1); }
.chart .val { transition: y .5s cubic-bezier(.2,.8,.2,1); }

.findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.finding { padding: 14px 16px 4px; border-radius: 12px; background: var(--soft); }
.finding h4 { margin: 0 0 6px; font-size: 15.5px; line-height: 1.35; color: var(--ink); }
.finding p { font-size: 14.5px; line-height: 1.55; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 7px 8px; text-align: center; white-space: nowrap; }
.tbl th { font-weight: 600; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.tbl thead tr:first-child th { color: var(--ink); font-size: 14px; }
.tbl td:first-child, .tbl th:first-child { text-align: left; }
.tbl tbody tr { border-bottom: 1px solid #f0f2f5; }
.tbl tr.ours td { font-weight: 650; color: var(--accent); background: var(--accent-soft); }
.tbl.agents td .sr { display: inline-flex; align-items: center; gap: 8px; }
.tbl.agents td .sr i { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent-2); }
.tbl.agents tr.online td { color: var(--muted); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.chart-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 2px 0 2px 6px; }

.two.tight { gap: 10px; }
.stack { display: grid; gap: 16px; }
.center { text-align: center; }
.lede { font-size: 18px; color: var(--muted); margin-bottom: 0; }

/* ---------- bibtex ---------- */
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 18px 20px;
  background: var(--soft); border-radius: 12px;
  font: 13.5px/1.6 "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink); overflow-x: auto;
}
.copy {
  position: absolute; right: 10px; top: 10px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 4px 10px; font: 500 13px/1.4 Inter, sans-serif; color: var(--muted); cursor: pointer;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }

.footer { margin-top: 56px; padding-top: 18px; padding-bottom: 48px; border-top: 1px solid var(--line); }
.footer p { font-size: 13.5px; color: var(--muted); text-align: center; }

/* ---------- side TOC (wide screens) ---------- */
.toc { position: fixed; left: 24px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 4px; z-index: 5; }
.toc a { font-size: 13px; color: #9a9da3; padding: 2px 0 2px 12px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
@media (min-width: 1440px) { .toc { display: flex; } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding-top: 44px; }
  .br-wide { display: none; }
  .stats, .steps, .findings, .two { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: 1fr 1fr; }
  .task-info { grid-template-columns: 1fr; gap: 6px; }
  .stat .num { font-size: 26px; }
  .sound-badge { left: 10px; top: 10px; padding: 5px 10px; font-size: 12px; }
  .bigplay { top: 80%; }
  .bigplay .ring { width: 48px; height: 48px; }
  .bigplay .ring svg { width: 22px; height: 22px; margin-left: 3px; }
  .bigplay .txt { display: none; }
}

/* ---------- interactive lab ---------- */
.lab-wrap { margin-top: 72px; padding: 56px 0 20px; background: linear-gradient(180deg, #f6f8fb 0%, #fff 100%); }
.lab { max-width: var(--wide); margin: 22px auto 0; padding: 0 16px; }
.lab-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.lab-ctrl { display: flex; flex-wrap: wrap; gap: 6px; }
.ctl {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 14px; font: 500 14px/1.2 Inter, system-ui, sans-serif; color: var(--ink); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.ctl:hover { border-color: var(--accent); color: var(--accent); }
.ctl.on, #lab-play { background: var(--ink); color: #fff; border-color: var(--ink); min-width: 74px; }
#lab-play:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.lab-body { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
.lab-stage { position: relative; }
.lab-stage canvas {
  display: block; width: 100%; border-radius: 14px; touch-action: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 32px rgba(20,40,80,.10); background: #f7f8fa;
}
.lab.dragging canvas { cursor: grabbing !important; }
.lab-toast {
  position: absolute; left: 50%; top: 18px; transform: translate(-50%, -8px); opacity: 0;
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 15px; color: #fff;
  transition: opacity .3s, transform .3s; pointer-events: none; white-space: nowrap;
}
.lab-toast.show { opacity: 1; transform: translate(-50%, 0); }
.lab-toast.ok { background: #2f8a4a; }
.lab-toast.bad { background: var(--base); }
.lab-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.lab-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lab-legend .ln { width: 20px; height: 0; border-top: 2.5px solid; }
.lab-legend .ln.pol { border-color: #c8553a; }
.lab-legend .ln.rej { border-color: #c8553a; border-top-style: dashed; }
.lab-legend .ln.cor { border-color: #2f6fd0; }
.lab-legend .ws { width: 13px; height: 13px; border-radius: 50%; border: 1.5px dashed #2f6fd0; }
.lab-legend .bp { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle, rgba(226,69,43,.6), rgba(226,69,43,.08)); }
.lab-legend .nb { width: 15px; height: 15px; border-radius: 50%; background: #2f6fd0; color: #fff; font: 700 10px/15px Inter, sans-serif; text-align: center; font-style: normal; }

.lab-side { display: grid; gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; background: #fff; transition: border-color .25s, box-shadow .25s; }
.card-h { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.card-h .katex { text-transform: none; letter-spacing: 0; font-size: 1.05em; color: var(--ink); }
.eqrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 15px; }
.eqrow .katex { font-size: 1.05em; margin-right: 2px; }
.term {
  border: 0; padding: 3px 8px; border-radius: 7px; font: 600 12.5px/1.3 Inter, sans-serif; cursor: pointer;
  transition: opacity .2s, transform .2s, box-shadow .2s;
}
.term[data-lock] { cursor: default; }
.term.off { opacity: .35; text-decoration: line-through; }
.term.pulse { animation: pulse 0.9s ease; box-shadow: 0 0 0 2px currentColor; }
@keyframes pulse { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: 14px; transition: background .25s; }
.row .f { font-size: 13.5px; white-space: nowrap; }
.row .v { font: 500 13px/1.2 "JetBrains Mono", monospace; color: var(--ink); white-space: nowrap; }
.row.ok { background: #e8f5ea; } .row.ok .v::after { content: " \2713"; color: #2f8a4a; font-weight: 700; }
.row.bad { background: #fbe6e1; } .row.bad .v::after { content: " \2717"; color: var(--base); font-weight: 700; }
#check-card.pass { border-color: #9fd3aa; }
#check-card.fail { border-color: #eeb0a3; box-shadow: 0 0 0 3px rgba(200,85,58,.08); }
.decision { margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; background: var(--soft); color: var(--muted); transition: background .25s, color .25s; }
.decision.keep { background: #e8f5ea; color: #2f7a43; }
.decision.reject { background: #fbe6e1; color: #a6432c; }
.decision.contact { background: #e8eff9; color: var(--accent); }
.decision.exec { background: #f6ece4; color: #8a5a2c; }
#corr-card { opacity: .55; }
#corr-card.active { opacity: 1; border-color: #a9c4ef; box-shadow: 0 0 0 3px rgba(47,111,208,.08); }
.pbar { height: 6px; border-radius: 4px; background: #edf0f4; overflow: hidden; margin-top: 6px; }
.pbar i { display: block; height: 100%; width: 0; background: #2f6fd0; border-radius: 4px; }
.stages { display: flex; gap: 8px; }
.stg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); transition: all .3s; }
.stg b { width: 20px; height: 20px; border-radius: 50%; background: var(--pc); border: 1.5px solid var(--pd); color: #1d1d1f; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.stg em { font-style: normal; font-weight: 600; }
.stg.cur { border-color: #2f6fd0; background: #e8eff9; color: #2f6fd0; }
.stg.done { background: #e8f5ea; border-color: #9fd3aa; color: #2f7a43; }
.ledger { margin-top: 8px; font: 12.5px/1.5 "JetBrains Mono", monospace; color: var(--muted); }
.ledger .ev { color: #2f7a43; font-weight: 500; }
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; font-size: 12px; color: var(--muted); }
.counters span { padding: 6px 2px; border-radius: 10px; background: var(--soft); line-height: 1.25; }
.counters b { display: block; font-size: 18px; color: var(--ink); }
.counters span:last-child b { color: var(--accent); }
.lab.is-base #corr-card, .lab.is-base .eqcard { opacity: .4; }
@media (max-width: 960px) {
  .lab-body { grid-template-columns: 1fr; }
  .lab-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .lab-side { grid-template-columns: 1fr; }
  .lab-bar { flex-direction: column; align-items: stretch; }
  .lab-bar .seg { align-self: center; }
  .lab-ctrl { justify-content: center; }
}

/* ---------- chapter player (On the real robot) ---------- */

/* ---------- lab: real scene additions ---------- */
.lab-stage { position: relative; }
.lab-status {
  position: absolute; left: 12px; top: 12px; z-index: 2; padding: 5px 11px; border-radius: 999px;
  font: 600 12.5px/1.2 Inter, sans-serif; color: #fff; background: rgba(42,84,147,.92);
}
.lab-status.setup { background: rgba(200,85,58,.92); }
.lab-status.compiling { background: rgba(217,164,65,.95); color: #1d1d1f; }
.lab-status.base { background: rgba(20,24,30,.75); }
.lab-toast { top: 14px; bottom: auto; left: auto; right: 14px; transform: translateY(-8px); }
.lab-toast.show { transform: translateY(0); }
.lab-toast.info { background: rgba(20,24,30,.82); }
.ctl.compile { background: #fff; }
.ctl.compile:disabled { opacity: .45; cursor: default; }
.ctl.compile:disabled:hover { border-color: var(--line); color: var(--ink); }
.ctl.compile.hot { background: var(--base); border-color: var(--base); color: #fff; animation: hot 1.4s ease-in-out infinite; }
@keyframes hot { 0%, 100% { box-shadow: 0 0 0 0 rgba(200,85,58,.45); } 50% { box-shadow: 0 0 0 7px rgba(200,85,58,0); } }
.ctl:disabled { opacity: .45; cursor: default; }
.ctl.autoplay { background: var(--accent); color: #fff; border-color: var(--accent); min-width: 104px; }
.ctl.autoplay:hover { filter: brightness(1.1); color: #fff; }
.ctl.autoplay.on { background: var(--ink); border-color: var(--ink); }
.comp-steps { margin: 2px 0 6px; padding: 0; list-style: none; counter-reset: cs; display: grid; gap: 3px; }
.comp-steps li { counter-increment: cs; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); padding: 2px 6px; border-radius: 7px; transition: background .25s, color .25s; }
.comp-steps li::before { content: counter(cs); width: 18px; height: 18px; border-radius: 50%; background: #eef1f5; color: var(--muted); font: 700 11px/18px Inter, sans-serif; text-align: center; flex: none; }
.comp-steps li.cur { background: #fff4d6; }
.comp-steps li.cur::before { background: #d9a441; color: #fff; }
.comp-steps li.done::before { content: "\2713"; background: #2f8a4a; color: #fff; }
.comp-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.lab.is-base #comp-card { opacity: .4; }
.lab.needs-compile #comp-card { border-color: #eeb0a3; box-shadow: 0 0 0 3px rgba(200,85,58,.08); }
.stg img { width: 22px; height: 22px; object-fit: contain; }
.stg { padding: 3px 9px 3px 5px; }
.stack > *, .two > * { min-width: 0; }
.lab-legend .fd { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle, #eafff1 0 25%, rgba(57,255,136,.8) 45%, rgba(57,255,136,0) 72%); }
.lab-toast { white-space: normal; max-width: 70%; text-align: right; }

/* ---------- try it yourself: draw a chunk ---------- */
.p2d { max-width: var(--wide); margin: 20px auto 0; padding: 0 16px; }
.p2d-stage { display: flex; gap: 10px; align-items: stretch; }
.p2d-cw { position: relative; flex: 1; min-width: 0; }
.p2d-key { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; font-size: 12px; color: var(--muted); padding: 4px 0; min-width: 52px; }
.p2d-key .kt { font-weight: 700; color: var(--ink); line-height: 1.1; }
.p2d-key .kt i { font-family: KaTeX_Math, "Times New Roman", serif; font-size: 15px; font-weight: 400; }
.p2d-key .kt sub { font-family: KaTeX_Math, "Times New Roman", serif; font-style: italic; font-size: 10px; }
.p2d-key .kh { font-weight: 600; color: #a6432c; margin-top: 8px; }
.p2d-key .kl { font-weight: 600; color: var(--accent); line-height: 1.2; }
.p2d-key .kbar { position: relative; flex: 1; width: 14px; min-height: 80px; margin: 4px 0; border-radius: 3px; border: 1px solid rgba(40,44,52,.25); }
.p2d-key .kbar span { position: absolute; left: 20px; transform: translateY(-50%); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p2d-key .kbar span::before { content: ""; position: absolute; left: -6px; top: 50%; width: 4px; border-top: 1px solid rgba(40,44,52,.5); }
.p2d.nofield .p2d-key { opacity: .3; }
@media (max-width: 640px) { .p2d-stage { gap: 6px; } .p2d-key { font-size: 10px; min-width: 40px; } .p2d-key .kbar span { font-size: 9px; left: 17px; } }
.p2d-top { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 8px; }
.p2d canvas { display: block; width: 100%; border-radius: 14px; touch-action: none; cursor: crosshair;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 32px rgba(20,40,80,.10); }
.p2d-hint { position: absolute; left: 14px; top: 12px; padding: 5px 12px; border-radius: 999px; background: rgba(20,24,30,.72);
  color: #fff; font: 500 13px/1.3 Inter, sans-serif; pointer-events: none; }
.p2d-bar { display: grid; grid-template-columns: 1.2fr 1.3fr 1fr; gap: 14px; margin-top: 14px; align-items: stretch; }
.p2d-verdict { padding: 12px 14px; border-radius: 12px; background: var(--soft); color: var(--muted); font-weight: 600; font-size: 15px; line-height: 1.4; display: flex; align-items: center; transition: background .25s, color .25s; }
.p2d-verdict.ok { background: #e8f5ea; color: #2f7a43; }
.p2d-verdict.bad { background: #fbe6e1; color: #a6432c; }
.p2d-verdict.contact { background: #e8eff9; color: var(--accent); }
.p2d-checks { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; gap: 4px; align-content: center; }
.p2d-ctrl { display: grid; gap: 8px; align-content: center; }
.p2d-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.p2d .stages { display: flex; gap: 6px; flex-wrap: wrap; }
.p2d-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.p2d-legend span { display: inline-flex; align-items: center; gap: 6px; }
.p2d-legend .lg-goal { width: 14px; height: 14px; border-radius: 50%; border: 1.5px dashed #2f6fd0; background: rgba(47,111,208,.2); }
.p2d-legend .lg-bad { width: 16px; height: 11px; border-radius: 3px; border: 1.3px solid rgba(200,85,58,.6); background: rgba(200,85,58,.15); }
.p2d-legend .ln { width: 20px; height: 0; border-top: 2.5px solid; }
.p2d-legend .ln.ok { border-color: #2f8a4a; }
.p2d-legend .ln.rej { border-color: #c8553a; border-top-style: dashed; }
.p2d-legend .ln.cor { border-color: #2f6fd0; }
.p2d.nofield .p2d-checks { opacity: .4; }
.p2d-gloss { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 0; }
.p2d-gloss > div { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.p2d-gloss dt { font-size: 18px; flex: none; min-width: 26px; }
.p2d-gloss dd { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.p2d-gloss dd b { color: var(--ink, #1d1d1f); font-weight: 600; }
.p2d-rule { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.p2d-rule b.ok { color: #2f8a4a; } .p2d-rule b.cor { color: #2f6fd0; }
@media (max-width: 760px) { .p2d-gloss { grid-template-columns: 1fr; } }
.p2d-tip { position: absolute; z-index: 3; min-width: 150px; padding: 7px 10px; border-radius: 10px; pointer-events: none;
  background: rgba(255,255,255,.94); box-shadow: 0 4px 16px rgba(20,40,80,.16); font: 12.5px/1.45 Inter, sans-serif; color: var(--ink, #1d1d1f); }
.p2d-tip[hidden] { display: none; }
.p2d-tip div { display: flex; gap: 6px; align-items: baseline; }
.p2d-tip i { font-family: KaTeX_Math, "Times New Roman", serif; font-size: 14px; }
.p2d-tip sub { font-size: 9px; margin-left: -4px; }
.p2d-tip label { font-weight: 400; }
.p2d-tip span { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.p2d-tip div.ok span { color: #2f8a4a; } .p2d-tip div.bad span { color: #c8553a; }
.p2d-tip em { display: block; font-style: normal; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.p2d-tip em.ws { color: #2f6fd0; } .p2d-tip em.bad { color: #c8553a; }
.p2d-tip b { display: block; } .p2d-tip > span { margin: 0; padding: 0; font-weight: 400; color: var(--muted); }
@media (max-width: 900px) { .p2d-bar { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .p2d-top .ctl { font-size: 11px; padding: 4px 9px; min-width: 0; } .p2d-hint { font-size: 11px; padding: 3px 9px; left: 8px; top: 8px; max-width: 70%; } }

/* ---------- one width for every unit ----------
   Every section uses the wide column (--wide), the same as the demo video and the puzzle, so headings, videos,
   figures, interactive panels, charts, cards, tables, prose and BibTeX share one centered column. */
.wrap { max-width: var(--wide); }
.task-info { max-width: none; }
/* the abstract is read, not scanned: a narrower centered column */
section.wrap#abstract { max-width: 880px; }

/* ---------- contributions and experiment questions ---------- */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.ccard { padding: 18px 18px 8px; border-radius: 12px; background: var(--soft); }
.ccard .cnum { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.ccard h3 { margin: 10px 0 6px; font-size: 18px; line-height: 1.3; }
.ccard p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.ccard p b { color: var(--accent); }
h3.sub .q { display: inline-block; margin-right: 10px; padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8em; vertical-align: 2px; }
.caps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.capc { padding: 14px 16px 6px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.capc .cap { font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--accent); }
.capc .nm { font-size: 16px; font-weight: 600; }
.capc .jump { margin: 8px 0 4px; font-size: 30px; font-weight: 750; line-height: 1.1; white-space: nowrap; }
.capc .jump .from { color: var(--base); } .capc .jump .to { color: var(--accent); } .capc .jump small { font-size: 15px; font-weight: 600; color: var(--muted); }
.capc p { font-size: 14px; line-height: 1.45; color: var(--muted); }
.capnote { margin-top: 8px; font-size: 13px; color: var(--muted); }
.findings { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; }
.findings.one { grid-template-columns: 1fr !important; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pair .finding { margin: 0; }
@media (max-width: 900px) { .caps { grid-template-columns: 1fr 1fr; } .cards3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .caps, .pair { grid-template-columns: 1fr; } }

.contribs { list-style: none; counter-reset: c; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.contribs li { counter-increment: c; display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start;
  padding: 16px 20px; border-radius: 12px; background: var(--soft); }
.contribs li::before { content: counter(c); display: grid; place-items: center; width: 28px; height: 28px; margin-top: 1px;
  border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.contribs p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.contribs p b { color: var(--ink, #1d1d1f); font-weight: 600; }
/* method steps: one row per step (label column + sentence) */
.steps { grid-template-columns: 1fr !important; gap: 10px !important; }
.step { display: grid; grid-template-columns: 210px 1fr; gap: 4px 20px; align-items: start; padding: 16px 20px !important; }
.step .step-tag { justify-self: start; grid-column: 1; }
.step h3 { grid-column: 1; margin: 6px 0 0 !important; }
.step p { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 16px !important; line-height: 1.6; align-self: center; }
@media (max-width: 640px) { .step { grid-template-columns: 1fr; } .step p { grid-column: 1; grid-row: auto; margin-top: 6px; } }

/* ---------- rollouts ---------- */
.ro-task { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.ro-task:first-of-type { border-top: 0; padding-top: 0; }
.ro-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ro-head h3 { margin: 0; font-size: 22px; display: flex; flex-direction: column; gap: 2px; }
.ro-head h3 .cap { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.ro-btns { display: flex; gap: 6px; }
.ro-btns .ctl.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.ro-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 12px; }
.ro-prompt { grid-column: 1 / -1; margin: 0; font-size: 15.5px; font-style: italic; color: var(--ink, #1d1d1f); }
.ro-prompt span { font-style: normal; font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: 10px; }
.ro-cell { margin: 0; }
.ro-vid { position: relative; border-radius: 10px; overflow: hidden; background: #e9edf2; aspect-ratio: 16 / 9; }
.ro-vid video { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.ro-time { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(20,24,30,.78); color: #fff;
  font: 600 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; pointer-events: none; }
.ro-rt { position: absolute; right: 10px; top: 8px; color: #fff; font-size: 12.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none; }
.ro-cell.base .ro-time { background: rgba(188,76,59,.9); } .ro-cell.ours .ro-time { background: rgba(42,85,148,.92); }
.ro-vid.done::after { content: "Ended"; position: absolute; right: 10px; bottom: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.85); font-size: 12px; font-weight: 600; color: var(--muted); }
.ro-cell figcaption { text-align: center; font-size: 14.5px; font-weight: 600; margin-top: 4px; }
.ro-cell.base figcaption { color: var(--base); } .ro-cell.ours figcaption { color: var(--accent); }
@media (max-width: 560px) { .ro-row { grid-template-columns: 1fr; } .ro-head h3 { font-size: 19px; } }

/* legends: keep the method name in one inline run (the legend's flex rule must not reach inside it) */
.legend .lgn { font-style: normal; display: inline; }
.legend .lgn span.sc { display: inline; gap: 0; padding: 0; }

/* rollouts: speed buttons and draggable progress */
.ro-btns { flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.ro-speed button { min-width: 38px; padding-left: 8px; padding-right: 8px; font-variant-numeric: tabular-nums; }
.ro-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; cursor: pointer; touch-action: none; }
.ro-bar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.45); transition: height .12s; }
.ro-fill { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; transition: height .12s; }
.ro-cell.base .ro-fill { background: var(--base); } .ro-cell.ours .ro-fill { background: var(--accent); }
.ro-knob { position: absolute; bottom: -3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); opacity: 0; transition: opacity .12s; left: 0; }
.ro-vid:hover .ro-bar::before, .ro-bar.drag::before, .ro-vid:hover .ro-fill, .ro-bar.drag .ro-fill { height: 6px; }
.ro-vid:hover .ro-knob, .ro-bar.drag .ro-knob, .ro-bar:focus-visible .ro-knob { opacity: 1; }
.ro-vid.done::after { bottom: 16px; }
@media (hover: none) { .ro-knob { opacity: 1; } .ro-bar::before, .ro-fill { height: 6px; } }
@media (max-width: 640px) { .ro-head { flex-direction: column; align-items: flex-start; } .ro-btns { justify-content: flex-start; } }

/* a base clip stops at its first error: show the reason */
.ro-vid[data-fail].done::after { content: "✗ " attr(data-fail); left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%);
  padding: 6px 14px; border-radius: 999px; background: rgba(188,76,59,.94); color: #fff; font-size: 15px; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.ro-vid[data-fail].done video { filter: saturate(.6) brightness(.85); }
@media (max-width: 560px) { .ro-vid[data-fail].done::after { font-size: 13px; } }

/* experiment findings: one row each (key column + paper sentence) */
.rows { display: grid; gap: 10px; margin-top: 16px; }
.rrow { display: grid; grid-template-columns: 300px 1fr; gap: 6px 24px; align-items: center; padding: 16px 20px; border-radius: 12px; background: var(--soft); }
.rkey h4 { margin: 2px 0 0; font-size: 16px; line-height: 1.35; color: var(--ink, #1d1d1f); }
.rtag { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.rtag .sc { text-transform: none; font-size: 1.15em; letter-spacing: 0; }
.rmetric { margin-top: 6px; font-size: 26px; font-weight: 750; line-height: 1.1; color: var(--accent); white-space: nowrap; }
.rmetric .from { color: var(--base); } .rmetric .to { color: var(--accent); } .rmetric small { font-size: 14px; font-weight: 600; color: var(--muted); }
.rrow p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--muted); }
@media (max-width: 760px) { .rrow { grid-template-columns: 1fr; } }

/* try it: three steps + the formulas folded away */
.p2d-how { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: h; display: grid; gap: 6px; }
.p2d-how li { counter-increment: h; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: baseline; font-size: 16px; line-height: 1.55; color: var(--muted); }
.p2d-how li::before { content: counter(h); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e08a1e; color: #fff; font-size: 13px; font-weight: 700; }
.p2d-how b { color: var(--ink, #1d1d1f); } .p2d-how b.ok { color: #2f8a4a; } .p2d-how b.bad { color: #c8553a; } .p2d-how b.cor { color: #2f6fd0; }
.p2d-more { margin-top: 10px; font-size: 14.5px; color: var(--muted); }
.p2d-more summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.p2d-more p { margin: 8px 0 0; line-height: 1.6; }
.p2d-how li { display: block; position: relative; padding-left: 36px; }
.p2d-how li::before { position: absolute; left: 0; top: 1px; }

/* ---------- rollouts: synchronized close-up inset (earphone, puzzle); click to enlarge / shrink ---------- */
.ro-pip { position: absolute; right: 8px; top: 32px; width: 36%; aspect-ratio: 16 / 9; z-index: 2; overflow: hidden;
  border: 2px solid rgba(255,255,255,.92); border-radius: 8px; box-shadow: 0 3px 12px rgba(0,0,0,.3); background: #dfe4ea;
  cursor: zoom-in; transition: top .25s ease, right .25s ease, width .25s ease, height .25s ease, border-radius .25s ease, border-width .25s ease; }
.ro-pip video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ro-pip i { position: absolute; left: 5px; bottom: 4px; padding: 0 6px; border-radius: 999px; background: rgba(20,24,30,.7); color: #fff;
  font: 600 10.5px/16px Inter, sans-serif; font-style: normal; pointer-events: none; }
.ro-pip:hover { box-shadow: 0 4px 16px rgba(0,0,0,.42); }
.ro-pip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ro-vid.big .ro-pip { top: 0; right: 0; width: 100%; height: 100%; aspect-ratio: auto; border-width: 0; border-radius: 0; cursor: zoom-out; }
.ro-vid.big .ro-pip i::after { content: " · click to shrink"; font-weight: 500; }
.ro-time, .ro-rt, .ro-bar { z-index: 3; }
.ro-vid.done::after { z-index: 4; }
@media (max-width: 560px) { .ro-pip { width: 40%; top: 30px; } }
/* speed label bottom-left (above the progress bar), close-up inset in the top-right corner */
.ro-rt { right: auto; left: 10px; top: auto; bottom: 12px; }
.ro-pip { top: 8px; }
@media (max-width: 560px) { .ro-pip { top: 8px; } }
.ro-vid.big .ro-pip i { left: auto; right: 8px; bottom: 14px; }

/* ---------- real-robot deployment suite callout ---------- */
.suite-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid #d4dfee;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: linear-gradient(135deg, #f5f8fd 0%, #f8f9fb 100%);
}
.suite-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.suite-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
}
.suite-card p {
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
}
.suite-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.suite-tags span {
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.suite-cta {
  background: var(--accent);
  white-space: nowrap;
}
.suite-cta:hover {
  background: var(--ink);
}
@media (max-width: 760px) {
  .suite-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .suite-cta {
    justify-self: start;
  }
}
