@font-face {
  font-family: 'Outfit';
  src: url('/static/fonts/Outfit-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --c-bg: #fbfaf9;
  --c-surface: #f3f1f0;
  --c-surface-2: #ebe7e7;
  --c-raised: #ffffff;
  --c-text: #1d1619;
  --c-muted: #62575c;
  --c-border: #e4dfe0;
  --c-border-strong: #cdc4c7;
  --c-accent: #b32a43;
  --c-brand: #92243b;
  --c-brand-hover: #7a1c31;
  --c-on-brand: #ffffff;
  --c-focus: #b32a43;
  --c-grid: rgba(146, 36, 59, 0.16);
  --c-selection: #fcf1bf;
  --c-gold-bg: #fcf1bf;
  --c-gold-text: #5c4500;
  --c-ok: #1d6b3f;
  --c-ok-bg: #e3f3e8;
  --c-warn: #7a4a00;
  --c-warn-bg: #fdf0d5;
  --c-danger: #a3172f;
  --c-danger-bg: #fbe5e8;
  --c-inline-code-bg: #f1ebec;
  --c-inline-code-text: #6e1a2e;
  --c-code-bg: #1a1316;
  --c-code-border: #1a1316;
  --c-code-rule: rgba(255, 255, 255, 0.09);
  --c-code-text: #ede6e9;
  --c-code-muted: #9c8f94;
  --c-code-key: #f4a7b5;
  --c-code-str: #f9e065;
  --c-code-num: #9fe0c9;
  --c-mark-body: #92243b;
  --c-mark-flap: #cf364c;
  --c-mark-clasp: #f9e065;
  --shadow-1: 0 1px 2px rgba(29, 22, 25, 0.06), 0 12px 32px -16px rgba(29, 22, 25, 0.28);

  --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.3125rem;
  --fs-xl: clamp(1.625rem, 1.25rem + 1.5vw, 2.25rem);
  --fs-hero: clamp(2.125rem, 1.5rem + 2.4vw, 3.25rem);
  --lh-tight: 1.1;
  --lh-snug: 1.35;
  --lh-body: 1.6;

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: clamp(3rem, 2rem + 4vw, 5.5rem);
  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 72rem;
  --header-h: 3.75rem;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-pill: 999px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #151113;
    --c-surface: #1e191b;
    --c-surface-2: #272124;
    --c-raised: #1b1618;
    --c-text: #f2edef;
    --c-muted: #ada2a7;
    --c-border: #2f282b;
    --c-border-strong: #4a3f44;
    --c-accent: #f7889a;
    --c-brand: #cf364c;
    --c-brand-hover: #b92f44;
    --c-on-brand: #ffffff;
    --c-focus: #f9e065;
    --c-grid: rgba(247, 136, 154, 0.12);
    --c-selection: #4a3c12;
    --c-gold-bg: #3a3110;
    --c-gold-text: #f9e065;
    --c-ok: #8fdcae;
    --c-ok-bg: #14281c;
    --c-warn: #f4c770;
    --c-warn-bg: #2e2410;
    --c-danger: #ff8f9f;
    --c-danger-bg: #331419;
    --c-inline-code-bg: #272124;
    --c-inline-code-text: #f7b3bf;
    --c-code-bg: #0e0b0c;
    --c-code-border: #2f282b;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s-4)); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-text);
  font: var(--fs-base)/var(--lh-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
body > main { flex: 1 0 auto; }
::selection { background: var(--c-selection); color: var(--c-text); }
a { color: var(--c-accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.015em; margin: 0 0 var(--s-4); text-wrap: balance; }
h3 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-md); line-height: var(--lh-snug); }
p, ul, ol, dl { margin: 0 0 var(--s-4); }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: var(--s-1); }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-6) 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -10rem; z-index: 100;
  padding: var(--s-2) var(--s-4); border-radius: var(--r-md);
  background: var(--c-brand); color: var(--c-on-brand); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s-3); }
