/* Guide d’utilisation : mêmes couleurs et polices que le studio, mise en page de lecture. */
:root {
  --bg: #e6ebee; --panel: #f6f8f9; --ink: #1d2730; --muted: #5a6875; --line-ui: #c9d2d9;
  --accent: #2f6f8f; --accent-ink: #ffffff; --tip: #e3eef4; --warn: #fbf0d9;
  --p1: #c0533a; --p2: #b07a1c; --tri: #2f8a55; --noise: #6a5aa8; --badge: #e0a21b;
  --display: 'Silkscreen', 'Courier New', monospace;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1418; --panel: #172027; --ink: #dfe7ec; --muted: #8d9ba7; --line-ui: #2c3a45;
  --accent: #6db3d3; --accent-ink: #0d1418; --tip: #1d3140; --warn: #3a3020;
  --p1: #ef7d62; --p2: #e2b04f; --tri: #6cc28c; --noise: #a593f0; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0f1418; --panel: #172027; --ink: #dfe7ec; --muted: #8d9ba7; --line-ui: #2c3a45;
  --accent: #6db3d3; --accent-ink: #0d1418; --tip: #1d3140; --warn: #3a3020;
  --p1: #ef7d62; --p2: #e2b04f; --tri: #6cc28c; --noise: #a593f0; color-scheme: dark }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); }
a { color: var(--accent); }

.g-top { z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line-ui); }
.g-brand { font: 400 1.3rem var(--display); color: var(--ink); text-decoration: none; }
.g-brand small { font: 400 .8rem var(--display); color: var(--muted); margin-left: 8px; }
.g-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.g-langs { display: inline-flex; border: 1px solid var(--line-ui); border-radius: 4px; overflow: hidden; }
.g-langs a { font: 600 .8rem var(--body); padding: 6px 10px; color: var(--muted); text-decoration: none; }
.g-langs a + a { border-left: 1px solid var(--line-ui); }
.g-langs a[aria-current] { background: var(--ink); color: var(--panel); }
.btn { display: inline-block; font: 600 .9rem var(--body); padding: 7px 14px; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none; }

.g-layout { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; padding: 24px 16px 64px; }
.g-toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: .9rem; }
.g-toc h2 { font: 400 .8rem var(--display); color: var(--muted); letter-spacing: .05em; margin: 0 0 8px; }
.g-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.g-toc li { counter-increment: toc; }
.g-toc a { display: block; padding: 4px 8px; border-radius: 4px; color: var(--ink); text-decoration: none; }
.g-toc a::before { content: counter(toc) '. '; color: var(--muted); }
.g-toc a:hover { background: var(--panel); }

.g-main { min-width: 0; }
.g-main > section { background: var(--panel); border: 1px solid var(--line-ui); border-radius: 8px; padding: 8px 28px 24px; margin-bottom: 22px; }
.g-hero { background: var(--panel); border: 1px solid var(--line-ui); border-left: 6px solid var(--accent); border-radius: 8px; padding: 22px 28px; margin-bottom: 22px; }
h1 { font: 400 1.7rem/1.2 var(--display); margin: 0 0 10px; letter-spacing: .02em; }
h2 { font: 400 1.15rem/1.3 var(--display); letter-spacing: .04em; margin: 22px 0 10px; color: var(--accent); }
h3 { font: 700 1.05rem var(--body); margin: 22px 0 6px; }
p, li { max-width: 75ch; }
.lead { font-size: 1.1rem; }
kbd { font: .82rem var(--mono); background: var(--bg); border: 1px solid var(--line-ui); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.ui { font-weight: 700; white-space: nowrap; }
.c-p1 { color: var(--p1); } .c-p2 { color: var(--p2); } .c-tri { color: var(--tri); } .c-noise { color: var(--noise); }

figure { margin: 16px 0 20px; }
figure a { display: block; }
figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line-ui); border-radius: 6px; background: #fff; }
figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 46px; margin: 14px 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 1rem var(--body); }
.legend { list-style: none; padding: 0; }
.legend li { margin: 6px 0; padding-left: 34px; position: relative; }
.legend b.n { position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--badge); color: #1d2730; display: grid; place-items: center; font-size: .78rem; }

.tip, .warn { border-radius: 6px; padding: 10px 14px; margin: 14px 0; max-width: 75ch; }
.tip { background: var(--tip); border-left: 4px solid var(--accent); }
.warn { background: var(--warn); border-left: 4px solid var(--badge); }
.tip::before, .warn::before { font-weight: 700; margin-right: 6px; }

table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 10px 0; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-ui); vertical-align: top; }
th { color: var(--muted); font-weight: 700; }
td:first-child { white-space: nowrap; }
dl dt { font-weight: 700; margin-top: 10px; }
dl dd { margin: 2px 0 0 0; color: var(--ink); max-width: 75ch; }
details { border-bottom: 1px solid var(--line-ui); padding: 8px 0; }
details summary { cursor: pointer; font-weight: 700; }
.g-foot { text-align: center; color: var(--muted); font-size: .88rem; }

@media (min-width: 861px) { .g-top { position: sticky; top: 0; } }
@media (max-width: 860px) {
  html { scroll-padding-top: 12px; }
  .g-layout { grid-template-columns: minmax(0, 1fr); }
  .g-toc { position: static; max-height: none; background: var(--panel); border: 1px solid var(--line-ui); border-radius: 8px; padding: 14px; }
  .g-main > section, .g-hero { padding-inline: 16px; }
  td:first-child { white-space: normal; }
}
@media print {
  .g-top, .g-toc { display: none; }
  .g-layout { display: block; }
  .g-main > section { break-inside: avoid-page; border: 0; }
}
