/* Mise en page : sommaire fixe à gauche, colonne de lecture à droite ; une seule colonne sur téléphone.
   Couleurs Copilotr@ce : primaire #F59E0B, survol #D48809, bordure active #F97316. */
:root {
  --primaire: #F59E0B;
  --primaire-survol: #D48809;
  --actif: #F97316;
  --fond: #FBF9F5;
  --surface: #FFFFFF;
  --surface-douce: #FEF4DC;
  --texte: #1F1A12;
  --texte-doux: #6A6152;
  --trait: #E9E2D3;
  --encre-bouton: #1F1A12;
  --bien: #1F8A4C;
  --bien-fond: #E7F5EC;
  --attention: #B4420F;
  --attention-fond: #FDEBDD;
  --titre: "Sora", "Segoe UI", system-ui, sans-serif;
  --corps: "Figtree", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #17140F;
    --surface: #211D16;
    --surface-douce: #33280F;
    --texte: #F4EEE2;
    --texte-doux: #B5AA95;
    --trait: #3A3327;
    --encre-bouton: #1F1A12;
    --bien: #6FD19A;
    --bien-fond: #183424;
    --attention: #FFAE7A;
    --attention-fond: #3B2212;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #17140F;
  --surface: #211D16;
  --surface-douce: #33280F;
  --texte: #F4EEE2;
  --texte-doux: #B5AA95;
  --trait: #3A3327;
  --encre-bouton: #1F1A12;
  --bien: #6FD19A;
  --bien-fond: #183424;
  --attention: #FFAE7A;
  --attention-fond: #3B2212;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--corps); font-size: 17px; line-height: 1.6; }
a { color: inherit; text-decoration-color: var(--primaire); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--primaire-survol); }
:focus-visible { outline: 3px solid var(--actif); outline-offset: 2px; border-radius: 4px; }

.page { display: grid; grid-template-columns: 280px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
nav.sommaire { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 28px 20px 28px 24px; border-right: 1px solid var(--trait); }
.marque { font-family: var(--titre); font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.marque span.pastille { width: 14px; height: 14px; border-radius: 50%; background: var(--primaire); box-shadow: 0 0 0 4px var(--surface-douce); }
.sous-marque { color: var(--texte-doux); font-size: .9rem; margin-bottom: 22px; }
nav.sommaire ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: s; }
nav.sommaire li a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 9px; text-decoration: none; font-weight: 500; font-size: .96rem; border-left: 3px solid transparent; }
nav.sommaire li a::before { counter-increment: s; content: counter(s); font-variant-numeric: tabular-nums; color: var(--texte-doux); font-size: .82rem; min-width: 1.2em; }
nav.sommaire li a:hover { background: var(--surface-douce); color: var(--texte); }
nav.sommaire li a.ici { background: var(--surface-douce); border-left-color: var(--actif); font-weight: 700; }

main { padding: 44px 40px 80px; min-width: 0; }
.colonne { max-width: 760px; }
header.entete h1 { font-family: var(--titre); font-size: 2.3rem; line-height: 1.15; margin: 0 0 12px; text-wrap: balance; }
header.entete p.chapo { font-size: 1.15rem; color: var(--texte-doux); margin: 0 0 8px; }
.pour-qui { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 999px; background: var(--surface-douce); border: 1px solid var(--primaire); font-size: .9rem; font-weight: 600; }

section { padding-top: 46px; }
h2 { font-family: var(--titre); font-size: 1.55rem; line-height: 1.2; margin: 0 0 6px; text-wrap: balance; display: flex; align-items: center; gap: 12px; }
h2 .num { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--primaire); color: var(--encre-bouton); display: grid; place-items: center; font-size: 1rem; font-variant-numeric: tabular-nums; }
h3 { font-family: var(--titre); font-size: 1.1rem; margin: 30px 0 8px; }
p { margin: 0 0 14px; }
.resume { color: var(--texte-doux); margin-bottom: 18px; }
ul { padding-left: 1.2em; margin: 0 0 14px; }
li { margin-bottom: 5px; }

/* étapes numérotées : un vrai ordre d'actions */
ol.etapes { list-style: none; counter-reset: e; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
ol.etapes > li { counter-increment: e; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; margin: 0; }
ol.etapes > li::before { content: counter(e); width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--actif); color: var(--actif); font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; font-size: .95rem; }
ol.etapes > li > div > p:last-child, ol.etapes > li > div > ul:last-child { margin-bottom: 0; }

