/* =========================================================================
   AuxiForge — feuille de style unique.
   Aucun framework : ~20 Ko non compressés, ~5 Ko en gzip, zéro requête
   supplémentaire. Mobile d'abord ; les media queries n'ajoutent que ce dont
   les grands écrans ont besoin.
   ========================================================================= */

/* --- 1. Jetons de design ------------------------------------------------ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-inset: #eef1f5;
  --surface: #ffffff;
  --border: #d7dee6;
  --border-soft: #e7ecf1;
  --ink: #10161d;
  --ink-soft: #4a5766;
  --ink-muted: #6b7684;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fe;
  --accent-border: #b6d1fb;
  --success: #17803d;
  --success-soft: #e6f5ec;
  --warning: #9a6700;
  --warning-soft: #fdf5e2;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --focus: #1f6feb;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 22, 29, .06);
  --shadow: 0 4px 16px rgba(16, 22, 29, .08);
  --container: 1180px;
  --nav-h: 56px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-soft: #131a23;
    --bg-inset: #1b2430;
    --surface: #161c25;
    --border: #2b3542;
    --border-soft: #222b36;
    --ink: #e7edf5;
    --ink-soft: #b3bfcd;
    --ink-muted: #8c99a8;
    --accent: #58a6ff;
    --accent-ink: #06121f;
    --accent-soft: #14273f;
    --accent-border: #2b4f7d;
    --success: #56d364;
    --success-soft: #11291a;
    --warning: #e3b341;
    --warning-soft: #2b2312;
    --danger: #ff7b72;
    --danger-soft: #341714;
    --focus: #58a6ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 6px 20px rgba(0, 0, 0, .45);
  }
}

/* --- 2. Réinitialisation ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.35rem); }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
ul, ol { padding-left: 1.3em; }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: 1.75rem 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-soft); }

/* --- 3. Structure ------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
.container-narrow { max-width: 760px; }
main { min-height: 60vh; padding-block: 1.5rem 3rem; }
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600;
  transition: top .15s;
}
.skip-link:focus { top: 8px; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
/* Sans cela, un enfant au contenu large (liste de choix, tableau, nom de
   fichier) refuse de se comprimer et pousse la grille hors de l'écran. */
.grid > *, .form-grid > *, .player > * { min-width: 0; }
@media (min-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.text-center { text-align: center; }
.muted { color: var(--ink-muted); }
.small { font-size: .875rem; }
.tiny { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.75rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.75rem; }
.hidden { display: none !important; }

/* --- 4. En-tête et navigation ------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border-soft);
}
.nav { display: flex; align-items: center; gap: .5rem; min-height: var(--nav-h); }
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 750; font-size: 1.12rem; color: var(--ink); text-decoration: none;
  letter-spacing: -.02em; flex: 0 0 auto;
}
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, var(--accent), #7c4dff);
  display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 800;
}
.brand .brand-logo { width: 26px; height: 26px; border-radius: 7px; flex: none; object-fit: contain; }
.nav-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem;
  background: none; border: 1px solid var(--border); color: var(--ink);
  border-radius: var(--radius-sm); padding: 8px 11px; font: inherit; font-size: .9rem;
  min-height: 40px; cursor: pointer;
}
.nav-links {
  display: none; flex-direction: column; gap: 2px;
  padding: .5rem 0 .9rem; border-top: 1px solid var(--border-soft); width: 100%;
}
.nav-links.open { display: flex; }
.nav-links a, .nav-links button.linkish {
  display: flex; align-items: center; gap: .5rem;
  padding: 11px 10px; border-radius: var(--radius-sm);
  color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500;
  background: none; border: 0; font-family: inherit; width: 100%; text-align: left; cursor: pointer;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--bg-soft); color: var(--ink); }
.nav-links a[aria-current="page"] { font-weight: 650; }
.nav-actions { display: flex; gap: .5rem; padding-top: .5rem; }
.nav-actions .btn { flex: 1; justify-content: center; }
/* Le menu horizontal n'apparaît qu'une fois l'espace réellement suffisant :
   en dessous, le menu déroulant reste plus confortable qu'un bandeau serré. */
@media (min-width: 1024px) {
  .nav { flex-wrap: nowrap; }
  .nav-toggle { display: none; }
  /* `flex-wrap: wrap` : le bandeau a atteint sa largeur utile avec l'arrivée
     des conférences. Plutôt que de masquer une section entière ou de laisser
     la page déborder horizontalement — ce qui casse la lecture sur toute la
     largeur —, les liens excédentaires passent à la ligne. Le repli ne
     concerne que les rôles chargés (élève, administration) ; l'en-tête garde
     une seule ligne partout ailleurs. */
  .nav-links {
    display: flex; flex-direction: row; align-items: center; gap: .1rem;
    flex-wrap: wrap; justify-content: flex-end; row-gap: .15rem;
    border: 0; padding: .25rem 0; margin-left: auto; width: auto;
    min-width: 0; flex: 1 1 auto;
  }
  .nav-links a, .nav-links button.linkish {
    padding: 7px 10px; width: auto;
    white-space: nowrap;   /* jamais de libellé coupé en trois lignes */
  }
  .nav-actions { padding-top: 0; margin-left: .5rem; }
  .nav-actions .btn { flex: none; }
}
.badge-count {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: #fff;
  font-size: .7rem; font-weight: 700; line-height: 1;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--accent-soft); color: var(--accent);
  display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700;
  border: 1px solid var(--border-soft);
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }

/* --- 5. Boutons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: 10px 18px;           /* cible tactile confortable */
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-group { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Au doigt, les boutons secondaires retrouvent une cible confortable ;
   au curseur, les tableaux denses restent compacts. */
@media (hover: none) {
  .btn-sm { min-height: 44px; padding: 10px 14px; }
}

/* --- 6. Cartes et surfaces ---------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow-sm);
}
.card-tight { padding: .85rem; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .12s, transform .12s; }
.card-link:hover { border-color: var(--accent-border); text-decoration: none; }
@media (hover: hover) and (min-width: 700px) { .card-link:hover { transform: translateY(-2px); } }
.panel { background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1rem; }
.section-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.section-head h2, .section-head h1 { margin: 0; }

/* --- 7. Étiquettes ------------------------------------------------------ */
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: 3px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600;
  background: var(--bg-inset); color: var(--ink-soft); border: 1px solid transparent;
  white-space: nowrap;
}
.tag-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-warning { background: var(--warning-soft); color: var(--warning); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }

/* --- 7b. Icônes SVG inline ---------------------------------------------- */
.icon { display: inline-block; vertical-align: -.15em; flex: none; }
.icon-inline { margin-right: .3rem; }

/* --- 8. Progression ----------------------------------------------------- */
.progress { background: var(--bg-inset); border-radius: 99px; height: 8px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.progress-done > span { background: var(--success); }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-muted); margin-bottom: .3rem; }

/* --- 9. Formulaires ----------------------------------------------------- */
.form-field { margin-bottom: 1.05rem; }
.form-field > label, .form-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"],
input[type="file"], select, textarea {
  width: 100%; padding: 11px 12px; min-height: 44px;
  font: inherit; font-size: 16px;                 /* 16px : évite le zoom iOS */
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  appearance: none;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
textarea.code { font-family: var(--mono); font-size: 14px; }
@media (hover: none) {
  /* Sous 16 px, iOS zoome à la mise au point et casse la mise en page. */
  textarea.code { font-size: 16px; }
}
select { max-width: 100%; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7684' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); margin: 0; flex: none; }
.check { display: flex; align-items: flex-start; gap: .6rem; padding: 9px 0; font-size: .95rem; cursor: pointer; }
.check input { margin-top: 2px; }
.help { display: block; font-size: .82rem; color: var(--ink-muted); margin-top: .3rem; }
.errorlist { list-style: none; padding: 0; margin: .35rem 0 0; color: var(--danger); font-size: .85rem; }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: var(--danger); }
fieldset { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.25rem; }
legend { font-weight: 650; padding: 0 .4rem; font-size: .95rem; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--border-soft); }
@media (max-width: 559px) { .form-actions .btn { flex: 1 1 100%; } }

/* --- 10. Messages ------------------------------------------------------- */
.alert {
  border: 1px solid var(--border); border-left-width: 4px;
  border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1rem;
  background: var(--bg-soft); font-size: .93rem;
}
.alert-success { border-left-color: var(--success); background: var(--success-soft); }
.alert-error, .alert-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.alert-warning { border-left-color: var(--warning); background: var(--warning-soft); }
.alert-info { border-left-color: var(--accent); background: var(--accent-soft); }
.alert p:last-child { margin-bottom: 0; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-muted); border: 1px dashed var(--border); border-radius: var(--radius); }

/* --- 11. Tableaux (version mobile en cartes) ---------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .7rem .75rem; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); font-weight: 650; }
table.data tbody tr:hover { background: var(--bg-soft); }
@media (max-width: 739px) {
  /* Chaque ligne devient une carte lisible au pouce : plus de défilement latéral. */
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { display: none; }
  table.data tr {
    border: 1px solid var(--border-soft); border-radius: var(--radius);
    margin-bottom: .7rem; padding: .35rem .2rem; background: var(--surface);
  }
  table.data td { border: 0; padding: .45rem .8rem; display: flex; gap: 1rem; justify-content: space-between; align-items: center; }
  table.data td::before {
    content: attr(data-label); font-size: .76rem; text-transform: uppercase;
    letter-spacing: .04em; color: var(--ink-muted); font-weight: 650; flex: none;
  }
  table.data td:empty { display: none; }
}

