@font-face{font-family:'DM Sans Variable';font-style:normal;font-display:swap;font-weight:100 1000;src:url('/assets/dm-sans-latin.woff2') format('woff2-variations');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{--font-sans:'DM Sans Variable','DM Sans',system-ui,sans-serif}

/* GENERATED by scripts/build.mjs from theme.css — do not edit by hand.
   theme.css (Tailwind v4, CSS-first) is the source of truth. This is the
   plain-CSS mirror, for surfaces that do not run Tailwind. */

:root {
  /* --- Scout Blue --------------------------------------------------------- */
  --color-scout-blue-600: #0077b3;  /* 4.90:1 on white — PASSES AA small text.
                                       An earlier requirement for #005A8C was overly
                                       cautious; links may use this directly. */
  --color-scout-blue-700: #005a8c;  /* 7.39:1 — hover, and text on tinted fills */
  --color-scout-blue-400: #21b2fc;  /* 2.11:1 — DECORATIVE ONLY. Never text,
                                       never a border that carries meaning. */

  /* --- neutrals: cool ramp ---------------------------------------
     Surfaces and borders are slate-tinted; text is neutral grey. That is the
     brand as specified, not an accident. */
  --color-white: #ffffff;
  --color-slate-50: #f5f7fa;   /* muted surface */
  --color-slate-200: #e2e8f0;  /* the hairline */
  --color-slate-400: #94a3b8;  /* 2.56:1 — decoration and disabled only */
  --color-slate-450: #8595a9;  /* 3.06:1 — the 1.4.11 floor for a control
                                  boundary. Cool-ramp successor to #949494. */
  --color-slate-500: #64748b;  /* 4.76:1 — the AA floor for small text */
  --color-grey-600: #666666;   /* 5.74:1 — body copy */
  --color-grey-800: #333333;   /* 12.63:1 — headlines and figures */
  --color-grey-100: #ececec;   /* neutral, not slate: this is a media void,
                                  not part of the chrome */

  /* --- status: fill and text are DIFFERENT COLOURS ------------------------
     These hexes are fill colours. Measured on white they are:
       #10B981 2.57:1   #F59E0B 2.15:1   #EF4444 3.76:1
     All three fail AA for text; the first two fail 3:1 for graphics too. So
     each status ships a `-fill` (the brand hex, for bars, dots and icons ON a
     tinted ground) and a text-safe partner. */
  --color-emerald-500: #10b981;  /* success fill */
  --color-emerald-700: #047857;  /* 5.48:1 — success text */
  --color-amber-500: #f59e0b;    /* warning fill; also the star gold */
  --color-amber-700: #b45309;    /* 5.02:1 — warning text */
  --color-red-500: #ef4444;      /* error fill */
  --color-red-700: #b91c1c;      /* 6.47:1 — destructive text */

  /* --- rating hues — DATA ONLY, unchanged --------------------------------
     Five tiers. ScoreBar is the named domain
     signature and these values are already AA-safe as text on white. */
  --color-rating-green-600: #1f7a4d;   /* tier 5 */
  --color-rating-green-500: #4f9d69;   /* tier 4 */
  --color-rating-amber-600: #b08307;   /* tier 3 */
  --color-rating-orange-600: #c2660f;  /* tier 2 */
  --color-rating-red-600: #b3261e;     /* tier 1 */

  /* --- dark-surface ramp, unused until dark mode ships -------------------- */
  --color-ink-900: #121212;
  --color-ink-800: #1b1b1b;
  --color-ink-700: #2a2a2a;
  --color-ink-600: #3a3a3a;
}
:root {
  /* --- surfaces ----------------------------------------------------------
     surface-raised is identical to surface in light mode, and that is correct:
     this system separates planes with a hairline, not a tint and not a shadow.
     In dark mode they diverge, which is why they are two tokens. */
  --color-surface: var(--color-white);
  --color-surface-muted: var(--color-slate-50);    /* alternating sections, app ground */
  --color-surface-raised: var(--color-white);      /* the card plane */
  --color-surface-sunken: var(--color-grey-100);   /* media / image voids */
  --color-surface-inverse: var(--color-grey-800);  /* inverted chips, step markers */

  /* --- text: three levels, by ROLE not by shade --------------------------- */
  --color-text-primary: var(--color-grey-800);     /* headlines, figures, strong copy */
  --color-text-secondary: var(--color-grey-600);   /* body copy — the reading colour */
  --color-text-muted: var(--color-slate-500);      /* eyebrows, table heads, captions */
  --color-text-inverse: var(--color-white);

  /* --- brand & action ----------------------------------------------------
     primary is the action colour: links, focus rings, category icons, item
     indicators. It is NOT the solid button — see --color-cta below. */
  --color-primary: var(--color-scout-blue-600);
  --color-primary-hover: var(--color-scout-blue-700);
  --color-primary-subtle: color-mix(in oklab, var(--color-scout-blue-600) 10%, transparent);
  --color-primary-contrast: var(--color-white);    /* text ON primary — 4.90:1 */
  --color-accent: var(--color-scout-blue-400);     /* decorative only, never text */

  /* The solid commit button is INK, not the action blue. Blue navigates, black
     commits. 12.63:1 with white on top — the strongest pairing in the system,
     which is what a single page-level commitment should be. */
  --color-cta: var(--color-grey-800);
  --color-cta-hover: color-mix(in oklab, var(--color-grey-800) 88%, white);
  --color-cta-contrast: var(--color-white);

  /* --- borders ------------------------------------------------------------ */
  --color-border: var(--color-slate-200);          /* hairlines, dividers, cards */
  --color-border-strong: var(--color-slate-450);   /* inputs, secondary button — 3.06:1 */
  --color-border-focus: var(--color-scout-blue-600);

  /* --- rating scale: the score bars, as a system --------------------------
     Thresholds are product policy and live in code (ratingOf), not here:
       5 excellent  >= 4.5      2 fair      >= 1.5
       4 very-good  >= 3.5      1 poor      >  0
       3 good       >= 2.5      - neutral   <= 0 / invalid
     Stars are NOT tier-coloured — they are always --color-star. Tier colour
     belongs to the aggregate figure, the bar fill and the tier badge. */
  --color-rating-excellent: var(--color-rating-green-600);
  --color-rating-very-good: var(--color-rating-green-500);
  --color-rating-good: var(--color-rating-amber-600);
  --color-rating-fair: var(--color-rating-orange-600);
  --color-rating-poor: var(--color-rating-red-600);
  --color-rating-neutral: var(--color-slate-400);  /* no rating / invalid */
  --color-rating-empty: var(--color-slate-200);    /* the unfilled track */
  --color-star: var(--color-amber-500);            /* the gold. One value, all tiers. */

  /* --- status: fill + text pairs -----------------------------------------
     Rule: `-fill` may never carry text. `-text` may never flood a surface.
     Status is never colour-only — always icon + text (WCAG 1.4.1). */
  --color-success: var(--color-emerald-700);
  --color-success-fill: var(--color-emerald-500);
  --color-success-subtle: color-mix(in oklab, var(--color-emerald-500) 12%, transparent);
  --color-warning: var(--color-amber-700);
  --color-warning-fill: var(--color-amber-500);
  --color-warning-subtle: color-mix(in oklab, var(--color-amber-500) 14%, transparent);
  --color-destructive: var(--color-red-700);
  --color-destructive-fill: var(--color-red-500);
  --color-destructive-hover: color-mix(in oklab, var(--color-red-700) 88%, black);
  --color-destructive-subtle: color-mix(in oklab, var(--color-red-500) 10%, transparent);

  /* --- type: roles, not just sizes ---------------------------------------
     Each size carries its own line-height and tracking, so one utility
     reproduces a style exactly. Shared by ALL densities: a dashboard is not a
     different typeface at a different scale, it is the same voice speaking in
     shorter sentences. */
  --font-sans: 'DM Sans', system-ui, sans-serif;
  /* No editorial serif. Playfair Display and Source Serif 4 were declared here
     and never loaded, so they shipped as Georgia while reading as a decision.
     Cut 2026-08-07. When /business/ needs an editorial voice, add ONE family
     together with its @font-face in the same commit — not before. */

  --text-caption: 0.625rem;      /* 10px — data sources, timestamps */
  --text-caption--line-height: 1.5;
  --text-caption--letter-spacing: 0.06em;
  --text-eyebrow: 0.6875rem;     /* 11px — section eyebrows, table heads */
  --text-eyebrow--line-height: 1.4;
  --text-eyebrow--letter-spacing: 0.12em;
  --text-meta: 0.8125rem;        /* 13px — step numbers, dense metadata */
  --text-meta--line-height: 1.4;
  --text-sm: 0.875rem;           /* 14px — table body, dense lists */
  --text-sm--line-height: 1.55;
  --text-ui: 0.9375rem;          /* 15px — buttons, links, controls */
  --text-ui--line-height: 1.6;
  --text-base: 1rem;
  --text-base--line-height: 1.65;
  --text-lead: 1.0625rem;        /* 17px — body-large, pull statements */
  --text-lead--line-height: 1.45;
  --text-h4: 1.125rem;
  --text-h4--line-height: 1.4;
  --text-h3: 1.25rem;
  --text-h3--line-height: 1.35;
  --text-h3--letter-spacing: -0.01em;
  --text-h2: clamp(1.75rem, 4vw, 2.25rem);
  --text-h2--line-height: 1.2;
  --text-h2--letter-spacing: -0.02em;
  --text-h1: clamp(2rem, 5vw, 2.75rem);
  --text-h1--line-height: 1.15;
  --text-h1--letter-spacing: -0.025em;
  --text-display: clamp(2.5rem, 6vw, 3.5rem);  /* hero only, comfortable density */
  --text-display--line-height: 1.05;
  --text-display--letter-spacing: -0.03em;

  --tracking-caps: 0.06em;
  --tracking-eyebrow: 0.12em;

  /* --- spacing: base scale ----------------------------------------------- */
  --spacing: 0.25rem;               /* 4px step */

  /* --- DENSITY -----------------------------------------------------------
     Three modes. The named spacings below hold the DEFAULT (product) values;
     [data-density] re-points them further down. Components never branch on
     surface — they use the names and inherit the mode.

       compact       feedback; dense dashboard panels
       default       app, business
       comfortable   www, /business/ marketing

     --spacing-density-* is the single base unit for each mode, exposed for callers that want to derive their own rhythm. */
  --spacing-density-compact: 0.75rem;
  --spacing-density-default: 1rem;
  --spacing-density-comfortable: 1.5rem;

  --spacing-section: 2rem;          /* vertical rhythm between page sections */
  --spacing-section-loose: 3rem;    /* hero and closing sections */
  --spacing-section-tight: 1.5rem;
  --spacing-block: 1rem;            /* card / callout / panel padding */
  --spacing-block-tight: 0.75rem;   /* toolbars, sidebars, list items */
  --spacing-stack: 0.75rem;         /* gap between related blocks */
  --spacing-row: 0.5rem;            /* table row padding-block */

  /* Control heights. `touch` is the floor on anything a finger hits — the
     feedback app is used on 4G after a race, by tired people. `sm` is
     desktop-only: keyboard-and-mouse dashboards, never mobile. */
  --control-height-sm: 2rem;        /* 32px — desktop dashboard controls */
  --control-height-md: 2.75rem;     /* 44px — the mobile floor */
  --control-height-lg: 3rem;        /* 48px — marketing CTAs */
  /* Spacing-scale aliases so `min-h-control-md` etc. exist as utilities.
     --control-height-* is the canonical name, and the name the specs cite;
     these three exist purely so no component needs `min-h-[2.75rem]`. */
  --spacing-control-sm: var(--control-height-sm);
  --spacing-control-md: var(--control-height-md);
  --spacing-control-lg: var(--control-height-lg);
  --spacing-touch: 2.75rem;         /* 44px — minimum hit target, always */
  --spacing-header: 4.5rem;         /* 72px marketing header */
  --spacing-header-app: 3.5rem;     /* 56px app header */

  /* --- icons: Lucide only, currentColor ---------------------------------- */
  --icon-size-sm: 1rem;             /* 16px — inline with text-sm */
  --icon-size-md: 1.25rem;          /* 20px — buttons, list rows */
  --icon-size-lg: 1.5rem;           /* 24px — section and category markers */
  --icon-stroke: 1.75;              /* Lucide default is 2; 1.75 sits better
                                       against DM Sans at small sizes */

  /* --- measures: text never spans the viewport --------------------------- */
  --container-page: 1200px;          /* marketing page */
  --container-app: 1440px;           /* dashboard shell — data wants room */
  --container-prose: 36rem;
  --container-narrow: 42rem;
  --container-form: 28rem;

  /* --- radii: one soft, small corner ------------------------------------- */
  --radius-sm: 2px;   /* nested items: menu rows, segmented controls */
  --radius-md: 4px;   /* the system's real radius — cards, buttons, inputs */
  --radius-lg: 8px;   /* dialogs, sheets, toasts */
  --radius-full: 9999px;

  /* --- elevation: the system is flat. Floating layers only. --------------
     --shadow-card is `none` BY DECISION, not by omission: a card is separated
     from its ground by a hairline. The name exists so conformant markup
     resolves instead of failing silently. */
  --shadow-card: none;
  --shadow-popover: 0 1px 2px rgb(51 51 51 / 0.06), 0 4px 12px rgb(51 51 51 / 0.08);
  --shadow-overlay: 0 1px 2px rgb(51 51 51 / 0.06), 0 8px 24px rgb(51 51 51 / 0.10);
  /* Widgets sit on an unknown host background and cannot rely on a hairline
     reading against it — this is the one place elevation is load-bearing. */
  --shadow-widget: 0 0 0 1px rgb(51 51 51 / 0.08), 0 2px 8px rgb(51 51 51 / 0.08);

  /* --- layers: one ordered scale, no ad-hoc z-index ----------------------
     Every stacking decision in the system is one of these six. A raw `z-50` in
     a component is a bug — it cannot be reasoned about against the others.
     Gaps of 100 leave room for a host page's own layers to interleave.

     Toast sits ABOVE modal on purpose: "saved", "failed to save" and
     "connection lost" must reach the user while a dialog is open. */
  --z-index-base: 0;
  --z-index-sticky: 100;     /* sticky table heads, app header */
  --z-index-dropdown: 200;   /* select, menu, popover, combobox */
  --z-index-overlay: 300;    /* the scrim behind a dialog */
  --z-index-modal: 400;      /* dialog, sheet, drawer */
  --z-index-toast: 500;
  --z-index-tooltip: 600;

  /* --- breakpoints ------------------------------------------------------- */
  --breakpoint-sm: 30rem;
  --breakpoint-md: 48rem;   /* 768px — the one real breakpoint */
  --breakpoint-lg: 64rem;
  --breakpoint-xl: 80rem;

  /* --- motion: functional, never decorative ------------------------------
     Two curves and three durations. `exit` is faster than `enter` — leaving
     should feel immediate, arriving should feel placed. Nothing in this system
     animates transform except the sheet and the spinner. */
  --default-transition-duration: 150ms;
  --default-transition-timing-function: ease;
  --ease-enter: cubic-bezier(0.2, 0, 0, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --duration-fast: 120ms;    /* state change on a control */
  --duration-base: 150ms;    /* the default */
  --duration-slow: 220ms;    /* a layer entering or leaving */
}
[data-density="compact"] {
  --spacing-section: 1.5rem;
  --spacing-section-loose: 2rem;
  --spacing-section-tight: 1rem;
  --spacing-block: 0.75rem;
  --spacing-block-tight: 0.5rem;
  --spacing-stack: 0.5rem;
  --spacing-row: 0.375rem;
}
[data-density="default"] {
  --spacing-section: 2rem;
  --spacing-section-loose: 3rem;
  --spacing-section-tight: 1.5rem;
  --spacing-block: 1rem;
  --spacing-block-tight: 0.75rem;
  --spacing-stack: 0.75rem;
  --spacing-row: 0.5rem;
}
[data-density="comfortable"] {
  --spacing-section: 3.5rem;
  --spacing-section-loose: 5rem;
  --spacing-section-tight: 2rem;
  --spacing-block: 1.5rem;
  --spacing-block-tight: 1rem;
  --spacing-stack: 1rem;
  --spacing-row: 0.625rem;
}
.dark {
  --color-surface: var(--color-ink-900);
  --color-surface-muted: var(--color-ink-800);
  --color-surface-raised: var(--color-ink-800);
  --color-surface-sunken: var(--color-ink-700);
  --color-surface-inverse: var(--color-white);

  --color-text-primary: var(--color-white);
  --color-text-secondary: var(--color-slate-200);
  --color-text-muted: var(--color-slate-400);
  --color-text-inverse: var(--color-grey-800);

  --color-primary: var(--color-scout-blue-400);
  --color-primary-hover: var(--color-white);
  --color-primary-contrast: var(--color-grey-800);
  --color-accent: var(--color-scout-blue-400);
  --color-cta: var(--color-white);
  --color-cta-hover: color-mix(in oklab, var(--color-white) 88%, black);
  --color-cta-contrast: var(--color-grey-800);

  --color-border: var(--color-ink-700);
  --color-border-strong: var(--color-ink-600);
  --color-border-focus: var(--color-scout-blue-400);

  /* Rating hues hold their meaning; only track and neutral follow the surface. */
  --color-rating-empty: var(--color-ink-700);
  --color-rating-neutral: var(--color-slate-500);
}
/* Fallbacks: declared in the design system’s tokens.css mirror but missing
   from theme.css. Remove once theme.css declares them. */
:root {
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* font is self-hosted by the docs site; upstream @import kept for reference:
   @import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,600;1,9..40,700&display=swap'); */

/* ==========================================================================
   Sporting Scouter design reference — documentation chrome.

   This file styles the DOCS. It is not part of the design system and must not
   be copied into a product. Every value below resolves a system token; where
   the docs need something the system has no name for (the sidebar width, the
   dotted demo stage) it is declared here and only here.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box }
/* An author display: declaration beats the UA stylesheet's [hidden] rule, so any
   component that sets display: grid/flex silently ignores the hidden attribute.
   Immunise every one of them here rather than reaching for style.display in JS. */
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-font-smoothing: antialiased; scroll-behavior: smooth }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto } *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important } }
body { margin: 0; font-family: var(--font-sans); font-size: var(--text-base); line-height: 1.65; color: var(--color-text-primary); background: var(--color-surface) }
img, svg { max-width: 100%; display: block }
a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px }
a:hover { color: var(--color-primary-hover) }
:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px }
::selection { background: var(--color-primary-subtle) }

