/* Fizzlayer's one stylesheet, for the site and the app.
   Every page body is white, whatever the OS theme. Views never write class names:
   they call app/src/ui.gleam or app/src/ui/*.gleam, the only modules that name
   the classes below. scripts/build-spa.sh copies this file to public/fizz.css. */

@layer tokens, base, layout, components, site, utilities;

/* Geist and Geist Mono 1.8.2, self-hosted from /fonts (SIL Open Font License 1.1).
   public/fonts.css declares the same faces for the legacy pages. */
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@layer tokens {
  :root {
    color-scheme: light;

    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

    /* Colour. Deep navy for headings, slate for body copy, one blue for actions,
       links and focus. Green, amber and red only mark status. The cyan comes
       from the logo and is used in illustrations, never for text. */
    --color-text: #0d2136;
    --color-body: #3d5266;
    --color-text-muted: #66788a;
    --color-border: #e3e8ee;
    --color-border-strong: #cbd5df;
    --color-surface: #ffffff;
    --color-subtle: #f6f9fc;
    --color-primary: #2252d8;
    --color-primary-hover: #1b43b4;
    --color-link: #2252d8;
    --color-focus: #2252d8;
    --color-ink: #0b1a2b;
    --color-cyan: #38bdd6;
    --color-success: #127a46;
    --color-success-bg: #e9f8f0;
    --color-success-border: #bfe6d0;
    --color-warning: #8a5a00;
    --color-warning-bg: #fff6e5;
    --color-warning-border: #f3dcae;
    --color-danger: #b42318;
    --color-danger-bg: #fdeeed;
    --color-danger-border: #f6cdc9;

    /* Type. 16px for app screens; site pages set larger sizes in the site layer. */
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.0625rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
    --text-3xl: 2.75rem;

    /* Space, on a 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;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px rgb(13 33 54 / 0.06);
    --shadow-lg: 0 30px 60px -12px rgb(13 33 54 / 0.18), 0 18px 36px -18px rgb(0 0 0 / 0.22);
    --duration-fast: 150ms;
    --duration: 200ms;

    --color-navy: #0a2540;

    --header-height: 64px;
    --content-width: 44rem;
    --content-width-wide: 74rem;
  }
}

@layer tokens {
  /* Navy surfaces. The top bars and every card switch the colour tokens, so
     the text, inputs, lists and pills inside them read light on navy. The
     page body stays white. */
  .app-header, .card, .site-header, .site-menu-panel, .feature, .split-card,
  .band, .preview-card, .cta-panel, .plan-card, .faq-item, .docs-quick a,
  .docs-compare > section, .legal-body pre, .gw-card, .gw-side, .panel,
  .empty, .sheet {
    --color-text: #ffffff;
    --color-body: #c6d3e0;
    --color-text-muted: #9fb2c5;
    --color-border: rgb(255 255 255 / 0.12);
    --color-border-strong: rgb(255 255 255 / 0.26);
    --color-surface: var(--color-navy);
    --color-subtle: #12345c;
    --color-primary: #3d6ef2;
    --color-primary-hover: #5b85f5;
    --color-link: #93b8ff;
    --color-focus: #93b8ff;
    --color-success: #86e3ad;
    --color-success-bg: rgb(46 160 98 / 0.2);
    --color-success-border: rgb(134 227 173 / 0.32);
    --color-warning: #f8d27f;
    --color-warning-bg: rgb(245 165 36 / 0.18);
    --color-warning-border: rgb(248 210 127 / 0.32);
    --color-danger: #ffaca3;
    --color-danger-bg: rgb(240 68 56 / 0.2);
    --color-danger-border: rgb(255 172 163 / 0.32);
    --shadow: none;
    color: var(--color-body);
  }
}

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

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

  body {
    margin: 0;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; color: var(--color-text); }
  h1 { font-size: var(--text-xl); font-weight: 650; margin: 0 0 var(--space-3); }
  h2 { font-size: var(--text-lg); font-weight: 600; margin: var(--space-6) 0 var(--space-3); }
  h3 { font-size: var(--text-base); font-weight: 600; margin: var(--space-5) 0 var(--space-2); }
  p { margin: 0 0 var(--space-3); }
  ul, ol { margin: 0 0 var(--space-3); padding-left: var(--space-5); }

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

  code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }

  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }

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

  [hidden] { display: none !important; }

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

@layer layout {
  .app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--space-5);
    min-height: var(--header-height);
    padding: 0 var(--space-5);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
  }

  .wordmark {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-decoration: none;
    white-space: nowrap;
  }
  .wordmark img { width: 30px; height: 30px; image-rendering: pixelated; }
  .wordmark-dot { color: var(--color-cyan); }

  .app-nav { display: flex; align-items: center; gap: var(--space-1); }
  .app-nav-link {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
  }
  .app-nav-link:hover { color: var(--color-text); background: var(--color-subtle); }
  .app-nav-link[aria-current='page'] { color: var(--color-text); background: var(--color-subtle); }

  .app-account { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
  .app-user { color: var(--color-text-muted); font-size: var(--text-sm); }

  .app-main {
    width: min(var(--content-width), 100% - 2 * var(--space-4));
    margin: var(--space-6) auto var(--space-8);
  }
  .app-main-wide { width: min(var(--content-width-wide), 100% - 2 * var(--space-4)); }

  @media (max-width: 720px) {
    .app-header { flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); }
    .app-account { margin-left: 0; width: 100%; justify-content: space-between; }
    .app-main { margin-top: var(--space-5); }
  }
}

