html { font-size: 17px; }
/* ============================================================
   EvEgoIMU project page
   Clean academic paper aesthetic (Google Sans + Noto Sans).
   ============================================================ */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* Data encoding palette (charts, legend, table swatches) */
  --c-event:     #2563eb;
  --c-fusion:    #059669;
  --c-imu:       #d97706;
  --c-intensity: #be185d;

  --brand-grad:  linear-gradient(100deg, #3b7dd8 0%, #5a6fd6 38%, #24a06b 72%, #c98a00 100%);

  /* Cool-neutral paper surfaces */
  --bg:           #ffffff;
  --bg-band:      #f6f8fa;
  --surface:      #ffffff;
  --surface-2:    #eef2f6;
  --ink:          #111722;
  --ink-2:        #3f4859;
  --ink-3:        #6b7486;
  --line:         rgba(17, 23, 34, 0.10);
  --line-2:       rgba(17, 23, 34, 0.18);
  --nav-bg:       rgba(255, 255, 255, 0.90);
  --code-bg:      #f4f6f9;
  --ours-row:     rgba(5, 150, 105, 0.13);
  --ours-ds-row:  rgba(37, 99, 235, 0.12);
  --row-hover:    rgba(17, 23, 34, 0.03);
  --stripe:       #f3f5f8;
  --stripe-solid: #f3f5f8;
  --ours-row-solid: #dff1ec;
  --ours-ds-row-solid: #e4ecfd;
  --whisker:      #111722;
  --whisker-halo: rgba(255, 255, 255, 0.92);

  --font-disp: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1020px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --c-event:     #60a5fa;
  --c-fusion:    #34d399;
  --c-imu:       #fbbf24;
  --c-intensity: #f472b6;

  --brand-grad:  linear-gradient(100deg, #60a5fa 0%, #818cf8 38%, #34d399 72%, #f5b935 100%);

  --bg:           #0f1217;
  --bg-band:      #141922;
  --surface:      #171c26;
  --surface-2:    #1f2633;
  --ink:          #eceef2;
  --ink-2:        #b5bac4;
  --ink-3:        #838a97;
  --line:         rgba(255, 255, 255, 0.10);
  --line-2:       rgba(255, 255, 255, 0.20);
  --nav-bg:       rgba(15, 18, 23, 0.90);
  --code-bg:      #141922;
  --ours-row:     rgba(52, 211, 153, 0.17);
  --ours-ds-row:  rgba(96, 165, 250, 0.17);
  --row-hover:    rgba(255, 255, 255, 0.03);
  --stripe:       rgba(255, 255, 255, 0.04);
  --stripe-solid: #191c21;
  --ours-row-solid: #15332d;
  --ours-ds-row-solid: #1d2b3e;
  --whisker:      #eceef2;
  --whisker-halo: rgba(23, 28, 38, 0.90);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: #206bc4; text-decoration: none; }
[data-theme="dark"] a { color: #74a9f5; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
strong { font-weight: 600; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Quiet Corner & Shared Icon Buttons ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2);
  cursor: pointer; flex: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); background: var(--surface-2); }
.icon-btn:focus-visible { outline: 2px solid var(--c-event); outline-offset: 2px; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .sun, [data-theme="dark"] .icon-btn .moon { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }

.theme-corner {
  position: fixed; top: 16px; right: 16px; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0.72;
}
.theme-corner:hover,
.theme-corner:focus-visible { opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(52px, 7.5vw, 84px) 0 30px;
  text-align: center;
}
.publication-title {
  font-family: var(--font-disp);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.3vw, 2.55rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 auto;
  max-width: 34ch;
  text-wrap: balance;
}
.publication-title .brand {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.desktop-break { display: inline; }
@media (max-width: 680px) { .desktop-break { display: none; } }

.authors {
  font-family: var(--font-disp);
  margin: 1.35rem auto 0.35rem;
  font-size: 1.08rem; font-weight: 500;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.25rem;
}
.authors a {
  color: #206bc4;
  transition: opacity 0.15s ease;
}
[data-theme="dark"] .authors a { color: #74a9f5; }
.authors a:hover { text-decoration: underline; }
.authors sup { color: var(--ink-3); font-weight: 500; margin-left: 1px; font-size: 0.7em; }

.affils {
  font-family: var(--font-disp);
  color: var(--ink-2); font-size: 0.96rem;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.15rem 0.75rem;
}
.affils .sep { opacity: 0.45; }
.affils-note { color: var(--ink-3); font-size: 0.85rem; margin: 0.2rem 0 0; }
.paper-venue {
  font-family: var(--font-disp);
  color: var(--ink-3); font-size: 0.95rem; font-weight: 500;
  margin: 0.5rem 0 0;
}

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.55rem; margin-top: 1.45rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  height: 38px; padding: 0 1.08rem;
  border-radius: 999px;
  font: 500 0.88rem/1 var(--font-disp);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2);
  transition: border-color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--ink); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.btn-primary:hover { opacity: 0.88; border-color: transparent; }
.btn-soon[aria-disabled="true"] {
  background: var(--bg-band); color: var(--ink-3); border-color: var(--line);
  cursor: default; pointer-events: none;
}
.btn small { font-size: 0.85em; opacity: 0.82; font-weight: 400; }

/* ---------- Unboxed Figures & Photos ---------- */
.fig-block { margin: 0; border: 0; background: transparent; box-shadow: none; }
.fig-pad {
  position: relative;
  display: block; width: 100%;
  padding: 0; border: 0; background: transparent;
  cursor: zoom-in; text-align: left;
}
.fig-pad picture { display: block; width: 100%; }
.fig-pad img { width: 100%; height: auto; border-radius: 4px; }
.fig-pad.is-photo img { border-radius: 6px; }

[data-theme="dark"] .fig-block .fig-pad:not(.is-photo) {
  background: #ffffff;
  padding: 14px;
  border-radius: 8px;
}

.zoom-hint {
  position: absolute; right: 10px; bottom: 10px;
  font-family: var(--font-disp); font-size: 0.77rem; font-weight: 500;
  color: #3f4859; background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(17, 23, 34, 0.14);
  border-radius: 6px; padding: 0.22rem 0.55rem;
  opacity: 0; transition: opacity 0.15s ease;
  pointer-events: none;
}
[data-theme="dark"] .fig-pad:not(.is-photo) .zoom-hint { right: 20px; bottom: 20px; }
.fig-pad:hover .zoom-hint,
.fig-pad:focus-visible .zoom-hint { opacity: 1; }
.fig-pad:focus-visible { outline: 2px solid var(--c-event); outline-offset: 2px; border-radius: 6px; }

.fig-cap {
  margin-top: 0.85rem;
  padding: 0;
  border-top: 0;
  color: var(--ink-2); font-size: 0.9rem; line-height: 1.58;
  text-align: justify; text-justify: inter-word; hyphens: auto;
}
.fig-cap b { color: var(--ink); font-weight: 600; }

/* ---------- Teaser ---------- */
.teaser { padding: 8px 0 clamp(44px, 6vw, 68px); }

/* ---------- Sections & Typography ---------- */
section.block { padding: clamp(46px, 6vw, 76px) 0; }
section.block.band {
  background: var(--bg-band);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
section.block:not(.band) + section.block:not(.band) { padding-top: 0; }
section.block:not(.band) + section.block:not(.band) > .wrap {
  border-top: 1px solid var(--line);
  padding-top: clamp(46px, 6vw, 76px);
}

.sec-head { margin-bottom: 1.7rem; text-align: center; }
h2.sec-title {
  font-family: var(--font-disp); font-weight: 600;
  font-size: clamp(1.48rem, 2.4vw, 1.88rem);
  line-height: 1.22; letter-spacing: -0.015em;
  margin: 0 0 0.55rem; text-align: center;
}
.sec-lead {
  color: var(--ink-2); font-size: 0.98rem;
  max-width: 78ch; margin: 0 auto; text-align: center;
  text-wrap: balance;
}
.sec-lead-wide { max-width: 78ch; line-height: 1.65; }
h3.sub {
  font-family: var(--font-disp); font-weight: 600;
  font-size: 1.45rem; margin: 3rem 0 0.75rem; line-height: 1.3;
  letter-spacing: -0.01em; text-align: center;
}
.table-takeaway {
  color: var(--ink-2); font-size: 0.97rem; line-height: 1.58;
  max-width: 76ch; margin: 0 auto 1.25rem; text-align: center;
  text-wrap: balance;
}
.caption {
  color: var(--ink-3); font-size: 0.9rem;
  margin: 0.85rem 0 0; line-height: 1.55;
}

/* ---------- Abstract & Method Prose ---------- */
.abstract-wrap { max-width: 780px; margin: 0 auto; }
.abstract-wrap .sec-title { margin-bottom: 1.35rem; }
.abstract-prose p,
.prose-block p {
  color: var(--ink-2); font-size: 1rem; line-height: 1.75;
  margin: 0 0 1rem; text-align: justify; text-justify: inter-word; hyphens: auto;
}
.abstract-prose p:last-child,
.prose-block p:last-child { margin-bottom: 0; }
.prose-block { max-width: 820px; margin: 1.5rem auto 0; }

/* ---------- Video & Chapters ---------- */
.video-frame {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: #ffffff;
}
.video-frame video { width: 100%; aspect-ratio: 16 / 9; background: #ffffff; }
.chapters { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; margin-top: 0.95rem; }
.chip {
  display: inline-flex; align-items: baseline; gap: 0.42rem;
  font: 500 0.88rem/1 var(--font-disp); color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2);
  padding: 0.45rem 0.77rem; border-radius: 6px; cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.chip:hover, .chip:focus-visible { border-color: var(--ink); color: var(--ink); outline: none; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip time { font-family: var(--font-mono); font-size: 0.79rem; color: var(--ink-3); }
.chip.on time { color: inherit; opacity: 0.75; }

/* ---------- Controls & Legend ---------- */
.controls-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.9rem; margin-bottom: 1.1rem;
}
.controls-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }

.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line);
  flex-wrap: wrap;
}
.seg-btn {
  font: 500 0.89rem/1 var(--font-disp); color: var(--ink-2);
  background: transparent; border: 0; padding: 0.48rem 0.9rem;
  border-radius: 6px; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-selected="true"],
.seg-btn[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(17, 23, 34, 0.10);
}
.seg-btn:focus-visible { outline: 2px solid var(--c-event); outline-offset: 2px; }
[role="tabpanel"][hidden] { display: none; }

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.95rem; font-size: 0.87rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ---------- Unboxed 3-Column Bar Chart with Whiskers ---------- */
.chart-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.25rem 0 0;
  margin-bottom: 1.85rem;
  position: relative;
}
.chart-title {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; margin-bottom: 0.95rem; flex-wrap: wrap;
}
.chart-title b { font-family: var(--font-disp); font-weight: 600; font-size: 1.04rem; }
.chart-title span { color: var(--ink-3); font-size: 0.85rem; }