/* --- shell ---------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh }
.skip { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--color-cta); color: var(--color-cta-contrast); padding: 10px 16px; border-radius: 0 0 var(--radius-md) 0; text-decoration: none }
.skip:focus { left: 0 }

.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--color-border); background: var(--color-surface-muted); padding: 28px 0 64px }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 24px; text-decoration: none; color: inherit }
.brand:hover { color: inherit }
.brand__mark { width: 22px; height: 22px; border-radius: var(--radius-sm); background: var(--color-cta); color: var(--color-cta-contrast); display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: -.02em; flex: none }
.brand__name { font-size: var(--text-ui); font-weight: 600; letter-spacing: -.01em }
.brand__ver { padding: 6px 24px 22px; font-weight:400;font-size:var(--text-eyebrow);line-height:1.4;font-family:var(--font-mono); letter-spacing: .06em; color: var(--color-text-muted) }

.nav { display: flex; flex-direction: column; gap: 22px; padding: 0 12px }
.nav__group { display: flex; flex-direction: column; gap: 1px }
.nav__label { font-weight:500;font-size:var(--text-eyebrow);line-height:1.4;font-family:var(--font-sans); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted); padding: 0 12px 8px }
.nav__link { display: block; padding: 6px 12px; border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--color-text-secondary); text-decoration: none; transition: background-color var(--duration-base) ease, color var(--duration-base) ease }
.nav__link:hover { background: var(--color-surface); color: var(--color-text-primary) }
.nav__link[aria-current="page"] { background: var(--color-surface); color: var(--color-text-primary); font-weight: 600; box-shadow: inset 2px 0 0 var(--color-primary) }

/* --- topbar --------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: var(--z-index-sticky); display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 56px; padding: 0 48px; background: color-mix(in srgb, var(--color-surface) 88%, transparent); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--color-border) }
.crumb { font-weight:400;font-size:var(--text-eyebrow);line-height:1;font-family:var(--font-mono); letter-spacing: .06em; color: var(--color-text-muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tools { display: flex; align-items: center; gap: 10px; flex: none }
.tools__label { font-weight:500;font-size:var(--text-eyebrow);line-height:1;font-family:var(--font-sans); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted) }
.seg { display: flex; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden }
.seg button { border: 0; background: transparent; font-weight:500;font-size:var(--text-eyebrow);line-height:1;font-family:var(--font-sans); letter-spacing: .04em; color: var(--color-text-secondary); padding: 7px 10px; cursor: pointer; transition: background-color var(--duration-base) ease, color var(--duration-base) ease }
.seg button + button { border-left: 1px solid var(--color-border) }
.seg button:hover { color: var(--color-text-primary) }
.seg button[aria-pressed="true"] { background: var(--color-surface-inverse); color: var(--color-text-inverse) }
.tbtn { border: 1px solid var(--color-border); background: transparent; border-radius: var(--radius-md); font-weight:500;font-size:var(--text-eyebrow);line-height:1;font-family:var(--font-sans); letter-spacing: .04em; color: var(--color-text-secondary); padding: 8px 12px; cursor: pointer }
.tbtn:hover { border-color: var(--color-border-strong); color: var(--color-text-primary) }
.navtoggle { display: none }

/* --- page ----------------------------------------------------------------- */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; max-width: 1160px; padding: 0 48px 160px }
.main { min-width: 0; padding-top: 64px }
.rail { display: none }