.bouton { display: inline-block; padding: 1px 9px; border-radius: 7px; background: var(--encre-bouton); color: #fff; font-weight: 600; font-size: .9em; white-space: nowrap; }
:root[data-theme="dark"] .bouton { background: #F4EEE2; color: #1F1A12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bouton { background: #F4EEE2; color: #1F1A12; } }
.bouton.rouge { background: #E5484D; color: #fff; }
.menu { display: inline-block; padding: 1px 8px; border-radius: 7px; border: 1px solid var(--trait); background: var(--surface); font-weight: 600; font-size: .9em; white-space: nowrap; }
.champ { font-weight: 700; }

.note { border-left: 4px solid var(--primaire); background: var(--surface-douce); border-radius: 0 12px 12px 0; padding: 12px 16px; margin: 0 0 18px; }
.note.bien { border-left-color: var(--bien); background: var(--bien-fond); }
.note.attention { border-left-color: var(--actif); background: var(--attention-fond); }
.note strong:first-child { display: block; margin-bottom: 2px; }
.note p:last-child { margin-bottom: 0; }

figure { margin: 0 0 22px; }
figure .cadre { background: #fff; border: 1px solid var(--trait); border-radius: 14px; overflow: hidden; box-shadow: 0 6px 22px rgba(60, 40, 0, .08); }
figure.etroit .cadre { max-width: 420px; }
figure img { display: block; max-width: 100%; height: auto; }
figcaption { font-size: .9rem; color: var(--texte-doux); margin-top: 8px; }

.tableau { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--trait); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--trait); vertical-align: top; }
thead th { background: var(--surface-douce); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.obl { white-space: nowrap; font-weight: 600; }
.oui { color: var(--bien); font-weight: 700; }
.non { color: var(--texte-doux); }

.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 0 0 20px; }
.role { background: var(--surface); border: 1px solid var(--trait); border-radius: 14px; padding: 14px 16px; }
.role.vous { border: 2px solid var(--actif); }
.role h4 { margin: 0 0 4px; font-family: var(--titre); font-size: 1rem; }
.role p { margin: 0; font-size: .95rem; color: var(--texte-doux); }
.role .etiq { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--actif); margin-bottom: 4px; }

/* carte de connexion d'un scripteur, dessinée */
.kit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--surface); border: 2px dashed var(--trait); border-radius: 16px; padding: 14px; margin: 0 0 8px; max-width: 560px; }
.kit > div { background: var(--surface-douce); border-radius: 12px; padding: 12px 8px; text-align: center; font-weight: 700; font-size: .88rem; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kit .vignette { width: 74px; height: 74px; border-radius: 12px; background: var(--surface); border: 1px solid var(--trait); display: grid; place-items: center; }
.kit .rond { width: 46px; height: 46px; border-radius: 50%; background: var(--primaire); }
.kit .lettres { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95rem; letter-spacing: .12em; }
.kit .qr { width: 52px; height: 52px; background:
   linear-gradient(var(--texte), var(--texte)) 0 0 / 18px 18px no-repeat,
   linear-gradient(var(--texte), var(--texte)) 100% 0 / 18px 18px no-repeat,
   linear-gradient(var(--texte), var(--texte)) 0 100% / 18px 18px no-repeat,
   repeating-conic-gradient(var(--texte) 0 25%, transparent 0 50%) 50% 50% / 13px 13px; }

.memo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.memo > div { background: var(--surface); border: 1px solid var(--trait); border-top: 4px solid var(--primaire); border-radius: 12px; padding: 14px 16px; }
.memo h4 { margin: 0 0 6px; font-family: var(--titre); font-size: .98rem; }
.memo p { margin: 0; font-size: .95rem; }

details { background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; }
details[open] { border-color: var(--actif); }
summary { cursor: pointer; font-weight: 700; padding: 13px 0; }
details > *:not(summary) { margin-top: 0; }
details p:last-child, details ul:last-child { margin-bottom: 14px; }

footer { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--trait); color: var(--texte-doux); font-size: .9rem; }

