/* Vantage HashPay site styles.
   Vantage palette: OBM navy for ink and primary buttons, Tailwind slate for lines and surfaces,
   slate-900 in dark mode with OBM cyan primary buttons. Light palette on :root, dark palette under
   prefers-color-scheme: dark. Every colour in this file comes from a token. No inline styles anywhere
   (the CSP forbids them); the only styles set from JavaScript are flex-grow and width on split-bar segments. */

:root {
  --bg: #F8FAFC;             /* slate-50 */
  --surface: #FFFFFF;
  --ink: #213654;            /* OBM navy */
  --muted: #475569;          /* slate-600 */
  --line: #E2E8F0;           /* slate-200 */
  --accent: #213654;         /* primary buttons, focus rings, selected states */
  --accent-ink: #213654;     /* links */
  /* pool colours: each at least 3:1 on white, the page and the track */
  --pool-1: #213654;         /* navy */
  --pool-2: #0E8F94;         /* teal */
  --pool-3: #5F7F00;         /* lime */
  --pool-4: #A86F00;         /* gold */
  --pool-5: #B4436C;         /* rose */
  --fee: #8A94A6;
  --good: #2E9E5B;
  --warn: #D98B1A;
  --bad: #D14343;

  /* derived tokens */
  --paper: #FFFFFF;          /* the mark's verticals and text on red, fixed in both themes */
  --ink-fixed: #FFFFFF;      /* text on primary buttons: white on navy, navy on cyan in dark mode */
  --track: #F1F5F9;          /* slate-100: empty split-bar track, table header fill, code background */
  --good-bg: #E6F4EB;
  --warn-bg: #FBF0DC;
  --bad-bg: #FAE3E3;
  --accent-bg: #E9EBEE;      /* navy at 10% */
  --accent-hover: #17263B;   /* primary buttons on hover: a darker navy */
  --logo-tile: #0F1F4B;      /* OBM Blue, the tile of the mark in the top bar */
  --logo-tile-edge: transparent;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.12);

  --font-display: "Mulish", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-card: 10px;
  --radius-input: 8px;
  --radius-pill: 999px;
  --gutter: 20px;
  --max: 1120px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F172A;           /* slate-900 */
    --surface: #1E293B;      /* slate-800 */
    --ink: #F1F5F9;          /* slate-100 */
    --muted: #94A3B8;        /* slate-400 */
    --line: #334155;         /* slate-700 */
    --accent: #33DCE1;       /* OBM cyan */
    --accent-ink: #33DCE1;
    --ink-fixed: #213654;    /* navy on cyan */
    /* lighter pool colours: each at least 3:1 on the page, cards and the track */
    --pool-1: #60A5FA;       /* blue-400: a clear blue, so it never reads as the grey fee */
    --pool-2: #2BBFC4;
    --pool-3: #A3C93A;
    --pool-4: #E3B341;
    --pool-5: #E07A9F;
    --track: #283548;        /* between slate-800 and slate-700: muted text on it stays above 4.5:1 */
    --good-bg: #16302A;
    --warn-bg: #3A2A12;
    --bad-bg: #3A1C1C;
    --accent-bg: #153546;    /* cyan at 15% on slate-900 */
    --accent-hover: #00D0D6; /* OBM dark turquoise */
    --logo-tile: #213654;    /* as in img/hashpay-mark-dark.svg */
    --logo-tile-edge: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

@media (max-width: 480px) {
  :root { --gutter: 16px; }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.75rem); }
h3 { font-size: 1.125rem; font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }

p, ul, ol, dl { margin: 0 0 1em; }
p:last-child, ul:last-child, ol:last-child, dl:last-child { margin-bottom: 0; }

.prose p, .prose li, .prose dd { max-width: 68ch; }

a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

code, kbd, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.9375em;
}
code {
  background: var(--track);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
pre {
  background: var(--track);
  padding: 12px 14px;
  border-radius: var(--radius-input);
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

.num, td.num, th.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

small, .small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.875rem; margin: 6px 0 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

img, svg { max-width: 100%; height: auto; }
/* a <picture> only picks the light or dark file; the <img> inside lays out as if it stood alone */
picture { display: contents; }

/* ---------- layout ---------- */

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

main.page { flex: 1 0 auto; padding-top: 32px; padding-bottom: 64px; }

.section { margin: 0 0 48px; }
.section:last-child { margin-bottom: 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem); }

.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- header ---------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }

.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.logo { display: block; width: 270px; height: 36px; }
.logo .logo-tile { fill: var(--logo-tile); stroke: var(--logo-tile-edge); stroke-width: 2px; }
.logo .logo-wordmark { fill: var(--ink); }
.logo .logo-endorser { fill: var(--muted); }

.site-nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 6px 0; }
.site-nav a:hover { color: var(--accent-ink); text-decoration: underline; }
.site-nav a.btn,
.site-nav .btn-small { padding: 8px 14px; }
.site-nav a.btn { color: var(--ink-fixed); text-decoration: none; }
.site-nav .inline-form { margin: 0; }

.link-button {
  background: none; border: 0; padding: 6px 0; margin: 0;
  font: inherit; font-weight: 500; color: var(--ink); cursor: pointer;
}
.link-button:hover { color: var(--accent-ink); text-decoration: underline; }

@media (max-width: 720px) {
  .site-header-inner { align-items: flex-start; }
  .site-nav { width: 100%; }
  .site-nav a,
  .site-nav .link-button,
  .site-nav .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .logo { width: 240px; height: 32px; }
}

/* Account pages: large tap targets, one full-width row on a phone. */
.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.app-nav a {
  flex: 1 1 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}
.app-nav a:hover { border-color: var(--accent); color: var(--ink); }
.app-nav a.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-fixed);
}
.split-action { min-height: 44px; }
@media (max-width: 640px) {
  .app-nav a { flex-basis: 100%; }
  .section-head .split-action { width: 100%; }
}

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: auto; padding: 32px 0; color: var(--muted); font-size: 0.9375rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.footer-brand img { width: 28px; height: 28px; }
.footer-brand .brand-line { margin: 0; color: var(--muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-note { width: 100%; margin: 0; max-width: 68ch; }
.footer-note a { color: var(--muted); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-input);
  border: 1px solid transparent;
  font: inherit; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border-color: var(--line);
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); color: var(--ink-fixed); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-small { padding: 6px 12px; font-size: 0.875rem; }
.btn[disabled], .btn:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
/* Closed sign-up: the control stays visible, looks inactive, and does not change on hover. */
.btn-disabled,
.btn-disabled:hover,
.btn-primary.btn-disabled,
.btn-primary.btn-disabled:hover,
.btn[aria-disabled="true"],
.btn[aria-disabled="true"]:hover,
.btn-primary[aria-disabled="true"],
.btn-primary[aria-disabled="true"]:hover,
.form-disabled .btn:disabled,
.form-disabled .btn:disabled:hover,
.form-disabled .btn-primary:disabled,
.form-disabled .btn-primary:disabled:hover,
fieldset:disabled .btn,
fieldset:disabled .btn:hover,
fieldset:disabled .btn-primary,
fieldset:disabled .btn-primary:hover {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  background: var(--track);
  color: var(--muted);
  border-color: var(--line);
}
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- cards, callouts, pills ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px;
}
@media (min-width: 640px) { .card { padding: 24px; } }
.card > h2:first-child, .card > .section-head:first-child { margin-top: 0; }
.card + .card { margin-top: 20px; }
.card-stack > .card { margin: 0 0 20px; }
.card-stack > .card:last-child { margin-bottom: 0; }

.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius-input);
  background: var(--surface);
  padding: 12px 16px;
  margin: 0 0 16px;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-good { border-left-color: var(--good); background: var(--good-bg); }
.callout-warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout-bad { border-left-color: var(--bad); background: var(--bad-bg); }
.callout-accent { border-left-color: var(--accent); background: var(--accent-bg); }
.callout ul { padding-left: 20px; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem; font-weight: 600; line-height: 1.5;
  background: var(--track); color: var(--muted);
  white-space: nowrap;
}
.pill-up { background: var(--good-bg); color: var(--good); }
.pill-degraded { background: var(--warn-bg); color: var(--warn); }
.pill-down { background: var(--bad-bg); color: var(--bad); }
.pill-disabled { background: var(--track); color: var(--muted); }
.pill-info { background: var(--track); color: var(--muted); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-error { background: var(--bad-bg); color: var(--bad); }

.draft-note {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--warn-bg); color: var(--warn);
  font-weight: 600; font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ---------- KPI tiles ---------- */

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 14px 16px; }
.kpi-label { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 500; margin-top: 2px; overflow-wrap: anywhere; }
.kpi-sub { font-size: 0.8125rem; color: var(--muted); margin-top: 2px; }

