/* Magic State Factory Catalog -- one stylesheet for every page.
 *
 * Tokens on :root; dark mode is its own palette (not an inversion), declared
 * under prefers-color-scheme AND [data-theme="dark"] so the toggle wins both
 * ways.  The distance ramp (d = 3..7) is one hue, light -> dark, validated as an
 * ordinal ramp against each mode's card surface with the dataviz validator.
 *
 * NOTHING in this file may apply `text-transform` to a label: `n` and `N` are
 * different parameters and `gamma` and `Gamma` are different symbols, so
 * case-folding a label states something false.  Labels are set apart by
 * weight, size, colour and letter-spacing instead.
 */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eef0f3;
  --border: #e1e4e8;
  --border-strong: #c9ced6;
  --text: #16191d;
  --text-dim: #505862;
  --muted: #7a828c;
  --brand: #1f4fbf;
  --brand-strong: #183f99;
  --brand-soft: #edf2fc;
  --brand-ink: #183f99;
  --brand-solid: #1f4fbf;      /* filled buttons: white text on it at > 4.5:1 */
  --output: #c2410c;          /* output wires: the k protected qubits */
  --output-fill: #f59e0b;
  --output-soft: #fff4e2;
  --check: #0f766e;           /* postselected check wires */
  --check-fill: #14b8a6;
  --check-soft: #e3f6f3;
  --zero: #d5dbe6;
  --good: #1d6b46;
  --good-soft: #eaf4ee;
  --violet: #505862;
  --violet-soft: #eef0f3;
  --amber-soft: #fff4dd;
  --amber-ink: #92400e;
  --stair: #d97706;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 4px 14px rgba(22, 25, 29, 0.10);
  --hero-1: #121a2b; --hero-2: #121a2b; --hero-3: #121a2b;
  --hero-text: #f2f4f7; --hero-dim: #b3bac6;
  --radius: 4px;
  --radius-sm: 3px;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111418; --surface: #171b21; --surface-2: #1d2229; --surface-3: #252b33;
    --border: #2b313a; --border-strong: #3a424d;
    --text: #e8eaed; --text-dim: #a9b0ba; --muted: #808893;
    --brand: #8fb0f5; --brand-strong: #a9c2f8; --brand-soft: #1d2638; --brand-ink: #b8cdf9; --brand-solid: #2f5fcb;
    --output: #fbbf24; --output-fill: #f59e0b; --output-soft: #2d2412;
    --check: #2dd4bf; --check-fill: #14b8a6; --check-soft: #0f2c2e;
    --zero: #2a3558;
    --good: #7fc79e; --good-soft: #18261f;
    --violet: #a9b0ba; --violet-soft: #252b33;
    --amber-soft: #2d2412; --amber-ink: #fcd34d;
    --stair: #fbbf24;
    --shadow-sm: none; --shadow: none; --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.45);
    --hero-1: #0c1119; --hero-2: #0c1119; --hero-3: #0c1119;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111418; --surface: #171b21; --surface-2: #1d2229; --surface-3: #252b33;
  --border: #2b313a; --border-strong: #3a424d;
  --text: #e8eaed; --text-dim: #a9b0ba; --muted: #808893;
  --brand: #8fb0f5; --brand-strong: #a9c2f8; --brand-soft: #1d2638; --brand-ink: #b8cdf9; --brand-solid: #2f5fcb;
  --output: #fbbf24; --output-fill: #f59e0b; --output-soft: #2d2412;
  --check: #2dd4bf; --check-fill: #14b8a6; --check-soft: #0f2c2e;
  --zero: #2a3558;
  --good: #7fc79e; --good-soft: #18261f;
  --violet: #a9b0ba; --violet-soft: #252b33;
  --amber-soft: #2d2412; --amber-ink: #fcd34d;
  --stair: #fbbf24;
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.45);
  --hero-1: #0c1119; --hero-2: #0c1119; --hero-3: #0c1119;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
p { margin: 0 0 14px; }
h1 { font: 600 36px/1.15 var(--serif); letter-spacing: -0.01em; margin: 0 0 8px; }
h2 { font: 600 25px/1.3 var(--serif); letter-spacing: -0.005em; margin: 52px 0 8px; }
h3 { font: 600 14px/1.35 var(--sans); margin: 24px 0 10px; color: var(--text); }
.lede { font: 19px/1.55 var(--serif); color: var(--text-dim); max-width: 68ch; }
.muted { color: var(--text-dim); }
.small { font-size: 13.5px; }
.section-intro { color: var(--text-dim); font: 16.5px/1.6 var(--serif); margin: 0 0 18px; max-width: 76ch; }
/* prose reads in the serif; tables, controls and labels stay in the sans */
.prose, .panel > p, .panel li, figure.plot figcaption, .about-grid p, .about-grid li, footer.site p,
.hero-matrix figcaption { font-family: var(--serif); }
.prose { font-size: 16.5px; line-height: 1.65; }
.panel > p, .panel li { font-size: 15.5px; line-height: 1.6; }
.panel > p.small, .panel li.small, .about-grid .small, ul.plain.small li { font-size: 15px; }

