/* =========================================================================
   Comprendre pour tous — feuille de style unique
   ========================================================================= */

:root {
  --bg: #fcfbf8;
  --surface: #ffffff;
  --surface-2: #f5f2ec;
  --text: #1b1b1d;
  --muted: #61605e;
  --faint: #8a8885;
  --border: #e6e1d8;
  --hue: 174;
  --accent: hsl(var(--hue) 62% 32%);
  --accent-ink: hsl(var(--hue) 68% 26%);
  --accent-soft: hsl(var(--hue) 52% 94%);
  --accent-line: hsl(var(--hue) 40% 86%);
  --warn: #9a3412;
  --warn-soft: #fdf0e8;
  --shadow-sm: 0 1px 2px rgba(28, 25, 20, .05);
  --shadow: 0 2px 4px rgba(28, 25, 20, .04), 0 12px 28px -12px rgba(28, 25, 20, .18);
  --radius: 12px;
  --topbar: 60px;
  --sidebar: 288px;
  --measure: 68ch;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --surface: #1a1d23;
    --surface-2: #21252c;
    --text: #e9e7e3;
    --muted: #a3a2a0;
    --faint: #85858a;
    --border: #2b3038;
    --accent: hsl(var(--hue) 62% 60%);
    --accent-ink: hsl(var(--hue) 72% 70%);
    --accent-soft: hsl(var(--hue) 45% 20%);
    --accent-line: hsl(var(--hue) 35% 30%);
    --warn: #fb923c;
    --warn-soft: rgba(251, 146, 60, .12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 28px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1a1d23;
  --surface-2: #21252c;
  --text: #e9e7e3;
  --muted: #a3a2a0;
  --faint: #85858a;
  --border: #2b3038;
  --accent: hsl(var(--hue) 62% 60%);
  --accent-ink: hsl(var(--hue) 72% 70%);
  --accent-soft: hsl(var(--hue) 45% 20%);
  --accent-line: hsl(var(--hue) 35% 30%);
  --warn: #fb923c;
  --warn-soft: rgba(251, 146, 60, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 28px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

::selection { background: var(--accent-soft); }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* --------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand-mark { font-size: 1.15rem; }

.topsearch { margin-left: auto; flex: 0 1 320px; }
.topsearch input {
  width: 100%; padding: .48rem .85rem;
  font: inherit; font-size: .92rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
}
.topsearch input::placeholder { color: var(--faint); }
.topsearch input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.theme-btn {
  flex: none; width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 1rem; cursor: pointer;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 50%;
}
.theme-btn::before { content: "🌙"; }
:root[data-theme="dark"] .theme-btn::before { content: "☀️"; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn::before { content: "☀️"; }
}
.theme-btn:hover { border-color: var(--accent); }

.burger { display: none; flex-direction: column; gap: 4px; width: 38px; height: 38px; cursor: pointer; align-items: center; justify-content: center; }
.burger span { display: block; width: 19px; height: 2px; background: var(--text); border-radius: 2px; }
.scrim { display: none; }

/* --------------------------------------------------------------- layout */

.shell { display: flex; align-items: flex-start; max-width: 1340px; margin: 0 auto; }

.sidebar {
  position: sticky; top: var(--topbar);
  flex: none; width: var(--sidebar);
  height: calc(100vh - var(--topbar));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 1.35rem 1rem 4rem 1.25rem;
  border-right: 1px solid var(--border);
  font-size: .92rem;
}
.sidebar::-webkit-scrollbar { width: 9px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }

main { flex: 1; min-width: 0; padding: 2.4rem 2.5rem 5rem; }

/* ------------------------------------------------------------------ nav */

.nav-root, .nav-root ul { list-style: none; margin: 0; padding: 0; }
.nav-root > li + li { margin-top: .15rem; }
.nav-root ul { margin: .1rem 0 .45rem; padding-left: .55rem; border-left: 1px solid var(--border); margin-left: .5rem; }

.nav-root a { display: block; padding: .32rem .5rem; border-radius: 7px; color: var(--muted); text-decoration: none; }
.nav-root a:hover { background: var(--surface-2); color: var(--text); }
.nav-root a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }

.nav-root summary {
  display: flex; align-items: center; gap: .1rem;
  list-style: none; cursor: pointer; border-radius: 7px;
}
.nav-root summary::-webkit-details-marker { display: none; }
.nav-root summary::before {
  content: "›"; flex: none; width: 1rem; text-align: center;
  color: var(--faint); transition: transform .16s ease;
}
.nav-root details[open] > summary::before { transform: rotate(90deg); }
.nav-root summary a { flex: 1; font-weight: 650; color: var(--text); }
.nav-root li li summary a { font-weight: 550; font-size: .9rem; }
.nav-root li li li a { font-size: .88rem; padding-left: .55rem; }

/* ----------------------------------------------------------------- hero */

.hero { max-width: var(--measure); margin: 1rem 0 2.6rem; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  line-height: 1.1; letter-spacing: -.025em;
  margin: 0 0 .55rem;
}
.lead { font-size: 1.16rem; color: var(--muted); margin: 0 0 1.5rem; line-height: 1.55; }

.hero-search { display: flex; gap: .55rem; max-width: 560px; margin: 0 0 .9rem; }
.hero-search input {
  flex: 1; min-width: 0; padding: .78rem 1.05rem;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
.hero-search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.hero-search button {
  padding: .78rem 1.3rem; font: inherit; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--accent); border: 1px solid var(--accent);
  border-radius: 10px; white-space: nowrap;
}
:root[data-theme="dark"] .hero-search button { color: #10241f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-search button { color: #10241f; } }
.hero-search button:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

.hero-stats { font-size: .89rem; color: var(--faint); margin: 0; }

/* ------------------------------------------------------------- mosaïque */

.home-subhead {
  font-family: var(--serif); font-size: 1.28rem; letter-spacing: -.01em;
  margin: 0 0 1rem;
}

.guide-mosaic {
  display: grid; gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  margin: 0 0 2.6rem;
}
.guide-tile {
  display: flex; flex-direction: column; gap: .55rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  background: hsl(var(--hue) 48% 94%);
  border: 1px solid hsl(var(--hue) 38% 84%);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.guide-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); border-color: hsl(var(--hue) 55% 62%); }
.guide-tile-top { display: flex; flex-direction: column; gap: .2rem; }
.guide-tile-top strong { font-family: var(--serif); font-size: 1.1rem; letter-spacing: -.01em; color: var(--accent-ink); }
.guide-tile-meta { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.guide-tile-desc { font-size: .87rem; color: var(--text); opacity: .82; line-height: 1.42; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .guide-tile { background: hsl(var(--hue) 42% 19%); border-color: hsl(var(--hue) 32% 30%); }
  :root:not([data-theme="light"]) .guide-tile:hover { border-color: hsl(var(--hue) 45% 46%); }
  :root:not([data-theme="light"]) .guide-tile-top strong { color: hsl(var(--hue) 60% 74%); }
}
:root[data-theme="dark"] .guide-tile { background: hsl(var(--hue) 42% 19%); border-color: hsl(var(--hue) 32% 30%); }
:root[data-theme="dark"] .guide-tile:hover { border-color: hsl(var(--hue) 45% 46%); }
:root[data-theme="dark"] .guide-tile-top strong { color: hsl(var(--hue) 60% 74%); }

/* ---------------------------------------------------------------- cards */

.cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  margin: 0 0 3rem;
}
.card {
  display: flex; flex-direction: column; gap: .45rem;
  padding: 1.3rem 1.4rem 1.15rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); color: var(--text); }
.card h2 { font-family: var(--serif); font-size: 1.24rem; line-height: 1.25; margin: 0; letter-spacing: -.01em; border: 0; padding: 0; }
.card p { margin: 0; font-size: .94rem; color: var(--muted); line-height: 1.5; }
.card-meta { margin-top: auto; padding-top: .5rem; font-size: .8rem; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }

/* ---------------------------------------------------------------- prose */

.prose { max-width: var(--measure); }
.home-prose { margin-top: 1rem; }

.prose h1 {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4vw, 2.6rem); line-height: 1.15;
  letter-spacing: -.022em; margin: 0 0 .6rem;
}
.prose h2 {
  font-family: var(--serif); font-size: 1.62rem; line-height: 1.25;
  letter-spacing: -.015em;
  margin: 2.7rem 0 .9rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.prose h3 { font-size: 1.22rem; margin: 2rem 0 .6rem; letter-spacing: -.008em; }
.prose h4 { font-size: 1.04rem; margin: 1.6rem 0 .5rem; color: var(--muted); }

.anchor {
  display: none; margin-left: .45rem; color: var(--accent);
  text-decoration: none; opacity: 0; transition: opacity .15s ease;
  vertical-align: middle;
}
.anchor svg { display: block; }
/* uniquement sur un peripherique a survol reel : jamais sur mobile/tablette */
@media (hover: hover) and (pointer: fine) {
  .anchor { display: inline-block; }
  h2:hover > .anchor, h3:hover > .anchor, h4:hover > .anchor,
  h5:hover > .anchor, h6:hover > .anchor, .anchor:focus-visible { opacity: .75; }
  .anchor:hover { opacity: 1; }
}

.prose p { margin: 0 0 1.15rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.35rem; }
.prose li { margin-bottom: .45rem; }
.prose li > ul, .prose li > ol { margin: .45rem 0 .15rem; }
.prose strong { font-weight: 680; }

.prose blockquote {
  margin: 1.4rem 0; padding: .9rem 1.3rem;
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; color: var(--muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono); font-size: .87em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .1em .38em; border-radius: 5px;
}
.prose pre {
  margin: 1.4rem 0; padding: 1rem 1.2rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; overflow-x: auto; font-size: .88rem; line-height: 1.55;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4rem 0; }

.table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--border); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.prose th, .prose td { padding: .62rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose thead th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

.section-intro { color: var(--muted); margin-bottom: 2rem; }
.section-intro p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- crumbs */

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--faint); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .here { color: var(--text); }

