/* ============================================================================
   CAPTALI — Démonstration bi-cas
   Feuille autonome. Les tokens, la typographie, le bandeau, la nav et le pied
   de page sont repris à l'identique d'index.html pour que la page soit
   indiscernable du reste de la landing.
   ========================================================================== */

/* ---------- Reset & base (identiques à index.html) ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  color: #1e1e1e;
  background: #fafaf9;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, .heading {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 300; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 300; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); font-weight: 400; }
h4 { font-size: clamp(1.1rem, 1.6vw, 1.4rem); font-weight: 500; }

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --navy-muted: #334155;
  --burgundy: #7f1d1d;
  --burgundy-light: #991b1b;
  --burgundy-lighter: #b91c1c;
  --burgundy-pale: #fef2f2;
  --brand-gold: #a46b32;   /* doré du wordmark, même valeur que site.css (lot 6) */
  --cream: #fafaf9;
  --cream-dark: #f5f2ed;
  --cream-darker: #efebe7;
  --stone: #e7e5e4;
  --stone-dark: #a8a29e;
  --text: #1c1917;
  --text-muted: #57534e;
  --text-light: #a8a29e;
  --white: #ffffff;
  --border: #e7e5e4;
  --border-light: #f0edeb;

  /* Courbes de mouvement — ease-out franc, jamais ease-in sur de l'UI */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-white { background: var(--white); }
.text-center { text-align: center; }

/* ---------- Bandeau persistant (identique à index.html) ---------- */
.top-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--navy); color: var(--cream); padding: 0.65rem 1.5rem;
  font-size: 0.8rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.top-banner-left { display: flex; align-items: center; gap: 0.5rem; flex: 1; }
.top-banner-left svg { flex-shrink: 0; opacity: 0.8; }
.top-banner-text { color: rgba(255,255,255,0.85); line-height: 1.4; }
.top-banner-cta {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.4rem 1rem; font-size: 0.75rem; font-weight: 600;
  font-family: 'Inter', sans-serif; color: var(--burgundy); text-shadow: 0 1px rgba(255,255,255,0.5);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  background-image: linear-gradient(to top, #D8D9DB 0%, #fff 80%, #FDFDFD 100%);
  border-radius: 30px; border: 1px solid var(--burgundy);
  transition: box-shadow 0.2s ease;
}
.top-banner-cta:hover {
  box-shadow: 0 4px 3px 1px rgba(255,255,255,0.06), 0 6px 8px rgba(0,0,0,0.3), 0 -4px 4px rgba(0,0,0,0.2), 0 -6px 4px rgba(255,255,255,0.04), inset 0 0 3px 3px rgba(0,0,0,0.15);
}

/* ---------- Nav (identique à index.html) ---------- */
.nav {
  position: fixed; top: 2.8rem; left: 0; right: 0; z-index: 99;
  background: rgba(250,250,249,0.92); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo {
  font-family: 'Newsreader', serif; font-size: 1.3rem; font-weight: 500;
  color: var(--navy); text-decoration: none; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.nav-logo img { display: block; height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  font-size: 0.8rem; color: var(--text-muted); text-decoration: none;
  transition: color 0.2s; font-weight: 500;
}
.nav-links a:hover { color: var(--navy); }
.nav-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.4rem 1rem; font-size: 0.8rem; font-weight: 600 !important;
  font-family: 'Inter', sans-serif; color: #606060 !important; text-shadow: 0 1px #fff;
  text-decoration: none; cursor: pointer;
  background-image: linear-gradient(to top, #D8D9DB 0%, #fff 80%, #FDFDFD 100%);
  border-radius: 30px; border: 1px solid #8F9092;
  transition: box-shadow 0.2s ease;
}
.nav-cta:hover {
  box-shadow: 0 4px 3px 1px #FCFCFC, 0 6px 8px #D6D7D9, 0 -4px 4px #CECFD1, 0 -6px 4px #FEFEFE, inset 0 0 3px 3px #CECFD1 !important;
}
.nav-mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.25rem; }

/* ---------- Chapeau de page ---------- */
.demo-hero {
  padding: calc(8rem - 2.8rem - 62px) 0 3rem;   /* nav fixe compensée par .cn-espace (commun.css) */
  background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--border);
}
.demo-surtitre {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--burgundy); margin-bottom: 0.75rem;
}
.demo-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: var(--navy);
  margin-bottom: 1.25rem;
}
.demo-chapeau {
  font-size: 1.125rem; line-height: 1.6; color: var(--navy-muted);
  max-width: 46rem; margin-bottom: 1.5rem;
}

