/*
  Uncart design tokens: the one source of Uncart's visual identity.

  Who reads this file
  -------------------
  Both the website and the partner demo put this file at the top of their
  stylesheet when they build, so every colour, size and font is defined once:
    - apps/site/src/render.ts    -> /site.css      (fonts served at /fonts/)
    - apps/demo/scripts/build.ts -> /demo/demo.css (fonts served at /demo/fonts/)
  The font addresses below are relative ("fonts/..."), so each stylesheet finds
  the fonts in the folder next to it. Nothing is loaded from another website
  (font-src 'self').

  The identity, in one sentence
  -----------------------------
  An instrument, not a brochure: monochrome (black, white and greys), a
  dot-matrix display face for the few things that should read like a
  readout, monospace labels like a spec sheet, thin rules on a visible grid,
  and one red that marks the single most important thing: the measured extra
  revenue, and the button that starts a pilot.

  Type
  ----
    - Doto (Óliver Lalan, SIL Open Font License 1.1): the dot-matrix display
      face. Display only: hero numbers, page titles, step numbers, the
      wordmark. Never body text, forms or anything a reader must parse.
      Round dots (ROND 100), weight 400 to 900.
    - Archivo (Omnibus-Type, SIL OFL 1.1): every sentence, form and table.
      Variable weight 400 to 900 (900 for the website's statement
      headlines; the 400-900 range was cut from @fontsource-variable/archivo
      5.3.0 with fontTools, same characters as before).
    - Space Mono (Colophon for Google, SIL OFL 1.1): small uppercase labels,
      tags, figures in tables, times and codes. Regular 400 only.
  The files were made from the @fontsource packages (5.3.0) with fontTools:
  subset to Latin-1 plus the German and typographic extras (€, „ " ‚ ' – —
  … • ß Œ), woff2, about 41 KB together. The licences sit next to them
  (OFL-*.txt).

  Colour
  ------
  Black, white and greys do almost all the work. One accent, red:
    --mark      the measured extra revenue (the one number), and its fill
    --accent    the primary call to action (and red text where it marks money)
  States stay near-monochrome: a label says what a state is, colour does not
  have to. The WhatsApp tokens (chat-*, bubble-*) follow the real app, so the
  phone is the one coloured object in a monochrome page.
  Every text/background pair used meets WCAG AA (4.5:1); the site's build
  test checks the pairs in light and dark.

  Themes
  ------
  Light is stark white; dark is a black canvas with white dots. Dark follows
  the system (prefers-color-scheme), and a page may force one with
  data-theme="light" or data-theme="dark" on <html>.
*/

/* ---------- Fonts ---------- */

