/* Police de secours aux dimensions de Montserrat : pas de saut au chargement. */
@font-face {
  font-family: 'Montserrat repli';
  src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans'), local('Roboto');
  font-weight: 100 549;
  size-adjust: 113%;
  ascent-override: 85.7%;
  descent-override: 22.2%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Montserrat repli';
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Liberation Sans Bold'), local('Roboto Bold');
  font-weight: 550 649;
  size-adjust: 107%;
  ascent-override: 90.5%;
  descent-override: 23.5%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Montserrat repli';
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Liberation Sans Bold'), local('Roboto Bold');
  font-weight: 650 900;
  size-adjust: 109%;
  ascent-override: 88.8%;
  descent-override: 23%;
  line-gap-override: 0%;
}

/*
 * Ressources gratuites OptiTAB (pages statiques). Mêmes couleurs que la
 * vitrine (bleu marine + vert). Préfixe « rg- ». Les contenus de cours
 * gardent les styles du site (optitab-doc.css, scientific-content.css),
 * ajoutés à la suite de ce fichier à la construction.
 */

:root {
  --rg-navy: #1b3c8e;
  --rg-navy-700: #163274;
  --rg-navy-900: #0d1f4f;
  --rg-navy-100: #dfe6f5;
  --rg-navy-50: #f1f4fb;
  --rg-green: #5fac60;
  --rg-green-700: #2f7a3a;
  --rg-green-50: #ecf7ec;
  --rg-orange: #f0a23b;
  --rg-orange-700: #9a5c0f;
  --rg-orange-50: #fef4e6;
  --rg-red-700: #b03a2e;
  --rg-red-50: #fdeeec;
  --rg-ink: #121a33;
  --rg-ink-soft: #2c3550;
  --rg-muted: #5d667d;
  --rg-line: #e4e8f0;
  --rg-line-strong: #cfd6e4;
  --rg-bg-soft: #f6f8fc;
  --rg-font: 'Montserrat', 'Montserrat repli', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --rg-max: 1200px;
  --rg-gutter: 32px;
  --rg-radius: 18px;
  --rg-shadow: 0 1px 2px rgba(16, 32, 79, 0.05), 0 12px 32px rgba(16, 32, 79, 0.07);
  --rg-header: 72px;
}

@media (max-width: 640px) {
  :root {
    --rg-gutter: 16px;
    --rg-radius: 16px;
    --rg-header: 64px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--rg-header) + 16px);
}

body.rg {
  margin: 0;
  background: #fff;
  color: var(--rg-ink);
  font-family: var(--rg-font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
}

.rg a {
  color: var(--rg-navy);
}

.rg img {
  max-width: 100%;
  height: auto;
}

.rg-wrap {
  width: 100%;
  max-width: var(--rg-max);
  margin: 0 auto;
  padding: 0 var(--rg-gutter);
}

.rg-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rg-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--rg-navy);
  color: #fff !important;
  font-weight: 600;
}

.rg-skip:focus {
  top: 12px;
}

/* ---------- Boutons ---------- */

.rg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 15px/1 var(--rg-font);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.rg-btn:hover {
  transform: translateY(-1px);
}

.rg-btn--sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
}

.rg-btn--primary {
  background: var(--rg-navy);
  color: #fff !important;
}

.rg-btn--primary:hover {
  background: var(--rg-navy-700);
}

.rg-btn--green {
  background: var(--rg-green-700);
  color: #fff !important;
}

.rg-btn--green:hover {
  background: #276832;
}

.rg-btn--ghost {
  border-color: var(--rg-line-strong);
  background: #fff;
  color: var(--rg-ink) !important;
}

.rg-btn--ghost:hover {
  border-color: var(--rg-navy);
}

.rg-btn .rg-ico {
  width: 18px;
  height: 18px;
}

/* ---------- En-tête ---------- */

.rg-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--rg-header);
  border-bottom: 1px solid var(--rg-line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(12px);
}

.rg-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.rg-brand {
  display: flex;
  flex-shrink: 0;
}

.rg-brand img {
  display: block;
  width: 132px;
  height: auto;
}

.rg-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}

.rg-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--rg-ink-soft) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.rg-nav a:hover,
.rg-nav a.is-active {
  background: var(--rg-navy-50);
  color: var(--rg-navy) !important;
}

.rg-nav__login {
  display: none;
}

.rg-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rg-login {
  color: var(--rg-ink-soft) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.rg-login:hover {
  color: var(--rg-navy) !important;
}

.rg-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  background: #fff;
  color: var(--rg-ink);
  cursor: pointer;
}

@media (max-width: 960px) {
  .rg-header__inner {
    gap: 12px;
  }

  .rg-brand {
    margin-right: auto;
  }

  .rg-menu {
    display: inline-flex;
  }

  .rg-login {
    display: none;
  }

  .rg-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 12px var(--rg-gutter) 18px;
    border-bottom: 1px solid var(--rg-line);
    background: #fff;
    box-shadow: var(--rg-shadow);
  }

  .rg-nav.is-open {
    display: flex;
  }

  .rg-nav a {
    padding: 12px 14px;
    font-size: 16px;
  }

  .rg-nav__login {
    display: block;
  }
}

@media (max-width: 400px) {
  .rg-brand img {
    width: 112px;
  }

  .rg-header .rg-btn--sm {
    padding: 0 14px;
  }
}

/* ---------- Fil d'Ariane ---------- */

.rg-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--rg-muted);
  font-size: 13.5px;
}

.rg-crumbs li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.rg-crumbs li + li::before {
  content: '›';
  margin: 0 8px;
  color: var(--rg-line-strong);
}

.rg-crumbs a {
  color: var(--rg-muted) !important;
  text-decoration: none;
}

.rg-crumbs a:hover {
  color: var(--rg-navy) !important;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .rg-crumbs ol {
    font-size: 13px;
  }

  .rg-crumbs li:first-child {
    display: none;
  }

  .rg-crumbs li:nth-child(2)::before {
    content: none;
  }
}

.rg-crumbs [aria-current] {
  overflow: hidden;
  max-width: 22.7em; /* 34 caractères */
  color: var(--rg-ink-soft);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Titres de page ---------- */

.rg-hero,
.rg-chap {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--rg-line);
  background:
    radial-gradient(800px 260px at 0% 0%, var(--rg-navy-50), transparent 70%),
    linear-gradient(#fff, #fbfcfe);
}

.rg-hero {
  padding: 36px 0 44px;
}

/* Accueil des ressources : en-tête centré, la recherche au milieu. */
.rg-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rg-hero__inner .rg-crumbs ol {
  justify-content: center;
}

.rg-hero__inner .rg-lead {
  max-width: 40em;
}

.rg-hero__inner .rg-search {
  width: 100%;
  max-width: 640px;
  margin-top: 28px;
  text-align: left;
}

.rg-garanties {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--rg-ink-soft);
  font-size: 15px;
}

.rg-garanties li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.rg-garanties .rg-ico {
  width: 18px;
  height: 18px;
  color: var(--rg-green-700);
  stroke-width: 2.4;
}

.rg-garanties strong {
  color: var(--rg-navy-900);
}

@media (max-width: 640px) {
  .rg-hero {
    padding: 24px 0 32px;
  }

  .rg-hero__inner .rg-lead {
    font-size: 16px;
  }

  .rg-hero__inner .rg-search {
    margin-top: 22px;
  }

  .rg-garanties {
    gap: 6px 16px;
    font-size: 14px;
  }
}

.rg-kicker {
  margin: 0 0 10px;
  color: var(--rg-green-700);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rg-h1 {
  max-width: 16.3em; /* 24 caractères ; en em et non en ch : le ch change avec la police chargée */
  margin: 0;
  color: var(--rg-navy-900);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.rg-h1--hero {
  max-width: 16em; /* 24 caractères : deux lignes */
  font-size: clamp(30px, 4.6vw, 50px);
}

.rg-h1__suite {
  color: var(--rg-navy);
  font-weight: 600;
}

.rg-lead {
  max-width: 44em; /* 66 caractères */
  margin: 16px 0 0;
  color: var(--rg-ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

.rg-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.rg-stats li {
  padding: 8px 14px;
  border: 1px solid var(--rg-line);
  border-radius: 999px;
  background: #fff;
  color: var(--rg-ink-soft);
  font-size: 14px;
}

.rg-stats strong {
  color: var(--rg-navy);
}

.rg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.rg-pills a {
  padding: 7px 14px;
  border: 1px solid var(--rg-line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--rg-ink-soft) !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.rg-pills a:hover,
.rg-pills a.is-active {
  border-color: var(--rg-navy);
  background: var(--rg-navy);
  color: #fff !important;
}

/* ---------- Onglets d'un chapitre ---------- */

.rg-tabs {
  display: flex;
  gap: 8px;
  margin-top: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rg-tabs::-webkit-scrollbar {
  display: none;
}

.rg-tab {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--rg-line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--rg-ink-soft) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.rg-tab:hover {
  border-color: var(--rg-navy);
  color: var(--rg-navy) !important;
}

.rg-tab.is-active {
  border-color: var(--rg-navy);
  background: var(--rg-navy);
  color: #fff !important;
}

.rg-tab__court {
  display: none;
}

@media (max-width: 640px) {
  .rg-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 6px;
  }

  .rg-tab {
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    font-size: 14px;
  }

  .rg-tab__long {
    display: none;
  }

  .rg-tab__court {
    display: inline;
  }

  .rg-tab .rg-ico {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 360px) {
  .rg-tab .rg-ico {
    display: none;
  }
}

.rg-infos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--rg-muted);
  font-size: 14.5px;
  font-weight: 600;
}

.rg-infos li {
  display: inline-flex;
  align-items: center;
}

.rg-infos li + li::before {
  content: '';
  width: 4px;
  height: 4px;
  margin-right: 14px;
  border-radius: 50%;
  background: var(--rg-line-strong);
}

.rg-tab__n {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rg-navy-50);
  color: var(--rg-navy);
  font-size: 12px;
}

.rg-tab.is-active .rg-tab__n {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ---------- Lecture (cours, fiche, exercices) ---------- */

.rg-reading {
  display: block;
  padding-top: 36px;
  padding-bottom: 24px;
}

.rg-reading--toc {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.rg-doc,
.rg-exos {
  min-width: 0;
  max-width: 820px;
}

.rg-reading:not(.rg-reading--toc) .rg-doc,
.rg-reading:not(.rg-reading--toc) .rg-exos {
  margin: 0 auto;
}

.rg-doc__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
  margin-bottom: 18px;
}

/* Ligne d'aide (cours particuliers) à gauche du bouton Imprimer. */
.rg-aide {
  display: inline-flex;
  flex: 1 1 300px;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--rg-ink-soft) !important;
  font-size: 14.5px;
  line-height: 1.45;
  text-decoration: none;
}

.rg-aide > .rg-ico:first-child {
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 50%;
  background: var(--rg-green-50);
  color: var(--rg-green-700);
}

.rg-aide strong {
  color: var(--rg-green-700);
  font-weight: 700;
}

.rg-aide > .rg-ico:last-child {
  width: 16px;
  height: 16px;
  color: var(--rg-green-700);
  transition: transform 0.15s;
}

.rg-aide:hover strong {
  text-decoration: underline;
}

.rg-aide:hover > .rg-ico:last-child {
  transform: translateX(3px);
}

.rg-aide:focus-visible {
  outline: 3px solid rgba(47, 122, 58, 0.35);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Encadré « cours particuliers » au milieu d'une longue page. */
.rg-sci .rg-encart,
.rg-encart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin: 32px 0;
  padding: 20px 22px;
  border: 1px solid #cfe6cf;
  border-radius: var(--rg-radius);
  background: var(--rg-green-50);
}

.rg-encart__ico .rg-ico {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: #fff;
  color: var(--rg-green-700);
}

.rg-encart__texte {
  flex: 1 1 280px;
  min-width: 0;
}

.rg-sci .rg-encart p,
.rg-encart p {
  margin: 0;
  color: var(--rg-ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

.rg-sci .rg-encart .rg-encart__titre,
.rg-encart .rg-encart__titre {
  margin-bottom: 2px;
  color: var(--rg-navy-900);
  font-size: 17px;
  font-weight: 700;
}

.rg-encart .rg-btn {
  margin-left: auto;
}

/* Mot composé jamais coupé au trait d'union (« physique-chimie »). */
.rg-insecable {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .rg-encart__ico {
    display: none;
  }

  .rg-encart .rg-btn {
    width: 100%;
    justify-content: center;
  }
}

.rg-sci {
  font-size: 17px;
  line-height: 1.7;
}

.rg-toc {
  position: sticky;
  top: calc(var(--rg-header) + 20px);
}

.rg-toc__box {
  border: 1px solid var(--rg-line);
  border-radius: 16px;
  background: var(--rg-bg-soft);
}

.rg-toc__box summary {
  padding: 14px 18px;
  color: var(--rg-navy-900);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.rg-toc__box summary::-webkit-details-marker {
  display: none;
}

.rg-toc ol {
  margin: 0;
  padding: 0 10px 12px;
  list-style: none;
}

.rg-toc a {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--rg-ink-soft) !important;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}

.rg-toc a:hover {
  background: #fff;
  color: var(--rg-navy) !important;
}

.rg-toc__num {
  flex-shrink: 0;
  color: var(--rg-navy);
  font-weight: 700;
}

@media (max-width: 960px) {
  .rg-reading--toc {
    display: block;
  }

  .rg-toc {
    position: static;
    margin-bottom: 28px;
  }
}

/* ---------- Exercices ---------- */

.rg-exo {
  margin-bottom: 28px;
  padding: 26px 28px;
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  background: #fff;
  box-shadow: var(--rg-shadow);
}

.rg-exo__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.rg-exo__num {
  color: var(--rg-navy);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rg-exo__type {
  color: var(--rg-muted);
  font-size: 13px;
  font-weight: 600;
}

.rg-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.rg-pill--easy {
  background: var(--rg-green-50);
  color: var(--rg-green-700);
}

.rg-pill--medium {
  background: var(--rg-orange-50);
  color: var(--rg-orange-700);
}

.rg-pill--hard {
  background: var(--rg-red-50);
  color: var(--rg-red-700);
}

.rg-exo__title {
  margin: 0 0 14px;
  color: var(--rg-navy-900);
  font-size: 21px;
  line-height: 1.3;
}

.rg-correction {
  margin-top: 20px;
  border: 1px solid var(--rg-navy-100);
  border-radius: 14px;
  background: var(--rg-navy-50);
}

.rg-correction summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: var(--rg-navy);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.rg-correction summary::-webkit-details-marker {
  display: none;
}

.rg-correction summary::after {
  content: '+';
  font-size: 22px;
  line-height: 1;
}

.rg-correction[open] summary::after {
  content: '−';
}

.rg-correction__body {
  padding: 4px 20px 20px;
  border-top: 1px solid var(--rg-navy-100);
  background: #fff;
  border-radius: 0 0 14px 14px;
}

.rg-reponses {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 4px solid var(--rg-green);
  border-radius: 0 12px 12px 0;
  background: var(--rg-green-50);
}

.rg-reponses__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--rg-green-700);
  font-weight: 700;
}

.rg-more {
  margin: 8px 0 32px;
  padding: 20px 22px;
  border: 1px dashed var(--rg-line-strong);
  border-radius: var(--rg-radius);
  background: var(--rg-bg-soft);
}

.rg-more__ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.rg-more__ligne + .rg-more__ligne {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--rg-line-strong);
}

.rg-more p {
  max-width: 34.7em; /* 52 caractères */
  margin: 0;
}

@media (max-width: 640px) {
  .rg-exo {
    padding: 20px 16px;
  }

  .rg-correction__body {
    padding: 4px 14px 16px;
  }
}

/* ---------- Pour continuer, chapitres voisins ---------- */

.rg-next {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rg-line);
}

.rg-next__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--rg-ink);
  font-weight: 700;
}

