/* =====================================================================================================
   Laramin Help Center · design system (help.css)
   Source of truth: the design board in the KB repo, docs/designs/project/Components.dc.html and
   HeaderVariants.dc.html, plus the board fix spec. Use these classes; don't invent new ones for the same
   job. Page-only layout goes in public/css/pages/<area>.css.

   COMPONENT INDEX  (block · elements · modifiers / states)
   -----------------------------------------------------------------------------------------------------
   Tokens          :root custom properties: --c-* colours, --fs-* sizes, --lh-* line-heights, --sp-* spacing,
                   --r-* radius, --shadow-1/2/3, --font-body/head/mono, --container, --measure (58ch reading),
                   --measure-prose (the 17px prose's 58ch, for a 16px grid column)
   Base            body (Roboto 16/1.5), h1–h4 (Nunito), a, strong, :focus-visible ring, mark (search match)
                   .on-dark on every navy band (white focus ring + light placeholders); .on-light on a white
                   panel inside a navy band (menus, the phone sheet, the hero search field)
   Type helpers    .t-display (46) · .t-title (36) · .t-page-title (30) · .t-h2 (24) · .t-h3 (20)
                   · .t-card-title (18) · .lead (18/1.7) · .text-muted · .text-small (14) · .caps-label (12 caps)
                   · .mono-meta (mono 12) · .ui-label (bold #0a1f44 app labels; paths "A › B")
   Layout          .container (1320 content + 24px gutters; alias .wrap) · .page (32px 0 80px) · .stack (+ --gap)
                   · .cluster · .docs-layout (__rail, __main, __aside: a grid; main = --measure-prose + the card's
                   80px, about 634px (780px for an API reference or a wide table: .ep--d1+ or .kb-table--wide; 840px
                   from 1440px for .kb-table--wider); rail and aside share the rest, so the columns meet the header's
                   edges; 1024–1199px aside under the rail; one column below 1024px)
                   · .section (__head, __title, __text, __link)
   A11y            .skip-link · .sr-only
   Icons           .icon (from @icon('name')) · .icon--mirror (flips in RTL: chevrons/arrows)
   Buttons         .btn + --primary | --on-dark | --secondary | --ghost | --danger | --search
                   sizes: (default 44) | --lg (48, auth/forms) | --xl (56, hero) · --compact (14px text: headers,
                   table rows) · --block (full width) · --row (table row action, min-width 96) · [disabled]
   Forms           .form-group · .label (+ .label__optional) · .field (48px box; wraps input/select/textarea)
                   + --44 | --textarea | --select | --otp | --error | --disabled | --on-dark · .field__prefix
                   · .field__icon · .field__kbd · .help · .field-error (role="alert") · .check (checkbox row)
                   · .form-error (top-of-form error summary) · .divider-text ("or use another Laramin")
   Badges          .badge + --guide | --concept | --troubleshoot | --reference | --space | --version
   Status badges   .status-badge + --new | --changed | --deprecated | --restricted | --machine | --reviewed
   State pills     .state-pill + --enabled | --disabled | --on | --not-set-up   (admin tables)
   Chips           .chip (36px pill in a 44px hit area; aria-pressed="true" or .is-selected) + --link (44px
                   search suggestion) | --on-dark · .chip__count
   Callouts        .callout + --tip | --careful | --danger | --module · .callout__icon · .callout__body
                   · .callout__label   (the renderer writes these; use the same markup by hand if needed)
   Notices         .notice + --info | --success | --warning | --error | --language (fallback + machine
                   translated, globe) | --restricted (navy, lock) · .notice__icon · .notice__body
                   · .notice__details (restricted "Why can I see this?" <details>) · .flash > .container.flash__inner
                   (page flash band under the header; + --error)
   Code            code (chip; breaks only at the renderer's <wbr>, board Components › 16) · pre (block) · kbd
                   · .code--nowrap (16 characters or fewer) · .tok-ph inside a chip (placeholder)
   Code viewer     .code-card (the renderer writes it for every code block; board Components › 14) · __head · __title
                   · __sep · __lang · __copy (+ __copy-idle, __copy-done; .is-copied) · __error (role="alert")
                   · __body · __scroll (+ --numbered) · __gutter (line numbers, over 10 lines) · __fade (--start/--end;
                   .has-more-start/-end) · __ring (focus) · __hint · syntax roles .tok-k .tok-s .tok-f .tok-n .tok-p .tok-c .tok-ph
                   · --dark (dark tokens, not used yet: the site is light only)
   Applies-to      dl.applies > div (dt caps label above dd value) · div.applies__wide (spans both columns)
   Article prose   .prose (17/1.7, 58ch measure, h2/h3 rhythm, underlined links, tables, images)
                   · .prose > ol and .steps = numbered steps (32px navy discs, nested content aligned)
                   · .table-scroll (renderer wraps prose tables; a container; scrolls sideways with edge shadows,
                   and is focusable, only when the columns' floors don't fit) · .kb-table (TableRenderer: code columns
                   natural width, short columns their own width, prose columns never under --kb-prose, 110px = 14ch of
                   the cell text, held on th.kb-table__prose; widths on <col> in cqw; headers wrap in their cell, code
                   in a header keeps the header style; --cards + .table-scroll--cards: 3+ columns, stacked cards on
                   phones with .kb-table__label; --wide (+ .table-scroll--wide): too wide for the reading column, so
                   the page gets the 780px main; --wider: over 690px, 840px main from 1440px; either is stacked cards
                   wherever its wrapper is narrower than that, by container query)
   Endpoint table  .ep-table > table.ep (+ --d0…--d3 detail columns; TableRenderer writes it for Method | Path tables;
                   board Components › 15) · __method · __badge · __path · __line · __detail (__label, __value) · __desc
                   · __copy (+ .is-copied, __icon, __tip) · .ep-badge (+ --get | --post | --put | --patch | --delete)
                   · .ep-path (__pre muted prefix, __seg, __q, __more)
   Cards           .card (+ --link hover, --stat, --flat) · .card__icon (+ --module | --restricted)
                   · .card__body · .card__title · .card__text · .card__meta · .card__stat · .card-grid (+ --2/--3/--4)
                   · .pager (__link, __label, __title; --next)
   Lists           .row-list · .row-list__item (link rows with 44px+ height, chevron end)
   Navigation      .breadcrumb (ol > li, current = [aria-current="page"]) · .rail (__group, __link, __title)
                   · .toc (__title, __link; current = [aria-current="true"] or .is-current)
                   · .tabs (__item; current = [aria-current] or [aria-selected="true"]) · .stepper (__step, --done, --current)
                   · .disclosure (<details> box with summary: phone "On this page" / "In this section")
   Menus           .menu (dropdown panel) · .menu__heading · .menu__list · .menu__identity · .menu__item · .menu__sep · .avatar (+ --lg, --mint)
   Header          .site-header (+ --light signed-in | --admin) · .site-header__inner · .brand (__tile, __name,
                   __logo, __org, __divider, __badge) · .header-search (+ --filled, __clear) · .site-nav (__link) · .header-actions
                   · .lang-menu · .account-menu · .account-chip · .header-icon-btn · .mobile-menu (sheet)
   Footer          .site-footer (__inner, __links)
   Empty state     .empty (__icon, __title, __text, __actions)
   Tables          .table-wrap · .table (th caps head, .num right + tabular figures, .table__actions)
   Dialog          .dialog (__title, __text, __actions) on <dialog>; ::backdrop scrim
   Admin bits      .key-block (mono key in groups) · .qr-box
   Phone           max-width 1023px: phone header (56px) + menu sheet; max-width 640px: 16px gutters,
                   smaller titles, stacked docs layout
   RTL             [dir="rtl"]: Noto Sans Arabic / Noto Kufi Arabic, reading 1.9, headings 1.4, no tracking,
                   .icon--mirror flips
   ===================================================================================================== */

:root {
    /* Text */
    --c-strong: #0a1f44;
    --c-body: #364a63;
    --c-muted: #526484;
    --c-on-navy: #c9d6ef;
    /* Brand */
    --c-primary: #0b3175;
    --c-navy: #0a1f44;
    /* Green */
    --c-green-fill: #0fac81;
    --c-green: #07523d;
    --c-green-tint: #e4f6f0;
    --c-green-border: #bfe8d9;
    --c-mint: #6fe0bd;
    /* Amber */
    --c-amber: #6b4700;
    --c-amber-tint: #fdf1d6;
    --c-highlight: #fff0b8;
    /* Red */
    --c-red: #a1271b;
    --c-red-tint: #fbe5e3;
    /* Blue tints */
    --c-selected: #e8eef9;
    --c-info: #e6f1fb;
    /* Surfaces */
    --c-surface: #ffffff;
    --c-ground: #f5f6fa;
    --c-subtle: #eef0f5;
    /* Borders */
    --c-border: #e3e7f0;
    --c-border-strong: #dbdfea;
    --c-control: #7d89a3;
    /* On navy */
    --c-navy-field: rgba(255, 255, 255, .10);
    --c-navy-border: rgba(255, 255, 255, .35);
    --c-navy-divider: rgba(255, 255, 255, .16);
    --c-scrim: rgba(10, 31, 68, .6);
    /* Code viewer: the one new colour (names; a lighter step of the primary). The other roles reuse the text
       tokens above; see "Code viewer" below. */
    --c-code-name: #1d5bbf;

    /* Type */
    --font-body: Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans Kannada", "Noto Sans Malayalam", "Noto Sans Tamil", "Noto Sans Telugu", system-ui, sans-serif;
    --font-head: Nunito, "Noto Kufi Arabic", var(--font-body);
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-15: 15px; --fs-16: 16px; --fs-17: 17px; --fs-18: 18px;
    --fs-20: 20px; --fs-24: 24px; --fs-30: 30px; --fs-36: 36px; --fs-46: 46px;
    --lh-head: 1.2;
    --lh-ui: 1.5;
    --lh-read: 1.7;
    --track-caps: .06em;
    --track-title: -.02em;

    /* Space, radius, shadow, sizes */
    --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-20: 20px; --sp-24: 24px; --sp-32: 32px;
    --sp-40: 40px; --sp-48: 48px; --sp-64: 64px; --sp-80: 80px;
    --r-code: 4px; --r-badge: 6px; --r-control: 8px; --r-card: 12px; --r-dialog: 16px; --r-pill: 999px;
    --shadow-1: 0 1px 2px rgba(10, 31, 68, .05);
    --shadow-2: 0 8px 24px rgba(10, 31, 68, .08);
    --shadow-3: 0 24px 60px rgba(10, 31, 68, .25);
    --container: 1320px;
    --gutter: 24px;
    --measure: 58ch;
    /* The measure of the 17px article prose, for a box that holds it (a grid column) but has the 16px body size:
       ch resolves where the property is used, so 58ch at 16px * 17 / 16 = 58ch at 17px (about 71 characters). */
    --measure-prose: calc(var(--measure) * 17 / 16);
    --header-h: 64px;
}

