/* =====================================================================
 * VG-Cap project page
 * Colors follow the Overview figure: retrieval=blue, context=green,
 * scorer=purple, length=teal, generation=amber.
 * ===================================================================== */
:root {
  --bg: #fbfbfd;
  --bg-alt: #f3f4f8;
  --surface: #ffffff;
  --ink: #1b2130;
  --ink-2: #3d4556;
  --muted: #6b7385;
  --line: #e3e6ee;
  --line-strong: #cfd4df;

  --retrieval: #2f6fde;
  --context: #2e9d5b;
  --scorer: #7b4fd6;
  --length: #0e8f9c;
  --gen: #d0781e;

  --kept: #1f9d55;
  --kept-bg: #e3f5ea;
  --removed: #d64545;
  --removed-bg: #fdeaea;
  --introduced: #c27c00;
  --introduced-bg: #fff3d6;

  --ours: #7b4fd6;
  --other: #b9c0cd;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 28, 45, .05), 0 4px 18px rgba(20, 28, 45, .05);
  --nav-h: 54px;
  --font: 'Inter', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); background: var(--bg); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
b, strong { color: inherit; font-weight: 650; }
a { color: var(--retrieval); }
a:hover { color: #1d4fb0; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; }

/* color helpers */
.c-retrieval { color: var(--retrieval); }
.c-context { color: var(--context); }
.c-scorer { color: var(--scorer); }
.c-length { color: var(--length); }
.c-gen { color: var(--gen); }
.c-retrieval-bg { background: var(--retrieval); }
.c-context-bg { background: var(--context); }
.c-scorer-bg { background: var(--scorer); }
.c-length-bg { background: var(--length); }
.c-gen-bg { background: var(--gen); }

/* layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 860px; }
.block { padding: 72px 0; }
.block.alt { background: var(--bg-alt); }
.section-title {
  font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em;
  margin-bottom: .5rem; color: var(--ink);
}
.section-lead { color: var(--ink-2); max-width: 760px; margin-bottom: 2rem; font-size: 1.04rem; }
.sub-title { font-size: 1.2rem; font-weight: 700; margin: 2.5rem 0 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); min-width: 0;
}
.card + .card, .card + .grid-2, .grid-2 + .card { margin-top: 20px; }
.grid-2 > .card + .card, .grid-3 > .card + .card { margin-top: 0; }
.card-title { font-size: 1.12rem; font-weight: 700; margin-bottom: .5rem; color: var(--ink); }
.card-kicker { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .25rem; }
.card p { color: var(--ink-2); }
.takeaway { color: var(--ink-2); font-size: .95rem; margin-bottom: 1rem; }

/* ------------------------------------------------------------------ nav */
.topnav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: rgba(251, 251, 253, .86); backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 100%; display: flex; align-items: center; gap: 24px; }
.topnav-brand { font-weight: 800; color: var(--ink); letter-spacing: -.01em; font-size: 1.05rem; }
.topnav-brand:hover { color: var(--scorer); }
.topnav-links { display: flex; gap: 4px; margin-left: auto; }
.topnav-links a {
  color: var(--ink-2); font-size: .9rem; font-weight: 500; padding: 6px 11px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.topnav-links a:hover { background: var(--bg-alt); color: var(--ink); }
.topnav-links a.is-current { color: var(--scorer); background: #f1ecfc; }
.topnav-burger { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 8px; }
.topnav-burger span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: .2s; }
.scroll-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: linear-gradient(90deg, var(--retrieval), var(--scorer), var(--length)); }

