/* Koutoubi : identité sobre (vert de l'IPN en accent, jaune pour les nouveautés), une seule police.
   Contrastes (WCAG 2.2) : texte 15:1, vert sur blanc 6,2:1, gris secondaire 6,0:1.
   Échelle : 1rem = 20 px (Material). Aucun texte sous 0.65rem (13 px). */

:root {
  --kt-vert: #00703C;
  --kt-vert-fonce: #00552D;
  --kt-vert-pale: #E6F2EA;
  --kt-or: #FFD200;
  --kt-ambre: #8A5A00;
  --kt-ambre-pale: #FFF4D6;
  --kt-encre: #17201B;
  --kt-gris: #5A645E;
  --kt-ligne: #E1E6E3;
  --kt-papier: #F5F7F6;
  --kt-rayon: 10px;
  --md-primary-fg-color: var(--kt-vert);
  --md-primary-fg-color--light: #2D8A5A;
  --md-primary-fg-color--dark: var(--kt-vert-fonce);
  --md-accent-fg-color: var(--kt-vert-fonce);
  --md-accent-fg-color--transparent: rgba(0, 112, 60, 0.08);
  --md-typeset-a-color: var(--kt-vert);
  --md-default-fg-color: var(--kt-encre);
}

/* --- Focus visible partout (modèle GOV.UK : contour sombre + halo jaune) ---------------- */
.md-typeset a:focus-visible,
.kt-recherche:focus-visible,
.kt-langue:focus-visible,
.md-tabs__link:focus-visible {
  outline: 3px solid var(--kt-encre);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--kt-or);
}