/* ---------------------------------------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--c-ground); color: var(--c-body);
    font: 400 var(--fs-16)/var(--lh-ui) var(--font-body);
}
body > main, .site-main { flex: 1 0 auto; }
.site-main:focus { outline: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); color: var(--c-strong); line-height: var(--lh-head); }
h1 { font-weight: 800; font-size: var(--fs-36); letter-spacing: var(--track-title); }
h2 { font-weight: 800; font-size: var(--fs-24); }
h3 { font-weight: 700; font-size: var(--fs-20); }
h4 { font-weight: 700; font-size: var(--fs-18); }
p { margin: 0; }
a { color: var(--c-primary); }
a:hover { color: var(--c-strong); }
strong, b { font-weight: 700; }
img, svg { vertical-align: middle; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.on-dark :focus-visible { outline-color: #ffffff; }
.on-dark .on-light :focus-visible { outline-color: var(--c-primary); }
/* Rows inside a box that clips (overflow hidden / scrolling): draw the ring inside so it isn't cut off. */
.art-row:focus-visible, .row-list__item:focus-visible, .rail__link:focus-visible, .rail__sub:focus-visible,
.tabs__item:focus-visible, .family-list__item > summary:focus-visible { outline-offset: -2px; }
::placeholder { color: var(--c-muted); opacity: 1; }
.on-dark ::placeholder { color: var(--c-on-navy); }
.on-dark .on-light ::placeholder { color: var(--c-muted); }
mark { background: var(--c-highlight); color: var(--c-strong); font-weight: 700; text-decoration: underline; text-decoration-color: #8a6100; text-underline-offset: 2px; }

/* --------------------------------------------------------------------------------------- Type helpers */
.t-display { font: 800 var(--fs-46)/var(--lh-head) var(--font-head); letter-spacing: var(--track-title); color: var(--c-strong); }
.t-title { font: 800 var(--fs-36)/var(--lh-head) var(--font-head); letter-spacing: var(--track-title); color: var(--c-strong); }
.t-page-title { font: 800 var(--fs-30)/var(--lh-head) var(--font-head); letter-spacing: var(--track-title); color: var(--c-strong); }
.t-h2 { font: 800 var(--fs-24)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.t-h3 { font: 700 var(--fs-20)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.t-card-title { font: 700 var(--fs-18)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.on-dark .t-display, .on-dark .t-title, .on-dark .t-page-title, .on-dark .t-h2 { color: #ffffff; }
.lead { font-size: var(--fs-18); line-height: var(--lh-read); color: var(--c-muted); max-width: var(--measure); }
.on-dark .lead { color: var(--c-on-navy); }
.text-muted { color: var(--c-muted); }
.text-small { font-size: var(--fs-14); line-height: var(--lh-ui); }
.caps-label { font-size: var(--fs-12); line-height: var(--lh-ui); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); }
.mono-meta { font-family: var(--font-mono); font-size: var(--fs-12); line-height: var(--lh-ui); color: var(--c-muted); }
.ui-label { font-weight: 700; color: var(--c-strong); }

/* ------------------------------------------------------------------------------------------- Layout */
.container, .wrap { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.page { padding-block: var(--sp-32) var(--sp-80); }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 8px); }

/* Rail + content + "On this page" (Article). The main column is the reading measure plus the article card's
   40px sides (--docs-main = --measure-prose + 80px, about 634px), so the text runs to its card's edge with no
   empty band; the rail and the aside share the rest equally, so the three columns span the container and line up
   with the header's edges. 1024–1199px: two columns, the aside under the rail (it
   stays sticky there). Below 1024px: one column (the article page folds the rail and aside into menus). */
.docs-layout {
    --docs-main: calc(var(--measure-prose) + 2 * var(--sp-40));
    display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: var(--sp-32);
}
.docs-layout__rail { display: flex; flex-direction: column; gap: var(--sp-12); min-width: 0; }
.docs-layout__main { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-24); }
.docs-layout__aside { display: flex; flex-direction: column; gap: var(--sp-24); min-width: 0; }
.docs-layout__rail, .docs-layout__aside { position: sticky; top: var(--sp-24); }
@media (min-width: 1024px) {
    .docs-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-rows: auto 1fr; row-gap: var(--sp-24); }
    .docs-layout__rail { grid-column: 1; grid-row: 1; }
    .docs-layout__main { grid-column: 2; grid-row: 1 / span 2; }
    .docs-layout__aside { grid-column: 1; grid-row: 2; }
}
@media (min-width: 1200px) {
    .docs-layout { grid-template-columns: minmax(0, 1fr) minmax(0, var(--docs-main)) minmax(0, 1fr); grid-template-rows: auto; }
    .docs-layout__main { grid-row: 1; }
    .docs-layout__aside { grid-column: 3; grid-row: 1; }
    /* An API reference whose endpoint tables have detail columns (Credential, Limit…) keeps the board's 780px main
       column, so those tables get the 698px they're drawn at (board DeveloperReference); its prose keeps the measure.
       So does an article with a table too wide for the reading column (TableRenderer adds .kb-table--wide when the
       columns' floors add up to more than its 550px): the board draws tables at 698px too. */
    .docs-layout:has(.ep:not(.ep--d0)), .docs-layout:has(.kb-table--wide) { --docs-main: 780px; }
}
/* A table that needs more than 690px (.kb-table--wider: the error codes) gets 840px from 1440px up, where the rail
   and the aside keep 208px; below that it is stacked cards. */
@media (min-width: 1440px) {
    .docs-layout:has(.kb-table--wider) { --docs-main: 840px; }
}

/* A page section: H2 + one-line description, optional "Browse all" link at the end. */
.section + .section { margin-top: var(--sp-48); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-8) var(--sp-24); margin-bottom: var(--sp-24); }
.section__title { font: 800 var(--fs-24)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.section__text { margin-top: var(--sp-8); color: var(--c-muted); max-width: var(--measure); }
.section__link { font-size: var(--fs-14); font-weight: 500; }

/* ---------------------------------------------------------------------------------------------- A11y */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
    position: absolute; z-index: 100; inset-inline-start: var(--sp-16); top: -100px;
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--sp-16);
    background: #ffffff; color: var(--c-primary); border-radius: var(--r-control); box-shadow: var(--shadow-2);
    font-weight: 500; text-decoration: underline;
}
.skip-link:focus { top: var(--sp-8); }

/* --------------------------------------------------------------------------------------------- Icons */
.icon { flex: none; }
[dir="rtl"] .icon--mirror { transform: scaleX(-1); }

/* ------------------------------------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
    height: 44px; padding: 0 var(--sp-16); border: 1px solid transparent; border-radius: var(--r-control);
    font: 500 var(--fs-16)/1 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
    background: transparent; color: var(--c-primary);
}
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: #ffffff; }
.btn--primary:hover { background: var(--c-navy); border-color: var(--c-navy); color: #ffffff; }
.btn--on-dark { background: #ffffff; border-color: #ffffff; color: var(--c-primary); }
.btn--on-dark:hover { background: var(--c-selected); border-color: var(--c-selected); color: var(--c-primary); }
.btn--secondary { background: #ffffff; border-color: var(--c-control); color: var(--c-primary); }
.btn--secondary:hover { background: var(--c-subtle); color: var(--c-primary); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--c-primary); }
.btn--ghost:hover { background: var(--c-subtle); color: var(--c-primary); }
.btn--danger { background: #ffffff; border-color: var(--c-red); color: var(--c-red); }
.btn--danger:hover { background: var(--c-red-tint); color: var(--c-red); }
.btn--search { background: var(--c-green-fill); border-color: var(--c-green-fill); color: var(--c-strong); }
.btn--search:hover { box-shadow: inset 0 0 0 1px var(--c-strong); color: var(--c-strong); }
.btn--lg { height: 48px; }
.btn--xl { height: 56px; padding: 0 var(--sp-24); }
.btn--compact { font-size: var(--fs-14); }
.btn--block { display: flex; width: 100%; }
.btn--row { min-width: 96px; font-size: var(--fs-14); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--c-subtle); border-color: var(--c-border-strong); color: var(--c-muted); cursor: not-allowed; }
.btn--ghost:disabled { background: transparent; border-color: transparent; }

/* --------------------------------------------------------------------------------------------- Forms */
.form-group { display: flex; flex-direction: column; gap: var(--sp-8); }
.form-group + .form-group { margin-top: var(--sp-20); }
.label { font-size: var(--fs-14); line-height: var(--lh-ui); font-weight: 500; color: var(--c-strong); }
.label__optional { font-weight: 400; color: var(--c-muted); }
.field {
    position: relative; display: flex; align-items: center; height: 48px; width: 100%;
    background: #ffffff; border: 1px solid var(--c-control); border-radius: var(--r-control); overflow: hidden;
}
.field:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary); }
.field input, .field select, .field textarea {
    flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 var(--sp-12); border: 0; background: transparent;
    font-size: var(--fs-16); color: var(--c-strong); border-radius: 0;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; }