@font-face {
  font-family: 'Doto';
  src: url('/assets/fonts/doto-var.a43866fbe316.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-var.cd8021c58ee4.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/assets/fonts/space-mono-400.ab9a611b112e.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallbacks (measured against Arial / Courier New metrics), so text does not jump when the fonts arrive. */
@font-face {
  font-family: 'Archivo Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica'), local('Liberation Sans');
  size-adjust: 98.67%;
  ascent-override: 88.98%;
  descent-override: 21.28%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Doto Fallback';
  src: local('Courier New'), local('Courier'), local('Liberation Mono');
  size-adjust: 99.98%;
  ascent-override: 95.02%;
  descent-override: 25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Space Mono Fallback';
  src: local('Courier New'), local('Courier'), local('Liberation Mono');
  size-adjust: 101.98%;
  ascent-override: 109.82%;
  descent-override: 35.4%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  /* Type families */
  --font-sans: 'Archivo', 'Archivo Fallback', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Doto', 'Doto Fallback', 'Courier New', monospace;
  --font-mono: 'Space Mono', 'Space Mono Fallback', 'Courier New', monospace;
  --font-code: var(--font-mono);
  /* The display face: round dots, heavy enough to read as a matrix. */
  --display-variation: 'ROND' 100;
  --display-weight: 900;

  /* Type scale (rem, 16px base); the top steps grow with the window */
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --text-3xl: clamp(1.85rem, 1.3rem + 2.2vw, 2.75rem);
  --text-4xl: clamp(2.2rem, 1.3rem + 3.6vw, 4rem);
  --text-5xl: clamp(2.6rem, 1.2rem + 5.6vw, 5.5rem);
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-body: 1.55;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  /* Labels: Space Mono, uppercase, tracked */
  --label-size: 0.6875rem;
  --label-tracking: 0.08em;

  /* Spacing (4px grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --measure: 66ch;
  --page-max: 80rem;

  /* Radii: square; only the phone (an object) and chat bubbles are round */
  --radius-0: 0;
  --radius-1: 2px;
  --radius-2: 4px;
  --radius-bubble: 7.5px;
  --radius-device: 40px;

  /* Rules and shadows: no soft shadows. The phone carries a hard contact edge, nothing more. */
  --rule-hair: 1px;
  --rule-strong: 2px;
  --rule-heavy: 4px;
  --shadow-none: none;
  --shadow-device: none;
  --shadow-popover: none;
  /* The dot grid: a printed matrix of 1px dots, for display surfaces only */
  --dot-size: 12px;

  /* Neutrals: stark white */
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --surface-3: #e8e8e8;
  --ink: #000000;
  --ink-2: #3b3b3b;
  --ink-3: #636363;
  --line: #e0e0e0;
  --line-strong: #000000;
  --field-line: #858585;
  --dot: #d4d4d4;

  /* The accent: red, for the one number and the one call to action */
  --accent: #d0121b;
  --accent-hover: #a10d14;
  --accent-ink: #ffffff;
  --accent-soft: #fde9ea;
  --mark: #d0121b;
  --mark-ink: #ffffff;
  --mark-soft: #fde9ea;

  /* The band: black statements, header chrome of the dashboard */
  --band: #000000;
  --band-2: #141414;
  --band-ink: #ffffff;
  --band-ink-2: #a8a8a8;
  --band-line: #2e2e2e;
  --band-dot: #2b2b2b;

  /* States: near-monochrome; the words carry the meaning */
  --ok: #1b7339;
  --ok-soft: #e8f3eb;
  --wait: #7a5500;
  --wait-soft: #f6efdf;
  --stop: #000000;
  --stop-soft: #ededed;
  --control: #595959;
  --control-soft: #ededed;
  --preview: #3b3b3b;
  --preview-soft: #f3f3f3;

  /* WhatsApp, as the shopper sees it */
  --chat-bg: #efeae2;
  --chat-head: #008069;
  --chat-head-ink: #ffffff;
  --bubble-in: #ffffff;
  --bubble-out: #d9fdd3;
  --bubble-ink: #111b21;
  --bubble-meta: #54656f;
  --bubble-link: #00739f;
  --tick-read: #53bdeb;
  --note-bg: #ffeecd;
  --note-ink: #54656f;
  --phone-frame: #1a1a1a;

  --focus: #000000;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #000000;
    --surface: #0b0b0b;
    --surface-2: #151515;
    --surface-3: #202020;
    --ink: #ffffff;
    --ink-2: #c4c4c4;
    --ink-3: #9a9a9a;
    --line: #262626;
    --line-strong: #ffffff;
    --field-line: #6b6b6b;
    --dot: #2a2a2a;

    --accent: #ff4b52;
    --accent-hover: #ff8085;
    --accent-ink: #000000;
    --accent-soft: #2b0a0c;
    --mark: #ff4b52;
    --mark-ink: #000000;
    --mark-soft: #2b0a0c;

    --band: #0b0b0b;
    --band-2: #151515;
    --band-ink: #ffffff;
    --band-ink-2: #a3a3a3;
    --band-line: #2e2e2e;
    --band-dot: #262626;

    --ok: #6fd393;
    --ok-soft: #0f2416;
    --wait: #e9b75c;
    --wait-soft: #2a210d;
    --stop: #ffffff;
    --stop-soft: #202020;
    --control: #a6a6a6;
    --control-soft: #202020;
    --preview: #c4c4c4;
    --preview-soft: #151515;

    --chat-bg: #0b141a;
    --chat-head: #1f2c34;
    --chat-head-ink: #e9edef;
    --bubble-in: #1f2c34;
    --bubble-out: #005c4b;
    --bubble-ink: #e9edef;
    --bubble-meta: #c3ccd1;
    --bubble-link: #6cc9f0;
    --tick-read: #53bdeb;
    --note-bg: #1d282f;
    --note-ink: #c3ccd1;
    --phone-frame: #3a3a3a;

    --focus: #ffffff;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --paper: #000000;
  --surface: #0b0b0b;
  --surface-2: #151515;
  --surface-3: #202020;
  --ink: #ffffff;
  --ink-2: #c4c4c4;
  --ink-3: #9a9a9a;
  --line: #262626;
  --line-strong: #ffffff;
  --field-line: #6b6b6b;
  --dot: #2a2a2a;

  --accent: #ff4b52;
  --accent-hover: #ff8085;
  --accent-ink: #000000;
  --accent-soft: #2b0a0c;
  --mark: #ff4b52;
  --mark-ink: #000000;
  --mark-soft: #2b0a0c;

  --band: #0b0b0b;
  --band-2: #151515;
  --band-ink: #ffffff;
  --band-ink-2: #a3a3a3;
  --band-line: #2e2e2e;
  --band-dot: #262626;

  --ok: #6fd393;
  --ok-soft: #0f2416;
  --wait: #e9b75c;
  --wait-soft: #2a210d;
  --stop: #ffffff;
  --stop-soft: #202020;
  --control: #a6a6a6;
  --control-soft: #202020;
  --preview: #c4c4c4;
  --preview-soft: #151515;

  --chat-bg: #0b141a;
  --chat-head: #1f2c34;
  --chat-head-ink: #e9edef;
  --bubble-in: #1f2c34;
  --bubble-out: #005c4b;
  --bubble-ink: #e9edef;
  --bubble-meta: #c3ccd1;
  --bubble-link: #6cc9f0;
  --tick-read: #53bdeb;
  --note-bg: #1d282f;
  --note-ink: #c3ccd1;
  --phone-frame: #3a3a3a;

  --focus: #ffffff;
  color-scheme: dark;
}


/* ---------- Base ---------- */
:root { --gutter: 16px; }
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1100px) { :root { --gutter: 32px; } }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--surface-2); color: var(--ink); font-family: var(--font-sans); font-size: var(--text-md); line-height: var(--leading-body); overflow-wrap: break-word; font-synthesis: none; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -100px; z-index: 10; background: var(--paper); color: var(--ink); padding: 0.6rem 0.9rem; border: var(--rule-strong) solid var(--ink); }
.skip:focus { top: 8px; }

