/* Aide en ligne : bouton « ? Aide » (ligne du fil d'Ariane), panneau latéral modal, pages d'aide.
   Couleurs : jetons --teams-* de skins/<client>/css/main.css. Pas de mode sombre dans l'application. */

.teams-breadcrumb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.teams-breadcrumb-row > nav {
    min-width: 0;
    flex: 1 1 auto;
}

.teams-aide-bouton {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.7rem;
    border: 1px solid var(--teams-outline, #d7def0);
    border-radius: 999px;
    background: var(--teams-surface, #fff);
    color: var(--teams-primary, #3d57d8);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.6;
    text-decoration: none;
    white-space: nowrap;
}

.teams-aide-bouton:hover,
.teams-aide-bouton:focus-visible {
    background: var(--teams-primary, #3d57d8);
    color: #fff;
    text-decoration: none;
}

.teams-aide-bouton:focus-visible {
    outline: 3px solid var(--teams-primary, #3d57d8);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ panneau */

.aide-panneau-fond {
    position: fixed;
    inset: 0;
    z-index: 1170;
    background: rgba(27, 31, 59, 0.35);
}

.aide-panneau {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1180;
    width: min(38rem, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--teams-surface, #fff);
    color: var(--teams-text, #1b1f3b);
    box-shadow: -8px 0 32px rgba(27, 31, 59, 0.25);
}

.aide-panneau[hidden],
.aide-panneau-fond[hidden] {
    display: none;
}

.aide-panneau-entete {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--teams-outline, #d7def0);
}

.aide-panneau-entete h2 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.aide-panneau-entete h2:focus {
    outline: none;
}

.aide-panneau-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.aide-panneau-fermer {
    border: 0;
    background: transparent;
    color: var(--teams-muted, #5f6788);
    font-size: 1.15rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.aide-panneau-fermer:hover,
.aide-panneau-fermer:focus-visible {
    background: var(--teams-bg-start, #f3f6fd);
    color: var(--teams-text, #1b1f3b);
}

.aide-panneau-corps {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem 1.25rem 2rem;
}

body.aide-panneau-ouvert {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .aide-panneau {
        width: 100vw;
    }

    .aide-panneau-entete {
        flex-wrap: wrap;
    }

    .aide-panneau-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ------------------------------------------------------------- pages d'aide */

.aide-page {
    max-width: 52rem;
    padding: 0.5rem 0 2rem;
}

.aide-retour {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.aide-module {
    color: var(--teams-muted, #5f6788);
}

.aide-recherche {
    margin: 1rem 0 1.5rem;
}

.aide-recherche-ligne {
    display: flex;
    gap: 0.5rem;
}

.aide-recherche-ligne .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.aide-modules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem 2rem;
}

.aide-module-bloc h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
}

.aide-module-bloc ul,
.aide-resultats {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aide-module-bloc li {
    padding: 0.15rem 0;
}

.aide-resultats li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--teams-outline, #d7def0);
}

.aide-extrait {
    margin: 0.2rem 0 0;
    color: var(--teams-muted, #5f6788);
    font-size: 0.9rem;
}

/* Prose : styles limités au contenu de l'aide, pour ne rien changer ailleurs. */
.aide-prose {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Les titres de l'application sont stylés globalement (affichage en ligne) : dans l'aide, chacun a sa ligne. */
.aide-prose h1,
.aide-prose h2,
.aide-prose h3,
.aide-prose h4 {
    display: block;
    width: 100%;
}

.aide-prose h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.aide-prose h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.75rem 0 0.6rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--teams-outline, #d7def0);
}

.aide-prose h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.25rem 0 0.4rem;
}

.aide-prose h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 1rem 0 0.3rem;
    color: var(--teams-muted, #5f6788);
}

.aide-prose ul,
.aide-prose ol {
    padding-left: 1.4rem;
    margin-bottom: 0.75rem;
}

.aide-prose li + li {
    margin-top: 0.2rem;
}

.aide-prose table {
    width: 100%;
    margin: 0.5rem 0 1rem;
    border-collapse: collapse;
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
}

.aide-prose th,
.aide-prose td {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--teams-outline, #d7def0);
    vertical-align: top;
}

.aide-prose th {
    background: var(--teams-bg-start, #f3f6fd);
    font-weight: 600;
}

.aide-prose code,
.aide-prose kbd {
    font-size: 0.85em;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    background: var(--teams-bg-start, #f3f6fd);
    color: var(--teams-text, #1b1f3b);
}

.aide-prose blockquote {
    margin: 0.75rem 0;
    padding: 0.5rem 0.9rem;
    border-left: 4px solid var(--teams-primary, #3d57d8);
    background: var(--teams-bg-start, #f3f6fd);
}

.aide-prose blockquote p:last-child {
    margin-bottom: 0;
}

.aide-genere {
    margin-top: 1.5rem;
}

.aide-note {
    color: var(--teams-muted, #5f6788);
    font-size: 0.9rem;
}

.aide-genere-titre {
    margin: 0.6rem 0 0.2rem;
}

.aide-champs {
    columns: 2 14rem;
    column-gap: 1.5rem;
}

.aide-champs li {
    break-inside: avoid;
}

.aide-marque {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--teams-bg-start, #f3f6fd);
    color: var(--teams-muted, #5f6788);
    font-size: 0.75rem;
    white-space: nowrap;
}
