/* Application Prof V0.15.3.2 — thèmes d'interface.
   Le thème ne modifie pas la charte des documents pédagogiques imprimables. */

html[data-theme="classic"]{
  color-scheme:light;
  --theme-soft:#f7f9fb;
  --theme-soft-2:#edf3f8;
  --surface-soft:var(--theme-soft);
  --theme-field:#fff;
  --theme-topbar:var(--surface);
  --theme-topbar-text:var(--text);
  --theme-topbar-muted:var(--muted);
  /* V0.18.12.340.2 — la marque « cumpari. / ENSEIGNANTS » (app-branding.css) sur la barre BLANCHE : le mot en bleu nuit (14,7:1), le point en violet foncé (5,7:1), la ligne en gris
     (5,6:1) — les versions pour fond clair du logo de Cumpari élèves. Un thème sombre ne reprend aucune de ces valeurs : chacun a son jeu. */
  --theme-brand-word:#1d2840;
  --theme-brand-dot:#6554cc;
  --theme-brand-sub:#5b6880;
  --theme-focus:rgba(35,75,114,.18);
  --theme-ai-bg:#f1edfa;
  --theme-ai-border:#d9cef5;
  --theme-ai-text:#7057a8;
  --theme-teacher-bg:#fff3dd;
  --theme-teacher-border:#ecd6aa;
  --theme-teacher-text:#8a641d;
  --theme-auto-bg:#e8f3ec;
  --theme-auto-border:#c5dfcd;
  --theme-auto-text:#397a55;
  --theme-warning-bg:#fff7e4;
  --theme-warning-border:#ecd49d;
  --theme-warning-text:#805d00;
}

/* V0.18.12.8 — plus contrastée, mêmes teintes (choix du concepteur, variante « marquée ») : fond plus
   soutenu, texte, texte secondaire et bordures plus foncés ; la surface (vignettes, lignes, bandes)
   se teinte de pétrole, les fiches (.card, plus bas) restent blanches et s'en détachent.
   Pétrole un cran plus foncé (#19757b → #12646a) : 4,5:1 au moins aussi sur le fond, plus soutenu.
   Les documents de cours et la toile des schémas gardent leur surface blanche (plus bas). */
html[data-theme="petrol"]{
  color-scheme:light;
  --bg:#c4d7d8;
  --surface:#e8f1f1;
  --text:#0b1f23;
  --muted:#35504f;
  --line:#7fa3a6;
  --primary:#12646a;
  --primary2:#0c4f55;
  --danger:#b84a4a;
  --success:#397a55;
  --radius:14px;
  --shadow:0 8px 22px rgba(15,48,53,.22);
  --theme-soft:#dcebeb;
  --theme-soft-2:#bcd5d6;
  --surface-soft:var(--theme-soft);
  --theme-field:#f8fcfc;
  --theme-topbar:#15343a;
  --theme-topbar-text:#f6fbfb;
  --theme-topbar-muted:#c4d9db;
  /* V0.18.12.340.2 — la marque sur la barre pétrole (un dégradé de #122e34 à gauche à #1c5960 à droite : le logo est tout à gauche, là où le fond est le plus sombre) : le mot est le
     texte de la barre, le point et la ligne ceux de Cumpari élèves (violet clair, gris-bleu) ; contrastes mesurés sur la partie de la barre qu'occupe le logo : tools/test-logo-cumpari.php. */
  --theme-brand-word:var(--theme-topbar-text);
  --theme-brand-dot:#a69afe;
  --theme-brand-sub:#a8b8d4;
  --theme-focus:rgba(25,117,123,.24);
  --theme-ai-bg:#f1edfa;
  --theme-ai-border:#d9cef5;
  --theme-ai-text:#7057a8;
  --theme-teacher-bg:#fff3dd;
  --theme-teacher-border:#ecd6aa;
  --theme-teacher-text:#8a641d;
  --theme-auto-bg:#e8f3ec;
  --theme-auto-border:#c5dfcd;
  --theme-auto-text:#397a55;
  --theme-warning-bg:#fff7e4;
  --theme-warning-border:#ecd49d;
  --theme-warning-text:#805d00;
}

html[data-theme="night"]{
  color-scheme:dark;
  --bg:#10171e;
  --surface:#18222c;
  --text:#e8edf2;
  --muted:#9cabb8;
  --line:#31404d;
  --primary:#63aeb8;
  --primary2:#7bc0c8;
  --danger:#e07a76;
  --success:#72bd8a;
  --radius:14px;
  --shadow:0 10px 28px rgba(0,0,0,.22);
  --theme-soft:#141e27;
  --theme-soft-2:#22313c;
  --surface-soft:var(--theme-soft);
  --theme-field:#101820;
  /* V0.18.11.27 — sans ces trois-la, les panneaux restaient clairs sous un texte
     clair : 1,1 de contraste, mesure sur vingt pages. */
  --on-primary:#0b1117;
  --tone-soft:#141e27;
  --tone-panel:#22313c;
  --tone-chip:#22313c;
  --theme-topbar:#0b1117;
  --theme-topbar-text:#f3f7fa;
  --theme-topbar-muted:#9fb0be;
  /* V0.18.12.340.2 — la marque sur la barre Nuit : le mot est le texte de la barre (17,6:1), le point (7,8:1) et la ligne (9,5:1) ceux de Cumpari élèves. */
  --theme-brand-word:var(--theme-topbar-text);
  --theme-brand-dot:#a69afe;
  --theme-brand-sub:#a8b8d4;
  --theme-focus:rgba(99,174,184,.26);
  --theme-ai-bg:#28213a;
  --theme-ai-border:#514373;
  --theme-ai-text:#c9b9ef;
  --theme-teacher-bg:#352b1d;
  --theme-teacher-border:#685431;
  --theme-teacher-text:#edc77d;
  --theme-auto-bg:#1d3228;
  --theme-auto-border:#365d47;
  --theme-auto-text:#92d2a5;
  --theme-warning-bg:#342b18;
  --theme-warning-border:#665428;
  --theme-warning-text:#edc66d;
}

/* V0.18.12.295 — le thème « Cumpari » : la charte graphique de la marque (bleu nuit pour l'en-tête, violet pour l'accent,
   fonds blanc et gris très pâle). Valeurs reprises de la charte (jetons ink, soft, paper, line, violet-700, navy-900…), sauf
   deux écarts voulus, mesurés : le gris secondaire (#66738b dans la charte) est assombri en #5b6880, parce qu'il tombait à
   4,1-4,2:1 sur les panneaux gris pâle (4,85-4,97:1 ainsi) ; l'accent est le violet-700 de la charte (7,6:1 sur blanc, texte
   blanc dessus 7,6:1) pour tenir en texte comme en fond de bouton. --danger et --success restent ceux du thème Classique :
   la charte n'en définit pas. Ni --radius ni --shadow ne sont touchés : ils servent aussi aux documents de cours.
   V0.18.12.295.1 — le fond de la PAGE (--bg) est #e3e8f2 et non le « soft » #f6f8fc de la charte (demande du concepteur : « une couleur de
   background plus foncée que les cartes ») : à 1,06:1 du blanc, les cartes ne se détachaient pas ; à 1,23:1 elles se détachent, et le
   gris secondaire y reste à 4,57:1 (un cran plus foncé, #e0e6f0, le ferait tomber à 4,48:1). Les panneaux DANS une carte (--tone-soft,
   --theme-soft) gardent le soft de la charte. */
