/* Révizor : styles d'apparence (spec 002). Actuel = app.css seul, sans data-style sur <html>.
   RÈGLE : toute règle de ce fichier est limitée par :root[data-style…] ou [data-style] (Actuel ne
   peut donc pas bouger), sauf les pastilles .apercu, la section .apparence de Mon compte et le bloc
   d'impression final. Vérifié par tests/js/styles.test.mjs. Valeurs : specs/002…/data-model.md. */

/* ── 1. Branchements communs aux 4 styles (écran seulement : l'impression reste celle d'Actuel) */
@media screen{
:root[data-style] body{background-image:var(--fond)}
:root[data-style] :is(.cours-cm, .cren-cm){--c:var(--edt-cm)}
:root[data-style] :is(.cours-td, .cren-td){--c:var(--edt-td)}
:root[data-style] :is(.cours-tp, .cren-tp){--c:var(--edt-tp)}
:root[data-style] :is(.cours-eval, .cren-eval){--c:var(--edt-eval)}
/* Petites étiquettes (en mono dans Actuel) ; le code, les codes à saisir et les schémas restent en mono. */
:root[data-style] :is(.eyebrow, .meta dt, .src, .count, .groupe-titre, .ligne-meta, .ligne-code,
  .cren-haut, .cren-type, .badge, .hors-ligne, thead th, .compte, .hors-ligne-note, .a-verifier,
  .autrement-titre, .ligne-note, .etiquette, .ligne-jx.retard, .edt-bande a span, .edt-resume,
  .cours-heure span, .cours-type, .pause, .agenda-heures span, .pastille, .sem-tete span, .sheet-h,
  .ordre-num){font-family:var(--f-label)}
:root[data-style] summary::after{font-family:var(--f-label)}
:root[data-style] :is(.meta, .carte, .liste, .cours, .layers, .tbl-wrap, .transitions, .revoir){border-radius:var(--r-carte)}
:root[data-style] .hero{background:var(--bandeau)}
:root[data-style] .notion h5{color:var(--t-notion)}
:root[data-style] :is(details.rev > summary, .question .q-texte){color:var(--t-question)}
:root[data-style] .cmd code{background:var(--t-cmd-bg); color:var(--t-cmd-texte)}
:root[data-style] .src{color:var(--t-tag)}
:root[data-style] .chip{background:var(--t-tag-bg); color:var(--t-tag); border-color:var(--t-tag-bg)}
/* Piège : encadré, dans tous les styles. */
:root[data-style] .pieges li{background:var(--t-piege-bg); border:1px solid var(--t-piege);
  border-radius:var(--r-carte); padding:10px 12px}
:root[data-style] .pieges li::before{background:transparent; color:var(--t-piege-texte)}
:root[data-style] .piege-enonce{color:var(--t-piege-texte); font-weight:700}

}

/* ── 2. iOS : couleurs système exactes d'Apple (choix de l'utilisateur, 03/10 : exception à l'AA,
   voir le plan, Complexity Tracking), police du système ──────────────── */
