/* ==========================================================================
   pay.ifinsta.com — one stylesheet for hosted pages, the back office and the dashboard.

   The ifinsta "property" kit on ifinmail's Smooth surfaces: quiet, flat,
   premium. Blue means interactive, navy marks the brand, one primary action
   per screen. Edges are a pale 1 px hairline and there are NO box shadows:
   depth comes from hairlines, one soft blue wash on the hero, and white on
   grey. Records sit in one grouped card with hairline rows; the key number
   is a hero; money is mono and tabular; status is a word on a tint, never
   colour alone. On a phone the cards dissolve into one continuous surface
   with hairline dividers.
   Tokens only below :root; components never write a literal colour.
   Light, dark (follows the device, or data-theme) and high contrast.
   ========================================================================== */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* `.pv` is the settings preview, a framed sample of a payer page: it carries
   its own copy of the scheme it shows (`data-mode`), so a merchant's theme can
   be tried in light and dark whatever the dashboard around it is showing. */
:root, .pv[data-mode="light"] {
  --paper: #e9edf3;      /* page behind sparse pages (payer, sign-in, home): darker than the cards, so they read in a bright room */
  --paper-work: #e5eaf1; /* work surface: white cards remain distinct in a bright room */
  --raised: #ffffff;     /* cards, inputs, sheets */
  --sunk: #edf0f5;       /* neutral badges, code */
  --hover: #f1f4f9;
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #4b5563;
  --faint: #5f6773;
  --line: #d5dbe4;       /* dividers and card edges: a hairline that survives glare */
  --line-strong: #858fa1; /* control edges (inputs, ghost buttons): 3:1 on a card */

  /* Interactive only: links, buttons, focus, the selected item. */
  --accent: #1a56db;
  --accent-deep: #1e40af;
  --accent-tint: #e8f0fe;
  --accent-subtle: #f0f4ff;
  --on-accent: #ffffff;
  --halo: rgba(26, 86, 219, 0.16);
  /* Link text. A merchant's theme gives it a shade that reaches 4.5:1 where the
     fill colour only needs 3:1; high contrast keeps it equal to the action. */
  --link: var(--accent);
  --link-hover: var(--accent-deep);
  --art: 0.55;         /* the dot lattice behind pages with room; 0 turns it off */

  /* The wordmark and brand tile. Never interactive. */
  --brand: #0f2b5b;
  --on-brand: #ffffff;

  /* Markers, never interactive: counters and warnings in prose. */
  --signal: #a84a07;
  --signal-tint: #fef3c7;

  --ok: #047857;
  --ok-tint: #d1fae5;
  --warn: #b45309;
  --warn-tint: #fef3c7;
  --bad: #b91c1c;
  --bad-tint: #fee2e2;
  --info: #1e40af;
  --info-tint: #e8f0fe;

  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

  --r-sm: 4px;
  --r: 6px;            /* buttons, inputs, rows */
  --r-lg: 8px;         /* panels, cards */
  --r-dialog: 12px;    /* the sheet, sign-in */
  --r-badge: 4px;      /* status: a word on a tint */
  --r-full: 9999px;


  /* 4 px base grid. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --control: 36px;
  --control-form: 40px;
  --header: 48px;
  --sidebar: 208px;
  --rail: 52px;
  --content: 1280px;
  --ease: 150ms ease-out;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="contrast"]) {
    --paper: #070c17; --paper-work: #0a111e; --raised: #111a2b; --sunk: #0f1829; --hover: #1b2433;
    --ink: #f3f4f6; --ink-soft: #d1d5db; --muted: #b6bdc9; --faint: #9ca3af;
    --line: #33405a; --line-strong: #5b6c8a;
    --accent: #7baaff; --accent-deep: #a9c6ff; --accent-tint: #16284d; --accent-subtle: #121f3a; --on-accent: #0b1220;
    --halo: rgba(123, 170, 255, 0.28);
    --art: 0.36;
    --brand: #e5ecff; --on-brand: #0b1220;
    --signal: #fbbf24; --signal-tint: #3a2a08;
    --ok: #6ee7b7; --ok-tint: #0b3a2e; --warn: #fcd34d; --warn-tint: #3a2a08;
    --bad: #fca5a5; --bad-tint: #3b1414; --info: #93c5fd; --info-tint: #14284a;
  }
}
:root[data-theme="dark"], .pv[data-mode="dark"] {
  --paper: #070c17; --paper-work: #0a111e; --raised: #111a2b; --sunk: #0f1829; --hover: #1b2433;
  --ink: #f3f4f6; --ink-soft: #d1d5db; --muted: #b6bdc9; --faint: #9ca3af;
  --line: #33405a; --line-strong: #5b6c8a;
  --accent: #7baaff; --accent-deep: #a9c6ff; --accent-tint: #16284d; --accent-subtle: #121f3a; --on-accent: #0b1220;
  --halo: rgba(123, 170, 255, 0.28);
  --art: 0.36;
  --brand: #e5ecff; --on-brand: #0b1220;
  --signal: #fbbf24; --signal-tint: #3a2a08;
  --ok: #6ee7b7; --ok-tint: #0b3a2e; --warn: #fcd34d; --warn-tint: #3a2a08;
  --bad: #fca5a5; --bad-tint: #3b1414; --info: #93c5fd; --info-tint: #14284a;
}
/* High contrast: black and white, a yellow action, a white border. */
:root[data-theme="contrast"] {
  --paper: #000000; --paper-work: #000000; --raised: #000000; --sunk: #1f1f1f; --hover: #1f1f1f;
  --ink: #ffffff; --ink-soft: #ffffff; --muted: #e5e5e5; --faint: #e5e5e5;
  --line: #8c8c8c; --line-strong: #ffffff;
  --accent: #ffd400; --accent-deep: #ffe766; --accent-tint: #2b2400; --accent-subtle: #1f1b00; --on-accent: #000000;
  --halo: rgba(255, 212, 0, 0.4);
  --link: var(--accent); --link-hover: var(--accent-deep);
  --art: 0;
  --brand: #ffffff; --on-brand: #000000;
  --signal: #ffd400; --signal-tint: #2b2400;
  --ok: #86efac; --ok-tint: #052e16; --warn: #fde047; --warn-tint: #2b2400;
  --bad: #fca5a5; --bad-tint: #3b0a0a; --info: #bfdbfe; --info-tint: #0a1f44;
}

:root[data-theme="contrast"] .hero, :root[data-theme="contrast"] .sheet-hero { background: var(--raised); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; margin: 0 0 var(--s3); }
ul, ol { padding-inline-start: var(--s5); }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent-tint); }
code, pre, .mono { font-family: var(--mono); }
.num, .tabular, .r { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: var(--paper); padding: var(--s2) var(--s4); border-radius: var(--r-sm); }
.skip:focus { left: 8px; }

