/* Site de documentation DS-CG : gabarit et blocs de documentation.
   Ces classes (site-*, doc-*) ne font pas partie du design system livré. */

html { scroll-padding-top: 88px; }
body { min-height: 100vh; display: flex; flex-direction: column; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
html { scrollbar-color: var(--border-strong) transparent; }

/* Barre d'évitement : repliée au repos (liens toujours atteignables au Tab),
   elle s'ouvre dans le flux dès qu'un de ses liens a le focus et pousse l'en-tête vers le bas. */
.site-skip { height: 0; overflow: hidden; background: var(--bg-subtle); }
.site-skip:focus-within { height: auto; overflow: visible; border-bottom: 1px solid var(--border); }
.site-skip__inner {
  max-width: 1280px; margin: 0 auto; padding: 8px var(--gutter);
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.site-skip a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--accent-text);
}
.site-skip a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
/* Navigation : les rubriques en grand écran, le bouton du menu en dessous (le tiroir sans JavaScript) */
.site-skip .site-skip__menu, .site-skip .site-skip__drawer { display: none; }
@media (max-width: 1023px) {
  .site-skip .site-skip__nav { display: none; }
  .js .site-skip .site-skip__menu { display: inline-flex; }
  html:not(.js) .site-skip .site-skip__drawer { display: inline-flex; }
}
/* Cibles atteintes par la barre : lues, sans anneau (ce ne sont pas des commandes) */
.site-nav:focus, .site-drawer:focus, .site-footer:focus { outline: none; }

/* En-tête */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: 1280px; margin: 0 auto; height: 64px;
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 32px;
}
.site-logo {
  display: inline-flex; align-items: baseline; gap: 2px;
  color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -.01em;
}
.site-logo:hover, .site-logo:active { text-decoration: none; color: var(--text); }
.site-logo span { color: var(--accent-text); }
.site-logo small { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
@media (hover: hover) {
  .site-nav a:hover { color: var(--text); background: var(--bg-subtle); text-decoration: none; }
}
.site-nav a:active { color: var(--text); background: var(--border); text-decoration: none; }
.site-nav a[aria-current] { cursor: default; }
.site-nav a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--r-sm) var(--r-sm) 0 0; }

.site-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--r-full); background: transparent; color: var(--text-muted);
  cursor: pointer; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.site-iconbtn svg { width: 20px; height: 20px; }
@media (hover: hover) { .site-iconbtn:hover { background: var(--bg-subtle); color: var(--text); } }
.site-iconbtn:active { background: var(--border); color: var(--text); }
/* Ouvert (aria-expanded) : garde le fond appuyé */
.site-iconbtn[aria-expanded="true"] { background: var(--border); color: var(--text); }
.site-iconbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 3px var(--focus-ring); color: var(--text); }
.site-theme .icon-moon, [data-theme-current="dark"] .site-theme .icon-sun { display: block; }
.site-theme .icon-sun, [data-theme-current="dark"] .site-theme .icon-moon { display: none; }
.site-menu-btn { display: none; }
.site-menu-btn .icon-close, .site-menu-btn[aria-expanded="true"] .icon-menu { display: none; }
.site-menu-btn[aria-expanded="true"] .icon-close { display: block; }

/* Corps : barre latérale + contenu */
.site-body {
  flex: 1; width: 100%; max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 248px minmax(0, 1fr);
  gap: 56px; padding: 0 var(--gutter);
}
.site-sidebar {
  position: sticky; top: 64px; align-self: start;
  max-height: calc(100vh - 64px); overflow-y: auto; overscroll-behavior: contain;
  padding: 40px 8px 48px 0; scrollbar-gutter: stable;
}
.site-sidebar h2 {
  font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 500;
  color: var(--text-muted); letter-spacing: .02em; margin: 0 12px 8px;
}
.site-sidebar ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.site-sidebar a {
  display: flex; align-items: center; min-height: 36px; padding: 6px 12px;
  border-radius: var(--r-sm); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-muted);
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
@media (hover: hover) {
  .site-sidebar a:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
}
.site-sidebar a:focus-visible { outline-offset: -2px; }
.site-sidebar a:active { background: var(--border); color: var(--text); text-decoration: none; }
.site-sidebar a[aria-current="page"],
.site-sidebar a[aria-current="page"]:hover,
.site-sidebar a[aria-current="page"]:active { background: var(--accent-soft); color: var(--accent-text); cursor: default; }
.site-sidebar .site-sidebar__group + .site-sidebar__group { margin-top: 24px; }