/* ---------- The header band: black in light and dark, like the demo's dashboard ---------- */
body > header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand out" "nav nav"; column-gap: var(--space-4);
  padding: 0 var(--gutter); background: var(--band); color: var(--band-ink); border-bottom: var(--rule-hair) solid var(--band-line);
}
body > header :focus-visible { outline-color: var(--band-ink); }
.brand { grid-area: brand; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0; padding: var(--space-3) 0; min-width: 0; }
.brand .brand-mark { width: 1.5rem; height: 1.5rem; flex: none; }
.brand strong {
  font-family: var(--font-display); font-variation-settings: var(--display-variation); font-weight: var(--display-weight); letter-spacing: 0;
  font-size: 1.75rem; line-height: 1;
}
.brand .shop { font-weight: var(--weight-semibold); padding-left: var(--space-3); border-left: var(--rule-hair) solid var(--band-line); overflow-wrap: anywhere; }
.brand .platform { font-family: var(--font-mono); font-size: var(--label-size); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--band-ink-2); border: var(--rule-hair) solid var(--band-line); padding: 0.1rem 0.45rem; overflow-wrap: anywhere; }
.sign-out { grid-area: out; align-self: center; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2) var(--space-3); padding: var(--space-2) 0; }
.sign-out .account-link, .sign-out .account-email { color: var(--band-ink); font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); overflow-wrap: anywhere; }
.sign-out form.switcher { display: flex; gap: var(--space-2); align-items: center; }
.sign-out select { font: inherit; font-size: var(--text-sm); color: var(--band-ink); background: var(--band); border: var(--rule-hair) solid var(--band-ink-2); border-radius: var(--radius-0); min-height: 2.25rem; padding: 0.3rem 0.5rem; max-width: 14rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  body > header:has(.account-link) { grid-template-areas: "brand brand" "out out" "nav nav"; }
  body > header:has(.account-link) .sign-out { justify-content: flex-start; padding-top: 0; }
}
main.account { max-width: 44rem; }
main.account form.stack { max-width: 28rem; }
main.account code.secret { font-family: var(--font-mono); font-size: var(--text-md); background: var(--paper); border: var(--rule-hair) solid var(--line); padding: 0.2rem 0.4rem; overflow-wrap: anywhere; }
main.account ul.codes { columns: 2; padding-left: 1.2rem; }
main.account .help, main.account .fine { color: var(--ink-2); font-size: var(--text-sm); margin: var(--space-1) 0 0; }
.sign-out form.inline { margin: 0; }
body > header button.secondary { background: transparent; color: var(--band-ink); border-color: var(--band-ink-2); min-height: 2.25rem; padding: 0.4rem 0.75rem; }
body > header button.secondary:hover { background: var(--band-ink); color: var(--band); border-color: var(--band-ink); }
body > header nav { grid-area: nav; border-top: var(--rule-hair) solid var(--band-line); }
body > header nav ul { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); list-style: none; margin: 0; padding: 0; }
body > header nav li + li { margin: 0; }
body > header nav a {
  display: inline-block; padding: 0.8rem 0 0.65rem; color: var(--band-ink-2); text-decoration: none; border-bottom: var(--rule-strong) solid transparent;
  font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking);
}
body > header nav a:hover { color: var(--band-ink); }
body > header nav a[aria-current="page"] { color: var(--band-ink); border-bottom-color: var(--band-ink); }
/* Conversations waiting for the team: a count beside the section, the one red on the band. */
body > header nav .nav-count { display: inline-block; margin-left: 0.4rem; padding: 0 0.4rem; min-width: 1.4rem; text-align: center; background: var(--mark); color: var(--mark-ink); }

/* ---------- While sending is paused: a line on the band, with a red status light ---------- */
.banner.paused { margin: 0; padding: var(--space-2) var(--gutter); background: var(--band); color: var(--band-ink); font-weight: var(--weight-semibold); font-size: var(--text-sm); border-bottom: var(--rule-hair) dotted var(--band-ink-2); }
.banner.paused::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 0.6rem; border-radius: 50%; background: var(--mark); vertical-align: 0.05em; }

/* ---------- An owner has the Terms and the DPA to accept: a line on the band with its link, until accepted ---------- */
.banner.legal { margin: 0; padding: var(--space-2) var(--gutter); background: var(--band); color: var(--band-ink); font-weight: var(--weight-semibold); font-size: var(--text-sm); border-bottom: var(--rule-hair) dotted var(--band-ink-2); }
.banner.legal a { color: var(--band-ink); }
.legal-documents li { margin-bottom: var(--space-1); }
.legal-notice { margin-bottom: var(--space-4); }

/* ---------- The example shop (an account with no shop yet): a striped band no real page has ---------- */
.banner.example {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
  margin: 0; padding: var(--space-3) var(--gutter); color: var(--ink); border-bottom: var(--rule-strong) solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--paper) 0 12px, var(--surface-3) 12px 24px);
}
.banner.example p { margin: 0; }
.banner.example strong { font-weight: var(--weight-semibold); background: var(--paper); padding: 0.1rem 0.3rem; }
main fieldset[disabled] { border: 0; margin: 0; padding: 0; max-width: none; min-width: 0; display: inline; }
/* The locked form's button (and closing paragraph) sits one level deeper, inside the fieldset: the same space above it as on a real page (form > button). */
main fieldset[disabled] > p:last-child, main fieldset[disabled] > button { margin-top: var(--space-4); }
main fieldset[disabled] .locked { display: block; margin: 0 0 var(--space-1); font-family: var(--font-mono); font-size: var(--label-size); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--ink-2); }

