/* ==========================================================================
   MVL Benchmark Library — design system (single source of colour truth)
   Only the tokens below may appear anywhere on the site.
   ========================================================================== */
:root {
    --bg: #FFFBEB;
    --surface: #FFFFFF;
    --border: #F3E8C8;
    --text: #1F2937;
    --text-muted: #6B7280;
    --primary-from: #D97706;
    --primary-to: #F59E0B;
    --link: #198C8A;
    --link-hover: #0F766E;
    --ok-bg: #E6F4F3;  --ok-fg: #0F766E;
    --warn-bg: #FEF3C7; --warn-fg: #92400E;
    --err-bg: #FEE2E2;  --err-fg: #B91C1C;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgb(31 41 55 / .06);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --primary-gradient: linear-gradient(90deg, var(--primary-from), var(--primary-to));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* Body links use --link-hover: --link is 3.9:1 on --bg (< 4.5), --link-hover is 5.3:1. */
a { color: var(--link-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
/* in-text links must not rely on colour alone (WCAG 1.4.1) */
p a, li a, dd a, .about-line a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
code, pre, .mono { font-family: var(--mono); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.page { flex: 1; padding: 32px 24px 56px; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.icon { width: 18px; height: 18px; stroke-width: 1.75; vertical-align: -3px; flex: none; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 26px; height: 26px; stroke-width: 1.75; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- Header / nav ------------------------------------------------------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 36px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav > a { position: relative; padding: 23px 12px; color: var(--text-muted); font-weight: 500; font-size: .92rem; line-height: 1; }
.site-nav > a:hover { color: var(--text); text-decoration: none; }
.site-nav > a.active { color: var(--text); }
.site-nav > a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--link); }
.site-nav > a:hover::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--border); }
.site-nav > a.active:hover::after { background: var(--link); }
.user-menu { position: relative; margin-left: 6px; }
.user-menu > button { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px 6px 8px; cursor: pointer; font: inherit; font-size: .85rem; color: var(--text-muted); }
.user-menu > button:hover { color: var(--text); }
.user-menu .menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(31 41 55 / .10); padding: 6px; z-index: 40; }
.user-menu.open .menu { display: block; }
.user-menu .menu a, .user-menu .menu span { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: .88rem; color: var(--text); }
.user-menu .menu a:hover { background: var(--bg); text-decoration: none; }
.user-menu .menu span { color: var(--text-muted); font-size: .78rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; cursor: pointer; color: var(--text); }

/* --- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); font-size: .84rem; color: var(--text-muted); }
.footer-inner { padding: 20px 24px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.footer-authors a { color: var(--link-hover); font-weight: 500; }
.footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }

/* --- Flash / alerts ----------------------------------------------------- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: .9rem; border: 1px solid transparent; }
.flash-error { background: var(--err-bg); color: var(--err-fg); }
.flash-success { background: var(--ok-bg); color: var(--ok-fg); }
.flash-info { background: var(--warn-bg); color: var(--warn-fg); }

/* --- Buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: .9rem; border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1.2; white-space: nowrap; transition: filter .15s, background .15s; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary-gradient); color: var(--surface); }
.btn-primary:hover { filter: brightness(.95); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--link); color: var(--link-hover); }
.btn-danger { background: var(--err-bg); color: var(--err-fg); }
.btn-ok { background: var(--ok-bg); color: var(--ok-fg); }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn .icon { width: 16px; height: 16px; }

/* --- Cards & sections --------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-title .count { color: var(--text-muted); font-weight: 500; font-size: .88rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head .section-title { margin: 0; }

/* --- Forms -------------------------------------------------------------- */
.input, input[type=text], input[type=search], input[type=password], input[type=email], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font: inherit; font-size: .92rem; color: var(--text); background: var(--surface);
}
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgb(25 140 138 / .18); }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search input { padding-left: 38px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }

/* --- Home --------------------------------------------------------------- */
.hero { padding: 56px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.15; font-weight: 700; margin-bottom: 12px; }
.hero h1 .accent { color: var(--link); }
.hero p { max-width: 680px; margin: 0 auto 22px; color: var(--text-muted); font-size: 1.05rem; }
.hero .search { max-width: 640px; margin: 0 auto 18px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.welcome { max-width: 860px; margin: 0 auto 34px; }
.welcome h2 { font-size: 1.2rem; margin-bottom: 10px; }
.welcome p { color: var(--text-muted); margin-bottom: 10px; font-size: .95rem; }
.welcome p:last-child { margin-bottom: 0; }
.welcome .notice { margin-top: 14px; padding: 10px 14px; background: var(--bg); border-left: 3px solid var(--link); border-radius: var(--radius-sm); color: var(--text); font-size: .88rem; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 14px 0 34px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--primary-from); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .76rem; color: var(--text-muted); margin-top: 6px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 34px; }
.module-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s; }
.module-card:hover { border-color: var(--link); text-decoration: none; }
.module-card .icon-lg { color: var(--link); }
.module-card h3 { font-size: 1rem; margin: 0; }
.module-card .n { color: var(--text-muted); font-size: .85rem; }
.module-card.empty { opacity: .6; }
.recent-list { list-style: none; }
.recent-list li { display: grid; grid-template-columns: minmax(170px, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.recent-list .badges { justify-content: flex-end; max-width: 220px; }
.recent-list li:last-child { border-bottom: none; }
.recent-list .meta { color: var(--text-muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 860px) { .home-two { grid-template-columns: 1fr; } }

/* --- Home v3 ------------------------------------------------------------ */
.hero-left { text-align: left; padding: 56px 0 40px; max-width: 1100px; }
.hero-left h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 10px; }
.hero-left p { margin: 0 0 20px; max-width: 64ch; }
.hero-left .search { margin: 0 0 18px; max-width: 640px; }
.hero-left .hero-actions { justify-content: flex-start; align-items: center; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.about-line { max-width: 76ch; margin: 0 auto 36px; text-align: center; }
.about-line p { color: var(--text-muted); font-size: 1rem; }
.home-benchmarks { margin-bottom: 36px; }
.home-benchmarks .section-title { margin: 0; font-size: 1.25rem; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .86rem; font-weight: 500; }
.filter-chip .n { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.filter-chip:hover { border-color: var(--link); text-decoration: none; }
.filter-chip.active { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-fg); }
.filter-chip.active .n { color: var(--ok-fg); }
.filter-chip.disabled { color: var(--text-muted); background: var(--bg); cursor: not-allowed; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: .84rem; color: var(--text-muted); }
.legend-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.home-bottom { margin-bottom: 8px; }
.home-bottom .section-title { font-size: 1.1rem; }
.news-list { list-style: none; }
.news-list li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .92rem; flex-wrap: wrap; }
.news-list li:last-child { border-bottom: none; }
.news-list time { color: var(--text-muted); font-size: .84rem; white-space: nowrap; }
.cite-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
pre.bibtex.wrap { white-space: pre-wrap; word-break: break-word; overflow-x: hidden; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: var(--radius-sm); font-size: .88rem; z-index: 200; box-shadow: 0 8px 24px rgb(31 41 55 / .2); }
.about-logo { height: 96px; width: auto; margin-bottom: 18px; display: block; }
.selection { margin-bottom: 18px; }
.sel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.sel-grid fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 10px; min-width: 0; }
.sel-grid legend { font-size: .8rem; font-weight: 600; color: var(--text-muted); padding: 0 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .88rem; padding: 3px 0; cursor: pointer; }
.check input { width: auto; margin: 0; accent-color: var(--link); }
.check .n { color: var(--text-muted); font-size: .8rem; margin-left: auto; font-variant-numeric: tabular-nums; }
.sel-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.sel-foot #selCount { font-variant-numeric: tabular-nums; }

/* --- Browse ------------------------------------------------------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 260px; }
.toolbar select { width: auto; }
.browse { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.browse > section { min-width: 0; }
.filters { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 90px); overflow-y: auto; }
.filters details { border-bottom: 1px solid var(--border); padding: 6px 0; }
.filters summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: .75rem; color: var(--text-muted); font-weight: 600; padding: 6px 4px; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary .icon { transition: transform .15s; }
.filters details[open] summary .icon { transform: rotate(180deg); }
.filters .opts { padding: 2px 0 8px; }
.filters .opts a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); font-size: .88rem; color: var(--text); }
.filters .opts a:hover { background: var(--surface); text-decoration: none; }
.filters .opts a.active { background: var(--ok-bg); color: var(--ok-fg); font-weight: 600; }
.filters .opts .n { color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.filter-clear { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; margin-top: 10px; }
.filter-toggle { display: none; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .76rem; background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 2px 9px; border-radius: 999px; font-family: var(--mono); }
.chip.more { font-family: var(--font); color: var(--text-muted); }
.chip a { color: var(--text-muted); display: inline-flex; }
.chip a:hover { color: var(--err-fg); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-width: 100%; }
table.bench { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
table.bench th, table.bench td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.bench th { background: var(--bg); font-size: .8rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
table.bench tr:last-child td { border-bottom: none; }
table.bench tbody tr:hover td { background: var(--bg); }
.slug { font-family: var(--mono); font-size: .85rem; color: var(--link-hover); font-weight: 500; }
.ops-chips { display: flex; gap: 4px; flex-wrap: wrap; min-width: 210px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-weight: 600; cursor: default; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-block; }
.badge.verified { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bg); }
.badge.verified .dot { background: currentColor; }
.badge.pending { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bg); }
.badge.pending .dot { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.badge.unverified .dot { background: transparent; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); font-weight: 600; }
.tag.ok { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-fg); }
.tag.warn { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn-fg); }
.tag.err { background: var(--err-bg); border-color: var(--err-bg); color: var(--err-fg); }
.legend { font-size: .8rem; color: var(--text-muted); margin-top: 10px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ok-fg); display: inline-block; vertical-align: -1px; margin-right: 4px; }
.legend .dot.full { background: var(--ok-fg); }
.legend .dot.half { background: linear-gradient(90deg, var(--warn-fg) 50%, transparent 50%); border-color: var(--warn-fg); }
.legend .dot.none { border-color: var(--text-muted); }
.empty { padding: 36px; text-align: center; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.empty-row { padding: 18px 16px; font-size: .92rem; color: var(--text-muted); max-height: 120px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; font-size: .88rem; }
.pagination a, .pagination span { padding: 6px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pagination a:hover { border-color: var(--link); text-decoration: none; }
.pagination .current { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bg); font-weight: 600; }
.pagination .disabled { color: var(--text-muted); }

/* --- Detail ------------------------------------------------------------- */
.crumbs { font-size: .84rem; color: var(--text-muted); margin-bottom: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-head h1 { font-size: 1.65rem; margin-bottom: 4px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stack > * + * { margin-top: 20px; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.spec-item { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; }
.spec-item .k { font-size: .7rem; color: var(--text-muted); }
.spec-item .v { font-weight: 600; margin-top: 2px; }
table.defs { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.defs td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.defs tr:last-child td { border-bottom: none; }
table.defs td:first-child { font-family: var(--mono); font-weight: 600; width: 80px; }
table.defs td:last-child { color: var(--text-muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-size: .9rem; font-weight: 500; color: var(--text-muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--link); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.impl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: .85rem; color: var(--text-muted); }
.impl-head .mono { color: var(--text); }
pre.code { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; font-size: .8rem; line-height: 1.5; overflow: auto; max-height: 560px; tab-size: 4; color: var(--text); }
pre.code code { font-family: var(--mono); background: none; padding: 0; }
pre.code .ln { display: inline-block; width: 3.2em; color: var(--text-muted); user-select: none; text-align: right; margin-right: 1.2em; }
/* highlight.js theme restricted to design tokens */
.hljs { color: var(--text); background: transparent; }
.hljs-keyword, .hljs-built_in, .hljs-type, .hljs-selector-tag, .hljs-meta { color: var(--link-hover); font-weight: 600; }
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-title { color: var(--warn-fg); }
.hljs-number, .hljs-literal { color: var(--primary-from); }
.hljs-comment, .hljs-quote { color: var(--text-muted); font-style: italic; }
.hljs-function .hljs-title, .hljs-title.function_ { color: var(--text); font-weight: 600; }
.record { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: .88rem; }
.record dt { color: var(--text-muted); }
.record dd { margin: 0; overflow-wrap: anywhere; }   /* break inside a long checksum, never inside "116/116" */
@media (max-width: 600px) { .record { grid-template-columns: 1fr; gap: 2px 0; } .record dd { margin-bottom: 8px; } }
.timeline { list-style: none; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--text-muted); font-variant-numeric: tabular-nums; }
pre.bibtex { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .82rem; overflow-x: auto; white-space: pre; }

/* --- Submit ------------------------------------------------------------- */
.dropzone { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 20px; text-align: center; color: var(--text-muted); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--link); background: var(--ok-bg); color: var(--ok-fg); }
.dropzone input { display: none; }
.file-list { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: .86rem; }
.file-list .name { font-family: var(--mono); }
.file-list button { background: none; border: none; color: var(--text-muted); cursor: pointer; display: inline-flex; }
.file-list button:hover { color: var(--err-fg); }
.problems { list-style: none; margin-top: 10px; font-size: .85rem; display: flex; flex-direction: column; gap: 4px; }
.problems li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; border-radius: var(--radius-sm); }
.problems li.err { background: var(--err-bg); color: var(--err-fg); }
.problems li.ok { background: var(--ok-bg); color: var(--ok-fg); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 16px 0; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; font-size: .74rem; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); }
.steps li .st { font-size: .7rem; font-weight: 700; }
.steps li.pass { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-fg); }
.steps li.fail { background: var(--err-bg); border-color: var(--err-bg); color: var(--err-fg); }
.steps li.running { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn-fg); }
.steps li.skipped { opacity: .65; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.step-logs details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; }
.step-logs summary { cursor: pointer; padding: 10px 14px; font-size: .88rem; display: flex; align-items: center; gap: 10px; }
.step-logs pre { padding: 10px 14px; border-top: 1px solid var(--border); font-size: .78rem; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }
.pill.ok { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-fg); }
.pill.warn { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn-fg); }
.pill.err { background: var(--err-bg); border-color: var(--err-bg); color: var(--err-fg); }

