:root {
  --paper: #eef2ee;
  --surface: #ffffff;
  --ink: #0e1f17;
  --muted: #56675d;
  --line: #d6ded8;
  --line-strong: #b9c6bd;
  --brand: #0b7a4b;
  --brand-deep: #075c38;
  --brand-ink: #ffffff;
  --brand-tint: #dff3e8;
  --mint: #1fcb7c;
  --warn-bg: #fbefc7;
  --warn-ink: #5c4300;
  --err-bg: #fbe3df;
  --err-ink: #8f1f14;
  --ok-bg: #dff3e8;
  --ok-ink: #0b5a39;
  --focus: #1fcb7c;
  --r: 10px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1512;
    --surface: #17201b;
    --ink: #e9efeb;
    --muted: #9fb0a6;
    --line: #29352e;
    --line-strong: #3a4a41;
    --brand: #22b072;
    --brand-deep: #1a9a63;
    --brand-ink: #06170f;
    --brand-tint: #16301f;
    --mint: #34d98a;
    --warn-bg: #3a2e0c;
    --warn-ink: #f5d982;
    --err-bg: #3d1a15;
    --err-ink: #ffb3a8;
    --ok-bg: #16301f;
    --ok-ink: #9fe6c1;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  overflow-x: hidden;
  overflow-x: clip;
}
a { color: var(--brand); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.75rem); font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .9em; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* chrome */
.testbar { background: var(--warn-bg); color: var(--warn-ink); text-align: center; font-size: .82rem; padding: 6px 16px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.nav nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav nav a { text-decoration: none; color: var(--ink); font-size: .95rem; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.nav nav a:hover { background: var(--paper); }
.nav nav a.btn { color: var(--brand-ink); padding: 8px 14px; margin-left: 4px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.45rem; letter-spacing: -0.04em; text-decoration: none; color: var(--ink); }
.logo span { color: var(--brand); }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; font-size: .95rem; cursor: pointer; padding: 8px 10px; white-space: nowrap; }
@media (max-width: 640px) {
  /* Logged-in menu does not fit beside the logo on phones: give it its own row. */
  body.in .nav { flex-wrap: wrap; padding-bottom: 4px; }
  body.in .nav nav { flex: 1 1 100%; justify-content: flex-start; margin-left: -10px; }
  body.in .nav nav form.inline { margin-left: auto; }
  body.in .nav nav a, body.in .linkbtn { font-size: .92rem; padding: 6px 10px; }
}
main.wrap { padding-top: 24px; padding-bottom: 32px; }
.foot { padding: 24px 16px 48px; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 20px; }
.subnav a { text-decoration: none; color: var(--ink); font-size: .92rem; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.subnav a[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r); background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 650; padding: 12px 20px; min-height: 46px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-deep); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .875rem; }
.btn.big { padding: 14px 26px; min-height: 52px; font-size: 1.05rem; }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn.ghost:hover { background: var(--brand-tint); }
.btn.quiet { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.quiet:hover { background: var(--paper); }
.btn.danger { background: var(--err-ink); color: #fff; }
.btn.block { width: 100%; }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0; }

/* hero */
.hero { padding: 16px 0 28px; max-width: 620px; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 3.4rem); font-weight: 750; margin-bottom: .4em; }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 52ch; margin-bottom: 1.4em; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 32px; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; padding: 14px 16px; background: var(--surface); border-radius: var(--r); }
.steps li::before { content: counter(step); font-family: var(--display); font-weight: 750; font-size: 1.4rem; color: var(--brand); line-height: 1; padding-top: 2px; }
.steps b { display: block; margin-bottom: 2px; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* panels & sections */
.section { margin: 0 0 28px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 0 0 16px; }
.panel h2 { margin-bottom: .5em; }
.panel > :last-child { margin-bottom: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }
.prose h3 { margin-top: 1.3rem; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 20px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.stat { background: var(--surface); border-radius: var(--r); padding: 12px 14px; border: 1px solid var(--line); }
.stat .k { color: var(--muted); font-size: .8rem; }
.stat .v { font-family: var(--display); font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat.hi { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stat.hi .k { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.q0 { color: var(--ok-ink); }
.q1 { color: var(--warn-ink); }
.q2, .q3, .q4, .q5 { color: var(--err-ink); }
.stat.hi .q0 { color: var(--mint); }

/* forms */
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--r); padding: 12px 14px; min-height: 46px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.small-input { width: 130px !important; min-height: 34px !important; padding: 5px 8px !important; font-size: .85rem !important; }
form.inline select { width: auto; min-height: 34px; padding: 5px 8px; font-size: .875rem; }
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .92rem; }
.field .hint { font-weight: 400; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; line-height: 1.45; }
.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.shorten { display: flex; gap: 8px; margin: 0 0 8px; }
.shorten input { flex: 1; min-width: 0; }
.result { display: flex; gap: 8px; margin-top: 12px; padding: 8px; background: var(--brand-tint); border-radius: var(--r); }
.result input { flex: 1; min-width: 0; font-weight: 600; background: var(--surface); border-color: transparent; }
@media (max-width: 560px) { .shorten { flex-direction: column; } .shorten .btn { width: 100%; } }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

pre.code { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; overflow-x: auto; font-size: .85rem; line-height: 1.5; margin: 0 0 12px; }

/* switches */
.switches { display: grid; gap: 12px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: .95rem; }
.switch input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track .knob { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch .state { display: inline-block; min-width: 2.2em; font-weight: 650; color: var(--muted); }
.switch input:checked ~ .lbl .state { color: var(--brand); }
.switch.saving { opacity: .6; }
@media (prefers-reduced-motion: reduce) { .switch .track, .switch .knob { transition: none; } }

/* messages & tags */
.flash { border-radius: var(--r); padding: 12px 14px; margin: 0 0 16px; background: var(--brand-tint); }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.err { background: var(--err-bg); color: var(--err-ink); }
.tag { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.tag.err { background: var(--err-bg); color: var(--err-ink); border-color: transparent; }

/* tables */
.tablewrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rates td:first-child { font-weight: 650; white-space: nowrap; }
.rates .num { font-family: var(--display); font-size: 1.1rem; font-weight: 700; }

/* empty states */
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: var(--r); }

/* interstitial */
.visit main { padding-top: 12px; }
.ad { margin: 12px 0; display: flex; justify-content: center; }
.adph { width: 100%; max-width: 336px; min-height: 100px; display: grid; place-items: center; border: 1.5px dashed var(--line-strong); border-radius: var(--r); color: var(--muted); font-size: .82rem; }
.adph.tall { min-height: 250px; }
.gate { background: var(--surface); border-radius: 16px; padding: 28px 20px; text-align: center; border: 1px solid var(--line); }
.gate h1 { font-size: 1.5rem; margin-bottom: 4px; }
.ring { position: relative; width: 112px; height: 112px; margin: 18px auto; }
.ring svg { width: 112px; height: 112px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .track { stroke: var(--line); }
.ring .bar { stroke: var(--brand); transition: stroke-dashoffset 1s linear; }
.ring .n { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 2.2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.ring.done .n { color: var(--brand); }
#getlink { min-width: 240px; }
.gate .links { margin-top: 14px; }
.gate .links a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .ring .bar { transition: none; }
}