/* ---------- The screen ---------- */
main { display: block; max-width: var(--page-max); margin: 0 auto; padding: var(--space-6) var(--gutter) var(--space-8); }
h1 {
  font-family: var(--font-display); font-variation-settings: var(--display-variation); font-weight: var(--display-weight); letter-spacing: 0;
  font-size: var(--text-3xl); line-height: 1.05; margin: 0 0 var(--space-4); overflow-wrap: anywhere; text-wrap: balance;
}
h2 { font-size: var(--text-xl); font-weight: var(--weight-medium); line-height: var(--leading-snug); letter-spacing: -0.01em; margin: 0 0 var(--space-3); text-wrap: balance; }
main > h2 { margin-top: var(--space-6); padding-top: var(--space-3); border-top: var(--rule-hair) solid var(--ink); }
h3 { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-snug); margin: var(--space-5) 0 var(--space-2); }

/* ---------- A page without a session (signed out, refused, an error): the frame, one card of text ---------- */
main > p.message { max-width: 60ch; background: var(--paper); border: var(--rule-hair) solid var(--line); padding: var(--space-5); margin: 0; }

@media (max-width: 640px) {
  body > header nav ul { gap: 0 var(--space-4); }
}
/* A phone: the four sections stack two by two. */
@media (max-width: 480px) {
  body > header nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); }
}
@media (max-width: 640px) {
  main { padding-top: var(--space-5); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* ---------- Text ---------- */
p { margin: 0 0 var(--space-3); max-width: 75ch; }
ul, ol { margin: 0 0 var(--space-3); padding-left: 1.2em; }
li + li { margin-top: var(--space-1); }
.muted { color: var(--ink-3); font-size: var(--text-sm); }
.inactive { opacity: 0.55; }
.note { font-size: var(--text-sm); }
.hint { color: var(--ink-3); font-size: var(--text-sm); margin: var(--space-1) 0 var(--space-3); }
.ok { color: var(--ok); font-weight: var(--weight-semibold); }
.warn { color: var(--wait); font-weight: var(--weight-semibold); }
.bad { color: var(--ink); font-weight: var(--weight-bold); }
/* A status line ("Sending is on.") carries a status light, like the website's pilot line. */
p.ok::before, p.warn::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 0.6rem; border-radius: 50%; background: currentColor; vertical-align: 0.1em; }
code { font-family: var(--font-code); font-size: 0.85em; background: var(--surface-2); padding: 0 0.25em; overflow-wrap: anywhere; }

/* ---------- What you are looking at ---------- */
.what { margin: 0 0 var(--space-5); max-width: 75ch; padding-left: var(--space-3); border-left: var(--rule-strong) solid var(--ink); color: var(--ink-2); }
.what strong { display: block; font-family: var(--font-mono); font-weight: var(--weight-regular); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--ink-2); }

/* ---------- Cards ---------- */
.card { background: var(--paper); border: var(--rule-hair) solid var(--line); padding: var(--space-5); margin: 0 0 var(--space-4); min-width: 0; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* ---------- The one number: a readout on a dot grid ---------- */
.number {
  font-family: var(--font-display); font-variation-settings: var(--display-variation); font-weight: var(--display-weight); letter-spacing: 0;
  font-size: var(--text-4xl); line-height: 1; color: var(--mark); max-width: none;
  margin: var(--space-3) 0 var(--space-4); padding: var(--space-4);
  border: var(--rule-hair) solid var(--line-strong); overflow-wrap: anywhere;
  background-color: var(--surface-2); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.5px); background-size: var(--dot-size) var(--dot-size);
}
.number.unproven { color: var(--ink); font-size: var(--text-3xl); }

/* ---------- Tables: mono column labels, thin rules, figures in step; a phone scrolls them sideways ---------- */
.table-scroll { overflow-x: auto; max-width: 100%; margin: 0 0 var(--space-3); }
.table-scroll > table:has(thead th:nth-child(4)) { min-width: 40rem; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-4) var(--space-2) 0; border-bottom: var(--rule-hair) solid var(--line); }
td { font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
td code { overflow-wrap: normal; white-space: nowrap; }
thead th { font-family: var(--font-mono); font-weight: var(--weight-regular); font-size: var(--label-size); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--ink-2); border-bottom-color: var(--ink); white-space: nowrap; }