/* Bandeau de cadrage — texte de référence, ton sobre */
.cadrage {
  max-width: 720px;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--burgundy);
  border-radius: 2px;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* En-tête centré : surtitre, titre, chapeau et bandeau sur une colonne de ~46rem */
.demo-surtitre, .demo-hero h1, .demo-chapeau, .cadrage {
  max-width: 46rem; margin-inline: auto; text-align: center;
}

/* ---------- Cartes de cas ---------- */
.case-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem; margin-top: 2rem;
}
.case-card {
  font: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 0.4rem;
  min-height: 44px; padding: 1.25rem 1.4rem;
  background: var(--white); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.16s var(--ease-out);
}
.case-card:hover { border-color: var(--stone-dark); }
.case-card:active { transform: scale(0.98); }
.case-card[aria-pressed="true"] {
  border: 2px solid var(--navy);
  padding: calc(1.25rem - 1px) calc(1.4rem - 1px);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.10);
}
.case-card-kicker {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--burgundy);
}
.case-card-title { font-family: 'Newsreader', Georgia, serif; font-size: 1.3rem; line-height: 1.3; color: var(--navy); }
.case-card-lede { font-size: 0.9rem; color: var(--text-muted); }

/* Focus visible, commun à toutes les commandes de la page */
.case-card:focus-visible, .saisie-bascule:focus-visible, .restit-bascule:focus-visible,
.visite-btn:focus-visible, .doc-tab:focus-visible {
  outline: 3px solid var(--burgundy); outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Section cas ---------- */
.case-panel { padding: 3rem 0 4rem; }
.profil, .saisie { margin-bottom: 2rem; }
.case-panel[hidden] { display: none; }

/* ---------- Étiquettes ---------- */
.etiquettes { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.etiquette {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.65rem; border-radius: 999px;
  background: var(--cream-darker); color: var(--navy-muted);
  font-family: 'Inter', sans-serif; font-size: 0.78rem; font-weight: 500; line-height: 1.4;
}
.etiquette--qit, .etiquette--force { background: var(--navy); color: var(--white); }
.etiquette--faiblesse { background: var(--burgundy-pale); color: var(--burgundy); }
.etiquette--hors { background: var(--white); color: var(--text-muted); border: 1px dashed var(--stone-dark); }

/* ---------- Profil en un coup d'œil ---------- */
/* La réglette est un SVG en unités de score (viewBox 55 → 145) : aucune
   position calculée, aucun style inline. */
.profil { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }
.profil-tete {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1rem;
}
.profil-tete h3 { font-size: 1.35rem; color: var(--navy); }
.profil-notes { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; }
.profil-note {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0.45rem 0.5rem;
  padding: 0.85rem; background: var(--cream-dark); border-radius: 10px;
}
.profil-code { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.profil-score { font-family: 'Newsreader', Georgia, serif; font-size: 1.6rem; line-height: 1; color: var(--navy); }
.reglette { grid-column: 1 / -1; display: block; width: 100%; height: 12px; }
.reglette-fond { fill: var(--stone); }
.reglette-bande { fill: var(--stone-dark); }
.reglette-repere { fill: var(--burgundy); }
.profil-nom { grid-column: 1 / -1; font-size: 0.78rem; line-height: 1.4; color: var(--text-muted); }
.profil-legende { margin-top: 0.9rem; font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Données saisies par le praticien ----------
   Repliées derrière un bouton ; dépliées, les champs du cas de démonstration,
   reproduits tels que saisis : libellé en gras, texte libre en citation. */
.saisie { background: var(--white); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.saisie-titre { font: inherit; }
.saisie-bascule, .restit-bascule {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  width: 100%; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: none; border: 0;
}
.saisie-bascule { padding: 1.1rem 1.4rem; }
.saisie-bascule-texte { display: flex; flex-direction: column; gap: 0.6rem; }
.saisie-bascule-libelle { font-family: 'Newsreader', Georgia, serif; font-size: 1.35rem; line-height: 1.25; color: var(--navy); }
.bascule-etat { font-size: 0.85rem; font-weight: 600; color: var(--burgundy); white-space: nowrap; }
.bascule-etat::after { content: "Afficher"; }
[aria-expanded="true"] .bascule-etat::after { content: "Masquer"; }
.saisie-panel {
  padding: 1.25rem 1.4rem 1.4rem;
  border-top: 1px solid var(--border-light);
}
.saisie-panel[hidden] { display: none; }
.saisie-panel h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}
.saisie-panel p {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}
.saisie-panel h4 + p { margin-top: 0; }
.saisie-panel blockquote {
  margin: 0;
  padding: 0 0 0 0.9rem;
  border-left: 2px solid var(--border-light);
}
.saisie-panel blockquote p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

/* ---------- Documents rédigés ---------- */
.docs-titre { font-size: 1.35rem; color: var(--navy); margin-bottom: 1rem; }

/* ---------- Onglets documents ---------- */
.doc-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.doc-tab {
  font-family: 'Inter', sans-serif;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.16s var(--ease-out);
}
.doc-tab:hover { color: var(--navy); }
.doc-tab:active { transform: scale(0.97); }
.doc-tab[aria-selected="true"] {
  color: var(--burgundy);
  border-bottom-color: var(--burgundy);
  font-weight: 600;
}
.doc-tab-count {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.doc-tab[aria-selected="true"] .doc-tab-count { color: var(--burgundy-lighter); }
.doc-tab { min-height: 44px; align-items: center; }
.doc-tab-count:empty { display: none; }

/* ---------- Barre de visite ---------- */
.visite {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--cream-dark); border: 1px solid var(--border); border-top: none;
}
.visite[hidden] { display: none; }
.visite-etat { font-size: 0.9rem; color: var(--navy-muted); }
.visite-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.visite-btn, .annot-note button {
  font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  min-height: 44px; padding: 0 1rem; border-radius: 8px;
  background: var(--white); color: var(--navy); border: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.16s var(--ease-out);
}
.visite-btn:hover:not(:disabled) { border-color: var(--navy); }
.visite-btn:active:not(:disabled), .annot-note button:active:not(:disabled) { transform: scale(0.97); }
.visite-btn--principal { background: var(--navy); border-color: var(--navy); color: var(--white); }
.visite-btn--principal:hover:not(:disabled) { background: var(--navy-light); }
.visite-btn[hidden] { display: none; }
.visite-btn:disabled, .annot-note button:disabled { opacity: 0.45; cursor: default; }

/* ---------- Feuille de document ---------- */
.doc-panel[hidden] { display: none; }
.doc-panel:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 4px; }
.doc {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  padding: 3rem clamp(1.25rem, 4vw, 3.5rem);
}
.doc > * { max-width: 68ch; }
.doc h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--burgundy);
  margin-bottom: 0.35rem;
}
.doc h4 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--burgundy);
  margin: 2.25rem 0 0.85rem;
}
.doc-meta {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}
.doc p {
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--text);
  margin-bottom: 1.15rem;
  text-align: left;
}
/* Justifié avec césure à partir de 600 px (page en lang="fr") ; à gauche en dessous.
   Notes, mention et détail de la restitution gardent leur alignement à gauche (règles plus spécifiques). */