@layer components {
  /* Panels: white, separated by a border, never tinted. */
  .card {
    padding: var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
  }
  .card + .card { margin-top: var(--space-5); }
  @media (max-width: 720px) { .card { padding: var(--space-5); } }

  .lead { color: var(--color-text-muted); }
  .muted { color: var(--color-text-muted); }
  .small { font-size: var(--text-sm); }
  .badge-label {
    display: inline-block;
    padding: 2px var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: 500;
  }

  /* Buttons */
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 40px;
    padding: var(--space-2) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--duration-fast), border-color var(--duration-fast);
  }
  .button:disabled, .button[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
  .button-primary { background: var(--color-primary); color: #fff; }
  .button-primary:hover:not(:disabled) { background: var(--color-primary-hover); }
  .button-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
  .button-secondary:hover:not(:disabled) { background: var(--color-subtle); }
  .button-quiet { background: transparent; color: var(--color-text-muted); }
  .button-quiet:hover:not(:disabled) { background: var(--color-subtle); color: var(--color-text); }
  .button-danger { background: var(--color-surface); color: var(--color-danger); border-color: var(--color-danger-border); }
  .button-danger:hover:not(:disabled) { background: var(--color-danger-bg); }

  .text-button { padding: 0; border: 0; background: none; color: var(--color-link); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
  .text-button:hover { text-decoration-thickness: 2px; }

  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-5); }
  .actions + p { margin-top: var(--space-4); }
  .stack > * + * { margin-top: var(--space-3); }

  /* Forms */
  .field { margin-top: var(--space-4); }
  .field-label { display: block; margin-bottom: var(--space-1); font-size: var(--text-sm); font-weight: 600; }
  .field + .muted, .field + p { margin-top: var(--space-2); font-size: var(--text-sm); }
  .field-hint { margin: var(--space-1) 0 0; color: var(--color-text-muted); font-size: var(--text-sm); }
  .input {
    width: 100%;
    min-height: 40px;
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-fast);
  }
  .input:hover { border-color: var(--color-text-muted); }
  .input:focus-visible { outline: 3px solid rgb(34 82 216 / 0.22); outline-offset: 0; border-color: var(--color-focus); }
  .input:disabled { background: var(--color-subtle); }

  /* Notices: status colour only, on a light tint, with a border. */
  .notice {
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
  }
  .notice > :last-child { margin-bottom: 0; }
  .notice-info { background: var(--color-subtle); border-color: var(--color-border); color: var(--color-text); }
  .notice-success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success); }
  .notice-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning); }
  .notice-danger { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: var(--color-danger); }

  /* Code and one-time secrets */
  .code-block {
    margin: 0 0 var(--space-3);
    padding: var(--space-3) var(--space-4);
    overflow-x: auto;
    background: var(--color-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .snippet { margin-top: var(--space-5); }
  .snippet-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
  .snippet-title { margin: 0; font-size: var(--text-sm); font-weight: 600; }
  .snippet .button { min-height: 32px; padding: var(--space-1) var(--space-3); }

  /* Choice cards on the start screen */
  .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-5) 0; }
  .choice { display: flex; flex-direction: column; padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
  .choice-default { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
  .choice h2 { margin-top: 0; font-size: var(--text-base); }
  .choice p { flex: 1; color: var(--color-text-muted); font-size: var(--text-sm); }
  @media (max-width: 720px) { .choices { grid-template-columns: 1fr; } }

  /* Onboarding steps */
  .steps { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-5); padding: 0; list-style: none; counter-reset: step; }
  .step { counter-increment: step; }
  .step a, .step-locked {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
    border-radius: 999px;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    text-decoration: none;
  }
  .step a::before, .step-locked::before {
    content: counter(step);
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: 600;
  }
  .step a:hover { color: var(--color-text); }
  .step-locked { opacity: 0.55; cursor: default; }
  .step-current a { color: var(--color-text); font-weight: 600; }
  .step-current a::before { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

  /* Rows in a list: tools, pins, approvals, tokens, gateways */
  .list { margin: var(--space-4) 0; border-top: 1px solid var(--color-border); }
  .list-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
  }
  .list-row-title { font-weight: 600; overflow-wrap: anywhere; }
  .list-row-detail { flex: 1; min-width: 10rem; color: var(--color-text-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
  .list-row-detail p { margin: 0; }
  .list-row-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

  /* Plan limits */
  .plan { margin: var(--space-4) 0; padding: var(--space-4) var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
  .plan h2 { margin: 0 0 var(--space-2); font-size: var(--text-base); }
  .plan ul { margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); }
}

@layer components {
  /* Sign-in */
  .segmented { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; margin: var(--space-4) 0 var(--space-5); padding: 4px; border-radius: 999px; background: var(--color-subtle); border: 1px solid var(--color-border); }
  .segmented-option { min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--color-text-muted); font-weight: 600; font-size: var(--text-sm); cursor: pointer; }
  .segmented-option:hover { color: var(--color-text); }
  .segmented-option[aria-pressed='true'] { background: var(--color-primary); color: #fff; }
  .button-block { display: flex; width: 100%; justify-content: center; }
  .button-provider { gap: var(--space-2); }
  .provider-mark { display: inline-flex; width: 18px; height: 18px; }
  .divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0 var(--space-4); color: var(--color-text-muted); font-size: var(--text-sm); }
  .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }
  .fine-print { margin: var(--space-5) 0 0; color: var(--color-text-muted); font-size: var(--text-xs); text-align: center; }
  .field-extra { display: flex; justify-content: flex-end; margin-top: var(--space-2); font-size: var(--text-sm); }
  form > .button-block { margin-top: var(--space-5); }
}

