  /* Light is the default; dark applies via system preference or an explicit choice. */
  :root {
    --bg: #ffffff;
    --panel: #fafafa;
    --line: #e6e6ea;
    --text: #141416;
    --muted: #61616b;
    --accent: #12a150;
    --gold: #d97706;
    --stripe: rgba(0,0,0,.035);
    --btn-text: #ffffff;
    --input-bg: #ffffff;
    --header-bg: rgba(255,255,255,.85);
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0b0b0c;
      --panel: #131316;
      --line: #232329;
      --text: #ececed;
      --muted: #8b8b95;
      --accent: #35d07f;
      --gold: #f0b429;
      --stripe: rgba(255,255,255,.02);
      --btn-text: #06210f;
      --input-bg: #08080a;
      --header-bg: rgba(11,11,12,.86);
    }
  }
  :root[data-theme="dark"] {
    --bg: #0b0b0c;
    --panel: #131316;
    --line: #232329;
    --text: #ececed;
    --muted: #8b8b95;
    --accent: #35d07f;
    --gold: #f0b429;
    --stripe: rgba(255,255,255,.02);
    --btn-text: #06210f;
    --input-bg: #08080a;
    --header-bg: rgba(11,11,12,.86);
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  a { color: var(--accent); }
  .wrap { max-width: 864px; margin: 0 auto; padding: 0 20px; }

  header {
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    z-index: 10;
  }
  header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
  .brand {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-weight: 600; letter-spacing: -.02em;
    color: var(--text); text-decoration: none;
  }
  .brand svg { width: 19px; height: 19px; display: block; flex: none; }
  .brand .b1 { fill: var(--muted); }
  .brand .b2 { fill: var(--accent); }
  .brand .b3 { fill: var(--gold); }
  nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
  nav a { color: var(--muted); text-decoration: none; }
  nav a:hover { color: var(--text); }
  @media (max-width: 560px) { nav a.hide-sm { display: none; } }
  .dropdown { position: relative; }
  .dropbtn {
    width: auto; display: flex; align-items: center; gap: 4px; padding: 6px 7px;
    background: transparent; color: var(--muted);
    border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  }
  .dropbtn:hover { color: var(--text); border-color: var(--muted); }
  .dropbtn svg { width: 15px; height: 15px; display: block; }
  .dropbtn .caret { width: 12px; height: 12px; opacity: .7; }
  .dropmenu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
    margin: 0; padding: 4px; list-style: none; min-width: 148px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
  }
  .dropmenu li {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 9px; border-radius: 7px; cursor: pointer;
    font-size: 14px; color: var(--text);
  }
  .dropmenu li:hover { background: var(--stripe); }
  .dropmenu li svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
  .dropmenu li .check { margin-left: auto; width: 13px; height: 13px; color: var(--accent); visibility: hidden; }
  .dropmenu li[aria-selected="true"] .check { visibility: visible; }

  .status {
    font-family: var(--mono); font-size: 13px; color: var(--muted);
    border-bottom: 1px solid var(--line); padding: 10px 0; text-align: center;
  }
  .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-right: 7px; vertical-align: middle; }
  .status b { color: var(--text); font-weight: 600; }

  h1 { font-size: clamp(34px, 6.5vw, 56px); line-height: 1.08; letter-spacing: -.03em; margin: 56px 0 16px; text-align: center; }
  .lead { font-size: 18px; font-weight: 600; color: var(--text); margin: 0 auto 36px; max-width: 54ch; text-align: center; }
  .lead strong { color: var(--text); font-weight: 600; }

  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
  .hook { margin-bottom: 28px; }
  .hook h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.01em; }
  .hook ol { margin: 0; padding-left: 20px; }
  .hook li { margin-bottom: 10px; color: var(--muted); }
  .hook li:last-child { margin-bottom: 0; }
  .hook li b { color: var(--text); }

  label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
  input[type=text], input[type=email], textarea, select {
    width: 100%; padding: 12px 14px; font-size: 16px;
    background: var(--input-bg); color: var(--text);
    border: 1px solid var(--line); border-radius: 9px; font-family: inherit;
  }
  textarea { resize: vertical; line-height: 1.5; }
  select { appearance: none; cursor: pointer; padding-right: 36px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 19px) 22px, calc(100% - 14px) 22px;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
  input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

  .catsrow { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 16px; }
  .cats { display: flex; gap: 7px; flex: 1; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
  .catsrow.open .cats { flex-wrap: wrap; overflow: visible; }
  .catsmore {
    width: auto; flex: none; padding: 6px 12px; font-size: 13px; font-weight: 500;
    background: transparent; color: var(--text);
    border: 1px solid var(--line); border-radius: 999px;
  }
  .catsmore:hover { border-color: var(--muted); }
  .cats button {
    width: auto; padding: 6px 12px; font-size: 13px; font-weight: 500;
    background: transparent; color: var(--muted);
    border: 1px solid var(--line); border-radius: 999px;
  }
  .cats button:hover { color: var(--text); }
  .cats button[aria-pressed="true"] { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }
  .cat { font-size: 12px; color: var(--muted); font-family: var(--mono); }
  .field { margin-bottom: 16px; }
  .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
  .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 18px 0; }
  .consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
  button {
    width: 100%; padding: 14px; font-size: 16px; font-weight: 600;
    background: var(--accent); color: var(--btn-text); border: 0; border-radius: 9px; cursor: pointer;
    font-family: inherit;
  }
  button:hover { filter: brightness(1.08); }
  button:disabled { opacity: .55; cursor: default; }
  .stepper { display: flex; gap: 8px; }
  .stepper input { text-align: center; font-family: var(--mono); font-size: 18px; font-weight: 600; }
  .stepbtn {
    width: 48px; flex: none; padding: 0; font-size: 22px; font-weight: 400;
    background: var(--input-bg); color: var(--text);
    border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
  }
  .stepbtn:hover { border-color: var(--accent); color: var(--accent); }
  .hp { position: absolute; left: -9999px; }
  .claimline {
    display: flex; align-items: baseline; justify-content: center; gap: 8px;
    margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
    font-size: 15px; color: var(--muted); flex-wrap: wrap; text-align: center;
  }
  .claimline b { font-family: var(--mono); font-size: 26px; color: var(--gold); font-weight: 700; }
  .claimline.hero { border-bottom: 0; padding-bottom: 0; margin-bottom: 10px; font-size: 17px; }
  .claimline.hero b { font-size: 30px; }
  .error { color: #ff6b6b; font-size: 14px; margin-top: 12px; }
  .free-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; }

  .success { text-align: center; }
  .success .num { font-family: var(--mono); font-size: 64px; font-weight: 700; color: var(--gold); line-height: 1; margin: 6px 0 4px; }
  .success p { color: var(--muted); }
  .sharebox { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
  .sharebox a, .sharebox button {
    flex: 1 1 140px; width: auto; padding: 11px 14px; font-size: 14px; text-align: center;
    text-decoration: none; border-radius: 9px;
  }
  .sharebox .ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

  section { margin: 56px 0; }
  h2.sec { font-size: 22px; letter-spacing: -.02em; margin: 0 0 6px; }
  /* Sections without a subtitle need the subtitle's spacing back. */
  h2.sec:not(:has(+ .sec-sub)) { margin-bottom: 26px; }
  .sec-sub { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

  .board { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .row:last-child { border-bottom: 0; }
  .rank { font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--text); width: 46px; flex: none; letter-spacing: -.03em; }
  .row.free { background: repeating-linear-gradient(135deg, transparent, transparent 8px, var(--stripe) 8px, var(--stripe) 16px); }
  .row.free .rank { color: var(--gold); font-weight: 600; }
  .row .who { flex: 1; min-width: 0; }
  .row .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row .who em { display: block; font-style: normal; font-size: 13.5px; color: var(--muted); margin: 2px 0 4px; }
  .row .who span { font-size: 13px; color: var(--muted); font-family: var(--mono); }
  .row.demo { align-items: flex-start; }
  .row.you {
    background: var(--stripe);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .row.you .rank, .row.you .tag { color: var(--accent); }
  .row.you .who b { color: var(--accent); }
  .row.demo .rank { padding-top: 8px; }
  .row .tag {
    font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: -.02em;
    color: var(--text); flex: none; white-space: nowrap; align-self: center;
  }
  .ico {
    width: 42px; height: 42px; border-radius: 11px; flex: none;
    display: grid; place-items: center; position: relative; overflow: hidden;
    font-family: var(--mono); font-weight: 700; font-size: 14px; color: #fff;
  }
  /* The favicon covers the initials when it loads, and removes itself when it fails. */
  .ico img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; background: #fff; padding: 5px;
  }

  .queuecount { text-align: center; padding: 28px 22px; }
  .queuecount .qnum { font-family: var(--mono); font-size: 52px; font-weight: 700; color: var(--gold); line-height: 1; }
  .queuecount p { margin: 6px 0 0; color: var(--muted); }

  .steps { counter-reset: s; padding: 0; list-style: none; margin: 0; }
  .steps li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 20px; }
  .steps li::before {
    content: counter(s); position: absolute; left: 0; top: 0;
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
    display: grid; place-items: center; font-family: var(--mono); font-size: 13px; color: var(--muted);
  }
  .steps b { display: block; }
  .steps p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

  details { border-bottom: 1px solid var(--line); padding: 14px 0; }
  details summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
  details summary::-webkit-details-marker { display: none; }
  details summary::after { content: "+"; color: var(--muted); font-family: var(--mono); }
  details[open] summary::after { content: "−"; }
  details p { color: var(--muted); margin: 10px 0 0; font-size: 15px; }
  ul.rules { color: var(--muted); padding-left: 20px; font-size: 15px; }
  ul.rules li { margin-bottom: 8px; }

  footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: 13px; }
  footer a { color: var(--muted); }

  /* Dropdowns built by app.js */
  .dropbtn-face { display: flex; align-items: center; font-size: 13px; white-space: nowrap; }
  .dropbtn-face svg { width: 15px; height: 15px; }
  .dropmenu { max-height: 60vh; overflow-y: auto; }
  .dropmenu li span { flex: 1; }
  .cta {
    display: block; width: 100%; max-width: 420px; margin: 0 auto;
    padding: 16px 22px; font-size: 17px; font-weight: 600; text-align: center;
    background: var(--accent); color: var(--btn-text); border-radius: 10px; text-decoration: none;
  }
  .cta:hover { filter: brightness(1.08); }
  .cta-note { text-align: center; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
  .backlink { display: inline-block; margin: 28px 0 0; color: var(--muted); text-decoration: none; font-size: 14px; }
  .backlink:hover { color: var(--text); }
  .formpage h1 { font-size: clamp(28px, 5vw, 38px); margin: 28px 0 8px; }
  .formpage .lead { font-size: 16px; font-weight: 400; color: var(--muted); margin-bottom: 28px; }

  .queueline { text-align: center; font-size: 15px; color: var(--muted); margin: 0 0 20px; }
  .queueline b { font-family: var(--mono); font-size: 21px; font-weight: 700; color: var(--gold); }

  .catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
  .catcard {
    display: block; padding: 16px 18px; text-decoration: none;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  }
  .catcard:hover { border-color: var(--accent); }
  .catcard b { display: block; color: var(--text); font-weight: 600; }
  .catcard span { font-size: 13px; color: var(--muted); font-family: var(--mono); }

  /* Success state hides the lead, so the card would sit right under the heading. */
  .formpage .lead[hidden] ~ .card { margin-top: 24px; }

  .refcard {
    max-width: 520px; margin: 32px auto 0; text-align: left;
    border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  }
  .refcard .refbadge {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
    color: var(--accent); font-weight: 700; font-size: 16px; letter-spacing: -.01em;
  }
  .refcard .refbadge svg { width: 18px; height: 18px; flex: none; }
  .refcard .ico { width: 46px; height: 46px; font-size: 15px; }

  /* Per-row call to action, like outbid.lol's "claim this rank for $X":
     a small pill straddling the top edge of the row, revealed on hover. */
  .board { overflow: visible; }
  .row { position: relative; }
  .row .claim {
    position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
    z-index: 2; white-space: nowrap;
    /* inline-flex + line-height:1 so the mono text sits centred in the pill */
    display: inline-flex; align-items: center; justify-content: center;
    height: 26px; padding: 0 12px; line-height: 1;
    font-family: var(--mono); font-size: 12px; text-decoration: none;
    color: var(--muted); background: var(--panel);
    border: 1px solid var(--line); border-radius: 999px;
    opacity: 0; pointer-events: none; transition: opacity .12s ease;
  }
  .row:hover .claim, .row .claim:focus-visible { opacity: 1; pointer-events: auto; }
  .row .claim:hover { color: var(--accent); border-color: var(--accent); }
  .row.you .claim { color: var(--accent); border-color: var(--accent); }
  /* Touch devices have no hover, so the pill is always visible there. */
  @media (hover: none) {
    .row .claim { opacity: 1; pointer-events: auto; }
  }

  /* Keep the row's own CTA on its own line, under the domain. */
  .row .who > span { display: block; }

  /* Category chips are links, not toggles, so style anchors too. */
  .cats a, .cats button { flex: none; white-space: nowrap; }
  .cats a {
    padding: 6px 12px; font-size: 13px; font-weight: 500; text-decoration: none;
    color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  }
  .cats a:hover { color: var(--text); border-color: var(--muted); }
  .cats a[aria-current="true"] { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }

  /* Fade the clipped edge so a half-visible chip reads as "there is more". */
  .catsrow:not(.open) .cats {
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
