/* Guide Cleo Carbone · CSS partagé
   Tokens de marque, nav, commandes et footer : voir ../assets/portal.css
   (charge avant ce fichier dans le <head> de chaque page du guide).
   Ce fichier ne garde que la mise en page documentation (sidebar,
   sommaire, stepper, recherche, glossaire...). */

:root {
  /* Rayons du site vitrine (portal.css) */
  --radius: var(--r-md);
  --radius-sm: var(--r-sm);
  --gradient: linear-gradient(90deg, var(--marine), var(--framboise));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Titres en Roboto Condensed (identité Cleo) */
.content h1, .content h2, .content h3, .guide-hero h1, .chapter-card h2, .profile-card h2, .parcours-step h3,
.section-title, .faq-title, .glossary-term { font-family: var(--font-display); font-weight: 700; letter-spacing: -.005em; }
.chapter-kicker, .sidebar-label, .hero-eyebrow, .profile-eyebrow, .chapter-num, .parcours-step-num, .pag-kicker,
.stepper-step-num, .profile-tag, .step-meta-label { font-family: var(--font-display); }
.sidebar-label, .chapter-kicker, .hero-eyebrow { letter-spacing: .14em; font-weight: 600; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--encre);
  background: var(--brume);
  line-height: 1.62;
  font-size: var(--t-base);
}

a { color: var(--marine); text-decoration: none; }
.content p a, .content li a, .content td a, .callout a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(25,40,131,.35); }
.content p a:hover, .content li a:hover, .content td a:hover, .callout a:hover { text-decoration-color: var(--framboise); }
.sidebar a, .chapter-card, .profile-card { text-decoration: none; }

img { max-width: 100%; display: block; }

/* --- Reading progress --- */
.reading-progress {
  height: 3px;
  background: var(--line);
}

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

/* --- Layout --- */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: 260px minmax(0, 760px);
  gap: 48px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--framboise-deep);
  margin: 0 0 10px;
}

.anchor-list, .chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chapter-list { counter-reset: chapter; }

.anchor-list a, .chapter-list a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--encre);
  font-size: 14px;
  font-weight: 600;
}

.anchor-list a { font-weight: 500; color: var(--gris-2); border-left: 2px solid transparent; }
.anchor-list a:hover, .anchor-list a.active { text-decoration: none; border-left: 2px solid var(--framboise); color: var(--encre); background: var(--paper); }

.chapter-list a:hover { text-decoration: none; background: var(--paper); }
.chapter-list a.active {
  background: var(--paper);
  color: var(--marine);
  box-shadow: inset 3px 0 0 var(--framboise);
}

/* --- Content --- */
.content {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 40px 48px;
  min-width: 0;
}

.content h1 {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--encre);
}

.chapter-kicker {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--framboise-deep);
  margin: 0 0 8px;
}

.content h2 {
  font-size: 29px;
  font-weight: 800;
  margin: 40px 0 14px;
  padding-top: 8px;
  color: var(--encre);
}

.content h3 {
  font-size: 22px;
  font-weight: 800;
  margin: 28px 0 10px;
  color: var(--encre);
}

.content p { margin: 0 0 16px; }

.content ul, .content ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.content li { margin-bottom: 8px; }

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 14px;
}

.content th, .content td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.content th {
  background: var(--brume);
  font-weight: 800;
  color: var(--encre);
}

.content table tr:last-child td { border-bottom: none; }

/* Callout objectif */
.callout {
  background: var(--marine-wash);
  border-left: 4px solid var(--marine);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 28px;
}

.callout p { margin: 0; }

.callout strong { color: var(--encre); }

/* Bloc etapes */
.steps-block {
  background: var(--brume);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 0 0 24px;
}

.steps-block p.steps-title {
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--encre);
}

.steps-block ol {
  margin: 0;
  padding-left: 22px;
}

.steps-block ol li { margin-bottom: 10px; }
.steps-block ol li:last-child { margin-bottom: 0; }

