/* ============================================================
   Fiches d'activité — charte de la mise en page « cockpit »
   (refonte du 2026-09-30, portée : pages enveloppées dans .zt-fiche
   par overrides/main.html, construites par assets/fiche.js)
   ------------------------------------------------------------
   Deux niveaux de style :
   - `.zt-fiche` seul : retouches sûres, valables même si le script n'a pas
     tourné (repli lisible) ;
   - `.zt-fiche.is-ready` : l'architecture (bandeau, barre d'étapes, colonne
     latérale, cartes) posée par fiche.js.
   Les couleurs reprennent la charte marine / or de style.css.
   ============================================================ */

.zt-fiche {
  --f-navy: #1a2e5c;
  --f-navy-deep: #0f1f3d;
  --f-gold: #b9822f;
  --f-gold-soft: rgba(185, 130, 47, 0.14);
  --f-gold-text: #7a5010;
  --f-ink: #1c2233;
  --f-muted: #5b6275;
  --f-surface: #ffffff;
  --f-soft: rgba(26, 46, 92, 0.045);
  --f-line: rgba(26, 46, 92, 0.13);
  --f-ok: #1f7a4d;
  --f-ok-soft: rgba(31, 122, 77, 0.1);
  --f-shadow: 0 1px 2px rgba(15, 31, 61, 0.06), 0 8px 22px -12px rgba(15, 31, 61, 0.22);
  --f-radius: 0.9rem;
  --f-hero-a: #1a2e5c;
  --f-hero-b: #26437f;
  --f-hero-ink: #ffffff;
  --f-hero-link: #f0cb8d;
  --f-lv-1: #b3261e;
  --f-lv-2: #a4560a;
  --f-lv-3: #1f7a4d;
  --f-lv-4: #1a4fa3;
  --f-top: var(--zt-top, 3.2rem);
}

[data-md-color-scheme="slate"] .zt-fiche {
  --f-navy: #f1eee6;
  --f-navy-deep: #f1eee6;
  --f-gold: #e8b96a;
  --f-gold-soft: rgba(232, 185, 106, 0.14);
  --f-gold-text: #e8b96a;
  --f-ink: #ece9e1;
  --f-muted: #a9aebb;
  --f-surface: #262a33;
  --f-soft: rgba(255, 255, 255, 0.05);
  --f-line: rgba(255, 255, 255, 0.13);
  --f-ok: #6fd3a0;
  --f-ok-soft: rgba(111, 211, 160, 0.12);
  --f-shadow: none;
  --f-hero-a: #2b3247;
  --f-hero-b: #222838;
  --f-lv-1: #ff8a80;
  --f-lv-2: #ffb454;
  --f-lv-3: #6fd3a0;
  --f-lv-4: #8fb8ff;
}

/* Le contenu ne s'affiche qu'une fois la mise en page construite, pour éviter
   un flash de la version brute. Filet de sécurité : sans script (ou si celui-ci
   échoue), la fiche brute réapparaît d'elle-même après 1,2 s. */
.zt-fiche:not(.is-ready):not(.is-failed) {
  opacity: 0;
  animation: zt-f-show 0.01s 1.2s forwards;
}

@keyframes zt-f-show {
  to { opacity: 1; }
}

/* La fiche gère sa propre navigation interne : le sommaire de droite de
   Material (4 entrées) ferait doublon avec la barre d'étapes. */
.md-main:has(.zt-fiche.is-ready) .md-sidebar--secondary {
  display: none;
}

/* Les fiches ne figurent pas dans le menu : la colonne de gauche est vide sur
   grand écran, on la retire pour centrer le contenu. Sur petit écran, le
   même bloc porte le tiroir de navigation : on n'y touche pas. */
@media (min-width: 76.25em) {
  .md-main:has(.zt-fiche.is-ready) .md-sidebar--primary {
    display: none;
  }
}

/* ---------- Bandeau d'en-tête ---------- */