.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); }
.stack > * + * { margin-top: var(--s-4); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

/* Code */
code, kbd, samp, pre { font-family: var(--font-mono); }
code, kbd, samp { font-size: 0.875em; }
:not(pre) > code {
  padding: 0.1em 0.35em; border-radius: var(--r-sm);
  background: var(--c-inline-code-bg); color: var(--c-inline-code-text);
  white-space: nowrap;
}
pre {
  margin: 0; padding: var(--s-4) var(--s-5); overflow-x: auto;
  background: var(--c-code-bg); color: var(--c-code-text);
  border: 1px solid var(--c-code-border); border-radius: var(--r-lg);
  font-size: var(--fs-sm); line-height: 1.65; tab-size: 2;
}
pre code { font-size: inherit; }
pre:focus-visible { outline-offset: -2px; }
.term :focus-visible, .demo :focus-visible, .oneliner :focus-visible { outline-color: var(--c-code-str); }
pre::selection, pre ::selection { background: rgba(249, 224, 101, 0.28); color: inherit; }
.t-k { color: var(--c-code-key); }
.t-s { color: var(--c-code-str); }
.t-n, .t-b { color: var(--c-code-num); }
.t-c { color: var(--c-code-muted); }

.term {
  margin: 0; overflow: hidden;
  background: var(--c-code-bg); color: var(--c-code-text);
  border: 1px solid var(--c-code-border); border-radius: var(--r-lg);
}
.term + .term, .term + p, p + .term { margin-top: var(--s-4); }
.term pre { border: 0; border-radius: 0; background: transparent; }
.term-bar {
  display: flex; align-items: center; gap: var(--s-3); min-height: 2.75rem;
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4);
  border-bottom: 1px solid var(--c-code-rule);
  font: var(--fs-xs)/1.4 var(--font-mono); color: var(--c-code-muted);
}
.term-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-method {
  flex: none; padding: 0.15em 0.45em; border-radius: var(--r-sm);
  background: var(--c-code-str); color: #1a1316; font-weight: 700;
}
.term-status { flex: none; color: var(--c-code-num); }
.term figcaption {
  padding: var(--s-3) var(--s-4); border-top: 1px solid var(--c-code-rule);
  font-size: var(--fs-xs); color: var(--c-code-muted);
}

.copy-btn {
  display: none; flex: none; align-items: center; min-height: 2rem; padding: 0 0.7em;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
  background: var(--c-raised); color: var(--c-text);
  font: 600 var(--fs-xs)/1 var(--font-body); cursor: pointer;
}
.copy-btn:hover { background: var(--c-surface); }
.js .copy-btn { display: inline-flex; }
.term .copy-btn, .oneliner .copy-btn { border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06); color: var(--c-code-text); }
.term .copy-btn:hover, .oneliner .copy-btn:hover { background: rgba(255, 255, 255, 0.13); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 2.75rem; padding: 0 var(--s-5);
  border: 1px solid transparent; border-radius: var(--r-md);
  font: 600 var(--fs-base)/1.2 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--c-brand); color: var(--c-on-brand); }
.btn-primary:hover { background: var(--c-brand-hover); }
.btn-secondary { background: transparent; color: var(--c-text); border-color: var(--c-border-strong); }
.btn-secondary:hover { background: var(--c-surface); }
.btn-danger { background: transparent; color: var(--c-danger); border-color: currentColor; }
.btn-danger:hover { background: var(--c-danger-bg); }
.btn-sm { min-height: 2.25rem; padding: 0 var(--s-3); font-size: var(--fs-sm); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }

/* Forms */
.field { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.label { font-size: var(--fs-sm); font-weight: 600; }
.input {
  width: 100%; min-height: 2.75rem; padding: 0 var(--s-3);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-md);
  background: var(--c-raised); color: var(--c-text); font: inherit;
}
.input::placeholder { color: var(--c-muted); opacity: 1; }
.input:focus-visible { outline-offset: 1px; }
.input[aria-invalid='true'] { border-color: var(--c-danger); }
.hint { font-size: var(--fs-xs); color: var(--c-muted); }
.field-error { font-size: var(--fs-sm); color: var(--c-danger); }

