/* Documentation LabCompta — feuille de style (sans dépendance) */
:root {
	--fond: #f7f8fb; --surface: #ffffff; --surface2: #f1f4f9; --texte: #1e293b; --doux: #64748b; --bord: #e2e8f0;
	--accent: #2563eb; --accent2: #7c3aed; --vert: #16a34a; --orange: #ea580c; --rouge: #dc2626;
	--code: #eef2ff; --ombre: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
	--entete: 60px; --nav: 280px; --surpage: 220px;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--fond: #0f172a; --surface: #111c33; --surface2: #172442; --texte: #e2e8f0; --doux: #94a3b8; --bord: #24324f;
		--accent: #60a5fa; --accent2: #a78bfa; --code: #1e293b; --ombre: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--fond: #0f172a; --surface: #111c33; --surface2: #172442; --texte: #e2e8f0; --doux: #94a3b8; --bord: #24324f;
	--accent: #60a5fa; --accent2: #a78bfa; --code: #1e293b; --ombre: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--entete) + 16px); }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* En-tête */
.entete { position: sticky; top: 0; z-index: 20; height: var(--entete); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bord); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--texte); font-weight: 700; font-size: 18px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo img { width: 34px; height: 34px; }
.logo small { display: block; font-weight: 500; font-size: 11px; color: var(--doux); letter-spacing: .06em; text-transform: uppercase; line-height: 1; }
.logo span { line-height: 1.15; }
.recherche { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.recherche input { width: 100%; height: 38px; padding: 0 40px 0 14px; border: 1px solid var(--bord); border-radius: 10px; background: var(--surface2); color: var(--texte); font: inherit; font-size: 14px; }
.recherche input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--surface); }
.recherche kbd { position: absolute; right: 10px; top: 9px; }
#resultats { position: absolute; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; box-shadow: var(--ombre); padding: 6px; }
#resultats a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--texte); }
#resultats a:hover, #resultats a.sel { background: var(--surface2); text-decoration: none; }
#resultats a b { display: block; font-size: 14px; }
#resultats a small { color: var(--doux); font-size: 12px; }
#resultats a span { display: block; color: var(--doux); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#resultats mark { background: color-mix(in srgb, #facc15 45%, transparent); color: inherit; border-radius: 3px; }
#resultats .vide { padding: 10px; color: var(--doux); font-size: 14px; }
.version { color: var(--doux); font-size: 13px; white-space: nowrap; }
.theme, .menu-mobile { border: 1px solid var(--bord); background: var(--surface2); color: var(--texte); border-radius: 10px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.menu-mobile { display: none; }
kbd { display: inline-block; min-width: 20px; padding: 0 6px; border: 1px solid var(--bord); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); font: 12px/18px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--doux); text-align: center; }

/* Mise en page */
.cadre { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr) var(--surpage); max-width: 1440px; margin: 0 auto; }
.sommaire { position: sticky; top: var(--entete); height: calc(100vh - var(--entete)); overflow: auto; padding: 18px 12px 40px 20px; border-right: 1px solid var(--bord); }
.rubrique { margin-bottom: 4px; }
.rubrique summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-weight: 650; font-size: 14px; }
.rubrique summary::-webkit-details-marker { display: none; }
.rubrique summary::after { content: "›"; margin-left: auto; color: var(--doux); transition: transform .15s; }
.rubrique[open] summary::after { transform: rotate(90deg); }
.rubrique summary:hover { background: var(--surface2); }
.pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); flex: none; }
.rubrique ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 18px; border-left: 1px solid var(--bord); margin-left: 12px; }
.rubrique li a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--doux); font-size: 14px; }
.rubrique li a:hover { color: var(--texte); background: var(--surface2); text-decoration: none; }
.rubrique li a.actif { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
main { padding: 36px 48px 40px; min-width: 0; }
article { max-width: 820px; }
.surpage { position: sticky; top: var(--entete); height: calc(100vh - var(--entete)); overflow: auto; padding: 36px 20px 20px 0; font-size: 13px; }
.surpage div { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--doux); margin-bottom: 8px; }
.surpage ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--bord); }
.surpage a { display: block; padding: 4px 0 4px 12px; color: var(--doux); margin-left: -1px; border-left: 2px solid transparent; }
.surpage a.actif { color: var(--accent); border-left-color: var(--accent); }