/* Kicker: the quiet label above a title. A marker, never interactive. */
.kicker {
  font: 500 12px/1.4 var(--sans);
  color: var(--faint);
  margin: 0 0 6px;
}

/* Status is a word on a tint, never colour alone. */
.status {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px; border-radius: var(--r-badge);
  font: 600 12px/1 var(--sans); white-space: nowrap;
  background: var(--sunk); color: var(--ink-soft);
}
.status.ok { background: var(--ok-tint); color: var(--ok); }
.status.warn { background: var(--warn-tint); color: var(--warn); }
.status.bad { background: var(--bad-tint); color: var(--bad); }
.status.info { background: var(--info-tint); color: var(--info); }

/* Buttons: one primary per screen. Secondary has a border, a link action has none. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: var(--control); padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r);
  background: var(--accent); color: var(--on-accent);
  font: 500 13px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.btn:hover { background: var(--accent-deep); border-color: transparent; color: var(--on-accent); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--raised); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--accent-subtle); border-color: var(--accent); color: var(--ink); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--link); padding: 0 var(--s2); }
.btn.quiet:hover { background: var(--accent-subtle); border-color: transparent; color: var(--link-hover); }
.btn.danger { background: var(--raised); color: var(--bad); border-color: var(--line-strong); }
.btn.danger:hover { background: var(--bad-tint); border-color: transparent; color: var(--bad); }
.btn.quiet.danger { background: transparent; border-color: transparent; color: var(--bad); }
.btn.quiet.danger:hover { background: var(--bad-tint); border-color: transparent; color: var(--bad); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.block { width: 100%; height: var(--control-form); }
.btn.small { height: 30px; padding: 0 var(--s3); font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic-lg { width: 18px; height: 18px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control); height: var(--control); padding: 0;
  border: 1px solid transparent; border-radius: var(--r);
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background-color var(--ease), color var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.ic { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Forms. */
.field { display: grid; gap: 6px; margin: 0 0 var(--s3); }
.field label, form > label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field .hint, form > .hint { font-size: 12px; color: var(--faint); }
form > label { display: block; margin: var(--s3) 0 6px; }
form > label:first-child { margin-top: 0; }
form > .input + label { margin-top: var(--s4); }
.input, select.input, textarea.input {
  width: 100%; height: var(--control-form); padding: 0 var(--s3);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--raised); color: var(--ink); font: 14px var(--sans);
  transition: border-color var(--ease);
}
textarea.input { height: auto; padding: var(--s2) var(--s3); font: 13px/1.6 var(--mono); resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:hover, select.input:hover, textarea.input:hover { border-color: var(--faint); }
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--accent);
}
.input.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
form > .btn, form > .btn:first-of-type { margin-top: var(--s3); }
form > .form-note { margin: var(--s3) 0 0; font-size: 12px; line-height: 1.5; }
.alert {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--raised); padding: var(--s3) var(--s4); margin: 0 0 var(--s4);
  font-size: 13px; color: var(--ink-soft);
}
.alert.bad { border-color: transparent; background: var(--bad-tint); color: var(--bad); }
.alert.ok { border-color: transparent; background: var(--ok-tint); color: var(--ok); }
.alert .label { display: block; font: 600 12px/1.4 var(--sans); color: inherit; margin-bottom: 2px; }
.alert > a { color: inherit; text-decoration: underline; }

/* Small quiet chips: environment, business, mode. */
.env, .env-chip, .biz-chip, .mode {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px; border-radius: var(--r-badge);
  font: 600 12px/1 var(--sans); white-space: nowrap;
  background: var(--sunk); color: var(--ink-soft);
}
.env, .env-chip { background: var(--warn-tint); color: var(--warn); }
.biz-chip { background: var(--accent-tint); color: var(--accent-deep); }
.mode-chip {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px; border-radius: var(--r-badge);
  font: 600 12px/1 var(--sans); white-space: nowrap;
  background: var(--warn-tint); color: var(--warn);
}
.mode-chip.live { background: var(--ok-tint); color: var(--ok); }
.mode { background: var(--warn-tint); color: var(--warn); }

/* ===================================================================== pay
   Hosted payer pages: phone first, one column, the engine's frame around
   the merchant's brand. */

.pay-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
/* The identity row opening a payer sheet: the merchant's tile, a line of text,
   and the Test mode chip when no real money moves. */