/* Surfaces */
.panel { padding: var(--s-5); background: var(--c-raised); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.notice {
  margin: 0 0 var(--s-4); padding: var(--s-4) var(--s-5);
  border-left: 3px solid var(--c-border-strong); border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--c-surface); color: var(--c-text);
}
.notice > :last-child { margin-bottom: 0; }
.notice-title { display: block; margin-bottom: var(--s-1); font-weight: 650; }
.notice-warn { border-left-color: var(--c-warn); background: var(--c-warn-bg); }
.notice-warn .notice-title { color: var(--c-warn); }
.notice-ok { border-left-color: var(--c-ok); background: var(--c-ok-bg); }
.notice-error { border-left-color: var(--c-danger); background: var(--c-danger-bg); }
.badge {
  display: inline-block; padding: 0.1em 0.55em; border-radius: var(--r-pill);
  background: var(--c-surface-2); color: var(--c-muted);
  font: 600 var(--fs-xs)/1.5 var(--font-body); vertical-align: 0.1em; white-space: nowrap;
}
.badge-gold { background: var(--c-gold-bg); color: var(--c-gold-text); }
.badge-ok { background: var(--c-ok-bg); color: var(--c-ok); }
.badge-warn { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-danger { background: var(--c-danger-bg); color: var(--c-danger); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--c-raised); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.table-wrap + * { margin-top: var(--s-4); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { padding: var(--s-3) var(--s-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-border); }
thead th { background: var(--c-surface); color: var(--c-muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
td p { margin: var(--s-1) 0 0; color: var(--c-muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--c-bg); border-bottom: 1px solid var(--c-border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--header-h); }
.wordmark {
  display: inline-flex; align-items: center; gap: 0.55rem; flex: none;
  color: var(--c-text); text-decoration: none;
  font: 600 1.25rem/1 var(--font-display); letter-spacing: -0.02em;
}
.wordmark .mark { width: 1.75rem; height: 1.75rem; }
.wordmark-tld { color: var(--c-accent); }
.nav { display: flex; align-items: center; gap: var(--s-3); }
.nav a:not(.btn) { color: var(--c-text); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; padding: var(--s-2) 0; }
.nav a:not(.btn):hover { color: var(--c-accent); }
.nav-wide, .nav-article { display: none; }

/* Hero */
.hero { position: relative; isolation: isolate; overflow: hidden; padding-block: var(--s-7) var(--s-8); border-bottom: 1px solid var(--c-border); }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--c-grid) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
}
.hero-grid { display: grid; gap: var(--s-7); }
.hero-grid > * { min-width: 0; }
.hero h1 { font-size: var(--fs-hero); line-height: 1.06; letter-spacing: -0.03em; margin-bottom: var(--s-5); max-width: 17ch; }
.kicker { margin: 0 0 var(--s-3); font: 500 var(--fs-xs)/1.4 var(--font-mono); color: var(--c-accent); letter-spacing: 0.01em; }
.lede { max-width: 36rem; font-size: var(--fs-md); color: var(--c-muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-5) 0 var(--s-4); }
.hero-note { font-size: var(--fs-sm); color: var(--c-muted); margin: 0; }

/* Hero example tabs */
.demo {
  min-width: 0; overflow: hidden;
  background: var(--c-code-bg); color: var(--c-code-text);
  border: 1px solid var(--c-code-border); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.demo-tabs { display: flex; gap: var(--s-1); padding: var(--s-1) var(--s-2) 0; overflow-x: auto; border-bottom: 1px solid var(--c-code-rule); }
.demo-tabs [role='tab'] {
  flex: none; min-height: 2.75rem; margin-bottom: -1px; padding: 0 var(--s-3);
  border: 0; border-bottom: 2px solid transparent; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: transparent; color: var(--c-code-muted); cursor: pointer;
  font: 600 var(--fs-sm)/1 var(--font-body);
}
.demo-tabs [role='tab']:hover { color: var(--c-code-text); }
.demo-tabs [role='tab'][aria-selected='true'] { color: var(--c-code-text); border-bottom-color: var(--c-code-str); }
.demo-tabs [role='tab']:focus-visible { outline-offset: -3px; }
.demo-panel { margin: 0; }
.demo.is-ready { display: grid; grid-template-columns: minmax(0, 1fr); }
.demo.is-ready > .demo-panel { display: flex; flex-direction: column; grid-area: 2 / 1; }
.demo.is-ready > .demo-panel.is-inactive { visibility: hidden; }
.demo.is-ready pre { flex: 1 0 auto; }
.demo-req { align-items: baseline; }
.demo-url { flex: 1; min-width: 0; color: var(--c-code-text); overflow-wrap: anywhere; }
.demo pre { height: 23rem; border: 0; border-radius: 0; background: transparent; }
.demo figcaption { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--c-code-rule); font-size: var(--fs-xs); color: var(--c-code-muted); }

.facts { margin: 0; display: grid; gap: var(--s-5) var(--s-6); }
.facts > div { padding-top: var(--s-3); border-top: 1px solid var(--c-border); }
.facts dt { font: var(--fs-xs)/1.4 var(--font-mono); color: var(--c-muted); margin-bottom: var(--s-1); }
.facts dd { margin: 0; font: 500 var(--fs-md)/1.35 var(--font-display); }
.facts-band { padding-block: var(--s-6); border-bottom: 1px solid var(--c-border); }

/* Sections */
.section { padding-block: var(--s-8); border-bottom: 1px solid var(--c-border); }
.section-grid { display: grid; gap: var(--s-6); }
.section-grid > * { min-width: 0; }
.section-head h2 { font-size: var(--fs-xl); margin-bottom: var(--s-3); }
.section-head p { color: var(--c-muted); }
.section-body > h3:not(:first-child) { margin-top: var(--s-7); }
.section-body h4 { margin-top: var(--s-6); }
.toc { list-style: none; padding: 0; margin: var(--s-5) 0 0; font-size: var(--fs-sm); border-left: 1px solid var(--c-border); }
.toc li + li { margin-top: 0; }
.toc a { display: block; padding: var(--s-1) 0 var(--s-1) var(--s-4); color: var(--c-muted); text-decoration: none; }
.toc a:hover { color: var(--c-accent); }
.section-intro { max-width: 46rem; margin-bottom: var(--s-6); }
.section-intro h2 { font-size: var(--fs-xl); margin-bottom: var(--s-3); }
.section-intro p:last-child { color: var(--c-muted); margin-bottom: 0; }
.code-wrap { white-space: normal; overflow-wrap: anywhere; }

/* Products */
.products { display: grid; gap: var(--s-4); }
.product {
  display: flex; flex-direction: column; min-width: 0; padding: var(--s-5);
  background: var(--c-raised); border: 1px solid var(--c-border); border-radius: var(--r-lg);
}
.product-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); margin-bottom: var(--s-4); }
.product-head h3 { margin: 0; font-size: var(--fs-lg); }
.product-endpoint { font-size: var(--fs-xs); }
.product-lead { font-weight: 500; }
.product-list { list-style: none; padding: 0; margin: 0 0 var(--s-5); font-size: var(--fs-sm); color: var(--c-muted); }
.product-list li { position: relative; padding-left: var(--s-4); }
.product-list li + li { margin-top: var(--s-2); }
.product-list li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 1px; background: var(--c-accent); }
.product-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); margin: 0 0 var(--s-1); padding-top: var(--s-4); border-top: 1px solid var(--c-border); }
.product-price .price { font-size: var(--fs-xl); }
.product-unit { font-size: var(--fs-sm); color: var(--c-muted); }
.product-note { margin-bottom: var(--s-4); font-size: var(--fs-sm); color: var(--c-muted); }
.oneliner {
  display: flex; align-items: flex-start; gap: var(--s-2); margin-bottom: var(--s-4); padding-right: var(--s-2);
  background: var(--c-code-bg); border: 1px solid var(--c-code-border); border-radius: var(--r-md);
}
.oneliner pre { flex: 1 1 auto; min-width: 0; padding: var(--s-3); border: 0; border-radius: var(--r-md); background: transparent; font-size: var(--fs-xs); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.oneliner .copy-btn { margin-top: var(--s-2); }
.oneliner pre:focus-visible { outline-offset: -2px; }
.product-link { justify-self: start; align-self: start; font-size: var(--fs-sm); font-weight: 500; }

/* Payment split */
.split { display: grid; background: var(--c-raised); border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; }
.split > * { padding: var(--s-5); min-width: 0; }
.split > * + * { border-top: 1px solid var(--c-border); }
.split h3, .split h4 { margin: 0 0 var(--s-3); font-size: var(--fs-lg); }
.split-featured { box-shadow: inset 0 3px 0 var(--c-brand); }
.split-tag { margin: 0 0 var(--s-2); font: 500 var(--fs-xs)/1.4 var(--font-mono); color: var(--c-muted); }
.split .btn { margin-top: var(--s-2); }
.kv { display: grid; gap: var(--s-1) var(--s-4); margin: var(--s-5) 0; font-size: var(--fs-sm); }
.kv dt { color: var(--c-muted); }
.kv dd { margin: 0 0 var(--s-3); }
.fine { margin-top: var(--s-5); font-size: var(--fs-sm); color: var(--c-muted); max-width: 46rem; }

/* Pricing */
.price { font: 600 var(--fs-lg)/1.1 var(--font-display); letter-spacing: -0.01em; color: var(--c-text); }
.price-unit { display: block; margin-top: var(--s-1); font: var(--fs-xs)/1.3 var(--font-mono); color: var(--c-muted); }
.price-unit > span { display: block; }
.action-name { font-weight: 600; }
.price-table .group-row th { padding-top: var(--s-4); background: var(--c-surface); font: 600 var(--fs-base)/1.3 var(--font-display); }
.price-table .group-row code { margin-left: var(--s-2); font-size: var(--fs-xs); font-weight: 400; }
.price-table tbody:not(:last-child) tr:last-child > * { border-bottom: 1px solid var(--c-border); }
.section-head .compare {
  margin-top: var(--s-5); padding: var(--s-4); border-radius: var(--r-md);
  background: var(--c-gold-bg); color: var(--c-gold-text); font-size: var(--fs-sm);
}
.notes { list-style: none; padding: 0; margin: var(--s-5) 0 0; font-size: var(--fs-sm); color: var(--c-muted); }
.notes li { padding-left: var(--s-4); position: relative; }
.notes li::before { content: ''; position: absolute; left: 0; top: 0.65em; width: 6px; height: 6px; border-radius: 1px; background: var(--c-mark-clasp); }

/* Field lists */
.fields { margin: 0 0 var(--s-5); border-top: 1px solid var(--c-border); }
.fields > div { display: grid; gap: var(--s-1); padding: var(--s-3) 0; border-bottom: 1px solid var(--c-border); }
.fields dt { font-weight: 600; }
.fields dt code { padding: 0; background: none; color: var(--c-text); font-weight: 600; }
.fields .type { display: block; margin-top: 0.1rem; font: var(--fs-xs)/1.4 var(--font-mono); color: var(--c-muted); }
.fields dd { margin: 0; font-size: var(--fs-sm); }
.status-code { font: 600 var(--fs-sm)/1.3 var(--font-mono); color: var(--c-text); }
.fields dt .error-code { display: block; margin-top: var(--s-1); white-space: normal; color: var(--c-accent); }

/* Networks */
.nets { list-style: none; padding: 0; margin: 0; display: grid; border-top: 1px solid var(--c-border); }
.nets li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); margin: 0; padding: var(--s-3) 0; border-bottom: 1px solid var(--c-border); }
.net-name { font-weight: 600; }
.nets code { font-size: var(--fs-xs); }
.net-tags { margin-left: auto; font-size: var(--fs-xs); color: var(--c-muted); }

