/**
 * Feuille de style de la documentation.
 *
 * Refonte : même base neutre, exécution resserrée. Un accent unique — le
 * vermillon — tenu à environ 5 % de la surface : état actif, lien, anneau de
 * focus, progression, et rien d'autre. Le reste est du gris de zinc et des
 * filets d'un pixel. La hiérarchie vient de la typographie et des filets, pas
 * de la couleur ni des ombres.
 *
 * Deux thèmes, une seule palette de rôles : rien n'est écrit en dur ailleurs
 * que dans les blocs de variables ci-dessous. Le thème suit le système par
 * défaut, et l'interrupteur de la barre le force dans un sens ou dans l'autre.
 */

/* ---------------------------------------------------------------- Palette -- */

:root {
  --ink: #0a0a0b;
  --ink-strong: #09090b;
  --prose: #3f3f46;
  --muted: #6e6e77;
  --faint: #9a9aa4;
  --dim: #b4b4bc;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #fafafa;
  --surface-sunk: #f4f4f5;
  --border: #e4e4e7;
  --border-soft: #f1f1f3;
  --border-strong: #d4d4d8;
  --accent: #e24218;
  --accent-ink: #bd3410;
  --accent-soft: #fdf1ed;
  --accent-line: rgba(226, 66, 24, .12);
  --ok: #22a06b;
  --ok-soft: #edf8f3;
  --warn: #a3620a;
  --warn-soft: #fdf5e9;
  --danger: #b42318;
  --danger-soft: #fdefed;
  --code-bg: #fafafa;
  --code-head: #f4f4f5;
  --shadow: 0 1px 2px rgba(9, 9, 11, .04);

  --t-com: #9a9aa4;
  --t-str: #1f7a4d;
  --t-kw: #9333a8;
  --t-num: #b45309;
  --t-key: #2563eb;
  --t-tag: #b42318;
  --t-attr: #a3620a;
  --t-flag: #0f766e;
  --t-var: #6d4bc7;
  --t-add: #22a06b;
  --t-del: #d0400f;

  /* Geist si le réseau la donne, la police du système sinon : la
     documentation doit rester lisible ouverte depuis un fichier local. */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --font-serif: var(--font-sans);

  /*
   * Lues par la règle `body` de `inline-core/styles/tokens.css`, qui passe
   * après cette feuille — l'intégration l'injecte dans la page.
   *
   * Sans elles, `font-family: var(--font-body)` est invalide au calcul : la
   * propriété est héritée, donc `body` reprend celle de `html`, c'est-à-dire
   * la serif du navigateur. La documentation entière perd sa police, son
   * interligne et son fond, sans qu'aucune règle d'ici ne soit fautive.
   *
   * Chaque valeur reprend à l'identique la déclaration correspondante de
   * `body`, quelques lignes plus bas : la règle de `tokens.css` l'emporte,
   * mais rend exactement la même chose. Les deux listes se répondent.
   */
  --font-body: var(--font-sans);
  --line-height: 1.65;
  --color-surface: var(--bg);
  --color-primary: var(--ink);

  --measure: 47.75rem;
  --sidebar: 16.75rem;
  --toc: 15.25rem;
  --topbar: 3.25rem;
  --gutter: 2.75rem;
  --radius: 9px;
  --radius-sm: 7px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #fafafa;
    --ink-strong: #ffffff;
    --prose: #d4d4d8;
    --muted: #a1a1aa;
    --faint: #71717a;
    --dim: #52525b;
    --bg: #09090b;
    --surface: #0c0c0f;
    --surface-alt: #18181b;
    --surface-sunk: #232326;
    --border: #27272a;
    --border-soft: #1f1f22;
    --border-strong: #3a3a3f;
    --accent: #f2542d;
    --accent-ink: #ff7a55;
    --accent-soft: #24120c;
    --accent-line: rgba(242, 84, 45, .16);
    --ok: #3ec08a;
    --ok-soft: #10231a;
    --warn: #d79a4a;
    --warn-soft: #241c10;
    --danger: #f08b83;
    --danger-soft: #2a1513;
    --code-bg: #0c0c0f;
    --code-head: #18181b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);

    --t-com: #71717a;
    --t-str: #7fc9a0;
    --t-kw: #d79ae0;
    --t-num: #e5b070;
    --t-key: #79a6ff;
    --t-tag: #f08b83;
    --t-attr: #e0a44a;
    --t-flag: #62c5bd;
    --t-var: #b39af3;
    --t-add: #3ec08a;
    --t-del: #f08b83;
  }
}

:root[data-theme="dark"] {
  --ink: #fafafa;
  --ink-strong: #ffffff;
  --prose: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --dim: #52525b;
  --bg: #09090b;
  --surface: #0c0c0f;
  --surface-alt: #18181b;
  --surface-sunk: #232326;
  --border: #27272a;
  --border-soft: #1f1f22;
  --border-strong: #3a3a3f;
  --accent: #f2542d;
  --accent-ink: #ff7a55;
  --accent-soft: #24120c;
  --accent-line: rgba(242, 84, 45, .16);
  --ok: #3ec08a;
  --ok-soft: #10231a;
  --warn: #d79a4a;
  --warn-soft: #241c10;
  --danger: #f08b83;
  --danger-soft: #2a1513;
  --code-bg: #0c0c0f;
  --code-head: #18181b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);

  --t-com: #71717a;
  --t-str: #7fc9a0;
  --t-kw: #d79ae0;
  --t-num: #e5b070;
  --t-key: #79a6ff;
  --t-tag: #f08b83;
  --t-attr: #e0a44a;
  --t-flag: #62c5bd;
  --t-var: #b39af3;
  --t-add: #3ec08a;
  --t-del: #f08b83;
}

