/* RouteMate hosted pages: the one stylesheet, served as /static/site.css.
   Section 1 is tokens, section 2 components. Components use tokens only (no raw colours),
   so a re-skin changes section 1 and nothing else.
   Light is the default; dark follows the OS. <html data-theme="light|dark"> forces a scheme.
   No TfL marks or look-alikes: no line colours as brand colours, no roundel shapes, no
   Johnston-like typeface (the fallback stack deliberately omits Gill Sans).
   Type: Bricolage Grotesque for display and headings, Atkinson Hyperlegible Next for text,
   both self-hosted subsets under the SIL Open Font License (see /static/fonts/). */

@font-face { font-family: "Bricolage Grotesque"; src: url("/static/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/static/fonts/atkinson-hyperlegible-next.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

/* =========================================================================
   1. TOKENS
   ========================================================================= */
:root {
  color-scheme: light dark;

  /* ---- Brand: the only tokens a re-skin must change (light values) ---- */
  --color-brand: #C0139F;          /* button fill (fuchsia); white text 5.5:1 */
  --color-brand-hover: #B30F9D;
  --color-brand-pressed: #9C0D8D;
  --color-on-brand: #FFFFFF;
  --color-brand-tint: #FBE9F6;     /* icon wells, selected plan, step numbers */
  --color-link: #9C0D8D;           /* 7.4:1 on bg, 6.3:1 on brand-tint */
  --color-focus: #C0139F;
  --color-bg-wash: #FCEFF9;        /* top of the page gradient */

  /* ---- Neutrals (light) ---- */
  --color-bg: #FFFFFF;
  --color-bg-subtle: #F9F7F9;
  --color-surface: #FFFFFF;
  --color-surface-sunken: #F6F3F6;
  --color-border: #E8E3E8;
  --color-border-strong: #CCC3CB;   /* decorative edges only */
  --color-border-input: #938992;    /* inputs, radios, plan options: 3.4:1 on surface (WCAG 1.4.11) */
  --color-text: #1D161C;           /* 17.7:1 on bg */
  --color-text-secondary: #554A54; /* 8.4:1 on bg */
  --color-text-tertiary: #6C626B;  /* 5.8:1 on bg, 5.3:1 on sunken */

  /* ---- Status (light). Never the only signal: always with an icon or a word ---- */
  --color-success: #1E6B45;        /* text/icon; 6.6:1 on success-tint */
  --color-success-tint: #E7F4EC;
  --color-warning: #8A4B00;        /* text/icon; 6.4:1 on warning-tint */
  --color-warning-tint: #FDF2E1;
  --color-warning-border: #E9B46A;
  --color-danger: #B42318;         /* destructive fill; white text 6.5:1 */
  --color-danger-hover: #912018;
  --color-on-danger: #FFFFFF;
  --color-danger-tint: #FDECEA;

  /* ---- Third-party sign-in buttons (fixed by Apple and Google guidelines) ---- */
  --apple-bg: #000000; --apple-fg: #FFFFFF; --apple-border: #000000;
  --google-bg: #FFFFFF; --google-fg: #1F1F1F; --google-border: #747775;

  /* ---- Typography ---- */
  --font-system: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-system);
  --font-text: "Atkinson Hyperlegible Next", var(--font-system);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --text-display: clamp(2.25rem, 1.5rem + 3.2vw, 4rem);      /* 36 → 64 */
  --leading-display: 1.05;
  --tracking-display: -0.032em;
  --text-h1: clamp(1.875rem, 1.5rem + 1.6vw, 2.75rem);       /* 30 → 44 */
  --leading-h1: 1.1;
  --tracking-h1: -0.026em;
  --text-h2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);            /* 24 → 32 */
  --leading-h2: 1.18;
  --tracking-h2: -0.02em;
  --text-h3: 1.1875rem;                                       /* 19 */
  --leading-h3: 1.3;
  --text-lede: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);     /* 17 → 20 */
  --leading-lede: 1.5;
  --text-body: 1rem;                                          /* 16 */
  --leading-body: 1.55;
  --text-small: 0.9375rem;                                    /* 15 */
  --leading-small: 1.5;
  --text-caption: 0.8125rem;                                  /* 13 */
  --leading-caption: 1.45;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---- Spacing (4 px base) ---- */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --section-y: clamp(56px, 32px + 6vw, 112px);
  --gutter: clamp(16px, 4vw, 32px);
  --container: 1120px;
  --container-narrow: 760px;
  --container-card: 30rem;           /* sign-in, consent, results */

  /* ---- Radii: soft rectangles; no circle-and-bar shapes anywhere ---- */
  --radius-xs: 6px; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px;
  --radius-pill: 999px;

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgb(29 21 28 / 0.06);
  --shadow-md: 0 4px 14px rgb(29 21 28 / 0.07), 0 1px 3px rgb(29 21 28 / 0.06);
  --shadow-lg: 0 24px 48px -14px rgb(29 21 28 / 0.20), 0 4px 12px rgb(29 21 28 / 0.06);
  --shadow-focus: 0 0 0 3px rgb(192 19 159 / 0.30);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;

  --z-nav: 50;
}

