/* DanceOPD shell restyled to match the DiffusionOPSD project-page language. */
:root {
  --ink: #1e1f24;
  --muted: #686b73;
  --line: #e3e5ea;
  --soft: #f5f6f8;
  --blue: #2c63d6;
  --deep-blue: #0d2a76;
  --cyan: #4ac7d4;
  --navy: #10182d;
  --white: #fff;
  --page: 1440px;
  --radius: 14px;
  --shadow: 0 24px 70px rgba(14, 24, 54, .12);
}

html { scroll-padding-top: 76px; }
body {
  color: var(--ink);
  background: var(--white);
  font-family: Inter, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
a { text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #111;
  background: #fff;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.scroll-progress {
  z-index: 160;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: none;
}

/* Fixed navigation: copied from the DiffusionOPSD interaction pattern. */
.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 5.4vw;
  color: #fff;
  transition: height .35s ease, background .35s ease, color .35s ease, box-shadow .35s ease;
}
.site-header button,
.site-header a { font-family: inherit; }
.site-header.scrolled {
  height: 74px;
  color: var(--ink);
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(20, 25, 40, .08);
}
.brand { width: 214px; justify-self: start; }
.brand img {
  width: 100%;
  height: auto;
  filter: brightness(0) invert(1);
}
.site-header.scrolled .brand img { filter: none; }