.field__prefix {
    align-self: stretch; display: flex; align-items: center; padding: 0 var(--sp-12);
    background: var(--c-subtle); border-inline-end: 1px solid var(--c-border-strong);
    font-family: var(--font-mono); font-size: var(--fs-13); color: var(--c-muted);
}
.field__icon { margin-inline-start: var(--sp-12); color: var(--c-muted); }
.field__icon + input { padding-inline-start: var(--sp-8); }
.field__kbd { margin-inline-end: var(--sp-12); }
.field--44 { height: 44px; }
.field--textarea { height: auto; }
.field--textarea textarea { min-height: 96px; padding: var(--sp-12); line-height: var(--lh-ui); resize: vertical; }
.field--select select { appearance: none; -webkit-appearance: none; padding-inline-end: 40px; cursor: pointer; }
.field--select::after {
    content: ""; position: absolute; inset-inline-end: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23364a63' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.field--otp { max-width: 240px; }
.field--otp input { font-family: var(--font-mono); font-size: var(--fs-20); letter-spacing: .15em; }
.field--error { border-color: var(--c-red); }
.field--error:focus-within { border-color: var(--c-red); }
.field--disabled { background: var(--c-subtle); border-color: var(--c-border-strong); }
.field--disabled input { color: var(--c-muted); cursor: not-allowed; }
.field--on-dark { background: var(--c-navy-field); border-color: var(--c-navy-border); }
.field--on-dark input { color: #ffffff; }
.on-dark .field:focus-within { border-color: #ffffff; box-shadow: 0 0 0 2px #ffffff; }
.on-dark .on-light .field:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary); }
.help { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); }
.field-error { display: flex; gap: var(--sp-8); align-items: flex-start; font-size: var(--fs-14); line-height: var(--lh-ui); font-weight: 500; color: var(--c-red); }
.field-error .icon { margin-top: 3px; }
.form-error { display: flex; gap: var(--sp-12); align-items: flex-start; padding: var(--sp-16); border-radius: var(--r-card); background: var(--c-red-tint); color: var(--c-red); }
.form-error a { color: var(--c-red); }
.check { display: flex; gap: var(--sp-12); align-items: flex-start; min-height: 44px; padding-block: var(--sp-12); color: var(--c-strong); cursor: pointer; }
.check input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 2px 0 0;
    border: 2px solid var(--c-control); border-radius: var(--r-code); background: #ffffff; cursor: pointer;
}
.check input[type="checkbox"]:checked {
    border-color: var(--c-primary);
    background: var(--c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.check input[type="checkbox"]:disabled { border-color: var(--c-border-strong); background-color: var(--c-subtle); cursor: not-allowed; }
.check:has(input:disabled) { color: var(--c-muted); cursor: not-allowed; }
.divider-text { display: flex; align-items: center; gap: var(--sp-16); font-size: var(--fs-14); color: var(--c-muted); }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--c-border-strong); }

/* -------------------------------------------------------------------------------- Badges and pills */
.badge {
    display: inline-flex; align-items: center; gap: var(--sp-4); align-self: flex-start; flex: none;
    padding: 2px 8px; border-radius: var(--r-badge); white-space: nowrap;
    font: 500 var(--fs-12)/var(--lh-ui) var(--font-body); background: var(--c-subtle); color: var(--c-body);
}
.badge--guide { background: var(--c-selected); color: var(--c-primary); }
.badge--concept { background: var(--c-green-tint); color: var(--c-green); }
.badge--troubleshoot { background: var(--c-amber-tint); color: var(--c-amber); }
.badge--reference, .badge--space { background: var(--c-subtle); color: var(--c-body); }
.badge--version { font-family: var(--font-mono); color: var(--c-muted); border-radius: var(--r-code); }

.status-badge {
    display: inline-flex; align-items: center; gap: var(--sp-4); align-self: flex-start; flex: none;
    padding: 2px 8px; border: 1px solid var(--c-control); border-radius: var(--r-pill); white-space: nowrap;
    font: 500 var(--fs-12)/var(--lh-ui) var(--font-body); background: #ffffff; color: var(--c-strong);
}
.status-badge--deprecated { border-color: var(--c-red); color: var(--c-red); }
.status-badge--restricted { background: var(--c-navy); border-color: var(--c-navy); color: #ffffff; }
.status-badge--machine { background: var(--c-amber-tint); border-color: var(--c-amber-tint); color: var(--c-amber); }

.state-pill {
    display: inline-flex; align-items: center; gap: var(--sp-8); padding: 2px 8px; border-radius: var(--r-pill);
    font: 500 var(--fs-12)/var(--lh-ui) var(--font-body); white-space: nowrap; background: var(--c-subtle); color: var(--c-body);
}
.state-pill::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); background: currentColor; }
.state-pill--enabled { background: var(--c-green-tint); color: var(--c-green); }
.state-pill--disabled::before { background: transparent; border: 1.5px solid var(--c-muted); }
.state-pill--on, .state-pill--not-set-up { gap: var(--sp-4); }
.state-pill--on::before, .state-pill--not-set-up::before { display: none; }
.state-pill--on { background: var(--c-green-tint); color: var(--c-green); }
.state-pill--not-set-up { background: var(--c-amber-tint); color: var(--c-amber); }