/* ---------- split bar ---------- */

.split {
  display: flex;
  gap: 2px;
  height: 14px;
  width: 100%;
  background: var(--track);
  border-radius: 7px;
}
.split.thin { height: 8px; border-radius: 4px; }
.split-seg {
  flex: 0 1 0px;
  min-width: 0;
  height: 100%;
  border-radius: 5px;
  background: var(--fee);
  transition: flex-grow 0.6s ease;
}
.split.thin .split-seg { border-radius: 3px; }
.split-seg.is-empty { display: none; }
.split-seg.split-rest { background: transparent; }

.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; background: var(--fee); flex: none; }

/* pool colours by slot, declared after .split-seg and .swatch so they win at equal specificity */
.p1 { background: var(--pool-1); }
.p2 { background: var(--pool-2); }
.p3 { background: var(--pool-3); }
.p4 { background: var(--pool-4); }
.p5 { background: var(--pool-5); }
.fee { background: var(--fee); }

.split-block { margin: 0 0 10px; }
.split-label { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--muted); margin-bottom: 6px; }
.split-legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.875rem; }
.split-legend li { display: inline-flex; align-items: center; gap: 4px; }
.split-legend .num { color: var(--muted); }

.expense-block { margin: 14px 0 4px; }
.expense-line { margin: 0 0 8px; }
.expense-fill { background: var(--accent); }

/* the front-page demo, when scripts are off: a static 50/30/20 bar */
.demo-a { flex-grow: 50; }
.demo-b { flex-grow: 30; }
.demo-c { flex-grow: 20; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-weight: 600; font-size: 0.8125rem; color: var(--muted); background: var(--track); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.wrap-cell { white-space: normal; }
.card .table-wrap { border-radius: var(--radius-input); }
.table-wrap + .empty { margin-top: 12px; }

.field-table th { width: 30%; }
.field-table td { white-space: normal; }

/* ---------- forms ---------- */

.form { max-width: 560px; }
.form-wide { max-width: none; }
.field { margin: 0 0 16px; }
.field label, .field > .label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 6px; }
.field .hint { margin-top: 6px; }
.field-error { color: var(--bad); font-size: 0.875rem; margin: 6px 0 0; }
.field-error:empty { display: none; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  line-height: 1.3;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="url"]:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent);
}
input.mono { font-family: var(--font-mono); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
input::placeholder { color: var(--muted); opacity: 0.8; }

.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.check .hint { margin: 2px 0 0; font-weight: 400; }

.form-row { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.form-errors { margin: 0 0 16px; }

fieldset.bare {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.form-disabled,
fieldset.bare:disabled { cursor: not-allowed; }
fieldset:disabled input,
fieldset:disabled select,
fieldset:disabled textarea,
.form-disabled input:disabled {
  cursor: not-allowed;
  background: var(--track);
  color: var(--muted);
  border-color: var(--line);
}
fieldset:disabled input:hover,
fieldset:disabled input:focus,
fieldset:disabled select:hover,
fieldset:disabled select:focus,
fieldset:disabled textarea:hover,
fieldset:disabled textarea:focus,
.form-disabled input:disabled:hover,
.form-disabled input:disabled:focus {
  outline: none;
  border-color: var(--line);
  cursor: not-allowed;
}

/* ---------- auth cards ---------- */

.auth { max-width: 460px; margin: 24px auto 0; }
.auth .card { padding: 28px; }
@media (max-width: 480px) { .auth .card { padding: 20px; } }
.auth h1 { font-size: 1.75rem; margin-bottom: 8px; }
.auth .lead { color: var(--muted); margin-bottom: 20px; }
.auth .btn { width: 100%; }
.auth-switch { margin-top: 16px; text-align: center; color: var(--muted); font-size: 0.9375rem; }

/* ---------- empty states, status ---------- */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-input);
  padding: 20px;
  color: var(--muted);
  text-align: center;
}
.empty strong { color: var(--ink); }
.status-line { font-size: 0.875rem; color: var(--muted); margin: 0; }
.status-line.is-live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 6px; vertical-align: 1px; }
.status-line.is-stale::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 6px; vertical-align: 1px; }

/* ---------- front page ---------- */

