/*
 * Modes d'emploi (04/11/2026) : /mode-d-emploi (particuliers) et /pro/mode-d-emploi (professionnels).
 * Mode lecture du système « L'instrument de verre » (DESIGN.md) : le cadre porte le monde (titre,
 * plaque de l'essentiel, rail du sommaire, ouvertures de chapitre en rond de verre), la colonne de
 * lecture reste calme (68 caractères, corps 1.0625rem, interligne 1.65). Mêmes jetons que base.css,
 * aucune nouvelle couleur : bleu = astuce et favorable, ambre = attention, toujours écrits.
 * Les écrans réels viennent de presentation.css (.prs-ecran, .prs-repere, .prs-reperes). Préfixe mde-.
 */

.mde {
    width: min(76rem, 100% - 3rem);
    margin: 0 auto;
    padding-top: 112px;
    color: var(--text-1);
}
.mde p, .mde li { text-wrap: pretty; }
.mde h1, .mde h2, .mde h3 { text-wrap: balance; font-style: normal; color: var(--text-1); }
.mde-leger { font-weight: 400; color: var(--text-2); }
.mde-mono {
    margin: 0;
    font-family: var(--font);
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-3);
}
.mde ::selection { background: rgba(0, 87, 217, .55); color: #fff; }

/* --- Titre et chapeau */
.mde-tete { padding: 40px 0 48px; max-width: 52rem; }
.mde-tete h1 {
    margin: 0;
    font-size: clamp(2.5rem, 5.4vw, 4.75rem);
    line-height: .98;
    font-weight: 500;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}
.mde-meta {
    margin: 20px 0 0;
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--text-3);
}
.mde-chapeau { margin-top: 22px; max-width: 44rem; }
.mde-chapeau p { margin: 0 0 12px; font-size: 1.25rem; line-height: 1.6; color: var(--text-2); }
.mde-chapeau strong { color: var(--text-1); font-weight: 500; }

/* --- L'essentiel en 5 minutes : plaque majeure, cinq étapes en lignes (pas de grille de cartes) */
.mde-essentiel {
    margin: 0 0 88px;
    padding: 34px 36px 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-1);
    box-shadow: var(--coeur-lueur), var(--coque);
}
/* Carte d'accès du guide des pros (visiteur ou compte particulier). */
.mde-refus {
    max-width: 640px;
    margin: 0 0 120px;
    padding: 30px 32px;
    border-radius: var(--radius-lg);
    background: var(--bg-1);
    box-shadow: var(--coeur-lueur), var(--coque);
}
.mde-refus h2 { margin: 0 0 10px; font-size: clamp(1.375rem, 2.4vw, 1.75rem); font-weight: 500; letter-spacing: -0.01em; }
.mde-refus p { margin: 0 0 14px; color: var(--text-2); line-height: 1.6; }
.mde-refus .mde-boutons { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 20px; }
@media (max-width: 720px) { .mde-refus { padding: 24px 20px; } }
.mde-essentiel h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: -0.01em; }
.mde-pas { margin: 0; padding: 0; list-style: none; }
.mde-pas li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.mde-pas li:first-child { border-top: 0; }
.mde-pas-num {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--verre);
    border: 1px solid var(--border-strong);
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-1);
}
.mde-pas h3 { margin: 2px 0 6px; font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }
.mde-pas p { margin: 0; max-width: 60ch; font-size: 1rem; line-height: 1.55; color: var(--text-2); }
.mde-pas-lien {
    /* Sous le texte de l'étape, à toutes les largeurs : à droite, à 400 px du texte sur un
       grand écran, l'œil devait traverser le vide (relecture du 04/11/2026). */
    grid-column: 2;
    justify-self: start;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    min-height: 40px;
    padding: 6px 4px 6px 0;
    font-family: var(--font);
    font-size: .8125rem;
    color: var(--text-3);
    text-decoration: none;
    white-space: nowrap;
    transition: color 300ms var(--ressort);
}
.mde-pas-lien span { font-family: var(--font); font-size: .9375rem; letter-spacing: 0; text-transform: none; color: var(--accent-strong); }
.mde-pas-lien:hover span { text-decoration: underline; text-underline-offset: 3px; }
.mde-pas-lien:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 10px; }