:root {
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ring: 0 0 0 3px var(--accent-line);
  --lift: 0 1px 2px rgba(9, 9, 11, .05), 0 12px 28px -20px rgba(9, 9, 11, .35);
}
:root[data-theme="dark"] { --lift: 0 1px 2px rgba(0, 0, 0, .6), 0 18px 40px -24px rgba(0, 0, 0, .9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --lift: 0 1px 2px rgba(0, 0, 0, .6), 0 18px 40px -24px rgba(0, 0, 0, .9); }
}

/* `hidden` doit l'emporter : plusieurs éléments d'interface portent une règle
   d'affichage explicite, qui sinon prend le dessus sur celle du navigateur. */
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ Base -- */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 1.5rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 0 0 8px 0;
  text-decoration: none; font-weight: 500;
}
.skip:focus { left: 0; }

:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Les chiffres qui se comparent d'une ligne à l'autre s'alignent. */
.chapter-position, .page-meta, .sidebar-progress-text, .nav-part-count,
.palette-meta, .table-count, .code-fold-count { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- Shell -- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc);
  align-items: start;
}

.page-preview .shell, .page-home .shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
/* Ces deux pages n'ont pas de troisième colonne : leur plan de page irait
   sinon se poser sous le contenu, en travers de la grille. */
.page-preview .toc, .page-home .toc, .page-preview .toc-fab, .page-home .toc-fab { display: none; }

/* --------------------------------------------------------------- Sommaire -- */

.sidebar {
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  padding: 1.1rem .85rem 2.5rem;
  border-right: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: .875rem;
  scrollbar-width: thin;
}

.sidebar-head {
  position: sticky; top: -1.1rem; z-index: 2;
  margin: -1.1rem -.85rem 0; padding: 1.1rem .85rem .85rem;
  background: var(--surface-alt);
}

.brand { display: flex; align-items: center; gap: .5rem; padding: 0 .5rem; text-decoration: none; color: inherit; }
.brand-mark {
  font-family: var(--font-sans); font-weight: 600; font-size: .95rem;
  color: var(--ink-strong); letter-spacing: -.015em;
  transition: color .15s var(--ease);
}
.brand:hover .brand-mark { color: var(--accent); }
.brand-sub { font-size: .82rem; color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.brand-lang {
  margin-left: auto; font-family: var(--font-mono); font-size: .7rem; font-weight: 500;
  color: var(--muted); letter-spacing: .04em;
}

.sidebar-label, .toc-label {
  margin: 0 0 .6rem; font-size: .74rem; font-weight: 600; letter-spacing: .01em;
  text-transform: none; color: var(--ink);
}
.sidebar-label { display: none; }

.sidebar-filter {
  display: flex; align-items: center; gap: .45rem;
  margin-top: .85rem; padding: 0 .55rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--faint);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.sidebar-filter:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.sidebar-filter input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font: inherit; font-size: .82rem; color: var(--ink); padding: .42rem 0;
}
.sidebar-filter input::placeholder { color: var(--muted); }
.sidebar-filter kbd {
  font-family: var(--font-mono); font-size: .62rem; font-weight: 500; color: var(--muted);
  background: var(--surface-sunk); border-radius: 4px; padding: .1rem .32rem;
}

.sidebar-progress { margin: 1rem .5rem 0; padding-top: .8rem; border-top: 1px solid var(--border); }
.sidebar-progress-head { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); }
.sidebar-progress-head strong { color: var(--ink); font-weight: 500; }
.sidebar-progress-bar {
  height: 3px; margin-top: .55rem; border-radius: 2px;
  background: var(--border); overflow: hidden;
}
.sidebar-progress-bar span {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: var(--accent);
  transition: width .35s var(--ease);
}
.sidebar-progress-text { margin: .45rem 0 0; font-size: .74rem; color: var(--muted); }
.sidebar-progress-text strong { color: var(--ink); font-weight: 500; }
.sidebar-resume {
  display: inline-block; margin-top: .35rem; font-size: .75rem; font-weight: 500;
  color: var(--accent); text-decoration: none;
}
.sidebar-resume:hover { text-decoration: underline; }

.nav-part { margin-top: 1.1rem; }
.nav-part-label {
  display: flex; align-items: center; gap: .35rem; width: 100%;
  margin: 0 0 .3rem; padding: .2rem .5rem; border: 0; background: none;
  font: inherit; font-size: .75rem; font-weight: 600; letter-spacing: .005em;
  text-transform: none; color: var(--ink); cursor: pointer; text-align: left;
  border-radius: 6px; transition: color .15s var(--ease);
}
.nav-part-label:hover { color: var(--accent); background: none; }
.nav-part-label .chevron { transform: rotate(90deg); flex: none; color: var(--dim); transition: transform .18s var(--ease); }
.nav-part-label span:not(.nav-part-count) { flex: 1; }
.nav-part-count { font-size: .66rem; font-weight: 500; color: var(--dim); background: none; padding: 0; }
.nav-part[data-collapsed] .nav-part-label .chevron { transform: rotate(0deg); }
.nav-part[data-collapsed] ul { display: none; }

.nav-part ul { list-style: none; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 1px; }
.nav-part li { margin: 0; }
.nav-part a {
  display: flex; align-items: center; gap: .5rem; position: relative;
  padding: .32rem .5rem; margin: 0; border: 0; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; line-height: 1.35;
  font-size: .845rem; font-weight: 400;
  transition: color .14s var(--ease), background .14s var(--ease);
}
.nav-part a:hover { color: var(--ink); background: var(--border-soft); }
.nav-dot {
  flex: none; width: 3px; height: 14px; border-radius: 2px; margin-left: -2px;
  background: transparent; border: 0;
  transition: background .2s var(--ease);
}
.nav-text { flex: 1; min-width: 0; }
.nav-part a.is-read .nav-text { color: var(--faint); }
.nav-part a.is-read .nav-dot { background: var(--border-strong); }
.nav-part a.is-current {
  color: var(--ink); font-weight: 500; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}