.hero { display: grid; gap: 32px; align-items: center; grid-template-columns: 1fr; padding: 40px 0 48px; }
@media (min-width: 820px) { .hero { grid-template-columns: 3fr 2fr; gap: 48px; padding: 64px 0; } }
.hero .lead { font-size: 1.125rem; max-width: 60ch; }
.hero .lead code { font-size: 0.95em; }
.hero-mark { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero-mark img { width: 160px; height: 160px; }
@media (max-width: 480px) { .hero-mark img { width: 120px; height: 120px; } }
.brand-line { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); margin: 0; text-align: center; }
.hero .btn-row { margin-top: 24px; }
.hero .note { margin-top: 16px; color: var(--muted); }

.demo { margin: 0 0 56px; }
.demo-caption { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.875rem; color: var(--muted); margin-bottom: 8px; }
.demo-caption strong { color: var(--ink); font-weight: 600; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; }
.steps li::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--ink-fixed);
  font-family: var(--font-display); font-weight: 700;
  margin-bottom: 12px;
}
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }
.steps code { color: var(--ink); }

.guarantees { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.guarantees h3 { margin-bottom: 6px; }
.guarantees p { margin: 0; color: var(--muted); }

.faq { display: grid; gap: 8px 32px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.faq-item { padding: 12px 0; border-top: 1px solid var(--line); }
.faq-item h3 { margin-bottom: 4px; }
.faq-item p { margin: 0; color: var(--muted); max-width: 60ch; }

.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 40px 0; margin: 0 0 56px; }
.band .wrap > :last-child { margin-bottom: 0; }

/* ---------- dashboard ---------- */

.conn-rows { margin: 0; }
.conn-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.conn-row:first-child { border-top: 0; padding-top: 0; }
.conn-row dt { font-weight: 600; font-size: 0.9375rem; margin: 0; }
.conn-row dd { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-row code { font-size: 1rem; padding: 4px 8px; }
@media (max-width: 480px) {
  .conn-row { grid-template-columns: 1fr; gap: 4px; }
}
.copy-done { color: var(--good); font-size: 0.875rem; }

.event-list { list-style: none; padding: 0; margin: 0; }
.event-list li { display: grid; grid-template-columns: 150px 72px 1fr; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.9375rem; align-items: baseline; }
.event-list li:first-child { border-top: 0; padding-top: 0; }
.event-list time { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.event-list .event-type { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }
.event-list .event-message { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .event-list li { grid-template-columns: 1fr auto; }
  .event-list .event-message { grid-column: 1 / -1; }
}

.account-lines { display: grid; gap: 2px; }
.account-line { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.account-line code { color: var(--ink); }
#routing-status[title] { cursor: help; border-bottom: 1px dotted var(--muted); }
.routing-details { margin-top: 6px; }

.fee-line { margin-top: 12px; font-size: 0.9375rem; }

/* ---------- pools editor ---------- */

.pool-rows { display: grid; gap: 16px; margin: 0 0 20px; }
.pool-row { border-left: 4px solid var(--fee); }
.pool-row[data-slot="1"] { border-left-color: var(--pool-1); }
.pool-row[data-slot="2"] { border-left-color: var(--pool-2); }
.pool-row[data-slot="3"] { border-left-color: var(--pool-3); }
.pool-row[data-slot="4"] { border-left-color: var(--pool-4); }
.pool-row[data-slot="5"] { border-left-color: var(--pool-5); }
.pool-row.is-off { opacity: 0.6; }
.pool-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pool-row-head h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.pool-share { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.pool-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.pool-grid .span-2 { grid-column: span 2; }
@media (max-width: 480px) { .pool-grid .span-2 { grid-column: auto; } }
.pool-grid .field { margin: 0; }
.pool-checks { display: flex; gap: 12px 24px; flex-wrap: wrap; margin-top: 12px; }

.validation { margin: 0 0 20px; }
.validation ul { margin: 6px 0 0; padding-left: 20px; }
.validation p { margin: 0; }

.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; }

/* ---------- docs, pricing ---------- */

.toc { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.9375rem; }

.plan { display: flex; flex-direction: column; }
.plan .price { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin: 4px 0 12px; }
.plan ul { padding-left: 20px; margin: 0 0 20px; }
.plan .btn-row { margin-top: auto; }

/* ---------- error pages ---------- */

.error-page { text-align: center; padding: 64px 0; }
.error-page .code { font-family: var(--font-mono); color: var(--muted); font-size: 1.125rem; margin-bottom: 8px; }
.error-page img { width: 72px; height: 72px; margin-bottom: 16px; }

/* ---------- integrations ---------- */

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.sub-title { margin-top: 28px; }

/* the one-time key and secret panels: the value on a line of its own, monospace, wrapping anywhere */
.secret-panel > code {
  display: block;
  margin: 10px 0 0;
  padding: 10px 12px;
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
}
.secret-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

.check-group { display: grid; gap: 10px; }

.pill-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pill-list .pill { font-family: var(--font-mono); font-weight: 500; }

.keys-table td, .webhooks-table td, .miners-table td { vertical-align: top; }
.webhooks-table code { overflow-wrap: anywhere; }
.webhooks-table td.wrap-cell { min-width: 14em; }
td.actions { text-align: right; }
td.actions form { display: inline-block; margin: 0 0 0 6px; }

/* an armed revoke or delete button, waiting for its second click */
.btn.is-armed { background: var(--bad); color: var(--paper); border-color: var(--bad); }
.btn.is-armed:hover { border-color: var(--bad); filter: brightness(0.96); }

.sandbox-state { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 8px; }
.sandbox-state p { margin: 0; }
.miners-table { margin: 16px 0; }
.card .table-wrap + .hint, .card .empty + .hint { margin-top: 12px; }

/* ---------- API docs ---------- */

.api-doc .toc { margin-bottom: 32px; }
.api-doc h3 { margin-top: 32px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.api-doc h3.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.api-doc h3.endpoint code { font-size: 1.0625rem; background: none; padding: 0; }
.method {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 4px;
  background: var(--track); color: var(--muted);
}
.method-get { background: var(--good-bg); color: var(--good); }
.method-post { background: var(--accent-bg); color: var(--accent-ink); }
.method-put, .method-patch { background: var(--warn-bg); color: var(--warn); }
.method-delete { background: var(--bad-bg); color: var(--bad); }
.scope { font-family: var(--font-body); font-size: 0.8125rem; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 1px 10px; }
.example-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.api-doc pre { font-size: 0.875rem; line-height: 1.5; margin: 0 0 1em; }
.api-doc ol > li > pre { margin: 8px 0 12px; }
.api-doc .table-wrap { margin: 0 0 1em; }
/* routing-mode toggle: three choices, the selected one edged in the accent, each with its explanation */
.mode-toggle { display: grid; gap: 12px; }
@media (min-width: 800px) { .mode-toggle { grid-template-columns: repeat(3, 1fr); } }
.mode-option {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  padding: 12px;
  cursor: pointer;
  background: var(--surface);
}
.mode-option:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.mode-option input { margin: 0 8px 0 0; }
.mode-name { font-weight: 600; }
.mode-tip { display: block; color: var(--muted); font-size: 0.875rem; margin-top: 6px; }

.range-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.range-toggle .is-selected { background: var(--accent); color: var(--ink-fixed); border-color: var(--accent); }
.chart-host { position: relative; }
.chart { width: 100%; height: auto; display: block; background: var(--track); border-radius: var(--radius-input); }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font-mono), ui-monospace, monospace; }
.chart-hit { fill: transparent; }
.chart-line { fill: none; stroke-width: 2; }
.chart-line.p1 { stroke: var(--pool-1); }
.chart-line.p2 { stroke: var(--pool-2); }
.chart-line.p3 { stroke: var(--pool-3); }
.chart-line.p4 { stroke: var(--pool-4); }
.chart-line.p5 { stroke: var(--pool-5); }
.chart-line.fee, .chart-line.rest { stroke: var(--fee); }
.csv-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-top: 16px; }
.csv-form label { display: grid; gap: 4px; font-size: 0.875rem; color: var(--muted); }
.meta-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; }
.meta-rows div { margin: 0; }
.meta-rows dt { color: var(--muted); font-size: 0.875rem; }
.meta-rows dd { margin: 0; }
.event-details { margin-top: 4px; font-size: 0.875rem; }
.event-details summary { cursor: pointer; color: var(--muted); }
.reason-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.reason-list li { display: flex; gap: 8px; align-items: baseline; }

.api-table th, .api-table td { white-space: normal; vertical-align: top; }
.api-table td:first-child { min-width: 9em; }
.api-table code { overflow-wrap: normal; }