/* Dark values. Written twice (OS preference, then explicit override) because CSS cannot
   share one block between a media query and an attribute selector. Keep both in step. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-brand: #F29AF0; --color-brand-hover: #FAB3F7; --color-brand-pressed: #E985E4;
    --color-on-brand: #2A0A28; --color-brand-tint: #3A1738; --color-link: #F29AF0;
    --color-focus: #F29AF0; --color-bg-wash: #21121F;
    --color-bg: #130E12; --color-bg-subtle: #181418; --color-surface: #1D181D;
    --color-surface-sunken: #0F0B0E; --color-border: #322A32; --color-border-strong: #4F444E; --color-border-input: #857684;
    --color-text: #F5F0F5; --color-text-secondary: #C2B7C1; --color-text-tertiary: #A79AA6;
    --color-success: #7DD3A8; --color-success-tint: #12261B;
    --color-warning: #F5B65C; --color-warning-tint: #2A1F0E; --color-warning-border: #7A5522;
    --color-danger: #FF8A80; --color-danger-hover: #FFA39B; --color-on-danger: #2A0806;
    --color-danger-tint: #2E1414;
    --apple-bg: #FFFFFF; --apple-fg: #000000; --apple-border: #FFFFFF;
    --google-bg: #131314; --google-fg: #E3E3E3; --google-border: #8E918F;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 14px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 24px 48px -14px rgb(0 0 0 / 0.6), 0 4px 12px rgb(0 0 0 / 0.3);
    --shadow-focus: 0 0 0 3px rgb(242 154 240 / 0.40);
  }
}
:root[data-theme="dark"] {
  --color-brand: #F29AF0; --color-brand-hover: #FAB3F7; --color-brand-pressed: #E985E4;
  --color-on-brand: #2A0A28; --color-brand-tint: #3A1738; --color-link: #F29AF0;
  --color-focus: #F29AF0; --color-bg-wash: #21121F;
  --color-bg: #130E12; --color-bg-subtle: #181418; --color-surface: #1D181D;
  --color-surface-sunken: #0F0B0E; --color-border: #322A32; --color-border-strong: #4F444E; --color-border-input: #857684;
  --color-text: #F5F0F5; --color-text-secondary: #C2B7C1; --color-text-tertiary: #A79AA6;
  --color-success: #7DD3A8; --color-success-tint: #12261B;
  --color-warning: #F5B65C; --color-warning-tint: #2A1F0E; --color-warning-border: #7A5522;
  --color-danger: #FF8A80; --color-danger-hover: #FFA39B; --color-on-danger: #2A0806;
  --color-danger-tint: #2E1414;
  --apple-bg: #FFFFFF; --apple-fg: #000000; --apple-border: #FFFFFF;
  --google-bg: #131314; --google-fg: #E3E3E3; --google-border: #8E918F;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 14px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 24px 48px -14px rgb(0 0 0 / 0.6), 0 4px 12px rgb(0 0 0 / 0.3);
  --shadow-focus: 0 0 0 3px rgb(242 154 240 / 0.40);
}

/* =========================================================================
   2. COMPONENTS (class names are the API; modifiers use --double-dash)
   ========================================================================= */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-text); font-size: var(--text-body); line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 4px; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.92em; }