html[data-theme="cumpari"]{
  color-scheme:light;
  --bg:#e3e8f2;
  --surface:#ffffff;
  --text:#1d2840;
  --muted:#5b6880;
  --line:#e7eaf2;
  --primary:#5145a8;
  --primary2:#43388f;
  --tone-soft:#f6f8fc;
  --tone-panel:#eef1f8;
  --tone-chip:#e9edf6;
  --theme-soft:#f6f8fc;
  --theme-soft-2:#e9edf6;
  --surface-soft:var(--theme-soft);
  --theme-field:#ffffff;
  --theme-topbar:#101a36;
  --theme-topbar-text:#ffffff;
  --theme-topbar-muted:#a8b8d4;
  /* V0.18.12.340.2 — la marque sur la barre bleu nuit : EXACTEMENT les couleurs de Cumpari élèves (mot blanc 17,2:1, point #a69afe 7,1:1, ligne #a8b8d4 8,6:1). */
  --theme-brand-word:var(--theme-topbar-text);
  --theme-brand-dot:#a69afe;
  --theme-brand-sub:#a8b8d4;
  --theme-focus:rgba(81,69,168,.30);
  --theme-ai-bg:#f7f5ff;
  --theme-ai-border:#d9d2ff;
  --theme-ai-text:#5145a8;
  --theme-teacher-bg:#fff3dd;
  --theme-teacher-border:#ecd6aa;
  --theme-teacher-text:#8a641d;
  --theme-auto-bg:#e8f3ec;
  --theme-auto-border:#c5dfcd;
  --theme-auto-text:#397a55;
  --theme-warning-bg:#fff7e4;
  --theme-warning-border:#ecd49d;
  --theme-warning-text:#805d00;
}

/* -------------------------------------------------------------------------
   Ardoise & Pétrole : identité visuelle assumée.
   L'interface devient nettement plus minérale et colorée sans modifier les
   documents pédagogiques, qui conservent leur charte claire.
   ------------------------------------------------------------------------- */