.bars,
.chart-panel .axis {
  display: grid;
  grid-template-columns: minmax(122px, auto) 1fr minmax(112px, auto);
  gap: 4px 14px;
  align-items: center;
}
.bars .name {
  font-size: 0.86rem; color: var(--ink-2);
  text-align: right; white-space: nowrap;
}
.bars .name.ours { color: var(--ink); font-weight: 600; }

.bars .track {
  position: relative; height: 26px;
  display: flex; align-items: center;
  cursor: default; outline: none;
}
.bars .track:focus-visible { outline: 2px solid var(--c-event); border-radius: 3px; }
.bars .grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.bars .grid-bg span { border-right: 1px dashed var(--line); }

.bars .fill {
  position: relative; z-index: 1;
  height: 15px; border-radius: 0 3px 3px 0; min-width: 2px; width: 0;
  transition: width 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.15s ease;
}
@media (prefers-reduced-motion: reduce) { .bars .fill { transition: none; } }

.bars .whisker {
  position: absolute; z-index: 2; height: 2px;
  background: var(--whisker);
  box-shadow: 0 0 0 1px var(--whisker-halo);
  pointer-events: none;
}
.bars .whisker::before,
.bars .whisker::after {
  content: ""; position: absolute; top: -3px; width: 2px; height: 8px;
  background: var(--whisker);
  box-shadow: 0 0 0 1px var(--whisker-halo);
}
.bars .whisker::before { left: 0; }
.bars .whisker::after { right: 0; }

