:root {
  --navy: #0d1e4a; --navy2: #1e3a8a; --or: #d97706; --or-cl: #fff7ed;
  --fond: #f4f6fb; --carte: #fff; --bord: #e5e7eb; --bord2: #cbd5e1;
  --texte: #0f172a; --texte2: #374151; --titre: #0d1e4a; --gris: #6b7280;
  --doux: #f8fafc; --doux2: #f1f5f9; --survol: #eef2ff; --code: #f1f5f9;
  --ombre: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --barre: 64px; --cote: 290px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --fond: #0b1220; --carte: #111a2e; --bord: #24324f; --bord2: #334466;
  --texte: #e5e7eb; --texte2: #cbd5e1; --titre: #e0e7ff; --gris: #94a3b8;
  --doux: #16213a; --doux2: #1b2744; --survol: #1e2b4d; --or-cl: #3a2a12; --code: #1b2744;
  --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--barre) + 18px); }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; background: var(--fond); color: var(--texte); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--navy2); }
html[data-theme="dark"] a { color: #93b4ff; }
button { font: inherit; }

.barre { position: fixed; inset: 0 0 auto 0; height: var(--barre); display: flex; align-items: center; gap: 16px; padding: 0 22px; background: color-mix(in srgb, var(--carte) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--bord); z-index: 40; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--titre); width: calc(var(--cote) - 38px); flex-shrink: 0; }
.marque img { width: 34px; height: 34px; object-fit: contain; }
.marque span { display: flex; flex-direction: column; line-height: 1.1; }
.marque strong { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: var(--titre); }
.marque small { font-size: .74rem; font-weight: 600; color: var(--or); text-transform: uppercase; letter-spacing: .08em; }
.recherche-btn { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--bord); background: var(--doux); color: var(--gris); border-radius: 11px; cursor: pointer; font-size: .88rem; text-align: left; }
.recherche-btn span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recherche-btn:hover { border-color: var(--bord2); }
kbd { font-family: inherit; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--bord); background: var(--carte); color: var(--gris); white-space: nowrap; }
.theme, .menu-mobile { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--bord); background: var(--carte); color: var(--titre); display: flex; align-items: center; justify-content: center; cursor: pointer; margin-left: auto; flex-shrink: 0; }
.theme:hover, .menu-mobile:hover { background: var(--survol); }
.theme .soleil, html[data-theme="dark"] .theme .lune { display: none; }
html[data-theme="dark"] .theme .soleil { display: block; }
.menu-mobile { display: none; margin-left: 0; }

.cote { position: fixed; top: var(--barre); bottom: 0; left: 0; width: var(--cote); overflow-y: auto; padding: 22px 14px 70px; border-right: 1px solid var(--bord); background: var(--carte); z-index: 30; scrollbar-width: thin; }
.cote-titre { margin: 0 10px 10px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--gris); }
.nav, .nav ul { list-style: none; margin: 0; padding: 0; }
.nav > li { margin-bottom: 2px; }
.nav-ligne { display: flex; align-items: center; border-radius: 10px; }
.nav-ligne:hover { background: var(--doux2); }
.nav-role { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-decoration: none; color: var(--texte2) !important; font-weight: 650; font-size: .9rem; }
.nav-ico { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); flex-shrink: 0; }
html[data-theme="dark"] .nav-ico { color: color-mix(in srgb, var(--c) 55%, white); background: color-mix(in srgb, var(--c) 28%, transparent); }
.nav-pli { width: 30px; height: 30px; border: 0; background: none; color: var(--gris); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: transform .15s; }
.nav li.ouvert .nav-pli { transform: rotate(90deg); }
.nav li > ul { display: none; margin: 2px 0 8px 23px; padding-left: 12px; border-left: 2px solid var(--bord); }
.nav li.ouvert > ul { display: block; }
.nav li > ul a { display: block; padding: 5px 10px; font-size: .84rem; color: var(--gris) !important; text-decoration: none; border-radius: 8px; line-height: 1.35; }
.nav li > ul a:hover { color: var(--titre) !important; background: var(--doux2); }
.nav li > ul a.vu { color: var(--titre) !important; font-weight: 650; background: var(--survol); }
.nav li.actif > .nav-ligne { background: var(--survol); }
.nav li.actif .nav-role { color: var(--titre) !important; }
.cote-pied { margin: 26px 10px 0; font-size: .75rem; color: var(--gris); }