/* Badge bientot disponible */
.badge-soon {
  display: inline-block;
  background: var(--framboise-wash);
  color: var(--framboise-deep);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Bonnes pratiques / points de vigilance */
.tips-block {
  background: var(--teal-wash);
  border-left: 4px solid var(--teal-deep);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 24px;
}

.tips-block p.tips-title { margin: 0 0 10px; font-weight: 800; color: var(--teal-deep); }
.tips-block ul { margin: 0; padding-left: 20px; }

.example-block {
  background: var(--marine-wash);
  border-left: 4px solid var(--marine);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 24px;
}

.example-block p.example-title { margin: 0 0 10px; font-weight: 800; color: var(--marine); }

hr.section-sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pag-link {
  flex: 1;
  background: var(--brume);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--encre);
  font-weight: 700;
}

.pag-link:hover { background: var(--line); text-decoration: none; }

.pag-link.pag-next { text-align: right; }

.pag-link .pag-kicker {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--framboise-deep);
  margin-bottom: 4px;
}

.pag-spacer { flex: 1; }

/* --- Hero (index) --- */
.guide-hero {
  grid-column: 1 / -1;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 56px 48px;
  margin-bottom: 8px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--framboise-deep);
  background: var(--framboise-wash);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.guide-hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin: 0 0 12px;
}

.guide-hero p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--gris-2);
  font-size: 16px;
}

.chapter-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.chapter-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px 26px;
  color: var(--encre);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}

.chapter-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient);
}

.chapter-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(25,40,131,0.10);
}

.chapter-card .chapter-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--marine);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.chapter-card h2 {
  font-size: 23px;
  font-weight: 800;
  margin: 0 0 8px;
  padding: 0;
}

.chapter-card p {
  font-size: 14px;
  color: var(--gris-2);
  margin: 0;
}

/* Footer commun : voir ../assets/portal.css (.pfooter) */

/* --- Checklist "Champs à préparer" --- */
.checklist-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--framboise-deep);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 0 0 28px;
}

.checklist-title { margin: 0 0 4px; font-weight: 800; color: var(--framboise-deep); }
.checklist-hint { margin: 0 0 12px; font-size: 13px; color: var(--gris-2); }

.checklist-items { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 16px; }

.checklist-items li { margin: 0; }

.checklist-items label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checklist-items input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--framboise-deep);
  flex-shrink: 0;
}

.checklist-reset {
  font-size: 13px;
  font-weight: 700;
  color: var(--encre);
  background: var(--brume);
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.checklist-reset:hover { background: var(--line); }

/* --- Stepper (parcours pas à pas) --- */
.stepper { margin-top: 4px; }

.stepper-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stepper-status { margin: 0; font-size: 13px; font-weight: 800; color: var(--marine); text-transform: uppercase; letter-spacing: 0.04em; }

.stepper-toggle {
  font-size: 13px;
  font-weight: 700;
  color: var(--encre);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.stepper-toggle:hover { background: var(--line); }

.stepper-step {
  display: none;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.stepper-step.is-visible { display: block; }

.stepper-step-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--paper);
  background: var(--marine);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 10px;
}

.stepper-step .step-action { margin: 0 0 10px; font-weight: 600; }
.stepper-step ul { margin: 0 0 10px; padding-left: 20px; }

.step-click, .step-result {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 8px;
}

.step-click { background: var(--marine-wash); }
.step-result { background: var(--teal-wash); }

.step-meta-label {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
}

.step-click .step-meta-label { color: var(--marine); background: var(--paper); }
.step-result .step-meta-label { color: var(--teal-deep); background: var(--paper); }

.stepper-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.stepper-nav button {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--encre);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
}

.stepper-nav button:hover:not(:disabled) { background: var(--line); }
.stepper-nav button:disabled { opacity: 0.4; cursor: default; }

/* --- Cas ambigus --- */
.ambiguous-block {
  background: var(--framboise-wash);
  border-left: 4px solid var(--framboise-deep);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 24px;
}

.ambiguous-title { margin: 0 0 6px; font-weight: 800; color: var(--framboise-deep); }
.ambiguous-source { display: block; font-size: 12px; font-weight: 600; color: var(--gris-2); margin: 0 0 10px; }
.ambiguous-block ul { margin: 0; padding-left: 20px; }
.ambiguous-block li { margin-bottom: 8px; }
.ambiguous-block li:last-child { margin-bottom: 0; }

