@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-600-normal.woff2") format("woff2");
}

:root {
  --bg: #FBFCFA;
  --bg-alt: #F2F5F3;
  --card: #FFFFFF;
  --ink: #142F45;
  --ink-2: #3A5266;
  --muted: #687A8A;
  --line: #E2E8EC;
  --line-2: #CFD8DF;
  --link: #205C78;
  --dace: #E07020;
  --dace-soft: #FCE8D8;
  --waft: #5E7894;
  --h4: #7B5EA7;
  --other: #A9B5C0;
  --occ: #3B9FDB;
  --good: #1A7F37;
  --bad: #C2412D;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 47, 69, .04), 0 6px 22px rgba(20, 47, 69, .06);
  --nav-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 14px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; display: block; }

b, strong { font-weight: 650; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--dace); outline-offset: 2px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }

/* ---------------------------------------------------------------- nav */
.topnav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(251, 252, 250, .86);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topnav.scrolled { border-bottom-color: var(--line); }
.topnav-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 24px; height: 100%;
  display: flex; align-items: center; gap: 22px;
}
.brand {
  font-weight: 800; letter-spacing: .04em; color: var(--ink); font-size: 15px;
  opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s;
}
.topnav.scrolled .brand { opacity: 1; transform: none; }
.brand:hover { text-decoration: none; color: var(--dace); }
.navlinks {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto;
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  padding: 0 8px;
}
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a {
  white-space: nowrap; font-size: 14px; color: var(--ink-2);
  padding: 5px 10px; border-radius: 999px;
}
.navlinks a:hover { text-decoration: none; background: rgba(20, 47, 69, .06); }
.navlinks a.active { color: var(--ink); background: rgba(224, 112, 32, .12); }

/* --------------------------------------------------------------- hero */
.hero { text-align: center; padding: 34px 0 10px; }
.venue {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dace);
  background: var(--dace-soft); border-radius: 999px; padding: 4px 14px; margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--sans); font-weight: 750;
  font-size: clamp(2.05rem, 4.6vw, 3.25rem); line-height: 1.12;
  letter-spacing: -.022em; margin: 0 auto 20px;
}
.hero h1 .ac { color: var(--dace); }
.paper-title {
  font-family: var(--serif); font-style: normal; font-weight: 500; font-size: 1.25rem; line-height: 1.4;
  color: var(--ink-2); margin: -8px auto 18px;
}
.acronym-initial { font-weight: 600; color: var(--dace); }
.authors { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; font-size: 1.2rem; margin: 0; }
.authors a { color: var(--ink); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.authors a:hover { text-decoration: none; border-bottom-color: var(--dace); color: var(--link); }
.affil { color: var(--muted); margin: 4px 0 22px; }

.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 600;
  padding: 9px 18px 9px 15px; border-radius: 999px; transition: background .15s, transform .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: #1F4563; text-decoration: none; transform: translateY(-1px); }
.btn.disabled { background: #E7ECEF; color: #7D8E9C; cursor: default; }
.btn.disabled:hover { transform: none; }
.btn small { font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }

.fig figcaption {
  color: var(--ink-2); font-size: 15px; line-height: 1.6; text-align: left; margin-top: 12px;
}

/* -------------------------------------------------------------- pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill {
  font: inherit; font-size: 14px; line-height: 1.2; cursor: pointer;
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 13px;
  transition: background .15s, color .15s, border-color .15s;
}
.pill:hover { border-color: var(--ink-2); color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pills.small .pill { font-size: 13px; padding: 5px 11px; }
.pill-label { font-size: 13px; color: var(--muted); margin-right: 2px; }

/* ------------------------------------------------------- compare view */
.compare {
  position: relative; width: 100%; overflow: hidden; border-radius: 12px;
  background: #0E1A24; user-select: none; -webkit-user-select: none; touch-action: pan-y;
  box-shadow: var(--shadow); cursor: ew-resize;
}
.compare .layer {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
}
.compare .base { position: relative; height: auto; }
.compare .clip {
  position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}
.compare .divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 0; z-index: 3;
  border-left: 2px solid rgba(255, 255, 255, .95); box-shadow: 0 0 8px rgba(0, 0, 0, .35);
  transform: translateX(-1px);
}
.compare .knob {
  position: absolute; top: 50%; left: 0; width: 40px; height: 40px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.compare .knob svg { width: 22px; height: 22px; }
.compare .tag {
  position: absolute; top: 10px; z-index: 2; font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
  color: #fff; background: rgba(14, 26, 36, .62); padding: 3px 10px; border-radius: 999px;
  backdrop-filter: blur(4px); pointer-events: none;
}
.compare .tag-left { left: 10px; }
.compare .tag-right { right: 10px; }
.compare .lens {
  position: absolute; z-index: 4; width: 190px; height: 190px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  pointer-events: none; opacity: 0; transition: opacity .15s;
  background-repeat: no-repeat; background-color: #0E1A24;
  transform: translate(-50%, -50%);
}
.compare.lens-on .lens { opacity: 1; }
/* --------------------------------------------------------------- tldr */
.tldr { padding: 28px 24px 4px; }
.tldr-text {
  max-width: 880px; margin: 0 auto 28px; font-size: 1.12rem; line-height: 1.7; text-align: center;
}
.kicker {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: #fff;
  background: var(--dace); border-radius: 6px; padding: 1px 7px; margin-right: 6px; vertical-align: 2px;
}
.ideas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 auto 22px; max-width: 1080px; }
.sota { text-align: center; font-size: 1.28rem; font-weight: 680; margin: 6px auto 4px; }
.idea { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-align: left; line-height: 1.5; }
.idea b { display: block; margin-bottom: 4px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .ideas { grid-template-columns: 1fr; } }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow); text-align: left;
}
.stat-num {
  font-family: var(--serif); font-weight: 500; font-size: 2.6rem; line-height: 1; color: var(--dace);
  font-variant-numeric: lining-nums tabular-nums;
}
.stat-label { font-weight: 650; margin-top: 8px; line-height: 1.35; }
.stat-note { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 4px; }

