:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #16181d;
  --ink-2: #464a55;
  --muted: #868a95;
  --line: #e8e5dd;
  --line-2: #f0eee8;

  --accent: #0f766e;
  --accent-ink: #0b5953;
  --accent-soft: #e2f1ee;
  --mark: #ffe9a8;
  --mark-ink: #4a3500;

  --good: #15803d;
  --good-soft: #dcf3e3;
  --bad: #b42318;

  --m-tfidf: #7259d1;
  --m-bm25: #2f6bd8;
  --m-wand: #0f8b7e;
  --m-wand2: #5bb3a7;
  --m-adaptive: #e0662c;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(22, 24, 29, .05);
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 6px 24px -8px rgba(22, 24, 29, .10);
  --shadow-lg: 0 24px 64px -16px rgba(22, 24, 29, .22);

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); }
mark {
  background: var(--mark);
  color: var(--mark-ink);
  border-radius: 3px;
  padding: 0 2px;
  box-decoration-break: clone;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 32px;
  background: rgba(246, 245, 241, .82);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font: 30px/1 var(--serif); letter-spacing: -.01em;
}
.brand svg { width: 28px; height: 28px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #eceae3; border-radius: 12px; }
.tabs a {
  padding: 7px 16px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.corpus-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-2);
}
.corpus-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