/* --- FAQ --- */
.faq-block { margin: 32px 0 0; }
.faq-title { font-size: 26px; font-weight: 800; margin: 0 0 14px; color: var(--encre); }

.faq-item {
  background: var(--brume);
  border-radius: var(--radius-sm);
  padding: 4px 20px;
  margin-bottom: 10px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: '+';
  display: inline-block;
  width: 18px;
  color: var(--marine);
  font-weight: 800;
}

.faq-item[open] summary::before { content: '−'; }

.faq-item p { padding-bottom: 14px; margin: 0; color: var(--encre); }
.faq-item p.faq-missing { color: var(--framboise-deep); font-style: italic; }

/* --- Glossaire --- */
.glossary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.glossary-term { font-size: 17px; font-weight: 800; margin: 0 0 6px; color: var(--encre); }
.glossary-def { margin: 0; }
.glossary-todo { color: var(--framboise-deep); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; margin-left: 8px; }

abbr[title] {
  text-decoration: underline dotted var(--marine);
  text-decoration-thickness: 1px;
  cursor: help;
}

/* --- Search block (sommaire) --- */
.search-block {
  grid-column: 1 / -1;
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 8px;
}

.search-label { display: block; font-size: 13px; font-weight: 800; color: var(--framboise-deep); margin-bottom: 8px; }

.search-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--brume);
  color: var(--encre);
}

.search-input:focus { outline: 2px solid var(--framboise); outline-offset: 1px; }

.search-results {
  position: absolute;
  left: 24px;
  right: 24px;
  top: calc(100% - 6px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(25,40,131,0.14);
  z-index: 60;
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.search-results li a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--encre);
}

.search-results li a:hover { background: var(--brume); text-decoration: none; }

.search-result-title { font-weight: 700; font-size: 14px; }
.search-result-chapter { font-size: 12px; color: var(--marine); }
.search-result-empty { padding: 10px 12px; font-size: 14px; color: var(--gris-2); }

/* --- Chapter visited badge --- */
.chapter-card { position: relative; }

.chapter-visited-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal-deep);
  background: var(--teal-wash);
  border-radius: 999px;
  padding: 3px 10px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }
  .sidebar-section { flex: 1 1 260px; }
  .content { padding: 28px 22px; }
  .guide-hero { padding: 40px 24px; }
  .guide-hero h1 { font-size: 34px; }
}

@media (max-width: 560px) {
  .nav-title { display: none; }
  .pagination { flex-direction: column; }
  .content table { display: block; overflow-x: auto; }
  .stepper-controls { flex-direction: column; align-items: flex-start; }
  .checklist-items { grid-template-columns: 1fr; }
}

/* ================================================================
   Parcours par profil (Agence / Fournisseur)
   Cartes de choix sur index.html, pages agence.html et
   fournisseur.html, rappel de parcours dans la sidebar des
   chapitres, filtre du sommaire par profil.
   Aucune couleur nouvelle : tokens de ../assets/portal.css.
   ================================================================ */

/* --- Cartes de choix de profil (index.html) --- */
.profile-choice {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.profile-card {
  display: block;
  background: var(--paper);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  color: var(--encre);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.profile-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--gradient);
}

.profile-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--framboise);
  box-shadow: 0 12px 28px rgba(25,40,131,0.12);
}

.profile-card .profile-eyebrow {
  font-size: 12px;
  font-weight: 800;
  color: var(--marine);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}

.profile-card h2 {
  font-size: 30px;
  font-weight: 800;
  margin: 0 0 10px;
  padding: 0;
}

.profile-card p {
  font-size: 15px;
  color: var(--gris-2);
  margin: 0 0 14px;
}

.profile-card ul {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 14px;
  color: var(--gris-2);
}

.profile-card li { margin-bottom: 4px; }

.profile-card .profile-cta {
  display: inline-block;
  font-weight: 800;
  font-size: 14px;
  color: var(--marine);
}

/* --- Filtre du sommaire par profil (injecte par guide.js) --- */
.sommaire-filter {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sommaire-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gris-2);
  margin-right: 4px;
}