@media (min-width: 600px) {
  .doc p { text-align: justify; hyphens: auto; }
}
.doc p:last-child { margin-bottom: 0; }
.doc strong { font-weight: 600; color: var(--navy); }

/* Chapeau des Pistes — exergue typographique, jamais une copie du texte */
.doc-chapeau {
  font-size: 0.875rem !important;
  font-style: italic;
  color: var(--text-muted) !important;
  background: var(--cream-dark);
  border-left: 3px solid var(--stone-dark);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem !important;
  text-align: left !important;
  line-height: 1.7 !important;
}

/* Tableau clinique */
.doc table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.85rem; }
/* La légende précède le tableau dans le document : caption-side « top » pour
   que le rendu suive l'ordre du DOCX. */
.doc caption,
.doc-caption {
  caption-side: top;
  font-size: 0.78rem !important;
  font-style: italic;
  color: var(--text-muted) !important;
  text-align: left !important;
  padding-bottom: 0.65rem;
  line-height: 1.5 !important;
}
.doc th, .doc td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.doc th {
  background: var(--cream-dark);
  font-weight: 600;
  color: var(--navy);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* Provenance, telle qu'elle figure dans le document */
.doc-provenance {
  font-size: 0.72rem !important;
  color: var(--text-light) !important;
  text-align: left !important;
  line-height: 1.6 !important;
}
/* Filet et marge sur la première ligne seule : la seconde suit sans séparation. */
:not(.doc-provenance) + .doc-provenance {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}
/* ---------- Annotations en ligne ---------- */
/* Passage surligné et numéroté ; son commentaire s'ouvre sous le paragraphe. */
a.annot {
  color: inherit; text-decoration: none; cursor: pointer;
  padding: 0.1em 0;
  background-image: linear-gradient(to top, rgba(127, 29, 29, 0.16) 0, rgba(127, 29, 29, 0.16) 38%, transparent 38%);
  border-radius: 1px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
a.annot:hover {
  background-image: linear-gradient(to top, rgba(127, 29, 29, 0.26) 0, rgba(127, 29, 29, 0.26) 46%, transparent 46%);
}
a.annot[aria-expanded="true"] { background: var(--navy); color: var(--white); }
a.annot:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 2px; border-radius: 2px; }
.annot-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.3rem; height: 1.3rem; margin-left: 0.3rem; padding: 0 0.3rem;
  border-radius: 999px; background: var(--burgundy); color: var(--white);
  font-family: 'Inter', sans-serif; font-size: 0.7rem; font-weight: 700; line-height: 1;
  vertical-align: 0.15em;
}
.annot-num:empty { display: none; }
a.annot[aria-expanded="true"] .annot-num { background: var(--white); color: var(--navy); }
.annot-note {
  margin: -0.4rem 0 1.4rem; padding: 1rem 1.15rem;
  background: var(--navy); color: var(--cream); border-radius: 10px;
  font-family: 'Inter', sans-serif;
}
.annot-note[hidden] { display: none; }
.doc .annot-note p { font-size: 0.95rem; line-height: 1.55; color: inherit; text-align: left; hyphens: manual; margin: 0; }
.doc .annot-note .annot-note-pos {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 0.35rem;
}
.annot-note-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.annot-note button { background: transparent; color: var(--white); border-color: var(--navy-muted); }
.annot-note button:hover:not(:disabled) { background: var(--navy-light); }
.annot-note button:focus-visible { outline: 3px solid var(--stone); outline-offset: 2px; }