body[data-theme="petrol"]{
  background:
    radial-gradient(circle at 88% -8%,rgba(25,117,123,.24),transparent 31rem),
    linear-gradient(180deg,#b9cfd0 0,#c8dadb 280px,#c4d7d8 100%);
  background-attachment:fixed;
}
body[data-theme="petrol"] .topbar{
  background:linear-gradient(110deg,#122e34 0%,#173f46 58%,#1c5960 100%);
  border-bottom-color:#28545a;
  box-shadow:0 7px 24px rgba(15,48,53,.24);
}
body[data-theme="petrol"] .topbar .main-nav>a{
  color:var(--theme-topbar-text);
}
body[data-theme="petrol"] .topbar .main-nav>a{
  padding:7px 9px;
  border-radius:8px;
  color:#d9e8e9;
  transition:background .15s ease,color .15s ease;
}
body[data-theme="petrol"] .topbar .main-nav>a:hover{
  color:#ffffff;
  background:rgba(255,255,255,.09);
}
body[data-theme="petrol"] .topbar .nav-dropdown>summary{
  color:var(--theme-topbar-text);
  border-color:rgba(255,255,255,.20);
  background:rgba(255,255,255,.08);
}
body[data-theme="petrol"] .topbar .nav-dropdown>summary:hover,
body[data-theme="petrol"] .topbar .nav-dropdown[open]>summary{
  background:rgba(255,255,255,.17);
  border-color:rgba(255,255,255,.30);
}
body[data-theme="petrol"] .topbar .nav-note-button{
  color:var(--theme-topbar-text);
  border-color:rgba(255,255,255,.20);
  background:rgba(255,255,255,.08);
}
body[data-theme="petrol"] .topbar .nav-note-button:hover,
body[data-theme="petrol"] .topbar .nav-note-button[aria-expanded="true"]{
  background:rgba(255,255,255,.17);
  border-color:rgba(255,255,255,.30);
  color:var(--theme-topbar-text);
}
body[data-theme="petrol"] .nav-dropdown-menu{
  background:#f8fcfc;
  color:#14282c;
  border-color:#afc8ca;
  box-shadow:0 16px 40px rgba(18,46,52,.22);
}
body[data-theme="petrol"] .nav-dropdown-menu a:hover{
  background:#dcebec;
  color:#0f5960;
}

/* Les en-têtes de page deviennent un véritable élément de la charte. */
body[data-theme="petrol"] .hero{
  position:relative;
  padding:22px 25px;
  margin-bottom:22px;
  border:1px solid #7fa3a6;
  border-left:5px solid var(--primary);
  border-radius:18px;
  background:linear-gradient(125deg,#e9f2f2,#c7dcdd);
  box-shadow:0 8px 24px rgba(23,52,59,.08);
}
body[data-theme="petrol"] .hero h1{
  color:#0c3d42;
}
body[data-theme="petrol"] .hero .muted,
body[data-theme="petrol"] .hero .meta{
  color:#35504f;
}
body[data-theme="petrol"] .eyebrow{
  color:#0b5157;
  letter-spacing:.115em;
}

/* Surfaces et formulaires : moins de blanc pur, davantage de profondeur. */
body[data-theme="petrol"] .card,
body[data-theme="petrol"] .auth-card,
body[data-theme="petrol"] .lesson-block{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbfb 100%);
  border-color:#7fa3a6;
  box-shadow:var(--shadow);
}
body[data-theme="petrol"] .card > h2,
body[data-theme="petrol"] .card > .section-heading h2,
body[data-theme="petrol"] .card > .progress-header h2{
  color:#0c3d42;
}
body[data-theme="petrol"] input,
body[data-theme="petrol"] select,
body[data-theme="petrol"] textarea,
body[data-theme="petrol"] .rich-editor{
  background:var(--theme-field);
  color:var(--text);
  border-color:#aac4c7;
}
body[data-theme="petrol"] input::placeholder,
body[data-theme="petrol"] textarea::placeholder{
  color:#7a8d91;
}
body[data-theme="petrol"] input:focus,
body[data-theme="petrol"] select:focus,
body[data-theme="petrol"] textarea:focus,
body[data-theme="petrol"] .rich-editor:focus{
  outline:3px solid var(--theme-focus);
  border-color:var(--primary);
}
body[data-theme="petrol"] .chapter-block-edit-form,
body[data-theme="petrol"] .table-editor,
body[data-theme="petrol"] .course-toc{
  background:#edf5f5;
  border-color:#b9cdd0;
}
body[data-theme="petrol"] .wysiwyg-toolbar{
  background:rgba(232,241,241,.96);
  border-bottom-color:#adc8ca;
  color:#526b70;
}
body[data-theme="petrol"] .wysiwyg-toolbar button{
  background:#dcebec;
  color:#17343b;
  border-color:#b2cacc;
}
body[data-theme="petrol"] .wysiwyg-toolbar button:hover{
  background:#cfe2e3;
}

/* Actions et badges : pétrole plus présent et contrasté. */
body[data-theme="petrol"] button:not(.delete-button):not(.delete-small):not(.danger-text),
body[data-theme="petrol"] .button:not(.secondary):not(.ghost){
  box-shadow:0 4px 12px rgba(25,117,123,.16);
}
body[data-theme="petrol"] .button.secondary,
body[data-theme="petrol"] .icon-button,
body[data-theme="petrol"] .quick-block,
body[data-theme="petrol"] .progress-session-more>summary{
  background:#c3dadb;
  color:#093f44;
  border-color:#86abad;
}
/* V0.18.11.68 — la pastille « Semaine A » de l'accueil prend les couleurs des boutons secondaires. */
body[data-theme="petrol"] .teacher-calendar-week-badge{
  background:#d9e8e9;
  color:#145e64;
}
body[data-theme="petrol"] .button.secondary:hover,
body[data-theme="petrol"] .icon-button:hover,
body[data-theme="petrol"] .quick-block:hover,
body[data-theme="petrol"] .progress-session-more>summary:hover{
  background:#c9dfe0;
  color:#0f4f55;
}
body[data-theme="petrol"] .badge,
body[data-theme="petrol"] .session-number,
body[data-theme="petrol"] .week-badge{
  background:#d5e7e8;
  color:#145e64;
  border:1px solid #b7d0d2;
}
body[data-theme="petrol"] .resource-library-card:hover{
  border-color:#78aeb2;
  box-shadow:0 12px 32px rgba(23,52,59,.13);
}
body[data-theme="petrol"] .assignment-row,
body[data-theme="petrol"] .dashboard-row,
body[data-theme="petrol"] .progress-row{
  border-top-color:#c5d7d9;
}
body[data-theme="petrol"] .course-table th{
  background:#dcebec;
  color:#17343b;
}
body[data-theme="petrol"] .course-table th,
body[data-theme="petrol"] .course-table td{
  border-color:#a9c1c4;
}
body[data-theme="petrol"] code{
  background:#dcebec;
  color:#174f55;
}

/* -------------------------------------------------------------------------
   Nuit : vraie interface sombre. Les documents pédagogiques restent clairs.
   ------------------------------------------------------------------------- */
body[data-theme="night"]{
  background:var(--bg);
  color:var(--text);
}
body[data-theme="night"] .topbar{
  background:var(--theme-topbar);
  border-bottom-color:#25323d;
  box-shadow:0 5px 20px rgba(0,0,0,.25);
}
body[data-theme="night"] .topbar .main-nav>a{
  color:var(--theme-topbar-text);
}
body[data-theme="night"] .topbar .main-nav>a:hover{
  color:#ffffff;
}
body[data-theme="night"] .topbar .nav-dropdown>summary{
  color:var(--theme-topbar-text);
  border-color:#354550;
  background:#16212a;
}
body[data-theme="night"] .topbar .nav-dropdown>summary:hover,
body[data-theme="night"] .topbar .nav-dropdown[open]>summary{
  background:#22313c;
}
body[data-theme="night"] .nav-dropdown-menu,
body[data-theme="night"] .progress-session-menu{
  background:#18222c;
  color:var(--text);
  border-color:var(--line);
  box-shadow:0 16px 38px rgba(0,0,0,.36);
}
body[data-theme="night"] .nav-dropdown-menu a:hover,
body[data-theme="night"] .progress-session-menu button:hover{
  background:#22313c;
  color:#f4f8fa;
}
body[data-theme="night"] .progress-session-menu button{
  background:transparent;
  color:var(--primary);
}
body[data-theme="night"] input,
body[data-theme="night"] select,
body[data-theme="night"] textarea,
body[data-theme="night"] .rich-editor{
  background:var(--theme-field);
  color:var(--text);
  border-color:var(--line);
}
body[data-theme="night"] input::placeholder,
body[data-theme="night"] textarea::placeholder{
  color:#738493;
}
body[data-theme="night"] input:focus,
body[data-theme="night"] select:focus,
body[data-theme="night"] textarea:focus,
body[data-theme="night"] .rich-editor:focus{
  outline:2px solid var(--theme-focus);
  border-color:var(--primary);
}
body[data-theme="night"] option{
  background:#18222c;
  color:var(--text);
}
/* V0.18.12.115 — « border-color » est un raccourci : il écrasait aussi le liseré latéral (« border-left-color ») que la feuille de l'élément donne à sa carte — couleur d'un type de bloc dans l'éditeur,
   priorité d'une tâche, accent de la carte de finalisation, du scan, du transfert… : tous devenaient la même ligne terne. Les trois autres côtés suivent la ligne du thème ; le côté gauche reste à
   l'élément (sans accent, il est déjà « 1px solid var(--line) » par la règle de base : même couleur qu'avant). */
body[data-theme="night"] .card,
body[data-theme="night"] .auth-card,
body[data-theme="night"] .lesson-block{
  background:var(--surface);
  border-top-color:var(--line);
  border-right-color:var(--line);
  border-bottom-color:var(--line);
  box-shadow:var(--shadow);
}
/* V0.18.12.115 — LISERÉS LATÉRAUX EN THÈME NUIT : leurs couleurs d'origine (thème clair) ne font que 2,3 à 3,3 : 1 sur la surface sombre ; ici des versions plus claires de la même teinte (au moins 4,5 : 1).
   Types de bloc de l'éditeur de séance, priorité d'une tâche, cartes de l'éditeur d'évaluation. Les autres liserés (titre et cartes « principales » : couleur du thème, texte, défaut, priorité basse, confidentialité) sont assez clairs. */
body[data-theme="night"] .lesson-block.block-learning_objective{border-left-color:#688dbe}
body[data-theme="night"] .lesson-block.block-definition{border-left-color:#9b7aba}
body[data-theme="night"] .lesson-block.block-document{border-left-color:#a79257}
body[data-theme="night"] .lesson-block.block-question{border-left-color:#5d9e9a}
body[data-theme="night"] .lesson-block.block-activity,
body[data-theme="night"] .lesson-block.block-exercise{border-left-color:#be8363}
body[data-theme="night"] .lesson-block.block-summary,
body[data-theme="night"] .lesson-block.block-written_trace{border-left-color:#6b9c7d}
body[data-theme="night"] .lesson-block.block-teacher_note,
body[data-theme="night"] .lesson-block.block-correction{border-left-color:#ce7069}
body[data-theme="night"] .lesson-block.block-homework{border-left-color:#8687f3}
body[data-theme="night"] .lesson-block.block-fill_blank{border-left-color:#9b83bc}
body[data-theme="night"] .lesson-block.block-formula{border-left-color:#7996b0}
body[data-theme="night"] .teacher-task-card.priority-urgent{border-left-color:#c38585}
body[data-theme="night"] .teacher-task-card.priority-high{border-left-color:#b87f40}
body[data-theme="night"] .teacher-task-card.priority-normal{border-left-color:#7a9ab5}
body[data-theme="night"] .evaluation-scan-import-card{border-left-color:#6b9686}
body[data-theme="night"] .evaluation-editor-finalize,
body[data-theme="night"] .evaluation-generation-summary-card{border-left-color:#6b9b80}
body[data-theme="night"] .evaluation-ai-structure-card,
body[data-theme="night"] .evaluation-generation-launch-card{border-left-color:#9481be}
body[data-theme="night"] .button.secondary,
body[data-theme="night"] .icon-button,
body[data-theme="night"] .quick-block,
body[data-theme="night"] .progress-session-more>summary{
  background:#22313c;
  color:#a9d8de;
  border-color:#3a4b58;
}
body[data-theme="night"] .teacher-calendar-week-badge{
  background:#22313c;
  color:#a9d8de;
}
/* V0.18.11.68 — la fenêtre « + Ajouter un événement » : fond plus sombre derrière. */
body[data-theme="night"] .teacher-calendar-dialog::backdrop{
  background:rgba(0,0,0,.6);
}
body[data-theme="night"] .button.secondary:hover,
body[data-theme="night"] .icon-button:hover,
body[data-theme="night"] .quick-block:hover,
body[data-theme="night"] .progress-session-more>summary:hover{
  background:#2a3b47;
}
body[data-theme="night"] .badge,
body[data-theme="night"] .session-number{
  background:#22313c;
  color:#a9d8de;
}
body[data-theme="night"] .delete-small{
  border-color:#704441;
  color:#ee918c;
}
body[data-theme="night"] .delete-small:hover{
  background:#382321;
}
body[data-theme="night"] .chapter-block-edit-form,
body[data-theme="night"] .table-editor{
  background:#141e27;
  border-color:var(--line);
}
body[data-theme="night"] .wysiwyg-toolbar{
  background:rgba(16,23,30,.96);
  border-bottom-color:var(--line);
  color:var(--muted);
}
body[data-theme="night"] .wysiwyg-toolbar button{
  background:#22313c;
  color:var(--text);
  border-color:#3a4b58;
}
body[data-theme="night"] .wysiwyg-toolbar button:hover{
  background:#2a3b47;
}
body[data-theme="night"] .flash.error{
  background:#382321;
  color:#f0a09b;
}
body[data-theme="night"] .flash.success{
  background:#193427;
  color:#92d2a5;
}
body[data-theme="night"] .flash.warning{
  background:var(--theme-warning-bg);
  color:var(--theme-warning-text);
  border-color:var(--theme-warning-border);
}
body[data-theme="night"] code{
  background:#101820;
  color:#bdd7dc;
}
body[data-theme="night"] hr{
  border-color:var(--line);
}

/* V0.18.10.67 — cartes du calendrier et cartouches de page restées avec un
   fond clair codé en dur (aucune variable de thème) : texte illisible en
   thème Nuit. Le fond reprend la teinte de chaque carte, assombrie via
   color-mix sur la surface du thème ; le texte suit déjà var(--text)/var(--muted). */
/* V0.18.12.114 — LES COULEURS DU CALENDRIER EN THÈME NUIT : le raccourci « border-color » ci-dessous écrasait l'accent latéral (« border-left-color ») posé par dashboard-calendar.css : les cinq
   genres avaient le même liseré terne, et la légende (restée aux couleurs du thème clair) ne correspondait plus à rien. Les variables --cal-* sont ici plus claires (contraste d'au moins 4,8 : 1 sur la carte) ;
   la légende et l'accent de la carte les lisent toutes les deux, et l'accent est reposé APRÈS le raccourci. */
html[data-theme="night"]{
  --cal-cours:#6ea7d3;
  --cal-evaluation:#d58d4a;
  --cal-tache:#62b085;
  --cal-sans-cours:#b2b8c0;   /* V0.18.12.117 : gris clair neutre (c'était un or #c9a24f) */
  --cal-personnel:#9d8bd9;
  --cal-pronote:#4fb5a5;
}
body[data-theme="night"] .teacher-calendar-event{
  background:var(--surface);
}
body[data-theme="night"] .teacher-calendar-event-course{
  background:color-mix(in srgb,var(--surface) 85%,#3d78a8 15%);
  border-color:color-mix(in srgb,var(--surface) 60%,#3d78a8 40%);
  border-left-color:var(--cal-cours);
}
body[data-theme="night"] .teacher-calendar-event-evaluation{
  background:color-mix(in srgb,var(--surface) 85%,#a76324 15%);
  border-color:color-mix(in srgb,var(--surface) 60%,#a76324 40%);
  border-left-color:var(--cal-evaluation);
}
body[data-theme="night"] .teacher-calendar-event-personal{
  background:color-mix(in srgb,var(--surface) 85%,#6d5aa8 15%);
  border-color:color-mix(in srgb,var(--surface) 60%,#6d5aa8 40%);
  border-left-color:var(--cal-personnel);
}
body[data-theme="night"] .teacher-calendar-event-task{
  background:color-mix(in srgb,var(--surface) 85%,#4a8667 15%);
  border-color:color-mix(in srgb,var(--surface) 60%,#4a8667 40%);
  border-left-color:var(--cal-tache);
}
/* V0.18.12.117 — l'étiquette « Vacances » / « Jour férié » n'est plus dorée en Nuit : elle suit le gris du thème (calendar-rules.css : color:var(--muted)). */
body[data-theme="night"] .teacher-calendar-embedded-evaluation,
body[data-theme="night"] .teacher-calendar-event-with-evaluation .teacher-calendar-embedded-evaluation{
  background:color-mix(in srgb,var(--surface) 85%,#a76324 15%);
  border-color:color-mix(in srgb,var(--surface) 55%,#a76324 45%);
  border-left-color:var(--cal-evaluation);   /* V0.18.12.115 : le liseré de l'évaluation, de la couleur de la pastille « Évaluation » (le raccourci ci-dessus l'écrasait) */
}
body[data-theme="night"] .teacher-calendar-embedded-evaluation:hover,
body[data-theme="night"] .teacher-calendar-embedded-evaluation:focus-visible,
body[data-theme="night"] .teacher-calendar-event-with-evaluation .teacher-calendar-embedded-evaluation:hover,
body[data-theme="night"] .teacher-calendar-event-with-evaluation .teacher-calendar-embedded-evaluation:focus-visible{
  background:color-mix(in srgb,var(--surface) 78%,#a76324 22%);
}
body[data-theme="night"] .teacher-calendar-embedded-evaluation-topline,
body[data-theme="night"] .teacher-calendar-event-with-evaluation .teacher-calendar-embedded-evaluation-topline{
  color:#e0b073;
}
/* V0.18.11.56 — l'évaluation « à créer » d'un DST : pointillés, sans fond. */
body[data-theme="night"] .teacher-calendar-embedded-evaluation.is-a-creer,
body[data-theme="night"] .teacher-calendar-event-with-evaluation .teacher-calendar-embedded-evaluation.is-a-creer{
  background:transparent;
}

/* Ressources documentaires : surcharges de thème à spécificité élevée. */
body[data-theme="petrol"] .resource-source-row,
body[data-theme="petrol"] .resource-usage-row{
  background:#f8fcfc;
  border-color:#b5cbcd;
}
body[data-theme="petrol"] .resource-source-row:hover{
  background:#e9f3f3;
  border-color:#78aeb2;
}
body[data-theme="petrol"] .resource-library-thumb{
  background:#edf5f5;
  border-color:#b5cbcd;
}
body[data-theme="petrol"] .resource-library-thumb-placeholder{
  background:linear-gradient(145deg,#eef7f7,#cfE3e4);
  color:#145e64;
}
body[data-theme="petrol"] .resource-ai-card{
  border-color:#a9c9cc;
  background:linear-gradient(180deg,#f9fcfc,#e7f2f2);
}
body[data-theme="petrol"] .resource-ai-apply-card,
body[data-theme="petrol"] .resource-usage-marker-help{
  background:#e9f3f3;
  border-color:#adc9cb;
}

body[data-theme="night"] .resource-source-row,
body[data-theme="night"] .resource-usage-row,
body[data-theme="night"] .resource-library-thumb,
body[data-theme="night"] .resource-parts-panel,
body[data-theme="night"] .resource-activity-editor-card,
body[data-theme="night"] .resource-activity-resource-card{
  background:var(--surface);
  color:var(--text);
  border-color:var(--line);
}
body[data-theme="night"] .resource-source-row:hover{
  background:#1e2c36;
  border-color:var(--primary);
}
body[data-theme="night"] .resource-source-object,
body[data-theme="night"] .resource-crop-stage canvas,
body[data-theme="night"] .resource-part-card img,
body[data-theme="night"] .resource-part-preview-list img,
body[data-theme="night"] .resource-library-thumb img,
body[data-theme="night"] .resource-activity-thumbs img{
  background:#ffffff;
}
body[data-theme="night"] .resource-crop-stage-wrap{
  background:#111a22;
  border-color:var(--line);
}
body[data-theme="night"] .resource-library-thumb-placeholder{
  background:linear-gradient(145deg,#1b2832,#22343f);
  color:#a9d8de;
}
body[data-theme="night"] .resource-ai-card,
body[data-theme="night"] .resource-ai-notice,
body[data-theme="night"] .resource-usage-assistant{
  background:#211d2c;
  border-color:#514373;
}
body[data-theme="night"] .resource-ai-pending{
  background:#28213a;
  border-color:#514373;
}
body[data-theme="night"] .resource-ai-warnings,
body[data-theme="night"] .resource-activity-warning{
  background:var(--theme-warning-bg);
  border-color:var(--theme-warning-border);
  color:var(--theme-warning-text);
}
body[data-theme="night"] .resource-current-value,
body[data-theme="night"] .resource-usage-context,
body[data-theme="night"] .resource-activity-context-mini{
  background:#141e27;
  color:var(--muted);
  border-color:var(--line);
}
body[data-theme="night"] .resource-ai-evidence{
  background:#1b3327;
  color:#99d2aa;
  border-left-color:#5c9f74;
}
body[data-theme="night"] .resource-ai-apply-card,
body[data-theme="night"] .resource-usage-marker-help{
  background:#15242b;
  border-color:#31525b;
}
body[data-theme="night"] .resource-usage-field.usage-capability-ai{
  background:var(--theme-ai-bg);
  border-color:var(--theme-ai-border);
}
body[data-theme="night"] .resource-usage-field.usage-capability-teacher{
  background:var(--theme-teacher-bg);
  border-color:var(--theme-teacher-border);
}
body[data-theme="night"] .resource-usage-field.usage-capability-auto{
  background:var(--theme-auto-bg);
  border-color:var(--theme-auto-border);
}
body[data-theme="night"] .resource-usage-origin-badge.usage-origin-ai,
body[data-theme="night"] .resource-origin-badge.origin-ai,
body[data-theme="night"] .generated-resource-activity-badge,
body[data-theme="night"] .generated-resource-activity-inline-badge,
body[data-theme="night"] .resource-activity-ai-badge{
  background:var(--theme-ai-bg);
  color:var(--theme-ai-text);
}
body[data-theme="night"] .resource-usage-origin-badge.usage-origin-teacher{
  background:var(--theme-teacher-bg);
  color:var(--theme-teacher-text);
}
body[data-theme="night"] .resource-usage-origin-badge.usage-origin-auto,
body[data-theme="night"] .resource-origin-badge.origin-document{
  background:var(--theme-auto-bg);
  color:var(--theme-auto-text);
}
body[data-theme="night"] .resource-activity-question{
  background:#211d2c;
  border-color:#514373;
}
body[data-theme="night"] .resource-activity-integrated{
  background:#183025;
  border-color:#365d47;
}
body[data-theme="night"] .generated-resource-activity-marker{
  background:#211d2c;
  border-color:#514373;
  border-left-color:#8f78cf;
}
/* V0.18.11.67 — Journal des seances : le bouton « Supprimer » (fond transparent, sur la page)
   garde son rouge ecrit en dur en Classique et en Petrole (5,3 a 6,1) ; en mode nuit, ce rouge
   tombait a 2,7 au repos et 1,8 au survol. Ici, le rouge du theme : 6,2 et 7,8. */
body[data-theme="night"] .teaching-journal-delete-button{
  color:var(--danger);
}
body[data-theme="night"] .teaching-journal-delete-button:hover,
body[data-theme="night"] .teaching-journal-delete-button:focus{
  color:color-mix(in srgb,var(--danger) 75%,var(--text));
}
/* V0.18.11.65 — « Historique recent » (titre du menu), en #475467 ecrit en dur : 2,1 de contraste sur le menu
   sombre des marqueurs. Le Classique garde son gris fonce. */
body[data-theme="night"] .teaching-marker-history>strong{
  color:var(--muted);
}

/* -------------------------------------------------------------------------
   Cumpari : la charte graphique de la marque (V0.18.12.295). L'en-tête est bleu nuit,
   l'accent violet, les pages restent claires et sobres. Les documents pédagogiques
   gardent leur charte (« le papier est une zone fermée », plus bas) : aucune règle
   ci-dessous ne vise un document, et celles qui touchent les champs ont leur
   remise à zéro pour le papier.
   ------------------------------------------------------------------------- */
body[data-theme="cumpari"] .topbar{
  background:var(--theme-topbar);
  border-bottom-color:#172652;
  box-shadow:0 6px 22px rgba(16,26,54,.20);
}
/* V0.18.12.340.2 — le logo de la charte (tuile violette, « C » blanc, point menthe ; « cumpari. » et « ENSEIGNANTS ») est celui de TOUS les thèmes : son balisage est dans l'en-tête
   (ui_marque_v0123402), son habillage dans app-branding.css, ses couleurs dans les jetons --theme-brand-* de chaque thème. Plus de règle propre à Cumpari ici. */
body[data-theme="cumpari"] .topbar .main-nav>a{
  color:#c3cde0;
}
body[data-theme="cumpari"] .topbar .main-nav>a:hover,
body[data-theme="cumpari"] .topbar .main-nav>a.is-active{
  color:#ffffff;
  background:rgba(255,255,255,.10);
}
body[data-theme="cumpari"] .topbar .nav-dropdown>summary,
body[data-theme="cumpari"] .topbar .nav-note-button{
  color:#ffffff;
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.07);
}
body[data-theme="cumpari"] .topbar .nav-dropdown>summary:hover,
body[data-theme="cumpari"] .topbar .nav-dropdown>summary.is-active,
body[data-theme="cumpari"] .topbar .nav-dropdown[open]>summary,
body[data-theme="cumpari"] .topbar .nav-note-button:hover,
body[data-theme="cumpari"] .topbar .nav-note-button[aria-expanded="true"]{
  color:#ffffff;
  border-color:rgba(255,255,255,.34);
  background:rgba(255,255,255,.16);
}
/* Les initiales du compte : les couleurs du bouton principal de la charte sur le bleu nuit (8,9:1). */
body[data-theme="cumpari"] .topbar .nav-initiales{
  background:#bcb3ff;
  color:#121b38;
}
/* Le raccourci « Ctrl K » de la recherche : une touche claire sur le bouton translucide. */
body[data-theme="cumpari"] .topbar .nav-recherche-raccourci{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.28);
  color:#dfe5f2;
}
/* L'aperçu d'un cours loge « ← Revenir au chapitre » DANS la barre : en violet-700 (--primary) il ne faisait que 2,3:1 sur le bleu nuit (mesuré). */
body[data-theme="cumpari"] .preview-cockpit-context .backlink{
  color:#c3cde0;
}
body[data-theme="cumpari"] .topbar :focus-visible{
  outline:2px solid #64ddc8;
  outline-offset:2px;
}
/* Les menus déroulants sont DANS la barre mais sur un panneau blanc, où le menthe ne ferait que 1,65:1 : le contour y est violet (7,6:1). */
body[data-theme="cumpari"] .topbar .nav-dropdown-menu :focus-visible{
  outline-color:var(--primary);
}
/* L'entrée courante d'un menu se distingue de celle qui est survolée (le survol seul garde le violet léger). */
body[data-theme="cumpari"] .nav-dropdown-menu>a.is-active{
  background:#e9e5ff;
  color:var(--primary);
  font-weight:800;
}
/* Sur téléphone, « Menu » prend l'habillage de ses voisins (loupe, pense-bête) : un bouton translucide, et non un pavé blanc. */
body[data-theme="cumpari"] .topbar .main-nav>.nav-menu-bouton{
  color:#ffffff;
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.07);
}
body[data-theme="cumpari"] .topbar .main-nav>.nav-menu-bouton:hover,
body[data-theme="cumpari"] .topbar .main-nav>.nav-menu-bouton[aria-expanded="true"]{
  border-color:rgba(255,255,255,.34);
  background:rgba(255,255,255,.16);
}

/* L'en-tête de page : un panneau clair à peine teinté de violet (violet-50 de la charte). */
body[data-theme="cumpari"] .hero{
  padding:22px 26px;
  margin-bottom:22px;
  border:1px solid var(--line);
  border-radius:24px;
  background:linear-gradient(135deg,#ffffff 0%,#f7f5ff 100%);
  box-shadow:0 22px 70px rgba(24,35,78,.07);
}
body[data-theme="cumpari"] .hero h1{
  font-weight:800;
  letter-spacing:-.04em;
}
/* Le surtitre : capitales espacées, violet plus foncé que celui du site (#7865da : 4,49:1 sur blanc) pour tenir 4,5:1 même posé directement sur le fond de page
   (#6554cc : 4,6:1 sur #e3e8f2, 5,7:1 sur blanc, 5,3:1 sur le violet-50 de l'en-tête de page). */
body[data-theme="cumpari"] .eyebrow{
  font-size:.72rem;
  letter-spacing:.17em;
  color:#6554cc;
}
body[data-theme="cumpari"] .card,
body[data-theme="cumpari"] .auth-card{
  border-radius:18px;
}
/* L'onglet courant de la page Établissement est écrit en bleu (#234b72) dans la page elle-même : ici, le violet du thème (texte blanc dessus, 7,6:1). */
body[data-theme="cumpari"] .admin-tabs a.active{
  background:var(--primary);
  color:var(--on-primary);
  border-color:var(--primary);
}
/* V0.18.12.295.2 — « À faire » (accueil) : des lignes blanches posées sur une carte blanche, bordées d'un gris à 1,2:1, avec une pastille de domaine sans fond et un
   bouton blanc : « un peu fades » (le concepteur, 01/11). Les trois sont teintés de violet léger (par mélange du jeton --primary, jamais un hex) : la ligne à 5 %, la pastille et le
   bouton à 10 %, leur bordure à 22-35 %. Le liseré gauche des lignes « en retard » (rouge) et « aujourd'hui » (violet) n'est PAS touché : seules les bordures sans état
   sont teintées (pas de « border-color » en raccourci sur une ligne : il effacerait ces liserés). */
body[data-theme="cumpari"] .accueil-a-faire-ligne{
  background:color-mix(in srgb,var(--primary) 5%,var(--surface));
  border-top-color:color-mix(in srgb,var(--primary) 22%,var(--surface));
  border-right-color:color-mix(in srgb,var(--primary) 22%,var(--surface));
  border-bottom-color:color-mix(in srgb,var(--primary) 22%,var(--surface));
}
body[data-theme="cumpari"] .accueil-a-faire-ligne:not(.is-retard):not(.is-jour){
  border-left-color:color-mix(in srgb,var(--primary) 22%,var(--surface));
}
body[data-theme="cumpari"] .accueil-a-faire-domaine{
  background:color-mix(in srgb,var(--primary) 10%,var(--surface));
  border-color:color-mix(in srgb,var(--primary) 30%,var(--surface));
  color:var(--primary);
}
body[data-theme="cumpari"] .accueil-a-faire-geste{
  background:color-mix(in srgb,var(--primary) 10%,var(--surface));
  border-color:color-mix(in srgb,var(--primary) 35%,var(--surface));
}
body[data-theme="cumpari"] .accueil-a-faire-geste:hover,
body[data-theme="cumpari"] .accueil-a-faire-geste:focus-visible{
  background:color-mix(in srgb,var(--primary) 18%,var(--surface));
}
/* Les champs. Les documents (le papier) n'ont AUCUNE de ces règles : « :not(:is(…papiers…) *) » les écarte, et « :where » laisse à chaque règle la force qu'elle aurait sans lui. */
body[data-theme="cumpari"] input:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)),
body[data-theme="cumpari"] select:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)),
body[data-theme="cumpari"] textarea:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)),
body[data-theme="cumpari"] .rich-editor:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)){
  background:var(--theme-field);
  color:var(--text);
  border-color:#aab4c8;
}
body[data-theme="cumpari"] input:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *))::placeholder,
body[data-theme="cumpari"] textarea:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *))::placeholder{
  color:#69758c;
}
body[data-theme="cumpari"] input:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)):focus,
body[data-theme="cumpari"] select:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)):focus,
body[data-theme="cumpari"] textarea:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)):focus,
body[data-theme="cumpari"] .rich-editor:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)):focus{
  outline:3px solid var(--theme-focus);
  border-color:var(--primary);
}
/* Un champ désactivé doit ressembler à un champ désactivé : texte atténué, fond de panneau. */
body[data-theme="cumpari"] input:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)):disabled,
body[data-theme="cumpari"] select:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)):disabled,
body[data-theme="cumpari"] textarea:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)):disabled{
  color:var(--muted);
  background:var(--tone-soft);
}
/* Cases à cocher et boutons radio : le violet de la marque. */
body[data-theme="cumpari"] input[type="checkbox"]:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)),
body[data-theme="cumpari"] input[type="radio"]:where(:not(:is(.course-document,.print-course-document,.document-print-screen,.document-print-screen-preview,.evaluation-paper,.evaluation-lot-page,.node-diagram-paper,.resource-activity-sheet) *)){
  accent-color:var(--primary);
}
/* V0.18.12.300.1 — la ligne du rail de progression (aperçu d'un chapitre ou d'une séance) : --line, presque blanc ici (#e7eaf2), est plus
   clair que le fond (#e3e8f2) : seule la séance en cours se voyait. Un gris tiré du texte atténué, des jetons du thème (sur tablette,
   course-preview-tablet.css la colore déjà). La séance en cours prend le violet de la marque : son bleu-gris (#6f8faa) ne se
   détachait plus assez de cette ligne (relecture). */
body[data-theme="cumpari"] .chapter-session-track{background:color-mix(in srgb,var(--muted) 55%,var(--line))}
body[data-theme="cumpari"] .chapter-session-active-segment{background:var(--primary);opacity:1}

/* Les documents pédagogiques conservent une charte claire, quel que soit le thème UI.
   V0.18.12.19 — le reste de la palette de .course-document est posé plus bas, avec les autres papiers
   (« V0.18.11.27 — LE PAPIER EST UNE ZONE FERMEE ») : ici ne restent pour lui que --bg et color-scheme, qu'elle ne pose pas. */
.course-document{
  --bg:#ffffff;
  color-scheme:light;
}
.resource-activity-sheet{
  --bg:#ffffff;
  --surface:#ffffff;
  --text:#1f2933;
  --muted:#667085;
  --line:#d9e0e7;
  --primary:#234b72;
  --primary2:#183754;
  --danger:#b42318;
  --success:#067647;
  color-scheme:light;
  color:#1f2933;
}
body[data-theme="night"] .course-document,
body[data-theme="night"] .resource-activity-sheet{
  background:#ffffff;
  color:#1f2933;
  border-color:#d9e0e7;
}
body[data-theme="night"] .course-document input,
body[data-theme="night"] .course-document select,
body[data-theme="night"] .course-document textarea{
  background:#ffffff;
  color:#1f2933;
  border-color:#d9e0e7;
}
body[data-theme="petrol"] .course-document,
body[data-theme="petrol"] .resource-activity-sheet{
  background:#ffffff;
  color:#1f2933;
  border-color:#d9e0e7;
  box-shadow:0 10px 30px rgba(20,42,64,.06);
}
body[data-theme="petrol"] .course-document input,
body[data-theme="petrol"] .course-document select,
body[data-theme="petrol"] .course-document textarea,
body[data-theme="petrol"] .resource-activity-sheet input,
body[data-theme="petrol"] .resource-activity-sheet select,
body[data-theme="petrol"] .resource-activity-sheet textarea{
  background:#ffffff;
  color:#1f2933;
  border-color:#d9e0e7;
}


/* V0.15.3.3 — rétroprojection : correction individuelle des textes à trous / synthèses hybrides. */
body.projection-mode .course-view-student .fill-blank-teacher-correction.is-revealed{
  display:block!important;
}

/* -------------------------------------------------------------------------
   Page Apparence.
   ------------------------------------------------------------------------- */
.appearance-hero{margin-bottom:20px}
.appearance-card{padding:26px}
.theme-choice-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.theme-choice{position:relative;display:grid;gap:13px;margin:0;padding:16px;border:2px solid var(--line);border-radius:14px;background:var(--surface);cursor:pointer;transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease}
.theme-choice:hover{transform:translateY(-1px);border-color:var(--primary)}
.theme-choice:has(input:checked),.theme-choice.is-previewed{border-color:var(--primary);box-shadow:0 0 0 3px var(--theme-focus)}
.theme-choice>input{position:absolute;top:16px;right:16px;width:18px;height:18px;margin:0;accent-color:var(--primary)}
.theme-choice-header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding-right:26px}
.theme-choice-header>span:first-child{display:grid;gap:2px}
.theme-choice-header strong{font-size:1rem}
.theme-choice-header small,.theme-choice-description{color:var(--muted);font-size:.82rem;line-height:1.45}
.theme-recommended{display:inline-flex;padding:3px 7px;border-radius:999px;background:var(--theme-auto-bg);color:var(--theme-auto-text);font-size:.68rem;font-weight:800;white-space:nowrap}
.theme-mini-preview{display:block;overflow:hidden;height:128px;border:1px solid var(--line);border-radius:10px;background:#f4f6f8}
.theme-mini-topbar{display:block;height:27px;background:#ffffff;border-bottom:1px solid #d9e0e7}
.theme-mini-body{display:grid;grid-template-columns:1.25fr .75fr;gap:8px;padding:11px;height:100%}
.theme-mini-card{display:grid;align-content:start;gap:8px;padding:10px;border-radius:8px;background:#ffffff;border:1px solid #d9e0e7;box-shadow:0 3px 9px rgba(16,24,40,.05)}
.theme-mini-card i,.theme-mini-card b,.theme-mini-card em{display:block;height:7px;border-radius:99px;background:#d8e1e8}
.theme-mini-card i{width:45%;background:#234b72}.theme-mini-card b{width:84%}.theme-mini-card em{width:66%}
.theme-mini-card-small i{width:65%}.theme-mini-card-small b{width:48%}
.theme-choice-petrol .theme-mini-preview{background:#e3ecec;border-color:#b9cdd0}
.theme-choice-petrol .theme-mini-topbar{background:linear-gradient(110deg,#122e34,#1c5960);border-bottom-color:#28545a}
.theme-choice-petrol .theme-mini-card{background:#f8fcfc;border-color:#b6ccce;box-shadow:0 4px 12px rgba(23,52,59,.10)}
.theme-choice-petrol .theme-mini-card i{background:#19757b}
.theme-choice-petrol .theme-mini-card b,.theme-choice-petrol .theme-mini-card em{background:#b8cdcf}
.theme-choice-night .theme-mini-preview{background:#10171e;border-color:#31404d}
.theme-choice-night .theme-mini-topbar{background:#0b1117;border-bottom-color:#25323d}
.theme-choice-night .theme-mini-card{background:#18222c;border-color:#31404d;box-shadow:0 3px 10px rgba(0,0,0,.18)}
.theme-choice-night .theme-mini-card i{background:#63aeb8}.theme-choice-night .theme-mini-card b,.theme-choice-night .theme-mini-card em{background:#40515f}
.theme-choice-cumpari .theme-mini-preview{background:#f6f8fc;border-color:#e7eaf2}
.theme-choice-cumpari .theme-mini-topbar{background:#101a36;border-bottom-color:#172652}
.theme-choice-cumpari .theme-mini-card{background:#ffffff;border-color:#e7eaf2;border-radius:10px;box-shadow:0 3px 10px rgba(38,50,87,.07)}
.theme-choice-cumpari .theme-mini-card i{background:#5145a8}
.theme-choice-cumpari .theme-mini-card b,.theme-choice-cumpari .theme-mini-card em{background:#dfe4f1}
.appearance-actions{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.appearance-actions p{margin:0}.appearance-actions button{margin:0;white-space:nowrap}
.appearance-info-card h2{margin-bottom:.35rem}
.appearance-info-card p{margin-top:0}
.appearance-semantic-legend{display:flex;gap:8px;flex-wrap:wrap}
.appearance-semantic{display:inline-flex;align-items:center;white-space:nowrap;padding:5px 9px;border:1px solid transparent;border-radius:999px;font-size:.76rem;font-weight:800}
.appearance-semantic.ai{background:var(--theme-ai-bg);border-color:var(--theme-ai-border);color:var(--theme-ai-text)}
.appearance-semantic.teacher{background:var(--theme-teacher-bg);border-color:var(--theme-teacher-border);color:var(--theme-teacher-text)}
.appearance-semantic.auto,.appearance-semantic.success{background:var(--theme-auto-bg);border-color:var(--theme-auto-border);color:var(--theme-auto-text)}
.appearance-semantic.warning{background:var(--theme-warning-bg);border-color:var(--theme-warning-border);color:var(--theme-warning-text)}
@media(max-width:1100px){.theme-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.theme-choice-grid{grid-template-columns:1fr}}
@media(max-width:900px){.theme-mini-preview{height:112px}.appearance-actions{align-items:flex-start;flex-direction:column}.appearance-actions button{width:100%}}

@media print{
  html,body{color-scheme:light!important;background:#fff!important;color:#1f2933!important}
}

/* V0.18.11.26 — lisibilite du bouton principal en mode nuit.
   L'accent nocturne (#63aeb8) est volontairement clair : c'est ce qui le rend
   lisible EN TEXTE sur un fond sombre. Mais employe en FOND de bouton sous du
   texte blanc, il ne donne que 2,54 de contraste — mesure sur les dix-neuf
   pages de l'application, ou il etait le defaut le plus frequent. Le texte du
   bouton passe donc au sombre : meme accent, 7,4 de contraste.

   V0.18.11.27 — la regle qui figurait ici a ete SUPPRIMEE, et non retouchee.
   Ecrite « body[data-theme=night] button », elle valait 0,1,2 de specificite
   et l'emportait donc sur toute variante qui se donne sa propre couleur :
   .delete-button (0,1,0), .drag-handle, .chapter-order-handle... Ces boutons
   ont leur propre fond SOMBRE ; ils recevaient un texte sombre par-dessus, a
   1,05 de contraste. Mesure : 45 elements sur 20 pages.

   La couleur du texte accent est desormais portee par la variable
   `--on-primary`, declaree dans application.css dans la meme regle que le fond
   qu'elle accompagne, et redefinie ci-dessous pour la nuit. La specificite
   redevient celle de la regle de base (0,0,1) : chaque variante qui se donne
   un fond se donne une couleur, et gagne. */

/* ==========================================================================
   V0.18.11.27 — LE PAPIER EST UNE ZONE FERMEE.

   Un document de cours, un sujet d'evaluation, une fiche de correction : ce
   sont des feuilles. Elles restent blanches meme quand l'interface est sombre,
   sinon l'apercu ne ressemble plus a ce qui sortira de l'imprimante — et c'est
   precisement ce qu'on vient y verifier.

   Mais garder le FOND blanc ne suffit pas : le texte, lui, suivait `--text` et
   devenait clair. Mesure en mode nuit sur la fiche de correction par lot : 25
   textes entre 1,11 et 1,18 de contraste, c'est-a-dire invisibles. Le defaut
   n'etait pas le fond blanc, c'etait le COUPLE rompu.

   La correction ne retouche donc pas les elements un par un : elle redeclare
   la palette CLAIRE sur le conteneur. Tout ce qui est dedans consomme deja ces
   variables et redevient juste d'un coup, y compris ce qui sera ajoute demain.
   Les valeurs sont copiees a l'identique de `:root` : en theme clair, cette
   regle ne change rien du tout.
   ========================================================================== */
.course-document,
.print-course-document,
.document-print-screen,
.document-print-screen-preview,
.evaluation-paper,
.evaluation-lot-page,
.node-diagram-paper{
  --surface:#fff;
  --text:#1f2933;
  --muted:#667085;
  --line:#d9e0e7;
  --primary:#234b72;
  --primary2:#183754;
  --danger:#b42318;
  --success:#067647;
  --tone-soft:#f8fafc;
  --tone-panel:#eef2f6;
  --tone-chip:#e9eef4;
  /* V0.18.11.65 — la teinte de survol manquait : definie a la racine a partir de --primary
     et --surface, elle y etait calculee une fois pour toutes avec les couleurs du theme, et
     restait sombre dans le papier en mode nuit. Au survol (et sur un telephone, un bouton
     touche garde son survol), « Afficher la correction » devenait fond sombre sous un texte
     bleu marine, et le menu des seances de l'apercu illisible. Redeclaree ici, elle se
     calcule avec la palette du papier. */
  --tone-hover:color-mix(in srgb,var(--primary) 9%,var(--surface));
  --on-primary:#fff;
  --theme-soft:#f8fafc;
  --theme-soft-2:#eef2f6;
  --surface-soft:#f8fafc;
  --theme-field:#fff;
  /* Pas de `background` ici : les regles du papier posent deja le leur, et le
     redeclarer a cet endroit ecraserait un gabarit de document qui voudrait le
     sien. On ne fournit que la palette. */
  color:var(--text);
}
