/* PaperScorer blog site CSS, verbatim from SachinKonan/PaperLens origin/main website/index.html
   (bundle template, third <style> block). Load the fonts and KaTeX from the CDN links in
   skeleton.html; they were inlined as the first two <style> blocks in the bundle. */
/* ============================================================================
   PaperScorer — manuscript site styles
   Direction F (refined): arXiv-faithful, distill.pub scroll TOC, paper palette
   ============================================================================ */

:root {
  /* paper palette (from main.tex) */
  --pl-blue:        #2F5496;
  --pl-blue-deep:   #233f70;
  --pl-row-hi:      #CDDFF5;
  --pl-takeaway-hd: #D9E7FF;
  --pl-takeaway-bg: #F8FBFF;
  --pl-green:       #006400;
  --pl-green-bg:    #e8f3e8;
  --pl-red:         #AA0000;
  --pl-red-bg:      #fbeaea;
  --pl-link:        #0063BE;
  --pl-platt:       #c4632f;

  /* neutrals */
  --ink:        #1b1b1a;
  --ink-soft:   #3a3a37;
  --ink-mute:   #6f6f69;
  --ink-faint:  #9b9b93;
  --rule:       #e7e4dc;
  --rule-soft:  #efece5;
  --paper:      #ffffff;
  --paper-2:    #f7f5f0;

  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", "Source Serif 4", Georgia, serif;
  --display: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", "Source Serif 4", Georgia, serif;
  --mono: "Inconsolata", "SFMono-Regular", Consolas, monospace;
  --ui-sans: Helvetica, Arial, sans-serif;

  --maxw: 1080px;
  --toc-w: 248px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* PaperScorer wordmark — always bold blue */
.pl {
  font-weight: 700;
  color: var(--pl-blue);
  letter-spacing: -0.005em;
}

.katex { font-size: 1.04em; }

/* ───────────────────────── Shell / TOC ───────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--toc-w) minmax(0, 1fr);
  align-items: start;
}

.toc {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 46px 26px 40px 40px;
  border-right: 1px solid var(--rule);
  overflow-y: auto;
  background: var(--paper);
}
.toc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 38px;
}
.toc-brand svg { width: 26px; height: 26px; flex: none; }
.toc-brand .brand-name {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  color: var(--pl-blue);
  letter-spacing: -0.01em;
}
.toc-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.toc nav { display: flex; flex-direction: column; gap: 1px; }
.toc nav a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--display);
  font-size: 15px;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
  line-height: 1.3;
}
.toc nav a .toc-n {
  font-family: var(--ui-sans);
  font-size: 11px;
  color: var(--ink-faint);
  min-width: 16px;
}
.toc nav a:hover { color: var(--ink); }
.toc nav a.active {
  color: var(--pl-blue);
  border-left-color: var(--pl-blue);
  font-weight: 600;
}
.toc nav a.active .toc-n { color: var(--pl-blue); }
/* the demo button leads the hero links */
.hero-links a.hero-cta { background: var(--pl-blue); border-color: var(--pl-blue); color: #fff; }
.hero-links a.hero-cta:hover { background: var(--pl-blue-deep); border-color: var(--pl-blue-deep); color: #fff; }
/* lighter aside next to a section heading */
h2.sec .sec-aside { font-weight: 400; font-size: 0.62em; color: var(--ink-mute); white-space: nowrap; }
h2.sec .sec-aside a { color: var(--pl-link); text-decoration: none; border-bottom: 1px solid rgba(0, 99, 190, .25); }
.toc-foot {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ───────────────────────── Main column ───────────────────────── */
main { padding: 0 56px; min-width: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.wide { max-width: var(--maxw); margin: 0 auto; }

section { padding: 30px 0; scroll-margin-top: 24px; }
.section-rule { border: none; border-top: 1px solid var(--rule); max-width: var(--maxw); margin: 18px auto; }

.eyebrow {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--pl-blue);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--pl-blue);
}

h2.sec {
  font-family: var(--display);
  font-weight: 700;
  font-size: 31px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--ink);
  text-wrap: balance;
}
h3.sub {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin: 28px 0 12px;
}
p { margin: 0 0 18px; color: var(--ink-soft); }
p .lead { color: var(--ink); }
/* F-style justified manuscript columns */
.wrap > p:not(.note), p.wrap, .abstract p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}
a.link { color: var(--pl-link); text-decoration: none; border-bottom: 1px solid rgba(0,99,190,0.3); }
a.link:hover { border-bottom-color: var(--pl-link); }

/* ───────────────────────── Hero / Title block ───────────────────────── */
.hero {
  text-align: center;
  padding: 78px 0 26px;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 43px;
  line-height: 1.16;
  letter-spacing: -0.012em;
  margin: 0 0 22px;
  color: var(--ink);
  text-wrap: balance;
}
.hero h1 .pl { font-weight: 700; }
.hero .wrap > p.authors {
  font-size: 19px;
  color: var(--ink);
  margin: 0 0 4px;
  text-align: center;
}
.hero .authors sup { color: var(--ink-mute); font-size: 0.7em; }
.hero .wrap > p.affil {
  font-size: 15px;
  font-style: italic;
  color: var(--ink-mute);
  margin: 0 0 22px;
  text-align: center;
}
.hero-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--display);
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  background: #fff;
  transition: all .15s;
}
.hero-links a:hover { border-color: var(--pl-blue); color: var(--pl-blue); }
.hero-links a svg { width: 16px; height: 16px; }