/* --- Admin -------------------------------------------------------------- */
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.status-tabs a { font-size: .84rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); }
.status-tabs a.active { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-fg); font-weight: 600; }
.status-tabs a:hover { text-decoration: none; border-color: var(--link); }
.mini-steps { display: inline-flex; gap: 3px; }
.mini-steps i { width: 10px; height: 10px; border-radius: 2px; background: var(--border); display: inline-block; }
.mini-steps i.pass { background: var(--ok-fg); }
.mini-steps i.fail { background: var(--err-fg); }
.mini-steps i.running, .mini-steps i.pending { background: var(--warn-fg); }
.mini-steps i.skipped { background: var(--border); }
.decision { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; }
@media (max-width: 600px) { .decision { grid-template-columns: 1fr; } }

/* --- Modal -------------------------------------------------------------- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgb(31 41 55 / .5); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); max-width: 720px; width: 100%; max-height: 85vh; overflow: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal-header h2 { font-size: 1.1rem; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); display: inline-flex; }
.legal-content { padding: 20px 24px; font-size: .88rem; color: var(--text-muted); }
.legal-content h3 { font-size: .95rem; color: var(--text); margin: 16px 0 6px; }
.legal-content p { margin-bottom: 8px; }

/* --- Login / prose ------------------------------------------------------ */
.login-box { max-width: 380px; margin: 60px auto; }
.login-box h1 { font-size: 1.25rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.login-box input { margin: 14px 0; }
.prose { max-width: 760px; }
.prose.wide { max-width: none; }
.prose.wide p, .prose.wide ul { max-width: 76ch; }
.prose h1 { font-size: 1.8rem; margin-bottom: 14px; }
.prose h2 { font-size: 1.15rem; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--text-muted); margin-bottom: 10px; }
.prose ul, .prose ol { padding-left: 22px; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 860px) {
    .browse { grid-template-columns: 1fr; }
    .filter-toggle { display: inline-flex; }
    .filters { position: fixed; inset: 0 auto 0 0; width: min(320px, 85vw); max-height: none; background: var(--surface); border-right: 1px solid var(--border); padding: 16px; transform: translateX(-100%); transition: transform .2s; z-index: 50; overflow-y: auto; }
    .filters.open { transform: none; box-shadow: 0 0 40px rgb(31 41 55 / .25); }
    .filters .drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
    .drawer-backdrop { display: none; position: fixed; inset: 0; background: rgb(31 41 55 / .4); z-index: 45; }
    .drawer-backdrop.open { display: block; }
}
@media (min-width: 861px) { .filters .drawer-head { display: none; } }
@media (max-width: 720px) {
    .nav-toggle { display: inline-flex; }
    .site-nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 8px 16px 12px; }
    .site-nav.open { display: flex; }
    .site-nav > a { padding: 12px 8px; }
    .site-nav > a.active::after { left: 8px; right: auto; width: 24px; }
    .user-menu { margin: 6px 0 0; }
    .hero h1 { font-size: 1.8rem; }
    .page { padding: 20px 16px 40px; }
    .container { padding: 0 16px; }
    .card { padding: 16px; }
    .detail-head h1 { font-size: 1.3rem; }
    .timeline li { grid-template-columns: 1fr; gap: 2px; }
}