.nav-part a.is-current .nav-dot { background: var(--accent); }
.nav-part a[hidden], .nav-part[hidden] { display: none; }
.nav-text mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 .1em; }
.sidebar-empty { font-size: .82rem; color: var(--muted); padding: .5rem .5rem; }

/* -------------------------------------------------------------- Barre haute -- */

.mainbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .6rem;
  height: var(--topbar); padding: 0 var(--gutter);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.page-home .mainbar, .page-preview .mainbar { padding-right: 1.75rem; }

.crumbs {
  display: flex; align-items: center; gap: .4rem; min-width: 0; margin: 0;
  font-size: .82rem; color: var(--muted); overflow: hidden; white-space: nowrap;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs i { color: var(--dim); font-style: normal; }
.crumbs span[aria-current] { color: var(--ink); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }

.mainbar-tools { margin-left: auto; display: flex; align-items: center; gap: .4rem; }

.search-trigger {
  display: inline-flex; align-items: center; gap: .5rem;
  height: 1.85rem; padding: 0 .35rem 0 .55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: .8rem; cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--ink); }
.search-trigger:focus-visible { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.search-trigger-key {
  font-family: var(--font-mono); font-size: .64rem; font-weight: 500; color: var(--muted);
  border: 0; border-radius: 4px; padding: .1rem .3rem; background: var(--surface-sunk);
}

.lang-switch {
  display: flex; align-items: center; margin: 0; gap: 0;
  font-size: .78rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0; background: var(--surface); overflow: hidden;
}
.lang-switch span, .lang-switch a { padding: .28rem .5rem; border-radius: 0; text-decoration: none; line-height: 1.2; }
.lang-switch span[aria-current] { background: var(--surface-sunk); color: var(--ink); font-weight: 500; }
.lang-switch a { color: var(--muted); font-weight: 500; }
.lang-switch a:hover { color: var(--ink); background: var(--surface-sunk); }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.85rem; height: 1.85rem; padding: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.icon-button:hover { color: var(--ink); border-color: var(--border-strong); }

.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: inline; }
}

.nav-toggle { display: none; flex-direction: column; gap: 3px; }
.nav-toggle span { display: block; width: 14px; height: 1.5px; background: currentColor; }

.mark-read {
  display: inline-flex; align-items: center; gap: .45rem;
  height: 1.85rem; padding: 0 .6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 500;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.mark-read:hover { border-color: var(--border-strong); }
.mark-read-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 11px; height: 11px; border-radius: 3px;
  border: 1.5px solid var(--accent); color: transparent;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.mark-read[aria-pressed="true"] { color: var(--ink); border-color: var(--border-strong); }
.mark-read[aria-pressed="true"] .mark-read-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.mark-read-box svg { width: 8px; height: 8px; }

/* La progression de lecture : un filet de deux pixels au pied de la barre. */
.reading-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: transparent; pointer-events: none;
}
.reading-progress span {
  display: block; height: 100%; width: 0; background: var(--accent);
  transition: width .12s linear;
}

/* --------------------------------------------------------- Plan de la page -- */

.toc {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 2.5rem 1.35rem 3rem;
  border-left: 1px solid var(--border);
  font-size: .82rem;
  scrollbar-width: thin;
}
.toc-label { margin: 0 0 .75rem; font-size: .75rem; font-weight: 600; color: var(--ink); }
.toc ul { list-style: none; margin: 0; padding: 0; border: 0; position: relative; display: flex; flex-direction: column; gap: 1px; }
.toc a {
  display: flex; align-items: center; gap: .55rem; padding: .28rem 0; margin: 0; border: 0;
  color: var(--muted); text-decoration: none; line-height: 1.4;
  transition: color .15s var(--ease);
}
.toc a::before {
  content: ""; flex: none; width: 2px; height: 13px; border-radius: 2px;
  background: transparent; transition: background .18s var(--ease);
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); font-weight: 500; }
.toc a.is-active::before { background: var(--accent); }
.toc-l3 a { padding-left: .7rem; font-size: .78rem; }

.toc-shortcuts { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.toc-shortcuts-label { margin: 0 0 .65rem; font-size: .75rem; font-weight: 600; color: var(--ink); }
.toc-shortcuts dl { margin: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .78rem; color: var(--muted); }
.toc-shortcuts div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.toc-shortcuts dt, .toc-shortcuts dd { margin: 0; }
.toc-shortcuts kbd {
  font-family: var(--font-mono); font-size: .64rem; font-weight: 500;
  background: var(--surface-sunk); border-radius: 4px; padding: .1rem .32rem; color: var(--muted);
}

.toc-top {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.25rem;
  border: 0; background: none; padding: .2rem 0; cursor: pointer;
  font: inherit; font-size: .78rem; color: var(--muted);
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), color .15s var(--ease);
}
.toc-top.is-on { opacity: 1; pointer-events: auto; }
.toc-top:hover { color: var(--accent); }
.toc-slot { display: none; }

.toc-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 45; display: none;
  align-items: center; gap: .45rem; padding: .5rem .85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); box-shadow: var(--lift);
  font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer;
}

/* --------------------------------------------------------------- Contenu -- */

.content { min-width: 0; }
.content-inner { max-width: var(--measure); padding: 2.5rem var(--gutter) 3.5rem; }
.page-preview .content-inner { max-width: none; padding-right: 1.75rem; }
.page-home .content-inner { max-width: 62rem; }

