:root {
  color-scheme: light;
  --ink: #141a26;
  --ink-2: #3d4657;
  --muted: #6b7486;
  --line: #dfe3ea;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --accent: #1f4e8c;
  --accent-2: #2b5c9e;
  --accent-soft: #e6eef8;
  --amber: #c1842a;
  --amber-soft: #fbe8c6;
  --bar-base: #b7bfcc;
  --radius: 10px;
  --wrap: 980px;
  --serif: "Source Serif 4", "Times New Roman", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

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

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 52px; }
.nav .brand { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--ink); white-space: nowrap; }
.nav .brand:hover { text-decoration: none; }
.nav .brand span { color: var(--accent); }
.nav ul { list-style: none; display: flex; gap: 20px; margin: 0 0 0 auto; padding: 0; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav li a { color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav li a:hover { color: var(--accent); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 28px; text-align: center; }
.venue { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 auto 10px;
  max-width: 860px;
  text-wrap: balance;
}
.hero .method-name { font-family: var(--serif); font-size: clamp(20px, 2.6vw, 26px); color: var(--accent); font-weight: 600; margin: 0 0 26px; }
.authors { font-size: 17px; line-height: 1.9; max-width: 860px; margin: 0 auto; }
.authors span { white-space: nowrap; margin: 0 7px; }
.authors sup, .affils sup, .roles sup { font-size: 0.68em; color: var(--muted); margin-left: 1px; }
.affils { margin-top: 10px; font-size: 16px; color: var(--ink-2); }
.affils span { margin: 0 12px; white-space: nowrap; }
.roles { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.roles span { margin: 0 9px; white-space: nowrap; }

.buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 500;
  transition: background .15s;
}
.btn:hover { background: var(--accent); text-decoration: none; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }
.btn.soon { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); cursor: default; }
.btn.soon:hover { background: var(--surface-2); }
.btn small { font-size: 12px; opacity: .85; }

/* ---------- sections ---------- */
section { padding: 40px 0; }
section + section { border-top: 1px solid var(--line); }
h2 {
  font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.2;
  margin: 0 0 20px; text-align: center; letter-spacing: -0.005em;
}
h3 { font-size: 19px; font-weight: 650; margin: 34px 0 10px; }
p { margin: 0 0 14px; color: var(--ink-2); }
.lead { font-size: 18px; color: var(--ink); }
.prose { max-width: 820px; margin: 0 auto; }
.abstract p { text-align: justify; hyphens: auto; }
em.k { font-style: normal; font-weight: 600; color: var(--ink); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--ink); }