/* --- En-tête : blanc, logo IPN, vert en accent ---------------------------------------- */
.md-header,
.md-tabs { background-color: #fff; color: var(--kt-encre); }
.md-header { box-shadow: 0 1px 0 var(--kt-ligne); }
.md-header--shadow { box-shadow: 0 1px 0 var(--kt-ligne), 0 4px 12px rgba(0, 0, 0, 0.05); }
.md-tabs { border-bottom: 1px solid var(--kt-ligne); }
.md-header__title { font-weight: 700; font-size: 0.95rem; }
.md-header__button.md-logo { padding: 0.2rem; }
.md-header__button.md-logo img { height: 2.4rem; width: 2.4rem; border-radius: 50%; }
[dir=rtl] .md-header__title { margin-right: 0.3rem; }
[dir=ltr] .md-header__title { margin-left: 0.3rem; }
.md-tabs__item { height: 2.6rem; }
.md-tabs__link { margin-top: 0.55rem; font-size: 0.75rem; opacity: 1; color: var(--kt-gris); }
.md-tabs__link:hover { color: var(--kt-vert); }
.md-tabs__item--active { box-shadow: inset 0 -3px 0 var(--kt-vert); }
.md-tabs__item--active .md-tabs__link { color: var(--kt-vert); font-weight: 700; }
.md-search__form { background-color: var(--kt-papier); border: 1px solid var(--kt-ligne); }
.md-search__form:hover { background-color: var(--kt-vert-pale); }
.md-search__input { color: var(--kt-encre); }
.md-search__input::placeholder { color: var(--kt-gris); }
.md-header .md-search__form .md-search__icon,
.md-header .md-search__form .md-search__icon svg { color: var(--kt-gris); fill: var(--kt-gris); }
.kt-langue {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  margin: 0 0.4rem;
  padding: 0 0.7rem;
  border: 1px solid var(--kt-ligne);
  border-radius: 999px;
  color: var(--kt-encre);
  font-size: 0.72rem;
  font-weight: 700;
}
.kt-langue:hover { border-color: var(--kt-vert); color: var(--kt-vert); }
.kt-badge-test { background: var(--kt-encre); color: var(--kt-or); }

/* --- Typographie : hiérarchie nette ---------------------------------------------------- */
.md-typeset { font-size: 0.8rem; }
.md-typeset h1 { margin: 0 0 0.6rem; font-size: 1.6em; font-weight: 700; line-height: 1.3; color: var(--kt-encre); }
.md-typeset h2 { margin: 1.8em 0 0.6em; font-size: 1.2em; font-weight: 700; line-height: 1.4; color: var(--kt-encre); }
.md-typeset h3 { font-size: 1em; font-weight: 700; }
.md-typeset .headerlink { display: none; }
.md-typeset .kt-sous-titre { margin: -0.2rem 0 1.2rem; font-size: 0.8rem; }
.md-typeset .kt-sous-titre a { font-weight: 700; }
.md-typeset .kt-note { margin-top: 1.5rem; font-size: 0.7rem; color: var(--kt-gris); }
.kt-ltr { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
[dir="rtl"] .md-typeset em { font-style: normal; }

/* --- Accueil : texte officiel, recherche, derniers livres ---------------------------- */
/* Bandeau plein vert IPN : l'identité de l'institution, le contenu reste sur fond blanc. Contrastes : blanc 6,2:1,
   texte secondaire #E3F1E8 5,3:1, légendes #CFE6D8 4,7:1. */
.kt-hero { background: var(--kt-vert); color: #fff; }
.kt-hero-grille {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  padding: 2rem 0.8rem;
}
.kt-hero h1 { margin: 0 0 0.7rem; font-size: 1.75rem; font-weight: 700; line-height: 1.35; color: #fff; text-wrap: balance; }
.kt-hero-sous { margin: 0 0 1.2rem; max-width: 36em; font-size: 0.84rem; line-height: 1.75; color: #E3F1E8; }
.kt-recherche {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 30rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 10px 24px -12px rgba(0, 0, 0, 0.45);
  color: var(--kt-gris);
  font: inherit;
  font-size: 0.8rem;
  text-align: start;
  cursor: text;
}
.kt-recherche svg { width: 1.1rem; height: 1.1rem; fill: var(--kt-vert); flex: none; }
.kt-recherche:hover { box-shadow: 0 0 0 3px var(--kt-or), 0 10px 24px -12px rgba(0, 0, 0, 0.45); }
.kt-chiffres { margin: 0.8rem 0 0; font-size: 0.7rem; color: #E3F1E8; }

.kt-etagere { min-width: 0; }
.kt-etagere .kt-etagere-titre { margin: 0 0 0.7rem; font-size: 0.8rem; font-weight: 700; color: var(--kt-encre); }
[dir] .md-typeset .kt-etagere ul,
.kt-etagere ul { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.8rem; margin: 0; padding: 0; list-style: none; }
[dir] .md-typeset .kt-etagere li,
.kt-etagere li { margin: 0; }
.kt-etagere a { display: block; color: inherit; text-decoration: none; }
.kt-etagere img {
  display: block;
  width: 100%;
  aspect-ratio: 0.705;
  height: auto;
  object-fit: cover;
  object-position: top;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 6px 14px -8px rgba(0, 40, 20, 0.45);
}
.kt-etagere a:hover img { outline: 2px solid var(--kt-vert); outline-offset: 2px; }
.kt-etagere-livre {
  display: -webkit-box;
  margin-top: 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kt-etagere-classe { display: block; font-size: 0.65rem; line-height: 1.4; color: var(--kt-gris); }
.kt-etagere a.kt-tout { display: inline-block; margin-top: 0.8rem; font-size: 0.72rem; font-weight: 700; }
.kt-etagere-mobile { display: none; }
.kt-hero .kt-etagere .kt-etagere-titre { color: #fff; }
.kt-hero .kt-etagere-classe { color: #CFE6D8; }
.kt-hero .kt-etagere a:hover img { outline-color: #fff; }
.kt-hero .kt-etagere a.kt-tout { color: #fff; }

.md-typeset .kt-h2 { margin: 1.8rem 0 0.8rem; font-size: 1.05rem; }
.md-typeset .kt-h2:first-child { margin-top: 0.4rem; }
.md-container:has(.kt-hero) .md-main__inner { margin-top: 0.6rem; }
/* Année mémorisée : bouton de reprise. */
.md-typeset .kt-reprendre {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.4rem;
  margin: -0.2rem 0 0.9rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  background: var(--kt-vert-pale);
  color: var(--kt-vert-fonce);
  font-size: 0.76rem;
  text-decoration: none;
}
.md-typeset .kt-reprendre[hidden] { display: none; }
.md-typeset .kt-reprendre span { color: var(--kt-gris); }
.md-typeset .kt-reprendre b { font-weight: 700; }
[dir="rtl"] .md-typeset .kt-reprendre b::after { content: " ←"; }
[dir="ltr"] .md-typeset .kt-reprendre b::after { content: " →"; }
.md-typeset .kt-reprendre:hover { background: var(--kt-vert); color: #fff; }
.md-typeset .kt-reprendre:hover span { color: #E6F2EA; }

/* Texte réservé aux lecteurs d'écran. */
.kt-lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Choisir sa classe ---------------------------------------------------------------- */
.kt-cycles { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) minmax(0, 3fr); gap: 0.8rem; }
.kt-cycle { padding: 0.8rem; border: 1px solid var(--kt-ligne); border-top: 4px solid var(--kt-cycle); border-radius: var(--kt-rayon); background: #fff; }
.md-typeset .kt-cycle h3 { margin: 0 0 0.6rem; font-size: 0.8rem; color: var(--kt-cycle-texte, var(--kt-encre)); }
.kt-fondamental { --kt-cycle: #00703C; --kt-cycle-pale: #E6F2EA; --kt-cycle-texte: #00703C; }
.kt-college { --kt-cycle: #D57D00; --kt-cycle-pale: #FDF1D8; --kt-cycle-texte: #A85600; }
.kt-lycee { --kt-cycle: #0072B2; --kt-cycle-pale: #E2EFF8; --kt-cycle-texte: #005A8C; }
.md-typeset ul.kt-classes {
  display: grid;
  grid-template-columns: repeat(var(--kt-n), minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
[dir] .md-typeset ul.kt-classes > li { margin: 0; }
.md-typeset .kt-classe {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.6rem;
  border-radius: 8px;
  background: var(--kt-cycle-pale, var(--kt-papier));
  color: var(--kt-cycle-texte, var(--kt-encre));
  text-decoration: none;
}
.md-typeset .kt-classe { transition: background-color 0.15s, box-shadow 0.15s; }
.md-typeset .kt-classe:hover,
.md-typeset .kt-classe-moi { background: var(--kt-cycle-texte); color: #fff; }
.md-typeset .kt-classe:hover .kt-nb,
.md-typeset .kt-classe-moi .kt-nb { color: #fff; }
.md-typeset .kt-classe-moi { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--kt-cycle-texte); }
.kt-num { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.kt-nb { margin-top: 0.15rem; font-size: 0.65rem; color: var(--kt-gris); white-space: nowrap; }

/* --- Raccourcis et engagements officiels ---------------------------------------------- */
.md-typeset ul.kt-raccourcis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
[dir] .md-typeset ul.kt-raccourcis > li { margin: 0; }
.md-typeset ul.kt-raccourcis a {
  display: block;
  height: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--kt-ligne);
  border-radius: var(--kt-rayon);
  color: var(--kt-encre);
  text-decoration: none;
}
.md-typeset ul.kt-raccourcis a:hover { border-color: var(--kt-vert); }
.kt-raccourcis strong { display: block; font-size: 0.78rem; color: var(--kt-vert); }
.kt-raccourcis span { display: block; margin-top: 0.15rem; font-size: 0.68rem; line-height: 1.5; color: var(--kt-gris); }

/* --- Page d'une classe ---------------------------------------------------------------- */
/* Titre, puis résumé, puis le sélecteur d'année aligné au début de la ligne (sous le titre, là où l'œil arrive). */
.kt-entete-classe { display: flex; flex-direction: column; align-items: flex-start; gap: 0.8rem; margin: -0.6rem 0 1rem; }
.md-typeset .kt-compte { margin: 0; color: var(--kt-gris); font-size: 0.78rem; }
.kt-soeurs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.kt-soeurs-titre { font-size: 0.8rem; font-weight: 700; color: var(--kt-encre); }
.kt-soeurs-liens { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.md-typeset .kt-soeurs a {
  display: grid;
  place-items: center;
  min-width: 2.4rem;
  min-height: 2.4rem;
  border: 1px solid var(--kt-ligne);
  border-radius: 8px;
  background: #fff;
  color: var(--kt-encre);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.md-typeset .kt-soeurs a:hover { border-color: var(--kt-vert); background: var(--kt-vert-pale); color: var(--kt-vert); }
.md-typeset .kt-soeurs a[aria-current] { border-color: var(--kt-vert); background: var(--kt-vert); color: #fff; }
@media screen and (max-width: 30em) {
  /* 6 années + libellé sur une ligne dès 360 px ; cases de 42 px, bien au-dessus du minimum tactile de 24 px (WCAG 2.5.8). */
  .md-typeset .kt-soeurs a { min-width: 2.1rem; min-height: 2.1rem; }
  .kt-soeurs { gap: 0.4rem; }
  .kt-soeurs-liens { gap: 0.2rem; }
}
.kt-puces {
  position: sticky;
  top: 2.4rem;
  z-index: 2;
  display: flex;
  gap: 0.4rem;
  margin: 0;
  padding: 0.5rem 0;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--kt-ligne);
  scrollbar-width: none;
}
@media screen and (min-width: 76.25em) { .kt-puces { top: 5rem; flex-wrap: wrap; overflow: visible; } }
.md-typeset .kt-puces a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--kt-ligne);
  border-radius: 999px;
  color: var(--kt-encre);
  font-size: 0.72rem;
  white-space: nowrap;
  text-decoration: none;
}
.md-typeset .kt-puces a:hover { border-color: var(--kt-vert); color: var(--kt-vert); }
.md-typeset .kt-puces a[aria-current] { border-color: var(--kt-vert); background: var(--kt-vert); color: #fff; }
.kt-puces-matieres { position: static; margin-bottom: 1rem; border-bottom: 0; flex-wrap: wrap; }
.kt-puces span { color: var(--kt-gris); font-size: 0.65rem; }
.md-typeset .kt-matiere-titre { margin: 1.6rem 0 0.3rem; font-size: 1.15em; scroll-margin-top: var(--kt-decalage, 8rem); }

/* --- Fiches livres -------------------------------------------------------------------- */
.kt-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 0.7rem;
  margin: 0.6rem 0 1.2rem;
}
.kt-grille-seule { grid-template-columns: minmax(0, 30rem); }
.kt-livre {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.7rem;
  border: 1px solid var(--kt-ligne);
  border-radius: var(--kt-rayon);
  background: #fff;
  scroll-margin-top: var(--kt-decalage, 9rem);
}
.kt-livre:target { border-color: var(--kt-vert); animation: kt-repere 1.6s ease-out; }
@keyframes kt-repere { from { background: var(--kt-vert-pale); } to { background: #fff; } }
.kt-couv img,
.kt-couv-vide {
  display: block;
  width: 4rem;
  height: 5.65rem;
  object-fit: cover;
  object-position: top;
  border-radius: 3px;
  background: var(--kt-papier);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 4px 10px -6px rgba(0, 40, 20, 0.4);
}
.kt-corps { display: flex; flex-direction: column; min-width: 0; }
.kt-matiere { font-size: 0.65rem; font-weight: 700; color: var(--kt-vert); }
.md-typeset .kt-titre { margin: 0 0 0.2rem; font-size: 0.8rem; line-height: 1.45; }
.md-typeset .kt-meta { margin: 0 0 0.35rem; font-size: 0.66rem; line-height: 1.6; color: var(--kt-gris); }
.md-typeset .kt-etiquettes { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0 0 0.45rem; }
.kt-recent,
.kt-lourd { display: inline-block; padding: 0.05rem 0.4rem; border-radius: 4px; font-size: 0.65rem; font-weight: 700; }
.kt-recent { background: var(--kt-or); color: #000; }
.kt-lourd { background: var(--kt-ambre-pale); color: var(--kt-ambre); }
.md-typeset .kt-etat { margin: 0 0 0.45rem; font-size: 0.66rem; font-weight: 700; }
.kt-etat-ok { color: var(--kt-vert); }
.kt-etat-perime { padding: 0.3rem 0.45rem; border-radius: 6px; background: var(--kt-ambre-pale); color: var(--kt-ambre); }
.kt-actions { display: flex; gap: 0.4rem; margin-top: auto; }
.md-typeset .kt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.2rem; /* 44 px */
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
}
.md-typeset .kt-telecharger { flex: 1 1 auto; padding: 0 0.8rem; background: var(--kt-vert-pale); color: var(--kt-vert-fonce); }
.md-typeset .kt-telecharger:hover { background: var(--kt-vert); color: #fff; }
.md-typeset .kt-telecharger b { font-size: 0.68rem; }
.md-typeset .kt-partager { flex: none; width: 2.2rem; border: 1px solid var(--kt-ligne); color: var(--kt-gris); }
.md-typeset .kt-partager svg { fill: currentColor; }
.md-typeset .kt-partager:hover { border-color: var(--kt-vert); color: var(--kt-vert); }
.kt-vide { color: var(--kt-gris); }

/* --- Liens officiels ------------------------------------------------------------------ */
.md-typeset ul.kt-liens {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 1.4rem;
  padding: 0;
  list-style: none;
}
[dir] .md-typeset ul.kt-liens > li { margin: 0; }
.md-typeset ul.kt-liens a {
  display: block;
  height: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--kt-ligne);
  border-radius: var(--kt-rayon);
  color: var(--kt-encre);
  text-decoration: none;
}
.md-typeset ul.kt-liens a:hover { border-color: var(--kt-vert); }
.kt-liens strong { display: block; font-size: 0.78rem; color: var(--kt-vert); }
.kt-liens strong::after { content: " ↗"; font-weight: 400; color: var(--kt-gris); }
.kt-liens span { display: block; margin-top: 0.15rem; font-size: 0.68rem; line-height: 1.55; color: var(--kt-gris); }
.kt-liens small { display: block; margin-top: 0.3rem; font-size: 0.65rem; color: var(--kt-gris); direction: ltr; text-align: end; }
[dir="ltr"] .kt-liens small { text-align: start; }

/* --- Page d'erreur -------------------------------------------------------------------- */
.kt-erreur { text-align: center; margin-bottom: 1.5rem; }
.kt-erreur-code { margin: 0; font-size: 3.5rem; font-weight: 700; line-height: 1; color: var(--kt-vert); }

/* --- Pied de page --------------------------------------------------------------------- */
.kt-pied { background: #0F2A1D; color: #DCE8E0; font-size: 0.7rem; }
.kt-pied-grille { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.2rem; padding: 1.4rem 0.8rem 0.8rem; }
.kt-pied-ipn { display: flex; gap: 0.8rem; align-items: flex-start; max-width: 34rem; }
.kt-pied-ipn img { display: block; border-radius: 50%; background: #fff; flex: none; }
.kt-pied-logo { flex: none; border-radius: 50%; transition: box-shadow 0.15s; }
.kt-pied-logo:hover { box-shadow: 0 0 0 3px var(--kt-or); }
.kt-pied p { margin: 0 0 0.3rem; line-height: 1.6; }
.kt-pied-nom { font-weight: 700; font-size: 0.82rem; color: #fff; }
.kt-pied-liens { margin: 0; padding: 0; list-style: none; }
.kt-pied-liens li { margin: 0; }
.kt-pied-liens a { display: inline-flex; align-items: center; min-height: 2.2rem; }
.kt-pied a { color: #fff; text-decoration: underline; text-underline-offset: 0.2em; }
.kt-pied a:hover { color: var(--kt-or); }
.kt-pied-bas { padding: 0.8rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.65rem; color: #B8C9BF; }

/* --- Tablette ------------------------------------------------------------------------- */
@media screen and (max-width: 76.1875em) {
  .kt-cycles { grid-template-columns: minmax(0, 1fr); }
}

/* --- Téléphone ------------------------------------------------------------------------ */
@media screen and (max-width: 44.9375em) {
  .kt-hero-grille { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1.1rem 0.8rem 1.2rem; }
  .kt-hero h1 { font-size: 1.3rem; }
  .kt-hero-sous { font-size: 0.74rem; }
  .kt-etagere-bureau { display: none; }
  .kt-etagere-mobile { display: block; margin-top: 1.4rem; }
  [dir] .md-typeset .kt-etagere ul,
  .kt-etagere ul { display: flex; overflow-x: auto; gap: 0.7rem; padding-bottom: 0.4rem; scroll-snap-type: x mandatory; }
  [dir] .md-typeset .kt-etagere li,
  .kt-etagere li { flex: 0 0 4.6rem; scroll-snap-align: start; }
  .md-typeset ul.kt-raccourcis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-typeset h1 { font-size: 1.4em; }
  .md-typeset h2 { font-size: 1.15em; }
  .kt-livre { grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0.7rem; padding: 0.6rem; }
  .kt-couv img,
  .kt-couv-vide { width: 3.2rem; height: 4.5rem; }
  .announce p { font-size: 0.68rem; }
  .md-typeset table:not([class]) th { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .kt-livre:target { animation: none; }
}

/* --- Filtre par filière (lycée) ------------------------------------------------------- */
.kt-livre[hidden],
.kt-section[hidden],
.kt-puces a[hidden],
.kt-filtre[hidden] { display: none !important; }
.kt-filtre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: var(--kt-rayon);
  background: var(--kt-papier);
}
.kt-cache { display: none !important; }
/* Annales et guides : boutons d'année carrés, comme le sélecteur « السنة » des pages de classe. */
.kt-filtre-cycle { margin-inline-start: 0.4rem; font-size: 0.68rem; color: var(--kt-gris); }
.kt-filtre button.kt-num { min-width: 2.2rem; padding: 0 0.5rem; border-radius: 8px; font-size: 0.8rem; font-weight: 700; }
.kt-filtre-titre { margin-inline-end: 0.3rem; font-size: 0.72rem; font-weight: 700; color: var(--kt-encre); }
.kt-filtre button {
  min-height: 2.2rem;
  padding: 0 0.8rem;
  border: 1px solid var(--kt-ligne);
  border-radius: 999px;
  background: #fff;
  color: var(--kt-encre);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}
.kt-filtre button:hover { border-color: var(--kt-vert); color: var(--kt-vert); }
.kt-filtre button[aria-pressed="true"] { border-color: var(--kt-vert); background: var(--kt-vert); color: #fff; font-weight: 700; }
.kt-filtre button:focus-visible { outline: 3px solid var(--kt-encre); outline-offset: 2px; box-shadow: 0 0 0 6px var(--kt-or); }
@media screen and (max-width: 44.9375em) {
  .kt-filtre { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .kt-filtre button { flex: none; }
}

/* Page d'une année : la matière n'apparaît sur la fiche que lorsqu'une filière est choisie
   (les livres forment alors une seule grille, sans titres de matière). */
.kt-sections:not(.kt-filtre-actif) .kt-matiere { display: none; }
.kt-sections.kt-filtre-actif {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}
.kt-filtre-actif .kt-section,
.kt-filtre-actif .kt-grille { display: contents; }
.kt-filtre-actif .kt-matiere-titre { display: none; }
.kt-puces[hidden] { display: none !important; }

/* Titres longs : toujours à la ligne, jamais de débordement. */
.md-typeset .kt-titre { overflow-wrap: anywhere; }
.kt-grille > * { min-width: 0; }

/* Accueil : une seule zone de recherche (le grand champ du héros). Celle de l'en-tête reste active,
   elle ne s'affiche que lorsque la recherche est ouverte. */
body:has(.kt-hero) [data-md-toggle="search"]:not(:checked) ~ .md-header .md-search__inner { visibility: hidden; width: 0; overflow: hidden; }
/* …et sans y laisser sa place vide : le choix de langue reste collé au bord, comme sur les autres pages. */
body:has(.kt-hero) [data-md-toggle="search"]:not(:checked) ~ .md-header .md-search { margin-inline-end: 0; }
body:has(.kt-hero) .md-header label.md-header__button[for="__search"] { display: none; }


/* --- Seconde revue : finitions ----------------------------------------------------------- */
/* Loupe du héros dans le même sens que celle de l'en-tête. */
[dir="rtl"] .kt-recherche svg { transform: scaleX(-1); }
.kt-recherche span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Étagère : titres dans leur propre sens d'écriture, alignés avec le bloc. */
.kt-etagere-livre { text-align: start; }
[dir="rtl"] .kt-etagere-livre { text-align: right; }
[dir="ltr"] .kt-etagere-livre { text-align: left; }
.kt-etagere-classe { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* « كل المستجدات » : un vrai lien. */
.kt-etagere a.kt-tout { color: var(--kt-vert); text-decoration: underline; text-underline-offset: 0.2em; }
[dir="rtl"] .kt-tout::after { content: " ←"; }
[dir="ltr"] .kt-tout::after { content: " →"; }
/* Retour vers l'année depuis une page de matière. */
[dir="rtl"] .kt-retour::before { content: "→ "; }
[dir="ltr"] .kt-retour::before { content: "← "; }
/* Liens officiels : flèche externe orientée selon la langue, adresses longues coupées. */
[dir="rtl"] .kt-liens strong::after { content: " ↖"; }
.kt-liens small { overflow-wrap: anywhere; }
/* Page d'erreur centrée (barre latérale vide). */
.md-main:has(.kt-erreur) .md-sidebar { display: none; }
/* En-tête : le champ de recherche reste dans la grille. */
@media screen and (min-width: 60em) { .md-header .md-search { margin-inline-end: 0.6rem; } }
/* Pied de page : ligne du bas centrée dans la grille, focus visible sur fond sombre. */
.kt-pied p.kt-pied-bas { margin: 0 auto; }
.kt-pied a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: none; }
/* Focus visible hors du contenu (étagère du héros, filtre, boutons de l'en-tête). */
.kt-etagere a:focus-visible,
.md-header__button:focus-visible { outline: 3px solid var(--kt-encre); outline-offset: 2px; box-shadow: 0 0 0 6px var(--kt-or); }
/* Menu mobile : titres de niveau lisibles, logo rond, pas de sous-niveau des matières (les puces le font). */
.md-nav--primary .md-nav__title { background: var(--kt-papier); color: var(--kt-encre); font-weight: 700; }
.md-nav__title .md-nav__button.md-logo img { border-radius: 50%; background: #fff; }
@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__item--nested .md-nav__item--nested > nav { display: none; }
}
/* Bandeau sur téléphone : la croix ne chevauche plus le texte, texte non gras sauf les liens. */
@media screen and (max-width: 44.9375em) {
  .announce p { padding-inline-end: 1.6rem; font-weight: 400; text-align: start; }
  .announce a { font-weight: 700; }
  .md-typeset .kt-fondamental ul.kt-classes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kt-puces { -webkit-mask-image: linear-gradient(to left, #000 88%, transparent); mask-image: linear-gradient(to left, #000 88%, transparent); }
  [dir="ltr"] .kt-puces { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
}
/* Menu mobile : l'année mène à sa page ; pas de chevron vers un sous-menu masqué. */
@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__item--nested .md-nav__item--nested > .md-nav__link > label,
  .md-nav--primary .md-nav__item--nested .md-nav__item--nested > .md-nav__container > label,
  .md-nav--primary .md-nav__item--nested .md-nav__item--nested > label.md-nav__link .md-nav__icon { display: none; }
}
@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__item--nested .md-nav__item--nested .md-nav__icon { display: none; }
}

/* --- Page « À propos » : bannière officielle de l'IPN et trois atouts illustrés --------- */
.md-typeset .kt-banniere { display: block; width: 100%; height: auto; margin: 0.4rem 0 1.2rem; border-radius: var(--kt-rayon); }
.md-typeset ul.kt-atouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.4rem 0 1.6rem; padding: 0; list-style: none; }
[dir] .md-typeset ul.kt-atouts > li { margin: 0; padding: 0.8rem; border: 1px solid var(--kt-ligne); border-radius: var(--kt-rayon); background: #fff; }
.md-typeset .kt-atouts img { display: block; width: 100%; height: auto; margin-bottom: 0.6rem; }
.md-typeset .kt-atouts h2 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.md-typeset .kt-atouts p { margin: 0; font-size: 0.75rem; line-height: 1.7; color: var(--kt-gris); }
@media screen and (max-width: 44.9375em) {
  .md-typeset ul.kt-atouts { grid-template-columns: minmax(0, 1fr); }
  .md-typeset .kt-atouts img { max-width: 16rem; margin-inline: auto; }
}

/* Nom du site dans l'en-tête : lien vers l'accueil, sans allure de lien. */
.md-header__topic a.kt-nom-site { color: inherit; text-decoration: none; }
.md-header__topic a.kt-nom-site:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.md-header__topic a.kt-nom-site:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }
