/* ===== Spec2Repo project page =====
 * Self-contained (no CSS framework). Palette follows the paper's figures and tables:
 * deep #3E1A5B, main #823C95, pink #C2185B, lavender #F3EBF6, light pink #FDE8EF.
 */

:root {
  --deep: #3E1A5B;
  --main: #823C95;
  --main-soft: #F3EBF6;
  --lav: #C9A3D9;
  --lav-light: #EFE3F5;
  --pink: #C2185B;
  --pink-soft: #FDE8EF;
  --ok: #2f9e6e;
  --ok-soft: #e3f4ea;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --ink-mute: #9ca3af;
  --paper: #ffffff;
  --paper-tint: #faf8fc;
  --rule: #e9e4ee;
  --serif: 'Noto Serif', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--main); }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
button { font-family: var(--sans); }

/* ----- Hero ----- */
.hero-banner {
  padding: 4.2rem 1.5rem 2.4rem;
  text-align: center;
  background:
    radial-gradient(1200px 380px at 50% -80px, rgba(201,163,217,0.35), rgba(255,255,255,0) 70%),
    linear-gradient(180deg, #fdfbfe 0%, #f6f0f9 100%);
  border-bottom: 1px solid var(--rule);
}
.hero-title {
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.hero-title .accent { color: var(--main); }
.hero-title .accent2 { color: var(--pink); }
.hero-logo {
  width: 3rem; height: 3rem;
  vertical-align: -0.55rem;
  margin-right: 0.55rem;
  border-radius: 0.6rem;
  box-shadow: 0 2px 8px rgba(62,26,91,0.25);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s ease;
}
.hero-title:hover .hero-logo { transform: translateY(-3px) scale(1.08) rotate(-2deg); box-shadow: 0 8px 18px rgba(62,26,91,0.35); }
.hero-subtitle {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}
.author-list { font-size: 1.02rem; margin: 0 auto 0.35rem; max-width: 980px; line-height: 1.75; }
.author-list .au { font-weight: 600; color: var(--ink); white-space: nowrap; }
.author-list sup { color: var(--pink); font-weight: 700; margin-left: 1px; }
.author-more { font-size: 0.9rem; color: var(--ink-soft); max-width: 980px; margin: 0.15rem auto 0.4rem; line-height: 1.7; }
.author-more .au { font-weight: 500; color: var(--ink-soft); }
.author-toggle {
  background: none; border: 1px dashed var(--lav); color: var(--main);
  border-radius: 999px; padding: 0.12rem 0.7rem; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; margin: 0.15rem 0 0.4rem;
}
.author-toggle:hover { background: var(--main-soft); }
.affiliation { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0.25rem; }
.affiliation sup { color: var(--main); font-weight: 700; }
.contact { font-size: 0.84rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.contact sup { color: var(--pink); font-weight: 700; }

.link-buttons { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.6rem; }
.link-buttons a.button {
  background: #2a1838; color: #fff; text-decoration: none;
  border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  padding: 0.55rem 1.15rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
  transition: background 0.15s, transform 0.15s;
}
.link-buttons a.button:hover { background: var(--main); transform: translateY(-1px); }
.link-buttons a.button svg { width: 1.05rem; height: 1.05rem; }
.link-buttons a.button.soon { background: #6b5a78; }
.link-buttons a.button .soon-tag {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(255,255,255,0.18); border-radius: 999px; padding: 0.05rem 0.45rem;
}

/* ----- TL;DR cards ----- */
.tldr-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  max-width: 1080px; margin: 0 auto; padding: 1.6rem 1.5rem 0;
}
.tldr-card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 16px;
  padding: 1.3rem 1rem 1.1rem; text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: transform 0.15s, box-shadow 0.15s;
}
.tldr-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(130,60,149,0.12); }
.tldr-num { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; color: var(--main); line-height: 1.05; }
.tldr-num .unit { font-size: 1.3rem; color: var(--ink-soft); font-weight: 600; }
.tldr-card.pink .tldr-num { color: var(--pink); }
.tldr-card.deep .tldr-num { color: var(--deep); }
.tldr-label { margin-top: 0.4rem; font-size: 0.95rem; color: var(--ink); font-weight: 600; }
.tldr-foot { margin-top: 0.25rem; font-size: 0.76rem; color: var(--ink-mute); }

/* ----- Contributions ----- */
.contributions-box {
  max-width: 820px; margin: 1.6rem auto 2rem;
  background: linear-gradient(135deg, #fbf7fd 0%, #f3ebf6 100%);
  border: 1px solid #e2d2ea; border-radius: 16px;
  padding: 1.4rem 1.8rem; box-shadow: 0 4px 20px rgba(130,60,149,0.06);
}
.contributions-heading { font-size: 1.12rem; font-weight: 700; color: var(--deep); margin: 0 0 1rem; text-align: center; }
.contributions-items { display: flex; flex-direction: column; gap: 0.75rem; }
.contrib-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  background: #fff; border: 1px solid #ead9f1; border-radius: 10px; padding: 0.8rem 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.15s;
}
.contrib-item:hover { transform: translateY(-3px); border-color: var(--main); box-shadow: 0 8px 22px rgba(130,60,149,0.16); }
.contrib-icon {
  flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 8px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.95rem;
  background: linear-gradient(160deg, var(--main), var(--deep));
}
.contrib-item div { font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft); }
.contrib-item strong { color: var(--ink); }