/* ---------- Restitution : 1er paragraphe visible, détail dépliable ---------- */
.restit {
  margin: 0 0 1.4rem; padding: 1.1rem 1.25rem;
  background: var(--cream-dark); border: 1px solid var(--border); border-radius: 10px;
}
.doc .restit-mention {
  font-family: 'Inter', sans-serif; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--navy-muted); text-align: left; margin-bottom: 0.5rem;
}
.restit-bascule {
  margin-top: 0.5rem; padding: 0.6rem 0 0.2rem;
  border-top: 1px solid var(--border);
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600; color: var(--navy);
}
.restit-detail { padding-top: 0.75rem; }
.restit-detail[hidden] { display: none; }
.doc .restit-table { min-width: 0; font-family: 'Inter', sans-serif; font-size: 0.8rem; background: var(--white); }
.doc .restit-table th[scope="row"] { background: var(--white); }
.doc .restit-detail p { font-size: 0.85rem; line-height: 1.6; text-align: left; hyphens: manual; margin: 1rem 0 0; }
.doc .restit-detail .restit-sous { font-family: 'Inter', sans-serif; font-weight: 600; color: var(--navy); margin-bottom: 0.5rem; }
.restit-detail .etiquettes { max-width: none; }

/* ---------- Essai ---------- */
.demo-essai { padding: 0 1.5rem 4rem; }
.demo-essai-boite {
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: center;
  padding: 1.75rem; background: var(--cream-dark); border: 1px solid var(--border); border-radius: 12px;
}
.demo-essai h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--navy); }