/* ----------------------------------------------------------------- hero */
.hero-block { padding: 64px 0 40px; background: radial-gradient(1200px 380px at 50% -40px, #efe9fd 0%, rgba(239, 233, 253, 0) 70%); }
.venue-row { margin-bottom: 1rem; }
.pill { display: inline-block; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: .03em; }
.pill-venue { background: var(--ink); color: #fff; }
.paper-title { font-size: 2.35rem; line-height: 1.22; font-weight: 800; letter-spacing: -.025em; color: var(--ink); margin-bottom: 1.4rem; }
.wordmark {
  display: block; font-size: 1.15rem; letter-spacing: .02em; margin-bottom: .45rem;
  background: linear-gradient(90deg, var(--retrieval), var(--scorer) 55%, var(--length));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 1.04rem; font-weight: 500; margin-bottom: .7rem; }
.author { white-space: nowrap; }
.author sup { font-size: .68em; color: var(--muted); margin-left: 1px; }
.orcid { color: #a6ce39; margin-left: 4px; font-size: .9em; }
.orcid:hover { color: #7fa21f; }
.affiliations { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; color: var(--ink-2); font-size: .93rem; }
.affiliations sup { color: var(--muted); margin-right: 2px; }
.author-notes { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; color: var(--muted); font-size: .84rem; margin-top: .4rem; }

.link-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 1.8rem 0 1.4rem; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px; position: relative;
  padding: 9px 18px; border-radius: 999px; background: var(--ink); color: #fff !important;
  font-weight: 600; font-size: .95rem; transition: transform .15s, background .15s;
}
.link-btn:hover { background: #333c52; transform: translateY(-1px); }
.link-btn .soon { display: none; }
/* No href yet -> UI-only button in a "soon" state. */
.link-btn:not([href]) { background: #e7e9ef; color: var(--muted) !important; cursor: default; transform: none; }
.link-btn:not([href]) .soon {
  display: inline; font-style: normal; font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; background: #fff; color: var(--muted); padding: 1px 7px; border-radius: 999px;
}
.logo-strip { display: flex; justify-content: center; align-items: center; gap: 28px; flex-wrap: wrap; }
.logo-img { height: 92px; width: auto; max-width: 280px; object-fit: contain; }

/* ---------------------------------------------------------- placeholders */
.ph {
  border: 2px dashed #c9bdf0; background: repeating-linear-gradient(135deg, #faf8ff, #faf8ff 10px, #f4f0fe 10px, #f4f0fe 20px);
  border-radius: var(--radius-sm); color: #6a54b0; font-size: .86rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 14px; gap: 4px;
}
.ph small { font-family: var(--mono); font-weight: 400; font-size: .74rem; color: #8574c2; word-break: break-all; }
.ph i { font-size: 1.4rem; opacity: .7; }
.ph-logo { width: 190px; min-height: 70px; padding: 8px; font-size: .8rem; }
.ph-logo small { font-size: .66rem; }
body.hide-placeholders [data-placeholder-block], body.hide-placeholders .ph-only { display: none !important; }

/* ---------------------------------------------------------------- TL;DR */
.tldr {
  font-size: 1.12rem; line-height: 1.65; color: var(--ink-2); max-width: 900px; margin: 0 auto 2rem; text-align: center;
}
.tldr-tag {
  display: inline-block; background: var(--scorer); color: #fff; font-weight: 800; font-size: .74rem;
  letter-spacing: .08em; padding: 3px 9px; border-radius: 6px; margin-right: 8px; vertical-align: 2px;
}
.teaser { margin-bottom: 2rem; }
.teaser-grid { display: grid; grid-template-columns: 1fr auto 1fr auto 1.3fr; gap: 14px; align-items: stretch; }
.teaser-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.teaser-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .6rem; }
.teaser-col img { width: 100%; border-radius: var(--radius-sm); display: block; }
.teaser-arrow { display: flex; align-items: center; color: var(--line-strong); font-size: 1.3rem; }
.teaser-ph { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 14px; }
.teaser-ph .ph { min-height: 200px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: .6rem; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--scorer); }
.stat-tile.t-removed::before { background: var(--removed); }
.stat-tile.t-introduced::before { background: var(--introduced); }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin: 4px 0 2px; white-space: nowrap; }
.stat-value .arrow { color: var(--muted); font-weight: 500; font-size: .8em; }
.stat-delta { font-size: .83rem; font-weight: 600; }
.stat-delta.up { color: var(--kept); }
.stat-delta.neutral { color: var(--muted); }
.stat-row + .card { margin-top: 20px; }
.stat-foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: .8rem; }

/* ------------------------------------------------------------- abstract */
.abstract { font-size: 1.03rem; line-height: 1.75; color: var(--ink-2); text-align: justify; hyphens: auto; }

/* --------------------------------------------------------------- problem */
.entity-cloud { display: flex; flex-wrap: wrap; gap: 8px; min-height: 120px; align-content: flex-start; margin: 1rem 0; padding: 14px; background: var(--bg-alt); border-radius: var(--radius-sm); }
.cloud-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.legend { font-size: .82rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.lg-kept { background: var(--kept); } .lg-removed { background: var(--removed); } .lg-introduced { background: var(--introduced); }
.btn-soft {
  background: #f1ecfc; color: var(--scorer); border: 0; border-radius: 999px; padding: 7px 15px;
  font-weight: 600; font-size: .88rem; cursor: pointer; font-family: inherit; transition: background .15s;
}
.btn-soft:hover { background: #e6dcfa; }

/* entity chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .86rem; font-weight: 600; background: #fff; border: 1px solid var(--line-strong); color: var(--ink);
  transition: opacity .45s, transform .45s, background .3s, border-color .3s; cursor: default; white-space: nowrap;
}
.chip .t { font-size: .64rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.chip .s { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.chip.kept { border-color: #9fd9b6; background: var(--kept-bg); }
.chip.removed { border-color: #f1b3b3; background: var(--removed-bg); }
.chip.introduced { border-color: #f0d08a; background: var(--introduced-bg); }
.entity-cloud .chip { background: #fff; border-color: var(--line-strong); }
.entity-cloud.filtered .chip.kept { background: var(--kept-bg); border-color: #9fd9b6; transform: scale(1.06); }
.entity-cloud.filtered .chip.removed { opacity: .28; text-decoration: line-through; transform: scale(.92); background: var(--removed-bg); }

/* sliders */
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: .4rem; font-size: .88rem; color: var(--ink-2); }
.slider-row label { min-width: 200px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--length); min-width: 0; }

/* contributions */
.contrib { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.contrib-icon { width: 40px; height: 40px; border-radius: 11px; color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: .8rem; }
.contrib h4 { font-weight: 700; margin-bottom: .35rem; }
.contrib p { color: var(--ink-2); font-size: .94rem; }

/* math */
.eq { overflow-x: auto; overflow-y: hidden; padding: 4px 0; margin: .6rem 0; }
.eq .katex-display { margin: .3em 0; }
.eq.small { font-size: .9rem; }
.step-panel .eq { font-size: .9em; }

/* --------------------------------------------------------------- method */
.stepper { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.step {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  padding: 8px 14px 8px 8px; border-radius: 999px; font-family: inherit; font-weight: 600; font-size: .9rem;
  color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.step:hover { border-color: var(--line-strong); color: var(--ink); }
.step.is-active { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.step-n { width: 24px; height: 24px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; }
.method-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
.overview-fig { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.overview-fig img { display: block; width: 100%; cursor: zoom-in; }
.fig-highlight {
  position: absolute; border: 2.5px solid var(--ink); border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(251, 251, 253, .62); transition: all .45s cubic-bezier(.4, .1, .2, 1);
}
.overview-fig.show-all .fig-highlight { opacity: 0; }
.fig-all {
  position: absolute; right: 10px; bottom: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer; color: var(--ink-2);
}
.step-panels { min-width: 0; }
.step-panel { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.step-panel.is-active { display: block; animation: fadeUp .35s ease; }
.step-panel h3 { font-weight: 800; font-size: 1.1rem; margin-bottom: .6rem; }
.step-panel p { color: var(--ink-2); margin-bottom: .6rem; font-size: .96rem; }
.ticks { list-style: none; margin: .5rem 0 0; padding: 0; }
.ticks li { position: relative; padding-left: 24px; margin-bottom: .45rem; color: var(--ink-2); font-size: .95rem; }
.ticks li::before { content: "✓"; position: absolute; left: 2px; top: 0; color: var(--kept); font-weight: 800; }
.text-link { font-weight: 600; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- scorer */
.scorer-grid { align-items: start; }
.weight-group { margin-bottom: 1.1rem; }
.wg-title { font-weight: 700; font-size: .9rem; margin-bottom: .4rem; }
.wg-title .muted { font-weight: 500; font-size: .8rem; margin-left: 4px; }
.wbar { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 10px; font-size: .84rem; margin-bottom: 4px; }
.wbar .lbl { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wbar .track { height: 10px; background: var(--bg-alt); border-radius: 6px; overflow: hidden; }
.wbar .fill { height: 100%; border-radius: 6px; transition: width .6s ease; }
.wbar .val { font-family: var(--mono); font-size: .8rem; text-align: right; color: var(--ink); }

.pg-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: .4rem 0 1rem; }
.pg-presets button {
  font-family: inherit; font-size: .78rem; font-weight: 600; border: 1px solid var(--line); background: var(--bg);
  border-radius: 999px; padding: 4px 11px; cursor: pointer; color: var(--ink-2);
}
.pg-presets button:hover { border-color: var(--scorer); color: var(--scorer); }
.pg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: .6rem; flex-wrap: wrap; }
.pg-label { font-size: .88rem; color: var(--ink-2); font-weight: 500; }
.seg { display: inline-flex; background: var(--bg-alt); border-radius: 9px; padding: 3px; }
.seg button {
  border: 0; background: transparent; font-family: inherit; font-size: .82rem; font-weight: 600; color: var(--muted);
  padding: 4px 11px; border-radius: 7px; cursor: pointer;
}
.seg button.is-on { background: #fff; color: var(--scorer); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.checks { display: inline-flex; gap: 14px; font-size: .86rem; color: var(--ink-2); }
.checks input { accent-color: var(--scorer); margin-right: 4px; }
.pg-select, .pg-num {
  font-family: inherit; font-size: .86rem; border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 9px; background: #fff; color: var(--ink);
}
.pg-num { width: 70px; }
.pg-result { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--line-strong); }
.pg-score { font-size: 1.05rem; margin-bottom: 1.4rem; }
.pg-score b { font-family: var(--mono); font-size: 1.5rem; color: var(--scorer); }
.pg-bar { position: relative; height: 22px; background: var(--bg-alt); border-radius: 6px; display: flex; overflow: visible; }
.pg-seg { height: 100%; transition: width .35s ease; }
.pg-thresh + .pg-seg { border-radius: 6px 0 0 6px; }
.pg-thresh { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); z-index: 2; }
.pg-thresh span { position: absolute; top: -18px; left: -10px; font-size: .7rem; font-family: var(--mono); color: var(--ink); }
.pg-breakdown { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--ink-2); margin-top: .7rem; }
.pg-breakdown .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.pg-verdict { margin-top: .8rem; font-weight: 700; padding: 8px 12px; border-radius: 9px; font-size: .92rem; }
.pg-verdict.ok { background: var(--kept-bg); color: var(--kept); }
.pg-verdict.no { background: var(--removed-bg); color: var(--removed); }

.trace-card { margin-top: 20px; }
.trace-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: .8rem; }
.trace-row { display: grid; grid-template-columns: 26px 220px 1fr 56px; gap: 10px; align-items: center; font-size: .86rem; padding: 3px 0; }
.trace-row .rk { color: var(--muted); font-family: var(--mono); font-size: .76rem; text-align: right; }
.trace-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.trace-row .nm .t { font-size: .66rem; color: var(--muted); margin-left: 6px; font-weight: 700; }
.trace-row .tr { position: relative; height: 14px; background: var(--bg-alt); border-radius: 5px; }
.trace-row .tr .f { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.trace-row .tr .th { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.trace-row .sc { font-family: var(--mono); font-size: .8rem; text-align: right; }
.trace-row.cut { border-top: 2px dashed var(--line-strong); margin-top: 4px; padding-top: 7px; }
.trace-note { font-size: .8rem; color: var(--muted); margin-top: .6rem; }

/* --------------------------------------------------------------- length */
.flow { display: flex; align-items: stretch; gap: 10px; margin-bottom: 22px; }
.flow-node {
  flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px;
  text-align: center; box-shadow: var(--shadow); min-width: 0;
}
.flow-node.c-length-border { border: 2px solid var(--length); }
.flow-node.muted-node { background: transparent; box-shadow: none; border-style: dashed; }
.flow-node.ok-node { border: 2px solid var(--kept); }
.flow-step { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--length); }
.flow-title { font-weight: 700; margin-bottom: .3rem; }
.flow-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.muted-node .flow-num { color: var(--muted); }
.ok-node .flow-num { color: var(--kept); }
.flow-unit { font-size: .78rem; color: var(--muted); margin-bottom: .4rem; }
.flow-cap { font-size: .84rem; color: var(--ink-2); }
.flow-arrow { display: flex; align-items: center; color: var(--line-strong); }

/* ------------------------------------------------------------- examples */
.tag-cfg { display: inline-block; font-size: .8rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; }
.tag-cfg.base { background: #eceef3; color: var(--ink-2); }
.tag-cfg.ours { background: #f1ecfc; color: var(--scorer); }

.xb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.xb-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.xb-filters button {
  font-family: inherit; font-size: .82rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 13px; cursor: pointer; color: var(--ink-2);
}
.xb-filters button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.xb-nav { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.xb-nav button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; color: var(--ink-2);
}
.xb-nav button:hover { border-color: var(--ink); color: var(--ink); }
.xb-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 14px; scroll-snap-type: x proximity; }
.xb-thumb {
  flex: 0 0 132px; height: 92px; border-radius: 10px; overflow: hidden; position: relative; cursor: pointer;
  border: 2px solid transparent; background: var(--bg-alt); scroll-snap-align: start; padding: 0;
  transition: border-color .15s, transform .15s;
}
.xb-thumb:hover { transform: translateY(-2px); }
.xb-thumb.is-on { border-color: var(--scorer); }
.xb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xb-thumb .badge {
  position: absolute; right: 5px; bottom: 5px; background: rgba(214, 69, 69, .92); color: #fff;
  font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 999px;
}
.xb-thumb .cat {
  position: absolute; left: 5px; top: 5px; background: rgba(27, 33, 48, .75); color: #fff;
  font-size: .64rem; font-weight: 700; padding: 1px 6px; border-radius: 5px;
}
.xb-thumb.ph { border: 2px dashed #c9bdf0; font-size: .72rem; padding: 4px; }
.xb-thumb.ph.is-on { border-color: var(--scorer); border-style: solid; }

.xb-view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; animation: fadeUp .3s ease; }
.xb-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; align-items: start; }
.xb-media { position: sticky; top: calc(var(--nav-h) + 16px); }
.xb-media img { width: 100%; border-radius: 11px; display: block; cursor: zoom-in; background: var(--bg-alt); max-height: 460px; object-fit: contain; }
.xb-media .ph { aspect-ratio: 4 / 3; }
.xb-meta { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.xb-meta .cat { background: var(--ink); color: #fff; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.xb-excerpt { background: var(--introduced-bg); color: #8a5a00; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.xb-article h4 { font-weight: 700; font-size: 1.02rem; line-height: 1.4; margin-bottom: .2rem; }
.xb-article .src { font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.xb-article .snip { font-size: .9rem; color: var(--ink-2); border-left: 3px solid var(--line-strong); padding-left: 10px; margin-bottom: .9rem; }
.xb-ents-title { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .2rem 0 .45rem; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.xb-ents { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.xb-ents .chip { cursor: pointer; }

.xb-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: .2rem 0 .7rem; }
.tabs-pill { display: inline-flex; background: var(--bg-alt); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.tabs-pill button {
  border: 0; background: transparent; font-family: inherit; font-size: .85rem; font-weight: 600; color: var(--muted);
  padding: 5px 13px; border-radius: 8px; cursor: pointer;
}
.tabs-pill button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.tabs-pill button:disabled { opacity: .45; cursor: not-allowed; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--scorer); }

.cap-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--bg); min-width: 0; }
.cap-card.ours { border-color: #d9cbf6; background: #fbf9ff; }
.cap-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: .5rem; flex-wrap: wrap; }
.cap-head .who { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.cap-card.ours .cap-head .who { color: var(--scorer); }
.cap-text {
  font-size: 1.02rem; line-height: 1.72; color: var(--ink); max-width: 68ch;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden;
}
.cap-text.is-open { -webkit-line-clamp: unset; display: block; }
.cap-more { margin-top: .4rem; background: none; border: 0; padding: 0; font-family: inherit; font-weight: 600; font-size: .84rem; color: var(--retrieval); cursor: pointer; }
.cap-foot { display: flex; gap: 14px; flex-wrap: wrap; margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.cap-foot b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.xb-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.xb-compare .cap-text { -webkit-line-clamp: unset; display: block; }
.xb-note { margin-top: 14px; font-size: .9rem; color: var(--ink-2); background: var(--bg-alt); border-radius: 10px; padding: 10px 14px; }
.xb-note i, .xb-note .svg-inline--fa { color: var(--scorer); margin-right: 8px; }

/* entity marks inside captions */
.ent { border-radius: 4px; padding: 0 2px; transition: background .2s, box-shadow .2s; }
.no-hl .ent { background: none !important; text-decoration: none !important; color: inherit !important; border-bottom: 0 !important; }
.ent-kept { border-bottom: 2px solid var(--kept); background: rgba(31, 157, 85, .08); }
.ent-removed { background: var(--removed-bg); color: #a32727; text-decoration: line-through; text-decoration-color: rgba(214, 69, 69, .7); }
.ent-introduced { border-bottom: 2px solid var(--introduced); background: rgba(194, 124, 0, .1); }
.ent.pulse { box-shadow: 0 0 0 2px var(--scorer); background: #efe8fd; }
.diff-del { background: var(--removed-bg); color: #a32727; text-decoration: line-through; border-radius: 3px; }
.diff-ins { background: var(--kept-bg); color: #156e3b; border-radius: 3px; }

.xb-ph-view { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; }
.xb-ph-view .ph { min-height: 120px; }
.xb-ph-view .ph.tall { min-height: 300px; }
.xb-ph-stack { display: grid; gap: 12px; }

/* -------------------------------------------------------------- results */
.result-card { margin-bottom: 20px; }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.chart-box { position: relative; width: 100%; }
.chart-box.short { height: 170px; }
.chart-box.mid { height: 290px; }
.chart-box.tall { height: 340px; }
.ablation-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: center; }
.abl-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.abl-steps li { position: relative; padding: 8px 10px 8px 40px; border-radius: 10px; margin-bottom: 6px; font-size: .88rem; color: var(--ink-2); transition: background .15s; }
.abl-steps li:hover, .abl-steps li.is-hot { background: var(--bg-alt); }
.abl-steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 8px; top: 9px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--other); color: #fff; font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.abl-steps li.ours::before { background: var(--ours); }
.abl-steps .nm { font-weight: 700; color: var(--ink); }
.abl-steps .dl { font-family: var(--mono); font-size: .78rem; color: var(--kept); margin-left: 6px; }
.abl-steps .len { display: inline-block; font-family: var(--mono); font-size: .72rem; background: #e6f4f5; color: var(--length); padding: 0 7px; border-radius: 999px; margin-left: 6px; }
.table-details { margin-top: 14px; }
.table-details summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); padding: 6px 0; }
.table-details summary:hover { color: var(--ink); }
.table-scroll { overflow-x: auto; margin: .6rem 0; }
.rtable { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.rtable th, .rtable td { padding: 8px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.rtable th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.rtable td:first-child, .rtable th:first-child { text-align: left; }
.rtable tr.ours td { background: #f7f3fe; font-weight: 600; }
.rtable td.best { font-weight: 800; color: var(--scorer); }

/* ------------------------------------------------------------- analysis */
.split-bar { display: flex; height: 54px; border-radius: 12px; overflow: hidden; }
.split-bar > div { display: flex; flex-direction: column; justify-content: center; padding: 0 14px; color: #fff; font-weight: 700; font-size: .9rem; line-height: 1.2; min-width: 0; white-space: nowrap; transition: flex-grow .8s ease; }
.split-bar small { font-weight: 500; font-size: .74rem; opacity: .9; }
.split-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.fig-fallback img { width: 100%; display: block; border-radius: 8px; cursor: zoom-in; }
.fig-fallback .tiny { margin-top: .4rem; }

/* ---------------------------------------------------------- limitations */
.lim-list { display: grid; gap: 10px; margin-bottom: 20px; }
.lim { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; box-shadow: var(--shadow); }
.lim summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
.lim summary::-webkit-details-marker { display: none; }
.lim summary::after { content: "+"; margin-left: auto; font-weight: 500; font-size: 1.2rem; color: var(--muted); }
.lim[open] summary::after { content: "−"; }
.lim summary i, .lim summary .svg-inline--fa { color: var(--scorer); width: 18px; }
.lim p { padding: 0 0 14px 28px; color: var(--ink-2); font-size: .95rem; }

/* --------------------------------------------------------------- bibtex */
.bibtex-box { position: relative; }
.bibtex-box pre { background: #1d2230; color: #e6e9f2; border-radius: var(--radius); padding: 22px; font-family: var(--mono); font-size: .84rem; line-height: 1.6; overflow-x: auto; white-space: pre; }
.bibtex-box code { background: none; color: inherit; font-size: inherit; padding: 0; }
.copy-btn {
  position: absolute; right: 12px; top: 12px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  color: #e6e9f2; font-family: inherit; font-size: .8rem; font-weight: 600; padding: 5px 11px; border-radius: 8px; cursor: pointer;
}
.copy-btn:hover { background: rgba(255, 255, 255, .2); }

/* --------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: .86rem; color: var(--muted); }
.site-footer .ack { margin-bottom: .8rem; color: var(--ink-2); }
.site-footer .ack b { color: var(--ink); }

/* -------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 18, 28, .88); display: none;
  align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox.is-open { display: flex; animation: fadeUp .2s ease; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; background: #fff; }
.lightbox-close { position: absolute; right: 18px; top: 14px; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  .method-grid { grid-template-columns: 1fr; }
  .teaser-grid { grid-template-columns: 1fr 1fr; }
  .teaser-grid .teaser-arrow { display: none; }
  .teaser-grid .teaser-col:last-child { grid-column: 1 / -1; }
  .ablation-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .xb-top, .xb-ph-view { grid-template-columns: 1fr; }
  .xb-media { position: static; }
  .xb-compare { grid-template-columns: 1fr; }
  .flow { flex-direction: column; }
  .flow-arrow { justify-content: center; transform: rotate(90deg); }
  .teaser-ph { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .topnav-burger { display: block; }
  .topnav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; box-shadow: var(--shadow);
  }
  .topnav-links.is-open { display: flex; }
  .block { padding: 52px 0; }
  .wrap { padding: 0 16px; }
  .paper-title { font-size: 1.6rem; }
  .section-title { font-size: 1.5rem; }
  .card { padding: 18px; }
  .xb-view { padding: 16px; }
  .slider-row { flex-direction: column; align-items: stretch; gap: 2px; }
  .slider-row label { min-width: 0; }
  .wbar { grid-template-columns: 112px 1fr 34px; }
  .trace-row { grid-template-columns: 22px 120px 1fr 44px; }
  .teaser-grid { grid-template-columns: 1fr; }
  .split-bar small { display: none; }
}
@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.6rem; }
  .abstract { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
