/* ==========================================================================
   Fiches-Scolaires.com — Feuille de style "Édition Scolaire Française"
   Palette académique sobre, contrastes WCAG AA >= 4.5:1, zéro artifice
   ========================================================================== */

:root,
[data-matiere="histoire"] {
  --subject: #1e3a8a;
  --subject-soft: #dbeafe;
}

[data-matiere="maths"] {
  --subject: #1d4ed8;
  --subject-soft: #dbeafe;
}

[data-matiere="francais"] {
  --subject: #9f1239;
  --subject-soft: #ffe4e6;
}

[data-matiere="svt"] {
  --subject: #166534;
  --subject-soft: #dcfce7;
}

[data-matiere="geographie"] {
  --subject: #b45309;
  --subject-soft: #fef3c7;
}

[data-matiere="physique"] {
  --subject: #0f766e;
  --subject-soft: #ccfbf1;
}

[data-matiere="langues"] {
  --subject: #3730a3;
  --subject-soft: #e0e7ff;
}

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #334155;
  --subtle: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --green: #166534;
  --green-bg: #f0fdf4;
  --green-border: #86efac;
  --amber: #92400e;
  --amber-bg: #fef3c7;
  --red: #991b1b;
  --red-bg: #fee2e2;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body.fs-body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: clip;
}

[id] {
  scroll-margin-top: 84px;
}

a {
  color: var(--subject);
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
}

.fs-container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 640px) {
  .fs-container {
    padding: 0 14px;
  }
}

/* ==========================================================================
   Header Sticky, Barre de progression & Recherche instantanée FTS5
   ========================================================================== */

.fs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--border-strong);
}

.fs-progress-track {
  height: 3px;
  width: 100%;
  background: transparent;
}

.fs-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--subject);
  transition: width 0.1s linear;
}

.fs-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.fs-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.fs-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.fs-logo svg,
.fs-logo strong {
  color: var(--subject);
}

.fs-logo strong {
  font-weight: 800;
}

.fs-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.fs-menu-toggle:hover {
  background: #f1f5f9;
}

.fs-search-wrap {
  position: relative;
  flex: 1 1 280px;
  max-width: 380px;
  min-width: 180px;
}

.fs-search-form {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 3px 4px 3px 10px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.fs-search-form:focus-within {
  background: #ffffff;
  border-color: var(--subject);
  box-shadow: 0 0 0 3px var(--subject-soft);
}

.fs-search-icon {
  color: var(--subtle);
  flex-shrink: 0;
}

.fs-search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  min-height: 36px;
  outline: none;
}

.fs-search-form button {
  background: var(--subject);
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  height: 36px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.fs-search-form button:hover {
  filter: brightness(1.08);
}

.fs-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
}

.fs-search-item {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s;
}

.fs-search-item:hover,
.fs-search-item.is-active {
  background: #f1f5f9;
  border-left-color: var(--subject);
}

.fs-search-item-title {
  display: block;
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.32;
  margin-bottom: 4px;
}

.fs-search-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.fs-search-item-meta .fs-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
}

.fs-search-empty {
  padding: 12px 10px;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

.fs-search-more {
  display: block;
  margin-top: 4px;
  padding: 9px 10px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--subject);
  text-decoration: none;
  border-radius: 0 0 7px 7px;
}

.fs-search-more:hover,
.fs-search-more.is-active {
  background: #f1f5f9;
  text-decoration: underline;
}

.fs-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.fs-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.87rem;
  padding: 7px 8px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.fs-nav a:hover,
.fs-nav a.is-active {
  background: #f1f5f9;
  color: var(--subject);
}

@media (max-width: 1080px) and (min-width: 881px) {
  .fs-header-inner {
    gap: 8px;
  }
  .fs-nav a {
    font-size: 0.81rem;
    padding: 6px 5px;
  }
}