.who-row { display: flex; align-items: center; gap: var(--s2); min-width: 0; margin: 0 0 var(--s3); }
.tile {
  flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); font: 700 12px var(--sans); letter-spacing: -0.02em; border-radius: var(--r);
}
/* A merchant's own logo: larger than the initial, never cropped, on the card. */
.tile.has-logo { width: 36px; height: 36px; background: var(--raised); border: 1px solid var(--line); }
.tile img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--r); }
.who-name { flex: 1; min-width: 0; font: 500 13px/1.4 var(--sans); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-row .mode { flex: 0 0 auto; }
.pay-main { flex: 1; display: flex; justify-content: center; padding: var(--s8) var(--s4) var(--s10); }
.pay-col { width: 100%; max-width: 440px; min-width: 0; }

/* The sheet: the one lifted surface. */
.sheet {
  --sheet-x: var(--s6); --sheet-y: var(--s6);
  position: relative; background: var(--raised);
  border: 1px solid var(--line); border-radius: var(--r-dialog);
  padding: var(--sheet-y) var(--sheet-x);
}
/* The sheet's head: who is asking, how much, for what, on a soft wash. */
.sheet-hero {
  margin: calc(-1 * var(--sheet-y)) calc(-1 * var(--sheet-x)) var(--s5); padding: var(--sheet-y) var(--sheet-x) var(--s4);
  border-radius: var(--r-dialog) var(--r-dialog) 0 0;
  background: linear-gradient(180deg, var(--accent-subtle), var(--raised));
}
.sheet-hero > :last-child { margin-bottom: 0; }
.sheet h1 { font-size: 20px; font-weight: 600; margin-bottom: var(--s2); }
.sheet .muted { font-size: 14px; }

.amount { font: 600 clamp(30px, 9vw, 36px)/1.1 var(--mono); letter-spacing: -0.03em; margin: var(--s1) 0 var(--s3); font-variant-numeric: tabular-nums; }
.meta {
  display: flex; flex-wrap: wrap; gap: 4px var(--s4);
  font: 12px/1.6 var(--mono); color: var(--faint);
  padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--line);
}
.meta b { color: var(--ink-soft); font-weight: 600; }
.desc { color: var(--muted); font-size: 14px; margin: -4px 0 var(--s4); }

/* Methods: an exclusive disclosure list that works without scripts. */
.methods { display: grid; gap: var(--s2); }
.method { border: 1px solid var(--line); background: var(--raised); border-radius: var(--r-lg); overflow: hidden; transition: border-color var(--ease), background-color var(--ease); }
.method[open] { border-color: var(--accent-tint); background: var(--accent-subtle); }
.method > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s3);
  min-height: 52px; padding: var(--s2) var(--s4);
}
.method > summary::-webkit-details-marker { display: none; }
.method > summary::before {
  content: ""; flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--faint); background: var(--raised);
}
.method[open] > summary::before { border: 5px solid var(--accent); }
.method.m-disclosure > summary::before {
  width: 7px; height: 7px; margin: 0 4px; border: 0;
  border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint);
  border-radius: 1px; background: transparent; transform: rotate(-45deg);
  transition: transform var(--ease), border-color var(--ease);
}
.method.m-disclosure[open] > summary::before {
  border: 0; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg);
}
.method .m-label { font-weight: 600; }
.method .m-flow { margin-inline-start: auto; font: 12px var(--sans); color: var(--faint); }
.method .m-body { padding: 0 var(--s4) var(--s4); }
.method .m-body p { font-size: 13px; color: var(--muted); }
/* A method whose provider is suspended or reports it down stays on the page,
   marked unavailable, so the payer sees it is not gone for good. */
.methods.unavailable { margin-top: var(--s4); }
.method.off { background: var(--sunk); color: var(--muted); }
.method.off .m-row { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: var(--s2) var(--s4); }
.p-body > details.method { margin-bottom: var(--s2); }
.p-body > details.method:last-child { margin-bottom: 0; }

/* Waiting and results. */
.state { text-align: start; }
.state h1 { font-size: 20px; margin: 0 0 var(--s2); }
.state .lede { color: var(--muted); }
.pulse {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 0 var(--s4);
  border: 3px solid var(--accent-tint); border-top-color: var(--accent); /* a spinner, not an edge */
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; border-color: var(--accent); } }
.mark-ok, .mark-bad {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin: 0 0 var(--s4);
  font: 600 22px var(--sans);
}
.mark-ok { background: var(--ok-tint); color: var(--ok); }
.mark-bad { background: var(--bad-tint); color: var(--bad); }
.instructions {
  list-style: none; margin: 0 0 var(--s4); padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); overflow: hidden;
  font: 13px/1.5 var(--mono);
}
.instructions li { padding: 10px var(--s3); border-bottom: 1px solid var(--line); }
.instructions li:last-child { border-bottom: 0; }
.instructions .copy-text { padding: 2px 6px; }
.instructions .btn { height: 28px; font-size: 12px; padding: 0 8px; margin-inline-start: 4px; }
.qr { width: min(240px, 100%); margin: 0 auto var(--s4); padding: var(--s3); background: #ffffff; /* literal: a QR code needs a white ground in every theme */ border: 1px solid var(--line); border-radius: var(--r-lg); }
.qr svg, .qr img { display: block; width: 100%; height: auto; }
.actions { display: grid; gap: var(--s2); margin-top: var(--s4); }
.receipt { width: 100%; border-collapse: collapse; font: 13px/1.5 var(--mono); margin: var(--s3) 0 var(--s4); font-variant-numeric: tabular-nums; }
.receipt .copy-text { font-size: 11.5px; letter-spacing: -0.02em; }
.receipt th { vertical-align: top; text-align: start; font-weight: 500; color: var(--faint); padding: 6px 0; width: 42%; font-size: 12px; }
.receipt td { padding: 6px 0; vertical-align: top; text-align: end; border-bottom: 1px solid var(--line); }
.pay-foot { padding: var(--s4); text-align: center; font-size: 12px; color: var(--faint); }
.pay-foot b { color: var(--muted); font-weight: 600; }

/* ============================================================ back office and dashboard
   The operator back office and the merchant dashboard: a 48 px header, a 208 px sidebar that
   folds to a 52 px rail, panels with 1 px borders, content to 1280 px. */

.c-shell { background: var(--paper-work); min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; grid-template-rows: var(--header) 1fr; }
.c-shell.has-nav { grid-template-columns: var(--sidebar) minmax(0, 1fr); grid-template-rows: 1fr; transition: grid-template-columns var(--ease); }
.c-shell.has-nav.is-rail { grid-template-columns: var(--rail) minmax(0, 1fr); }

/* The slim bar: only for a page with no navigation (a signed-out dashboard page). */
.c-top {
  grid-column: 1 / -1; grid-row: 1;
  display: flex; align-items: center; gap: var(--s3);
  min-height: var(--header); padding: 0 var(--s4);
  background: color-mix(in srgb, var(--raised) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.c-top .spacer { flex: 1; }
.c-top form { margin: 0; }
.lockup { display: flex; align-items: center; gap: var(--s2); color: var(--brand); text-decoration: none; font-weight: 700; letter-spacing: -0.2px; white-space: nowrap; }
.lockup .glyph {
  width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand);
  font: 700 12px var(--sans); letter-spacing: -0.04em; border-radius: var(--r);
}
.lockup .word { font-size: 16px; color: var(--brand); font-weight: 600; letter-spacing: -0.3px; }
.lockup .word b { color: var(--brand); font-weight: 700; }
.nav-toggle[hidden] { display: none; }
.who-avatar {
  flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: var(--r-full); background: var(--accent); color: var(--on-accent);
  font: 600 11px var(--sans);
}
.biz-switch { display: flex; align-items: center; gap: 4px; }
.biz-switch .input { flex: 1 1 auto; min-width: 0; width: auto; height: 32px; font-size: 13px; padding: 0 var(--s2); background: var(--paper); }

/* The sidebar: brand and environment on top, navigation in the middle, the
   account and the collapse button at the bottom. One component, every page. */
.c-side {
  grid-column: 1; grid-row: 1;
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; z-index: 30;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--raised); border-right: 1px solid var(--line);
}
.s-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); padding: var(--s3) var(--s3) var(--s2); }
.s-chips { display: flex; flex-wrap: wrap; gap: var(--s1); min-width: 0; }
.s-chips > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 20px; height: 20px; }
.s-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 var(--s2) var(--s3); }
.c-main { grid-column: 1 / -1; grid-row: 2; padding: var(--s6) var(--s8) var(--s10); min-width: 0; width: 100%; max-width: var(--content); margin: 0 auto; }
.c-shell.has-nav .c-main { grid-column: 2; grid-row: 1; }
.c-side .group { font: 500 12px/1.4 var(--sans); color: var(--faint); padding: 12px var(--s2) 4px; margin: 0; white-space: nowrap; }
.c-side .s-nav a {
  display: flex; align-items: center; gap: var(--s2);
  height: 32px; margin: 1px 0; padding: 0 var(--s2);
  color: var(--ink-soft); text-decoration: none; font: 500 13px/1 var(--sans); border-radius: var(--r);
  transition: background-color var(--ease), color var(--ease);
  white-space: nowrap;
}
.c-side .s-nav a:hover { background: var(--hover); color: var(--ink); }
.c-side .s-nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.c-side a .nl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.c-side .count { font: 600 11px var(--mono); color: var(--bad); background: var(--bad-tint); padding: 1px 6px; border-radius: var(--r-full); }