/* --- 12. Contenu riche des leçons --------------------------------------- */
.prose { font-size: 1.02rem; line-height: 1.72; max-width: 72ch; }
.prose h2 { margin-top: 2rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border-soft); }
.prose h3 { margin-top: 1.5rem; }
.prose img { border-radius: var(--radius); margin: 1.25rem 0; border: 1px solid var(--border-soft); }
.prose blockquote {
  margin: 1.25rem 0; padding: .6rem 1rem; border-left: 4px solid var(--accent);
  background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-soft);
}
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .93rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border-soft); padding: .55rem .7rem; text-align: left; }
.prose th { background: var(--bg-soft); }
.prose :not(pre) > code {
  font-family: var(--mono); font-size: .875em; padding: .15em .4em;
  background: var(--bg-inset); border-radius: 4px; word-break: break-word;
}
.prose .admonition {
  margin: 1.25rem 0; padding: .85rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--border-soft); border-left: 4px solid var(--accent); background: var(--bg-soft);
}
.prose .admonition-title { font-weight: 700; margin-bottom: .35rem; }
.prose .admonition.warning, .prose .admonition.attention { border-left-color: var(--warning); background: var(--warning-soft); }
.prose .admonition.danger, .prose .admonition.error { border-left-color: var(--danger); background: var(--danger-soft); }
.prose .admonition.tip, .prose .admonition.note { border-left-color: var(--success); background: var(--success-soft); }