/* ---------- Buttons: square and mono; ink for actions, red only for the one call to action ---------- */
button, a.button-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; max-width: 100%;
  font-family: var(--font-mono); font-weight: var(--weight-regular); font-size: var(--text-xs); line-height: 1.25; text-transform: uppercase; letter-spacing: var(--label-tracking); text-align: center; text-decoration: none;
  padding: 0.6rem 1rem; border: var(--rule-hair) solid var(--ink); border-radius: var(--radius-0); background: var(--ink); color: var(--paper); cursor: pointer;
}
button:hover { background: var(--ink-2); border-color: var(--ink-2); }
button.secondary { background: var(--paper); color: var(--ink); }
button.secondary:hover { background: var(--surface-3); border-color: var(--ink); }
button.danger { background: var(--paper); color: var(--ink); border-width: var(--rule-strong); }
button.danger:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
a.button-link { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
a.button-link:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
form > p:last-child, form > button { margin-top: var(--space-4); }
form.inline { display: inline-block; margin: 0 var(--space-2) var(--space-2) 0; }

/* ---------- Forms ---------- */
label { display: block; font-weight: var(--weight-semibold); font-size: var(--text-sm); margin: var(--space-3) 0 var(--space-1); }
label.check { display: inline; font-weight: var(--weight-regular); font-size: var(--text-md); margin: 0; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], textarea, select {
  font: inherit; color: var(--ink); background: var(--paper); border: var(--rule-hair) solid var(--field-line); border-radius: var(--radius-0);
  padding: 0.55rem 0.7rem; min-height: 2.75rem; width: 100%; max-width: 40rem;
}
select { width: auto; }
textarea { min-height: 8em; resize: vertical; }
input[type="text"]:hover, input[type="tel"]:hover, input[type="email"]:hover, input[type="password"]:hover, textarea:hover, select:hover { border-color: var(--ink); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 1.15rem; height: 1.15rem; margin: 0 0.4rem 0 0; vertical-align: -0.2em; }
fieldset { border: var(--rule-hair) solid var(--line); margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4) var(--space-4); max-width: 40rem; min-width: 0; }
legend { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--ink-2); padding: 0 var(--space-2); }
fieldset > div { margin: var(--space-2) 0; }
.choice { display: inline-block; margin: var(--space-1) var(--space-5) var(--space-1) 0; }
dl.fixed { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); }
dl.fixed dt { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--ink-2); padding-top: 0.2em; }
dl.fixed dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Disclosures ---------- */
details summary { cursor: pointer; padding: var(--space-1) 0; }
details.support { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--ink-3); }
details.support summary { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--ink-2); }
details.support dl { margin: var(--space-2) 0 0; padding-left: var(--space-3); border-left: var(--rule-hair) dotted var(--ink-3); }
details.support dt { font-weight: var(--weight-semibold); }
details.support dd { margin: 0 0 var(--space-2); }
details.columns summary, details.disconnect summary { font-weight: var(--weight-semibold); }
details[open] > summary { margin-bottom: var(--space-2); }

/* ---------- State pills: the word says the state; the outline only repeats it ---------- */
.steps .state, .checklist li > span:first-child, .soon {
  display: inline-block; font-family: var(--font-mono); font-weight: var(--weight-regular); font-size: var(--label-size); line-height: 1.5;
  text-transform: uppercase; letter-spacing: var(--label-tracking); white-space: nowrap;
}
.steps .state, .checklist li > span:first-child { padding: 0.1rem 0.45rem; border: var(--rule-hair) solid currentColor; text-align: center; }
.steps .done .state, .checklist li > span.ok:first-child { color: var(--ok); background: var(--ok-soft); }
.steps .todo .state, .checklist li > span.bad:first-child { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.steps .waiting .state, .checklist li > span.warn:first-child { color: var(--wait); background: var(--wait-soft); border-style: dotted; }
.checklist li > span.muted:first-child { color: var(--ink-2); background: var(--paper); border-style: dotted; }
/* "Coming soon": a bracketed mono tag, as on the website. */
.soon { color: var(--ink-2); vertical-align: 0.1em; }
.soon::before { content: '[' / ''; margin-right: 0.3em; }
.soon::after { content: ']' / ''; margin-left: 0.3em; }

/* ---------- The setup checklist ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps .step { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: var(--space-3); row-gap: var(--space-1); align-items: baseline; margin: 0; padding: var(--space-3) 0; border-top: var(--rule-hair) solid var(--line); }
.steps .step:first-child { border-top: 0; padding-top: 0; }
.steps .state { grid-column: 1; justify-self: start; }
.steps .step > strong { grid-column: 2; }
.steps .line { grid-column: 2; color: var(--ink-2); font-size: var(--text-sm); }
.checklist { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.checklist li { margin: 0; padding: var(--space-2) 0; border-top: var(--rule-hair) solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist li > span:first-child { margin-right: var(--space-2); }

/* ---------- The message after a button ---------- */
.flash { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); background: var(--paper); border: var(--rule-hair) solid var(--ink); border-left-width: var(--rule-heavy); max-width: none; }
.flash.problem { border-width: var(--rule-strong); border-left-width: var(--rule-heavy); }

/* ---------- A conversation, word for word ---------- */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.thread li { margin: 0; max-width: min(40rem, 88%); padding: var(--space-3) var(--space-4); background: var(--paper); border: var(--rule-hair) solid var(--line); }
.thread li.inbound { align-self: flex-start; }
.thread li.outbound { align-self: flex-end; background: var(--surface-2); border-color: var(--ink); }
.thread .who { display: block; margin-bottom: var(--space-1); font-family: var(--font-mono); font-size: var(--label-size); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--ink-2); }
.thread .words { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- The opt-in preview: a sketch, so a dotted outline ---------- */
.preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-4); margin: 0 0 var(--space-3); }
.preview-device { border: var(--rule-hair) dotted var(--ink); padding: var(--space-4); background: var(--paper); min-width: 0; }
.preview-label { margin: 0 0 var(--space-3); font-family: var(--font-mono); font-size: var(--label-size); text-transform: uppercase; letter-spacing: var(--label-tracking); color: var(--ink-2); }
.preview-button { border: var(--rule-hair) solid var(--ink); background: var(--ink); color: var(--paper); padding: 0.75rem; text-align: center; font-weight: var(--weight-semibold); }
.preview-pill { display: flex; align-items: center; gap: var(--space-2); border: var(--rule-hair) solid var(--field-line); border-radius: 999px; padding: 0.55rem 0.9rem; min-width: 0; }
.preview-code { font-family: var(--font-mono); font-size: var(--text-sm); white-space: nowrap; }
.preview-input { flex: 1; min-width: 0; color: var(--ink-3); overflow-wrap: anywhere; }
.preview-switch { margin: var(--space-2) 0 0; font-size: var(--text-sm); text-decoration: underline; }