/* --- Corps : rail du sommaire et colonne de lecture */
.mde-corps {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}
.mde-rail { position: sticky; top: calc(var(--haut-collant) + 24px); padding-top: 4px; }
.mde-rail .mde-mono { padding: 0 0 12px 6px; }
.mde-rail ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.mde-rail-court { display: none; }
.mde-rail a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 6px 10px 6px 6px;
    border-radius: var(--radius-pill);
    color: var(--text-3);
    font-size: .875rem;
    line-height: 1.25;
    text-decoration: none;
    transition: color 300ms var(--ressort), background-color 300ms var(--ressort);
}
.mde-rail-num {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-2);
    transition: background-color 300ms var(--ressort), border-color 300ms var(--ressort), color 300ms var(--ressort);
}
@media (hover: hover) { .mde-rail a:hover { color: var(--text-1); background: rgba(255, 255, 255, .04); } }
.mde-rail a[aria-current="true"] { color: var(--text-1); background: rgba(255, 255, 255, .06); }
.mde-rail a[aria-current="true"] .mde-rail-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.mde-rail a:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.mde-article { min-width: 0; }
.mde-chap { padding: 0 0 72px; scroll-margin-top: calc(var(--haut-collant) + 16px); }
.mde-chap + .mde-chap { padding-top: 64px; border-top: 1px solid var(--border); }
.mde-chap-tete { display: flex; align-items: center; gap: 18px; margin: 0 0 22px; }
.mde-chap-num {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--verre);
    box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 var(--anneau-filet) rgba(255, 255, 255, .025);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-1);
}
.mde-chap-tete h2 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.08; font-weight: 500; letter-spacing: -0.02em; }

/* Colonne de lecture : 68 caractères pour le texte, les écrans et les tableaux prennent la largeur. */
.mde-chap > p, .mde-chap > ul, .mde-chap > ol, .mde-chap > h3, .mde-chap > .mde-note, .mde-chap > details { max-width: 68ch; }
.mde-chap > p, .mde-chap li { font-size: 1.0625rem; line-height: 1.65; color: var(--text-2); }
.mde-chap > p { margin: 0 0 16px; }
.mde-chap strong { color: var(--text-1); font-weight: 500; }
.mde-chap h3 { margin: 40px 0 10px; font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }
.mde-chap > ul, .mde-chap > ol { margin: 0 0 18px; padding-left: 1.25em; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mde-chap li::marker { color: var(--text-3); }
.mde-article a:not([class]) { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.mde-article a:not([class]):hover { text-decoration-thickness: 2px; }
.mde-article a:not([class]):focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }

/* Libellé d'interface : le mot exact de l'écran, en pastille de verre. */
.mde-ui {
    display: inline-block;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--border);
    font-size: .9375em;
    line-height: 1.5;
    color: var(--text-1);
    white-space: nowrap;
    max-width: 100%;
}
/* Un libellé long (« Comparer avec une annonce concurrente ») ne tient pas sur une ligne de
   320 px : il passe à la ligne au lieu d'élargir la page. */
@media (max-width: 480px) { .mde-ui { white-space: normal; } }

/* Étapes d'une manipulation : compteur en rond de verre. */
.mde-etapes { counter-reset: mde-etape; list-style: none; padding-left: 0 !important; }
.mde-etapes > li { position: relative; padding-left: 44px; counter-increment: mde-etape; }
.mde-etapes > li::before {
    content: counter(mde-etape);
    position: absolute;
    left: 0;
    top: .1em;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    font-size: .8125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
}

/* Encadrés : voile et filet de 1 px du signal, titre écrit (jamais la couleur seule). */
.mde-note {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 14px;
    margin: 22px 0;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--accent-border);
    background: var(--success-dim);
}
.mde-attention { border-color: var(--warning-border); background: var(--warning-dim); }
.mde-note-ico { margin-top: 2px; color: var(--accent-strong); }
.mde-attention .mde-note-ico { color: var(--warning); }
.mde-note-titre { margin: 0 0 4px; font-weight: 500; color: var(--text-1); }
.mde-note p { margin: 0 0 8px; font-size: 1rem; line-height: 1.6; color: var(--text-2); }
.mde-note p:last-child { margin-bottom: 0; }

/* Tableaux de référence : double cadre, défilement dans l'enfant (l'anneau n'est pas rogné). */
.mde-tableau {
    margin: 22px 0 26px;
    border-radius: var(--radius);
    background: var(--bg-1);
    box-shadow: var(--coeur-lueur), var(--coque);
}
.mde-tableau-defil { overflow-x: auto; border-radius: var(--radius); }
.mde-tableau table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.mde-tableau th, .mde-tableau td { padding: 13px 16px; text-align: left; vertical-align: top; border-top: 1px solid rgba(255, 255, 255, .05); line-height: 1.5; }
.mde-tableau thead th {
    border-top: 0;
    font-family: var(--font);
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-3);
    white-space: nowrap;
}
.mde-tableau tbody th { font-weight: 500; color: var(--text-1); min-width: 11rem; }
.mde-tableau td { color: var(--text-2); }
.mde-tableau td.mde-non { color: var(--text-4); }
.mde-tableau .mde-oui { color: var(--text-1); }
/* Au téléphone, une colonne ne descend pas sous 8,5em : le tableau défile plutôt que d'empiler
   un mot par ligne (tableau des régimes de TVA, trois colonnes). */