/* ------------------------------------------------------------------------------------------- Chips */
.chip {
    position: relative; display: inline-flex; align-items: center; gap: var(--sp-4); height: 36px; margin-block: 4px;
    padding: 0 var(--sp-16); border: 1px solid var(--c-control); border-radius: var(--r-pill); background: #ffffff;
    font: 500 var(--fs-14)/1 var(--font-body); color: var(--c-body); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.chip::after { content: ""; position: absolute; inset: -5px 0; } /* 44px hit area */
.chip:hover { background: var(--c-subtle); color: var(--c-strong); }
.chip__count { font-weight: 400; color: var(--c-muted); }
.chip[aria-pressed="true"], .chip.is-selected { background: var(--c-primary); border-color: var(--c-primary); color: #ffffff; }
.chip[aria-pressed="true"] .chip__count, .chip.is-selected .chip__count { color: var(--c-on-navy); }
.chip--link { height: 44px; margin-block: 0; color: var(--c-primary); }
.chip--link::after { display: none; }
.chip--on-dark { background: transparent; border-color: var(--c-navy-border); color: #ffffff; }
.chip--on-dark:hover { background: var(--c-navy-field); color: #ffffff; }
.chip--on-dark[aria-pressed="true"], .chip--on-dark.is-selected { background: #ffffff; border-color: #ffffff; color: var(--c-strong); }

/* ---------------------------------------------------------------------------------------- Callouts */
.callout {
    display: flex; gap: var(--sp-12); align-items: flex-start; max-width: var(--measure);
    padding: var(--sp-16) var(--sp-20); border-radius: var(--r-card);
}
.callout__icon { margin-top: 4px; }
.callout__body { flex: 1; min-width: 0; font-size: var(--fs-16); line-height: var(--lh-read); }
.callout__body > * { margin: 0; }
.callout__body > * + * { margin-top: var(--sp-8); }
.callout__body ul, .callout__body ol { padding-inline-start: var(--sp-24); }
.callout strong { color: inherit; font-weight: 700; }
.callout a { color: inherit; text-decoration: underline; }
.callout--tip { background: var(--c-info); color: var(--c-primary); }
.callout--careful { background: var(--c-amber-tint); color: var(--c-amber); }
.callout--danger { background: var(--c-red-tint); color: var(--c-red); }
.callout--module { background: var(--c-green-tint); color: var(--c-green); }

/* ----------------------------------------------------------------------------------------- Notices */
.notice { display: flex; gap: var(--sp-12); align-items: flex-start; padding: var(--sp-16); border-radius: var(--r-card); font-size: var(--fs-16); line-height: var(--lh-ui); }
.notice__icon { margin-top: 2px; }
.notice__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.notice strong { font-weight: 700; }
.notice a { color: inherit; text-decoration: underline; }
.notice--info { background: var(--c-info); color: var(--c-primary); }
.notice--success { background: var(--c-green-tint); color: var(--c-green); }
.notice--warning { background: var(--c-amber-tint); color: var(--c-amber); }
.notice--error { background: var(--c-red-tint); color: var(--c-red); }
.notice--language { background: var(--c-subtle); color: var(--c-body); }
.notice--language strong { color: var(--c-strong); }
.notice--language a { color: var(--c-primary); }
.notice--restricted { flex-direction: column; gap: var(--sp-12); padding: var(--sp-16) var(--sp-20); background: var(--c-navy); color: #ffffff; }
.notice--restricted .notice__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-12); }
.notice--restricted .notice__lead { display: flex; gap: var(--sp-12); align-items: flex-start; }
.notice--restricted .notice__lead .icon { color: var(--c-mint); margin-top: 2px; }
.notice__details > summary {
    display: inline-flex; align-items: center; gap: var(--sp-8); height: 44px; padding: 0 var(--sp-16); list-style: none;
    border: 1px solid var(--c-navy-border); border-radius: var(--r-control); font-size: var(--fs-14); font-weight: 500; cursor: pointer;
}
.notice__details > summary::-webkit-details-marker { display: none; }
.notice__details[open] > summary .icon--chevron-down { transform: rotate(180deg); }
.notice__reasons { margin: var(--sp-12) 0 0; padding: var(--sp-12) 0 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-8); border-top: 1px solid var(--c-navy-divider); }
.notice__reasons li { display: flex; gap: var(--sp-8); align-items: flex-start; font-size: var(--fs-14); color: var(--c-on-navy); }
.notice__reasons .icon { color: var(--c-mint); margin-top: 3px; }
.notice__reasons strong, .notice__reasons code { color: #ffffff; }
.notice--restricted code { background: transparent; color: #ffffff; padding: 0; }
.flash { background: var(--c-green-tint); color: var(--c-green); border-block: 1px solid var(--c-green-border); }
.flash__inner { display: flex; gap: var(--sp-12); align-items: center; padding-block: var(--sp-12); }
.flash--error { background: var(--c-red-tint); color: var(--c-red); border-color: var(--c-red-tint); }

/* -------------------------------------------------------------------------------------------- Code */
/* Inline code never breaks inside a word (board Components › 16): the renderer (App\Content\Code\InlineToken)
   puts <wbr> after separators; break-word only steps in when nothing else fits, and doesn't shrink table columns.
   A wrapped chip keeps its padding and corners on both lines. 16 characters or fewer get .code--nowrap. */
code, kbd {
    font-family: var(--font-mono); font-size: var(--fs-13); line-height: var(--lh-ui); font-variant-ligatures: none;
    background: var(--c-subtle); color: var(--c-primary); border-radius: var(--r-code); padding: 1px 6px;
    overflow-wrap: break-word; word-break: normal; hyphens: none; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
kbd { color: var(--c-body); }
.code--nowrap { white-space: nowrap; overflow-wrap: normal; }
[dir="rtl"] code { unicode-bidi: isolate; }
/* A placeholder inside an inline chip or an endpoint path: the code viewer's amber, without the block's halo, kept whole
   (nothing breaks inside <…> or {…}, not even at a space). */
:not(pre) > code .tok-ph, .ep-path .tok-ph { box-shadow: none; white-space: nowrap; }
pre {
    margin: 0; padding: var(--sp-12) var(--sp-16); border-radius: var(--r-code); background: var(--c-subtle); color: var(--c-strong);
    font-family: var(--font-mono); font-size: var(--fs-13); line-height: var(--lh-ui); white-space: pre-wrap; overflow-wrap: anywhere;
}
pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
[dir="rtl"] pre { direction: ltr; text-align: left; }

/* ------------------------------------------------------------------------------------- Code viewer */
/* Board Components › 14. Highlighted on the server (App\Content\Code): the HTML arrives with role classes, so the
   palette lives here. Long lines scroll inside the card and never wrap (wrapping changes what a command means);
   print wraps instead. The body is always LTR; the header follows the page (label start, Copy end). No motion. */
.code-card {
    /* Light roles: every one is 4.5:1 or more on the body (and on white inside a callout). */
    --cv-body: var(--c-ground); --cv-body-rgb: 245 246 250; --cv-head: var(--c-subtle); --cv-rule: var(--c-border);
    --cv-border: var(--c-border-strong); --cv-label: var(--c-body); --cv-title: var(--c-strong); --cv-text: var(--c-strong);
    --cv-punct: var(--c-muted); --cv-keyword: var(--c-red); --cv-string: var(--c-green); --cv-literal: var(--c-amber);
    --cv-name: var(--c-code-name); --cv-ph: var(--c-amber); --cv-ph-bg: var(--c-amber-tint); --cv-ring: var(--c-primary);
    --cv-copy-bg: #ffffff; --cv-copy-border: var(--c-control); --cv-copy-text: var(--c-primary);
    --cv-done-bg: var(--c-green-tint); --cv-done: var(--c-green);
    position: relative; min-width: 0; margin: 0; overflow: hidden;
    border: 1px solid var(--cv-border); border-radius: var(--r-card); background: var(--cv-body);
    font-family: var(--font-body); font-size: var(--fs-14); line-height: var(--lh-ui);
}
/* Dark tokens, ready for when the site gets a dark mode (prefers-color-scheme); not used on the light pages. */
.code-card--dark {
    --cv-body: var(--c-navy); --cv-body-rgb: 10 31 68; --cv-head: #192c4f; --cv-rule: #314362; --cv-border: #314362;
    --cv-label: var(--c-on-navy); --cv-title: #ffffff; --cv-text: #ffffff; --cv-punct: var(--c-on-navy); --cv-keyword: #ffa198;
    --cv-string: var(--c-mint); --cv-literal: #ffd47a; --cv-name: #9fc3ff; --cv-ph: #ffd47a; --cv-ph-bg: #41381a; --cv-ring: #ffffff;
    --cv-copy-bg: transparent; --cv-copy-border: #8c96a7; --cv-copy-text: #ffffff; --cv-done-bg: #274961; --cv-done: var(--c-mint);
}
.code-card--dark .code-card__gutter, .code-card--dark .tok-c { color: #8d9dbb; }
/* Inside a callout the body turns white so it stands apart from the tint. */
.callout .code-card { --cv-body: #ffffff; --cv-body-rgb: 255 255 255; }

.code-card__head {
    display: flex; align-items: center; gap: var(--sp-8); min-height: 44px; padding-block: var(--sp-4); padding-inline: var(--sp-16) var(--sp-4);
    background: var(--cv-head); border-bottom: 1px solid var(--cv-rule); color: var(--cv-label); font-size: var(--fs-14); font-weight: 500;
}
.code-card__title { min-width: 0; color: var(--cv-title); overflow-wrap: anywhere; }
.code-card__lang { flex: none; }
.code-card__copy {
    flex: none; margin-inline-start: auto; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
    padding: 0 var(--sp-12); border: 1px solid var(--cv-copy-border); border-radius: var(--r-control); background: var(--cv-copy-bg);
    color: var(--cv-copy-text); font: inherit; font-size: var(--fs-14); font-weight: 500; line-height: 1; cursor: pointer;
}
.code-card__copy:hover { background: var(--c-subtle); }
.code-card__copy:focus-visible { outline-color: var(--cv-ring); }
.code-card__copy[hidden], .code-card__error[hidden] { display: none; }
.code-card__icon { flex: none; }
.code-card__icon--done, .code-card__copy-done, .code-card.is-copied .code-card__icon--copy, .code-card.is-copied .code-card__copy-idle { display: none; }
.code-card.is-copied .code-card__icon--done, .code-card.is-copied .code-card__copy-done { display: inline; }
.code-card.is-copied .code-card__copy { border-color: var(--cv-done); background: var(--cv-done-bg); color: var(--cv-done); }
.code-card__error {
    margin: 0; display: flex; gap: var(--sp-8); align-items: flex-start; padding: var(--sp-8) var(--sp-16);
    background: var(--c-red-tint); border-bottom: 1px solid var(--cv-rule); color: var(--c-red);
}
.code-card__error .icon { margin-top: 2px; }
.code-card__error strong { color: inherit; font-weight: 700; }

.code-card__body { position: relative; }
.code-card .code-card__scroll {
    margin: 0; display: flex; padding: var(--sp-16) 0; overflow-x: auto; border-radius: 0; background: var(--cv-body);
    direction: ltr; text-align: left; unicode-bidi: isolate; white-space: pre; overflow-wrap: normal;
    font-family: var(--font-mono); font-size: var(--fs-13); line-height: 1.7; color: var(--cv-text);
    font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; tab-size: 4;
    scrollbar-width: thin; scrollbar-color: var(--c-control) transparent;
}
/* Focus on a scrollable block: the ring is drawn inside the card (offset -2px) on an overlay, so the sticky
   gutter and the edge fade never cover part of it. */
.code-card .code-card__scroll:focus-visible { outline: none; }
.code-card__ring { position: absolute; inset: 0; z-index: 2; display: none; pointer-events: none; border: 2px solid var(--cv-ring); }
.code-card__scroll:focus-visible ~ .code-card__ring { display: block; }
.code-card .code-card__scroll code {
    flex: 1 0 auto; padding: 0; padding-inline: var(--sp-20); border-radius: 0; background: none; color: inherit;
    font: inherit; white-space: pre; overflow-wrap: normal;
}
.code-card .code-card__scroll--numbered code { padding-inline-start: var(--sp-16); }
.code-card__gutter {
    flex: none; position: sticky; left: 0; z-index: 1; padding-inline: var(--sp-16) var(--sp-12); text-align: right; white-space: pre;
    user-select: none; -webkit-user-select: none; color: var(--cv-punct); background: var(--cv-body); border-right: 1px solid var(--cv-rule);
}
/* The edge fade with a chevron: shown by the page script while there is more to scroll that way. */
.code-card__fade {
    position: absolute; top: 0; bottom: 0; width: 48px; display: none; align-items: center; padding: 0 var(--sp-4);
    pointer-events: none; color: var(--cv-punct);
}
.code-card__fade--end { right: 0; justify-content: flex-end; background: linear-gradient(to right, rgb(var(--cv-body-rgb) / 0), rgb(var(--cv-body-rgb)) 70%); }
.code-card__fade--start { left: var(--cv-gutter, 0px); justify-content: flex-start; background: linear-gradient(to left, rgb(var(--cv-body-rgb) / 0), rgb(var(--cv-body-rgb)) 70%); }
.code-card.has-more-end .code-card__fade--end, .code-card.has-more-start .code-card__fade--start { display: flex; }
/* .code-card .code-card__… beats `.prose p` (the 58ch measure): these lines span the card. */
.code-card .code-card__hint, .code-card .code-card__error { max-width: none; }
.code-card__hint { margin: 0; padding: var(--sp-8) var(--sp-16); border-top: 1px solid var(--cv-rule); background: var(--cv-body); color: var(--c-muted); }

/* Syntax roles. */
.code-card { color: var(--cv-text); }
.tok-k { color: var(--cv-keyword, var(--c-red)); }
.tok-s { color: var(--cv-string, var(--c-green)); }
.tok-f { color: var(--cv-literal, var(--c-amber)); }
.tok-n { color: var(--cv-name, var(--c-code-name)); }
.tok-p { color: var(--cv-punct, var(--c-muted)); }
.tok-c { color: var(--cv-punct, var(--c-muted)); font-style: italic; }
.tok-ph {
    background: var(--cv-ph-bg, var(--c-amber-tint)); color: var(--cv-ph, var(--c-amber)); border-radius: var(--r-code);
    box-shadow: 0 0 0 2px var(--cv-ph-bg, var(--c-amber-tint));
    text-decoration-line: underline; text-decoration-style: dashed; text-decoration-color: currentColor; text-underline-offset: 3px;
}
.code-card__hint .tok-ph { font-family: var(--font-mono); font-size: var(--fs-13); }
[dir="rtl"] .code-card__hint .tok-ph { font-family: inherit; font-size: inherit; }

/* In an article: a card in a numbered step is as wide as the step, not the 58ch text measure. */
.prose li:has(> .code-card) { max-width: none; }

@media (max-width: 640px), (pointer: coarse) {
    .code-card__head { min-height: 52px; }
    .code-card__copy { height: 44px; }
}
@media (max-width: 640px) {
    /* Phone: a card in a step runs under the step number, so the code gets the whole width (board Mobile). */
    .prose > ol > li > .code-card, .steps > li > .code-card { margin-inline-start: calc(-1 * var(--sp-48)); }
}
@media print {
    .code-card .code-card__scroll, .code-card .code-card__scroll code { white-space: pre-wrap; overflow-wrap: anywhere; }
    /* Wrapped lines would no longer match the numbers, so the gutter goes too. */
    .code-card__copy, .code-card__fade, .code-card__error, .code-card__gutter { display: none !important; }
}

/* -------------------------------------------------------------------------------------- Applies-to */
.applies { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: #ffffff; border: 1px solid var(--c-border); border-radius: var(--r-card); overflow: hidden; }
.applies > div { min-width: 0; padding: var(--sp-16) var(--sp-20); display: flex; flex-direction: column; gap: var(--sp-4); border-top: 1px solid var(--c-border); }
.applies > div:nth-child(-n + 2) { border-top: 0; }
.applies > div:nth-child(odd):not(.applies__wide) { border-inline-end: 1px solid var(--c-border); }
.applies > div:nth-child(odd):last-child:not(.applies__wide) { grid-column: 1 / -1; border-inline-end: 0; }
.applies > .applies__wide { grid-column: 1 / -1; }
.applies dt { font-size: var(--fs-12); line-height: var(--lh-ui); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); }
.applies dd { margin: 0; font-size: var(--fs-15); line-height: var(--lh-ui); font-weight: 500; color: var(--c-strong); overflow-wrap: break-word; }
.applies dd strong { font-weight: 700; }
.applies dd code { display: inline-block; max-width: 100%; }

/* ----------------------------------------------------------------------------------- Article prose */
.prose { font-size: var(--fs-17); line-height: var(--lh-read); color: var(--c-body); }
.prose > * { margin: 0; }
.prose > * + * { margin-top: var(--sp-12); }
.prose > h2 { margin-top: var(--sp-40); font-size: var(--fs-24); font-weight: 800; scroll-margin-top: var(--sp-24); }
.prose > h3 { margin-top: var(--sp-32); font-size: var(--fs-20); font-weight: 700; scroll-margin-top: var(--sp-24); }
.prose > h3 + * { margin-top: var(--sp-8); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose p, .prose li, .prose > blockquote { max-width: var(--measure); }
.prose a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--c-strong); }
.prose strong { color: var(--c-strong); }
.prose ul { padding-inline-start: var(--sp-24); }
.prose ul > li + li { margin-top: var(--sp-8); }
.prose li > ul, .prose li > ol { margin-top: var(--sp-8); }
.prose img { display: block; border: 1px solid var(--c-border); border-radius: var(--r-card); }
.prose blockquote { padding-inline-start: var(--sp-16); border-inline-start: 3px solid var(--c-border-strong); color: var(--c-muted); }
.prose hr { border: 0; border-top: 1px solid var(--c-border); margin-block: var(--sp-32); }
/* A table never crushes a column and never spills or clips: when its columns' floors don't fit, it scrolls sideways
   inside this wrapper. Edge shadows show there is more (white covers that travel with the content
   hide each shadow at its end; pure CSS, so they work in RTL and without JavaScript); the page script makes an
   overflowing wrapper focusable, so arrow keys scroll it. The page itself never scrolls sideways. */
.prose .table-scroll {
    overflow-x: auto; container-type: inline-size; border: 1px solid var(--c-border); border-radius: var(--r-card);
    background:
        linear-gradient(#ffffff, #ffffff) left center / 14px 100% no-repeat local,
        linear-gradient(#ffffff, #ffffff) right center / 14px 100% no-repeat local,
        linear-gradient(to right, rgb(10 31 68 / .16), rgb(10 31 68 / 0)) left center / 14px 100% no-repeat scroll,
        linear-gradient(to left, rgb(10 31 68 / .16), rgb(10 31 68 / 0)) right center / 14px 100% no-repeat scroll,
        #ffffff;
    scrollbar-width: thin; scrollbar-color: var(--c-control) transparent;
}
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); line-height: var(--lh-ui); }
.prose th { padding: var(--sp-12) var(--sp-16); text-align: start; background: var(--c-subtle); font-size: var(--fs-12); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); overflow-wrap: break-word; }
.prose td { padding: var(--sp-8) var(--sp-16); border-top: 1px solid var(--c-border); vertical-align: top; }
/* Inline code in a header (`error.type`) or a card label keeps the header's size, weight and colour, without the
   chip; it stays monospace and keeps its case, since a key is case-sensitive. */
.prose th code, .kb-table__label code {
    padding: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; font-weight: inherit;
    text-transform: none; letter-spacing: 0;
}
/* TableRenderer: code columns at their natural width (capped at 45% of the table, several share 80%) and short
   columns at their own width, set on <col> in cqw; the prose columns share the rest by the browser's balance (the
   layout stays automatic) and never get under --kb-prose, held on their header: 14ch of the 14px cell text, in px
   because ch on the 12px header would be narrower. */
.kb-table { --kb-cell-x: 32px; --kb-prose: 110px; }
.prose .kb-table__prose { min-width: calc(var(--kb-prose) + var(--kb-cell-x)); }
.kb-table__label, .kb-table__empty { display: none; }

/* ------------------------------------------------------------------------------------ Endpoint table */
/* Board Components › 15. Written by App\Content\Tables\TableRenderer for a table headed Method | Path: a real
   <table> whose rows are CSS grid (so every element carries its ARIA role). Method 64px · Path takes the rest ·
   detail columns 160px for one, 112px each for more · the last column (the description) runs under the path. */
.ep-table { border: 1px solid var(--c-border); border-radius: var(--r-card); background: #ffffff; overflow: hidden; }
.prose .ep { display: block; width: 100%; border-collapse: collapse; font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-body); }
.ep thead, .ep tbody { display: block; }
.ep tr { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: var(--sp-16); row-gap: var(--sp-4); padding: var(--sp-12) var(--sp-16); }
.ep--d1 tr { grid-template-columns: 64px minmax(0, 1fr) 160px; }
.ep--d2 tr { grid-template-columns: 64px minmax(0, 1fr) repeat(2, 112px); }
.ep--d3 tr { grid-template-columns: 64px minmax(0, 1fr) repeat(3, 112px); }
.ep thead tr { background: var(--c-subtle); }
.prose .ep th { padding: 0; background: none; }
.ep tbody tr { border-top: 1px solid var(--c-border); }
.ep tbody tr:hover, .ep tbody tr:focus-within { background: var(--c-ground); }
.prose .ep td { padding: 0; border: 0; min-width: 0; }
.ep th:nth-child(1), .ep td:nth-child(1) { grid-column: 1; }
.ep th:nth-child(2), .ep td:nth-child(2) { grid-column: 2; grid-row: 1; }
.ep th:nth-child(3), .ep td:nth-child(3) { grid-column: 3; }
.ep th:nth-child(4), .ep td:nth-child(4) { grid-column: 4; }
.ep th:nth-child(5), .ep td:nth-child(5) { grid-column: 5; }
.ep td.ep__method { grid-row: 1 / span 2; display: flex; flex-direction: column; gap: var(--sp-4); }
.ep td.ep__detail { grid-row: 1 / span 2; padding-top: var(--sp-8); }
.ep td.ep__desc { grid-column: 2; grid-row: 2; }
.ep__badge { min-height: 36px; display: flex; align-items: center; }
.ep__label { display: none; }
/* Method badge: word + colour (never colour alone), the code viewer's syntax colours on their tints. */
.ep-badge {
    display: inline-flex; justify-content: center; min-width: 64px; box-sizing: border-box; padding: 2px var(--sp-8);
    border-radius: var(--r-badge); background: var(--c-subtle); color: var(--c-body);
    font-family: var(--font-mono); font-size: var(--fs-12); font-weight: 500; line-height: var(--lh-ui); font-variant-ligatures: none;
}
.ep-badge--get { background: var(--c-selected); color: var(--c-code-name); }
.ep-badge--post { background: var(--c-green-tint); color: var(--c-green); }
.ep-badge--put, .ep-badge--patch { background: var(--c-amber-tint); color: var(--c-amber); }
.ep-badge--delete { background: var(--c-red-tint); color: var(--c-red); }
/* Path: plain monospace, never a chip; breaks only at the renderer's <wbr> after "/" (segments are nowrap). */
.ep__line { display: flex; align-items: center; gap: var(--sp-8); min-height: 36px; }
.ep .ep-path {
    flex: 0 1 auto; min-width: 0; padding: 0; border-radius: 0; background: none; color: var(--c-strong); font-weight: 500;
    direction: ltr; text-align: left; unicode-bidi: isolate; overflow-wrap: break-word;
}
.ep-path__seg { white-space: nowrap; }
.ep-path__pre { color: var(--c-muted); font-weight: 400; }
.ep-path__q, .ep-path__more { color: var(--c-muted); }
/* Copy: icon only, quiet until hover or focus; a tooltip names it; "Copied" for 2 s (partials/code-script). */
.ep__copy {
    position: relative; flex: none; margin-inline-start: auto; width: 36px; height: 36px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; padding: 0;
    border: 1px solid transparent; border-radius: var(--r-control); background: transparent; color: var(--c-muted); cursor: pointer;
}
.ep__copy[hidden] { display: none; }
.ep__copy:hover, .ep__copy:focus-visible { border-color: var(--c-control); background: #ffffff; color: var(--c-primary); }
.ep__copy.is-copied { border-color: var(--c-green); background: var(--c-green-tint); color: var(--c-green); }
.ep__icon { flex: none; }
.ep__icon--done, .ep__tip-done, .ep__copy.is-copied .ep__icon--copy, .ep__copy.is-copied .ep__tip-idle { display: none; }
.ep__copy.is-copied .ep__icon--done, .ep__copy.is-copied .ep__tip-done { display: inline; }
.ep__tip {
    position: absolute; bottom: calc(100% + var(--sp-8)); inset-inline-end: 0; z-index: 3; display: none; white-space: nowrap;
    padding: var(--sp-4) var(--sp-8); border-radius: var(--r-badge); background: var(--c-navy); color: #ffffff; box-shadow: var(--shadow-2);
    font-family: var(--font-body); font-size: var(--fs-14); font-weight: 500; line-height: var(--lh-ui); pointer-events: none;
}
.ep__copy:hover .ep__tip, .ep__copy:focus-visible .ep__tip, .ep__copy.is-copied .ep__tip { display: block; }

/* A wide table is drawn for the 698px it gets in the 780px main column (.kb-table--wide), or the 758px of the 840px
   one (.kb-table--wider, 1440px and up). Where its wrapper (a container) is narrower, at 1024-1199px, on tablets and
   on phones, it is stacked cards, as every table of 3+ columns is on phones (the rules repeat in the phone block). */
@container (max-width: 689.98px) {
    .kb-table--wide.kb-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .kb-table--wide.kb-table--cards, .kb-table--wide.kb-table--cards tbody, .kb-table--wide.kb-table--cards tr, .kb-table--wide.kb-table--cards td { display: block; }
    .kb-table--wide.kb-table--cards colgroup { display: none; }
    .kb-table--wide.kb-table--cards tr { display: flex; flex-direction: column; gap: var(--sp-8); padding: var(--sp-12) var(--sp-16); border-top: 1px solid var(--c-border); }
    .kb-table--wide.kb-table--cards tbody tr:first-child { border-top: 0; }
    .prose .kb-table--wide.kb-table--cards td { padding: 0; border: 0; font-size: var(--fs-15); line-height: var(--lh-ui); text-align: start; }
    .prose .kb-table--wide.kb-table--cards td:first-child { font-weight: 500; color: var(--c-strong); }
    .kb-table--wide.kb-table--cards .kb-table__label {
        display: block; font-size: var(--fs-12); font-weight: 700; line-height: var(--lh-ui); letter-spacing: var(--track-caps);
        text-transform: uppercase; color: var(--c-muted);
    }
    .kb-table--wide.kb-table--cards .kb-table__empty { display: inline; }
    [dir="rtl"] .kb-table--wide.kb-table--cards .kb-table__label { text-transform: none; letter-spacing: 0; font-size: var(--fs-14); }
}
@container (max-width: 749.98px) {
    .kb-table--wider.kb-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .kb-table--wider.kb-table--cards, .kb-table--wider.kb-table--cards tbody, .kb-table--wider.kb-table--cards tr, .kb-table--wider.kb-table--cards td { display: block; }
    .kb-table--wider.kb-table--cards colgroup { display: none; }
    .kb-table--wider.kb-table--cards tr { display: flex; flex-direction: column; gap: var(--sp-8); padding: var(--sp-12) var(--sp-16); border-top: 1px solid var(--c-border); }
    .kb-table--wider.kb-table--cards tbody tr:first-child { border-top: 0; }
    .prose .kb-table--wider.kb-table--cards td { padding: 0; border: 0; font-size: var(--fs-15); line-height: var(--lh-ui); text-align: start; }
    .prose .kb-table--wider.kb-table--cards td:first-child { font-weight: 500; color: var(--c-strong); }
    .kb-table--wider.kb-table--cards .kb-table__label {
        display: block; font-size: var(--fs-12); font-weight: 700; line-height: var(--lh-ui); letter-spacing: var(--track-caps);
        text-transform: uppercase; color: var(--c-muted);
    }
    .kb-table--wider.kb-table--cards .kb-table__empty { display: inline; }
    [dir="rtl"] .kb-table--wider.kb-table--cards .kb-table__label { text-transform: none; letter-spacing: 0; font-size: var(--fs-14); }
}

@media (max-width: 640px) {
    /* Phone: one card per endpoint: badges, the path with a 44px Copy, the description, then the labelled details. */
    .ep thead, .kb-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .ep tr { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-16); padding: var(--sp-12); }
    .ep tbody tr:first-child { border-top: 0; }
    .ep td.ep__method { flex: 1 0 100%; flex-direction: row; flex-wrap: wrap; gap: var(--sp-8); }
    .ep__badge { min-height: 0; }
    .ep td.ep__path { flex: 1 0 100%; margin-top: calc(-1 * var(--sp-4)); }
    .ep td.ep__desc { flex: 1 0 100%; order: 1; font-size: var(--fs-15); }
    .ep td.ep__detail { order: 2; margin-top: var(--sp-4); padding-top: 0; display: flex; flex-wrap: wrap; gap: 0 var(--sp-8); }
    .ep__label, .kb-table__label {
        display: inline; font-size: var(--fs-12); font-weight: 700; line-height: var(--lh-ui); letter-spacing: var(--track-caps);
        text-transform: uppercase; color: var(--c-muted);
    }
    .ep__label { padding-top: 1px; }
    .ep__line { min-height: 44px; }
    .ep__copy { width: 44px; height: 44px; border-color: var(--c-control); background: #ffffff; color: var(--c-primary); }
    /* Two-column tables stay tables, with 12px cell sides so two unbreakable 16-character chips still fit. */
    .prose .kb-table td, .prose .kb-table th { padding-inline: var(--sp-12); }
    .kb-table { --kb-cell-x: 24px; }
    /* Ordinary tables of 3+ columns: stacked cards; the first cell is the title, the others keep their label. */
    .prose .table-scroll--cards { overflow: visible; background: #ffffff; }
    .kb-table--cards, .kb-table--cards tbody, .kb-table--cards tr, .kb-table--cards td { display: block; }
    .kb-table--cards colgroup { display: none; }
    .kb-table--cards tr { display: flex; flex-direction: column; gap: var(--sp-8); padding: var(--sp-12); border-top: 1px solid var(--c-border); }
    .kb-table--cards tbody tr:first-child { border-top: 0; }
    .prose .kb-table--cards td { padding: 0; border: 0; font-size: var(--fs-15); line-height: var(--lh-ui); text-align: start; }
    .prose .kb-table--cards td:first-child { font-weight: 500; color: var(--c-strong); }
    .kb-table--cards .kb-table__label { display: block; }
    .kb-table--cards .kb-table__empty { display: inline; }
    [dir="rtl"] .ep__label, [dir="rtl"] .kb-table__label { text-transform: none; letter-spacing: 0; font-size: var(--fs-14); }
}

/* Numbered steps: every ordered list at the top level of an article body (and anything with .steps). */
.prose > ol, .steps { list-style: none; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: var(--sp-24); }
.prose > ol > li, .steps > li { counter-increment: step; position: relative; min-height: 32px; padding-inline-start: var(--sp-48); }
.prose > ol > li::before, .steps > li::before {
    content: counter(step); position: absolute; inset-inline-start: 0; top: 0;
    width: 32px; height: 32px; border-radius: var(--r-pill); background: var(--c-primary); color: #ffffff;
    display: flex; align-items: center; justify-content: center; font: 800 var(--fs-14)/1 var(--font-head);
}
.prose > ol > li > *, .steps > li > * { margin: 0; }
.prose > ol > li > * + *, .steps > li > * + * { margin-top: var(--sp-12); }
.prose > ol > li > .callout, .steps > li > .callout { padding: var(--sp-12) var(--sp-16); }
.prose > ol ol { list-style: lower-alpha; padding-inline-start: var(--sp-24); }
.prose > ol ol > li + li { margin-top: var(--sp-8); }

/* ------------------------------------------------------------------------------------------- Cards */
.card {
    display: flex; gap: var(--sp-16); align-items: flex-start; padding: var(--sp-20);
    background: #ffffff; border: 1px solid var(--c-border); border-radius: var(--r-card); box-shadow: var(--shadow-1);
    color: var(--c-body); text-decoration: none;
}
a.card:hover, .card--link:hover { border-color: var(--c-control); color: var(--c-body); }
a.card:hover .card__title { color: var(--c-primary); }
.card--flat { box-shadow: none; }
.card__icon { flex: none; width: 40px; height: 40px; border-radius: var(--r-control); display: flex; align-items: center; justify-content: center; background: var(--c-selected); color: var(--c-primary); }
.card__icon--module { background: var(--c-green-tint); color: var(--c-green); }
.card__icon--restricted { background: var(--c-navy); color: var(--c-mint); }
.card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.card__title { font: 700 var(--fs-18)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.card__text { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { display: flex; flex-wrap: wrap; gap: var(--sp-8); margin-top: var(--sp-4); }
.card--stat { flex-direction: column; gap: var(--sp-4); }
.card__stat { font: 800 var(--fs-30)/var(--lh-head) var(--font-head); color: var(--c-primary); font-variant-numeric: tabular-nums; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-16); }
.card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-16); }
.pager__link { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-16) var(--sp-20); background: #ffffff; border: 1px solid var(--c-border); border-radius: var(--r-card); text-decoration: none; }
.pager__link:hover { border-color: var(--c-control); }
.pager__link--next { grid-column: 2; text-align: end; align-items: flex-end; }
.pager__label { font-size: var(--fs-14); color: var(--c-muted); }
.pager__title { display: inline-flex; align-items: center; gap: var(--sp-8); font-weight: 500; color: var(--c-primary); }

/* ------------------------------------------------------------------------------------------- Lists */
.row-list { margin: 0; padding: 0; list-style: none; background: #ffffff; border: 1px solid var(--c-border); border-radius: var(--r-card); box-shadow: var(--shadow-1); overflow: hidden; }
.row-list > li + li { border-top: 1px solid var(--c-border); }
.row-list__item { display: flex; align-items: center; gap: var(--sp-16); min-height: 44px; padding: var(--sp-16) var(--sp-20); color: var(--c-strong); text-decoration: none; }
a.row-list__item:hover { background: var(--c-ground); color: var(--c-primary); }
.row-list__item > .icon:last-child { margin-inline-start: auto; color: var(--c-muted); }

/* -------------------------------------------------------------------------------------- Navigation */
.breadcrumb ol { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-8); font-size: var(--fs-14); line-height: var(--lh-ui); }
.breadcrumb li { display: flex; align-items: center; gap: var(--sp-8); }
/* The "/" ends each crumb (not starts the next), so a wrapped trail never begins a line with "/". */
.breadcrumb li:not(:last-child)::after { content: "/"; color: var(--c-muted); }
.breadcrumb a { min-height: 44px; display: flex; align-items: center; color: var(--c-muted); text-decoration: underline; }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb [aria-current="page"] { font-weight: 400; color: var(--c-strong); }

.rail { background: #ffffff; border: 1px solid var(--c-border); border-radius: var(--r-card); padding: var(--sp-8); display: flex; flex-direction: column; }
.rail__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); padding: var(--sp-12) var(--sp-12) var(--sp-8); font: 700 var(--fs-18)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.rail__group { padding: var(--sp-12) var(--sp-12) var(--sp-4); font-size: var(--fs-12); line-height: var(--lh-ui); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); }
.rail__group:first-child { padding-top: var(--sp-8); }
.rail__link { min-height: 44px; display: flex; align-items: center; padding: var(--sp-8) var(--sp-12); border-inline-start: 3px solid transparent; border-radius: var(--r-control); font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-body); text-decoration: none; }
.rail__link:hover { background: var(--c-subtle); color: var(--c-strong); }
.rail__link[aria-current="page"] { border-inline-start-color: var(--c-primary); border-start-start-radius: 0; border-end-start-radius: 0; background: var(--c-selected); font-weight: 700; color: var(--c-primary); }

.toc { display: flex; flex-direction: column; gap: var(--sp-4); }
.toc__title { padding-bottom: var(--sp-4); font-size: var(--fs-12); line-height: var(--lh-ui); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); }
.toc__link { display: block; padding-block: var(--sp-4); padding-inline: var(--sp-12) 0; border-inline-start: 3px solid var(--c-border-strong); font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); text-decoration: none; }
.toc__link:hover { color: var(--c-primary); }
.toc__link[aria-current="true"], .toc__link.is-current { border-inline-start-color: var(--c-primary); font-weight: 700; color: var(--c-primary); }

.tabs { display: flex; flex-wrap: wrap; gap: var(--sp-4); border-bottom: 1px solid var(--c-border-strong); }
.tabs__item {
    height: 44px; display: inline-flex; align-items: center; padding: 0 var(--sp-12); border: 0; border-block: 2px solid transparent;
    background: transparent; font: 500 var(--fs-14)/1 var(--font-body); color: var(--c-body); text-decoration: none; cursor: pointer;
}
.tabs__item:hover { background: var(--c-subtle); color: var(--c-strong); }
.tabs__item[aria-current], .tabs__item[aria-selected="true"] { border-bottom-color: var(--c-primary); color: var(--c-primary); }

.stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--sp-8); }
.stepper__step { display: flex; flex-direction: column; gap: var(--sp-8); font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); }
.stepper__step::before { content: ""; height: 4px; border-radius: var(--r-pill); background: var(--c-border-strong); }
.stepper__step--done::before, .stepper__step--current::before { background: var(--c-primary); }
.stepper__step--current { font-weight: 700; color: var(--c-strong); }
.stepper__step--done { display: flex; }
.stepper__step--done .icon { color: var(--c-green); }

