/* ===== Maths en CPGE — feuille de style ===== */
:root {
  --fond: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --texte: #1b2333;
  --texte-2: #4a5568;
  --bord: #dde2ec;
  --accent: #1d4ed8;
  --accent-fonce: #1e3a8a;
  --accent-doux: #e3ebff;
  --ok: #0f7a3d;
  --ok-doux: #e3f6ea;
  --ko: #b42318;
  --ko-doux: #fdeceb;
  --attente: #8a6100;
  --attente-doux: #fff4d6;
  --etoile: #d99a00;
  --mpsi: #1d4ed8; --pcsi: #0e7c86; --ecs: #6d28d9; --ect: #b45309;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(16,24,40,.06), 0 2px 8px rgba(16,24,40,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f141c; --surface: #171e29; --surface-2: #1f2836; --texte: #e6ebf3; --texte-2: #a7b2c3;
    --bord: #2c3747; --accent: #7aa2ff; --accent-fonce: #a9c1ff; --accent-doux: #1c2a4a;
    --ok: #4ad38a; --ok-doux: #12301f; --ko: #ff8a80; --ko-doux: #3a1a18; --attente: #f1c45a; --attente-doux: #33290f;
    --etoile: #f1c45a; --mpsi: #7aa2ff; --pcsi: #45c7cf; --ecs: #b394ff; --ect: #f0a75b;
    --ombre: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: .4em 0 .3em; }
h2 { font-size: 1.35rem; }
.conteneur { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.conteneur { padding-bottom: 48px; min-height: 70vh; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* En-tête */
.entete { background: var(--surface); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 10; }
.entete-int { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte); font-weight: 700; font-size: 1.1rem; margin-right: auto; }
.logo-signe { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 1.2rem; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--texte-2); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--texte); }
.nav a.actif { background: var(--accent-doux); color: var(--accent-fonce); }
.menu-btn { display: none; background: none; border: 1px solid var(--bord); color: var(--texte); border-radius: 8px; font-size: 1.2rem; padding: 4px 10px; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 8px 16px 16px; border-bottom: 1px solid var(--bord); }
  .nav.ouvert { display: flex; }
}

/* Pied */
.pied { border-top: 1px solid var(--bord); background: var(--surface); color: var(--texte-2); font-size: .9rem; padding: 20px 0; }
.pied p { margin: 4px 0; }
.discret { opacity: .8; font-size: .85rem; }

/* Fil d'Ariane */
.fil { font-size: .88rem; color: var(--texte-2); margin-top: 20px; }
.fil a { color: var(--texte-2); }
.fil span { margin: 0 4px; opacity: .6; }