.site-main { min-width: 0; padding: 48px 0 128px; }
.site-main:focus { outline: none; }
.site-content { max-width: 800px; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); }
.site-footer__inner {
  max-width: 1280px; margin: 0 auto; padding: 32px var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  font-size: 14px; color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }
@media (hover: hover) { .site-footer a:hover { color: var(--text); } }
.site-footer a:active { color: var(--text); }
.site-footer__links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; margin: 0; padding: 0; list-style: none; }
.site-footer__links li { display: flex; align-items: center; }
.site-footer__links li + li::before { content: ""; width: 1px; height: 16px; margin: 0 16px; background: var(--border); }
/* Téléphone : sans séparateurs, qui resteraient seuls en début de ligne quand les liens passent à la ligne */
@media (max-width: 479px) {
  .site-footer__links { gap: 8px 24px; }
  .site-footer__links li + li::before { display: none; }
}
.site-footer__theme { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font: inherit; font-weight: 500; color: var(--text-muted); cursor: pointer; }
@media (hover: hover) { .site-footer__theme:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; } }
.site-footer__theme:active { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.site-footer__theme svg { width: 16px; height: 16px; }

/* Tiroir mobile */
.site-drawer { display: none; }

@media (max-width: 1023px) {
  .site-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .site-sidebar { display: none; }
  .site-nav { display: none; }
  .site-menu-btn { display: inline-grid; }
  .site-main { padding-top: 32px; padding-bottom: 96px; }
  .site-drawer {
    position: fixed; inset: 64px 0 0 0; z-index: 39;
    background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
    padding: 16px var(--gutter) 48px;
  }
  .site-drawer:not([hidden]) { display: block; animation: site-in var(--dur-open) var(--ease); }
  .site-drawer nav + nav { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
  .site-drawer h2 { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-muted); margin: 0 12px 8px; }
  .site-drawer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .site-drawer a {
    display: flex; align-items: center; min-height: 44px; padding: 0 12px;
    border-radius: var(--r-sm); font-size: 16px; font-weight: 500; color: var(--text);
  }
  .site-drawer a { transition: background-color var(--dur-fast) ease; }
  @media (hover: hover) { .site-drawer a:hover { background: var(--bg-subtle); text-decoration: none; } }
  .site-drawer a:active { background: var(--border); color: var(--text); text-decoration: none; }
  .site-drawer a[aria-current],
  .site-drawer a[aria-current]:hover,
  .site-drawer a[aria-current]:active { background: var(--accent-soft); color: var(--accent-text); cursor: default; }
  body.site-drawer-open { overflow: hidden; }
  /* Sans JavaScript : pas de bouton, le menu s’affiche en entier sous l’en-tête */
  html:not(.js) .site-menu-btn { display: none; }
  html:not(.js) .site-drawer { display: block; position: static; padding-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
}
@keyframes site-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 767px) {
  .site-header__inner { gap: 12px; }
  .site-logo small { display: none; }
}

/* ───────── Blocs de documentation ───────── */

.doc-crumbs { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.doc-crumbs a { color: var(--text-muted); }
@media (hover: hover) { .doc-crumbs a:hover { color: var(--text); } }
.doc-crumbs a:active { color: var(--text); }

.doc-title { margin-bottom: 16px; }
.doc-intro { max-width: 640px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.doc-meta a { color: var(--text-muted); text-decoration: underline; text-decoration-color: var(--border-strong); }
@media (hover: hover) { .doc-meta a:hover { color: var(--text); text-decoration-color: currentColor; } }
.doc-meta a:active { color: var(--text); text-decoration-color: currentColor; }

.doc-prose { max-width: 68ch; }
.doc-prose > * + * { margin-top: 16px; }
.doc-prose h2 { margin-top: 64px; }
.doc-prose h3 { margin-top: 40px; }
.doc-prose h2 + *, .doc-prose h3 + * { margin-top: 12px; }
.doc-prose ul, .doc-prose ol { padding-left: 22px; }
.doc-prose li + li { margin-top: 6px; }
.doc-prose li::marker { color: var(--text-muted); }
.doc-prose :not(pre) > code {
  padding: 2px 6px; border-radius: 6px; background: var(--bg-subtle);
  border: 1px solid var(--border); font-size: 13px; white-space: nowrap;
}
.doc-prose strong { font-weight: 600; }

.doc-section { margin-top: 64px; }
.doc-section > h2 { margin-bottom: 12px; }
.doc-section > h3 { margin: 40px 0 12px; }
.doc-section > p { max-width: 68ch; }
.doc-section > p + p { margin-top: 12px; }
.doc-section > .doc-demo + p { margin-top: 16px; }
.doc-section > .doc-table-wrap + .doc-prose,
.doc-section > .doc-prose + p,
.doc-section > .doc-prose + .doc-code { margin-top: 16px; }

/* Onglets de page composant */
.doc-tabs {
  position: sticky; top: 64px; z-index: 5;
  display: flex; gap: 28px; margin-top: 40px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.doc-tabs[hidden] { display: none; }
.doc-tabs::-webkit-scrollbar { display: none; }
.doc-tabs [role="tab"] {
  position: relative; flex: none; height: 48px; padding: 0;
  border: 0; background: none; cursor: pointer;
  font-size: 15px; font-weight: 500; color: var(--text-muted);
  transition: color var(--dur-fast) ease;
}
@media (hover: hover) { .doc-tabs [role="tab"]:hover { color: var(--text); } }
.doc-tabs [role="tab"]:active { color: var(--text); }
.doc-tabs [role="tab"]:not([aria-selected="true"]):active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text-muted);
}
.doc-tabs [role="tab"][aria-selected="true"] { color: var(--text); }
.doc-tabs [role="tab"][aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
}
.doc-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; color: var(--text); border-radius: 6px; }
.doc-panel { padding-top: 8px; }
.doc-panel:focus { outline: none; }
.doc-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 4px; }
.doc-panel > .doc-section:first-child { margin-top: 40px; }
.js .doc-panel[hidden] { display: none; }