@layer components {
  /* Gateway screens. Navy surfaces (gw-card, gw-side, panel, empty, sheet)
     pick up the navy tokens above. Motion is short and eased, and the base
     layer turns it off for prefers-reduced-motion. */
  .fa-solid, .fa-brands { line-height: 1; }
  .button .fa-solid, .button .fa-brands { font-size: 0.9em; }

  /* Page heading outside a card */
  .page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
  .page-title { margin: 0; font-size: var(--text-2xl); letter-spacing: -0.02em; }
  .page-lead { margin: var(--space-2) 0 0; max-width: 40rem; color: var(--color-text-muted); }
  .page-head-actions { display: flex; gap: var(--space-2); }

  /* Gateway list */
  .gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
  .gw-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-height: 13rem;
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-body);
    text-decoration: none;
    overflow: hidden;
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 220ms, box-shadow 220ms;
    animation: rise-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .gw-card::after { content: ''; position: absolute; inset: auto -40% -60% auto; width: 14rem; height: 14rem; border-radius: 50%; background: radial-gradient(closest-side, rgb(56 189 214 / 0.18), transparent); transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1); pointer-events: none; }
  .gw-card:hover { transform: translateY(-3px); border-color: var(--color-border-strong); box-shadow: var(--shadow-lg); }
  .gw-card:hover::after { transform: scale(1.25); }
  .gw-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
  .gw-card-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-md); background: rgb(61 110 242 / 0.22); color: #b9ceff; font-size: 1.05rem; }
  .gw-card-name { margin: var(--space-2) 0 0; font-size: var(--text-lg); overflow-wrap: anywhere; }
  .gw-card-mode { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
  .gw-card-url { margin-top: auto; overflow: hidden; color: var(--color-body); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
  .gw-card-open { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-link); font-size: var(--text-sm); font-weight: 600; }
  .gw-card-open .fa-solid { transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .gw-card:hover .gw-card-open .fa-solid { transform: translateX(4px); }
  .gw-card-new { align-items: center; justify-content: center; text-align: center; border-style: dashed; border-color: var(--color-border-strong); }
  .gw-card-new .gw-card-icon { width: 48px; height: 48px; border-radius: 50%; font-size: 1.2rem; transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .gw-card-new:hover .gw-card-icon { transform: rotate(90deg) scale(1.08); }

  .status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: var(--text-xs); font-weight: 600; }
  .status-on { background: var(--color-success-bg); color: var(--color-success); }
  .status-off { background: var(--color-warning-bg); color: var(--color-warning); }
  .status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
  .status-on .status-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite; }

  .empty { padding: var(--space-7) var(--space-5); text-align: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); animation: rise-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .panel .empty { padding: var(--space-6) var(--space-4); background: var(--color-subtle); }
  .empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: var(--space-3); border-radius: 50%; background: rgb(61 110 242 / 0.22); color: #b9ceff; font-size: 1.6rem; animation: float 4s ease-in-out infinite; }
  .empty h2 { margin: 0 0 var(--space-2); }
  .empty p { max-width: 32rem; margin-inline: auto; color: var(--color-text-muted); }
  .empty-actions { justify-content: center; }

  /* One gateway: side menu and panel */
  .gw-layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: var(--space-5); align-items: start; }
  .gw-side { position: sticky; top: calc(var(--header-height) + var(--space-4)); padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
  .gw-side-head { padding: 0 var(--space-1) var(--space-4); border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-3); }
  .gw-back { display: inline-flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 600; text-decoration: none; }
  .gw-back:hover { color: var(--color-text); }
  .gw-back .fa-solid { transition: transform 200ms; }
  .gw-back:hover .fa-solid { transform: translateX(-3px); }
  .gw-side-title { display: flex; align-items: center; gap: var(--space-3); }
  .gw-side-title strong { display: block; color: var(--color-text); font-size: var(--text-md); overflow-wrap: anywhere; }
  .gw-side-title .status-pill { margin-top: 4px; }

  .tab-menu ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .tab-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 550;
    text-decoration: none;
    isolation: isolate;
    transition: color 200ms;
  }
  /* The selected item's pill grows in from the left and its accent bar
     slides down; the icon gives a small pop. */
  .tab-link::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(90deg, rgb(61 110 242 / 0.34), rgb(61 110 242 / 0.12));
    opacity: 0;
    transform: scaleX(0.6);
    transform-origin: left center;
    transition: opacity 240ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .tab-link::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 3px;
    background: var(--color-cyan);
    transform: scaleY(0);
    transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .tab-link:hover { color: var(--color-text); }
  .tab-link:hover::before { opacity: 0.45; transform: scaleX(1); }
  .tab-link[aria-current='page'] { color: var(--color-text); }
  .tab-link[aria-current='page']::before { opacity: 1; transform: scaleX(1); }
  .tab-link[aria-current='page']::after { transform: scaleY(1); }
  .tab-icon { display: inline-grid; place-items: center; width: 1.25rem; transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .tab-link:hover .tab-icon { transform: translateX(2px); }
  .tab-link[aria-current='page'] .tab-icon { color: #b9ceff; animation: icon-pop 420ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .tab-label { flex: 1; }
  .tab-count { min-width: 1.5rem; padding: 1px 7px; border-radius: 999px; background: var(--color-subtle); color: var(--color-body); font-size: var(--text-xs); font-weight: 700; text-align: center; }
  .tab-count-alert { position: relative; background: #f5a524; color: #1b1300; }
  .tab-count-alert::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgb(245 165 36 / 0.6); animation: halo 2s ease-out infinite; }

  .panel-host { min-width: 0; }
  .panel {
    padding: var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    animation: panel-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-5); }
  .panel-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: var(--radius-md); background: linear-gradient(135deg, rgb(61 110 242 / 0.4), rgb(56 189 214 / 0.25)); color: #e6eeff; font-size: 1.1rem; }
  .panel-head-text { flex: 1; min-width: 14rem; }
  .panel-head-text h1 { margin: 0 0 var(--space-1); }
  .panel-head-text .lead { margin: 0; }
  .panel-head-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .card .panel-head { margin-top: var(--space-2); }

  .block { margin-top: var(--space-6); }
  .block:first-of-type { margin-top: 0; }
  .panel-head + .block, .panel-head + * { margin-top: 0; }
  .block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
  .block-head h2 { margin: 0; font-size: var(--text-md); }
  .block-actions { display: flex; gap: var(--space-2); }

  .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-3); margin-top: var(--space-5); }
  .stat {
    display: grid;
    gap: 2px;
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-subtle);
    color: var(--color-body);
    text-decoration: none;
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 220ms;
  }
  .stat:hover { transform: translateY(-2px); border-color: var(--color-border-strong); }
  .stat-icon { color: #9fbaff; }
  .stat-value { color: var(--color-text); font-size: var(--text-2xl); font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .stat-label { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
  .stat-alert { border-color: rgb(245 165 36 / 0.55); }
  .stat-alert .stat-icon { color: #f8d27f; }

  .checklist-steps { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
  .check-step { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
  .check-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1px solid var(--color-border-strong); color: var(--color-text-muted); font-size: 0.7rem; }
  .check-done .check-mark { border-color: transparent; background: var(--color-success); color: var(--color-navy); animation: icon-pop 420ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .check-done .check-title { color: var(--color-text-muted); text-decoration: line-through; text-decoration-color: var(--color-border-strong); }
  .check-title { flex: 1; color: var(--color-text); font-weight: 550; }
  .check-action { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; text-decoration: none; }
  .check-action .fa-solid { transition: transform 200ms; }
  .check-action:hover .fa-solid { transform: translateX(3px); }

  .copy-line { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-subtle); }
  .copy-line-value { flex: 1; min-width: 0; overflow-x: auto; color: var(--color-text); font-size: var(--text-sm); white-space: nowrap; }
  .copy-line .button { min-height: 34px; }

  .pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid; font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
  .pill-neutral { border-color: var(--color-border-strong); color: var(--color-body); }
  .pill-good { border-color: var(--color-success-border); background: var(--color-success-bg); color: var(--color-success); }
  .pill-caution { border-color: var(--color-warning-border); background: var(--color-warning-bg); color: var(--color-warning); }
  .pill-bad { border-color: var(--color-danger-border); background: var(--color-danger-bg); color: var(--color-danger); }

  .item-list { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
  .item-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-subtle); animation: rise-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both; transition: border-color 200ms; }
  .item-row:hover { border-color: var(--color-border-strong); }
  .item-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); background: rgb(255 255 255 / 0.08); color: #c9d8ff; }
  .item-body { flex: 1; min-width: 12rem; }
  .item-title { display: block; color: var(--color-text); overflow-wrap: anywhere; }
  .item-detail { color: var(--color-text-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
  .item-detail p { margin: 0; }
  .item-detail code { font-size: var(--text-xs); }
  .item-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .item-actions .button { min-height: 34px; }

  .facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
  .facts dt { color: var(--color-text-muted); font-size: var(--text-sm); }
  .facts dd { margin: 0; color: var(--color-text); overflow-wrap: anywhere; }

  .danger-zone { margin-top: var(--space-6); padding: var(--space-5); border: 1px solid var(--color-danger-border); border-radius: var(--radius-md); background: var(--color-danger-bg); }
  .danger-zone h2 { margin: 0 0 var(--space-2); color: var(--color-danger); font-size: var(--text-md); }

  /* Rules */
  .rule-switch { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: rgb(0 0 0 / 0.22); border: 1px solid var(--color-border); }
  .rule-option { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--space-3); border: 0; border-radius: 999px; background: transparent; color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 650; transition: background-color 220ms, color 220ms, transform 160ms; }
  .rule-option:hover:not(:disabled) { color: var(--color-text); }
  .rule-option:active:not(:disabled) { transform: scale(0.96); }
  .rule-option:disabled { cursor: not-allowed; opacity: 0.6; }
  .rule-option[aria-pressed='true'] .fa-solid { animation: icon-pop 380ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .rule-allow[aria-pressed='true'] { background: #2ea062; color: #fff; }
  .rule-deny[aria-pressed='true'] { background: #d9483b; color: #fff; }
  .rule-approve[aria-pressed='true'] { background: #f5a524; color: #1b1300; }

  .chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0; }
  .chip { min-height: 32px; padding: 0 var(--space-4); border: 1px solid var(--color-border-strong); border-radius: 999px; background: transparent; color: var(--color-body); font-size: var(--text-sm); font-weight: 550; transition: background-color 220ms, color 220ms, border-color 220ms, transform 160ms; }
  .chip:hover { color: var(--color-text); border-color: var(--color-text-muted); }
  .chip:active { transform: scale(0.96); }
  .chip[aria-pressed='true'] { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

  /* Server catalog */
  .search-bar { display: flex; gap: var(--space-2); margin: var(--space-4) 0 0; }
  .search-field { position: relative; flex: 1; display: flex; align-items: center; }
  .search-field > .fa-solid { position: absolute; left: var(--space-4); color: var(--color-text-muted); pointer-events: none; }
  .search-input { width: 100%; min-height: 44px; padding: var(--space-2) var(--space-4) var(--space-2) 2.6rem; border: 1px solid var(--color-border-strong); border-radius: 999px; background: rgb(0 0 0 / 0.18); color: var(--color-text); transition: border-color 200ms, box-shadow 200ms; }
  .search-input::placeholder { color: var(--color-text-muted); }
  .search-input:focus-visible { outline: none; border-color: var(--color-focus); box-shadow: 0 0 0 4px rgb(147 184 255 / 0.25); }
  .search-bar .button { min-height: 44px; border-radius: 999px; padding-inline: var(--space-5); }

  .catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--space-3); margin: var(--space-3) 0 var(--space-4); }
  .catalog-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-subtle);
    color: var(--color-body);
    text-align: left;
    animation: rise-in 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 35ms);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 220ms, background-color 220ms;
  }
  .catalog-card:hover { transform: translateY(-3px); border-color: rgb(147 184 255 / 0.5); background: #163b66; }
  .catalog-card-head { display: flex; align-items: center; gap: var(--space-3); }
  .catalog-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: var(--radius-md); background: #fff; color: var(--color-navy); font-size: 1.25rem; transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .catalog-card:hover .catalog-icon { transform: rotate(-6deg) scale(1.06); }
  .catalog-card-title { min-width: 0; }
  .catalog-card h3 { margin: 0; color: var(--color-text); font-size: var(--text-base); }
  .catalog-source { display: block; overflow: hidden; color: var(--color-text-muted); font-family: var(--font-mono); font-size: 0.6875rem; text-overflow: ellipsis; white-space: nowrap; }
  .catalog-desc { flex: 1; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--color-body); font-size: var(--text-sm); }
  .catalog-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
  .catalog-foot .button { min-height: 32px; padding: var(--space-1) var(--space-3); }
  .catalog-custom { align-items: flex-start; border-style: dashed; border-color: var(--color-border-strong); background: transparent; cursor: pointer; font: inherit; }
  .catalog-custom h3 { margin: 0; }
  .catalog-custom .catalog-icon { background: rgb(61 110 242 / 0.25); color: #c9d8ff; }
  .catalog-custom-cta { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-link); font-size: var(--text-sm); font-weight: 600; }

  /* Tools a server listed, under its row */
  .server-tools { margin: calc(-1 * var(--space-1)) 0 var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); background: rgb(0 0 0 / 0.14); animation: rise-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .server-tools-summary { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
  .server-tools-summary:empty { display: none; }
  .server-tools .actions { margin-top: var(--space-2); }
  .item-list > div > .item-row { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .item-list > div > .item-row:only-child { border-radius: var(--radius-md); }
  .disclosure-summary { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text); font-size: var(--text-sm); font-weight: 600; cursor: pointer; list-style: none; }
  .disclosure-summary::-webkit-details-marker { display: none; }
  .disclosure-summary .fa-solid { font-size: 0.7rem; transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .disclosure[open] > .disclosure-summary .fa-solid { transform: rotate(90deg); }
  .tool-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-3) 0 0; padding: 0; list-style: none; }
  .tool-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--color-border-strong); border-radius: 999px; background: rgb(255 255 255 / 0.04); color: var(--color-body); font-size: var(--text-xs); animation: fade-in 240ms ease-out both; }
  .tool-chip .fa-solid { color: #9fbaff; font-size: 0.65rem; }
  .tool-chip code { color: var(--color-text); font-size: inherit; background: none; padding: 0; }

  /* Connect: client picker and setup steps */
  .client-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: var(--space-2); }
  .client-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-subtle);
    color: var(--color-body);
    font: inherit;
    text-align: left;
    cursor: pointer;
    animation: rise-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 30ms);
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 200ms, background-color 200ms;
  }
  .client-option:hover { transform: translateY(-2px); border-color: var(--color-border-strong); }
  .client-option:active { transform: scale(0.98); }
  .client-option[aria-pressed='true'] { border-color: var(--color-primary); background: rgb(61 110 242 / 0.22); }
  .client-option[aria-pressed='true'] .client-icon { background: var(--color-primary); color: #fff; animation: icon-pop 380ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .client-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); background: rgb(255 255 255 / 0.08); color: #c9d8ff; transition: background-color 200ms, color 200ms; }
  .client-text { display: grid; min-width: 0; }
  .client-text strong { color: var(--color-text); font-size: var(--text-sm); }
  .client-detail { color: var(--color-text-muted); font-size: var(--text-xs); }
  .setup-steps { display: grid; gap: var(--space-4); margin: 0; padding: 0; list-style: none; counter-reset: setup; }
  .setup-step { position: relative; padding-left: 2.6rem; counter-increment: setup; animation: rise-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .setup-step::before { content: counter(setup); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: rgb(61 110 242 / 0.3); color: #e6eeff; font-size: var(--text-sm); font-weight: 700; }
  .setup-step-title { margin: 0.2rem 0 var(--space-2); color: var(--color-text); }
  .setup-step .snippet, .setup-step .copy-line { margin-top: var(--space-2); }

  /* Add-server sheet */
  .sheet-layer { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: flex-end; }
  .sheet-backdrop { position: absolute; inset: 0; border: 0; padding: 0; background: rgb(6 18 32 / 0.55); backdrop-filter: blur(3px); cursor: default; animation: fade-in 220ms ease-out both; }
  .sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(32rem, 100%);
    height: 100%;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    animation: sheet-in 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .sheet-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5); border-bottom: 1px solid var(--color-border); }
  .sheet-head h2 { flex: 1; margin: 0; font-size: var(--text-lg); }
  .sheet-close { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--color-border); border-radius: 50%; background: transparent; color: var(--color-text-muted); transition: transform 220ms, color 200ms; }
  .sheet-close:hover { color: var(--color-text); transform: rotate(90deg); }
  .sheet-body { flex: 1; overflow-y: auto; padding: var(--space-5); }

  .gw-side, .panel { min-width: 0; }
  @media (max-width: 900px) {
    .gw-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
    .gw-side { position: static; padding: var(--space-3); }
    .gw-side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); padding-bottom: var(--space-3); }
    .gw-back { margin: 0; }
    .tab-menu { overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--space-3)); padding: 0 var(--space-3); }
    .tab-menu ul { display: flex; width: max-content; gap: var(--space-1); }
    .tab-link { white-space: nowrap; }
    .tab-link::after { left: 20%; right: 20%; top: auto; bottom: -2px; width: auto; height: 3px; transform: scaleX(0); }
    .tab-link[aria-current='page']::after { transform: scaleX(1); }
    .panel { padding: var(--space-5); }
  }
  @media (max-width: 560px) {
    .search-bar { flex-direction: column; }
    .item-actions { width: 100%; }
    .facts { grid-template-columns: 1fr; }
  }

  @keyframes panel-in { from { opacity: 0; transform: translateY(10px) scale(0.995); } to { opacity: 1; transform: none; } }
  @keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes icon-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
  @keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
  @keyframes halo { 0% { box-shadow: 0 0 0 0 rgb(245 165 36 / 0.55); } 80%, 100% { box-shadow: 0 0 0 8px rgb(245 165 36 / 0); } }
  @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
}