/* ---------- The summary pages (Home, Shop setup, Account): rows with one button each ---------- */
a.action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; max-width: 100%; flex: none;
  font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.25; text-transform: uppercase; letter-spacing: var(--label-tracking); text-align: center; text-decoration: none;
  padding: 0.6rem 1rem; border: var(--rule-hair) solid var(--ink); border-radius: var(--radius-0); background: var(--ink); color: var(--paper);
}
a.action:hover { background: var(--ink-2); border-color: var(--ink-2); }
a.action.secondary { background: var(--paper); color: var(--ink); }
a.action.secondary:hover { background: var(--surface-3); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0; padding: var(--space-3) 0; border-top: var(--rule-hair) solid var(--line); }
.rows .row:first-child { border-top: 0; padding-top: 0; }
.rows .row:last-child { padding-bottom: 0; }
.row-text { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.row-name { font-weight: var(--weight-semibold); }
.row-state { color: var(--ink-2); font-size: var(--text-sm); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); }
.card-head h2 { margin: 0; }
.empty { color: var(--ink-2); margin: 0; }
/* The guided setup's card: the header band's black, so it reads as the one thing to do next. */
.card.lead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); background: var(--band); color: var(--band-ink); border-color: var(--band); }
.card.lead .lead-text { flex: 1 1 18rem; min-width: 0; }
.card.lead p { color: var(--band-ink-2); }
.card.lead :focus-visible { outline-color: var(--band-ink); }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-1); max-width: 26rem; margin: 0; }
.segment { display: block; height: 6px; background: var(--band-line); }
.segment.done { background: var(--band-ink); }
a.action.inverse { background: var(--band-ink); color: var(--band); border-color: var(--band-ink); }
a.action.inverse:hover { background: var(--band-ink-2); border-color: var(--band-ink-2); }
/* The status card: the state with its light, why, the number and the features, and the pause. */
.status-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); }
.status-text { flex: 1 1 20rem; min-width: 0; }
.status-text p { margin-bottom: var(--space-1); }
.status-title { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-2xl); font-weight: var(--weight-semibold); margin: 0 0 var(--space-2); }
.status-title::before { content: ''; display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--wait); }
.status.working .status-title::before { background: var(--ok); }
.status.paused .status-title::before { background: var(--mark); }
.status-action form.inline { margin: 0; }
.status .hint { margin: var(--space-3) 0 0; }
/* What Uncart brought in: figures in step, in Space Mono (Doto stays the one number's). */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-5); }
.figure { min-width: 0; }
.figure-value { font-family: var(--font-mono); font-size: var(--text-3xl); line-height: 1.1; margin: 0 0 var(--space-1); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.figure-label { color: var(--ink-2); font-size: var(--text-sm); margin: 0; }
/* A card that folds away (the checklist once done, More settings). */
details.fold > summary { font-weight: var(--weight-semibold); min-height: 2.75rem; display: flex; align-items: center; }
details.fold[open] > summary { margin-bottom: var(--space-3); }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .card { padding: var(--space-4); }
  .figure-value { font-size: var(--text-2xl); }
  .rows .row > a.action { width: 100%; }
  .steps .step { grid-template-columns: minmax(0, 1fr); }
  .steps .state, .steps .step > strong, .steps .line { grid-column: 1; }
  .thread li { max-width: 94%; }
}


/* ---------- The guided setup: the steps-left bar on every other page ---------- */
.banner.onboarding {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
  margin: 0; padding: var(--space-2) var(--gutter); background: var(--paper); color: var(--ink);
  border-bottom: var(--rule-hair) solid var(--line-strong); font-size: var(--text-sm);
}
.banner.onboarding .onb-bar-text { font-weight: var(--weight-semibold); }
.banner.onboarding progress { width: 8rem; height: 8px; }
.banner.onboarding a { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); }

/* ---------- The guided setup: the frame ---------- */
.onb-actions form.inline { margin: 0; }
.onb-actions a.onb-leave { color: var(--band-ink); font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); }
.onb { min-width: 0; }
.onb-progress { margin: 0 0 var(--space-4); }
.onb-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-2); max-width: none; font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); }
.onb-count .muted { font-size: var(--text-xs); }
.onb-progress progress { display: block; width: 100%; height: 10px; }
.onb progress, .banner.onboarding progress { appearance: none; -webkit-appearance: none; border: var(--rule-hair) solid var(--ink); border-radius: var(--radius-0); background: var(--paper); color: var(--ink); }
.onb progress::-webkit-progress-bar, .banner.onboarding progress::-webkit-progress-bar { background: var(--paper); }
.onb progress::-webkit-progress-value, .banner.onboarding progress::-webkit-progress-value { background: var(--ink); }
.onb progress::-moz-progress-bar, .banner.onboarding progress::-moz-progress-bar { background: var(--ink); }