/* FAQ */
.faq { border-top: 1px solid var(--c-border); }
.faq details { border-bottom: 1px solid var(--c-border); }
.faq summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4);
  padding: var(--s-4) 0; cursor: pointer; list-style: none;
  font: 600 var(--fs-md)/1.35 var(--font-display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font: 500 var(--fs-md)/1 var(--font-mono); color: var(--c-accent); }
.faq details[open] summary::after { content: '\2212'; }
.faq details > div { padding-bottom: var(--s-4); max-width: 44rem; }
.faq details > div > :last-child { margin-bottom: 0; }

/* Footer */
.site-footer { padding-block: var(--s-6) var(--s-7); font-size: var(--fs-sm); color: var(--c-muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4) var(--s-6); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; padding: 0; margin: 0; }
.footer-links li + li { margin-top: 0; }
.site-footer a { color: var(--c-muted); }
.site-footer a:hover { color: var(--c-text); }

/* Small pages */
.page-main { padding-block: var(--s-8); }
.page-narrow { max-width: 34rem; }
.big-code { margin: 0 0 var(--s-3); font: 600 var(--fs-sm)/1 var(--font-mono); color: var(--c-accent); }

@media (max-width: 29.99em) {
  pre { padding-inline: var(--s-4); }
}

@media (min-width: 30em) {
  .kv { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .kv dd { margin: 0; }
  .nav-article { display: inline; }
}

@media (min-width: 40em) {
  .nav { gap: var(--s-5); }
  .nav-wide { display: inline; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields > div { grid-template-columns: 12rem minmax(0, 1fr); gap: var(--s-4); }
  .price-unit > span { display: inline; }
  .price-unit > span + span::before { content: '\00b7  '; }
  .nets { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); }
}

@media (min-width: 52em) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo pre { height: 26rem; }
  .split > * + * { border-top: 0; border-left: 1px solid var(--c-border); }
  .split > * { padding: var(--s-6); }
}

