:root {
  --accent: #4f8cff;
  --accent-dark: #1e4fa8;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-sunk: #eef0f4;
  --fg: #16181d;
  --fg-soft: #5b6472;
  --fg-faint: #8b94a3;
  --line: #dfe3ea;
  --ok: #1c7a4a;
  --warn: #9a6400;
  --bad: #b0243a;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-soft: #1b1e24;
    --bg-sunk: #23272f;
    --fg: #e8eaee;
    --fg-soft: #a3acbb;
    --fg-faint: #737d8d;
    --line: #2c313a;
    --ok: #4cc98a;
    --warn: #e0a94a;
    --bad: #f0768c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 650; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
small { font-size: .82rem; }
code, kbd { font-family: var(--mono); font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1rem; }
.wrap-narrow { max-width: 620px; margin: 0 auto; padding: 0 1rem; }

/* ── header ── */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.site-head .wrap { display: flex; align-items: center; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--fg); display: flex; align-items: center; gap: .5rem; }
.brand:hover { text-decoration: none; }
.brand .mark { font-size: 1.3rem; }
.site-nav { display: flex; gap: 1rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--fg-soft); font-size: .92rem; }
.site-nav a.active { color: var(--fg); font-weight: 600; }
.tagline { color: var(--fg-soft); font-size: .95rem; margin: .25rem 0 0; }

/* ── layout ── */
main { padding: 1.75rem 0 3rem; }
.page-head { margin-bottom: 1.5rem; }
.cols { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.side { position: sticky; top: 1rem; }
.side section { margin-bottom: 1.5rem; }
.side h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-faint); }

/* ── ranked list ── */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.rank-row.featured { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.rank-num { font-size: 1.4rem; font-weight: 700; color: var(--fg-faint); font-variant-numeric: tabular-nums; text-align: right; }
.rank-row.top-3 .rank-num { color: var(--accent); }
.rank-main h2 { font-size: 1.05rem; margin-bottom: .15rem; }
.rank-tagline { color: var(--fg-soft); font-size: .92rem; margin: 0 0 .4rem; }
.rank-meta { display: flex; flex-wrap: wrap; gap: .4rem .75rem; font-size: .82rem; color: var(--fg-faint); }
.rank-stats { text-align: right; font-size: .82rem; color: var(--fg-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-stats b { display: block; font-size: 1.05rem; color: var(--fg); font-weight: 650; }
.rank-delta { font-size: .78rem; }
.rank-delta.up { color: var(--ok); }
.rank-delta.down { color: var(--bad); }
.rank-delta.flat { color: var(--fg-faint); }
@media (max-width: 620px) {
  .rank-row { grid-template-columns: 2.4rem 1fr; }
  .rank-stats { grid-column: 2; text-align: left; display: flex; gap: 1rem; }
  .rank-stats b { display: inline; }
}

/* ── pills & badges ── */
.pill {
  display: inline-block;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--bg-sunk);
  color: var(--fg-soft);
  font-size: .78rem;
  white-space: nowrap;
}
.pill.accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-dark); }
@media (prefers-color-scheme: dark) { .pill.accent { color: var(--accent); } }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }

/* ── cards & panels ── */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: var(--bg-soft); }
.card + .card { margin-top: 1rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { padding: .7rem 1rem; background: var(--bg-soft); border-bottom: 1px solid var(--line); font-weight: 600; font-size: .92rem; }
.panel-body { padding: 1rem; }

/* ── notices ── */
.notice { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; border: 1px solid; font-size: .93rem; }
.notice.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.notice.bad { background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.notice.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.info { background: var(--bg-soft); border-color: var(--line); }
.notice p:last-child { margin-bottom: 0; }

/* ── forms ── */
.field { margin-bottom: 1.1rem; }
.field > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field .help { display: block; color: var(--fg-soft); font-size: .84rem; margin-top: .3rem; }
.field .err { display: block; color: var(--bad); font-size: .84rem; margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=search], select, textarea {
  width: 100%;
  padding: .55rem .65rem;
  font: inherit;
  font-size: .95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
textarea { min-height: 9rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.checks { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.checks label { display: flex; align-items: center; gap: .35rem; font-size: .92rem; font-weight: 400; }
.checks input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.25rem; }
legend { padding: 0 .4rem; font-weight: 650; font-size: .9rem; }

.btn {
  display: inline-block;
  padding: .5rem .9rem;
  font: inherit;
  font-size: .93rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-soft); filter: none; }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.small { padding: .3rem .6rem; font-size: .84rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ── tables ── */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-faint); font-weight: 650; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* ── listing detail ── */
.listing-head { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1.25rem; }
.listing-head .rank-badge {
  font-size: 2rem; font-weight: 700; color: var(--accent);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .5rem 1rem; text-align: center; line-height: 1.1;
}
.listing-head .rank-badge small { display: block; font-size: .68rem; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; background: var(--bg-soft); }
.stat b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .76rem; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .05em; }
.prose { max-width: 62ch; }
/* Only member-submitted text keeps its line breaks. Applying this to every
   .prose paragraph leaked the template's own source indentation onto the page. */
.user-text { white-space: pre-wrap; }
dl.spec { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .93rem; }
dl.spec dt { color: var(--fg-faint); }
dl.spec dd { margin: 0; }

/* ── sparkline chart ── */
.spark { display: block; width: 100%; height: 90px; }
.spark .bar { fill: var(--accent); opacity: .75; }
.spark .bar.b { fill: var(--fg-faint); opacity: .5; }

/* ── filters ── */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1.25rem; }
.filters .field { margin-bottom: 0; min-width: 140px; flex: 1 1 140px; }
.filters .field > label { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-faint); }
.active-filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* ── pagination ── */
.pager { display: flex; gap: .4rem; align-items: center; justify-content: center; margin: 1.5rem 0; flex-wrap: wrap; }
.pager a, .pager span { padding: .35rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); font-size: .9rem; }
.pager .current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
.pager .gap { border: 0; color: var(--fg-faint); }

/* ── vote button ── */
.vote-box { text-align: center; }
.vote-box .btn { width: 100%; padding: .7rem 1rem; font-size: 1rem; }
.vote-count { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.vote-note { font-size: .82rem; color: var(--fg-faint); margin-top: .5rem; }

/* ── footer ── */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 1.75rem 0; margin-top: 3rem; color: var(--fg-soft); font-size: .88rem; }
.site-foot .wrap { display: flex; gap: 1rem 2rem; flex-wrap: wrap; justify-content: space-between; }
.site-foot a { color: var(--fg-soft); text-decoration: underline; }

/* ── misc ── */
.muted { color: var(--fg-soft); }
.faint { color: var(--fg-faint); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt1 { margin-top: 1rem; } .mb1 { margin-bottom: 1rem; }
.mt2 { margin-top: 2rem; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--fg-faint); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem 1rem; z-index: 10; border: 2px solid var(--accent); border-radius: var(--radius); }
.embed-code { width: 100%; font-family: var(--mono); font-size: .8rem; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; min-height: 5rem; }

/* ── info site ─────────────────────────────────────────────────────────────── */

.wrap-text { max-width: 760px; margin: 0 auto; padding: 0 1rem; }
.prose-wide { max-width: 72ch; }

/* hero */
.hero { padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--line); }
.hero .kicker { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-faint); margin: 0 0 1rem; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); letter-spacing: -.02em; max-width: 18ch;
  margin-bottom: 1rem; }
.hero .lede { font-size: 1.15rem; color: var(--fg-soft); max-width: 58ch; margin-bottom: 1.5rem; }
.hero .lede strong { color: var(--fg); font-weight: 600; }

/* the private access band */
.band {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 1rem 1.15rem;
  font-size: .95rem;
}
.band h2, .band h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent-dark); margin-bottom: .35rem; }
@media (prefers-color-scheme: dark) { .band h2, .band h3 { color: var(--accent); } }
.band p:last-child { margin-bottom: 0; }