/* Aperçu de démo */
.doc-demo {
  margin-top: 16px;
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
}
.doc-demo__stage {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 40px 32px; background: var(--bg);
}
.doc-demo__stage--subtle { background: var(--bg-subtle); }
.doc-demo__stage--column { flex-direction: column; align-items: stretch; }
.doc-demo__stage--center { justify-content: center; }
/* Mises en page des démos (pour garder les exemples sans style écrit dans le HTML) */
.doc-demo__stage > p { max-width: 68ch; }
.doc-demo__stage--fill > * { width: 100%; }
.doc-demo__stage--row > * { display: flex; flex-wrap: wrap; gap: 12px; }
.doc-demo__stage--narrow > * { width: 100%; max-width: 280px; }
.doc-demo__stage--phone > * { width: 100%; max-width: 375px; margin-inline: auto; }
.doc-demo__stage--phone > p { max-width: 375px; }
.doc-demo__stage--list > ul { list-style: none; padding: 0; display: grid; gap: 12px; max-width: 420px; }
.doc-demo__stage--list > ul > li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* Démos avec une couche flottante (infobulle, menu) : de la place pour qu’elle ne soit pas coupée par le cadre */
.doc-demo .doc-demo__stage--pop { padding-block: 72px; }
.doc-toolbar { display: flex; gap: 4px; }
.doc-push-end { margin-left: auto; }
.doc-demo__stage--menu { align-items: flex-start; min-height: 340px; }
/* Aperçu figé d'un menu, dans « À faire, à éviter » */
.menu.doc-menu-static { position: static; display: flex; opacity: 1; transform: none; }
.doc-demo__stage--mini .modal-scene { padding: 24px 16px; }
.doc-demo__stage--mini .modal { padding: 20px; }
.doc-demo__stage--mini .modal__actions { margin-top: 16px; }
.doc-demo__stage--mini .topnav-scene { min-height: 0; }
/* Aperçus réduits : garder la présentation large de l’en-tête malgré la petite taille du cadre (pas sur téléphone, où elle déborderait) */
@media (min-width: 640px) { .doc-demo__stage--mini .topnav { container-type: normal; } }
.doc-demo__stage--mini .topnav__menu > .topnav__actions:first-child { margin-left: auto; }
.doc-demo__stage--phone .modal-scene { padding: 48px var(--space-5); }
/* Aperçus « À la largeur d'un téléphone » : reprendre dans le cadre de 375 px ce que les composants font sous 768 px d'écran */
.doc-demo__stage--phone .search-scene { padding: var(--space-5) var(--space-3); }
.doc-demo__stage--phone .search { --search-h: 48px; }
.doc-demo__stage--phone .search__bar { flex-wrap: wrap; }
.doc-demo__stage--phone .search__field { flex-basis: 100%; }
.doc-demo__stage--phone .search__input { font-size: 17px; }
.doc-demo__stage--phone .search__filters { flex: 1; justify-content: center; }
.doc-toast-screen {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  min-height: 240px; padding: var(--space-4); border-radius: var(--r-lg); background: var(--bg-subtle);
}
.doc-heavy-shadow { box-shadow: var(--shadow-2); }
.doc-figure { margin: 0; width: 100%; }