.pagehead { margin-bottom: 40px }
.pagehead .eyebrow { margin-bottom: 12px }
.pagehead h1 { margin: 0; font-size: var(--text-h1); line-height: 1.15; letter-spacing: -.025em; font-weight: 600 }
.pagehead .lead { margin: 18px 0 0; max-width: 38rem; font-size: var(--text-lead); line-height: 1.55; color: var(--color-text-secondary) }

.main h2 { margin: 56px 0 0; font-size: var(--text-h3); line-height: 1.35; letter-spacing: -.01em; font-weight: 600; scroll-margin-top: 76px }
.main h3 { margin: 40px 0 0; font-size: var(--text-h4); line-height: 1.4; font-weight: 600; scroll-margin-top: 76px }
.main h2 + p, .main h3 + p { margin-top: 8px }
.main p { margin: 16px 0 0; max-width: 38rem; font-size: var(--text-base); line-height: 1.65; color: var(--color-text-secondary) }
.main p.lead { font-size: var(--text-lead); line-height: 1.55 }
.main ul, .main ol { margin: 12px 0 0; padding-left: 18px; max-width: 38rem; font-size: var(--text-sm); line-height: 1.8; color: var(--color-text-secondary) }
.main li + li { margin-top: 2px }
.main strong { color: var(--color-text-primary); font-weight: 600 }
.main > * + h2 { margin-top: 56px }

.eyebrow { font-weight:500;font-size:var(--text-eyebrow);line-height:1.4;font-family:var(--font-sans); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted) }
.eyebrow--primary { color: var(--color-primary) }
.eyebrow--warn { color: var(--color-warning) }
.eyebrow--danger { color: var(--color-destructive) }
.eyebrow--ok { color: var(--color-success) }
.muted { color: var(--color-text-muted) }
.tnum { font-variant-numeric: tabular-nums }

code { font-weight:400;font-size:var(--text-meta);font-family:var(--font-mono); color: inherit }
.main p code, .main li code, .main td code { background: var(--color-surface-muted); border-radius: 2px; padding: 1px 5px }
h1 code, h2 code, h3 code { font-size: inherit; font-weight: inherit }

/* --- blocks --------------------------------------------------------------- */
.card { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 20px }
.card > :first-child { margin-top: 0 }
.frame { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden }
.pad { padding: 24px }
.grid2, .grid3, .grid4 { display: grid; gap: 16px; margin-top: 16px }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.stack { display: grid; gap: 14px; margin-top: 16px }
.hairgrid { display: grid; gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-top: 16px; overflow: hidden }
.hairgrid > * { background: var(--color-surface); padding: 18px 20px }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px }
.chip { font-weight:400;font-size:var(--text-meta);font-family:var(--font-mono); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 6px 10px; color: var(--color-text-secondary) }

/* --- tables --------------------------------------------------------------- */
.tbl { margin-top: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow-x: auto }
.tbl table { width: 100%; border-collapse: collapse; font-size: var(--text-sm) }
.tbl thead tr { background: var(--color-surface-muted) }
.tbl th { text-align: left; padding: 9px 16px; border-bottom: 1px solid var(--color-border); font-weight:500;font-size:var(--text-eyebrow);line-height:1.4;font-family:var(--font-sans); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted); white-space: nowrap }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--color-border); vertical-align: top }
.tbl tbody tr:last-child td { border-bottom: 0 }
.tbl td.sec, .tbl td .sec { color: var(--color-text-secondary) }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
.tbl th.num { text-align: right }

/* --- code snippets -------------------------------------------------------- */
.snippet { position: relative; margin-top: 16px }
.snippet pre { margin: 0; overflow-x: auto; background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px 18px; font-weight:400;font-size:13px;line-height:1.7;font-family:var(--font-mono); color: var(--color-text-primary) }
.snippet--bare pre { background: var(--color-surface); border: 0; border-radius: 0 }
.copy { position: absolute; top: 10px; right: 10px; font-weight:500;font-size:11px;line-height:1;font-family:var(--font-mono); letter-spacing: .06em; color: var(--color-text-muted); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 6px 8px; cursor: pointer }
.copy:hover { color: var(--color-text-primary); border-color: var(--color-border-strong) }
pre::-webkit-scrollbar { height: 8px }
pre::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full) }

/* --- notes ---------------------------------------------------------------- */
.note { margin-top: 18px; border: 1px solid var(--color-border); border-left: 3px solid var(--color-primary); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--color-surface-muted); padding: 14px 18px }
.note--warn { border-left-color: var(--color-warning-fill) }
.note--danger { border-left-color: var(--color-destructive-fill) }
.note p { margin: 6px 0 0; font-size: var(--text-sm); line-height: 1.6 }
.note p + p { margin-top: 10px }
.rule { border-left: 3px solid var(--color-primary); padding: 2px 0 2px 18px; margin-top: 22px }
.rule p { margin: 0 }

/* --- do / don't ----------------------------------------------------------- */
.dd { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column }
.dd__demo { padding: 22px; background: var(--color-surface); flex: 1 }
.dd__foot { padding: 12px 16px; background: var(--color-surface-muted); border-top: 1px solid var(--color-border) }
.dd__foot p { margin: 6px 0 0; font-size: var(--text-meta); line-height: 1.55; max-width: none }