.contenu { margin-left: var(--cote); padding: calc(var(--barre) + 34px) 40px 60px; display: flex; gap: 48px; justify-content: center; }
.contenu article { width: 100%; max-width: 860px; min-width: 0; }
.toc { position: sticky; top: calc(var(--barre) + 34px); align-self: flex-start; width: 230px; flex-shrink: 0; max-height: calc(100vh - var(--barre) - 60px); overflow-y: auto; font-size: .82rem; scrollbar-width: thin; }
.toc p { margin: 0 0 10px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--gris); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--bord); }
.toc li a { display: block; padding: 4px 0 4px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--gris); text-decoration: none; line-height: 1.4; }
.toc li.n3 a { padding-left: 26px; font-size: .78rem; }
.toc li a:hover { color: var(--titre); }
.toc li a.vu { color: var(--or); border-left-color: var(--or); font-weight: 650; }

.entete-role { display: flex; gap: 18px; align-items: flex-start; padding: 26px 28px; border-radius: 18px; background: var(--carte); border: 1px solid var(--bord); box-shadow: var(--ombre); margin-bottom: 34px; position: relative; overflow: hidden; }
.entete-role::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--c), var(--or)); }
.pastille { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--c); flex-shrink: 0; }
.entete-role .sur { margin: 0; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--or); }
.entete-role h1 { margin: 2px 0 6px; font-size: 2rem; line-height: 1.15; letter-spacing: -.02em; color: var(--titre); }
.entete-role .chapo { margin: 0; color: var(--texte2); font-size: 1rem; }

article h2 { font-size: 1.5rem; letter-spacing: -.015em; margin: 54px 0 14px; padding-top: 10px; color: var(--titre); line-height: 1.25; border-top: 1px solid var(--bord); padding-top: 34px; }
article h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 10px; }
article h3 { font-size: 1.14rem; margin: 34px 0 10px; color: var(--titre); line-height: 1.3; }
article h4 { font-size: 1rem; margin: 24px 0 8px; color: var(--titre); }
article h2, article h3, article h4 { position: relative; }
.lien-ancre { position: absolute; left: -22px; opacity: 0; color: var(--or) !important; text-decoration: none; font-weight: 700; }
article h2 .lien-ancre { top: 34px; }
article h2:first-of-type .lien-ancre { top: 0; }
h2:hover .lien-ancre, h3:hover .lien-ancre, h4:hover .lien-ancre { opacity: 1; }
article p { margin: 0 0 14px; color: var(--texte2); }
article ul { margin: 0 0 16px; padding-left: 22px; color: var(--texte2); }
article ul li { margin: 4px 0; }
article ul li::marker { color: var(--or); }
strong { color: var(--texte); font-weight: 700; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .86em; background: var(--code); padding: 2px 6px; border-radius: 6px; }
.ui { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 7px; background: var(--doux2); border: 1px solid var(--bord); color: var(--titre); font-weight: 650; font-size: .88em; white-space: nowrap; line-height: 1.6; }
.ui i { font-style: normal; color: var(--or); font-weight: 800; }

ol.etapes { list-style: none; counter-reset: e; margin: 6px 0 22px; padding: 0; }
ol.etapes > li { counter-increment: e; position: relative; padding: 0 0 16px 50px; color: var(--texte2); }
ol.etapes > li::before { content: counter(e); position: absolute; left: 0; top: -1px; width: 31px; height: 31px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: .85rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px color-mix(in srgb, var(--navy) 12%, transparent); }
html[data-theme="dark"] ol.etapes > li::before { background: var(--navy2); }
ol.etapes > li::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: var(--bord); }
ol.etapes > li:last-child::after { display: none; }
ol.etapes > li > div { padding-top: 2px; }
ol.etapes ul { margin: 6px 0 0; }