/* ---------------------------------------------------------------- maths */
.katex { font-size: 1.1em; line-height: 1.2; }
td .katex, th .katex, .pill .katex, .tag .katex, .filters .katex { font-size: 1.04em; }
.head-stat .v .katex { font-size: 1em; }
.katex-display { margin: 0.6em 0; }
.tex-fallback { font-family: var(--serif); font-style: italic; }

.inner { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
main { max-width: 1200px; margin: 0 auto; padding: 8px 28px 80px; }
main.wide { max-width: 1440px; }

/* ------------------------------------------------------- accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
           overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 60; background: var(--surface);
        padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- header */
header.site {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--hero-1) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
header.site .inner { display: flex; align-items: center; gap: 22px; height: 60px; max-width: 1440px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 600;
         font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; color: #fff; }
.brand .sub { color: var(--hero-dim); font-weight: 500; }
.nav-search { flex: 1; max-width: 360px; position: relative; }
.nav-search input {
  width: 100%; font: inherit; font-size: 13.5px; color: #fff; padding: 7px 12px 7px 34px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius); outline: none; transition: background .15s, border-color .15s;
}
.nav-search input::placeholder { color: #aab2d6; }
.nav-search input:focus { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); }
.nav-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
                  width: 15px; height: 15px; color: #aab2d6; pointer-events: none; }
header.site nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
header.site nav a { color: #c3cad6; font-size: 14px; font-weight: 500; padding: 6px 11px; border-radius: var(--radius); }
header.site nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
header.site nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.12); }
header.site nav a.gh { display: inline-flex; align-items: center; gap: 6px; }
header.site nav a.gh svg { width: 16px; height: 16px; }
#theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: 6px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius); cursor: pointer; color: #dfe3ea; padding: 0;
}
#theme-toggle:hover { background: rgba(255, 255, 255, 0.14); }
#theme-toggle svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; color: var(--hero-text); background: var(--hero-1); padding: 56px 0 64px;
        border-bottom: 1px solid #000; }
.hero .inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
               gap: 56px; align-items: center; max-width: 1200px; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--hero-dim); margin: 0 0 14px; letter-spacing: 0.02em; }
.hero h1 { font: 600 50px/1.08 var(--serif); letter-spacing: -0.015em; color: #fff; margin-bottom: 18px; }
.hero .lede { color: var(--hero-dim); font-size: 19px; max-width: 54ch; }
.hero .lede strong { color: #fff; font-weight: 600; }

.searchbar { display: flex; gap: 8px; margin: 22px 0 12px; max-width: 760px; position: relative; }
.searchbar .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
                   width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.searchbar input {
  flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 10px 14px 10px 42px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); outline: none;
}
.searchbar input:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.searchbar.big input { font-size: 16px; padding: 13px 16px 13px 44px; border-color: transparent; }
.searchbar.big .btn { padding: 0 24px; font-size: 15px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 0; font-size: 13.5px; }
.quick .label { color: var(--hero-dim); margin-right: 2px; }
.quick a { color: #dfe4ec; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3);
           text-underline-offset: 3px; }
.quick a:hover { color: #fff; text-decoration-color: #fff; }

/* the hero's live matrix: the 15-to-1 factory, drawn from its own record */
.hero-matrix { margin: 0; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.12);
               border-radius: var(--radius); padding: 16px 16px 12px; }
.hero-matrix .hm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
                        font-size: 12.5px; color: var(--hero-dim); margin-bottom: 12px; }