h1, h2, h3, h4, p { margin: 0; }
strong { font-weight: var(--weight-semibold); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: 100; padding: var(--space-2) var(--space-4); background: var(--color-surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.skip-link:focus { top: var(--space-3); }
.icon { width: 20px; height: 20px; flex: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Light/dark image swap, for third-party artwork that cannot use currentColor (Apple logo). */
:root[data-theme="light"] .when-dark, :root[data-theme="dark"] .when-light { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .when-dark { display: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .when-light { display: none; } }

/* ---------- Layout ---------- */
.shell { flex: 1 0 auto; background: linear-gradient(180deg, var(--color-bg-wash) 0, var(--color-bg) 440px); }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.layout-narrow .container { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.layout-card .container { max-width: calc(var(--container-card) + 2 * var(--gutter)); }
.page { padding-block: var(--space-7) var(--space-8); }
.section { padding: var(--section-y) 0; }
.section--subtle { background: var(--color-bg-subtle); border-block: 1px solid var(--color-border); }
.section-head { max-width: 640px; margin: 0 auto var(--space-7); text-align: center; }
.section-head .lede { margin-top: var(--space-3); }
@media (max-width: 560px) { .page { padding-block: var(--space-5) var(--space-7); } }

/* ---------- Type roles ---------- */
.display { font-size: var(--text-display); line-height: var(--leading-display); letter-spacing: var(--tracking-display); font-weight: var(--weight-bold); text-wrap: balance; }
.h1 { font-size: var(--text-h1); line-height: var(--leading-h1); letter-spacing: var(--tracking-h1); font-weight: var(--weight-bold); text-wrap: balance; }
.h2 { font-size: var(--text-h2); line-height: var(--leading-h2); letter-spacing: var(--tracking-h2); font-weight: var(--weight-bold); text-wrap: balance; }
.h3 { font-size: var(--text-h3); line-height: var(--leading-h3); letter-spacing: -0.01em; font-weight: var(--weight-semibold); }
.lede { font-size: var(--text-lede); line-height: var(--leading-lede); color: var(--color-text-secondary); text-wrap: pretty; }
.small { font-size: var(--text-small); line-height: var(--leading-small); }
.caption { font-size: var(--text-caption); line-height: var(--leading-caption); color: var(--color-text-tertiary); }
.display, .h1, .h2, .h3, .price, .plan-price, .prose h2 { font-family: var(--font-display); }
.eyebrow { display: inline-block; margin-bottom: var(--space-3); font-size: var(--text-caption); font-weight: var(--weight-semibold); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-link); }
.muted { color: var(--color-text-secondary); }
.hint { margin-top: var(--space-2); font-size: var(--text-small); line-height: var(--leading-small); color: var(--color-text-tertiary); }
.mono { font-family: var(--font-mono); font-size: 0.9em; }

/* ---------- Logo lockup ----------
   The logo files carry clear space of a fifth of the tile on every side, so a 30 px tile is a
   42 px image pulled back by 6 px: the tile then sits where the design's mark did. */
.logo { display: inline-flex; align-items: center; color: var(--color-text); text-decoration: none; }
.logo img { height: 42px; width: auto; max-width: none; margin: -6px; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo:hover { text-decoration: none; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: var(--z-nav); background: color-mix(in srgb, var(--color-bg) 84%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent); }
.nav-inner { display: flex; align-items: center; gap: var(--space-5); height: 64px; }
.nav-links { display: flex; gap: var(--space-5); margin: 0 0 0 auto; padding: 0; list-style: none; }
.nav-links a { display: inline-block; padding: 10px 0; color: var(--color-text-secondary); text-decoration: none; font-size: var(--text-small); font-weight: var(--weight-medium); }
.nav-links a:hover { color: var(--color-text); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.nav-links + .nav-end { margin-left: 0; }
.nav-menu { display: none; position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); color: var(--color-text); }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu[open] > summary { background: var(--color-surface-sunken); }
.nav-menu ul { position: absolute; right: 0; top: 52px; min-width: 220px; margin: 0; padding: var(--space-2); list-style: none; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.nav-menu li a { display: block; padding: 12px 14px; border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none; font-weight: var(--weight-medium); }
.nav-menu li a:hover { background: var(--color-surface-sunken); }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-menu { display: block; }
  .nav-end, .nav-links + .nav-end { margin-left: auto; }
  .nav-end .btn--hide-mobile { display: none; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-size: var(--text-small); font-weight: var(--weight-semibold); line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.btn:hover { text-decoration: none; }
.btn .icon { width: 18px; height: 18px; }
.btn--lg { min-height: 50px; padding: 0 24px; font-size: var(--text-body); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: var(--text-caption); }
/* Dense rows keep 36 px only with a fine pointer on wide screens; touch and narrow screens get the full 44 px. */
@media (max-width: 760px), (pointer: coarse) { .btn--sm { min-height: 44px; padding: 0 16px; font-size: var(--text-small); } }
.btn--block { width: 100%; }
.btn--primary { background: var(--color-brand); color: var(--color-on-brand); }
.btn--primary:hover { background: var(--color-brand-hover); }
.btn--primary:active { background: var(--color-brand-pressed); }
.btn--secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn--secondary:hover { border-color: var(--color-text-tertiary); background: var(--color-surface-sunken); }
.btn--ghost { background: transparent; color: var(--color-link); padding: 0 10px; }
.btn--ghost:hover { background: var(--color-brand-tint); }
.btn--danger { background: var(--color-danger); color: var(--color-on-danger); }
.btn--danger:hover { background: var(--color-danger-hover); }
.btn--danger:focus-visible { outline-color: var(--color-danger); }
.btn--danger-outline { background: var(--color-surface); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 55%, var(--color-border)); }
.btn--danger-outline:hover { background: var(--color-danger-tint); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
/* Destructive confirm: the button is always a real, enabled button. The confirm checkbox is
   `required`, so the browser blocks the submit and announces the box; the server also refuses a
   request without it and re-renders the page with .check.is-invalid + .field-error. */
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.btn-row--end { justify-content: flex-end; }
@media (max-width: 560px) { .btn-row--stack { flex-direction: column-reverse; align-items: stretch; } .btn-row--stack .btn { width: 100%; } }

/* Sign in with Apple: Apple HIG custom button (exact title, black on light / white on dark,
   44px high, logo is Apple's artwork). Sign in with Google: Google's branding rules
   (white / #131314 fill, 1px border, the four-colour G, "Sign in with Google"). */
.btn-apple, .btn-google { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; min-width: 140px; height: 44px; padding: 0 16px; border-radius: var(--radius-sm); font-family: var(--font-text); font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; cursor: pointer; font-size: 17px; line-height: 1; }
.btn-apple { background: var(--apple-bg); color: var(--apple-fg); border: 1px solid var(--apple-border); }
.btn-apple img { width: 42px; height: 42px; margin: 0 -8px 0 -12px; }
.btn-google { gap: 10px; background: var(--google-bg); color: var(--google-fg); border: 1px solid var(--google-border); font-size: 15px; }
.btn-google svg { width: 18px; height: 18px; }
.btn-apple:hover, .btn-google:hover { text-decoration: none; opacity: 0.9; }
.auth-buttons { display: grid; gap: var(--space-3); margin-top: var(--space-5); }

/* ---------- Card (the panel used by every non-landing page) ---------- */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: var(--space-6); }
.card + .card { margin-top: var(--space-5); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.card .lede { margin-top: var(--space-3); }
@media (max-width: 560px) { .card { padding: var(--space-5); border-radius: var(--radius-lg); } }
.page-title { margin-bottom: var(--space-5); }
.page-title .h1 + p { margin-top: var(--space-2); }

/* ---------- Hero (landing) ---------- */
.hero { padding-block: clamp(48px, 7vw, 96px) var(--space-8); }
.hero-grid { display: grid; gap: var(--space-7); align-items: center; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.hero .lede { margin-top: var(--space-5); max-width: 36rem; }
.hero .btn-row { margin-top: var(--space-6); }
.hero .caption { margin-top: var(--space-4); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .hero .btn-row .btn { width: 100%; } }

/* ---------- Illustration window (inert picture of an assistant chat) ----------
   Always aria-hidden="true" with a text alternative beside it. Not interactive. */
.window { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; pointer-events: none; user-select: none; -webkit-user-select: none; }
.window-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--color-border); background: var(--color-bg-subtle); }
.window-bar i { width: 9px; height: 9px; border-radius: 2px; background: var(--color-border-strong); }
.window-bar span { margin-left: 8px; font-size: var(--text-caption); color: var(--color-text-tertiary); font-weight: var(--weight-medium); }
.window-body { padding: var(--space-5); display: grid; gap: var(--space-3); font-size: var(--text-small); }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; }
.bubble--user { justify-self: end; background: var(--color-brand); color: var(--color-on-brand); border-bottom-right-radius: 4px; }
.bubble--assistant { justify-self: start; background: var(--color-surface-sunken); border: 1px solid var(--color-border); border-bottom-left-radius: 4px; display: grid; gap: var(--space-2); }
.tool-chip { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: var(--weight-semibold); color: var(--color-link); background: var(--color-brand-tint); border-radius: var(--radius-xs); padding: 3px 8px; }
.tool-chip .icon { width: 14px; height: 14px; }
.route { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 12px; display: grid; gap: 6px; }
.route-top { display: flex; justify-content: space-between; gap: var(--space-3); font-weight: var(--weight-semibold); }
.route-top time { font-variant-numeric: tabular-nums; }
.route-legs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--color-text-secondary); font-size: var(--text-caption); }
.route-legs .leg { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: var(--radius-xs); background: var(--color-surface-sunken); border: 1px solid var(--color-border); }
.route-legs .leg .icon { width: 13px; height: 13px; }
.route-legs .sep { color: var(--color-text-tertiary); }

/* ---------- Issue tag (severity by icon + word, colour third) ---------- */
.issue { display: inline-flex; align-items: center; gap: 5px; justify-self: start; font-size: var(--text-caption); font-weight: var(--weight-semibold); padding: 2px 8px 2px 6px; border-radius: var(--radius-xs); }
.issue .icon { width: 14px; height: 14px; }
.issue--ok { color: var(--color-success); background: var(--color-success-tint); }
.issue--warn { color: var(--color-warning); background: var(--color-warning-tint); }
.issue--severe { color: var(--color-danger); background: var(--color-danger-tint); }

/* ---------- Feature cards ---------- */
.feature-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.feature-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.feature-card .h3 { margin-top: var(--space-4); }
.feature-card p { margin-top: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-small); }
.feature-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--color-brand-tint); color: var(--color-link); }
.feature-icon .icon { width: 22px; height: 22px; }