/* ---------------------------------------------------------------- chips */

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.6rem; }
.chip {
  display: inline-block; padding: .2rem .68rem;
  font-size: .78rem; font-weight: 550; letter-spacing: .01em;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px;
}
.chip-accent { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.chip-ghost { background: transparent; color: var(--faint); }

/* ------------------------------------------------------------------ toc */

.toc {
  margin: 0 0 2.2rem; padding: .85rem 1.15rem;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
}
.toc summary { cursor: pointer; font-weight: 650; font-size: .92rem; letter-spacing: .01em; }
.toc ul { list-style: none; margin: .7rem 0 .15rem; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: .2rem 0; font-size: .91rem; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc .lvl3 { padding-left: 1.1rem; font-size: .88rem; }

/* ----------------------------------------------------------- rows/lists */

.rows { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.rows li { padding: .95rem 0; border-bottom: 1px solid var(--border); }
.rows li:first-child { border-top: 1px solid var(--border); }
.rows a { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.rows a strong { font-weight: 620; font-size: 1.03rem; }
.rows a:hover strong { color: var(--accent); }
.row-desc { display: block; margin-top: .18rem; font-size: .9rem; color: var(--faint); line-height: 1.45; }

.chapters { list-style: none; margin: 1.6rem 0 0; padding: 0; counter-reset: none; }
.chapters li { border-bottom: 1px solid var(--border); }
.chapters li:first-child { border-top: 1px solid var(--border); }
.chapters a { display: flex; align-items: center; gap: .85rem; padding: .85rem .4rem; text-decoration: none; color: var(--text); border-radius: 8px; }
.chapters a:hover { background: var(--surface-2); }
.chapters a:hover strong { color: var(--accent); }
.chapters .num {
  flex: none; width: 1.85rem; height: 1.85rem;
  display: grid; place-items: center;
  font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums;
  color: var(--accent-ink); background: var(--accent-soft); border-radius: 50%;
}
.chapters strong { font-weight: 600; font-size: 1.01rem; flex: 1; }
.start-guide { margin: 1.6rem 0 0; }

/* ---------------------------------------------------------------- pager */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: var(--measure); margin: 3rem 0 0; }
.pager a {
  display: flex; flex-direction: column; gap: .22rem;
  padding: .95rem 1.15rem; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .16s ease, transform .16s ease;
}
.pager a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pager a span { font-size: .78rem; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.pager a strong { font-weight: 600; font-size: .97rem; line-height: 1.35; }
.pager-next { grid-column: 2; text-align: right; align-items: flex-end; }

/* --------------------------------------------------------------- source */

.source { margin: 3rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--border); font-size: .88rem; }
.source a { color: var(--faint); text-decoration: none; }
.source .src-main { color: var(--accent-ink); font-weight: 600; }
.source .src-main:hover { text-decoration: underline; }
.source a:hover { color: var(--accent); text-decoration: underline; }

/* -------------------------------------------------------------- results */

.results { list-style: none; margin: 1.6rem 0 0; padding: 0; }
.results li { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.results h3 { margin: 0 0 .25rem; font-size: 1.06rem; }
.results h3 a { text-decoration: none; }
.results .where { font-size: .8rem; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.results p { margin: .3rem 0 0; font-size: .93rem; color: var(--muted); line-height: 1.5; }
.results mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 .12em; }
.muted { color: var(--faint); font-size: .93rem; }

.az-jump { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.4rem 0 2rem; }
.az-jump a {
  display: grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .4rem;
  font-size: .88rem; font-weight: 600; text-decoration: none;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 7px;
}
.az-jump a:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ----------------------------------------------------------------- misc */

.btn {
  display: inline-block; padding: .6rem 1.15rem; margin-right: .5rem;
  font-weight: 600; text-decoration: none; border-radius: 9px;
  color: #fff; background: var(--accent); border: 1px solid var(--accent);
}
:root[data-theme="dark"] .btn { color: #10241f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #10241f; } }
.btn:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { color: var(--accent-ink); background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-ink); }
.notfound { text-align: center; padding-top: 3rem; }

/* -------------------------------------------------- illustrations & co */

.illo { width: 74px; height: 50px; color: var(--accent); flex: none; }
.illo-head { width: 104px; height: 70px; }

.page-head { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 1.6rem; }
.page-head h1 { margin-bottom: .4rem; }
.page-head .lead { margin-bottom: 0; }

/* bandeau colore discret en haut de chaque page de section ou de guide */
main { position: relative; }
main::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 72%);
  opacity: .85;
}

.card { position: relative; overflow: hidden; }
.card .illo { margin-bottom: .3rem; }
.card::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: var(--accent); opacity: .9;
}
.card-guide { padding-top: 1.45rem; }
.card-dot {
  width: 30px; height: 30px; border-radius: 9px; margin-bottom: .5rem;
  background: var(--accent-soft); border: 2px solid var(--accent);
}

/* bouton de retour a l'accueil, en tete de la navigation laterale */
.nav-home {
  display: flex; align-items: center; gap: .55rem;
  margin-bottom: .9rem; padding: .5rem .7rem;
  font-weight: 650; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; box-shadow: var(--shadow-sm);
}
.nav-home:hover { border-color: var(--accent); color: var(--accent-ink); }
.nav-home.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.nav-home svg { flex: none; }

.legal h2 { font-size: 1.32rem; }
.legal ul { margin-bottom: 1.2rem; }

/* ------------------------------------------------------ avis & contact */

.feedback, .avis {
  max-width: 46rem; padding: 1.5rem 1.7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
}
.feedback { margin: 1.2rem 0 0; }
.avis { margin: 3rem 0 0; }

/* En-tete commun : icone + titre + sous-titre, pour distinguer les deux
   blocs d'un coup d'oeil sans dupliquer leur structure. */
.block-head { display: flex; align-items: flex-start; gap: .7rem; margin: 0 0 1.1rem; }
.block-icon { font-size: 1.3rem; line-height: 1.3; flex: none; }
.block-head h2 {
  margin: 0; padding: 0; border: 0;
  font-family: var(--sans); font-size: 1.04rem; font-weight: 650; letter-spacing: 0;
}
.block-sub { margin: .15rem 0 0; font-size: .82rem; color: var(--faint); }

.feedback-note, .avis-legal { margin: .9rem 0 0; font-size: .8rem; color: var(--faint); line-height: 1.5; }

.contact-form, .feedback-panel, .avis-form {
  position: relative; display: flex; flex-direction: column; gap: .6rem; margin: 0;
}
.avis-form[hidden] { display: none; }
.contact-form label { font-size: .88rem; font-weight: 600; margin-top: .6rem; }
.contact-form .opt { font-weight: 400; color: var(--faint); }
.avis-form-legend { margin: 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea,
.feedback-panel textarea, .avis-form input, .avis-form textarea {
  width: 100%; box-sizing: border-box; font: inherit; padding: .6rem .8rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
}
.contact-form textarea { resize: vertical; min-height: 8rem; }
.feedback-panel textarea, .avis-form textarea { resize: vertical; min-height: 5rem; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus,
.feedback-panel textarea:focus, .avis-form input:focus, .avis-form textarea:focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft);
}
.fb-count, .avis-count { align-self: flex-end; margin-top: -.4rem; font-size: .78rem; color: var(--faint); }

/* Piege a robots : invisible pour un visiteur humain, mais present dans le
   DOM pour les scripts automatises qui remplissent tous les champs. */
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-form button[type="submit"], .fb-send, .avis-send {
  align-self: flex-start; margin-top: .3rem; padding: .7rem 1.3rem;
  font: inherit; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--accent);
  border: 1px solid var(--accent); border-radius: 10px;
}
:root[data-theme="dark"] .contact-form button[type="submit"],
:root[data-theme="dark"] .fb-send, :root[data-theme="dark"] .avis-send { color: #10241f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .contact-form button[type="submit"],
  :root:not([data-theme="light"]) .fb-send,
  :root:not([data-theme="light"]) .avis-send { color: #10241f; }
}
.contact-form button[type="submit"]:hover, .fb-send:hover, .avis-send:hover {
  background: var(--accent-ink); border-color: var(--accent-ink);
}

.avis-note-msg { margin: 0; font-size: .85rem; font-weight: 600; color: var(--accent-ink); }

.avis-stars { display: flex; gap: .15rem; margin: -.1rem 0 .1rem; }
.star-btn {
  font-size: 1.7rem; line-height: 1; padding: 0; border: 0; background: none;
  color: var(--border); cursor: pointer; transition: color .1s ease;
}
.star-btn:hover { color: var(--accent); }
.avis-stars .star-btn.is-active { color: var(--accent); }
.avis-stars-ro { color: var(--accent); letter-spacing: .05em; }

.avis-liste { margin: 0 0 1.3rem; padding-bottom: 1.3rem; border-bottom: 1px solid var(--border); }
.avis-moyenne { margin: 0 0 .6rem; font-size: .95rem; }
.avis-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.avis-items li { padding: .7rem .9rem; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; }
.avis-item-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; font-size: .88rem; }
.avis-items p { margin: 0; font-size: .92rem; color: var(--text); line-height: 1.5; }