/* Page Mouvement : démos animées */
.doc-motion-tracks { display: grid; gap: 16px; width: 100%; }
.doc-motion-track { container-type: inline-size; display: grid; gap: 8px; }
.doc-motion-track__label { font-size: 14px; color: var(--text-muted); }
.doc-motion-track__rail { position: relative; height: 32px; border-radius: var(--r-full); background: var(--bg-subtle); }
.doc-demo__stage--subtle .doc-motion-track__rail { background: var(--bg); }
.doc-motion-dot {
  position: absolute; top: 4px; left: 4px; width: 24px; height: 24px;
  border-radius: var(--r-full); background: var(--accent);
  transition: transform var(--dur-open) var(--ease);
}
.doc-motion-track--bounce .doc-motion-dot { background: var(--chart-4); transition: transform 600ms cubic-bezier(.3, 1.7, .5, 1); }
/* Course réduite à 85 % : le dépassement du rebond reste sur le rail */
[data-moved] .doc-motion-dot { transform: translateX(calc((100cqi - 32px) * .85)); }
.doc-motion-tracks + .btn { align-self: flex-start; }
/* Assez haut pour le panneau ouvert : le texte en dessous ne saute pas */
.doc-motion-menu { min-height: 340px; justify-content: flex-start; }
.doc-motion-menu > .check { align-self: flex-start; }
.doc-motion-menu__anchor { display: grid; justify-items: start; gap: 8px; }
.doc-motion-menu__anchor .btn svg { transition: transform var(--dur-fast) var(--ease); }
.doc-motion-menu__anchor .btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.doc-motion-panel {
  width: min(100%, 240px); padding: 6px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-raised); box-shadow: var(--shadow-1);
  transition:
    opacity var(--dur-open) var(--ease),
    transform var(--dur-open) var(--ease),
    display var(--dur-open) allow-discrete;
}
.doc-motion-panel[hidden] { opacity: 0; transform: translateY(-8px); }
@starting-style {
  .doc-motion-panel:not([hidden]) { opacity: 0; transform: translateY(-8px); }
}
.doc-motion-panel ul { margin: 0; padding: 0; list-style: none; }
.doc-motion-panel li { padding: 10px 12px; border-radius: var(--r-sm); font-size: 15px; color: var(--text); }
.doc-motion-panel li + li { border-top: 1px solid var(--border); border-radius: 0; }
.doc-motion--reduced .doc-motion-menu__anchor .btn svg { transition: none; }
.doc-motion--reduced .doc-motion-panel,
.doc-motion--reduced .doc-motion-panel[hidden] { transform: none; }
@starting-style {
  .doc-motion--reduced .doc-motion-panel:not([hidden]) { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .doc-motion-dot, .doc-motion-menu__anchor .btn svg { transition: none; }
  .doc-motion-panel, .doc-motion-panel[hidden] { transform: none; }
  @starting-style { .doc-motion-panel:not([hidden]) { transform: none; } }
}
.doc-demo__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px; border-top: 1px solid var(--border); background: var(--bg-subtle);
  font-size: 13px; color: var(--text-muted);
}
.doc-demo__foot > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; margin: 6px;
  border-radius: var(--r-sm); cursor: pointer; list-style: none; font-weight: 500; color: var(--text-muted);
}
.doc-demo__foot > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .doc-demo__foot > summary:hover { color: var(--text); background: var(--border); } }
.doc-demo__foot > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: 0 0 0 3px var(--focus-ring); }
.doc-demo__foot > summary:active { color: var(--text); background: var(--border-strong); }
.doc-demo__foot[open] > summary { color: var(--text); }
.doc-demo__foot > .doc-code { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.doc-demo__foot { border-top: 1px solid var(--border); }

/* Blocs de code */
.doc-code {
  position: relative; margin-top: 16px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-subtle);
}
.doc-code__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: .02em;
}
.doc-code pre {
  margin: 0; padding: 16px; overflow-x: auto; tab-size: 2;
  font-size: 13px; line-height: 1.6; color: var(--text);
}
.doc-code pre:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.doc-copy {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.doc-copy svg { width: 15px; height: 15px; }
@media (hover: hover) { .doc-copy:hover { background: var(--border); color: var(--text); } }
.doc-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: 0 0 0 3px var(--focus-ring); color: var(--text); }
.doc-copy:active { background: var(--border-strong); color: var(--text); }
.doc-copy[data-copied] { color: var(--success); }

