/* ============================================================
   DCG & DSCG — Feuille de style principale
   Direction « Moderne épuré » — indigo + teal
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Couleurs principales */
  --indigo: #4f46e5;
  --indigo-dark: #3730a3;
  --indigo-700: #4338ca;
  --indigo-50: #eef2ff;
  --teal: #0d9488;
  --teal-50: #e7f6f1;
  --amber: #f59e0b;
  --amber-50: #fff5e6;

  /* Neutres */
  --ink: #141a33;        /* titres */
  --texte: #2b3350;      /* corps */
  --texte-doux: #5b6781; /* secondaire */
  --line: #e8eaf6;       /* bordures */
  --line-fort: #d8dbf0;
  --fond: #f6f7fc;
  --blanc: #ffffff;

  /* Alias rétro-compatibles (anciennes variables) */
  --bleu-nuit: var(--ink);
  --bleu: var(--indigo);
  --bleu-clair: var(--indigo);
  --bleu-pale: var(--indigo-50);
  --or: var(--amber);
  --or-pale: var(--amber-50);
  --vert: var(--teal);
  --vert-pale: var(--teal-50);
  --gris-900: #1a2230;
  --gris-700: #44506b;
  --gris-500: #7a849b;
  --gris-300: var(--line);
  --gris-100: #f1f2f9;

  /* Typographie */
  --font-titre: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-corps: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Divers */
  --radius: 18px;
  --radius-sm: 12px;
  --ombre: 0 4px 14px rgba(20, 26, 51, 0.05), 0 2px 6px rgba(20, 26, 51, 0.04);
  --ombre-forte: 0 16px 40px rgba(20, 26, 51, 0.12);
  --max: 1140px;
  --transition: 0.2s ease;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-corps);
  color: var(--texte);
  background: var(--fond);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-titre);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }

/* Texte justifié pour le confort de lecture (avec césure) */
.section p, .faq-a p, .ue-cols li, .axes-list li {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.section-head p { text-align: center; }      /* chapôs centrés conservés */
.section-head.left p { text-align: left; }   /* sauf ceux alignés à gauche */
.cta-band p { text-align: center; }          /* bannières d'appel à l'action */

a { color: var(--indigo); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--indigo-dark); text-decoration: underline; }

img { max-width: 100%; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.section { padding: 76px 0; }

/* Décalage des ancres pour ne pas passer sous l'en-tête fixe */
section.section, .card[id], [id^="dcg-ue"], [id^="dscg-ue"], .ue-acc[id] { scroll-margin-top: 96px; }
.section--gris { background: var(--gris-100); }
.section--bleu { background: var(--indigo-50); }

.text-center { text-align: center; }
.lead { font-size: 1.2rem; color: var(--texte-doux); }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.78rem; font-weight: 700; color: var(--indigo);
  margin-bottom: 0.6em;
}
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 13px 26px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 1rem; cursor: pointer;
  border: 1.5px solid transparent; transition: all var(--transition);
  text-decoration: none; font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--indigo); color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,0.26); }