.zt-fiche.is-ready .zt-f-hero {
  margin: 0.3rem 0 0;
  padding: 0.9rem 1.3rem 1.2rem;
  color: var(--f-hero-ink);
  background: linear-gradient(140deg, var(--f-hero-a), var(--f-hero-b));
  border-radius: 1.1rem;
  box-shadow: var(--f-shadow);
}

.zt-fiche .zt-f-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  font-size: 0.68rem;
  font-weight: 600;
}

.md-typeset .zt-fiche .zt-f-hero a.zt-f-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem 0.25rem 0.55rem;
  margin-left: -0.55rem;
  color: var(--f-hero-link);
  text-decoration: none;
  border-radius: 99px;
}

.md-typeset .zt-fiche .zt-f-hero a.zt-f-back:hover {
  background: rgba(255, 255, 255, 0.12);
}

.zt-fiche .zt-f-pos {
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.02em;
}

.zt-fiche .zt-f-pos:empty {
  display: none;
}

.zt-fiche .zt-f-titlerow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.55rem 0 0.7rem;
}

.zt-fiche .zt-f-emoji {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  font-size: 1.55rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 0.9rem;
}

.md-typeset .zt-fiche .zt-f-titlerow h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--f-hero-ink);
  text-wrap: balance;
}

.zt-fiche .zt-f-titlerow h1 .headerlink {
  display: none;
}

.zt-fiche .zt-f-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}

.zt-fiche .zt-f-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.65rem;
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
}

.zt-fiche .zt-f-chip[hidden] {
  display: none;
}

.zt-fiche .zt-f-chip--crcn {
  color: #1a2e5c;
  background: #e8b96a;
  cursor: help;
  /* intitulé complet : la pastille passe à la ligne plutôt que de déborder */
  max-width: 100%;
  padding-block: 0.2rem;
  border-radius: 0.8rem;
}

/* Parcours Pix : nom du parcours + lien vers le tableau de la classe */
.zt-fiche .zt-f-pix {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.55rem;
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #fff;
}

.zt-fiche .zt-f-pix-k {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--f-hero-link);
}

.zt-fiche .zt-f-pix-n {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.md-typeset .zt-fiche .zt-f-hero a.zt-f-pix-go {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--f-hero-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  white-space: nowrap;
}

.md-typeset .zt-fiche .zt-f-hero a.zt-f-pix-go:hover {
  color: #fff;
}

/* Objectifs : cartouche translucide dans le bandeau */
.zt-fiche .zt-f-goals {
  margin-top: 0.9rem;
  padding: 0.7rem 1rem 0.55rem;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.8rem;
}

.md-typeset .zt-fiche .zt-f-goals h2 {
  margin: 0 0 0.35rem;
  padding: 0;
  border: 0;
  font-family: var(--md-text-font, "DM Sans"), sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--f-hero-link);
}

.zt-fiche .zt-f-goals h2 .headerlink {
  display: none;
}

.md-typeset .zt-fiche .zt-f-goals .zt-objectifs {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #fff;
}

.md-typeset .zt-fiche .zt-f-goals ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.md-typeset .zt-fiche .zt-f-goals li {
  position: relative;
  margin: 0 0 0.35rem;
  padding-left: 1.35rem;
}

.md-typeset .zt-fiche .zt-f-goals li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.55rem;
  font-weight: 800;
  color: #1a2e5c;
  background: #e8b96a;
  border-radius: 50%;
}

/* ---------- Barre d'étapes collante ---------- */

.zt-fiche .zt-f-tabs {
  position: sticky;
  top: var(--f-top);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 -0.4rem;
  padding: 0.45rem 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--md-default-bg-color) 96%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--f-line);
}

.zt-fiche .zt-f-tabs::-webkit-scrollbar {
  display: none;
}

.md-typeset .zt-fiche .zt-f-tab {
  flex: none;
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--f-muted);
  text-decoration: none;
  border-radius: 99px;
  transition: background-color 0.15s, color 0.15s;
}

.md-typeset .zt-fiche .zt-f-tab:hover {
  color: var(--f-navy);
  background: var(--f-soft);
}