@media (max-width: 720px) { .mde-tableau th, .mde-tableau td { min-width: 8.5em; }
    /* Un tableau à deux colonnes tient dans l'écran : rien ne doit défiler hors de vue. */
    .mde-tableau table:not(:has(tr > :nth-child(3))) :is(th, td) { min-width: 0; width: 50%; font-size: .875rem; }
    .mde-tableau table:not(:has(tr > :nth-child(3))) thead th { white-space: normal; font-size: .75rem; }
    /* Trois colonnes et plus : le tableau défile, et la ligne sous le tableau le dit. */
    .mde-tableau:has(tr > :nth-child(3))::after {
        content: "Faites glisser le tableau pour voir les autres colonnes.";
        display: block;
        padding: 10px 16px 12px;
        border-top: 1px solid rgba(255, 255, 255, .05);
        font-size: .75rem;
        color: var(--text-3);
    } }

/* Écrans réels : légende sous l'écran, colonne de lecture. */
.mde-ecran { margin: 28px 0 14px; }
/* Légende de l'écran : une phrase lisible, pas une étiquette en capitales (relecture du 04/11/2026). */
.mde-ecran figcaption { font-family: var(--font); font-size: .8125rem; letter-spacing: 0; text-transform: none; color: var(--text-3); }
/* Le cadre épouse un écran plus étroit que la colonne et s'aligne à gauche sur le texte, au lieu
   de centrer l'écran dans un cadre pleine largeur. 48 px = les deux marges intérieures de 24 px. */
.mde-ecran.prs-ecran-fiche, .mde-ecran.prs-ecran-collage { max-width: calc(49rem + 48px); }
.mde-ecran.prs-ecran-message { max-width: calc(33rem + 48px); }
.mde-ecran.prs-ecran-feuille { max-width: calc(560px + 48px); }
.mde-legende { max-width: 68ch; margin: 12px 0 30px; }

/* Questions fréquentes : <details> natifs, marqueur commun du site (bordereau.css). */
.mde-faq { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 68ch; }
.mde-faq details {
    border-radius: var(--radius);
    background: var(--bg-1);
    box-shadow: var(--coeur-lueur), 0 0 0 1px var(--border);
}
.mde-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 12px 18px;
    font-weight: 500;
    font-size: 1.0625rem;
    line-height: 1.35;
    color: var(--text-1);
    cursor: pointer;
    list-style: none;
}
.mde-faq summary::-webkit-details-marker { display: none; }
.mde-faq summary:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: var(--radius); }
.mde-faq details > div { padding: 0 18px 16px; }
.mde-faq details p { margin: 0 0 10px; font-size: 1rem; line-height: 1.6; color: var(--text-2); }

/* Astuces : liste numérotée, une idée par ligne, titre en tête. */
.mde-astuces { counter-reset: mde-astuce; list-style: none; padding: 0 !important; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 !important; max-width: 68ch; }
.mde-astuces > li {
    position: relative;
    padding: 16px 0 16px 56px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    counter-increment: mde-astuce;
}
.mde-astuces > li:first-child { border-top: 0; }
.mde-astuces > li::before {
    content: counter(mde-astuce);
    position: absolute;
    left: 0;
    top: 16px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--verre);
    border: 1px solid var(--border-strong);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
}
.mde-astuces strong { display: block; margin-bottom: 2px; font-size: 1.0625rem; }

.mde-fin {
    max-width: 68ch;
    margin: 8px 0 96px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-2);
}
.mde-fin span { display: block; margin-top: 6px; font-size: .875rem; color: var(--text-3); }

/* --- Tablette et téléphone : le sommaire passe en tête, statique, sur deux colonnes */
@media (max-width: 1023px) {
    .mde { padding-top: 92px; }
    .mde-corps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .mde-rail { position: static; padding: 18px 16px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--verre); }
    .mde-rail ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
}
@media (max-width: 720px) {
    .mde { width: calc(100% - 32px); }
    .mde-tete { padding: 24px 0 36px; }
    .mde-chapeau p { font-size: 1.0625rem; }
    .mde-essentiel { margin-bottom: 56px; padding: 24px 18px 8px; }
    .mde-pas li { grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
    .mde-pas-num { width: 36px; height: 36px; font-size: .9375rem; }
    .mde-pas-lien { grid-column: 2; flex-direction: row; align-items: baseline; gap: 8px; padding-left: 0; min-height: 40px; }
    /* Sommaire du téléphone : titres courts sur deux colonnes (cinq rangées au lieu de dix). */
    .mde-rail-titre { display: none; }
    .mde-rail-court { display: inline; }
    .mde-chap { padding-bottom: 56px; }
    .mde-chap + .mde-chap { padding-top: 48px; }
    .mde-chap-tete { gap: 14px; }
    .mde-chap-num { width: 44px; height: 44px; font-size: 1.0625rem; }
    .mde-chap > p, .mde-chap li { font-size: 1rem; }
    .mde-tableau th, .mde-tableau td { padding: 11px 12px; }
    .mde-tableau tbody th { min-width: 9rem; }
}
@media (prefers-reduced-motion: reduce) {
    .mde-rail a, .mde-rail-num, .mde-pas-lien { transition: none; }
}
@media print {
    .mde-rail, .mde-ecran, .mde-legende { display: none !important; }
    .mde-corps { display: block; }
}