.btn--primary:hover { background: var(--indigo-dark); color: #fff; box-shadow: 0 10px 26px rgba(79,70,229,0.34); }
.btn--ghost { background: #fff; color: var(--indigo); border-color: var(--line-fort); }
.btn--ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn--or { background: var(--amber); color: #3a2606; }
.btn--or:hover { background: #e08c06; color: #3a2606; }

/* ---------- En-tête / Navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-titre); font-weight: 800; font-size: 1.02rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #1e3a8a 0%, #06b6d4 130%);
  color: #fff; display: grid; place-items: center;
  font-size: 1.25rem; font-weight: 800; letter-spacing: 0.01em;
}
.brand small { display: block; font-weight: 500; font-size: 0.7rem; color: var(--gris-500); letter-spacing: 0.02em; }

.nav-links { display: flex; align-items: center; flex-wrap: nowrap; gap: 1px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 9px; border-radius: 10px; white-space: nowrap;
  color: var(--gris-700); font-weight: 600; font-size: 0.86rem; text-decoration: none;
}
.nav-links a:hover { background: var(--gris-100); color: var(--indigo); }
.nav-links a.active { color: var(--indigo); background: var(--indigo-50); }
.nav-links .btn { padding: 9px 18px; margin-left: 8px; }
.nav-links a.btn--primary { color: #fff; }
.nav-links a.btn--primary:hover { color: #fff; background: var(--indigo-dark); }

/* Sous-menu déroulant (Programmes → DCG / DSCG) */
.nav-links .has-sub { position: relative; }
.nav-links .has-sub > a::after { content: " ▾"; font-size: 0.6em; opacity: 0.6; }
.nav-links .submenu {
  position: absolute; top: 100%; left: 0; min-width: 210px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--ombre-forte); padding: 6px; margin: 6px 0 0; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 110;
}
.nav-links .has-sub:hover .submenu,
.nav-links .has-sub:focus-within .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-links .submenu li { margin: 0; }
.nav-links .submenu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--gris-700); font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.nav-links .submenu a:hover { background: var(--gris-100); color: var(--indigo); }

/* Recherche de navigation (à droite du bandeau) */
.site-search { position: relative; display: flex; align-items: center; margin-left: 8px; }
.search-input {
  background: transparent; border: 1px solid var(--line-fort); border-radius: 999px;
  padding: 7px 14px; font-size: 0.84rem; font-family: inherit; color: var(--ink);
  width: 140px; transition: width var(--transition), background var(--transition), border-color var(--transition);
}
.search-input::placeholder { color: var(--gris-500); }
.search-input:focus { outline: none; border-color: var(--indigo); background: #fff; }
.search-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-width: 84vw;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--ombre-forte); padding: 8px; z-index: 200; display: none;
}
.search-panel.open { display: block; }
.search-results { list-style: none; margin: 8px 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
.search-results li a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.search-results li a:hover, .search-results li a.active { background: var(--indigo-50); color: var(--indigo); text-decoration: none; }
.search-empty { padding: 10px; color: var(--texte-doux); font-size: 0.9rem; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.sub-toggle { display: none; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: var(--transition); }

/* ---------- Hero (clair) ---------- */
.hero {
  background: linear-gradient(135deg, var(--indigo-50) 0%, var(--teal-50) 100%);
  color: var(--texte); padding: 96px 0 100px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -140px; top: -100px;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(13,148,136,0.16), transparent 70%);
  border-radius: 50%;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--ink); font-size: 3rem; max-width: 17ch; }
.hero h1 .hl { color: var(--indigo); }
.hero p { color: var(--texte-doux); font-size: 1.22rem; max-width: 54ch; }
.hero .badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.hero .pill {
  background: #fff; border: 1px solid var(--line-fort);
  color: var(--indigo); padding: 6px 14px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; box-shadow: var(--ombre);
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- Grilles & cartes ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--ombre);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--ombre-forte); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .ico {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--indigo-50); color: var(--indigo);
  display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 16px;
}
/* Variation de couleur des icônes pour le rythme visuel */
.grid .card:nth-child(3n+2) .ico { background: var(--teal-50); color: var(--teal); }
.grid .card:nth-child(3n+3) .ico { background: var(--amber-50); color: var(--amber); }

.card--link { display: block; text-decoration: none; color: inherit; }
.card--link:hover { text-decoration: none; color: inherit; }
.card .more { color: var(--indigo); font-weight: 700; font-size: 0.95rem; margin-top: 14px; display: inline-block; }

/* Badges diplôme */
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.03em; padding: 4px 11px; border-radius: 999px; text-transform: uppercase;
}
.tag--dcg { background: var(--indigo-50); color: var(--indigo-dark); }
.tag--dscg { background: var(--teal-50); color: #0a6b60; }
.tag--soon { background: var(--gris-100); color: var(--gris-500); }
.tag--new { background: var(--amber-50); color: #9a6206; }

/* ---------- Étapes ---------- */
.steps { display: grid; gap: 18px; }
.step {
  display: flex; gap: 20px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--ombre);
}
.step .num {
  flex: none; width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--indigo), var(--teal));
  color: #fff; display: grid; place-items: center; font-size: 1.25rem; font-weight: 800;
}
.step h3 { margin: 4px 0 6px; }
.step p:last-child { margin-bottom: 0; }