.bars .val {
  font-family: var(--font-sans); font-size: 0.87rem; color: var(--ink-2);
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bars .val b { color: var(--ink); font-weight: 600; }
.bars .val small { color: var(--ink-3); font-size: 0.92em; margin-left: 3px; }

.bars:hover .fill { opacity: 0.42; }
.bars .track:hover .fill { opacity: 1; }

.chart-panel .axis { margin-top: 6px; }
.chart-panel .axis .ticks {
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: var(--ink-3);
  border-top: 1px solid var(--line-2); padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--ink); color: var(--bg);
  font-size: 0.83rem; line-height: 1.45; padding: 0.45rem 0.68rem; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); white-space: nowrap; opacity: 0; transition: opacity 0.1s ease;
}
.tooltip.show { opacity: 1; }

@media (max-width: 580px) {
  .bars,
  .chart-panel .axis {
    grid-template-columns: 90px 1fr 56px;
    gap: 4px 10px;
  }
  .bars .name { font-size: 0.81rem; }
  .bars .val { font-size: 0.81rem; }
  .bars .val small { display: none; }
}

/* ---------- Booktabs Academic Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.tbl {
  border-collapse: collapse; width: 100%;
  font-size: 0.84rem;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.tbl th, .tbl td {
  padding: 0.6rem 0.5rem; text-align: center; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.tbl thead th {
  font-weight: 600; color: var(--ink-2); font-size: 0.87rem;
  background: transparent;
}
.tbl thead tr:first-child th { border-bottom: 1px solid var(--line-2); }
.tbl thead tr:last-child th { border-bottom: 1px solid var(--ink); }
.tbl thead tr:first-child th:first-child,
.tbl tbody td:first-child { text-align: left; padding-left: 0.8rem; }
.tbl tbody tr:hover td { background: var(--row-hover); }
.tbl tbody tr.group-sep td { border-top: 1.5px solid var(--line-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.method { font-weight: 600; color: var(--ink); }
.tbl td.input { text-align: left; color: var(--ink-2); font-size: 0.89rem; }

.swatch {
  display: inline-block; width: 7px; height: 7px; border-radius: 2px;
  margin-right: 7px; vertical-align: 1px;
}
.s-event     { background: var(--c-event); }
.s-imu       { background: var(--c-imu); }
.s-intensity { background: var(--c-intensity); }
.s-fusion    { background: var(--c-fusion); }

.tbl tr.ours td,
.tbl tr.ours:hover td { background: var(--ours-row); }
.tbl tr.ours td.method,
.tbl tr.ours td:first-child { font-weight: 700; }
.tbl .best { font-weight: 700; color: var(--ink); }
.tbl .second { text-decoration: underline; text-underline-offset: 3px; }
.tbl .ok { color: var(--c-fusion); font-weight: 700; }
.tbl .no { color: var(--ink-3); }

/* Table 1 (Datasets): larger, clearer visual hierarchy */
.ds-tbl { font-size: 0.9rem; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.ds-tbl th, .ds-tbl td { padding: 0.5rem 0.75rem; }
.ds-tbl thead tr:first-child th {
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3); padding-top: 0.7rem; padding-bottom: 0.4rem;
}
.ds-tbl thead tr:first-child th:first-child {
  text-transform: none; letter-spacing: 0; font-size: 0.86rem; color: var(--ink-2); vertical-align: bottom; padding-bottom: 0.5rem;
}
.ds-tbl thead tr:last-child th { font-size: 0.84rem; font-weight: 600; color: var(--ink-2); padding-bottom: 0.5rem; }
.ds-tbl tbody td { color: var(--ink); border-bottom: 1px solid var(--line); }
.ds-tbl tbody td:first-child { color: var(--ink); font-weight: 500; }
.ds-tbl tr.ours td,
.ds-tbl tr.ours:hover td { background: var(--ours-ds-row); }
.ds-tbl tr.ours td:first-child { font-weight: 700; }
.ds-tbl td.ok { color: var(--ink); font-weight: 600; }
.ds-tbl td.no { color: var(--ink-3); opacity: 1; }
[data-theme="light"] .ds-tbl td.no, :root .ds-tbl td.no { color: #b9bfca; }
[data-theme="dark"] .ds-tbl td.no { color: #4b5261; }

/* ---------- Qualitative Gallery ---------- */
.gallery-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; margin-bottom: 1rem;
}
.gallery-tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.gallery-tabs::-webkit-scrollbar { display: none; }
.gallery-arrows { display: flex; gap: 6px; flex: none; }

.clip-stage {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
}
.clip video {
  width: 100%; aspect-ratio: 16 / 9; background: #ffffff;
  border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer;
}
.clip-play-overlay {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(17, 23, 34, 0.74);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.15s ease;
}
.clip-play-overlay svg { width: 24px; height: 24px; margin-left: 2px; }
.clip-play-overlay:hover { background: rgba(17, 23, 34, 0.88); transform: scale(1.06); }
.clip-play-overlay:focus-visible { outline: 2px solid var(--c-event); outline-offset: 2px; }
.clip:not([data-state="paused"]) .clip-play-overlay {
  opacity: 0;
  pointer-events: none;
}
.clip-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  background: rgba(17, 23, 34, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.clip[data-state="loading"] .clip-spinner {
  opacity: 1;
  animation: clip-spin 0.8s linear infinite;
}
@keyframes clip-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .clip[data-state="loading"] .clip-spinner { animation: none; }
}
.clip-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 0.75rem 0 0;
  background: transparent; border-top: 0; flex-wrap: wrap;
}
.clip-meta p { margin: 0; color: var(--ink-2); font-size: 0.92rem; }
.clip-actions { display: flex; align-items: center; gap: 0.65rem; flex: none; }
.clip-ds {
  font-family: var(--font-disp); font-size: 0.85rem; font-weight: 500;
  color: var(--ink-3); white-space: nowrap;
}
.clip-toggle { width: 32px; height: 32px; }
.clip-toggle svg { width: 14px; height: 14px; }
.clip-toggle[data-paused="false"] .ic-play { display: none; }
.clip-toggle[data-paused="true"] .ic-pause { display: none; }

.fig-pair { display: grid; grid-template-columns: 1fr; gap: 2.25rem; }
@media (max-width: 760px) {
  .gallery-arrows { display: none; }
}

/* ---------- BibTeX ---------- */
.bib {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; background: var(--code-bg);
}
.bib pre {
  margin: 0; padding: 1.2rem 1.3rem; overflow-x: auto;
  font: 0.88rem/1.65 var(--font-mono); color: var(--ink-2);
}
.copy {
  position: absolute; top: 10px; right: 10px;
  font: 500 0.83rem/1 var(--font-disp); color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px;
  padding: 0.4rem 0.68rem; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Footer ---------- */
footer {
  padding: 28px 0 42px; color: var(--ink-3); font-size: 0.89rem;
  border-top: 1px solid var(--line);
}
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer a { color: var(--ink-2); }

/* ---------- Lightbox ---------- */
.lightbox {
  padding: 0; border: 0; background: transparent;
  max-width: min(1120px, 94vw); max-height: 92vh;
  margin: auto; overflow: visible;
}
.lightbox::backdrop {
  background: rgba(14, 17, 22, 0.74);
  backdrop-filter: blur(5px);
}
.lightbox-inner {
  position: relative;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  padding: 14px; max-height: 92vh; display: flex; flex-direction: column;
}
.lightbox-media {
  background: #ffffff; border-radius: 6px; padding: 10px;
  overflow: auto; display: flex; justify-content: center;
}
.lightbox-media img { max-height: 76vh; width: auto; height: auto; object-fit: contain; }
.lightbox-cap { margin: 0.77rem 0 0; color: var(--ink-2); font-size: 0.88rem; }
.lightbox-close {
  position: absolute; top: -14px; right: -14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.lightbox-close:hover { border-color: var(--ink); }
.lightbox-close svg { width: 16px; height: 16px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.45s ease, transform 0.45s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Inter's tabular figures also widen hyphens, so apply them to numeric cells only */
.tbl td:not(:first-child):not(.input) { font-variant-numeric: tabular-nums; }
.ds-tbl thead tr:first-child th:first-child { border-bottom: 1px solid var(--ink); }

/* Striped rows instead of row rules (both tables) */
.tbl tbody td, .ds-tbl tbody td { border-bottom: 0; }
.tbl tbody tr:nth-child(even) td { background: var(--stripe); }
.tbl tbody tr:hover td { background: var(--row-hover); }
.tbl tbody tr.ours td { background: var(--ours-row); }
.ds-tbl tbody tr.ours td { background: var(--ours-ds-row); }

/* Dataset table: compact six-column layout */
.ds-tbl thead th, .ds-tbl thead tr:first-child th, .ds-tbl thead tr:first-child th:first-child {
  font-size: 0.84rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--ink-2); padding: 0.65rem 0.75rem 0.55rem; vertical-align: bottom; line-height: 1.3;
  border-bottom: 1px solid var(--ink);
}
.ds-tbl thead th:first-child, .ds-tbl tbody td:first-child { text-align: right; padding-right: 1.4rem; padding-left: 0.8rem; }
.ds-tbl tbody td { padding-top: 0.55rem; padding-bottom: 0.55rem; }
.ds-tbl td.ok { color: var(--c-fusion); font-size: 1.2rem; font-weight: 700; line-height: 1; }
.ds-tbl thead tr:first-child th:first-child { text-align: right; padding-right: 1.4rem; }
.ds-tbl .s-rgb { color: var(--c-intensity); font-weight: 600; }
.ds-tbl .s-ev { color: var(--c-event); font-weight: 600; }
.ds-tbl .sens-imu { color: var(--c-imu); font-weight: 600; }

/* Larger table text */
table.tbl.ds-tbl { font-size: 1rem; }
.ds-tbl thead th, .ds-tbl thead tr:first-child th, .ds-tbl thead tr:first-child th:first-child { font-size: 0.92rem; }
.ds-tbl td.ok { font-size: 1.3rem; }
table.tbl:not(.ds-tbl) { font-size: 0.89rem; }
.tbl:not(.ds-tbl) th, .tbl:not(.ds-tbl) td { padding-left: 0.42rem; padding-right: 0.42rem; }
.tbl:not(.ds-tbl) thead th { font-size: 0.86rem; }
.tbl td.input { font-size: 0.87rem; }
.ds-tbl thead th { white-space: nowrap; }
.ds-tbl thead th, .ds-tbl thead tr:first-child th, .ds-tbl thead tr:first-child th:first-child { vertical-align: middle; line-height: 1.3; }
.ds-tbl thead th:nth-child(n+4) { width: 13%; }
.ds-tbl thead th:nth-child(3) { width: 11%; }
/* Hover feedback on "Ours" rows: a stronger version of their own tint */
.tbl tbody tr.ours:hover td { background: linear-gradient(var(--row-hover-strong), var(--row-hover-strong)), var(--ours-row); }
.ds-tbl tbody tr.ours:hover td { background: linear-gradient(var(--row-hover-strong), var(--row-hover-strong)), var(--ours-ds-row); }
:root, [data-theme="light"] { --row-hover-strong: rgba(17, 23, 34, 0.05); }
[data-theme="dark"] { --row-hover-strong: rgba(255, 255, 255, 0.06); }
.ds-tbl tbody tr.group-sep td { border-top: 1px solid var(--ink-3); }

/* ---------- Qualitative carousel ---------- */
.carousel { position: relative; overflow: hidden; container-type: inline-size; }
.car-track { display: flex; transition: transform 0.45s cubic-bezier(.22,.7,.2,1); will-change: transform; }
.car-track > .clip { flex: 0 0 100%; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .car-track { transition: none; } }
.car-arrow {
  position: absolute; z-index: 3;
  top: calc(100cqw * 9 / 32); transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: #111722; background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 23, 34, 0.14);
  box-shadow: 0 2px 10px rgba(17, 23, 34, 0.16);
  transition: background 0.15s ease, transform 0.15s ease;
}
.car-arrow svg { width: 20px; height: 20px; }
.car-arrow:hover { background: #ffffff; transform: translateY(-50%) scale(1.06); }
.car-arrow:focus-visible { outline: 2px solid var(--c-event); outline-offset: 2px; }
.car-prev { left: 12px; }
.car-next { right: 12px; }
@media (max-width: 560px) {
  .car-arrow { width: 36px; height: 36px; }
  .car-prev { left: 6px; } .car-next { right: 6px; }
}
.gallery-controls { justify-content: center; }
.gallery-tabs .seg { justify-content: center; }


.fig-pad.sunburst img { border-radius: 0; }
.fig-block .plain-video { width: 100%; height: auto; display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.sensors-fig { max-width: 860px; margin: 0 auto 2.2rem; }
.sensors-fig .fig-cap { text-align: center; }
.sensor-row { display: grid; grid-template-columns: 590fr 330fr 742fr 740fr; gap: clamp(0.8rem, 3vw, 2rem); align-items: end; }
.sensor-item { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; min-width: 0; }
.sensor-item img { width: 100%; height: auto; display: block; }
.sensor-item span { font-family: var(--font-disp); font-weight: 600; font-size: 1rem; color: var(--ink); text-align: center; }
@media (max-width: 560px) { .sensor-item span { font-size: 0.82rem; } }
[data-theme="dark"] .sensor-item img { background: #fff; border-radius: 6px; }

/* Playback progress bars on chapter chips and qualitative tabs */
.chip, #qual-tablist .seg-btn { position: relative; overflow: hidden; }
.chip::after, #qual-tablist .seg-btn::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px;
  width: calc(var(--p, 0) * 100%);
  pointer-events: none;
}
.chip.on::after { background: var(--c-fusion); }
#qual-tablist .seg-btn[aria-selected="true"]::after { background: var(--c-fusion); }
.sunburst-pair { display: flex; justify-content: center; gap: clamp(2rem, 9vw, 7rem); }
.sunburst-pair .sunburst { width: min(300px, 40%); }
.sunburst-pair .sunburst img { border-radius: 0; }

/* Zoomable figures: always-visible magnifier badge; label expands on hover */
.zoomable .zoom-hint {
  opacity: 1; display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem; border-radius: 999px; font-size: 0.8rem; line-height: 1;
  color: #111722; background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 23, 34, 0.16); box-shadow: 0 1px 6px rgba(17, 23, 34, 0.15);
  transition: padding 0.15s ease, background 0.15s ease;
}
.zoomable .zoom-hint svg { width: 16px; height: 16px; flex: none; }
.zoomable .zoom-hint .zh-label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width 0.2s ease; }
.zoomable:hover .zoom-hint, .zoomable:focus-visible .zoom-hint { padding: 0.35rem 0.6rem 0.35rem 0.45rem; background: #fff; }
.zoomable:hover .zoom-hint .zh-label, .zoomable:focus-visible .zoom-hint .zh-label { max-width: 6em; }
.zoomable:hover img { filter: brightness(0.97); }
.sunburst .zoom-hint { right: 4%; bottom: 4%; }
@media (hover: none) { .zoomable .zoom-hint .zh-label { max-width: 6em; } .zoomable .zoom-hint { padding: 0.35rem 0.6rem 0.35rem 0.45rem; } }
.zoomable .zoom-hint { top: 8px; right: 8px; bottom: auto; }
[data-theme="dark"] .fig-pad:not(.is-photo).zoomable .zoom-hint { top: 18px; right: 18px; bottom: auto; }
.sunburst .zoom-hint { top: 2%; right: 2%; bottom: auto; }

/* Capture studio photo + recording specs side by side */
.studio-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.2rem, 4vw, 2.5rem); align-items: start; }
.spec-list { margin: 0; display: grid; gap: 0; border-top: 1.5px solid var(--ink); }
.spec-list > div { padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--line); }
.spec-list > div:last-child { border-bottom: 1.5px solid var(--ink); }
.spec-list dt { font-family: var(--font-disp); font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.spec-list dd { margin: 0.15rem 0 0; color: var(--ink-2); font-size: 0.92rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .studio-row { grid-template-columns: 1fr; } }
/* zoom badge: sit just outside the image corner so it never covers figure labels */
.zoomable .zoom-hint { top: -10px; right: -10px; }
[data-theme="dark"] .fig-pad:not(.is-photo).zoomable .zoom-hint { top: -10px; right: -10px; }
.sunburst .zoom-hint { top: 0; right: 0; }

/* No zoom badge: hover feedback only */
.zoom-hint { display: none !important; }
.zoomable { cursor: zoom-in; }
.zoomable img { transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease; }
.zoomable:hover img, .zoomable:focus-visible img {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 22px rgba(17, 23, 34, 0.14);
}
.sunburst.zoomable:hover img { box-shadow: none; transform: translateY(-3px) scale(1.04); }
@media (prefers-reduced-motion: reduce) { .zoomable:hover img { transform: none; } }
.sensors-fig { max-width: none; }
@media (max-width: 760px) { .sensor-row { grid-template-columns: 1fr 1fr; align-items: end; } }
.sensor-item span { white-space: nowrap; }

/* Lightbox: use (almost) the full screen so a click actually enlarges the figure */
.lightbox { width: 96vw; max-width: 96vw; max-height: 96vh; }
.lightbox-inner { padding: 10px; max-height: 96vh; }
.lightbox-media { padding: 6px; align-items: center; }
.lightbox-media img {
  width: 100%; max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
}
.lightbox-close { top: -42px; right: 0; }

/* Sensor row: same image height for all items, labels centered under each image */
.sensor-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 1.2rem clamp(1.2rem, 3.5vw, 2.6rem); }
.sensor-item { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.sensor-item img, .sensor-item .fig-pad { height: clamp(96px, 12vw, 170px); width: auto; }
.sensor-item .fig-pad picture { display: block; height: 100%; width: auto; }
.sensor-item .fig-pad img { height: 100%; width: auto; }
.sensor-item span { text-align: center; line-height: 1.3; }
@media (min-width: 900px) { .sensor-row { flex-wrap: nowrap; } }

/* Lightbox: large but leave a visible margin so clicking outside to close is easy */
.lightbox { width: auto; max-width: min(1280px, 86vw); max-height: 86vh; }
.lightbox-inner { max-height: 86vh; }
.lightbox-toolbar {
  position: absolute; top: -42px; right: 0; z-index: 4;
  display: flex; align-items: center; gap: 8px;
}
.lightbox-zoom {
  height: 34px; padding: 0 0.85rem; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 500 0.82rem/1 var(--font-disp);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.lightbox-zoom:hover { border-color: var(--ink); }
.lightbox-zoom[aria-pressed="true"] {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.lightbox-close { position: static; }
.lightbox-media img { width: auto; max-width: 100%; max-height: calc(86vh - 120px); cursor: zoom-in; }
.lightbox-cap { font-size: 0.95rem; line-height: 1.55; max-width: 72ch; }
.lightbox-cap a { color: var(--c-event); text-decoration: underline; text-underline-offset: 2px; }
.sensor-item .fig-pad { cursor: zoom-in; }
.lightbox-media img { height: min(calc(86vh - 150px), 680px); max-height: none; object-fit: contain; }
.lightbox { width: fit-content; max-width: 90vw; }
.lightbox-media img { height: auto; max-height: none; max-width: none; object-fit: contain; }
.lightbox-media { overflow: visible; }
.lightbox.is-zoomed { width: 94vw; max-width: 94vw; max-height: 90dvh; }
.lightbox.is-zoomed .lightbox-inner { max-height: 90dvh; }
.lightbox.is-zoomed .lightbox-media {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(90dvh - 125px);
  align-items: flex-start;
  justify-content: flex-start;
}
.lightbox.is-zoomed .lightbox-media img {
  width: max(220%, 960px) !important;
  max-width: none !important;
  max-height: none !important;
  height: auto !important;
  cursor: zoom-out;
}

/* ---------- Responsive (Tablet & Mobile) ---------- */
@media (max-width: 760px) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .sensor-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 0.9rem;
    align-items: end;
  }
  .sensor-item .fig-pad {
    width: 100%;
    height: clamp(88px, 24vw, 135px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
  }
  .sensor-item .fig-pad picture {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    height: 100%;
  }
  .sensor-item .fig-pad img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }
  .sensor-item span { white-space: normal; font-size: 0.88rem; }

  .controls-bar { justify-content: center; }
  .controls-left { justify-content: center; }
  .legend { justify-content: center; }

  .tbl thead tr:first-child th:first-child,
  .tbl tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg);
    background-clip: padding-box;
    box-shadow: 1px 0 0 var(--line);
  }
  .tbl thead tr:first-child th:first-child { z-index: 3; }
  .tbl tbody tr:hover td:first-child {
    background: linear-gradient(var(--row-hover), var(--row-hover)), var(--bg);
  }
  .tbl tbody tr:nth-child(even) td:first-child { background: var(--stripe-solid); }
  .tbl tbody tr:nth-child(even):hover td:first-child {
    background: linear-gradient(var(--row-hover), var(--row-hover)), var(--stripe-solid);
  }
  .tbl tbody tr.ours td:first-child { background: var(--ours-row-solid); }
  .tbl tbody tr.ours:hover td:first-child {
    background: linear-gradient(var(--row-hover-strong), var(--row-hover-strong)), var(--ours-row-solid);
  }
  .ds-tbl tbody tr.ours td:first-child { background: var(--ours-ds-row-solid); }
  .ds-tbl tbody tr.ours:hover td:first-child {
    background: linear-gradient(var(--row-hover-strong), var(--row-hover-strong)), var(--ours-ds-row-solid);
  }

  .lightbox { width: 94vw; max-width: 94vw; max-height: 90dvh; }
  .lightbox-inner { padding: 10px; max-height: 90dvh; }
  .lightbox-toolbar {
    position: static;
    justify-content: flex-end;
    margin-bottom: 8px;
  }
  .lightbox-media { overflow: auto; -webkit-overflow-scrolling: touch; max-height: calc(90dvh - 150px); padding: 6px; }
  .lightbox-media img {
    max-width: 100%;
    max-height: calc(90dvh - 170px);
    width: auto !important;
    height: auto !important;
    object-fit: contain;
  }
  .lightbox-cap { font-size: 0.86rem; max-width: 100% !important; }
}