/* Boutons */
.btn { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 9px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: .93rem; border: 1px solid transparent; }
.btn:hover { background: var(--accent-fonce); color: #fff; }
@media (prefers-color-scheme: dark) { .btn { color: #0f141c; } .btn:hover { color: #0f141c; } }
.btn small { font-weight: 400; opacity: .85; font-size: .78rem; }
.btn-corrige { background: var(--ok); }
.btn-corrige:hover { background: var(--ok); filter: brightness(.92); }
.btn-sec { background: transparent; color: var(--accent); border-color: var(--bord); }
.btn-sec:hover { background: var(--surface-2); color: var(--accent); }
.btn-attente { background: var(--attente-doux); color: var(--attente); border-color: transparent; cursor: default; font-weight: 500; }
.btn-attente:hover { background: var(--attente-doux); color: var(--attente); }
.btn-grand { padding: 12px 22px; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* Accueil */
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: .2em; }
.hero p { color: var(--texte-2); font-size: 1.12rem; max-width: 640px; margin: 0 auto 24px; }
.titre-section { margin-top: 8px; }
.grille-filieres { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.carte-filiere { background: var(--surface); border: 1px solid var(--bord); border-top: 4px solid var(--c, var(--accent)); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); }
.carte-filiere h2 { margin: 0 0 4px; color: var(--c); }
.carte-filiere p { color: var(--texte-2); margin: 0 0 14px; font-size: .93rem; }
.filiere-mpsi { --c: var(--mpsi); } .filiere-pcsi { --c: var(--pcsi); } .filiere-ecs { --c: var(--ecs); } .filiere-ect { --c: var(--ect); }
.annees { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.annee { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); text-decoration: none; color: var(--texte); border: 1px solid transparent; }
.annee:hover { border-color: var(--c); }
.annee span { font-size: .8rem; color: var(--texte-2); }
.vide-annee { opacity: .75; }
.encart { margin-top: 32px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 6px 20px 14px; }
.annonces { padding-left: 18px; }
.annonces .date { display: inline-block; min-width: 150px; font-weight: 600; color: var(--attente); }

/* Page d'une classe */
.filiere-tete { border-left: 5px solid var(--c); padding: 4px 0 4px 16px; margin: 12px 0 24px; }
.filiere-tete h1 small { font-size: .55em; color: var(--texte-2); font-weight: 400; }
.filiere-tete p { margin: 0 0 12px; color: var(--texte-2); }
.onglets { display: flex; gap: 8px; flex-wrap: wrap; }
.onglet { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--bord); text-decoration: none; color: var(--texte); font-weight: 600; font-size: .92rem; }
.onglet small { font-weight: 400; color: var(--texte-2); }
.onglet.actif { background: var(--c); border-color: var(--c); color: #fff; }
.onglet.actif small { color: #fff; opacity: .85; }
@media (prefers-color-scheme: dark) { .onglet.actif, .onglet.actif small { color: #0f141c; } }
.grille-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.tuile { position: relative; display: block; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 20px; text-decoration: none; color: var(--texte); box-shadow: var(--ombre); transition: transform .12s, border-color .12s; }
.tuile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tuile h3 { margin: 0 0 6px; color: var(--accent-fonce); }
.tuile p { margin: 0 0 18px; color: var(--texte-2); font-size: .93rem; }
.tuile-nb { font-size: .82rem; font-weight: 700; color: var(--accent); background: var(--accent-doux); padding: 3px 10px; border-radius: 999px; }
.bientot { background: var(--surface); border: 1px dashed var(--bord); border-radius: var(--rayon); padding: 24px; text-align: center; color: var(--texte-2); }
.bientot ul { display: inline-block; text-align: left; }

/* Devoirs */
.chapo { color: var(--texte-2); max-width: 820px; }
.etoiles { color: var(--etoile); letter-spacing: 1px; white-space: nowrap; }
.etoiles .eteinte { color: var(--bord); }
.barre-outils { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 18px 0 10px; }
.recherche { flex: 1 1 260px; }
.recherche input { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); font-size: 1rem; }
.recherche input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.filtre-niveau { display: flex; gap: 6px; }
.puce { border: 1px solid var(--bord); background: var(--surface); color: var(--texte); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .9rem; }
.puce.active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .puce.active { color: #0f141c; } }
.compteur { font-size: .88rem; color: var(--texte-2); }
.sommaire { margin: 6px 0 12px; }
.sommaire summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.sommaire div { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; padding: 10px 0; font-size: .92rem; }
.chapitre { margin-top: 28px; scroll-margin-top: 80px; }
.chapitre h2 { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--bord); padding-bottom: 8px; }
.ch-num { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 8px; background: var(--accent-doux); color: var(--accent-fonce); font: 700 .95rem system-ui, sans-serif; }
.grille-devoirs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.devoir { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); }
.devoir-tete { display: flex; justify-content: space-between; align-items: center; }
.numero { font-weight: 700; font-size: .85rem; color: var(--texte-2); }
.devoir-titre { margin: 6px 0 6px; font-size: 1.08rem; }
.objectif { color: var(--texte-2); font-size: .9rem; margin: 0 0 14px; }
.vide { color: var(--texte-2); font-style: italic; }

/* Documents */
.grille-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.carte-doc { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); }
.carte-doc h3 { margin: 0 0 6px; }
.carte-doc p { color: var(--texte-2); margin: 0 0 14px; font-size: .93rem; }

/* Quiz */
.grille-quiz { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 16px; }
.carte-quiz { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); text-decoration: none; color: var(--texte); }
.carte-quiz:hover { border-color: var(--accent); }
.q-num { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 8px; background: var(--accent-doux); color: var(--accent-fonce); font-weight: 700; }
.q-titre { flex: 1; font-weight: 600; }
.q-score { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.q-score.fait { background: var(--ok-doux); color: var(--ok); }
#quiz { max-width: 820px; }
.question { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; margin: 16px 0; }
.question h2 { font-size: 1.05rem; margin: 0 0 12px; font-family: inherit; }
.question h2 .qn { color: var(--accent); margin-right: 6px; }
.choix { display: grid; gap: 8px; }
.choix button { text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--bord); background: var(--surface-2); color: var(--texte); font-size: 1rem; cursor: pointer; font-family: inherit; }
.choix button:hover:not(:disabled) { border-color: var(--accent); }
.choix button:disabled { cursor: default; }
.choix button.juste { background: var(--ok-doux); border-color: var(--ok); color: var(--texte); }
.choix button.faux { background: var(--ko-doux); border-color: var(--ko); color: var(--texte); }
.explication { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: .95rem; }
.explication strong.ok { color: var(--ok); } .explication strong.ko { color: var(--ko); }
.bilan { background: var(--accent-doux); border-radius: var(--rayon); padding: 16px 20px; margin-top: 20px; }
.bilan button { margin-top: 8px; cursor: pointer; font-family: inherit; }
.retour { margin-top: 24px; }

/* Texte */
.texte { max-width: 780px; }
.texte li { margin-bottom: 6px; }
.katex { font-size: 1.05em; }
.choix .katex-display, .question .katex-display { margin: .3em 0; }

/* ===== Logo-formule, page d'accueil, page chercheur ===== */
.logo-formule { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .95rem; line-height: 1; white-space: nowrap; }
.logo-formule .katex { font-size: 1em; }
@media (prefers-color-scheme: dark) { .logo-formule { color: #0f141c; } }
.logo-texte { white-space: nowrap; }
@media (max-width: 1240px) { .logo-texte { display: none; } }
.nav a { padding: 8px 10px; }
@media (max-width: 420px) { .logo-formule { font-size: .8rem; padding: 3px 7px; } }
.nav-chercheur { display: inline-flex !important; align-items: center; gap: 6px; border: 1px solid var(--bord); }
.icone { flex: none; vertical-align: -4px; }

.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center; text-align: left; padding: 40px 0 28px; }
.hero h1 { margin-top: 0; }
.hero p { margin-left: 0; }
.hero-lieu { font-weight: 700; color: var(--accent) !important; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem !important; margin-bottom: 4px !important; }
.hero-auteur { font-size: .98rem !important; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn-sec { display: inline-flex; align-items: center; gap: 8px; }
.hero-visuel { margin: 0; background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; padding: 18px; box-shadow: var(--ombre); text-align: center; }
.hero-visuel figcaption { font-size: 1rem; color: var(--texte); overflow-x: auto; }
.hero-visuel .legende { color: var(--texte-2); font-size: .85rem; margin: 4px 0 0 !important; }
.formule-accueil { overflow-x: auto; font-size: 1.15rem; }
.formule-accueil .katex-display { margin: .4em 0; }
.hero-visuel.photo { padding: 0; overflow: hidden; }
.hero-visuel.photo img { display: block; width: 100%; height: auto; aspect-ratio: 720 / 680; max-height: 440px; object-fit: cover; object-position: center 45%; }
.hero-visuel.photo figcaption { padding: 10px; font-weight: 600; }
.illus { width: 100%; max-width: 300px; height: auto; }
.illus .cercle { fill: none; stroke: var(--bord); stroke-width: 2; }
.illus .poly-reg { fill: none; stroke: var(--texte-2); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .7; }
.illus .poly-alea { fill: var(--accent-doux); stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.illus .pt { fill: var(--texte-2); }
.illus .pt-choisi { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero-actions { justify-content: center; } }

.profil { display: flex; gap: 24px; align-items: center; margin: 20px 0 8px; flex-wrap: wrap; }
.profil h1 { margin: 0; }
.portrait { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent-doux); }
.portrait-vide { display: grid; place-items: center; background: var(--accent); color: #fff; font: 700 2.6rem Georgia, serif; }
@media (prefers-color-scheme: dark) { .portrait-vide { color: #0f141c; } }
.profil-titre { font-weight: 600; margin: 4px 0; }
.profil-fonction { color: var(--texte-2); margin: 0 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 999px; padding: 2px 10px; font-size: .85rem; }
.liste-pubs { list-style: none; padding: 0; margin: 0; }
.pub { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px 16px; margin-bottom: 10px; }
.pub-annee { font-weight: 700; color: var(--accent); min-width: 44px; }
.pub-corps p { margin: 0 0 4px; }
.pub-titre { font-weight: 600; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.05rem; }
.pub-auteurs { color: var(--texte-2); }
.pub-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .9rem; }
.pub-note { font-size: .85rem; color: var(--texte-2); font-style: italic; }
.statut { font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--attente-doux); color: var(--attente); }
.statut-publié, .statut-accepté { background: var(--ok-doux); color: var(--ok); }

/* ===== Espace étudiants ===== */
.nav-compte, .nav-admin { display: inline-flex; align-items: center; gap: 6px; }
.nav-compte { border: 1px solid var(--bord); border-radius: 10px; }
.nav-admin { color: var(--accent) !important; font-weight: 600; }
.btn .cadenas { align-self: center; margin-right: -2px; }
.btn.en-cours, button.en-cours { opacity: .65; cursor: progress; }
.btn-apercu { background: var(--surface-2); color: var(--texte); border: 1px dashed var(--texte-2); }
.btn-apercu:hover { background: var(--surface-2); color: var(--texte); }
.btn-petit { padding: 5px 10px; font-size: .85rem; }
button.btn { cursor: pointer; font-family: inherit; }
button.btn:disabled { opacity: .5; cursor: not-allowed; }

.espace { max-width: 560px; margin: 0 auto; }
.panneau { background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; padding: 22px 24px 18px; box-shadow: var(--ombre); }
.panneau h1 { margin-top: 0; }
.chargement { color: var(--texte-2); }
.formulaire { display: grid; gap: 14px; margin: 18px 0 8px; }
.formulaire label { display: grid; gap: 5px; font-weight: 600; font-size: .93rem; }
.formulaire label small { font-weight: 400; color: var(--texte-2); }
.formulaire input, .formulaire select, .barre-outils select, .date-doc input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--bord);
  background: var(--fond); color: var(--texte); font: inherit; font-weight: 400;
}
.formulaire input:focus, .formulaire select:focus, .barre-outils select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.formulaire .btn { justify-content: center; }
.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .deux-col { grid-template-columns: 1fr; } .panneau { padding: 18px 16px 14px; } }
.message { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: .93rem; background: var(--ko-doux); color: var(--ko); }
.message-ok { background: var(--ok-doux); color: var(--ok); }
.bascule { margin: 8px 0 0; font-size: .93rem; }
.fiche-compte { background: var(--surface-2); border-radius: 12px; padding: 12px 16px; margin: 14px 0 18px; }
.fiche-compte p { margin: 4px 0; }
.compte-nom { font-weight: 700; font-size: 1.1rem; }
.compte-detail { color: var(--texte-2); }
.compte-statut { font-weight: 600; }
.statut-ok { color: var(--ok); } .statut-attente { color: var(--attente); } .statut-ko { color: var(--ko); }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; max-width: min(92vw, 520px);
  background: var(--texte); color: var(--fond); padding: 11px 18px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: .95rem; }
.toast-ok { background: var(--ok); color: #fff; } .toast-ko { background: var(--ko); color: #fff; }
@media (prefers-color-scheme: dark) { .toast-ok, .toast-ko { color: #0f141c; } }

/* Administration */
.onglets-admin { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--bord); margin: 8px 0 18px; }
.onglet-admin { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--texte-2); cursor: pointer; }
.onglet-admin.actif { color: var(--accent); border-bottom-color: var(--accent); }
.pastille { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--ko); color: #fff; font-size: .78rem; text-align: center; }
.barre-outils select { width: auto; padding: 9px 10px; }
.actions-groupees { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 16px; }
.table-defile { overflow-x: auto; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.table-admin { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table-admin th, .table-admin td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.table-admin th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texte-2); }
.table-admin tr:last-child td { border-bottom: 0; }
.table-admin small { color: var(--texte-2); }
.ligne-attente { background: var(--attente-doux); }
.etiquette { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.etiquette-ok { background: var(--ok-doux); color: var(--ok); }
.etiquette-attente { background: var(--attente-doux); color: var(--attente); }
.etiquette-prof { background: var(--accent-doux); color: var(--accent); }
.etiquette-cat { background: var(--surface-2); color: var(--texte-2); margin-right: 4px; }
.cat-corrige { background: var(--ok-doux); color: var(--ok); }
.groupe-docs { font-size: 1rem; margin: 22px 0 8px; color: var(--texte-2); }
.liste-docs { border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.ligne-doc { display: grid; grid-template-columns: 1fr auto auto 120px; gap: 14px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--bord); font-size: .93rem; }
.ligne-doc:last-child { border-bottom: 0; }
.etat-doc { font-size: .85rem; font-weight: 600; text-align: right; }
.etat-publie .etat-doc { color: var(--ok); } .etat-programme .etat-doc { color: var(--attente); } .etat-masque .etat-doc { color: var(--texte-2); }
.date-doc { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--texte-2); white-space: nowrap; }
.date-doc input { width: auto; padding: 5px 8px; }
.date-doc input:disabled { opacity: .45; }
@media (max-width: 760px) {
  .ligne-doc { grid-template-columns: 1fr auto; }
  .doc-info { grid-column: 1 / -1; }
  .etat-doc { text-align: left; }
}
.interrupteur { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .88rem; user-select: none; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.glissiere { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--bord); transition: background .15s; flex: none; }
.glissiere::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.interrupteur input:checked + .glissiere { background: var(--ok); }
.interrupteur input:checked + .glissiere::after { transform: translateX(16px); }
.interrupteur input:focus-visible + .glissiere { outline: 2px solid var(--accent); outline-offset: 2px; }
.liste-categories { display: grid; gap: 10px; max-width: 760px; }
.ligne-categorie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 16px; }
.choix-acces { display: flex; flex-wrap: wrap; gap: 14px; font-size: .93rem; }
.choix-acces label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
/* en-tête plus chargé avec l'espace étudiants : menu repliable plus tôt */
@media (max-width: 1400px) { .entete-membres .logo-texte { display: none; } }
@media (max-width: 1100px) {
  .entete-membres .menu-btn { display: block; }
  .entete-membres .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 8px 16px 16px; border-bottom: 1px solid var(--bord); }
  .entete-membres .nav.ouvert { display: flex; }
  .entete-membres .nav-compte { align-self: flex-start; }
}
.onglets-admin { flex-wrap: nowrap; overflow-x: auto; }
.onglet-admin { white-space: nowrap; }
.barre-outils select { flex: 1 1 150px; }
@media (max-width: 640px) {
  .table-admin .col-date { display: none; }
  .table-admin th, .table-admin td { padding: 8px 8px; }
  .actions-groupees .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 640px) {
  .table-admin thead { display: none; }
  .table-admin tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--bord); align-items: center; }
  .table-admin tr:last-child { border-bottom: 0; }
  .table-admin td { border: 0; padding: 0 !important; }
  .table-admin td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  .table-admin td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .table-admin td:nth-child(3) { grid-column: 2; grid-row: 2; font-size: .85rem; color: var(--texte-2); }
  .table-admin td:nth-child(5) { grid-column: 3; grid-row: 1; text-align: right; }
  .table-admin td:nth-child(6) { grid-column: 3; grid-row: 2; text-align: right; }
}