/* --- Stacked table on narrow screens ---------------------------------------- */
@media (max-width: 640px) {
    .table-wrap:has(table.bench-stack) { overflow: visible; border: none; background: transparent; }
    table.bench-stack { min-width: 0; display: block; }
    table.bench-stack thead { display: none; }
    table.bench-stack tbody, table.bench-stack tr { display: block; }
    table.bench-stack tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
    table.bench-stack td { display: none; border: none; padding: 2px 0; text-align: left; }
    table.bench-stack td[data-label="Name"], table.bench-stack td[data-label="Implementations"], table.bench-stack td[data-label="Added"] { display: block; }
    table.bench-stack td[data-label="Added"] { font-size: .8rem; color: var(--text-muted); }
    table.bench-stack tr::after { content: attr(data-summary); display: block; font-size: .84rem; color: var(--text-muted); order: 2; }
    table.bench-stack td[data-label="Name"] { font-size: 1rem; }
    .hero-left { padding: 32px 0 24px; }
    .hero-left .hero-actions .btn { width: 100%; }
}

/* --- Submission outcome / review rules -------------------------------------- */
.outcome { border-left: 4px solid var(--border); }
.outcome-ok { border-left-color: var(--ok-fg); }
.outcome-warn { border-left-color: var(--warn-fg); }
.outcome-err { border-left-color: var(--err-fg); }
/* Nav dropdown (Docs) */
.nav-drop { position: relative; display: inline-flex; align-items: center; }
.nav-drop > a { display: inline-flex; align-items: center; gap: 4px; }
.nav-drop .drop-caret { opacity: .6; }
.nav-drop .menu { display: none; position: absolute; left: 0; top: calc(100% + 10px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(31 41 55 / .10); padding: 6px; z-index: 40; }
.nav-drop.open .menu { display: block; }
.nav-drop .menu a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); font-size: .88rem; color: var(--text); white-space: nowrap; }
.nav-drop .menu a:hover { background: var(--bg); text-decoration: none; }
@media (hover: hover) and (min-width: 861px) {
    .nav-drop:hover .menu { display: block; }
    /* invisible bridge over the gap: without it the pointer leaves .nav-drop
       on its way to the menu and the menu closes before it can be clicked */
    .nav-drop::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
}