/* --- demo stage ----------------------------------------------------------- */
.demo { margin-top: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden }
.demo__stage { min-height: 180px; display: grid; place-items: center; padding: 40px; background: var(--color-surface); background-image: radial-gradient(var(--color-border) 1px, transparent 1px); background-size: 16px 16px }
.demo__controls { border-top: 1px solid var(--color-border); background: var(--color-surface-muted); padding: 16px 18px; display: flex; gap: 24px; flex-wrap: wrap }
.demo__controls .eyebrow { margin-bottom: 7px }
.ctlrow { display: flex; flex-wrap: wrap; gap: 4px }
.ctl { border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-sm); font-weight:500;font-size:var(--text-meta);line-height:1;font-family:var(--font-sans); color: var(--color-text-secondary); padding: 7px 10px; cursor: pointer }
.ctl[aria-pressed="true"] { background: var(--color-surface-inverse); color: var(--color-text-inverse); border-color: var(--color-surface-inverse) }

/* --- demo controls (system look-alikes, docs only) ------------------------ */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-sans); font-weight: 600; font-size: var(--text-ui); line-height: 1; height: var(--control-height-md); padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; transition: background-color var(--duration-base) ease, border-color var(--duration-base) ease, color var(--duration-base) ease; text-decoration: none }
.b--primary { background: var(--color-cta); color: var(--color-cta-contrast) }
.b--primary:hover { background: var(--color-cta-hover); color: var(--color-cta-contrast) }
.b--secondary { background: transparent; color: var(--color-text-primary); border-color: var(--color-border-strong) }
.b--secondary:hover { border-color: var(--color-text-primary); color: var(--color-text-primary) }
.b--ghost { background: transparent; color: var(--color-text-secondary); padding: 0 14px }
.b--ghost:hover { background: var(--color-surface-muted); color: var(--color-text-primary) }
.b--destructive { background: var(--color-destructive-solid); color: #fff }
.b--destructive:hover { background: color-mix(in oklab, var(--color-destructive-solid) 88%, black); color: #fff }
.b--link { background: none; height: auto; padding: 0; font-weight: 500; color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; line-height: 1.6 }
.b--xs { height: var(--control-height-sm); padding: 0 12px; font-size: var(--text-sm) }
.b--lg { height: var(--control-height-lg); padding: 0 24px }
.field { width: 100%; height: var(--control-height-md); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text-primary); font-size:var(--text-ui);font-family:var(--font-sans); padding: 0 12px; transition: border-color var(--duration-base) ease, box-shadow var(--duration-base) ease }
.field:hover { border-color: var(--color-text-primary) }
.field:focus-visible { border-color: var(--color-border-focus) }
textarea.field { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); font-weight:500;font-size:var(--text-eyebrow);line-height:1;font-family:var(--font-sans); letter-spacing: var(--tracking-caps); text-transform: uppercase }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--radius-full); animation: ss-spin 700ms linear infinite; flex: none }
@keyframes ss-spin { to { transform: rotate(360deg) } }
@keyframes ss-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }
.pulse { animation: ss-pulse 1.6s ease-in-out infinite }
.sk { background: var(--color-surface-sunken); border-radius: 2px }

/* --- page footer / prev-next ---------------------------------------------- */
.pagenav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--color-border) }
.pagenav a { display: block; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px 18px; text-decoration: none; color: inherit; transition: border-color var(--duration-base) ease }
.pagenav a:hover { border-color: var(--color-border-strong); color: inherit }
.pagenav .dir { font-weight:500;font-size:var(--text-eyebrow);line-height:1.4;font-family:var(--font-sans); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted) }
.pagenav .ttl { margin-top: 4px; font-size: var(--text-ui); font-weight: 600 }
.pagenav .next { text-align: right }
.foot { margin-top: 40px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-weight:400;font-size:var(--text-meta);line-height:1.6;font-family:var(--font-sans); color: var(--color-text-muted) }

/* --- right rail (on this page) -------------------------------------------- */
@media (min-width: 1400px) {
  .page { grid-template-columns: minmax(0, 1fr) 200px; max-width: 1400px }
  .rail { display: block; position: sticky; top: 76px; align-self: start; padding-top: 64px; max-height: calc(100vh - 96px); overflow-y: auto }
  .rail__label { font-weight:500;font-size:var(--text-eyebrow);line-height:1.4;font-family:var(--font-sans); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 10px }
  .rail a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--color-border); font-size: var(--text-meta); color: var(--color-text-secondary); text-decoration: none; line-height: 1.5 }
  .rail a:hover { color: var(--color-text-primary) }
  .rail a[aria-current="true"] { color: var(--color-text-primary); border-left-color: var(--color-primary) }
}

/* --- breakpoints ---------------------------------------------------------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr) }
  .page { padding: 0 32px 140px }
  .topbar { padding: 0 32px }
}
@media (max-width: 767px) {
  .shell { grid-template-columns: minmax(0, 1fr) }
  .sidebar { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--color-border); padding: 16px 0 }
  .brand, .brand__ver { padding-left: 16px; padding-right: 16px }
  .brand__ver { padding-bottom: 0 }
  .navtoggle { display: inline-flex; align-items: center; gap: 8px; margin: 12px 16px 0; border: 1px solid var(--color-border-strong); background: var(--color-surface); border-radius: var(--radius-md); font-weight:600;font-size:var(--text-sm);line-height:1;font-family:var(--font-sans); color: var(--color-text-primary); min-height: var(--spacing-touch); padding: 0 14px; cursor: pointer }
  .nav { display: none; padding: 14px 16px 0 }
  .nav.is-open { display: flex }
  .nav__link { min-height: var(--spacing-touch); display: flex; align-items: center }
  .topbar { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px }
  .crumb { width: 100% }
  .page { padding: 0 16px 120px; gap: 0 }
  .main { padding-top: 40px }
  .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr) }
  .pagenav { grid-template-columns: minmax(0, 1fr) }
  .pagenav .next { text-align: left }
  .demo__stage { padding: 24px }
  .pad { padding: 16px }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}

@media print {
  .sidebar, .topbar, .rail, .copy, .pagenav,
  .demo__controls, .navtoggle, .skip, .foot,
  .tools, [data-theme-toggle], .seg { display: none !important }

  .shell, .page { display: block; max-width: none; padding: 0; margin: 0 }
  .main {
    width: 100%;
    max-width: none;
    padding: 12mm 0 0;
    margin: 0;
  }

  .demo, .tbl, .frame, .note, .dd { break-inside: avoid; page-break-inside: avoid }

  /* Belt-and-suspenders: force light palette even if .dark slipped through */
  html.dark {
    color-scheme: light;
    --color-surface: #ffffff;
    --color-surface-muted: #f5f7fa;
    --color-surface-raised: #ffffff;
    --color-surface-sunken: #ececec;
    --color-surface-inverse: #333333;
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-text-muted: #64748b;
    --color-text-inverse: #ffffff;
    --color-primary: #0077b3;
    --color-primary-hover: #005a8c;
    --color-primary-contrast: #ffffff;
    --color-accent: #21b2fc;
    --color-cta: #333333;
    --color-cta-hover: color-mix(in oklab, #333333 88%, white);
    --color-cta-contrast: #ffffff;
    --color-border: #e2e8f0;
    --color-border-strong: #8595a9;
    --color-border-focus: #0077b3;
    --color-destructive: #b91c1c;
    --color-warning: #b45309;
    --color-success: #047857;
    --color-rating-empty: #ececec;
    --color-rating-neutral: #64748b;
  }
}

/* --- utilities used by the ported pages ----------------------------------- */
code.k { font-weight: 500 }
.accent { color: var(--color-primary) }
.tar { text-align: right }
.main p.small { font-size: var(--text-sm); line-height: 1.6 }
.main p.lead + p { margin-top: 16px }
.note--ok { border-left-color: var(--color-success-fill) }
.fieldlabel { display: block }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%), linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px }
.demo__stage svg, .main svg { display: inline-block; vertical-align: middle }
.main table code { white-space: nowrap }

/* Token tables built as CSS grids (colour, spacing, layout, tiers) keep their
   column rhythm and scroll rather than squashing on a narrow main column. */
.frame:has(> [style*="grid-template-columns"]) { overflow-x: auto }
.frame > [style*="grid-template-columns"] { min-width: 620px }

/* A chart holder is a grid item inside a place-items:center stage, so it
   shrinks to fit and its percentage-width SVG falls back to the 300px default
   intrinsic width of a replaced element — scaling 11px labels down to 7px.
   Stretch the holder; the SVG's own max-width still caps the drawing. */
.demo__stage > [id$="-chart"] { justify-self: stretch; width: 100%; display: flex; justify-content: center }