@media screen{
:root[data-style="ios"]{
  --paper:#F2F2F7; --surface:#FFFFFF; --ink:#000000; --muted:#8E8E93; --rule:#E5E5EA; --dot:transparent;
  --accent:#007AFF; --marque:var(--accent); --hl:transparent; --hl-solid:#007AFF;
  --ok:#34C759; --ok-bg:#E3F6E8; --ko:#FF3B30; --ko-bg:#FFE5E5; --code-bg:#F2F2F7; --rose:#FF2D55;
  --lift:none;
  --f-display:-apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --f-body:-apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --f-label:-apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --f-mono:ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fond:none; --r-carte:18px;
  --edt-cm:#007AFF; --edt-td:#FF2D55; --edt-tp:#34C759; --edt-eval:#FF3B30;
  --t-notion:#007AFF; --t-piege:#FF9500; --t-piege-bg:#FFF4E5; --t-piege-texte:#FF9500;
  --t-question:#000000; --t-cmd-bg:#F2F2F7; --t-cmd-texte:#000000; --t-invite:#8E8E93;
  --t-tag-bg:#F2F2F7; --t-tag:#8E8E93; --bandeau:transparent;
  --seg-fond:rgba(118,118,128,.12); --seg-actif:#FFFFFF;
  /* Couleurs exactes d'Apple, pour tout ce qui n'est pas du texte (puces, icônes, fonds de pastille, bordures). */
  --vif-bleu:#007AFF; --vif-vert:#34C759; --vif-orange:#FF9500;
}
}
@media screen{
  :root[data-style="ios"][data-theme="dark"]{
    --paper:#000000; --surface:#1C1C1E; --ink:#FFFFFF; --muted:#98989F; --rule:#38383A; --dot:transparent;
    --accent:#0A84FF; --marque:var(--accent); --hl:transparent; --hl-solid:#0A84FF;
    --ok:#30D158; --ok-bg:rgba(48,209,88,.16); --ko:#FF453A; --ko-bg:rgba(255,105,97,.16);
    --code-bg:#2C2C2E; --rose:#FF375F; --lift:none; --fond:none;
    --edt-cm:#0A84FF; --edt-td:#FF375F; --edt-tp:#30D158; --edt-eval:#FF453A;
    --t-notion:#0A84FF; --t-piege:#FF9F0A; --t-piege-bg:#2E2214; --t-piege-texte:#FF9F0A;
    --t-question:#FFFFFF; --t-cmd-bg:#2C2C2E; --t-cmd-texte:#FFFFFF; --t-invite:#98989F;
    --t-tag-bg:#2C2C2E; --t-tag:#98989F; --bandeau:transparent;
    --seg-fond:rgba(118,118,128,.24); --seg-actif:#636366;
    --vif-bleu:#0A84FF; --vif-vert:#30D158; --vif-orange:#FF9F0A;
    color-scheme:dark;
  }
}
@media screen{
/* Titres au poids d'iOS ; titres de section en petites capitales grises, comme dans Réglages. */
:root[data-style="ios"] .hero h1{font-weight:700; letter-spacing:-.01em; font-size:clamp(1.9rem, 7vw, 2.6rem)}
:root[data-style="ios"] .eyebrow{font-weight:600; letter-spacing:.02em}
:root[data-style="ios"] .sh{border-bottom:0; padding-inline:16px; margin-bottom:8px}
:root[data-style="ios"] :is(.sh h2, .groupe-rev .sh h4, .groupe-titre, .chapitre-tete h3){font-family:var(--f-label);
  font-size:.82rem; font-weight:600; line-height:1.3; text-transform:uppercase; letter-spacing:.03em; color:var(--muted)}
:root[data-style="ios"] .chapitre-tete{padding-inline:16px}
:root[data-style="ios"] .chapitre-tete .sub{font-style:italic; font-size:.95rem}
:root[data-style="ios"] :is(mark, .essentiel strong){background:none; font-weight:700}
/* Cartes : arrondies, filet très léger, pas d'ombre. */
:root[data-style="ios"] :is(.meta, .liste, .carte, .essentiel, .notion, .cmd){border:1px solid var(--rule); border-radius:var(--r-carte)}
/* En-tête de fiche en lignes groupées : libellé gris à gauche, valeur à droite, J-x en pastille. */
:root[data-style="ios"] .meta{position:relative; grid-template-columns:1fr; padding:2px 16px}
:root[data-style="ios"] .meta dl{grid-template-columns:auto 1fr; gap:0}
:root[data-style="ios"] .meta :is(dt, dd){padding-block:12px; border-top:1px solid var(--rule)}
:root[data-style="ios"] .meta :is(dt:first-of-type, dt:first-of-type + dd){border-top:0}
:root[data-style="ios"] .meta dt{font-family:var(--f-body); text-transform:none; letter-spacing:0; font-size:1rem; color:var(--muted)}
:root[data-style="ios"] .meta dd{margin:0; text-align:right; color:var(--ink)}
:root[data-style="ios"] .meta:not(.sans-jx) dt:first-of-type{padding-bottom:40px}
:root[data-style="ios"] .meta .jx{position:absolute; top:42px; left:16px; font-family:var(--f-label); font-size:.8rem;
  font-weight:600; line-height:1.5; padding:0 8px; border-radius:999px;
  background:color-mix(in srgb, var(--vif-orange) 18%, var(--surface)); color:var(--t-piege-texte)}
:root[data-style="ios"] .count::after{content:" captés"}
/* L'essentiel : une carte, puces bleues rondes, lignes séparées. */
:root[data-style="ios"] .essentiel{background:var(--surface); padding:0 16px; gap:0}
:root[data-style="ios"] .essentiel li{padding:12px 0 12px 18px}
:root[data-style="ios"] .essentiel li + li{border-top:1px solid var(--rule)}
:root[data-style="ios"] .essentiel li::before{width:7px; height:7px; border-radius:50%; background:var(--vif-bleu); top:calc(12px + .6em)}
/* Sources en petite étiquette grise. */
:root[data-style="ios"] .src{display:inline-block; font-size:.75rem; line-height:1.5; padding:0 6px; border-radius:6px;
  background:var(--t-tag-bg); border:1px solid var(--rule)}
/* Une carte par notion et par commande, avec sa pastille de type ; la source à droite de la pastille. */
:root[data-style="ios"] :is(.notions, .cmds){display:grid; gap:12px; border-top:0}
:root[data-style="ios"] :is(.notion, .cmd){background:var(--surface); padding:14px 16px}
:root[data-style="ios"] .notion .n-head{row-gap:8px}
:root[data-style="ios"] .notion .n-head::before{order:0}
:root[data-style="ios"] .notion .n-head .src{order:1}
:root[data-style="ios"] .notion .n-head h5{order:2; flex-basis:100%; font-size:1.15rem; font-weight:700; color:var(--ink)}
:root[data-style="ios"] .notion .n-head .badge{order:3}
:root[data-style="ios"] :is(.notion .n-head, .cmd)::before{font-family:var(--f-label); font-size:.72rem; font-weight:600;
  letter-spacing:.03em; line-height:1.6; padding:0 8px; border-radius:6px}
:root[data-style="ios"] .notion .n-head::before{content:"NOTION"; content:"NOTION" / "";
  background:color-mix(in srgb, var(--vif-bleu) 12%, var(--surface)); color:var(--t-notion)}
:root[data-style="ios"] .cmd{row-gap:8px}
:root[data-style="ios"] .cmd::before{content:"COMMANDE"; content:"COMMANDE" / ""; grid-column:1 / -1; justify-self:start;
  background:color-mix(in srgb, var(--vif-vert) 14%, var(--surface)); color:var(--ok)}
:root[data-style="ios"] .cmd-code code{font-size:.95rem; font-weight:600; padding:4px 10px; border-radius:8px}
/* Piège : encadré orange pâle, triangle d'alerte, libellé « Piège : ». */
:root[data-style="ios"] .pieges li{grid-template-columns:24px 1fr; padding:14px 16px;
  border-color:color-mix(in srgb, var(--vif-orange) 55%, var(--t-piege-bg))}
:root[data-style="ios"] .pieges li::before{content:"⚠\FE0E"; content:"⚠\FE0E" / ""; width:auto; height:auto; margin-top:0; align-self:start; display:block;
  font-family:var(--f-body); font-size:1.15rem; line-height:1.3; color:var(--t-piege-texte)}
:root[data-style="ios"] .piege-enonce::before{content:"Piège : "}
:root[data-style="ios"] .pieges li::before{color:var(--vif-orange)}
:root[data-style="ios"] .nav a[aria-current="page"] svg{color:var(--vif-bleu)}
/* Contrôle segmenté et barre d'onglets à la manière d'iOS. */
:root[data-style="ios"] .seg{background:var(--seg-fond)}
:root[data-style="ios"] .seg button[aria-pressed="true"]{background:var(--seg-actif); color:var(--ink);
  box-shadow:0 1px 3px rgba(0,0,0,.12)}
:root[data-style="ios"] .nav a[aria-current="page"]{color:var(--accent)}
:root[data-style="ios"] .nav a[aria-current="page"] span{background:none}
}