.hero-matrix .hm-head strong { color: #fff; font-family: var(--mono); font-size: 13.5px; font-weight: 500; }
.hero-matrix svg { width: 100%; height: auto; display: block; }
.hero-matrix .cell-out { fill: #e8a33d; }
.hero-matrix .cell-chk { fill: #4fb3a6; }
.hero-matrix .cell-zero { fill: rgba(255, 255, 255, 0.07); }
.hero-matrix .rowlab { fill: #9aa3b2; font: 400 10.5px var(--mono); }
.hero-matrix .rowlab.o { fill: #e8a33d; }
.hero-matrix .rowlab.c { fill: #4fb3a6; }
.hero-matrix figcaption { font-size: 12.5px; color: var(--hero-dim); margin-top: 12px; line-height: 1.55; }
.hero-matrix figcaption .k-out { color: #e8a33d; font-weight: 600; }
.hero-matrix figcaption .k-chk { color: #4fb3a6; font-weight: 600; }
.hero-matrix figcaption a { color: #c9d6f2; }

/* the headline figures: one row, hairline dividers */
.stats-wrap { margin-top: 0; }
.statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0;
           border-bottom: 1px solid var(--border); }
.statbar .stat { padding: 20px 20px 18px 0; }
.statbar .stat + .stat { padding-left: 20px; border-left: 1px solid var(--border); }
.statbar .value { font: 400 26px/1.2 var(--serif); display: block; font-variant-numeric: lining-nums; }
.statbar .label { font-size: 13px; color: var(--text-dim); }
main .statbar { border: 1px solid var(--border); border-radius: var(--radius); }
main .statbar .stat { padding-left: 18px; }

/* -------------------------------------------------------- explore links */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
         border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
a.tile { display: block; padding: 14px 16px; color: var(--text); border-right: 1px solid var(--border);
         border-bottom: 1px solid var(--border); background: var(--surface); }
a.tile:hover { text-decoration: none; background: var(--surface-2); }
a.tile:hover .t { color: var(--brand); }
.tile .ico { display: none; }
.tile .t { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; font-size: 15px; }
.tile .c { font: 500 14px var(--mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tile .s { display: block; font-size: 13px; color: var(--text-dim); line-height: 1.45; margin-top: 3px; }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
       font: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.3; padding: 6px 12px;
       border-radius: var(--radius); cursor: pointer; color: var(--text); background: var(--surface);
       border: 1px solid var(--border-strong); }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--brand-solid); border-color: var(--brand-solid); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.hero .btn.primary { background: #3b6fe0; border-color: #3b6fe0; }
.hero .btn.primary:hover { background: #2f5fcb; }
.linkish { background: none; border: none; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.linkish:hover { text-decoration: underline; }

/* ----------------------------------------------------- page header band */
.page-head { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 24px 0 20px; margin-bottom: 24px; }
.page-head .inner { max-width: 1440px; }
.page-head.narrow .inner { max-width: 1200px; }
.page-head h1 { font-size: 34px; }
.page-head .lede { margin-bottom: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted);
          margin-bottom: 10px; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--brand); }
.crumbs > span + span::before { content: "›"; margin: 0 8px; opacity: 0.6; }
.crumbs .mono { font-size: 12.5px; }

/* ---------------------------------------------------------------- tables */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.toolbar input[type="search"], .toolbar select, select.plain {
  font: inherit; font-size: 13.5px; padding: 7px 11px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
}
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.toolbar .count { margin-left: auto; font-size: 13.5px; color: var(--text-dim); }
.toolbar .spacer { flex: 1; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--text); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
thead th {
  position: sticky; top: 0; background: var(--surface); text-align: left;
  font: 600 12.5px/1.4 var(--sans); color: var(--text-dim); padding: 11px 14px;
  border-bottom: 1px solid var(--border-strong); white-space: nowrap; cursor: pointer; user-select: none;
}
thead th:hover { color: var(--text); }
thead th.nosort { cursor: default; }
thead th .arrow { opacity: 0.35; margin-left: 4px; font-size: 11px; }
thead th[aria-sort="ascending"], thead th[aria-sort="descending"] { color: var(--brand-ink); }
thead th[aria-sort="ascending"] .arrow, thead th[aria-sort="descending"] .arrow { opacity: 1; color: var(--brand); }
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; transition: background .1s; }
tbody tr.clickable:hover { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
tbody tr.clickable:hover td.params a, tbody tr.clickable:hover td.gate a { text-decoration: underline; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
td.num { font-size: 14px; }
td.gate { font-size: 14px; min-width: 230px; overflow-wrap: normal; word-break: normal; }
td.gate a { color: var(--text); }
td.params { white-space: nowrap; font-size: 14px; }
td.cites { white-space: nowrap; color: var(--text-dim); }
.empty { padding: 44px 16px; text-align: center; color: var(--text-dim); }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500;
       padding: 1px 7px; border-radius: var(--radius-sm); white-space: nowrap; line-height: 1.5;
       background: var(--surface-3); color: var(--text-dim); border: 1px solid transparent; }
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.tag.exact { background: var(--good-soft); color: var(--good); }
.tag.floor { background: var(--surface-3); color: var(--text-dim); border-color: var(--border-strong); }
.tag.pure { background: var(--amber-soft); color: var(--amber-ink); }
.tag.ai { background: var(--violet-soft); color: var(--violet); }
.tag.pre { background: var(--brand-soft); color: var(--brand-ink); }
.tag.cert { background: transparent; color: var(--text-dim); border: 1px dashed var(--border-strong); }
.cert-mark { color: var(--text-dim); margin-left: 1px; }
.cert-d { color: var(--text-dim); font-size: 12.5px; }
a.tag:hover { text-decoration: none; border-color: var(--brand); }

.pager { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; margin: 16px 0 0; }
.pager button { font: inherit; font-size: 13px; min-width: 36px; height: 34px; padding: 0 10px;
                border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
                color: var(--text); cursor: pointer; }
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager .gap { color: var(--muted); padding: 0 4px; }

/* --------------------------------------------------------------- search */
.syntax { margin: 0 0 6px; max-width: 760px; font-size: 13.5px; color: var(--text-dim); }
.syntax summary { cursor: pointer; display: inline-block; color: var(--brand); font-weight: 500; }
.syntax-table { width: auto; font-size: 13px; margin: 10px 0 6px; background: var(--surface);
                border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.syntax-table td { padding: 6px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.syntax-table tr:last-child td { border-bottom: none; }
.syntax-table code { white-space: nowrap; margin-right: 4px; color: var(--brand-ink);
                     background: var(--brand-soft); padding: 1px 5px; border-radius: 4px; }
.notes { margin: 6px 0 0; } .notes:empty { display: none; }
.search-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 24px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
           padding: 14px 16px 16px; position: sticky; top: 76px;
           max-height: calc(100vh - 92px); overflow-y: auto; }
.filters > summary { font-weight: 600; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.filters fieldset { border: none; margin: 14px 0 0; padding: 0; }
.filters legend { font-size: 12.5px; font-weight: 600; color: var(--text-dim);
                  padding: 0; margin-bottom: 8px; }
.filters .range { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 13px; color: var(--text-dim); }
.filters .range label { min-width: 22px; font: 600 13px var(--mono); color: var(--text); }
.filters .range label.wide { min-width: 72px; font-family: var(--sans); font-weight: 500; }
.filters input[type="number"], .filters select {
  font: inherit; font-size: 13px; padding: 6px 9px; color: var(--text); width: 100%; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; }
.filters input[type="number"]:focus, .filters select:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.filters .range input { flex: 1; width: 70px; }
.filters .stack { display: block; font-size: 12px; color: var(--muted); margin: 8px 0; font-weight: 600; }
.filters .stack select { margin-top: 4px; font-weight: 400; }
/* toggle pills: a real checkbox inside a label, drawn as a chip */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
label.pill { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
             font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: var(--radius-sm);
             background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
             transition: background .12s, border-color .12s, color .12s; user-select: none; }
label.pill:hover { border-color: var(--border-strong); color: var(--text); }
label.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
label.pill:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
label.pill:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
label.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
label.pill .sym { font: 600 11px var(--mono); }
.results { min-width: 0; }
.results .toolbar .count { margin-left: 0; font-size: 14.5px; color: var(--text); }
.results .toolbar .count strong { font-size: 17px; }

/* ------------------------------------------------------------ landmarks */
.headline { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 18px 0 8px;
            border: 1px solid var(--border); border-radius: var(--radius); }
.head-stat { padding: 18px 20px; }
.head-stat + .head-stat { border-left: 1px solid var(--border); }
.head-stat .t { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.head-stat .v { display: block; font: 400 27px/1.2 var(--serif); color: var(--text); }
.head-stat .l { display: inline-block; font-size: 15px; margin-top: 6px; }
.head-stat .n { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }

.records { display: grid; margin: 0 0 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
           border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
a.record { display: block; padding: 14px 16px; color: var(--text); background: var(--surface);
           border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
a.record:hover { text-decoration: none; background: var(--surface-2); }
a.record .d { display: block; font-size: 14px; color: var(--text-dim); }
a.record .g { display: block; font: 400 19px/1.3 var(--serif); margin: 4px 0 2px; }
a.record .p { display: block; font-size: 14.5px; color: var(--brand); }
a.record .meta { display: block; font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }

/* ------------------------------------------------------------- the plot */
figure.plot { position: relative; margin: 12px 0 0; }
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
          border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.panels svg { display: block; width: 100%; height: auto; border-right: 1px solid var(--border);
              border-bottom: 1px solid var(--border); background: var(--surface); padding: 4px 2px 0; }
figure.plot figcaption { padding: 10px 0 0; font-size: 13px; color: var(--text-dim); line-height: 1.7; max-width: 100ch; }
.plot .grid, .panels .grid { stroke: var(--border); stroke-width: 1; }
.panels .axis { stroke: var(--border-strong); stroke-width: 1; }
.panels .tick { stroke: var(--border-strong); stroke-width: 1; }
.panels .ax { fill: var(--muted); font: 10.5px var(--sans); font-variant-numeric: tabular-nums; }
.panels .ptitle { fill: var(--text); font: 15px KaTeX_Main, var(--serif); }
.panels .mi { font-family: KaTeX_Math, var(--serif); font-style: italic; }
.panels .psub { fill: var(--text-dim); font: 11px var(--sans); }
.panels .atitle { fill: var(--text-dim); font: 12px var(--sans); }
.panels .atitle .mi { font-size: 14px; }
.panels .atitle .asub { font-size: 10px; }
.panels .unity { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.panels .stair { fill: none; stroke: var(--brand); stroke-width: 1.75; }
.panels .pt { fill: var(--muted); opacity: 0.55; }
.panels .pt.front { fill: var(--brand); opacity: 1; }
.panels .pt.clipped { fill: none; stroke: var(--muted); stroke-width: 1; opacity: 0.8; }
.panels .pt.hot { opacity: 1; stroke: var(--text); stroke-width: 1.5; }
.key { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; color: var(--text); }
.key .key-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: 0.7; }
.key .stair-key { width: 18px; height: 0; border-top: 2px solid var(--brand); }
.key .unity-key { width: 18px; height: 0; border-top: 1px dashed var(--muted); }
.plot-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 150px;
            background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
            border-radius: var(--radius); padding: 7px 10px; font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow-lg);
            transform: translate(-50%, calc(-100% - 10px)); opacity: 0; }
.plot-tip.on { opacity: 1; }
.plot-tip b { font-weight: 400; }
.plot-tip .row { display: flex; justify-content: space-between; gap: 14px; color: var(--text-dim); }
.plot-tip .row span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }
.plot-tip .hint { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* ------------------------------------------------------------------ matrix */
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: 13px;
          color: var(--text-dim); margin: 0 0 12px; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; white-space: nowrap; }
.legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; }
.swatch.out { background: var(--output-fill); }
.swatch.chk { background: var(--check-fill); }
.matrix-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; }
.seg button { font: inherit; font-size: 12.5px; font-weight: 500; border: none; background: none; color: var(--text-dim);
              padding: 3px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.matrix-wrap {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  overflow: auto; max-height: 72vh; position: relative; width: fit-content; max-width: 100%;
}
table.matrix { border-collapse: separate; border-spacing: 0; width: max-content; font-family: var(--mono); font-size: 12px; }
table.matrix th.rowlab {
  position: sticky; left: 0; z-index: 3; background: var(--surface);
  border-right: 1px solid var(--border-strong); padding: 0 12px 0 14px;
  text-align: left; white-space: nowrap; font-weight: 500; line-height: 1.5; font-size: 11.5px;
}
table.matrix thead th { position: sticky; top: 0; z-index: 4; background: var(--surface-2);
                        padding: 4px 0; font-size: 10px; color: var(--muted); cursor: default; }
table.matrix thead th.rowlab { z-index: 5; }
table.matrix tr.out th.rowlab { color: var(--output); background: var(--output-soft); }
table.matrix tr.chk th.rowlab { color: var(--check); background: var(--check-soft); }
table.matrix tr.divider th, table.matrix tr.divider td { border-top: 2px solid var(--border-strong); }
td.bits { padding: 0 10px; white-space: pre; line-height: 1.5; letter-spacing: 0; }
td.bits i { font-style: normal; color: var(--zero); }
td.bits b { font-weight: 600; }
tr.out td.bits b { color: var(--output); }
tr.chk td.bits b { color: var(--check); }
/* "cells" view: every 1 is a filled square, every 0 a faint one -- one glyph
 * per column, so the squares line up with the ruler.  The digits are still in
 * the DOM (transparent), so copy-paste and the verifier read the same bits. */
.matrix-wrap.cells td.bits b, .matrix-wrap.cells td.bits i {
  color: transparent;
  background-image: linear-gradient(90deg, var(--cell) calc(100% - 2px), transparent 0);
  background-size: 1ch 78%; background-position: 0 50%; background-repeat: repeat-x;
}
.matrix-wrap.cells tr.out td.bits b { --cell: var(--output-fill); }
.matrix-wrap.cells tr.chk td.bits b { --cell: var(--check-fill); }
.matrix-wrap.cells td.bits i { --cell: color-mix(in srgb, var(--zero) 55%, transparent); }
.ruler { color: var(--muted); white-space: pre; line-height: 1.4; letter-spacing: 0; padding: 1px 10px; font-size: 10px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
           border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.metrics .cell { background: var(--surface); padding: 14px 16px; border-right: 1px solid var(--border);
                 border-bottom: 1px solid var(--border); }
.metrics .cell.key-metric { background: var(--surface-2); }
.metrics .k { font-size: 12.5px; font-weight: 600; color: var(--text-dim); display: block; margin-bottom: 4px; }
.metrics .v { font: 400 22px/1.2 var(--serif); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.metrics .v.none { color: var(--muted); font-weight: 500; font-size: 14px; }
.metrics .note { display: block; margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--text-dim); }

.panel { padding: 0; }
.panel + .panel { margin-top: 14px; }
.panel > :last-child { margin-bottom: 0; }
ol.refs { margin: 0; padding-left: 22px; font-size: 14px; }
ol.refs li { margin-bottom: 10px; }
ol.refs li::marker { color: var(--text-dim); }
pre.raw { margin: 0; padding: 14px; overflow-x: auto; font-size: 12px;
          background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
details > summary { cursor: pointer; font-size: 13.5px; color: var(--brand); font-weight: 500; }
details[open] > summary { margin-bottom: 10px; }
/* a long list folded mid-sentence: the summary reads as part of the text */
details.inline { display: inline; }
details.inline > summary { display: inline; font-size: inherit; }
details.inline[open] > summary { margin-bottom: 0; }
.matrix-skip { margin: 0; padding: 14px 16px; color: var(--text-dim); }
code.wrap { word-break: break-all; white-space: normal; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.jump a { font-size: 13.5px; font-weight: 500; color: var(--text-dim); padding: 2px 0; margin-right: 14px; }
.jump a:hover { color: var(--brand); }
.toolbar.export { margin: 14px 0 10px; }
.toolbar.export .label { font-size: 13px; color: var(--text-dim); font-weight: 600; margin-right: 2px; }
.gate-terms { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.gate-terms .term { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-sm);
                    background: var(--surface-2); border: 1px solid var(--border); }
.gate-terms .term b { font-family: var(--mono); }

.error { border: 1px solid color-mix(in srgb, var(--output) 50%, var(--border)); background: var(--output-soft);
         color: var(--text); border-radius: var(--radius); padding: 18px 20px; }
.error h2 { margin-top: 0; }

/* ----------------------------------------------------------------- about */
.prose { max-width: 84ch; }
dl.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 16px 0 18px; font-size: 14px; }
dl.glossary dt { color: var(--text); }
dl.glossary dd { font-family: var(--serif); font-size: 15.5px; }
dl.glossary dd { margin: 0; color: var(--text-dim); }
.about-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.about-grid .panel + .panel { margin-top: 0; }
.about-grid h3 { margin-top: 0; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.about-grid h3 .ico { display: none; }
ul.plain { margin: 0 0 10px; padding-left: 18px; font-size: 14px; }
ul.plain li { margin-bottom: 6px; }
ul.plain li::marker { color: var(--brand); }

/* ---------------------------------------------------------------- footer */
footer.site { margin-top: 70px; background: var(--hero-1); color: #a3abb8; font-size: 13.5px; padding: 40px 0 34px; }
footer.site .inner { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; max-width: 1200px; }
footer.site h4 { color: #fff; font-size: 13.5px; margin: 0 0 10px; font-weight: 600; }
footer.site a { color: #c3cad6; }
footer.site a:hover { color: #fff; }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin-bottom: 6px; }
footer.site .brand { margin-bottom: 10px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .hero .inner { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 36px; }
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  footer.site .inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .inner, main { padding-left: 16px; padding-right: 16px; }
  header.site .inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 8px 12px; }
  .nav-search { order: 3; flex-basis: 100%; max-width: none; }
  header.site nav { gap: 0; }
  header.site nav a { padding: 6px 8px; font-size: 13.5px; }
  header.site nav a.gh span { display: none; }
  .hero { padding: 36px 0 44px; }
  .hero h1 { font-size: 30px; }
  .searchbar.big .btn { padding: 0 16px; }
  h1, .page-head h1 { font-size: 26px; }
  h2 { font-size: 20px; margin-top: 40px; }
  dl.glossary { grid-template-columns: 1fr; gap: 2px; }
  dl.glossary dd { margin-bottom: 10px; }
  .toolbar .count { margin-left: 0; width: 100%; }
  footer.site .inner { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  header.site nav a { padding: 6px 7px; }
  header.site nav a.gh { display: none; }  /* the footer links to GitHub */
}

/* ------------------------------------------------- video (about page) */
figure.video { margin: 8px 0 8px; }
figure.video iframe, .video-facade { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0;
  border-radius: var(--radius); background: #000; }
.video-facade { position: relative; overflow: hidden; border: 1px solid var(--border); }
.video-facade img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-facade .play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: rgba(22, 25, 29, 0.82); border-radius: var(--radius); }
.video-facade .play svg { width: 28px; height: 28px; }
.video-facade:hover .play, .video-facade:focus-visible .play { background: var(--brand-solid); }
figure.video figcaption { margin-top: 8px; font-size: 14px; color: var(--text-dim); }
.hero-video { margin: 14px 0 0; font-size: 14.5px; }
.hero-video a { display: inline-flex; align-items: baseline; gap: 6px; color: #dfe4ec; line-height: 1.5; }
.hero-video a:hover { color: #fff; }
.hero-video svg { width: 14px; height: 14px; flex: none; position: relative; top: 2px; }

/* ------------------------------------------------- contribute: submission form */
.submit-form { display: grid; gap: 6px; margin: 12px 0 24px; padding: 16px; max-width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.submit-form label { font: 600 13.5px var(--sans); color: var(--text); margin-top: 4px; }
.submit-form input[type="text"], .submit-form textarea { font: 15px/1.5 var(--sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 8px 10px; width: 100%; box-sizing: border-box; min-width: 0; }
.submit-form textarea { resize: vertical; }
.submit-form input:focus, .submit-form textarea:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand); }
.submit-form p { margin: 0; }

/* ------------------------------------------------- CNOT + S transform panel */
.tf-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.tf-row input { flex: 1 1 280px; min-width: 0; font: 14px var(--mono); padding: 7px 10px; color: var(--text);
                background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.tf-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.tf-msg.bad { color: var(--output); font-size: 13.5px; }
.tf-verdict { font-size: 14.5px; margin: 4px 0 12px; }
.tf-verdict strong { margin-right: 4px; }
.tf-all { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.tf-all p { margin: 0 0 10px; }
.source-list li { margin-bottom: 8px; }
.ref-list li { margin-bottom: 12px; overflow-wrap: anywhere; }
.people { list-style: none; padding: 0; margin: 8px 0 28px; display: grid;
          grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 28px; }
.person { display: flex; gap: 14px; align-items: flex-start; margin: 0; }
.person img, .person .initials { flex: none; width: 72px; height: 72px; object-fit: cover;
                                 border: 1px solid var(--border); border-radius: var(--radius); }
.person .initials { display: flex; align-items: center; justify-content: center;
                    background: var(--surface-2); color: var(--text-dim); font: 500 22px var(--sans); }
.person div { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; min-width: 0; }
.person .role { font-size: 13px; color: var(--brand-ink); }
.tf-verdict.ok strong { color: var(--good); }
.tf-verdict.no strong { color: var(--output); }
.tf-verdict.maybe strong { color: var(--text-dim); }
.tf-verdict code, #tf-elsewhere code { font-size: 12.5px; word-break: break-all; }
.circ-wrap { overflow-x: auto; margin: 4px 0 10px; border: 1px solid var(--border); border-radius: var(--radius);
             padding: 8px 10px; background: var(--surface); }
.circ { display: block; max-width: none; height: auto; }
.circ .cw { stroke: var(--border-strong); stroke-width: 1; }
.circ .cw-l { fill: var(--text-dim); font: 10.5px var(--mono); }
.circ .cv { stroke: var(--text); stroke-width: 1.3; }
.circ .cdot { fill: var(--text); }
.circ .ctarget { fill: var(--surface); stroke: var(--text); stroke-width: 1.3; }
.circ .cbox { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
.circ .cbox-l { fill: var(--text); font: 600 10.5px var(--mono); }
.tf-gates { line-height: 2; }
.tf-gates code.g { font-size: 12px; padding: 1px 6px; background: var(--surface-2); border: 1px solid var(--border);
                   border-radius: var(--radius-sm); white-space: nowrap; }
.tf-check { margin-top: 6px; }

/* the hero's submission form: the contribute page's form in one line */
.quick-submit { margin-top: 26px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12); max-width: 760px; }
.quick-submit p { margin: 0 0 10px; font: 16px/1.5 var(--serif); color: var(--hero-text); }
.quick-submit p strong { color: #fff; font-weight: 600; }
.qs-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) auto; gap: 8px; }
.qs-row input { min-width: 0; font: 15px var(--sans); color: var(--text); background: var(--surface);
                border: 1px solid transparent; border-radius: var(--radius); padding: 9px 12px; }
.qs-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.qs-row .btn { padding: 0 20px; }
.quick-submit .qs-note { margin: 8px 0 0; font: 13.5px/1.5 var(--sans); color: var(--hero-dim); }
.qs-note a { white-space: nowrap; color: #dfe4ec; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3);
             text-underline-offset: 3px; }
.qs-note a:hover { color: #fff; text-decoration-color: #fff; }
@media (max-width: 760px) { .qs-row { grid-template-columns: 1fr; } .qs-row .btn { padding: 10px 20px; } }

/* ------------------------------------------------------- factory pages */
.label-h { font-family: var(--mono); font-weight: 500; letter-spacing: -0.01em; }
.page-head .gate-lede { margin: 2px 0 14px; color: var(--text); font-size: 20px; }
dl.summary { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 6px 0 0; padding: 12px 0 0;
             border-top: 1px solid var(--border); }
dl.summary div { min-width: 90px; }
dl.summary dt { font-size: 12.5px; color: var(--text-dim); margin-bottom: 2px; }
dl.summary dd { margin: 0; font-size: 16px; font-variant-numeric: tabular-nums; }
.entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.entry-main > h2:first-child { margin-top: 8px; }
aside.side { position: sticky; top: 80px; font-size: 14px; padding-top: 14px; }
aside.side section { padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
aside.side section:last-child { border-bottom: 0; }
aside.side h3 { margin: 0 0 8px; font: 600 14px var(--sans); }
aside.side h4 { margin: 12px 0 4px; font: 500 12.5px var(--sans); color: var(--text-dim); }
aside.side ul { list-style: none; margin: 0; padding: 0; }
aside.side li { margin: 3px 0; }
aside.side .related .katex { font-size: 1em; }
pre.bib { font: 11.5px/1.5 var(--mono); background: var(--surface-2); border: 1px solid var(--border);
          border-radius: var(--radius); padding: 10px; overflow-x: auto; white-space: pre; margin: 0 0 8px; }
td.lab { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
td.lab a { color: var(--brand); }

/* ------------------------------------------------------------ landing */

/* -------------------------------------------------------------- guide */
main.guide { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 48px; align-items: start; }
nav.toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; padding-top: 52px; }
nav.toc a { color: var(--text-dim); }
nav.toc a:hover { color: var(--brand); }
main.guide .prose { max-width: 68ch; min-width: 0; }  /* lets a wide <pre> scroll inside, not the page */
main.guide .prose p, main.guide .prose li { font-size: 16.5px; line-height: 1.65; }
main.guide h2:first-child { margin-top: 24px; }

@media (max-width: 1000px) {
  .entry-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  aside.side { position: static; border-top: 1px solid var(--border); margin-top: 32px; }
  main.guide { grid-template-columns: minmax(0, 1fr); gap: 0; }
  nav.toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; padding-top: 8px; }
}

table.reliability { margin: 8px 0 6px; font-size: 14.5px; }
table.reliability td { padding: 8px 12px 8px 0; vertical-align: top; }
table.reliability td:first-child { white-space: nowrap; }
table.reliability td:last-child { white-space: nowrap; color: var(--text-dim); }
pre.raw.code { font-size: 12.5px; line-height: 1.55; margin-bottom: 10px; }

/* -------------------------------------------------- search: chips, counts */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; min-height: 0; }
.chips:empty { display: none; }
button.chip { font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
              padding: 3px 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
              background: var(--surface-2); color: var(--text); }
button.chip:hover { border-color: var(--brand); }
button.chip span { color: var(--text-dim); }
.pill .cnt { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
label.pill.zero { opacity: 0.45; }
/* column chooser */
details.colpick { position: relative; }
details.colpick > summary { list-style: none; }
details.colpick > summary::-webkit-details-marker { display: none; }
.colpick-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 170px;
                background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
                padding: 8px 12px; box-shadow: var(--shadow-lg); }
.colpick-menu .check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 0; cursor: pointer; }
table.hide-params [data-col="params"] { display: none; }
table.hide-gate [data-col="gate"] { display: none; }
table.hide-N [data-col="N"] { display: none; }
table.hide-gamma_rho [data-col="gamma_rho"] { display: none; }
table.hide-gamma [data-col="gamma"] { display: none; }
table.hide-distance [data-col="distance"] { display: none; }
table.hide-found [data-col="found"] { display: none; }
table.hide-cited [data-col="cited"] { display: none; }
table.hide-tcount [data-col="tcount"] { display: none; }
/* inline matrix preview */
button.peek { font: inherit; font-size: 11px; width: 18px; height: 18px; margin-right: 6px; padding: 0; cursor: pointer;
              border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
              color: var(--text-dim); vertical-align: 1px; transition: transform .1s; }
button.peek[aria-expanded="true"] { transform: rotate(90deg); }
tr.preview td { background: var(--surface-2); padding: 12px 14px; }
.preview-wrap { overflow-x: auto; max-width: 100%; margin-bottom: 6px; }
svg.mini-matrix { display: block; height: auto; }
svg.mini-matrix .cell-out { fill: var(--output-fill); }
svg.mini-matrix .cell-chk { fill: var(--check-fill); }
svg.mini-matrix .cell-zero { fill: var(--surface-3); }
tr.preview .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 8px; vertical-align: -1px; }

.plot-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.plot-bar .spacer { flex: 1; }
.plot-table { margin-top: 4px; }


/* the hidden attribute must win over any display rule (e.g. the panel grid) */
[hidden] { display: none !important; }
.best-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.best-head h2 { margin-bottom: 6px; }
.plot-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; align-items: start; }
.plot-table table { width: 100%; }
@media (max-width: 900px) { .plot-table { grid-template-columns: 1fr; } }

/* the landing page's summary of what the catalogue offers: a plain list in
 * three columns, hairlines only */
dl.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; margin: 0 0 44px; }
dl.features > div { padding: 14px 0 16px; border-top: 1px solid var(--border); }
dl.features dt { font-weight: 600; font-size: 14.5px; color: var(--text); margin-bottom: 4px; }
dl.features dd { margin: 0; font: 15.5px/1.55 var(--serif); color: var(--text-dim); }
@media (max-width: 900px) { dl.features { grid-template-columns: 1fr; } }
/* contribute.html: numbered steps */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 6px 40px; }
ol.steps > li > h2 { margin-top: 30px; position: relative; }
ol.steps > li > h2::before { content: counter(step); position: absolute; left: -40px; top: 0.1em; width: 26px; height: 26px;
  border: 1px solid var(--border); border-radius: var(--radius); font: 600 14px/24px var(--sans);
  text-align: center; color: var(--text-dim); }