/* --- event search demo -----------------------------------------------------
   One block, one definition per class. These are docs-demo styles; the real
   component lives in the ui package. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }
.es { position: relative; text-align: left }
.es .es__label { display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: 6px }
.es .es__field { position: relative }
.es .es__field .field { padding-left: 38px; padding-right: 46px }
.es .es__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; display: flex }
.es .es__clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: var(--spacing-touch); height: var(--spacing-touch); display: grid; place-items: center; border: 0; background: none; color: var(--color-text-muted); cursor: pointer; border-radius: var(--radius-md) }
.es .es__clear:hover { color: var(--color-text-primary) }
.es .es__hint { margin: 6px 0 0; font-size: var(--text-meta); line-height: 1.5; color: var(--color-text-muted); max-width: none }

/* The popup is ONE surface however many of its parts are populated. */
.es .es__pop { margin: 6px 0 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); overflow: hidden }
.es .es__note { margin: 0; padding: 4px }
.es .es__pop .es__list { list-style: none; margin: 0; padding: 4px; max-height: 268px; overflow-y: auto; font-size: var(--text-sm); line-height: 1.55; color: var(--color-text-primary) }
.es .es__pop .es__note:not([hidden]) + .es__list:not([hidden]) { border-top: 1px solid var(--color-border) }

/* .main p wins on specificity over a single class, so the message is scoped. */
.es .es__note .es__empty { margin: 0; padding: 6px 10px; max-width: none; font-size: var(--text-sm); line-height: 1.55; color: var(--color-text-secondary) }
.es .es__note .es__skel { height: 14px; margin: 6px 10px; border-radius: 2px }

.es .es__pop .es__opt { display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: var(--spacing-touch); padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer }
.es .es__pop .es__opt.is-active, .es .es__pop .es__opt:hover { background: var(--color-surface-muted) }
.es .es__opt-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 }
.es .es__opt-name { font-weight: 400 }
.es .es__hl { font-weight: 700 }
.es .es__opt-meta { font-size: var(--text-caption); letter-spacing: .04em; color: var(--color-text-muted) }
.es .es__opt-rate { display: flex; align-items: baseline; gap: 6px; flex: none; white-space: nowrap }
.es .es__stars { color: var(--color-star); font-size: 13px; letter-spacing: 1px }
.es .es__num { font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--text-meta) }
.es .es__opt-rate--none { font-size: var(--text-caption); letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-muted) }
.es .es__opt--create { flex-direction: column; align-items: stretch; border-top: 1px solid var(--color-border); border-radius: 0; margin-top: 4px; padding-top: 10px }
.es .es__opt--create:first-child { border-top: 0; margin-top: 0; padding-top: 6px }
.es .es__opt--create .es__opt-name { color: var(--color-primary); font-weight: 600 }

.es .es__create { margin-top: 6px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); padding: 16px; display: grid; gap: 12px }
.es .es__create-title { margin: 0; font-size: var(--text-sm); line-height: 1.55; font-weight: 600; color: var(--color-text-primary); max-width: none }
.es .es__f { display: grid; gap: 4px; align-content: start }
.es .es__f-label { font-size: var(--text-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; font-weight: 500; color: var(--color-text-muted) }
.es .es__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px }
.es .es__row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start }
.es .es__why { font-size: var(--text-meta); line-height: 1.5; letter-spacing: normal; text-transform: none; color: var(--color-text-muted) }
.es .es__check { display: grid; grid-template-columns: 18px 1fr; align-items: start; column-gap: 10px; font-size: var(--text-meta); line-height: 1.5; color: var(--color-text-secondary); min-height: var(--spacing-touch) }
.es .es__check .es__fe { grid-column: 2; margin-top: 6px }
.es .es__check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--color-cta); flex: none }
.es .es__fe { margin: 5px 0 0; font-size: var(--text-meta); line-height: 1.5; letter-spacing: normal; text-transform: none; color: var(--color-destructive) }
.es .es__fe:empty { margin: 0; min-height: 0 }
/* The two-column row shares its height, so a message under one column would
   move the other. Reserved there only — 20px once, not once per field. */
.es .es__row2 .es__fe, .es .es__row2 .es__fe:empty { min-height: 20px; margin-top: 5px }
.es .es__f input[aria-invalid="true"] { border-color: var(--color-destructive) }
.es .es__check input[aria-invalid="true"] { outline: 2px solid var(--color-destructive); outline-offset: 1px }
.es .es__err { margin: 0; font-size: var(--text-meta); line-height: 1.5; color: var(--color-destructive); max-width: none }
.es .es__create .field[aria-invalid="true"] { border-color: var(--color-destructive) }
@media (max-width: 480px) { .es__row2 { grid-template-columns: 1fr } }
.es .es__f { position: relative }
/* An autocomplete overlays its field. In flow it shoves the rest of the form
   down mid-typing, moving the fields the user is looking at. */
.es .es__places { position: absolute; top: 100%; left: 0; right: 0; z-index: var(--z-index-dropdown); list-style: none; margin: 4px 0 0; padding: 4px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-popover) }
.es .es__place { min-height: var(--spacing-touch); display: flex; align-items: center; padding: 6px 10px; border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer }
.es .es__place:hover, .es .es__place.is-active { background: var(--color-surface-muted) }
.es .es__opt-tag, .es .es__req-tag { font-size: var(--text-caption); letter-spacing: normal; text-transform: none; font-weight: 400; color: var(--color-text-muted) }
.es .es__req-tag { color: var(--color-text-secondary) }
.es .es__req-note { margin: -4px 0 0; font-size: var(--text-meta); line-height: 1.5; color: var(--color-text-muted); max-width: none }


/* === new components =========================================================
   Root classes are DOUBLED (.bn.bn) so nothing here loses to the prose
   defaults .main p / .main ul / .main ol, which are (0,1,1). Descendants are
   written with an ancestor class for the same reason. This is the rule that
   the search component had to learn twice.
   ========================================================================== */
:root { --dsx-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); --dsx-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") }
.demo.demo { margin-top: 16px }

/* --- banner --------------------------------------------------------------- */
.bn.bn { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid transparent; border-radius: var(--radius-md); font-size: var(--text-sm); line-height: 1.55 }
.bn .bn__icon { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px }
.bn .bn__body { min-width: 0 }
.bn .bn__body strong { font-weight: 600; color: var(--color-text-primary) }
.bn .bn__body a { color: var(--color-text-primary); font-weight: 500; text-decoration: underline; text-underline-offset: 2px }
.bn .bn__body a:hover { color: var(--color-primary-hover) }
.bn--neutral.bn--neutral { background: var(--color-surface-muted); border-color: var(--color-border); color: var(--color-text-secondary) }
.bn--neutral .bn__icon { color: var(--color-text-muted) }
.bn--warning.bn--warning { background: var(--color-warning-subtle); border-color: color-mix(in oklab, var(--color-warning) 28%, transparent); color: var(--color-text-secondary) }
.bn--warning .bn__icon { color: var(--color-warning) }
.bn--destructive.bn--destructive { background: var(--color-destructive-subtle); border-color: color-mix(in oklab, var(--color-destructive) 28%, transparent); color: var(--color-text-secondary) }
.bn--destructive .bn__icon { color: var(--color-destructive) }
.frame > .bn.bn { border-radius: 0; border-width: 0 0 1px 0 }

/* --- breadcrumbs ---------------------------------------------------------- */
.bc.bc ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: var(--text-sm) }
.bc.bc li { display: flex; align-items: center; margin: 0 }
.bc.bc li + li::before { content: ""; display: block; flex: none; width: 14px; height: 14px; margin: 0 6px; background-color: var(--color-text-muted); -webkit-mask: var(--dsx-chev) center / 14px no-repeat; mask: var(--dsx-chev) center / 14px no-repeat }
.bc.bc a { display: inline-block; padding: 8px 2px; color: var(--color-text-secondary); text-decoration: none; border-radius: var(--radius-sm) }
.bc.bc a[href]:hover { color: var(--color-text-primary); text-decoration: underline }
.bc.bc a[aria-current] { color: var(--color-text-primary); font-weight: 500 }
.bc .bc__more { border: 1px solid var(--color-border); background: transparent; border-radius: var(--radius-sm); padding: 3px 9px; font: inherit; line-height: 1.3; color: var(--color-text-secondary); cursor: pointer }
.bc .bc__more:hover { border-color: var(--color-border-strong); color: var(--color-text-primary) }
.bc--up.bc--up a { display: inline-flex; align-items: center; gap: 6px; color: var(--color-primary); font-weight: 500 }

