/* ============================================================
   Crisalida — centre d'aide (/aide) : accueil, guides, chapitres
   Les couleurs viennent des jetons de base.css (mode clair et sombre).
   ============================================================ */

/* ---------------------------------------------------------------- Recherche */
.help-search { position: relative; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px;
  background: var(--field-bg); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--slate); }
.help-search > svg { width: 20px; height: 20px; flex: none; }
.help-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: inherit; font-size: 15.5px; color: var(--ink); outline: none; }
.help-search:focus-within { border-color: var(--crimson); box-shadow: 0 0 0 3px var(--crimson-100); }
.help-search-hero { max-width: 720px; margin-top: 26px; height: 58px; border-color: transparent; box-shadow: var(--sh-lg); }
.help-results { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0; max-height: min(460px, 70vh); overflow: auto;
  padding: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-xl); text-align: left; }
.help-result { display: grid; gap: 3px; padding: 11px 12px; border-radius: var(--r-sm); color: var(--text-strong); }
.help-result small { font-size: 12px; font-weight: 600; color: var(--slate-light); }
.help-result b { font-size: 15px; color: var(--ink); }
.help-result span { font-size: 13.5px; line-height: 1.5; color: var(--slate); }
.help-result mark { background: var(--crimson-100); color: inherit; border-radius: 3px; padding: 0 1px; }
.help-result:hover, .help-result.is-active { background: var(--mist); }
.help-empty { padding: 16px; font-size: 14px; line-height: 1.6; color: var(--slate); }
.help-empty button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------------------------------------------------------------- Accueil et sommaire d'un guide */
.help-hero { overflow: visible; z-index: 5; }
.help-hero .page-hero-inner { padding-bottom: 48px; }
.help-hero h1 { max-width: 780px; }
.help-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: 13.5px; color: rgba(255, 255, 255, .65); }
.help-hint { padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--r-pill); background: rgba(255, 255, 255, .06);
  color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.help-hint:hover { background: rgba(255, 255, 255, .16); }
.help-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.help-home { display: grid; gap: 56px; padding-top: 52px; padding-bottom: 84px; }
.help-h2 { font-size: 24px; font-weight: 800; margin-bottom: 18px; }
.help-guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.help-guide { display: flex; flex-direction: column; gap: 6px; padding: 24px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); color: var(--slate); transition: border-color .15s, box-shadow .15s, transform .15s; }
a.help-guide:hover { border-color: var(--crimson); box-shadow: var(--sh-md); transform: translateY(-2px); }
.help-guide small { margin-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--crimson); }
.help-guide b { font-family: var(--font-head); font-size: 20px; color: var(--ink); }
.help-guide > span:not(.help-guide-ic) { font-size: 14.5px; line-height: 1.55; }
.help-guide em { margin-top: auto; padding-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-style: normal; font-weight: 700; font-size: 14px; color: var(--crimson); }
.help-guide em svg { width: 16px; height: 16px; }
.help-guide.is-locked { background: var(--mist); border-style: dashed; }
.help-guide.is-locked .text-link { margin-top: auto; padding-top: 12px; font-size: 14px; }
.help-guide-ic { width: 46px; height: 46px; display: grid; place-items: center; flex: none; border-radius: 12px; background: var(--crimson-50); color: var(--crimson); }
.help-guide-ic svg { width: 22px; height: 22px; }
.help-guide-ic.sm { width: 36px; height: 36px; border-radius: 10px; }
.help-guide-ic.sm svg { width: 18px; height: 18px; }

.help-tours { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 36px; align-items: start; padding: 32px;
  border-radius: var(--r-xl); background: var(--section-alt); border: 1px solid var(--line-soft); }
.help-tours p { color: var(--slate); line-height: 1.65; }
.help-tour-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.help-tour { display: flex; gap: 12px; align-items: flex-start; padding: 16px; text-align: left; font: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--crimson); transition: border-color .15s, box-shadow .15s; }
.help-tour:hover { border-color: var(--crimson); box-shadow: var(--sh-md); }
.help-tour > svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.help-tour span { display: grid; gap: 3px; }
.help-tour b { color: var(--ink); font-size: 15px; }
.help-tour small { color: var(--slate); font-size: 13px; line-height: 1.45; }

.help-faq { display: grid; gap: 10px; max-width: 900px; }
.help-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.help-faq summary { position: relative; padding: 16px 48px 16px 20px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 400; color: var(--crimson); }
.help-faq details[open] summary::after { content: "–"; }
.help-faq details p { padding: 0 20px; color: var(--slate); line-height: 1.65; }
.help-faq details .text-link { display: inline-flex; align-items: center; gap: 6px; margin: 10px 20px 18px; font-size: 14px; }
.help-faq details .text-link svg { width: 15px; height: 15px; }

