/* ============================================================
   WAP Comarquage DILA — feuille de styles
   Personnalisation via variables CSS sur .sp-fiche-wrap
   ============================================================ */

:root {
    --sp-color-primary:        #0073aa;
    --sp-color-primary-dark:   #005a87;
    --sp-color-accent:         #c0003c;
    --sp-color-accent-bg:      #fdf0f4;
    --sp-color-accent-border:  #f5c6d8;
    --sp-color-warning:        #e8a000;
    --sp-color-info:           #0073aa;
    --sp-color-example:        #46b450;
    --sp-color-border:         #e0e0e0;
    --sp-color-bg:             #f8f8f8;
    --sp-color-text:           #1d1d1d;
    --sp-color-muted:          #666;
    --sp-radius:               4px;
    --sp-font-size:            1em;
    --sp-max-width:            860px;
}

/* ---- Conteneurs ---- */
.sp-fiche-wrap,
.sp-sommaire-wrap {
    max-width: var(--sp-max-width);
    margin-inline: auto;
    color: var(--sp-color-text);
    font-size: 16px; /* rebase rem — certains thèmes modifient html font-size */
    line-height: 1.5;
}

/* Neutralise les font-size rem/em du thème sur les balises nues dans nos conteneurs */
.sp-fiche-wrap p, .sp-fiche-wrap li, .sp-fiche-wrap a,
.sp-fiche-wrap ol, .sp-fiche-wrap ul, .sp-fiche-wrap td, .sp-fiche-wrap th,
.sp-fiche-wrap button, .sp-fiche-wrap summary, .sp-fiche-wrap details,
.sp-sommaire-wrap p, .sp-sommaire-wrap li, .sp-sommaire-wrap a,
.sp-sommaire-wrap ol, .sp-sommaire-wrap ul {
    font-size: 16px;
}

/* ---- Fil d'Ariane ---- */
.sp-breadcrumb { margin-bottom: 1.5em; }
.sp-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: .25em;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: .85em;
    color: var(--sp-color-muted);
}
.sp-breadcrumb li + li::before {
    content: "›";
    margin-right: .25em;
    opacity: .5;
}
.sp-breadcrumb a { color: var(--sp-color-primary); }

/* ---- Navigation audiences ---- */
.sp-audience-nav {
    display: flex;
    gap: .5em;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
}
.sp-audience-tab {
    padding: .4rem .9em;
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
    text-decoration: none;
    color: var(--sp-color-primary);
    font-size: .9em;
    background: #fff;
}
.sp-audience-tab.is-active,
.sp-audience-tab:hover {
    background: var(--sp-color-primary);
    color: #fff;
    border-color: var(--sp-color-primary);
}

/* ---- Reset headings — neutralise interlignes et espacement imposés par le thème ---- */
.sp-fiche-wrap h1, .sp-fiche-wrap h2, .sp-fiche-wrap h3,
.sp-fiche-wrap h4, .sp-fiche-wrap h5, .sp-fiche-wrap h6,
.sp-sommaire-wrap h1, .sp-sommaire-wrap h2, .sp-sommaire-wrap h3,
.sp-sommaire-wrap h4, .sp-sommaire-wrap h5, .sp-sommaire-wrap h6,
.sp-fiche-wrap h1 a, .sp-fiche-wrap h2 a, .sp-fiche-wrap h3 a,
.sp-sommaire-wrap h1 a, .sp-sommaire-wrap h2 a, .sp-sommaire-wrap h3 a {
    line-height: 1.3;
    letter-spacing: normal;
}

/* ---- Titre & méta ---- */
.sp-fiche-wrap .sp-fiche-title { margin-bottom: .25em; font-weight: 700; font-size: 1.5em; }
.sp-fiche-date {
    font-size: .8em;
    color: var(--sp-color-muted);
    margin: 0 0 1em;
}
.sp-fiche-intro { margin-bottom: 1.5em; }

/* ---- Services en haut ---- */
.sp-services-top {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
    margin-bottom: 1.5em;
}