/* ---------- The guided setup: the list of steps ---------- */
.onb-steps { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--space-2); }
.onb-steps li + li { margin-top: 0; }
.onb-step { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; padding: var(--space-2) var(--space-3); background: var(--paper); border: var(--rule-hair) solid var(--line); min-width: 0; }
.onb-step.current { border: var(--rule-strong) solid var(--ink); }
.onb-step a { text-decoration: none; font-weight: var(--weight-semibold); font-size: var(--text-sm); line-height: var(--leading-snug); }
.onb-step a:hover { text-decoration: underline; }
.onb-num { font-family: var(--font-mono); font-weight: var(--weight-regular); color: var(--ink-2); margin-right: 0.2em; }
.onb-step .state {
  align-self: flex-start; font-family: var(--font-mono); font-size: var(--label-size); line-height: 1.5; text-transform: uppercase;
  letter-spacing: var(--label-tracking); white-space: nowrap; padding: 0.05rem 0.4rem; border: var(--rule-hair) solid currentColor;
}
.onb-step.done .state { color: var(--ok); background: var(--ok-soft); }
.onb-step.todo .state { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.onb-step.waiting .state { color: var(--wait); background: var(--wait-soft); border-style: dotted; }

/* ---------- The guided setup: the step beside the phone ---------- */
.onb-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
@media (min-width: 960px) {
  .onb-layout { grid-template-columns: minmax(0, 1fr) 22rem; }
  .onb-phone { position: sticky; top: var(--space-4); }
}
.onb-card { background: var(--paper); border: var(--rule-hair) solid var(--line); padding: var(--space-5); min-width: 0; }
.onb-card > :last-child { margin-bottom: 0; }
.onb-lead { font-size: var(--text-lg); line-height: var(--leading-snug); }
.onb-time, .onb-tag { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--label-tracking); }
.onb-tag { display: inline-block; font-size: var(--label-size); font-weight: var(--weight-regular); padding: 0.05rem 0.4rem; border: var(--rule-hair) solid var(--ink); vertical-align: 0.15em; white-space: nowrap; }
.onb-plan { margin-bottom: var(--space-4); }
.onb-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); margin: var(--space-5) 0 var(--space-3); padding-top: var(--space-4); border-top: var(--rule-hair) solid var(--line); }
.onb-nav form.inline { margin: 0; }
.onb-nav a.button-link.onb-next { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.onb-nav a.button-link.onb-next:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }
.onb-card button.onb-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.onb-card button.onb-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.onb-leave-hint { margin-top: var(--space-3); }

