/* Apolaris AI documentation site — theme-aware via tokens.css custom properties. */
* { box-sizing: border-box; }
:root { --docs-top-h: 58px; --docs-side-w: 280px; --docs-toc-w: 230px; --docs-max: 860px; }

body.docs-body {
  margin: 0; font-family: var(--ng-font, "Inter", system-ui, sans-serif);
  background: var(--ng-bg, #f7f8fa); color: var(--ng-text, #0f172a);
  -webkit-font-smoothing: antialiased; line-height: 1.6;
}
/* The mobile nav drawer and the Ask-AI panel are fixed elements parked just
   off-screen via a translate transform; that parked position widens the page's
   scrollable area, so on mobile you can pan right onto a blank strip. Clip the
   horizontal overflow at the viewport. `clip` (with a `hidden` fallback for old
   engines) does NOT create a scroll container, so the sticky top bar and rails
   keep working — `overflow-x: hidden` would have forced overflow-y to `auto`. */
html, body.docs-body { overflow-x: hidden; overflow-x: clip; }
.docs-body a { color: var(--ng-brand, #4f46e5); text-decoration: none; }
.docs-body a:hover { text-decoration: underline; }
.docs-skip { position: absolute; left: -999px; }
.docs-skip:focus { left: 12px; top: 8px; background: var(--ng-surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }

/* ---------------------------------------------------------------- top bar */
/* Three zones: brand (left) · search (centered) · controls (right). The 1fr
   side columns keep the search visually centered regardless of zone widths. */
.docs-top {
  position: sticky; top: 0; z-index: 40; height: var(--docs-top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--ng-chrome-bg, #fff); color: var(--ng-chrome-fg, #334155);
  border-bottom: 1px solid var(--ng-chrome-border, var(--ng-border, #e2e8f0));
}
/* Grid items default to min-width:auto, so a zone cannot shrink below its own
   content: one wide child (the language <select>, sized by its longest option)
   would otherwise hold the right zone open and push the brand out of the bar. */
.docs-top > * { min-width: 0; }
.docs-top__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.docs-ico { flex: none; display: inline-block; vertical-align: middle; }
.docs-brand { display: flex; align-items: center; gap: 10px; color: inherit; min-width: 0; }
.docs-brand:hover { text-decoration: none; }
.docs-brand__logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--ng-brand, #4f46e5); color: #fff; font-weight: 800; font-size: 16px;
}
.docs-brand__name { font-weight: 700; font-size: 15px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.docs-brand__name em { color: var(--ng-text-tertiary, #64748b); font-style: normal; font-weight: 600; }

.docs-search-trigger {
  justify-self: center; width: clamp(180px, 42vw, 520px);
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--ng-surface-2, #f1f5f9); border: 1px solid var(--ng-border, #e2e8f0);
  color: var(--ng-text-tertiary, #64748b); border-radius: var(--ng-radius-pill, 999px);
  padding: 8px 14px; font-size: 14px; font-family: inherit;
}
.docs-search-trigger > span { flex: 1; text-align: left; }
.docs-search-trigger:hover { border-color: var(--ng-brand, #4f46e5); }
/* Subtle key hint — inherits the trigger's text colour and uses a translucent
   fill + currentColor border so it stays readable on a light OR a brand-filled
   search box (the docs hero renders the trigger in the brand colour). */
.docs-kbd {
  font-size: 11px; font-family: inherit; color: inherit; opacity: .85;
  background: color-mix(in srgb, currentColor 14%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 6px; padding: 1px 6px; white-space: nowrap;
}
.docs-top__right { justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 0; }

.docs-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--ng-surface-2, #f1f5f9); color: var(--ng-text, #0f172a);
  border: 1px solid var(--ng-border, #e2e8f0); border-radius: var(--ng-radius, 8px);
  padding: 8px 12px; font-size: 13.5px; font-weight: 600; font-family: inherit;
}
.docs-btn:hover { text-decoration: none; border-color: var(--ng-brand, #4f46e5); }
.docs-btn--ai { background: var(--ng-brand, #4f46e5); color: #fff; border-color: transparent; }
.docs-btn--ai:hover { background: var(--ng-brand-hover, #4338ca); }
.docs-icnbtn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--ng-chrome-fg-muted, #64748b);
  border: 1px solid transparent; border-radius: var(--ng-radius, 8px); font-size: 15px;
}
.docs-icnbtn:hover { background: var(--ng-chrome-hover-bg, #f1f5f9); text-decoration: none; }
.docs-lang { display: flex; align-items: center; gap: 6px; color: var(--ng-chrome-fg-muted, #64748b); }
.docs-lang select {
  background: transparent; border: 1px solid var(--ng-border, #e2e8f0); color: inherit;
  border-radius: var(--ng-radius, 8px); padding: 6px 6px; font-family: inherit; font-size: 13px; cursor: pointer;
  /* Options carry native names ("Português (Portugal)"), which set the closed
     control's intrinsic width. Cap it — the open list still shows them in full. */
  max-width: 160px; text-overflow: ellipsis;
}
.docs-burger { display: none; flex-direction: column; gap: 4px; }
.docs-burger span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

/* ---------------------------------------------------------------- shell layout */
.docs-shell {
  display: grid; grid-template-columns: var(--docs-side-w) minmax(0, 1fr) var(--docs-toc-w);
  align-items: start; max-width: 1500px; margin: 0 auto;
}
.docs-sidebar {
  position: sticky; top: var(--docs-top-h); height: calc(100vh - var(--docs-top-h));
  overflow-y: auto; padding: 18px 12px 40px; border-right: 1px solid var(--ng-border, #e2e8f0);
}
.docs-nav__home {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--ng-radius, 8px);
  color: var(--ng-text-secondary, #475569); font-weight: 600; font-size: 14px;
}
.docs-nav__home:hover, .docs-nav a:hover { background: var(--ng-chrome-hover-bg, #f1f5f9); text-decoration: none; }
.docs-nav__home.is-active { background: var(--ng-chrome-active-bg, #eef2ff); color: var(--ng-chrome-active-fg, #4f46e5); }
.docs-nav__section { margin-top: 18px; }
.docs-nav__sectitle {
  display: flex; align-items: center; gap: 8px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 700; color: var(--ng-text-tertiary, #64748b); padding: 0 12px 6px;
}
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li a {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--ng-radius, 8px);
  color: var(--ng-text-secondary, #475569); font-size: 14px;
}
.docs-nav li a.is-active {
  background: var(--ng-chrome-active-bg, #eef2ff); color: var(--ng-chrome-active-fg, #4f46e5); font-weight: 600;
}

.docs-nav__footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--ng-border, #e2e8f0); }
.docs-nav__footer a { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--ng-radius, 8px);
  color: var(--ng-text-secondary, #475569); font-size: 13.5px; }
.docs-nav__footer a:hover { background: var(--ng-chrome-hover-bg, #f1f5f9); text-decoration: none; }
.docs-ext { font-size: 10px; opacity: .55; margin-left: auto; }

/* multi-language code tabs (curl / Python / PowerShell / …) */
.docs-tabs { margin: 16px 0; border: 1px solid var(--ng-border, #e2e8f0); border-radius: var(--ng-radius-lg, 12px); overflow: hidden; }
.docs-tabs__bar { display: flex; gap: 2px; padding: 6px 6px 0; background: var(--ng-surface-2, #f1f5f9);
  border-bottom: 1px solid var(--ng-border, #e2e8f0); flex-wrap: wrap; }
.docs-tabs__btn { background: transparent; border: none; border-radius: 8px 8px 0 0; padding: 8px 14px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ng-text-tertiary, #64748b); cursor: pointer; }
.docs-tabs__btn:hover { color: var(--ng-text, #0f172a); }
.docs-tabs__btn.is-active { background: var(--ng-code-bg, #0f172a); color: #fff; }
.docs-tabs__panels pre { margin: 0; border-radius: 0; border: none; }
.docs-tabs__panels pre[hidden] { display: none; }

.docs-main { min-width: 0; padding: 32px 40px 80px; }
.docs-toc {
  position: sticky; top: var(--docs-top-h); height: calc(100vh - var(--docs-top-h));
  overflow-y: auto; padding: 32px 16px;
}
.docs-toc__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ng-text-tertiary, #64748b); margin-bottom: 10px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--ng-border, #e2e8f0); }
.docs-toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -2px; font-size: 13px;
  color: var(--ng-text-tertiary, #64748b); border-left: 2px solid transparent; }
.docs-toc li.docs-toc__l3 a { padding-left: 24px; font-size: 12.5px; }
.docs-toc li a:hover { color: var(--ng-text, #0f172a); text-decoration: none; }
.docs-toc li a.is-active { color: var(--ng-brand, #4f46e5); border-left-color: var(--ng-brand, #4f46e5); font-weight: 600; }

/* ---------------------------------------------------------------- badges */
.docs-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 1px 6px; border-radius: 999px; vertical-align: middle; }
.docs-badge--dev { background: var(--ng-info-bg, #dbeafe); color: var(--ng-info, #2563eb); }
.docs-badge--pro { background: var(--ng-warning-bg, #fef3c7); color: var(--ng-warning, #b45309); }
.docs-badge--basic { background: var(--ng-success-bg, #dcfce7); color: var(--ng-success, #16a34a); }
/* Super-Admin-only (private "Platform operations" section). */
.docs-badge--super { background: var(--ng-danger-bg, #fee2e2); color: var(--ng-danger, #b91c1c);
  text-transform: none; letter-spacing: 0; }
.docs-badge--super .fa-lock { font-size: 9px; margin-right: 2px; }
.docs-nav__section--private { margin-top: 6px; padding-top: 10px;
  border-top: 1px dashed var(--ng-border, #e2e8f0); }
.docs-nav__section--private .docs-nav__sectitle { color: var(--ng-danger, #b91c1c); }

/* ---------------------------------------------------------------- home */
/* Every surface below is built from tokens.css only (plus color-mix over those
   tokens), so the light / dark / blue themes all follow without a per-theme
   block. `--docs-card-radius` keeps the hero pill, the start tiles and the
   section cards on one radius scale. */
:root { --docs-card-radius: 14px; }

/* The brand-tinted tiles on this page (section icons, step numbers) used the
   --ng-chrome-active-* pair, which is built for the app CHROME — a dark sidebar
   — not for a card sitting on --ng-surface. On the blue theme that wash is
   rgba(255,255,255,.16), i.e. an invisible white tile on a white card, and on
   dark it pairs an indigo glyph with an indigo wash at ~2.2:1. Mixing the brand
   into the surface instead gives a tint that is always a step off the card, and
   mixing it toward the text colour keeps the glyph legible on every theme. */
.docs-body {
  --docs-tile-bg: color-mix(in srgb, var(--ng-brand, #4f46e5) 14%, var(--ng-surface, #fff));
  --docs-tile-fg: color-mix(in srgb, var(--ng-brand, #4f46e5) 70%, var(--ng-text, #0f172a));
  /* The fill alone is only ~1.1:1 against a dark card. A hairline ring gives the
     tile a defined edge on every theme without darkening the wash. */
  --docs-tile-ring: inset 0 0 0 1px color-mix(in srgb, var(--ng-brand, #4f46e5) 24%, transparent);
}

.docs-hero {
  text-align: center; padding: 52px 16px 34px;
  /* A soft brand wash bleeding down from the top edge — enough to lift the hero
     off the flat page background without tinting the text behind it. */
  background: radial-gradient(70% 130% at 50% -10%,
    color-mix(in srgb, var(--ng-brand, #4f46e5) 9%, transparent), transparent 72%);
}
.docs-hero h1 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 800; margin: 0 0 12px; letter-spacing: -.025em; }
.docs-hero p { color: var(--ng-text-secondary, #475569); font-size: 17px; max-width: 620px; margin: 0 auto 26px; }
.docs-hero__search {
  /* Sized and laid out like the top-bar trigger (label left, hint right) so the
     two search entry points read as the same control. */
  width: min(520px, 100%);
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-family: inherit;
  background: var(--ng-surface, #fff); border: 1px solid var(--ng-border, #e2e8f0); border-radius: var(--ng-radius-pill, 999px);
  padding: 13px 20px; font-size: 15px; color: var(--ng-text-tertiary, #64748b);
  box-shadow: var(--ng-shadow-md, 0 4px 6px -1px rgba(16,24,40,.08));
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.docs-hero__search > span { flex: 1; text-align: left; }
.docs-hero__search:hover {
  border-color: color-mix(in srgb, var(--ng-brand, #4f46e5) 60%, var(--ng-border, #e2e8f0));
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--ng-brand, #4f46e5) 55%, transparent);
  transform: translateY(-1px);
}
.docs-hero__search .docs-kbd { font-size: 11px; }

/* Sentence-case heading with a trailing hairline: the old 15px all-caps grey
   label sat too far from the cards it introduces to read as their title. */
.docs-home__heading {
  display: flex; align-items: center; gap: 14px;
  font-size: 18px; font-weight: 700; letter-spacing: -.01em; text-transform: none;
  color: var(--ng-text, #0f172a); margin: 40px 0 16px;
}
.docs-home__heading::after { content: ''; flex: 1; height: 1px; background: var(--ng-border, #e2e8f0); }

.docs-start { margin-top: 4px; }
.docs-start__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
/* `.docs-body a` is 0-1-1 and this tile is a bare 0-1-0 class, so the generic
   link colour was winning and these labels rendered brand-indigo — 2.8:1 on the
   dark theme. The extra .docs-body qualifier takes it to 0-2-0 so the intended
   text colour applies. Same trap as the page rows below, which only escape it
   by being declared later in this file. */
.docs-body .docs-start__link { display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: var(--ng-surface, #fff); border: 1px solid var(--ng-border, #e2e8f0);
  border-radius: var(--docs-card-radius); font-weight: 600; font-size: 14.5px;
  color: var(--ng-text, #0f172a); box-shadow: var(--ng-shadow-sm, 0 1px 2px rgba(16,24,40,.06));
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.docs-start__link:hover { text-decoration: none; transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ng-brand, #4f46e5) 55%, var(--ng-border, #e2e8f0));
  box-shadow: var(--ng-shadow-md, 0 4px 6px -1px rgba(16,24,40,.08)); }
.docs-start__num { flex: none; width: 28px; height: 28px; border-radius: 999px; display: grid;
  place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--docs-tile-bg); color: var(--docs-tile-fg); box-shadow: var(--docs-tile-ring);
  transition: background-color .18s ease, color .18s ease; }
.docs-start__link:hover .docs-start__num { background: var(--ng-brand, #4f46e5); color: #fff; box-shadow: none; }
/* Pure-CSS chevron (two borders on a rotated square) — no extra markup and no
   icon-font dependency for what is decoration. */
.docs-start__link::after, .docs-card__pages a::after {
  content: ''; flex: none; margin-left: auto; width: 6px; height: 6px;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg); transition: opacity .18s ease, transform .18s ease;
}
.docs-start__link::after { opacity: .3; }
/* rotate() first, so the translate runs in the chevron's own axes: (2px,2px)
   there lands as a straight nudge to the right on screen. */
.docs-start__link:hover::after { opacity: .75; transform: rotate(-45deg) translate(2px, 2px); }

/* Masonry, via multicol rather than grid. Sections run from 1 to 8 pages, and a
   grid gives no good answer to that: stretched rows inflate a one-page section
   into a mostly empty box, while `align-items: start` moves the emptiness
   between the rows instead — measured at a 217px void under the neighbours of
   the 8-page card. Columns pack each card against the one above it, so every
   gap is the gutter and nothing else. Costs row-major reading order (cards fill
   down a column, then across); DOM order is untouched, so the sidebar order
   still governs tab order and screen readers.
   `columns: <width>` sets a MINIMUM — the count follows the space available,
   the way auto-fill + minmax did. */
.docs-cards { columns: 264px; column-gap: 18px; }
.docs-card { -webkit-column-break-inside: avoid; break-inside: avoid; margin: 0 0 18px;
  position: relative; display: block;
  background: var(--ng-surface, #fff); border: 1px solid var(--ng-border, #e2e8f0);
  border-radius: var(--docs-card-radius); padding: 18px 18px 16px;
  box-shadow: var(--ng-shadow-sm, 0 1px 2px rgba(16,24,40,.06));
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.docs-card:hover { text-decoration: none; transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--ng-brand, #4f46e5) 55%, var(--ng-border, #e2e8f0));
  box-shadow: var(--ng-shadow-lg, 0 12px 16px -4px rgba(16,24,40,.08)); }
.docs-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.docs-card__icon { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--docs-tile-bg); color: var(--docs-tile-fg); font-size: 16px;
  box-shadow: var(--docs-tile-ring);
  transition: background-color .18s ease, color .18s ease; }
.docs-card:hover .docs-card__icon { background: var(--ng-brand, #4f46e5); color: #fff; box-shadow: none; }
.docs-card__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
  font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; color: var(--ng-text, #0f172a); }
.docs-card__title a { color: inherit; }
.docs-card:hover .docs-card__title a { color: var(--ng-brand, #4f46e5); }
/* The card already lifts on hover, which promises it is clickable — so make it
   so. This overlay covers the whole card; the page list below re-raises itself
   above it, so an individual page link still wins its own click. */
.docs-card__title a::after { content: ''; position: absolute; inset: 0; border-radius: var(--docs-card-radius); }
.docs-card__pages { position: relative; z-index: 1; list-style: none; margin: 0;
  padding: 12px 0 0; border-top: 1px solid var(--ng-border, #e2e8f0); }
.docs-card__pages li { margin: 0; }
/* Every page in a card is its own link: the card lists a whole section now, so
   landing on page 1 and hunting from there is a wasted click. They are styled
   as menu rows rather than blue links — a dozen underlined links per card read
   as a raw sitemap. */
.docs-card__pages a { display: flex; align-items: center; gap: 8px;
  margin: 0 -8px; padding: 6px 8px; border-radius: var(--ng-radius, 8px);
  font-size: 13.5px; line-height: 1.35; color: var(--ng-text-secondary, #475569); text-decoration: none;
  transition: background-color .14s ease, color .14s ease; }
.docs-card__pages a:hover { background: var(--ng-surface-2, #f1f5f9); color: var(--ng-brand, #4f46e5); text-decoration: none; }
.docs-card__pages a::after { opacity: 0; }
.docs-card__pages a:hover::after { opacity: .55; transform: rotate(-45deg) translate(1.5px, 1.5px); }
/* Restricted, not unfinished: the old dashed border read as a placeholder. */
.docs-card--private { border-color: color-mix(in srgb, var(--ng-danger, #dc2626) 30%, var(--ng-border, #e2e8f0)); }
.docs-card--private:hover { border-color: color-mix(in srgb, var(--ng-danger, #dc2626) 55%, var(--ng-border, #e2e8f0)); }
.docs-card--private .docs-card__icon { background: var(--ng-danger-bg, #fee2e2); color: var(--ng-danger, #dc2626);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ng-danger, #dc2626) 24%, transparent); }
.docs-card--private:hover .docs-card__icon { background: var(--ng-danger, #dc2626); color: #fff; box-shadow: none; }
.docs-card--private:hover .docs-card__title a { color: var(--ng-danger, #dc2626); }
.docs-card--private .docs-card__pages a:hover { color: var(--ng-danger, #dc2626); }

/* ---------------------------------------------------------------- article + prose */
.docs-article { max-width: var(--docs-max); }
.docs-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ng-text-tertiary, #64748b); margin-bottom: 14px; }
.docs-article__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.docs-article__head h1 { font-size: 30px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.docs-article__summary { font-size: 17px; color: var(--ng-text-secondary, #475569); margin: 8px 0 20px; }

.docs-prose { font-size: 15.5px; }
.docs-prose h2 { font-size: 22px; font-weight: 700; margin: 34px 0 12px; padding-top: 8px; letter-spacing: -.01em; scroll-margin-top: calc(var(--docs-top-h) + 16px); }
.docs-prose h3 { font-size: 18px; font-weight: 700; margin: 26px 0 10px; scroll-margin-top: calc(var(--docs-top-h) + 16px); }
.docs-prose h2 + h3 { margin-top: 14px; }
.docs-prose p { margin: 12px 0; }
.docs-prose ul, .docs-prose ol { margin: 12px 0; padding-left: 24px; }
.docs-prose li { margin: 6px 0; }
.docs-prose a { font-weight: 500; }
.docs-prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em;
  background: var(--ng-surface-2, #f1f5f9); padding: 2px 6px; border-radius: 6px; }
.docs-prose pre { background: var(--ng-code-bg, #0f172a); color: #e2e8f0; border-radius: var(--ng-radius, 8px);
  padding: 16px; overflow-x: auto; margin: 16px 0; position: relative; }
.docs-prose pre code { background: none; padding: 0; color: inherit; font-size: 13px; line-height: 1.55; }
.docs-prose blockquote { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--ng-brand, #4f46e5);
  background: var(--ng-surface-2, #f1f5f9); border-radius: 0 8px 8px 0; color: var(--ng-text-secondary, #475569); }
.docs-prose blockquote p { margin: 4px 0; }
.docs-prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.docs-prose th, .docs-prose td { text-align: left; padding: 9px 12px; border: 1px solid var(--ng-border, #e2e8f0); }
.docs-prose th { background: var(--ng-surface-2, #f1f5f9); font-weight: 600; }
.docs-prose img { max-width: 100%; border-radius: var(--ng-radius, 8px); border: 1px solid var(--ng-border, #e2e8f0); }
.docs-prose hr { border: none; border-top: 1px solid var(--ng-border, #e2e8f0); margin: 28px 0; }
.docs-copy { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.12); color: #fff;
  border: none; border-radius: 6px; padding: 4px 9px; font-size: 11px; cursor: pointer; font-family: inherit; }
.docs-copy:hover { background: rgba(255,255,255,.25); }

/* figures: workflow illustrations, animated demos, and real screenshots/video */
.docs-figure { margin: 18px 0 24px; }
.docs-figure img, .docs-figure video { display: block; width: 100%; height: auto;
  border: 1px solid var(--ng-border, #e2e8f0); border-radius: var(--ng-radius-lg, 12px);
  background: var(--ng-surface, #fff); }
.docs-figure--svg img { border: none; background: transparent; }
.docs-figure--demo img { border: 1px dashed var(--ng-border-strong, #cbd5e1); background: var(--ng-surface, #fff); }
.docs-figure figcaption { margin-top: 8px; font-size: 13px; color: var(--ng-text-tertiary, #64748b);
  text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.docs-figure figcaption i { color: var(--ng-brand, #4f46e5); }

/* callouts (blockquote starting with [!NOTE]/[!TIP]/[!WARNING] handled in JS, plus class) */
.docs-callout { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; padding: 12px 16px;
  border-radius: var(--ng-radius, 8px); font-size: 14.5px; border: 1px solid; }
.docs-callout i { margin-top: 3px; }
.docs-callout--note { background: var(--ng-info-bg, #dbeafe); border-color: var(--ng-info, #2563eb); color: var(--ng-text, #0f172a); }
.docs-callout--tip { background: var(--ng-success-bg, #dcfce7); border-color: var(--ng-success, #16a34a); color: var(--ng-text, #0f172a); }
.docs-callout--warning { background: var(--ng-warning-bg, #fef3c7); border-color: var(--ng-warning, #d97706); color: var(--ng-text, #0f172a); }

/* ------------------------------------------------- release notes: one day per block */
/* Built on native <details>, so it works with JavaScript off and survives the
   nav swapping #docMain out from under any listener. */
.docs-release-day { border: 1px solid var(--ng-border, #e2e8f0); border-radius: var(--ng-radius, 8px);
  margin: 12px 0; background: var(--ng-surface, #fff); overflow: hidden; }
.docs-release-day__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  cursor: pointer; font-weight: 700; font-size: 15px; color: var(--ng-text, #0f172a);
  list-style: none; user-select: none; }
.docs-release-day__head::-webkit-details-marker { display: none; }
.docs-release-day__head:hover { background: var(--ng-surface-2, #f1f5f9); }
.docs-release-day__head:focus-visible { outline: 2px solid var(--ng-brand, #4f46e5); outline-offset: -2px; }
/* The chevron is the affordance; it rotates rather than swapping glyph so the
   open/closed states cannot drift apart. */
.docs-release-day__head::before { content: "\203A"; font-size: 19px; line-height: 1;
  color: var(--ng-text-tertiary, #64748b); transition: transform .15s ease; }
.docs-release-day[open] > .docs-release-day__head::before { transform: rotate(90deg); }
.docs-release-day[open] > .docs-release-day__head { border-bottom: 1px solid var(--ng-border, #e2e8f0); }
.docs-release-day__title { flex: 1; }
/* A bare number: it reads the same in all 16 languages, so it needs no string. */
.docs-release-day__count { min-width: 22px; padding: 1px 8px; border-radius: 999px;
  background: var(--ng-surface-2, #f1f5f9); color: var(--ng-text-secondary, #475569);
  font-size: 12.5px; font-weight: 600; text-align: center; }
.docs-release-day__body { padding: 4px 16px 14px; }
.docs-release-day__body > h3:first-child { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .docs-release-day__head::before { transition: none; }
}

.docs-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--ng-border, #e2e8f0); }
.docs-pager__btn { display: inline-flex; align-items: center; gap: 10px; max-width: 48%; padding: 12px 16px;
  border: 1px solid var(--ng-border, #e2e8f0); border-radius: var(--ng-radius, 8px); color: var(--ng-text, #0f172a); font-weight: 600; font-size: 14px; }
.docs-pager__btn:hover { border-color: var(--ng-brand, #4f46e5); text-decoration: none; }
.docs-pager__btn--next { margin-left: auto; text-align: right; }

/* ---------------------------------------------------------------- search overlay */
.docs-search { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.45); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.docs-search[hidden] { display: none; }
.docs-search__box { width: min(640px, 92vw); background: var(--ng-surface, #fff); border-radius: var(--ng-radius-lg, 12px); box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.docs-search__field { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--ng-border, #e2e8f0); color: var(--ng-text-tertiary, #64748b); }
.docs-search__field input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; font-family: inherit; color: var(--ng-text, #0f172a); }
.docs-search__close { background: none; border: none; cursor: pointer; color: inherit; font-size: 16px; }
.docs-search__results { max-height: 56vh; overflow-y: auto; }
.docs-result { display: block; padding: 12px 18px; border-bottom: 1px solid var(--ng-border, #e2e8f0); }
.docs-result:hover, .docs-result.is-active { background: var(--ng-surface-2, #f1f5f9); text-decoration: none; }
.docs-result__title { font-weight: 600; color: var(--ng-text, #0f172a); font-size: 15px; }
.docs-result__sec { font-size: 12px; color: var(--ng-text-tertiary, #64748b); }
.docs-result__snip { font-size: 13px; color: var(--ng-text-secondary, #475569); margin-top: 3px; }
.docs-result mark { background: var(--ng-warning-bg, #fef3c7); color: inherit; border-radius: 3px; }
.docs-search__empty { padding: 22px; text-align: center; color: var(--ng-text-tertiary, #64748b); }

/* ---------------------------------------------------------------- Ask AI panel */
.docs-ai { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 70;
  background: var(--ng-surface, #fff); border-left: 1px solid var(--ng-border, #e2e8f0);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; }
.docs-ai.is-open { transform: translateX(0); box-shadow: -12px 0 40px rgba(0,0,0,.18); }
.docs-ai__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px;
  border-bottom: 1px solid var(--ng-border, #e2e8f0); font-weight: 700; }
.docs-ai__actions { display: inline-flex; align-items: center; gap: 6px; }
.docs-ai__ctx { padding: 8px 16px 0; font-size: 12px; color: var(--ng-text-tertiary, #64748b);
  display: flex; align-items: center; gap: 6px; }
.docs-ai__ctx[hidden] { display: none; }
.docs-ai__ctx i { color: var(--ng-brand, #4f46e5); }
.docs-ai__ctx b { color: var(--ng-text-secondary, #475569); font-weight: 600; }
.docs-ai__body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.docs-ai__hint { color: var(--ng-text-secondary, #475569); font-size: 14px; }
.docs-ai__hint .docs-btn { margin-top: 12px; }
.docs-ai__msg { font-size: 14.5px; }
.docs-ai__msg--q { align-self: flex-end; background: var(--ng-brand, #4f46e5); color: #fff; padding: 8px 14px; border-radius: 14px 14px 2px 14px; max-width: 85%; }
.docs-ai__msg--a { background: var(--ng-surface-2, #f1f5f9); padding: 12px 14px; border-radius: 14px 14px 14px 2px; white-space: pre-wrap; }
.docs-ai__sources { margin-top: 8px; font-size: 12.5px; }
.docs-ai__sources b { color: var(--ng-text-tertiary, #64748b); font-weight: 700; }
.docs-ai__sources a { display: inline-block; margin: 3px 6px 0 0; background: var(--ng-surface, #fff); border: 1px solid var(--ng-border, #e2e8f0); padding: 3px 8px; border-radius: 999px; font-size: 12px; }
.docs-ai__form { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--ng-border, #e2e8f0); }
.docs-ai__form input { flex: 1; border: 1px solid var(--ng-border, #e2e8f0); border-radius: var(--ng-radius-pill, 999px); padding: 10px 16px; font-family: inherit; font-size: 14px; background: var(--ng-bg, #f7f8fa); color: var(--ng-text, #0f172a); }
.docs-ai__form input:focus { outline: none; border-color: var(--ng-brand, #4f46e5); }
.docs-ai__form input:disabled { opacity: .7; }
.docs-ai__disclaimer { display: flex; align-items: center; gap: 6px; padding: 0 14px 12px;
  font-size: 11px; color: var(--ng-text-tertiary, #64748b); }

/* ---------------------------------------------------------------- navigation */
/* Client-side navigation swaps the article without a document load, so the
   browser shows none of its own loading feedback. These two cues stand in for
   it: a hairline progress bar, and a short entry transition on the new article
   so the change registers as a change. */
.docs-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 80;
  background: var(--ng-brand, #4f46e5); opacity: 0; pointer-events: none;
  box-shadow: 0 0 8px color-mix(in srgb, var(--ng-brand, #4f46e5) 60%, transparent);
  transition: width .25s ease, opacity .2s ease;
}
.docs-progress.is-on { opacity: 1; }
@keyframes docsArticleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.docs-main.is-fresh > * { animation: docsArticleIn .2s ease both; }
/* aria-busy is set for the moment between the click and the swap. */
.docs-main[aria-busy="true"] { cursor: progress; }

.docs-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 30; display: none; }
.docs-backdrop.is-on { display: block; }
.docs-backdrop--ai { z-index: 65; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) { .docs-toc { display: none; } .docs-shell { grid-template-columns: var(--docs-side-w) minmax(0,1fr); } }
@media (max-width: 820px) {
  .docs-shell { grid-template-columns: minmax(0,1fr); }
  .docs-burger { display: flex; }
  .docs-sidebar { position: fixed; top: var(--docs-top-h); left: 0; width: 280px; z-index: 35;
    background: var(--ng-chrome-bg, #fff); transform: translateX(-100%); transition: transform .22s ease; }
  .docs-sidebar.is-open { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,.18); }
  .docs-main { padding: 22px 18px 70px; }
  .docs-hero { padding: 30px 4px 22px; }
  .docs-hero p { font-size: 15.5px; margin-bottom: 20px; }
  .docs-home__heading { font-size: 16.5px; margin: 30px 0 14px; }
  .docs-cards { columns: 230px; column-gap: 14px; }
  .docs-card { margin-bottom: 14px; }
  .docs-brand__name em { display: none; }
  .docs-btn--ai span { display: none; }
  .docs-search-trigger > span { display: none; }
  .docs-search-trigger { width: auto; padding: 8px 10px; }
  .docs-search-trigger .docs-kbd { display: none; }
  .docs-top { gap: 8px; padding: 0 10px; }
  /* Phone: the bar carries burger, brand, search, AI, language, theme and the
     app link. The globe is decorative next to a named language, so it goes
     first, and the select keeps just enough width to read the language. */
  .docs-lang i { display: none; }
  .docs-lang select { max-width: 104px; font-size: 12px; padding: 6px 4px; }
}
@media (max-width: 480px) {
  /* Below this the bar cannot hold the wordmark AND the seven controls without
     one of them overlapping. The logo tile still identifies the site. */
  .docs-brand__name { display: none; }
  /* The 1fr auto 1fr grid reserves a CENTRED middle column, so the two side
     columns are equal and the right one overflows once its controls need more
     than half the bar. On a phone the search button does not need to be
     centred — let the three zones simply flow. */
  .docs-top { display: flex; justify-content: space-between; }
  .docs-top__left, .docs-top__right { flex: 0 1 auto; }
  .docs-search-trigger { flex: 0 0 auto; margin-left: auto; }
}
@media (max-width: 400px) {
  .docs-lang select { max-width: 76px; }
  .docs-top { gap: 6px; padding: 0 8px; }
}
/* Touch has no hover, so the affordance the chevron carries would never appear
   on a phone. Show it at rest there instead. */
@media (hover: none) {
  .docs-card__pages a::after { opacity: .3; }
}
/* The home tiles lift and slide on hover; honour a reader who asked for less.
   Colour changes stay — they carry the hover affordance on their own. */
@media (prefers-reduced-motion: reduce) {
  .docs-card, .docs-start__link, .docs-hero__search,
  .docs-card__icon, .docs-start__num, .docs-card__pages a,
  .docs-start__link::after, .docs-card__pages a::after { transition: none; }
  .docs-card:hover, .docs-start__link:hover, .docs-hero__search:hover { transform: none; }
  .docs-start__link:hover::after, .docs-card__pages a:hover::after { transform: rotate(-45deg); }
  /* The progress bar still reports, it just stops sliding. */
  .docs-main.is-fresh > * { animation: none; }
  .docs-progress { transition: opacity .2s ease; }
}