@layer site {
  /* Public site pages: landing, product, pricing. Larger type, more air. */
  .site { color: var(--color-body); font-size: var(--text-md); line-height: 1.6; }
  .site h1, .site h2, .site h3 { color: var(--color-text); text-wrap: balance; }
  .container { width: min(1180px, 100% - 48px); margin-inline: auto; }

  .skip-link { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--color-ink); color: #fff; }
  .skip-link:focus { top: 12px; }

  /* Header */
  .site-header { position: sticky; top: 0; z-index: 20; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
  .site-header-inner { display: flex; align-items: center; gap: var(--space-6); min-height: 68px; }
  .site-nav { display: flex; align-items: center; gap: var(--space-1); }
  .site-nav-link { padding: 8px 12px; border-radius: 999px; color: var(--color-text); font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
  .site-nav-link:hover { background: var(--color-subtle); }
  .site-header-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
  .site-menu { display: none; margin-left: auto; }
  .site-menu > summary { list-style: none; cursor: pointer; padding: 8px 14px; border: 1px solid var(--color-border-strong); border-radius: 999px; color: var(--color-text); font-size: 0.9375rem; font-weight: 500; }
  .site-menu > summary::-webkit-details-marker { display: none; }
  .site-menu-panel { position: absolute; left: 0; right: 0; top: 100%; display: grid; gap: 2px; padding: 12px 24px 20px; background: var(--color-surface); border-bottom: 1px solid var(--color-border); box-shadow: 0 16px 24px -16px rgb(13 33 54 / 0.3); }
  .site-menu-panel .site-nav-link { padding: 12px 0; border-radius: 0; font-size: 1.0625rem; }
  @media (max-width: 900px) {
    .site-nav, .site-header-actions { display: none; }
    .site-menu { display: block; }
  }

  /* Buttons on the site are pills. */
  .button-lg { min-height: 46px; padding: 0 22px; border-radius: 999px; font-size: 0.9375rem; }
  .button-arrow::after { content: '\2192'; display: inline-block; transition: transform var(--duration-fast); }
  .button-arrow:hover::after { transform: translateX(3px); }
  .link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--color-link); font-weight: 600; text-decoration: none; }
  .link-arrow::after { content: '\2192'; transition: transform var(--duration-fast); }
  .link-arrow:hover::after { transform: translateX(3px); }

  /* Hero */
  .hero { padding: clamp(56px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); }
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(40px, 6vw, 80px); align-items: center; }
  .hero-title { margin: 0; font-size: clamp(2.75rem, 5.4vw, 4.5rem); font-weight: 600; line-height: 1.03; letter-spacing: -0.045em; }
  .hero-sub { max-width: 33rem; margin: 24px 0 0; font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.55; }
  .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 36px; }
  .hero-note { margin: 20px 0 0; color: var(--color-text-muted); font-size: 0.875rem; }
  @media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

  /* Product preview in the hero: two stacked cards on a soft panel. */
  .preview { position: relative; padding: 40px; }
  .preview::before { content: ''; position: absolute; inset: 0 0 0 0; border-radius: 24px; background: linear-gradient(135deg, #eaf7fb 0%, #eef2fe 60%, #f4f1fe 100%); border: 1px solid #e6edf6; }
  .preview-card { position: relative; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); font-size: 0.875rem; }
  .preview-card + .preview-card { margin: -28px 0 0 56px; }
  .preview-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); color: var(--color-text); font-weight: 600; }
  .preview-head-meta { margin-left: auto; color: var(--color-text-muted); font-weight: 400; font-size: 0.8125rem; }
  .preview-body { padding: 16px 18px 18px; }
  .preview-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--color-border); }
  .preview-row:first-child { border-top: 0; padding-top: 0; }
  .preview-tool { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--color-text); }
  .preview-label { color: var(--color-text-muted); }
  .preview-value { color: var(--color-text); font-weight: 500; }
  .preview-buttons { display: flex; gap: 8px; margin-top: 14px; }
  .preview-buttons .button { min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 0.8125rem; }
  .pulse { width: 8px; height: 8px; border-radius: 50%; background: #f5a524; box-shadow: 0 0 0 4px rgb(245 165 36 / 0.18); }
  @media (max-width: 560px) {
    .preview { padding: 20px; }
    .preview-card + .preview-card { margin: -12px 0 0 0; }
  }

  /* Rule pills */
  .pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
  .pill-allow { background: var(--color-success-bg); color: var(--color-success); }
  .pill-ask { background: var(--color-warning-bg); color: var(--color-warning); }
  .pill-block { background: var(--color-danger-bg); color: var(--color-danger); }

  /* Works-with strip */
  .clients { padding: 28px 0; border-block: 1px solid var(--color-border); }
  .clients-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 40px; }
  .clients-label { color: var(--color-text-muted); font-size: 0.875rem; }
  .clients-name { color: var(--color-text); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }

  /* Sections */
  .section { padding: clamp(56px, 8vw, 96px) 0; }
  .section + .section { padding-top: 0; }
  .section-head { max-width: 40rem; margin-bottom: clamp(40px, 5vw, 56px); }
  .section-kicker { margin: 0 0 12px; color: var(--color-primary); font-size: 0.9375rem; font-weight: 600; }
  .section-title { margin: 0; font-size: clamp(2rem, 3.6vw, 2.875rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.035em; }
  .section-sub { margin: 16px 0 0; font-size: 1.125rem; }

  .feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .feature { display: flex; flex-direction: column; padding: 32px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
  .feature h3 { margin: 0; font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.015em; }
  .feature p { margin: 8px 0 0; }
  .feature-visual { margin-top: 28px; padding: 20px; border-radius: 10px; background: rgb(255 255 255 / 0.04); border: 1px solid var(--color-border); font-size: 0.875rem; }
  @media (max-width: 820px) { .feature-grid { grid-template-columns: 1fr; } .feature { padding: 24px; } }

  .mini-rules { display: grid; gap: 10px; }
  .mini-rule { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mini-notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--color-subtle); border: 1px solid var(--color-border); border-radius: 12px; color: var(--color-text); }
  .mini-notice img { flex: none; border-radius: 6px; }
  .mini-notice small { display: block; color: var(--color-text-muted); }
  .mini-notice .preview-buttons { margin-top: 10px; }
  .mini-diff { margin: 0; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; white-space: pre-wrap; }
  .mini-diff del { display: block; text-decoration: none; color: var(--color-danger); background: var(--color-danger-bg); padding: 2px 8px; border-radius: 4px; }
  .mini-diff ins { display: block; text-decoration: none; color: var(--color-success); background: var(--color-success-bg); padding: 2px 8px; border-radius: 4px; margin-top: 4px; }

  /* Three steps */
  .steps-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; counter-reset: site-step; }
  .step-item { counter-increment: site-step; padding-top: 20px; border-top: 2px solid var(--color-text); }
  .step-item::before { content: counter(site-step, decimal-leading-zero); display: block; margin-bottom: 12px; color: var(--color-primary); font-family: var(--font-mono); font-size: 0.875rem; font-weight: 500; }
  .step-item h3 { margin: 0; font-size: 1.1875rem; font-weight: 600; }
  .step-item p { margin: 8px 0 0; }
  @media (max-width: 820px) { .steps-grid { grid-template-columns: 1fr; gap: 28px; } }

  /* Two cards side by side */
  .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .split-card { padding: 40px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
  .split-card h3 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; }
  .split-card p { margin: 0 0 24px; }
  .split-card { display: flex; flex-direction: column; align-items: flex-start; }
  @media (max-width: 820px) { .split { grid-template-columns: 1fr; } .split-card { padding: 28px; } }

  /* A row pointing to another product */
  .band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 32px 40px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
  .band h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
  .band p { margin: 0; }
  .section-tight { padding-top: clamp(48px, 7vw, 80px); }

  /* Closing call to action: a dark panel inside the white page. */
  .cta-panel { padding: clamp(48px, 7vw, 80px) clamp(28px, 6vw, 72px); border-radius: 24px; background: var(--color-surface); }
  .cta-panel h2 { margin: 0; font-size: clamp(2rem, 3.6vw, 2.875rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.035em; max-width: 22ch; }
  .cta-panel p { margin: 16px 0 0; font-size: 1.125rem; max-width: 36rem; }
  .cta-panel .hero-actions { margin-top: 32px; }

  /* Inner pages */
  .page-hero { padding: clamp(56px, 8vw, 96px) 0 clamp(32px, 5vw, 56px); }
  .page-title { margin: 0; max-width: 20ch; font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.04em; }
  .page-hero .hero-sub { max-width: 40rem; }
  .page-hero + .section { padding-top: 0; }
  .page-hero-docs { padding-bottom: clamp(24px, 4vw, 40px); border-bottom: 1px solid var(--color-border); }
  .page-hero-docs .page-title { font-size: clamp(2.25rem, 4vw, 3rem); }
  .page-hero-docs .hero-sub { font-size: 1.125rem; }
  .page-hero-docs .hero-sub code { font-size: 0.9em; }

  .feature-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  @media (max-width: 980px) { .feature-grid-3 { grid-template-columns: 1fr; } }

  .checklist { margin: 0; padding: 0; list-style: none; }
  .checklist li { position: relative; padding: 6px 0 6px 26px; }
  .checklist li::before { content: ''; position: absolute; left: 3px; top: 13px; width: 10px; height: 6px; border-left: 2px solid var(--color-link); border-bottom: 2px solid var(--color-link); transform: rotate(-45deg); }
  .split-card .checklist { align-self: stretch; }

  .faq { display: grid; gap: 12px; max-width: 48rem; }
  .faq-item { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
  .faq-item summary { display: flex; justify-content: space-between; gap: 16px; padding: 20px 24px; color: var(--color-text); font-weight: 600; cursor: pointer; list-style: none; }
  .faq-item summary::-webkit-details-marker { display: none; }
  .faq-item summary::after { content: '+'; color: var(--color-link); font-size: 1.25rem; line-height: 1; transition: transform var(--duration-fast); }
  .faq-item[open] summary::after { transform: rotate(45deg); }
  .faq-item p { margin: 0; padding: 0 24px 20px; }

  /* Pricing */
  .plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .plan-card { display: flex; flex-direction: column; padding: 28px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
  .plan-card-featured { box-shadow: 0 0 0 2px var(--color-primary), var(--shadow-lg); }
  .plan-name { margin: 0; font-size: 1.125rem; font-weight: 600; }
  .plan-tagline { margin: 4px 0 0; color: var(--color-text-muted); font-size: 0.9375rem; }
  .plan-price { margin: 20px 0 16px; color: var(--color-text); font-size: 2.5rem; font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
  .plan-price small { color: var(--color-text-muted); font-size: 0.9375rem; font-weight: 400; letter-spacing: 0; }
  .plan-card .checklist { flex: 1; margin-bottom: 24px; font-size: 0.9375rem; }
  @media (max-width: 1020px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }

  .compare-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
  .compare { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.9375rem; }
  .compare th, .compare td { padding: 14px 20px; border-bottom: 1px solid var(--color-border); text-align: left; }
  .compare thead th { background: var(--color-subtle); color: var(--color-text); font-weight: 600; }
  .compare tbody th { color: var(--color-text); font-weight: 500; }
  .compare tbody tr:last-child > * { border-bottom: 0; }
  .notes { max-width: 48rem; margin-top: 20px; color: var(--color-text-muted); font-size: 0.9375rem; }
  .notes p { margin: 0 0 8px; }

  /* Docs */
  .docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); padding-top: 40px; }
  .docs-toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 112px); overflow-y: auto; font-size: 0.9375rem; }
  .docs-toc ol { margin: 0 0 20px; padding: 0; list-style: none; }
  .docs-toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--color-border); color: var(--color-body); text-decoration: none; }
  .docs-toc a:hover { color: var(--color-text); }
  .docs-toc a.is-active { border-left-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }
  .toc-label { margin: 0 0 8px; color: var(--color-text); font-size: 0.8125rem; font-weight: 600; }
  @media (max-width: 900px) {
    .docs-layout { grid-template-columns: 1fr; }
    .docs-toc { position: static; max-height: none; padding: 16px 20px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
  }

  .prose { max-width: 46rem; min-width: 0; }
  .prose h2 { margin: 56px 0 12px; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.025em; scroll-margin-top: 88px; }
  .prose > h2:first-child, .prose > p:first-child + h2 { margin-top: 0; }
  .prose h3 { margin: 32px 0 8px; font-size: 1.25rem; font-weight: 600; scroll-margin-top: 88px; }
  .prose h4 { margin: 24px 0 6px; color: var(--color-text); font-size: 1.0625rem; }
  .prose p, .prose ul, .prose ol, .prose dl { margin: 0 0 16px; }
  .prose li { margin: 4px 0; }
  .prose a { color: var(--color-link); }
  .prose strong { color: var(--color-text); }
  .prose :not(pre) > code { padding: 2px 6px; border-radius: 5px; background: var(--color-subtle); border: 1px solid var(--color-border); color: var(--color-text); font-size: 0.875em; overflow-wrap: anywhere; }
  .prose pre { margin: 0 0 20px; padding: 18px 20px; overflow-x: auto; border-radius: 12px; background: var(--color-surface); color: #e6edf5; font-size: 0.875rem; line-height: 1.65; tab-size: 2; }
  .prose pre code { font-family: var(--font-mono); }
  .docs-code { position: relative; }
  @media (max-width: 700px) { .docs-code pre { padding-top: 46px; } }
  .docs-copy { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 999px; background: rgb(255 255 255 / 0.06); color: #fff; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
  .docs-copy:hover { background: rgb(255 255 255 / 0.14); }
  .docs-table-wrap { margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--color-border); border-radius: 12px; }
  .prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
  .prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
  .prose thead th { background: var(--color-subtle); color: var(--color-text); }
  .prose tbody tr:last-child > * { border-bottom: 0; }
  .prose td p { margin: 0 0 6px; }
  .prose caption { padding: 10px 14px; color: var(--color-text-muted); font-size: 0.875rem; text-align: left; }
  .docs-defs dt, .docs-faq dt { margin-top: 16px; color: var(--color-text); font-weight: 600; }
  .docs-defs dd, .docs-faq dd { margin: 4px 0 0; }
  .docs-label { margin: 20px 0 8px !important; color: var(--color-text); font-size: 0.875rem; font-weight: 600; }
  .docs-args { color: var(--color-text-muted); font-size: 0.875rem; }
  .docs-legend { padding: 14px 18px; border-radius: 12px; background: var(--color-subtle); border: 1px solid var(--color-border); }
  .docs-note { padding: 14px 18px; border-left: 3px solid var(--color-primary); border-radius: 0 12px 12px 0; background: var(--color-subtle); }
  .docs-warning { border-left-color: #c98a00; background: var(--color-warning-bg); color: var(--color-warning); }
  .docs-badge { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
  .docs-badge-read { background: var(--color-success-bg); color: var(--color-success); }
  .docs-badge-confirm { background: var(--color-warning-bg); color: var(--color-warning); }
  .docs-steps { padding-left: 1.25rem; }
  .docs-steps > li { margin: 10px 0; padding-left: 4px; }
  .docs-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
  .docs-quick a { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); color: var(--color-body); text-decoration: none; }
  .docs-quick a:hover { background: var(--color-subtle); }
  .docs-quick strong { color: var(--color-text); }
  .docs-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 24px; }
  .docs-compare > section { padding: 22px 24px; border-radius: 12px; background: var(--color-surface); }
  .docs-compare h3 { margin-top: 0; }
  .docs-compare ul { padding-left: 1.1rem; }
  @media (max-width: 700px) { .docs-quick, .docs-compare { grid-template-columns: 1fr; } }

  /* Footer */
  .site-footer { margin-top: clamp(56px, 8vw, 96px); padding: 56px 0 40px; border-top: 1px solid var(--color-border); font-size: 0.9375rem; }
  .footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
  .footer-tagline { margin: 12px 0 0; color: var(--color-text-muted); max-width: 18rem; }
  .footer-title { margin: 0 0 12px; color: var(--color-text); font-size: 0.875rem; font-weight: 600; }
  .footer-links { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
  .footer-links a { color: var(--color-body); text-decoration: none; }
  .footer-links a:hover { color: var(--color-text); text-decoration: underline; }
  .footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 0.875rem; }
  @media (max-width: 820px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
}

@layer utilities {
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}