/* --- checkbox ------------------------------------------------------------- */
.ck.ck { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 11px 0; box-sizing: border-box; font-size: var(--text-ui); line-height: 1.5; cursor: pointer }
.ck.ck input { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); display: grid; place-items: center; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-enter), border-color var(--duration-fast) var(--ease-enter) }
.ck.ck input:checked { background: var(--color-cta); border-color: var(--color-cta) }
.ck.ck input:checked::after { content: ""; width: 12px; height: 12px; background: var(--color-cta-contrast); -webkit-mask: var(--dsx-tick) center / 12px no-repeat; mask: var(--dsx-tick) center / 12px no-repeat }
.ck.ck input:indeterminate { background: var(--color-cta); border-color: var(--color-cta) }
.ck.ck input:indeterminate::after { content: ""; width: 10px; height: 2px; border-radius: 1px; background: var(--color-cta-contrast); -webkit-mask: none; mask: none }
.ck.ck input:disabled { background: var(--color-surface-muted); border-color: var(--color-border); cursor: not-allowed }
.ck.ck input:checked:disabled { background: var(--color-border-strong); border-color: var(--color-border-strong) }
.ck.ck input:disabled + span { color: var(--color-text-muted) }
.ck.ck input:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px }
.ck--error.ck--error input { border-color: var(--color-destructive) }
.ck__err.ck__err { margin: 0; font-size: var(--text-sm); color: var(--color-destructive) }
.ck__set.ck__set, .cx__set.cx__set { border: 0; margin: 0; padding: 0; min-width: 0 }
.ck__set.ck__set legend, .cx__set.cx__set legend { padding: 0; margin: 0; font-weight: 500; font-size: var(--text-eyebrow); line-height: 1.4; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted) }
.ck__kids.ck__kids { margin: 0 0 0 9px; padding-left: 26px; border-left: 1px solid var(--color-border) }
.ck--parent.ck--parent { font-weight: 600 }

/* --- choicebox ------------------------------------------------------------ */
.cx__grid.cx__grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px }
.cx.cx { position: relative; display: block; cursor: pointer }
.cx.cx input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none }
.cx .cx__box { position: relative; display: grid; gap: 3px; align-content: start; height: 100%; box-sizing: border-box; padding: 14px 44px 14px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); transition: background-color var(--duration-fast) var(--ease-enter), border-color var(--duration-fast) var(--ease-enter) }
.cx.cx:hover .cx__box { border-color: var(--color-border-strong) }
.cx .cx__ttl { font-size: var(--text-ui); font-weight: 600; color: var(--color-text-primary) }
.cx .cx__sub { font-size: var(--text-sm); line-height: 1.45; color: var(--color-text-secondary) }
.cx .cx__tick { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: var(--color-primary); color: #fff; opacity: 0; transition: opacity var(--duration-fast) var(--ease-enter) }
.cx.cx:has(:checked) .cx__box { border-color: var(--color-primary); background: var(--color-primary-subtle) }
.cx.cx:has(:checked) .cx__tick { opacity: 1 }
.cx.cx:has(:focus-visible) .cx__box { outline: 2px solid var(--color-primary); outline-offset: 2px }
.cx.cx:has(:disabled) { cursor: not-allowed }
.cx.cx:has(:disabled) .cx__box { background: var(--color-surface-muted); border-color: var(--color-border) }
.cx.cx:has(:disabled) .cx__ttl, .cx.cx:has(:disabled) .cx__sub { color: var(--color-text-muted) }

/* --- collapse ------------------------------------------------------------- */
.co.co { border-bottom: 1px solid var(--color-border) }
.co.co:last-child { border-bottom: 0 }
.co.co summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 12px 20px; list-style: none; cursor: pointer; color: var(--color-text-primary); transition: background-color var(--duration-fast) var(--ease-enter) }
.co.co summary::-webkit-details-marker { display: none }
.co.co summary::marker { content: "" }
.co.co summary:hover { background: var(--color-surface-muted) }
.co.co summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px }
.co .co__ttl { font-size: var(--text-ui); font-weight: 500 }
.co .co__ico { flex: none; display: grid; place-items: center; width: 20px; height: 20px; color: var(--color-text-muted) }
.co .co__ico svg:nth-child(2) { display: none }
.co[open] .co__ico svg:nth-child(1) { display: none }
.co[open] .co__ico svg:nth-child(2) { display: block }
.co .co__body { padding: 0 20px 18px; font-size: var(--text-base); color: var(--color-text-secondary) }
.co .co__body p { margin: 0; line-height: 1.6; max-width: 66ch }

/* --- gauge ---------------------------------------------------------------- */
.gg__row.gg__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 34px }
.gg__cell.gg__cell { display: grid; justify-items: center; gap: 10px }
.gg__lbl.gg__lbl { font-weight: 500; font-size: var(--text-caption); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-text-muted) }
.gg.gg { display: block; overflow: visible }
.gg .gg__track { fill: none; stroke: var(--color-border) }
.gg .gg__arc { fill: none; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50% }
.gg[width="96"] circle { stroke-width: 8 }
.gg[width="64"] circle { stroke-width: 6 }
.gg[width="40"] circle { stroke-width: 4 }
.gg .gg__val { text-anchor: middle; font-family: var(--font-sans); font-size: 26px; font-weight: 600; letter-spacing: -.02em; fill: var(--color-text-primary) }
.gg .gg__val--md { font-size: 17px }
.gg .gg__val--sm { font-size: 12px }
.gg .gg__val--none { fill: var(--color-text-muted) }
.gg .gg__cap { text-anchor: middle; font-family: var(--font-sans); font-size: 8px; font-weight: 500; letter-spacing: .12em; fill: var(--color-text-muted) }
.gg__live.gg__live { display: flex; flex-wrap: wrap; align-items: center; gap: 32px }
.gg__ctl.gg__ctl { display: grid; gap: 8px }
.gg__ctl-lbl.gg__ctl-lbl { font-weight: 500; font-size: var(--text-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted) }
.gg__ctl.gg__ctl input { width: 240px; accent-color: var(--color-primary) }

/* --- multi-select --------------------------------------------------------- */
.ms.ms { position: relative; max-width: 440px }
.ms .ms__lbl { display: block; margin-bottom: 6px; font-weight: 500; font-size: var(--text-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted) }
.ms .ms__ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 5px 6px 5px 8px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); cursor: text }
.ms .ms__ctl:focus-within { border-color: var(--color-primary); outline: 2px solid var(--color-primary); outline-offset: 2px }
.ms .ms__chips { display: contents }
.ms .ms__chip { display: inline-flex; align-items: center; gap: 1px; max-width: 190px; padding: 3px 3px 3px 10px; border-radius: var(--radius-sm); background: var(--color-primary-subtle); color: var(--color-primary-hover); font-size: var(--text-sm); line-height: 1.4 }
.ms .ms__chip button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; cursor: pointer }
.ms .ms__chip button:hover { background: color-mix(in oklab, var(--color-primary) 18%, transparent) }
.ms .ms__in { flex: 1 1 60px; min-width: 60px; padding: 6px 2px; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--text-ui); color: var(--color-text-primary) }
.ms .ms__clear, .ms .ms__caret { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--color-text-muted) }
.ms .ms__clear { padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer }
.ms .ms__clear:hover { background: var(--color-surface-muted); color: var(--color-text-primary) }
.ms .ms__list { position: absolute; left: 0; right: 0; top: 100%; z-index: var(--z-index-dropdown); max-height: 300px; margin: 6px 0 0; padding: 4px; overflow: auto; list-style: none; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-popover) }
.ms .ms__opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--text-ui); cursor: pointer }
.ms .ms__opt[aria-selected="true"] { background: var(--color-primary-subtle) }
.ms .ms__opt.is-active { background: var(--color-surface-muted) }
.ms .ms__opt[aria-selected="true"].is-active { background: color-mix(in oklab, var(--color-primary) 16%, transparent) }
.ms .ms__box { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface) }
.ms .ms__opt[aria-selected="true"] .ms__box { background: var(--color-cta); border-color: var(--color-cta); color: var(--color-cta-contrast) }
.ms .ms__box svg { display: none }
.ms .ms__opt[aria-selected="true"] .ms__box svg { display: block }
.ms .ms__note { margin: 8px 0 0; font-size: var(--text-sm); color: var(--color-text-muted) }

@media (max-width: 767px) {
  .cx__grid.cx__grid { grid-template-columns: minmax(0, 1fr) }
  .gg__row.gg__row { gap: 24px }
}

/* --- demo icon sizing (the preview renders Lucide at runtime at 24px) ------ */
.bn .bn__icon svg { width: 18px; height: 18px }
.co .co__ico svg { width: 18px; height: 18px }
.cx .cx__tick svg { width: 12px; height: 12px }
.ms .ms__caret svg, .ms .ms__clear svg { width: 16px; height: 16px }
.bc--up.bc--up a svg { width: 16px; height: 16px }

.ms .ms__chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.ms .ms__chip--sum { padding-right: 10px }