.eyebrow {
  display: flex; align-items: center; gap: .6rem;
  margin: 0 0 .6rem; font-size: .75rem; font-weight: 500; letter-spacing: 0;
  text-transform: none; color: var(--muted);
}
.eyebrow-rule { flex: none; width: 14px; height: 1px; background: var(--border-strong); }

.content h1 {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 1.5rem + 1.7vw, 2.5rem);
  line-height: 1.1; letter-spacing: -.04em;
  margin: 0 0 .6rem; color: var(--ink-strong); font-weight: 600;
}
.content h2 {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-sans);
  font-size: 1.5625rem; line-height: 1.2; font-weight: 600; letter-spacing: -.025em;
  margin: 2.4rem 0 .8rem; padding-top: 0; color: var(--ink-strong);
  border-top: 0;
  scroll-margin-top: calc(var(--topbar) + 1.5rem);
}
.content h3 {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.05rem; font-weight: 600; margin: 1.9rem 0 .55rem; color: var(--ink-strong);
  letter-spacing: -.015em;
  scroll-margin-top: calc(var(--topbar) + 1.5rem);
}
.content h4 { font-size: .95rem; font-weight: 600; margin: 1.4rem 0 .4rem; color: var(--ink); letter-spacing: -.01em; }

.h-text { min-width: 0; }

/* Le croisillon des titres : l'ancre est un signe, pas un bouton flottant. */
.anchor {
  float: none; margin: 0; width: auto; order: 2;
  font-family: var(--font-mono); font-size: .8em; font-weight: 400;
  color: var(--dim); text-decoration: none; opacity: 1;
  transition: color .15s var(--ease);
}
.anchor:hover { color: var(--accent); }
.content h3 .anchor { font-size: .85em; }

/* Le bouton « copier le lien » reste discret : il n'apparaît qu'au survol. */
.heading-link {
  order: 3; border: 0; background: none; padding: .1rem .2rem; margin: 0;
  color: var(--dim); cursor: pointer; opacity: 0; line-height: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease);
}
h2:hover .heading-link, h3:hover .heading-link, .heading-link:focus-visible { opacity: 1; }
.heading-link:hover { color: var(--accent); }
.heading-link.is-done { color: var(--ok); opacity: 1; }

.lead {
  font-size: 1.09rem; line-height: 1.6; color: var(--muted);
  margin: 0 0 1.1rem; padding-bottom: 0; border-bottom: 0;
}

.content p { margin: 0 0 1rem; color: var(--prose); }
.content ul, .content ol { margin: 0 0 1.1rem; padding-left: 1.25rem; color: var(--prose); }
.content li { margin: .28rem 0; }
.content li > ul, .content li > ol { margin: .28rem 0; }

.content strong { color: var(--ink-strong); font-weight: 600; }
.content em { font-style: italic; }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.content blockquote {
  margin: 1.25rem 0; padding: .9rem 1.15rem;
  border: 1px solid var(--border); border-left: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-alt);
  color: var(--prose); font-family: var(--font-sans); font-size: 1rem; font-style: normal;
}
.content blockquote > :last-child { margin-bottom: 0; }

.content :not(pre) > code {
  font-family: var(--font-mono); font-size: .84em; font-weight: 450;
  background: var(--surface-sunk); border: 0;
  padding: .1em .35em; border-radius: 4px; color: var(--ink-strong);
  word-break: break-word;
}

/* Tête de chapitre */
.page-head { margin-bottom: 1.6rem; }
.page-head h1 { margin-top: .35rem; }
.page-head .lead { margin-bottom: 1rem; }

.page-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin: 0; padding-bottom: 1.1rem; border-bottom: 1px solid var(--border);
  font-size: .78rem; color: var(--muted);
}
.page-meta i { font-style: normal; color: var(--dim); }
.page-badge { font-size: .78rem; color: var(--muted); background: none; border: 0; padding: 0; border-radius: 0; }
.page-copy-link {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem;
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: .78rem; color: var(--ink);
  transition: color .15s var(--ease);
}
.page-copy-link:hover { color: var(--accent); }
.page-copy-link.is-done { color: var(--ok); }

/* --------------------------------------------------------- Blocs de code -- */

figure.code {
  position: relative; margin: 1.25rem 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--code-bg); box-shadow: none;
}
.code-head {
  display: flex; align-items: center; gap: .55rem;
  padding: 0 .5rem 0 .8rem; min-height: 2.15rem;
  background: var(--surface-alt); border-bottom: 1px solid var(--border);
}
.code-lang {
  font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim);
  border: 0; border-radius: 4px; padding: 0;
}
.code-title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  letter-spacing: 0; color: var(--muted); text-transform: none;
}
.code-actions { display: flex; align-items: center; gap: .15rem; margin-left: auto; }
.code-button, .code-copy {
  display: inline-flex; align-items: center; gap: .3rem;
  border: 0; border-radius: 5px; background: none;
  color: var(--muted); font: inherit; font-family: var(--font-mono); font-size: .68rem;
  padding: .2rem .4rem; cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.code-button:hover, .code-copy:hover { color: var(--ink); background: var(--surface-sunk); }
.code-button.is-done, .code-copy.is-done { color: var(--ok); background: none; }
.code-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
figure.code.is-wrapped pre { white-space: pre-wrap; word-break: break-word; }

figure.code pre {
  margin: 0; padding: .85rem 1rem; overflow-x: auto;
  font-family: var(--font-mono); font-size: .795rem; line-height: 1.7;
  tab-size: 2;
}
figure.code code { font: inherit; color: var(--prose); }
.code-source { position: absolute; left: -9999px; }

.code-body { position: relative; }
figure.code.is-folded .code-body { max-height: 21rem; overflow: hidden; }
figure.code.is-folded .code-body::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 5rem;
  background: linear-gradient(to bottom, transparent, var(--code-bg));
  pointer-events: none;
}
.code-fold {
  display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
  border: 0; border-top: 1px solid var(--border); background: var(--surface-alt);
  color: var(--muted); font: inherit; font-size: .74rem; font-weight: 500;
  padding: .4rem; cursor: pointer; transition: color .15s var(--ease);
}
.code-fold:hover { color: var(--accent); }
.code-fold-count { font-weight: 400; color: var(--dim); }