.help-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.help-contact-card { display: flex; align-items: center; gap: 16px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.help-contact-card > div { flex: 1; display: grid; gap: 4px; min-width: 0; }
.help-contact-card b { color: var(--ink); font-size: 16px; }
.help-contact-card span:not(.adv-avatar):not(.help-guide-ic) { color: var(--slate); font-size: 14px; line-height: 1.5; }
.help-contact-card .adv-avatar { flex: none; }

.help-chapters { display: grid; gap: 12px; max-width: 920px; counter-reset: none; }
.help-chapter { display: flex; align-items: center; gap: 18px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); color: var(--slate); transition: border-color .15s, box-shadow .15s; }
.help-chapter:hover { border-color: var(--crimson); box-shadow: var(--sh-md); }
.help-chapter > svg { width: 20px; height: 20px; flex: none; color: var(--slate-light); }
.help-chapter-n { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--crimson); color: #fff;
  font-family: var(--font-head); font-weight: 800; }
.help-chapter-body { flex: 1; display: grid; gap: 4px; min-width: 0; }
.help-chapter-body b { font-size: 17px; color: var(--ink); }
.help-chapter-body span { font-size: 14px; line-height: 1.55; }
.help-chapter-body small { font-size: 12.5px; color: var(--slate-light); }
.help-other { color: var(--slate); }

/* ---------------------------------------------------------------- Chapitre */
.help-top { border-bottom: 1px solid var(--line); background: var(--section-alt); }
.help-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 14px; padding-bottom: 14px; }
.help-top .help-search { width: min(420px, 100%); height: 44px; }
.help-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 40px; padding-bottom: 80px; }
.help-side { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 12px; max-height: calc(var(--screen-h) - var(--header-h) - 40px); overflow: auto; padding-bottom: 8px; }
.help-toc { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.help-toc summary { display: flex; align-items: center; gap: 12px; padding: 16px; cursor: pointer; list-style: none; border-bottom: 1px solid var(--line-soft); }
.help-toc summary::-webkit-details-marker { display: none; }
.help-toc summary > span:last-child { display: grid; }
.help-toc summary small { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-light); }
.help-toc summary b { color: var(--ink); }
.help-toc > ol { padding: 8px; display: grid; gap: 2px; }
.help-toc > ol > li > a { display: flex; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--slate); line-height: 1.4; }
.help-toc > ol > li > a .n { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--mist-2);
  font-size: 11.5px; font-weight: 800; color: var(--slate); }
.help-toc > ol > li > a:hover { background: var(--mist); color: var(--ink); }
.help-toc li.is-current > a { background: var(--crimson-50); color: var(--crimson); }
.help-toc li.is-current > a .n { background: var(--crimson); color: #fff; }
.help-toc ul { display: grid; gap: 1px; margin: 4px 0 6px 21px; padding-left: 10px; border-left: 2px solid var(--line); }
.help-toc ul a { display: block; padding: 5px 8px; font-size: 13.5px; color: var(--slate); border-radius: var(--r-xs); }
.help-toc ul a:hover, .help-toc ul a.is-active { color: var(--crimson); }
.help-toc ul a.is-active { font-weight: 700; }
.help-side-tour { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border: 1px dashed var(--crimson);
  border-radius: var(--r-md); background: var(--crimson-50); color: var(--crimson); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.help-side-tour svg { width: 18px; height: 18px; }

.help-article { max-width: 820px; }
.help-article-head { position: relative; padding-right: 50px; }
.help-kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--crimson); }
.help-article-head h1 { margin-top: 6px; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; font-weight: 800; color: var(--ink); }
.help-print { position: absolute; right: 0; top: 4px; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--surface); color: var(--slate); cursor: pointer; }
.help-print:hover { color: var(--crimson); border-color: var(--crimson); }
.help-print svg { width: 18px; height: 18px; }
.help-article h2 { padding-top: 6px; }
.help-article h3 { scroll-margin-top: calc(var(--header-h) + 24px); }
.help-article ol.help-steps { gap: 14px; }
.help-article ol.help-steps li { padding-left: 44px; min-height: 30px; }
.help-article ol.help-steps li::before { width: 30px; height: 30px; top: 0; background: var(--crimson); color: #fff; font-size: 14px; }

/* Éléments d'interface cités dans le texte */
.ui-btn { display: inline-block; padding: 1px 9px; border-radius: var(--r-sm); background: var(--crimson); color: #fff; font-size: .88em; font-weight: 700;
  line-height: 1.6; white-space: nowrap; }
.ui-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 1px 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--mist); color: var(--ink); font-size: .9em; font-weight: 600; line-height: 1.6; }
.ui-path i { font-style: normal; color: var(--crimson); }
.article kbd { display: inline-block; min-width: 24px; padding: 0 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface); font-family: var(--font-mono); font-size: .82em; text-align: center; color: var(--ink); line-height: 1.6; }
.article code { padding: 1px 6px; border-radius: 5px; background: var(--mist-2); font-family: var(--font-mono); font-size: .86em; color: var(--ink); }
.article a.ui-addr { font-weight: 600; }
.article a.ui-addr code { color: var(--crimson); }
.tour-cta .btn svg { width: 18px; height: 18px; }