@media (min-width: 60em) {
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0; }
  .product { display: grid; grid-row: span 7; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); row-gap: 0; }
}

@media (min-width: 64em) {
  .hero { padding-block: var(--s-8); }
  .demo pre { height: min(30rem, 60vh); }
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: var(--s-7); }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .section-grid { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: var(--s-7); }
  .section-head { position: sticky; top: calc(var(--header-h) + var(--s-6)); align-self: start; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .copy-btn, .toc a, .nav a, .demo-tabs [role='tab'] { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
}

/* App pages: login + dashboard */
:root {
  --c-series-1: #ec8fa0;
  --c-series-2: #cf364c;
  --c-series-3: #7a1c31;
  --c-series-4: #2a78d6;
  --c-series-5: #eda100;
  --c-meter-track: rgba(146, 36, 59, 0.12);
  --c-meter-near: #c98500;
  --c-chart-hover: rgba(146, 36, 59, 0.07);
  --c-on-danger: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-series-1: #93283d;
    --c-series-2: #d9465c;
    --c-series-3: #f7a3b1;
    --c-series-4: #3987e5;
    --c-series-5: #c98500;
    --c-meter-track: rgba(247, 136, 154, 0.14);
    --c-meter-near: #f4c770;
    --c-chart-hover: rgba(247, 136, 154, 0.08);
    --c-on-danger: #151113;
  }
}