.card-top[hidden] { display: none; }
.card-top .top-emoji { font-size: 2rem; line-height: 1; margin-bottom: .3rem; }
.card-top .top-pages-list { list-style: decimal; margin: .3rem 0 0 1.1rem; padding: 0; font-size: .86rem; color: var(--muted); }
.card-top .top-pages-list li { margin-bottom: .2rem; }
.card-top .top-pages-list a { color: inherit; }

@media print { .feedback, .contact-form, .avis, .card-top { display: none !important; } }

/* --------------------------------------------------------------- footer */

.footer {
  margin-top: 2rem; padding: 2.5rem 1.5rem 3.5rem;
  border-top: 1px solid var(--border); background: var(--surface-2);
  text-align: center; font-size: .88rem; color: var(--muted);
}
.footer p { margin: 0 0 .5rem; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }
.footer-brand { font-size: .95rem; }
.footer-author { color: var(--muted); }
.footer-author a { color: var(--accent-ink); font-weight: 600; }
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem .9rem;
  margin: 1.1rem auto .2rem; padding-top: 1rem;
  max-width: 40rem; border-top: 1px solid var(--border);
}
.footer-links a { font-size: .85rem; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer .disclaimer { max-width: 60ch; margin: 1rem auto 0; font-size: .83rem; color: var(--faint); }

/* ----------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  main { padding: 2rem 1.6rem 4rem; }
  :root { --sidebar: 250px; }
}

@media (max-width: 820px) {
  body { font-size: 16.5px; }
  .burger { display: flex; }
  .topsearch { display: none; }

  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 90;
    width: min(84vw, 320px); height: 100vh;
    padding-top: calc(var(--topbar) + 1rem);
    background: var(--bg); box-shadow: var(--shadow);
    transform: translateX(-100%); transition: transform .22s ease;
  }
  #nav-toggle:checked ~ .shell .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .45); }
  #nav-toggle:checked ~ .shell .scrim { display: block; }

  main { padding: 1.6rem 1.15rem 3.5rem; }
  .page-head { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .illo-head { width: 84px; height: 56px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; text-align: left; align-items: flex-start; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }
}

@media print {
  .topbar, .sidebar, .pager, .toc, .footer, .source, .scrim { display: none !important; }
  main { padding: 0; }
  .prose { max-width: none; }
  body { font-size: 11pt; }
}

/* Avertissement de guide : note discrete en bas de page */
.prose .guide-notice {
  margin: 2.2rem 0 1rem; padding: 1rem 0 0;
  border-top: 1px solid var(--border);
  font-size: .86rem; line-height: 1.6; color: var(--muted);
}
.prose .guide-notice p { margin: 0; }
.prose .guide-notice strong:first-child { color: var(--text, inherit); }

/* ------------------------------------------------- page d'un guide */
.guide-hero {
  margin: 1.4rem 0 1.8rem; padding: 1.6rem 1.7rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-soft), transparent 75%);
  border: 1px solid var(--accent-line); border-radius: 16px;
}
.prose .guide-hook {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.5rem, 3.6vw, 2.15rem); line-height: 1.2;
  letter-spacing: -.02em; color: var(--text); margin: 0 0 1rem;
}
.guide-lead p { font-size: 1.14rem; line-height: 1.65; color: var(--text); margin: 0; }
.guide-lead strong, .guide-intro strong { color: var(--accent-ink); font-weight: 700; }
.guide-intro { margin: 0 0 1rem; }
.guide-intro p { font-size: 1.04rem; line-height: 1.7; color: var(--text); margin: 0 0 1rem; }
.prose h2.guide-h { font-size: 1.35rem; margin: 2.2rem 0 .3rem; padding-top: 1.2rem; }
.guide-h-sub { margin: 0 0 1rem; color: var(--faint); font-size: .95rem; }
.guide-seealso { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .92rem; color: var(--muted); }
.guide-seealso p { margin: 0 0 .6rem; }