@media (max-width: 880px) {
  .fs-header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }
  .fs-brand-row {
    width: 100%;
  }
  .fs-menu-toggle {
    display: inline-flex;
  }
  .fs-search-wrap {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    min-width: 0;
    order: 2;
  }
  .fs-nav {
    display: none;
    width: 100%;
    order: 3;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .fs-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .fs-nav a {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 12px;
    min-height: 42px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   Mise en page principale, Fil d'Ariane & En-têtes (Hero)
   ========================================================================== */

.fs-main {
  padding-top: 24px;
  padding-bottom: 56px;
}

.fs-breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.45;
}

.fs-breadcrumb a {
  color: var(--subject);
  text-decoration: none;
  font-weight: 500;
}

.fs-breadcrumb a:hover {
  text-decoration: underline;
}

.hero-box {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 24px 26px;
  margin-bottom: 24px;
}

.hero-home {
  border-top: 4px solid var(--subject);
}

.fs-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subject);
  background: var(--subject-soft);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.hero-box h1 {
  margin: 6px 0 12px;
  font-size: clamp(1.38rem, 2.4vw, 1.95rem);
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.hero-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.01rem;
  line-height: 1.6;
  max-width: 78ch;
}

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

/* ==========================================================================
   Badges & Pilules taxonomiques (Accueil & Silos)
   ========================================================================== */

.fs-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.fs-badge {
  display: inline-flex;
  align-items: center;
  background: var(--subject-soft);
  color: var(--subject);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.fs-badge-sec {
  background: #f1f5f9;
  color: var(--ink);
}

.fs-badge-type {
  background: var(--amber-bg);
  color: var(--amber);
}

.fs-badge-bareme {
  background: #dcfce7;
  color: var(--green);
}

.fs-discovery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 860px) {
  .fs-discovery-grid {
    grid-template-columns: 1fr;
  }
}

.fs-panel-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px 22px;
}

.fs-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
}

.fs-panel-title svg {
  color: var(--subject);
  flex-shrink: 0;
}

.fs-cycle-group {
  margin-bottom: 14px;
}

.fs-cycle-group:last-child {
  margin-bottom: 0;
}

.fs-cycle-label {
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtle);
  margin-bottom: 7px;
}

.fs-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fs-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  min-height: 36px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.fs-pill:hover {
  border-color: var(--subject);
  background: var(--subject-soft);
  color: var(--subject);
}

.fs-pill-sm {
  padding: 5px 11px;
  font-size: 0.84rem;
  min-height: 34px;
}

.fs-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--subject);
  flex-shrink: 0;
}

.fs-pill-count {
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.fs-pill:hover .fs-pill-count {
  background: #ffffff;
  color: var(--subject);
}

.fs-subnav {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.fs-subnav-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

/* ==========================================================================
   Sections, Barre de filtres Silos & Grille de cartes (.fs-card)
   ========================================================================== */

.fs-section {
  margin: 30px 0;
}

.fs-section > h2,
.fs-section-head h2 {
  font-size: 1.28rem;
  color: var(--subject);
  margin: 0 0 14px;
  line-height: 1.3;
}

.fs-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-strong);
}

.fs-section-head h2 {
  margin: 0;
}

.fs-section-sub {
  font-size: 0.88rem;
  color: var(--muted);
}

.fs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
}

.fs-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fs-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fs-tab:hover {
  border-color: var(--subject);
  color: var(--subject);
}

.fs-tab.is-active {
  background: var(--subject);
  border-color: var(--subject);
  color: #ffffff;
}

.fs-tab span {
  font-size: 0.8rem;
  opacity: 0.9;
}

.fs-sort-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.fs-sort-box select {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  min-height: 38px;
  cursor: pointer;
}

.fs-filter-status {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin: -8px 0 16px;
}

.fs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 18px;
}

.fs-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--subject);
  border-radius: 10px;
  padding: 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fs-card:hover {
  border-color: #94a3b8;
  border-top-color: var(--subject);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.fs-card h2,
.fs-card h3 {
  margin: 4px 0 8px;
  font-size: 1.03rem;
  line-height: 1.36;
  font-weight: 700;
}

.fs-card h2 a,
.fs-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.fs-card h2 a:hover,
.fs-card h3 a:hover {
  color: var(--subject);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fs-card p {
  margin: 0 0 14px;
  font-size: 0.89rem;
  color: var(--muted);
  line-height: 1.52;
  flex: 1;
}

.fs-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 11px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 0.81rem;
  color: var(--subtle);
  font-weight: 600;
}

.fs-card-pdf {
  color: var(--green);
  font-weight: 700;
}

/* ==========================================================================
   Pages Fiches (fiche.php) : Hero A4, CTA, Sommaire Sticky & Lecture
   ========================================================================== */

.hero-fiche {
  border-top: 4px solid var(--subject);
}

.hero-fiche.has-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.hero-fiche-preview {
  justify-self: center;
  width: 100%;
  max-width: 190px;
}

@media (min-width: 768px) {
  .hero-fiche.has-preview {
    grid-template-columns: 1fr 190px;
    gap: 28px;
    align-items: start;
  }
}

.fs-a4-thumb {
  display: block;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 4px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: var(--muted);
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}

.fs-a4-thumb:hover {
  border-color: var(--subject);
  transform: translateY(-1px);
}

.fs-a4-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  border: 1px solid #f1f5f9;
}