/* ---------- The guided setup: WhatsApp's two choices ---------- */
.onb-choices { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--space-3); }
.onb-choices li + li { margin-top: 0; }
.onb-choice { margin: 0; padding: var(--space-4); border: var(--rule-hair) solid var(--line); min-width: 0; }
.onb-choice.chosen { border: var(--rule-strong) solid var(--ink); }
.onb-choice h2 { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.onb-choice form.inline { margin: 0; }

/* ---------- The guided setup: the switches ---------- */
.onb-switches fieldset { max-width: none; }
.onb-switch { margin: var(--space-2) 0; padding: 0 0 var(--space-2); border-bottom: var(--rule-hair) solid var(--line); }
.onb-switch:last-child { border-bottom: 0; }
.onb-switch .hint { margin-bottom: 0; }
.onb-switch.fixed p { margin-bottom: var(--space-1); }

/* ---------- The guided setup: the lightbox (a popover), and its drawing of the theme editor ---------- */
.onb-lightbox {
  width: min(40rem, calc(100vw - 2 * var(--gutter))); max-height: calc(100vh - 2 * var(--space-5)); overflow: auto;
  padding: var(--space-5); border: var(--rule-strong) solid var(--ink); border-radius: var(--radius-0); background: var(--paper); color: var(--ink);
}
.onb-lightbox::backdrop { background: var(--band); opacity: 0.6; }
.onb-lightbox h2 { margin-top: 0; }
.onb-save-steps { margin: 0 0 var(--space-4); }
.onb-drawing { margin: var(--space-2) 0 var(--space-5); border: var(--rule-hair) solid var(--ink); background: var(--surface-2); font-size: var(--text-xs); line-height: 1.3; }
.ed-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--band); color: var(--band-ink); }
.ed-title { font-weight: var(--weight-semibold); }
.ed-save { position: relative; padding: 0.2rem 0.7rem; background: var(--paper); color: var(--ink); font-weight: var(--weight-semibold); outline: 3px solid var(--accent); outline-offset: 2px; }
.ed-body { display: grid; grid-template-columns: 2.75rem minmax(0, 13rem) minmax(0, 1fr); min-height: 9rem; }
.ed-rail { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-2); background: var(--paper); border-right: var(--rule-hair) solid var(--line); }
.ed-icon { position: relative; display: block; width: 1.4rem; height: 1.4rem; border: var(--rule-hair) solid var(--ink-3); }
.ed-icon.on { background: var(--ink); border-color: var(--ink); outline: 3px solid var(--accent); outline-offset: 2px; }
.ed-panel { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); background: var(--paper); border-right: var(--rule-hair) solid var(--line); min-width: 0; }
.ed-head { font-weight: var(--weight-semibold); }
.ed-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.ed-name { min-width: 0; overflow-wrap: anywhere; }
.ed-toggle { position: relative; flex: none; width: 2.1rem; height: 1.15rem; border-radius: 999px; background: var(--ok); outline: 3px solid var(--accent); outline-offset: 2px; }
.ed-toggle::after { content: ''; position: absolute; right: 3px; top: 3px; width: calc(1.15rem - 6px); height: calc(1.15rem - 6px); border-radius: 50%; background: var(--paper); }
.ed-preview { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); }
.ed-line { display: block; height: 6px; background: var(--line); }
.ed-line.short { width: 60%; }
.ed-block { display: block; height: 3rem; border: var(--rule-hair) dashed var(--ink-3); }
.ed-callout {
  position: absolute; top: -0.75rem; right: -0.75rem; z-index: 1; display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: var(--label-size); font-weight: var(--weight-regular);
}
@media (max-width: 520px) {
  .ed-body { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .ed-preview { display: none; }
}

/* ---------- The guided setup: the phone, as on the website and in the demo ---------- */
.onb-phone { margin: 0; min-width: 0; }
.onb-phone .phone {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: flex; flex-direction: column; max-width: 22rem; min-height: 28rem; margin: 0 auto; overflow: hidden;
  border: 10px solid var(--phone-frame); border-radius: var(--radius-device); background: var(--chat-bg); box-shadow: 0 0 0 1px var(--line);
}
.onb-phone .phone::before {
  content: ''; flex: none; height: 24px; background: var(--chat-head);
  background-image: linear-gradient(var(--chat-head-ink), var(--chat-head-ink)), linear-gradient(90deg, var(--chat-head-ink) 0 70%, transparent 70% 78%, var(--chat-head-ink) 78% 100%);
  background-size: 28px 6px, 22px 8px; background-position: 18px 11px, calc(100% - 16px) 10px; background-repeat: no-repeat;
}
.onb-phone .chat-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px; background: var(--chat-head); color: var(--chat-head-ink); }
.onb-phone .avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--ink); font-weight: 600; font-size: 0.85rem; }
.onb-phone .chat-who { display: flex; flex-direction: column; min-width: 0; }
.onb-phone .chat-name { font-weight: 600; font-size: 0.98rem; line-height: 1.2; overflow-wrap: anywhere; }
.onb-phone .chat-sub { font-size: 0.75rem; opacity: 0.85; overflow-wrap: anywhere; }
.onb-phone .chat { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 14px; }
.onb-phone .bubble {
  align-self: flex-start; max-width: 88%; padding: 6px 9px 4px; background: var(--bubble-in); color: var(--bubble-ink);
  border-radius: var(--radius-bubble); border-top-left-radius: 0; font-size: 0.9rem; line-height: 1.35; overflow-wrap: anywhere;
  transition: opacity 0.15s;
}
.onb-phone .bubble.out { align-self: flex-end; background: var(--bubble-out); border-top-left-radius: var(--radius-bubble); border-top-right-radius: 0; }
.onb-phone .bubble.ai { box-shadow: inset 3px 0 0 var(--bubble-meta); }
.onb-phone .bubble-text { display: block; white-space: pre-wrap; }
.onb-phone .ai-label { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--bubble-meta); }
.onb-phone .bubble-footer { display: block; margin-top: 4px; font-size: 0.76rem; color: var(--bubble-meta); }
.onb-phone .bubble-buttons { display: grid; margin: 6px -9px -4px; border-top: 1px solid var(--line); }
.onb-phone .bubble-buttons span { display: flex; justify-content: center; align-items: center; padding: 8px; color: var(--bubble-link); font-weight: 500; font-size: 0.88rem; }
.onb-phone .bubble-buttons span + span { border-top: 1px solid var(--line); }
.onb-phone figcaption { margin: var(--space-2) auto 0; max-width: 22rem; font-size: var(--text-sm); color: var(--ink-2); text-align: center; }

/* A switch that is off dims its example, and says "Off"; a focused switch outlines its example. */
.onb:has(#sw-assistant:not(:checked)) .onb-phone [data-example="assistant"],
.onb:has(#sw-backInStock:not(:checked)) .onb-phone [data-example="backInStock"],
.onb:has(#sw-updates:not(:checked)) .onb-phone [data-example="updates"] { opacity: 0.45; }
.onb:has(#sw-assistant:not(:checked)) .onb-phone [data-example="assistant"]::before,
.onb:has(#sw-backInStock:not(:checked)) .onb-phone [data-example="backInStock"]::before,
.onb:has(#sw-updates:not(:checked)) .onb-phone [data-example="updates"]::before {
  content: attr(data-off); display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--bubble-meta);
}
.onb:has(#sw-assistant:focus-visible) .onb-phone [data-example="assistant"],
.onb:has(#sw-backInStock:focus-visible) .onb-phone [data-example="backInStock"],
.onb:has(#sw-updates:focus-visible) .onb-phone [data-example="updates"] { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- The guided setup: trying it on WhatsApp ---------- */
.onb-try { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin: 0 0 var(--space-3); }
.onb-qr-box { flex: none; padding: var(--space-2); background: var(--paper); border: var(--rule-hair) solid var(--line); line-height: 0; }
.onb-qr { width: 200px; height: 200px; max-width: 100%; }
.onb-try-card { margin: var(--space-4) 0; }
.onb-try-card .onb-try { margin: 0; }
.onb-try-words { flex: 1 1 16rem; min-width: 0; }
.onb-try-words p { margin: 0 0 var(--space-2); }
.onb-try-words p:last-child { margin-bottom: 0; }
.onb-try-words .button-link { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .onb-card { padding: var(--space-4); }
  .onb-nav { flex-direction: column-reverse; align-items: stretch; }
  .onb-nav > a, .onb-nav form.inline, .onb-nav button { width: 100%; text-align: center; }
  .onb-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