.t-com { color: var(--t-com); font-style: italic; }
.t-str { color: var(--t-str); }
.t-kw { color: var(--t-kw); font-weight: 500; }
.t-num { color: var(--t-num); }
.t-key { color: var(--t-key); }
.t-tag { color: var(--t-tag); }
.t-attr { color: var(--t-attr); }
.t-flag { color: var(--t-flag); }
.t-var { color: var(--t-var); }
.t-add { color: var(--t-add); }
.t-del { color: var(--t-del); }

/* -------------------------------------------------------------- Encadrés -- */

/* Un filet de deux pixels à gauche, et rien d'autre : la couleur ne remplit
   pas le bloc, elle le désigne. */
.note, .warn, .danger, .ok, .rule {
  margin: 1.25rem 0; padding: .9rem 1.15rem;
  border: 1px solid var(--border); border-left: 2px solid var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface); font-size: .92rem; color: var(--muted);
}
.note > :last-child, .warn > :last-child, .danger > :last-child,
.ok > :last-child, .rule > :last-child { margin-bottom: 0; }
.note p, .warn p, .danger p, .ok p, .rule p { color: inherit; }

.note { border-left-color: var(--accent); background: var(--surface); }
.warn { border-left-color: var(--warn); }
.danger { border-left-color: var(--danger); }
.ok { border-left-color: var(--ok); }
.rule { border-left-color: var(--ink); }

.note-label {
  display: block; font-size: .78rem; font-weight: 600; letter-spacing: 0;
  text-transform: none; margin-bottom: .25rem; color: var(--ink);
}
.note .note-label, .warn .note-label, .danger .note-label,
.ok .note-label, .rule .note-label { color: var(--ink); }
.note-label::before { display: none; }

[data-callout] { position: relative; }

/* --------------------------------------------------------------- Tableaux -- */

.table-wrap {
  overflow-x: auto; margin: 1.25rem 0;
  border: 1px solid var(--border); border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: .875rem; background: var(--surface); }
th, td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
thead th {
  background: var(--surface-alt); font-size: .75rem; text-transform: none;
  letter-spacing: .01em; color: var(--ink); font-weight: 600; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody { color: var(--prose); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--surface-alt); }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--surface-sunk); }
tbody tr[hidden] { display: none; }
td code, th code { white-space: nowrap; }
td strong:first-child { color: var(--ink-strong); font-weight: 550; }

.table-wrap.is-large { border-radius: var(--radius); max-height: 32rem; overflow: auto; }
.table-filter {
  display: flex; align-items: center; gap: .45rem;
  padding: .4rem .6rem; border-bottom: 1px solid var(--border);
  background: var(--surface-alt); color: var(--muted);
}
.table-filter input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font: inherit; font-size: .82rem; color: var(--ink);
}
.table-filter input::placeholder { color: var(--muted); }
.table-filter .table-count { font-size: .7rem; color: var(--dim); }
.table-wrap.is-large thead th { position: sticky; top: 0; z-index: 1; }
.table-empty { padding: .8rem; font-size: .84rem; color: var(--muted); }

/* ----------------------------------------------------------------- Blocs -- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; margin: 1.25rem 0; }
.card {
  padding: 1.05rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-alt); box-shadow: none;
}
.card h3, .card h4 { margin-top: 0; font-size: 1rem; }
.card > :last-child { margin-bottom: 0; }
a.card {
  text-decoration: none; color: inherit; display: block; background: var(--surface);
  transition: border-color .16s var(--ease);
}
a.card:hover { border-color: var(--ink); transform: none; box-shadow: none; }
.card-kicker {
  font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 0 0 .35rem; font-weight: 500;
}

/* Les étapes : une rangée numérotée par ligne, filets pleine largeur. */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.25rem 0; }
.steps > li {
  counter-increment: step; position: relative;
  display: block; padding: .95rem 0 .95rem 2.6rem; margin: 0;
  border-left: 0; border-top: 1px solid var(--border); margin-left: 0;
  transition: opacity .2s var(--ease);
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: .95rem;
  width: auto; height: auto; border-radius: 0;
  display: block; background: none; border: 0;
  font-family: var(--font-mono); font-size: .74rem; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.steps > li:last-child { border-bottom: 1px solid var(--border); padding-bottom: .95rem; }
.steps > li > :first-child { margin-top: 0; }
.steps > li > :last-child { margin-bottom: 0; }
.steps h3, .steps h4 { margin-top: 0; font-size: .95rem; font-weight: 550; }

.steps[data-steps] > li { padding-right: 2.2rem; position: relative; }
.step-check {
  position: absolute; right: 0; top: 1rem;
  width: 1.25rem; height: 1.25rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: 5px;
  background: var(--surface); color: transparent; cursor: pointer;
  transition: all .16s var(--ease);
}
.step-check:hover { border-color: var(--accent); }
.step-check svg { width: 12px; height: 12px; }
.steps > li.is-done .step-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps > li.is-done > .step-body, .steps > li.is-done > p, .steps > li.is-done > h3, .steps > li.is-done > h4 { opacity: .5; }
.steps > li.is-done::before { background: none; border: 0; color: var(--accent); }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .75rem; margin: 1.25rem 0; }
.compare > div {
  padding: 1rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-alt);
}
.compare .yes { border-color: var(--ink); background: var(--surface); }
.compare .no { border-left: 1px solid var(--border); }
.compare h4 { margin-top: 0; }
.compare > div > :last-child { margin-bottom: 0; }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 1.25rem 0; font-size: .8rem; }
.flow span {
  padding: .3rem .65rem; border-radius: var(--radius-sm); background: var(--surface-alt);
  border: 1px solid var(--border); font-family: var(--font-mono); white-space: nowrap; color: var(--prose);
}
.flow i { color: var(--dim); font-style: normal; }