/* ---------- Footer (identique à index.html) ---------- */
.footer {
  background: var(--navy); color: rgba(255,255,255,0.7);
  padding: 3rem 0 2rem; font-size: 0.8rem;
}
.footer-notice {
  text-align: center; max-width: 720px; margin: 0 auto 2rem;
  padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem; line-height: 1.6; color: rgba(255,255,255,0.5);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.footer-links a { color: rgba(255,255,255,0.6); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--cream); }
.footer-brand { text-align: center; font-family: 'Newsreader', serif; font-size: 1rem; color: rgba(255,255,255,0.4); }
.footer-brand span { color: var(--burgundy); }
.footer-disclaimer {
  max-width: 820px; margin: 2.5rem auto 0; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem; line-height: 1.6; color: rgba(255,255,255,0.38); text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--cream); border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; gap: 1rem;
  }
  .top-banner-text { display: none; }
  .top-banner { padding: 0.5rem 1rem; }
  .demo-hero { padding-bottom: 2.5rem; }   /* le haut reste celui de la règle de base : nav compensée par .cn-espace */
  .case-panel { padding: 2.5rem 0 3rem; }
  .doc { padding: 2rem 1.25rem; }
  .doc p { font-size: 1rem; }
}

@media (max-width: 560px) {
  .container, .container-narrow, .demo-essai { padding: 0 1rem; }
  .demo-essai { padding-bottom: 3rem; }
  .doc-tabs { flex-direction: column; gap: 0; border-bottom: none; }
  .doc-tab {
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    border-left: 2px solid transparent;
    margin-bottom: 0;
    padding: 0.7rem 0.5rem;
  }
  .doc-tab[aria-selected="true"] {
    border-bottom-color: var(--border);
    border-left-color: var(--burgundy);
    background: var(--burgundy-pale);
  }
  .visite { border-top: 1px solid var(--border); margin-top: 0.75rem; }
  .doc { border-top: 1px solid var(--border); padding: 1.5rem 1rem; }
  .cadrage { padding: 1rem 1.1rem; font-size: 0.83rem; }
  .profil, .restit { padding: 1rem; }
  .saisie-bascule { padding: 1rem; align-items: flex-start; }
  .saisie-panel { padding: 1rem; }

  /* Tableau des calculs : une ligne = un bloc, chaque cellule porte son intitulé */
  .restit-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .restit-table, .restit-table tbody, .restit-table tr, .restit-table th[scope="row"], .restit-table td { display: block; width: 100%; }
  .restit-table tr { border: 1px solid var(--border); margin-bottom: 0.6rem; }
  .doc .restit-table th, .doc .restit-table td { border: 0; border-bottom: 1px solid var(--border-light); }
  .restit-table td::before {
    content: attr(data-label); display: block;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .case-card, .doc-tab, .visite-btn, .annot-note button { transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; }
  .case-card:active, .doc-tab:active, .visite-btn:active:not(:disabled), .annot-note button:active:not(:disabled) { transform: none; }
}

/* ---------- Couleurs de la démo (lot 6, 15/10/2026) : en-tête navy, or et bordeaux ----------
   Placé avant l'impression, qui garde le dernier mot (fond blanc, texte sombre). */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url('assets/arabesque_fond.svg') right bottom / cover no-repeat; opacity: 0.09; }