@media (max-width: 860px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  nav.sommaire { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--trait); padding: 20px 16px; }
  nav.sommaire ol { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  nav.sommaire li a { border-left: 0; border: 1px solid var(--trait); padding: 6px 10px; font-size: .88rem; }
  nav.sommaire li a.ici { border-color: var(--actif); }
  main { padding: 28px 16px 60px; }
  header.entete h1 { font-size: 1.75rem; }
  h2 { font-size: 1.3rem; }
  .kit { grid-template-columns: minmax(0, 1fr); }
}

/* ---- complements communs a tous les guides ---- */
.retour-guides { margin: -10px 0 20px; font-size: .92rem; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.gros ol.etapes > li { font-size: 1.12rem; padding: 16px 18px; grid-template-columns: 44px minmax(0, 1fr); }
.gros ol.etapes > li::before { width: 40px; height: 40px; font-size: 1.15rem; background: var(--primaire); border-color: var(--primaire); color: var(--encre-bouton); }
.gros p, .gros li { font-size: 1.1rem; }
.trois { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 20px; }
.trois > div { background: var(--surface); border: 1px solid var(--trait); border-radius: 16px; padding: 16px; text-align: center; }
.trois h4 { margin: 10px 0 4px; font-family: var(--titre); font-size: 1.02rem; }
.trois p { margin: 0; font-size: .98rem; color: var(--texte-doux); }
.dessin { width: 84px; height: 84px; border-radius: 18px; background: var(--surface-douce); display: grid; place-items: center; margin: 0 auto; color: var(--actif); }
.dessin svg { width: 46px; height: 46px; }
.ecran { background: var(--surface); border: 2px solid var(--trait); border-radius: 18px; padding: 16px; margin: 0 0 8px; max-width: 520px; }
.ecran .barre { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ecran .feuille { background: #fff; border: 1px solid var(--trait); border-radius: 8px; height: 190px; position: relative; overflow: hidden; }
.ecran .feuille .m { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: #e5e5e5; color: #e9a3a3; display: grid; place-items: center; font-family: Georgia, serif; font-size: 1.1rem; }
.ecran .feuille svg { position: absolute; inset: 0; width: 100%; height: 100%; }
kbd { font-family: inherit; font-weight: 700; background: var(--surface); border: 1px solid var(--trait); border-bottom-width: 3px; border-radius: 7px; padding: 0 7px; white-space: nowrap; }

/* ---- page d'entree : cartes comme sur l'accueil ---- */
.hub { max-width: 1180px; margin: 0 auto; padding: 0 24px 80px; }
.hub-haut { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; flex-wrap: wrap; }
.hub-haut .marque { margin: 0; font-size: 1.25rem; }
.hub-haut nav { display: flex; gap: 18px; font-weight: 600; font-size: .95rem; flex-wrap: wrap; }
.hub-titre { max-width: 760px; margin: 40px auto 44px; text-align: center; }
.hub-titre h1 { font-family: var(--titre); font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.15; margin: 0 0 14px; text-wrap: balance; }
.hub-titre p { color: var(--texte-doux); font-size: 1.12rem; margin: 0; }
.cartes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
a.carte { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--trait); border-radius: 20px; padding: 26px; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(17,24,39,.06), 0 6px 20px rgba(17,24,39,.06); transition: transform .18s, box-shadow .18s, border-color .18s; }
a.carte:hover { transform: translateY(-4px); box-shadow: 0 4px 8px rgba(17,24,39,.08), 0 18px 40px rgba(17,24,39,.12); border-color: var(--actif); color: inherit; }
a.carte .ico { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--surface-douce); color: var(--actif); margin-bottom: 16px; }
a.carte .ico svg { width: 26px; height: 26px; }
a.carte .public { font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-doux); margin-bottom: 6px; }
a.carte h2 { font-family: var(--titre); font-size: 1.2rem; margin: 0 0 8px; display: block; }
a.carte p { color: var(--texte-doux); font-size: 1rem; margin: 0 0 14px; flex: 1; }
a.carte .plus { color: var(--primaire-survol); font-weight: 700; font-size: .95rem; }
a.carte:hover .plus { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { a.carte { transition: none; } a.carte:hover { transform: none; } }
@media (max-width: 980px) { .cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cartes { grid-template-columns: minmax(0, 1fr); } .hub { padding: 0 16px 60px; } }