.sommaire-filter button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--gris-2);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.sommaire-filter button:hover { border-color: var(--framboise); }

.sommaire-filter button[aria-pressed="true"] {
  background: var(--marine);
  border-color: var(--marine);
  color: var(--paper);
}

/* --- Etapes d'un parcours (agence.html / fournisseur.html) --- */
.parcours-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.parcours-steps > li { margin: 0; }

.parcours-step {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.parcours-step .parcours-step-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--marine);
  margin: 0 0 6px;
}

.parcours-step h3 {
  font-size: 23px;
  font-weight: 800;
  margin: 0 0 8px;
  padding: 0;
}

.parcours-step p {
  font-size: 15px;
  color: var(--gris-2);
  margin: 0 0 10px;
}

.parcours-step .parcours-link {
  font-weight: 800;
  font-size: 14px;
}

.parcours-step .parcours-sublinks {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 14px;
}

/* --- Rappel du parcours actif dans la sidebar des chapitres --- */
.parcours-recall {
  display: block;
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--framboise);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--encre);
}

.parcours-recall:hover {
  text-decoration: none;
  border-color: var(--framboise);
}

.parcours-recall .parcours-recall-label {
  display: block;
  font-weight: 800;
  font-size: 14px;
}

.parcours-recall .parcours-recall-hint {
  display: block;
  font-size: 12px;
  color: var(--gris-2);
  margin-top: 2px;
}

/* --- Pastille "chapitre du parcours X" en tete de chapitre --- */
.profile-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--marine);
  background: var(--marine-wash);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
}

/* Titre de section sur la page de choix (index.html) */
.section-title {
  grid-column: 1 / -1;
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  color: var(--encre);
}

/* Harmonisation portail : texte courant du guide a la meme taille que le reste du site */
.content p, .content li, .content td, .content th, .content dd { font-size: var(--t-base); line-height: 1.65; }

.search-result-snippet{display:block;font-size:13px;color:var(--gris-2);margin-top:4px;line-height:1.45}
.search-result-snippet mark{background:var(--framboise-wash);color:inherit;padding:0 2px;border-radius:3px}
.search-results li a{display:block}

/* --- Mention par profil dans un chapitre (data-profile : masquée hors profil actif) --- */
.profile-note {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--marine);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 20px;
}
.profile-note .profile-note-who {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--marine);
  margin-bottom: 4px;
}
.profile-note p { margin: 0; }
.content .todo { font-size: 15px; }

/* Page d'accueil du guide : une seule colonne */
.layout.layout-wide { grid-template-columns: 1fr; }