/* ---- Sections accordion ---- */
.sp-accordion {
    display: flex;
    flex-direction: column;
    gap: .5em;
    margin-bottom: 1.5em;
}
.sp-section {
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
}
.sp-section summary.sp-section-title {
    padding: .75rem 1em;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--sp-color-bg);
    border-radius: var(--sp-radius);
    user-select: none;
}
.sp-section summary.sp-section-title::-webkit-details-marker { display: none; }
.sp-section summary.sp-section-title::after {
    content: "▼";
    font-size: .65em;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: .5em;
}
.sp-section[open] summary.sp-section-title { border-radius: var(--sp-radius) var(--sp-radius) 0 0; }
.sp-section[open] summary.sp-section-title::after { transform: rotate(180deg); }
.sp-section-body { padding: 1em; }
.sp-section-body > *:first-child { margin-top: 0; }
.sp-section-body > *:last-child  { margin-bottom: 0; }
.sp-section-title.sp-section-title { font-size: 1.05em; }
.sp-fiche-wrap .sp-section-body h2 { font-size: 1em; margin: 1rem 0 .4em; }
.sp-fiche-wrap .sp-section-body h3 { font-size: .95em; margin: .75rem 0 .25em; }

/* ---- Listes ---- */
.sp-liste { padding-left: 1.5em; margin: .5rem 0; }
.sp-liste li { margin-bottom: .25em; }