/* Blocs de code : défilement horizontal propre, bouton Copier. */
.prose pre, .codehl pre, pre.code {
  font-family: var(--mono); font-size: .86rem; line-height: 1.55;
  background: #0d1117; color: #e6edf3;
  padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid #22303f;
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0;
  tab-size: 2;
}
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; white-space: pre; }
.codeblock { position: relative; margin: 1.25rem 0; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(255, 255, 255, .1); color: #e6edf3;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--radius-sm);
  padding: 5px 10px; font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
.codeblock:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
@media (hover: none) {
  /* Au tactile : toujours visible, et assez grand pour le pouce. */
  .copy-btn { opacity: 1; min-height: 44px; padding: 10px 14px; }
}
.copy-btn.done { background: var(--success); border-color: var(--success); color: #fff; }

/* Coloration Pygments (rendue côté serveur, valable en clair et en sombre) */
.codehl .k, .codehl .kd, .codehl .kn, .codehl .kr, .codehl .kt { color: #ff7b72; }
.codehl .s, .codehl .s1, .codehl .s2, .codehl .sb, .codehl .sd { color: #a5d6ff; }
.codehl .c, .codehl .c1, .codehl .cm, .codehl .cp { color: #8b949e; font-style: italic; }
.codehl .nb, .codehl .bp { color: #79c0ff; }
.codehl .nf, .codehl .nd { color: #d2a8ff; }
.codehl .mi, .codehl .mf, .codehl .m { color: #79c0ff; }
.codehl .nv, .codehl .vi { color: #ffa657; }
.codehl .o, .codehl .ow { color: #ff7b72; }
.codehl .err { color: #ffa198; }

/* --- 13. Vidéo (façade : l'iframe n'est chargée qu'au clic) ------------- */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: #0d1117; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-soft);
}
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade { width: 100%; height: 100%; padding: 0; border: 0; background: #0d1117; cursor: pointer; position: relative; display: block; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.video-facade .play {
  position: absolute; inset: 0; margin: auto; width: 62px; height: 62px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #0d1117;
  display: grid; place-items: center; font-size: 1.3rem; box-shadow: var(--shadow);
}
.video-facade .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .6rem .8rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff;
  font-size: .85rem; text-align: left;
}

/* --- 14. Catalogue et couvertures --------------------------------------- */
.course-cover {
  aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--bg-inset);
}
.cover-fallback {
  aspect-ratio: 16 / 9; border-radius: var(--radius-sm);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.05rem;
  text-align: center; padding: 1rem; letter-spacing: -.01em;
  background: linear-gradient(135deg, var(--accent), #6f42c1);
}
.filters { display: grid; gap: .6rem; grid-template-columns: 1fr; margin-bottom: 1.25rem; }
@media (min-width: 700px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; } }
.filters .form-field { margin: 0; }

/* --- 15. Lecteur de cours ----------------------------------------------- */
.player { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
/* Mobile : l'ordre du DOM place le contenu en premier — on ne fait pas défiler
   tout le sommaire avant d'atteindre la leçon. */
@media (min-width: 1000px) {
  .player { grid-template-columns: 310px minmax(0, 1fr); align-items: start; }
  /* Grand écran : le sommaire revient à gauche, sans changer le DOM. */
  .player-aside {
    order: -1;
    position: sticky; top: calc(var(--nav-h) + 12px);
    max-height: calc(100vh - var(--nav-h) - 28px); overflow-y: auto;
  }
}
/* Le lecteur de cours liste déjà tous les modules dans sa colonne principale :
   sur mobile, le sommaire latéral ferait doublon. */
@media (max-width: 999px) { .player-aside-duplicate { display: none; } }
.outline { list-style: none; margin: 0; padding: 0; }
.outline > li + li { margin-top: .5rem; }
.outline-module > summary {
  cursor: pointer; padding: .6rem .7rem; border-radius: var(--radius-sm);
  font-weight: 650; font-size: .93rem; list-style: none; display: flex; gap: .5rem; align-items: center;
}
.outline-module > summary::-webkit-details-marker { display: none; }
.outline-module > summary:hover { background: var(--bg-soft); }
.outline-module[open] > summary { background: var(--bg-soft); }
.outline-items { list-style: none; margin: .25rem 0 0; padding: 0 0 0 .3rem; }
.outline-items a, .outline-items span.locked {
  display: flex; gap: .55rem; align-items: center;
  padding: 9px 10px; border-radius: var(--radius-sm); font-size: .89rem;
  color: var(--ink-soft); text-decoration: none; border-left: 2px solid transparent;
}
.outline-items a:hover { background: var(--bg-soft); color: var(--ink); }
.outline-items a.current { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.outline-items .locked { color: var(--ink-muted); cursor: not-allowed; }
.item-state { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .65rem; border: 1.5px solid var(--border); }
.item-state.done { background: var(--success); border-color: var(--success); color: #fff; }
.item-state.doing { border-color: var(--accent); color: var(--accent); }
.item-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--ink-muted); font-size: .85rem; margin-bottom: 1rem; }
.player-nav {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  justify-content: space-between; margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
}
/* `min-width: 0` est nécessaire : un élément flex refuse par défaut de
   descendre sous la largeur de son texte et pousse la rangée hors de l'écran. */
.player-nav .btn { flex: 1 1 auto; min-width: 0; }
@media (max-width: 559px) {
  /* Trois boutons côte à côte ne tiennent pas sur un téléphone : « Sommaire »
     passe sur sa propre ligne, Précédent et Suivant restent appairés. */
  .player-nav .btn-ghost { order: 3; flex-basis: 100%; }
}
@media (min-width: 620px) { .player-nav .btn { flex: 0 0 auto; } }

/* --- 16. Accueil -------------------------------------------------------- */
.hero { padding: 2.5rem 0 2rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.1rem); margin-bottom: .35rem; letter-spacing: -.03em; }
.hero .tagline { font-size: clamp(1.05rem, 3.4vw, 1.35rem); color: var(--accent); font-weight: 600; margin-bottom: .9rem; }
.hero p.lead { font-size: 1.03rem; color: var(--ink-soft); max-width: 62ch; margin: 0 auto 1.6rem; }
.hero .btn-group { justify-content: center; }
@media (max-width: 559px) { .hero .btn-group .btn { flex: 1 1 100%; } }
.pillar { border-top: 3px solid var(--accent); }
.pillar h3 { display: flex; align-items: center; gap: .5rem; }
.pillar ul { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: .92rem; }
.stat { text-align: center; padding: 1rem .6rem; }
.stat .n { font-size: 1.9rem; font-weight: 750; letter-spacing: -.02em; display: block; line-height: 1.1; }
.stat .l { font-size: .84rem; color: var(--ink-muted); }

/* --- 17. Quiz ----------------------------------------------------------- */
.question { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; background: var(--surface); }
.question legend, .question .q-title { font-weight: 650; margin-bottom: .6rem; display: block; }
.question .choice {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  margin-bottom: .45rem; cursor: pointer; transition: border-color .12s, background .12s;
}
.question .choice:hover { border-color: var(--accent-border); background: var(--bg-soft); }
.question .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.correct { border-color: var(--success); background: var(--success-soft); }
.choice.wrong { border-color: var(--danger); background: var(--danger-soft); }
.exam-timer {
  position: sticky; top: calc(var(--nav-h) + 6px); z-index: 20;
  background: var(--warning-soft); border: 1px solid var(--warning);
  color: var(--warning); border-radius: var(--radius-sm);
  padding: .5rem .85rem; font-weight: 700; font-variant-numeric: tabular-nums;
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;
}
.score-ring { text-align: center; padding: 1.5rem 1rem; }
.score-ring .pct { font-size: 3rem; font-weight: 750; line-height: 1; letter-spacing: -.03em; }
.score-ring .pct.pass { color: var(--success); }
.score-ring .pct.fail { color: var(--danger); }

/* --- 18. Certificat ----------------------------------------------------- */
.cert {
  border: 2px solid var(--accent); border-radius: var(--radius-lg);
  padding: 2rem 1.25rem; text-align: center; background: var(--surface); box-shadow: var(--shadow);
}
.cert .code { font-family: var(--mono); font-size: 1.15rem; letter-spacing: .06em; font-weight: 700; word-break: break-all; }
.cert h2 { margin: .5rem 0; }

/* --- 19. Pied de page --------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border-soft); background: var(--bg-soft); padding: 2rem 0 2.5rem; margin-top: 3rem; font-size: .9rem; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); margin-bottom: .6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border-soft); color: var(--ink-muted); font-size: .84rem; }

/* --- 20. Divers --------------------------------------------------------- */
.breadcrumb { font-size: .85rem; color: var(--ink-muted); margin-bottom: .85rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; align-items: center; margin-top: 2rem; }
.pagination .btn-sm { min-width: 40px; }
.pagination .current { font-weight: 700; padding: 0 .75rem; color: var(--ink-muted); font-size: .9rem; }
.notif { display: flex; gap: .8rem; padding: .85rem 0; border-bottom: 1px solid var(--border-soft); }
.notif.unread { background: var(--accent-soft); margin-inline: -.75rem; padding-inline: .75rem; border-radius: var(--radius-sm); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: .55rem; }
/* La ligne de fichier se replie plutôt que de pousser son bouton hors de
   l'écran : un nom de fichier long est la règle, pas l'exception. */
.file-item {
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  padding: .85rem; border: 1px solid var(--border-soft); border-radius: var(--radius);
}
.file-item > .btn, .file-item > .tag { flex: 0 0 auto; }
@media (max-width: 559px) {
  .file-item > .btn { flex: 1 1 100%; justify-content: center; }
}
.file-ext {
  flex: none; width: 46px; height: 46px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: .7rem; font-weight: 800; letter-spacing: .02em;
}
@media print {
  .site-header, .site-footer, .btn, .player-aside, .breadcrumb, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .cert { box-shadow: none; border-color: #999; }
}

/* --- 21. Blocs insérés par balise --------------------------------------- */
/* Les balises [[…]] produisent des blocs de largeur pleine au milieu d'un
   texte rédigé : ils doivent respirer sans casser le rythme de la prose. */
.shortcode { margin: 1.75rem 0; }
.prose > .shortcode:first-child { margin-top: 0; }
.featured-course { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .featured-course { grid-template-columns: 300px minmax(0, 1fr); align-items: center; }
}
.featured-body h3 { font-size: 1.15rem; }

/* --- 22. Éditeur Markdown assisté --------------------------------------- */
/* La barre d'outils est masquée tant que le script ne l'a pas activée : sans
   JavaScript, il ne reste qu'un champ de saisie parfaitement utilisable. */
.editor { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.editor textarea {
  border: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-height: 320px; resize: vertical;
}
.editor textarea:focus { outline-offset: -3px; }
.editor-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .2rem;
  padding: .35rem; border-bottom: 1px solid var(--border-soft);
  background: var(--bg-soft); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  position: sticky; top: var(--nav-h); z-index: 5;
}
.editor-btn {
  min-width: 36px; min-height: 36px; padding: 6px 9px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-soft);
  font: inherit; font-size: .85rem; line-height: 1; cursor: pointer;
}
.editor-btn:hover { background: var(--bg-inset); color: var(--ink); }
.editor-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.editor-sep { width: 1px; height: 22px; background: var(--border); margin: 0 .25rem; }
/* Les quelques boutons portant un libellé textuel (G, I, H2…) s'alignent sur
   la taille des boutons à icône. */
.editor-btn > .editor-glyph, .editor-btn { display: inline-flex; align-items: center; justify-content: center; }
.editor-glyph { font-family: var(--mono); font-size: .8rem; }
.editor-tab { font-weight: 600; }
.editor-preview {
  padding: 1rem; min-height: 320px; max-width: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.editor-help { padding: .75rem 1rem; border-top: 1px solid var(--border-soft); font-size: .9rem; }
.editor-help summary { cursor: pointer; font-weight: 600; }
@media (hover: none) {
  /* Au doigt, les boutons de la barre gagnent la même cible que les autres. */
  .editor-btn { min-width: 44px; min-height: 44px; }
}

/* --- 23. Wiki ------------------------------------------------------------ */
.wiki-tree { list-style: none; margin: .25rem 0 0; padding-left: 0; }
.wiki-tree .wiki-tree { padding-left: .85rem; border-left: 1px solid var(--border-soft); margin-left: .45rem; }
.wiki-tree a {
  display: block; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-soft); text-decoration: none; font-size: .92rem;
  border-left: 2px solid transparent;
}
.wiki-tree a:hover { background: var(--bg-soft); color: var(--ink); }
.wiki-tree a.current { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
@media (hover: none) {
  /* Le sommaire se parcourt au pouce : 8 px de rembourrage laissaient les
     liens juste sous la cible tactile confortable. */
  .wiki-tree a { padding: 11px 10px; }
}
/* Lien rouge : convention des wikis pour une page qui reste à écrire. */
.wikilink-missing { color: var(--danger); border-bottom: 1px dashed currentColor; text-decoration: none; }
a.wikilink-missing:hover { background: var(--danger-soft); }
span.wikilink-missing { cursor: help; }
.prose-wide { max-width: none; }
/* Page rédigée : le texte reste à une largeur lisible, mais les blocs insérés
   par balise ([[cours]], [[cohortes]]…) occupent toute la colonne — une grille
   de formations à 72 caractères de large ne serait qu'une pile. */
.prose-page { max-width: none; }
.prose-page > p,
.prose-page > ul,
.prose-page > ol,
.prose-page > dl,
.prose-page > blockquote,
.prose-page > h1,
.prose-page > h2,
.prose-page > h3,
.prose-page > h4,
.prose-page > .admonition { max-width: 72ch; }

/* --- 24. Tarification ---------------------------------------------------- */
.price-box {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem;
  padding: .85rem 1rem; border: 1px solid var(--border-soft);
  border-radius: var(--radius); background: var(--bg-soft);
}
.price-amount { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; }
.price-free { color: var(--success); }
/* Le taux de commission : champ libre, plus des valeurs courantes. */
.rate-field { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.rate-input { position: relative; flex: 1 1 140px; min-width: 120px; }
.rate-input input { padding-right: 2.2rem; }
.rate-suffix {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); pointer-events: none; font-size: .9rem;
}
.rate-presets { display: flex; flex-wrap: wrap; gap: .3rem; }

/* --- 25. Téléversement d'image depuis l'éditeur ------------------------- */
.editor-status {
  margin: 0; padding: .55rem 1rem; font-size: .85rem;
  color: var(--ink-soft); background: var(--bg-soft);
  border-top: 1px solid var(--border-soft);
}
.editor-status-error { color: var(--danger); background: var(--danger-soft); }
/* Repère visuel pendant un glisser-déposer. */
.editor textarea.editor-drop { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* --- 26. Lecture d'un document dans la page ----------------------------- */
.doc-viewer {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--bg-soft); overflow: hidden;
}
.doc-viewer img { width: 100%; height: auto; display: block; }
.doc-viewer iframe { width: 100%; border: 0; display: block; background: var(--bg-soft); }
/* Un PDF a besoin de hauteur ; sur mobile on garde une proportion lisible
   plutôt qu'une fenêtre écrasée. */
.doc-viewer-pdf iframe { height: 70vh; min-height: 420px; }
@media (max-width: 739px) {
  .doc-viewer-pdf iframe { height: 60vh; min-height: 340px; }
}

/* --- 27. Bandeau d'aperçu ----------------------------------------------- */
/* Doit rester identifiable sans être envahissant : l'enseignant regarde le
   contenu, pas le bandeau. */
.preview-banner { border-left-color: var(--accent); }
.preview-banner .row { gap: .75rem; }

/* =========================================================================
   28. Blocs interactifs des cours
   Chaque bloc doit rester lisible sans JavaScript : les onglets se déplient,
   la réponse d'une question reste dépliable, les cases restent cochables.
   ========================================================================= */
.bloc { margin: 1.75rem 0; }
.prose > .bloc:first-child { margin-top: 0; }
.bloc-titre { margin: 0 0 .6rem; font-size: 1rem; }

/* --- Onglets ------------------------------------------------------------- */
.bloc-onglets {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
}
.onglets-barre {
  display: none;                      /* révélée par le script */
  flex-wrap: wrap; gap: .2rem; padding: .35rem;
  background: var(--bg-soft); border-bottom: 1px solid var(--border-soft);
}
.bloc-onglets.actif .onglets-barre { display: flex; }
.onglet-bouton {
  min-height: 40px; padding: 8px 14px; border: 1px solid transparent;
  border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft);
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
}
.onglet-bouton:hover { background: var(--bg-inset); color: var(--ink); }
.onglet-bouton[aria-selected="true"] {
  background: var(--surface); color: var(--accent);
  border-color: var(--border-soft); box-shadow: var(--shadow-sm);
}
.onglet-panneau { padding: 1rem; }
.onglet-panneau > :first-child { margin-top: 0; }
.onglet-panneau > :last-child { margin-bottom: 0; }
/* Sans script, chaque panneau garde son titre et suit le précédent. */
.onglet-titre-repli { margin: 0 0 .5rem; font-size: .95rem; color: var(--accent); }
.bloc-onglets.actif .onglet-titre-repli { display: none; }
.bloc-onglets.actif .onglet-panneau[hidden] { display: none; }
.bloc-onglets:not(.actif) .onglet-panneau + .onglet-panneau {
  border-top: 1px solid var(--border-soft);
}
@media (hover: none) { .onglet-bouton { min-height: 44px; } }

/* --- Étapes -------------------------------------------------------------- */
.etapes { list-style: none; margin: 0; padding: 0; }
.etape { display: flex; gap: .9rem; padding-bottom: 1.1rem; position: relative; }
.etape:last-child { padding-bottom: 0; }
/* Trait de liaison entre les pastilles, pour faire lire la suite. */
.etape:not(:last-child)::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px;
  width: 2px; background: var(--border);
}
.etape-numero {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: var(--accent); color: var(--accent-ink); position: relative; z-index: 1;
}
.etape-corps { min-width: 0; padding-top: .2rem; }
.etape-corps > :first-child { margin-top: 0; }
.etape-corps > :last-child { margin-bottom: 0; }
.etape-titre { margin: 0 0 .35rem; font-size: 1rem; }

/* --- Question d'auto-évaluation ------------------------------------------ */
.bloc-question {
  border: 1px solid var(--accent-border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1rem; background: var(--accent-soft);
}
.question-entete { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.question-etiquette {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent);
}
.question-enonce > :last-child { margin-bottom: .75rem; }
.question-reponse > summary {
  cursor: pointer; font-weight: 600; color: var(--accent);
  padding: 9px 0; min-height: 40px; display: flex; align-items: center;
}
.question-corps {
  padding: .75rem 1rem; margin-top: .25rem;
  background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}
.question-corps > :first-child { margin-top: 0; }
.question-corps > :last-child { margin-bottom: 0; }

/* --- Liste de vérification ----------------------------------------------- */
.bloc-verification {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 1rem; background: var(--bg-soft);
}
.verification { list-style: none; margin: 0; padding: 0; }
.verification li + li { border-top: 1px solid var(--border-soft); }
.verification .check { padding: 10px 0; }
.verification p { margin: 0; }
/* Un point coché s'efface visuellement : il ne reste que ce qui est à faire. */
.verification .check:has(input:checked) > span { color: var(--ink-muted); text-decoration: line-through; }

/* --- Comparaison --------------------------------------------------------- */
.comparer-grille { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .comparer-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.comparer-colonne {
  border: 1px solid var(--border-soft); border-top: 3px solid var(--border);
  border-radius: var(--radius); padding: 1rem; background: var(--surface);
}
.comparer-colonne > :first-child { margin-top: 0; }
.comparer-colonne > :last-child { margin-bottom: 0; }
.comparer-titre { margin: 0 0 .6rem; font-size: 1rem; }
.comparer-succes { border-top-color: var(--success); background: var(--success-soft); }
.comparer-succes .comparer-titre { color: var(--success); }
.comparer-danger { border-top-color: var(--danger); background: var(--danger-soft); }
.comparer-danger .comparer-titre { color: var(--danger); }

/* --- Terminal ------------------------------------------------------------ */
.bloc-terminal { border-radius: var(--radius); overflow: hidden; border: 1px solid #22303f; }
.terminal-barre {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .8rem; background: #161c25; border-bottom: 1px solid #22303f;
}
.terminal-pastilles { display: flex; gap: .3rem; }
.terminal-pastilles i { width: 10px; height: 10px; border-radius: 50%; background: #3a4654; }
.terminal-pastilles i:first-child { background: #ff5f57; }
.terminal-pastilles i:nth-child(2) { background: #febc2e; }
.terminal-pastilles i:nth-child(3) { background: #28c840; }
.terminal-titre { font-family: var(--mono); font-size: .78rem; color: #8c99a8; }
.terminal-corps { background: #0d1117; padding: .25rem 0; }
.terminal-corps pre { border: 0; border-radius: 0; margin: 0; }
.terminal-corps p { color: #c9d1d9; padding: .5rem 1rem; margin: 0; font-family: var(--mono); font-size: .86rem; }

/* --- Encadré ------------------------------------------------------------- */
.bloc-encadre {
  border: 1px solid var(--border-soft); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1rem; background: var(--bg-soft);
}
.bloc-encadre > :last-child { margin-bottom: 0; }
.encadre-succes { border-left-color: var(--success); background: var(--success-soft); }
.encadre-attention { border-left-color: var(--warning); background: var(--warning-soft); }
.encadre-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.encadre-neutre { border-left-color: var(--border); }

/* --- 29. Menu d'insertion de blocs -------------------------------------- */
.editor-btn-large { gap: .35rem; padding: 6px 11px; }
.editor-label { font-size: .85rem; font-weight: 600; }
.editor-blocs {
  display: grid; gap: .4rem; grid-template-columns: 1fr;
  padding: .7rem; background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
}
@media (min-width: 620px) { .editor-blocs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .editor-blocs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.editor-bloc {
  display: flex; flex-direction: column; gap: .15rem; align-items: flex-start;
  min-height: 56px; padding: .6rem .7rem; text-align: left;
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
}
.editor-bloc:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.editor-bloc strong { font-size: .9rem; }
/* Texte d'introduction placé avant la première section d'un bloc. */
.bloc-intro { margin-bottom: .85rem; }
.bloc-intro > :first-child { margin-top: 0; }
.bloc-intro > :last-child { margin-bottom: 0; }
.bloc-onglets .bloc-intro, .bloc-verification .bloc-intro { padding: 0 1rem; }
.bloc-onglets .bloc-intro { padding-top: .85rem; }

/* --- 30. Aide ------------------------------------------------------------ */
/* Le sommaire de l'aide est une liste imbriquée : sa structure porte déjà la
   hiérarchie, la mise en forme ne fait que la rendre lisible. */
.aide-sommaire { padding-left: 1.4rem; }
.aide-sommaire > li { margin-bottom: 1rem; }
.aide-sommaire > li > a { font-weight: 650; }
.aide-sommaire > li > .small { display: block; margin: .1rem 0 .35rem; }
.aide-sommaire ul { list-style: none; padding-left: 0; margin: 0; }
.aide-sommaire ul li { margin: 0; }
.aide-sommaire ul a {
  display: inline-block; padding: 3px 0; font-size: .9rem; color: var(--ink-soft);
}
.aide-sommaire ul a:hover { color: var(--accent); }
@media (hover: none) { .aide-sommaire ul a { padding: 8px 0; } }

/* Renvois internes d'une section : compacts, pour ne pas repousser le texte. */
.aide-local ul { list-style: none; margin: .4rem 0 0; padding: 0; columns: 2; column-gap: 1.2rem; }
@media (max-width: 559px) { .aide-local ul { columns: 1; } }
.aide-local li { break-inside: avoid; }
.aide-local a { font-size: .9rem; }

/* `scroll-margin-top` : sans lui, une ancre place le titre sous l'en-tête
   fixe et l'on croit avoir atterri au mauvais endroit. */
.aide-sujet { scroll-margin-top: calc(var(--nav-h) + 16px); }
.aide-sujet + .aide-sujet { margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1px solid var(--border-soft); }
.aide-sujet > h2 { margin-top: 0; }

.editor-bloc-aide {
  grid-column: 1 / -1; padding: .35rem .1rem 0; color: var(--ink-muted);
}

/* --- 31. Conférences ------------------------------------------------------ */
/* Les faits d'une conférence — date, lieu, accès — se lisent d'abord ; la
   description vient après. D'où une liste de définitions plutôt qu'un
   paragraphe : chaque information est étiquetée et repérable d'un coup d'œil. */
.event-facts { display: grid; grid-template-columns: 1fr; gap: .15rem .9rem; margin: 1.25rem 0 0; }
.event-facts dt {
  display: flex; align-items: center; gap: .4rem;
  color: var(--ink-muted); font-size: .82rem; font-weight: 600;
  margin-top: .85rem;
}
.event-facts dd { margin: 0; font-size: .95rem; }
@media (min-width: 620px) {
  .event-facts { grid-template-columns: max-content minmax(0, 1fr); }
  .event-facts dt { margin-top: .35rem; }
  .event-facts dd { margin-top: .35rem; }
}
.event-when { font-variant-numeric: tabular-nums; }

/* --- Sécurité du compte ------------------------------------------------- */
.qr-box { display: inline-block; padding: 8px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--border); margin: .25rem 0 .75rem; }
.qr-box svg { display: block; width: 200px; height: 200px; }
.recovery-codes { columns: 2; column-gap: 2rem; padding-left: 1.4rem; font-size: 1.05rem; }
.recovery-codes li { margin-bottom: .35rem; }