/* --- Brand page ------------------------------------------------------- */
.br .br__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px }
.br .br__tile { position: relative; display: grid; place-items: center; min-height: 168px; padding: 24px 20px 40px; background: #ffffff; color: #333333; border: 1px solid #e2e8f0; border-radius: var(--radius-md) }
.br .br__cap { position: absolute; left: 12px; bottom: 11px; font-size: var(--text-caption); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: #64748b }
.br .br__tile--ink { background: #333333; border-color: transparent }
.br .br__tile--ink .br__cap { color: #b8c2cc }
.br .br__tile--blue { background: #0077b3; border-color: transparent }
.br .br__tile--blue .br__cap { color: rgba(255,255,255,.82) }
.br .br__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px }
.br .br__btn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text-primary); font: inherit; font-size: var(--text-ui); line-height: 1; cursor: pointer; text-decoration: none; transition: background-color var(--duration-fast) var(--ease-enter) }
.br .br__btn:hover { background: var(--color-surface-muted) }
.br .br__lock { display: inline-flex; align-items: center; gap: 9px }
.br .br__lock--stack { flex-direction: column; gap: 10px }
.br .br__wm { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap }
.br .br__clear { display: grid; place-items: center; padding: 34px; background: #f1f5f9; color: #333333; border-radius: var(--radius-md) }
.br .br__clearbox { position: relative; padding: 24px; outline: 1px dashed var(--color-primary); outline-offset: 0 }
.br .br__xl { position: absolute; font-size: 10px; font-weight: 600; color: var(--color-primary); letter-spacing: var(--tracking-caps) }
.br .br__misuse { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px }
.br .br__m { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden }
.br .br__m-fig { flex: 1; display: grid; place-items: center; min-height: 104px; padding: 16px; background: #ffffff; color: #333333 }
.br .br__m-cap { margin: 0; padding: 10px 12px; border-top: 1px solid var(--color-border); background: var(--color-surface-muted); font-size: var(--text-sm); color: var(--color-text-secondary) }

.brand__logo { flex: none; display: block; width: 16px; height: 22px }
/* The mark is 0.7306:1. Integer width/height attrs can only approximate that,
   so contain guarantees no distortion however the attrs are rounded. */
img[src*="/brand/"], img[src$="/logo.svg"] { object-fit: contain }
.br .br__lockimg { display: block }


/* --- input OTP ------------------------------------------------------------ */
.otp.otp { display: grid; gap: 12px; justify-items: start }
.otp .otp__row { position: relative; display: flex; gap: 8px }
.otp .otp__slot { width: 44px; height: 52px; display: grid; place-items: center; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--color-text-primary) }
.otp .otp__slot--active { border-color: var(--color-border-focus); box-shadow: 0 0 0 1px var(--color-border-focus) }
.otp .otp__slot--filled { border-color: var(--color-text-primary) }
.otp .otp__caret { width: 2px; height: 22px; background: var(--color-text-primary); animation: otpblink 1.06s steps(2, jump-none) infinite }
@media (prefers-reduced-motion: reduce) { .otp .otp__caret { animation: none } }
@keyframes otpblink { 50% { opacity: 0 } }
.otp .otp__sep { align-self: center; width: 12px; height: 1px; background: var(--color-border-strong); flex: none }
.otp .otp__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; margin: 0; padding: 0; font-size: 16px; background: transparent; caret-color: transparent; color: transparent }
.otp .otp__input:focus { outline: none }
.otp.otp--error .otp__slot { border-color: var(--color-destructive) }
.otp.otp--ok .otp__slot { border-color: var(--color-success) }
.otp .otp__msg { margin: 0; font-size: var(--text-sm); min-height: 20px }
.otp .otp__msg--err { color: var(--color-destructive) }
.otp .otp__msg--ok { color: var(--color-success) }
.otp .otp__foot { display: flex; align-items: center; gap: 10px; font-size: var(--text-sm); color: var(--color-text-muted) }
.otp .otp__lbl { font-size: var(--text-eyebrow); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); font-weight: 500; color: var(--color-text-secondary) }

/* --- expanding textarea --------------------------------------------------- */
.xta.xta { display: grid; gap: 8px }
.xta .xta__ta { width: 100%; box-sizing: border-box; min-height: 84px; max-height: 220px; overflow-y: auto; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text-primary); padding: 10px 12px; font-family: var(--font-sans); font-size: var(--text-ui); line-height: 1.6; resize: none; field-sizing: content }
.xta .xta__ta:hover { border-color: var(--color-text-primary) }
.xta .xta__ta:focus-visible { border-color: var(--color-border-focus) }
.xta .xta__ta:disabled { background: var(--color-surface-muted); color: var(--color-text-muted) }
.xta.xta--fixed .xta__ta { max-height: none }
.xta .xta__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: var(--text-sm); color: var(--color-text-muted) }
.xta .xta__count { font-variant-numeric: tabular-nums; visibility: hidden }
.xta .xta__count--show { visibility: visible }
.xta .xta__count--over { color: var(--color-destructive); font-weight: 500 }
.xta .xta__lbl { font-size: var(--text-eyebrow); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); font-weight: 500; color: var(--color-text-secondary) }


/* --- navigation menu ------------------------------------------------------ */
.nv.nv { position: relative; width: 100%; max-width: 720px }
.nv .nv__bar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap }
.nv .nv__item { position: relative }
.nv .nv__trigger { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text-secondary); font-family: var(--font-sans); font-size: var(--text-ui); font-weight: 500; cursor: pointer }
.nv .nv__trigger:hover { background: var(--color-surface-muted); color: var(--color-text-primary) }
.nv .nv__trigger[aria-expanded="true"] { background: var(--color-surface-muted); color: var(--color-text-primary) }
.nv .nv__chev { width: 16px; height: 16px; flex: none; color: var(--color-text-muted) }
.nv .nv__chev--up { display: none }
.nv .nv__trigger[aria-expanded="true"] .nv__chev--down { display: none }
.nv .nv__trigger[aria-expanded="true"] .nv__chev--up { display: block }
.nv .nv__panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-index-dropdown); min-width: 320px; padding: 20px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-popover) }
.nv .nv__panel[hidden] { display: none }
.nv .nv__panel--wide { --nv-cols: 2; min-width: 520px }
.nv .nv__cols { display: grid; grid-template-columns: repeat(var(--nv-cols, 1), minmax(0, 1fr)); gap: 28px }
.nv .nv__coltitle { margin: 0 0 4px; font-size: var(--text-eyebrow); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); font-weight: 500; color: var(--color-text-muted) }
.nv .nv__list { list-style: none; margin: 0; padding: 0; display: grid }
.nv .nv__link { display: grid; grid-template-columns: 36px 1fr; align-items: start; gap: 12px; padding: 10px; border-radius: var(--radius-md); text-decoration: none; color: inherit }
.nv .nv__link:hover { background: var(--color-surface-muted) }
.nv .nv__ico { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text-primary) }
.nv .nv__ico svg { width: 18px; height: 18px }
.nv .nv__ttl { display: block; font-size: var(--text-ui); font-weight: 500; color: var(--color-text-primary); line-height: 1.35 }
.nv .nv__desc { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.45 }
.nv .nv__plain { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: var(--radius-md); font-size: var(--text-ui); font-weight: 500; color: var(--color-text-secondary); text-decoration: none }
.nv .nv__plain:hover { background: var(--color-surface-muted); color: var(--color-text-primary) }
.nv.nv--acc .nv__bar { flex-direction: column; align-items: stretch; gap: 0 }
.nv.nv--acc .nv__item { border-bottom: 1px solid var(--color-border) }
.nv.nv--acc .nv__trigger, .nv.nv--acc .nv__plain { width: 100%; justify-content: space-between; height: 48px; border-radius: 0 }
.nv.nv--acc .nv__panel { position: static; min-width: 0; padding: 0 0 12px; border: 0; box-shadow: none; border-radius: 0 }
.nv.nv--acc .nv__cols { grid-template-columns: minmax(0, 1fr); gap: 18px }
@media (max-width: 767px) {
.nv.nv .nv__bar { flex-direction: column; align-items: stretch; gap: 0 }
.nv.nv .nv__item { border-bottom: 1px solid var(--color-border) }
.nv.nv .nv__trigger, .nv.nv .nv__plain { width: 100%; justify-content: space-between; height: 48px; border-radius: 0 }
.nv.nv .nv__panel { position: static; min-width: 0; padding: 0 0 12px; border: 0; box-shadow: none; border-radius: 0 }
.nv.nv .nv__cols { grid-template-columns: minmax(0, 1fr); gap: 18px }
}

/* the panel floats out of the trigger, so the stage must reserve its height */
#nv-demo .demo__stage { min-height: 460px; align-items: start; padding: 32px 28px }
#nv-demo .nv__panel { max-width: 100% }

kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--color-border-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); background: var(--color-surface-muted); font-family: var(--font-mono); font-size: 0.85em; line-height: 1.5; color: var(--color-text-primary); white-space: nowrap }


/* ---- Sidebar (docs demo) ------------------------------------------------ */
/* Every selector is prefixed .sb so the component outranks prose defaults. */
.sb { --sb-w: 256px; --sb-rail: 64px; position: relative; display: grid; grid-template-columns: var(--sb-w) 1fr; grid-template-rows: minmax(0, 1fr); height: 460px; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface) }
.sb[data-mode="rail"] { grid-template-columns: var(--sb-rail) 1fr }
.sb[data-mode="drawer"] { grid-template-columns: 1fr }
.sb .sb__side { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--color-border); background: var(--color-surface) }
.sb[data-mode="drawer"] .sb__side { position: absolute; z-index: var(--z-index-modal); inset: 0 auto 0 0; width: var(--sb-w); border-right: 1px solid var(--color-border) }
.sb[data-mode="drawer"] .sb__side[hidden] { display: none }
.sb[data-mode="drawer"] .sb__side:not([hidden]) { animation: ss-slide-in 180ms var(--ease-enter) both }
@keyframes ss-slide-in { from { transform: translateX(-100%) } to { transform: none } }
@media (prefers-reduced-motion: reduce) { .sb[data-mode="drawer"] .sb__side:not([hidden]) { animation: none } }
.sb .sb__scrim { position: absolute; inset: 0; z-index: var(--z-index-overlay); background: rgba(51,51,51,.4) }
.sb .sb__scrim[hidden] { display: none }

