/* SYS-14 · Manuel de l'ERP : panneau « ❓ Aide », page /admin/aide, visite guidée « ▶ Me montrer » */
:root { --st-aide-fond: #ffffff; --st-aide-texte: #0E121D; --st-aide-doux: #64748B; --st-aide-trait: #E5E7EB; --st-aide-survol: #F4F8DD; --st-aide-vert: #85990A; --st-aide-vert-clair: #F4F8DD; --st-aide-marque: #FDF2B3; }
.dark { --st-aide-fond: #1E293B; --st-aide-texte: #F1F5F9; --st-aide-doux: #94A3B8; --st-aide-trait: #334155; --st-aide-survol: #2B3A16; --st-aide-vert: #AFCA0B; --st-aide-vert-clair: #26300A; --st-aide-marque: #5B4B00; }

/* ───── Panneau de la barre verte ───── */
.st-aide__panneau { position: fixed; top: 80px; right: 1rem; width: 420px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 96px); display: flex; flex-direction: column;
    background: var(--st-aide-fond); color: var(--st-aide-texte); border: 1px solid var(--st-aide-trait); border-radius: .75rem; box-shadow: 0 12px 34px rgba(0,0,0,.2); z-index: 210; font-family: "Public Sans", sans-serif; font-size: .875rem; }
.st-aide__tete { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--st-aide-trait); }
.st-aide__tete strong { font-family: "Exo", sans-serif; font-size: 1rem; }
.st-aide__lien-manuel { margin-left: auto; color: var(--st-aide-vert); font-weight: 600; text-decoration: none; }
.st-aide__lien-manuel:hover { text-decoration: underline; }
.st-aide__recherche { padding: .6rem .9rem; }
.st-aide__recherche input, .st-manuel__chercher { width: 100%; border: 1px solid var(--st-aide-trait); border-radius: .5rem; padding: .55rem .75rem; font-size: .9rem; background: var(--st-aide-fond); color: var(--st-aide-texte); }
.st-aide__recherche input:focus, .st-manuel__chercher:focus { outline: 2px solid #AFCA0B; border-color: #AFCA0B; }
.st-aide__corps { overflow-y: auto; padding: 0 .6rem .8rem; }
.st-aide__resultat, .st-manuel__item { display: flex; gap: .6rem; align-items: flex-start; width: 100%; padding: .5rem .55rem; border-radius: .5rem; color: inherit; text-decoration: none; text-align: left; background: transparent; border: 0; cursor: pointer; font: inherit; }
.st-aide__resultat:hover, .st-manuel__item:hover { background: var(--st-aide-survol); }
.st-aide__resultat b, .st-manuel__item b { font-weight: 600; }
.st-aide__icone { flex: 0 0 1.5rem; font-size: 1.1rem; line-height: 1.3rem; text-align: center; }
.st-aide__extrait { display: block; color: var(--st-aide-doux); font-size: .8rem; line-height: 1.35; margin-top: .1rem; }
.st-aide__extrait mark, .st-aide mark { background: var(--st-aide-marque); color: inherit; border-radius: 2px; padding: 0 1px; }
.st-aide .st-sous, .st-manuel .st-sous { display: block; color: var(--st-aide-doux); font-size: .78rem; font-weight: 400; }
.st-aide__resultat .st-sous, .st-manuel__item .st-sous { display: inline; }
.st-aide__vide { color: var(--st-aide-doux); padding: .6rem .4rem; }
.st-aide__vide a { color: var(--st-aide-vert); font-weight: 600; }
.st-aide__ici { background: var(--st-aide-vert-clair); border-radius: .6rem; padding: .7rem .8rem; margin: 0 .2rem .4rem; }
.st-aide__ici-titre { display: flex; gap: .5rem; align-items: center; }
.st-aide__ici-titre b { font-size: 1rem; font-family: "Exo", sans-serif; }
.st-aide__ici p { margin: .4rem 0 .6rem; line-height: 1.4; }
.st-aide__boutons, .st-manuel__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.st-aide__bouton { display: inline-flex; align-items: center; gap: .3rem; padding: .42rem .8rem; border-radius: .5rem; border: 1px solid var(--st-aide-trait); background: var(--st-aide-fond); color: var(--st-aide-texte); font-weight: 600; font-size: .85rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.st-aide__bouton:hover { border-color: #AFCA0B; }
.st-aide__bouton:disabled { opacity: .45; cursor: default; }
.st-aide__bouton--vert { background: #85990A; border-color: #85990A; color: #fff; }
.st-aide__bouton--vert:hover { background: #6E7E08; color: #fff; }
.st-aide__rubrique, .st-manuel__rubrique { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--st-aide-doux); padding: .7rem .55rem .25rem; }
.st-aide__faq { border-bottom: 1px solid var(--st-aide-trait); padding: .45rem .55rem; }
.st-aide__faq summary { cursor: pointer; font-weight: 600; }
.st-aide__faq div { color: var(--st-aide-doux); padding-top: .3rem; line-height: 1.45; }
.st-aide__faq div p { margin: 0; }
.st-aide__faq a, .st-manuel__texte a { color: var(--st-aide-vert); font-weight: 600; }

/* ───── Page /admin/aide : deux colonnes qui défilent chacune dans leur cadre ───── */
.st-aide-page .fi-page > section { padding-top: 0 !important; padding-bottom: 0 !important; gap: 0 !important; }
.st-manuel { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; height: calc(100dvh - 72px - 2.5rem); min-height: 420px; color: var(--st-aide-texte); font-size: .9rem; }
.st-manuel__gauche { display: flex; flex-direction: column; gap: .5rem; min-height: 0; background: var(--st-aide-fond); border: 1px solid var(--st-aide-trait); border-radius: .75rem; padding: .7rem; }
.st-manuel__accueil { font-family: "Exo", sans-serif; font-weight: 700; font-size: 1.05rem; text-align: left; background: none; border: 0; padding: .1rem .2rem; cursor: pointer; color: inherit; }
.st-manuel__liste { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -.3rem; padding: 0 .3rem; }
.st-manuel__item { padding: .38rem .5rem; font-size: .86rem; }
.st-manuel__item.actif { background: var(--st-aide-vert-clair); box-shadow: inset 3px 0 0 #AFCA0B; font-weight: 600; }
.st-manuel__item--parcours { font-weight: 600; }
.st-manuel__autres { margin-top: .4rem; }
.st-manuel__autres summary { cursor: pointer; color: var(--st-aide-doux); font-size: .8rem; font-weight: 600; padding: .4rem .55rem; }
.st-manuel__lecture { overflow-y: auto; min-height: 0; background: var(--st-aide-fond); border: 1px solid var(--st-aide-trait); border-radius: .75rem; padding: 1.1rem 1.6rem 1.5rem; }
.st-manuel__retour { display: none; }
.st-manuel__entete { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: .8rem; }
.st-manuel__entete-texte { flex: 1; min-width: 0; }
.st-manuel__entete h1 { font-family: "Exo", sans-serif; font-size: 1.5rem; font-weight: 700; margin: .1rem 0 .2rem; line-height: 1.2; }
.st-manuel__grande-icone { font-size: 2rem; line-height: 2.4rem; }
.st-manuel__resume { color: var(--st-aide-doux); margin: 0; font-size: .95rem; }
.st-manuel__texte { max-width: 820px; line-height: 1.6; }
.st-manuel__texte h2 { font-family: "Exo", sans-serif; font-size: 1.15rem; font-weight: 700; margin: 1.3rem 0 .45rem; padding-top: .2rem; border-top: 1px solid var(--st-aide-trait); padding-top: .9rem; }
.st-manuel__texte h2:first-child { border-top: 0; margin-top: .3rem; padding-top: 0; }
.st-manuel__texte h3 { font-size: 1rem; font-weight: 700; margin: 1rem 0 .3rem; }
.st-manuel__texte p { margin: .4rem 0; }
.st-manuel__texte ul, .st-manuel__texte ol { margin: .3rem 0 .6rem 1.4rem; }
.st-manuel__texte ul { list-style: disc; }
.st-manuel__texte ol { list-style: decimal; }
.st-manuel__texte li { margin: .18rem 0; }
.st-manuel__texte strong, .st-manuel__texte b { font-weight: 700; }
.st-manuel__texte table { border-collapse: collapse; margin: .6rem 0; font-size: .85rem; }
.st-manuel__texte th, .st-manuel__texte td { border: 1px solid var(--st-aide-trait); padding: .35rem .6rem; text-align: left; vertical-align: top; }
.st-manuel__texte th { background: var(--st-aide-vert-clair); }
.st-manuel__texte code { background: var(--st-aide-vert-clair); padding: 0 .25rem; border-radius: 3px; font-size: .85em; }
.st-manuel__texte .st-aide-montrer { display: inline-block; background: #85990A; color: #fff !important; padding: .2rem .6rem; border-radius: .4rem; text-decoration: none; font-size: .85rem; }
.st-aide-capture { margin: .6rem 0 1rem; max-width: 820px; }
.st-aide-capture img { width: 100%; border: 1px solid var(--st-aide-trait); border-radius: .5rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.st-aide-capture figcaption { color: var(--st-aide-doux); font-size: .75rem; margin-top: .25rem; }
.st-aide-capture--haut img { max-height: 46vh; object-fit: cover; object-position: top left; }
.st-manuel__cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; margin: .4rem 0 1rem; max-width: 900px; }
.st-manuel__carte { display: flex; gap: .7rem; align-items: flex-start; text-align: left; padding: .9rem 1rem; border: 1px solid var(--st-aide-trait); border-radius: .7rem; background: var(--st-aide-fond); color: inherit; cursor: pointer; font: inherit; }
.st-manuel__carte:hover { border-color: #AFCA0B; }
.st-manuel__carte b { display: block; font-size: 1rem; margin-bottom: .15rem; }
.st-manuel__carte--vert { background: var(--st-aide-vert-clair); border-color: #AFCA0B; }
.st-manuel__controle { margin-top: 1rem; font-size: .82rem; color: var(--st-aide-doux); }
.st-manuel__controle summary { cursor: pointer; font-weight: 600; }
.st-manuel__controle ul { margin: .4rem 0 0 1.2rem; list-style: disc; }

/* Parcours pas à pas */
.st-parcours__fil { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .9rem; padding: 0; list-style: none; }
.st-parcours__fil button { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem .25rem .3rem; border-radius: 999px; border: 1px solid var(--st-aide-trait); background: var(--st-aide-fond); color: var(--st-aide-doux); cursor: pointer; font-size: .78rem; }
.st-parcours__fil button span { display: inline-flex; width: 1.35rem; height: 1.35rem; border-radius: 999px; align-items: center; justify-content: center; background: var(--st-aide-trait); color: var(--st-aide-texte); font-weight: 700; font-size: .75rem; }
.st-parcours__fil button em { font-style: normal; }
.st-parcours__fil button.fait span { background: #AFCA0B; color: #fff; }
.st-parcours__fil button.actif { border-color: #85990A; color: var(--st-aide-texte); font-weight: 600; }
.st-parcours__fil button.actif span { background: #85990A; color: #fff; }
.st-parcours__etape h2 { border-top: 0 !important; margin-top: 0 !important; padding-top: 0 !important; }
.st-parcours__nav { display: flex; align-items: center; gap: .8rem; margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--st-aide-trait); max-width: 820px; position: sticky; bottom: -1.5rem; background: var(--st-aide-fond); padding-bottom: .4rem; }
.st-parcours__nav .st-sous { flex: 1; text-align: center; }
.st-parcours__fini { font-weight: 700; color: var(--st-aide-vert); }

/* Tablette / téléphone : une colonne, le sommaire puis la lecture (« ← Sommaire » pour revenir) */
@media (max-width: 900px) {
    .st-manuel { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 72px - 1.5rem); }
    .st-manuel--lecture .st-manuel__gauche { display: none; }
    .st-manuel:not(.st-manuel--lecture) .st-manuel__lecture { display: none; }
    .st-manuel__retour { display: inline-block; background: none; border: 0; color: var(--st-aide-vert); font-weight: 700; padding: 0 0 .5rem; cursor: pointer; font-size: .9rem; }
    .st-manuel__lecture { padding: .8rem 1rem 1.2rem; }
    .st-manuel__entete { flex-wrap: wrap; }
    .st-manuel__actions { width: 100%; }
    .st-parcours__fil em { display: none; }
    .st-parcours__fil button { padding: .2rem; }
}
@media (max-width: 640px) {
    .st-aide__panneau { top: 64px; right: 8px; left: 8px; width: auto; max-width: none; max-height: calc(100dvh - 76px); }
    .st-manuel__entete h1 { font-size: 1.25rem; }
}

/* ───── Visite guidée ───── */
.st-visite-voile { position: fixed; inset: 0; z-index: 9990; }
.st-visite-cadre { position: fixed; z-index: 9991; border-radius: .5rem; box-shadow: 0 0 0 3px #AFCA0B, 0 0 0 9999px rgba(14,18,29,.55); pointer-events: none; transition: all .25s ease; }
.st-visite-bulle { position: fixed; z-index: 9992; background: #fff; color: #0E121D; border-radius: .7rem; padding: .9rem 1rem .7rem; box-shadow: 0 14px 40px rgba(0,0,0,.3); font-family: "Public Sans", sans-serif; font-size: .92rem; line-height: 1.45; border-top: 4px solid #AFCA0B; }
.st-visite-bulle p { margin: 0 1.4rem .7rem 0; }
.st-visite-pied { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: #64748B; }
.st-visite-pied button { border: 1px solid #E5E7EB; background: #fff; border-radius: .45rem; padding: .3rem .7rem; font-weight: 600; cursor: pointer; font-size: .82rem; color: #0E121D; }
.st-visite-pied button.st-visite-principal { background: #85990A; border-color: #85990A; color: #fff; }
.st-visite-fermer { position: absolute; top: .45rem; right: .5rem; border: 0; background: none; cursor: pointer; color: #64748B; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .st-visite-cadre { transition: none; } }