.fs-a4-caption {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 2px 2px;
}

.fs-intro {
  color: var(--muted);
  font-size: 0.99rem;
  line-height: 1.62;
  margin: 10px 0 14px;
}

.fs-intro p {
  margin: 0 0 8px;
}

.fs-intro p:last-child {
  margin-bottom: 0;
}

.fs-pdf-meta {
  font-size: 0.84rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 14px 0;
}

.fs-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.pdf-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--subject, #1e3a8a);
  color: #ffffff;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 46px;
  transition: filter 0.15s, background 0.15s;
}

.pdf-btn:hover {
  filter: brightness(1.08);
  color: #ffffff;
}

.pdf-btn.is-downloaded {
  background: var(--green);
}

.print-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 11px 18px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  cursor: pointer;
  min-height: 46px;
  transition: background 0.15s, border-color 0.15s;
}

.print-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* Sommaire mobile (< 1280px) & Sommaire sticky (>= 1280px) */
.fs-mobile-toc {
  display: block;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  margin: 18px 0 24px;
  overflow: hidden;
}

.fs-mobile-toc summary {
  list-style: none;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--subject);
  cursor: pointer;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}

.fs-mobile-toc summary::-webkit-details-marker {
  display: none;
}

.fs-mobile-toc summary::after {
  content: "▾";
  font-size: 0.95rem;
}

.fs-mobile-toc[open] summary::after {
  content: "▴";
}

.fs-mobile-toc nav {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border);
  gap: 2px;
}

.fs-mobile-toc nav a {
  padding: 9px 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 6px;
}

.fs-mobile-toc nav a:hover {
  background: #f1f5f9;
  color: var(--subject);
}

.fs-fiche-layout {
  display: block;
}

.fs-reading-col {
  width: 100%;
  max-width: 820px;
  font-size: 16.5px;
  line-height: 1.65;
}

@media (max-width: 767px) {
  .fs-reading-col {
    font-size: 15.5px;
    line-height: 1.65;
  }
}

.fs-sticky-toc {
  display: none;
}

@media (min-width: 1280px) {
  .fs-mobile-toc {
    display: none;
  }
  .fs-fiche-layout {
    display: grid;
    grid-template-columns: minmax(0, 820px) 260px;
    gap: 32px;
    align-items: start;
    justify-content: space-between;
  }
  .fs-sticky-toc {
    display: block;
    position: sticky;
    top: 88px;
    align-self: start;
  }
}

.fs-toc-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 16px;
}

.fs-toc-heading {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtle);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

#fs-desktop-toc {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fs-toc-link {
  display: block;
  padding: 7px 10px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.fs-toc-link:hover {
  background: var(--bg);
  color: var(--subject);
}

.fs-toc-link.is-active {
  background: var(--subject-soft);
  color: var(--subject);
  border-left-color: var(--subject);
  font-weight: 700;
}

.fs-toc-corrige {
  margin-top: 4px;
  color: var(--green);
  font-weight: 600;
}

.fs-toc-cta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.fs-toc-pdf-link {
  display: block;
  text-align: center;
  background: var(--subject);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 7px;
  min-height: 40px;
}

.fs-toc-pdf-link:hover {
  filter: brightness(1.08);
  color: #ffffff;
}

/* ==========================================================================
   Composants Pédagogiques : Exercices, Tableaux, Mémos, QCM, Corrigé, FAQ
   ========================================================================== */

.exo-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

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

.exo-card-head h3,
.exo-card > h3 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.35;
}

.exo-body p:first-child {
  margin-top: 0;
}

.exo-body p:last-child {
  margin-bottom: 0;
}

.eval-memo-box,
.memo-box {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--subject);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  color: var(--ink);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.clean-table,
.eval-clean-table,
.exo-body table,
.corrige-content table,
.fs-intro table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.93rem;
  margin: 12px 0;
}