/* ----------------------------------------------------------- sections */
.section { padding: 64px 0 56px; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { text-align: left; margin-bottom: 26px; }
.eyebrow {
  font-size: 12.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--dace);
  margin-bottom: 6px;
}
h2 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  line-height: 1.15; letter-spacing: -.005em; margin: 0 0 14px;
}
h3 { font-size: 1.12rem; margin: 0 0 8px; }
h3.sub { margin: 34px 0 10px; font-size: 1.16rem; }
.lead { font-size: 1.07rem; color: var(--ink-2); margin: 0; }
p { margin: 0 0 14px; }
.text-term { white-space: nowrap; }
p, figcaption, .step-text, .ex-caption, .fig-note {
  text-wrap: pretty;
  hyphens: none;
  -webkit-hyphens: none;
}
h1, h2, h3, .fig-title, .tldr-text, .lead, .conclusion, .story-stage > p,
.story-note, .result-scope, .ex-caption, .premise-desc, .small-text, .fig figcaption {
  text-wrap: balance;
}

.abstract { padding-top: 6px; padding-bottom: 8px; }
.abstract h2 {
  margin: 0 0 10px; font-family: var(--sans); font-size: 12.5px; font-weight: 750;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dace); line-height: 1.4;
}
.abstract p { text-align: left; margin: 0; }