/* ---------- Tableau programmes ---------- */
.ue-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--ombre); font-size: 0.85rem; }
/* Mots entiers + retour à la ligne entre les mots (pas de coupure ni de débordement) */
.ue-table th, .ue-table td { overflow-wrap: break-word; word-break: normal; hyphens: none; }
.ue-table th, .ue-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.ue-table th { background: var(--ink); color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.ue-table tr:last-child td { border-bottom: none; }
.ue-table tbody tr:hover { background: var(--indigo-50); }
.ue-table .ue-code { font-weight: 800; color: var(--indigo); white-space: nowrap; }
.ue-table .coef { text-align: center; white-space: nowrap; }

/* Onglets */
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 32px; flex-wrap: wrap; }
.tab-btn {
  padding: 11px 26px; border-radius: 999px; border: 1.5px solid var(--line-fort);
  background: #fff; font-weight: 700; cursor: pointer; font-size: 1rem;
  color: var(--gris-700); transition: var(--transition); font-family: inherit;
}
.tab-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.tab-btn.active { background: var(--indigo); border-color: var(--indigo); color: #fff; box-shadow: 0 8px 18px rgba(79,70,229,0.25); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade 0.3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Veille ---------- */
.veille-item {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 30px; box-shadow: var(--ombre);
  margin-bottom: 22px; border-left: 4px solid var(--teal); border-radius: 0 var(--radius) var(--radius) 0;
}
.veille-item .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.veille-item .date { font-size: 0.85rem; color: var(--gris-500); font-weight: 700; }
.veille-item h3 { margin: 0 0 8px; }
.veille-item ul { margin: 12px 0 0; padding-left: 20px; }
.veille-item li { margin-bottom: 6px; }

/* ---------- Encadrés ---------- */
.note {
  background: var(--indigo-50); border-left: 4px solid var(--indigo);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 18px 22px; margin: 24px 0;
}
.note--or { background: var(--amber-50); border-left-color: var(--amber); }
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--ink); }

/* Liste à puces */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding-left: 32px; margin-bottom: 12px; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal-50); color: var(--teal);
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 800;
}