.md-typeset .zt-fiche .zt-f-tab[aria-current="true"] {
  color: #fff;
  background: var(--f-navy-deep);
}

[data-md-color-scheme="slate"] .md-typeset .zt-fiche .zt-f-tab[aria-current="true"] {
  color: #1a2e5c;
  background: var(--f-gold);
}

.md-typeset .zt-fiche .zt-f-tab:focus-visible,
.zt-fiche .zt-check:focus-visible,
.zt-fiche .zt-f-reset:focus-visible,
.md-typeset .zt-fiche .zt-f-hero a:focus-visible {
  outline: 2px solid var(--f-gold);
  outline-offset: 2px;
}

.zt-fiche .zt-f-tab--res {
  display: none;
}

.zt-fiche .zt-f-mini {
  flex: none;
  position: sticky;
  right: 0;
  margin-left: auto;
  box-shadow: -0.6rem 0 0.5rem var(--md-default-bg-color);
  padding: 0.15rem 0.6rem;
  font-size: 0.64rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--f-ok);
  /* Fond opaque (teinte vert clair posée sur le fond de page) : sans cela,
     les onglets qui défilent dessous transparaissent derrière le compteur. */
  background: linear-gradient(var(--f-ok-soft), var(--f-ok-soft)), var(--md-default-bg-color);
  border-radius: 99px;
}

.zt-fiche .zt-f-mini[hidden] {
  display: none;
}

/* ---------- Disposition : colonne principale + colonne latérale ---------- */

.zt-fiche .zt-f-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  grid-template-areas:
    "ctx    side"
    "mission side"
    "synth  side"
    "retenir side";
  column-gap: 1.6rem;
  align-items: start;
}

.zt-fiche .zt-f-sec--ctx { grid-area: ctx; }
.zt-fiche .zt-f-aside { grid-area: side; }
.zt-fiche .zt-f-sec--mission { grid-area: mission; }
.zt-fiche .zt-f-sec--synth { grid-area: synth; }
.zt-fiche .zt-f-sec--retenir { grid-area: retenir; }

.zt-fiche .zt-f-aside {
  position: sticky;
  top: calc(var(--f-top) + 3.4rem);
  display: grid;
  gap: 0.9rem;
  margin-top: 1.4rem;
  align-self: start;
}

/* Section : titre avec pastille d'icône, ancre calée sous les barres collantes */
.zt-fiche .zt-f-sec {
  min-width: 0;
  padding-top: 0.2rem;
  scroll-margin-top: calc(var(--f-top) + 3.6rem);
}

.md-typeset .zt-fiche .zt-f-sec > h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0.8rem;
  padding: 0;
  border: 0;
  font-size: 1.22rem;
  line-height: 1.2;
  color: var(--f-navy);
  scroll-margin-top: calc(var(--f-top) + 3.6rem);
}

.md-typeset .zt-fiche .zt-f-sec > h2::before {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1rem;
  line-height: 1;
  background: var(--f-gold-soft);
  border-radius: 0.6rem;
}

.md-typeset .zt-fiche .zt-f-sec--ctx > h2::before { content: "🧭"; }
.md-typeset .zt-fiche .zt-f-sec--mission > h2::before { content: "🛠️"; }
.md-typeset .zt-fiche .zt-f-sec--synth > h2::before { content: "✍️"; }
.md-typeset .zt-fiche .zt-f-sec--retenir > h2::before { content: "💡"; }
.md-typeset .zt-fiche .zt-f-sec--eval > h2::before { content: "📋"; }

.zt-fiche .zt-f-sec > h2 .headerlink {
  margin-left: auto;
}

/* ---------- Contexte ---------- */

.zt-fiche .zt-f-sec--ctx > p {
  max-width: 44rem;
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--f-ink);
}