/* ---- Tableaux ---- */
.sp-tableau-wrap { overflow-x: auto; margin: 1rem 0; }
.sp-tableau { width: 100%; border-collapse: collapse; font-size: .9em; }
.sp-tableau th,
.sp-tableau td { border: 1px solid #ddd; padding: .5rem .75em; text-align: left; vertical-align: top; }
.sp-tableau th { background: #f0f0f0; font-weight: 600; }
.sp-tableau caption { caption-side: top; text-align: left; font-weight: 600; margin-bottom: .5em; }

/* ---- Callouts ---- */
.sp-callout {
    border-left: 4px solid #aaa;
    padding: .75rem 1em;
    margin: 1rem 0;
    background: #f9f9f9;
    border-radius: 0 var(--sp-radius) var(--sp-radius) 0;
}
.sp-callout--warning { border-color: var(--sp-color-warning); background: #fffbf0; }
.sp-callout--info    { border-color: var(--sp-color-info);    background: #f0f7ff; }
.sp-callout--example { border-color: var(--sp-color-example); background: #f2fbf2; }
.sp-callout-title { font-weight: 700; margin: 0 0 .4em; font-size: .9em; }
.sp-callout > *:last-child { margin-bottom: 0; }

/* ---- BlocCas onglets ---- */
.sp-bloccas { margin: 1rem 0; }

.sp-bloccas--onglet .sp-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--sp-color-border);
    flex-wrap: wrap;
}
.sp-tab-btn {
    padding: .6rem 1.25em;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    cursor: pointer;
    font-size: .95em;
    color: var(--sp-color-muted);
    font-weight: 500;
    transition: color .15s, border-color .15s;
    position: relative;
    bottom: -2px;
}
.sp-tab-btn.is-active {
    background: #fff;
    border-color: var(--sp-color-border);
    border-bottom-color: #fff;
    border-top: 2px solid var(--sp-color-primary);
    color: var(--sp-color-primary);
    font-weight: 700;
}
.sp-tab-btn:hover:not(.is-active) {
    color: var(--sp-color-primary);
    background: var(--sp-color-bg);
}
.sp-tab-panel { display: none; }
.sp-tab-panel.is-active {
    display: block;
    padding: 1.5rem 1em;
    border: 1px solid var(--sp-color-border);
    border-top: none;
    border-radius: 0 0 var(--sp-radius) var(--sp-radius);
    background: #fff;
}

/* ---- BlocCas radio (cartes sélectionnables) ---- */
.sp-bloccas--radio {
    display: flex;
    flex-direction: column;
    gap: 1em;
    margin: 0 0 1.25em;
}
.sp-bloccas--radio > details.sp-cas {
    border: 1px solid var(--sp-color-primary);
    border-radius: 0;
    background: #fff;
}
.sp-bloccas--radio > details.sp-cas > summary.sp-cas-title {
    padding: 1rem 1rem 1rem 3em;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    color: var(--sp-color-primary);
    user-select: none;
    display: flex;
    align-items: center;
    position: relative;
    background: transparent;
}
.sp-bloccas--radio > details.sp-cas > summary.sp-cas-title::-webkit-details-marker { display: none; }
.sp-bloccas--radio > details.sp-cas > summary.sp-cas-title::before {
    content: "";
    width: 1.1em;
    height: 1.1em;
    border: 2px solid var(--sp-color-primary);
    border-radius: 50%;
    position: absolute;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    box-sizing: border-box;
}
.sp-bloccas--radio > details.sp-cas[open] > summary.sp-cas-title::before {
    background: var(--sp-color-primary);
    box-shadow: inset 0 0 0 3px #fff;
}
.sp-bloccas--radio > details.sp-cas > summary.sp-cas-title::after {
    content: none;
}
.sp-bloccas--radio > details.sp-cas > .sp-cas-body {
    padding: 1rem 1rem 1rem 3em;
    border-top: 1px solid var(--sp-color-border);
}

/* ---- Chapitres (accordéons de questions) ---- */
details.sp-cas {
    border: none;
    border-bottom: 1px solid var(--sp-color-border);
    border-radius: 0;
    background: transparent;
}
.sp-tab-panel > details.sp-cas:first-of-type,
.sp-cas-body > details.sp-cas:first-of-type,
.sp-sections > details.sp-cas:first-of-type {
    border-top: 1px solid var(--sp-color-border);
}
details.sp-cas > summary.sp-cas-title {
    padding: .85rem 2rem .85rem 2.75em;
    color: var(--sp-color-primary);
    font-weight: 700;
    font-size: 1em;
    background: transparent;
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    position: relative;
}
details.sp-cas > summary.sp-cas-title::-webkit-details-marker { display: none; }
details.sp-cas > summary.sp-cas-title::before {
    content: "→";
    background: var(--sp-color-primary);
    color: #fff;
    font-size: .8em;
    width: 1.5em;
    height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: absolute;
    left: .75em;
    top: 50%;
    transform: translateY(-50%);
    box-sizing: border-box;
    flex-shrink: 0;
}
details.sp-cas > summary.sp-cas-title::after {
    content: "∨";
    font-size: .9em;
    color: var(--sp-color-muted);
    margin-left: auto;
    flex-shrink: 0;
    padding-left: .5em;
}
details.sp-cas[open] > summary.sp-cas-title::after { content: "∧"; }
details.sp-cas > .sp-cas-body {
    padding: .75rem 1rem .75rem 2.75em;
}

/* ---- Bouton Tout déplier ---- */
.sp-expand-all-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .5em;
}
.sp-expand-all {
    background: transparent;
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
    padding: .3rem .75em;
    font-size: .85em;
    color: var(--sp-color-text);
    cursor: pointer;
}
.sp-expand-all:hover {
    background: var(--sp-color-bg);
    border-color: var(--sp-color-primary);
    color: var(--sp-color-primary);
}

/* ---- Où s'adresser ---- */
.sp-ou-s-adresser {
    background: var(--sp-color-accent-bg);
    border-radius: var(--sp-radius);
    padding: .75rem 1em;
    margin: 1rem 0;
}
.sp-ou-s-adresser-title {
    font-weight: 700;
    color: var(--sp-color-accent);
    margin: 0 0 .5em;
    font-size: 1em;
}

/* ---- Adresses ---- */
.sp-adresser { padding: .2rem 0; }
.sp-adresser-link { color: var(--sp-color-primary); }
.sp-adresser-name { color: var(--sp-color-muted); }
.sp-adresser-complement { font-size: .85em; color: var(--sp-color-muted); font-style: italic; margin: 0 0 .25em; }

.sp-adresser--link {
    display: flex;
    align-items: baseline;
    gap: .5em;
    padding: .4rem .75em;
    background: #fff;
    border-radius: var(--sp-radius);
    margin: .3rem 0;
}
.sp-adresser--link .sp-adresser-name,
.sp-adresser--link .sp-adresser-ext {
    font-weight: 600;
    color: var(--sp-color-accent);
    text-decoration: none;
}
.sp-adresser--link .sp-adresser-ext:hover { text-decoration: underline; }
.sp-adresser--link .sp-adresser-ext::after {
    content: ' ↗';
    font-size: .8em;
    opacity: .7;
}
.sp-adresser-source {
    font-size: .8em;
    color: var(--sp-color-muted);
}

.sp-adresser--fetched {
    background: var(--sp-color-accent-bg);
    border: 1px solid var(--sp-color-accent-border);
    border-radius: var(--sp-radius);
    padding: .75rem 1em;
    margin: .5rem 0;
}
.sp-adresser--fetched .sp-adresser-name {
    font-weight: 600;
    color: var(--sp-color-accent);
    margin: 0 0 .25em;
}
.sp-adresser--fetched .sp-adresser-addr,
.sp-adresser--fetched .sp-adresser-tel,
.sp-adresser--fetched .sp-adresser-email {
    margin: .15rem 0;
    font-size: .9em;
}
.sp-adresser--fetched .sp-adresser-tel a,
.sp-adresser--fetched .sp-adresser-email a {
    color: var(--sp-color-accent);
}
.sp-adresser-horaires {
    list-style: none;
    padding: 0;
    margin: .5rem 0 .25em;
    font-size: .85em;
    color: var(--sp-color-muted);
}
.sp-adresser-horaires .sp-adresser-jours {
    font-weight: 500;
    color: var(--sp-color-text);
}
.sp-adresser-more {
    display: inline-block;
    margin-top: .5em;
    font-size: .85em;
    color: var(--sp-color-primary);
}

.sp-adresser--national {
    background: var(--sp-color-accent-bg);
    border-left: 3px solid var(--sp-color-accent-border);
    padding: .5rem .75em;
    margin: .5rem 0;
}
.sp-adresser--national .sp-adresser-name {
    font-weight: 600;
    color: var(--sp-color-accent);
    margin: 0 0 .5em;
}
.sp-adresser--national .sp-adresser-body { font-size: .9em; }

/* ---- Bouton service en ligne ---- */
.sp-service-btn {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    padding: .45rem .9em;
    background: var(--sp-color-primary);
    color: #fff !important;
    border-radius: var(--sp-radius);
    text-decoration: none;
    font-size: .9em;
    font-weight: 500;
    transition: background .15s;
}
.sp-service-btn:hover { background: var(--sp-color-primary-dark); }
.sp-service-icon { fill: currentColor; flex-shrink: 0; }

/* ---- Voir aussi (details accordéon) ---- */
.sp-voir-aussi-details {
    margin-top: 1em;
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
}
.sp-voir-aussi-details summary {
    padding: .6rem 1em;
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    background: var(--sp-color-bg);
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sp-voir-aussi-details summary::-webkit-details-marker { display: none; }
.sp-voir-aussi-details summary::after {
    content: "▼";
    font-size: .65em;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: .5em;
}
.sp-voir-aussi-details[open] summary::after { transform: rotate(180deg); }
.sp-voir-aussi-list {
    list-style: none;
    padding: .5rem 1rem .75em;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .3em;
}
.sp-voir-aussi-list a {
    color: var(--sp-color-primary);
    font-size: .9em;
    text-decoration: none;
}
.sp-voir-aussi-list a::before { content: "→ "; }
.sp-voir-aussi-list a:hover { text-decoration: underline; }

/* ---- Pour en savoir plus ---- */
.sp-voir-aussi {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #eee;
}
.sp-voir-aussi-title { font-weight: 600; margin-bottom: .5em; }
.sp-voir-aussi ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4em;
}
.sp-voir-aussi li a {
    display: block;
    padding: .3rem .6em;
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
    font-size: .875em;
    color: var(--sp-color-primary);
    text-decoration: none;
}
.sp-voir-aussi li a:hover { background: var(--sp-color-bg); }

/* ---- Qui peut m'aider ---- */
.sp-qui-aide {
    margin-top: 1em;
    padding: 1.25rem 1.5em;
    border: none;
    border-radius: var(--sp-radius);
    background: var(--sp-color-accent-bg);
}
.sp-qui-aide-title {
    font-weight: 700;
    margin: 0 0 .5em;
    color: var(--sp-color-accent);
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: .4em;
}
.sp-qui-aide-title::before {
    content: "🎧";
    font-size: 1em;
}
.sp-qui-aide-intro { color: var(--sp-color-text); font-size: .95em; margin: 0 0 .75em; }
.sp-qui-aide-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3em; }
.sp-qui-aide-list a { color: var(--sp-color-accent); font-weight: 500; }

/* ---- Références / services (details) ---- */
.sp-references,
.sp-services-ligne {
    margin-top: 1em;
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
}
.sp-references summary,
.sp-services-ligne summary {
    padding: .6rem 1em;
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    background: var(--sp-color-bg);
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sp-references summary::-webkit-details-marker,
.sp-services-ligne summary::-webkit-details-marker { display: none; }
.sp-references summary::after,
.sp-services-ligne summary::after {
    content: "▼";
    font-size: .65em;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: .5em;
}
.sp-references[open] summary::after,
.sp-services-ligne[open] summary::after { transform: rotate(180deg); }
.sp-references ul,
.sp-services-ligne ul { padding: .75rem 1rem .75rem 2em; margin: 0; }
.sp-ref-complement { color: var(--sp-color-muted); font-size: .875em; }

/* ---- Navigation prev/next ---- */
.sp-siblings {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    margin: 2rem 0 1em;
    padding-top: 1em;
    border-top: 1px solid var(--sp-color-border);
    flex-wrap: wrap;
}
.sp-siblings-prev,
.sp-siblings-next {
    color: var(--sp-color-primary);
    text-decoration: none;
    font-size: .875em;
    max-width: 45%;
}
.sp-siblings-next { margin-left: auto; text-align: right; }
.sp-siblings-prev:hover,
.sp-siblings-next:hover { text-decoration: underline; }

/* ---- Groupe de fiches dans dossier ---- */
.sp-fiche-wrap .sp-titre-flottant {
    font-size: 1.2em;
    font-weight: 700;
    margin: 1.75rem 0 .5em;
    color: var(--sp-color-text);
}

.sp-fiche-wrap .sp-group-title {
    font-size: 1em;
    font-weight: 600;
    margin: 1.5rem 0 .5em;
    padding-bottom: .25em;
    border-bottom: 2px solid var(--sp-color-border);
}

/* ---- Liste de fiches (dossier) ---- */
.sp-fiche-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1em;
}
.sp-fiche-list li {
    padding: .5rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.sp-fiche-list li:last-child { border-bottom: none; }
.sp-fiche-list a {
    font-weight: 500;
    color: var(--sp-color-primary);
    text-decoration: none;
}
.sp-fiche-list a:hover { text-decoration: underline; }

/* ---- Sommaire ---- */
.sp-sommaire-title { margin-bottom: 1em; }
.sp-sommaire-themes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25em;
    margin-top: 1em;
}
.sp-theme {
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
    padding: 1em;
}
.sp-sommaire-wrap .sp-theme-title { font-size: 1em; margin: 0 0 .5em; }
.sp-sommaire-wrap .sp-theme-title a { color: var(--sp-color-primary); text-decoration: none; font-weight: 600; line-height: 1.3; letter-spacing: normal; }
.sp-sommaire-wrap .sp-theme-title a:hover { text-decoration: underline; }
.sp-theme-list { list-style: none; padding: 0; margin: 0; font-size: .875em; }
.sp-theme-list li { padding: .2rem 0; border-top: 1px solid #f0f0f0; }
.sp-theme-list li:first-child { border-top: none; }
.sp-theme-list a { color: var(--sp-color-primary); text-decoration: none; }
.sp-theme-list a:hover { text-decoration: underline; }

/* ---- Navigation thème ---- */
.sp-theme-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25em;
    margin-top: 1em;
}
.sp-sous-theme {
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
    padding: 1em;
}
.sp-fiche-wrap .sp-sous-theme-title { font-size: 1em; font-weight: 600; margin: 0 0 .5em; }
.sp-dossier-list { list-style: none; padding: 0; margin: 0; font-size: .875em; }
.sp-dossier-list li { padding: .25rem 0; border-top: 1px solid #f0f0f0; }
.sp-dossier-list li:first-child { border-top: none; }
.sp-dossier-list a { color: var(--sp-color-primary); text-decoration: none; }
.sp-dossier-list a:hover { text-decoration: underline; }

/* ---- Recherche ---- */
.sp-search-wrap { margin: 1rem 0; }
.sp-search-form {
    display: flex;
    gap: 0;
    max-width: 500px;
}
.sp-search-input {
    flex: 1;
    padding: .55rem .75em;
    border: 1px solid var(--sp-color-border);
    border-right: none;
    border-radius: var(--sp-radius) 0 0 var(--sp-radius);
    font-size: 1em;
    outline: none;
}
.sp-search-input:focus { border-color: var(--sp-color-primary); }
.sp-search-btn {
    padding: .55rem .85em;
    background: var(--sp-color-primary);
    color: #fff;
    border: 1px solid var(--sp-color-primary);
    border-radius: 0 var(--sp-radius) var(--sp-radius) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.sp-search-btn:hover { background: var(--sp-color-primary-dark); }
.sp-search-results { margin-top: .75em; }
.sp-search-list { list-style: none; padding: 0; margin: 0; }
.sp-search-item {
    padding: .6rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.sp-search-item:last-child { border-bottom: none; }
.sp-search-item a { font-weight: 500; color: var(--sp-color-primary); text-decoration: none; }
.sp-search-item a:hover { text-decoration: underline; }
.sp-search-excerpt { font-size: .85em; color: var(--sp-color-muted); margin: .15rem 0 0; }
.sp-search-empty,
.sp-search-loading { color: var(--sp-color-muted); font-size: .9em; padding: .5rem 0; }

/* ---- Source ---- */
.sp-source { margin-top: 2em; font-size: .75em; color: var(--sp-color-muted); }
.sp-source a { color: var(--sp-color-muted); }

/* ---- Définitions / tooltips ---- */
.sp-definition {
    border-bottom: 1px dashed var(--sp-color-muted);
    cursor: help;
    position: relative;
    display: inline;
}
.sp-definition[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: .8em;
    line-height: 1.4;
    padding: .4rem .6em;
    border-radius: var(--sp-radius);
    white-space: normal;
    width: max-content;
    max-width: 260px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 100;
}
.sp-definition[data-tooltip]:hover::after,
.sp-definition[data-tooltip]:focus::after {
    opacity: 1;
}
.sp-definition[data-tooltip]:focus {
    outline: 2px solid var(--sp-color-primary);
    outline-offset: 2px;
}

/* ---- Questions Réponses ---- */
.sp-question-reponses {
    margin-top: 1em;
    padding: 1rem 1.25em;
    border: 1px solid var(--sp-color-border);
    border-radius: var(--sp-radius);
}
.sp-question-reponses .sp-voir-aussi-title {
    margin: 0 0 .75em;
    font-size: 1em;
}
.sp-question-reponses .sp-fiche-list { margin: 0; }
.sp-question-reponses .sp-fiche-list li {
    border-bottom: 1px solid #f0f0f0;
    padding: .4rem 0;
}
.sp-question-reponses .sp-fiche-list li:last-child { border-bottom: none; }
.sp-question-reponses .sp-fiche-list a::before {
    content: "→ ";
    color: var(--sp-color-primary);
}

/* ---- Type de service ---- */
.sp-service-type {
    font-size: .75em;
    color: var(--sp-color-muted);
    margin-left: .35em;
}

/* ---- Erreurs ---- */
.sp-error {
    color: #cc0000;
    border-left: 3px solid #cc0000;
    padding: .5rem 1em;
    background: #fff5f5;
    border-radius: 0 var(--sp-radius) var(--sp-radius) 0;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .sp-sommaire-themes,
    .sp-theme-nav { grid-template-columns: 1fr; }
    .sp-siblings { flex-direction: column; }
    .sp-siblings-prev,
    .sp-siblings-next { max-width: 100%; }
    .sp-audience-nav { gap: .25em; }
}