/* --- Méthodologie : tableaux de facteurs, encarts d'attention, cartes de catégories --- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  max-width: 100%;
}
.table-scroll:focus-visible { outline: 3px solid var(--framboise); outline-offset: 2px; }
.content .table-scroll table.data-table {
  display: table;
  width: 100%;
  min-width: 520px;
  margin: 0;
  border: 0;
  border-radius: 0;
  font-size: 14.5px;
}
.content .table-scroll th, .content .table-scroll td { font-size: 14.5px; line-height: 1.45; }
.content .table-scroll th { white-space: nowrap; }
.content .table-scroll tbody tr:nth-child(even) td { background: var(--brume); }

.attention {
  background: var(--framboise-wash);
  border-left: 4px solid var(--framboise);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 24px;
}
.attention .attention-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--framboise-deep);
}
.attention p { margin: 0 0 10px; }
.attention ul { margin: 0 0 10px; }
.attention > :last-child { margin-bottom: 0; }

.content .lead-in { margin-bottom: 8px; }
.content .lead-in strong { color: var(--marine-deep); }
.content .note { color: var(--gris-2); font-size: 15px; }
.content h3 { scroll-margin-top: 90px; }

.methodo-cards { margin: 8px 0 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.methodo-cards .chapter-card { border: 1px solid var(--line-2); box-shadow: var(--sh-1); }
.methodo-cards .chapter-card h3 { font-size: 22px; margin: 0 0 4px; padding: 0; color: var(--marine-deep); line-height: 1.15; }
.methodo-cards .chapter-sub { font-size: 13px; color: var(--gris-2); margin: 0 0 10px; }
.methodo-cards ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--gris-2); }
.methodo-cards li { margin-bottom: 2px; }
.search-inline { grid-column: auto; margin: 8px 0 24px; padding: 16px 18px; background: var(--brume); }
.search-inline .search-results { left: 18px; right: 18px; }

/* --- Schémas explicatifs (SVG inline : couleurs en attributs, polices et tailles ici) --- */
.schema { margin: 8px 0 28px; }
.schema-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-width: 100%;
}
.schema-scroll:focus-visible { outline: 3px solid var(--framboise); outline-offset: 2px; }
.schema-svg { display: block; width: 100%; height: auto; }
.schema-m560 { min-width: 560px; }
.schema-m640 { min-width: 640px; }
.schema-m720 { min-width: 720px; }
.schema figcaption { margin-top: 8px; font-size: 14.5px; color: var(--gris-2); line-height: 1.5; }
.schema-svg text { font-family: var(--font-body); }
.schema-svg .dg-t { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.schema-svg .dg-w { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.schema-svg .dg-b { font-weight: 700; font-size: 14px; }
.schema-svg .dg-s { font-size: 14px; }
.schema-svg .dg-sw { font-size: 14px; }
.schema-svg .dg-c { font-size: 13px; }
.schema-svg a { cursor: pointer; }
.schema-svg a:focus-visible rect, .schema-svg a:hover rect { stroke: var(--framboise); stroke-width: 2.5; }
.cat-tree { margin: 0 0 16px; }
/* Tuiles de catégorie : un seul lien par niveau (pas de lien dans un lien).
   Le lien du titre couvre la tuile ; les sous-catégories restent cliquables au-dessus. */
.methodo-cards .chapter-card h3 a { color: inherit; text-decoration: none; }
.methodo-cards .chapter-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.methodo-cards .chapter-card ul { position: relative; z-index: 1; }
.methodo-cards .chapter-card h3 a:focus-visible { outline: none; }
.methodo-cards .chapter-card:focus-within { outline: 2px solid var(--marine); outline-offset: 2px; }

/* --- Profil actif : mise en avant des parcours et des pages « métier » --- */
.profile-card.is-current { border-color: var(--marine); box-shadow: 0 0 0 3px var(--marine), 0 12px 28px rgba(25,40,131,0.14); background: var(--marine-wash); }
.profile-card.is-current .profile-cta::after { content: " · votre profil"; color: var(--framboise-deep); }
.badge-metier { display: none; }
.chapter-card .badge-metier { position: absolute; top: 12px; right: 12px; }
.is-metier > .badge-metier {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--framboise-deep);
  border-radius: 999px;
  padding: 3px 10px;
}
.methodo-cards .chapter-card.is-metier { border-color: var(--framboise); box-shadow: 0 0 0 2px var(--framboise); }
.chapter-list a.is-metier { box-shadow: inset 3px 0 0 var(--framboise); font-weight: 700; }
.chapter-list a.is-metier.active { box-shadow: inset 3px 0 0 var(--framboise); }
.schema-svg .badge-metier { display: none; }
.schema-svg a.is-metier .badge-metier { display: inline; }
.schema-svg a.is-metier > rect { stroke: var(--framboise); stroke-width: 2.5; }
.schema-svg .dg-badge { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .04em; }

/* --- Tutoriel d'import : vidéo, étapes numérotées, générateur de coefficient --- */
.tuto-video { margin: 0 0 24px; }
.tuto-video video { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 970; background: var(--marine-deep); border-radius: var(--radius-sm); }
.tuto-video figcaption { margin-top: 8px; font-size: 14.5px; color: var(--gris-2); }
.tuto-steps { list-style: none; counter-reset: tuto; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.tuto-steps > li { counter-increment: tuto; position: relative; margin: 0; padding: 14px 18px 14px 62px; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.tuto-steps > li::before { content: counter(tuto); position: absolute; left: 16px; top: 13px; width: 32px; height: 32px; border-radius: 50%; background: var(--marine); color: #fff; font-family: var(--font-display); font-weight: 700; display: grid; place-items: center; }
.tuto-steps > li strong { color: var(--marine-deep); }
.coef-gen { background: var(--brume); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 20px; margin: 0 0 24px; }
.coef-manual { margin: 0 0 12px; }
.coef-form[hidden] { display: none; }
.coef-form fieldset { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 16px 16px; margin: 0 0 14px; background: var(--paper); min-width: 0; }
.coef-form legend { font-family: var(--font-display); font-weight: 700; color: var(--marine-deep); padding: 0 6px; }
.coef-form label { display: block; font-weight: 700; font-size: 15px; margin: 10px 0 4px; color: var(--encre); }
.coef-form input { width: 100%; max-width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); color: var(--encre); }
.coef-form input:focus { outline: 3px solid var(--framboise); outline-offset: 1px; border-color: transparent; }
.coef-form input[aria-invalid="true"] { border-color: var(--framboise-deep); background: var(--framboise-wash); }
.coef-result { margin-top: 4px; }
.coef-hint { margin: 0; color: var(--gris-2); }
.coef-line { background: var(--paper); border: 1px solid var(--line-2); border-left: 4px solid var(--teal); border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 12px; }
.coef-line.is-error { border-left-color: var(--framboise); background: var(--framboise-wash); }
.coef-seg { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; color: var(--marine-deep); }
.coef-formula { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--teal-deep); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.coef-detail { margin: 0 0 10px; color: var(--encre); }
.coef-msg { margin: 0; color: var(--framboise-deep); font-weight: 700; }
.coef-status { margin: 4px 0 0; min-height: 1.4em; color: var(--teal-deep); font-weight: 700; }
.coef-ghost { position: absolute; left: -9999px; }
@media (max-width: 560px) { .coef-formula { font-size: 22px; } .coef-gen { padding: 14px; } }

/* --- Calculateur de distance : champs avec liste de suggestions (combobox) --- */
.dist-gen { background: var(--brume); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 20px; margin: 0 0 24px; }
.dist-form[hidden] { display: none; }
.dist-form { display: grid; gap: 12px; }
.dist-field label { display: block; font-weight: 700; font-size: 15px; margin: 0 0 4px; color: var(--encre); }
.dist-combo { position: relative; }
.dist-form input { width: 100%; max-width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); color: var(--encre); }
.dist-form input:focus { outline: 3px solid var(--framboise); outline-offset: 1px; border-color: transparent; }
.dist-form input[aria-invalid="true"] { border-color: var(--framboise-deep); background: var(--framboise-wash); }
.dist-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--paper); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 30px rgba(25,40,131,.16); max-height: 320px; overflow-y: auto; }
.dist-list[hidden] { display: none; }
.dist-list li { margin: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 15.5px; line-height: 1.35; }
.dist-list li[aria-selected="true"], .dist-list li:hover { background: var(--marine-wash); color: var(--marine-deep); }
.dist-swap-wrap { display: flex; }
.dist-swap { padding: 8px 18px; }
.dist-aide { margin: 0; font-size: 14px; color: var(--gris-2); }
.dist-trips { max-width: 320px; }
.dist-result { margin-top: 14px; }
.dist-hint { margin: 0; color: var(--gris-2); }
.dist-msg { margin: 0; color: var(--framboise-deep); font-weight: 700; }
.dist-line { background: var(--paper); border: 1px solid var(--line-2); border-left: 4px solid var(--marine); border-radius: var(--radius-sm); padding: 14px 18px; }
.dist-route { margin: 0 0 8px; font-family: var(--font-display); font-weight: 700; color: var(--marine-deep); overflow-wrap: anywhere; }
.dist-km { margin: 0 0 4px; font-size: 18px; font-variant-numeric: tabular-nums; }
.dist-km strong { font-family: var(--font-display); font-size: 26px; color: var(--marine); }
.dist-copy { margin-top: 10px; }
@media (max-width: 560px) { .dist-gen { padding: 14px; } .dist-km strong { font-size: 22px; } }
/* Formule repliée (calculateur de distance) : pour qui veut vérifier, jamais en tête de l'outil */
details.formule { margin: 12px 0 16px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--brume); }
details.formule summary { cursor: pointer; font-weight: 700; color: var(--marine); }
details.formule p { margin: 10px 0 0; font-size: 14.5px; }