.fold-card > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.fold-card > summary::-webkit-details-marker { display: none; }
.fold-card > summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--link); border-bottom: 2px solid var(--link);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; flex: none; margin-right: 4px;
}
.fold-card[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.fold-card > summary:hover h2, .fold-card > summary:hover .fig-title { color: var(--link); }
.fold-card { margin: 0 0 22px; padding: 14px 20px; }
.fold-body { margin-top: 12px; }
.fold-text { font-size: 15px; color: var(--ink-2); line-height: 1.6; margin: 0 0 4px; }

.ctl-panel .cap { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin: 12px 0 0; }
.sub-pills { margin: 0 0 8px; }
.pills.sub-pills .pill { font-size: 12.5px; padding: 4px 10px; }
.sub-pills .pill[aria-pressed="true"] { background: var(--bg-alt); color: var(--ink); border-color: var(--ink-2); }

.better { color: var(--good); font-weight: 650; }
.worse { color: var(--bad); font-weight: 650; }
.small-text { font-size: 15px; color: var(--ink-2); }

/* -------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.fig { margin: 0 0 22px; padding: 18px 20px 16px; }
.fig-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin-bottom: 10px;
}
.fig-title { font-weight: 650; font-size: 16px; }
.fig-note { font-size: 13px; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.regions-stack { display: grid; gap: 26px; }

.legend-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--ink-2); margin: -2px 0 6px; }
.lg::before {
  content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px;
}
.lg.waft::before { background: var(--waft); }
.lg.h4::before { background: var(--h4); }
.lg.dace::before { background: var(--dace); transform: rotate(45deg) scale(.9); border-radius: 2px; }
.lg.sq::before { border-radius: 2px; transform: none; }
.lg-ctx { color: var(--muted); }
.lg-ctx i {
  display: inline-block; box-sizing: border-box; width: 10px; height: 10px; border-radius: 50%;
  border: 1.8px solid var(--muted); margin-right: 5px; vertical-align: -1px;
}
.lg-ctx i.f { background: var(--muted); margin-left: 2px; }

/* ------------------------------------------------------------- charts */
.chart { position: relative; width: 100%; min-height: 120px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.chart text { fill: var(--ink-2); font-size: 12px; }
.chart .axis text { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .axis path, .chart .axis line { stroke: var(--line-2); }
.chart .grid line { stroke: var(--line); }
.chart .grid path { display: none; }
.chart .axis-title { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart .panel-title { fill: var(--ink); font-size: 13px; font-weight: 650; }
.chart .label { font-size: 11.5px; fill: var(--ink-2); }
.chart .label.muted { fill: var(--muted); }
.chart .label.dace { fill: var(--dace); font-weight: 750; font-size: 12.5px; }
.chart .label.waft { fill: var(--waft); font-weight: 650; }
.chart .value { font-size: 11.5px; font-variant-numeric: tabular-nums; fill: var(--ink-2); }
.chart .value.dace { fill: var(--dace); font-weight: 700; }
.chart .value.h4 { fill: var(--h4); font-weight: 650; }
.chart .value.good { fill: var(--good); font-weight: 650; }
.chart .value.bad { fill: var(--bad); font-weight: 650; }
.chart .value.small { font-size: 11px; }
.chart .dot-num { fill: #fff; font-size: 10.5px; font-weight: 750; pointer-events: none; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .dim { opacity: .25; }

.numbers { margin-top: 10px; border-top: 1px dashed var(--line-2); padding-top: 8px; }
.numbers summary, .reading summary {
  cursor: pointer; font-size: 14px; color: var(--link); font-weight: 600; list-style: none; display: inline-flex;
  align-items: center; gap: 6px;
}
.numbers summary::-webkit-details-marker, .reading summary::-webkit-details-marker { display: none; }
.numbers summary::before, .reading summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px;
}
.numbers[open] summary::before, .reading[open] summary::before { transform: rotate(45deg); }
.table-wrap { overflow-x: auto; margin-top: 10px; }
table.num {
  border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.num th, table.num td { padding: 5px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.num th:first-child, table.num td:first-child { text-align: left; }
table.num thead th { font-weight: 650; color: var(--ink-2); border-bottom: 1.5px solid var(--line-2); vertical-align: bottom; }
table.num tr.group td { font-style: italic; color: var(--muted); text-align: left; background: #FAFBFC; }
table.num td.best { font-weight: 750; }
table.num tr.ours td { background: #FFF7F0; }
table.num .src { font-size: 12px; color: var(--muted); }

.tooltip {
  position: fixed; z-index: 90; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: rgba(20, 47, 69, .96); color: #fff; font-size: 13px; line-height: 1.45;
  padding: 7px 10px; border-radius: 8px; max-width: 280px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.tooltip.on { opacity: 1; }
.tooltip b { color: #FFC08F; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }

.unit-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; color: var(--ink-2);
  margin: -16px 0 28px;
}
.ul { display: inline-flex; align-items: center; gap: 7px; }
.ul::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 3px; }
.ul-obj::before { background: #F5B07A; }
.ul-unit::before { box-sizing: border-box; border: 1.5px solid #34495E; border-radius: 2px; background: radial-gradient(circle, #34495E 0 1.8px, #DDE5EC 2.3px); }
.ul-mixed::before { box-sizing: border-box; border: 1.5px solid #34495E; border-radius: 2px; background: repeating-linear-gradient(45deg, rgba(214, 69, 69, .6) 0 2px, #DDE5EC 2px 5px); }
.ul-feat::before { width: 7px; height: 7px; border-radius: 50%; background: #8A9AA8; margin: 0 3px; }

.setup { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; align-items: start; margin-top: 4px; }
.su { margin: 0; }
.su svg { display: block; width: 100%; max-width: 210px; margin: 0 auto; }
.setup .su figcaption { margin: 10px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); text-align: center; }
.setup .su figcaption b { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 1px; }
.setup .su figcaption span { display: block; }
.setup .su.ours figcaption b { color: var(--dace); }
.su-ctx { border-left: 1px dashed var(--line-2); padding-left: 22px; }
.chip {
  display: inline-block; margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 650; color: var(--dace);
  background: var(--dace-soft); border-radius: 999px; padding: 1px 9px;
}
#fig-setup .unit-legend { margin: 18px 0 2px; }
.stat-sep { color: var(--muted); margin: 0 .14em; font-weight: 400; }
.stat-unit { font-size: .5em; margin-left: .18em; color: var(--muted); font-family: var(--sans); font-weight: 500; }

/* ------------------------------------------------------------ problem */
.premise { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.premise-title { font-weight: 650; font-size: 15.5px; }
.premise-title b { color: var(--muted); font-weight: 650; margin-right: 2px; }
.premise-desc { font-size: 14px; color: var(--ink-2); line-height: 1.45; margin: 2px 0 8px; min-height: 2.9em; }
.pm { margin: 0; min-width: 0; }
.pm img { display: block; width: 100%; height: auto; }
.pm figcaption, .fig .pm figcaption {
  font-size: 12px; color: var(--muted); text-align: center; margin: 0 0 3px; line-height: 1.3;
}
[data-connectors] { position: relative; }
.connectors { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.connectors path { fill: none; }
.pm.ours figcaption { color: var(--dace); font-weight: 700; }
.pm-full { display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 1080 / 500; }
.pm-full img { max-height: 100%; object-fit: contain; }
.pm-row { display: grid; gap: 4px; margin-top: 6px; }
.pm-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pm-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.roles { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.roles li { position: relative; padding-left: 20px; }
.roles li::before {
  content: ""; position: absolute; left: 3px; top: .62em; width: 8px; height: 8px; border-radius: 2px;
  background: var(--dace); transform: rotate(45deg);
}

/* ------------------------------------------------------------- method */
.pipeline-stage { position: relative; max-width: 900px; margin: 4px auto 0; }
.pipeline-stage img { width: 100%; height: auto; }
.pipeline-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pipeline-overlay .dim { fill: rgba(255, 255, 255, .8); transition: opacity .25s; }
.pipeline-overlay .hl { fill: none; stroke: var(--dace); stroke-width: 1.6; rx: 5; }
.step-text {
  min-height: 74px; margin-top: 12px; padding: 12px 16px; border-radius: 10px; background: #F7F9FA;
  border: 1px solid var(--line); font-size: 15px; line-height: 1.55;
}
.step-text .step-n {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--dace); color: #fff; font-size: 12.5px; font-weight: 750; margin-right: 8px; vertical-align: 1px;
}
.step-text .step-name { font-weight: 700; }

.eq { overflow-x: auto; overflow-y: hidden; margin: 8px 0 16px; padding: 2px 0; }
.eq.small { font-size: 14.5px; margin: 10px 0 0; }
.eq-pair { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 2.2em; }
.katex { font-size: 1.06em; }
.katex-display { margin: .4em 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

.assign-layout { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: 26px; align-items: start; }
.assign-canvas-wrap svg { width: 100%; height: auto; touch-action: none; display: block; }
.assign-canvas-wrap .hint { font-size: 13px; color: var(--muted); text-align: center; margin: 6px 0 0; }
#assign-svg .cell { fill: none; stroke: var(--line-2); stroke-dasharray: 3 4; }
#assign-svg .cell.center { fill: rgba(224, 112, 32, .05); stroke: #EBC3A3; stroke-dasharray: none; }
#assign-svg .contour { fill: rgba(224, 112, 32, .07); stroke: var(--dace); stroke-width: 1.4; }
#assign-svg .contour.outer { fill: rgba(224, 112, 32, .04); stroke-dasharray: 4 4; stroke-width: 1; }
#assign-svg .anchor-bubble { fill: var(--waft); }
#assign-svg .anchor-dot { fill: var(--ink); }
#assign-svg .link { stroke: var(--waft); }
#assign-svg .pct { font-size: 13px; font-weight: 650; fill: var(--ink); font-variant-numeric: tabular-nums; }
#assign-svg .cell-note { font-size: 11px; font-weight: 500; fill: #B9875E; }
#assign-svg .mu { fill: var(--dace); stroke: #fff; stroke-width: 2.5; cursor: grab; }
#assign-svg .mu:active { cursor: grabbing; }
#assign-svg .mu-label { font-size: 13px; font-style: italic; fill: var(--dace); font-weight: 600; }
.assign-side { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 14px; font-weight: 600; }
.slider span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--dace); }
.entropy { margin-top: 6px; }
.entropy-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.entropy-head b { font-variant-numeric: tabular-nums; }
.entropy-track {
  position: relative; height: 12px; border-radius: 999px; margin: 6px 0 4px;
  background: linear-gradient(90deg, #2A1D5C, #34618D 25%, #21908C 50%, #5DC863 75%, #FDE725);
}
.entropy-mark {
  position: absolute; top: -4px; width: 4px; height: 20px; border-radius: 2px; background: var(--ink);
  box-shadow: 0 0 0 2px #fff; transform: translateX(-50%); transition: left .08s;
}
.entropy-scale { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.assign-msg {
  font-size: 14.5px; color: var(--ink-2); background: #F7F9FA; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin: 4px 0 0; min-height: 64px;
}

.losses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 6px 0 18px; }
.loss { padding: 16px 18px; }
.loss p { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 0; }
.loss-tag {
  display: inline-block; font-weight: 750; font-size: 13px; letter-spacing: .02em; color: var(--dace);
  margin-bottom: 6px;
}
.loss-tag .katex { font-size: 1.25em; margin-right: 1px; }
.loss-name { display: block; margin-top: 3px; }
.structure-img { width: 100%; height: auto; margin: 4px 0 0; }

/* ------------------------------------------------------- learned units */
.regions { display: grid; gap: 6px; }
.region-row {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 4px; align-items: end;
}

/* ------------------------------------------------------------ gallery */
.gallery { padding: 16px 18px 18px; }
.thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.thumb {
  font: inherit; text-align: left; padding: 0; border: 2px solid transparent; border-radius: 10px; background: none;
  cursor: pointer; overflow: hidden; transition: border-color .15s, transform .15s;
}
.thumb img { width: 100%; height: auto; aspect-ratio: 2.35 / 1; object-fit: cover; border-radius: 8px 8px 0 0; }
.thumb span { display: block; font-size: 12.5px; padding: 4px 6px 5px; color: var(--ink-2); line-height: 1.3; }
.thumb span b { display: block; font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.thumb:hover { transform: translateY(-1px); }
.thumb[aria-pressed="true"] { border-color: var(--dace); background: var(--dace-soft); }
.gallery-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.ex-title { font-weight: 700; font-size: 17px; }
.ex-meta { font-size: 13.5px; color: var(--muted); }
.minis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.mini { margin: 0; }
.mini-img { position: relative; border-radius: 8px; overflow: hidden; background: #0E1A24; cursor: crosshair; }
.mini-img img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-select: none; }
.mini figcaption { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 5px; }
.sw-occ { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: #56B4E9; margin-right: 6px; vertical-align: -1px; }
#gallery-views[hidden] { display: none; }
#gallery-compare { cursor: ew-resize; }
#gallery-compare .tag-right { background: var(--dace); }
#gallery-compare.tokens .tag-right { background: rgba(14, 26, 36, .62); }
.gallery .mark {
  position: absolute; left: var(--fx, 50%); top: var(--fy, 50%); z-index: 3; width: 14px; height: 14px;
  border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(14, 26, 36, .8);
  transform: translate(-50%, -50%); pointer-events: none; opacity: 0;
}
.gallery.marking .mark { opacity: 1; }
.gallery.marking .here .mark, .gallery.marking .here > .mark { opacity: 0; }
.gallery-hint { font-size: 13.5px; color: var(--muted); margin: 8px 0 4px; }
.ex-caption { margin: 2px 0 12px; font-size: 15px; color: var(--ink-2); }
.reading { margin-top: 6px; }
.reading-body { display: flex; gap: 18px; align-items: flex-start; margin-top: 10px; }
.reading-body canvas { flex: none; width: 132px; height: 132px; border-radius: 50%; }
.reading-body p { font-size: 14.5px; color: var(--ink-2); margin: 0; }

/* -------------------------------------------------------- conclusion */
.conclusion { font-size: 1.1rem; line-height: 1.65; color: var(--ink-2); margin: 0; text-wrap: pretty; }
.conclusion b { font-weight: 600; }
.bibtex { position: relative; padding: 0; overflow: hidden; }
.bibtex pre {
  margin: 0; padding: 18px 20px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
  color: var(--ink); background: #F7F9FA;
}
.copy {
  position: absolute; top: 10px; right: 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--card); color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 12px;
}
.copy:hover { border-color: var(--ink-2); color: var(--ink); }
.copy.done { background: var(--good); color: #fff; border-color: var(--good); }

.footer { border-top: 1px solid var(--line); padding: 22px 0 34px; font-size: 14px; color: var(--muted); }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .losses { grid-template-columns: minmax(0, 1fr); }
  .premise { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; gap: 26px; }
  .premise-desc { min-height: 0; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .section { padding: 46px 0 40px; }
  .assign-layout { grid-template-columns: minmax(0, 1fr); }
  .fig { padding: 14px 12px 12px; }
  .compare .lens { display: none; }
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .regions { gap: 14px; }
  .region-row { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr); row-gap: 6px; }
  .region-row > :nth-child(5) { width: 50%; }
  .setup { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .su-ctx { border-left: 0; padding-left: 0; }
  .reading-body { flex-direction: column; align-items: center; }
  .brand { display: none; }
  .navlinks { margin-left: 0; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-num { font-size: 2.1rem; }
  .thumbs { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
  .thumb { flex: 0 0 42%; scroll-snap-align: start; }
  .abstract p { text-align: left; }
  .compare .tag { font-size: 11px; }
}
@media (hover: none) { .compare .lens { display: none; } }

/* Opening story and reading order. */
.hero { padding-top: 25px; }
.hero h1 { font-size: clamp(2.05rem, 4.2vw, 3rem); margin-bottom: 15px; }
.venue { margin-bottom: 14px; }
.paper-title { margin-bottom: 14px; }
.authors { font-size: 1.08rem; }
.affil { font-size: 15px; margin-bottom: 17px; }
.tldr { padding-top: 20px; }
.tldr-panel {
  max-width: 880px; margin: 0 auto; padding: 22px 28px 24px;
  background: #F8F5EF; border-left: 3px solid var(--dace); border-radius: 0 12px 12px 0;
}
.tldr-panel .eyebrow { margin-bottom: 10px; }
.tldr-text { max-width: none; margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 400; line-height: 1.45; color: var(--ink); text-align: left; text-wrap: balance; }
.story-section { padding: 38px 0 36px; }
.story-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 21px; }
.story-heading h2 { font-size: clamp(1.7rem, 2.9vw, 2.15rem); margin-bottom: 0; }
.story-heading .pills { flex-shrink: 0; padding-bottom: 3px; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.story-stage { min-width: 0; margin: 0; position: relative; }
.story-label { display: flex; align-items: center; gap: 9px; font-size: 15px; margin-bottom: 11px; min-height: 26px; }
.step-number { color: var(--dace); font-size: 11px; font-weight: 750; letter-spacing: .06em; }
.story-media { position: relative; overflow: hidden; border-radius: 8px; aspect-ratio: 1024 / 436; background: #e3e9e7; }
.story-image { width: 100%; height: 100%; object-fit: fill; }
.story-grid.detail .story-media { aspect-ratio: 2; }
.story-grid.detail .story-image { position: absolute; width: 609.523810%; max-width: none; height: 519.047619%; left: -347.619048%; top: -142.857143%; }
.story-grid.detail .story-image.cropped { width: 100%; height: 100%; left: 0; top: 0; }
.story-stage > p { margin: 10px 0 0; max-width: 315px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.stage-arrow { position: absolute; left: -19px; top: 91px; color: var(--muted); font-size: 18px; }
.frame-switch { margin-left: auto; display: flex; gap: 3px; }
.frame-switch button { font: inherit; font-size: 11px; width: 24px; height: 24px; padding: 0; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--card); cursor: pointer; }
.frame-switch button[aria-pressed="true"] { color: white; background: var(--ink); border-color: var(--ink); }
.story-note { margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line-2); margin-top: 28px; padding-top: 22px; }
.result-claim { font-size: 19px; font-weight: 650; line-height: 1.4; margin-bottom: 5px; }
.result-claim em { color: #b85312; font-style: normal; }
.result-scope { color: var(--muted); font-size: 12px; margin-bottom: 0; line-height: 1.5; }
.result-summary > a { white-space: nowrap; font-size: 14px; font-weight: 650; }
.comparison-section { padding-top: 38px; }
.comparison-section .sec-head { margin-bottom: 22px; }
.comparison-section h2 { margin-bottom: 9px; }
.comparison-section .lead { font-size: 16px; }
.comparison-section .gallery { padding: 22px; }
.comparison-section .minis { max-width: 850px; margin: 20px auto; }
.comparison-section .thumbs { padding-top: 18px; border-top: 1px solid var(--line); margin-bottom: 15px; }
.comparison-section .gallery-head { margin-top: 15px; }
.comparison-section .ex-title { font-size: 20px; }
.comparison-section .ex-caption { max-width: 820px; margin-bottom: 16px; }
.supporting-examples > .fold-body > .fig,
.support-details > .fold-body > .fig { border: 0; box-shadow: none; margin-bottom: 0; padding: 10px 0 0; }
.paper-abstract { margin-bottom: 24px; }
.paper-abstract .abstract { font-size: 16px; padding-top: 0; padding-bottom: 5px; }
.supervision-details .losses { margin-bottom: 14px; }
@media (max-width: 900px) {
  .story-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .story-grid { gap: 18px; }
  .stage-arrow { left: -16px; top: 77px; font-size: 15px; }
  .result-summary { align-items: flex-start; }
}
@media (max-width: 600px) {
  .hero { padding-top: 23px; }
  .hero h1 { font-size: 2rem; }
  .paper-title { font-size: 1.125rem; }
  .tldr { padding-top: 20px; }
  .tldr-panel { padding: 20px 19px 22px; }
  .tldr-text { font-size: 1.125rem; }
  .story-section { padding-top: 30px; padding-bottom: 30px; }
  .story-grid { grid-template-columns: 1fr; gap: 22px; }
  .story-stage > p { max-width: none; margin-top: 8px; }
  .stage-arrow { display: none; }
  .story-label { margin-bottom: 8px; }
  .story-note { margin-top: 18px; }
  .result-summary { flex-direction: column; gap: 12px; margin-top: 24px; padding-top: 19px; }
  .result-claim { font-size: 18px; }
  .comparison-section .gallery { padding: 15px 12px; }
  .comparison-section .minis { gap: 9px; margin-top: 15px; }
  .comparison-section .ex-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .story-image { transition: none; } }