.kbd, .toc-shortcuts kbd {
  font-family: var(--font-mono); font-size: .78em; font-weight: 500; padding: .1em .38em;
  border: 0; border-radius: 4px;
  background: var(--surface-sunk); color: var(--muted);
}

.pill {
  display: inline-block; font-family: var(--font-mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .02em; text-transform: uppercase; padding: .1rem .45rem; border-radius: 100px;
  background: var(--surface-sunk); color: var(--muted); border: 0;
}
.pill.is-ok { background: var(--ok-soft); color: var(--ok); }
.pill.is-warn { background: var(--warn-soft); color: var(--warn); }
.pill.is-danger { background: var(--danger-soft); color: var(--danger); }
.pill.is-accent { background: var(--accent-soft); color: var(--accent); }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 1.6rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .45rem;
  width: .95rem; height: .95rem; border-radius: 4px;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.checklist[data-checklist] li { cursor: pointer; user-select: none; border-radius: 6px; transition: background .15s var(--ease); }
.checklist[data-checklist] li:hover { background: var(--surface-alt); }
.checklist[data-checklist] li.is-done { color: var(--faint); }
.checklist[data-checklist] li.is-done::before { background: var(--accent); border-color: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: .87rem; }

/* ----------------------------------------------------------------- Onglets -- */

.tabs { margin: 1.25rem 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tabs-bar {
  position: relative; display: flex; gap: 0; padding: 0 .35rem;
  background: var(--surface-alt); border-bottom: 1px solid var(--border); overflow-x: auto;
}
.tabs-tab {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 500; color: var(--muted);
  padding: .55rem .55rem; border-radius: 0; white-space: nowrap;
  transition: color .15s var(--ease);
}
.tabs-tab[aria-selected="true"] { color: var(--ink); }
.tabs-tab:hover { color: var(--ink); }
.tabs-ink {
  position: absolute; z-index: 0; top: auto; bottom: 0; left: 0; width: 0; height: 1.5px;
  background: var(--ink); border-radius: 0; box-shadow: none;
  transition: transform .22s var(--ease), width .22s var(--ease);
}
.tabs-panel { padding: 1rem 1.1rem; }
.tabs-panel > :first-child { margin-top: 0; }
.tabs-panel > :last-child { margin-bottom: 0; }
.tabs-panel figure.code { margin: 0; border: 0; }
.tabs-fallback { display: none; }
.tabs:not([data-tabs]) .tabs-fallback { display: block; font-weight: 600; }

/* ---------------------------------------------------------------- Pager -- */

.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.pager-link {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; background: var(--surface);
  transition: border-color .16s var(--ease);
}
.pager-link:hover { border-color: var(--ink); transform: none; box-shadow: none; }
.pager-next { text-align: right; }
.pager-dir { font-size: .78rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
.pager-title { color: var(--ink-strong); font-weight: 550; font-size: .9rem; }

.chapter-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  margin: 2.25rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--border);
}
.chapter-position { margin: 0 0 0 auto; font-size: .78rem; color: var(--muted); }

/* --------------------------------------------------------------- Accueil -- */

.hero { padding: .5rem 0 2.25rem; }
.hero h1 {
  font-family: var(--font-sans); font-weight: 600;
  font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.1rem); line-height: 1.05;
  letter-spacing: -.042em; margin: .5rem 0 1rem; color: var(--ink-strong);
}
.hero .hero-lead { font-size: 1.1rem; color: var(--muted); max-width: 40rem; margin: 0 0 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.button {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.05rem; border-radius: 8px; font-weight: 500; font-size: .875rem;
  text-decoration: none; border: 1px solid transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.button-primary { background: var(--ink); color: var(--bg); }
.button-primary:hover { background: var(--ink-strong); color: var(--bg); }
.button-ghost { border-color: var(--border); color: var(--ink); background: var(--surface); }
.button-ghost:hover { border-color: var(--ink); color: var(--ink); }

.hero-meta { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .82rem; color: var(--muted); }

.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .75rem; margin: 1.25rem 0 2.5rem; }

/* ---------------------------------------------------------------- Footer -- */

/*
 * Le pied de page, et pourquoi il porte un cran de specificite de plus.
 *
 * `inline-core/styles/tokens.css` est injecte dans la page par l'integration,
 * et il ne contient pas que les classes `cms-*` : il porte aussi le mobilier
 * du site modele — `.page`, `.site-nav`, `.site-footer`, `.hero`. Deux de ces
 * noms existent ici, et cette feuille passant AVANT, ce sont les siens qui
 * gagnaient a specificite egale.
 *
 * Ce qu'on y perdait, sur toutes les pages de documentation : les variables
 * qu'il lit (`--space-3`, `--color-border`, et `--color-muted` / `--size-sm`
 * qui ne sont definis que sous `.content`) n'existent pas ici. Ses
 * declarations devenaient invalides au calcul, donc `unset` : plus de filet,
 * plus de marges, et surtout un texte qui HERITE de la couleur et de la taille
 * du corps au lieu de son gris discret. Discutable en clair, franchement
 * mauvais en sombre, ou le pied passait au blanc.
 *
 * `body` devant le selecteur suffit a rendre a cette feuille ce qui lui
 * appartient. Les deux premieres lignes annulent ce que l'autre impose.
 */
body .site-footer {
  max-width: none;
  margin: 0;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 1.75rem var(--gutter) 2.25rem;
  color: var(--muted); font-size: .82rem;
}
.site-footer-inner { max-width: 84rem; margin: 0 auto; display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; align-items: baseline; }
.site-footer p { margin: 0; }
.site-footer .muted { margin-left: auto; font-family: var(--font-mono); font-size: .74rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* -------------------------------------------------------- Palette de recherche -- */

.palette { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; }
.palette[hidden] { display: none; }
.palette-backdrop {
  position: absolute; inset: 0; background: rgba(10, 10, 11, .32);
  animation: palette-fade .16s var(--ease);
}
.palette-box {
  position: relative; width: min(33rem, calc(100vw - 2rem));
  margin-top: min(10vh, 5rem); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 24px 48px -12px rgba(9, 9, 11, .28);
  overflow: hidden; animation: palette-pop .18s var(--ease);
}
@keyframes palette-fade { from { opacity: 0; } }
@keyframes palette-pop { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .palette-backdrop, .palette-box { animation: none; } }

.palette-field {
  display: flex; align-items: center; gap: .65rem;
  padding: .8rem .95rem; border-bottom: 1px solid var(--border); color: var(--muted);
}
.palette-field input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font: inherit; font-size: .94rem; color: var(--ink);
}
.palette-field input::placeholder { color: var(--muted); }
.palette-field input::-webkit-search-cancel-button { display: none; }
.palette-esc {
  border: 0; border-radius: 4px; background: var(--surface-sunk);
  color: var(--muted); font: inherit; font-family: var(--font-mono);
  font-size: .64rem; font-weight: 500; padding: .12rem .4rem; cursor: pointer;
}
.palette-esc:hover { color: var(--ink); }

.palette-results { max-height: min(58vh, 27rem); overflow-y: auto; padding: .45rem .45rem .3rem; }
.palette-group {
  padding: .4rem .55rem .2rem; font-size: .72rem; font-weight: 500; letter-spacing: 0;
  text-transform: none; color: var(--muted);
}
.palette-group + .palette-group,
.palette-item + .palette-group { margin-top: .3rem; border-top: 1px solid var(--border-soft); padding-top: .55rem; }
.palette-item {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .5rem .55rem; border-radius: 8px; text-decoration: none; color: inherit;
  border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
}
.palette-item:hover { background: var(--surface-alt); }
.palette-item.is-active { background: var(--surface-sunk); outline: none; }
.palette-kind {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; border-radius: 0; background: none;
  color: var(--muted); font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.palette-item.is-active .palette-kind { background: none; color: var(--accent); }
.palette-body { min-width: 0; flex: 1; }
.palette-title { display: block; font-size: .845rem; font-weight: 550; color: var(--ink-strong); }
.palette-title mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 .1em; }
.palette-sub { display: block; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-meta { flex: none; font-size: .74rem; color: var(--muted); }
.palette-empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); }
.palette-empty p { margin: .2rem 0; }
.palette-empty .palette-hint { font-size: .82rem; color: var(--dim); }
.palette-foot {
  display: flex; gap: .9rem; padding: .55rem .95rem; border-top: 1px solid var(--border);
  background: var(--surface-alt); font-size: .72rem; color: var(--muted);
}
.palette-foot span:last-child { margin-left: auto; }
.palette-foot kbd {
  font-family: var(--font-mono); font-size: .66rem; border: 0;
  border-radius: 4px; padding: 0 .25rem; background: var(--surface-sunk); margin-right: .15rem;
}
@media (max-width: 560px) { .palette-foot { display: none; } }