/* À faire / à éviter */
.doc-dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.doc-dodont > div { border-top: 2px solid; padding-top: 16px; min-width: 0; }
.doc-do { border-color: var(--success) !important; }
.doc-dont { border-color: var(--danger) !important; }
.doc-dodont h3, .doc-dodont h4 {
  display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 24px; margin-bottom: 8px;
}
.doc-dodont svg { width: 18px; height: 18px; }
/* Dessins d'onglets des exemples (simples images, pas de vrais onglets) : même onglet choisi que .tab[aria-selected="true"] */
.doc-dodont .tab[data-selected] { color: var(--text); border-bottom-color: var(--accent); }
.doc-do h3 svg, .doc-do h4 svg { color: var(--success); }
.doc-dont h3 svg, .doc-dont h4 svg { color: var(--danger); }
.doc-dodont ul { padding-left: 20px; color: var(--text-muted); }
.doc-dodont li + li { margin-top: 6px; }
.doc-dodont .doc-demo__stage { padding: 24px; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 12px; }

/* Tableau de spécifications */
.doc-table-wrap { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--r-md); overflow-x: auto; position: relative; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 22px; }
.doc-table th {
  text-align: left; padding: 10px 16px; background: var(--bg-subtle);
  font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap;
}
.doc-table td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: top; }
.doc-table td:first-child { white-space: nowrap; }
.doc-table--wrap td:first-child { white-space: normal; }
.doc-table code { font-size: 13px; }
.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Liste de liens (pages d'index) : composant .link-list, voir components/lien.css */
.doc-section > .link-list { margin-top: 24px; }

/* Encadré de remarque (site) */
.doc-note {
  margin-top: 24px; padding: 16px 20px; border-radius: var(--r-md);
  background: var(--bg-subtle); font-size: 15px; line-height: 24px; max-width: 68ch;
}
.doc-note strong { font-weight: 600; }
.doc-section > .doc-note:first-child { margin-top: 0; }

/* Détails repliés (tests, contrastes) dans l'onglet Usage des composants */
.doc-more { margin-top: 24px; border: 1px solid var(--border); border-radius: var(--r-md); }
.doc-more > summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-md); cursor: pointer; list-style: none; font-weight: 500;
}
.doc-more > summary::-webkit-details-marker { display: none; }
.doc-more > summary svg { flex: none; width: 16px; height: 16px; color: var(--text-muted); transition: transform var(--dur-fast, 150ms); }
.doc-more[open] > summary svg { transform: rotate(90deg); }
@media (hover: hover) { .doc-more > summary:hover { background: var(--bg-subtle); } }
.doc-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: 0 0 0 3px var(--focus-ring); }
.doc-more[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--r-md) var(--r-md) 0 0; }
.doc-more__body { padding: 8px 16px 24px; }
.doc-more__body > .doc-section { margin-top: 40px; }
.doc-more__body > .doc-section:first-child { margin-top: 24px; }
.doc-more__body .doc-section > h4 { margin: 24px 0 8px; font-size: 16px; line-height: 24px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .doc-more > summary svg { transition: none; } }

