/* ═══════════════════════════════════════════════════════════════
   When Robots Outweigh Objects — project page
   Visual language follows younghyopark.me/tune-to-learn: monochrome,
   Inter + JetBrains Mono, hairline rules, interactive iframes.
   Red = high inertia, blue = low inertia, green = goal (paper figures).
   ═══════════════════════════════════════════════════════════════ */

:root {
  --primary:      #222;
  --accent:       #555;
  --bg:           #ffffff;
  --bg-alt:       #fafafa;
  --bg-hero:      #f7f8fa;
  --text:         #1a1a1a;
  --text-muted:   #6b6b6b;
  --text-light:   #999;
  --border:       #e0e0e0;
  --heavy:        #c0392b;
  --heavy-soft:   rgba(192, 57, 43, 0.07);
  --light:        #2a64b8;
  --light-soft:   rgba(42, 100, 184, 0.07);
  --goal:         #2e8b57;

  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  --max-width:        1100px;
  --max-width-medium:  900px;
  --max-width-narrow:  760px;
  --section-padding:   2.5rem 0;
  --radius:            4px;
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); font-size: 1rem; line-height: 1.65; color: var(--text); background: var(--bg); counter-reset: cite-counter; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: var(--text); }
img, video, iframe { max-width: 100%; display: block; border: none; }
figure { margin: 0; }
p + p { margin-top: 0.9rem; }
code { font-family: var(--font-mono); font-size: 0.875em; background: var(--bg-alt); padding: 0.15em 0.4em; border-radius: 4px; border: 1px solid var(--border); }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
strong { font-weight: 600; }
.heavy { color: var(--heavy); }
.light { color: var(--light); }