/* ---------- figures ---------- */
figure { margin: 22px 0 8px; }
figure a.zoom { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; cursor: zoom-in; }
figure img { display: block; width: 100%; height: auto; }
figcaption { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin: 10px auto 0; max-width: 860px; }
figcaption b { color: var(--ink-2); }
.fig-narrow { max-width: 620px; margin-left: auto; margin-right: auto; }
.fig-mid { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---------- teaser + stats ---------- */
.teaser-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.teaser-grid figure { margin: 0; }
.tldr { font-size: 18.5px; line-height: 1.6; color: var(--ink); margin-bottom: 22px; }
.tldr b { color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .num small { font-size: 0.55em; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat .num .arrow { color: var(--muted); font-weight: 400; margin: 0 3px; }
.stat .lbl { font-size: 13.5px; line-height: 1.4; color: var(--muted); margin-top: 6px; }
.stat.hl { background: var(--accent-soft); border-color: #c6d6ec; }
.stat.hl .num { color: var(--accent); }

/* ---------- pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.pillar { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: #fff; }
.pillar .tag { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.pillar h4 { font-size: 18px; margin: 4px 0 8px; }
.pillar p { font-size: 15px; margin: 0; }

/* ---------- step example ---------- */
.example { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: stretch; margin-top: 24px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 16px 18px; }
.panel h5 { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.panel ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.panel li { margin: 3px 0; }
pre {
  margin: 0; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: var(--ink);
  white-space: pre; overflow-x: auto;
}
pre .key { color: var(--accent); }
pre .str { color: #8a5a14; }
pre .cmt { color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 18px auto 6px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
caption { caption-side: top; text-align: left; font-size: 14.5px; color: var(--muted); padding-bottom: 10px; line-height: 1.5; }
caption b { color: var(--ink-2); }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); border-bottom: 1.5px solid var(--ink-2); }
td.num, th.num { text-align: right; }
tr.group td { padding-top: 14px; font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: none; }
tr.ours td { background: var(--accent-soft); font-weight: 600; color: var(--ink); }
tr.ours td:first-child { border-radius: 6px 0 0 6px; }
tr.ours td:last-child { border-radius: 0 6px 6px 0; }
.dagger { color: var(--muted); font-weight: 400; }

/* results chart */
.sr-head { display: flex; align-items: stretch; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 26px auto 22px; max-width: 820px; }
.sr-big, .sr-gain { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); min-width: 170px; }
.sr-big .v, .sr-gain .v { font-family: var(--serif); font-size: 44px; font-weight: 700; line-height: 1; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sr-big .v small { font-size: .5em; margin-left: 2px; color: var(--muted); }
.sr-big .l, .sr-gain .l { margin-top: 8px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.sr-big.ours { background: var(--accent); border-color: var(--accent); }
.sr-big.ours .v, .sr-big.ours .v small, .sr-big.ours .l { color: #fff; }
.sr-big.ours .l { font-weight: 600; font-size: 14px; }
.sr-gain { background: var(--accent-soft); border-color: #c6d6ec; }
.sr-gain .v { color: var(--accent); }
.sr-vs { align-self: center; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 18px; }

.sr-chart { position: relative; max-width: 820px; margin: 0 auto; padding: 24px 0 26px; }
.sr-group { margin: 14px 0 4px; padding-left: 264px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sr-ref + .sr-group { margin-top: 0; }
.sr-row.ours + .sr-group { margin-top: 18px; }
.sr-group { position: relative; z-index: 1; }
.sr-group span { background: var(--surface); padding-right: 4px; }
.sr-row { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: center; gap: 14px; padding: 3px 0; }
.sr-name { font-size: 14.5px; color: var(--ink-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-tag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; line-height: 17px; vertical-align: 1px; }
.sr-bar { position: relative; height: 20px; }
.sr-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #c9cfd9; border-radius: 0 4px 4px 0; }
.sr-row { position: relative; z-index: 1; }
.sr-val { background: var(--surface); padding: 0 3px; border-radius: 3px; position: absolute; top: 50%; transform: translateY(-50%); margin-left: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-row.ours { padding: 6px 0; margin: 2px 0 4px; background: var(--accent-soft); border-radius: 6px; }
.sr-row.ours .sr-name { color: var(--accent); font-weight: 700; font-size: 16px; }
.sr-row.ours .sr-tag { color: var(--accent); background: var(--accent-soft); border-color: #c6d6ec; }
.sr-row.ours .sr-bar { height: 30px; }
.sr-row.ours .sr-fill { background: var(--accent); }
.sr-row.ours .sr-val { font-size: 20px; font-weight: 700; color: var(--accent); font-family: var(--serif); }
.sr-ref { position: absolute; top: 0; bottom: 22px; left: calc(250px + 14px + (100% - 264px) * var(--xf, 0)); width: 0; border-left: 1.5px dashed #8e95a1; pointer-events: none; }
.sr-ref span { position: absolute; top: 0; left: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sr-axis { position: relative; height: 18px; margin-left: 264px; border-top: 1px solid var(--line); margin-top: 6px; }
.sr-axis span { position: absolute; top: 3px; transform: translateX(-50%); font-size: 11.5px; color: var(--muted); }
.sr-note { max-width: 820px; margin: 6px auto 0; font-size: 13.5px; color: var(--muted); text-align: center; }

/* results bar column */
.results { max-width: 760px; }
.results td.bar { width: 46%; padding-right: 4px; }
.bar-track { position: relative; height: 12px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar-base); border-radius: 0 4px 4px 0; min-width: 2px; }
tr.ours .bar-fill { background: var(--accent-2); }
.results td.sr { width: 64px; text-align: right; font-weight: 500; }
tr.ours td.sr { color: var(--accent); }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.two-col figure { margin-top: 0; }

/* ---------- bibtex ---------- */
.bib { position: relative; max-width: 820px; margin: 0 auto; }
.bib pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 13px; }
.copy {
  position: absolute; top: 10px; right: 10px;
  font: 500 12.5px var(--sans); color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.copy:hover { border-color: var(--accent-2); color: var(--accent); }
.note { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 10px; }

/* ---------- streaming execution (static/streaming.js) ---------- */
.sf { position: relative; margin: 22px 0 8px; }
.sf-task { min-height: 1.5em; margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.sf-task b { color: var(--ink); }

/* left: the robot (camera); right: the model, what it receives and what it writes */
.sf-stage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 14px; }   /* the camera fills the row height */
.sf-vid { position: relative; overflow: hidden; border-radius: var(--radius); background: #e7ebf0; }
.sf-vid::before { content: ""; display: block; padding-top: 75%; }      /* at least 4:3; taller if the panel beside it is */
.sf-vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.sf-chip { position: absolute; padding: 4px 9px; border: 1px solid rgba(20, 26, 38, .08); border-radius: 7px; background: rgba(255, 255, 255, .93);
           color: var(--ink); font: 500 12.5px/1.35 var(--sans); pointer-events: none; }
.sf-robot { left: 10px; top: 10px; max-width: calc(100% - 90px); display: grid; grid-template-columns: 8px auto; column-gap: 7px; align-items: center; }
.sf-robot i { width: 8px; height: 8px; border-radius: 50%; background: #9aa2b1; }
.sf-robot b { font-weight: 600; }
.sf-robot span { grid-column: 2; font-size: 12px; color: var(--muted); }
.sf-robot.is-new i { background: #1f4e8c; }
.sf-robot.is-pre i { background: #e0a043; }
.sf-robot.is-wait i { background: #c8553d; animation: sf-pulse 1.6s ease-in-out infinite; }
.sf-robot.is-ok i { background: #2f7d4f; }
.sf-clock { right: 10px; top: 10px; font-variant-numeric: tabular-nums; }
.sf-snapchip { left: 10px; bottom: 10px; opacity: 0; transition: opacity .3s; }
.sf-snapchip.on { opacity: 1; }
.sf-paused { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: -26px 0 0 -26px;
             border-radius: 50%; background: rgba(255, 255, 255, .88); box-shadow: 0 2px 10px rgba(20, 26, 38, .15); color: var(--ink); opacity: 0;
             transition: opacity .25s; pointer-events: none; }
.sf-paused svg { width: 20px; height: 20px; margin-left: 3px; fill: currentColor; }
.sf-vid.is-paused .sf-paused { opacity: 1; }

.sf-side { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.sf-side h5 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 7px;
              font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sf-side h5 > span, .sf-side h5 > b { font-weight: 600; }
.sf-side h5 > span:not(.sf-status) { font-weight: 500; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.sf-req { padding: 10px 14px 10px; border-bottom: 1px solid var(--line); }
.sf-reqrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sf-imgs { flex: 0 1 190px; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.sf-img { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; font: inherit; }
.sf-img img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; background: #e7ebf0; }
.sf-prompt { padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink-2); font: 500 12.5px var(--sans); cursor: pointer; white-space: nowrap; }
.sf-prompt:hover { border-color: var(--accent-2); color: var(--accent); }

.sf-rep { padding: 10px 14px 12px; }
.sf-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--ink-2); white-space: nowrap; }
.sf-status i { width: 7px; height: 7px; border-radius: 50%; background: #b7bfcc; }
.sf-status.is-read i { background: #9fb8dc; animation: sf-pulse 1.8s ease-in-out infinite; }
.sf-status.is-write i { background: #1f4e8c; animation: sf-pulse 1.2s ease-in-out infinite; }
.sf-lab { flex: none; width: 64px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sf-prog { display: flex; align-items: baseline; min-height: 2.9em; font-size: 13px; line-height: 1.45; color: var(--ink); }
.sf-progt { flex: 1; min-width: 0; }
.sf-steph { display: flex; align-items: baseline; margin: 4px 0 4px; }
.sf-note { flex: 1; min-width: 0; font-size: 11.5px; color: #8a560c; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-note.is-bad { color: #b3261e; }
/* four fixed slots (a reply has at most four steps): the cards never scroll, they move between slots */
.sf-steps { --slot: 46px; position: relative; height: calc(4 * var(--slot) - 6px); margin: 0; padding: 0; list-style: none; }
.sf-card { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--slot) - 6px); overflow: hidden; display: grid; grid-template-columns: 70px minmax(0, 1fr);
           column-gap: 8px; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-left: 2px solid #1f4e8c; border-radius: 6px; background: #fff;
           transform: translateY(calc(var(--i) * var(--slot)));
           transition: transform .85s cubic-bezier(.45, 0, .25, 1) .2s, opacity .45s ease, background .4s, border-color .4s; }
.sf-steps.no-anim .sf-card { transition: none; }
.sf-card.is-hidden { opacity: 0; visibility: hidden; }
.sf-card.is-pre, .sf-card.is-carry { border: 1px dashed #e3bf86; border-left: 2px solid #e0a043; background: #fffbf3; }
.sf-card.is-writing { border-color: #c9d8ec; border-left-color: #1f4e8c; }
.sf-card.is-running { background: #eef3fa; }
.sf-card.is-pre.is-running { background: #fcf0da; }
.sf-card.is-done, .sf-card.is-unneeded, .sf-card.is-skipped, .sf-card.is-stopped { opacity: .5; }
.sf-card.is-skipped .sf-cmd { text-decoration: line-through; }
.sf-card.is-failed { background: #fcf1ef; border-color: #ebbcb3; }
.sf-g { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font: 500 11.5px/1.3 var(--sans); color: var(--muted); }
.sf-g > div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sf-id { min-width: 18px; padding: 0 5px; border-radius: 4px; background: #1f4e8c; color: #fff; font-weight: 700; line-height: 1.5; text-align: center; }
.is-pre .sf-id { background: #e0a043; color: #3a2606; }
.is-running .sf-st { color: var(--ink); font-weight: 600; }
.is-failed .sf-st { color: #b3261e; }
.is-carry .sf-st { color: #a76a14; }
.sf-tag { padding: 0 5px; border-radius: 4px; background: #f6dfb4; color: #6b4410; font-size: 10.5px; font-weight: 600; line-height: 1.5;
          transition: background .8s ease, color .8s ease, box-shadow .8s ease; }
.sf-tag.is-soon { background: transparent; color: #c49a5a; box-shadow: inset 0 0 0 1px #e8c58f; }
.sf-cmd { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.4; color: var(--ink-2);
          font-variant-numeric: tabular-nums; }
.sf-cmd b { font-weight: 600; color: var(--ink); }
.sf-sep { color: var(--muted); }
.sf-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.sf-card:not(.is-running) .sf-bar { display: none; }
.sf-bar i { display: block; height: 100%; width: 0; background: #1f4e8c; }
.is-pre .sf-bar i { background: #e0a043; }
.sf-steps .sf-card.is-out { opacity: 0; transition: opacity .35s ease; }      /* after the state rules: it wins */
.sf-caret[hidden] { display: none; }
.sf-caret { display: inline-block; width: 6px; height: 1.05em; margin-left: 1px; vertical-align: -2px; background: #1f4e8c; animation: sf-blink 1.1s ease-in-out infinite; }

/* timeline */
.sf-tl { position: relative; margin-top: 12px; }
.sf-tlsvg { min-height: 84px; border-radius: 6px; cursor: pointer; touch-action: pan-y; }
.sf-svg { display: block; overflow: visible; font-family: var(--sans); user-select: none; -webkit-user-select: none; }
.sf-svg .ln { font-size: 12px; font-weight: 600; fill: var(--muted); }
.sf-svg .lane { fill: #f2f4f7; }
.sf-svg .m-infer { fill: #8fb0dc; }
.sf-svg .b-new { fill: #1f4e8c; }
.sf-svg .b-pre { fill: #e0a043; }
.sf-svg .b-fail { stroke: #b3261e; stroke-width: 2; }
.sf-svg .bl { font-size: 10.5px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.sf-svg .bl-new { fill: #fff; }
.sf-svg .bl-pre { fill: #3a2606; }
.sf-svg .snap { stroke: var(--ink); stroke-opacity: .4; stroke-dasharray: 3 3; }
.sf-svg .snapdot { fill: #fff; stroke: var(--ink); stroke-width: 1.5; }
.sf-svg .sn { font-size: 10.5px; fill: var(--ink-2); }
.sf-svg .done { stroke: #2f7d4f; stroke-width: 2; }
.sf-svg .doneflag { fill: #2f7d4f; }
.sf-svg .axt { stroke: #b7bfcc; }
.sf-svg .axl { font-size: 10.5px; fill: var(--muted); text-anchor: middle; }
.sf-svg .future { fill: #fff; opacity: .62; pointer-events: none; }
.sf-svg .head { stroke: var(--ink); stroke-width: 1.5; pointer-events: none; }
.sf-legend { display: flex; flex-wrap: wrap; gap: 3px 16px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 10px; margin-right: 6px; border-radius: 2.5px; vertical-align: -1px; }
.lg-infer { background: #8fb0dc; }
.lg-new { background: #1f4e8c; }
.lg-pre { background: #e0a043; }
.lg-idle { background: repeating-linear-gradient(45deg, #c8553d 0 2px, #f6dcd5 2px 5px); }
.lg-snap { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); background: #fff; }
.sf-tip { position: absolute; z-index: 6; display: none; max-width: 340px; padding: 5px 8px; border-radius: 6px; background: var(--ink); color: #fff;
          font: 12px/1.4 var(--sans); pointer-events: none; }

/* controls */
.sf-ctl { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.sf-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px;
           background: none; color: var(--ink-2); cursor: pointer; }
.sf-icon svg { width: 14px; height: 14px; fill: currentColor; }
.sf-icon:hover { background: var(--surface-2); color: var(--accent); }
.sf-icon:disabled { background: none; color: var(--ink-2); opacity: .3; cursor: default; }
.sf :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sf-turns { display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.sf-turns span { min-width: 82px; text-align: center; white-space: nowrap; }
.sf-seg { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; }
.sf-ctl .sf-seg { margin-left: auto; }
.sf-seg button { padding: 3px 10px; border: 0; background: #fff; color: var(--ink-2); font: 500 12.5px var(--sans); cursor: pointer; }
.sf-seg button + button { border-left: 1px solid var(--line); }
.sf-seg button:hover { color: var(--accent); }
.sf-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

/* episode picker */
.sf-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: start; margin-top: 12px; }
.vthumb { display: block; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.vthumb img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; outline: 1px solid var(--line); outline-offset: -1px; }
.vthumb .vname { display: block; margin-top: 4px; font-size: 12px; line-height: 1.3; color: var(--ink-2); }
.vthumb .vtime { display: block; white-space: nowrap; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vthumb:hover img { outline-color: var(--accent-2); }
.vthumb[aria-pressed="true"] img { outline: 2px solid var(--accent); outline-offset: -2px; }
.vthumb[aria-pressed="true"] .vname { color: var(--accent); font-weight: 600; }
.vthumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.sf-fly { position: absolute; z-index: 15; height: auto; border-radius: 5px; transform-origin: 0 0; box-shadow: 0 8px 24px rgba(20, 26, 38, .25); pointer-events: none; }
.sf-lb { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
         background: rgba(245, 247, 250, .94); cursor: zoom-out; overscroll-behavior: contain; }
html.sf-lock { overflow: hidden; scrollbar-gutter: stable; }
.sf-lb[hidden] { display: none; }
.sf-lbin { position: relative; max-width: 100%; max-height: 100%; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
           background: #fff; box-shadow: 0 8px 30px rgba(20, 26, 38, .12); cursor: auto; }
.sf-x { position: sticky; float: right; top: 0; width: 28px; height: 28px; margin: -4px -4px 4px 8px; padding: 0; border: 0; border-radius: 7px;
        background: rgba(255, 255, 255, .9); color: var(--ink-2); font: 400 22px/1 var(--sans); cursor: pointer; }
.sf-x:hover { background: var(--surface-2); color: var(--accent); }
.sf-lbin img { display: block; max-width: min(960px, 100%); height: auto; }
.sf-lbin pre { margin: 0; max-width: 860px; white-space: pre-wrap; font-size: 12.5px; }
.sf-lbin mark { background: #fcefd6; color: inherit; }
.sf-lbin p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

@keyframes sf-pulse { 50% { opacity: .5; } }
@keyframes sf-blink { 0%, 100% { opacity: .85; } 50% { opacity: .25; } }
.sf.is-still .sf-caret, .sf.is-still .sf-status i, .sf.is-still .sf-robot i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .sf-caret, .sf-status i, .sf-robot i { animation: none !important; } }

footer { border-top: 1px solid var(--line); padding: 26px 0 40px; text-align: center; font-size: 13.5px; color: var(--muted); }
footer p { color: var(--muted); margin: 4px 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .sf-task { min-height: 3em; }
  .sf-prog { min-height: 4.35em; }
  .sf-steps { --slot: 62px; }
  .sf-card { grid-template-columns: 72px minmax(0, 1fr); }
  .sf-cmd { -webkit-line-clamp: 3; }
  .teaser-grid, .example, .two-col { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .teaser-grid figure { max-width: 560px; margin: 0 auto; }
}
@media (max-width: 720px) {
  .sf-stage { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .sf-imgs { flex-basis: 330px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 40px; }
  .nav ul { gap: 16px; }
  .nav .brand { display: none; }
  .nav ul { margin-left: 0; }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .stat .num { font-size: 25px; }
  h2 { font-size: 25px; }
  .abstract p { text-align: left; }
  th, td { padding: 7px 8px; }
  .results td.bar { width: 34%; }
  .sr-head { gap: 8px; }
  .sr-big, .sr-gain { min-width: 0; flex: 1 1 30%; padding: 10px 8px; }
  .sr-big .v, .sr-gain .v { font-size: 30px; }
  .sr-vs { display: none; }
  .sr-row { grid-template-columns: 118px minmax(0, 1fr); gap: 8px; }
  .sr-name { font-size: 12.5px; white-space: normal; line-height: 1.3; }
  .sr-tag { display: block; margin: 1px 0 0 auto; width: max-content; font-size: 10px; line-height: 14px; }
  .sr-row.ours .sr-name { font-size: 13.5px; }
  .sr-ref { left: calc(118px + 8px + (100% - 126px) * var(--xf, 0)); }
  .sr-axis { margin-left: 126px; }
  .sr-group { padding-left: 126px; font-size: 11px; }
  pre { font-size: 12px; }
  .bib pre { font-size: 11.5px; }
  .sf-robot span { display: none; }
  .sf-turns span { min-width: 64px; }
  .sf-task { min-height: 4.5em; }
  .sf-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
