:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #5f5b53;
  --line: #e2ded5;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --row-hover: #f3f0e8;
  --tag-bg: #efe7d4;
  --tag-text: #5a4511;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416;
    --surface: #1b1d20;
    --text: #e9e7e2;
    --muted: #a5a199;
    --line: #2f3236;
    --accent: #7fb0ff;
    --accent-text: #0d1420;
    --row-hover: #23262a;
    --tag-bg: #3b321d;
    --tag-text: #f1d99b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  overflow-x: hidden;
}
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.92em; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); padding: 40px 0 28px; }
.kicker { margin: 0; color: var(--muted); font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
h1 { margin: 4px 0 10px; font-size: clamp(32px, 6vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
.lede { max-width: 70ch; margin: 0 0 18px; font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.coi { max-width: 80ch; margin: 0; color: var(--muted); font-size: 15px; }
.tag {
  display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--tag-bg); color: var(--tag-text);
  font-size: 12px; font-weight: 600; line-height: 1.6; vertical-align: 1px;
}

main section { padding: 32px 0 8px; }
h2 { font-size: 26px; margin: 0 0 14px; }
h3 { font-size: 19px; margin: 28px 0 6px; }
.note { margin: 6px 0; max-width: 90ch; }
.small { font-size: 14px; color: var(--muted); }

.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); min-width: 0; }
select {
  font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; max-width: 100%;
}
.modes { border: 0; margin: 0; padding: 0; min-width: 0; }
.modes legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-size: 14px; cursor: pointer;
}
.seg input { margin: 0; accent-color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent); }

.table-scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  margin: 12px 0 8px; max-width: 100%;
}
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
th { font-weight: 600; color: var(--muted); background: var(--surface); position: sticky; top: 0; }
th button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap;
}
th button[aria-sort]::after { content: " \2195"; opacity: 0.35; }
th button[aria-sort="ascending"]::after { content: " \2191"; opacity: 1; }
th button[aria-sort="descending"]::after { content: " \2193"; opacity: 1; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num a, td.ci a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
td.num a:hover, td.ci a:hover { color: var(--accent); }
td.id { font-family: var(--mono); font-size: 13px; }
td.why { white-space: normal; min-width: 8rem; max-width: 15rem; }
.unranked { color: var(--muted); }
.empty { padding: 16px; color: var(--muted); }

.method { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 8px 24px; margin: 16px 0; }
.method dt { font-weight: 600; }
.method dd { margin: 0; max-width: 75ch; }
@media (max-width: 640px) {
  .method { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .method dd { margin-bottom: 12px; }
  .top { padding-top: 28px; }
  .lede { font-size: 17px; }
}
.downloads { padding-left: 20px; }
.downloads li { margin: 4px 0; }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 32px; color: var(--muted); font-size: 14px; }