/* Home: identity panel + at a glance */
.hero-compact { padding-bottom: 8px; }
.intro-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; margin: 24px 0 8px; align-items: stretch; }

.intro-panel, .glance-panel, .cat-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-head, .cat-head { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 16px; font-size: .95rem; font-weight: 600; background: var(--bg); border-bottom: 1px solid var(--border); }
.panel-head .icon, .cat-head .icon { color: var(--link); }
.intro-panel { display: flex; flex-direction: column; }
.intro-panel .panel-body { padding: 16px; flex: 1 1 auto; }
.intro-panel p { margin: 0 0 10px; font-size: .92rem; line-height: 1.65; color: var(--text-muted); max-width: 70ch; }
.intro-panel p.lead { font-size: 1rem; font-weight: 600; color: var(--text); }
.intro-panel p.invite { margin-bottom: 0; }
.glance-panel { display: flex; flex-direction: column; }
.glance { margin: 0; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-content: start; flex: 1 1 auto; }
.glance dt { font-size: .86rem; color: var(--text-muted); }
.glance dd { margin: 0; font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.glance-foot { margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--border); color: var(--text-muted); }

/* Home: category panels */
.cat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 20px 0; align-items: start; }
.cat-body { padding: 4px 16px 8px; }
.cat-group { padding: 10px 0; border-bottom: 1px solid var(--border); }
.cat-group:last-child { border-bottom: none; }
.cat-group-title { display: block; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 6px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; font-size: .9rem; }
.cat-list .n { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: .84rem; }
.cat-list.inline { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.cat-list.inline li { padding: 2px 0; }
.cat-foot { padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--border); font-size: .9rem; font-weight: 600; }