/* The footer: the account row opens a menu; the collapse button sits beside it. */
.s-foot { position: relative; display: flex; align-items: center; gap: var(--s1); padding: var(--s2); border-top: 1px solid var(--line); }
.acct { flex: 1; min-width: 0; }
.acct > summary { list-style: none; }
.acct > summary::-webkit-details-marker { display: none; }
.acct-row { display: flex; align-items: center; gap: var(--s2); min-width: 0; padding: var(--s1) var(--s2); border-radius: var(--r); cursor: pointer; transition: background-color var(--ease); }
.acct-row:hover, .acct[open] > .acct-row { background: var(--hover); }
.acct-text { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.acct-name { font: 600 13px var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-sub { font: 500 11.5px var(--sans); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-chev { flex: 0 0 auto; width: 14px; height: 14px; color: var(--faint); }
.acct-menu {
  position: absolute; z-index: 40; left: var(--s2); bottom: calc(100% + var(--s1)); width: 256px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  padding: var(--s2);
}
.acct-id { display: grid; gap: 2px; margin: 0; padding: var(--s2) var(--s2) var(--s3); border-bottom: 1px solid var(--line); font-size: 13px; }
.acct-id b { font-weight: 600; color: var(--ink); }
.acct-id .mono { font-size: 11.5px; color: var(--faint); overflow-wrap: anywhere; }
.acct-theme { display: grid; gap: var(--s2); padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line); }
.acct-theme[hidden] { display: none; }
.acct-label { font: 500 12px var(--sans); color: var(--faint); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s1); }
.seg button { height: 30px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); color: var(--ink-soft); font: 500 12px var(--sans); cursor: pointer; }
.seg button:hover { background: var(--hover); }
.seg button[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.acct-menu form { margin: var(--s1) 0 0; }
.acct-out { display: flex; align-items: center; gap: var(--s2); width: 100%; height: 34px; padding: 0 var(--s2); border: 0; border-radius: var(--r); background: transparent; color: var(--ink-soft); font: 500 13px var(--sans); cursor: pointer; }
.acct-out:hover { background: var(--bad-tint); color: var(--bad); }
.s-foot .nav-toggle { flex: 0 0 auto; }

/* Rail: icons only. The environment becomes a dot, the account an avatar whose
   menu opens to the side. */
.c-shell.is-rail .s-top { padding-inline: var(--s2); justify-items: center; }
.c-shell.is-rail .lockup .word, .c-shell.is-rail .s-top .biz-switch, .c-shell.is-rail .c-side .group, .c-shell.is-rail .c-side .nl, .c-shell.is-rail .c-side .count,
.c-shell.is-rail .acct-text, .c-shell.is-rail .acct-chev { display: none; }
.c-shell.is-rail .s-nav { padding-inline: 6px; }
.c-shell.is-rail .c-side .s-nav a { justify-content: center; padding: 0; }
.c-shell.is-rail .s-chips { justify-content: center; }
.c-shell.is-rail .s-chips > span { width: 10px; height: 10px; padding: 0; border-radius: 50%; }
.c-shell.is-rail .s-chips .chip-text { display: none; }
.c-shell.is-rail .env, .c-shell.is-rail .mode-chip { background: var(--warn); }
.c-shell.is-rail .mode-chip.live { background: var(--ok); }
.c-shell.is-rail .biz-chip { background: var(--accent); }
.c-shell.is-rail .s-foot { flex-direction: column; padding-inline: 6px; }
.c-shell.is-rail .acct { flex: 0 0 auto; }
.c-shell.is-rail .acct-menu { left: calc(100% + var(--s1)); bottom: var(--s2); }
.c-shell.is-rail .nav-toggle svg { transform: scaleX(-1); }
.c-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); }
.c-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.c-head .aside { font-size: 12px; color: var(--faint); white-space: nowrap; }
.c-head .aside.mono { white-space: normal; overflow-wrap: anywhere; }