/* ----- Section scaffold ----- */
.section-block { max-width: 1080px; margin: 0 auto; padding: 3rem 1.5rem 2rem; }
.section-title { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 0.4rem; text-align: center; }
.section-sub { font-size: 1rem; color: var(--ink-soft); text-align: center; margin: 0 auto 1.8rem; max-width: 820px; }
.divider-rule { height: 1px; background: var(--rule); max-width: 1080px; margin: 0 auto; }
.note { font-size: 0.82rem; color: var(--ink-soft); text-align: center; margin-top: 0.6rem; }

.result-group-header { text-align: center; margin: 2.6rem auto 0.2rem; max-width: 760px; padding: 0 1.5rem; }
.result-group-header h3 { font-size: 2.05rem; font-weight: 800; color: var(--ink); margin: 0.3rem 0 0; letter-spacing: -0.01em; }
.result-group-label {
  display: inline-block; background: var(--deep); color: #fff;
  font-size: 0.86rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.32rem 1.05rem; border-radius: 999px; margin-bottom: 0.4rem;
}
.sub-section .section-title { font-size: 1.4rem; }

/* ----- Hero demo ----- */
.demo-wrap {
  max-width: 1000px; margin: 0 auto;
  background: #fff; border: 1px solid var(--rule); border-radius: 18px;
  box-shadow: 0 6px 28px rgba(62,26,91,0.07);
  overflow: hidden;
}
.demo-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.85rem 1.2rem; background: var(--paper-tint); border-bottom: 1px solid var(--rule);
}
.demo-head .who { font-size: 0.9rem; color: var(--ink-soft); }
.demo-head .who strong { color: var(--ink); }
.demo-head .who code { background: var(--main-soft); color: var(--deep); padding: 0.05rem 0.4rem; border-radius: 5px; }
.demo-controls { display: flex; align-items: center; gap: 0.5rem; }
.demo-controls button {
  border: 1px solid var(--lav); background: #fff; color: var(--deep);
  border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.84rem; font-weight: 600; cursor: pointer;
}
.demo-controls button:hover { background: var(--main-soft); }
.demo-controls button.primary { background: var(--deep); border-color: var(--deep); color: #fff; }
.demo-controls button.primary:hover { background: var(--main); }

.demo-body { display: grid; grid-template-columns: 1fr 250px; gap: 0; }
.demo-caps { padding: 1rem 1.2rem 1.1rem; }
.cap-row {
  border: 1px solid var(--rule); border-radius: 12px; padding: 0.7rem 0.85rem 0.75rem; margin-bottom: 0.7rem;
  transition: border-color 0.25s, background 0.25s;
}
.cap-row:last-child { margin-bottom: 0; }
.cap-row.lost { border-color: #f3b4cb; background: #fff8fb; }
.cap-row.kept { border-color: #b9e0c9; background: #f8fdf9; }
.cap-top { display: flex; align-items: baseline; gap: 0.55rem; margin-bottom: 0.45rem; min-width: 0; }
.cap-id { font-family: var(--mono); font-weight: 700; color: var(--main); font-size: 0.85rem; }
.cap-name { font-weight: 700; font-size: 0.97rem; }
.cap-api { font-family: var(--mono); font-size: 0.76rem; color: #5b6bd6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cap-name, .cap-count, .cap-badge, .cap-id { white-space: nowrap; flex-shrink: 0; }
.cap-count { margin-left: auto; font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); }
.cap-badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.1rem 0.5rem; border-radius: 999px; background: #eef0f3; color: var(--ink-mute);
}
.cap-row.lost .cap-badge { background: var(--pink-soft); color: var(--pink); }
.cap-row.kept .cap-badge { background: var(--ok-soft); color: var(--ok); }
.cells { display: flex; flex-wrap: wrap; gap: 4px; }
.cell {
  width: 15px; height: 15px; border-radius: 3.5px; background: #eceaf0;
  border: 1px solid #e0dce6; transition: background 0.15s, transform 0.15s;
}
.cell.i { border-radius: 50%; }
.cell.pass { background: #7cc8a0; border-color: #5fb487; }
.cell.fail { background: var(--pink); border-color: #9d1048; cursor: pointer; animation: pop 0.35s ease; }
.cell.fail:hover, .cell.fail.sel { transform: scale(1.35); box-shadow: 0 0 0 3px rgba(194,24,91,0.2); }
@keyframes pop { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }
.miss {
  display: none; margin-top: 0.55rem; font-size: 0.86rem; color: var(--ink);
  border-left: 3px solid var(--pink); background: #fff; padding: 0.4rem 0.7rem; border-radius: 0 8px 8px 0;
}
.miss.show { display: block; }
.miss b { color: var(--pink); }

.demo-meters {
  border-left: 1px solid var(--rule); padding: 1.1rem 1.1rem; background: var(--paper-tint);
  display: flex; flex-direction: column; gap: 1.1rem; justify-content: center;
}
.meter-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.meter-val { font-size: 2.3rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.meter-val.pass { color: var(--ok); }
.meter-val.fcr { color: var(--pink); }
.meter-sub { font-size: 0.78rem; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.meter-bar { height: 8px; border-radius: 999px; background: #ece6f0; overflow: hidden; margin-top: 0.3rem; }
.meter-bar > span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 0.12s linear; }
.meter-bar.pass > span { background: #7cc8a0; }
.meter-bar.fcr > span { background: var(--pink); }
.demo-legend { font-size: 0.74rem; color: var(--ink-soft); display: flex; gap: 0.8rem; flex-wrap: wrap; }
.demo-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2.5px; background: #b9b3c2; vertical-align: -1px; margin-right: 0.25rem; }
.demo-legend i.c { border-radius: 50%; }
.demo-foot {
  padding: 0.8rem 1.2rem; border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--ink);
  background: linear-gradient(90deg, #fff 0%, #fdf3f7 100%);
}
.demo-foot strong { color: var(--pink); }

/* ----- Abstract ----- */
.abstract-content { max-width: 880px; margin: 0 auto; font-family: var(--serif); font-size: 1.06rem; line-height: 1.78; color: var(--ink); }
.abstract-content p { margin-bottom: 0.85rem; }
.abstract-content strong { color: var(--main); }

/* ----- Pull quote ----- */
.gap-conclusion {
  text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink);
  margin-top: 1.4rem; padding: 0.95rem 1rem; border-left: 4px solid var(--main);
  background: var(--main-soft); border-radius: 0 10px 10px 0;
}

/* ----- Tabs ----- */
.tabs { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 1.2rem; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1.15rem;
  border: 2px solid #e2d2ea; border-radius: 999px; background: #fff;
  font-size: 0.92rem; font-weight: 600; color: var(--ink); cursor: pointer; transition: all 0.15s;
}
.tab:hover { border-color: var(--main); background: #fbf7fd; }
.tab.active { border-color: var(--deep); background: var(--deep); color: #fff; }
.tab .tag {
  display: inline-block; background: var(--main-soft); color: var(--deep);
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; padding: 0.12rem 0.5rem; border-radius: 999px;
}
.tab.active .tag { background: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.figure-card { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 1rem; }
.figure-card img { width: 100%; height: auto; display: block; border-radius: 6px; }
.figure-cap { font-size: 0.86rem; color: var(--ink-soft); margin-top: 0.7rem; line-height: 1.55; }
.figure-cap b { color: var(--ink); }

.stage-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem; margin-top: 1rem; }
.stage { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 0.7rem 0.75rem; font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5; }
.stage .n {
  display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--deep); color: #fff; font-weight: 800; font-size: 0.78rem; margin-right: 0.35rem;
}
.stage b { color: var(--ink); font-size: 0.88rem; }
.stage p { margin-top: 0.35rem; }

/* metric toy */
.metric-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.2rem; align-items: stretch; }
.formula-card { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 1.1rem 1.2rem; }
.formula-card h4 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--deep); }
.formula { text-align: center; margin: 0.6rem 0 0.8rem; overflow-x: auto; }
.formula-card p { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.4rem; }
.toy-card { background: var(--paper-tint); border: 1px solid #e2d2ea; border-radius: 14px; padding: 1rem 1.1rem; }
.toy-card h4 { font-size: 1rem; color: var(--deep); margin-bottom: 0.2rem; }
.toy-hint { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0.7rem; }
.toy-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.45rem; }
.toy-row .lbl { width: 96px; font-size: 0.82rem; font-weight: 600; }
.toy-row .cells .cell { width: 18px; height: 18px; cursor: pointer; }
.toy-row .cells .cell.pass { background: #7cc8a0; }
.toy-row .cells .cell.fail { background: var(--pink); animation: none; }
.toy-row .st { margin-left: auto; font-size: 0.75rem; font-weight: 700; }
.toy-row .st.ok { color: var(--ok); }
.toy-row .st.no { color: var(--pink); }
.toy-out { display: flex; gap: 0.8rem; margin-top: 0.8rem; }
.toy-out > div { flex: 1; background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 0.5rem 0.6rem; text-align: center; }
.toy-out .k { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.toy-out .v { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.toy-out .v.pass { color: var(--ok); }
.toy-out .v.fcr { color: var(--main); }
.toy-out .v.res { color: var(--pink); }
.toy-btns { margin-top: 0.6rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.toy-btns button { border: 1px solid var(--lav); background: #fff; color: var(--deep); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.toy-btns button:hover { background: var(--main-soft); }

/* ----- Stats strip ----- */
.stat-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.7rem; margin-bottom: 1.2rem; }
.stat { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 0.75rem 0.5rem; text-align: center; }
.stat .v { font-size: 1.55rem; font-weight: 800; color: var(--deep); letter-spacing: -0.01em; }
.stat .k { font-size: 0.78rem; color: var(--ink-soft); }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; margin: 0 auto; }
table.data {
  border-collapse: collapse; width: 100%; font-size: 0.86rem; font-variant-numeric: tabular-nums;
}
table.data th, table.data td { border-bottom: 1px solid var(--rule); padding: 0.45rem 0.55rem; text-align: center; white-space: nowrap; }
table.data thead th {
  background: var(--main-soft); color: var(--deep); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.02em; position: sticky; top: 0; z-index: 1;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { background: #ead9f1; }
table.data thead th .arr { font-size: 0.7rem; opacity: 0.55; margin-left: 2px; }
table.data thead th.sorted .arr { opacity: 1; color: var(--pink); }
table.data td.l { text-align: left; }
table.data tr.grp td { background: #fbf8fd; font-style: italic; font-weight: 700; color: var(--deep); text-align: left; font-size: 0.82rem; }
table.data tbody tr:hover td { background: #fcf9fd; }
table.data tr.ours td { background: var(--pink-soft) !important; font-weight: 700; }
.model-cell { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.model-cell img { width: 18px; height: 18px; object-fit: contain; }
.scaf { font-size: 0.74rem; font-weight: 600; padding: 0.08rem 0.45rem; border-radius: 999px; background: #f1edf5; color: var(--ink-soft); }
.best { font-weight: 800; color: var(--deep); }
.second { text-decoration: underline; text-decoration-color: var(--lav); text-underline-offset: 3px; }
.fcr-cell { min-width: 150px; }
.fcr-wrap { display: flex; align-items: center; gap: 0.5rem; }
.fcr-wrap .track { flex: 1; height: 8px; border-radius: 999px; background: #f1ebf5; overflow: hidden; }
.fcr-wrap .track > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #C9A3D9, #823C95); }
.fcr-wrap b { width: 2.6rem; text-align: right; font-weight: 800; color: var(--deep); }
.seg { display: inline-flex; border: 1px solid #e2d2ea; border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0.32rem 0.9rem; font-size: 0.84rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.seg button + button { border-left: 1px solid #e2d2ea; }
.seg button.active { background: var(--deep); color: #fff; }
.toolbar { display: flex; align-items: center; justify-content: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.toolbar .lab { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }

/* ----- Chart cards ----- */
.chart-card { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 1rem 1rem 0.8rem; }
.chart-card h4 { font-size: 1rem; text-align: center; margin-bottom: 0.4rem; }
.chart-card svg { width: 100%; height: auto; display: block; }
.legend { display: flex; justify-content: center; gap: 1.1rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.3rem; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; margin-right: 0.3rem; }
.callout {
  background: var(--main-soft); border-left: 4px solid var(--main); border-radius: 0 8px 8px 0;
  padding: 0.7rem 1rem; margin-top: 0.9rem; font-size: 0.93rem; color: var(--ink);
}
.callout strong { color: var(--deep); }

/* ----- Finding cards ----- */
.finding-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.finding {
  background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 1rem 1.1rem;
  display: grid; grid-template-columns: 112px 1fr; gap: 0.9rem; align-items: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.finding:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(130,60,149,0.1); }
.finding .num { font-size: 2.15rem; font-weight: 800; color: var(--main); text-align: center; line-height: 1.05; letter-spacing: -0.02em; }
.finding .num small { display: block; font-size: 0.7rem; font-weight: 600; color: var(--ink-mute); letter-spacing: 0; margin-top: 0.2rem; }
.finding.pink .num { color: var(--pink); }
.finding h4 { font-size: 0.98rem; margin-bottom: 0.2rem; }
.finding p { font-size: 0.87rem; color: var(--ink-soft); line-height: 1.5; }
.q-head { font-size: 1.12rem; font-weight: 700; color: var(--deep); margin: 1.6rem 0 0.8rem; text-align: center; }
.q-head:first-child { margin-top: 0; }
.fig-details { margin-top: 1rem; }
.fig-details summary {
  cursor: pointer; text-align: center; font-size: 0.88rem; font-weight: 600; color: var(--main); list-style: none;
  padding: 0.4rem; border-radius: 8px;
}
.fig-details summary::-webkit-details-marker { display: none; }
.fig-details summary:hover { background: var(--main-soft); }
.fig-details[open] summary { margin-bottom: 0.6rem; }

/* ----- Case card ----- */
.case-card { background: #fff; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; margin-top: 1.1rem; }
.case-card .ch { background: var(--paper-tint); padding: 0.6rem 1rem; font-size: 0.86rem; color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
.case-card .ch b { color: var(--ink); }
.case-card .cb { display: grid; grid-template-columns: 1fr 1fr; }
.case-card .cb > div { padding: 0.8rem 1rem; font-size: 0.88rem; }
.case-card .cb > div + div { border-left: 1px solid var(--rule); }
.case-card .lbl { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.3rem; }
.case-card .lbl.ok { color: var(--ok); }
.case-card .lbl.no { color: var(--pink); }

/* ----- Explorer ----- */
.explorer-card { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 1rem; }
.explorer-card svg { width: 100%; height: auto; display: block; }
.search {
  border: 1px solid #e2d2ea; border-radius: 999px; padding: 0.32rem 0.9rem; font-size: 0.85rem; width: 200px; outline: none;
}
.search:focus { border-color: var(--main); box-shadow: 0 0 0 3px rgba(130,60,149,0.12); }
.task-detail {
  margin-top: 0.9rem; border: 1px solid #e2d2ea; border-radius: 12px; padding: 0.9rem 1rem; background: var(--paper-tint);
  display: grid; grid-template-columns: 270px 1fr; gap: 1.3rem; min-height: 120px;
}
.task-detail .empty { grid-column: 1 / -1; text-align: center; color: var(--ink-mute); font-size: 0.9rem; align-self: center; }
.td-name { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--deep); }
.td-meta { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.2rem; line-height: 1.7; }
.td-meta b { color: var(--ink); }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.06rem 0.5rem; border-radius: 999px; background: #fff; border: 1px solid #e2d2ea; color: var(--main); margin-right: 0.25rem; }
.td-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 1.2rem; align-content: start; }
.td-bar { display: grid; grid-template-columns: 128px 1fr 40px; align-items: center; gap: 0.4rem; font-size: 0.76rem; }
.td-bar .t { background: #ece6f0; height: 9px; border-radius: 999px; overflow: hidden; }
.td-bar .t > span { display: block; height: 100%; background: var(--main); border-radius: 999px; }
.td-bar .t > span.full { background: var(--pink); }
.td-bar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.td-col-h { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute); grid-column: span 1; }
.scale { display: flex; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.5rem; }
.scale .grad { width: 160px; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #ffffff, #EFE3F5, #C9A3D9, #823C95, #3E1A5B); border: 1px solid #e2d2ea; }

/* ----- BibTeX ----- */
.bibtex-wrap { position: relative; max-width: 880px; margin: 0 auto; }
.bibtex-wrap pre {
  background: #1f1630; color: #ece4f2; padding: 1.2rem; border-radius: 12px;
  font-family: var(--mono); font-size: 0.8rem; overflow-x: auto; margin: 0; white-space: pre-wrap; line-height: 1.55;
}
.bibtex-copy {
  position: absolute; top: 0.7rem; right: 0.7rem; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25); color: #fff; border-radius: 6px; padding: 0.25rem 0.7rem; font-size: 0.78rem; cursor: pointer;
}
.bibtex-copy:hover { background: rgba(255,255,255,0.25); }

/* ----- Footer ----- */
.page-footer { background: var(--paper-tint); border-top: 1px solid var(--rule); padding: 2rem 1.5rem; text-align: center; font-size: 0.85rem; color: var(--ink-soft); margin-top: 2.5rem; }
.page-footer a { color: var(--main); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.footer-logo { width: 30px; height: 30px; border-radius: 7px; opacity: 0.9; transition: transform 0.25s ease; }
.footer-logo:hover { transform: translateY(-2px); }

/* ----- Tooltip ----- */
#chart-tooltip {
  position: fixed; pointer-events: none; z-index: 9999;
  background: rgba(31, 22, 48, 0.95); color: #fff; padding: 0.45rem 0.7rem; border-radius: 8px;
  font-size: 0.78rem; line-height: 1.45; box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  opacity: 0; transform: translate(-50%, calc(-100% - 12px)); transition: opacity 0.12s ease; max-width: 340px;
}
#chart-tooltip.visible { opacity: 1; }
#chart-tooltip .tt-title { font-weight: 700; margin-bottom: 0.15rem; }
#chart-tooltip .tt-dim { color: #c9b8d6; }

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .tldr-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-body { grid-template-columns: 1fr; }
  .demo-meters { border-left: 0; border-top: 1px solid var(--rule); flex-direction: row; flex-wrap: wrap; }
  .demo-meters > div { flex: 1; min-width: 140px; }
  .stage-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
  .finding-grid { grid-template-columns: 1fr; }
  .task-detail { grid-template-columns: 1fr; }
  .td-bars { grid-template-columns: 1fr; }
  .case-card .cb { grid-template-columns: 1fr; }
  .case-card .cb > div + div { border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 600px) {
  .hero-title { font-size: 2.5rem; }
  .hero-subtitle { font-size: 1.15rem; }
  .hero-logo { width: 2.2rem; height: 2.2rem; vertical-align: -0.4rem; }
  .tldr-num { font-size: 2.1rem; }
  .section-title { font-size: 1.5rem; }
  .contributions-box { padding: 1rem; }
}

/* ----- Top nav ----- */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 1.4rem; background: rgba(255,255,255,0.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%); transition: transform 0.25s ease;
}
.topnav.show { transform: none; }
.topnav .brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.02rem; }
.topnav .brand img { width: 26px; height: 26px; border-radius: 6px; }
.navlinks { display: flex; gap: 0.2rem; flex-wrap: wrap; justify-content: flex-end; }
.navlinks a { text-decoration: none; color: var(--ink-soft); font-size: 0.86rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 999px; }
.navlinks a:hover, .navlinks a.on { background: var(--main-soft); color: var(--deep); }
.navlinks a.cta { background: var(--deep); color: #fff; }
.navlinks a.cta:hover { background: var(--main); color: #fff; }
section[id], div[id].result-group-header { scroll-margin-top: 64px; }

/* ----- Leaderboard ----- */
.lb-wrap { max-width: 1040px; border: 1px solid var(--rule); border-radius: 14px; background: #fff; box-shadow: 0 4px 20px rgba(62,26,91,0.05); }
table.lb { font-size: 0.88rem; }
table.lb thead th { padding: 0.55rem 0.5rem; }
table.lb thead th:first-child { border-top-left-radius: 14px; }
table.lb thead th:last-child { border-top-right-radius: 14px; }
table.lb tbody tr:last-child td { border-bottom: 0; }
table.lb td { padding: 0.5rem 0.5rem; }
.rank { font-weight: 800; color: var(--ink-mute); width: 2.2rem; }
.medal { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-size: 0.78rem; font-weight: 800; color: #fff; }
.medal.g1 { background: linear-gradient(160deg, #f6c74a, #d49b12); }
.medal.g2 { background: linear-gradient(160deg, #cfd5de, #9aa4b2); }
.medal.g3 { background: linear-gradient(160deg, #e3a979, #b7713f); }
.res-cell b { color: var(--pink); }
.res-cell .alm { color: var(--ink-mute); font-size: 0.78rem; margin-left: 0.2rem; }
.lb-sub { font-size: 0.72rem; color: var(--ink-mute); font-weight: 500; display: block; letter-spacing: 0; text-transform: none; }
.scaf.mini { background: #f3ebf6; color: var(--main); }
.scaf.cli { background: #fde8ef; color: var(--pink); }
.ver { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mute); margin-left: 0.2rem; }

/* ----- Submit ----- */
.submit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; }
.submit-step { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 1rem 1rem 0.9rem; }
.submit-step .n { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: linear-gradient(160deg, var(--main), var(--deep)); color: #fff; font-weight: 800; font-size: 0.85rem; margin-bottom: 0.5rem; }
.submit-step h4 { font-size: 0.98rem; margin-bottom: 0.3rem; }
.submit-step p { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.55; }
@media (max-width: 900px) { .submit-grid { grid-template-columns: repeat(2, 1fr); } .navlinks a:not(.cta) { display: none; } }
@media (max-width: 600px) { .submit-grid { grid-template-columns: 1fr; } }

/* ----- Small screens: demo and leaderboard ----- */
@media (max-width: 600px) {
  .demo-body, .demo-caps { min-width: 0; }
  .cap-top { flex-wrap: wrap; }
  .cap-api { display: none; }
  .cap-count { margin-left: auto; }
  .demo-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; padding: 0.9rem; }
  .demo-meters > div { min-width: 0; }
  .demo-legend { grid-column: 1 / -1; }
  .meter-val { font-size: 1.7rem; }
  .cell { width: 13px; height: 13px; }
}
@media (max-width: 600px) {
  table.lb { font-size: 0.8rem; }
  table.lb td, table.lb thead th { padding: 0.4rem 0.3rem; }
  .fcr-cell { min-width: 0; }
  .fcr-wrap .track { display: none; }
  .scaf { font-size: 0.66rem; padding: 0.05rem 0.35rem; }
  .scaf .long { display: none; }
  .model-cell { gap: 0.3rem; white-space: normal; }
  .lb-sub { display: none; }
}
@media (min-width: 601px) { .scaf .short { display: none; } }

/* ----- Demo: behaviors the run missed ----- */
.demo-grid { gap: 5px; margin-bottom: 1rem; }
.demo-grid .cell { width: 20px; height: 20px; border-radius: 4px; }
.demo-grid .cell.sel { transform: scale(1.3); box-shadow: 0 0 0 3px rgba(194,24,91,0.22); }
.beh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.beh { border: 1px solid var(--rule); border-radius: 12px; padding: 0.65rem 0.75rem; font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.beh.lost { border-color: #f3b4cb; background: #fff8fb; }
.beh.hl { box-shadow: 0 6px 18px rgba(194,24,91,0.14); }
.beh-top { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.2rem; }
.beh-t { font-weight: 700; color: var(--ink); font-size: 0.9rem; }
.beh.lost .cap-badge { background: var(--pink-soft); color: var(--pink); }
.beh-sec { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--main); margin-bottom: 0.3rem; }
.beh-spec { color: var(--ink); margin-bottom: 0.35rem; }
.beh-agent b { color: var(--pink); font-weight: 700; }
@media (max-width: 900px) { .beh-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .demo-grid .cell { width: 15px; height: 15px; } }