/* -------------------------------------------------------------- Animations -- */

[data-reveal] { opacity: 0; transform: translateY(8px); }
[data-reveal].is-in { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal].is-in { opacity: 1; transform: none; transition: none; }
}

.flow[data-flow] span { transition: transform .3s var(--ease), border-color .3s var(--ease); }
.flow[data-flow].is-in span { animation: flow-pop .4s var(--ease) both; animation-delay: calc(var(--n, 0) * .07s); }
@keyframes flow-pop { from { opacity: 0; transform: translateY(6px); } }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); z-index: 95;
  background: var(--ink); color: var(--bg); font-size: .82rem; font-weight: 500;
  padding: .45rem .85rem; border-radius: var(--radius-sm); box-shadow: var(--lift);
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ Responsive -- */

@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .toc { display: none; }
  .toc-fab { display: inline-flex; }
  .shell.has-toc-open .toc {
    display: block; position: fixed; inset: auto 0 0 0; z-index: 46;
    max-height: 65vh; height: auto; overflow-y: auto; background: var(--surface);
    border-top: 1px solid var(--border); border-left: 0; border-radius: 12px 12px 0 0;
    padding: 1rem 1.25rem 4.5rem; box-shadow: 0 -12px 40px -20px rgba(0, 0, 0, .5);
  }
}

@media (max-width: 1000px) {
  :root { --gutter: 1.35rem; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: min(19rem, 84vw); height: 100vh; max-height: none;
    border-right: 1px solid var(--border);
    padding: 1.1rem 1.1rem 3rem;
    transform: translateX(-102%); transition: transform .2s var(--ease);
    box-shadow: var(--lift);
  }
  .sidebar.is-open { transform: none; }
  /* Il ne reste que la page courante : trois niveaux dans une barre de
     trois centimètres ne disent rien de plus qu'un seul. */
  .crumbs { font-size: .82rem; }
  .crumbs > *:not([aria-current]) { display: none; }
  .search-trigger-label, .search-trigger-key { display: none; }
  .search-trigger { padding: 0 .45rem; }
  .mark-read span:not(.mark-read-box) { display: none; }
  .mark-read { padding: 0 .5rem; }
  .pager { grid-template-columns: 1fr; }
  .site-footer { padding-left: 1.35rem; padding-right: 1.35rem; }
}

@media (max-width: 560px) {
  .lang-switch { display: none; }
  /* Le cran, et non la taille : la zone éditable est un span posé dans le
     titre, et sa classe `cms-size-3xl` l'emporterait sur cette règle. */
  .content h1 { font-size: 1.9rem; --size-3xl: 1.9rem; }
  .page-copy-link { display: none; }
}

@media print {
  .mainbar, .sidebar, .toc, .pager, .site-footer, .code-copy, .code-actions,
  .reading-progress, .toc-fab, .palette, .search-trigger, .chapter-foot { display: none !important; }
  .shell { display: block; }
  .content-inner { max-width: none; padding: 0; }
  figure.code, .card, .note, .warn, .danger, .ok, .rule { break-inside: avoid; }
  figure.code.is-folded .code-body { max-height: none; }
  figure.code.is-folded .code-body::after, .code-fold { display: none; }
  body { font-size: 11pt; }
}

/* ------------------------------------------------- Les tokens de style -- */
/*
 * Les titres et les chapôs de la documentation sont des champs « text » : le
 * client règle leur taille, leur graisse et leur couleur sur la page, et
 * `inline-core/styles/tokens.css` traduit ces crans en classes `cms-*`.
 *
 * Deux choses sont nécessaires pour que le réglage se voie, et aucune ne va
 * de soi.
 *
 * 1. Les crans sont relatifs. `cms-size-2xl` vaut `var(--size-2xl)` : sans
 *    définition, la déclaration est invalide et le réglage reste sans effet.
 *    C'est donc ici que l'échelle prend ses valeurs — et le cran posé à la
 *    reprise doit reproduire exactement la maquette, pour qu'un titre jamais
 *    retouché ne change pas d'allure. Voir `TITRES` dans
 *    `scripts/importer-docs.mjs` : les deux listes se répondent, et modifier
 *    l'une sans l'autre déplace la typographie de toute la documentation.
 *
 * 2. La spécificité. `.content h4` vaut (0,1,1) et `.cms-size-base` (0,1,0) :
 *    la feuille l'emporterait sur le client, et son réglage n'aurait aucun
 *    effet. Les classes sont donc réaffirmées sous `.content`, où elles valent
 *    (0,2,0). Rien n'est réaffirmé hors de `.content` : un titre non éditable
 *    garde la typographie de la page, sans exception à retenir.
 *
 * Une limite, qui tient à la structure et non à cette feuille : sur un `h2` ou
 * un `h3`, la zone éditable est un `<span>` posé dans le titre — l'ancre de
 * lien occupe le reste. L'alignement n'a donc pas d'effet sur ces deux-là.
 * Taille, graisse et couleur, si. Sur un `h4`, où la zone est le titre entier,
 * les quatre réglages fonctionnent.
 */
.content {
  --size-xs: .75rem;
  --size-sm: .875rem;
  --size-base: 1rem;
  --size-lg: 1.09rem;
  --size-xl: 1.25rem;
  --size-2xl: 1.5625rem;
  --size-3xl: clamp(2rem, 1.5rem + 1.7vw, 2.5rem);

  --weight-thin: 200;
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --color-primary: var(--ink-strong);
  --color-secondary: var(--ink);
  --color-muted: var(--muted);
  --color-accent: var(--accent);
  --color-inverse: var(--bg);
}

/* Ce que valent les crans, là où la maquette s'écarte de l'échelle. L'ordre
   compte : à spécificité égale, la dernière règle l'emporte. */
.content h3 { --size-lg: 1.05rem; }
.content h4 { --size-base: .95rem; }
.card h3, .card h4 { --size-lg: 1rem; --size-base: 1rem; }
/* Dans une étape, « Demi-gras » vaut 550 : le titre y côtoie le corps de
   l'étape, et le cran 600 les décollerait l'un de l'autre. */
.steps h3, .steps h4 { --size-lg: .95rem; --size-base: .95rem; --weight-semibold: 550; }

.content .cms-size-xs { font-size: var(--size-xs); }
.content .cms-size-sm { font-size: var(--size-sm); }
.content .cms-size-base { font-size: var(--size-base); }
.content .cms-size-lg { font-size: var(--size-lg); }
.content .cms-size-xl { font-size: var(--size-xl); }
.content .cms-size-2xl { font-size: var(--size-2xl); }
.content .cms-size-3xl { font-size: var(--size-3xl); }

.content .cms-weight-thin { font-weight: var(--weight-thin); }
.content .cms-weight-light { font-weight: var(--weight-light); }
.content .cms-weight-regular { font-weight: var(--weight-regular); }
.content .cms-weight-medium { font-weight: var(--weight-medium); }
.content .cms-weight-semibold { font-weight: var(--weight-semibold); }
.content .cms-weight-bold { font-weight: var(--weight-bold); }

.content .cms-italic { font-style: italic; }

.content .cms-align-left { text-align: left; }
.content .cms-align-center { text-align: center; }
.content .cms-align-right { text-align: right; }

.content .cms-color-primary { color: var(--color-primary); }
.content .cms-color-secondary { color: var(--color-secondary); }
.content .cms-color-muted { color: var(--color-muted); }
.content .cms-color-accent { color: var(--color-accent); }
.content .cms-color-inverse { color: var(--color-inverse); }