/* Stat strip: separate bordered cards. */
.stats {
  display: flex; flex-wrap: wrap; margin-bottom: var(--s5);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.stats > .stat { flex: 1 1 170px; min-width: 0; margin: 0 -1px -1px 0; padding: var(--s4) var(--s5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat .big { font: 600 22px/1.2 var(--mono); letter-spacing: -0.04em; white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .big.bad { color: var(--bad); }
.stat .lbl { display: block; margin-top: 6px; font: 500 12px/1.4 var(--sans); color: var(--muted); }

/* Panels. */
.panel {
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: var(--s4); overflow: hidden;
}
.panel > .p-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 48px; padding: var(--s3) 18px; border-bottom: 1px solid var(--line); }
.panel > .p-head h2 { font-size: 15px; font-weight: 600; }
.panel > .p-head > .faint, .panel > .p-head > .muted { font-size: 12px; color: var(--faint); }
.panel > .p-head .btn { height: 30px; }
.panel > .p-head h2 + a { margin-inline-end: auto; margin-inline-start: var(--s3); font-size: 12px; }
.panel > .p-body { padding: var(--s4) 18px; }
.panel > .p-body.flush { padding: 0; }
.panel > .p-body + .p-body { border-top: 1px solid var(--line); }
.p-body > form + form { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.c-head h1 .status { vertical-align: middle; margin-inline-start: var(--s2); }
.p-head .status { flex: 0 0 auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }

/* Hero: the one number that matters, on a soft blue wash. At most one action. */
.hero {
  display: flex; flex-direction: column; gap: var(--s2); min-width: 0;
  padding: var(--s5); margin-bottom: var(--s5);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-subtle), var(--raised) 72%);
}
.hero .label { font: 500 13px/1.4 var(--sans); color: var(--muted); }
.hero .figure { font: 600 clamp(26px, 5vw, 32px)/1.15 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.hero .caption { margin: 0; font-size: 13px; color: var(--muted); }
.hero .foot { display: flex; align-items: center; gap: var(--s3); margin-top: auto; padding-top: var(--s2); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s4); align-items: stretch; margin-bottom: var(--s5); }
.hero-grid > .hero, .hero-grid > .stats { margin-bottom: 0; }
@media (max-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* Data tables: a sunk head, hairlines, a calm hover. */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font: 13px/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.tbl th {
  text-align: start; font: 500 12px var(--sans); color: var(--faint);
  padding: 10px var(--s4); border-bottom: 1px solid var(--line); background: transparent; white-space: nowrap;
}
.tbl td { padding: 10px var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr { transition: background-color var(--ease); }
.tbl tbody tr:hover td { background: var(--accent-subtle); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .mono { font-size: 12.5px; overflow-wrap: anywhere; }
.tbl .r { text-align: end; white-space: nowrap; }
.tbl td.r { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tbl .wrap { white-space: normal; word-break: break-word; min-width: 140px; }
.tbl .url { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; overflow-wrap: anywhere; }
.tbl td form { margin: 0; }
.tbl td form > .btn { margin-top: 0; }
.tbl .btn { white-space: nowrap; }
.data-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.data-list li { display: flex; flex-wrap: wrap; gap: 0 6px; }
.data-list .dl-k { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.tbl a { text-decoration: none; font-weight: 500; }
.tbl a:hover { text-decoration: underline; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 0; font-size: 13px; margin: 0 0 var(--s3); }
.kv:last-child { margin-bottom: 0; }
.p-body > .stats:first-child { margin-bottom: var(--s4); }
.kv dt { padding: 8px 0; color: var(--faint); font: 500 12px/1.8 var(--sans); border-bottom: 1px solid var(--line); }
.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; word-break: break-word; }
.empty { padding: var(--s8) var(--s5); text-align: center; color: var(--muted); }
.empty p { margin: 0 0 var(--s3); font-size: 14px; }
.empty p:last-child { margin-bottom: 0; }
pre.json {
  margin: 0; padding: var(--s4) 18px; background: var(--sunk); color: var(--ink-soft);
  border: 1px solid var(--line); font: 12px/1.6 var(--mono);
  overflow-x: auto; max-height: 340px; border-radius: var(--r-lg); white-space: pre-wrap; word-break: break-word;
}
.timeline { list-style: none; margin: 0; padding: 0 0 0 var(--s4); border-inline-start: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 var(--s3) var(--s3); font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline .t { font: 11.5px var(--mono); color: var(--faint); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.toolbar form { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.toolbar .input { width: auto; min-width: 150px; height: var(--control); font-size: 13px; }
.toolbar > .btn { margin: 0; }
.toolbar label { margin: 0; }

/* Filters: a bordered card of labelled fields, wrapping down to one column. */
.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s3) var(--s3); align-items: end;
  margin: 0 0 var(--s4);
}
.filters label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.filters .input { height: var(--control); font-size: 13px; }
.filters .btn { margin: 0; height: var(--control); }
.filters .btn.block, .filters .btn.small { width: auto; }
.filter-note { grid-column: 1 / -1; font-size: 12px; color: var(--faint); margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.row-actions form { display: inline-flex; margin: 0; }
.note-strip {
  border: 1px solid transparent; border-radius: var(--r-lg); background: var(--info-tint);
  padding: var(--s3) var(--s4); font: 13px/1.6 var(--sans); color: var(--info); margin-bottom: var(--s4);
}
.note-strip b { color: inherit; }

/* Sign-in: one quiet card, centred, no decoration. */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s4); }
.auth .sheet { width: 100%; max-width: 400px; }
.auth h1 { font-size: 20px; margin-bottom: var(--s2); }
.auth .kicker { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.auth p { font-size: 13px; }
.auth .btn.block { margin-bottom: var(--s3); }
.auth .btn.block:last-child { margin-bottom: 0; }
.stack { display: grid; gap: 0; margin: 0; }
.or { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0; color: var(--faint); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or span { flex: 0 0 auto; }
.foot-note { margin: var(--s5) 0 0; font-size: 12px; color: var(--faint); }
.auth .hint { font-size: 12px; color: var(--faint); margin: 0 0 var(--s4); }
.auth .alert { margin-bottom: var(--s4); }

.sheet-brand { margin: 0 0 var(--s5); }

/* Home: two doors, one quiet card. */
.home .sheet { max-width: 460px; }
.home h1 { font-size: 24px; font-weight: 700; }
.home-paths { display: grid; gap: var(--s2); margin: var(--s5) 0 0; }
.home-path {
  display: grid; gap: 1px; padding: var(--s3) var(--s4);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--raised); color: var(--ink); text-decoration: none;
  transition: border-color var(--ease), background-color var(--ease);
}
.home-path:hover { border-color: var(--accent-tint); background: var(--accent-subtle); color: var(--ink); }
.home-path:focus-visible { border-color: var(--accent); }
.home-path .hp-k { font-size: 14px; font-weight: 600; color: var(--accent); }
.home-path .hp-d { font-size: 13px; color: var(--muted); }

/* ============================================================ public site
   The pages that need no account: landing, features, pricing, docs,
   changelog, about, contact, terms, privacy and security. One readable
   column on the sparse paper; a translucent hairline header like the
   back office's. Prose pages are calm: the dot lattice stays behind the payer
   sheets, sign-in and home cards. */

.site { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.site-wrap { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 var(--s5); }
.site-wrap.narrow { max-width: 960px; }
.site-h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 var(--s2); }

/* Header: brand, quiet links, the sign-in actions; on phones the links become
   a scrollable tab strip, like the back office's navigation. */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--raised) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head-in { min-height: var(--header); display: flex; align-items: center; gap: var(--s5); }
.site-nav { display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.site-nav a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 var(--s2);
  border-radius: var(--r); color: var(--ink-soft); text-decoration: none;
  font: 500 13px/1 var(--sans); white-space: nowrap;
  transition: background-color var(--ease), color var(--ease);
}
.site-nav a:hover { background: var(--hover); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.site-actions { display: flex; align-items: center; gap: var(--s2); margin-inline-start: auto; }

/* Landing: a soft blue wash behind the headline, then the example screen and
   the doors into the signed-in areas. */
.site-band { background: linear-gradient(180deg, var(--accent-subtle), var(--paper)); }
.site-band > .site-wrap { padding-block: var(--s8); }
.site-hero h1 { font: 700 clamp(24px, 5vw, 34px)/1.2 var(--sans); letter-spacing: -0.02em; margin: 0 0 var(--s3); }
.site-lede { font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 62ch; margin: 0; }
.site-actions-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.site-facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4);
  margin: var(--s5) 0 0; padding: 0;
  font: 500 13px/1.5 var(--sans); color: var(--muted);
}
.site-facts li { display: flex; align-items: center; gap: var(--s2); }
.site-facts li::before { content: ""; flex: 0 0 auto; width: 4px; height: 4px; border-radius: var(--r-full); background: var(--accent); }
.site-proof { max-width: 640px; margin: 0 auto; }

/* Sections of prose and panels. */
.site-section { padding: var(--s8) var(--s4); }
.site-section.alt { background: var(--paper-work); border-block: 1px solid var(--line); }
.site-sec { margin-bottom: var(--s6); }
.site-sec h2 { font: 600 20px/1.3 var(--sans); letter-spacing: -0.01em; margin: 0 0 var(--s2); }
.site-sec > p { color: var(--muted); margin: 0; max-width: 62ch; }
.site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.site-note { font-size: 12px; color: var(--faint); }
.site-more { display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--sans); text-decoration: none; }
.site-more:hover { text-decoration: underline; }

/* Docs: the on-this-page list beside the article; sticky on wide screens. */
.site-docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s8); align-items: start; }
.site-toc { position: sticky; top: calc(var(--header) + var(--s4)); }
.site-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-toc a { display: block; padding: 4px var(--s2); border-radius: var(--r); color: var(--muted); text-decoration: none; font: 500 13px/1.4 var(--sans); }
.site-toc a:hover { background: var(--hover); color: var(--ink); }
.site-toc a[aria-current="true"] { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.prose pre {
  margin: 0 0 var(--s4); padding: var(--s3) var(--s4);
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-lg);
  font: 12.5px/1.6 var(--mono); color: var(--ink-soft);
  overflow-x: auto; white-space: pre;
}
.prose pre code { background: transparent; padding: 0; color: inherit; }
/* Changelog: releases as hairline-divided rows of one grouped card. */
.site-rel { padding: var(--s5) 18px; }
.site-rel + .site-rel { border-top: 1px solid var(--line); }
.site-rel-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0 0 var(--s3); }
.site-rel-head h2 { font: 600 15px var(--mono); margin: 0; }
.site-rel .prose { max-width: none; margin-bottom: 0; }
/* Legal pages: a longer read than the docs article, so its headings keep
   more room between sections. */
.legal-prose h2 { margin-top: var(--s6); }

/* Footer: the facts and the doors, quietly, one row of columns on desktop
   and the same columns stacked on a phone. */
.site-foot { border-top: 1px solid var(--line); margin-top: var(--s8); padding: var(--s7) 0 var(--s5); }
.site-foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, max-content); gap: var(--s6) var(--s8); }
.site-foot-grid nav h2 { font: 600 13px/1 var(--sans); letter-spacing: -0.01em; margin: 0 0 var(--s2); }
.site-foot-grid nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.site-foot-grid nav a { font: 400 13px/1.6 var(--sans); color: var(--muted); text-decoration: none; }
.site-foot-grid nav a:hover { color: var(--ink); }
.site-foot-base {
  display: flex; align-items: center; gap: var(--s4);
  margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--faint);
}
.site-foot-base p { margin: 0; }

/* Hooks: `copy` marks the buttons pay.js reveals; `sections` groups panels. */
.copy { cursor: pointer; }
.sections { min-width: 0; }

/* Runbooks and other long text: a readable measure, quiet lists. */
.prose { max-width: 70ch; font-size: 14px; line-height: 1.65; color: var(--ink-soft); }
.prose p { margin: 0 0 var(--s3); }
.prose ol, .prose ul { margin: 0 0 var(--s4); padding-inline-start: var(--s6); }
.prose li { margin: 0 0 var(--s2); }
.prose h2 { font-size: 15px; margin: var(--s5) 0 var(--s2); color: var(--ink); }
.prose code { font-size: 12.5px; background: var(--sunk); padding: 1px 6px; border-radius: var(--r-sm); color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }

/* Copyable secret: wraps rather than pushing the page wide. */
.copy-text { display: inline-block; max-width: 100%; word-break: break-all; background: var(--sunk); border-radius: var(--r-sm); padding: var(--s2) var(--s3); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid transparent; background-clip: content-box; border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }

/* Page art: a dot lattice in the accent colour, pin-sharp at any size, fading
   out from the top. Pure CSS, so it follows the theme tokens and needs no file.
   Full field behind the payer pages, sign-in and home (they have room); a short
   band behind the page head in the back office and dashboard (tables and forms stay on a calm
   ground). Off in high contrast and on phones. Decoration only: it never holds
   content, and the cards above it stay solid. */
