:root {
  color-scheme: light;
  --page: #f4f4f1; --surface: #fcfcfb; --surface-2: #f0efec;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #666560;
  --line: #e1e0d9; --grid: #e1e0d9; --axis: #c3c2b7;
  --accent: #256abf; --accent-ink: #ffffff; --link: #1c5cab;
  --series-pool: #2a78d6; --series-you: #eb6834; --you-ink: #b8481c;
  --good: #006300; --good-bg: #e4f3e4; --bad: #b02a2a; --bad-bg: #fbe9e9; --warn: #8a5a00; --warn-bg: #fdf1d6;
  --tooltip-bg: #0b0b0b; --tooltip-ink: #f0efec; --code-bg: #f0efec;
  --heat-0: #cde2fb; --heat-1: #9ec5f4; --heat-2: #6da7ec; --heat-3: #256abf; --heat-4: #104281;
  --heat-ink-0: #0b0b0b; --heat-ink-1: #0b0b0b; --heat-ink-2: #0b0b0b; --heat-ink-3: #ffffff; --heat-ink-4: #ffffff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --art-opacity: .13;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #262624;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #a3a29a;
    --line: #2c2c2a; --grid: #2c2c2a; --axis: #383835;
    --accent: #256abf; --accent-ink: #ffffff; --link: #6da7ec;
    --series-pool: #3987e5; --series-you: #d95926; --you-ink: #ec835a;
    --good: #4cc94c; --good-bg: #132a13; --bad: #f08a8a; --bad-bg: #331818; --warn: #fab219; --warn-bg: #30260e;
    --tooltip-bg: #f0efec; --tooltip-ink: #0b0b0b; --code-bg: #0d0d0d;
    --heat-0: #0d366b; --heat-1: #184f95; --heat-2: #256abf; --heat-3: #5598e7; --heat-4: #9ec5f4;
    --heat-ink-0: #ffffff; --heat-ink-1: #ffffff; --heat-ink-2: #ffffff; --heat-ink-3: #0b0b0b; --heat-ink-4: #0b0b0b;
    --art-opacity: .15;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #262624;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #a3a29a;
  --line: #2c2c2a; --grid: #2c2c2a; --axis: #383835;
  --accent: #256abf; --accent-ink: #ffffff; --link: #6da7ec;
  --series-pool: #3987e5; --series-you: #d95926; --you-ink: #ec835a;
  --good: #4cc94c; --good-bg: #132a13; --bad: #f08a8a; --bad-bg: #331818; --warn: #fab219; --warn-bg: #30260e;
  --tooltip-bg: #f0efec; --tooltip-ink: #0b0b0b; --code-bg: #0d0d0d;
  --heat-0: #0d366b; --heat-1: #184f95; --heat-2: #256abf; --heat-3: #5598e7; --heat-4: #9ec5f4;
  --heat-ink-0: #ffffff; --heat-ink-1: #ffffff; --heat-ink-2: #ffffff; --heat-ink-3: #0b0b0b; --heat-ink-4: #0b0b0b;
  --art-opacity: .15;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url(img/bg-bitcoin.svg) center top / 720px; opacity: var(--art-opacity); }