/* ===== Langues ===== */
.nav-langue { display: inline-flex; align-items: center; gap: 5px; font-weight: 600 !important; }
.note-langue { background: var(--accent-doux); color: var(--accent-fonce); border-radius: 10px; padding: 9px 14px; font-size: .93rem; max-width: 820px; }
.encart-cpge { margin-top: 0; margin-bottom: 8px; }
.bandeau-langue { background: var(--accent-doux); color: var(--accent-fonce); border-bottom: 1px solid var(--bord); font-size: .93rem; }
.bandeau-langue .conteneur { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.bandeau-langue span { flex: 1 1 auto; }
.bandeau-fermer { background: none; border: 0; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; }

/* ===== Accueil : présentation de l'auteur, formule sur la photo ; page des cours ===== */
.hero-auteur-bloc { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.hero-auteur-bloc .hero-auteur { margin: 0; }
.hero-portrait { flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: hidden; border: 3px solid var(--surface); box-shadow: var(--ombre); display: grid; place-items: center; text-decoration: none; }
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-portrait-vide { background: var(--accent); color: #fff; font: 700 1.9rem Georgia, serif; }
@media (prefers-color-scheme: dark) { .hero-portrait-vide { color: #0f141c; } }
@media (max-width: 760px) { .hero-auteur-bloc { flex-direction: column; text-align: center; } }
.photo-cadre { position: relative; }
.formule-photo { position: absolute; left: 10px; bottom: 10px; padding: 3px 9px; border-radius: 8px; font-size: .82rem; line-height: 1;
  background: rgba(255,255,255,.82); color: #1b2333; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.formule-photo .katex { font-size: 1em; }
.liste-cours { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin-top: 18px; }
.carte-cours { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 14px; box-shadow: var(--ombre); }
.carte-cours h3 { font-size: 1rem; margin: 0; }
.carte-cours p { margin: 2px 0 0; color: var(--texte-2); font-size: .85rem; }
.carte-cours .actions { margin: 0; }
@media (max-width: 420px) { .liste-cours { grid-template-columns: 1fr; } .carte-cours { grid-template-columns: auto 1fr; } .carte-cours .actions { grid-column: 1 / -1; } }
.liste-cours { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); }
.carte-cours .btn { white-space: nowrap; }
@media (max-width: 520px) { .liste-cours { grid-template-columns: 1fr; } }

/* ===== Rubriques des classes, TIPE, page Recherche ===== */
.tuile-vide { opacity: .62; cursor: default; box-shadow: none; border-style: dashed; }
.tuile-vide:hover { transform: none; }
.tuile-vide .tuile-nb { background: var(--surface-2); color: var(--texte-2); }
.sous-menu { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.sous-menu a { padding: 7px 14px; border-radius: 20px; background: var(--accent-doux); color: var(--accent-fonce); text-decoration: none; font-weight: 600; font-size: .93rem; }
.sous-menu a:hover { background: var(--accent); color: #fff; }
.tipe-theme { font: 700 1.35rem Georgia, serif; color: var(--accent); margin: 6px 0 10px; }
.serie-date { font-size: .85rem; color: var(--texte-2); }
.titre-groupe-pubs { font-size: 1.08rem; margin: 22px 0 10px; color: var(--accent-fonce); }
.serie-pages { margin: 0 0 6px; color: var(--texte-2); font-size: .85rem; }