.app-main { padding-block: var(--s-6) var(--s-8); }
.btn-block { width: 100%; }
.btn[aria-busy='true'] { cursor: progress; }
.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--c-accent); font: inherit; font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
.link-btn:hover { text-decoration-thickness: 2px; }
.form-status { margin: var(--s-2) 0 0; font-size: var(--fs-sm); }
.form-status:empty { display: none; }
.form-status.is-ok { color: var(--c-ok); }
.form-status.is-error { color: var(--c-danger); }
.spinner {
  display: inline-block; flex: none; width: 1.125rem; height: 1.125rem;
  border: 2px solid var(--c-border-strong); border-top-color: var(--c-brand); border-radius: 50%;
}
.header-email {
  display: none; min-width: 0; max-width: 16rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-sm); color: var(--c-muted);
}

/* Login */
.auth-main { position: relative; isolation: isolate; overflow: hidden; }
.auth-main::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 22rem; z-index: -1;
  background-image: radial-gradient(var(--c-grid) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.auth-grid { display: grid; gap: var(--s-7); align-items: start; }
.auth-grid > * { min-width: 0; }
.auth-col { max-width: 30rem; }
.auth-col h1 { font-size: var(--fs-xl); margin-bottom: var(--s-3); }
.auth-col h1:focus { outline: none; }
.auth-intro { color: var(--c-muted); font-size: var(--fs-md); }
.auth-form { margin: var(--s-5) 0 var(--s-3); }
.auth-form .field { margin-bottom: var(--s-3); }
.auth-form .input { font-size: var(--fs-md); }
.sent-to { color: var(--c-text); font-weight: 650; overflow-wrap: anywhere; }
.sent-actions, .confirm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); margin: var(--s-5) 0 var(--s-4); }
.confirm-email { overflow-wrap: anywhere; }
.verify-row { display: flex; align-items: center; gap: var(--s-3); color: var(--c-muted); }
.auth-aside { padding-top: var(--s-5); border-top: 1px solid var(--c-border); }
.auth-aside h2 { font-size: var(--fs-md); margin-bottom: var(--s-4); }
.steps { list-style: none; padding: 0; margin: 0 0 var(--s-5); counter-reset: step; }
.steps li { position: relative; margin: 0; padding-left: 2.25rem; counter-increment: step; }
.steps li + li { margin-top: var(--s-4); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0.15em;
  font: 500 var(--fs-xs)/1.5 var(--font-mono); color: var(--c-accent);
}
.steps strong { display: block; margin-bottom: 0.1rem; }
.steps p { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }

/* Dashboard */
.dash-head { margin-bottom: var(--s-5); }
.dash-head h1 { font-size: var(--fs-xl); margin-bottom: var(--s-2); }
.dash-head p { margin: 0; }
.dash-email { color: var(--c-text); font-weight: 600; overflow-wrap: anywhere; }
.dash-loading { display: flex; align-items: center; gap: var(--s-3); padding-block: var(--s-6); color: var(--c-muted); }
.banners > .notice { margin-bottom: var(--s-5); }
.notice .cluster { margin-top: var(--s-3); }

.overview h2 { font-size: var(--fs-lg); margin: 0; }
.overview h3 { margin: var(--s-5) 0 var(--s-2); font: 600 var(--fs-xs)/1.4 var(--font-body); color: var(--c-muted); letter-spacing: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-4); }
.card-lead { margin-bottom: var(--s-2); font: 600 var(--fs-md)/1.35 var(--font-display); }
.card-text { color: var(--c-muted); font-size: var(--fs-sm); }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin: var(--s-4) 0 var(--s-3); }
.split .card-actions .btn, .split .cap-row .btn { margin-top: 0; }
.split-warn { box-shadow: inset 0 3px 0 var(--c-warn); }
.split-danger { box-shadow: inset 0 3px 0 var(--c-danger); }
.badge-dot::before {
  content: ''; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.4rem;
  border-radius: 50%; background: currentColor; vertical-align: 0.08em;
}