/* Problématique : citation mise en avant */
.md-typeset .zt-fiche .admonition.question {
  position: relative;
  margin: 1.1rem 0 0.4rem;
  padding: 0.85rem 1.1rem 0.9rem 3rem;
  font-size: 0.85rem;
  color: var(--f-ink);
  background: var(--f-gold-soft);
  border: 0;
  border-left: 4px solid var(--f-gold);
  border-radius: 0 0.9rem 0.9rem 0;
  box-shadow: none;
}

.md-typeset .zt-fiche .admonition.question::before {
  content: "“";
  position: absolute;
  left: 0.85rem;
  top: 0.2rem;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--f-gold);
}

.md-typeset .zt-fiche .admonition.question > .admonition-title {
  padding: 0;
  margin: 0 0 0.2rem;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--f-gold-text);
  background: none;
}

.md-typeset .zt-fiche .admonition.question > .admonition-title::before {
  display: none;
}

.md-typeset .zt-fiche .admonition.question p {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--f-navy);
}

/* ---------- Mission ---------- */

.md-typeset .zt-fiche .zt-f-sec--mission > p.zt-f-lead {
  margin: 1.1rem 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--f-gold-text);
}

.md-typeset .zt-fiche .zt-f-sec--mission > p.zt-f-lead strong {
  font-weight: 700;
}

/* Sous-parties « A — … » : titre avec pastille de lettre */
.md-typeset .zt-fiche .zt-f-parth {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0.4rem;
  padding: 0.5rem 0.8rem 0.5rem 0.55rem;
  font-size: 0.95rem;
  color: var(--f-navy);
  background: var(--f-soft);
  border: 0;
  border-radius: 0.8rem;
}

.zt-fiche .zt-f-part {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  font-family: var(--md-text-font, "DM Sans"), sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--f-navy-deep);
  border-radius: 0.5rem;
}

[data-md-color-scheme="slate"] .zt-fiche .zt-f-part {
  color: #1a2e5c;
  background: var(--f-gold);
}

/* Étapes : une carte par étape, pastille à cocher */
.md-typeset .zt-fiche .zt-f-steps {
  margin: 0.5rem 0 0.8rem;
  padding: 0;
  list-style: none;
}

.md-typeset .zt-fiche .zt-f-step {
  position: relative;
  margin: 0 0 0.5rem;
  padding: 0.65rem 0.9rem 0.65rem 3.35rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--f-ink);
  background: var(--f-surface);
  border: 1px solid var(--f-line);
  border-radius: 0.8rem;
  transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

.md-typeset .zt-fiche .zt-f-step:hover {
  border-color: var(--f-gold);
}

.md-typeset .zt-fiche .zt-f-step > ul,
.md-typeset .zt-fiche .zt-f-step > ol {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
}

.md-typeset .zt-fiche .zt-f-step.is-done {
  background: var(--f-ok-soft);
  border-color: transparent;
  color: var(--f-muted);
}

.zt-fiche .zt-check {
  position: absolute;
  left: 0.7rem;
  top: 0.55rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font: 800 0.72rem/1 var(--md-text-font, "DM Sans"), sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--f-gold-text);
  background: var(--f-gold-soft);
  border: 2px solid var(--f-gold);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.zt-fiche .zt-check:hover {
  transform: scale(1.06);
}

.zt-fiche .zt-check .zt-check-v {
  display: none;
  font-size: 0.85rem;
}

.zt-fiche .zt-check[aria-checked="true"] {
  color: #fff;
  background: var(--f-ok);
  border-color: var(--f-ok);
}

[data-md-color-scheme="slate"] .zt-fiche .zt-check[aria-checked="true"] {
  color: #10281c;
}

.zt-fiche .zt-check[aria-checked="true"] .zt-check-n {
  display: none;
}

.zt-fiche .zt-check[aria-checked="true"] .zt-check-v {
  display: block;
}

/* Autres encadrés (note, info, succès, avertissement…) : même famille visuelle
   que les astuces — coins arrondis, pas d'ombre — en gardant leur couleur propre. */
.md-typeset .zt-fiche .admonition:not(.question):not(.tip),
.md-typeset .zt-fiche details:not(.zt-f-verif):not(.tip) {
  border-radius: 0.8rem;
  box-shadow: none;
  overflow: hidden;
}

