/* Documentation publique (/docs) : mêmes couleurs que la page d'accueil. */
:root {
  --bg: #f6f5f0; --surface: #ffffff; --surface-2: #efeee7; --border: #e2e0d6; --text: #1b1c1a; --muted: #65645c;
  --accent: #2f6b5a; --accent-strong: #24584a; --accent-ink: #ffffff; --accent-soft: #e2eee8;
  --warn: #8a5a00; --warn-bg: #fbefd6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131412; --surface: #1c1d1a; --surface-2: #252622; --border: #33342f; --text: #ecebe5; --muted: #a09e95;
    --accent: #5cae94; --accent-strong: #79c2aa; --accent-ink: #0c1813; --accent-soft: #1d3029;
    --warn: #f2c879; --warn-bg: #3a2c12;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* En-tête */
header.site { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.bar { width: min(1360px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: 18px; }
header.site .bar { height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.brand .hl { color: var(--accent); }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; inset: 0; background: var(--accent-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23000' stroke-linejoin='round'%3E%3Cpath d='M4.8 16 11.6 9h15.6v14H11.6z' stroke-width='2.4'/%3E%3Cpath d='m14.6 16.3 2.9 2.9 5-6' stroke-width='2.6' stroke-linecap='round'/%3E%3C/g%3E%3Ccircle cx='10.2' cy='16' r='1.6'/%3E%3C/svg%3E") center / 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23000' stroke-linejoin='round'%3E%3Cpath d='M4.8 16 11.6 9h15.6v14H11.6z' stroke-width='2.4'/%3E%3Cpath d='m14.6 16.3 2.9 2.9 5-6' stroke-width='2.6' stroke-linecap='round'/%3E%3C/g%3E%3Ccircle cx='10.2' cy='16' r='1.6'/%3E%3C/svg%3E") center / 100% no-repeat; }
.section-link { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); }
.spacer { flex: 1; }
.ext-link, .login { font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ext-link { color: var(--muted); }
.ext-link:hover { color: var(--text); }
.login { color: var(--accent); }
@media (max-width: 640px) { .ext-link { display: none; } .section-link { display: none; } }

/* Mise en page : menu | article | sommaire */
.layout { width: min(1360px, 100% - 32px); margin-inline: auto; display: grid; grid-template-columns: 270px minmax(0, 1fr) 220px; gap: 48px; align-items: start; }
@media (max-width: 1180px) { .layout { grid-template-columns: 250px minmax(0, 1fr); gap: 40px; } .toc { display: none; } }
@media (max-width: 899px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* Barre latérale */
.side { position: sticky; top: 60px; max-height: calc(100vh - 60px); overflow-y: auto; padding: 24px 4px 32px 0; font-size: 14.5px; scrollbar-width: thin; }
.side summary { display: none; }
.side ul { list-style: none; margin: 0 0 6px; padding: 0; }
.side-filter { width: 100%; font: inherit; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); margin-bottom: 14px; }
.side-group { margin: 18px 0 6px; padding: 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side-group:first-of-type { margin-top: 0; }
.side-sub { margin: 12px 0 2px; padding: 0 10px; font-size: 13px; font-weight: 650; color: var(--muted); }
.side a { display: flex; gap: 9px; align-items: baseline; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.35; }
.side a:hover { background: var(--surface-2); }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.side a span { flex: none; width: 1.2em; text-align: center; }
@media (max-width: 899px) {
  .side { position: static; max-height: none; overflow: visible; padding: 14px 0 0; }
  .side summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 600; }
  .side summary::-webkit-details-marker { display: none; }
  .side-toggle { color: var(--accent); font-size: 14px; flex: none; }
  .side details[open] summary { margin-bottom: 12px; }
}

/* Article */
main { min-width: 0; }
article { max-width: 760px; padding: 28px 0 56px; }
.crumbs { margin: 0 0 6px; font-size: 14px; color: var(--accent); font-weight: 600; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; }
h2 { font-size: 23px; line-height: 1.3; letter-spacing: -.01em; margin: 40px 0 12px; padding-top: 8px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 8px; }
article p, article li { max-width: 68ch; }
article ul, article ol { padding-left: 22px; }
article li { margin: 5px 0; }
code { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
kbd { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface); padding: 0 5px; border-radius: 5px; }

ol.steps { list-style: none; padding: 0; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding-left: 40px; margin: 12px 0; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; display: grid; place-items: center; }

.note, .warn { border-radius: 12px; padding: 14px 16px; margin: 18px 0; font-size: 15px; }
.note { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.warn { background: var(--warn-bg); border-left: 4px solid var(--warn); }

.btn { display: inline-flex; align-items: center; font-weight: 600; font-size: 15px; padding: 11px 20px; border-radius: 10px; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 14px 0; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
thead th { font-size: 13px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.card-link { display: grid; gap: 2px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.card-link span { font-size: 22px; }
.card-link small { color: var(--muted); font-size: 14px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--surface); }
.pager a:hover { border-color: var(--accent); }
.pager small { color: var(--muted); font-size: 13px; }
.pager span { font-weight: 600; }
.pager-next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager-next { grid-column: 1; } }

/* Sommaire */
.toc { position: sticky; top: 60px; padding: 28px 0; font-size: 14px; }
.toc p { margin: 0 0 8px; font-weight: 700; font-size: 13px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer .bar { flex-wrap: wrap; gap: 8px 20px; }
footer a { color: var(--muted); }
footer small { flex-basis: 100%; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card-link { transition: none; } }