/* Abstract */
.abstract {
  max-width: 920px;
  margin: 34px auto 0;
}
.abstract .abstract-h {
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 12px;
}
.abstract p {
  font-size: 17.5px;
  line-height: 1.66;
  color: var(--ink-soft);
  margin: 0;
}

/* ───────────────────────── Terminal / code ───────────────────────── */
.terminal {
  background: #1c2230;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 40px -24px rgba(31,44,77,0.5);
  border: 1px solid #161b27;
}
.terminal-head {
  display: flex;
  gap: 7px;
  padding: 12px 16px;
  background: #161b27;
  align-items: center;
}
.terminal-head span {
  width: 11px; height: 11px; border-radius: 50%;
  background: #39414f;
}
.terminal-head span:nth-child(1) { background: #e06c5a; }
.terminal-head span:nth-child(2) { background: #e0b04a; }
.terminal-head span:nth-child(3) { background: #5aa564; }
.term-copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: #8b94a6;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}
.term-copy:hover, .term-copy:focus-visible { color: #e6e9f0; border-color: #39414f; background: #1c2230; outline: none; }
.term-copy svg { width: 16px; height: 16px; display: block; }
.term-copy .ok { display: none; }
.term-copy.copied { color: #7fd88f; border-color: #2f4a37; }
.term-copy.copied .ic { display: none; }
.term-copy.copied .ok { display: block; }
.terminal-head .term-title {
  margin-left: 8px; font-family: var(--mono); font-size: 12px; color: #8b94a6; width: auto; height: auto; border-radius: 0; background: none;
}
.terminal pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
}
.terminal code {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.8;
  color: #e6e9f0;
  white-space: pre;
}
.terminal code .tok-cmd { color: #7fd88f; }
.terminal code .tok-flag { color: #e0b04a; }
.terminal code .tok-path { color: #8fb4ff; }
.terminal code .tok-cmt { color: #6b7488; }
.terminal code .tok-key { color: #d98f6a; }
.terminal code .tok-str { color: #c5e1a5; }

/* quickstart toggle */
.qs-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 3px;
}
.seg button {
  font-family: var(--display);
  font-size: 14px;
  border: none;
  background: none;
  color: var(--ink-mute);
  padding: 7px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all .15s;
}
.seg button.on {
  background: var(--pl-blue);
  color: #fff;
  box-shadow: 0 2px 8px -3px rgba(47,84,150,0.6);
}
.note {
  font-size: 15px;
  color: var(--ink-mute);
  margin: 14px 0 0;
}
.note code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--pl-blue-deep);
}

/* ───────────────────────── Motivation ───────────────────────── */
.flow-chain {
  margin: 26px 0;
  padding: 26px 24px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.flow-chain .flow-cap {
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-mute);
  margin-bottom: 16px;
  text-align: center;
}
.flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.flow-node {
  font-family: var(--display);
  font-size: 15px;
  padding: 8px 15px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 7px;
  white-space: nowrap;
  color: var(--ink);
}
.flow-node.terminal-node {
  background: var(--pl-blue);
  color: #fff;
  border-color: var(--pl-blue);
  font-weight: 600;
}
.flow-arrow { color: var(--pl-blue); font-size: 14px; }
.flow-latent {
  margin-top: 13px;
  text-align: center;
  font-size: 13.5px;
  font-style: italic;
  color: var(--ink-mute);
}

.display-eq {
  margin: 22px 0;
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.display-eq.accent {
  background: var(--pl-takeaway-bg);
  border: 1px solid var(--pl-row-hi);
  border-radius: 10px;
}

/* callout / takeaway box */
.takeaway {
  margin: 24px 0;
  border: 1px solid var(--pl-blue);
  border-radius: 8px;
  overflow: hidden;
  background: var(--pl-takeaway-bg);
}
.takeaway .takeaway-h {
  background: var(--pl-takeaway-hd);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  padding: 9px 18px;
  color: var(--ink);
}
.takeaway .takeaway-b {
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.takeaway .takeaway-b p { margin: 0; }

/* stat inline highlights */
.stat { font-weight: 600; color: var(--pl-blue-deep); font-variant-numeric: tabular-nums; }

/* ───────────────────────── Figures ───────────────────────── */
figure { margin: 24px 0; }
.media-frame {
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
}
.media-frame img { display: block; width: 100%; }
.dataset-figure { margin: 38px 0 12px; padding: 22px; }
figcaption {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-mute);
  margin-top: 12px;
  text-align: left;
  max-width: none;
}
figcaption .fig-n { font-weight: 600; color: var(--ink); }

.howitworks-fig { padding: 18px 14px; }
.howitworks-fig svg { display: block; width: 100%; height: auto; }
.howitworks-fig .teaser-stacked { display: none; }
@media (max-width: 640px) {
  /* the wide pipeline gets too small to read here; show the same cards in a two-column flow */
  .howitworks-fig { padding: 12px 10px; }
  .howitworks-fig .teaser-wide { display: none; }
  .howitworks-fig .teaser-stacked { display: block; max-width: 460px; margin: 0 auto; }
}

/* ───────────────────────── Results table ───────────────────────── */
.table-wrap { overflow-x: auto; margin: 22px 0 8px; }
table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  border-top: 1.5px solid var(--ink);
}
table.results caption {
  caption-side: bottom;
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-mute);
  max-width: none;
  margin: 10px 0 0;
  font-family: var(--serif);
}
table.results caption .fig-n { font-weight: 600; color: var(--ink); }
table.results thead th {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  padding: 7px 10px;
  font-size: 13.5px;
}
table.results thead tr.grp th {
  border-bottom: none;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--pl-blue);
  text-transform: uppercase;
}
table.results thead tr.grp th.spacer { border-bottom: none; }
table.results thead tr.metrics th { border-bottom: 1px solid var(--ink); padding-top: 2px; color: var(--ink-mute); font-weight: 500; }
table.results th.lft, table.results td.lft { text-align: left; }
table.results tbody td:nth-child(2) { text-align: center; }
table.results tbody td {
  text-align: center;
  padding: 8px 10px;
  border-bottom: none;
  font-size: 16.5px;
}
table.results tbody tr:last-child td { border-bottom: 1.5px solid var(--ink); }
table.results tbody .method strong { font-weight: 600; }
table.results tbody .method span {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
  margin-top: 1px;
}
table.results tbody tr.pl { background: var(--pl-takeaway-bg); }
table.results tbody tr.pl td.best,
table.results td.best { color: var(--pl-blue-deep); font-weight: 700; }
table.results tbody tr.divider td { border-bottom: 1.5px solid var(--ink); padding: 0; height: 0; }
.table-note { font-size: 13.5px; color: var(--ink-faint); margin-top: 10px; }
.visual-conjecture {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.visual-conjecture p {
  margin: 0;
  flex: 1 1 auto;
}
.vision-dumbbell-figure {
  order: 2;
  flex: 0 0 min(390px, 42%);
  margin: 0;
  padding: 10px 10px 8px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(27, 27, 26, .04);
}
.vision-dumbbell-figure img { width: 100%; }
.dumbbell-svg { display: block; width: 100%; height: auto; }
.vision-dumbbell-figure figcaption {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-soft);
}
.conjecture-highlight {
  display: block;
  margin-top: 10px;
  padding: 11px 13px;
  border-left: 3px solid var(--pl-blue);
  background: var(--paper-2);
}
@media (max-width: 820px) {
  .visual-conjecture {
    display: block;
  }
  .vision-dumbbell-figure {
    width: 100%;
    margin: 0 0 14px;
  }
}

/* ───────────────────────── Visual decision game ───────────────────────── */
.visual-game-block { margin-top: 28px; }
.visual-game-block .sub { text-align: left; margin-top: 6px; }
.visual-game {
  margin-top: 18px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 16px 38px rgba(27, 27, 26, 0.055);
}
.vg-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.vg-kicker {
  font-family: var(--ui-sans);
  font-size: 12px;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.vg-venue {
  margin-top: 2px;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
}
.vg-timer {
  position: relative;
  width: 138px;
  height: 32px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-2);
  font-family: var(--ui-sans);
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vg-timer i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  transform-origin: left center;
  background: var(--pl-blue);
  transition: transform .2s linear;
}
.vg-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.vg-option {
  position: relative;
  appearance: none;
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  background: #fcfbf8;
  padding: 12px;
  min-width: 0;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.vg-option:hover {
  border-color: var(--pl-blue);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(47, 84, 150, .12);
}
.vg-option:disabled { cursor: default; }
.vg-option img {
  display: block;
  width: 100%;
  height: clamp(210px, 25vw, 340px);
  object-fit: contain;
  background: #fff;
  border: 1px solid #e9e4da;
  border-radius: 8px;
}
.vg-label {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 2;
  padding: 5px 9px 4px;
  border-radius: 999px;
  font-family: var(--ui-sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #fff;
  border: 1px solid var(--rule);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(27, 27, 26, .08);
}
.vg-label.hidden { opacity: 0; pointer-events: none; }
.vg-option.accept { border-color: #17a052; background: #f4fbf6; }
.vg-option.reject { border-color: #e1312a; background: #fff8f7; }
.vg-option.accept .vg-label { color: #128343; border-color: rgba(23, 160, 82, .45); }
.vg-option.reject .vg-label { color: #c22620; border-color: rgba(225, 49, 42, .45); }
.vg-option.answer { box-shadow: 0 0 0 3px rgba(47, 84, 150, .16); }
.vg-id {
  display: block;
  margin-top: 8px;
  font-family: var(--ui-sans);
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
}
.vg-feedback {
  min-height: 24px;
  margin-top: 12px;
  font-size: 15px;
  color: var(--ink-mute);
  text-align: center;
}
.vg-end {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 0 16px;
}
.vg-score {
  margin-top: 4px;
  font-size: clamp(56px, 7vw, 86px);
  line-height: .92;
  color: var(--pl-blue-deep);
}
.vg-score span { font-size: .42em; color: var(--ink-faint); }
.vg-end p { margin: 16px auto 0; color: var(--ink-mute); max-width: 560px; }
.vg-restart {
  margin-top: 18px;
  border: 1px solid var(--pl-blue);
  border-radius: 999px;
  background: var(--pl-blue);
  color: #fff;
  padding: 9px 16px;
  font-family: var(--ui-sans);
  font-size: 13px;
  cursor: pointer;
}
.visual-game-takeaway { color: var(--ink-mute); margin-top: 14px; }
@media (max-width: 760px) {
  .vg-head { align-items: flex-start; flex-direction: column; }
  .vg-options { grid-template-columns: 1fr; }
  .vg-option img { height: 260px; }
}

/* ───────────────────────── Rating-tail signal ───────────────────────── */
.rating-signal-grid {
  display: block;
  margin-top: 18px;
}
.rating-copy p { margin-top: 0; }
.rating-figure {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
  padding: 22px 24px 16px;
  margin: 20px 0 0;
}
.rating-figure.full-width { width: 100%; }
.rating-svg { width: 100%; min-height: 430px; display: block; }
.rating-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
  font-family: var(--ui-sans);
  font-size: 14px;
  color: var(--ink-mute);
}
.rating-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rating-legend i { width: 24px; height: 4px; border-radius: 2px; display: inline-block; }
@media (max-width: 900px) {
  .rating-svg { min-height: 320px; }
}

/* ───────────────────────── Calibration interactive ───────────────────────── */
.calib-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.calib-controls label {
  font-family: var(--ui-sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.calib-select {
  font-family: var(--display);
  font-size: 15px;
  padding: 7px 32px 7px 13px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%232F5496' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--ink);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.calib-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
.calib-card {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
  padding: 18px 20px;
}
.calib-card .cc-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 2px;
}
.calib-card .cc-sub {
  font-size: 12.5px;
  color: var(--ink-mute);
  margin: 0 0 12px;
}
.reliability-svg, .support-svg { width: 100%; height: auto; display: block; }
.calib-figure { margin: 0; }
.calib-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.calib-panel { display: flex; flex-direction: column; min-width: 0; }
.calib-panel > .calib-host { margin-top: auto; }
.calib-pair .calib-slider-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
}
@media (max-width: 720px) {
  .calib-panels { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .calib-card { padding: 16px 14px; }
  .bin-ticks { font-size: 12.5px; }
  .bin-ticks span { padding: 3px 2px; }
}
.density-svg { width: 100%; height: 100%; display: block; }

.calib-slider-row { margin-top: 14px; }
.bin-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--pl-row-hi), var(--pl-blue));
  outline: none;
}
.bin-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pl-blue);
  cursor: pointer;
  box-shadow: 0 2px 8px -2px rgba(47,84,150,0.6);
}
.bin-slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pl-blue);
  cursor: pointer;
}
.bin-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-mute);
}
.bin-ticks span { cursor: pointer; padding: 3px 5px; border-radius: 4px; transition: all .12s; }
.bin-ticks span.on { color: var(--pl-blue); font-weight: 600; background: var(--pl-takeaway-bg); }

.calib-right { display: grid; grid-template-rows: 1fr 1fr auto; gap: 14px; min-height: 0; }
.mini-chart { min-height: 0; display: flex; flex-direction: column; }
.mini-chart > div { flex: 1 1 auto; min-height: 0; }
.mini-chart svg { width: 100%; height: 100%; display: block; }

.calib-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.readout-item {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--paper-2);
}
.readout-item .ri-k {
  font-family: var(--ui-sans);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 3px;
}
.readout-item .ri-v {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  color: var(--pl-blue-deep);
  font-variant-numeric: tabular-nums;
}

/* paper sample cards */
.calib-papers { }
.calib-papers .cp-title {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-mute);
  margin: 4px 0 12px;
}
.paper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.paper-card {
  border: 1px solid var(--rule);
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.paper-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -18px rgba(0,0,0,0.5); }
.paper-thumb {
  aspect-ratio: 2380 / 1512;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: #fbfaf7;
}
.paper-thumb svg { width: 100%; height: 100%; display: block; }
.paper-thumb.real-panel img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.paper-badge {
  position: absolute;
  top: 7px; right: 7px;
  font-family: var(--ui-sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 7px;
  border-radius: 5px;
}
.paper-badge.ok { background: var(--pl-green-bg); color: var(--pl-green); }
.paper-badge.no { background: var(--pl-red-bg); color: var(--pl-red); }
.paper-meta { padding: 10px 11px 12px; flex: 1; display: flex; flex-direction: column; }
.paper-meta .pm-title {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.paper-meta .pm-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--ui-sans);
  font-size: 11px;
  color: var(--ink-mute);
}
.pm-p { font-weight: 600; color: var(--pl-blue-deep); }
.pm-kind { font-size: 10px; }

/* ───────────────────────── Applications: LitSearch ───────────────────────── */
.app-divider {
  text-align: center;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 8px 0 0;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 20px 0 24px;
}
.metric-pill {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--paper-2);
}
.metric-pill .mp-k {
  font-family: var(--ui-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.metric-pill .mp-flow {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.metric-pill .mp-from { font-size: 19px; color: var(--ink-faint); }
.metric-pill .mp-arrow { color: var(--pl-blue); }
.metric-pill .mp-to { font-size: 26px; font-weight: 600; color: var(--pl-blue-deep); }
.metric-pill .mp-delta {
  font-family: var(--ui-sans);
  font-size: 12px;
  color: var(--pl-green);
  margin-left: 4px;
}

.ex-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 30px 0 16px;
}
.ex-nav-label {
  font-family: var(--ui-sans);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  font-weight: 500;
}
.ex-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
#agent-tabs.ex-tabs { gap: 12px 18px; align-items: flex-start; }
.agent-demo .ex-nav { align-items: flex-end; }
.agent-demo .ex-nav-label { margin-bottom: 10px; }
.ex-group { display: flex; flex-direction: column; gap: 6px; }
.ex-group-label {
  font-family: var(--ui-sans);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  font-weight: 500;
}
.ex-group-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.ex-tab {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.2;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  padding: 6px 11px 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}
.ex-tab:hover { border-color: var(--pl-blue); color: var(--pl-blue); }
.ex-tab.on {
  background: var(--pl-takeaway-bg);
  color: var(--pl-blue-deep);
  border-color: var(--pl-row-hi);
  box-shadow: inset 0 0 0 1px var(--pl-row-hi);
}

.retrieval-demo,
.agent-demo {
  margin: 28px 0 0;
  padding: 18px 20px 20px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper-2);
}
.retrieval-demo .ex-nav,
.agent-demo .ex-nav { margin-top: 0; }
.retrieval-demo .note { margin: 0 0 14px; color: var(--pl-blue-deep); }
.agent-demo .table-note { margin-bottom: 0; }

.query-box {
  border-left: 3px solid var(--pl-blue);
  background: transparent;
  padding: 10px 0 10px 16px;
  border-radius: 0;
  margin-bottom: 16px;
}
.query-box .qb-k {
  font-family: var(--ui-sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pl-blue);
  margin-bottom: 5px;
}
.query-box .qb-q { font-size: 16.5px; color: var(--ink); font-style: italic; margin: 0; }

.rerank-cols {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: start;
}
.rerank-col-h {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rerank-col-h .rc-dot { width: 8px; height: 8px; border-radius: 50%; }
.rerank-col.base .rc-dot { background: var(--ink-faint); }
.rerank-col.pl .rc-dot { background: var(--pl-blue); }
.rank-list { display: flex; flex-direction: column; gap: 5px; }
.rank-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule-soft);
  border-radius: 0;
  background: transparent;
  font-size: 12.5px;
  transition: color .15s;
}
.rank-item .ri-rank { font-family: var(--ui-sans); font-size: 11px; color: var(--ink-faint); }
.rank-item .ri-ttl {
  line-height: 1.3;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rank-item .ri-pa {
  font-family: var(--ui-sans);
  font-size: 10.5px;
  color: var(--ink-mute);
  white-space: nowrap;
}
.rank-item.gold {
  background: transparent;
  border-bottom-color: #c7a33f;
  box-shadow: none;
}
.rank-item.gold .ri-ttl { color: #6b5208; font-weight: 600; }
.rank-item.gold .ri-rank { color: #ad8716; font-weight: 700; }
.gold-tag {
  display: inline-block;
  font-family: var(--ui-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #d4a017;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: 1px;
}
.rerank-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 40px;
  color: var(--pl-blue);
}
.rerank-mid svg { width: 26px; height: 26px; }
.rerank-mid span {
  font-family: var(--ui-sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-top: 6px;
  writing-mode: vertical-rl;
}

/* ───────────────────────── Applications: Agentic review ───────────────────────── */
.agent-topic {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 10px 0 10px 14px;
  border-left: 2px solid var(--pl-blue);
  background: transparent;
}
.agent-topic .at-cat {
  font-family: var(--ui-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pl-blue);
  background: transparent;
  padding: 1px 0 0;
  border-radius: 0;
  white-space: nowrap;
  flex: none;
}
.agent-topic .at-cat.rej { color: var(--ink-mute); background: transparent; }
.agent-topic .at-copy { min-width: 0; }
.agent-topic .at-topic { font-size: 14.5px; color: var(--ink-soft); margin: 0; line-height: 1.5; }
.agent-topic .at-agree { margin: 7px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.agent-topic .at-agree strong { color: var(--pl-blue-deep); font-weight: 600; }
.agent-topic .at-topic b { color: var(--ink); }

.gen-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  flex-wrap: wrap;
}
.gen-btn {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--pl-blue);
  background: transparent;
  border: 1px solid var(--pl-blue);
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color .15s, border-color .15s, background .15s;
}
.gen-btn:hover { background: var(--pl-takeaway-bg); color: var(--pl-blue-deep); border-color: var(--pl-blue-deep); }
.gen-btn:disabled { opacity: 0.5; cursor: default; }
.gen-status {
  font-family: var(--ui-sans);
  font-size: 12px;
  color: var(--ink-mute);
}
.gen-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.gen-legend span { font-size: 12px; color: var(--ink-mute); display: inline-flex; align-items: center; gap: 6px; }
.gen-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.gen-legend i.g { background: var(--pl-green-bg); border: 1px solid var(--pl-green); }
.gen-legend i.r { background: var(--pl-red-bg); border: 1px solid var(--pl-red); }

.review-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;
}
.review-panel {
  border: 1px solid var(--rule);
  border-top: 1.5px solid var(--ink);
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.review-panel .rp-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 0;
  background: transparent;
}
.review-panel.human .rp-head,
.review-panel.aigen .rp-head,
.review-panel.aicond .rp-head { background: transparent; }
.rp-head .rp-icon { display: none; }
.rp-head .rp-name { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--ink); }
.rp-head .rp-sub { font-size: 11px; color: var(--ink-mute); font-family: var(--ui-sans); }
.review-panel .rp-body { padding: 12px 12px 14px; flex: 1; }
.rp-decision {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dec-chip {
  font-family: var(--ui-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid currentColor;
  text-transform: uppercase;
  background: transparent;
}
.dec-chip.accept { color: var(--pl-green); }
.dec-chip.reject { color: var(--pl-red); }
.dec-meta { font-family: var(--ui-sans); font-size: 11px; color: var(--ink-mute); }
.rp-prior {
  font-family: var(--ui-sans);
  font-size: 11px;
  color: var(--pl-blue-deep);
  background: transparent;
  padding: 5px 0 5px 9px;
  border-left: 2px solid var(--pl-row-hi);
  border-radius: 0;
  margin-bottom: 12px;
}
.rp-strength-h,
.rp-weak-h {
  font-family: var(--ui-sans);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 7px;
}
.rp-strength,
.rp-weak {
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--ink-soft);
  margin: 0;
}
.rp-strength .hl-green,
.rp-weak .hl-green { background: var(--pl-green-bg); color: var(--pl-green-deep, #044804); border-radius: 3px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.rp-strength .hl-red,
.rp-weak .hl-red { background: var(--pl-red-bg); color: #7a0000; border-radius: 3px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.rp-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--pl-blue);
  vertical-align: -2px;
  margin-left: 1px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ───────────────────────── Citation ───────────────────────── */
.citation-band .terminal { margin-top: 16px; }
.lit-legend {
  display: flex;
  gap: 8px 22px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--ui-sans);
  font-size: 14px;
  color: var(--ink-mute);
  margin: 0 0 8px;
}
.lit-legend span { display: inline-flex; align-items: center; gap: 8px; }
.lit-legend i { display: inline-block; width: 26px; height: 3px; border-radius: 2px; }
.lit-legend i.lg-base { background: #9A9A9A; }
.lit-legend i.lg-ps { background: var(--pl-blue); }
.lit-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.lit-svg { display: block; width: 100%; height: auto; }
@media (max-width: 640px) {
  .lit-panels { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .litsearch-figure { padding: 16px 12px 12px !important; }
}
.bibtex code { color: #cdd6e6; }
.bibtex .bt-k { color: #8fb4ff; }
.bibtex .bt-v { color: #c5e1a5; }
.copy-btn {
  font-family: var(--display);
  font-size: 13px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  padding: 6px 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .14s;
}
.copy-btn:hover { border-color: var(--pl-blue); color: var(--pl-blue); }

.site-foot {
  border-top: 1px solid var(--rule);
  margin-top: 40px;
  padding: 30px 0 60px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-faint);
}

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .toc {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 22px 28px;
  }
  .toc nav { flex-flow: row wrap; gap: 4px 14px; }
  .toc nav a { border-left: none; padding: 4px 0; }
  .toc nav a.active { border-left: none; }
  .toc-label, .toc-foot { display: none; }
  main { padding: 0 30px; }
  .calib-stage { grid-template-columns: 1fr; }
  .calib-right { grid-template-rows: none; }
  .mini-chart { height: 240px; }
}
@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .hero h1 { font-size: 34px; }
  h2.sec { font-size: 27px; }
  .rerank-cols { grid-template-columns: 1fr; }
  .rerank-mid { flex-direction: row; padding: 8px 0; }
  .rerank-mid span { writing-mode: horizontal-tb; margin: 0 0 0 6px; }
  .review-cols { grid-template-columns: 1fr; }
}

/* ───────── Common type for small UI text ─────────
   Labels, tags, readouts and numbers use the page serif in normal case
   (previously Helvetica in tiny tracked uppercase). */
:root { --ui-sans: var(--serif); }
.ex-nav-label, .ex-group-label, .agent-topic .at-cat, .rp-strength-h, .rp-weak-h,
.query-box .qb-k, .rerank-mid span, .calib-controls label, .vg-kicker, .vg-label,
.gold-tag, .dec-chip, .paper-badge, .readout-item .ri-k, .metric-pill .mp-k,
.visual-game .vg-memory { text-transform: none; letter-spacing: normal; }
/* headings */
.ex-group-label, .rp-strength-h, .rp-weak-h { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.rp-weak-h { margin-top: 14px; }
/* plain labels */
.ex-nav-label, .query-box .qb-k, .calib-controls label, .vg-kicker, .rerank-mid span,
.rp-head .rp-sub { font-size: 14px; font-weight: 400; color: var(--ink-mute); }
.vg-restart { font-size: 14px; }
/* tags and readouts */
.agent-topic .at-cat, .dec-chip, .vg-label, .paper-badge, .gold-tag,
.gen-status, .dec-meta, .rp-prior, .visual-game .vg-memory { font-size: 13px; }
/* numbers */
.toc nav a .toc-n, .rank-item .ri-rank, .rank-item .ri-pa, .paper-meta .pm-foot,
.pm-p, .pm-kind, .vg-timer, .vg-id { font-variant-numeric: tabular-nums; }
.rank-item .ri-rank, .rank-item .ri-pa, .paper-meta .pm-foot, .pm-kind, .vg-id { font-size: 13px; }
.toc nav a .toc-n { font-size: 12.5px; }
/* KaTeX's hidden MathML is position:absolute; anchor it to its formula so formulas inside scrolling
   tables do not widen the page on phones */
.katex { position: relative; }