/* Encadrés */
.help-callout { padding: 18px 22px; border-radius: var(--r-md); border-left: 4px solid; font-size: 15.5px; line-height: 1.65; }
.help-callout > * + * { margin-top: 8px; }
.help-callout-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-family: var(--font-head); }
.help-callout-title svg { width: 18px; height: 18px; flex: none; }
.help-callout ul { gap: 6px; }
.help-callout-astuce { background: var(--success-bg); border-color: var(--success); }
.help-callout-astuce .help-callout-title { color: var(--success); }
.help-callout-attention { background: var(--warning-bg); border-color: var(--warning); }
.help-callout-attention .help-callout-title { color: var(--warning); }
.help-callout-retenir { background: var(--crimson-50); border-color: var(--crimson); }
.help-callout-retenir .help-callout-title { color: var(--crimson); }
.help-callout-note { background: var(--mist); border-color: var(--slate-light); }
.help-callout-note .help-callout-title { color: var(--text-strong); }

/* Captures */
.shot { margin: 26px 0; }
.shot a { display: block; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-md); cursor: zoom-in; background: var(--mist); }
.shot img { display: block; width: 100%; height: auto; transition: transform .3s var(--ease); }
.shot a:hover img { transform: scale(1.015); }
.shot figcaption { margin-top: 10px; font-size: 13.5px; font-style: italic; color: var(--slate); text-align: center; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; align-items: start; }
.shots .shot { margin: 0; }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.article table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.article th { padding: 12px 16px; text-align: left; background: var(--section-alt); color: var(--crimson); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.article td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.article td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }

/* Avis, navigation entre chapitres */
.help-feedback { margin-top: 48px !important; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--section-alt);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.help-feedback > p:first-child { font-weight: 700; color: var(--ink); }
.help-feedback > div { display: flex; gap: 8px; }
.help-feedback .btn svg { width: 16px; height: 16px; }
.help-feedback-thanks { flex-basis: 100%; font-size: 14.5px; color: var(--slate); }
.help-feedback-thanks button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.help-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px !important; }
.help-pager a { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); font-weight: 400; }
.help-pager a:hover { border-color: var(--crimson); text-decoration: none; box-shadow: var(--sh-md); }
.help-pager small { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--slate); font-weight: 600; }
.help-pager small svg { width: 15px; height: 15px; }
.help-pager b { color: var(--ink); font-size: 16px; }
.help-pager .next { text-align: right; justify-items: end; grid-column: 2; }

/* Agrandissement d'une capture */
.help-lightbox { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 56px 24px 24px; background: rgba(10, 11, 15, .88); }
.help-lightbox[hidden] { display: none; }
.help-lightbox img { max-width: min(1400px, 100%); max-height: calc(var(--screen-h) - 130px); border-radius: var(--r-md); box-shadow: var(--sh-xl); background: #fff; }
.help-lightbox p { color: rgba(255, 255, 255, .8); font-size: 14px; text-align: center; }
.help-lightbox-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.help-lightbox-close svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- Écrans étroits */
@media (max-width: 960px) {
  .help-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .help-side { position: static; max-height: none; overflow: visible; }
  .help-tours { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
  .help-top-inner { flex-direction: column; align-items: stretch; }
  .help-top .help-search { width: 100%; }
}
@media (max-width: 640px) {
  .help-home { gap: 40px; padding-top: 32px; }
  .help-search-hero { height: 52px; }
  .help-chapter { padding: 16px; gap: 12px; }
  .help-chapter > svg { display: none; }
  .help-pager { grid-template-columns: 1fr; }
  .help-pager .next { grid-column: 1; }
  .help-contact { grid-template-columns: 1fr; }
  .help-contact-card { flex-wrap: wrap; }
  .article td:first-child { white-space: normal; }
}

/* ---------------------------------------------------------------- Impression */
@media print {
  .header, .utility, .footer, .help-top, .help-side, .help-feedback, .help-pager, .help-print, .adv, .tour-cta, #consent { display: none !important; }
  .help-layout { display: block; padding: 0; }
  .shot a { box-shadow: none; }
  .help-callout, .shot { break-inside: avoid; }
}