.md-typeset .zt-fiche .admonition:not(.question) {
  margin: 0.9rem 0;
  font-size: 0.76rem;
}

/* Astuces : discrètes, dans le fil des étapes */
.md-typeset .zt-fiche .zt-f-sec--mission .admonition.tip {
  margin: 0.6rem 0 0.9rem;
  font-size: 0.76rem;
  border: 0;
  border-left: 4px solid var(--f-gold);
  border-radius: 0 0.7rem 0.7rem 0;
  background: var(--f-gold-soft);
  box-shadow: none;
}

.md-typeset .zt-fiche .zt-f-sec--mission .admonition.tip > .admonition-title {
  background: none;
  padding-top: 0.5rem;
}

/* ---------- Questions de synthèse ---------- */

.md-typeset .zt-fiche .zt-f-sec--synth > ul {
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
  counter-reset: zt-q;
}

.md-typeset .zt-fiche .zt-f-sec--synth > ul > li {
  position: relative;
  counter-increment: zt-q;
  margin: 0 0 0.5rem;
  padding: 0.7rem 0.9rem 0.7rem 3.2rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--f-ink);
  background: var(--f-surface);
  border: 1px solid var(--f-line);
  border-radius: 0.8rem;
}

.md-typeset .zt-fiche .zt-f-sec--synth > ul > li::before {
  content: "Q" counter(zt-q);
  position: absolute;
  left: 0.7rem;
  top: 0.62rem;
  display: grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  font-size: 0.66rem;
  font-weight: 800;
  color: #fff;
  background: var(--f-navy-deep);
  border-radius: 0.5rem;
}

[data-md-color-scheme="slate"] .md-typeset .zt-fiche .zt-f-sec--synth > ul > li::before {
  color: #1a2e5c;
  background: var(--f-gold);
}

/* Corrigé : repliable, ton « vérification » (vert) plutôt que « astuce » (or) */
.md-typeset .zt-fiche details.zt-f-verif {
  margin: 0.4rem 0 0;
  font-size: 0.76rem;
  border: 1px solid var(--f-ok);
  border-radius: 0.8rem;
  box-shadow: none;
  overflow: hidden;
}

.md-typeset .zt-fiche details.zt-f-verif > summary {
  padding: 0.6rem 2.4rem 0.6rem 2.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--f-ok);
  background: var(--f-ok-soft);
}

/* Pictogramme « astuce » (flamme) remplacé par une coche : ici on vérifie, on ne cherche pas d'astuce. */
.md-typeset .zt-fiche details.zt-f-verif > summary::before {
  content: "✓";
  display: grid;
  place-items: center;
  background: none;
  -webkit-mask-image: none;
  mask-image: none;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--f-ok);
}

.md-typeset .zt-fiche details.zt-f-verif > summary::after {
  color: var(--f-ok);
}

.md-typeset .zt-fiche details.zt-f-verif[open] > summary {
  border-bottom: 1px solid var(--f-line);
}

.md-typeset .zt-fiche details.zt-f-verif > :not(summary) {
  margin-left: 0.9rem;
  margin-right: 0.9rem;
}

/* ---------- À retenir ---------- */

.md-typeset .zt-fiche .zt-f-sec--retenir .zt-retenir {
  padding: 0.9rem 1.1rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--f-ink);
  background: var(--f-surface);
  border: 1px solid var(--f-line);
  border-top: 4px solid var(--f-gold);
  border-radius: 0.9rem;
  box-shadow: var(--f-shadow);
}

.md-typeset .zt-fiche .zt-f-sec--retenir .zt-retenir ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.md-typeset .zt-fiche .zt-f-sec--retenir .zt-retenir li {
  position: relative;
  margin: 0 0 0.55rem;
  padding-left: 1.6rem;
}

.md-typeset .zt-fiche .zt-f-sec--retenir .zt-retenir li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.15rem;
  display: grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  background: var(--f-gold);
  border-radius: 50%;
}

[data-md-color-scheme="slate"] .md-typeset .zt-fiche .zt-f-sec--retenir .zt-retenir li::before {
  color: #1a2e5c;
}

.md-typeset .zt-fiche .zt-f-sec--retenir .zt-retenir p {
  margin: 0.6rem 0 0.3rem;
  padding-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--f-muted);
  border-top: 1px dashed var(--f-line);
}

/* ---------- Colonne latérale ---------- */

.md-typeset .zt-fiche .zt-f-card {
  padding: 0.85rem 1rem 0.9rem;
  background: var(--f-surface);
  border: 1px solid var(--f-line);
  border-radius: 1rem;
  box-shadow: var(--f-shadow);
  scroll-margin-top: calc(var(--f-top) + 3.6rem);
}

.md-typeset .zt-fiche .zt-f-card-t {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.55rem;
  padding: 0;
  border: 0;
  font-family: var(--md-text-font, "DM Sans"), sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--f-navy);
}

/* Progression */
.zt-fiche .zt-f-prog-line {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  color: var(--f-muted);
}

.zt-fiche .zt-f-prog-line b {
  font-size: 1.15rem;
  color: var(--f-navy);
  font-variant-numeric: tabular-nums;
}

.zt-fiche .zt-f-bar {
  height: 0.5rem;
  overflow: hidden;
  background: var(--f-soft);
  border-radius: 99px;
}

.zt-fiche .zt-f-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--f-gold), var(--f-ok));
  border-radius: 99px;
  transition: width 0.35s ease;
}

.zt-fiche .zt-f-prog-msg {
  margin: 0.55rem 0 0;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--f-muted);
}

.zt-fiche .zt-f-prog.is-complete .zt-f-prog-msg {
  color: var(--f-ok);
  font-weight: 600;
}

.zt-fiche .zt-f-reset {
  margin-top: 0.4rem;
  padding: 0.15rem 0;
  font: inherit;
  font-size: 0.66rem;
  color: var(--f-muted);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

.zt-fiche .zt-f-reset[hidden] {
  display: none;
}

/* Ressources */
.md-typeset .zt-fiche .zt-f-card-b {
  font-size: 0.74rem;
  line-height: 1.55;
}

.md-typeset .zt-fiche .zt-f-card-b ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.md-typeset .zt-fiche .zt-f-card-b li {
  margin: 0 0 0.55rem;
  padding: 0 0 0.55rem;
  border-bottom: 1px solid var(--f-line);
}

.md-typeset .zt-fiche .zt-f-card-b li:last-child {
  margin: 0;
  padding: 0;
  border: 0;
}

.md-typeset .zt-fiche .zt-f-card-b p {
  margin: 0 0 0.5rem;
}

.md-typeset .zt-fiche .zt-f-card-b a {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.md-typeset .zt-fiche .zt-f-card-b a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.85em;
  color: var(--f-gold-text);
}

/* ---------- Évaluation ---------- */

.zt-fiche .zt-f-sec--eval {
  margin-top: 0.8rem;
}

.md-typeset .zt-fiche .zt-f-sec--eval details {
  margin: 0 0 0.7rem;
  font-size: 0.76rem;
  border-color: var(--f-line);
  border-radius: 0.8rem;
  box-shadow: none;
  overflow: hidden;
}

.md-typeset .zt-fiche .zt-f-sec--eval details > summary {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.zt-fiche .zt-f-crits {
  display: grid;
  gap: 0.8rem;
  padding: 0.3rem 0 0.8rem;
}

.md-typeset .zt-fiche .zt-f-crit {
  padding: 0.8rem 0.9rem;
  background: var(--f-surface);
  border: 1px solid var(--f-line);
  border-radius: 0.8rem;
}

.md-typeset .zt-fiche .zt-f-crit-t {
  margin: 0 0 0.2rem;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--f-navy);
}

.md-typeset .zt-fiche .zt-f-crit-i {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--f-muted);
}