.desktop-nav { display: flex; align-items: center; gap: 10px; }
.desktop-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  background: rgba(255,255,255,.11);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.desktop-nav a:hover,
.desktop-nav a.active {
  color: #131722;
  background: rgba(255,255,255,.92);
  transform: translateY(-1px);
}
.site-header.scrolled .desktop-nav a { background: #f0f1f4; }
.site-header.scrolled .desktop-nav a:hover,
.site-header.scrolled .desktop-nav a.active { color: #fff; background: #171b27; }

.header-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.research-menu { position: relative; }
.header-paper {
  appearance: none;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  transition: background .2s ease, color .2s ease;
}
.header-paper:hover { color: #121725; background: #fff; }
.site-header.scrolled .header-paper { border-color: #222; }
.site-header.scrolled .header-paper:hover { color: #fff; background: #171b27; }
.research-chevron { margin: -3px 0 0 8px; font-size: 15px; transition: transform .2s ease; }
.research-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 252px;
  padding: 8px;
  border: 1px solid rgba(24,29,41,.11);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255,255,255,.98);
  box-shadow: 0 20px 55px rgba(12,18,32,.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.research-popover::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -13px;
  height: 13px;
}
.research-menu:hover .research-popover,
.research-menu:focus-within .research-popover,
.research-menu.is-open .research-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.research-menu:hover .research-chevron,
.research-menu:focus-within .research-chevron,
.research-menu.is-open .research-chevron { transform: rotate(180deg); }
.research-popover a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 9px;
  background: #f3f4f7;
  transition: color .2s ease, background .2s ease;
}
.research-popover a:hover { color: #fff; background: #171b27; }
.research-popover strong,
.research-popover small { display: block; }
.research-popover strong { margin-bottom: 5px; font-size: 15px; }
.research-popover small { color: var(--muted); font-size: 11px; }
.research-popover a:hover small { color: rgba(255,255,255,.62); }

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: rgba(255,255,255,.15);
}
.menu-button span {
  display: block;
  width: 18px;
  height: 1px;
  margin: 5px auto;
  background: currentColor;
  transition: transform .25s ease;
}
.mobile-nav { display: none; }
.mobile-research-menu summary {
  padding: 14px 10px;
  color: var(--blue);
  cursor: pointer;
  font-weight: 600;
}
.mobile-research-menu > a {
  margin: 0 8px 8px;
  border: 0 !important;
  border-radius: 8px;
  background: #f1f3f7;
}

/* Full-screen editorial hero with DanceOPD content and the original author list. */
.hero {
  position: relative;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: #fff;
  background: var(--navy);
}
.hero-media,
.hero-overlay { position: absolute; inset: 0; }
.hero-media {
  background-image: url("../../assets/figures/fig2.webp");
  background-position: center 48%;
  background-size: cover;
  transform: scale(1.035);
  animation: danceHeroDrift 18s ease-in-out infinite alternate;
}
.hero-overlay {
  background:
    linear-gradient(90deg, rgba(6,10,22,.90) 0%, rgba(6,10,22,.61) 48%, rgba(6,10,22,.25) 100%),
    linear-gradient(0deg, rgba(7,12,28,.85) 0%, transparent 55%),
    linear-gradient(180deg, rgba(4,8,20,.58) 0%, transparent 28%);
}
@keyframes danceHeroDrift {
  from { transform: scale(1.035) translate3d(0,0,0); }
  to { transform: scale(1.095) translate3d(-.7%,-.6%,0); }
}
.hero-copy {
  position: absolute;
  z-index: 2;
  left: clamp(28px, 5.4vw, 88px);
  bottom: clamp(74px, 10vh, 112px);
  width: min(900px, 66vw);
}
.hero h1 {
  margin: 0;
  font-size: clamp(76px, 8.1vw, 132px);
  font-weight: 600;
  letter-spacing: -.075em;
  line-height: .88;
  text-wrap: balance;
}
.hero h1 span { display: inline; }
.hero h1 .title-accent {
  color: #7ddde2;
  text-shadow: 0 0 42px rgba(78,214,224,.3);
}
.hero-subtitle {
  margin: 21px 0 10px;
  font-size: clamp(20px, 1.65vw, 28px);
  font-weight: 500;
  letter-spacing: -.025em;
}
.hero-authors {
  max-width: 850px;
  margin: 0 0 13px;
  color: rgba(255,255,255,.95);
  font-size: clamp(13px, 1.05vw, 16px);
  font-weight: 500;
  line-height: 1.55;
  text-wrap: balance;
}
.hero-description {
  max-width: 720px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 15px;
  line-height: 1.55;
}
.hero-buttons {
  position: absolute;
  z-index: 3;
  right: clamp(28px, 4vw, 66px);
  bottom: clamp(50px, 6.6vh, 70px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.hero .button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.hero .button:hover { transform: translateY(-2px); }
.hero .button-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.hero .arxiv-mark {
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
.button-solid { color: #161a25 !important; background: #fff !important; }
.button-solid:hover { background: #e9f9fa !important; }
.button-glass {
  color: #fff !important;
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.68) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.button-glass:hover { background: rgba(255,255,255,.23) !important; }
.scroll-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: translateX(-50%);
}
.scroll-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(#fff, transparent);
  animation: danceScrollPulse 1.7s ease-in-out infinite;
}
@keyframes danceScrollPulse { 50% { opacity: .25; transform: scaleY(.75); } }

/* Convert the original Distill-style body to DiffusionOPSD's spacious sections. */
d-article {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}
d-article > section {
  margin: 0;
  scroll-margin-top: 74px;
}
d-article > section:nth-of-type(even) { background: var(--soft); }
d-article > section:nth-of-type(odd) { background: #fff; }
.wb-section {
  width: min(var(--page), calc(100% - 80px));
  margin: 0 auto;
  padding: 112px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.wb-section h2 {
  max-width: 1050px;
  margin: 0 0 14px;
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(38px, 3.4vw, 56px);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.wb-kicker {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ar-hr {
  width: 100%;
  height: 1px;
  margin: 0 0 28px;
  background: var(--line);
}
.lead {
  max-width: 980px;
  margin: 0 0 44px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.68;
}
.small-note { color: var(--muted); }

.hero-callout {
  margin-bottom: 28px;
  padding: clamp(28px, 4vw, 54px);
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(circle at 86% 0%, rgba(74,199,212,.30), transparent 25rem),
    linear-gradient(145deg, #17233f 0%, #0c286f 100%);
  box-shadow: none;
}
.hero-callout::after { content: "D"; color: rgba(255,255,255,.055); }
.hero-tag {
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.08);
}
.hero-quote {
  max-width: 1060px;
  font-family: Inter, "PingFang SC", sans-serif;
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.045em;
}

.figure-card,
.formula-visual-card,
.step-card,
.card,
.regime-card,
.result-card,
.stat-card {
  border-color: var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
}
.figure-card {
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.figure-card img { width: 100%; }
.figure-card figcaption {
  color: var(--muted);
  background: #fff;
}
.figure-caption-label { color: var(--ink); }

.method-anim-card,
.overview-exact { margin-top: 24px; }
.method-anim-stage { border-radius: var(--radius) var(--radius) 0 0; }
.overview-image-readout { border-top-color: var(--line); background: #fff; }

.stats-grid { gap: 14px; margin-top: 24px; }
.stat-card {
  min-height: 210px;
  padding: 27px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-num {
  color: var(--deep-blue);
  font-family: Inter, sans-serif;
  font-size: clamp(46px, 4vw, 70px);
  font-weight: 600;
  letter-spacing: -.065em;
}
.stat-label {
  max-width: 245px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.challenge-map,
.card-grid,
.diagnostic-grid { gap: 18px; }
.challenge-card,
.metric-card,
.regime-card,
.step-card,
.result-card { padding: 30px; }
.challenge-card,
.metric-card { min-height: 250px; }
.challenge-card h3,
.metric-card h3,
.regime-card h3,
.step-card h3,
.result-card h3 {
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: -.035em;
}
.challenge-card p,
.metric-card p,
.regime-card p,
.step-card p,
.result-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}
.card-icon,
.regime-label,
.step-index { color: var(--blue); }
.solution-pill {
  color: #2250a8;
  background: #eaf1ff;
}

.formula-visual-grid { gap: 18px; }
.formula-visual-card { padding: 30px; }
.formula-card-title { color: var(--blue); }
.formula-chip { color: #315387; background: #eef3fb; }
.formula-main { color: var(--deep-blue); }

.result-summary-grid { gap: 18px; }
.result-card.strong {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, #245cc7 0%, #0e348f 100%);
}
.result-card.strong h3,
.result-card.strong p,
.result-card.strong .regime-label { color: #fff; }
.tabs { gap: 7px; }
.tab-btn {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid #d4d6df;
  border-radius: 999px;
  color: #555a66;
  background: #fff;
}
.tab-btn.active { color: #fff; border-color: #171b27; background: #171b27; }
.result-table-wrap {
  border-color: #d8dbe3;
  border-radius: var(--radius);
  box-shadow: 0 17px 40px rgba(34,40,76,.07);
}
.result-table th { color: #292b32; background: #eceef2; }
.result-table tr.ours td { background: #edf4ff; }

.gallery-grid { gap: 18px; }
.paper-gallery .figure-card,
.diagnostic-figures .figure-card { transition: transform .25s ease, box-shadow .25s ease; }
.paper-gallery .figure-card:hover,
.diagnostic-figures .figure-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 75px rgba(14,24,54,.16);
}

.citation-section { padding: 72px 0; background: #fff !important; }
.citation-box {
  width: min(var(--page), calc(100% - 80px));
  margin: 0 auto;
  padding: 30px;
  border: 1px solid #dfe1e6;
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}
.citation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}
.citation-heading .kicker {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.citation-copy-button {
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #171b27;
  box-shadow: none;
  cursor: pointer;
}
.citation-copy-button:hover { color: #fff; background: var(--blue); }
.citation-box pre {
  margin: 0;
  padding: 24px 26px;
  overflow-x: auto;
  border-radius: 10px;
  color: #e5ecff;
  background: #111827;
  white-space: pre;
  font: 13px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.citation-box code { font: inherit; }
.site-footer {
  min-height: 148px;
  display: flex;
  align-items: center;
  padding: 42px max(40px, calc((100vw - var(--page)) / 2));
  color: #fff;
  background: #050505;
}
.footer-brand { display: block; width: 248px; }
.footer-brand img { width: 100%; height: auto; filter: brightness(0) invert(1); }
.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: 28px;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: #171b27;
  box-shadow: 0 12px 40px rgba(0,0,0,.24);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1200px) {
  .site-header { padding: 0 32px; }
  .desktop-nav a { min-width: 0; padding: 0 13px; }
  .brand { width: 190px; }
  .hero-copy { width: min(850px, calc(100% - 56px)); }
  .hero-buttons {
    left: 28px;
    right: 28px;
    bottom: 42px;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .site-header { height: 76px; grid-template-columns: 1fr auto; }
  .brand { width: 178px; }
  .desktop-nav,
  .research-menu { display: none; }
  .menu-button { display: block; }
  .site-header.scrolled .menu-button { background: #eff0f3; }
  .menu-button[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
  .menu-button[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
  .mobile-nav {
    position: fixed;
    z-index: 99;
    top: 76px;
    left: 20px;
    right: 20px;
    max-height: calc(100vh - 96px);
    overflow: auto;
    padding: 12px;
    border: 1px solid #e5e7ec;
    border-radius: 14px;
    color: var(--ink);
    background: rgba(255,255,255,.97);
    box-shadow: 0 24px 70px rgba(0,0,0,.18);
  }
  .mobile-nav.open { display: grid; }
  .mobile-nav a { padding: 14px 10px; border-bottom: 1px solid #eceef1; }
  .mobile-research-menu { border-top: 1px solid #eceef1; }
  .hero-copy { top: 23vh; bottom: auto; width: calc(100% - 56px); }
  .hero h1 { font-size: clamp(64px, 13vw, 105px); }
  .hero-authors { max-width: 720px; }
  .hero-description { max-width: 630px; }
  .hero-buttons { justify-content: flex-start; }
  .scroll-cue { display: none; }
  .wb-section { width: min(var(--page), calc(100% - 48px)); padding: 90px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-header { padding-inline: 20px; }
  .brand { width: 178px; }
  .hero-media { background-position: 50% 45%; }
  .hero-copy { top: 18vh; left: 22px; width: calc(100% - 44px); }
  .hero h1 { font-size: clamp(60px, 19vw, 86px); }
  .hero-subtitle { margin-top: 16px; font-size: 19px; }
  .hero-authors { font-size: 12px; line-height: 1.45; }
  .hero-description { font-size: 13px; }
  .hero-buttons {
    left: 22px;
    right: 22px;
    bottom: 28px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
  .hero .button { min-width: 0; padding-inline: 9px; font-size: 12px; }
  .hero .button-icon { display: none; }
  .wb-section { width: calc(100% - 34px); padding: 72px 0; }
  .wb-section h2 { font-size: 34px; }
  .lead { font-size: 15px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 170px; }
  .challenge-card,
  .metric-card,
  .regime-card,
  .step-card,
  .result-card,
  .formula-visual-card { padding: 22px; }
  .footer { padding-inline: 24px; }
}

@media (max-width: 600px) {
  .brand { width: 154px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media,
  .scroll-line { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* --- Method-card corrections and direct manipulation controls. --- */
.formula-main {
  margin-top: 10px !important;
  padding: 12px 2px 0 !important;
  border-top: 1px solid #dce3ef;
  border-radius: 0 !important;
  color: var(--deep-blue) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.method-steps-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  width: 100%;
}

.method-interaction-bar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e8ef;
  color: #4c5361;
  background: #f8f9fb;
}
.method-field-controls {
  display: flex;
  gap: 7px;
  align-items: center;
}
.method-field-controls > span {
  margin-right: 3px;
  color: #656c78;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.method-field-button,
.method-play-button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #d3d8e2;
  border-radius: 999px;
  color: #343a46;
  background: #fff;
  font: 700 12px/1 Inter, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.method-field-button:hover,
.method-play-button:hover { transform: translateY(-1px); border-color: #9da9bb; }
.method-field-button[aria-pressed="true"] { color: #fff; border-color: transparent; }
.field-blue-button[aria-pressed="true"] { background: #1769d1; }
.field-red-button[aria-pressed="true"] { background: #e05252; }
.field-green-button[aria-pressed="true"] { background: #159b69; }
.method-play-button { color: #1c4fa3; }
.method-interaction-status {
  min-width: 0;
  color: #6a717d;
  font-size: 13px;
  text-align: center;
}
.method-anim-card.animations-paused .method-anim-svg *,
.method-anim-card.is-manual .method-anim-svg * {
  animation-play-state: paused !important;
}
.method-anim-card.is-manual .field { opacity: .22 !important; }
.method-anim-card.is-manual[data-field="blue"] .field-blue,
.method-anim-card.is-manual[data-field="red"] .field-red,
.method-anim-card.is-manual[data-field="green"] .field-green { opacity: 1 !important; }
.method-anim-card.is-manual .route-arm,
.method-anim-card.is-manual .latent-flow-layer,
.method-anim-card.is-manual .rollout-layer,
.method-anim-card.is-manual .v-vector-layer,
.method-anim-card.is-manual .mse-link-layer { opacity: 0 !important; }
.method-anim-card.is-manual[data-field="blue"] :is(.route-arm-blue, .latent-flow-blue, .rollout-blue-layer, .v-vector-blue, .mse-link-blue),
.method-anim-card.is-manual[data-field="red"] :is(.route-arm-red, .latent-flow-red, .rollout-red-layer, .v-vector-red, .mse-link-red),
.method-anim-card.is-manual[data-field="green"] :is(.route-arm-green, .latent-flow-green, .rollout-green-layer, .v-vector-green, .mse-link-green) {
  opacity: 1 !important;
}
.method-anim-card.is-manual[data-field="red"] .selected-arrow { stroke: #e05252 !important; }
.method-anim-card.is-manual[data-field="green"] .selected-arrow { stroke: #159b69 !important; }

@media (max-width: 900px) {
  .method-steps-wide { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .method-interaction-bar { grid-template-columns: 1fr auto; }
  .method-interaction-status { grid-column: 1 / -1; grid-row: 2; text-align: left; }
}

@media (max-width: 720px) {
  .method-steps-wide { grid-template-columns: 1fr !important; }
  .method-interaction-bar { grid-template-columns: 1fr; gap: 9px; }
  .method-field-controls { flex-wrap: wrap; }
  .method-play-button { justify-self: start; }
  .method-interaction-status { grid-column: 1; grid-row: auto; text-align: left; }
}

/* --- High-contrast result controls. --- */
.result-card.strong .regime-label {
  display: inline-flex;
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 999px;
  color: #1749a5 !important;
  background: #fff !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.12);
  font-weight: 850;
}
.tab-btn {
  color: #1f2937 !important;
  border-color: #c7ced9 !important;
  background: #e9edf4 !important;
  font-weight: 750;
}
.tab-btn:hover { color: #0f2f69 !important; border-color: #7696cc !important; background: #dce7f8 !important; }
.tab-btn.active {
  color: #fff !important;
  border-color: #1749a5 !important;
  background: #1749a5 !important;
  box-shadow: 0 6px 18px rgba(23,73,165,.22);
}

.gallery-jump {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid #d6dfed;
  border-radius: 13px;
  color: #1f2937;
  background: #f5f8fd;
  text-decoration: none;
}
.gallery-jump span { font-size: 13px; font-weight: 650; }
.gallery-jump b { color: #1749a5; font-size: 14px; }

/* --- Native interactive SVG charts, following DiffusionOPSD's chart shell. --- */
.native-chart-stack { display: grid; gap: 26px; margin-top: 34px; }
.native-chart-card {
  overflow: hidden;
  border: 1px solid #dcdfe6;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31,42,68,.07);
}
.native-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
  padding: 17px 20px;
  border-bottom: 1px solid #eceef2;
  background: #f9fafc;
}
.native-chart-head > div span,
.native-chart-head > div strong { display: block; }
.native-chart-head > div span {
  margin-bottom: 4px;
  color: #245fc4;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.native-chart-head > div strong { color: #404755; font-size: 13px; }
.native-chart-head p { max-width: 460px; margin: 0; color: #6d7481; font-size: 11px; line-height: 1.45; text-align: right; }
.native-chart-stage {
  position: relative;
  min-height: 330px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
}
.native-chart-canvas { position: relative; z-index: 2; }
.native-chart-canvas svg {
  display: block;
  width: 100%;
  min-width: 1020px;
  height: auto;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}
.native-chart-fallback { display: block; width: 100%; height: auto; }
.native-chart-card.is-ready .native-chart-fallback { display: none; }
.native-chart-tooltip {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  min-width: 170px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.78);
  background: rgba(14,19,30,.94);
  box-shadow: 0 14px 36px rgba(0,0,0,.25);
  font-size: 10px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(12px,-50%);
  transition: opacity .12s ease;
}
.native-chart-tooltip.show { opacity: 1; }
.native-chart-tooltip strong { display: block; margin-bottom: 4px; color: #fff; font-size: 11px; }
.native-chart-tooltip span { display: block; }
.native-chart-readout {
  display: grid;
  grid-template-columns: minmax(190px, .35fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 58px;
  align-items: center;
  padding: 13px 20px;
  border-top: 1px solid #eceef2;
  background: #f9fafc;
}
.native-chart-readout strong { color: #1749a5; font-size: 12px; }
.native-chart-readout span { color: #626b79; font-size: 11px; line-height: 1.45; }
.dance-chart-grid { stroke: #e8ebf0; stroke-width: 1; }
.dance-chart-axis { stroke: #aeb6c2; stroke-width: 1; }
.dance-chart-tick { fill: #626b79; font-size: 11px; }
.dance-chart-title { fill: #1d2635; font-size: 15px; font-weight: 800; }
.dance-chart-axis-title { fill: #4f5868; font-size: 11px; font-weight: 650; }
.dance-series-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: opacity .16s ease, stroke-width .16s ease;
}
.dance-series-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  cursor: crosshair;
  pointer-events: stroke;
}
.dance-chart-point,
.dance-chart-bar,
.dance-chart-bubble { cursor: pointer; outline: none; }
.dance-chart-point .point-halo,
.dance-chart-bar .bar-focus,
.dance-chart-bubble .bubble-focus { fill: transparent; stroke: transparent; stroke-width: 3; }
.dance-chart-point:hover .point-halo,
.dance-chart-point:focus-visible .point-halo,
.dance-chart-point.is-selected .point-halo,
.dance-chart-bar:hover .bar-focus,
.dance-chart-bar:focus-visible .bar-focus,
.dance-chart-bar.is-selected .bar-focus,
.dance-chart-bubble:hover .bubble-focus,
.dance-chart-bubble:focus-visible .bubble-focus,
.dance-chart-bubble.is-selected .bubble-focus { fill: rgba(36,95,196,.08); stroke: #245fc4; }
.dance-chart-point:hover .point-core,
.dance-chart-point.is-selected .point-core { stroke-width: 4; }
.dance-chart-bar:hover .bar-core,
.dance-chart-bar.is-selected .bar-core { filter: brightness(.9); }
.dance-bar-value { fill: #333c49; font-size: 10px; font-weight: 750; text-anchor: middle; }
.dance-bar-label { fill: #555f6e; font-size: 10px; text-anchor: end; }
.dance-bubble-value { fill: #fff; font-size: 12px; font-weight: 800; text-anchor: middle; pointer-events: none; }

/* --- Standalone qualitative overview + prompt-level sliding comparison. --- */
.qualitative-overview-card {
  overflow: hidden;
  margin: 30px 0 48px;
  border: 1px solid #dfe3e9;
  border-radius: 18px;
  background: #fff;
}
.qualitative-overview-copy {
  display: grid;
  grid-template-columns: 150px minmax(240px,.6fr) minmax(0,1fr);
  gap: 22px;
  align-items: baseline;
  padding: 22px 24px 20px;
  border-bottom: 1px solid #e6e8ed;
}
.qualitative-overview-copy > span,
.prompt-explorer-heading > div > span {
  color: #245fc4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.qualitative-overview-copy h3,
.prompt-explorer-heading h3 {
  margin: 0;
  color: #202733;
  font: 750 21px/1.2 Inter, "Helvetica Neue", Arial, sans-serif;
}
.qualitative-overview-copy p,
.prompt-explorer-heading p {
  margin: 0;
  color: #68707e;
  font-size: 13px;
  line-height: 1.55;
}
.qualitative-overview-card > img {
  display: block;
  width: 100%;
  max-height: 780px;
  object-fit: contain;
  background: #f5f6f8;
}
.prompt-explorer-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.prompt-explorer-heading > div { display: grid; gap: 7px; }
.prompt-explorer-heading > p { max-width: 360px; text-align: right; }

.dance-carousel { position: relative; margin-top: 0; }
.dance-carousel-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dance-carousel-count { color: #245fc4; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.dance-carousel-arrows { display: flex; gap: 8px; }
.dance-round-button {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #cfd5df;
  border-radius: 50%;
  color: #1f2937;
  background: #fff;
  cursor: pointer;
  font-size: 19px;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.dance-round-button:hover { color: #fff; background: #1749a5; transform: translateY(-1px); }
.dance-carousel-viewport { overflow: hidden; border-radius: 16px; outline: none; touch-action: pan-y; transition: height .35s ease; }
.dance-carousel-viewport:focus-visible { box-shadow: 0 0 0 3px rgba(36,95,196,.25); }
.dance-carousel-track { display: flex; align-items: flex-start; transition: transform .52s cubic-bezier(.22,.7,.2,1); will-change: transform; }
.dance-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  padding: 24px;
  border: 1px solid #dfe3e9;
  border-radius: 16px;
  background: #fff;
}
.dance-slide-copy {
  display: grid;
  grid-template-columns: 96px minmax(220px,.55fr) minmax(0,1fr);
  gap: 20px;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e6e8ed;
}
.dance-slide-copy span { color: #245fc4; font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.dance-slide-copy h3 { margin: 0; color: #202733; font: 750 20px/1.2 Inter, "Helvetica Neue", Arial, sans-serif; }
.dance-slide-copy p { margin: 0; color: #68707e; font-size: 13px; line-height: 1.5; }
.dance-comparison-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.dance-comparison-grid[data-cells="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dance-comparison-grid[data-cells="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dance-comparison-grid[data-cells="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dance-comparison-cell {
  overflow: hidden;
  min-width: 0;
  border: 1px solid #dfe3e9;
  border-radius: 12px;
  background: #f5f6f8;
}
.dance-comparison-cell.is-highlighted {
  border-color: #245fc4;
  box-shadow: inset 0 0 0 1px #245fc4;
}
.dance-comparison-cell img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.dance-comparison-cell span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 8px 10px;
  border-top: 1px solid #e0e4ea;
  color: #4f5968;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.dance-comparison-cell.is-highlighted span {
  color: #1749a5;
  background: #f2f7ff;
}
.dance-carousel-dots {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  overflow-x: auto;
  margin-top: 18px;
  padding: 2px 2px 9px;
  scrollbar-width: thin;
  scrollbar-color: #b8c2d2 transparent;
}
.dance-carousel-dots button {
  flex: 0 0 auto;
  width: 158px;
  min-height: 56px;
  padding: 9px 12px;
  border: 1px solid #d5dae3;
  border-radius: 10px;
  color: #5d6674;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.dance-carousel-dots button small,
.dance-carousel-dots button span { display: block; }
.dance-carousel-dots button small {
  overflow: hidden;
  margin-bottom: 4px;
  color: #8b93a0;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.dance-carousel-dots button span { font-size: 11px; font-weight: 750; line-height: 1.2; }
.dance-carousel-dots button:hover { border-color: #9aabc5; }
.dance-carousel-dots button.active {
  color: #1749a5;
  border-color: #245fc4;
  background: #f2f7ff;
}
.dance-carousel-dots button.active small { color: #245fc4; }

/* --- Ordered qualitative modules, matching DiffusionOPSD's prompt-fidelity format. --- */
.results-overview-card { margin: 52px 0 26px; }
.results-overview-card > img { width: 100%; max-height: none; object-fit: contain; }
#qualitative { background: #f6f6f7; }
.qualitative-modules { display: grid; gap: 76px; margin-top: 44px; }
.zero-shot-module { margin-top: 92px; padding-top: 70px; border-top: 1px solid #d9dde5; }
.prompt-comparison-module { min-width: 0; }
.prompt-module-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 42px;
  margin-bottom: 26px;
}
.prompt-module-heading > div { max-width: 760px; }
.prompt-module-heading .kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.prompt-module-heading h3 {
  margin: 0;
  color: #1f232c;
  font: 750 clamp(28px, 3vw, 43px)/1.08 Inter, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -.035em;
}
.prompt-module-heading > p {
  max-width: 470px;
  margin: 0;
  color: #676d78;
  font-size: 13px;
  line-height: 1.62;
}
.module-description-panel {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 24px;
  margin: -4px 0 26px;
  padding: 22px 24px;
  border: 1px solid #dfe3ea;
  border-radius: 14px;
  background: #fff;
}
.module-description-panel p {
  margin: 0;
  color: #5f6672;
  font-size: 13px;
  line-height: 1.7;
}
.module-description-panel p:first-child { padding-left: 16px; border-left: 3px solid var(--blue); }
.module-carousel { position: relative; }
.module-carousel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.module-carousel-count { color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .12em; }
.module-carousel-arrows { display: flex; gap: 8px; }
.module-carousel-arrows .dance-round-button:disabled { opacity: .35; pointer-events: none; }
.module-carousel-viewport { overflow: hidden; border-radius: 16px; outline: none; touch-action: pan-y; }
.module-carousel-viewport:focus-visible { box-shadow: 0 0 0 3px rgba(44,99,214,.25); }
.module-carousel-track { display: flex; align-items: stretch; transition: transform .52s cubic-bezier(.22,.7,.2,1); will-change: transform; }
.module-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  padding: 28px;
  border: 1px solid #e0e2e7;
  border-radius: 16px;
  background: #fff;
}
.module-prompt {
  display: grid;
  grid-template-columns: 110px minmax(0,1fr);
  gap: 24px;
  align-items: start;
  min-height: 94px;
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e4e6eb;
}
.module-prompt > span { color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.module-prompt p { max-width: 1050px; margin: 0; color: #3e424c; font-size: 16px; line-height: 1.55; }
.module-prompt p strong { display: block; margin-bottom: 5px; color: #20242d; font-size: 18px; line-height: 1.25; }
.module-comparison-images { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.module-comparison-images[data-cells="4"] { grid-template-columns: repeat(4,minmax(0,1fr)); }
.module-comparison-images[data-cells="5"] { grid-template-columns: repeat(5,minmax(0,1fr)); }
.module-comparison-images[data-cells="6"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
.module-comparison-images[data-cells="7"],
.module-comparison-images[data-cells="8"] { grid-template-columns: repeat(4,minmax(0,1fr)); }
.prompt-comparison-module.is-single-row .module-comparison-images { gap: 8px; }
.prompt-comparison-module.is-single-row .module-comparison-images[data-cells="6"] { grid-template-columns: repeat(6,minmax(0,1fr)); }
.prompt-comparison-module.is-single-row .module-comparison-images[data-cells="7"] { grid-template-columns: repeat(7,minmax(0,1fr)); }
.module-comparison-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dfe1e7;
  border-radius: 10px;
  background: #eef0f3;
}
.module-comparison-image img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s ease; user-select: none; -webkit-user-drag: none; }
.module-comparison-image:hover img { transform: scale(1.025); }
.module-comparison-image > span {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  max-width: calc(100% - 18px);
  padding: 6px 9px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  background: rgba(10,13,20,.76);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-comparison-image.is-highlighted { border: 2px solid #3975e5; box-shadow: 0 0 0 3px rgba(57,117,229,.1); }
.module-comparison-image.is-highlighted > span { background: rgba(38,93,201,.92); }
.module-carousel-dots { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 24px; }
.module-carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c8cbd2;
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}
.module-carousel-dots button.active { width: 30px; background: var(--blue); }
.module-paper-note {
  max-width: 1080px;
  margin: 20px 0 0;
  padding-left: 18px;
  border-left: 3px solid var(--blue);
  color: #5f6672;
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 720px) {
  .gallery-jump { align-items: flex-start; flex-direction: column; gap: 7px; }
  .native-chart-head { align-items: flex-start; flex-direction: column; gap: 8px; padding: 14px; }
  .native-chart-head p { text-align: left; }
  .native-chart-readout { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .native-chart-canvas svg { min-width: 920px; }
  .qualitative-overview-copy { grid-template-columns: 1fr; gap: 8px; padding: 16px; }
  .prompt-explorer-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .prompt-explorer-heading > p { max-width: none; text-align: left; }
  .dance-carousel-slide { padding: 14px; }
  .dance-slide-copy { grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; }
  .dance-slide-copy h3 { font-size: 17px; }
  .dance-comparison-grid,
  .dance-comparison-grid[data-cells="4"],
  .dance-comparison-grid[data-cells="5"],
  .dance-comparison-grid[data-cells="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .dance-comparison-cell span { min-height: 39px; padding: 7px 6px; font-size: 10px; }
  .dance-carousel-dots button { width: 138px; }
  .results-overview-card { margin-top: 38px; }
  .qualitative-modules { gap: 58px; margin-top: 34px; }
  .zero-shot-module { margin-top: 66px; padding-top: 52px; }
  .prompt-module-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .prompt-module-heading h3 { font-size: 28px; }
  .prompt-module-heading > p { max-width: none; }
  .module-description-panel { grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; padding: 16px; }
  .module-carousel-slide { padding: 14px; }
  .module-prompt { grid-template-columns: 1fr; gap: 9px; min-height: 0; margin-bottom: 14px; padding-bottom: 14px; }
  .module-prompt p { font-size: 14px; }
  .module-prompt p strong { font-size: 16px; }
  .module-comparison-images,
  .module-comparison-images[data-cells="4"],
  .module-comparison-images[data-cells="5"],
  .module-comparison-images[data-cells="6"],
  .module-comparison-images[data-cells="7"],
  .module-comparison-images[data-cells="8"] { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .prompt-comparison-module.is-single-row .module-comparison-images[data-cells="6"],
  .prompt-comparison-module.is-single-row .module-comparison-images[data-cells="7"] { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .module-comparison-image > span { top: 6px; left: 6px; max-width: calc(100% - 12px); padding: 5px 7px; font-size: 8px; }
  .module-carousel-dots { gap: 7px; margin-top: 18px; }
  .module-paper-note { margin-top: 16px; font-size: 12px; }
  .citation-section { padding: 54px 0; }
  .citation-box { width: calc(100% - 36px); padding: 22px 18px 18px; }
  .citation-heading { gap: 14px; }
  .citation-copy-button { min-height: 38px; padding: 0 14px; font-size: 12px; }
  .citation-box pre { padding: 18px; font-size: 11px; }
  .site-footer { min-height: 120px; padding: 36px 24px; }
  .footer-brand { width: 218px; }
}