.spend { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); margin: 0 0 var(--s-3); }
.spend-value { font: 600 var(--fs-xl)/1 var(--font-display); letter-spacing: -0.02em; }
.spend-of { font-size: var(--fs-sm); color: var(--c-muted); }
.meter { height: 0.625rem; overflow: hidden; border-radius: var(--r-pill); background: var(--c-meter-track); }
.meter-fill { width: 0; height: 100%; border-radius: inherit; background: var(--c-brand); }
.meter.is-near .meter-fill { background: var(--c-meter-near); }
.meter.is-full .meter-fill { background: var(--c-danger); }
.meter-note { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--c-muted); font-variant-numeric: tabular-nums; }
.period-card .notice { margin: var(--s-4) 0 0; }
.period-card .notice p { font-size: var(--fs-sm); }

.action-rows { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--c-border); font-size: var(--fs-sm); }
.action-rows li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-1) var(--s-3);
  margin: 0; padding: var(--s-2) 0; border-bottom: 1px solid var(--c-border);
}
.action-rows .num { color: var(--c-muted); }
.action-rows .num strong { color: var(--c-text); font-weight: 600; }
.action-detail { display: block; font-size: var(--fs-xs); }
.action-rows .mono { white-space: nowrap; }
.swatch { display: inline-block; flex: none; width: 0.625rem; height: 0.625rem; border-radius: 2px; }
.swatch-1 { background: var(--c-series-1); }
.swatch-2 { background: var(--c-series-2); }
.swatch-3 { background: var(--c-series-3); }
.swatch-4 { background: var(--c-series-4); }
.swatch-5 { background: var(--c-series-5); border-radius: 50%; }
.action-hint { margin: var(--s-2) 0 0; }

.cap-form { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--c-border); }
.cap-form .label { display: block; margin-bottom: var(--s-2); }
.cap-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.input-affix { position: relative; flex: 1 1 8rem; max-width: 11rem; }
.input-affix .input { padding-left: 1.65rem; font-variant-numeric: tabular-nums; }
.input-affix-text { position: absolute; left: var(--s-3); top: 50%; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.cap-form .hint { margin: var(--s-2) 0 0; }

.dash-section { margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--c-border); }
.dash-section-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s-3) var(--s-5); margin-bottom: var(--s-4); }
.dash-section-head > div { min-width: 0; max-width: 40rem; }
.dash-section-head h2 { font-size: var(--fs-lg); margin-bottom: var(--s-1); }
.dash-section-head p { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }
.dash-section-head .btn { flex: none; }

