[hidden] { display: none !important; }
:root {
  --fg: #1f2933; --muted: #5b6776; --line: #e2e7ee; --bg: #ffffff; --soft: #f6f8fb;
  --accent: #2563eb; --accent-soft: #e8efff; --max: 1100px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--bg); line-height: 1.6; }
a { color: var(--accent); }
img, video { max-width: 100%; display: block; }

.hero { max-width: var(--max); margin: 0 auto; padding: 48px 20px 8px; text-align: center; }
.hero h1 { font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.25; margin: 0 0 14px; font-weight: 700; }
.hero h1 .name { color: var(--accent); }
.authors { color: var(--muted); margin: 0 0 18px; }
.links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.btn { display: inline-block; padding: 8px 18px; border-radius: 999px; background: #1f2933; color: #fff;
  text-decoration: none; font-size: 0.95rem; }
.btn:hover { background: #374151; }
.btn.disabled { background: #cbd2db; color: #4b5563; cursor: default; }
.hero-video video { width: 100%; border-radius: 10px; background: #000; }
figure { margin: 22px 0; }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 8px; text-align: left; }

main { max-width: var(--max); margin: 0 auto; padding: 0 20px 40px; }
section { padding-top: 36px; }
h2 { font-size: 1.6rem; margin: 0 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
h3 { margin: 0 0 6px; font-size: 1.05rem; }
.lead { margin-top: 0; }
.small, .note { color: var(--muted); font-size: 0.88rem; }
#abstract p { text-align: justify; }

/* ------------------------------------------------------------------ demo */
.demo { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto auto; gap: 0 16px; }
.demo-stage { position: relative; grid-column: 1; grid-row: 1; height: min(62vh, 560px); min-height: 360px;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
#demo-view { position: absolute; inset: 0; }
#demo-view canvas { display: block; }
.demo-now { position: absolute; top: 12px; left: 12px; right: 12px; max-width: 560px; background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; pointer-events: none; }
.demo-now .tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
#demo-now { font-size: 1.05rem; font-weight: 600; }
.demo-now.flash { animation: flash 0.9s ease-out; }
@keyframes flash { from { background: #fff3c4; } to { background: rgba(255, 255, 255, 0.9); } }
.demo-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(241, 244, 248, 0.85); color: var(--muted); }
.demo-loading[hidden] { display: none; }
.demo-legend { position: absolute; bottom: 8px; left: 12px; font-size: 0.78rem; color: var(--muted);
  background: rgba(255, 255, 255, 0.8); padding: 2px 8px; border-radius: 6px; pointer-events: none; }
.avatar-credit { position: absolute; top: 10px; right: 12px; max-width: 36%; font-size: 0.72rem; color: var(--muted);
  background: rgba(255, 255, 255, 0.8); padding: 2px 8px; border-radius: 6px; pointer-events: none; text-align: right; }
.avatar-credit[hidden] { display: none; }
select.mini { font-size: 0.78rem; padding: 0 2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px 0 8px; vertical-align: middle; }
.dot.l { background: #3b82f6; } .dot.r { background: #f97316; } .dot.c { background: #16a34a; }

.demo-controls { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; font-size: 0.9rem; }
.demo-controls label { color: var(--muted); white-space: nowrap; }
button { font: inherit; padding: 5px 14px; border-radius: 6px; border: 1px solid #1f2933; background: #1f2933;
  color: #fff; cursor: pointer; }
button.secondary { background: #fff; color: var(--fg); border-color: #c9d1dc; }
.demo-bar { position: relative; flex: 1 1 220px; height: 22px; background: var(--soft); border: 1px solid var(--line);
  border-radius: 5px; cursor: pointer; overflow: hidden; touch-action: none; }
#demo-segs .seg { position: absolute; top: 0; bottom: 0; border-right: 1px solid #fff; }
#demo-segs .seg.auto { background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 4px, #e2e7ee 4px, #e2e7ee 8px); }
#demo-fill { position: absolute; top: 0; bottom: 0; left: 0; border-right: 2px solid #1f2933; background: rgba(31, 41, 51, 0.12); }
.demo-time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 92px; }

.demo-side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; min-height: 0;
  max-height: calc(min(62vh, 560px) + 56px); }
.demo-sessions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.demo-sessions button { display: inline-flex; gap: 8px; align-items: baseline; background: #fff; color: var(--fg);
  border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; font-size: 0.88rem; }
.demo-sessions button .len { color: var(--muted); font-size: 0.78rem; }
.demo-sessions button.active { background: var(--accent-soft); border-color: var(--accent); }
.demo-info { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow: auto; min-height: 120px; flex: 1; }
.demo-info p { margin: 0 0 8px; font-size: 0.88rem; color: var(--muted); }
#demo-prompts { list-style: none; padding: 0; margin: 0 0 6px; font-size: 0.88rem; }
#demo-prompts li { display: flex; gap: 8px; padding: 4px 6px; border-radius: 5px; cursor: pointer; }
#demo-prompts li:hover { background: var(--soft); }
#demo-prompts li .t { color: var(--muted); min-width: 44px; font-variant-numeric: tabular-nums; }
#demo-prompts li.done { color: var(--muted); }
#demo-prompts li.active { background: #fff3c4; color: var(--fg); font-weight: 600; }

@media (max-width: 860px) {
  .demo { grid-template-columns: 1fr; }
  .demo-side { grid-column: 1; grid-row: 3; max-height: 320px; }
  .demo-stage { height: 60vh; }
}

/* ------------------------------------------------------------------ robot, method, results */
#robot-video { width: 100%; border-radius: 10px; background: #000; }
.chapters { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.chapters button { background: #fff; color: var(--fg); border-color: var(--line); font-size: 0.85rem; padding: 4px 10px; }
.chapters button:hover { background: var(--soft); }
.chapters button.active { background: var(--accent-soft); border-color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.card { background: var(--soft); border-radius: 10px; padding: 14px 16px; }
.card p { margin: 0; font-size: 0.93rem; }
.results { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 24px; align-items: center; }
.results ul { margin: 0; padding-left: 20px; }
.results li { margin-bottom: 8px; }
@media (max-width: 700px) { .results { grid-template-columns: 1fr; } }
pre { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-x: auto; font-size: 0.85rem; }
footer { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 24px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ live demo page */
body.live { display: flex; flex-direction: column; min-height: 100vh; }
.live-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.live-head h1 { font-size: 1.2rem; margin: 0; }
.live-head .back { text-decoration: none; font-size: 0.9rem; }
.status { font-size: 0.85rem; padding: 2px 10px; border-radius: 999px; }
.status.on { background: #dcfce7; color: #166534; } .status.wait { background: #fef9c3; color: #854d0e; }
.status.off { background: #fee2e2; color: #991b1b; }
.live-main { flex: 1; width: 100%; max-width: none; margin: 0; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; padding: 16px 20px; min-height: 0; }
.live-stage { position: relative; min-height: 420px; height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
#live-view { position: absolute; inset: 0; }
.live-stage .demo-legend { pointer-events: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.live-stage .demo-legend label { margin-left: 10px; }
button.mini { padding: 1px 8px; font-size: 0.78rem; margin-left: 6px; }
.toast { position: absolute; top: 80px; left: 50%; transform: translateX(-50%); background: #1f2933; color: #fff;
  padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; max-width: 80%; }
.toast.hidden { display: none; }
.live-side { display: flex; flex-direction: column; gap: 12px; overflow: auto; max-height: calc(100vh - 150px); }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.box .row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.box input:not([type]), .box input[type=text] { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid #c9d1dc; border-radius: 6px; font: inherit; }
.box input[type=range] { flex: 1; }
.box textarea { width: 100%; padding: 8px; border: 1px solid #c9d1dc; border-radius: 6px; font: inherit; resize: vertical; }
.operator { font-weight: 600; }
#live-compose.locked { opacity: 0.6; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.chip { background: #fff; color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; }
.box .title { font-weight: 600; margin-bottom: 6px; }
#live-history { list-style: none; padding: 0; margin: 0; font-size: 0.86rem; }
#live-history li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
#live-history .who { color: var(--muted); margin-right: 6px; font-size: 0.78rem; }
@media (max-width: 860px) {
  .live-main { grid-template-columns: 1fr; }
  .live-stage { height: 55vh; }
  .live-side { max-height: none; }
}
.btn.live-btn { background: #16a34a; }
.btn.live-btn:hover { background: #15803d; }

/* ------------------------------------------------------------------ ExecHMR additions */
.hero h1 .name { color: #7c3aed; }
.btn.live-btn { background: #7c3aed; }
.btn.live-btn:hover { background: #6d28d9; }
.teaser { display: grid; grid-template-columns: 90px repeat(5, minmax(0, 1fr)); gap: 4px; align-items: center; }
.teaser .lab { font-size: 0.8rem; color: var(--muted); text-align: right; padding-right: 6px; line-height: 1.25; }
.teaser img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; background: var(--soft); }
.teaser .lab.ours { color: #7c3aed; font-weight: 600; }
.teaser .lab.base { color: #b91c1c; }
.realgrid { display: grid; grid-template-columns: 70px repeat(7, minmax(0, 1fr)); gap: 3px; align-items: center; margin-top: 8px; }
.realgrid .lab { font-size: 0.75rem; color: var(--muted); text-align: right; padding-right: 4px; }
.realgrid img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; }
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0 16px; }
.numbers .n { background: var(--soft); border-radius: 10px; padding: 12px 14px; }
.numbers .n b { display: block; font-size: 1.6rem; color: #7c3aed; line-height: 1.2; }
.numbers .n span { font-size: 0.86rem; color: var(--muted); }
table.res { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin: 8px 0; }
table.res th, table.res td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: right; }
table.res th:first-child, table.res td:first-child { text-align: left; }
table.res tr.ours td { font-weight: 700; color: #6d28d9; }
.cta { display: flex; gap: 18px; align-items: center; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 12px; padding: 14px 18px; }
.cta p { margin: 0; }

.live-left { display: flex; flex-direction: column; min-width: 0; }
.result-stage { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); gap: 10px; height: calc(100vh - 210px); min-height: 380px; }
.result-video, .result-3d { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0b0f14; }
.result-3d { background: #f1f4f8; }
.result-video video { width: 100%; height: 100%; object-fit: contain; }
.result-3d #live-view { position: absolute; inset: 0; }
.tag-overlay { position: absolute; top: 8px; left: 10px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #fff; background: rgba(15, 23, 42, 0.55); padding: 2px 8px; border-radius: 5px; pointer-events: none; }
.result-3d .tag-overlay { color: var(--muted); background: rgba(255, 255, 255, 0.85); }
.result-3d .demo-legend { pointer-events: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.result-3d .demo-legend label { margin-left: 8px; }
.result-info { margin-top: 2px; }
.good { color: #15803d; } .bad { color: #b91c1c; }
#pl-segs .seg { position: absolute; top: 0; bottom: 0; border-right: 1px solid #fff; }
#pl-segs .seg.start, #pl-segs .seg.return { background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 4px, #e2e7ee 4px, #e2e7ee 8px); }
#pl-segs .seg.dance { background: #ede9fe; }
#pl-fill { position: absolute; top: 0; bottom: 0; left: 0; border-right: 2px solid #1f2933; background: rgba(31, 41, 51, 0.12); }
.drop { display: block; border: 2px dashed #c9d1dc; border-radius: 10px; padding: 18px 12px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: 0.92rem; margin: 6px 0; }
.drop.over { border-color: #7c3aed; background: #f5f3ff; }
#preview { width: 100%; max-height: 180px; border-radius: 8px; background: #000; margin: 6px 0; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; color: var(--muted); margin: 6px 0; }
.consent input { margin-top: 3px; }
.stages { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.8rem; }
.stages li { padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.stages li.done { background: #dcfce7; color: #166534; }
.stages li.active { background: #ede9fe; color: #5b21b6; font-weight: 600; }
.progress { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
#job-bar { height: 100%; width: 0; background: #7c3aed; transition: width 0.4s; }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.examples button { display: flex; gap: 8px; align-items: center; text-align: left; background: #fff; color: var(--fg);
  border: 1px solid var(--line); padding: 4px; font-size: 0.82rem; border-radius: 8px; }
.examples button img { width: 44px; height: 58px; object-fit: cover; border-radius: 5px; flex: none; }
.examples button .len { color: var(--muted); font-size: 0.75rem; }
.examples button.active { background: #f5f3ff; border-color: #7c3aed; }
.mine { padding-left: 18px; margin: 0; font-size: 0.85rem; }
@media (max-width: 1100px) { .result-stage { grid-template-columns: 1fr; grid-template-rows: 32vh 52vh; height: auto; } }