.disclosure { background: #ffffff; border: 1px solid var(--c-control); border-radius: var(--r-control); }
.disclosure > summary {
    display: flex; align-items: center; gap: var(--sp-12); min-height: 44px; padding: var(--sp-8) var(--sp-16); list-style: none; cursor: pointer;
    font-size: var(--fs-14); font-weight: 500; color: var(--c-strong);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .icon--chevron-down { margin-inline-start: auto; color: var(--c-muted); transition: transform .15s; }
.disclosure[open] > summary .icon--chevron-down { transform: rotate(180deg); }
.disclosure__body { padding: var(--sp-8) var(--sp-16) var(--sp-16); border-top: 1px solid var(--c-border); }
.disclosure--muted > summary { background: var(--c-ground); border-radius: var(--r-control); }

/* ------------------------------------------------------------------------------------------- Menus */
.menu {
    position: absolute; z-index: 30; top: calc(100% + 8px); inset-inline-end: 0; width: 300px;
    padding: var(--sp-8); display: flex; flex-direction: column; background: #ffffff; color: var(--c-strong);
    border: 1px solid var(--c-border-strong); border-radius: var(--r-card); box-shadow: var(--shadow-2);
}
.menu--narrow { width: 240px; }
.menu__heading { padding: var(--sp-8) var(--sp-12); font-size: var(--fs-12); line-height: var(--lh-ui); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); }
.menu__identity { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-8) var(--sp-8) var(--sp-12); margin-bottom: var(--sp-4); border-bottom: 1px solid var(--c-border); }
.menu__identity-text { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); }
.menu__identity-text strong { font-size: var(--fs-16); color: var(--c-strong); }
.menu__identity-text code { background: none; padding: 0; color: var(--c-strong); }
.menu__item {
    min-height: 44px; display: flex; align-items: center; gap: var(--sp-12); width: 100%; padding: 0 var(--sp-8); border: 0; border-radius: var(--r-control);
    background: transparent; font: 500 var(--fs-14)/var(--lh-ui) var(--font-body); color: var(--c-strong); text-align: start; text-decoration: none; cursor: pointer;
}
.menu__item:hover { background: var(--c-selected); color: var(--c-strong); }
.menu__item > .icon:first-child { color: var(--c-muted); }
.menu__item[aria-current="true"] { background: var(--c-selected); font-weight: 700; color: var(--c-primary); justify-content: space-between; }
.menu__item-end { margin-inline-start: auto; color: var(--c-muted); }
.menu__list { margin: 0; padding: 0; list-style: none; }
.menu__sep { height: 1px; margin: var(--sp-4) 0; background: var(--c-border); border: 0; }
.menu form { margin: 0; }
.avatar {
    flex: none; width: 32px; height: 32px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center;
    background: var(--c-primary); color: #ffffff; font: 700 var(--fs-12)/1 var(--font-body);
}
.avatar--lg { width: 40px; height: 40px; font-size: var(--fs-14); }
.avatar--mint { background: var(--c-mint); color: var(--c-strong); }