/* ---------- Bannière CTA ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--indigo-700) 0%, var(--indigo-dark) 60%, var(--teal) 160%);
  color: #fff; border-radius: var(--radius); padding: 52px 44px; text-align: center;
  position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.86); max-width: 56ch; margin: 0 auto 24px; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.72); padding: 60px 0 28px; font-size: 0.95rem; }
.site-footer h4 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; font-weight: 700; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 36px; margin-bottom: 36px; }
.site-footer a { color: rgba(255,255,255,0.72); }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.14); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: rgba(255,255,255,0.5); }

/* ---------- En-tête de page interne (bandeau coloré) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--indigo-50) 0%, var(--teal-50) 100%); color: var(--texte);
  padding: 68px 0 60px; position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(13,148,136,0.16), transparent 70%); border-radius: 50%;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: var(--ink); }
.page-hero p { color: var(--texte-doux); max-width: 60ch; margin-bottom: 0; }
.breadcrumb { font-size: 0.85rem; color: var(--texte-doux); margin-bottom: 16px; }
.breadcrumb a { color: var(--indigo); }

/* Coming soon / Phase 2 */
.soon-card { background: #fff; border: 1.5px dashed var(--line-fort); border-radius: var(--radius); padding: 30px; position: relative; overflow: hidden; }
.soon-card .tag--soon { position: absolute; top: 18px; right: 18px; }
.soon-card.locked { opacity: 0.94; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { text-align: center; padding: 20px; }
.stat .big { font-family: var(--font-titre); font-size: 2.8rem; font-weight: 800; color: var(--indigo); line-height: 1; letter-spacing: -0.03em; }
.stat .lbl { color: var(--texte-doux); font-size: 0.92rem; margin-top: 6px; }

/* ---------- FAQ ---------- */
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.faq-q { width: 100%; text-align: left; background: none; border: none; padding: 18px 22px; font-size: 1.05rem; font-weight: 700; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; gap: 16px; align-items: center; font-family: inherit; }
.faq-q:hover { background: var(--gris-100); }
.faq-q .chev { transition: transform var(--transition); flex: none; color: var(--indigo); }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { padding: 0 22px; max-height: 0; overflow: hidden; transition: max-height var(--transition), padding var(--transition); }
.faq-item.open .faq-a { padding: 0 22px 20px; max-height: 400px; }

/* ---------- Barre latérale dynamique ---------- */
.side-toggle {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 120;
  background: var(--indigo); color: #fff; border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 14px 10px; cursor: pointer;
  box-shadow: var(--ombre-forte); display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; writing-mode: vertical-rl;
  transition: background var(--transition);
}
.side-toggle:hover { background: var(--indigo-dark); }
.side-toggle .bars { writing-mode: horizontal-tb; font-size: 1.1rem; line-height: 1; }

.side-overlay { position: fixed; inset: 0; background: rgba(20, 26, 51, 0.45); z-index: 130; opacity: 0; visibility: hidden; transition: opacity var(--transition), visibility var(--transition); }
.side-overlay.open { opacity: 1; visibility: visible; }

.side-rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 84vw;
  background: #fff; z-index: 140; box-shadow: var(--ombre-forte);
  transform: translateX(-100%); transition: transform 0.28s ease;
  display: flex; flex-direction: column; overflow-y: auto;
}
.side-rail.open { transform: translateX(0); }
.side-rail .side-head { background: linear-gradient(135deg, var(--indigo-700), var(--indigo)); color: #fff; padding: 22px 22px 20px; }
.side-rail .side-head .brand, .side-rail .side-head .brand span { color: #fff; }
.side-rail .side-close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,0.18); border: none; color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.side-rail .side-close:hover { background: rgba(255,255,255,0.3); }
.side-home { display: flex; align-items: center; gap: 10px; margin: 14px 22px 0; padding: 12px 16px; background: var(--amber); color: #3a2606; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; }
.side-home:hover { background: #e08c06; color: #3a2606; text-decoration: none; }
.side-sec-title { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; font-weight: 800; color: var(--gris-500); margin: 24px 22px 8px; }
.side-nav { list-style: none; margin: 0; padding: 0 12px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--gris-700); text-decoration: none; font-weight: 600; }
.side-nav a:hover { background: var(--gris-100); color: var(--indigo); text-decoration: none; }
.side-nav a.current { background: var(--indigo-50); color: var(--indigo); }
.side-nav a .dot { color: var(--line-fort); }
.side-nav a.current .dot { color: var(--indigo); }
.side-toc { list-style: none; margin: 0 0 22px; padding: 0 12px; }
.side-toc a { display: block; padding: 7px 12px 7px 18px; border-left: 2px solid var(--line-fort); color: var(--texte-doux); text-decoration: none; font-size: 0.92rem; margin-left: 8px; }
.side-toc a:hover { color: var(--indigo); border-left-color: var(--indigo); text-decoration: none; }
.side-toc a.spy-active { color: var(--indigo); border-left-color: var(--indigo); font-weight: 700; background: var(--indigo-50); border-radius: 0 6px 6px 0; }

@media (max-width: 600px) { .side-toggle { padding: 12px 8px; } }
@media print { .side-toggle, .side-rail, .side-overlay { display: none !important; } }

/* ---------- Volet « Sur cette page » à droite (survol) ---------- */
.toc-rail {
  position: fixed; right: 0; top: 50%;
  transform: translateY(-50%) translateX(calc(100% - 38px));
  transition: transform 0.28s ease; z-index: 95;
  display: flex; align-items: stretch; max-width: 86vw;
}
.toc-rail:hover, .toc-rail:focus-within { transform: translateY(-50%) translateX(0); }
.toc-handle {
  width: 38px; flex: none; background: var(--indigo); color: #fff;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--ombre-forte); cursor: pointer;
}
.toc-handle span {
  writing-mode: vertical-rl; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 16px 0;
}
.toc-body {
  width: 250px; background: #fff; border-left: 1px solid var(--line);
  box-shadow: var(--ombre-forte); padding: 16px 8px 16px 12px;
  max-height: 72vh; overflow-y: auto;
}
.toc-title {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem;
  font-weight: 800; color: var(--gris-500); margin: 0 8px 8px;
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list a {
  display: block; padding: 7px 12px 7px 14px;
  border-left: 2px solid var(--line-fort); color: var(--texte-doux);
  text-decoration: none; font-size: 0.9rem;
}
.toc-list a:hover { color: var(--indigo); border-left-color: var(--indigo); text-decoration: none; }
.toc-list a.spy-active { color: var(--indigo); border-left-color: var(--indigo); font-weight: 700; background: var(--indigo-50); border-radius: 0 6px 6px 0; }
.toc-list a.toc-sub { padding-left: 28px; font-size: 0.83rem; color: var(--gris-500); }
.toc-list a.toc-sub:hover, .toc-list a.toc-sub.spy-active { color: var(--indigo); }
@media (max-width: 900px) { .toc-rail { display: none; } }
@media print { .toc-rail { display: none !important; } }

/* ---------- Accordéon détaillé par sous-partie (3 colonnes) ---------- */
.ue-partie-title { margin: 30px 0 12px; font-size: 1.25rem; color: var(--ink); }
.ue-acc { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; background: #fff; overflow: hidden; box-shadow: var(--ombre); }
.ue-acc summary { cursor: pointer; padding: 15px 18px; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.ue-acc summary::-webkit-details-marker { display: none; }
.ue-acc summary::after { content: "▾"; color: var(--indigo); transition: transform 0.2s ease; flex: none; }
.ue-acc[open] summary::after { transform: rotate(180deg); }
.ue-acc summary:hover { background: var(--gris-100); }
.ue-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 8px 18px 20px; border-top: 1px solid var(--line); }
.ue-cols .col h4 { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 10px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.ue-cols .col-c h4 { color: var(--indigo); border-color: var(--indigo-50); }
.ue-cols .col-s h4 { color: var(--teal); border-color: var(--teal-50); }
.ue-cols .col-l h4 { color: var(--amber); border-color: var(--amber-50); }
.ue-cols ul { margin: 0; padding-left: 18px; font-size: 0.92rem; line-height: 1.55; }
.ue-cols li { margin-bottom: 6px; }
.ue-cols .empty { color: var(--gris-500); font-size: 0.9rem; font-style: italic; }
@media (max-width: 760px) { .ue-cols { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Tableau défilant à en-tête figé (bloc collant sous le bandeau) ---------- */
.ecoles-sticky { padding: 4px 0; }
.table-scroll {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ombre);
}
/* En-tête réellement fixe : le tbody défile, le thead reste au-dessus (compatible Safari) */
#ecoles-table { display: block; width: 100%; box-shadow: none; border-radius: 0; }
#ecoles-table thead { display: block; }
#ecoles-table tbody { display: block; max-height: calc(100vh - 240px); overflow-y: auto; }
#ecoles-table thead tr, #ecoles-table tbody tr { display: table; width: 100%; table-layout: fixed; }
#ecoles-table th, #ecoles-table td { overflow-wrap: break-word; word-break: normal; }
#ecoles-table th:nth-child(1), #ecoles-table td:nth-child(1) { width: 18%; }
#ecoles-table th:nth-child(2), #ecoles-table td:nth-child(2) { width: 11%; }
#ecoles-table th:nth-child(3), #ecoles-table td:nth-child(3) { width: 12%; }
#ecoles-table th:nth-child(4), #ecoles-table td:nth-child(4) { width: 13%; }
#ecoles-table th:nth-child(5), #ecoles-table td:nth-child(5) { width: 14%; }
#ecoles-table th:nth-child(6), #ecoles-table td:nth-child(6) { width: 18%; }
#ecoles-table th:nth-child(7), #ecoles-table td:nth-child(7) { width: 7%; }
#ecoles-table th:nth-child(8), #ecoles-table td:nth-child(8) { width: 7%; }
/* Tri par colonne (tableau des établissements) */
#ecoles-table thead th { cursor: pointer; user-select: none; white-space: nowrap; }
#ecoles-table thead th::after { content: " ↕"; opacity: 0.4; font-size: 0.8em; }
#ecoles-table thead th.sort-asc::after { content: " ▲"; opacity: 1; }
#ecoles-table thead th.sort-desc::after { content: " ▼"; opacity: 1; }

/* ---------- Tableaux dispenses : en-tête figé + tri + filtre ---------- */
.tblx { display: block; width: 100%; box-shadow: none; border-radius: 0; font-size: 0.8rem; }
.tblx thead { display: block; }
.tblx tbody { display: block; max-height: calc(100vh - 260px); overflow-y: auto; }
.tblx thead tr, .tblx tbody tr { display: table; width: 100%; table-layout: fixed; }
.tblx th, .tblx td { overflow-wrap: break-word; word-break: normal; }
.tblx thead th { cursor: pointer; user-select: none; }
.tblx thead th::after { content: " ↕"; opacity: 0.4; font-size: 0.8em; }
.tblx thead th.sort-asc::after { content: " ▲"; opacity: 1; }
.tblx thead th.sort-desc::after { content: " ▼"; opacity: 1; }
/* largeurs de colonnes (les colonnes UE non listées se partagent le reste) */
#disp-acces th:nth-child(1), #disp-acces td:nth-child(1) { width: 30%; }
#disp-acces th:nth-child(2), #disp-acces td:nth-child(2) { width: 14%; }
#disp-acces th:nth-child(3), #disp-acces td:nth-child(3) { width: 56%; }
#disp-dcg th:nth-child(1), #disp-dcg td:nth-child(1) { width: 22%; }
#disp-dcg th:nth-child(2), #disp-dcg td:nth-child(2) { width: 10%; }
#disp-dscg th:nth-child(1), #disp-dscg td:nth-child(1) { width: 22%; }
#disp-dscg th:nth-child(2), #disp-dscg td:nth-child(2) { width: 9%; }
#disp-dscg th:nth-child(3), #disp-dscg td:nth-child(3) { width: 13%; white-space: normal; }
#disp-dscg th:nth-child(11), #disp-dscg td:nth-child(11) { width: 12%; }

/* ---------- Veille normes : badges d'impact + colonnes ---------- */
.imp { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.imp-eleve { background: #fdecec; color: #a32d2d; }
.imp-moyen { background: var(--amber-50); color: #9a6206; }
.imp-faible { background: var(--gris-100); color: var(--gris-500); }
#veille-normes-table th:nth-child(1), #veille-normes-table td:nth-child(1) { width: 11%; white-space: nowrap; }
#veille-normes-table th:nth-child(2), #veille-normes-table td:nth-child(2) { width: 12%; }
#veille-normes-table th:nth-child(3), #veille-normes-table td:nth-child(3) { width: 13%; }
#veille-normes-table th:nth-child(5), #veille-normes-table td:nth-child(5) { width: 12%; }
/* en-têtes toujours sur une seule ligne (police réduite si besoin) */
#veille-normes-table thead th { white-space: nowrap; font-size: 0.74rem; }
/* Veille mensuelle (DCG/DSCG) : même présentation en tableau */
#veille-mensuelle-table th:nth-child(1), #veille-mensuelle-table td:nth-child(1) { width: 12%; white-space: nowrap; }
#veille-mensuelle-table th:nth-child(2), #veille-mensuelle-table td:nth-child(2) { width: 18%; }
#veille-mensuelle-table th:nth-child(4), #veille-mensuelle-table td:nth-child(4) { width: 13%; }
#veille-mensuelle-table thead th { white-space: nowrap; font-size: 0.74rem; }
/* Annales : sujets et corrigés par année */
#annales-table th:nth-child(1), #annales-table td:nth-child(1) { width: 10%; white-space: nowrap; }
#annales-table th:nth-child(2), #annales-table td:nth-child(2) { width: 12%; white-space: nowrap; }
#annales-table th:nth-child(4), #annales-table td:nth-child(4) { width: 19%; }
#annales-table th:nth-child(5), #annales-table td:nth-child(5) { width: 19%; }
#annales-table thead th { white-space: nowrap; font-size: 0.74rem; }

/* ---------- Liste des axes de programme ---------- */
.axes-list { list-style: none; padding: 0; margin: 16px 0 0; }
.axes-list li { display: flex; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 0.96rem; }
.axes-list li:first-child { border-top: none; }
.axes-list .h {
  flex: none; min-width: 92px; font-weight: 700; color: var(--indigo);
  font-size: 0.85rem; background: var(--indigo-50); border-radius: 8px;
  padding: 3px 10px; height: fit-content; text-align: center;
}
.ue-meta { font-size: 0.85rem; font-weight: 600; color: var(--texte-doux); margin: 4px 0 0; }
.ue-meta strong { color: var(--ink); }

/* ---------- Utilitaires ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 24px; }
.mt-3 { margin-top: 36px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 2.1rem; } .hero h1 { font-size: 2.3rem; }
  h2 { font-size: 1.65rem; }
}

/* Le bandeau passe en menu hamburger plus tôt, pour toujours tenir sur une ligne */
@media (max-width: 1260px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 74px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; background: #fff;
    border-bottom: 1px solid var(--line); padding: 12px; gap: 4px;
    box-shadow: var(--ombre); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links .btn { margin: 6px 0 0; justify-content: center; }
  /* Sous-menus en accordéons dépliables (bouton ▾ injecté par main.js) */
  .nav-links .has-sub > a { display: block; padding-right: 52px; }
  .nav-links .has-sub > a::after { content: ""; }
  .nav-links .sub-toggle {
    display: block; position: absolute; top: 0; right: 0;
    width: 48px; height: 44px; background: none; border: none;
    cursor: pointer; color: var(--gris-700); font-size: 0.9rem;
  }
  .nav-links .sub-toggle::before { content: "▾"; display: inline-block; transition: var(--transition); }
  .nav-links .has-sub.sub-open .sub-toggle::before { transform: rotate(180deg); }
  .nav-links .submenu {
    display: none; position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; min-width: 0; background: transparent;
    padding: 0 0 4px 14px;
  }
  .nav-links .has-sub.sub-open .submenu { display: block; }
  .nav-links .submenu a { white-space: normal; }
  /* Recherche : pleine largeur dans le menu, panneau visible sous le champ */
  .site-search { width: 100%; margin: 8px 0 0; }
  .search-input, .search-input:focus { width: 100%; }
  .search-panel { position: static; width: 100%; max-width: none; box-shadow: none; border: none; padding: 6px 0 0; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .section { padding: 54px 0; }
  body { font-size: 16px; }
  .cta-band { padding: 36px 24px; }
}

.brand-sub { font-size: 0.7rem; font-weight: 600; color: var(--texte-doux); letter-spacing: 0.02em; margin-left: 2px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.12; }

#cca-table th:nth-child(2), #cca-table td:nth-child(2) { width: 38%; }
#cca-table thead th { white-space: nowrap; }

.app-placeholder { border: 2px dashed var(--line-fort); border-radius: var(--radius); padding: 48px 24px; text-align: center; color: var(--texte-doux); background: #fff; }
.app-placeholder .ico { font-size: 2.4rem; }
.app-placeholder h3 { margin: 10px 0 6px; color: var(--ink); }

.app-mockup { width: 160px; margin: 0 auto 18px; }
.app-mockup svg { width: 160px; height: auto; display: block; filter: drop-shadow(0 12px 28px rgba(20,26,51,0.18)); }
.appstore-badge { display: inline-flex; align-items: center; gap: 8px; background: #111827; color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; margin-top: 16px; }

.appstore-badge.soon-android { background: transparent; color: var(--texte-doux); border: 1px solid var(--line-fort); }