.rg-next__title .rg-ico {
  color: var(--rg-green-700);
}

.rg-next__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.rg-next__card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--rg-line);
  border-radius: 16px;
  background: #fff;
  color: var(--rg-ink) !important;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rg-next__card:hover {
  border-color: var(--rg-navy);
  box-shadow: var(--rg-shadow);
}

.rg-next__card .rg-ico {
  width: 24px;
  height: 24px;
  color: var(--rg-navy);
}

.rg-next__card strong {
  display: block;
  color: var(--rg-navy-900);
}

.rg-next__card small {
  display: block;
  margin-top: 2px;
  color: var(--rg-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.rg-neighbours {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 28px 0 0;
}

.rg-neighbour {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--rg-line);
  border-radius: 16px;
  color: var(--rg-ink) !important;
  text-decoration: none;
}

.rg-neighbour:hover {
  border-color: var(--rg-navy);
}

.rg-neighbour--next {
  justify-content: flex-end;
  text-align: right;
}

.rg-neighbour span {
  min-width: 0;
}

.rg-neighbour small {
  display: block;
  color: var(--rg-muted);
  font-size: 13px;
}

.rg-neighbour strong {
  display: block;
  overflow: hidden;
  color: var(--rg-navy-900);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .rg-neighbours {
    grid-template-columns: 1fr;
  }
}

/* ---------- Aller plus loin ---------- */

.rg-ctas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 48px 0 56px;
}

.rg-ctas--seul {
  grid-template-columns: 1fr;
}

.rg-cta {
  padding: 28px;
  border-radius: 22px;
}

.rg-cta--plateforme {
  background: var(--rg-navy-900);
  color: #dfe6f5;
}

.rg-cta--prof {
  border: 1px solid #cfe7cf;
  background: var(--rg-green-50);
  color: var(--rg-ink-soft);
}

.rg-cta__kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rg-cta--plateforme .rg-cta__kicker {
  color: var(--rg-green-300, #8fd18f);
}

.rg-cta--prof .rg-cta__kicker {
  color: var(--rg-green-700);
}

.rg-cta__title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.rg-cta--plateforme .rg-cta__title {
  color: #fff;
}

.rg-cta--prof .rg-cta__title {
  color: var(--rg-navy-900);
}

.rg-cta p {
  margin: 0 0 20px;
  line-height: 1.6;
}

.rg-cta--plateforme .rg-btn--primary {
  background: #fff;
  color: var(--rg-navy-900) !important;
}

@media (max-width: 760px) {
  .rg-ctas {
    grid-template-columns: 1fr;
  }

  .rg-cta {
    padding: 22px;
  }
}

/* ---------- Page d'une classe ---------- */

.rg-classe {
  padding-top: 36px;
}

.rg-theme {
  margin-bottom: 36px;
}

.rg-theme__title {
  margin: 0 0 14px;
  color: var(--rg-navy-900);
  font-size: 21px;
}

.rg-chapters {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rg-chapter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  border: 1px solid var(--rg-line);
  border-radius: 16px;
  background: #fff;
}

.rg-chapter:hover {
  border-color: var(--rg-navy-100);
  box-shadow: var(--rg-shadow);
}

.rg-chapter__main {
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--rg-ink) !important;
  text-decoration: none;
}

.rg-chapter__num {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--rg-navy-50);
  color: var(--rg-navy);
  font-weight: 700;
}

.rg-chapter__title {
  font-weight: 600;
  line-height: 1.35;
}

.rg-chapter__main:hover .rg-chapter__title {
  color: var(--rg-navy);
}

.rg-chapter__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rg-chapter__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--rg-bg-soft);
  color: var(--rg-ink-soft) !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

.rg-chapter__links a:hover {
  background: var(--rg-navy);
  color: #fff !important;
}

.rg-chapter__links .rg-ico {
  width: 16px;
  height: 16px;
}

@media (max-width: 640px) {
  .rg-chapter__links {
    padding-left: 50px;
  }
}

/* ---------- Accueil des ressources ---------- */

.rg-home {
  padding-top: 44px;
}

.rg-bloc {
  margin-bottom: 48px;
}

.rg-bloc__titre {
  margin: 0 0 16px;
  color: var(--rg-navy-900);
  font-size: 24px;
  line-height: 1.25;
}

/* Choix de la classe : une ligne par cycle, les classes alignées en colonnes. */
.rg-choix {
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  background: #fff;
}

.rg-choix__ligne {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
}

.rg-choix__ligne + .rg-choix__ligne {
  border-top: 1px solid var(--rg-line);
}

.rg-choix__cycle {
  margin: 0;
  color: var(--rg-navy-900);
  font-size: 16px;
  font-weight: 700;
}

.rg-choix__classes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rg-choix__classes a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 14px;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  background: var(--rg-bg-soft);
  color: var(--rg-navy-900) !important;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.rg-choix__classes a:hover {
  border-color: var(--rg-navy);
  background: #fff;
  box-shadow: var(--rg-shadow);
}

.rg-choix__classes strong {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
}

.rg-choix__classes span {
  color: var(--rg-muted);
  font-size: 13px;
}

/* Accès rapide : les pages les plus demandées. */
.rg-acces {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rg-acces a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--rg-line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--rg-ink-soft) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.rg-acces a:hover {
  border-color: var(--rg-navy);
  color: var(--rg-navy) !important;
}

/* Rubriques : formulaires, tables, calculateurs, fiches, physique-chimie. */
.rg-rubs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rg-rub {
  display: flex;
  gap: 16px;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  background: #fff;
  color: var(--rg-ink) !important;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rg-rub:hover {
  border-color: var(--rg-navy);
  box-shadow: var(--rg-shadow);
}

.rg-rub__ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--rg-navy-50);
  color: var(--rg-navy);
}

.rg-rub__ico .rg-ico {
  width: 22px;
  height: 22px;
}

.rg-rub--physique .rg-rub__ico {
  background: var(--rg-green-50);
  color: var(--rg-green-700);
}

.rg-rub__corps {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rg-rub__titre {
  margin: 0;
  color: var(--rg-navy-900);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.rg-rub__texte {
  margin: 4px 0 12px;
  color: var(--rg-muted);
  font-size: 14px;
  line-height: 1.5;
}

.rg-rub__compte {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--rg-navy);
  font-size: 14px;
  font-weight: 700;
}

.rg-rub__compte .rg-ico {
  width: 16px;
  height: 16px;
}

.rg-choix__classes a:focus-visible,
.rg-acces a:focus-visible,
.rg-rub:focus-visible {
  outline: 3px solid rgba(27, 60, 142, 0.35);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  .rg-rubs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .rg-choix__ligne {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 16px 18px;
  }

  .rg-choix__classes {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 640px) {
  .rg-home {
    padding-top: 32px;
  }

  .rg-bloc {
    margin-bottom: 40px;
  }

  .rg-bloc__titre {
    font-size: 21px;
  }

  /* Sur téléphone, pas de cadre autour du choix : toute la largeur pour les
     classes (« Maths Terminale » tient sur une ligne). */
  .rg-choix {
    border: 0;
    border-radius: 0;
    background: none;
  }

  .rg-choix__ligne {
    padding: 14px 0;
  }

  .rg-choix__ligne:first-child {
    padding-top: 0;
  }

  .rg-choix__classes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .rg-choix__classes a {
    padding: 10px 12px;
  }

  .rg-acces {
    gap: 8px;
  }

  .rg-acces a {
    min-height: 40px;
    padding: 7px 14px;
    font-size: 14px;
  }

  .rg-rubs {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .rg-rub {
    padding: 16px;
  }
}

.rg-faq {
  max-width: 820px;
  margin: 0 auto 64px;
}

.rg-faq h2 {
  margin: 0 0 16px;
  color: var(--rg-navy-900);
  font-size: 24px;
}

.rg-faq__item {
  border-bottom: 1px solid var(--rg-line);
}

.rg-faq__item summary {
  padding: 18px 0;
  color: var(--rg-ink);
  font-weight: 600;
  cursor: pointer;
}

.rg-faq__item p {
  margin: 0 0 18px;
  color: var(--rg-ink-soft);
}

/* ---------- Pied de page ---------- */

.rg-footer {
  padding: 48px 0 24px;
  background: var(--rg-navy-900);
  color: #c9d2ea;
  font-size: 14.5px;
}

.rg-footer a {
  color: #e8edf8 !important;
  text-decoration: none;
}

.rg-footer a:hover {
  text-decoration: underline;
}

.rg-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 28px;
}

.rg-footer__brand img {
  width: 132px;
  height: auto;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff;
}

.rg-footer__brand p {
  max-width: 24em; /* 36 caractères */
  margin: 14px 0 0;
  line-height: 1.6;
}

.rg-footer__title {
  margin: 0 0 10px;
  color: #fff;
  font-weight: 700;
}

.rg-footer ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rg-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

@media (max-width: 960px) {
  .rg-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .rg-footer__brand {
    grid-column: 1 / -1;
  }
}

/* ---------- Bandeau des cookies ---------- */

.rg-cookies {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 20px;
  border: 1px solid var(--rg-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(16, 32, 79, 0.08), 0 24px 60px rgba(16, 32, 79, 0.18);
  font-size: 14px;
}

.rg-cookies[hidden] {
  display: none;
}

.rg-cookies__text {
  flex: 1 1 420px;
}

.rg-cookies__text p {
  margin: 4px 0 0;
  color: var(--rg-ink-soft);
  line-height: 1.5;
}

.rg-cookies__choix {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.rg-cookies__choix[hidden] {
  display: none;
}

.rg-cookies__choix label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.rg-cookies__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Impression (fiches, exercices) ---------- */

@media print {
  .rg-header,
  .rg-footer,
  .rg-tabs,
  .rg-crumbs,
  .rg-ctas,
  .rg-next,
  .rg-neighbours,
  .rg-more,
  .rg-encart,
  .rg-toc,
  .rg-doc__tools,
  .rg-cookies,
  .rg-skip {
    display: none !important;
  }

  .rg-hero,
  .rg-chap {
    padding: 0 0 12px;
    border: 0;
    background: none;
  }

  .rg-reading {
    display: block;
    padding: 0;
  }

  .rg-exo {
    box-shadow: none;
    break-inside: avoid;
  }

  .rg-correction summary::after {
    content: '';
  }
}

/* ---------- Recherche (accueil des ressources) ---------- */

.rg-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.rg-search {
  position: relative;
  max-width: 560px;
  margin-top: 22px;
}

.rg-search__box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--rg-line-strong);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--rg-shadow);
  cursor: text;
}

.rg-search__box:focus-within {
  border-color: var(--rg-navy);
  box-shadow: 0 0 0 3px rgba(27, 60, 142, 0.15), var(--rg-shadow);
}

.rg-search__box .rg-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--rg-muted);
}

.rg-search__box input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0;
  outline: 0;
  background: none;
  font: 500 16px var(--rg-font);
  color: var(--rg-ink);
}

.rg-search__box input::placeholder {
  color: #8a93a8;
}

.rg-search__res {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 30;
  max-height: min(420px, 60vh);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(16, 32, 79, 0.06), 0 24px 60px rgba(16, 32, 79, 0.14);
  list-style: none;
}

.rg-search__res a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--rg-ink);
}

.rg-search__res a:hover,
.rg-search__res a:focus-visible {
  background: var(--rg-navy-50, #f1f4fb);
  outline: none;
}

.rg-search__res strong {
  font-size: 15px;
  font-weight: 600;
}

.rg-search__res span {
  font-size: 13px;
  color: var(--rg-muted);
}

.rg-search__vide {
  padding: 12px;
  font-size: 14px;
  color: var(--rg-muted);
}

@media print {
  .rg-search {
    display: none;
  }
}

/*
 * Blog OptiTAB (scripts/ressources/blog.mjs). Préfixe « bl- ». S'ajoute à
 * ressources.css (mêmes couleurs, mêmes boutons, même en-tête).
 */

.bl-h1 {
  max-width: 30ch;
}

.bl-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.bl-byline__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--rg-line);
  border-radius: 50%;
  background: #fff;
}

.bl-byline__nom {
  margin: 0;
  color: var(--rg-ink);
  font-size: 15px;
  font-weight: 600;
}

.bl-byline__nom a {
  color: var(--rg-navy-900) !important;
  text-decoration: none;
}

.bl-byline__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 2px 0 0;
  color: var(--rg-muted);
  font-size: 13.5px;
}

.bl-byline__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.bl-byline__meta span + span {
  margin-left: 10px;
}

.bl-byline__meta .rg-ico {
  width: 15px;
  height: 15px;
}

/* ---------- Article ---------- */

.bl-article {
  max-width: 760px;
}

.bl-cover {
  margin: 0 0 28px;
  overflow: hidden;
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  background: var(--rg-navy-50);
}