/* ------------------------------------------------------------------------------------------ Header */
.site-header { flex: none; position: relative; z-index: 20; height: var(--header-h); background: var(--c-navy); color: #ffffff; }
.site-header--light { background: #ffffff; color: var(--c-strong); border-bottom: 1px solid var(--c-border-strong); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: var(--sp-16); }

.brand { flex: none; display: flex; align-items: center; gap: var(--sp-12); min-height: 44px; min-width: 0; border-radius: var(--r-control); text-decoration: none; color: #ffffff; }
.brand:hover { color: #ffffff; }
.brand__tile { flex: none; width: 32px; height: 32px; border-radius: var(--r-control); background: #ffffff; color: var(--c-primary); display: flex; align-items: center; justify-content: center; }
.brand__name { font: 800 var(--fs-18)/var(--lh-head) var(--font-head); white-space: nowrap; }
.brand__logo { display: block; max-width: 120px; max-height: 36px; width: auto; height: auto; object-fit: contain; }
.brand__org { max-width: 200px; overflow: hidden; text-overflow: ellipsis; font: 800 var(--fs-18)/var(--lh-head) var(--font-head); color: var(--c-strong); white-space: nowrap; }
.brand__divider { flex: none; width: 1px; height: 28px; background: var(--c-border-strong); }
.brand__badge { padding: 2px 8px; border-radius: var(--r-badge); background: var(--c-mint); color: var(--c-strong); font: 700 var(--fs-12)/var(--lh-ui) var(--font-body); letter-spacing: var(--track-caps); text-transform: uppercase; }
.site-header--light .brand, .site-header--light .brand:hover { color: var(--c-strong); }

.header-search {
    flex: 1 1 360px; max-width: 560px; min-width: 0; height: 40px; display: flex; align-items: center; gap: var(--sp-8); padding: 0 var(--sp-12);
    background: var(--c-navy-field); border: 1px solid var(--c-navy-border); border-radius: var(--r-control); color: var(--c-on-navy);
}
.header-search:focus-within { box-shadow: 0 0 0 2px #ffffff; }
.header-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: var(--fs-16); color: #ffffff; }
.header-search input:focus-visible { outline: none; }
.header-search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.header-search kbd { flex: none; padding: 0 8px; background: transparent; border: 1px solid var(--c-navy-border); font-size: var(--fs-12); color: var(--c-on-navy); }
/* With text: a × with a 44px hit area (as on the board, it overhangs the 40px field) replaces the "/" hint. */
.header-search__clear {
    flex: none; display: none; width: 44px; height: 44px; margin-block: -4px; margin-inline-end: calc(-1 * var(--sp-12)); align-items: center; justify-content: center;
    border: 0; border-radius: var(--r-control); background: transparent; color: var(--c-on-navy); cursor: pointer;
}
.header-search__clear:hover { color: #ffffff; background: var(--c-navy-field); }
.header-search--filled kbd { display: none; }
.header-search--filled .header-search__clear { display: flex; }
.site-header--light .header-search__clear { color: var(--c-muted); }
.site-header--light .header-search__clear:hover { color: var(--c-strong); background: var(--c-subtle); }
.site-header--light .header-search { background: #ffffff; border-color: var(--c-control); color: var(--c-muted); }
.site-header--light .header-search:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary); }
.site-header--light .header-search input { color: var(--c-strong); }
.site-header--light .header-search kbd { border-color: var(--c-control); color: var(--c-muted); }

.site-nav { flex: none; display: flex; align-items: center; gap: var(--sp-4); margin-inline-start: auto; }
.site-nav__link {
    height: 44px; display: flex; align-items: center; padding: 0 var(--sp-12); border-block: 2px solid transparent; border-radius: 0;
    color: var(--c-on-navy); text-decoration: none; font-size: var(--fs-14); font-weight: 500; white-space: nowrap;
}
.site-nav__link:hover { color: #ffffff; background: var(--c-navy-field); border-radius: var(--r-control); }
.site-nav__link[aria-current="page"] { color: #ffffff; border-bottom-color: var(--c-mint); }
.site-nav__link[aria-current="page"]:hover { border-radius: 0; background: transparent; }
.site-header--light .site-nav__link { color: var(--c-body); }
.site-header--light .site-nav__link:hover { color: var(--c-strong); background: var(--c-subtle); }
.site-header--light .site-nav__link[aria-current="page"] { color: var(--c-primary); border-bottom-color: var(--c-primary); background: transparent; }

.header-actions { flex: none; display: flex; align-items: center; gap: var(--sp-8); margin-inline-start: auto; }
.site-nav + .header-actions { margin-inline-start: 0; }
.header-actions .btn { font-size: var(--fs-14); }

/* Dropdowns in the header are <details>: they open without JavaScript; a few lines of JS close them on Esc / outside click. */
.lang-menu, .account-menu { position: relative; }
.lang-menu > summary, .account-menu > summary { list-style: none; }
.lang-menu > summary::-webkit-details-marker, .account-menu > summary::-webkit-details-marker { display: none; }
.lang-menu__button {
    height: 44px; display: flex; align-items: center; gap: var(--sp-8); padding: 0 var(--sp-12); cursor: pointer;
    border: 1px solid var(--c-navy-border); border-radius: var(--r-control); background: transparent;
    font-size: var(--fs-14); font-weight: 500; color: #ffffff;
}
.lang-menu__button:hover { background: var(--c-navy-field); }
.site-header--light .lang-menu__button { border-color: var(--c-control); background: #ffffff; color: var(--c-primary); }
.site-header--light .lang-menu__button:hover { background: var(--c-subtle); }
.lang-menu[open] .lang-menu__button .icon--chevron-down,
.account-menu[open] .account-chip .icon--chevron-down { transform: rotate(180deg); }
.lang-menu .menu { width: 240px; }
.lang-menu .menu__item { font-family: var(--font-body), "Noto Sans Arabic", "Noto Sans Tamil"; }
.account-chip {
    height: 44px; display: flex; align-items: center; gap: var(--sp-8); padding: 0 var(--sp-12) 0 var(--sp-4); cursor: pointer;
    border: 1px solid var(--c-navy-border); border-radius: var(--r-pill); background: transparent;
    font-size: var(--fs-14); font-weight: 500; color: #ffffff; white-space: nowrap;
}
.account-chip__name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.site-header--light .account-chip { border-color: var(--c-control); background: #ffffff; color: var(--c-strong); }
.site-header--light .account-menu[open] .account-chip { border-color: var(--c-primary); }
.account-menu[open] .account-chip { border-color: #ffffff; }

.header-icon-btn {
    flex: none; width: 44px; height: 44px; display: none; align-items: center; justify-content: center; padding: 0;
    border: 0; border-radius: var(--r-control); background: transparent; color: #ffffff; cursor: pointer;
}
.site-header--light .header-icon-btn { color: var(--c-primary); }

/* Phone menu: a <details>; its summary is the 44px menu button, its body the 336px sheet over a scrim. */
.mobile-menu { display: none; }
.mobile-menu > summary { list-style: none; }
.mobile-menu > summary::-webkit-details-marker { display: none; }
.mobile-menu__toggle { background: var(--c-navy-field); }
.site-header--light .mobile-menu__toggle { width: 44px; height: 44px; border: 1px solid var(--c-control); border-radius: var(--r-pill); background: #ffffff; }
.mobile-menu__scrim { position: fixed; inset: 0; z-index: 40; background: var(--c-scrim); }
.mobile-menu__sheet {
    position: fixed; z-index: 41; top: 0; bottom: 0; inset-inline-end: 0; width: min(336px, 100% - 40px);
    display: flex; flex-direction: column; overflow-y: auto; background: #ffffff; color: var(--c-strong); box-shadow: var(--shadow-3);
}
.mobile-menu__head { flex: none; height: 56px; padding: 0 var(--sp-8) 0 var(--sp-20); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--c-subtle); }
.mobile-menu__title { font: 800 var(--fs-20)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.mobile-menu__close { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-control); background: var(--c-subtle); color: var(--c-strong); }
.mobile-menu__identity { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-16) var(--sp-20); border-bottom: 1px solid var(--c-border); }
.mobile-menu__search { padding: var(--sp-16) var(--sp-16) var(--sp-8); }
.mobile-menu__search .field { padding-inline: var(--sp-16) 0; }
.mobile-menu__search .field .icon { color: var(--c-muted); }
.mobile-menu__nav { padding: var(--sp-4) var(--sp-8); display: flex; flex-direction: column; }
.mobile-menu__sep { margin: var(--sp-4) var(--sp-20) 0; border: 0; border-top: 1px solid var(--c-border); }
.mobile-menu__row {
    min-height: 48px; display: flex; align-items: center; gap: var(--sp-12); padding: 0 var(--sp-12); border-inline-start: 3px solid transparent; border-radius: var(--r-control);
    font-size: var(--fs-16); font-weight: 500; color: var(--c-strong); text-decoration: none;
}
.mobile-menu__row:hover { background: var(--c-subtle); color: var(--c-strong); }
.mobile-menu__row > .icon:first-child { color: var(--c-primary); }
.mobile-menu__row > .icon:last-child { margin-inline-start: auto; color: var(--c-muted); }
.mobile-menu__row[aria-current="page"] { background: var(--c-selected); border-inline-start-color: var(--c-primary); border-start-start-radius: 0; border-end-start-radius: 0; font-weight: 700; }
.mobile-menu__row-value { margin-inline-start: auto; font-weight: 400; color: var(--c-muted); }
.mobile-menu__row-value + .icon { margin-inline-start: 0 !important; }
.mobile-menu__row-value[hidden] + .icon { margin-inline-start: auto !important; }
.mobile-menu__langs { padding: var(--sp-4) var(--sp-8) var(--sp-8) var(--sp-48); display: flex; flex-direction: column; }
.mobile-menu__langs a { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--sp-12); border-radius: var(--r-control); color: var(--c-body); text-decoration: none; }
.mobile-menu__langs a[aria-current="true"] { background: var(--c-selected); font-weight: 700; color: var(--c-primary); }
.mobile-menu__lang > summary { list-style: none; cursor: pointer; }
.mobile-menu__lang > summary::-webkit-details-marker { display: none; }
.mobile-menu__lang[open] > summary .icon:last-child { transform: rotate(90deg); }
[dir="rtl"] .mobile-menu__lang[open] > summary .icon:last-child { transform: scaleX(-1) rotate(90deg); }
.mobile-menu__foot { margin-top: auto; padding: var(--sp-16) var(--sp-20) var(--sp-20); display: flex; flex-direction: column; gap: var(--sp-12); background: var(--c-ground); border-top: 1px solid var(--c-border); }
.mobile-menu__foot form { margin: 0; }
.mobile-menu__tip { font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); }
.mobile-menu__tip strong { color: var(--c-strong); }
body:has(.mobile-menu[open]) { overflow: hidden; }

/* ------------------------------------------------------------------------------------------ Footer */
.site-footer { flex: none; background: #ffffff; border-top: 1px solid var(--c-border-strong); font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-muted); }
.site-footer__inner { min-height: 92px; padding-block: var(--sp-24); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-16); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: var(--sp-8) var(--sp-24); }
.site-footer__links a { min-height: 44px; display: inline-flex; align-items: center; color: var(--c-muted); }

/* ------------------------------------------------------------------------------------- Empty state */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-16); padding: var(--sp-32) var(--sp-24); text-align: center; background: #ffffff; border: 1px solid var(--c-border); border-radius: var(--r-card); }
.empty__icon { width: 48px; height: 48px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; background: var(--c-subtle); color: var(--c-muted); }
.empty__title { font: 700 var(--fs-20)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.empty__text { max-width: var(--measure); color: var(--c-body); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-12); }

/* ------------------------------------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; background: #ffffff; border: 1px solid var(--c-border); border-radius: var(--r-card); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-body); }
.table caption { text-align: start; }
.table thead tr { background: var(--c-subtle); }
.table th { padding: var(--sp-12) var(--sp-16); text-align: start; font-size: var(--fs-12); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); white-space: nowrap; }
.table tbody th { font-size: var(--fs-14); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--c-strong); white-space: normal; }
.table td, .table tbody th { padding: var(--sp-8) var(--sp-16); border-top: 1px solid var(--c-border); vertical-align: middle; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table__actions { text-align: end; white-space: nowrap; }
.table__actions > * + * { margin-inline-start: var(--sp-8); }
.table__actions form { display: inline; }

/* ------------------------------------------------------------------------------------------ Dialog */
.dialog { width: min(480px, 100% - 32px); padding: var(--sp-24); border: 0; border-radius: var(--r-dialog); box-shadow: var(--shadow-3); color: var(--c-body); }
.dialog::backdrop { background: rgba(10, 31, 68, .5); }
.dialog__title { font: 700 var(--fs-20)/var(--lh-head) var(--font-head); color: var(--c-strong); }
.dialog__text { margin-top: var(--sp-16); }
.dialog__actions { margin-top: var(--sp-16); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-12); }

/* -------------------------------------------------------------------------------------- Admin bits */
.key-block { padding: var(--sp-8) var(--sp-12); border-radius: var(--r-code); background: var(--c-subtle); font-family: var(--font-mono); font-size: var(--fs-13); line-height: var(--lh-ui); color: var(--c-strong); word-spacing: .3em; overflow-wrap: anywhere; user-select: all; }
.qr-box { width: 160px; height: 160px; flex: none; display: flex; align-items: center; justify-content: center; padding: var(--sp-8); background: #ffffff; border: 1px dashed var(--c-control); border-radius: var(--r-card); }
.qr-box svg { width: 100%; height: 100%; }

/* ------------------------------------------------------------------------------------------- Phone */
@media (max-width: 1023px) {
    :root { --header-h: 56px; }
    .site-header__inner { gap: var(--sp-8); padding-inline: var(--sp-16); }
    .brand { gap: var(--sp-8); }
    .brand__name, .brand__org { font-size: var(--fs-16); }
    .brand__logo { max-width: 96px; max-height: 32px; }
    .brand__divider { height: 24px; }
    .brand__org { max-width: 120px; }
    .header-search, .site-nav, .header-actions { display: none; }
    .header-icon-btn { display: inline-flex; }
    .mobile-menu { display: block; margin-inline-start: auto; }
    .header-icon-btn--search { margin-inline-start: auto; }
    .header-icon-btn--search + .mobile-menu { margin-inline-start: 0; }
    .docs-layout__rail, .docs-layout__aside { position: static; }
    /* The admin header keeps its nav and account chip on small screens (no phone sheet). */
    .site-header--admin .site-nav, .site-header--admin .header-actions { display: flex; }
}
@media (max-width: 640px) {
    :root { --gutter: 16px; }
    .page { padding-block: var(--sp-16) var(--sp-48); }
    h1, .t-title { font-size: var(--fs-30); }
    .t-display { font-size: var(--fs-30); }
    .docs-layout { gap: var(--sp-16); }
    .card-grid, .card-grid--2, .card-grid--3, .card-grid--4 { grid-template-columns: minmax(0, 1fr); gap: var(--sp-12); }
    .pager { grid-template-columns: minmax(0, 1fr); }
    .pager__link--next { grid-column: auto; }
    .applies > div { padding: var(--sp-12); }
    .callout { padding: var(--sp-12) var(--sp-16); }
    .site-footer__inner { min-height: 0; padding-block: var(--sp-16); flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
    .site-footer__links { gap: 0 var(--sp-20); }
    .section + .section { margin-top: var(--sp-32); }
    .section__head { margin-bottom: var(--sp-16); }
    .site-header--admin .brand__name, .site-header--admin .account-chip__name { display: none; }
    .site-header--admin .site-nav__link { padding: 0 var(--sp-8); }
}
@media (min-width: 641px) and (max-width: 1023px) {
    .card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------------------------- RTL */
[dir="rtl"] {
    --font-body: "Noto Sans Arabic", Roboto, "Noto Sans", system-ui, sans-serif;
    --font-head: "Noto Kufi Arabic", "Noto Sans Arabic", Nunito, sans-serif;
    --lh-read: 1.9;
    --track-title: 0;
    --track-caps: 0;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
[dir="rtl"] .t-display, [dir="rtl"] .t-title, [dir="rtl"] .t-page-title, [dir="rtl"] .t-h2, [dir="rtl"] .t-h3, [dir="rtl"] .t-card-title,
[dir="rtl"] .card__title, [dir="rtl"] .section__title, [dir="rtl"] .empty__title, [dir="rtl"] .dialog__title { line-height: 1.4; }
[dir="rtl"] .caps-label, [dir="rtl"] .applies dt, [dir="rtl"] .toc__title, [dir="rtl"] .rail__group, [dir="rtl"] .menu__heading,
[dir="rtl"] .table th, [dir="rtl"] .prose th { text-transform: none; font-size: var(--fs-14); }
/* English content inside an Arabic page (fallback articles, code, brand) keeps the Latin fonts and rhythm. */
[dir="rtl"] [lang="en"] { --font-body: Roboto, "Noto Sans", system-ui, sans-serif; --font-head: Nunito, sans-serif; --lh-read: 1.7; font-family: var(--font-body); }
[dir="rtl"] .brand__name { font-family: Nunito, sans-serif; }