/* section rhythm */
.section { padding: 3rem 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section > .wrap > h2, .section > .wrap-text > h2 { font-size: 1.5rem; letter-spacing: -.01em; }
.section-lede { color: var(--fg-soft); max-width: 62ch; margin-bottom: 1.75rem; }
.eyebrow { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-faint); margin: 0 0 .5rem; }

/* generic grids */
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid .card { margin-top: 0; }
.grid .card h3 { margin-bottom: .35rem; }
.grid .card p:last-child { margin-bottom: 0; }

/* the receipt */
.receipt {
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.7;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--fg);
  margin: 0 0 1rem;
  tab-size: 2;
}
.receipt .em { color: var(--accent-dark); font-weight: 650; }
.receipt .dim { color: var(--fg-faint); }
/* The mid-blue accent is legible on a dark ground and thin on a light one, so
   the light theme takes the darker of the pair, as the pills already do. */
@media (prefers-color-scheme: dark) { .receipt .em { color: var(--accent); } }
.receipt-note { font-size: .88rem; color: var(--fg-soft); max-width: 62ch; }

/* the six stages */
.stages { list-style: none; margin: 0; padding: 0; counter-reset: stage; }
.stage { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem;
  padding: 1.4rem 0; border-top: 1px solid var(--line); }
.stage:last-child { border-bottom: 1px solid var(--line); }
.stage-num { font-family: var(--mono); font-size: 1.4rem; font-weight: 700;
  color: var(--fg-faint); line-height: 1.2; }
.stage h3 { margin-bottom: .3rem; display: flex; align-items: baseline;
  gap: .6rem; flex-wrap: wrap; }
.stage p { margin-bottom: .6rem; max-width: 68ch; }
.stage p:last-child { margin-bottom: 0; }
.stage .formula { font-family: var(--mono); font-size: .86rem; background: var(--bg-sunk);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .7rem;
  display: inline-block; margin-bottom: .6rem; }
@media (max-width: 620px) { .stage { grid-template-columns: 1fr; gap: .3rem; } }

/* network cards */
.net { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-soft); }
.net-head { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--net-accent, var(--accent)); }
.net-head h3 { margin-bottom: .2rem; display: flex; align-items: center; gap: .5rem; }
.net-head .mark { font-size: 1.15rem; }
.net-head p { font-size: .9rem; color: var(--fg-soft); margin: 0; }
.net-body { padding: .9rem 1.1rem; }
.net-body dl.spec { font-size: .86rem; margin-bottom: .75rem; }
.net-cats { display: flex; flex-wrap: wrap; gap: .3rem; }
.net-cats .pill { font-size: .74rem; }

/* key/value spec strips */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.kv > div { background: var(--bg-soft); padding: .7rem .85rem; }
.kv b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums;
  font-weight: 650; line-height: 1.3; }
.kv span { font-size: .74rem; color: var(--fg-faint); text-transform: uppercase;
  letter-spacing: .05em; }

/* layered config stack */
.stack { list-style: none; margin: 0 0 1rem; padding: 0; font-family: var(--mono);
  font-size: .85rem; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; }
.stack li { padding: .6rem .85rem; border-bottom: 1px solid var(--line);
  display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap;
  background: var(--bg-soft); }
.stack li:last-child { border-bottom: 0; }
.stack .what { color: var(--fg-soft); font-family: var(--sans); font-size: .84rem; }

/* info-site header and footer tweaks */
.site-head .site-nav a.here { color: var(--fg); font-weight: 600; }
.site-foot .cols-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem; width: 100%; }
.site-foot h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--fg-faint); margin-bottom: .4rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: .25rem; }

/* misc */
.lead-in { font-size: 1.05rem; color: var(--fg-soft); }
.tick { list-style: none; margin: 0 0 1rem; padding: 0; }
.tick li { padding-left: 1.4rem; position: relative; margin-bottom: .45rem; }
.tick li::before { content: "+"; position: absolute; left: 0; top: 0;
  font-family: var(--mono); color: var(--accent); font-weight: 700; }
.no li::before { content: "-"; color: var(--fg-faint); }