a { color: var(--link); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1, .h2 { font-size: 1.7rem; font-weight: 700; }
.h2 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: .95rem; margin-top: 1.25rem; }
p { margin: 0 0 .75rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; }
.wrap { overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.center { text-align: center; }
small { font-size: .82em; color: var(--muted); font-weight: 400; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; z-index: 10; background: var(--surface); padding: .5rem 1rem; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: .55rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { background: var(--accent); color: var(--accent-ink); font-family: var(--mono); padding: .15rem .4rem; border-radius: 6px; font-size: .9rem; }
.nav { display: flex; gap: .15rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--ink-2); text-decoration: none; padding: .35rem .65rem; border-radius: 6px; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.topbar-end { display: flex; align-items: center; gap: .6rem; }
.topbar-end form { margin: 0; }
.whoami { color: var(--you-ink); font-weight: 600; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Controls */
.btn { display: inline-block; font: inherit; font-weight: 600; padding: .5rem 1rem; border-radius: 7px; border: 1px solid transparent; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: var(--axis); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-sm { padding: .22rem .6rem; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 1px solid var(--axis); color: var(--ink-2); width: 30px; height: 30px; border-radius: 7px; cursor: pointer; font-size: 1rem; line-height: 1; }
.link-btn { background: none; border: 0; padding: 0 .15rem; font: inherit; font-size: .85rem; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.segmented { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 8px; gap: 2px; }
.segmented button, .segmented a { font: inherit; font-size: .85rem; border: 0; background: none; color: var(--ink-2); padding: .25rem .7rem; border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.segmented [aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.controls { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Layout */
.page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.two-col-tight { margin-top: 1rem; }
.narrow { max-width: 460px; width: 100%; margin: 0 auto; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.section-head h2, .section-head p { margin-bottom: 0; }
.page-head { margin-bottom: 0; }
.page-head h1, .page-head p { margin-bottom: .1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 650; color: var(--muted); margin-bottom: .35rem; }
.lede { font-size: 1.1rem; color: var(--ink-2); }

/* Overview */
.hero-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.hero-num { font-size: clamp(2.8rem, 8vw, 4.4rem); font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 0; }
.hero-side { text-align: right; }
.hero-side p { margin: .35rem 0 0; }
.hero-foot { color: var(--ink-2); margin: .6rem 0 0; }
.meter { height: 10px; border-radius: 5px; background: var(--surface-2); margin-top: 1rem; overflow: hidden; }
.meter span { display: block; height: 100%; min-width: 3px; background: var(--series-pool); border-radius: 5px; }
.badge { display: inline-block; font-weight: 600; font-size: .85rem; padding: .2rem .65rem; border-radius: 99px; }
.badge-open { background: var(--surface-2); color: var(--ink-2); }
.badge-good { background: var(--good-bg); color: var(--good); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.tile { display: flex; flex-direction: column; gap: .1rem; padding: 1rem 1.25rem; }
.tile-label { font-size: .82rem; color: var(--muted); }
.tile-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
.tile-sub { font-size: .82rem; color: var(--ink-2); }
.you-take { font-size: 2rem; font-weight: 700; color: var(--you-ink); line-height: 1.15; }
.you-take small { display: block; font-size: .85rem; margin-top: .15rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .4rem; flex: none; }
.dot-pool { background: var(--series-pool); }
.dot-you { background: var(--series-you); }
.dot-bonus { background: var(--ink-2); }
.dot-online { background: #0ca30c; }
.dot-idle { background: #fab219; }
.dot-off { background: var(--axis); }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-top: 1px solid var(--line); }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--ink-2); flex: none; max-width: 55%; }
.kv dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; font-variant-numeric: tabular-nums; }
.kv dd.mono { font-weight: 500; }
.chart-summary { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; font-size: .9rem; color: var(--ink-2); margin-bottom: .5rem; }
.chart-summary strong { color: var(--ink); }
.chart-box { position: relative; height: 280px; }
[data-chart-root].is-loading .chart-box { opacity: .55; }
.chart-table { margin-top: .5rem; font-size: .9rem; }
.chart-table summary { cursor: pointer; color: var(--link); }
.scale { display: flex; align-items: center; gap: 2px; font-size: .78rem; color: var(--muted); }
.scale span { margin: 0 .3rem; }
.scale i { width: 20px; height: 10px; }
.keymap { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
.keycell { padding: .55rem .35rem; text-align: center; display: flex; flex-direction: column; border-radius: 4px; font-variant-numeric: tabular-nums; }
.keycell strong { font-size: 1rem; }
.keycell-label { font-family: var(--mono); font-size: .72rem; }
.keycell-pct { font-size: .72rem; }
.heat-0 { background: var(--heat-0); color: var(--heat-ink-0); }
.heat-1 { background: var(--heat-1); color: var(--heat-ink-1); }
.heat-2 { background: var(--heat-2); color: var(--heat-ink-2); }
.heat-3 { background: var(--heat-3); color: var(--heat-ink-3); }
.heat-4 { background: var(--heat-4); color: var(--heat-ink-4); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .55rem .9rem; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
.table thead th { border-top: 0; font-size: .8rem; font-weight: 600; color: var(--muted); }
.table thead a { color: inherit; text-decoration: none; }
.table thead a:hover { text-decoration: underline; }
.table .num { text-align: right; }
.table-dense th, .table-dense td { padding: .35rem .6rem; font-size: .85rem; }
.table-board tbody tr:hover, .table-dense tbody tr:hover { background: var(--surface-2); }
.row-you { background: color-mix(in srgb, var(--series-you) 11%, transparent); }
.row-bonus .trunc { color: var(--warn); font-weight: 600; }
.trunc { display: inline-block; vertical-align: bottom; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.trunc-cell { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--you-ink); padding: 0 .4rem; border-radius: 4px; margin-left: .35rem; text-decoration: none; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.fire { font-weight: 700; color: var(--you-ink); }
.state { display: inline-flex; align-items: center; }
.progress { display: inline-block; vertical-align: middle; width: 90px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--series-pool); }
.num-inline { font-size: .85rem; color: var(--ink-2); margin-left: .3rem; }
.empty { text-align: center; padding: 3rem 1.25rem; }
.log { font: .8rem/1.5 var(--mono); max-height: 70vh; overflow: auto; margin: 0; white-space: pre; }

/* Forms */
.form { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 1rem; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; }
.form small { font-size: .78rem; }
input, select { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--axis); border-radius: 7px; padding: .5rem .65rem; width: 100%; min-width: 0; }
input.mono { font-family: var(--mono); font-size: .88rem; }
input:focus { outline: 2px solid var(--link); outline-offset: 0; border-color: transparent; }
.field-error { color: var(--bad); font-weight: 500; font-size: .85rem; }
.alert { padding: .55rem .8rem; border-radius: 7px; font-size: .92rem; }
.alert-good { background: var(--good-bg); color: var(--good); }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.captcha { display: flex; align-items: center; gap: .75rem; }
.captcha img { border-radius: 7px; }
.inline-field { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--ink-2); }
.inline-field select { width: auto; padding: .3rem .5rem; }

/* Landing */
.landing { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: center; padding: 2.5rem 0; }
.landing h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -.025em; margin-bottom: 1rem; }
.landing h1 sup { font-size: .55em; }
.keyfield { display: grid; grid-template-columns: repeat(32, 1fr); gap: 3px; margin: 1.5rem 0; max-width: 560px; }
.keyfield i { aspect-ratio: 1; background: var(--surface-2); border-radius: 2px; }
.keyfield i.on { background: var(--heat-1); }
.keyfield i.hit { background: var(--series-you); }
.facts { display: flex; gap: 2rem; flex-wrap: wrap; margin: 0 0 1rem; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-size: 1.2rem; font-weight: 700; }
.auth-card { padding: 1.75rem; }

/* Get started */
.downloads { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .85rem; }
.download { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem .8rem; border: 1px solid var(--axis); border-radius: 7px; text-decoration: none; overflow-wrap: anywhere; }
.download:hover { background: var(--surface-2); }
.steps { padding-left: 1.3rem; margin: 0 0 .75rem; }
.steps li { margin-bottom: .3rem; }
.provider { display: flex; flex-direction: column; min-width: 0; }
.provider-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.provider-logo { display: block; max-height: 44px; max-width: 150px; width: auto; height: auto; border-radius: 6px; padding: 4px; }
.provider-logo-dark { background: #1a1a19; }
.mini { display: flex; gap: 1.25rem; margin: 0; text-align: right; }
.mini dt { font-size: .75rem; color: var(--muted); }
.mini dd { margin: 0; font-weight: 700; }
.code { position: relative; margin-bottom: .75rem; }
.code pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: .75rem; padding-right: 4.5rem; margin: 0; overflow-x: auto; }
.code code { background: none; padding: 0; font-size: .8rem; line-height: 1.6; }
.code-copy { position: absolute; top: .5rem; right: .5rem; background: var(--surface); }

/* About */
.prose { max-width: 720px; width: 100%; margin: 0 auto; padding: 1rem 0; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.prose h2 { margin-top: 1.75rem; font-size: 1.2rem; }
.kv-wide { margin-bottom: 1rem; }
.split { display: flex; gap: 2px; height: 14px; margin: 1rem 0 .75rem; }
.split span:first-child { border-radius: 4px 0 0 4px; }
.split span:last-child { border-radius: 0 4px 4px 0; }
.split-a { background: var(--series-pool); }
.split-b { background: var(--series-you); }
.split-c { background: var(--ink-2); min-width: 4px; }
.split-legend { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.split-legend li { margin-bottom: .4rem; }

/* Footer */
.footer { border-top: 1px solid var(--line); margin-top: 1.5rem; font-size: .85rem; }
.footer-in { max-width: 1120px; margin: 0 auto; padding: 1.25rem; }
.footer p { margin-bottom: .3rem; }
.addr { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .landing { grid-template-columns: minmax(0, 1fr); }
  .landing { gap: 1.5rem; padding: .5rem 0; }
  .keymap { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .topbar-in { flex-wrap: wrap; gap: .5rem .75rem; }
  .nav { order: 3; flex-basis: 100%; }
  .topbar-end { margin-left: auto; }
  .topbar { position: static; }
}
@media (max-width: 520px) {
  .page { padding: .85rem; }
  .card { padding: 1rem; }
  .hero-side { text-align: left; }
  .code pre { padding: 2.6rem .75rem .75rem; }
  .kv > div { flex-wrap: wrap; gap: 0 1rem; }
  .kv dt { max-width: 100%; }
  .kv dd { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print, (forced-colors: active) { body::before { display: none; } }
@media (forced-colors: active) { .dot, .meter span, .progress span { forced-color-adjust: none; } }