.clean-table th,
.clean-table td,
.eval-clean-table th,
.eval-clean-table td,
.exo-body table th,
.exo-body table td,
.corrige-content table th,
.corrige-content table td,
.fs-intro table th,
.fs-intro table td {
  border: 1px solid var(--border-strong);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.clean-table th,
.eval-clean-table th,
.exo-body table th,
.corrige-content table th,
.fs-intro table th {
  background: #f1f5f9;
  color: var(--ink);
  font-weight: 700;
}

.ans-line {
  border-bottom: 1.5px dotted #64748b;
  height: 26px;
  margin: 6px 0;
  width: 100%;
}

td .ans-line {
  min-width: 80px;
  height: 20px;
  margin: 2px 0;
}

.qcm-list {
  list-style: none;
  padding-left: 0;
}

.qcm-option {
  cursor: pointer;
  padding: 8px 12px;
  margin: 6px 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  transition: background 0.12s, border-color 0.12s;
}

.qcm-option:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.qcm-option.is-selected {
  background: var(--subject-soft);
  border-color: var(--subject);
  color: var(--ink);
  font-weight: 600;
}

.exo-card-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  justify-content: flex-end;
}

.fs-jump-corrige {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  min-height: 36px;
  transition: background 0.15s;
}

.fs-jump-corrige:hover {
  background: #dcfce7;
}

/* Corrigé détaillé */
.corrige-panel {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.corrige-panel summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--green);
  font-size: 1.03rem;
  min-height: 52px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.corrige-panel summary::-webkit-details-marker {
  display: none;
}

.corrige-toggle-hint {
  font-size: 0.8rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--green);
  border: 1px solid #bbf7d0;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.corrige-content {
  background: #ffffff;
  border-top: 1px solid #bbf7d0;
  padding: 20px 22px;
}

.corrige-item,
.cor-block {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.corrige-item:last-child,
.cor-block:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.corrige-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.corrige-item-head h3,
.cor-block h3 {
  margin: 0 0 8px;
  font-size: 1.04rem;
  color: var(--green);
}

.corrige-item-head h3 {
  margin: 0;
}

.fs-back-exo {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--subject);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  margin-bottom: 6px;
}

.corrige-item-head .fs-back-exo {
  margin-bottom: 0;
}

.fs-back-exo:hover {
  background: var(--subject-soft);
  border-color: var(--subject);
}

/* FAQ & Maillage interne */
.fs-faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fs-faq-item {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 16px 20px;
}

.fs-faq-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--ink);
}

.fs-faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.fs-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}

.fs-related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--subject);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}

.fs-related-card:hover {
  background: var(--bg);
  border-color: var(--subject);
}

.fs-related-card strong {
  font-size: 0.94rem;
  line-height: 1.35;
}

/* ==========================================================================
   Figures Zoomables 300 DPI & Lightbox <dialog id="fs-lightbox">
   ========================================================================== */

.fs-doc-study {
  margin-bottom: 20px;
}

.fs-fiche figure,
.exo-card figure,
.fs-doc-study figure,
.corrige-content figure {
  margin: 16px 0;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}

.fs-fiche figure img,
.exo-card figure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

.exo-body figure img,
.fs-doc-study figure img,
.corrige-content figure img {
  cursor: zoom-in;
}

.fs-fiche figcaption,
.exo-card figcaption {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 8px;
}

.fs-zoom-hint {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--subtle);
  font-weight: 600;
  cursor: zoom-in;
}

.fs-zoom-hint:hover {
  color: var(--subject);
  text-decoration: underline;
}

dialog.fs-lightbox {
  width: 96vw;
  max-width: 96vw;
  max-height: 94vh;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0;
  background: #0f172a;
  color: #ffffff;
  overflow: hidden;
}

dialog.fs-lightbox[open] {
  display: flex;
  flex-direction: column;
}

dialog.fs-lightbox::backdrop {
  background: rgba(15, 23, 42, 0.82);
}

.fs-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.fs-lightbox-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fs-lightbox-btn,
.fs-lightbox-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  background: #334155;
  color: #ffffff;
  border: 1px solid #475569;
  border-radius: 8px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fs-lightbox-close {
  font-size: 1.4rem;
  line-height: 1;
  padding: 0;
}

.fs-lightbox-btn:hover,
.fs-lightbox-close:hover {
  background: #475569;
}

.fs-lightbox-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #0f172a;
}

.fs-lightbox-stage img {
  max-width: 100%;
  max-height: calc(94vh - 88px);
  width: auto;
  height: auto;
  background: #ffffff;
  border-radius: 6px;
  padding: 6px;
}