/* ---------- Works-with chips (names only: no third-party logos) ---------- */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-3); margin: 0; padding: 0; list-style: none; }
.chips li { padding: 8px 16px; border-radius: var(--radius-pill); background: var(--color-surface); border: 1px solid var(--color-border); font-weight: var(--weight-semibold); font-size: var(--text-small); }
.chips li.chips-more { font-weight: var(--weight-regular); color: var(--color-text-secondary); }
.works-with { text-align: center; }
.works-with .caption { margin-bottom: var(--space-3); }

/* ---------- Connect: steps + copy box + per-assistant notes ---------- */
.connect-grid { display: grid; gap: var(--space-7); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .connect-grid { grid-template-columns: minmax(0, 1fr); } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: var(--space-5); }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: var(--space-4); }
.steps > li::before { content: counter(step); grid-row: span 3; width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--color-brand-tint); color: var(--color-link); font-weight: var(--weight-bold); }
.step-title { font-weight: var(--weight-semibold); padding-top: 6px; }
.step-body { color: var(--color-text-secondary); font-size: var(--text-small); margin-top: var(--space-1); }
.steps .copy-box { margin-top: var(--space-3); }

.copy-label { display: block; font-size: var(--text-caption); font-weight: var(--weight-semibold); color: var(--color-text-tertiary); margin-bottom: var(--space-2); }
.copy-box { display: flex; align-items: center; gap: var(--space-2); background: var(--color-surface-sunken); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 4px 4px 4px 14px; min-width: 0; }
.copy-box code { flex: 1; min-width: 0; padding: 9px 0; font-size: 0.9375rem; line-height: 1.45; color: var(--color-text); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
/* The copy button ships with the hidden attribute; /static/copy.js (script-src 'self') unhides it.
   Without script, a single click on the code selects all of it (user-select: all). */
.copy-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: var(--text-caption); font-weight: var(--weight-semibold); cursor: pointer; }
.copy-btn[hidden] { display: none; }
.copy-btn:hover { border-color: var(--color-text-tertiary); }
.copy-btn .icon { width: 16px; height: 16px; }
.copy-btn .when-idle, .copy-btn .when-done { display: inline-flex; align-items: center; gap: 6px; }
.copy-btn .when-done { display: none; }
.copy-btn[data-copied] { background: var(--color-success-tint); border-color: var(--color-success); color: var(--color-success); }
.copy-btn[data-copied] .when-idle { display: none; }
.copy-btn[data-copied] .when-done { display: inline-flex; }
@media (max-width: 560px) {
  .copy-box code { font-size: 0.875rem; }
  .steps .copy-box { grid-column: 1 / -1; }
}

