/* HUST BCIML — web app styles. Clean, responsive, light + dark. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #4338ca;
  --accent-soft: #eef2ff;
  --pos: #059669;
  --neg: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.04);
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111a2e;
    --surface-2: #0f1729;
    --text: #e5ecf6;
    --muted: #93a4bd;
    --border: #24314b;
    --accent: #a5b4fc;
    --accent-soft: #1e1b4b;
    --pos: #34d399;
    --neg: #f87171;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; letter-spacing: -.01em; color: var(--text); font-size: 16px; }
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-logo {
  height: 24px; width: auto; border-radius: 5px;
  vertical-align: middle; margin-right: 8px;
  border: 1px solid var(--border);
}
.tabs { display: flex; gap: 4px; margin-left: 6px; }
.tab {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  cursor: pointer; transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--accent); background: var(--accent-soft); }
/* language toggle: styled like a tab but set apart as a control */
.tab.lang-toggle { margin-left: 8px; border: 1px solid var(--border); padding: 6px 12px; font-weight: 700; letter-spacing: .02em; }
.tab.lang-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.header-links { margin-left: auto; display: flex; gap: 14px; font-size: 13.5px; }
.header-links a { color: var(--muted); font-weight: 500; }

/* ---------- layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 64px; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.section-title { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 34px 0 14px; }

/* ---------- overview: hero ---------- */
.hero { padding: 8px 0 6px; }
.hero h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; }
.hero .tagline { font-size: 17px; color: var(--muted); margin: 0 0 10px; max-width: 70ch; }
.hero .who { font-size: 14.5px; margin-bottom: 14px; }
.hero .who a { font-weight: 600; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; box-shadow: var(--shadow); min-width: 96px;
}
.stat .n { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.btn {
  display: inline-block; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px;
  background: var(--accent); color: #fff; border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--border); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.flag { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.flag .pillar { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.flag h4 { margin: 3px 0 5px; font-size: 15.5px; }
.flag .blurb { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.flag .badge { font-size: 12px; color: var(--muted); }

/* pillar table with mini bars */
.pillars { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pillars td, .pillars th { padding: 9px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
.pillars th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.pillars tr:last-child td { border-bottom: 0; }
.pillars .num { text-align: right; font-variant-numeric: tabular-nums; width: 88px; }
/* datasets overview table (benchmark tab): reuses the pillar surface, but the
   numeric columns size to content and the primary column carries a role blurb */
.datasets td.num, .datasets th.num { width: auto; white-space: nowrap; padding-left: 20px; }
.datasets td:first-child { max-width: 30ch; }
.datasets .ds-name { font-weight: 700; }
.datasets .ds-role { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-weight: 400; white-space: normal; }
.bar { height: 7px; border-radius: 5px; background: var(--accent-soft); position: relative; min-width: 40px; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 5px; }

/* ---------- papers ---------- */
.controls { position: sticky; top: 54px; z-index: 10; background: var(--bg); padding: 8px 0 12px; }
.searchrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1 1 320px; min-width: 200px; padding: 11px 14px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
.search:focus { outline: 2px solid var(--accent); border-color: transparent; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); cursor: pointer; user-select: none; }
.count { font-size: 13.5px; color: var(--muted); margin-left: auto; }
.clearbtn { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.clearbtn:hover { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  /* rendered as <button> for keyboard access; strip the UA button chrome */
  font: inherit; text-align: left; -webkit-appearance: none; appearance: none;
  font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: .12s;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .c { opacity: .65; font-weight: 500; margin-left: 4px; }
.chip-legend { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 2px; }

.papers-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.paper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px; box-shadow: var(--shadow); }
.paper-head { display: flex; gap: 10px; align-items: baseline; }
.paper .year { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; font-size: 13px; flex: 0 0 auto; }
.paper-title { font-size: 15.5px; margin: 0; font-weight: 650; }
.paper-meta { color: var(--muted); font-size: 13px; margin: 3px 0 8px; }
.paper-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.topic-badge { border: 0; font-family: inherit; -webkit-appearance: none; appearance: none; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.tag { border: 0; font-family: inherit; -webkit-appearance: none; appearance: none; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; cursor: pointer; }
.paper-links { display: inline-flex; gap: 12px; margin-left: auto; font-size: 13px; font-weight: 600; }
.paper-links .nocode { color: var(--muted); font-weight: 500; }
.tldr { color: var(--text); opacity: .9; font-size: 13.5px; margin: 9px 0 0; }
.tldr.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.more { background: transparent; border: 0; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

/* ---------- benchmark ---------- */
.bench-intro { color: var(--muted); max-width: 78ch; }
.bench-note { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin: 12px 0 6px; }
.bench-table { margin: 22px 0; }
.bench-table h3 { margin: 0 0 3px; font-size: 17px; }
.bench-table .blurb { color: var(--muted); font-size: 13px; margin: 0 0 10px; max-width: 82ch; }
table.lb { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.lb th, table.lb td { padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.lb th { text-align: right; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.lb th:first-child, table.lb td:first-child { text-align: left; }
table.lb td { text-align: right; font-variant-numeric: tabular-nums; }
table.lb tr:last-child td { border-bottom: 0; }
.delta.pos { color: var(--pos); font-weight: 600; }
.delta.neg { color: var(--neg); font-weight: 600; }
.delta.zero, .delta.base { color: var(--muted); }
.refrow { color: var(--muted); font-size: 12.5px; margin-top: 6px; font-style: italic; }

.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.method { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.method-top { display: flex; justify-content: space-between; align-items: baseline; }
.method .mkey { font-weight: 700; font-size: 15px; }
.method .macc { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; }
.method .mrange { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.method .msource { font-size: 12.5px; margin-bottom: 6px; }
.method .mnote { font-size: 12.5px; color: var(--muted); }

/* ---------- overview: repo intro + official links ---------- */
.hero .repo-intro { font-size: 14.5px; color: var(--text); opacity: .92; margin: 4px 0 12px; max-width: 78ch; }
.official {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin: 8px 0 4px; padding: 10px 15px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.official-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.official-row { display: inline-flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13.5px; font-weight: 600; }
.area-note { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; max-width: 82ch; }

/* ---------- papers: gallery note ---------- */
.gallery-note { color: var(--muted); font-size: 13.5px; margin: 2px 0 12px; max-width: 88ch; }
.gallery-note strong { color: var(--text); }
.paper-links .codelink { color: var(--accent); }

/* ---------- benchmark: the library ---------- */
.lib-intro { border-left: 3px solid var(--accent); }
.lib-intro h3 { margin: 0 0 8px; font-size: 18px; }
.lib-intro .lib-name { font-size: 16px; background: var(--surface-2); padding: 1px 7px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lib-intro .blurb { color: var(--muted); margin: 0 0 12px; max-width: 86ch; }
.lib-intro .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.stages { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 6px 0 2px; }
.stage { font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.stage-arrow { color: var(--muted); font-weight: 700; }
.stage-driver { color: var(--muted); font-size: 12.5px; font-style: italic; margin-left: 4px; }
.run {
  background: #0b1120; color: #e5ecf6; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; margin: 14px 0 0; overflow-x: auto; font-size: 13px;
}
.run code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }

/* ---------- footer ---------- */
.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 22px 20px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.site-footer a { font-weight: 500; }

/* ---------- lab-method highlighting ---------- */
.lab-badge {
  display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent); color: #fff; vertical-align: middle;
}
table.lb tr.lab { background: color-mix(in srgb, var(--accent-soft) 75%, transparent); }
.methods-group { font-size: 14px; margin: 22px 0 8px; letter-spacing: -.01em; }
.method.lab { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.method.lab .lab-badge { font-size: 9.5px; }

/* ---------- overview: the lab's benchmark methods ---------- */
/* the five pipeline-stage categories sit in a single row on desktop */
.lab-methods { display: flex; flex-direction: column; gap: 10px; }
.lab-cat { display: flex; gap: 14px; align-items: baseline; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.lab-cat-label { flex: 0 0 150px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.lab-chips { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 7px; }
/* a <button>, not a link: it opens the approach menu rather than going somewhere,
   so it needs the font and cursor an anchor would have given it for free. */
.lab-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--border); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.lab-chip:hover { text-decoration: none; filter: brightness(1.03); }
.lab-chip[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.lab-chip .lm-name { font-weight: 700; font-size: 13px; color: var(--text); }
.lab-chip .lm-acc { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* lab-proposed approaches are highlighted (accent-soft fill + accent border,
   mirroring the leaderboard's lab rows); external baselines are muted so the
   lab's own methods lead the eye. */
.lab-chip.is-lab { background: var(--accent-soft); border-color: var(--accent); }
.lab-chip.is-lab .lm-name { color: var(--text); font-weight: 700; }
.lab-chip.is-ext { background: var(--surface-2); border-color: var(--border); }
.lab-chip.is-ext .lm-name { color: var(--muted); font-weight: 600; }
.approach-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 2px 0 14px; font-size: 12px; color: var(--muted); }
.approach-legend .lgd { display: inline-flex; align-items: center; gap: 7px; }
.approach-legend .lgd::before { content: ""; width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); }
.approach-legend .lgd-lab::before { background: var(--accent-soft); border-color: var(--accent); }
/* the menu one approach chip opens: code / paper / benchmark result. It is placed on
   <body> in page coordinates by app.js, so it is never clipped by the chip card. */
.approach-menu { position: absolute; z-index: 40; min-width: 236px; max-width: min(380px, calc(100vw - 16px)); padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15,23,42,.18); }
.am-head { display: flex; align-items: center; gap: 7px; padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.am-name { font-weight: 700; font-size: 13.5px; }
.am-item { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.am-item:hover, .am-item:focus-visible { background: var(--accent-soft); text-decoration: none; }
.am-label { display: block; font-size: 13px; font-weight: 650; }
.am-note { display: block; font-size: 11.5px; color: var(--muted); word-break: break-word; }
/* an option the data cannot fill, e.g. an approach with no DOI on record: shown with
   the reason rather than hidden, so every menu offers the same three choices. */
.am-item.is-off { opacity: .55; cursor: default; }
.am-item.is-off:hover { background: none; }
/* the row an approach chip asked for, cued just long enough to find it. The tint is
   a background-image over the cell, so the only two permanent row aesthetics, i.e.
   lab-proposed and not, are left exactly as they are. */
.lb-row.located > td { animation: located-fade 2.6s ease-out 1; }
@keyframes located-fade {
  0%, 45% { background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); }
  100% { background-image: linear-gradient(transparent, transparent); }
}
.lb-row:focus { outline: none; }

@media (max-width: 620px) {
  .header-links { display: none; }
  .hero h1 { font-size: 24px; }
  .controls { top: 50px; }
  .paper-links { margin-left: 0; }
}

/* ---------- benchmark: in-table sub-categories, per-row links, inline description + citation ---------- */
/* a sub-category section header rendered INSIDE the single leaderboard table
   (the Transfer families sit in one table, not separate tables) */
table.lb tr.subcat-tr td {
  background: var(--surface-2); border-top: 2px solid var(--border);
  padding-top: 11px; padding-bottom: 8px;
}
table.lb tr.subcat-tr .subcat-name {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent);
}
table.lb tr.subcat-tr .subcat-blurb {
  display: block; margin-top: 3px; max-width: 90ch;
  font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--muted);
}
/* a group's baseline/reference line, spanning the full table width */
table.lb tr.ref-tr td { color: var(--muted); font-size: 12px; font-style: italic; }

.lb .m-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.lb .m-name { font-weight: 600; }
.lb tr.lab .m-name { font-weight: 700; }
.lb td.acc { white-space: nowrap; }
.lb tr.reference td { color: var(--muted); }

/* the links that open a method's implementation file / its paper */
.codelink.code-impl, .codelink.paper-impl {
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--border); border-radius: 6px; padding: 0 7px; line-height: 1.7;
}
.codelink.code-impl:hover, .codelink.paper-impl:hover { text-decoration: none; background: var(--accent-soft); }
.codelink.paper-impl { color: var(--muted); }

/* inline, reader-facing description + IEEE citation under each method name */
.lb .m-desc { font-size: 12.5px; color: var(--text); opacity: .84; margin-top: 3px; max-width: 76ch; text-align: left; }
.lb .m-ref { font-size: 11.5px; color: var(--muted); margin-top: 2px; text-align: left; font-style: italic; }

/* ---------- benchmark: three-dataset (per-column) leaderboard ---------- */
/* every comparison spans the three datasets as one column each; a cell shows the
   acc ± std with the coloured Δ-vs-that-dataset's-baseline beneath it */
.bench-table { overflow-x: auto; }
table.lb.multi { min-width: 640px; }
table.lb.multi th.ds-col { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.lb.multi td:first-child { min-width: 20ch; }
table.lb td.acc-cell { vertical-align: top; white-space: nowrap; }
.acc-cell .cell-acc { font-variant-numeric: tabular-nums; font-weight: 600; }
.acc-cell .cell-delta { font-size: 11.5px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.acc-cell .cell-delta.pos { color: var(--pos); }
.acc-cell .cell-delta.neg { color: var(--neg); }
.acc-cell .cell-delta.zero, .acc-cell .cell-delta.base { color: var(--muted); }
.acc-cell.na { color: var(--muted); }
.acc-cell .na-dash { font-size: 12.5px; color: var(--muted); }

/* ---------- ensemble tab: per-dataset context cards ---------- */
.ens-context { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.ens-ctx-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 15px; box-shadow: var(--shadow); }
.ens-ctx-ds { font-weight: 700; font-size: 14.5px; }
.ens-ctx-meta { font-size: 12px; color: var(--muted); margin: 2px 0 9px; }
.ens-ctx-nums { display: flex; flex-direction: column; gap: 5px; }
.ens-ctx-num { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12.5px; }
.ens-ctx-num .l { color: var(--muted); }
.ens-ctx-num .v { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- overview: PI portrait on the hero ---------- */
.hero { position: relative; }
.hero h1, .hero .tagline, .hero .who, .hero .repo-intro { max-width: calc(100% - 172px); }
.pi-photo { position: absolute; top: 6px; right: 0; width: 138px; margin: 0; text-align: center; }
.pi-photo img { width: 138px; height: 138px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow); display: block; }
.pi-photo figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; }
@media (max-width: 760px) {
  .hero h1, .hero .tagline, .hero .who, .hero .repo-intro { max-width: 100%; }
  .pi-photo { position: static; margin: 0 0 14px; width: 120px; }
  .pi-photo img { width: 120px; height: 120px; }
}

/* ---------- footer: maintainer + disclaimer ---------- */
.site-footer .foot-line { margin-bottom: 6px; }
.site-footer .foot-line strong { color: var(--text); }
.site-footer .foot-disclaimer { margin-top: 12px; font-size: 12px; opacity: .82; max-width: 108ch; line-height: 1.5; }

/* ---------- benchmark: collapsible "how to read" guide ---------- */
.bench-guide { margin: 2px 0 16px; }
.bench-guide summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; width: fit-content; }
.bench-guide summary:hover { text-decoration: underline; }
.bench-guide p { color: var(--muted); font-size: 13px; max-width: 92ch; margin: 9px 0 0; }

/* each stage row stacks its label above the chips on narrow screens */
@media (max-width: 680px) { .lab-cat { flex-direction: column; gap: 8px; } .lab-cat-label { flex-basis: auto; } }


/* ---------- review pass 2026-07: overflow, focus, row caveats ---------- */

/* Any wide block (the 7-column dataset table, the leaderboard tables) scrolls
   inside its own container. Without this the page itself scrolls sideways on a
   phone, or the columns are simply clipped. */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Header: brand + three tabs + language toggle does not fit one line on a narrow
   phone, especially in Chinese where the tab labels are wider. Let it wrap, and
   let the tab strip scroll rather than push the page wider than the viewport. */
@media (max-width: 620px) {
  .site-header { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
  .tabs { margin-left: 0; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 6px 10px; white-space: nowrap; }
}

/* A visible focus ring on every interactive control. The filter chips and card
   badges are keyboard-operable now, which is only useful if you can see where
   the focus is. */
.chip:focus-visible, .tag:focus-visible, .topic-badge:focus-visible,
.tab:focus-visible, .clearbtn:focus-visible, .more:focus-visible,
a:focus-visible, .search:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
/* The view containers take focus on tab switch (see go() in app.js); that is a
   programmatic move, so it should not paint a ring. */
.view:focus { outline: none; }

/* Per-row qualifier: this row changes more than its table's axis, or its empty
   dataset cells have a stated reason. Deliberately quieter than the description
   but not hidden — it is the sentence that keeps a Δ from being over-read. */
.lb .m-caveat {
  font-size: 12px; color: var(--muted); margin-top: 3px; max-width: 76ch;
  text-align: left; font-style: italic;
}