.fs-lightbox-stage.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}

.fs-lightbox-stage.is-zoomed img {
  max-width: none;
  max-height: none;
  width: 175%;
}

/* ==========================================================================
   Emplacements AdSense sécurisés (>= 48px de marge franche, zéro barre sticky)
   ========================================================================== */

.fs-ad-box {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 1px;
  text-align: center;
}

.fs-ad-box[data-ad-loaded="1"],
.fs-ad-box:has(ins.adsbygoogle) {
  margin: 48px 0 !important;
}

.fs-ad-box:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none !important;
  margin: 0 !important;
}

.fs-ad-admin-notice {
  margin: 20px 0;
  padding: 10px 14px;
  background: #f1f5f9;
  border: 1px dashed var(--border-strong);
  color: var(--subtle);
  font-size: 0.84rem;
  border-radius: 8px;
}

/* ==========================================================================
   Pied de page
   ========================================================================== */

.fs-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-strong);
  padding: 26px 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.fs-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.fs-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.fs-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.fs-footer a:hover {
  color: var(--subject);
  text-decoration: underline;
}

/* ==========================================================================
   Back-Office Administration (/admin)
   ========================================================================== */

.fs-admin-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #0f172a;
  color: #ffffff;
  border-bottom: 1px solid #1e293b;
}

.fs-admin-bar .fs-logo {
  color: #ffffff;
}

.fs-admin-bar .fs-logo span {
  color: #93c5fd;
}

.fs-admin-bar .fs-menu-toggle {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

.fs-admin-bar .fs-nav a {
  color: #cbd5e1;
}

.fs-admin-bar .fs-nav a:hover,
.fs-admin-bar .fs-nav a.is-active {
  background: #1e293b;
  color: #ffffff;
}

@media (max-width: 880px) {
  .fs-admin-bar .fs-nav {
    border-top-color: #1e293b;
  }
  .fs-admin-bar .fs-nav a {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
  }
}

.fs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.fs-kpi {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px 16px;
}

.fs-kpi strong {
  display: block;
  font-size: 1.45rem;
  color: var(--subject);
  line-height: 1.2;
  margin-bottom: 4px;
}

.fs-kpi span {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}

.fs-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #dcfce7;
  border: 1px solid var(--green-border);
  border-left: 4px solid var(--green);
  color: #14532d;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.94rem;
  margin-bottom: 18px;
}

.fs-status-published {
  background: #dcfce7;
  color: var(--green);
}

.fs-status-draft {
  background: var(--amber-bg);
  color: var(--amber);
}

.fs-status-pending {
  background: #f1f5f9;
  color: var(--subtle);
}

.fs-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.fs-filter-bar input,
.fs-filter-bar select {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  min-height: 44px;
  background: #ffffff;
  color: var(--ink);
}

.fs-filter-bar input {
  flex: 1 1 240px;
}

.fs-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fs-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--ink);
}

.fs-form input[type="text"],
.fs-form input[type="email"],
.fs-form input[type="password"],
.fs-form input[type="search"],
.fs-form textarea,
.fs-form select {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
}

.fs-form input:focus,
.fs-form textarea:focus,
.fs-form select:focus {
  outline: none;
  border-color: var(--subject);
  box-shadow: 0 0 0 3px var(--subject-soft);
}

.fs-label-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fs-seo-counter {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--subtle);
}

.fs-seo-counter.is-good {
  background: #dcfce7;
  color: var(--green);
}

.fs-seo-counter.is-warn {
  background: var(--amber-bg);
  color: var(--amber);
}

.fs-seo-counter.is-bad {
  background: var(--red-bg);
  color: var(--red);
}

.fs-admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.fs-admin-head h1 {
  margin: 0;
}

.fs-actions-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.fs-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.81rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink);
  white-space: nowrap;
}