.disclosures { border-top: 1px solid var(--color-border); }
.disclosures details { border-bottom: 1px solid var(--color-border); }
.disclosures summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 52px; padding: 12px 0; font-weight: var(--weight-semibold); }
.disclosures summary::-webkit-details-marker { display: none; }
.disclosures summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--color-text-tertiary); border-bottom: 2px solid var(--color-text-tertiary); transform: translateY(-3px) rotate(45deg); transition: transform var(--duration-base) var(--ease-out); }
.disclosures details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.disclosures .answer { padding: 0 0 var(--space-4); color: var(--color-text-secondary); font-size: var(--text-small); max-width: 64ch; }
.disclosures .answer p + p, .disclosures .answer p + .copy-box { margin-top: var(--space-3); }
.disclosures .answer code:not(.copy-box code) { background: var(--color-surface-sunken); border-radius: 4px; padding: 0.1em 0.35em; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 980px) { .pricing-grid { grid-template-columns: minmax(0, 1fr); max-width: 30rem; margin: 0 auto; } }
.price-card { display: flex; flex-direction: column; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: var(--space-6); }
.price-card--featured { border: 2px solid var(--color-brand); box-shadow: var(--shadow-lg); }
.price-card .tag { align-self: flex-start; font-size: var(--text-caption); font-weight: var(--weight-semibold); padding: 3px 10px; border-radius: var(--radius-xs); background: var(--color-brand-tint); color: var(--color-link); }
.price-card .tag--plain { background: var(--color-surface-sunken); color: var(--color-text-secondary); }
.price-card .h3 { margin-top: var(--space-4); }
.price { margin-top: var(--space-3); font-size: 2.5rem; line-height: 1; font-weight: var(--weight-bold); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.price small { font-size: var(--text-body); font-weight: var(--weight-medium); color: var(--color-text-secondary); letter-spacing: 0; }
.price-alt { margin-top: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-small); }
.ticks { list-style: none; margin: var(--space-5) 0 var(--space-6); padding: 0; display: grid; gap: var(--space-3); font-size: var(--text-small); }
.ticks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--space-3); }
.ticks li .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--color-link); }
.price-card .btn { margin-top: auto; width: 100%; }
.pricing-note { margin-top: var(--space-5); text-align: center; }

/* ---------- Callout ---------- */
.callout { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-border); }
.callout p { color: var(--color-text-secondary); font-size: var(--text-small); margin-top: var(--space-1); }
.callout .btn-row, .callout .copy-box { margin-top: var(--space-4); }

/* ---------- Alerts (role="status" for good news, role="alert" for problems) ---------- */
.alert { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--space-3); margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface-sunken); color: var(--color-text); font-size: var(--text-small); }
.alert .icon { margin-top: 1px; }
.alert > div > strong:first-child { display: block; }
.alert--success { background: var(--color-success-tint); border-color: color-mix(in srgb, var(--color-success) 45%, transparent); }
.alert--success .icon { color: var(--color-success); }
.alert--warning { background: var(--color-warning-tint); border-color: var(--color-warning-border); }
.alert--warning .icon { color: var(--color-warning); }
.alert--danger { background: var(--color-danger-tint); border-color: color-mix(in srgb, var(--color-danger) 45%, transparent); }
.alert--danger .icon { color: var(--color-danger); }
.alert .btn-row { margin-top: var(--space-3); }

/* ---------- Status badge (plan state) ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: var(--radius-pill); font-size: var(--text-caption); font-weight: var(--weight-semibold); background: var(--color-surface-sunken); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.status .icon { width: 14px; height: 14px; }
.status--active { background: var(--color-success-tint); color: var(--color-success); border-color: transparent; }
.status--warning { background: var(--color-warning-tint); color: var(--color-warning); border-color: transparent; }
.status--brand { background: var(--color-brand-tint); color: var(--color-link); border-color: transparent; }

/* ---------- Facts ---------- */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-5); margin: var(--space-4) 0 0; padding: var(--space-4); background: var(--color-surface-sunken); border-radius: var(--radius-md); font-size: var(--text-small); }
.facts dt { color: var(--color-text-tertiary); }
.facts dd { margin: 0; font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
@media (max-width: 560px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 0; } .facts dd { margin-bottom: var(--space-3); } .facts dd:last-child { margin-bottom: 0; } }

/* ---------- Account sections (each is a .card) ---------- */
.card > .card-head + p { margin-top: var(--space-3); color: var(--color-text-secondary); font-size: var(--text-small); }
.card > .btn-row, .card form > .btn-row { margin-top: var(--space-4); }
.acct-section + .acct-section { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--color-border); }
.acct-section > .h3 + p, .acct-section > .card-head + p { margin-top: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-small); }
.acct-section .btn-row { margin-top: var(--space-4); }

/* ---------- Row list (connected apps, API keys) ---------- */
.rows { list-style: none; margin: var(--space-4) 0 0; padding: 0; border-top: 1px solid var(--color-border); }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--space-2) var(--space-4); align-items: center; padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border); }
.row-title { font-weight: var(--weight-semibold); }
.row-meta { display: block; font-size: var(--text-caption); color: var(--color-text-tertiary); margin-top: 2px; }
.row-meta .mono { color: var(--color-text-secondary); }
.row form { margin: 0; }
@media (max-width: 560px) { .row { grid-template-columns: 40px minmax(0, 1fr); } .row form { grid-column: 2; } }
.tile { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--color-surface-sunken); border: 1px solid var(--color-border); color: var(--color-text-secondary); font-weight: var(--weight-bold); }
.tile .icon { width: 20px; height: 20px; }
.empty { margin-top: var(--space-4); padding: var(--space-5); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); text-align: center; color: var(--color-text-secondary); font-size: var(--text-small); }
.empty .icon { width: 24px; height: 24px; margin: 0 auto var(--space-2); color: var(--color-text-tertiary); }