/* ── 3. Premium : toujours sombre, un seul accent champagne (J-x, captés, onglet actif) ─────── */
@media screen{
:root[data-style="premium"]{
  --paper:#0B0B0C; --surface:#151517; --ink:#E2E2E5; --muted:#9D9DA3; --rule:rgba(255,255,255,.1); --dot:transparent;
  --accent:#E2E2E5; --marque:#C9B37E; --hl:transparent; --hl-solid:#8A8A90;
  --ok:#7DD3A0; --ok-bg:rgba(125,211,160,.12); --ko:#F28B82; --ko-bg:rgba(242,139,130,.12);
  --code-bg:#1E1E21; --rose:#E79AC8; --lift:none;
  --f-display:"Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body:"Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label:"Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:"Fragment Mono", ui-monospace, Menlo, Consolas, monospace;
  --fond:none; --r-carte:12px;
  --edt-cm:#8AA4FF; --edt-td:#E79AC8; --edt-tp:#7DD3A0; --edt-eval:#F28B82;
  --t-notion:#E2E2E5; --t-piege:rgba(242,139,130,.35); --t-piege-bg:rgba(242,139,130,.10); --t-piege-texte:#F5B1AA;
  --t-question:#A9B8E8; --t-cmd-bg:#1E1E21; --t-cmd-texte:#E2E2E5; --t-invite:#9D9DA3;
  --t-tag-bg:#151517; --t-tag:#9D9DA3; --bandeau:transparent;
  color-scheme:dark;
}
/* Titres en Geist, fins et serrés ; petites capitales espacées pour les en-têtes de section. */
:root[data-style="premium"] .hero h1{font-weight:600; letter-spacing:-.02em; font-size:clamp(1.9rem, 7vw, 2.6rem)}
:root[data-style="premium"] :is(.sh h2, .groupe-rev .sh h4, .groupe-titre, .chapitre-tete h3, .eyebrow){font-family:var(--f-label);
  font-size:.8rem; font-weight:500; line-height:1.4; text-transform:uppercase; letter-spacing:.12em; color:var(--muted)}
:root[data-style="premium"] .sh{border-bottom:1px solid var(--rule)}
:root[data-style="premium"] :is(mark, .essentiel strong, .def strong){background:none; font-weight:700; color:#FFFFFF}
/* Chiffres clés : J-x en grands chiffres fins champagne ; compteur de progression champagne. */
:root[data-style="premium"] .jx{font-family:var(--f-display); font-weight:200; font-size:3rem; letter-spacing:-.03em;
  font-variation-settings:normal; color:var(--marque)}
:root[data-style="premium"] .meta:not(.sans-jx){grid-template-columns:auto 1fr; align-items:start; column-gap:16px}
:root[data-style="premium"] .meta dt{font-size:.72rem; letter-spacing:.1em}
:root[data-style="premium"] .count{color:var(--muted)}
:root[data-style="premium"] .count b{color:var(--marque)}
:root[data-style="premium"] .count::after{content:" captés"}
:root[data-style="premium"] .nav a[aria-current="page"]{color:var(--marque)}
:root[data-style="premium"] .nav a[aria-current="page"] span{background:none}
:root[data-style="premium"] .seg{background:transparent; box-shadow:inset 0 0 0 1px var(--rule)}
:root[data-style="premium"] .seg button[aria-pressed="true"]{background:rgba(255,255,255,.1); color:var(--ink)}
/* Sources en petite étiquette encadrée ; l'essentiel, les notions et les commandes en cartes. */
:root[data-style="premium"] .src{display:inline-block; font-size:.74rem; line-height:1.5; padding:0 6px;
  border:1px solid var(--rule); border-radius:5px}
:root[data-style="premium"] :is(.essentiel, .notions, .cmds){display:grid; gap:10px; border-top:0}
:root[data-style="premium"] :is(.essentiel li, .notion, .cmd){background:var(--surface); border:1px solid var(--rule);
  border-radius:var(--r-carte)}
:root[data-style="premium"] .essentiel li{padding:14px 16px 14px 34px}
:root[data-style="premium"] .essentiel li::before{left:16px; top:calc(14px + .62em); width:6px; height:6px; border-radius:50%}
:root[data-style="premium"] :is(.notion, .cmd){padding:14px 16px}
/* Citation de chapitre : italique à empattements, filet champagne (à garder du rendu Stitch). */
:root[data-style="premium"] .chapitre-tete{border-left:2px solid var(--marque); padding-left:14px}
:root[data-style="premium"] .chapitre-tete .sub{font-family:"Iowan Old Style", Georgia, "Times New Roman", serif;
  font-style:italic; font-size:1.1rem; color:var(--ink)}
}

/* ── 4. Cahier : papier quadrillé, cartes très arrondies, lilas, surligneur vert pastel ──────── */
@media screen{
:root[data-style="cahier"]{
  --paper:#FAF8F4; --surface:#FFFFFF; --ink:#26242E; --muted:#716C80; --rule:#ECE7DC; --dot:transparent;
  --accent:#5B4B8A; --marque:var(--accent); --hl:#DCFCE7; --hl-solid:#8B7CC4;
  --ok:#166534; --ok-bg:#DCFCE7; --ko:#B42318; --ko-bg:#FEE4E2; --code-bg:#F4F1FD; --rose:#BE185D;
  --lift:none;
  --f-display:"Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body:"Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label:"Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:"Fragment Mono", ui-monospace, Menlo, Consolas, monospace;
  --fond:linear-gradient(rgba(113,108,128,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(113,108,128,.05) 1px, transparent 1px);
  --r-carte:20px;
  --edt-cm:#3B5BDB; --edt-td:#BE185D; --edt-tp:#166534; --edt-eval:#B42318;
  --t-notion:#5B4B8A; --t-piege:#FED7AA; --t-piege-bg:#FFF4E8; --t-piege-texte:#9A3412;
  --t-question:#075985; --t-cmd-bg:#FFFFFF; --t-cmd-texte:#26242E; --t-invite:#5B4B8A;
  --t-tag-bg:#E9E4F8; --t-tag:#5B4B8A; --bandeau:transparent;
  --carte-cmd:#F6F3EB;
}
}
@media screen{
  :root[data-style="cahier"][data-theme="dark"]{
    --paper:#17161B; --surface:#211F27; --ink:#ECE9F2; --muted:#A7A2B5; --rule:#34313D; --dot:transparent;
    --accent:#C4B5FD; --marque:var(--accent); --hl:rgba(74,222,128,.16); --hl-solid:#C4B5FD;
    --ok:#86EFAC; --ok-bg:rgba(74,222,128,.16); --ko:#FCA5A5; --ko-bg:rgba(252,165,165,.14);
    --code-bg:#131217; --rose:#F9A8D4; --lift:none;
    --fond:linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    --edt-cm:#93A8FF; --edt-td:#F9A8D4; --edt-tp:#86EFAC; --edt-eval:#FCA5A5;
    --t-notion:#C4B5FD; --t-piege:#9A3412; --t-piege-bg:#3A2418; --t-piege-texte:#FDBA74;
    --t-question:#7DD3FC; --t-cmd-bg:#131217; --t-cmd-texte:#ECE9F2; --t-invite:#C4B5FD;
    --t-tag-bg:#2E2842; --t-tag:#C4B5FD; --bandeau:transparent;
    --carte-cmd:#1B1A20;
    color-scheme:dark;
  }
}
@media screen{
:root[data-style="cahier"] body{background-size:24px 24px}
/* Titres serrés, flèche « → » devant les titres de partie, de section et de chapitre. */
:root[data-style="cahier"] .hero h1{font-weight:800; letter-spacing:-.03em; font-size:clamp(1.9rem, 7vw, 2.6rem)}
:root[data-style="cahier"] .eyebrow{justify-self:start; padding:2px 10px; border-radius:999px; background:var(--t-tag-bg);
  color:var(--t-tag); text-transform:none; letter-spacing:0; font-weight:600}
:root[data-style="cahier"] .sh{border-bottom:0}
:root[data-style="cahier"] :is(.sh h2, .partie > summary h2, .chapitre-tete h3)::before{content:"→ "; content:"→ " / ""; color:var(--accent)}
:root[data-style="cahier"] :is(.sh h2, .partie > summary h2){font-weight:800; letter-spacing:-.02em}
:root[data-style="cahier"] .chapitre{border-top:1.5px dashed var(--rule); margin-top:18px}
:root[data-style="cahier"] .chapitre-tete .sub{font-style:italic}
/* Mots-clés en pastille vert pastel. */
:root[data-style="cahier"] :is(mark, .essentiel strong){background:var(--hl); color:var(--ok); font-weight:700;
  border-radius:6px; padding:0 .25em; -webkit-box-decoration-break:clone; box-decoration-break:clone}
/* Cartes blanches très arrondies à bord lilas. */
:root[data-style="cahier"] :is(.meta, .liste, .carte, .essentiel li, .notion){border:1.5px solid var(--t-tag-bg)}
:root[data-style="cahier"] :is(.essentiel, .notions, .cmds){display:grid; gap:12px; border-top:0}
:root[data-style="cahier"] :is(.essentiel li, .notion, .cmd){background:var(--surface); border-radius:var(--r-carte)}
:root[data-style="cahier"] .essentiel li{padding:14px 16px 14px 30px}
:root[data-style="cahier"] .essentiel li::before{left:14px; top:calc(14px + .65em); width:6px; height:6px; border-radius:50%}
:root[data-style="cahier"] :is(.notion, .cmd){padding:14px 16px}
/* Étiquettes lilas : sources, puces de la carte mentale, terme d'une notion. */
:root[data-style="cahier"] .src{display:inline-block; font-size:.74rem; font-weight:600; line-height:1.6; padding:0 8px;
  border-radius:999px; background:var(--t-tag-bg)}
:root[data-style="cahier"] .notion h5{display:inline-block; padding:1px 10px; border-radius:999px; background:var(--t-tag-bg)}
/* Commande : encart beige, bloc blanc avec invite « $ » (sans faux terminal). */
:root[data-style="cahier"] .cmd{background:var(--carte-cmd); border:1.5px solid var(--rule)}
:root[data-style="cahier"] .cmd-code code{display:block; padding:8px 12px; border-radius:12px; border:1px solid var(--rule)}
:root[data-style="cahier"] .cmd-code code::before{content:"$ "; content:"$ " / ""; color:var(--t-invite); font-weight:700}
/* Piège : encadré pêche, triangle d'alerte. */
:root[data-style="cahier"] .pieges li{grid-template-columns:24px 1fr; padding:14px 16px}
:root[data-style="cahier"] .pieges li::before{content:"⚠\FE0E"; content:"⚠\FE0E" / ""; width:auto; height:auto; margin-top:0;
  align-self:start; display:block; font-size:1.1rem; line-height:1.4}
/* Onglets Lire / Réviser en intercalaire ; rubrique active en pastille lilas. */
:root[data-style="cahier"] .seg{background:transparent; padding:0; gap:4px; border-radius:0; align-items:flex-end;
  box-shadow:inset 0 -1.5px 0 var(--t-tag-bg)}
:root[data-style="cahier"] .seg button{border-radius:14px 14px 0 0; border:1.5px solid var(--rule); border-bottom:0;
  background:color-mix(in srgb, var(--rule) 55%, var(--paper)); color:var(--muted)}
:root[data-style="cahier"] .seg button[aria-pressed="true"]{background:var(--surface); color:var(--ink); border-color:var(--t-tag-bg)}
/* Jour / Semaine de l'emploi du temps : des liens, pas des intercalaires, donc sans le trait (04/10). */
:root[data-style="cahier"] .edt-barre .seg{box-shadow:none}
:root[data-style="cahier"] .nav a[aria-current="page"]{color:var(--t-tag); background:var(--t-tag-bg) padding-box;
  border:4px solid transparent; border-radius:20px; padding-block:2px}
:root[data-style="cahier"] .nav a[aria-current="page"] span{background:none}
}

/* ── 5. Bristol : feuille blanche à lignes sur fond bureau, bandeau bleu, même bleu pour tous ── */
@media screen{
:root[data-style="bristol"]{
  --paper:#F7F5F0; --surface:#FFFFFF; --ink:#1E293B; --muted:#5F6F85; --rule:#E2E8F0; --dot:transparent;
  --accent:#2F5BEA; --marque:var(--accent); --hl:rgba(47,91,234,.10); --hl-solid:#2F5BEA;
  --ok:#117A4B; --ok-bg:#E3F4EC; --ko:#B91C1C; --ko-bg:#FDECEC; --code-bg:#F1F5F9; --rose:#BE185D;
  --lift:0 1px 3px rgba(30,41,59,.10);
  --f-display:"Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body:"Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif;
  --f-label:"Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:"Fragment Mono", ui-monospace, Menlo, Consolas, monospace;
  --fond:none; --r-carte:10px;
  --edt-cm:#2F5BEA; --edt-td:#BE185D; --edt-tp:#138653; --edt-eval:#B91C1C;
  --t-notion:#2F5BEA; --t-piege:#F26B1D; --t-piege-bg:#FFF8F3; --t-piege-texte:#C2410C;
  --t-question:#117A4B; --t-cmd-bg:#1E293B; --t-cmd-texte:#E2E8F0; --t-invite:#F26B1D;
  --t-tag-bg:#F1F5F9; --t-tag:#5F6F85; --bandeau:#2F5BEA;
  --ligne:rgba(30,41,59,.07); --cmd-saisie:#4ADE80; --cmd-muet:#94A3B8;
}
}
@media screen{
  :root[data-style="bristol"][data-theme="dark"]{
    --paper:#0F141C; --surface:#171E29; --ink:#E5E9F0; --muted:#94A3B8; --rule:#263142; --dot:transparent;
    --accent:#7C9CFF; --marque:var(--accent); --hl:rgba(124,156,255,.14); --hl-solid:#7C9CFF;
    --ok:#4ADE80; --ok-bg:rgba(74,222,128,.14); --ko:#F87171; --ko-bg:rgba(248,113,113,.14);
    --code-bg:#0B0F16; --rose:#F472B6; --lift:none; --fond:none;
    --edt-cm:#7C9CFF; --edt-td:#F472B6; --edt-tp:#4ADE80; --edt-eval:#F87171;
    --t-notion:#7C9CFF; --t-piege:#FF9A5C; --t-piege-bg:#2A1A10; --t-piege-texte:#FDBA74;
    --t-question:#4ADE80; --t-cmd-bg:#0B0F16; --t-cmd-texte:#E2E8F0; --t-invite:#FF9A5C;
    --t-tag-bg:#0B0F16; --t-tag:#94A3B8; --bandeau:#2A4FC7;
    --ligne:rgba(255,255,255,.05);
    color-scheme:dark;
  }
}
@media screen{
/* La fiche (de ressource ou d'éval) est une feuille blanche à lignes fines, posée sur le bureau. */
:root[data-style="bristol"] .page:has(.hero){background-color:var(--surface);
  background-image:repeating-linear-gradient(to bottom, transparent 0 31px, var(--ligne) 31px 32px);
  border-radius:var(--r-carte); box-shadow:var(--lift)}
/* Bandeau de tête plein, du même bleu pour toutes les ressources, texte blanc. */
:root[data-style="bristol"] .hero{margin-inline:-16px; padding:22px 16px 18px; color:#FFFFFF}
:root[data-style="bristol"] .hero :is(a, .src, .eyebrow, dt, .jx, .lead, .hors-ligne-note){color:inherit}
:root[data-style="bristol"] .hero .meta{background:transparent; border:1px solid rgba(255,255,255,.4); box-shadow:none}
:root[data-style="bristol"] .hero h1{font-weight:700; letter-spacing:-.02em; font-size:clamp(1.8rem, 6.8vw, 2.5rem)}
:root[data-style="bristol"] .hero .jx{font-family:var(--f-display); font-weight:700}
/* Titres de section en capitales, précédés d'un point bleu ; chapitre dans un encart gris. */
:root[data-style="bristol"] .sh{border-bottom:0}
:root[data-style="bristol"] .sh h2{font-size:1rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em}
:root[data-style="bristol"] .sh h2::before{content:"● "; content:"● " / ""; color:var(--accent)}
:root[data-style="bristol"] .chapitre-tete{background:color-mix(in srgb, var(--rule) 40%, var(--surface)); border:1px solid var(--rule);
  border-radius:var(--r-carte); padding:14px 16px}
:root[data-style="bristol"] .chapitre-tete .sub{font-style:italic}
/* L'essentiel : barre bleue à gauche, mots-clés en bleu ; sources en mono. */
:root[data-style="bristol"] .essentiel li{padding-left:14px; border-left:3px solid color-mix(in srgb, var(--accent) 35%, var(--surface))}
:root[data-style="bristol"] .essentiel li::before{content:none}
:root[data-style="bristol"] :is(mark, .essentiel strong){background:var(--hl); color:var(--accent); font-weight:700;
  border-radius:4px; padding:0 .2em; -webkit-box-decoration-break:clone; box-decoration-break:clone}
:root[data-style="bristol"] .src{font-family:var(--f-mono)}
/* Notions : carte à bord bleu, terme dans une étiquette bleue pleine. */
:root[data-style="bristol"] .notions{display:grid; gap:10px; border-top:0}
:root[data-style="bristol"] .notion{background:var(--surface); border:1px solid color-mix(in srgb, var(--accent) 30%, var(--surface));
  border-radius:var(--r-carte); padding:12px 14px}
:root[data-style="bristol"] .notion h5{display:inline-block; padding:1px 8px; border-radius:4px; background:var(--bandeau); color:#FFFFFF}
/* Commandes : bloc bleu nuit, invite « $ » orange, saisie en vert. */
:root[data-style="bristol"] .cmds{display:grid; gap:10px; border-top:0}
:root[data-style="bristol"] .cmd{background:var(--t-cmd-bg); color:var(--t-cmd-texte); border:0; border-radius:var(--r-carte); padding:14px 16px}
:root[data-style="bristol"] .cmd code{background:rgba(255,255,255,.08); color:var(--t-cmd-texte)}
:root[data-style="bristol"] .cmd-code code{background:none; color:var(--cmd-saisie); font-weight:600; padding:0}
:root[data-style="bristol"] .cmd-code code::before{content:"$ "; content:"$ " / ""; color:var(--t-invite)}
:root[data-style="bristol"] .cmd .src{color:var(--cmd-muet)}
/* Piège : barre orange à gauche, fond pêche, triangle d'alerte. */
:root[data-style="bristol"] .pieges li{grid-template-columns:24px 1fr; border-left-width:4px; padding:12px 14px}
:root[data-style="bristol"] .pieges li::before{content:"⚠\FE0E"; content:"⚠\FE0E" / ""; width:auto; height:auto; margin-top:0;
  align-self:start; display:block; font-size:1.1rem; line-height:1.4}
/* Barre du haut : contrôle segmenté blanc à texte bleu, compteur encadré « captés ». */
:root[data-style="bristol"] .seg{background:color-mix(in srgb, var(--rule) 70%, var(--paper))}
:root[data-style="bristol"] .seg button[aria-pressed="true"]{background:var(--surface); color:var(--accent); box-shadow:0 1px 2px rgba(0,0,0,.1)}
:root[data-style="bristol"] .count{border:1px solid var(--rule); border-radius:8px; padding:3px 8px; background:var(--surface)}
:root[data-style="bristol"] .count::after{content:" captés"}
/* La fiche d'éval compte des savoir-faire « acquis », pas des éléments captés (08/10). */
:root[data-style] .fiche-eval .count::after{content:none}
:root[data-style="bristol"] .nav a[aria-current="page"]{color:var(--accent)}
:root[data-style="bristol"] .nav a[aria-current="page"] span{background:none}
}

/* ── 6. Choix dans Mon compte (visible dans tous les styles, Actuel compris) ─────────────────── */
/* Carrousel d'aperçus : un mini-écran sans texte par style, aux couleurs du style (fixées ici, pour
   les montrer quel que soit le style en cours). On fait défiler, on touche celui qu'on veut. */
.apercus{display:flex; gap:14px; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none;
  margin-inline:-16px; padding:6px 16px 10px; scroll-padding-inline:16px}
.apercus::-webkit-scrollbar{display:none}
.apercu-carte{position:relative; flex:0 0 118px; scroll-snap-align:start; display:grid; align-content:start; justify-items:center; gap:2px; cursor:pointer; text-align:center}
.apercu-nom{margin-top:8px; font-weight:700; font-size:.95rem}
.apercu{position:relative; width:118px; height:200px; box-sizing:border-box; display:flex; flex-direction:column; gap:7px;
  padding:0 9px 0; border-radius:20px; overflow:hidden; background-color:var(--a-fond); background-image:var(--a-motif, none);
  background-size:12px 12px; box-shadow:0 0 0 1px rgba(0,0,0,.14), 0 6px 16px -10px rgba(0,0,0,.45)}
.apercu-carte:has(input:checked) .apercu{box-shadow:0 0 0 3px var(--accent), 0 6px 16px -10px rgba(0,0,0,.45)}
.apercu-carte:has(input:focus-visible) .apercu{outline:2.5px dashed var(--accent); outline-offset:5px}
.apercu-carte:has(input:checked) .apercu::after{content:"✓"; position:absolute; top:7px; right:7px; width:20px; height:20px;
  border-radius:50%; display:grid; place-items:center; font-size:.75rem; font-weight:700; color:#FFFFFF; background:var(--accent)}
.apercu-carte:has(input:checked) .apercu-nom{color:var(--accent)}
.apercu span{display:block}
.apercu .ap-l{height:5px; border-radius:3px; background:var(--a-muet)}
.apercu .ap-courte{width:55%}
.apercu .ap-bandeau{margin:0 -9px; padding:22px 9px 9px; background:var(--a-bandeau, transparent); display:grid; gap:5px}
.apercu .ap-titre{height:9px; width:78%; background:var(--a-titre, var(--a-encre))}
.apercu .ap-sous{width:45%; background:var(--a-sous, var(--a-muet))}
.apercu .ap-carte{display:grid; gap:5px; padding:8px; border-radius:var(--a-rayon); background:var(--a-carte); border:1px solid var(--a-bord)}
.apercu .ap-pastille{width:34%; height:8px; border-radius:4px; background:var(--a-accent)}
.apercu .ap-surligne{width:70%; height:7px; background:var(--a-hl)}
.apercu .ap-piege{padding:7px 8px; border-radius:var(--a-rayon); background:var(--a-piege); border:1px solid var(--a-piege-b)}
.apercu .ap-piege .ap-l{background:var(--a-piege-b)}
.apercu .ap-nav{margin:auto -9px 0; padding:7px 14px 9px; display:flex; justify-content:space-between; background:var(--a-carte);
  border-top:1px solid var(--a-bord)}
.apercu .ap-nav span{width:12px; height:12px; border-radius:4px; background:var(--a-muet)}
.apercu .ap-nav span:first-child{background:var(--a-accent)}
.apercu-actuel{--a-fond:#F5F6F2; --a-motif:radial-gradient(#DDE1D6 1px, transparent 1.2px); --a-carte:#FFFFFF; --a-bord:#D8DCD1;
  --a-encre:#1A2340; --a-muet:#C9CEDB; --a-accent:#2C45BF; --a-hl:#F0D20B; --a-piege:#FAE5E2; --a-piege-b:#E0A39C; --a-rayon:8px}
.apercu-premium{--a-fond:#0B0B0C; --a-carte:#151517; --a-bord:#2A2A2D; --a-encre:#E2E2E5; --a-muet:#3A3A3F; --a-accent:#C9B37E;
  --a-hl:#F5F5F7; --a-piege:#2A1817; --a-piege-b:#7A4540; --a-rayon:7px; --a-titre:#C9B37E}
.apercu-ios{--a-fond:#F2F2F7; --a-carte:#FFFFFF; --a-bord:#E5E5EA; --a-encre:#000000; --a-muet:#D1D1D6; --a-accent:#007AFF;
  --a-hl:#34C759; --a-piege:#FFF4E5; --a-piege-b:#FF9500; --a-rayon:10px}
.apercu-bristol{--a-fond:#FFFFFF; --a-motif:repeating-linear-gradient(transparent 0 11px, #E8ECF2 11px 12px); --a-carte:#FFFFFF;
  --a-bord:#C9D5FA; --a-encre:#1E293B; --a-muet:#CBD5E1; --a-accent:#2F5BEA; --a-hl:#2F5BEA; --a-piege:#FFF8F3; --a-piege-b:#F26B1D;
  --a-rayon:5px; --a-bandeau:#2F5BEA; --a-titre:#FFFFFF; --a-sous:rgba(255,255,255,.6)}
.apercu-cahier{--a-fond:#FAF8F4; --a-motif:linear-gradient(#ECE7DC 1px, transparent 1px), linear-gradient(90deg, #ECE7DC 1px, transparent 1px);
  --a-carte:#FFFFFF; --a-bord:#E9E4F8; --a-encre:#26242E; --a-muet:#DDD8E8; --a-accent:#8B7CC4; --a-hl:#BBF7D0; --a-piege:#FFEDD5;
  --a-piege-b:#FDBA74; --a-rayon:12px}
@media screen{
  :root[data-theme="dark"] .apercu-actuel{--a-fond:#0E1322; --a-motif:radial-gradient(#1B2339 1px, transparent 1.2px); --a-carte:#151C31; --a-bord:#29324C;
    --a-encre:#E6E9F2; --a-muet:#2E3858; --a-accent:#94A6FF; --a-hl:#E3C800; --a-piege:#3A1F2A; --a-piege-b:#FF8C82}
  :root[data-theme="dark"] .apercu-ios{--a-fond:#000000; --a-carte:#1C1C1E; --a-bord:#38383A; --a-encre:#FFFFFF; --a-muet:#3A3A3C; --a-accent:#0A84FF;
    --a-hl:#30D158; --a-piege:#2E2214; --a-piege-b:#FF9F0A}
  :root[data-theme="dark"] .apercu-bristol{--a-fond:#171E29; --a-motif:repeating-linear-gradient(transparent 0 11px, #212A38 11px 12px); --a-carte:#171E29;
    --a-bord:#2F3D5C; --a-encre:#E5E9F0; --a-muet:#334155; --a-accent:#7C9CFF; --a-hl:#7C9CFF; --a-piege:#2A1A10; --a-piege-b:#FF9A5C;
    --a-bandeau:#2A4FC7}
  :root[data-theme="dark"] .apercu-cahier{--a-fond:#17161B; --a-motif:linear-gradient(#24222B 1px, transparent 1px), linear-gradient(90deg, #24222B 1px, transparent 1px);
    --a-carte:#211F27; --a-bord:#2E2842; --a-encre:#ECE9F2; --a-muet:#3A3646; --a-accent:#C4B5FD; --a-hl:#2C5A3C; --a-piege:#3A2418;
    --a-piege-b:#9A3412}
}

/* Automatique / Clair / Sombre, sous le carrousel : contrôle segmenté aux couleurs du style en cours. */
.apparence .teintes{display:flex; gap:2px; margin-top:12px; padding:3px; border-radius:12px; background:var(--code-bg)}
.apparence .teintes label{flex:1; position:relative; cursor:pointer}
.apparence .teintes span{display:grid; place-items:center; min-height:44px; border-radius:9px; font-weight:700;
  font-size:.92rem; color:var(--muted)}
.apparence .teintes input:checked + span{background:var(--surface); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.14)}
.apparence .teintes input:focus-visible + span{outline:2.5px solid var(--accent); outline-offset:1px}
.apparence .teintes input:disabled + span{cursor:not-allowed}
.apparence .teintes input:disabled:not(:checked) + span{opacity:.4}

/* ── 7. Impression : les styles ci-dessus sont limités à l'écran ; ici, Actuel sombre imprime en
   clair, pour que la feuille soit la même dans tous les cas (FR-026). */
@media print{
  :root:not([data-theme="impression"]){
    --paper:#F5F6F2; --surface:#FFFFFF; --ink:#1A2340; --muted:#586179; --rule:#D8DCD1; --dot:#DDE1D6;
    --accent:#2C45BF; --hl:rgba(245,214,10,.58); --hl-solid:#F0D20B;
    --ok:#1B7248; --ok-bg:#E2F1E8; --ko:#AE2A20; --ko-bg:#FAE5E2; --code-bg:#ECEFF6; --rose:#B23A86;
    color-scheme:light;
  }
}