.fs-btn-sm:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.fs-btn-live {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.fs-btn-live:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* ==========================================================================
   Typographie mathématique & scientifique pure (Sésamath / Brevet, CLS = 0)
   ========================================================================== */

.fs-math {
  display: inline;
  line-height: inherit;
}

.fs-math-block {
  display: block;
  text-align: center;
  margin: 12px 0;
}

.fs-math .m-v,
.fs-math-block .m-v {
  font-family: Georgia, "Times New Roman", "Liberation Serif", serif;
  font-style: italic;
  padding-right: 0.03em;
}

.fs-math .m-rm,
.fs-math-block .m-rm {
  font-style: normal;
}

.fs-math .m-bf,
.fs-math-block .m-bf {
  font-weight: 700;
}

.fs-math .m-cal,
.fs-math-block .m-cal {
  font-family: Georgia, "Times New Roman", "Liberation Serif", serif;
  font-style: italic;
  font-weight: 700;
}

.fs-math .m-frac,
.fs-math-block .m-frac {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  font-size: 0.88em;
  line-height: 1.12;
  margin: 0 0.16em;
}

.fs-math .m-frac > .m-num,
.fs-math-block .m-frac > .m-num {
  display: block;
  padding: 0 0.24em 1.5px;
  border-bottom: 1.2px solid currentColor;
}

.fs-math .m-frac > .m-den,
.fs-math-block .m-frac > .m-den {
  display: block;
  padding: 1.5px 0.24em 0;
}

.fs-math .m-bar,
.fs-math-block .m-bar {
  display: inline-block;
  border-top: 1.2px solid currentColor;
  padding-top: 1px;
  line-height: 1.05;
}

.fs-math .m-sqrt,
.fs-math-block .m-sqrt {
  display: inline-block;
  white-space: nowrap;
}

.fs-math .m-sqrt > .m-surd,
.fs-math-block .m-sqrt > .m-surd {
  font-size: 1.08em;
  vertical-align: baseline;
  margin-right: -0.04em;
}

.fs-math .m-sqrt > .m-rad,
.fs-math-block .m-sqrt > .m-rad {
  display: inline-block;
  border-top: 1.2px solid currentColor;
  padding: 1px 0.16em 0 0.1em;
  line-height: 1.05;
}

.fs-math .m-hat,
.fs-math-block .m-hat {
  display: inline-block;
  position: relative;
  text-align: center;
  padding-top: 0.32em;
  line-height: 1.05;
}

.fs-math .m-hat > .m-hat-roof,
.fs-math-block .m-hat > .m-hat-roof {
  position: absolute;
  top: -0.18em;
  left: 0;
  right: 0;
  font-size: 0.78em;
  line-height: 1;
  transform: scaleX(2.4) scaleY(0.75);
  transform-origin: center top;
  font-style: normal;
  font-family: system-ui, -apple-system, sans-serif;
  pointer-events: none;
}

.fs-math .m-dot,
.fs-math-block .m-dot {
  display: inline-block;
  position: relative;
  padding-top: 0.22em;
}

.fs-math .m-dot > .m-dot-mark,
.fs-math-block .m-dot > .m-dot-mark {
  position: absolute;
  top: -0.28em;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.62em;
  line-height: 1;
  font-style: normal;
  pointer-events: none;
}

.fs-math .m-xarr,
.fs-math-block .m-xarr {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  line-height: 1;
  margin: 0 0.24em;
}

.fs-math .m-xarr > .m-xarr-lbl,
.fs-math-block .m-xarr > .m-xarr-lbl {
  display: block;
  font-size: 0.74em;
  padding: 0 0.25em;
  margin-bottom: -2px;
}

.fs-math .m-xarr > .m-xarr-sym,
.fs-math-block .m-xarr > .m-xarr-sym {
  display: block;
  font-size: 1.15em;
  line-height: 0.85;
}

.fs-math .m-phantom,
.fs-math-block .m-phantom {
  visibility: hidden;
}

.fs-math sub,
.fs-math sup,
.fs-math-block sub,
.fs-math-block sup {
  font-size: 0.74em;
  line-height: 0;
}

/* ==========================================================================
   Impression propre (@media print)
   ========================================================================== */

@media print {
  .no-print,
  .fs-ad-box,
  .fs-header,
  .fs-footer,
  .fs-admin-bar,
  .fs-sticky-toc,
  .fs-mobile-toc,
  dialog.fs-lightbox {
    display: none !important;
  }

  body.fs-body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10.5pt;
  }

  .fs-container,
  .fs-main,
  .fs-reading-col {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .hero-box,
  .exo-card,
  .corrige-panel,
  .fs-faq-item {
    border-color: #94a3b8 !important;
    box-shadow: none !important;
  }

  .corrige-panel > .corrige-content {
    display: block !important;
  }

  .qcm-option,
  .qcm-option.is-selected {
    background: transparent !important;
    border: 0 !important;
    padding: 2px 0 !important;
    font-weight: normal !important;
  }
}