/* ---------- Form fields ---------- */
.field { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.field label, .field-label { font-size: var(--text-small); font-weight: var(--weight-semibold); color: var(--color-text); }
.input { width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border-input); border-radius: var(--radius-sm); transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
.input::placeholder { color: var(--color-text-tertiary); }
.input:hover { border-color: var(--color-text-tertiary); }
.input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; border-color: var(--color-focus); box-shadow: var(--shadow-focus); }
.input[aria-invalid="true"] { border-color: var(--color-danger); }
.field-error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--text-small); font-weight: var(--weight-semibold); color: var(--color-danger); }
.field-error .icon { width: 16px; height: 16px; margin-top: 3px; }
.inline-form { display: flex; gap: var(--space-3); align-items: flex-end; margin-top: var(--space-4); }
.inline-form .field { margin-top: 0; flex: 1; }
@media (max-width: 560px) { .inline-form { flex-direction: column; align-items: stretch; } }
.check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); align-items: start; margin-top: var(--space-5); padding: var(--space-4); border: 1px solid var(--color-border-input); border-radius: var(--radius-md); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--color-danger); }
.check:has(input:checked) { border-color: var(--color-danger); background: var(--color-danger-tint); }
.check.is-invalid { border: 2px solid var(--color-danger); padding: calc(var(--space-4) - 1px); }
.check + .field-error { margin-top: var(--space-2); }
.divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0 0; color: var(--color-text-tertiary); font-size: var(--text-caption); text-transform: uppercase; letter-spacing: 0.08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.legal-line { margin-top: var(--space-5); font-size: var(--text-caption); color: var(--color-text-tertiary); text-align: center; }

/* ---------- Plan picker (radio cards; works without script) ---------- */
.plan-picker { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); margin: var(--space-4) 0 0; padding: 0; border: 0; }
.plan-picker legend { padding: 0; margin-bottom: var(--space-2); font-size: var(--text-small); font-weight: var(--weight-semibold); }
.plan-option { position: relative; display: grid; align-content: start; gap: 2px; padding: var(--space-4); border: 1px solid var(--color-border-input); border-radius: var(--radius-md); background: var(--color-surface); cursor: pointer; }
.plan-option input { position: absolute; top: var(--space-4); right: var(--space-4); width: 20px; height: 20px; margin: 0; accent-color: var(--color-brand); }
.plan-option:has(input:checked) { border: 2px solid var(--color-brand); padding: calc(var(--space-4) - 1px); background: var(--color-brand-tint); }
.plan-option:has(input:focus-visible) { box-shadow: var(--shadow-focus); }
.plan-name { font-weight: var(--weight-semibold); padding-right: 28px; }
.plan-price { font-size: 1.375rem; font-weight: var(--weight-bold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: var(--text-small); font-weight: var(--weight-medium); color: var(--color-text-secondary); }
.plan-note { font-size: var(--text-caption); color: var(--color-text-tertiary); }
.plan-option:has(input:checked) .plan-note { color: var(--color-text-secondary); }
@media (max-width: 420px) { .plan-picker { grid-template-columns: minmax(0, 1fr); } }

/* ---------- OAuth consent ---------- */
.consent-head { display: flex; align-items: center; justify-content: center; gap: var(--space-3); margin-bottom: var(--space-5); color: var(--color-text-tertiary); }
.consent-head .tile { width: 52px; height: 52px; border-radius: var(--radius-md); font-size: 1.25rem; color: var(--color-text); }
.consent-head .logo-mark { width: 52px; height: 52px; }
.consent-head .link-dots { display: flex; gap: 4px; }
.consent-head .link-dots i { width: 5px; height: 5px; border-radius: 1px; background: var(--color-border-strong); }
.center { text-align: center; }
.perm-title { margin-top: var(--space-5); font-size: var(--text-small); font-weight: var(--weight-semibold); }
.perm-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--text-small); }
.perm-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--space-3); }
.perm-list .icon { width: 18px; height: 18px; margin-top: 2px; }
.perm-list--can .icon { color: var(--color-success); }
.perm-list--cannot .icon { color: var(--color-text-tertiary); }
.perm-list--cannot li { color: var(--color-text-secondary); }

/* ---------- One-time key ---------- */
.key-box { margin-top: var(--space-4); }
.key-box .copy-box { flex-direction: column; align-items: stretch; gap: var(--space-3); padding: var(--space-4); border: 2px solid var(--color-brand); background: var(--color-brand-tint); }
.key-box code { padding: 0; font-size: 1rem; word-break: break-all; }
.key-box .copy-btn { justify-content: center; }