.pay-shell, .auth, .c-main { position: relative; isolation: isolate; }
.pay-shell::before, .auth::before, .c-main::before {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--accent) 1.1px, transparent 1.6px);
  background-size: 24px 24px; background-position: center top;
  opacity: var(--art);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 0%, transparent 100%);
}
.c-main::before {
  inset: 0 0 auto 0; height: 260px;
  -webkit-mask-image: radial-gradient(ellipse 65% 100% at 50% 0%, black 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 65% 100% at 50% 0%, black 0%, transparent 100%);
}

/* Reduced motion: nothing decorative moves. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Small screens: one column, touch-sized controls, the navigation a tab
   strip that works without scripts, tables scroll in their card. */
@media (max-width: 767px) {
  :root { --control: 40px; --control-form: 44px; --header: auto; }
  /* One white surface, edge to edge. No cards, no boxes: hairlines divide. */
  body { background: var(--raised); }
  .pay-shell::before, .auth::before, .c-main::before { display: none; }
  .c-shell { background: transparent; }
  .panel {
    margin-inline: calc(-1 * var(--s4)); border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: transparent; margin-bottom: 0;
  }
  .panel:last-child { border-bottom: 1px solid var(--line); }
  .panel > .p-head { padding-inline: var(--s4); }
  .stats { display: block; background: none; border: 0; border-radius: 0; margin-inline: calc(-1 * var(--s4)); margin-bottom: var(--s4); }
  .stats > .stat { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: var(--s3); margin: 0; padding: var(--s3) var(--s4); border: 0; border-top: 1px solid var(--line); }
  .stats > .stat:last-child { border-bottom: 1px solid var(--line); }
  .stat .lbl { margin: 0; }
  .hero { margin-inline: calc(-1 * var(--s4)); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--raised); }
  .hero-grid { gap: 0; margin-inline: 0; }
  .hero-grid > .hero { margin-inline: calc(-1 * var(--s4)); }
  .filters { gap: var(--s2); }
  .sheet { --sheet-x: var(--s4); --sheet-y: var(--s5); border: 0; border-radius: 0; background: transparent; }
  .sheet-hero { border-radius: 0; }
  .pay-main { padding: 0 0 var(--s6); }
  .pay-col { max-width: none; }
  .methods { gap: 0; margin-inline: calc(-1 * var(--sheet-x)); }
  .method { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
  .method:last-child { border-bottom: 1px solid var(--line); }
  .method[open] { background: var(--accent-subtle); }
  .method > summary, .method .m-body { padding-inline: var(--sheet-x); }
  .home-paths { gap: 0; margin-inline: calc(-1 * var(--sheet-x)); }
  .home-path { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding-inline: var(--sheet-x); }
  .home-path:last-child { border-bottom: 1px solid var(--line); }
  .auth { padding: 0; padding-top: var(--s6); }
  .c-shell, .c-shell.has-nav, .c-shell.has-nav.is-rail { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nav-toggle { display: none; }
  .c-top { position: static; padding: var(--s3) var(--s4); }
  /* The sidebar becomes a head (brand, environment, the account) over a tab
     strip of the navigation. It works without scripts. */
  .c-side, .c-shell.is-rail .c-side {
    position: static; grid-column: 1; grid-row: 1; height: auto; z-index: 30;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "top foot" "nav nav";
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .s-top, .c-shell.is-rail .s-top { grid-area: top; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4) var(--s2); justify-items: stretch; }
  .c-shell.is-rail .lockup .word { display: inline; }
  .s-chips, .c-shell.is-rail .s-chips { justify-content: flex-start; }
  .c-shell.is-rail .s-chips > span { width: auto; height: 20px; padding: 0 8px; border-radius: var(--r-badge); }
  .c-shell.is-rail .s-chips .chip-text { display: inline; }
  .c-shell.is-rail .env { background: var(--warn-tint); }
  .c-shell.is-rail .mode-chip.live { background: var(--ok-tint); }
  .c-shell.is-rail .biz-chip { background: var(--accent-tint); }
  .biz-switch, .c-shell.is-rail .s-top .biz-switch { display: flex; flex: 1 1 100%; }
  .biz-switch .input { height: 36px; }
  .biz-switch .btn { display: inline-flex; height: 36px; padding: 0 var(--s3); }
  .s-foot, .c-shell.is-rail .s-foot { grid-area: foot; border-top: 0; padding: var(--s3) var(--s4) var(--s2) 0; flex-direction: row; }
  .acct-text, .acct-chev, .c-shell.is-rail .acct-text { display: none; }
  .acct-row { padding: var(--s1); }
  .acct-menu, .c-shell.is-rail .acct-menu { left: auto; right: var(--s2); bottom: auto; top: calc(100% + var(--s1)); width: min(280px, calc(100vw - 2 * var(--s3))); }
  .s-nav, .c-shell.is-rail .s-nav {
    grid-area: nav; display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden;
    padding: 0 var(--s3) var(--s2); scrollbar-width: none;
  }
  .s-nav::-webkit-scrollbar { display: none; }
  .c-side .group, .c-shell.is-rail .c-side .group { display: none; }
  .c-shell.is-rail .c-side .nl { display: inline; }
  .c-side .s-nav a, .c-shell.is-rail .c-side .s-nav a { flex: 0 0 auto; height: 38px; padding: 0 var(--s3); justify-content: flex-start; }
  .c-main, .c-shell.has-nav .c-main { grid-column: 1; grid-row: 2; padding: var(--s4) var(--s4) var(--s8); }
  .c-head { display: block; margin-bottom: var(--s4); }
  .c-head h1 { font-size: 20px; }
  .c-head .aside { display: block; margin-top: 4px; white-space: normal; }
  .c-head > .btn, .c-head > form { margin-top: var(--s3); }
  .stat .big { font-size: 17px; }
  .panel > .p-head { padding: var(--s3) var(--s4); align-items: flex-start; }
  .panel > .p-head > .faint, .panel > .p-head > .muted { white-space: normal; text-align: end; }
  .panel > .p-body { padding: var(--s4); }
  .panel > .p-body.flush { padding: 0; }
  .tbl { min-width: 560px; }
  .tbl th, .tbl td { padding: 10px var(--s3); }
  .tbl .mono { overflow-wrap: normal; white-space: nowrap; }
  .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .kv dd { padding-top: 2px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field, .filters label { min-width: 0; }
  .auth { align-items: start; }
  .toolbar .input { min-width: 0; flex: 1 1 130px; }
  /* The public site: one surface, the links a scroll strip under the brand. */
  .site-head-in { flex-wrap: wrap; gap: var(--s2); padding: var(--s2) 0; min-height: 0; }
  .site-nav { order: 2; flex: 1 0 100%; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 0 0 auto; }
  .site-actions { margin-inline-start: 0; }
  .site-actions .btn.op { display: none; }
  .site-wrap, .site-wrap.narrow { padding-inline: var(--s4); }
  .site-section { padding: var(--s6) 0; }
  .site-grid { grid-template-columns: 1fr; }
  .site-docs { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .site-toc { position: static; }
  .site-foot { padding-block: var(--s6) var(--s4); margin-top: var(--s6); }
  .site-foot-grid { grid-template-columns: 1fr; gap: var(--s5); }
  .site-foot-base { flex-direction: column; gap: var(--s1); }
  .site-rel { padding-inline: var(--s4); }
}

/* Settings: the checkout theme form and its live preview. The preview is the
   real payer sheet in a frame (`.pv`) that carries its own scheme, so the
   merchant sees exactly what a payer will. */
.theme-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 480px); gap: var(--s4); align-items: start; }
.theme-form, .theme-aside { min-width: 0; }
.theme-aside { position: sticky; top: var(--s4); }
.theme-aside .panel > .p-head .seg { width: 168px; }
.color-row { display: flex; align-items: center; gap: var(--s2); }
.color-row .input { flex: 1; min-width: 0; }
.swatch { flex: 0 0 auto; width: var(--control-form); height: var(--control-form); padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--raised); cursor: pointer; }
.swatch[hidden] { display: none; }
.choices { display: flex; flex-wrap: wrap; gap: var(--s2); min-width: 0; border: 0; padding: 0; margin: 0 0 var(--s3); }
.choices legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.choices .hint { flex: 1 0 100%; font-size: 12px; color: var(--faint); }
.choice { position: relative; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice span {
  display: inline-flex; align-items: center; min-height: var(--control); padding: 0 var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--raised);
  font: 500 13px var(--sans); color: var(--ink-soft); cursor: pointer;
}
.choice span:hover { background: var(--accent-subtle); }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-tint); color: var(--ink); font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo-row { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s3); }
.logo-row .tile { width: 48px; height: 48px; font-size: 18px; }
.logo-row .field { flex: 1; min-width: 0; margin: 0; }
.check-line { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); font-size: 13px; color: var(--ink-soft); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.form-actions .btn { margin: 0; }
.pv { padding: var(--s5); background: var(--paper); color: var(--ink); font: 14px/1.5 var(--sans); }
.pv .pay-foot { padding-bottom: 0; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); font-size: 13px; }
.checks li:first-child { border-top: 0; }
.checks .c-label { flex: 1; min-width: 0; color: var(--ink-soft); }
.checks .c-ratio { font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.theme-notes { margin: 0 0 var(--s4); padding-inline-start: var(--s5); }
.theme-notes:empty { display: none; }
@media (max-width: 1000px) {
  .theme-layout { grid-template-columns: minmax(0, 1fr); }
  .theme-aside { position: static; }
}
@media (max-width: 767px) {
  /* The frame keeps the sheet a card: it is a sample inside the page, not the page. */
  .pv { padding: var(--s4); }
  .pv .sheet { --sheet-x: var(--s5); --sheet-y: var(--s5); border: 1px solid var(--line); border-radius: var(--r-dialog); background: var(--raised); }
  .pv .sheet-hero { border-radius: var(--r-dialog) var(--r-dialog) 0 0; }
  .pv .methods { gap: var(--s2); margin-inline: 0; }
  .pv .method { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--raised); }
  .pv .method[open] { border-color: var(--accent-tint); background: var(--accent-subtle); }
  .pv .method:last-child { border-bottom: 1px solid var(--line); }
  .pv .method > summary, .pv .method .m-body { padding-inline: var(--s4); }
}

.seg[hidden], .note-strip[hidden], .hint[hidden] { display: none; }
.pv .m-body .btn + p { margin-top: var(--s3); }
@media (max-width: 1000px) { .theme-aside { order: -1; } }