/* Usage chart */
.chart-summary { margin: 0 0 var(--s-3); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; padding: 0; margin: 0 0 var(--s-3); font: var(--fs-xs)/1.4 var(--font-mono); color: var(--c-muted); }
.legend li { display: inline-flex; align-items: center; gap: var(--s-2); margin: 0; }
.chart { position: relative; min-height: 14.25rem; border-radius: var(--r-sm); touch-action: pan-y; }
.chart:focus-visible { outline-offset: 4px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart.is-loading svg { opacity: 0.5; }
.chart-grid { stroke: var(--c-border); stroke-width: 1; shape-rendering: crispEdges; }
.chart-base { stroke: var(--c-border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart-label { fill: var(--c-muted); font-family: var(--font-body); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-band { fill: transparent; }
.chart-day.is-active .chart-band { fill: var(--c-chart-hover); }
.chart.has-active .chart-day:not(.is-active) .seg { opacity: 0.4; }
.seg-1 { fill: var(--c-series-1); }
.seg-2 { fill: var(--c-series-2); }
.seg-3 { fill: var(--c-series-3); }
.seg-4 { fill: var(--c-series-4); }
.seg-5 { fill: var(--c-series-5); }
.seg-dot { stroke: var(--c-bg); stroke-width: 4px; paint-order: stroke; }
.chart-tip {
  position: absolute; left: 0; top: 0; z-index: 2; min-width: 11rem; max-width: 15rem;
  padding: var(--s-2) var(--s-3); pointer-events: none;
  background: var(--c-raised); border: 1px solid var(--c-border); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  font-size: var(--fs-xs); line-height: 1.5;
}
.tip-date { margin: 0 0 var(--s-1); color: var(--c-muted); }
.tip-row { display: grid; grid-template-columns: 0.75rem minmax(2.5rem, auto) minmax(0, 1fr); align-items: center; gap: var(--s-2); }
.tip-key { width: 0.75rem; height: 2px; border-radius: 1px; }
.tip-key.k-1 { background: var(--c-series-1); }
.tip-key.k-2 { background: var(--c-series-2); }
.tip-key.k-3 { background: var(--c-series-3); }
.tip-key.k-4 { background: var(--c-series-4); }
.tip-key.k-5 { justify-self: center; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--c-series-5); }
.tip-value { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--c-text); }
.tip-name { font-family: var(--font-mono); color: var(--c-muted); white-space: nowrap; }
.tip-total { margin: var(--s-1) 0 0; padding-top: var(--s-1); border-top: 1px solid var(--c-border); color: var(--c-text); font-variant-numeric: tabular-nums; }
.chart-empty { position: absolute; left: var(--s-4); right: var(--s-4); top: var(--s-5); max-width: 26rem; margin: 0; }
.chart-empty strong { display: block; margin-bottom: var(--s-1); font: 600 var(--fs-md)/1.35 var(--font-display); }
.chart-empty span { font-size: var(--fs-sm); color: var(--c-muted); }
.chart-error { margin: var(--s-3) 0 0; }
.chart-table { margin-top: var(--s-4); }
.chart-table summary { display: inline-block; cursor: pointer; color: var(--c-accent); font-size: var(--fs-sm); font-weight: 500; }
.chart-table[open] summary { margin-bottom: var(--s-3); }
.chart-table .table-wrap { max-height: 24rem; overflow-y: auto; }
.chart-table thead th { position: sticky; top: 0; }
.chart-table tbody th { white-space: nowrap; }

/* API keys */
.key-reveal { margin-bottom: var(--s-5); padding: var(--s-5); border: 1px solid var(--c-ok); border-radius: var(--r-lg); background: var(--c-ok-bg); }
.key-reveal h3 { margin-bottom: var(--s-2); font-size: var(--fs-md); }
.key-reveal h3:focus { outline: none; }
.key-reveal p { font-size: var(--fs-sm); }
.secret-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--s-2); margin: var(--s-3) 0 var(--s-4); }
.secret {
  flex: 1 1 16rem; min-width: 0; margin: 0; padding: var(--s-3);
  overflow-wrap: anywhere; word-break: break-all; -webkit-user-select: all; user-select: all;
  border-radius: var(--r-md); background: var(--c-code-bg); color: var(--c-code-text);
  font: var(--fs-sm)/1.5 var(--font-mono);
}
.secret-row .copy-btn { min-height: 2.75rem; padding: 0 var(--s-4); font-size: var(--fs-sm); }
.key-create {
  display: grid; gap: var(--s-3); margin-bottom: var(--s-5); padding: var(--s-4);
  border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface);
}
.key-create .field { margin: 0; }
.key-create .cluster { gap: var(--s-2); }
.key-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--c-border); }
.key-row { display: grid; gap: var(--s-3) var(--s-4); margin: 0; padding: var(--s-4) 0; border-bottom: 1px solid var(--c-border); }
li.key-row + li.key-row { margin-top: 0; }
.key-row > * { min-width: 0; }
.key-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.key-token { margin: var(--s-1) 0 0; font: var(--fs-sm)/1.4 var(--font-mono); overflow-wrap: anywhere; }
.key-meta { margin: var(--s-1) 0 0; font-size: var(--fs-xs); color: var(--c-muted); }
.key-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.key-row.is-confirming { padding-inline: var(--s-4); background: var(--c-danger-bg); }
.key-confirm { grid-column: 1 / -1; }
.key-confirm p { margin: 0 0 var(--s-3); font-size: var(--fs-sm); }
.key-confirm .btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: var(--c-on-danger); }
.key-confirm .btn-danger:hover { opacity: 0.9; }
.key-row .form-status { grid-column: 1 / -1; margin: 0; }
.keys-empty { margin: 0; padding: var(--s-5) 0 0; border-top: 1px solid var(--c-border); color: var(--c-muted); }
.keys-empty strong { display: block; color: var(--c-text); }

@media (min-width: 30em) {
  .action-detail { display: inline; font-size: inherit; }
  .action-detail::before { content: ' \00b7  '; }
}

@media (min-width: 40em) {
  .header-email { display: block; }
  .header-email:empty { display: none; }
  .key-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .key-create { grid-template-columns: minmax(0, 22rem) auto; align-items: end; }
}

@media (min-width: 52em) {
  .auth-grid { grid-template-columns: minmax(0, 30rem) minmax(0, 21rem); justify-content: space-between; gap: var(--s-8); }
  .auth-aside { margin-top: var(--s-7); padding: var(--s-1) 0 var(--s-1) var(--s-6); border-top: 0; border-left: 1px solid var(--c-border); }
}

@media (prefers-reduced-motion: no-preference) {
  .spinner { animation: invy-spin 0.8s linear infinite; }
  .meter-fill { transition: width 0.4s ease, background-color 0.2s ease; }
  .chart svg, .seg { transition: opacity 0.15s ease; }
  .link-btn { transition: color 0.15s ease; }
}

@keyframes invy-spin { to { transform: rotate(360deg); } }