/* ---------- Result pages (billing return, email sent, deleted) ---------- */
.result { text-align: center; }
.result-icon { width: 56px; height: 56px; margin: 0 auto var(--space-5); border-radius: var(--radius-lg); display: grid; place-items: center; background: var(--color-brand-tint); color: var(--color-link); }
.result-icon .icon { width: 28px; height: 28px; }
.result-icon--success { background: var(--color-success-tint); color: var(--color-success); }
.result-icon--neutral { background: var(--color-surface-sunken); color: var(--color-text-secondary); }
.result-icon--danger { background: var(--color-danger-tint); color: var(--color-danger); }
.result .lede { margin-top: var(--space-3); }
.result .facts { text-align: left; margin-top: var(--space-5); }
.result .btn-row { justify-content: center; margin-top: var(--space-6); }
.result .hint { margin-top: var(--space-5); }

/* ---------- Prose (privacy, terms) ---------- */
.prose { max-width: 68ch; }
.prose h2 { margin: var(--space-6) 0 var(--space-2); font-size: var(--text-h3); line-height: var(--leading-h3); }
.prose p, .prose ul { margin: 0 0 var(--space-3); color: var(--color-text-secondary); }
.prose ul { padding-left: 1.3em; }
.prose li + li { margin-top: var(--space-1); }
.prose .placeholder { display: block; height: 0.8em; margin: 0.55em 0; border-radius: 3px; background: var(--color-border); }
.prose .placeholder--short { width: 62%; }
.summary-box { margin: var(--space-5) 0 0; padding: var(--space-5); border-radius: var(--radius-md); background: var(--color-brand-tint); }
.summary-box .h3 { font-size: var(--text-body); }
.summary-box ul { margin: var(--space-2) 0 0; padding-left: 1.2em; font-size: var(--text-small); color: var(--color-text); }
.summary-box li + li { margin-top: var(--space-1); }
.toc { margin-top: var(--space-5); padding: var(--space-4) var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md); font-size: var(--text-small); }
.toc ol { margin: var(--space-2) 0 0; padding-left: 1.3em; columns: 2; column-gap: var(--space-6); }
.toc li { break-inside: avoid; padding: 3px 0; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

/* ---------- Footer: attribution and not-affiliated lines live here on every page ---------- */
.footer { flex: none; border-top: 1px solid var(--color-border); padding: var(--space-7) 0 var(--space-7); background: var(--color-bg-subtle); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); margin: 0; padding: 0; list-style: none; font-size: var(--text-small); }
.footer-links a { display: inline-block; padding: 11px 0; color: var(--color-text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--color-text); text-decoration: underline; }
.attribution { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--color-border); display: grid; gap: var(--space-2); font-size: var(--text-caption); line-height: var(--leading-caption); color: var(--color-text-tertiary); max-width: 80ch; }
.attribution .not-affiliated { color: var(--color-text-secondary); font-weight: var(--weight-semibold); }

/* ---------- Spacing fixes ---------- */
/* A hint under a button row or form sits 12px clear of the buttons, not 8px. */
:is(.btn-row, form) + .hint, .btn-row + p.hint { margin-top: var(--space-3); }
/* Button beside a 48px input matches its height. */
.inline-form .btn { min-height: 48px; }
/* Attribution divider spans the footer; only the text is held to a readable width. */
.attribution { max-width: none; }
.attribution p { max-width: 80ch; }
/* Footer links wrap as an even grid on phones instead of leaving one link alone. */
@media (max-width: 560px) { .footer-links { width: 100%; display: grid; grid-template-columns: repeat(3, max-content); gap: 0 var(--space-5); } }
/* Result pages keep their 24px gap between the buttons and the hint. */
.result .btn-row + .hint, .result .btn-row + p.hint { margin-top: var(--space-5); }

/* ---------- Large text ---------- */
/* At a doubled default text size a phone is too narrow for one-line button labels and for
   three full-width footer columns, so both may wrap. Nothing changes at the usual size. */
.btn { max-width: 100%; white-space: normal; text-align: center; padding-block: 6px; }
/* The header grows, and its button moves to a second line, rather than cut a label off. */
.nav-inner { height: auto; min-height: 64px; padding-block: 8px; flex-wrap: wrap; row-gap: 0; }
.nav-end .btn { white-space: nowrap; }
@media (max-width: 560px) { .footer-links { grid-template-columns: repeat(3, minmax(0, max-content)); } }