main { max-width: 1240px; margin: 0 auto; padding: 8px 32px 96px; }
.view { display: none; }
.view.active { display: block; animation: view-in .35s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { margin: 36px 0 28px; }
.page-head h1 { font: 44px/1.05 var(--serif); letter-spacing: -.015em; margin: 0 0 10px; }
.page-head h1 em { color: var(--accent); }
.page-head p { margin: 0; color: var(--ink-2); max-width: 720px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }

/* ---------- Search box ---------- */
.searchbox {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s;
}
.searchbox:focus-within { border-color: #bfdcd6; box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.searchbox svg { flex: none; color: var(--muted); }
.searchbox input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 17px; padding: 10px 0;
}
.searchbox input::placeholder { color: #a7aab3; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 22px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
  transition: transform .12s, background .15s, opacity .15s;
}
.btn:hover { background: #2a2d35; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
kbd {
  font: 500 11px var(--mono); color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
  background: var(--surface-2);
}

/* ---------- Search: hero ---------- */
.search-shell { transition: padding .5s cubic-bezier(.2,.8,.2,1); padding-top: 14vh; }
.search-shell.compact { padding-top: 18px; }
.hero { text-align: center; overflow: hidden; max-height: 320px; opacity: 1;
  transition: max-height .5s cubic-bezier(.2,.8,.2,1), opacity .3s, margin .5s; margin-bottom: 30px; }
.search-shell.compact .hero { max-height: 0; opacity: 0; margin-bottom: 0; }
.hero h1 { font: 76px/1 var(--serif); letter-spacing: -.02em; margin: 0 0 14px; }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero p { margin: 0 auto; max-width: 560px; color: var(--ink-2); font-size: 16px; }
.hero-stats { display: flex; justify-content: center; gap: 28px; margin-top: 22px; font-size: 13px; color: var(--muted); }
.hero-stats b { color: var(--ink); font-weight: 600; }
.search-form { max-width: 760px; margin: 0 auto; transition: max-width .5s cubic-bezier(.2,.8,.2,1); }
.search-shell.compact .search-form { max-width: 100%; }

.suggestions { max-width: 760px; margin: 22px auto 0; text-align: center; transition: opacity .3s; }
.search-shell.compact .suggestions { display: none; }
.suggestions .label { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--ink-2);
  transition: border-color .15s, color .15s, transform .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.chip b { color: var(--accent); font-weight: 600; margin-right: 4px; }

/* ---------- Controls ---------- */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 18px 0 6px; }
.segmented { display: inline-flex; padding: 3px; background: #eceae3; border-radius: 11px; gap: 2px; }
.segmented button {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; padding: 6px 13px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: background .15s, color .15s, box-shadow .15s;
}
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.swatch { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.select {
  appearance: none; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868a95' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border-radius: 10px; padding: 7px 34px 7px 12px; font-size: 13px; font-weight: 500;
}
.controls .spacer { flex: 1; }
.control-label { font-size: 12px; color: var(--muted); margin-right: -6px; }

/* ---------- Query analysis ---------- */
.analysis { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 10px; margin: 16px 0 4px; }
.analysis .tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; align-self: center; }
.tok { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; animation: pop .35s ease both; }
.tok .w { font-size: 12px; color: var(--muted); }
.tok .s { font: 500 13px var(--mono); color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; margin-top: 3px; }
.tok.drop .w { text-decoration: line-through; opacity: .7; }
.tok.drop .s { background: transparent; color: #c2c4ca; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Result meta ---------- */
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; color: var(--ink-2); margin: 18px 0 14px; }
.meta-line .pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.meta-line .pill.bench { background: var(--good-soft); border-color: #bfe5cb; color: #14532d; }
.meta-line b { color: var(--ink); font-weight: 600; }
.prune { display: inline-flex; align-items: center; gap: 8px; }
.prune-bar { width: 90px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.prune-bar i { display: block; height: 100%; background: var(--m-wand); border-radius: 99px; }

/* ---------- Results ---------- */
.results { display: flex; flex-direction: column; gap: 12px; }
.result {
  display: grid; grid-template-columns: 44px 1fr 120px; gap: 4px 18px;
  padding: 18px 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  animation: rise .45s cubic-bezier(.2,.8,.2,1) both;
}
.result:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #ddd9cf; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rank { font: 30px/1 var(--serif); color: #c4c1b8; padding-top: 2px; }
.result h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; }
.result h3::first-letter { text-transform: uppercase; }
.result .sub { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.result .snip { grid-column: 2; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.scorebox { grid-row: 1 / span 2; grid-column: 3; text-align: right; }
.scorebox .v { font: 600 15px var(--mono); }
.scorebox .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.scorebar { height: 5px; border-radius: 99px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.scorebar i { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: grow .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.badge.rel { background: var(--good-soft); color: var(--good); }
.badge.non { background: #f1efea; color: var(--muted); }

.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, #efede7 0%, #f7f6f2 50%, #efede7 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(22, 24, 29, .28); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 94vw); z-index: 41;
  background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(104%); transition: transform .4s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer header { padding: 26px 30px 18px; border-bottom: 1px solid var(--line); }
.drawer .close { float: right; border: 0; background: #f1efea; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--ink-2); }
.drawer h2 { font: 30px/1.15 var(--serif); margin: 6px 0 12px; letter-spacing: -.01em; }
.drawer h2::first-letter { text-transform: uppercase; }
.drawer .facts { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.drawer .body { padding: 22px 30px 40px; overflow: auto; white-space: pre-wrap; font-size: 15px; line-height: 1.75; color: var(--ink-2); }

/* ---------- Cards / sections ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-head h2 { font: 28px/1.1 var(--serif); margin: 0; letter-spacing: -.01em; }
.section-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }

/* ---------- Compare ---------- */
.compare-bar { display: flex; gap: 14px; align-items: center; }
.compare-bar .searchbox { flex: 1; }
.scoreboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 6px; }
.sb { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.sb .top { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sb .big { font: 34px/1 var(--serif); margin-top: 8px; }
.sb .big small { font: 500 13px var(--sans); color: var(--muted); margin-left: 4px; }
.sb .dots { display: flex; gap: 3px; margin-top: 10px; }
.sb .dots i { width: 100%; height: 6px; border-radius: 2px; background: var(--line-2); transition: background .3s; }

.bump { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 56px; margin-top: 18px; }
.bump svg.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.bump svg.links path { fill: none; stroke-width: 2; opacity: .28; transition: opacity .2s, stroke-width .2s; }
.bump svg.links path.rel { opacity: .45; }
.bump.hovering svg.links path { opacity: .06; }
.bump.hovering svg.links path.on { opacity: .95; stroke-width: 3; }
.col-head { padding: 0 2px 12px; border-bottom: 2px solid; margin-bottom: 10px; }
.col-head .name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.col-head .desc { font-size: 12px; color: var(--muted); margin-top: 3px; min-height: 18px; }
.col-head .time { font: 500 12px var(--mono); color: var(--ink-2); margin-left: auto; }
.row {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center;
  height: 62px; padding: 0 10px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: opacity .2s, border-color .2s, box-shadow .2s, transform .2s;
  animation: rise .4s cubic-bezier(.2,.8,.2,1) both;
}
.row .r { font: 20px/1 var(--serif); color: #b9b6ad; text-align: center; }
.row .t { font-size: 12.5px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .t::first-letter { text-transform: uppercase; }
.row .d { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 2px; }
.row.rel { border-left: 3px solid var(--good); }
.row .delta { font: 600 10.5px var(--mono); padding: 1px 5px; border-radius: 4px; }
.delta.up { color: var(--good); background: var(--good-soft); }
.delta.down { color: var(--bad); background: #fde8e6; }
.delta.new { color: #8a4b00; background: #fff0d6; }
.bump.hovering .row { opacity: .35; }
.bump.hovering .row.on { opacity: 1; border-color: var(--ink); box-shadow: var(--shadow); transform: scale(1.02); }

/* ---------- Index lab ---------- */
.codec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.codec { position: relative; overflow: hidden; }
.codec .name { font-weight: 600; }
.codec .how { font-size: 13px; color: var(--muted); min-height: 40px; margin-top: 2px; }
.codec .size { font: 44px/1 var(--serif); margin-top: 16px; }
.codec .size small { font: 500 14px var(--sans); color: var(--muted); }
.codec .ratio { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.meter { height: 10px; border-radius: 99px; background: var(--line-2); margin-top: 16px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: grow .9s cubic-bezier(.2,.8,.2,1) both; }

.inspector-form { display: flex; gap: 12px; align-items: center; max-width: 520px; }
.inspector-form .searchbox { flex: 1; }
.term-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.fact { padding: 10px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.fact .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.fact .v { font: 600 18px var(--mono); margin-top: 2px; }
.ptable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ptable th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptable td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: 0; }
.bits { font: 500 12.5px var(--mono); letter-spacing: .04em; white-space: nowrap; }
.bits .cont { color: var(--m-bm25); font-weight: 700; }
.bits .unary { color: var(--m-adaptive); }
.bits .sep { color: var(--ink); font-weight: 700; }
.bits .rem { color: var(--m-wand); }
.bits .zero { color: #c9c6be; }
.bits-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.bits-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bytes-row { display: grid; grid-template-columns: 130px 1fr 80px; align-items: center; gap: 12px; font-size: 13px; margin-top: 10px; }
.bytes-row .bar { height: 12px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bytes-row .bar i { display: block; height: 100%; border-radius: 99px; transition: width .7s cubic-bezier(.2,.8,.2,1); }

.matrix { display: grid; grid-template-columns: 190px repeat(3, 1fr); gap: 10px; }
.matrix .colh { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 0 4px 4px; }
.matrix .rowh { display: flex; flex-direction: column; justify-content: center; font-weight: 600; font-size: 14px; }
.matrix .rowh span { font-size: 12px; font-weight: 400; color: var(--muted); }
.cell { position: relative; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.cell.default { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cell .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.cell .stats b { display: block; font: 600 15px var(--mono); color: var(--ink); }
.cell .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 11px; color: var(--muted); }
.cell .rebuild { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 500; }
.cell .rebuild:hover { border-color: var(--accent); color: var(--accent-ink); }
.cell .progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); }
.cell.building .progress { animation: building 2.6s cubic-bezier(.3,.6,.4,1) forwards; }
.cell.building { border-color: var(--accent); }
.cell.flash { animation: flash 1.2s ease; }
@keyframes building { from { width: 0; } to { width: 92%; } }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: var(--surface); } }

/* ---------- Evaluation ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi .k { font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font: 46px/1 var(--serif); margin-top: 12px; }
.kpi .d { font-size: 13px; margin-top: 8px; color: var(--muted); }
.kpi .d b { color: var(--good); font-weight: 600; }
.chart-card { padding: 24px 24px 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow-y .8s cubic-bezier(.2,.8,.2,1) both; }
.chart .hbar { transform-box: fill-box; animation: grow .8s cubic-bezier(.2,.8,.2,1) both; }
.chart .hbar.neg { transform-origin: right; }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.qbar { cursor: pointer; }
.qbar:hover rect.hit { fill: rgba(22, 24, 29, .04); }
.leader { width: 100%; border-collapse: collapse; font-size: 14px; }
.leader th { text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.leader th:first-child, .leader td:first-child { text-align: left; }
.leader td { text-align: right; padding: 13px 12px; border-bottom: 1px solid var(--line-2); font-family: var(--mono); font-size: 13px; }
.leader td:first-child { font-family: var(--sans); font-size: 14px; font-weight: 500; }
.leader td .cellbar { height: 4px; border-radius: 99px; background: var(--line-2); margin-top: 6px; margin-left: auto; width: 100px; overflow: hidden; }
.leader td .cellbar i { display: block; height: 100%; border-radius: 99px; }
.leader tr.best td:first-child::after { content: "best"; margin-left: 8px; font: 600 10px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; }
.tooltip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 360px;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip b { font-weight: 600; }
.tooltip .muted { color: #a9acb5; }

.loading-note { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 30px 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--bad); padding: 14px 0; font-size: 14px; }

@media (max-width: 960px) {
  main { padding: 8px 16px 64px; }
  .topbar { padding: 12px 16px; gap: 14px; flex-wrap: wrap; }
  .corpus-pill { display: none; }
  .hero h1 { font-size: 52px; }
  .scoreboard, .kpis, .codec-grid { grid-template-columns: 1fr 1fr; }
  .bump { grid-template-columns: repeat(4, 260px); overflow-x: auto; gap: 40px; }
  .matrix { grid-template-columns: 1fr; }
  .result { grid-template-columns: 34px 1fr; }
  .scorebox { grid-row: auto; grid-column: 2; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