.bl-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.bl-bref {
  margin: 0 0 32px;
  padding: 20px 24px;
  border: 1px solid var(--rg-navy-100);
  border-radius: var(--rg-radius);
  background: var(--rg-navy-50);
}

.bl-bref__titre {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--rg-navy);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bl-bref__titre .rg-ico {
  width: 18px;
  height: 18px;
}

.bl-bref ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bl-bref li {
  position: relative;
  padding-left: 22px;
  color: var(--rg-ink-soft);
  font-size: 16px;
  line-height: 1.55;
}

.bl-bref li::before {
  content: '';
  position: absolute;
  top: 0.62em;
  left: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rg-green);
}

.bl-prose {
  color: var(--rg-ink-soft);
  font-size: 17.5px;
  line-height: 1.75;
}

.bl-prose > p,
.bl-prose > ul,
.bl-prose > ol {
  margin: 0 0 20px;
}

.bl-prose h2 {
  margin: 48px 0 16px;
  color: var(--rg-navy-900);
  font-size: clamp(23px, 2.6vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.bl-prose h3 {
  margin: 32px 0 10px;
  color: var(--rg-ink);
  font-size: 20px;
  line-height: 1.3;
}

.bl-prose strong {
  color: var(--rg-ink);
}

.bl-prose a {
  color: var(--rg-navy) !important;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(27, 60, 142, 0.35);
  text-underline-offset: 3px;
}

.bl-prose a:hover {
  text-decoration-color: currentColor;
}

.bl-prose > ul,
.bl-prose > ol {
  padding-left: 24px;
}

.bl-prose li {
  margin-bottom: 8px;
}

.bl-prose li::marker {
  color: var(--rg-navy);
  font-weight: 700;
}

/* ---------- Tableau comparatif ---------- */

.bl-table {
  margin: 8px 0 28px;
  overflow-x: auto;
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  -webkit-overflow-scrolling: touch;
}

.bl-table table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.bl-table th,
.bl-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rg-line);
  text-align: left;
  vertical-align: top;
}

.bl-table thead th {
  background: var(--rg-navy-900);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bl-table tbody th {
  color: var(--rg-navy-900);
  font-weight: 700;
}

.bl-table tbody tr:nth-child(even) {
  background: var(--rg-bg-soft);
}

.bl-table tbody tr:last-child th,
.bl-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Téléphone : chaque ligne devient une fiche, chaque valeur précédée du
   titre de sa colonne (attribut data-label posé par blog.mjs). */
@media (max-width: 640px) {
  .bl-table {
    overflow: visible;
  }

  .bl-table table {
    min-width: 0;
  }

  .bl-table thead {
    display: none;
  }

  .bl-table table,
  .bl-table tbody,
  .bl-table tr,
  .bl-table th,
  .bl-table td {
    display: block;
  }

  .bl-table tbody tr {
    padding: 16px 18px;
    border-bottom: 1px solid var(--rg-line);
  }

  .bl-table tbody tr:last-child {
    border-bottom: 0;
  }

  .bl-table tbody th,
  .bl-table tbody td {
    padding: 0;
    border-bottom: 0;
  }

  .bl-table tbody th {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .bl-table tbody td + td {
    margin-top: 8px;
  }

  .bl-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--rg-green-700);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
}

/* ---------- Schéma de la méthode ---------- */

.bl-cycle {
  margin: 8px 0 32px;
  padding: 24px;
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  background: linear-gradient(180deg, #fff, var(--rg-bg-soft));
}

.bl-cycle figcaption {
  margin: 0 0 18px;
  color: var(--rg-navy-900);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.bl-cycle ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bl-cycle li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 16px 14px;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 32, 79, 0.04);
  font-size: 14px;
  line-height: 1.45;
}

/* Flèche entre deux étapes, dans l’espace qui les sépare (jamais sur un texte). */
.bl-cycle li + li::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -22px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: no-repeat center / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b3c8e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

.bl-cycle li strong {
  color: var(--rg-navy-900);
  font-size: 16px;
}

.bl-cycle li span:not(.bl-cycle__num) {
  color: var(--rg-muted);
}

.bl-cycle__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--rg-navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.bl-cycle li:nth-child(3) .bl-cycle__num {
  background: var(--rg-green-700);
}

.bl-cycle li:nth-child(4) .bl-cycle__num {
  background: var(--rg-orange);
}

.bl-cycle__boucle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--rg-orange-700);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.bl-cycle__boucle::before {
  content: '';
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: no-repeat center / 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a5c0f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 15.5-6.2L21 8M21 3v5h-5M21 12a9 9 0 0 1-15.5 6.2L3 16M3 21v-5h5'/%3E%3C/svg%3E");
}

/* ---------- Encadrés ---------- */

.bl-encart {
  margin: 8px 0 28px;
  padding: 18px 22px;
  border-left: 4px solid var(--rg-green);
  border-radius: 0 14px 14px 0;
  background: var(--rg-green-50);
}

.bl-encart p {
  margin: 0;
  font-size: 16px;
}

.bl-encart .bl-encart__titre {
  margin-bottom: 4px;
  color: var(--rg-green-700);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bl-check {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.bl-check li {
  position: relative;
  margin: 0;
  padding: 12px 16px 12px 48px;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  line-height: 1.5;
}

.bl-check li::before {
  content: '';
  position: absolute;
  top: 13px;
  left: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--rg-green-50) no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f7a3a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
}

/* ---------- Appels à l’action dans l’article ---------- */

.bl-pause {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 0 8px;
  padding: 22px 24px;
  border-radius: var(--rg-radius);
  background: var(--rg-navy-900);
  color: #dfe6f5;
}

.bl-pause p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.bl-pause .bl-pause__titre {
  margin-bottom: 4px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.bl-prose .bl-pause .rg-btn {
  flex-shrink: 0;
  text-decoration: none;
  background: #fff;
  color: var(--rg-navy-900) !important;
}

.bl-fin {
  margin: 48px 0;
  padding: 32px;
  border: 1px solid var(--rg-navy-100);
  border-radius: 22px;
  background:
    radial-gradient(520px 200px at 100% 0%, rgba(95, 172, 96, 0.14), transparent 70%),
    var(--rg-navy-50);
  text-align: center;
}

.bl-fin p {
  max-width: 56ch;
  margin: 0 auto 20px;
  color: var(--rg-ink-soft);
}

.bl-fin .bl-fin__titre {
  margin-bottom: 8px;
  color: var(--rg-navy-900);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.bl-fin__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.bl-fin .bl-fin__rassurance {
  margin: 16px auto 0;
  color: var(--rg-muted);
  font-size: 13.5px;
}

.bl-faq {
  max-width: none;
  margin: 0 0 48px;
}

/* ---------- Classes ---------- */

.bl-classes {
  margin: 0 0 48px;
}

.bl-classes h2 {
  margin: 0 0 6px;
  color: var(--rg-navy-900);
  font-size: 22px;
}

.bl-classes p {
  margin: 0 0 16px;
  color: var(--rg-muted);
}

.bl-classes ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bl-classes a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--rg-line);
  border-radius: 999px;
  background: #fff;
  color: var(--rg-navy-900) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.bl-classes a:hover {
  border-color: var(--rg-navy);
  background: var(--rg-navy-50);
}

.bl-classes a .rg-ico {
  width: 18px;
  height: 18px;
  color: var(--rg-navy);
}

.bl-classes .bl-classes__tout {
  border-color: transparent;
  background: transparent;
  color: var(--rg-navy) !important;
}

/* ---------- Sommaire : encart sous la liste ---------- */

.bl-toc__cta {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--rg-navy-900);
  color: #dfe6f5;
  font-size: 14px;
  line-height: 1.5;
}

.bl-toc__cta p {
  margin: 0 0 10px;
}

.bl-toc__cta strong {
  color: #fff;
}

.bl-toc .bl-toc__cta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #fff !important;
  font-weight: 700;
}

.bl-toc .bl-toc__cta a:hover {
  background: none;
  text-decoration: underline;
}

.bl-toc .bl-toc__cta .rg-ico {
  width: 16px;
  height: 16px;
}

/* ---------- Accueil du blog ---------- */

.bl-liste {
  padding-top: 36px;
}

.bl-card {
  overflow: hidden;
  border: 1px solid var(--rg-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--rg-shadow);
}

.bl-card--une {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  margin-bottom: 48px;
}

.bl-card__img {
  display: block;
  align-self: stretch;
  background: var(--rg-navy-50);
}

.bl-card__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bl-card__body {
  padding: 24px;
}

.bl-card--une .bl-card__body {
  padding: 32px 36px;
}

.bl-card__rubrique {
  margin: 0 0 8px;
  color: var(--rg-green-700);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bl-card__titre {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.3;
}

.bl-card--une .bl-card__titre {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.25;
  text-wrap: balance;
}

.bl-card__titre a {
  color: var(--rg-navy-900) !important;
  text-decoration: none;
}

.bl-card__titre a:hover {
  color: var(--rg-navy) !important;
}

.bl-card__desc {
  margin: 0 0 14px;
  color: var(--rg-ink-soft);
  font-size: 15.5px;
  line-height: 1.6;
}

.bl-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--rg-muted);
  font-size: 13.5px;
}

.bl-card__meta .rg-ico {
  width: 15px;
  height: 15px;
}

.bl-card__meta time + .rg-ico {
  margin-left: 8px;
}

.bl-card__cta {
  margin-top: 22px;
}

.bl-liste__titre {
  margin: 0 0 18px;
  color: var(--rg-navy-900);
  font-size: 24px;
}

.bl-grille {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.bl-vide {
  padding: 48px 0;
  color: var(--rg-muted);
  text-align: center;
}

/* ---------- Tablette et téléphone ---------- */

@media (max-width: 960px) {
  .bl-toc {
    display: none;
  }

  .bl-article {
    margin: 0 auto;
  }

  .bl-card--une {
    grid-template-columns: 1fr;
  }

  .bl-grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .bl-cycle {
    padding: 18px 16px;
  }

  .bl-cycle ol {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .bl-cycle li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
  }

  .bl-cycle__num {
    grid-row: 1 / span 2;
    margin: 0;
  }

  .bl-cycle li + li::before {
    top: -21px;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
  }

  .bl-pause {
    flex-direction: column;
    align-items: flex-start;
  }

  .bl-fin {
    padding: 24px 18px;
  }

  .bl-fin .rg-btn {
    width: 100%;
  }


  .bl-card--une .bl-card__body {
    padding: 22px 20px 24px;
  }

  .bl-grille {
    grid-template-columns: 1fr;
  }

  .bl-prose {
    font-size: 17px;
  }

  .bl-bref {
    padding: 18px;
  }
}

/* ---------- Chapô, « Lire aussi », suggestions ---------- */

.bl-chapo {
  max-width: 62ch;
}

.bl-lire {
  margin: 4px 0 24px !important;
  padding: 12px 16px;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  background: var(--rg-bg-soft);
  color: var(--rg-muted);
  font-size: 15.5px;
  line-height: 1.5;
}

.bl-lire strong {
  color: var(--rg-navy-900);
}

.bl-suggestions {
  padding: 48px 0 8px;
  border-top: 1px solid var(--rg-line);
  background: var(--rg-bg-soft);
}

.bl-suggestions h2 {
  margin: 0 0 20px;
  color: var(--rg-navy-900);
  font-size: 24px;
}

.bl-suggestions .bl-grille {
  margin-bottom: 40px;
}

.bl-card {
  display: flex;
  flex-direction: column;
}

.bl-card--une {
  display: grid;
}

.bl-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.bl-card:not(.bl-card--une) .bl-card__titre {
  font-size: 18px;
}

.bl-card__lire {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--rg-navy) !important;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
}

.bl-card__lire .rg-ico {
  width: 16px;
  height: 16px;
}

.bl-card__img {
  aspect-ratio: 1200 / 630;
}