iframe[data-src] {
  background: linear-gradient(110deg, #f5f5f5 8%, #e8e8e8 18%, #f5f5f5 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position-x: -200%; } }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.container-medium { max-width: var(--max-width-medium); margin: 0 auto; }
.container-narrow { max-width: var(--max-width-narrow); margin: 0 auto; }
.section { padding: var(--section-padding); }

.section h2 { font-size: 1.725rem; font-weight: 600; margin-bottom: 1.25rem; letter-spacing: 0.01em; display: flex; align-items: center; gap: 0.75rem; }
.section h2::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.section h3 { font-size: 1.3rem; font-weight: 600; margin: 2.25rem 0 0.9rem; letter-spacing: 0.01em; display: flex; align-items: center; gap: 0.75rem; }
.section h3::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.section-kicker { font-size: 1.05rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.02em; }
.section-kicker + h2 { margin-top: -0.2rem; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero { background: var(--bg-hero); padding: 2.75rem 1.5rem 2rem; text-align: center; border-bottom: 1px solid var(--border); }
.paper-title { font-size: clamp(1.5rem, 3.5vw, 2.3rem); font-weight: 700; line-height: 1.25; margin-bottom: 1rem; letter-spacing: -0.02em; }
.paper-title .subtitle { font-weight: 400; opacity: 0.85; font-size: 0.85em; }
.author-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.5rem; margin-bottom: 0.75rem; font-size: 1.05rem; }
.author a { font-weight: 500; text-underline-offset: 3px; }
.author sup { font-size: 0.7em; margin-left: 1px; opacity: 0.7; }
.affiliations { font-size: 0.9rem; opacity: 0.8; margin-bottom: 1rem; display: flex; justify-content: center; align-items: center; gap: 0.4rem; }
.affiliations img { height: 40px; display: inline; }
.link-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 1rem; border-radius: var(--radius); font-size: 0.85rem; font-weight: 500; color: var(--text); background: transparent; border: 1px solid var(--border); transition: border-color .15s; text-decoration: none; }
.btn:hover { border-color: var(--text); }
.btn.disabled { color: var(--text-light); pointer-events: none; }
.btn.disabled small { font-size: 0.72rem; }
.venue-line { margin-top: 0.85rem; color: var(--text-muted); font-size: 1.05rem; font-weight: 500; }

/* ── Abstract ──────────────────────────────────────────────── */
.abstract-text { line-height: 1.65; text-align: justify; }
.abstract-findings { line-height: 1.65; margin: 0.75rem 0 0.75rem 1.5rem; padding-left: 0.5rem; }
.abstract-findings li { margin-bottom: 0.35rem; }

/* ── Figures ───────────────────────────────────────────────── */
figcaption { margin-top: 0.6rem; font-size: 0.92rem; color: var(--text-muted); text-align: center; line-height: 1.5; }
figcaption strong { color: var(--text); }

/* Opening figure (static/js/hero.js): FR3 on a seesaw, three.js with HTML readouts */
.hero-fig { margin: 0.25rem 0 0; }
.hero-stage { position: relative; width: 100%; aspect-ratio: 2.1 / 1; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.hero-stage.dragging { cursor: grabbing; }
.hero-stage:not(.ready) { border-radius: 8px; background: linear-gradient(110deg, #f7f7f6 8%, #eeeeec 18%, #f7f7f6 33%); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }
.hero-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .7s ease; }
.hero-stage canvas:focus-visible { outline: 2px solid var(--light); outline-offset: 2px; border-radius: 6px; }
.hero-stage.ready canvas { opacity: 1; }
.hero-read { position: absolute; top: 0.2rem; display: flex; flex-direction: column; line-height: 1.2; pointer-events: none; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .7s ease .2s; }
.hero-stage.ready .hero-read, .hero-stage.ready .hero-hint { opacity: 1; }
.hero-read-arm { left: 0; }
.hero-read-ratio { left: 50%; transform: translateX(-50%); align-items: center; text-align: center; }
.hero-read-obj { right: 0; align-items: flex-end; text-align: right; }
.hero-read-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); }
.hero-read-value { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.01em; margin: 0.1rem 0 0.05rem; }
.hero-read-arm .hero-read-value { color: var(--heavy); }
.hero-read-obj .hero-read-value { color: var(--light); }
.hero-read-ratio .hero-read-value { color: var(--text); }
.hero-read-sub { font-size: 0.8rem; color: var(--text-muted); }
.hero-read-label .short { display: none; }
.hero-hint, .hero-status { position: absolute; left: 0; right: 0; bottom: 0.3rem; display: flex; justify-content: center; align-items: center; gap: 0.4rem; text-align: center; font-size: 0.8rem; color: var(--text-muted); pointer-events: none; }
/* "For illustration" badge on the seesaw; hovering it (or focusing, or tapping it) shows why */
.hero-badge { position: absolute; right: 0; bottom: 0.2rem; padding: 0.28rem 0.7rem; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; cursor: help; opacity: 0; transition: opacity .7s ease .2s, color .15s; }
.hero-stage.ready .hero-badge { opacity: 1; }
.hero-badge i { margin-right: 0.2rem; }
.hero-badge:hover, .hero-badge:focus { color: var(--text); outline: none; }
.hero-badge:focus-visible { box-shadow: 0 0 0 2px var(--light); }
.hero-badge-tip { position: absolute; right: 0; bottom: calc(100% + 6px); width: 22rem; max-width: calc(100vw - 2rem); padding: 0.5rem 0.7rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); color: var(--text-muted); font-size: 0.76rem; font-weight: 400; letter-spacing: 0; line-height: 1.45; text-transform: none; white-space: normal; pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s; }
.hero-badge:hover .hero-badge-tip, .hero-badge:focus .hero-badge-tip { opacity: 1; visibility: visible; transform: none; }
.hero-hint { opacity: 0; transition: opacity .5s ease; }
.hero-stage.ready.touched .hero-hint, .hero-stage.busy .hero-hint { opacity: 0; }
.hero-tools { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin: 0.45rem 0 0; }
.hero-tools-off { display: none; }
.hero-robots { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; }
.hero-robots button { font: 500 0.78rem/1 var(--font-sans); color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 0.38rem 0.7rem; cursor: pointer; transition: border-color .15s, background .15s; }
.hero-robots button:hover { border-color: var(--text-muted); }
.hero-robots button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
/* Posture slider: the arm's mass from its lightest to its heaviest posture (red, as the arm's readout) */
.hero-posture { display: grid; grid-template-columns: 2rem auto 1fr auto 2rem; align-items: center; gap: 0.85rem; width: 100%; max-width: 42rem; }
.hero-posture::before { content: ''; }    /* balances the reset button: the track sits in the middle */
.hero-posture-off { display: none; }
.hero-posture-end { display: flex; flex-direction: column; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hero-posture-end:first-of-type { align-items: flex-end; text-align: right; }
.hero-posture-name { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.hero-posture-name .short { display: none; }
.hero-posture-mass { font-size: 0.9rem; font-weight: 600; color: var(--heavy); }
.hero-posture input { --fill: 100%; -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; }
.hero-posture input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--heavy) var(--fill), #dedcd6 var(--fill)); }
.hero-posture input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--heavy) var(--fill), #dedcd6 var(--fill)); }
.hero-posture input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--heavy); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.hero-posture input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--heavy); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.hero-posture input:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; border-radius: 4px; }
.hero-reset { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 0.85rem; cursor: pointer; transition: background .15s, color .15s; }
.hero-reset:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.hero-reset:focus-visible { outline: 2px solid var(--light); outline-offset: 1px; }
.hero-fig figcaption { text-align: left; margin-top: 1rem; }
.hero-fig .hero-note { display: block; margin-top: 0.25rem; font-size: 0.85rem; color: var(--text-light); }
.hero-fallback { display: none; width: 100%; }
.hero-fig.hero-failed .hero-stage { display: none; }
.hero-fig.hero-failed .hero-fallback { display: block; }

/* Interactive widget frame */
.widget { margin: 1.5rem 0 0.5rem; }
.widget.wide { width: min(1100px, calc(100vw - 3rem)); margin-left: calc(50% - min(550px, 50vw - 1.5rem)); }
.widget-frame { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #f4f4f2; }
.widget-frame iframe { width: 100%; height: 100%; border: 0; }
.widget-tag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.45rem; }
.widget-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--heavy); box-shadow: 0 0 0 3px var(--heavy-soft); }
.widget figcaption { text-align: left; }
button.linkish { font: inherit; font-weight: 600; color: var(--light); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ── Findings: a claim set in the text, numbered in the margin; its key
   phrase is marked with a highlighter that sweeps in once it is read
   (static/js/script.js, initClaims). No box. ─────────────────────── */
.claim { position: relative; margin: 1.9rem 0 1.6rem; padding-left: 3.4rem; font-size: 1.28rem; line-height: 1.42; font-weight: 500; letter-spacing: -0.012em; color: var(--text); text-wrap: pretty; }
.claim-n { position: absolute; left: 0; top: -0.05em; width: 2.4rem; text-align: right; font-size: 2.35rem; line-height: 1; font-weight: 300; color: #c4c4bf; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.claim mark { --mark: rgba(31, 31, 31, 0.1); color: inherit; background-color: transparent; padding: 0 0.08em; margin: 0 -0.08em; background-image: linear-gradient(var(--mark), var(--mark)); background-repeat: no-repeat; background-position: 0 82%; background-size: 0% 0.58em; transition: background-size 1.15s cubic-bezier(.3, .7, .2, 1) .15s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.claim.heavy mark { --mark: rgba(192, 57, 43, 0.2); }
.claim.light mark { --mark: rgba(42, 100, 184, 0.2); }
.claim.in mark, .no-js .claim mark { background-size: 100% 0.58em; }
@media (prefers-reduced-motion: reduce) { .claim mark { transition: none; background-size: 100% 0.58em; } }

/* ── "Is it a problem?": low-inertia papers, learning demos, the question ── */
.paper-card { display: flex; flex-direction: column; gap: 0.55rem; padding: 1.15rem 1.25rem 1.2rem; background: #fff; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.paper-card.active:hover { box-shadow: 0 8px 24px rgba(0,0,0,.09); }
.paper-card-title { font-family: 'Times New Roman', Times, Georgia, serif; font-weight: 700; font-size: 1.16rem; line-height: 1.3; }
.paper-card-title mark { color: inherit; background: linear-gradient(transparent 10%, #fff27a 10%, #fff27a 90%, transparent 90%); padding: 0 2px; }
.paper-card-meta { font-size: 0.78rem; color: var(--text-muted); }
.paper-card-quote { margin-top: auto; font-size: 0.83rem; font-style: italic; line-height: 1.45; color: var(--text-muted); }
.meanwhile { display: flex; align-items: center; gap: 1rem; margin: 2.25rem 0 0.9rem; font-size: 1.2rem; text-align: center; }
.meanwhile::before, .meanwhile::after { content: ''; flex: 1; border-top: 1.5px dashed #cfcfcf; }
/* Carousels: the item in front is centred, its neighbours peek out faded,
   and the strip advances on its own (static/js/script.js, initCarousels). */
.carousel { --item-w: 58%; --step: 66%; margin: 1.1rem 0 0.4rem; }
.carousel.demos { --item-w: 66%; --step: 64%; }
.carousel-track { display: grid; align-items: center; overflow: hidden; padding: 10px 0 14px; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%); }
.carousel-item { grid-area: 1 / 1; justify-self: center; width: var(--item-w); min-width: 0;
  transform: translateX(calc(var(--k, 0) * var(--step))) scale(var(--s, 1)); opacity: var(--o, 1); z-index: var(--z, 1);
  transition: transform .75s cubic-bezier(.22, .7, .2, 1), opacity .6s ease; -webkit-user-drag: none; }
.carousel-item.side { cursor: pointer; }
.carousel-item.side *, .carousel-item.away * { pointer-events: none; }
.carousel-item.away { visibility: hidden; }
.carousel-item.jump { transition: none !important; opacity: 0 !important; }
.carousel-nav { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 2px; }
.carousel-nav .arrow { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--text-muted); font: 500 17px/1 var(--font-sans); cursor: pointer; transition: border-color .15s, color .15s; }
.carousel-nav .arrow:hover { border-color: var(--text-muted); color: var(--text); }
.carousel-dots { display: flex; align-items: center; gap: 6px; }
.carousel-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px; background: #d2d2d2; cursor: pointer; transition: width .3s, background .3s; }
.carousel-dots button.on { width: 20px; background: var(--text); }
.demo-tile { display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.demo-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: #111; }
.demo-thumb img, .demo-thumb iframe { width: 100%; height: 100%; object-fit: cover; }
.demo-play { position: absolute; left: 50%; top: 50%; width: 56px; height: 40px; transform: translate(-50%, -50%); border-radius: 11px; background: rgba(20,20,20,.72); transition: background .15s; }
.demo-play::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent #fff; }
.demo-tile.active:hover .demo-play, .demo-tile.active:focus-visible .demo-play { background: var(--heavy); }
.demo-name { margin-top: 0.55rem; font-weight: 600; }
.demo-org { font-size: 0.78rem; color: var(--text-muted); }
.demo-desc { margin-top: 0.2rem; font-size: 0.88rem; line-height: 1.45; color: var(--text-muted); }
.demo-note { font-size: 0.78rem; color: var(--text-light); }
.demo-tile .demo-name, .demo-tile .demo-org, .demo-tile .demo-desc { transition: opacity .4s ease; }
.demo-tile:not(.active) .demo-name, .demo-tile:not(.active) .demo-org, .demo-tile:not(.active) .demo-desc { opacity: 0; }

/* ── Video below the abstract ── */
.video-embed { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #000; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.video-embed iframe { width: 100%; height: 100%; }

/* Equation block */
.eq { margin: 1rem 0; overflow-x: auto; }

/* ── Poll ──────────────────────────────────────────────────── */
#poll { background: linear-gradient(135deg, var(--heavy-soft), var(--light-soft)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.poll-onboarding { color: var(--text-muted); font-size: 0.95rem; text-align: center; }
.poll-question { font-size: 1.5rem; font-weight: 600; text-align: center; margin: 0.25rem 0 1.1rem; }
.poll-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.poll-card { text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem 1rem; cursor: pointer; transition: border-color .15s, transform .15s; }
.poll-card:hover { border-color: var(--text); transform: translateY(-1px); }
.poll-card.chosen { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.poll-card-title { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.poll-card-desc { display: block; font-size: 0.88rem; color: var(--text-muted); line-height: 1.45; }
.poll-response { display: none; margin-top: 1rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; }
.poll-response.show { display: block; animation: fadein .3s ease; }
.poll-response p { font-size: 0.97rem; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Inline citations with hover tooltip ──────────────────── */
.cite { counter-increment: cite-counter; display: inline; position: relative; color: #4f46e5; font-size: 0.85em; font-weight: 500; cursor: pointer; text-decoration: none; border-bottom: 1px dashed rgba(79, 70, 229, 0.3); }
.cite::before { content: '[' counter(cite-counter) ']'; }
.cite .cite-tooltip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1e1e2e; color: #e0e0e0; font-size: 0.75rem; font-weight: 400; line-height: 1.5; padding: 0.5rem 0.75rem; border-radius: 6px; min-width: 280px; max-width: 420px; white-space: normal; box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 100; pointer-events: none; }
.cite:hover .cite-tooltip { display: block; }

/* ── BibTeX ────────────────────────────────────────────────── */
.bibtex-block { position: relative; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; overflow-x: auto; }
.bibtex-block pre { font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.copy-btn { position: absolute; top: 0.75rem; right: 0.75rem; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); padding: 0.3rem 0.75rem; border-radius: var(--radius); font-size: 0.75rem; cursor: pointer; font-family: var(--font-sans); }
.copy-btn:hover { border-color: var(--text); color: var(--text); }
.copy-btn.copied { background: #22c55e; border-color: #22c55e; color: #fff; }

/* ── Footer ────────────────────────────────────────────────── */
.footer { padding: 1.25rem 1.5rem; text-align: center; font-size: 0.85rem; color: var(--text-light); border-top: 1px solid var(--border); }

/* ── Sticky header ─────────────────────────────────────────── */
.sticky-header { position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: var(--bg-hero); border-bottom: 1px solid var(--border); transform: translateY(-100%); opacity: 0; transition: transform .35s ease, opacity .35s ease; pointer-events: none; }
.sticky-header.visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
.sticky-header-inner { max-width: var(--max-width); margin: 0 auto; padding: 0.5rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sticky-title { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.sticky-title strong { font-weight: 600; }
.sticky-sep { color: var(--text-light); margin: 0 0.25rem; }
.sticky-authors { color: var(--text-muted); }
.sticky-venue { color: var(--text-light); }

/* ── Table of contents (floating, right) ───────────────────── */
.dynamic-toc { position: fixed; top: 58%; right: 1.5rem; transform: translateY(-50%); z-index: 100; max-height: 75vh; overflow-y: auto; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(0,0,0,.08); border-radius: 0.75rem; box-shadow: 0 4px 24px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04); padding: 0.75rem 0; min-width: 12.5rem; max-width: 15rem; }
.dynamic-toc .toc-title { display: block; padding: 0.15rem 1rem 0.55rem; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #999; border-bottom: 1px solid rgba(0,0,0,.06); margin-bottom: 0.35rem; }
.dynamic-toc ul { list-style: none; }
.dynamic-toc a { display: block; padding: 0.32rem 1rem 0.32rem 0.85rem; font-size: 0.73rem; color: var(--text-light); text-decoration: none; line-height: 1.4; border-left: 2.5px solid transparent; transition: color .2s, background .2s, border-color .2s; }
.dynamic-toc a:hover { color: var(--text); background: rgba(0,0,0,.03); }
.dynamic-toc a.active { color: var(--text); border-left-color: var(--heavy); font-weight: 600; background: var(--heavy-soft); }
.dynamic-toc .toc-sub a { padding-left: 1.6rem; color: #aaa; }
.dynamic-toc { transition: opacity .25s; }
.dynamic-toc.dimmed { opacity: 0; pointer-events: none; }
@media (max-width: 1400px) { .dynamic-toc { display: none; } }

/* ── Native figures (static/js/viz, static/js/figures) ─────── */
:root {
  --viz-text: #1f1f1f;
  --viz-text-2: #5f5f5b;
  --viz-muted: #8f8f8a;
  --viz-grid: #ececea;
  --viz-axis: #cfcfca;
  --viz-surface: #ffffff;
}
figure.viz { margin: 1.75rem 0 1.5rem; }
figure.viz > figcaption { text-align: left; margin-top: 0.75rem; }
/* A figure that breaks out of the text column, like .widget.wide. */
figure.viz.wide { width: min(1100px, calc(100vw - 3rem)); margin-left: calc(50% - min(550px, 50vw - 1.5rem)); }
.viz-mount { position: relative; min-height: 120px; }
.viz-svg { display: block; overflow: visible; font-family: var(--font-sans); }
.viz-svg text { font-family: var(--font-sans); }
.viz-tick { font-size: 10.5px; fill: var(--viz-muted); font-variant-numeric: tabular-nums; }
.viz-axis-title { font-size: 11.5px; fill: var(--viz-text-2); font-weight: 500; }
.viz-axis-line, .viz-tick-line { stroke: var(--viz-axis); stroke-width: 1; }
.viz-axis-arrow { stroke: #3a3a37; stroke-width: 1.2; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-ref-line { stroke: #9a9a95; stroke-width: 1; stroke-dasharray: 4 4; }
.viz-ref-label { font-size: 10px; fill: #8a8a85; font-style: italic; }
.viz-boundary { stroke: #2f2f2c; stroke-width: 1.6; stroke-linejoin: round; pointer-events: none; }
.viz-empty { font-size: 12px; fill: var(--viz-muted); }
.viz-crosshair { stroke: #b9b9b4; stroke-width: 1; }
.viz-hit { cursor: crosshair; outline: none; }
.viz-error { color: var(--heavy); font-size: 0.9rem; }

/* Controls: one row above the chart. */
.viz-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 1.1rem; margin-bottom: 0.9rem; }
.viz-control { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; min-width: 0; max-width: 100%; }
.viz-control-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); }
.viz-seg { display: inline-flex; max-width: 100%; border: 1px solid var(--border); border-radius: 7px; overflow-x: auto; overflow-y: hidden; background: #fff; scrollbar-width: none; }
.viz-seg::-webkit-scrollbar { display: none; }
.viz-seg button { font: inherit; font-size: 0.8rem; color: var(--text-muted); background: transparent; border: 0; padding: 0.3rem 0.7rem; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.viz-seg button + button { border-left: 1px solid var(--border); }
.viz-seg button:hover:not(.on):not(:disabled) { background: #f4f4f2; color: var(--text); }
.viz-seg button.on { background: var(--text); color: #fff; }
.viz-seg button:disabled { color: #c8c8c4; cursor: not-allowed; }
.viz-actions { margin-left: auto; display: flex; gap: 0.5rem; }
.viz-replay { font: inherit; font-size: 0.78rem; color: var(--text-muted); background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 0.28rem 0.65rem; cursor: pointer; }
.viz-replay:hover { border-color: var(--text); color: var(--text); }

/* Layouts */
/* The audit (figures/audit_grid.js, figures/audit.js): tiles | scatter */
.au-duo { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.2rem 1.6rem; align-items: start; }
.au-right { min-width: 0; }
.ag-wrap { position: relative; min-width: 0; }
.ag-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.ag-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem 0.75rem; }
.ag-tile { min-width: 0; outline: none; cursor: pointer; }
.ag-view { position: relative; aspect-ratio: 4 / 3; }
.ag-view.loading { background: linear-gradient(110deg, #f5f5f3 8%, #ebebe8 18%, #f5f5f3 33%); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }
.ag-view.failed { background: #f4f4f2; }
.ag-view::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.ag-view.swap::after { opacity: 1; }
.ag-grid.dim .ag-tile:not(.focus) .ag-view::after { opacity: 0.62; }
.ag-tile.focus .ag-view, .ag-tile:hover .ag-view, .ag-tile:focus-visible .ag-view { box-shadow: 0 0 0 2px #1f1f1f; }
.ag-grid.dim .ag-tile:not(.focus) .ag-cap { opacity: 0.4; }
.ag-chip { position: absolute; z-index: 1; padding: 0.1rem 0.42rem; border-radius: 999px; background: rgba(255, 255, 255, 0.92); font-size: 0.68rem; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); white-space: nowrap; transition: opacity .3s; }
.ag-chip-obj { left: 6px; bottom: 6px; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; color: var(--light); }
.ag-chip-ratio { top: 6px; right: 6px; color: var(--heavy); font-weight: 700; }
.ag-view.swap .ag-chip, .ag-view.loading .ag-chip { opacity: 0; }
.ag-cap { padding-top: 0.35rem; line-height: 1.3; transition: opacity .3s; }
.ag-l1 { display: flex; align-items: baseline; gap: 0.25rem; font-size: 0.84rem; white-space: nowrap; overflow: hidden; }
.ag-l1 strong { font-weight: 600; }
.ag-robot { color: var(--text-muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; }
.ag-coll { margin-left: auto; padding-left: 0.4rem; color: var(--text-light); font-size: 0.68rem; }
.ag-blurb { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-wrap.no-gl .ag-view { background: #f4f4f2; }
.au-box { min-width: 0; }
.au-actions { display: flex; justify-content: flex-end; margin-top: 0.2rem; }
.au-heavy { fill: rgba(192, 57, 43, 0.05); }
.au-heavy-label { font-size: 10.5px; fill: #bd8a83; font-style: italic; }
.au-equal { stroke: #3a3a37; stroke-width: 1.2; stroke-dasharray: 5 4; }
.au-equal-label { font-size: 10px; fill: #6f6f6b; font-style: italic; }
.au-iso { stroke: #cfcfca; stroke-width: 1; stroke-dasharray: 2 4; }
.au-iso-label { font-size: 10px; fill: #9a9a95; font-variant-numeric: tabular-nums; }
.au-study { fill: rgba(42, 100, 184, 0.04); stroke: #9bb3d6; stroke-width: 1.2; stroke-dasharray: 4 3; }
.au-study-label { font-size: 10.5px; fill: #4f72a8; font-weight: 600; }
.au-study-sub { font-size: 10px; fill: #7d93b8; }
.au-drop { stroke: rgba(192, 57, 43, 0.38); stroke-width: 1.5; }
.au-whisker { stroke: rgba(31, 31, 31, 0.3); stroke-width: 1.5; transition: opacity .3s; }
.au-mark { fill: #4a3aa7; stroke: #fff; stroke-width: 1.2; }
.au-mark.mg { fill: #e06a2c; }
.au-label { font-size: 10.5px; font-weight: 600; fill: var(--viz-text); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; transition: opacity .3s; }
.au-pt { outline: none; transition: opacity .2s; }
.au-ring { fill: none; stroke: #1f1f1f; stroke-width: 1.5; opacity: 0; pointer-events: none; }
.au-hit { fill: transparent; cursor: default; }
.au-heavy, .au-heavy-label, .au-equal, .au-equal-label, .au-iso, .au-iso-label, .au-study, .au-study-label, .au-study-sub, .au-drop, .au-whisker, .au-label { pointer-events: none; }
.au-pt.on .au-mark, .au-pt.focus .au-mark { stroke: #1f1f1f; stroke-width: 2; }
g.dim .au-pt:not(.focus) { opacity: 0.22; }
@media (max-width: 760px) { .au-duo { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Balanced two-column figures: equal columns, matched heights. */
.viz-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 1.75rem; align-items: start; }
.viz-duo + .viz-duo { margin-top: 1.6rem; }
.viz-panel { min-width: 0; }
.viz-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.1rem 0.75rem; margin-bottom: 0.45rem; min-height: 1.2rem; }
.viz-panel-head .viz-panel-title { margin: 0; }
.viz-panel-note { font-size: 0.74rem; color: var(--text-light); }
.viz-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 0.35rem; }
.viz-curve-note { min-height: 1.2em; }
.viz-chart-box { min-width: 0; }
.viz-key { display: flex; flex-wrap: wrap; gap: 0.1rem 0.9rem; font-size: 0.74rem; color: var(--text-muted); }
.viz-key span { display: inline-flex; align-items: center; gap: 0.35rem; }
.viz-key i { width: 16px; height: 0; display: inline-block; }

/* Live policy canvases (static/js/figures/live.js) */
.lv { position: relative; aspect-ratio: 1.08 / 1; border-radius: 8px; overflow: hidden; background: #f4f4f2; border: 1px solid #ebebe7; }
.lv canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lv-top { position: absolute; top: 9px; left: 11px; right: 9px; display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; pointer-events: none; z-index: 2; }
.lv-head { min-width: 0; line-height: 1.3; }
.lv-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-light); }
.lv-pair { font-size: 0.8rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.lv-tools { display: flex; gap: 5px; pointer-events: auto; }
.lv-tools button { font: 500 0.7rem/1 var(--font-sans); color: var(--text-muted); background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 6px; padding: 0.32rem 0.55rem; cursor: pointer; }
.lv-tools button:hover { color: var(--text); border-color: var(--text-muted); }
.lv-foot { position: absolute; left: 11px; right: 11px; bottom: 9px; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; pointer-events: none; z-index: 2; }
.lv-score { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.lv-rate { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lv-cmp { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lv-dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 46%; }
.lv-dot { width: 9px; height: 9px; border-radius: 50%; background: #d6d6d1; box-shadow: 0 0 0 1.5px rgba(255,255,255,.9); }
.lv-dot.ok { background: var(--goal); }
.lv-dot.bad { background: var(--heavy); }
.lv-clock { position: absolute; top: 46px; left: 11px; font-size: 0.68rem; color: var(--text-light); font-variant-numeric: tabular-nums; pointer-events: none; z-index: 2; }
.lv-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #f4f4f2; color: var(--text-muted); font-size: 0.8rem; z-index: 3; transition: opacity .4s; }
.lv-loading.hidden { opacity: 0; pointer-events: none; }
.lv-loading .w-spinner { width: 26px; height: 26px; border: 3px solid rgba(0,0,0,.08); border-top-color: var(--text); border-radius: 50%; animation: lv-spin .8s linear infinite; }
.lv-loading .w-error { color: var(--heavy); max-width: 80%; text-align: center; }
@keyframes lv-spin { to { transform: rotate(360deg); } }

.viz-note { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; margin-top: 0.4rem; }
.viz-panel-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); margin-bottom: 0.15rem; }

/* Heatmap cells */
.viz-cell { cursor: pointer; outline: none; }
.viz-cell rect { transition: stroke .12s; stroke: transparent; stroke-width: 0; }
.viz-cell rect.hover, .viz-cell:focus-visible rect { stroke: #1f1f1f; stroke-width: 1.5; }
.viz-cell.selected rect { stroke: #1f1f1f; stroke-width: 2.5; }
.viz-cell-value { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.viz-mark-label { font-size: 11.5px; font-weight: 700; }

/* Line charts */
.viz-linechart { min-width: 0; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.8rem; color: var(--text-muted); margin: 0.2rem 0 0.35rem; }
.viz-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.viz-legend-key { width: 18px; height: 0; display: inline-block; }
.viz-legend-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Tooltip */
.viz-tip { position: absolute; z-index: 30; pointer-events: none; background: #fff; border: 1px solid #e3e3e0; border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.08); padding: 0.45rem 0.6rem; font-size: 0.78rem; line-height: 1.45; color: var(--text-muted); min-width: 140px; max-width: 280px; opacity: 0; transform: translateY(3px); transition: opacity .12s, transform .12s; }
.viz-tip.show { opacity: 1; transform: none; }
.viz-tip-title { font-size: 0.72rem; color: var(--text-light); margin-bottom: 0.15rem; }
.viz-tip-row { display: flex; align-items: center; gap: 0.4rem; }
.viz-tip-row strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-tip-key { width: 14px; height: 0; flex: none; }
.viz-tip-swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.viz-tip-note { margin-top: 0.2rem; font-size: 0.72rem; color: var(--text-light); }

/* Table view */
.viz-table { margin-top: 0.6rem; font-size: 0.8rem; color: var(--text-muted); }
.viz-table summary { cursor: pointer; font-size: 0.75rem; color: var(--text-light); width: max-content; }
.viz-table summary:hover { color: var(--text); }
.viz-table table { border-collapse: collapse; margin-top: 0.4rem; font-variant-numeric: tabular-nums; overflow-x: auto; display: block; }
.viz-table th, .viz-table td { padding: 0.2rem 0.55rem; border-bottom: 1px solid #efefec; text-align: right; white-space: nowrap; }
.viz-table th { color: var(--text); font-weight: 600; }
.viz-table td:first-child, .viz-table th:first-child { text-align: left; }

/* The same mistake (figures/nudge.js) */
.nd-stage { position: relative; min-height: 220px; }
.nd-stage canvas { display: block; touch-action: none; cursor: crosshair; }
.nd-status { margin-top: 0.45rem; font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; min-height: 1.3em; }
.nd-reads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem 14px; margin-top: 0.5rem; }
.nd-read { min-width: 0; padding-top: 0.45rem; border-top: 2px solid #e4e4e0; }
.nd-read.nd-light { border-top-color: var(--light); }
.nd-read.nd-heavy { border-top-color: var(--heavy); }
.nd-read-head { display: flex; flex-direction: column; line-height: 1.3; }
.nd-read-head strong { font-size: 0.85rem; }
.nd-read-head span { font-size: 0.74rem; color: var(--text-light); }
.nd-read-value { margin-top: 0.3rem; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.nd-heavy .nd-read-value { color: var(--heavy); }
.nd-read-note { font-size: 0.76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Sec. IV: reflected inertia (figures/rotor.js) */
.rt-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.4rem 1.4rem; margin-bottom: 1.1rem; }
.rt-dial-label { display: flex; flex-direction: column; gap: 0.05rem; }
.rt-s { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-dial { position: relative; padding-bottom: 1.35rem; }
.rt-dial input { --fill: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; }
.rt-dial input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--heavy) var(--fill), #dedcd6 var(--fill)); }
.rt-dial input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--heavy) var(--fill), #dedcd6 var(--fill)); }
.rt-dial input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; border: 2px solid var(--heavy); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.rt-dial input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--heavy); }
.rt-dial input:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; border-radius: 4px; }
.rt-ticks { position: absolute; left: 10px; right: 10px; top: 24px; height: 1.2rem; }
.rt-tick { position: absolute; transform: translateX(-50%); font: 500 0.7rem/1 var(--font-sans); color: var(--text-light); background: none; border: 0; padding: 0.15rem 0.2rem; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt-tick::before { content: ''; position: absolute; left: 50%; top: -6px; width: 1px; height: 5px; background: #c9c9c4; }
.rt-tick:hover { color: var(--text); }
.rt-tick.real { color: var(--text); font-weight: 600; }
.rt-stage { position: relative; aspect-ratio: 1.12 / 1; border-radius: 8px; overflow: hidden; background: #f4f4f2; border: 1px solid #ebebe7; }
.rt-stage canvas { display: block; touch-action: pan-y; }
.rt-over { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 0.5rem; pointer-events: none; z-index: 2; }
.rt-read { display: flex; flex-direction: column; line-height: 1.25; }
.rt-read-r { align-items: flex-end; text-align: right; }
.rt-read-k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-light); }
.rt-read-v { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.rt-read-v.heavy { color: var(--heavy); }
.rt-read-n { font-size: 0.7rem; color: var(--text-muted); }
.rt-share { margin-top: 0.7rem; }
.rt-share-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-size: 0.76rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.rt-share-head strong { color: var(--heavy); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rt-bar { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.rt-bar-track { position: relative; width: 100%; height: 44px; border-radius: 3px; background: #e6e5e1; overflow: hidden; }
.rt-bar-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--heavy); opacity: 0.85; transition: height .12s linear; }
.rt-bar-j { font-size: 0.66rem; color: var(--text-light); font-variant-numeric: tabular-nums; }
.rt-chart { position: relative; min-height: 300px; }
.rt-bc-read { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; min-height: 2.9em; margin-top: 0.2rem; }
.rt-bc-read b { color: var(--text); font-variant-numeric: tabular-nums; }
.rt-band { fill: rgba(192, 57, 43, 0.08); transition: x .12s linear; }
.rt-top-tick { fill: var(--heavy); opacity: 0.85; }
.rt-dot { transition: r .2s; }
.rt-dot.on { r: 5; stroke: #1f1f1f; }
.rt-mean { fill: none; stroke: var(--heavy); stroke-width: 2.2; stroke-linejoin: round; }
.rt-mean-dot { fill: #fff; stroke: var(--heavy); stroke-width: 2; transition: r .2s; }
.rt-mean-dot.on { r: 6.5; fill: var(--heavy); }
.rt-legend { font-size: 10.5px; fill: var(--viz-text-2); }
.rt-legend-sm { font-size: 9.5px; fill: var(--viz-muted); }
.rt-col { cursor: pointer; }
@media (max-width: 760px) { .rt-controls { grid-template-columns: 1fr; } }

/* Side-by-side 3D replays (dual_stage.js; figures/placement.js, figures/franka.js) */
.ds-stage { position: relative; aspect-ratio: 2.05 / 1; border-radius: 8px; overflow: hidden; background: #fff; }
.ds-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.ds-canvas:active { cursor: grabbing; }
.ds-label { position: absolute; top: 10px; display: flex; flex-direction: column; line-height: 1.25; pointer-events: none; z-index: 2; text-shadow: 0 0 6px #f4f4f2, 0 0 2px #f4f4f2; }
.ds-ground { left: 12px; }
.ds-elevated { left: calc(50% + 20px); }
.ds-label-k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.ds-ground .ds-label-k { color: var(--heavy); }
.ds-elevated .ds-label-k { color: var(--light); }
.ds-label-v { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ds-label-n { font-size: 0.7rem; color: var(--text-muted); }
.ds-trace { margin-top: 0.6rem; min-height: 170px; }
.ds-ref { font-size: 10.5px; font-weight: 500; }
.ds-head { stroke: #1f1f1f; stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.55; }
@media (max-width: 640px) { .ds-stage { aspect-ratio: 1.3 / 1; } .ds-label-v { font-size: 1rem; } .ds-label-n { display: none; } }

/* Paired comparisons (figures/outcomes.js) */
.sl-box { min-width: 0; }
.sl-axis { stroke: #d7d7d2; stroke-width: 1; }
.sl-col { font-size: 11.5px; font-weight: 600; }
.sl-line { stroke-width: 1.3; opacity: 0.42; transition: opacity .15s, stroke-width .15s; }
.sl-line.strong { stroke-width: 2.4; opacity: 0.85; }
.sl-line.on { opacity: 1; stroke-width: 2.8; }
.sl-hit { stroke: transparent; stroke-width: 9; cursor: pointer; }
.sl-end { stroke: #fff; stroke-width: 1; }
.sl-mean { stroke: #1f1f1f; stroke-width: 3; }
.sl-mean-end { stroke: #fff; stroke-width: 2; }
.sl-mean-lab { font-size: 12px; font-weight: 600; fill: var(--viz-text); font-variant-numeric: tabular-nums; }
.sl-lab { font-size: 10.5px; fill: var(--viz-text-2); font-variant-numeric: tabular-nums; }
.sl-gain { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sl-one { stroke: #1f1f1f; stroke-width: 1.2; stroke-dasharray: 3 3; }
.sl-note { font-size: 10.5px; fill: var(--viz-muted); font-style: italic; }
.sl-stem { stroke: var(--light); stroke-width: 2; opacity: 0.55; }
.sl-dot { stroke: #fff; stroke-width: 1.2; }

/* What bounds each lever (figures/outcomes.js, mountLadder) */
.ld-box { min-width: 0; }
.ld-label { font-size: 12px; font-weight: 600; fill: var(--viz-text); }
.ld-note { font-size: 10.5px; fill: var(--viz-muted); }
.ld-rail { stroke: #ecebe7; stroke-width: 1; }
.ld-range { stroke: rgba(192, 57, 43, 0.28); stroke-width: 8; stroke-linecap: round; }
.ld-tick { stroke: rgba(192, 57, 43, 0.75); stroke-width: 1.2; }
.ld-arrow { stroke: #1f1f1f; stroke-width: 2; }
.ld-head { fill: #1f1f1f; }
.ld-dot { stroke: #fff; stroke-width: 1; cursor: default; }
.ld-val { font-size: 11px; font-weight: 600; fill: var(--viz-text); font-variant-numeric: tabular-nums; transition: opacity .3s; }
.ld-to { fill: var(--light); }
.ld-obj { font-size: 10.5px; font-weight: 500; fill: var(--goal); }
.ld-obj-range { stroke: rgba(46, 139, 87, 0.45); stroke-width: 8; stroke-linecap: round; }
.ld-pct { font-size: 10.5px; fill: var(--viz-text-2); font-variant-numeric: tabular-nums; transition: opacity .3s; }

/* Conclusion: open directions, tagged by lever */
.directions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2rem; margin-top: 1.4rem; }
.direction h4 { font-size: 1.02rem; font-weight: 600; margin: 0.15rem 0 0.3rem; }
.direction p { font-size: 0.93rem; color: var(--text-muted); line-height: 1.55; }
.direction-k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); }
@media (max-width: 760px) { .directions { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .viz-tip { transition: none; }
  .carousel-item { transition-duration: .01s; }
}
@media (max-width: 760px) {
  .viz-duo { grid-template-columns: 1fr; }
  .claim { padding-left: 2.3rem; font-size: 1.1rem; }
  .claim-n { width: 1.6rem; font-size: 1.8rem; }
  .viz-massmap svg { width: 100%; height: auto; }
  .viz-actions { margin-left: 0; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 860px) {
  .poll-options { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .section { padding: 1.75rem 0; }
  .section h2 { font-size: 1.45rem; }
  .section h3 { font-size: 1.1rem; }
  .container { padding: 0 1rem; }
  .author-list { font-size: 0.95rem; gap: 0.2rem 1rem; }
  .abstract-text { text-align: left; }
  .katex-display { overflow-x: auto; overflow-y: hidden; padding: 0.25rem 0; }
  .sticky-authors, .sticky-venue, .sticky-sep { display: none; }
  .widget.wide, figure.viz.wide { width: auto; margin-left: 0; }
  .hero-stage { aspect-ratio: 1.3 / 1; }
  .hero-read { top: 0; }
  .hero-read-arm { left: 0.1rem; }
  .hero-read-obj { right: 0.1rem; }
  .hero-read-label { font-size: 0.6rem; letter-spacing: 0.05em; }
  .hero-read-label .long { display: none; }
  .hero-read-label .short { display: inline; }
  .hero-read-value { font-size: 1.2rem; }
  .hero-read-sub { font-size: 0.68rem; }
  .hero-read-obj .hero-read-sub, .hero-read-arm .hero-read-sub { display: none; }
  .hero-hint, .hero-status { font-size: 0.72rem; }
  .hero-badge { bottom: 1.6rem; max-width: calc(100% - 1rem); }
  .hero-robots button { font-size: 0.72rem; padding: 0.32rem 0.55rem; }
  .hero-posture { gap: 0.6rem; }
  .hero-posture-name { font-size: 0.6rem; letter-spacing: 0.05em; }
  .hero-posture-name .long { display: none; }
  .hero-posture-name .short { display: inline; }
  .hero-posture-mass { font-size: 0.8rem; }
  .widget-frame.tall { height: 1180px !important; }
  .widget-frame.playground { height: 1140px !important; }
  .carousel, .carousel.demos { --item-w: 84%; --step: 74%; }
  .meanwhile { font-size: 1rem; gap: 0.6rem; }
  }
@media print {
  .btn, .copy-btn, .widget, .dynamic-toc, .sticky-header { display: none; }
}