.md-typeset .zt-fiche .zt-f-crit-i ul,
.md-typeset .zt-fiche .zt-f-crit-i ol {
  margin: 0;
  padding-left: 1.1rem;
}

.md-typeset .zt-fiche .zt-f-crit-n {
  margin: 0;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--f-muted);
}

.md-typeset .zt-fiche .zt-f-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.md-typeset .zt-fiche .zt-f-lv {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  padding: 0.5rem 0.65rem 0.55rem;
  font-size: 0.7rem;
  line-height: 1.45;
  background: var(--f-soft);
  border-top: 3px solid var(--lv);
  border-radius: 0.5rem;
}

.zt-fiche .zt-f-lv--1 { --lv: var(--f-lv-1); }
.zt-fiche .zt-f-lv--2 { --lv: var(--f-lv-2); }
.zt-fiche .zt-f-lv--3 { --lv: var(--f-lv-3); }
.zt-fiche .zt-f-lv--4 { --lv: var(--f-lv-4); }

.zt-fiche .zt-f-lv-name {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lv);
}

/* ---------- Tablette et mobile : une seule colonne ---------- */

@media (max-width: 60em) {
  .zt-fiche .zt-f-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "ctx"
      "side"
      "mission"
      "synth"
      "retenir";
  }

  .zt-fiche .zt-f-aside {
    position: static;
    margin-top: 0.4rem;
  }

  .zt-fiche .zt-f-tab--res {
    display: inline-block;
  }

  .md-main:has(.zt-fiche.is-ready) .md-sidebar--secondary {
    display: none;
  }
}

@media (max-width: 44em) {
  .zt-fiche.is-ready .zt-f-hero {
    margin-top: 0;
    padding: 0.75rem 0.95rem 1rem;
    border-radius: 0.95rem;
  }

  .zt-fiche .zt-f-emoji {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.1rem;
    border-radius: 0.75rem;
  }

  .md-typeset .zt-fiche .zt-f-titlerow h1 {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .zt-fiche .zt-f-titlerow {
    gap: 0.65rem;
    margin: 0.4rem 0 0.55rem;
  }

  .zt-fiche .zt-f-top {
    font-size: 0.64rem;
  }

  /* Repère d'étape : une seule ligne, tronquée si besoin */
  .zt-fiche .zt-f-chip--where {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .zt-fiche .zt-f-goals {
    margin-top: 0.7rem;
    padding: 0.6rem 0.75rem 0.4rem;
  }

  .md-typeset .zt-fiche .zt-f-goals .zt-objectifs {
    font-size: 0.72rem;
  }

  .md-typeset .zt-fiche .zt-f-step {
    padding: 0.6rem 0.75rem 0.6rem 3rem;
  }

  .zt-fiche .zt-check {
    left: 0.5rem;
    width: 2.1rem;
    height: 2.1rem;
  }

  .md-typeset .zt-fiche .zt-f-sec--synth > ul > li {
    padding-left: 2.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zt-fiche *,
  .zt-fiche *::before {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Impression : on garde le contenu, on retire la navigation ---------- */

@media print {
  .zt-fiche .zt-f-tabs,
  .zt-fiche .zt-f-prog,
  .zt-fiche .zt-f-mini {
    display: none !important;
  }

  .zt-fiche .zt-f-layout {
    display: block;
  }

  .zt-fiche.is-ready .zt-f-hero {
    color: #000;
    background: none;
    box-shadow: none;
    border: 1px solid #000;
  }

  .zt-fiche .zt-f-pix,
  .zt-fiche .zt-f-pix-k,
  .md-typeset .zt-fiche .zt-f-hero a.zt-f-pix-go,
  .md-typeset .zt-fiche .zt-f-titlerow h1,
  .md-typeset .zt-fiche .zt-f-goals .zt-objectifs,
  .md-typeset .zt-fiche .zt-f-goals h2 {
    color: #000;
  }

  .zt-fiche .zt-f-step,
  .zt-fiche .zt-f-crit {
    break-inside: avoid;
  }
}