.demo-hero { background: radial-gradient(120% 100% at 85% 0%, var(--navy-muted) 0%, var(--navy-light) 45%, var(--navy) 100%); border-bottom: 3px solid var(--brand-gold); padding-bottom: 3.5rem; }
.demo-surtitre { color: #fff; }
/* Titre en or, sur une ligne dès que la largeur le permet. */
.demo-hero h1 { color: #e9b97a; max-width: none; font-size: clamp(1.75rem, 3.4vw, 2.75rem); }
@media (min-width: 900px) { .demo-hero h1 { white-space: nowrap; } }
/* « Pour chaque cas… » : même étiquette que le cadrage, en bordeaux sur fond beige. */
.demo-chapeau { max-width: 46rem; margin: 1.25rem auto 0; padding: 1.25rem 1.5rem; background: var(--cream-dark); border: 1px solid var(--border); border-left: 3px solid var(--burgundy); border-radius: 6px; font-size: 0.875rem; line-height: 1.75; color: #4c0519; }
.demo-chapeau strong { color: var(--burgundy); font-weight: 700; }
.cadrage { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-left: 3px solid #e9b97a; border-radius: 6px; color: rgba(255,255,255,0.78); }
.cadrage strong { color: #e9b97a; font-weight: 700; }
.case-card { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); color: #fff; }
.case-card .case-card-kicker { color: #e9b97a; }
.case-card .case-card-title { color: #fff; }
.case-card .case-card-lede { color: rgba(255,255,255,0.7); }
.case-card:hover { border-color: #e9b97a; }
.case-card[aria-pressed="true"] { background: #fff; border: 2px solid #e9b97a; box-shadow: 0 10px 30px -8px rgba(233,185,122,0.45); }
.case-card[aria-pressed="true"] .case-card-kicker { color: var(--burgundy); }
.case-card[aria-pressed="true"] .case-card-title { color: var(--navy); }
.case-card[aria-pressed="true"] .case-card-lede { color: var(--text-muted); }
.case-card:focus-visible { outline-color: #e9b97a; }
/* Indication de bascule entre les cas (texte décoratif : le bouton porte déjà aria-pressed). */
.case-card::after { content: 'Cliquez pour afficher ce cas →'; content: 'Cliquez pour afficher ce cas →' / ''; margin-top: 0.35rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; color: #e9b97a; }
.case-card[aria-pressed="true"]::after { content: '✓ Cas affiché'; content: '✓ Cas affiché' / ''; color: var(--burgundy); }
.profil { padding: 0 1.5rem 1.5rem; overflow: hidden; box-shadow: 0 10px 30px -18px rgba(15,23,42,0.35); }
.profil-tete { margin: 0 -1.5rem 1.25rem; padding: 1rem 1.5rem; background: var(--navy); align-items: center; }
.profil-tete h3 { color: #e9b97a; }
.profil-tete .etiquette--qit { background: #e9b97a; color: var(--navy); font-weight: 700; }
.profil-note { background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--burgundy); }
.profil-score { color: var(--burgundy); }
.profil-note:last-child { background: var(--navy); border-color: var(--navy); border-top-color: #e9b97a; }
.profil-note:last-child .profil-code, .profil-note:last-child .profil-nom { color: rgba(255,255,255,0.85); }
.profil-note:last-child .profil-score { color: #e9b97a; }
.profil-note:last-child .reglette-fond { fill: rgba(255,255,255,0.18); }
.profil-note:last-child .reglette-bande { fill: rgba(255,255,255,0.4); }
.profil-note:last-child .reglette-repere { fill: #e9b97a; }
.saisie { border-top: 3px solid var(--brand-gold); }
.saisie-bascule-libelle::first-letter, .docs-titre::first-letter { color: var(--brand-gold); font-weight: 700; }
/* « Afficher / Masquer » de la saisie : même bouton que « Commencer la visite », bord droit aligné (1rem). */
.saisie-bascule { padding-right: 1rem; }
.saisie .bascule-etat { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: 8px; background: var(--burgundy); color: #fff; font-size: 0.85rem; font-weight: 600; transition: background-color 0.2s ease; }
.saisie-bascule:hover .bascule-etat { background: var(--burgundy-light); }
.visite-btn--principal { background: var(--burgundy); border-color: var(--burgundy); }
.visite-btn--principal:hover:not(:disabled) { background: var(--burgundy-light); }
.demo-essai-boite { background: radial-gradient(120% 100% at 85% 0%, var(--navy-muted) 0%, var(--navy) 100%); border: 0; border-bottom: 3px solid var(--brand-gold); }
.demo-essai h2 { color: #fff; }
/* Passages commentés en bordeaux (le navy reste à l'en-tête). */
a.annot[aria-expanded="true"] { background: var(--burgundy); }
a.annot[aria-expanded="true"] .annot-num { color: var(--burgundy); }
.annot-note { background: var(--burgundy); }
.doc .annot-note .annot-note-pos { color: rgba(255,255,255,0.75); }
.annot-note button { border-color: rgba(255,255,255,0.35); }
.annot-note button:hover:not(:disabled) { background: var(--burgundy-light); }
/* Provenance centrée sous le document. */
.doc .doc-provenance { text-align: center !important; margin-inline: auto; }
@media (prefers-reduced-motion: no-preference) {
  .case-card:hover { transform: translateY(-3px); }
  .profil-note { transition: transform 0.25s ease, box-shadow 0.25s ease; }
  .profil-note:hover { transform: translateY(-3px); box-shadow: 0 10px 20px -12px rgba(127,29,29,0.45); }
}
@media print {
  body::before { display: none; }
  .demo-hero { border: 0; }
  .demo-surtitre { color: var(--burgundy); }
  .demo-hero h1 { color: var(--navy); }
  .demo-chapeau, .cadrage { color: var(--text-muted); background: none; }
  .demo-chapeau strong { color: var(--burgundy); }
  .cadrage { background: none; border: 1px solid var(--border); border-left: 3px solid var(--burgundy); }
  .cadrage strong { color: var(--burgundy); }
  .profil-tete { background: none; }
  .profil-tete h3 { color: var(--navy); }
  .case-card::after { content: none; }
}

/* ---------- Impression : le cas affiché, tout déplié, tous les commentaires ---------- */
@media print {
  .cn-top-banner, .cn-nav, .cn-espace, .cn-fil, .cn-footer, .case-cards, .doc-tabs, .visite,
  .demo-essai, .bascule-etat, .annot-note-nav {
    display: none !important;
  }
  .doc-panel[hidden], .saisie-panel[hidden], .restit-detail[hidden], .annot-note[hidden] { display: block !important; }
  body { background: #fff; }
  .demo-hero { padding: 0 0 1.5rem; background: none; }
  .case-panel { padding: 1rem 0; }
  .doc-panel { break-before: page; }
  .doc { border: none; padding: 0; }
  .doc > * { max-width: none; }
  .doc h3, .doc h4 { break-after: avoid; }
  a.annot, a.annot[aria-expanded="true"] { background: none; color: inherit; text-decoration: underline; }
  .annot-num { background: none; color: var(--burgundy); border: 1px solid var(--burgundy); }
  .annot-note { background: none; color: var(--text); border: 1px solid var(--border); break-inside: avoid; }
  .doc .annot-note .annot-note-pos { color: var(--text-muted); }
  .restit-table tr { break-inside: avoid; }
  a[href]::after { content: ""; }
}