.bl-card--une {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

/* L'image garde ses proportions ; la colonne prend la couleur de fond des
   couvertures, sans bande blanche au-dessus ni en dessous. */
.bl-card--une .bl-card__img {
  display: flex;
  align-items: center;
  align-self: stretch;
  aspect-ratio: auto;
  background: #f3f6fb;
}

.bl-card--une .bl-card__img img {
  height: auto;
}

/* Tablette et téléphone : l'article à la une passe sur une colonne, image en
   haut (cette règle doit rester après la grille à deux colonnes ci-dessus). */
@media (max-width: 960px) {
  .bl-card--une {
    grid-template-columns: 1fr;
  }

  .bl-card--une .bl-card__img {
    aspect-ratio: 1200 / 630;
  }

  .bl-card--une .bl-card__img img {
    height: 100%;
  }
}

/*
 * Formulaires de maths (ressources gratuites). Préfixe « fm- ». Les
 * formules gardent les styles des fiches du site (optitab-doc.css) ; ce
 * fichier règle les tableaux de formules, les pastilles de niveau, les
 * cartes et l'impression.
 */

/* ---------- Pastilles de niveau ---------- */

.fm-niveau {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--rg-font);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

.fm-niveau--college {
  background: var(--rg-green-50);
  color: var(--rg-green-700);
}

.fm-niveau--lycee {
  background: var(--rg-navy-50);
  color: var(--rg-navy);
}

.fm-niveau--superieur {
  background: var(--rg-orange-50);
  color: var(--rg-orange-700);
}

.fm-niveau--primaire {
  background: #fdf2f8;
  color: #9d2a64;
}

.fm-niveau--maternelle {
  background: #f5effb;
  color: #6c3fa3;
}

.fm-legende {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
}

.fm-legende__titre {
  margin-right: 2px;
  color: var(--rg-muted);
  font-size: 13.5px;
  font-weight: 600;
}

/* Pastille dans un titre de partie : à la suite du titre, jamais coupée. */
.fm-sci .otm.otm .otm-h2 .fm-niveau {
  position: relative;
  top: -2px;
  margin-left: 10px;
}

/* ---------- Tableaux de formules ---------- */

/* Tous les tableaux occupent la largeur de la page, comme sur une fiche imprimée. */
.fm-sci .otm.otm table.otm-table {
  width: 100%;
  margin: 0;
}

.fm-sci .otm.otm .otm-scroll {
  margin: 1.25em 0 1.4em;
}

.fm-sci .otm.otm table.otm-table th,
.fm-sci .otm.otm table.otm-table td {
  padding: 0.62em 1em;
}

.fm-sci .otm.otm table.otm-table tbody tr:nth-child(even) td {
  background: #f8f9fc;
}

/* Tableau à deux colonnes « nom en mots | formule » (classe fm-t2) : lecture
   de gauche à droite. Les tableaux dont la première colonne est une formule
   (limites, dérivées…) restent centrés, comme dans les livres. */
.fm-sci .otm.otm table.otm-table.fm-t2 th:first-child,
.fm-sci .otm.otm table.otm-table.fm-t2 td:first-child {
  width: 34%;
  text-align: left;
}

.fm-sci .otm.otm table.otm-table.fm-t2 th:last-child,
.fm-sci .otm.otm table.otm-table.fm-t2 td:last-child {
  text-align: left;
}

.fm-sci .otm.otm table.otm-table.fm-t2 td:first-child {
  font-family: var(--rg-font);
  font-size: 0.86em;
  line-height: 1.45;
}

/* Tableau à deux colonnes « symbole | explication en phrases » (classe
   fm-texte) : symbole centré, explication alignée à gauche. */
.fm-sci .otm.otm table.otm-table.fm-texte td:first-child {
  width: 24%;
  white-space: nowrap;
  font-size: 1.1em;
}

.fm-sci .otm.otm table.otm-table.fm-texte th:last-child,
.fm-sci .otm.otm table.otm-table.fm-texte td:last-child {
  text-align: left;
}

/* Tableau à trois colonnes ou plus dont la première colonne est un libellé
   (figure, solide…) : libellé à gauche, dans la police du site. */
.fm-sci .otm.otm table.otm-table.fm-libelles th:first-child,
.fm-sci .otm.otm table.otm-table.fm-libelles td:first-child {
  text-align: left;
}

.fm-sci .otm.otm table.otm-table.fm-libelles td:first-child {
  font-family: var(--rg-font);
  font-size: 0.86em;
  line-height: 1.45;
}

/* Grands tableaux de nombres (6 colonnes ou plus : table de multiplication,
   loi normale…) : grille compacte, chiffres alignés, aucune largeur minimale. */
.fm-sci .otm.otm table.otm-table.fm-grille-n th,
.fm-sci .otm.otm table.otm-table.fm-grille-n td {
  min-width: 0;
  padding: 0.5em 0.45em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fm-sci .otm.otm table.otm-table.fm-grille-n td:first-child,
.fm-sci .otm.otm table.otm-table.fm-grille-n th:first-child {
  background: var(--rg-navy-50);
}

.fm-sci .otm.otm table.otm-table.fm-grille-n thead th {
  background: var(--rg-navy-50);
  color: var(--rg-navy);
  font-size: 0.9em;
}

/* Les figures : centrées, sans marge excessive. */
.fm-sci .course-figure {
  margin: 1.6em 0 !important;
}

.fm-sci .course-figure img {
  display: block;
  margin: 0 auto;
}

/* ---------- Page ---------- */

.fm-doc .rg-doc__tools {
  margin-bottom: 4px;
}

/* Le premier titre de partie n'a pas besoin de la grande marge du haut. */
.fm-sci .otm.otm > .otm-h2:first-child {
  margin-top: 0.4em;
}

.fm-toc .rg-toc__box ol {
  max-height: calc(100vh - var(--rg-header) - 120px);
  overflow-y: auto;
}

.fm-lies {
  margin-top: 48px;
}

.fm-lies .rg-next__title {
  font-size: 17px;
}

.fm-faq {
  margin: 48px 0 0;
}

.fm-faq h2 {
  font-size: 22px;
}

/* ---------- Cartes (accueil, liste des formulaires) ---------- */

.fm-hub {
  padding-top: 40px;
}

/* Grille de 3 cartes (9 formulaires = 3 × 3), 2 sur tablette, 1 sur téléphone. */
.fm-grille {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 900px) {
  .fm-grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fm-hub .fm-grille {
  margin-bottom: 48px;
}

/* Carte : aperçu de la figure, titre, une ligne de mots-clés. */
.fm-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  background: #fff;
  color: var(--rg-ink) !important;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.fm-card:hover {
  border-color: var(--rg-navy);
  box-shadow: var(--rg-shadow);
  transform: translateY(-2px);
}

/* Aperçu de hauteur fixe : l'image s'y loge sans jamais l'agrandir. */
.fm-card__visuel {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--rg-line);
  background: #fff;
}

.fm-sci .fm-card__visuel img,
.fm-card__visuel img {
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  max-width: none;
  object-fit: contain;
}

.fm-card__corps {
  display: block;
  padding: 16px 18px 18px;
}

.fm-card__titre {
  margin: 0;
  color: var(--rg-navy-900);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.fm-card:hover .fm-card__titre {
  color: var(--rg-navy);
}

.fm-card__resume {
  display: block;
  margin-top: 4px;
  color: var(--rg-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.fm-autres {
  margin: 8px 0 40px;
}

.fm-autres h2 {
  margin: 0 0 16px;
  color: var(--rg-navy-900);
  font-size: 22px;
}

/* ---------- Maths en maternelle ---------- */

/* Liste : un titre par section (grande, moyenne, petite), son âge en pastille. */
.fm-section__titre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0 0 18px;
  color: var(--rg-navy-900);
  font-size: 22px;
}

.fm-section__titre span {
  padding: 3px 11px;
  border-radius: 999px;
  background: #f5effb;
  color: #6c3fa3;
  font-size: 13px;
  font-weight: 600;
}

.fm-hub .fm-section .fm-grille {
  margin-bottom: 0;
}

.fm-section + .fm-section {
  margin-top: 40px;
}

/* Section d'une seule page : la carte s'étale (aperçu à gauche, titre à droite). */
.fm-section .fm-grille:has(> .fm-card:only-child) {
  grid-template-columns: minmax(0, 760px);
}

.fm-section .fm-card:only-child {
  flex-direction: row;
  align-items: center;
}

.fm-section .fm-card:only-child .fm-card__visuel {
  flex: 0 0 42%;
  border-right: 1px solid var(--rg-line);
  border-bottom: 0;
}

.fm-section .fm-card:only-child .fm-card__corps {
  padding: 24px 28px;
}

.fm-section .fm-card:only-child .fm-card__titre {
  font-size: 20px;
}

.fm-section .fm-card:only-child .fm-card__resume {
  margin-top: 8px;
  font-size: 14.5px;
}

.fm-bientot {
  margin: 22px 0 48px;
  color: var(--rg-muted);
  font-size: 14.5px;
}

/* Page : encadrés titrés par leur seul titre (« La bonne réponse »,
   « Erreur fréquente »…), dans la couleur de l'encadré. */
.fm-doc--maternelle .otm.otm .otm-box-label {
  display: none;
}

.fm-doc--maternelle .otm.otm .otm-box-title {
  color: var(--box-accent);
  font-weight: 700;
}

/* Illustrations : à taille de dessin d'enfant, la réponse un peu plus petite,
   posée comme une fiche sur le fond vert de « La bonne réponse ». */
.fm-doc.fm-doc--maternelle .fm-sci .course-figure img {
  max-width: min(100%, 540px) !important;
}

.fm-doc--maternelle .fm-sci .otm-box--resultat .course-figure {
  margin: 0.9em 0 0.35em !important;
}

.fm-doc--maternelle .fm-sci .otm-box--resultat .course-figure img {
  max-width: min(100%, 440px) !important;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(59, 133, 68, 0.2);
}

/* ---------- Téléphone ---------- */

@media (max-width: 640px) {
  .fm-sci .otm.otm table.otm-table.fm-grille-n {
    font-size: 0.8em;
  }

  .fm-sci .otm.otm table.otm-table.fm-grille-n th,
  .fm-sci .otm.otm table.otm-table.fm-grille-n td {
    padding: 0.42em 0.18em;
  }

  .fm-sci .otm.otm table.otm-table th,
  .fm-sci .otm.otm table.otm-table td {
    padding: 0.55em 0.6em;
  }

  /* Cartes compactes : petit aperçu à gauche, titre à droite. */
  .fm-grille {
    gap: 12px;
  }

  .fm-card {
    flex-direction: row;
    align-items: center;
  }

  .fm-grille {
    grid-template-columns: minmax(0, 1fr);
  }

  .fm-card__visuel {
    flex: 0 0 104px;
    width: 104px;
    aspect-ratio: 1;
    border-bottom: 0;
    border-right: 1px solid var(--rg-line);
  }

  .fm-card__visuel img {
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
  }

  .fm-card__corps {
    padding: 12px 14px;
  }

  .fm-card__titre {
    font-size: 15.5px;
  }

  .fm-card__resume {
    font-size: 13px;
  }

  /* Tableau nom | formule : le nom au-dessus de sa formule, sur toute la largeur. */
  .fm-sci .otm.otm table.otm-table.fm-t2,
  .fm-sci .otm.otm table.otm-table.fm-t2 tbody,
  .fm-sci .otm.otm table.otm-table.fm-t2 tr,
  .fm-sci .otm.otm table.otm-table.fm-t2 td {
    display: block;
    width: 100%;
  }

  .fm-sci .otm.otm table.otm-table.fm-t2 thead {
    display: none;
  }

  .fm-sci .otm.otm table.otm-table.fm-t2 tr {
    padding: 0.55em 0.7em 0.6em;
  }

  .fm-sci .otm.otm table.otm-table.fm-t2 tbody tr:nth-child(even) {
    background: #f8f9fc;
  }

  .fm-sci .otm.otm table.otm-table.fm-t2 tbody tr:nth-child(even) td {
    background: none;
  }

  .fm-sci .otm.otm table.otm-table.fm-t2 tbody tr + tr {
    border-top: 1px solid #e8ebf1;
  }

  .fm-sci .otm.otm table.otm-table.fm-t2 tbody tr + tr td {
    border-top: 0;
  }

  .fm-sci .otm.otm table.otm-table.fm-t2 td,
  .fm-sci .otm.otm table.otm-table.fm-t2 td:first-child {
    width: 100%;
    padding: 0;
  }

  .fm-sci .otm.otm table.otm-table.fm-t2 td:first-child {
    margin-bottom: 0.3em;
    font-size: 0.8em;
    letter-spacing: 0.01em;
  }

  .fm-sci .otm.otm .otm-h2 .fm-niveau {
    top: -1px;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 10.5px;
  }

  /* Carte seule d'une section : aperçu en haut, sur toute la largeur. */
  .fm-section .fm-card:only-child {
    flex-direction: column;
    align-items: stretch;
  }

  .fm-section .fm-card:only-child .fm-card__visuel {
    flex: none;
    width: auto;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1px solid var(--rg-line);
  }

  .fm-section .fm-card:only-child .fm-card__visuel img {
    inset: 14px;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
  }

  .fm-section .fm-card:only-child .fm-card__corps {
    padding: 14px 16px 16px;
  }

  .fm-section .fm-card:only-child .fm-card__titre {
    font-size: 17px;
  }

  .fm-section__titre {
    font-size: 20px;
  }
}

/* ---------- Impression : le formulaire seul ---------- */

@media print {
  .fm-legende,
  .fm-lies,
  .fm-faq,
  .fm-autres {
    display: none !important;
  }

  .fm-sci .otm.otm table.otm-table,
  .fm-sci .course-figure,
  .fm-sci .otm.otm .otm-box {
    break-inside: avoid;
  }

  .fm-sci .otm.otm .otm-h2 {
    break-after: avoid;
  }

  .fm-sci .otm.otm table.otm-table tbody tr:nth-child(even) td {
    background: none;
  }

  /* Maternelle : « Imprimer les activités » donne la fiche de l'enfant, une
     activité par page (titre, consigne, dessin), sans les réponses ni les
     textes pour les parents, qui restent à l'écran. */
  .fm-doc--maternelle .otm.otm > :not(h2[id^="activite"], h2[id^="activite"] ~ *),
  .fm-doc--maternelle .otm.otm > h2[id^="jeux"],
  .fm-doc--maternelle .otm.otm > h2[id^="jeux"] ~ *,
  .fm-doc--maternelle .otm.otm > .otm-box {
    display: none !important;
  }

  .fm-doc--maternelle .otm.otm > h2[id^="activite"] ~ h2[id^="activite"] {
    break-before: page;
  }

  /* La première activité partage sa page avec le titre : dessin un peu plus petit. */
  .fm-doc.fm-doc--maternelle .fm-sci .course-figure img {
    max-width: 13cm !important;
  }

  .fm-doc.fm-doc--maternelle .fm-sci .otm.otm > h2[id^="activite"] ~ h2[id^="activite"] ~ .otm-figure img {
    max-width: 16.5cm !important;
  }
}

/* ---------- Calculateurs (outils.mjs) ---------- */

.otc {
  margin: 8px 0 36px;
  padding: 24px;
  border: 1px solid var(--rg-navy-100);
  border-radius: var(--rg-radius);
  background: linear-gradient(180deg, var(--rg-navy-50), #fff 70%);
  box-shadow: var(--rg-shadow);
  font-family: var(--rg-font);
}

.otc__kicker {
  margin: 0 0 4px;
  color: var(--rg-green-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.otc__titre {
  margin: 0;
  color: var(--rg-navy-900);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.otc__intro {
  margin: 6px 0 18px;
  color: var(--rg-muted);
  font-size: 15px;
  line-height: 1.5;
}

.otc__onglets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.otc__onglet {
  padding: 9px 14px;
  border: 1px solid var(--rg-line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--rg-ink-soft);
  font: 600 14px/1.2 var(--rg-font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.otc__onglet:hover {
  border-color: var(--rg-navy);
  color: var(--rg-navy);
}

.otc__onglet[aria-selected='true'] {
  border-color: var(--rg-navy);
  background: var(--rg-navy);
  color: #fff;
}

.otc__onglet:focus-visible,
.otc__champ:focus-visible,
.otc__menu:focus-visible {
  outline: 3px solid rgba(27, 60, 142, 0.35);
  outline-offset: 2px;
}

.otc__phrase {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 10px;
  margin: 0;
  color: var(--rg-ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.otc__champ,
.otc__menu {
  box-sizing: border-box;
  min-height: 48px;
  padding: 8px 12px;
  border: 1.5px solid var(--rg-line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--rg-navy-900);
  font: 700 18px/1.2 var(--rg-font);
}

.otc__champ {
  width: calc(var(--w, 6) * 0.72em + 28px);
  max-width: 100%;
  text-align: center;
}

.otc__champ.is-faux {
  border-color: var(--rg-red-700);
  background: var(--rg-red-50);
}

.otc__menu {
  padding-right: 8px;
  cursor: pointer;
}

.otc__resultat {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--rg-line);
  border-left: 4px solid var(--rg-green);
}

.otc.is-vide .otc__resultat {
  border-left-color: var(--rg-line-strong);
}

.otc__res-lib {
  margin: 0;
  color: var(--rg-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.otc__res {
  margin: 2px 0 6px;
  color: var(--rg-green-700);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.otc__calc {
  margin: 0;
  color: var(--rg-ink-soft);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.otc__frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.otc__frac .otc__champ {
  min-height: 42px;
}

.otc__barre {
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: var(--rg-navy-900);
}

.otc__lignes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.otc__ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--rg-ink);
  font-size: 16px;
  font-weight: 600;
}

.otc__num {
  min-width: 64px;
  color: var(--rg-muted);
  font-size: 14px;
}

.otc__suppr {
  width: 40px;
  height: 40px;
  border: 1px solid var(--rg-line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--rg-muted);
  font: 600 20px/1 var(--rg-font);
  cursor: pointer;
}

.otc__suppr:hover {
  border-color: var(--rg-red-700);
  color: var(--rg-red-700);
}

.otc__ajout {
  margin-top: 14px;
  padding: 10px 16px;
  border: 1.5px dashed var(--rg-navy);
  border-radius: 12px;
  background: #fff;
  color: var(--rg-navy);
  font: 700 15px/1.2 var(--rg-font);
  cursor: pointer;
}

.otc__ajout:hover {
  background: var(--rg-navy-50);
}

.otc__suppr:focus-visible,
.otc__ajout:focus-visible {
  outline: 3px solid rgba(27, 60, 142, 0.35);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .otc {
    padding: 18px 16px;
  }

  .otc__titre {
    font-size: 19px;
  }

  .otc__onglet {
    padding: 8px 12px;
    font-size: 13px;
  }

  .otc__phrase {
    font-size: 16px;
  }

  .otc__res {
    font-size: 28px;
  }

  /* Moyenne : « Note n | note | coef. | coefficient | × » sur une seule ligne. */
  .otc__ligne {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .otc__num {
    min-width: 0;
    flex: 0 0 auto;
    font-size: 13px;
  }

  .otc__ligne .otc__champ {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
  }

  .otc__ligne [data-note] {
    flex-grow: 1.4;
  }

  .otc__suppr {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }
}

@media print {
  .otc {
    display: none !important;
  }
}

/* ---------- Fiches à imprimer : téléchargements PDF ---------- */

.fm-pdf {
  display: grid;
  gap: 12px;
  margin: 8px 0 32px;
  padding: 20px 22px;
  border: 1px solid var(--rg-navy-100);
  border-radius: var(--rg-radius);
  background: var(--rg-navy-50);
  font-family: var(--rg-font);
}

.fm-pdf__ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.fm-pdf__ligne + .fm-pdf__ligne {
  padding-top: 12px;
  border-top: 1px solid var(--rg-navy-100);
}

.fm-pdf__titre {
  margin: 0;
  color: var(--rg-navy-900);
  font-size: 17px;
  font-weight: 700;
}

.fm-pdf__boutons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fm-pdf__btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .fm-pdf {
    padding: 16px;
  }

  .fm-pdf__boutons,
  .fm-pdf__btn {
    width: 100%;
  }

  .fm-pdf__btn {
    justify-content: center;
  }
}

@media print {
  .fm-pdf {
    display: none !important;
  }
}

/* ---------- Grande carte d’une rubrique qui n’a qu’une page ---------- */

.fm-vedette {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  overflow: hidden;
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius);
  background: #fff;
  color: var(--rg-ink) !important;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.fm-vedette:hover {
  border-color: var(--rg-navy);
  box-shadow: var(--rg-shadow);
  transform: translateY(-2px);
}

.fm-vedette__visuel {
  position: relative;
  display: block;
  min-height: 220px;
  border-right: 1px solid var(--rg-line);
  background: #fff;
}

.fm-vedette__visuel img {
  position: absolute;
  inset: 24px;
  width: calc(100% - 48px);
  height: calc(100% - 48px);
  object-fit: contain;
}

.fm-vedette__corps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 28px;
}

.fm-vedette__kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rg-green-700, #2f7a3a);
}

.fm-vedette__titre {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--rg-navy-900);
}

.fm-vedette__texte {
  font-size: 15px;
  line-height: 1.6;
  color: var(--rg-muted);
}

.fm-vedette__resume {
  font-size: 14px;
  font-weight: 600;
  color: var(--rg-ink-soft);
}

.fm-vedette__lien {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--rg-navy);
}

.fm-vedette__lien .rg-ico {
  width: 18px;
  height: 18px;
}

@media (max-width: 760px) {
  .fm-vedette {
    grid-template-columns: minmax(0, 1fr);
  }

  .fm-vedette__visuel {
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid var(--rg-line);
  }

  .fm-vedette__visuel img {
    inset: 14px;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
  }

  .fm-vedette__corps {
    padding: 18px;
  }

  .fm-vedette__titre {
    font-size: 19px;
  }
}

/* ---------- Tableau périodique interactif (physique-chimie/tableau-periodique) ---------- */

.tp {
  margin: 8px 0 36px;
  padding: 24px;
  border: 1px solid var(--rg-navy-100);
  border-radius: var(--rg-radius);
  background: linear-gradient(180deg, var(--rg-navy-50), #fff 60%);
  box-shadow: var(--rg-shadow);
  font-family: var(--rg-font);
}

/* Couleurs des familles : teintes claires, texte foncé (contraste suffisant). */
.tp--alcalin { background: #ffdcd8; }
.tp--alcalino-terreux { background: #ffe7c9; }
.tp--transition { background: #fff2b8; }
.tp--metal-pauvre { background: #e3e8ef; }
.tp--lanthanide { background: #e2f3c8; }
.tp--actinide { background: #cfeedd; }
.tp--metalloide { background: #d2edf2; }
.tp--non-metal { background: #d9e7ff; }
.tp--halogene { background: #e8dcff; }
.tp--gaz-noble { background: #ffdcee; }

.tp__glisser {
  display: none;
  margin: 0 0 8px;
  color: var(--rg-muted);
  font-size: 13px;
  font-weight: 600;
}

.tp__defile {
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.tp__defile:focus-visible {
  outline: 3px solid rgba(27, 60, 142, 0.35);
  outline-offset: 2px;
  border-radius: 8px;
}

.tp__grille {
  display: grid;
  grid-template-columns: repeat(18, minmax(34px, 1fr));
  grid-template-rows: repeat(8, auto) 10px auto auto;
  gap: 3px;
  min-width: 664px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tp__grille > li {
  margin: 0;
  padding: 0;
}

.tp__groupe {
  align-self: end;
  padding-bottom: 2px;
  color: var(--rg-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.tp__el {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  padding: 2px 0;
  border: 1px solid rgba(18, 26, 51, 0.12);
  border-radius: 6px;
  color: var(--rg-ink);
  font-family: var(--rg-font);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.tp__el:hover {
  border-color: var(--rg-navy);
  box-shadow: 0 2px 8px rgba(16, 32, 79, 0.18);
  transform: translateY(-1px);
}

.tp__el:focus-visible {
  outline: 3px solid rgba(27, 60, 142, 0.45);
  outline-offset: 1px;
}

.tp__el[aria-pressed='true'] {
  border: 2px solid var(--rg-navy-900);
  box-shadow: 0 2px 10px rgba(16, 32, 79, 0.25);
}

.tp__z {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  color: var(--rg-ink-soft);
}

.tp__s {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.tp__renvoi {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--rg-ink-soft);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.tp__legende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--rg-ink-soft);
  font-size: 13.5px;
}

.tp__legende li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tp__pastille {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(18, 26, 51, 0.15);
  border-radius: 4px;
}

/* Fiche de l'élément choisi */
.tp__fiche {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  background: #fff;
}

.tp__fiche-tete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 92px;
  height: 100px;
  border: 1px solid rgba(18, 26, 51, 0.15);
  border-radius: 10px;
}

.tp__fiche-z {
  font-size: 15px;
  font-weight: 600;
  color: var(--rg-ink-soft);
}

.tp__fiche-s {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--rg-ink);
}

.tp__fiche-corps {
  flex: 1;
  min-width: 0;
}

.tp__fiche-nom {
  margin: 0 0 8px;
  color: var(--rg-navy-900);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.tp__fiche-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px 18px;
  margin: 0;
}

.tp__fiche-dl div {
  min-width: 0;
}

.tp__fiche-dl dt {
  color: var(--rg-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.tp__fiche-dl dd {
  margin: 0;
  color: var(--rg-ink);
  font-size: 15px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .tp {
    margin-right: calc(-1 * var(--rg-gutter) + 4px);
    margin-left: calc(-1 * var(--rg-gutter) + 4px);
    padding: 18px 12px;
  }

  .tp__glisser {
    display: block;
  }

  .tp__grille {
    grid-template-columns: repeat(18, 42px);
    min-width: 0;
  }

  .tp__fiche {
    flex-direction: column;
    align-items: stretch;
  }

  .tp__fiche-tete {
    flex-direction: row;
    gap: 10px;
    width: auto;
    height: auto;
    padding: 10px 14px;
    justify-content: flex-start;
  }

  .tp__fiche-s {
    font-size: 30px;
  }

  .tp__fiche-dl {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  .tp__glisser,
  .tp__fiche {
    display: none;
  }

  .tp {
    box-shadow: none;
  }
}

/* ---------- Horloge interactive (methodes/lire-l-heure) ---------- */

.hl__grille {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.hl-cadran {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto;
}

.hl-bord { fill: var(--rg-navy-900); }
.hl-fond { fill: #fff; }
.hl-t1 { stroke: #9aa3b5; stroke-width: 1; }
.hl-t5 { stroke: var(--rg-navy-900); stroke-width: 2.4; stroke-linecap: round; }
.hl-n { fill: var(--rg-navy-900); font: 700 17px var(--rg-font); text-anchor: middle; dominant-baseline: central; }
.hl-mn { fill: var(--rg-green-700); font: 600 9.5px var(--rg-font); text-anchor: middle; dominant-baseline: central; }
.hl-ah { stroke: var(--rg-navy); stroke-width: 7; stroke-linecap: round; }
.hl-am { stroke: #e8892c; stroke-width: 4.5; stroke-linecap: round; }
.hl-centre { fill: var(--rg-navy-900); }

.hl__num {
  margin: 0;
  color: var(--rg-navy-900);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.hl__mots {
  margin: 8px 0 0;
  color: var(--rg-ink);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}

.hl__24 {
  margin: 6px 0 0;
  color: var(--rg-muted);
  font-size: 14.5px;
}

.hl__boutons,
.hl__niveaux {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hl__niveaux {
  margin: 0 0 16px;
}

.hl__btn,
.hl__niveau,
.hl__reponse {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--rg-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--rg-ink);
  font: 600 15px/1.2 var(--rg-font);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.hl__btn:hover,
.hl__niveau:hover,
.hl__reponse:hover:not(:disabled) {
  border-color: var(--rg-navy);
  color: var(--rg-navy);
}

.hl__btn:focus-visible,
.hl__niveau:focus-visible,
.hl__reponse:focus-visible {
  outline: 3px solid rgba(27, 60, 142, 0.35);
  outline-offset: 2px;
}

.hl__niveau[aria-checked='true'] {
  border-color: var(--rg-navy);
  background: var(--rg-navy);
  color: #fff;
}

.hl__consigne {
  margin: 0 0 12px;
  color: var(--rg-navy-900);
  font-size: 18px;
  font-weight: 700;
}

.hl__choix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hl__reponse {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.hl__reponse:disabled {
  cursor: default;
}

.hl__reponse.is-juste {
  border-color: var(--rg-green-700);
  background: var(--rg-green-50);
  color: var(--rg-green-700);
}

.hl__reponse.is-faux {
  border-color: var(--rg-red-700);
  background: var(--rg-red-50);
  color: var(--rg-red-700);
}

.hl__retour {
  min-height: 1.5em;
  margin: 12px 0 0;
  font-size: 15.5px;
  line-height: 1.5;
}

.hl__retour.is-juste { color: var(--rg-green-700); }
.hl__retour.is-faux { color: var(--rg-red-700); }

.hl__suite {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.hl__score {
  color: var(--rg-muted);
  font-weight: 600;
}

@media (max-width: 640px) {
  .hl__grille {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .hl-cadran {
    max-width: 230px;
  }

  .hl__lecture {
    text-align: center;
  }

  .hl__num {
    font-size: 34px;
  }

  .hl__mots {
    font-size: 17px;
  }

  .hl__boutons .hl__btn {
    flex: 1 1 30%;
  }

  .hl__btn--large {
    flex-basis: 100% !important;
  }
}

@media print {
  .hl {
    display: none;
  }
}

/* ---------- Simulateur du brevet (methodes/simulateur-brevet) ---------- */

.bv__aide {
  margin: -8px 0 16px;
  color: var(--rg-muted);
  font-size: 13.5px;
}

.bv__bloc {
  margin: 0 0 16px;
  padding: 16px 18px 12px;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  background: #fff;
}

/* Titre du bloc à l'intérieur du cadre (sur le cadre, il le chevauchait sur téléphone). */
.bv__bloc legend {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  line-height: 1.35;
  color: var(--rg-navy-900);
  font-size: 16px;
  font-weight: 700;
}

.bv__bloc legend span {
  color: var(--rg-green-700);
  font-weight: 600;
}

.bv__bloc legend + * {
  clear: both;
}

.bv__grille {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.bv__option {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 10px 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--rg-line-strong);
}

/* Libellé en haut, champ en bas : les champs d'une même ligne restent alignés
   même quand un libellé tient sur deux lignes. */
.bv__champ {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.bv__lib {
  color: var(--rg-ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}

.bv__lib em {
  color: var(--rg-navy);
  font-style: normal;
  font-weight: 700;
}

.bv__champ input,
.bv__champ select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--rg-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--rg-ink);
  font: 600 16px var(--rg-font);
}

.bv__champ input:focus,
.bv__champ select:focus {
  border-color: var(--rg-navy);
  outline: 3px solid rgba(27, 60, 142, 0.2);
}

.bv__champ input:disabled {
  background: var(--rg-bg-soft);
  color: var(--rg-muted);
}

.bv__champ input.is-erreur {
  border-color: var(--rg-red-700);
  background: var(--rg-red-50);
}

.bv__sous {
  margin: 12px 0 2px;
  color: var(--rg-ink-soft);
  font-size: 15px;
}

.bv__sous strong {
  color: var(--rg-navy-900);
}

.bv__resultat {
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--rg-navy-900);
  color: #fff;
}

.bv__resultat .otc__res-lib {
  color: #c9d6f2;
}

.bv__note {
  margin: 2px 0 0;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.bv__verdict {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.bv__verdict.is-oui { color: #a5e3a7; }
.bv__verdict.is-non { color: #ffc2bb; }

.bv__calc {
  margin: 6px 0 0;
  color: #c9d6f2;
  font-size: 14px;
}

.bv__viser {
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  background: #fff;
}

.bv__viser-titre {
  margin: 0 0 8px;
  color: var(--rg-navy-900);
  font-size: 15.5px;
  font-weight: 700;
}

.bv .bv__viser ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bv__viser li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--rg-line);
  font-size: 15px;
}

.bv__viser li:first-child {
  border-top: 0;
}

.bv__viser strong {
  color: var(--rg-navy);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .bv__bloc {
    padding: 12px 12px 10px;
  }

  .bv__grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bv__option {
    grid-template-columns: minmax(0, 1fr);
  }

  .bv__note {
    font-size: 34px;
  }
}

@media print {
  .bv {
    display: none;
  }
}

/* ---------- Convertisseur d'unités (methodes/convertisseur-d-unites) ---------- */

.cv__grille {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto minmax(0, 1.6fr);
  align-items: end;
  gap: 12px 12px;
}

.cv__champ {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.cv__champ--grandeur {
  grid-column: 1 / -1;
  max-width: 360px;
}

.cv__lib {
  color: var(--rg-ink-soft);
  font-size: 13.5px;
  font-weight: 700;
}

.cv .otc__menu,
.cv .otc__champ {
  width: 100%;
  min-width: 0;
  font-size: 16px;
}

.cv .cv__valeur {
  text-align: left;
}

.cv__inverser {
  min-width: 48px;
  min-height: 48px;
  border: 1.5px solid var(--rg-line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--rg-navy);
  font: 700 20px/1 var(--rg-font);
  cursor: pointer;
}

.cv__inverser:hover {
  border-color: var(--rg-navy);
  background: var(--rg-navy-50);
}

.cv__inverser:focus-visible {
  outline: 3px solid rgba(27, 60, 142, 0.35);
  outline-offset: 2px;
}

.cv__tout {
  margin-top: 16px;
}

.cv__tout-titre {
  margin: 0 0 8px;
  color: var(--rg-navy-900);
  font-size: 15px;
  font-weight: 700;
}

.cv .cv__liste {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv .cv__liste li {
  margin: 0;
}

.cv__liste button {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--rg-line);
  border-radius: 10px;
  background: #fff;
  color: var(--rg-ink);
  font: 500 14.5px/1.35 var(--rg-font);
  text-align: left;
  cursor: pointer;
}

.cv__liste button:hover {
  border-color: var(--rg-navy);
}

.cv__liste button[aria-current='true'] {
  border-color: var(--rg-green);
  background: var(--rg-green-50, #eef8ef);
}

.cv__liste strong {
  color: var(--rg-navy-900);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.cv__liste span {
  color: var(--rg-muted);
}

@media (max-width: 640px) {
  /* Téléphone : un champ par ligne, le bouton d'inversion entre « De » et « Vers ». */
  .cv__grille {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .cv__champ--grandeur {
    max-width: none;
  }

  .cv__inverser {
    justify-self: center;
    min-height: 40px;
  }

  .cv .cv__liste {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .cv {
    display: none;
  }
}

/* ---------- Masse volumique des matériaux (physique-chimie/masse-volumique-des-materiaux) ---------- */

.mv__recherche {
  margin-bottom: 18px;
}

.mv__lib {
  display: block;
  margin-bottom: 5px;
  color: var(--rg-ink-soft);
  font-size: 13.5px;
  font-weight: 700;
}

.mv .mv__q {
  width: 100%;
  text-align: left;
  font-size: 16px;
}

.mv__compte {
  margin: 10px 0 6px;
  color: var(--rg-muted);
  font-size: 13.5px;
}

.mv .mv__resultats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mv .mv__resultats li {
  margin: 0;
}

.mv__resultats button {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--rg-line);
  border-radius: 10px;
  background: #fff;
  color: var(--rg-ink);
  font: 500 14.5px/1.35 var(--rg-font);
  text-align: left;
  cursor: pointer;
}

.mv__resultats button:hover {
  border-color: var(--rg-navy);
}

.mv__resultats strong {
  color: var(--rg-navy-900);
}

.mv__val {
  color: var(--rg-green-700);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mv__cat {
  flex-basis: 100%;
  color: var(--rg-muted);
  font-size: 12.5px;
}

.mv__calcul {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: end;
  padding-top: 16px;
  border-top: 1px dashed var(--rg-line-strong);
}

.mv__champ {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mv .mv__calcul .otc__menu,
.mv .mv__calcul .otc__champ {
  width: 100%;
  min-width: 0;
  font-size: 16px;
}

.mv .mv__calcul .otc__champ {
  text-align: left;
}

@media (max-width: 640px) {
  .mv .mv__resultats,
  .mv__calcul {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .mv {
    display: none;
  }
}

/* ---------- Barre sous un outil : cours particulier, abonnement, contact ---------- */

.rg-suite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: -20px 0 36px;
  padding: 14px 18px;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  background: var(--rg-bg-soft, #f6f8fc);
  font-family: var(--rg-font);
}

.rg-suite__texte {
  flex: 1 1 280px;
  margin: 0;
  color: var(--rg-ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

.rg-suite__texte strong {
  color: var(--rg-navy-900);
}

.rg-suite__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.rg-suite__contact {
  color: var(--rg-navy);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rg-suite__contact:hover {
  color: var(--rg-navy-900);
}

/* Ligne « Une question ? Écris-nous » sous les appels de fin de page. */
.rg-ctas__contact {
  margin: -8px 0 32px;
  color: var(--rg-muted);
  font-size: 15px;
  text-align: center;
}

.rg-ctas__contact a {
  color: var(--rg-navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .rg-suite {
    margin-top: -24px;
    padding: 14px;
  }

  .rg-suite__actions {
    width: 100%;
  }
}

@media print {
  .rg-suite,
  .rg-ctas__contact {
    display: none;
  }
}

/* Contenus de cours (styles du site) */
/* ============================================================
   OptiTAB — Rendu des contenus scientifiques
   (cours, fiches de synthèse, exercices, corrections)

   Classe de portée : .sci-doc, appliquée à chaque conteneur de
   contenu rendu en v-html (cours, fiches, énoncés, solutions).

   Règle d'or : aucune formule, aucun tableau, aucune image ne
   doit JAMAIS déborder ni casser la mise en page, sur aucun
   écran. Ce qui est trop large défile horizontalement, en place.
   ============================================================ */

.sci-doc {
  overflow-wrap: break-word;
  word-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.75;
  /* Verrou de sécurité : rien ne peut pousser la page sur le côté */
  overflow-x: clip;
}

/* Les blocs du contenu (encadrés colorés des cours inclus)
   restent toujours dans la colonne de lecture */
.sci-doc div,
.sci-doc p,
.sci-doc ul,
.sci-doc ol,
.sci-doc blockquote,
.sci-doc figure,
.sci-doc section {
  max-width: 100%;
  box-sizing: border-box;
}

/* Ancres du sommaire : ne pas coller au bord haut */
.sci-doc h1,
.sci-doc h2,
.sci-doc h3,
.sci-doc h4 {
  scroll-margin-top: 90px;
  overflow-wrap: break-word;
}

.sci-doc ul,
.sci-doc ol {
  padding-left: 1.4rem;
}

/* ------------------------------------------------------------
   Formules MathJax (v3, sortie SVG) — et compat v2 / KaTeX
   ------------------------------------------------------------ */

/* Formules en display : bloc centré. Si la formule est plus
   large que la colonne, elle défile horizontalement en place. */
.sci-doc mjx-container[display="true"],
.sci-doc .MathJax_Display,
.sci-doc .MathJax_SVG_Display,
.sci-doc .katex-display {
  display: block !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  margin: 0.9em auto !important;
  padding: 2px 2px 6px;
  text-align: center !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c6d2e8 transparent;
}

/* Une formule plus large que l'écran se réduit pour tenir :
   le SVG garde ses proportions, rien n'est jamais coupé. */
.sci-doc mjx-container svg {
  max-width: 100% !important;
  height: auto !important;
}

/* Les formules en ligne ne dépassent jamais du paragraphe */
.sci-doc mjx-container:not([display="true"]) {
  max-width: 100% !important;
}

/* Formule trop longue pour être réduite lisiblement (< ~70 %) :
   JS lui ajoute .mjx-scrollable → taille normale + défilement. */
.sci-doc mjx-container.mjx-scrollable {
  display: block !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  margin: 0.5em 0 !important;
  padding: 2px 2px 6px;
  text-align: left !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c6d2e8 transparent;
}

.sci-doc mjx-container.mjx-scrollable svg {
  max-width: none !important;
}

.sci-doc mjx-container.mjx-scrollable::-webkit-scrollbar {
  height: 6px;
}

.sci-doc mjx-container.mjx-scrollable::-webkit-scrollbar-thumb {
  background: #c6d2e8;
  border-radius: 999px;
}

.sci-doc mjx-container.mjx-scrollable::-webkit-scrollbar-track {
  background: transparent;
}

/* Barres de défilement discrètes des formules et tableaux */
.sci-doc mjx-container[display="true"]::-webkit-scrollbar,
.sci-doc .MathJax_Display::-webkit-scrollbar,
.sci-doc .katex-display::-webkit-scrollbar,
.sci-doc table:not(.otm-table)::-webkit-scrollbar,
.sci-doc [data-formula-scroll-wrapper]::-webkit-scrollbar,
.sci-doc [data-table-scroll-wrapper]::-webkit-scrollbar,
.sci-doc pre::-webkit-scrollbar {
  height: 6px;
}

.sci-doc mjx-container[display="true"]::-webkit-scrollbar-thumb,
.sci-doc .MathJax_Display::-webkit-scrollbar-thumb,
.sci-doc .katex-display::-webkit-scrollbar-thumb,
.sci-doc table:not(.otm-table)::-webkit-scrollbar-thumb,
.sci-doc [data-formula-scroll-wrapper]::-webkit-scrollbar-thumb,
.sci-doc [data-table-scroll-wrapper]::-webkit-scrollbar-thumb,
.sci-doc pre::-webkit-scrollbar-thumb {
  background: #c6d2e8;
  border-radius: 999px;
}

.sci-doc mjx-container[display="true"]::-webkit-scrollbar-track,
.sci-doc .MathJax_Display::-webkit-scrollbar-track,
.sci-doc .katex-display::-webkit-scrollbar-track,
.sci-doc table:not(.otm-table)::-webkit-scrollbar-track,
.sci-doc [data-formula-scroll-wrapper]::-webkit-scrollbar-track,
.sci-doc [data-table-scroll-wrapper]::-webkit-scrollbar-track,
.sci-doc pre::-webkit-scrollbar-track {
  background: transparent;
}

/* Wrappers de défilement créés en JS par certaines pages
   (Cours, Fiches) : leur donner enfin leur comportement. */
.sci-doc [data-formula-scroll-wrapper],
.sci-doc [data-table-scroll-wrapper],
.sci-doc [data-horizontal-scroll-wrapper]:not([data-formula-inline-scroll-wrapper]) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c6d2e8 transparent;
}

/* Les wrappers de formules en ligne ne changent rien sur desktop
   (la formule reste dans la phrase) ; sur mobile ils empêchent une
   formule longue de pousser la page. */
.sci-doc [data-formula-inline-scroll-wrapper] {
  display: inline;
}

@media (max-width: 768px) {
  .sci-doc [data-formula-inline-scroll-wrapper] {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    vertical-align: middle;
    scrollbar-width: none;
  }

  .sci-doc [data-formula-inline-scroll-wrapper]::-webkit-scrollbar {
    display: none;
  }
}

/* Un wrapper qui contient une formule déjà contrainte ne doit pas
   créer de double barre */
.sci-doc [data-formula-scroll-wrapper] mjx-container[display="true"] {
  overflow-x: visible !important;
}

/* ------------------------------------------------------------
   Structure pédagogique des énoncés, étapes et solutions
   (classes générées par le rendu des exercices)
   ------------------------------------------------------------ */

/* Titre de question : bien détaché, souligné */
.sci-doc .sd-question {
  font-weight: 800;
  color: #193e8e;
  margin: 1.35rem 0 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #dbeafe;
  line-height: 1.5;
}

.sci-doc .sd-question:first-child {
  margin-top: 0.15rem;
}

/* En-tête d'étape : badge numéroté + intitulé en gras.
   Grille à retrait suspendu : le texte qui passe à la ligne reste
   aligné sous le texte, jamais sous le badge. */
.sci-doc .sd-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.55rem;
  align-items: baseline;
  margin: 1.1rem 0 0.45rem;
  line-height: 1.65;
}

.sci-doc .sd-step:first-child {
  margin-top: 0.15rem;
}

.sci-doc .sd-badge {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.16rem 0.62rem;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: 0.08em;
}

.sci-doc .sd-badge--method {
  background: #0e9f6e;
}

.sci-doc .sd-step-text {
  font-weight: 700;
  color: #0f172a;
}

/* Point principal : puce ronde nette, texte aligné */
.sci-doc .sd-item {
  position: relative;
  padding-left: 1.1rem;
  margin: 0.45rem 0;
  line-height: 1.7;
}

.sci-doc .sd-item::before {
  content: '';
  position: absolute;
  left: 0.1rem;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
}

/* Sous-point : guide vertical, comme une correction rédigée */
.sci-doc .sd-sub {
  position: relative;
  margin: 0.3rem 0 0.3rem 0.5rem;
  padding: 0.1rem 0 0.1rem 0.95rem;
  border-left: 3px solid #dbe6f7;
  line-height: 1.7;
}

.sci-doc .sd-sub + .sd-sub {
  margin-top: 0.15rem;
}

/* Tiret : sous-détail d'un sous-point, avec retrait suspendu.
   Le tiret est en flux (pas en absolu) pour rester sur la même
   ligne de base que le texte, même avec une grande fraction. */
.sci-doc .sd-dash {
  margin: 0.25rem 0 0.25rem 1.45rem;
  padding-left: 0.95rem;
  text-indent: -0.95rem;
  line-height: 1.7;
}

.sci-doc .sd-dash::before {
  content: '–\00a0';
  color: #64748b;
  font-weight: 600;
}

/* Ligne simple */
.sci-doc .sd-line {
  margin: 0.4rem 0;
  line-height: 1.7;
}

/* Bloc de formule display issu du rendu des exercices */
.sci-doc .mathjax-block {
  max-width: 100%;
  margin: 0.55rem 0;
}

/* ------------------------------------------------------------
   Tableaux
   ------------------------------------------------------------ */

/* Présentation unifiée « manuel scolaire » : cadre net arrondi,
   quadrillage fin, en-têtes marqués. Les bordures bricolées en ligne
   dans le contenu sont neutralisées (!important) ; les couleurs de
   fond autorées (lignes de signes, etc.) sont conservées. */
.sci-doc table:not(.otm-table) {
  display: block;
  /* Le tableau épouse son contenu, centré — jamais de cadre vide
     à droite (le width:100% bricolé en ligne est neutralisé).
     max-width !important : les max-width 600/700px écrits en ligne
     ne doivent JAMAIS dépasser la colonne de lecture. */
  width: max-content !important;
  max-width: 100% !important;
  overflow-x: auto;
  margin: 1.1rem auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 2px solid #8aa6cc !important;
  border-radius: 12px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c6d2e8 transparent;
}

.sci-doc table:not(.otm-table) th,
.sci-doc table:not(.otm-table) td {
  border: none !important;
  border-right: 1px solid #d6dfee !important;
  border-bottom: 1px solid #d6dfee !important;
  padding: 0.55rem 0.9rem !important;
  text-align: center !important;
  vertical-align: middle !important;
  min-width: 2.2rem;
}

.sci-doc table:not(.otm-table) tr > th:last-child,
.sci-doc table:not(.otm-table) tr > td:last-child {
  border-right: none !important;
}

.sci-doc table:not(.otm-table) tr:last-child > th,
.sci-doc table:not(.otm-table) tr:last-child > td {
  border-bottom: none !important;
}

/* Cellule d'asymptote d'un tableau de variations : les limites
   (±∞) sont placées aux coins, de part et d'autre d'une double
   barre verticale, comme dans un manuel. La cellule reçoit une
   taille garantie pour que les deux valeurs ne se chevauchent pas. */
.sci-doc td[style*="position:relative"]:has(> div[style*="position:absolute"]),
.sci-doc td[style*="position: relative"]:has(> div[style*="position: absolute"]) {
  min-width: 5.4rem;
  height: 3.4rem;
}

.sci-doc td[style*="position:relative"]:has(> div[style*="position:absolute"])::after,
.sci-doc td[style*="position: relative"]:has(> div[style*="position: absolute"])::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  border-left: 1.5px solid #64748b;
  border-right: 1.5px solid #64748b;
}

/* Flèches de variation (↗ ↘) : plus grandes, bien lisibles
   (classe ajoutée par tuneMathOverflow) */
.sci-doc td.sd-var-arrow {
  font-size: 1.45em;
  font-weight: 700;
  line-height: 1;
}

/* Première ligne et première colonne : rôle d'en-tête, séparées
   par un trait plus fort, comme dans un tableau de variations */
.sci-doc table:not(.otm-table) tr:first-child > th,
.sci-doc table:not(.otm-table) tr:first-child > td {
  background: #eaf2fd;
  color: #1e3a8a;
  font-weight: 700;
  border-bottom: 2px solid #8aa6cc !important;
}

.sci-doc table:not(.otm-table) tr > th:first-child,
.sci-doc table:not(.otm-table) tr > td:first-child {
  background: #eaf2fd;
  color: #1e3a8a;
  font-weight: 700;
  border-right: 2px solid #8aa6cc !important;
}

/* Un tableau déjà dans un wrapper de scroll redevient un vrai tableau */
.sci-doc [data-table-scroll-wrapper] table:not(.otm-table) {
  display: table;
  width: auto;
  max-width: none;
  overflow-x: visible;
  margin: 0 auto;
}

/* ------------------------------------------------------------
   Images et figures
   ------------------------------------------------------------ */

.sci-doc img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 10px;
}

.sci-doc figure {
  margin-left: auto;
  margin-right: auto;
}

.sci-doc figcaption {
  font-size: 0.9em;
  color: #64748b;
}

/* ------------------------------------------------------------
   Code et texte préformaté
   ------------------------------------------------------------ */

.sci-doc pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.sci-doc code {
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------
   Confort de lecture mobile
   ------------------------------------------------------------ */

/* Le grand conteneur décoratif que l'éditeur ajoute autour de
   certains contenus (fond gris + padding 20px) est neutralisé :
   c'est la carte de lecture blanche de la page qui fait l'écrin. */
.sci-doc > div[style*="background:#f9f9f9"],
.sci-doc > div[style*="background: #f9f9f9"] {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

@media (max-width: 768px) {
  .sci-doc {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  /* Les encadrés colorés des cours : padding plus compact que
     les 15-20px fixés en ligne, pour gagner de la largeur utile */
  .sci-doc div[style*="border-left"] {
    padding: 12px 12px !important;
    margin: 12px 0 !important;
  }
}

/* ------------------------------------------------------------
   Contenus au format structuré (OptiTAB v1, classe .otm) :
   la formule centrée est déjà espacée par son bloc .otm-math
   ------------------------------------------------------------ */
.sci-doc .otm .otm-math > mjx-container[display="true"] {
  margin: 0 auto !important;
}

/* ============================================================
   OptiTAB Doc — système de design des contenus structurés
   (format v1, rendu par src/utils/optitabDoc.js)

   Même identité que les livres OptiTAB : palette du logo,
   étiquettes Montserrat en petites capitales espacées, encadrés
   Définition / Théorème / Propriété / Méthode / Attention /
   Exemple / Démonstration, questions numérotées en bleu marine,
   résultats surlignés en vert, tableaux de variations tkz-tab.
   ============================================================ */

.otm.otm {
  --ot-navy: #1b3c8e;
  --ot-navy-dark: #122a66;
  --ot-navy-tint: #f1f3f8;
  --ot-navy-soft: #e4e8f1;
  --ot-navy-line: #98a7cc;
  --ot-green: #5fac60;
  --ot-green-dark: #3b8544;
  --ot-green-tint: #eaf4ea;
  --ot-ink: #1c2130;
  --ot-muted: #6b7385;
  --ot-rule: #d5dae3;
  --ot-orange: #f0a23b;
  --ot-orange-dark: #a86a1c;
  --ot-orange-tint: #fef6eb;
  --ot-font-ui: 'Montserrat', 'Montserrat repli', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --otm-tv-line: #a3aab8;
  --otm-tv-gap-min: 2.5rem;
  --otm-tv-gap-max: 5rem;

  color: var(--ot-ink);
  font-size: 1rem;
  line-height: 1.7;
  text-align: left;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}

.otm.otm > :first-child,
.otm-box-body > :first-child,
.otm-li > :first-child {
  margin-top: 0 !important;
}

.otm.otm > :last-child,
.otm-box-body > :last-child,
.otm-li > :last-child {
  margin-bottom: 0 !important;
}

.otm.otm p {
  margin: 0.55em 0;
  padding: 0;
  text-indent: 0;
}

.otm.otm strong {
  font-weight: 650;
  color: inherit;
}

.otm.otm em {
  font-style: italic;
  color: inherit;
}

/* Formule et ponctuation collée (jamais de « ) » orphelin) */
.otm.otm .otm-nb {
  white-space: nowrap;
}

.otm.otm .otm-nb.otm-nb--libre {
  white-space: normal;
}

/* Formule centrée */
.otm.otm .otm-math {
  margin: 0.75em 0;
  text-align: center;
}

/* ------------------------------------------------------------
   Titres
   ------------------------------------------------------------ */

.otm.otm .otm-h2 {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin: 2.1em 0 1em;
  padding: 0 0 0.55em;
  border: 0;
  border-bottom: 1px solid var(--ot-rule);
  font-family: var(--ot-font-ui);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ot-ink);
  background: none;
}

.otm.otm .otm-h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 3.4rem;
  height: 2px;
  background: var(--ot-navy);
}

.otm.otm .otm-h2-num {
  color: var(--ot-navy);
  font-weight: 700;
}

.otm.otm .otm-h3 {
  margin: 1.7em 0 0.6em;
  padding: 0;
  border: 0;
  font-family: var(--ot-font-ui);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ot-navy-dark);
  background: none;
}

.otm.otm .otm-h4 {
  margin: 1.3em 0 0.4em;
  padding: 0;
  border: 0;
  font-family: var(--ot-font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ot-ink);
  background: none;
}

/* Question d'exercice : pastille numérotée + intitulé */
.otm.otm .otm-q {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.75em;
  margin: 2em 0 0.9em;
  padding: 0 0 0.7em;
  border: 0;
  border-bottom: 1px solid var(--ot-rule);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ot-ink);
  background: none;
}

.otm.otm .otm-q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75em;
  height: 1.75em;
  padding: 0 0.35em;
  border-radius: 6px;
  background: var(--ot-navy);
  color: #fff;
  font-family: var(--ot-font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.otm.otm .otm-q-text {
  min-width: 0;
}

/* ------------------------------------------------------------
   Listes (puce / numéro alignés sur la première ligne)
   ------------------------------------------------------------ */

.otm.otm ul.otm-list,
.otm.otm ol.otm-olist {
  list-style: none;
  margin: 0.5em 0;
  padding: 0;
  text-align: left;
}

.otm.otm ul.otm-list > li,
.otm.otm ol.otm-olist > li {
  display: grid;
  grid-template-columns: 1.15em minmax(0, 1fr);
  align-items: baseline;
  margin: 0.35em 0;
  padding: 0;
  text-indent: 0;
  line-height: 1.7;
}

.otm.otm ul.otm-list > li::before {
  content: '•';
  color: var(--ot-navy);
  font-weight: 700;
  display: block;
}

.otm.otm ul.otm-list ul.otm-list > li::before {
  content: '–';
  color: var(--ot-muted);
  font-weight: 600;
}

.otm.otm ol.otm-olist {
  counter-reset: otm-li;
}

.otm.otm ol.otm-olist > li {
  grid-template-columns: 1.9em minmax(0, 1fr);
  counter-increment: otm-li;
  margin: 0.5em 0;
}

.otm.otm ol.otm-olist > li::before {
  content: counter(otm-li) '.';
  display: block;
  font-family: var(--ot-font-ui);
  font-size: 0.9em;
  font-weight: 600;
  color: var(--ot-navy);
}

.otm.otm .otm-li {
  min-width: 0;
}

/* ------------------------------------------------------------
   Encadrés
   ------------------------------------------------------------ */

.otm.otm .otm-box {
  --box-accent: var(--ot-navy);
  margin: 1.15em 0;
  padding: 0.95em 1.2em;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: #fff;
}

.otm.otm .otm-box-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15em 0.7em;
  margin: 0 0 0.4em;
}

.otm.otm .otm-box-label {
  font-family: var(--ot-font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--box-accent);
}

.otm.otm .otm-box-title {
  font-family: var(--ot-font-ui);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ot-ink);
}

.otm.otm .otm-box--definition {
  background: var(--ot-navy-tint);
  border-left: 4px solid var(--ot-navy);
}

.otm.otm .otm-box--theoreme {
  border: 1.5px solid var(--ot-navy);
  border-radius: 9px;
}

.otm.otm .otm-box--propriete,
.otm.otm .otm-box--notation {
  border: 1px solid var(--ot-navy-line);
  border-radius: 9px;
}

.otm.otm .otm-box--methode {
  --box-accent: var(--ot-green-dark);
  background: var(--ot-green-tint);
  border-left: 4px solid var(--ot-green);
}

.otm.otm .otm-box--attention {
  --box-accent: var(--ot-orange-dark);
  background: var(--ot-orange-tint);
  border-left: 4px solid var(--ot-orange);
}

.otm.otm .otm-box--exemple {
  --box-accent: var(--ot-muted);
  padding: 0.35em 0 0.35em 1.05em;
  border-left: 2px solid var(--ot-rule);
  border-radius: 0;
}

.otm.otm .otm-box--demonstration {
  --box-accent: var(--ot-muted);
  border: 1px solid var(--ot-rule);
  border-radius: 9px;
}

.otm.otm .otm-qed {
  display: block;
  width: 0.62em;
  height: 0.62em;
  margin: 0.35em 0 0 auto;
  border: 1.5px solid var(--ot-muted);
}

.otm.otm .otm-box--remarque,
.otm.otm .otm-box--conseil {
  --box-accent: var(--ot-muted);
  background: #f6f7fa;
  border-left: 3px solid #b9c1d1;
}

.otm.otm .otm-box--conseil {
  --box-accent: var(--ot-green-dark);
  border-left-color: var(--ot-green);
}

.otm.otm .otm-box--retenir {
  --box-accent: var(--ot-green-dark);
  border: 1.5px solid var(--ot-green);
  border-radius: 9px;
}

.otm.otm .otm-box--rappel {
  background: var(--ot-navy-tint);
  border-left: 3px solid var(--ot-navy-line);
}

.otm.otm .otm-box--formule {
  margin: 1.2em auto;
  padding: 0.9em 1.2em;
  border: 1.5px solid var(--ot-navy);
  border-radius: 9px;
  text-align: center;
  width: fit-content;
  max-width: 100%;
}

.otm.otm .otm-box--formule .otm-box-body {
  font-size: 1.05em;
}

.otm.otm .otm-box--resultat {
  --box-accent: var(--ot-green-dark);
  margin: 1em 0;
  padding: 0.7em 1.05em;
  background: var(--ot-green-tint);
  border-radius: 8px;
}

.otm.otm .otm-box--objectifs,
.otm.otm .otm-box--prerequis {
  --box-accent: var(--ot-green-dark);
  border: 1px solid var(--ot-rule);
  border-radius: 9px;
}

.otm.otm .otm-box--prerequis {
  --box-accent: var(--ot-muted);
}

.otm.otm .otm-box--objectifs ul.otm-list > li::before {
  content: '✓';
  color: var(--ot-green-dark);
}

.otm.otm .otm-box--autre {
  --box-accent: var(--ot-muted);
  background: #f6f7fa;
  border-left: 3px solid var(--ot-rule);
}

/* Étapes d'un raisonnement : étiquette « Étape n » + corps guidé */
.otm.otm .otm-box--etape,
.otm.otm .otm-box--point {
  margin: 1.05em 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

.otm.otm .otm-box--etape > .otm-box-head,
.otm.otm .otm-box--point > .otm-box-head {
  margin-bottom: 0.3em;
}

.otm.otm .otm-box--etape > .otm-box-body,
.otm.otm .otm-box--point > .otm-box-body {
  margin-left: 0.2em;
  padding-left: 0.95em;
  border-left: 2px solid var(--ot-navy-soft);
}

.otm.otm .otm-box--etape > .otm-box-body:empty,
.otm.otm .otm-box--point > .otm-box-body:empty {
  display: none;
}

/* Dans un corrigé, « Méthode » est une ligne d'annonce, comme au livre */
.otm.otm--exercise .otm-box--methode {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2em 0.75em;
  margin: 0.6em 0 1em;
  padding: 0;
  background: none;
  border: 0;
  --box-accent: var(--ot-muted);
}

.otm.otm--exercise .otm-box--methode > .otm-box-head {
  margin: 0;
}

.otm.otm--exercise .otm-box--methode > .otm-box-body {
  color: var(--ot-muted);
  font-style: italic;
}

/* ------------------------------------------------------------
   Tableaux de données (style « booktabs » des livres)
   ------------------------------------------------------------ */

.otm.otm .otm-scroll {
  max-width: 100%;
  margin: 1.1em 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c6d2e8 transparent;
}

.otm.otm .otm-scroll::-webkit-scrollbar {
  height: 6px;
}

.otm.otm .otm-scroll::-webkit-scrollbar-thumb {
  background: #c6d2e8;
  border-radius: 999px;
}

.otm.otm table.otm-table {
  display: table;
  width: auto;
  max-width: none;
  margin: 0 auto;
  border: 0;
  border-collapse: collapse;
  border-radius: 0;
  border-top: 1.5px solid #8d96a8;
  border-bottom: 1.5px solid #8d96a8;
  background: transparent;
  overflow: visible;
}

.otm.otm table.otm-table th,
.otm.otm table.otm-table td {
  min-width: 2.6rem;
  padding: 0.5em 0.95em;
  border: 0;
  text-align: center;
  vertical-align: middle;
  background: transparent;
  line-height: 1.5;
}

.otm.otm table.otm-table thead th {
  border-bottom: 1px solid #8d96a8;
  font-family: var(--ot-font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ot-navy);
}

.otm.otm table.otm-table tbody tr + tr td {
  border-top: 1px solid #e8ebf1;
}

.otm.otm table.otm-table tbody td:first-child {
  color: var(--ot-navy);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Tableaux de variations et de signes (rendu tkz-tab)
   ------------------------------------------------------------ */

.otm.otm .otm-tv-figure {
  margin: 1.2em 0;
  padding: 0;
}

.otm.otm .otm-tv-figure > .otm-scroll {
  margin: 0;
  padding: 1px;
}

.otm.otm .otm-tv-title {
  margin-bottom: 0.5em;
  font-family: var(--ot-font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ot-muted);
  text-align: center;
}

.otm.otm .otm-tv {
  display: grid;
  width: max-content;
  max-width: 100%;
  min-width: min-content;
  margin: 0 auto;
  border: 1px solid var(--otm-tv-line);
  border-radius: 4px;
  background: #fff;
  font-size: 0.98em;
  line-height: 1.3;
  text-align: center;
}

.otm.otm .otm-tv-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6em;
  padding: 0.35em 0.45em;
  border-bottom: 1px solid var(--otm-tv-line);
}

.otm.otm .otm-tv-cell.otm-tv-last {
  border-bottom: 0;
}

.otm.otm .otm-tv-head,
.otm.otm .otm-tv-label {
  background: var(--ot-navy-tint);
}

.otm.otm .otm-tv-label {
  padding: 0.35em 0.85em;
  border-right: 1px solid var(--otm-tv-line);
  color: var(--ot-navy-dark);
}

.otm.otm .otm-tv-x {
  padding: 0.45em 0.4em;
}

/* Ligne de signes */
.otm.otm .otm-tv-z::before,
.otm.otm .otm-tv-t::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed var(--ot-muted);
}

.otm.otm .otm-tv-zero {
  position: relative;
  z-index: 1;
  padding: 0 0.15em;
  background: #fff;
}

.otm.otm .otm-tv-d::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  border-left: 1.5px solid var(--ot-ink);
  border-right: 1.5px solid var(--ot-ink);
}

.otm.otm .otm-tv-h {
  background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(107, 115, 133, 0.35) 5px 6px);
}

/* Ligne de variations */
.otm.otm .otm-tv-var {
  min-height: 4.7em;
}

.otm.otm .otm-tv-varval {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.35em 0.4em;
}

.otm.otm .otm-tv-varval > .otm-tv-v--top {
  margin-bottom: auto;
}

.otm.otm .otm-tv-varval > .otm-tv-v--bottom {
  margin-top: auto;
}

.otm.otm .otm-tv-varval > .otm-tv-v--middle {
  margin: auto 0;
}

.otm.otm .otm-tv-varval.otm-tv-bar-left,
.otm.otm .otm-tv-varval.otm-tv-bar-right,
.otm.otm .otm-tv-varval.otm-tv-bar-middle {
  flex-direction: row;
  align-items: stretch;
  padding: 0;
}

.otm.otm .otm-tv-side {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.35em 0.3em;
}

.otm.otm .otm-tv-side.otm-tv-v--top {
  justify-content: flex-start;
}

.otm.otm .otm-tv-side.otm-tv-v--bottom {
  justify-content: flex-end;
}

.otm.otm .otm-tv-side.otm-tv-v--middle {
  justify-content: center;
}

.otm.otm .otm-tv-bar {
  flex: 0 0 auto;
  width: 4px;
  border-left: 1.5px solid var(--ot-ink);
  border-right: 1.5px solid var(--ot-ink);
}

.otm.otm .otm-tv-arrowcell {
  padding: 0;
}

.otm.otm .otm-tv-arrow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--ot-navy);
}

/* Les formules d'un tableau gardent leur taille naturelle */
.sci-doc .otm.otm .otm-tv mjx-container svg,
.sci-doc .otm.otm table.otm-table mjx-container svg {
  max-width: none !important;
}

/* ------------------------------------------------------------
   Divers
   ------------------------------------------------------------ */

.otm.otm .otm-figure {
  margin: 1.2em 0;
  text-align: center;
}

.otm.otm .otm-error {
  margin: 1em 0;
  padding: 0.6em 0.9em;
  border: 1px dashed #e0574c;
  border-radius: 8px;
  color: #b42318;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------
   Mobile
   ------------------------------------------------------------ */

@media (max-width: 640px) {
  .otm.otm {
    --otm-tv-gap-min: 1.9rem;
    --otm-tv-gap-max: 3.6rem;
    font-size: 0.98rem;
  }

  .otm.otm .otm-box {
    padding: 0.85em 0.95em;
  }

  .otm.otm .otm-box--exemple {
    padding: 0.3em 0 0.3em 0.85em;
  }

  .otm.otm .otm-h2 {
    font-size: 1.15rem;
  }

  .otm.otm .otm-q {
    column-gap: 0.6em;
  }

  .otm.otm .otm-tv {
    font-size: 0.92em;
  }

  .otm.otm .otm-tv-label {
    padding: 0.35em 0.6em;
  }

  .otm.otm table.otm-table th,
  .otm.otm table.otm-table td {
    padding: 0.45em 0.7em;
  }
}

@media (max-width: 380px) {
  .otm.otm {
    --otm-tv-gap-min: 1.55rem;
  }

  .otm.otm .otm-tv {
    font-size: 0.88em;
  }

  .otm.otm .otm-tv-label {
    padding: 0.35em 0.45em;
  }
}

/* Dans les étapes d'un corrigé, les calculs partent du trait de guidage
   (comme une copie rédigée) ; ils restent centrés dans les encadrés. */
.sci-doc .otm.otm--exercise .otm-box--etape > .otm-box-body > .otm-math,
.sci-doc .otm.otm--exercise .otm-box--point > .otm-box-body > .otm-math {
  text-align: left;
  padding-left: 0.4em;
}

.sci-doc .otm.otm--exercise .otm-box--etape > .otm-box-body > .otm-math > mjx-container[display="true"],
.sci-doc .otm.otm--exercise .otm-box--point > .otm-box-body > .otm-math > mjx-container[display="true"] {
  text-align: left !important;
}

/* Formule encadrée à l'intérieur d'un encadré : pas de double cadre */
.otm.otm .otm-box .otm-box--formule {
  margin: 0.8em auto;
  padding: 0.55em 1.1em;
  border: 0;
  border-radius: 8px;
  background: rgba(27, 60, 142, 0.05);
}

/* Figures : pleine largeur sur téléphone, taille de manuel sur ordinateur */
.otm.otm .otm-figure img {
  display: block;
  margin: 0 auto;
  max-width: min(100%, 660px) !important;
  height: auto !important;
  border-radius: 0;
  box-shadow: none;
}

/* ------------------------------------------------------------
   Code (même présentation que l'environnement Python des livres)
   ------------------------------------------------------------ */

.otm.otm .otm-code {
  position: relative;
  margin: 1em 0;
  padding: 0.85em 1em 0.85em 1.1em;
  border-radius: 8px;
  background: var(--ot-navy-tint);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.otm.otm .otm-code pre {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  overflow: visible;
  white-space: pre;
  font-family: 'Fira Mono', 'Cascadia Mono', Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.55;
  color: var(--ot-ink);
}

.otm.otm .otm-code code {
  font: inherit;
  color: inherit;
  background: none;
  padding: 0;
}

.otm.otm .otm-code-lang {
  position: sticky;
  left: 0;
  display: block;
  margin: -0.35em 0 0.35em;
  text-align: right;
  font-family: var(--ot-font-ui);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ot-muted);
}

.otm.otm .otm-code .tk-k { color: var(--ot-navy); font-weight: 700; }
.otm.otm .otm-code .tk-b { color: var(--ot-navy); }
.otm.otm .otm-code .tk-s { color: var(--ot-green-dark); }
.otm.otm .otm-code .tk-c { color: var(--ot-muted); font-style: italic; }
.otm.otm .otm-code .tk-n { color: #a8551b; }

.otm.otm .otm-code--console {
  background: #fff;
  border: 1px solid var(--ot-rule);
}

.otm.otm code.otm-c {
  padding: 0.08em 0.35em;
  border-radius: 4px;
  background: var(--ot-navy-tint);
  font-family: 'Fira Mono', 'Cascadia Mono', Consolas, 'Courier New', monospace;
  font-size: 0.88em;
  color: var(--ot-navy-dark);
  white-space: nowrap;
}

/* Mot dans un tableau de signes (« convexe », « concave ») */
.otm.otm .otm-tv-txt {
  font-size: 0.88em;
  font-style: italic;
  color: var(--ot-ink);
}

/* Formules (MathJax) */

mjx-container[jax="SVG"] {
  direction: ltr;
}

mjx-container[jax="SVG"] > svg {
  overflow: visible;
  min-height: 1px;
  min-width: 1px;
}

mjx-container[jax="SVG"] > svg a {
  fill: blue;
  stroke: blue;
}

mjx-assistive-mml {
  position: absolute !important;
  top: 0px;
  left: 0px;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 1px 0px 0px 0px !important;
  border: 0px !important;
  display: block !important;
  width: auto !important;
  overflow: hidden !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

mjx-assistive-mml[display="block"] {
  width: 100% !important;
}

mjx-container[jax="SVG"][display="true"] {
  display: block;
  text-align: center;
  margin: 1em 0;
}

mjx-container[jax="SVG"][display="true"][width="full"] {
  display: flex;
}

mjx-container[jax="SVG"][justify="left"] {
  text-align: left;
}

mjx-container[jax="SVG"][justify="right"] {
  text-align: right;
}

g[data-mml-node="merror"] > g {
  fill: red;
  stroke: red;
}

g[data-mml-node="merror"] > rect[data-background] {
  fill: yellow;
  stroke: none;
}

g[data-mml-node="mtable"] > line[data-line], svg[data-table] > g > line[data-line] {
  stroke-width: 70px;
  fill: none;
}

g[data-mml-node="mtable"] > rect[data-frame], svg[data-table] > g > rect[data-frame] {
  stroke-width: 70px;
  fill: none;
}

g[data-mml-node="mtable"] > .mjx-dashed, svg[data-table] > g > .mjx-dashed {
  stroke-dasharray: 140;
}

g[data-mml-node="mtable"] > .mjx-dotted, svg[data-table] > g > .mjx-dotted {
  stroke-linecap: round;
  stroke-dasharray: 0,140;
}

g[data-mml-node="mtable"] > g > svg {
  overflow: visible;
}

[jax="SVG"] mjx-tool {
  display: inline-block;
  position: relative;
  width: 0;
  height: 0;
}

[jax="SVG"] mjx-tool > mjx-tip {
  position: absolute;
  top: 0;
  left: 0;
}

mjx-tool > mjx-tip {
  display: inline-block;
  padding: .2em;
  border: 1px solid #888;
  font-size: 70%;
  background-color: #F8F8F8;
  color: black;
  box-shadow: 2px 2px 5px #AAAAAA;
}

g[data-mml-node="maction"][data-toggle] {
  cursor: pointer;
}

mjx-status {
  display: block;
  position: fixed;
  left: 1em;
  bottom: 1em;
  min-width: 25%;
  padding: .2em .4em;
  border: 1px solid #888;
  font-size: 90%;
  background-color: #F8F8F8;
  color: black;
}

foreignObject[data-mjx-xml] {
  font-family: initial;
  line-height: normal;
  overflow: visible;
}

mjx-container[jax="SVG"] path[data-c], mjx-container[jax="SVG"] use[data-c] {
  stroke-width: 3;
}