/* Pastille d'échantillon de couleur */
.doc-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); vertical-align: -3px; margin-right: 8px; }

@media (max-width: 767px) {
  .site-main { padding-top: 24px; }
  .doc-demo__stage { padding: 28px 20px; }
  .doc-dodont { grid-template-columns: 1fr; }
  .doc-tabs { gap: 20px; }
}
/* Téléphone : les cinq onglets tiennent sur la ligne, sans défilement caché */
@media (max-width: 479px) {
  .doc-tabs { gap: 8px; justify-content: space-between; }
  .doc-tabs [role="tab"] { font-size: 14px; }
  /* Petits tableaux : les en-têtes passent à la ligne pour tenir sans défiler */
  .doc-table th, .doc-table td:first-child { white-space: normal; }
  .doc-table th, .doc-table td { padding-left: 12px; padding-right: 12px; }
  .doc-table td { overflow-wrap: break-word; }
}

/* Accueil */
.site-hero { padding: 24px 0 8px; }
.site-hero .ds-display { max-width: 16ch; }
.site-hero .ds-lead { margin-top: 24px; max-width: 60ch; }
.site-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.site-hero__actions .btn:hover { text-decoration: none; }

/* Tableaux : en-têtes de ligne, touches */
.doc-table th[scope="row"] { background: none; border-top: 1px solid var(--border); font-size: 14px; color: var(--text); font-weight: 500; vertical-align: top; padding: 12px 16px; }
.doc-table tbody tr:first-child > * { border-top: 0; }
.doc-table thead + tbody tr:first-child > * { border-top: 1px solid var(--border); }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; text-align: center;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-xs);
  background: var(--surface); font-size: 12px; line-height: 18px; color: var(--text);
}

/* Accueil sans barre latérale */
.site-body.site-body--home { grid-template-columns: minmax(0, 1fr); }
.site-home .site-content { max-width: 880px; margin-inline: auto; }

/* Fondations : échelle typographique, barres, tuiles */
.doc-pairing-switch { margin-bottom: 20px; }
.doc-typescale { border-top: 1px solid var(--border); }
.doc-typescale > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--border); }
.doc-typescale > div > p { margin: 0; min-width: 0; }
.doc-typescale > div > span { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.doc-ts { font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.doc-ts-h1 { font-size: clamp(2rem, 1.73rem + 1.2vw, 2.5rem); line-height: 1.16; letter-spacing: -0.02em; }
.doc-ts-h2 { font-size: 28px; line-height: 34px; }
.doc-ts-h3 { font-size: 20px; line-height: 28px; }
[data-pairing="serif"] :is(.doc-ts-h1, .doc-ts-h2) { font-family: var(--font-display); font-weight: 500; }
.doc-bar { display: block; height: 12px; border-radius: 3px; background: var(--accent); }
.doc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 24px; }
.doc-tiles--wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.doc-tiles > div { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-muted); }
.doc-tiles > div > strong { color: var(--text); font-weight: 500; margin-top: 8px; }
.doc-tile { display: block; width: 88px; height: 88px; background: var(--accent-soft); border: 1px solid var(--accent); }
.doc-elev { display: block; height: 120px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.doc-elev--1 { box-shadow: var(--shadow-1); background: var(--surface-raised); }
.doc-elev--2 { box-shadow: var(--shadow-2); background: var(--surface-raised); border-radius: var(--r-lg); }
.doc-iconrow { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; color: var(--text); }
.doc-iconrow > figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.doc-chart { display: flex; align-items: flex-end; gap: 16px; height: 180px; padding: 0 4px; border-bottom: 1px solid var(--border-strong); background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% 45px; }
.doc-chart__group { flex: 1; display: flex; align-items: flex-end; gap: 4px; height: 100%; }
.doc-chart__bar { flex: 1; border-radius: 4px 4px 0 0; }
.doc-chart__axis { display: flex; gap: 16px; padding: 8px 4px 0; font-size: 12px; color: var(--text-muted); }
.doc-chart__axis > span { flex: 1; text-align: center; }
.doc-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 14px; color: var(--text-muted); padding: 0; list-style: none; }
.doc-legend li { display: flex; align-items: center; gap: 8px; }
.doc-legend i { width: 12px; height: 12px; border-radius: 3px; }
@media (max-width: 767px) {
  .doc-typescale > div { grid-template-columns: 1fr; }
  .doc-typescale > div > span { white-space: normal; }
}
.doc-table-wrap + p, .doc-code + p { margin-top: 16px; }
.doc-tiles code { white-space: nowrap; }