@media (max-width: 640px) {
  .gallery-tabs { width: 100%; -webkit-overflow-scrolling: touch; }
  .gallery-tabs .seg { flex-wrap: nowrap; justify-content: flex-start; width: max-content; margin: 0 auto; }

  table.tbl.ds-tbl { font-size: 0.78rem; }
  .ds-tbl thead th,
  .ds-tbl thead tr:first-child th,
  .ds-tbl thead tr:first-child th:first-child {
    font-size: 0.76rem;
    padding: 0.42rem 0.45rem;
  }
  .ds-tbl tbody td { padding: 0.42rem 0.45rem; }
  .ds-tbl thead th:nth-child(3),
  .ds-tbl thead th:nth-child(n+4) { width: auto; }
  .ds-tbl thead th:first-child,
  .ds-tbl thead tr:first-child th:first-child,
  .ds-tbl tbody td:first-child {
    text-align: left;
    padding: 0.42rem 0.5rem;
    white-space: normal;
    max-width: 122px;
    line-height: 1.25;
  }
  .ds-tbl td.ok { font-size: 1.05rem; }

  table.tbl:not(.ds-tbl) { font-size: 0.78rem; }
  .tbl:not(.ds-tbl) thead th { font-size: 0.76rem; }
  .tbl:not(.ds-tbl) td.input { font-size: 0.76rem; }
  .tbl:not(.ds-tbl) thead tr:first-child th:first-child,
  .tbl:not(.ds-tbl) tbody td:first-child {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    max-width: 118px;
    white-space: normal;
    line-height: 1.25;
  }

  .clip-meta { gap: 0.5rem 0.75rem; }
  .clip-actions { margin-left: auto; }
}