/* Contenu */
article h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
article h1 + p { font-size: 18px; color: var(--doux); margin-top: 0; }
article h2 { font-size: 23px; margin: 42px 0 12px; padding-top: 6px; letter-spacing: -.01em; position: relative; }
article h3 { font-size: 18px; margin: 28px 0 8px; position: relative; }
article h4 { font-size: 16px; margin: 20px 0 6px; }
.ancre { position: absolute; left: -22px; opacity: 0; color: var(--doux); font-weight: 400; }
h2:hover .ancre, h3:hover .ancre { opacity: 1; text-decoration: none; }
article p, article li { color: var(--texte); }
article ul, article ol { padding-left: 24px; }
article li { margin: 4px 0; }
article ol > li::marker { color: var(--accent); font-weight: 700; }
article code { background: var(--code); padding: 1px 6px; border-radius: 5px; font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; }
article pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow: auto; font-size: 13px; }
article pre code { background: none; padding: 0; color: inherit; }
article hr { border: 0; border-top: 1px solid var(--bord); margin: 32px 0; }
article em { color: var(--accent); font-style: normal; font-weight: 600; }
.fl { color: var(--doux); margin: 0 2px; }
img.ico { width: 22px; height: 22px; vertical-align: -6px; margin: 0 2px; }
td img.ico { width: 26px; height: 26px; }

figure { margin: 22px 0 26px; }
figure img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--bord); box-shadow: var(--ombre); cursor: zoom-in; background: var(--surface); }
figcaption { margin-top: 8px; font-size: 13px; color: var(--doux); text-align: center; }

.tableau { overflow-x: auto; margin: 16px 0 22px; border: 1px solid var(--bord); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; background: var(--surface2); font-weight: 650; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--bord); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

.encadre { margin: 20px 0; padding: 12px 16px 12px 18px; border-radius: 10px; border: 1px solid; border-left-width: 4px; --c: var(--accent); border-color: color-mix(in srgb, var(--c) 35%, transparent); border-left-color: var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); }
.encadre p { margin: 6px 0; }
.encadre-titre { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--c); }
.encadre.astuce { --c: var(--vert); }
.encadre.attention { --c: var(--orange); }
.encadre.important { --c: var(--rouge); }
.encadre.astuce .encadre-titre::before { content: "💡 "; }
.encadre.attention .encadre-titre::before { content: "⚠️ "; }
.encadre.important .encadre-titre::before { content: "❗ "; }
.encadre.note .encadre-titre::before { content: "ℹ️ "; }

/* Cartes de la page d'accueil */
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 22px 0 30px; }
.carte { display: block; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--bord); box-shadow: var(--ombre); color: var(--texte); transition: transform .12s, border-color .12s; }
.carte:hover { transform: translateY(-2px); border-color: var(--c, var(--accent)); text-decoration: none; }
.carte b { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.carte span { color: var(--doux); font-size: 14px; }

.precsuiv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 820px; margin: 48px 0 20px; }
.precsuiv a { padding: 14px 16px; border: 1px solid var(--bord); border-radius: 12px; background: var(--surface); color: var(--texte); font-weight: 600; }
.precsuiv a:hover { border-color: var(--accent); text-decoration: none; }
.precsuiv small { display: block; color: var(--doux); font-weight: 500; font-size: 12px; }
.precsuiv .suiv { text-align: right; grid-column: 2; }
.pied { max-width: 820px; color: var(--doux); font-size: 13px; border-top: 1px solid var(--bord); padding-top: 16px; }

#loupe { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .85); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
#loupe[hidden] { display: none; }
#loupe img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

@media (max-width: 1200px) { .cadre { grid-template-columns: var(--nav) minmax(0, 1fr); } .surpage { display: none; } }
@media (max-width: 860px) {
	.cadre { grid-template-columns: 1fr; }
	.menu-mobile { display: block; }
	.version, .logo small { display: none; }
	.sommaire { position: fixed; top: var(--entete); left: 0; width: min(320px, 86vw); z-index: 15; background: var(--surface); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--ombre); }
	body.nav-ouverte .sommaire { transform: none; }
	main { padding: 24px 16px; }
	article h1 { font-size: 28px; }
	.recherche kbd { display: none; }
	.entete { gap: 10px; padding: 0 12px; }
	.logo span { display: none; }
}
@media print { .entete, .sommaire, .surpage, .precsuiv { display: none; } .cadre { display: block; } main { padding: 0; } }