.sb .sb__head { display: flex; align-items: stretch; border-bottom: 1px solid var(--color-border) }
.sb .sb__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.sb .sb__org { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer }
.sb .sb__org:hover { background: var(--color-surface-muted) }
.sb .sb__org:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }
.sb .sb__orgmark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface) }
.sb .sb__orgtxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px }
.sb .sb__orgname { display: block; max-width: 100%; font-size: var(--text-sm); font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sb .sb__orgmeta { display: block; font-size: var(--text-eyebrow); line-height: 1.2; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow) }

.sb .sb__ctx { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--color-border); background: var(--color-surface-muted) }
.sb .sb__ctx[hidden] { display: none }
.sb .sb__back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 28px; padding: 0 6px 0 4px; margin-left: -4px; border-radius: var(--radius-sm); color: var(--color-text-secondary); font-size: var(--text-caption); text-decoration: none }
.sb .sb__back:hover { background: var(--color-surface); color: var(--color-text-primary) }
.sb .sb__back:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }
.sb .sb__back svg { width: 14px; height: 14px }
.sb .sb__ctxtxt { min-width: 0 }
.sb .sb__ctxname { font-size: var(--text-sm); font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sb .sb__ctxmeta { font-size: var(--text-caption); color: var(--color-text-muted) }
.sb .sb__act[hidden], .sb .sb__nav[hidden] { display: none }
.sb .sb__seclbl { padding: 14px 10px 4px; font-size: var(--text-eyebrow); font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted) }

.sb .sb__act { padding: 12px 12px 4px }
.sb .sb__actbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: var(--color-surface-inverse); color: var(--color-text-inverse); font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer }
.sb .sb__actbtn:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px }

.sb .sb__nav { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 8px }
.sb .sb__nav ul { margin: 0; padding: 0; list-style: none }
.sb .sb__link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--color-text-secondary); font-size: var(--text-sm); text-decoration: none }
.sb .sb__link:hover { background: var(--color-surface-muted); color: var(--color-text-primary) }
.sb .sb__link:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }
.sb .sb__link[aria-current="page"] { background: var(--color-surface-muted); color: var(--color-text-primary); font-weight: 600 }
.sb .sb__link[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 1px; background: var(--color-primary) }
.sb .sb__ico { flex: none; display: grid; place-items: center; width: 20px; height: 20px }
.sb .sb__ico svg { width: 18px; height: 18px }
.sb .sb__t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sb .sb__count { margin-left: auto; font-size: var(--text-caption); font-variant-numeric: tabular-nums; color: var(--color-text-muted) }

.sb .sb__gbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--color-text-secondary); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer }
.sb .sb__gbtn:hover { background: var(--color-surface-muted); color: var(--color-text-primary) }
.sb .sb__gbtn:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }
.sb .sb__gchev { margin-left: auto; display: grid; place-items: center; color: var(--color-text-muted) }
.sb .sb__gchev svg { width: 16px; height: 16px }
.sb .sb__nav .sb__sub { padding-left: 20px }
.sb .sb__sub[hidden] { display: none }

.sb .sb__foot { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--color-border); padding: 8px }
.sb .sb__acct { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer }
.sb .sb__acct:hover { background: var(--color-surface-muted) }
.sb .sb__acct:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }
.sb .sb__avatar { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--color-primary-subtle); color: var(--color-text-primary); font-size: var(--text-caption); font-weight: 700 }
.sb .sb__out { margin: 0 }
.sb .sb__signout { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--color-destructive); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer }
.sb .sb__signout:hover { background: var(--color-destructive-subtle) }
.sb .sb__signout:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }
.sb .sb__collapse { flex: none; display: grid; place-items: center; width: 46px; border: 0; border-left: 1px solid var(--color-border); background: none; color: var(--color-text-muted); font: inherit; cursor: pointer }
.sb .sb__collapse:hover { background: var(--color-surface-muted); color: var(--color-text-primary) }
.sb .sb__collapse:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }

/* Rail: labels leave the page but never the accessibility tree. */
.sb[data-mode="rail"] .sb__t,
.sb[data-mode="rail"] .sb__orgtxt,
.sb[data-mode="rail"] .sb__ctxtxt,
.sb[data-mode="rail"] .sb__seclbl,
.sb[data-mode="rail"] .sb__gchev,
.sb[data-mode="rail"] .sb__count { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.sb[data-mode="rail"] .sb__link,
.sb[data-mode="rail"] .sb__gbtn,
.sb[data-mode="rail"] .sb__signout,
.sb[data-mode="rail"] .sb__back,
.sb[data-mode="rail"] .sb__acct { justify-content: center; padding: 0; gap: 0 }
.sb[data-mode="rail"] .sb__head { flex-direction: column }
.sb[data-mode="rail"] .sb__collapse { width: 100%; min-height: 40px; border-left: 0; border-top: 1px solid var(--color-border) }
.sb[data-mode="rail"] .sb__back { align-self: stretch; margin: 0 }
.sb[data-mode="rail"] .sb__ctx { padding: 8px 6px }
.sb[data-mode="rail"] .sb__org { justify-content: center; padding: 8px 0 }
.sb[data-mode="rail"] .sb__actbtn .sb__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
.sb[data-mode="rail"] .sb__nav .sb__sub { padding-left: 0 }
.sb[data-mode="rail"] .sb__link[aria-current="page"]::before { left: 4px }

.sb .sb__main { min-width: 0; display: flex; flex-direction: column; background: var(--color-surface-muted) }
.sb .sb__top { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; border-bottom: 1px solid var(--color-border); background: var(--color-surface) }
.sb .sb__burger { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; cursor: pointer }
.sb[data-mode="drawer"] .sb__burger { display: flex }
.sb .sb__burger:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }
.sb .sb__crumb { font-size: var(--text-sm); color: var(--color-text-secondary) }
.sb .sb__body { flex: 1; min-height: 0; padding: 18px; overflow: auto }
.sb .sb__ph { height: 100%; border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); display: grid; place-items: center; color: var(--color-text-muted); font-size: var(--text-sm) }

/* Sidebar: role + account popup */
.sb .sb__acctwrap { position: relative }
.sb .sb__orgwrap { position: relative; flex: 1; min-width: 0 }
.sb .sb__orglist { position: absolute; z-index: var(--z-index-dropdown); left: 8px; right: 8px; top: calc(100% + 2px); margin: 0; padding: 6px; list-style: none; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-popover) }
.sb .sb__orglist[hidden] { display: none }
.sb .sb__opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--color-text-secondary); cursor: pointer }
.sb .sb__opt:hover, .sb .sb__opt.is-active { background: var(--color-surface-muted); color: var(--color-text-primary) }
.sb .sb__opt[aria-selected="true"] { color: var(--color-text-primary); font-weight: 500 }
.sb .sb__optrole { flex: none; font-size: var(--text-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted) }
.sb .sb__orglist:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px }
.sb[data-mode="rail"] .sb__orglist { left: 8px; right: auto; width: 220px }
.sb .sb__roleinit { display: none }
.sb .sb__role { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--color-primary-subtle); color: var(--color-text-primary); font-size: var(--text-eyebrow); font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; line-height: 1 }
.sb .sb__acctxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start }
.sb .sb__acctname { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sb .sb__menu { position: absolute; z-index: var(--z-index-dropdown); left: 8px; right: 8px; bottom: calc(100% + 6px); padding: 6px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-popover) }
.sb .sb__menu[hidden] { display: none }
.sb .sb__menu ul { margin: 0; padding: 0; list-style: none }
.sb .sb__mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--color-text-secondary); font: inherit; font-size: var(--text-sm); text-align: left; text-decoration: none; cursor: pointer }
.sb .sb__mi:hover { background: var(--color-surface-muted); color: var(--color-text-primary) }
.sb .sb__mi:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px }
.sb .sb__mi--danger { color: var(--color-destructive) }
.sb .sb__mi--danger:hover { background: var(--color-destructive-subtle); color: var(--color-destructive) }
.sb .sb__mdiv { height: 1px; margin: 6px 4px; background: var(--color-border) }
.sb .sb__mhead { padding: 8px 10px 6px; border-bottom: 1px solid var(--color-border); margin: -6px -6px 6px }
.sb .sb__mname { font-size: var(--text-sm); font-weight: 600 }
.sb .sb__memail { font-size: var(--text-caption); color: var(--color-text-muted) }
.sb[data-mode="rail"] .sb__menu { left: 8px; right: auto; width: 220px }
.sb[data-mode="rail"] .sb__acctxt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
.sb[data-mode="rail"] .sb__roleinit { display: block }
.sb[data-mode="rail"] .sb__role { gap: 0; padding: 0; width: 18px; justify-content: center }
.sb[data-mode="rail"] .sb__acct { gap: 4px }