/* Plan du site */
.site-sitemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px; margin-top: 32px; }
.site-sitemap h2 { font-size: 16px; margin: 0 0 12px; }
.site-sitemap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* Page Responsive : petits téléphones dessinés dans les exemples « à faire / à éviter » */
.doc-phone {
  display: flex; flex-direction: column;
  width: 100%; max-width: 260px; min-height: 300px; margin-inline: auto;
  border: 1px solid var(--border-strong); border-radius: 24px;
  background: var(--bg); overflow: hidden; font-size: 14px; line-height: 20px;
}
.doc-phone__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; padding: 4px 4px 4px 16px; border-bottom: 1px solid var(--border);
}
.doc-phone__logo { font-weight: 600; }
.doc-phone__body { flex: 1; display: grid; align-content: start; gap: 12px; padding: 16px; min-width: 0; }
.doc-phone__body > p { margin: 0; color: var(--text-muted); }
.doc-phone__foot { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.doc-phone__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-phone__line { display: block; height: 10px; border-radius: var(--r-full); background: var(--bg-subtle); }
.doc-phone__line--short { width: 60%; }
.doc-phone__img {
  display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--r-md);
  background: var(--bg-subtle); color: var(--text-muted);
}
.doc-phone__img svg { width: 28px; height: 28px; }
/* Contre-exemples : ce qui est volontairement mal fait */
.doc-phone__links--cramped { display: flex; gap: 4px; font-size: 11px; white-space: nowrap; overflow: hidden; color: var(--text-muted); padding-right: 12px; }
.doc-phone__tiny { display: flex; gap: 2px; color: var(--text); }
.doc-phone__tiny > span { display: grid; place-items: center; width: 24px; height: 24px; }
.doc-phone__tiny svg { width: 16px; height: 16px; }
.doc-phone__table--squeezed { width: 100%; border-collapse: collapse; font-size: 10px; line-height: 12px; word-break: break-all; }
.doc-phone__table--squeezed th, .doc-phone__table--squeezed td { padding: 4px 2px; border-bottom: 1px solid var(--border); text-align: left; }
.doc-phone__side { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.doc-phone__side .input { min-height: 32px; font-size: 13px; padding: 0 8px; }
.doc-phone__img--wide { width: 340px; max-width: none; aspect-ratio: auto; height: 120px; }
.doc-phone__small-text { font-size: 12px; line-height: 16px; color: var(--text-muted); }
/* Zone de toucher rendue visible : les pointillés montrent les 44 px */
.doc-show-hit .btn-sm { position: relative; }
.doc-show-hit .btn-sm::after {
  content: ""; position: absolute; inset: -6px 0;
  border: 1px dashed var(--accent); border-radius: var(--r-full);
}
.doc-show-hit .btn-icon.btn-sm::after { inset: -6px; }

/* Écrans tactiles : commandes du site d'au moins 44 px, comme le demande DESIGN.md */
@media (pointer: coarse) {
  .doc-copy, .doc-demo__foot > summary { min-height: 44px; }
  .site-footer a, .site-footer__theme, .doc-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  .doc-tabs [role="tab"] { min-width: 44px; }
}

/* Modèles et parcours : page d'exemple complète dans un cadre */
.doc-frame {
  display: block; width: 100%; height: 640px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg);
}
.doc-frame--phone { width: 375px; max-width: 100%; height: 720px; margin-inline: 0; }
.doc-frame--short { height: 480px; }
.doc-frame-open { display: flex; justify-content: flex-start; margin-top: 12px; }
.doc-frame-open a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 500; }
.doc-frame-open svg { width: 16px; height: 16px; }
@media (max-width: 767px) { .doc-frame { height: 560px; } }

/* Galerie d'états figés (pages Bouton et Lien) : reproduit chaque état sans interaction */
.doc-states { overflow-x: auto; margin-bottom: var(--space-4, 24px); }
.doc-states table { border-collapse: collapse; min-width: 100%; }
.doc-states th, .doc-states td { padding: 12px 16px 12px 0; text-align: left; vertical-align: middle; white-space: nowrap; }
.doc-states thead th { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.doc-states tbody th { font-size: 14px; font-weight: 500; color: var(--text); padding-right: 24px; }
.doc-states .btn.is-hover { background: var(--border); }
.doc-states .btn-primary.is-hover { background: var(--accent-hover); }
.doc-states .btn-ghost.is-hover { background: var(--bg-subtle); }
.doc-states .btn-danger.is-hover { background: var(--danger-soft); }
.doc-states .btn.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.doc-states .btn-primary.is-focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.doc-states .btn.is-active { background: var(--border-strong); }
.doc-states .btn-primary.is-active { background: var(--accent-active); }
.doc-states .btn-ghost.is-active { background: var(--border); }
.doc-states .btn-danger.is-active { background: var(--danger-soft); border-color: var(--danger); }
.doc-states .btn.is-disabled { opacity: .4; }
.doc-states .link.is-hover { text-decoration: underline; }
.doc-states .link-underline.is-hover { text-decoration-thickness: 2px; }
.doc-states .link.is-focus { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 3px var(--focus-ring); text-decoration: underline; }
.doc-states .link.is-active { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; }
.doc-states .link.is-visited { color: var(--link-visited); }
.doc-states .input { width: 140px; pointer-events: none; }
.doc-states .input.is-hover { border-color: var(--text-muted); }
.doc-states .input.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