/* Home: the three paths */
.path-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 16px 0 4px; }
.path-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.path-card:hover { border-color: var(--link); text-decoration: none; box-shadow: 0 6px 18px rgb(31 41 55 / .06); }
.path-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .95rem; }
.path-card h3 .icon { color: var(--link); }
.path-card p { margin: 0 0 8px; font-size: .86rem; color: var(--text-muted); line-height: 1.55; }
.path-more { font-size: .84rem; font-weight: 600; color: var(--link-hover); }

/* Docs index */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 20px 0 28px; }
.doc-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); }
.doc-card:hover { border-color: var(--link); text-decoration: none; box-shadow: 0 6px 18px rgb(31 41 55 / .06); }
.doc-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .98rem; }
.doc-card h2 .icon { color: var(--link); }
.doc-card p { margin: 0; font-size: .88rem; color: var(--text-muted); line-height: 1.6; }

/* Footer status line */
.footer-status { margin-top: 8px; font-size: .8rem; color: var(--text-muted); }

.news-list.wide li { padding: 8px 0; }

@media (max-width: 860px) {
    .intro-row { grid-template-columns: 1fr; }
    .nav-drop .menu { position: static; display: block; box-shadow: none; border: none; padding: 4px 0 4px 12px; min-width: 0; }
    .nav-drop .drop-caret { display: none; }
}

/* Download by selection: collapsible panel */
details.selection > summary.sel-summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
details.selection > summary.sel-summary::-webkit-details-marker { display: none; }
details.selection > summary .section-title { margin: 0; }
details.selection > summary .sel-hint { margin-left: auto; }
details.selection > summary .sel-caret { color: var(--text-muted); transition: transform .15s; }
details.selection:not([open]) > summary .sel-caret { transform: rotate(180deg); }
details.selection[open] > summary { margin-bottom: 14px; }
details.selection > summary:hover .section-title { color: var(--link-hover); }

.read-as { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sel-legend { margin: 0 0 12px; }
.cat-unit { margin-left: auto; font-weight: 500; }

/* Download by selection: options that cannot combine with the rest */
label.check.zero { color: var(--text-muted); opacity: .55; cursor: not-allowed; }
label.check.zero .n { color: var(--text-muted); }

/* Statistics: coverage matrix */
table.matrix { min-width: 720px; }
table.matrix th[scope="row"] { white-space: nowrap; }
table.matrix td.cell { font-size: .84rem; white-space: nowrap; }
table.matrix td.cell a { font-family: var(--mono); font-size: .8rem; }
table.matrix td.cell .cell-n { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-variant-numeric: tabular-nums; font-size: .76rem; }
table.matrix td.full .cell-n { background: var(--ok-bg); color: var(--ok-fg); }
table.matrix td.part .cell-n { background: var(--warn-bg); color: var(--warn-fg); }
table.matrix td.none .cell-n { background: var(--bg); color: var(--text-muted); }
.stat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.stat-cols table.bench { min-width: 0; }

/* Models page */
table.models { min-width: 640px; }
table.models td.ok { color: var(--ok-fg); font-weight: 600; }
.rate { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.rate-track { flex: 0 0 80px; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.rate-bar { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary-from), var(--primary-to)); }
.rate-num { font-variant-numeric: tabular-nums; font-size: .86rem; color: var(--text-muted); white-space: nowrap; }

table.rules { min-width: 900px; font-size: .84rem; }
table.rules td { vertical-align: top; }
table.rules code { font-size: .8rem; }
.prose h3 { font-size: 1rem; margin: 18px 0 6px; }
.prose table.defs { margin-bottom: 8px; }

/* Submit page: the complete example */
.example-card { margin-bottom: 20px; }
.example-points { margin: 0 0 14px 18px; line-height: 1.6; }
.example-points li { margin-bottom: 4px; }
.example-files { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; }
.example-file-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .85rem; }
.example-code { margin: 0; max-height: 360px; overflow: auto; font-size: .74rem; white-space: pre; }
@media (max-width: 860px) { .example-files { grid-template-columns: minmax(0, 1fr); } }
.example-summary { cursor: pointer; margin-bottom: 0; flex-wrap: wrap; list-style: none; }
.example-summary::-webkit-details-marker { display: none; }
.example-summary::after { content: '▸'; margin-left: auto; color: var(--text-muted); transition: transform .15s; }
details[open] > .example-summary::after { transform: rotate(90deg); }
details[open] .example-hint { display: none; }