.encart { margin: 18px 0 22px; padding: 14px 18px 14px 18px; border-radius: 13px; border: 1px solid; position: relative; }
.encart strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.encart p { margin: 0; }
.encart.note { background: #eff6ff; border-color: #dbeafe; } .encart.note strong { color: #1e40af; }
.encart.astuce { background: #f0fdf4; border-color: #bbf7d0; } .encart.astuce strong { color: #166534; }
.encart.attention { background: var(--or-cl); border-color: #fed7aa; } .encart.attention strong { color: #9a3412; }
.encart.important { background: #fef2f2; border-color: #fecaca; } .encart.important strong { color: #b91c1c; }
html[data-theme="dark"] .encart.note { background: #132042; border-color: #24324f; } html[data-theme="dark"] .encart.note strong { color: #93c5fd; }
html[data-theme="dark"] .encart.astuce { background: #0f2a1d; border-color: #1c4a33; } html[data-theme="dark"] .encart.astuce strong { color: #86efac; }
html[data-theme="dark"] .encart.attention { border-color: #5a3d14; } html[data-theme="dark"] .encart.attention strong { color: #fdba74; }
html[data-theme="dark"] .encart.important { background: #2a1214; border-color: #5b1f24; } html[data-theme="dark"] .encart.important strong { color: #fca5a5; }

.capture { margin: 20px 0 28px; }
.cadre { display: block; width: 100%; padding: 0; border: 1px solid var(--bord); border-radius: 14px; overflow: hidden; position: relative; background: var(--carte); box-shadow: var(--ombre); cursor: zoom-in; }
.cadre img { display: block; width: 100%; height: auto; }
.ov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ov .z { fill: rgba(217, 119, 6, .08); stroke: #d97706; stroke-width: 3.5; }
.ov .f { stroke: #d97706; stroke-width: 3.5; }
.ov .b { fill: #0d1e4a; stroke: #fff; stroke-width: 2; filter: drop-shadow(0 4px 10px rgba(13, 30, 74, .35)); }
.ov .t { fill: #fff; font: 700 17px Inter, system-ui, sans-serif; }
.ov .n { fill: #d97706; stroke: #fff; stroke-width: 2.5; }
.ov .nt { fill: #fff; font: 800 15px Inter, system-ui, sans-serif; text-anchor: middle; }
figcaption { font-size: .84rem; color: var(--gris); text-align: center; margin-top: 10px; }
.legende { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: .9rem; color: var(--texte2); }
.legende li { display: flex; gap: 10px; align-items: baseline; }
.legende b { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--or); color: #fff; font-size: .74rem; display: inline-flex; align-items: center; justify-content: center; }
.manque { padding: 12px 16px; border: 1px dashed var(--bord2); border-radius: 12px; color: var(--gris); font-size: .9rem; }

.tableau { overflow-x: auto; margin: 10px 0 22px; border: 1px solid var(--bord); border-radius: 13px; background: var(--carte); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); background: var(--doux); padding: 10px 14px; border-bottom: 1px solid var(--bord); }
td { padding: 10px 14px; border-bottom: 1px solid var(--bord); color: var(--texte2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 18px 0 30px; }
.carte { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 15px; border: 1px solid var(--bord); background: var(--carte); text-decoration: none; color: var(--texte2) !important; box-shadow: var(--ombre); transition: transform .15s, border-color .15s; }
.carte:hover { transform: translateY(-2px); border-color: var(--or); }
.carte .ico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--survol); color: var(--titre); margin-bottom: 4px; }
.carte strong { color: var(--titre); font-size: 1rem; }
.carte span:last-child { font-size: .86rem; line-height: 1.5; }

.accueil article > h1:first-child, .hero h1 { font-size: 2.4rem; letter-spacing: -.025em; line-height: 1.1; color: var(--titre); margin: 0 0 12px; }
.hero { padding: 38px 200px 38px 36px; border-radius: 22px; background: linear-gradient(135deg, var(--navy), var(--navy2)); color: #e0e7ff; margin-bottom: 30px; position: relative; overflow: hidden; }
.hero h1 { color: #fff; }
.hero p { color: #c7d2fe; font-size: 1.05rem; max-width: 560px; margin: 0; }
.hero img { position: absolute; right: 30px; bottom: -6px; width: 150px; opacity: .95; }

.prec-suiv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 56px 0 0; }
.ps { display: flex; flex-direction: column; padding: 14px 18px; border-radius: 13px; border: 1px solid var(--bord); background: var(--carte); text-decoration: none; }
.ps:hover { border-color: var(--or); }
.ps small { color: var(--gris); font-size: .76rem; }
.ps strong { color: var(--titre); }
.ps.suiv { text-align: right; grid-column: 2; }
.maj { display: flex; align-items: center; gap: 8px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--bord); font-size: .84rem; color: var(--gris); }
.maj strong { color: var(--texte2); font-weight: 650; }

.recherche { position: fixed; inset: 0; background: rgba(8, 15, 35, .55); backdrop-filter: blur(3px); z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.recherche[hidden] { display: none; }
.recherche-boite { width: 100%; max-width: 640px; background: var(--carte); border-radius: 16px; border: 1px solid var(--bord); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); overflow: hidden; }
.recherche-champ { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--bord); color: var(--gris); }
.recherche-champ input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 1rem; color: var(--texte); }
.recherche-res { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow-y: auto; }
.recherche-res li a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--texte2) !important; }
.recherche-res li a.sel, .recherche-res li a:hover { background: var(--survol); }
.recherche-res .r-p { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.recherche-res .r-t { display: block; font-weight: 700; color: var(--titre); }
.recherche-res .r-x { display: block; font-size: .82rem; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recherche-res mark { background: color-mix(in srgb, var(--or) 30%, transparent); color: inherit; border-radius: 3px; }
.recherche-res .vide { padding: 18px; text-align: center; color: var(--gris); }

.zoom { position: fixed; inset: 0; z-index: 70; background: rgba(6, 12, 30, .86); display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.zoom[hidden] { display: none; }
.zoom-img { position: relative; width: min(96vw, 1700px); }
.zoom-img .cadre { cursor: zoom-out; box-shadow: none; border: 0; }
.zoom button { position: absolute; top: 14px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.6rem; cursor: pointer; }

.voile { display: none; }

@media (max-width: 1240px) { .toc { display: none; } }
@media (max-width: 900px) {
  :root { --cote: 290px; }
  .menu-mobile { display: flex; }
  .marque { width: auto; }
  .marque small { display: none; }
  .recherche-btn kbd { display: none; }
  .cote { transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 30px rgba(0, 0, 0, .15); }
  body.menu-ouvert .cote { transform: none; }
  body.menu-ouvert .voile { display: block; position: fixed; inset: var(--barre) 0 0 0; background: rgba(8, 15, 35, .4); z-index: 25; }
  .contenu { margin-left: 0; padding: calc(var(--barre) + 22px) 18px 40px; }
  .entete-role { padding: 22px 20px; flex-direction: column; gap: 12px; }
  .entete-role h1 { font-size: 1.6rem; }
  .hero { padding: 28px 22px 120px; }
  .hero h1 { font-size: 1.9rem; }
  .hero img { width: 104px; right: 18px; }
  .lien-ancre { display: none; }
}
@media (max-width: 560px) {
  .barre { gap: 10px; padding: 0 12px; }
  .marque span { display: none; }
  .recherche-btn span { font-size: .84rem; }
  body { font-size: 15.5px; }
  ol.etapes > li { padding-left: 44px; }
  .prec-suiv { grid-template-columns: 1fr; }
  .ps.suiv { grid-column: 1; }
  .tableau { border: 0; background: none; }
  .tableau table, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { display: none; }
  .tableau tr { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; margin-bottom: 10px; padding: 6px 0; }
  .tableau td { border: 0; padding: 6px 14px; }
  .tableau td::before { content: attr(data-titre); display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
}
@media print {
  .barre, .cote, .toc, .prec-suiv, .recherche, .zoom { display: none !important; }
  .contenu { margin: 0; padding: 0; }
}