@media (max-width: 580px) {
  html { font-size: 15.5px; }
  .theme-corner { top: 10px; right: 10px; }
  .hero { padding-top: 58px; }
  .publication-title { font-size: clamp(1.42rem, 6vw, 1.85rem); }
  .authors { gap: 0.2rem 0.9rem; font-size: 1rem; }
  .affils { flex-direction: column; gap: 0.1rem; font-size: 0.9rem; }
  .affils .sep { display: none; }
  .links { gap: 0.45rem; }
  .btn { height: 36px; padding: 0 0.88rem; font-size: 0.84rem; }
  .abstract-prose p, .prose-block p, .fig-cap { overflow-wrap: break-word; }
  .chip { padding: 0.38rem 0.62rem; font-size: 0.82rem; }

  h3.sub { font-size: 1.2rem; margin: 2.2rem 0 0.65rem; }
  .sunburst-pair { flex-direction: column; align-items: center; gap: 1.1rem; }
  .sunburst-pair .sunburst { width: min(215px, 60vw); }

  .bars,
  .chart-panel .axis {
    grid-template-columns: minmax(98px, auto) 1fr minmax(46px, auto);
    gap: 4px 8px;
  }
  .bars .name { font-size: 0.76rem; }
  .bars .val { font-size: 0.78rem; }
  .tooltip { max-width: calc(100% - 16px); white-space: normal; }

  .fig-pair { gap: 1.5rem; }
  .bib pre { padding: 2.5rem 0.9rem 1rem; font-size: 0.8rem; }
  footer .wrap { justify-content: center; text-align: center; }
}
