/* Feuille commune de MyAmbassador (lot L01 « Charte et coquilles », doc/charte.md).
   1. Jetons  2. Base  3. Boutons  4. Champs  5. Tableau  6. Badges  7. Messages flash
   8. État vide  9. Panneau latéral  10. Coquille publique  11. Coquille admin  12. Pages d'erreur  13. Grands écrans
   14. Type de compte (mode développeur)
   Les feuilles de page (assets/styles/<module>.css) utilisent ces jetons et ces classes, sans les recopier. */

/* 1. Jetons ------------------------------------------------------------------------------------------------- */
/* Polices auto-hébergées (licence SIL OFL, assets/fonts/LICENCES.md) : Saira pour les titres (sportive, carrée,
   largeur variable), Plus Jakarta Sans pour le texte. Silkscreen reste en réserve, sans usage depuis la v2.2. Unbounded reste chargée
   à la demande seulement (aucun jeton ne la sert depuis la charte v2). */
@font-face { font-family: "Saira"; font-style: normal; font-weight: 100 900; font-stretch: 50% 125%; font-display: swap;
    src: url("../fonts/saira-latin-7fMUeyD.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Saira"; font-style: normal; font-weight: 100 900; font-stretch: 50% 125%; font-display: swap;
    src: url("../fonts/saira-latin-ext-nZZHa2o.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Saira"; font-style: italic; font-weight: 100 900; font-stretch: 50% 125%; font-display: swap;
    src: url("../fonts/saira-italic-latin-EWuai5M.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Saira"; font-style: italic; font-weight: 100 900; font-stretch: 50% 125%; font-display: swap;
    src: url("../fonts/saira-italic-latin-ext-VoLgvLa.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 300 900; font-display: swap;
    src: url("../fonts/unbounded-latin-boXcx2G.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 300 900; font-display: swap;
    src: url("../fonts/unbounded-latin-ext-qByU6Wa.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-ZHdaFJ8.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-ext-w14NvZZ.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Silkscreen"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/silkscreen-400-latin-0U7YsY8.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Silkscreen"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/silkscreen-400-latin-ext-w_i_ihO.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Silkscreen"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("../fonts/silkscreen-700-latin-a4D_kW9.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Silkscreen"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("../fonts/silkscreen-700-latin-ext-YaG8Y4A.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    /* Facteur d'échelle unique : tout est en rem, il agrandit l'ensemble au-delà de 1800 px (§ 13). */
    --ma-scale: 1;

    --ma-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ma-font-display: "Saira", "Plus Jakarta Sans", system-ui, sans-serif;
    --ma-font-pixel: "Silkscreen", ui-monospace, monospace;
    --ma-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    /* Palette de la marque (charte « Story », doc/charte.md). Couleurs vives pour les surfaces,
       variantes « -texte » pour écrire sur fond clair (contraste AA). */
    --ma-encre: #0b1026;
    --ma-papier: #ffffff;
    /* Charte v2.3 (Allan, 24/11/2026) : fond blanc pur ; ton sidéral profond pour l'en-tête, la navigation et les
       grandes bandes pleine largeur qui coupent la page. Couleurs vives = accents. */
    --ma-sideral: #050816;
    --ma-sideral-bleu: #0a1640;
    --ma-degrade-sideral: linear-gradient(160deg, #050816 0%, #0a1640 100%);
    --ma-rose: #ff2d87;
    --ma-violet: #7a2cf5;
    --ma-orange: #ff7a1f;
    --ma-jaune: #ffd43b;
    --ma-bleu: #2eb8ff;
    --ma-menthe: #20d6a0;
    --ma-rose-texte: #c3125f;
    --ma-violet-texte: #5b17c9;
    --ma-degrade-story: linear-gradient(135deg, #ffd43b 0%, #ff7a1f 28%, #ff2d87 58%, #7a2cf5 100%);

    /* Charte v2 « Story » (Allan, 24/11/2026) : angles droits et gros carrés de couleur, mais ni bordure noire ni ombre
       dure ; la profondeur vient des aplats, des dégradés story et du mouvement (GSAP). Pixels : simple touche. */
    --ma-pixel: 8px;
    --ma-trait: none;
    --ma-ombre-dure: none;
    --ma-ombre-dure-grande: none;
    --ma-degrade-sport: linear-gradient(120deg, #ff2d87 0%, #7a2cf5 100%);
    --ma-degrade-flamme: linear-gradient(120deg, #ffd43b 0%, #ff7a1f 45%, #ff2d87 100%);
    --ma-degrade-ocean: linear-gradient(120deg, #2eb8ff 0%, #20d6a0 100%);
    --ma-titre-geant: clamp(3.25rem, 10vw, 11rem);
    --ma-titre-xl: clamp(2.5rem, 6vw, 6.5rem);
    --ma-titre-l: clamp(1.75rem, 3.4vw, 3.5rem);
    --ma-space-7: 3rem;
    --ma-space-8: 5rem;
    --ma-space-9: 8rem;
    --ma-ease-sport: cubic-bezier(0.16, 1, 0.3, 1);
    --ma-surface-douce: #f2f4f9;

    --ma-color-bg: var(--ma-papier);
    --ma-color-surface: #ffffff;
    --ma-color-surface-muted: #f2f4f9;
    --ma-color-text: var(--ma-encre);
    --ma-color-muted: #5a6175;
    --ma-color-border: #e3e7ef;
    --ma-color-border-strong: #c5ccda;
    --ma-color-primary: var(--ma-rose);
    --ma-color-primary-hover: #ff4f9b;
    --ma-color-primary-soft: #ffe3ef;
    --ma-color-primary-text: var(--ma-encre);
    --ma-color-link: var(--ma-violet-texte);
    --ma-color-success: #0f7d5a;
    --ma-color-success-soft: #dcf8ee;
    --ma-color-warning: #a64f00;
    --ma-color-warning-soft: #fff2d1;
    --ma-color-danger: #c81e45;
    --ma-color-danger-hover: #a3163a;
    --ma-color-danger-soft: #ffe1e8;
    --ma-color-focus: var(--ma-violet);

    --ma-radius: 0;
    --ma-radius-small: 0;
    --ma-radius-pill: 0;

    --ma-space-1: 0.25rem;
    --ma-space-2: 0.5rem;
    --ma-space-3: 0.75rem;
    --ma-space-4: 1rem;
    --ma-space-5: 1.5rem;
    --ma-space-6: 2rem;

    --ma-text-xs: 0.75rem;
    --ma-text-sm: 0.875rem;
    --ma-text-md: 1rem;
    --ma-text-lg: 1.25rem;
    --ma-text-xl: 1.5rem;

    --ma-control-height: 2.5rem;
    --ma-shadow-card: none;
    --ma-shadow-panel: none;
    --ma-duration: 160ms;
}

/* Téléphone et tablette : cibles tactiles de 44 px. */
@media (pointer: coarse) {
    :root {
        --ma-control-height: 2.75rem;
    }
}

/* 2. Base --------------------------------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: calc(100% * var(--ma-scale));
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--ma-color-bg);
    color: var(--ma-color-text);
    font-family: var(--ma-font);
    font-size: var(--ma-text-md);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 var(--ma-space-3);
    font-family: var(--ma-font-display);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 { font-size: var(--ma-text-xl); }
h2 { font-size: var(--ma-text-lg); }
h3 { font-size: var(--ma-text-md); }

p {
    margin: 0 0 var(--ma-space-4);
}

a {
    color: var(--ma-color-link);
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--ma-rose-texte);
}

:focus-visible {
    outline: 2px solid var(--ma-color-focus);
    outline-offset: 2px;
}

code,
kbd {
    font-family: var(--ma-font-mono);
    font-size: 0.875em;
}

img,
svg {
    max-width: 100%;
}

.ma-muted {
    color: var(--ma-color-muted);
}

.ma-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.ma-icon {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
}

/* 3. Boutons ------------------------------------------------------------------------------------------------ */
/* Les couleurs de survol de base neutralisent le lien global au doigt ; les effets restent réservés à la souris. */
/* Le focus commun complète la base sans modifier les jetons ni la typographie des § 1-2. */
:focus-visible {
    outline: 3px solid var(--ma-violet);
    outline-offset: 3px;
}

/* Saira renforce les titres des 2 coquilles ; les grilles restent celles du socle. */
.ma-admin :is(h1, h2, h3, h4),
.ma-public :is(h1, h2, h3, h4) {
    font-family: var(--ma-font-display);
    font-weight: 800;
    font-style: italic;
    font-stretch: 87.5%;
}

.ma-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ma-space-2);
    min-height: var(--ma-control-height);
    padding: 0 var(--ma-space-4);
    border: 0;
    border-radius: var(--ma-radius);
    background: var(--ma-color-primary);
    color: var(--ma-color-primary-text);
    font: inherit;
    font-size: var(--ma-text-sm);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--ma-duration) var(--ma-ease-sport);
}

.ma-btn:hover {
    color: var(--ma-color-primary-text);
}

@media (hover: hover) and (pointer: fine) {
    .ma-btn:hover {
        background: var(--ma-color-primary-hover);
        color: var(--ma-encre);
    }
}

.ma-btn--secondary {
    background: var(--ma-surface-douce);
    color: var(--ma-color-text);
}

.ma-btn--secondary:hover {
    color: var(--ma-color-text);
}

@media (hover: hover) and (pointer: fine) {
    .ma-btn--secondary:hover {
        background: var(--ma-color-primary-soft);
        color: var(--ma-color-text);
    }
}

.ma-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ma-violet-texte);

}

.ma-btn--ghost:hover {
    color: var(--ma-violet-texte);
}

@media (hover: hover) and (pointer: fine) {
    .ma-btn--ghost:hover {
        background: var(--ma-color-primary-soft);
        color: var(--ma-rose-texte);
    }
}

.ma-btn--danger {
    background: var(--ma-color-danger);
    color: var(--ma-color-surface);
}

.ma-btn--danger:hover {
    color: var(--ma-color-surface);
}

@media (hover: hover) and (pointer: fine) {
    .ma-btn--danger:hover {
        background: var(--ma-color-danger-hover);
        color: var(--ma-color-surface);
    }
}

/* Bouton compact (lignes de tableau, panneau latéral). */
.ma-btn--small {
    min-height: 2rem;
    padding: 0 var(--ma-space-3);
    font-size: var(--ma-text-xs);
}

/* Bouton pleine largeur (cartes d'entrée au téléphone). */
.ma-btn--block {
    display: flex;
    width: 100%;
}

.ma-btn:disabled,
.ma-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 4. Champs ------------------------------------------------------------------------------------------------- */
.ma-field {
    display: grid;
    gap: var(--ma-space-1);
    margin-bottom: var(--ma-space-4);
}

.ma-field__label {
    font-size: var(--ma-text-sm);
    font-weight: 600;
}

.ma-field__optional,
.ma-field__help {
    color: var(--ma-color-muted);
    font-size: var(--ma-text-xs);
    font-weight: 400;
}

.ma-field__input {
    width: 100%;
    min-height: var(--ma-control-height);
    padding: var(--ma-space-2) var(--ma-space-3);
    border: 0;
    border-radius: var(--ma-radius);
    background: var(--ma-surface-douce);
    color: var(--ma-color-text);
    font: inherit;
    font-size: var(--ma-text-md);
    transition: background-color var(--ma-duration) var(--ma-ease-sport);
}

.ma-field__input::placeholder {
    color: var(--ma-color-muted);
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .ma-field__input:hover {
        background: var(--ma-surface-douce);
    }
}

.ma-field__input:focus,
.ma-field__input:focus-visible {
    outline: 3px solid var(--ma-violet);
    outline-offset: 3px;

}

.ma-field__input:disabled {
    background: var(--ma-surface-douce);
    color: var(--ma-color-muted);
    cursor: not-allowed;
}

textarea.ma-field__input {
    min-height: 6rem;
    resize: vertical;
}

.ma-field--error .ma-field__input,
.ma-field__input[aria-invalid="true"] {
    background: var(--ma-color-danger-soft);
}

.ma-field--error .ma-field__input:focus {
    outline-color: var(--ma-violet);
}

.ma-field__error {
    margin: 0;
    padding: 0;
    color: var(--ma-color-danger);
    font-size: var(--ma-text-sm);
    list-style: none;
}

.ma-check {
    display: flex;
    align-items: flex-start;
    gap: var(--ma-space-2);
    margin-bottom: var(--ma-space-4);
    font-size: var(--ma-text-sm);
    cursor: pointer;
}

.ma-check input {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0.125rem 0 0;
    accent-color: var(--ma-violet);
    cursor: pointer;
}

.ma-check input:disabled,
.ma-check input:disabled + span {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 5. Tableau ------------------------------------------------------------------------------------------------ */
.ma-table-wrap {
    overflow-x: auto;
    border: 0;
    border-radius: var(--ma-radius);
    background: var(--ma-color-surface);
}

.ma-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--ma-text-sm);
}

.ma-table th,
.ma-table td {
    padding: var(--ma-space-3) var(--ma-space-4);
    border-bottom: 1px solid var(--ma-color-border);
    text-align: left;
    vertical-align: middle;
}

.ma-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ma-surface-douce);
    color: var(--ma-encre);
    font-family: var(--ma-font-display);
    font-size: var(--ma-text-sm);
    font-weight: 800;
    font-stretch: 87.5%;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ma-table tbody tr:last-child td {
    border-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
    .ma-table tbody tr:hover {
        background: var(--ma-surface-douce);
    }
}

.ma-table tbody tr.is-selected,
.ma-table tbody tr[aria-selected="true"] {
    background: var(--ma-color-primary-soft);
}

.ma-table td.ma-table__num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ma-table th.ma-table__num {
    text-align: right;
}

/* En-tête triable : <th aria-sort="ascending|descending|none"><button class="ma-table__sort">…</button></th> */
.ma-table__sort {
    display: inline-flex;
    align-items: center;
    gap: var(--ma-space-1);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.ma-table__sort:hover {
    color: inherit;
}

.ma-table__sort::after {
    content: "↕";
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .ma-table__sort:hover {
        color: var(--ma-color-text);
    }
}

[aria-sort="ascending"] > .ma-table__sort,
[aria-sort="descending"] > .ma-table__sort {
    color: var(--ma-color-text);
}

[aria-sort="ascending"] > .ma-table__sort::after {
    content: "↑";
    opacity: 1;
}

[aria-sort="descending"] > .ma-table__sort::after {
    content: "↓";
    opacity: 1;
}

/* Ligne cliquable (ouvre le panneau latéral). */
.ma-table__row-link {
    cursor: pointer;
}

/* Barre au-dessus d'un tableau : recherche, filtres, compteur. */
.ma-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--ma-space-3);
    margin-bottom: var(--ma-space-4);
}

.ma-toolbar .ma-field {
    margin-bottom: 0;
}

/* 6. Badges ------------------------------------------------------------------------------------------------- */
.ma-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--ma-space-1);
    padding: 0.125rem var(--ma-space-2);
    border: 0;
    border-radius: var(--ma-radius-pill);
    background: var(--ma-color-primary-soft);
    color: var(--ma-rose-texte);
    font-size: var(--ma-text-xs);
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.ma-badge--success {
    background: var(--ma-color-success-soft);
    color: var(--ma-encre);
}

.ma-badge--warning {
    background: var(--ma-color-warning-soft);
    color: var(--ma-encre);
}

.ma-badge--danger {
    background: var(--ma-color-danger-soft);
    color: var(--ma-color-danger);
}

.ma-badge--muted {
    background: var(--ma-surface-douce);
    color: var(--ma-color-muted);
}

/* 7. Messages flash ----------------------------------------------------------------------------------------- */
.ma-flashes {
    display: grid;
    gap: var(--ma-space-2);
    margin-bottom: var(--ma-space-4);
}

.ma-flash {
    margin: 0;
    padding: var(--ma-space-3) var(--ma-space-4);
    border: 0;
    border-radius: var(--ma-radius);
    font-size: var(--ma-text-sm);
}

.ma-flash--success {
    background: var(--ma-color-success-soft);
    color: var(--ma-encre);
}

.ma-flash--error {
    background: var(--ma-color-danger-soft);
    color: var(--ma-color-danger);
}

/* 8. État vide ---------------------------------------------------------------------------------------------- */
.ma-empty {
    display: grid;
    justify-items: center;
    gap: var(--ma-space-2);
    padding: var(--ma-space-6) var(--ma-space-4);
    color: var(--ma-color-muted);
    text-align: center;
}

.ma-empty__title {
    margin: 0;
    color: var(--ma-color-text);
    font-size: var(--ma-text-md);
    font-weight: 600;
}

.ma-empty__text {
    max-width: 32rem;
    margin: 0;
    font-size: var(--ma-text-sm);
}

/* 9. Panneau latéral de détail -------------------------------------------------------------------------------
   <aside class="ma-panel" hidden aria-labelledby="…"> ; le lot qui l'ouvre retire « hidden ». */
.ma-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: min(28rem, 100%);
    background: var(--ma-color-surface);
    border-left: 0;
    animation: ma-panel-in var(--ma-duration) ease-out;
}

.ma-panel[hidden] {
    display: none;
}

/* Variante native pour le banc : aucune gestion JavaScript ni modification du contrat « hidden ». */
.ma-panel[popover] {
    height: 100dvh;
    margin: 0;
    padding: 0;
    color: var(--ma-color-text);
    border: 0;
    border-left: 0;
}

.ma-panel[popover]:not(:popover-open) {
    display: none;
}

.ma-panel::backdrop {
    background: color-mix(in srgb, var(--ma-encre) 16%, transparent);
}

.ma-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ma-space-3);
    padding: var(--ma-space-4) var(--ma-space-5);
    border-bottom: 1px solid var(--ma-color-border);
}

.ma-panel__title {
    margin: 0;
    font-size: var(--ma-text-lg);
}

.ma-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: var(--ma-control-height);
    height: var(--ma-control-height);
    margin: calc(var(--ma-space-2) * -1) calc(var(--ma-space-2) * -1) 0 0;
    border: 0;
    border-radius: var(--ma-radius);
    background: var(--ma-surface-douce);
    color: var(--ma-encre);
    cursor: pointer;
}

.ma-panel__close:hover {
    color: var(--ma-encre);
}

@media (hover: hover) and (pointer: fine) {
    .ma-panel__close:hover {
        background: var(--ma-surface-douce);
        color: var(--ma-color-text);
    }
}

.ma-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--ma-space-5);
}

.ma-panel__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--ma-space-2);
    padding: var(--ma-space-4) var(--ma-space-5);
    border-top: 1px solid var(--ma-color-border);
}

/* Liste « libellé : valeur » du panneau et des fiches. */
.ma-details {
    display: grid;
    grid-template-columns: minmax(7rem, auto) 1fr;
    gap: var(--ma-space-2) var(--ma-space-4);
    margin: 0 0 var(--ma-space-5);
    font-size: var(--ma-text-sm);
}

.ma-details dt {
    color: var(--ma-color-muted);
}

.ma-details dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.ma-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: color-mix(in srgb, var(--ma-encre) 32%, transparent);
}

.ma-panel-backdrop[hidden] {
    display: none;
}

/* Panneau montré à sa place dans la page (page de charte). */
.ma-panel--inline {
    position: static;
    width: 100%;
    max-width: 28rem;
    border: 0;
    border-radius: var(--ma-radius);
    animation: none;
}

@keyframes ma-panel-in {
    from { transform: translateX(1.5rem); }
    to { transform: none; }
}

/* 10. Coquille publique (inscription, merci, kit, erreurs) -------------------------------------------------- */
.ma-public {
    position: relative;
    isolation: isolate;
    overflow: clip;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--ma-papier);
}

.ma-public__main {
    display: flex;
    flex: 1;
    align-items: flex-start;
    justify-content: center;
    padding: var(--ma-space-4) var(--ma-space-3);
}

.ma-public__card {
    width: 100%;
    max-width: 30rem;
    padding: var(--ma-space-5) var(--ma-space-4);
    border: 0;
    border-radius: var(--ma-radius);
    background: var(--ma-color-surface);

}

/* Contenu long (page du kit) : carte plus large. */
.ma-public__card--wide {
    max-width: 46rem;
}

.ma-public__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--ma-space-2);
    margin-bottom: var(--ma-space-5);
    color: var(--ma-color-text);
    font-size: var(--ma-text-md);
    font-weight: 700;
    text-decoration: none;
}

.ma-public__brand:hover {
    color: var(--ma-color-text);
}

@media (hover: hover) and (pointer: fine) {
    .ma-public__brand:hover {
        color: var(--ma-color-text);
    }
}

.ma-public__brand img {
    width: 2rem;
    height: 2rem;
}

.ma-public__footer {
    background: var(--ma-papier);
    padding: var(--ma-space-4);
    color: var(--ma-color-muted);
    font-size: var(--ma-text-xs);
    text-align: center;
}

/* Titre et chapeau d'une carte d'entrée. */
.ma-intro {
    margin-bottom: var(--ma-space-5);
}

.ma-intro h1 {
    margin-bottom: var(--ma-space-2);
}

.ma-intro p {
    margin: 0;
    color: var(--ma-color-muted);
}

@media (min-width: 600px) {
    .ma-public__main {
        align-items: center;
        padding: var(--ma-space-6) var(--ma-space-4);
    }

    .ma-public__card {
        padding: var(--ma-space-6);
    }
}

/* 11. Coquille admin ---------------------------------------------------------------------------------------
   Téléphone : barre du haut + menu déplié sur place (<details>). Ordinateur (≥ 960 px) : navigation latérale. */
.ma-admin {
    min-height: 100vh;
}

.ma-admin__sidebar {
    display: none;
}

.ma-admin__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--ma-space-2);
    color: var(--ma-papier);
    font-weight: 700;
    text-decoration: none;
}

.ma-admin__brand:hover {
    color: var(--ma-papier);
}

@media (hover: hover) and (pointer: fine) {
    .ma-admin__brand:hover {
        color: var(--ma-papier);
    }
}

.ma-admin__brand img {
    width: 1.75rem;
    height: 1.75rem;
}

.ma-admin__nav {
    display: grid;
    gap: 0.125rem;
}

.ma-admin__link {
    display: flex;
    align-items: center;
    gap: var(--ma-space-3);
    min-height: var(--ma-control-height);
    padding: 0 var(--ma-space-3);
    border-radius: var(--ma-radius);
    color: var(--ma-papier);
    font-size: var(--ma-text-sm);
    font-weight: 500;
    text-decoration: none;
}

.ma-admin__link:hover {
    color: var(--ma-papier);
}

@media (hover: hover) and (pointer: fine) {
    .ma-admin__link:hover {
        background: var(--ma-violet);
        color: var(--ma-papier);
    }
}

.ma-admin__link[aria-current="page"] {
    background: var(--ma-violet);
    color: var(--ma-papier);
    font-weight: 600;
}

.ma-admin__link[aria-current="page"]::after {
    content: "";
    flex: none;
    width: var(--ma-space-1);
    height: var(--ma-space-5);
    margin-left: auto;
    background: var(--ma-degrade-story);
    transform: skewX(-15deg);
}

.ma-admin__sidebar :focus-visible,
.ma-admin__topbar :focus-visible {
    outline-color: var(--ma-papier);
}

.ma-admin__account {
    display: grid;
    gap: var(--ma-space-1);
    padding-top: var(--ma-space-3);
    border-top: 1px solid var(--ma-color-muted);
}

.ma-admin__user {
    padding: 0 var(--ma-space-3);
    overflow: hidden;
    color: var(--ma-papier);
    font-size: var(--ma-text-sm);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ma-admin__topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--ma-sideral-bleu);
    border-bottom: 0;
}

.ma-admin__topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ma-space-3);
    min-height: 3.5rem;
    padding: 0 var(--ma-space-4);
}

.ma-admin__menu {
    border-top: 1px solid var(--ma-color-muted);
}

.ma-admin__menu:not([open]) {
    border-top: 0;
}

.ma-admin__menu > summary {
    list-style: none;
}

.ma-admin__menu > summary::-webkit-details-marker {
    display: none;
}

.ma-admin__menu-toggle {
    position: absolute;
    top: 0.5rem;
    right: var(--ma-space-4);
    display: inline-flex;
    align-items: center;
    gap: var(--ma-space-2);
    min-height: var(--ma-control-height);
    padding: 0 var(--ma-space-3);
    border: 0;
    border-radius: var(--ma-radius);
    background: var(--ma-color-surface);
    color: var(--ma-encre);
    font-size: var(--ma-text-sm);
    font-weight: 600;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .ma-admin__menu-toggle:hover {
        background: var(--ma-surface-douce);
    }
}

.ma-admin__menu[open] .ma-admin__menu-toggle {
    background: var(--ma-violet);
    color: var(--ma-papier);
}

.ma-admin__menu-body {
    display: grid;
    gap: var(--ma-space-3);
    padding: var(--ma-space-3) var(--ma-space-4) var(--ma-space-4);
}

.ma-admin__main {
    min-width: 0;
    padding: var(--ma-space-4);
}

.ma-admin__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ma-space-3);
    margin-bottom: var(--ma-space-5);
}

.ma-admin__title {
    margin: 0;
    font-size: var(--ma-text-xl);
    text-transform: uppercase;
    line-height: 1;
}

.ma-admin__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ma-space-2);
}

.ma-admin__actions:empty {
    display: none;
}

/* Bloc de contenu d'une page admin : sert seulement quand une zone doit être séparée du fond (formulaire, liste). */
.ma-section {
    margin-bottom: var(--ma-space-5);
    padding: var(--ma-space-5);
    border: 0;
    border-radius: var(--ma-radius);
    background: var(--ma-color-surface);
}

.ma-section > :last-child {
    margin-bottom: 0;
}

@media (min-width: 960px) {
    .ma-admin {
        display: grid;
        grid-template-columns: 15rem minmax(0, 1fr);
    }

    .ma-admin__topbar {
        display: none;
    }

    .ma-admin__sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        gap: var(--ma-space-5);
        height: 100vh;
        padding: var(--ma-space-5) var(--ma-space-3);
        background: var(--ma-sideral);
        border-right: 0;
        overflow-y: auto;
    }

    .ma-admin__sidebar .ma-admin__brand {
        padding: 0 var(--ma-space-3);
    }

    .ma-admin__sidebar .ma-admin__account {
        margin-top: auto;
    }

    .ma-admin__main {
        padding: var(--ma-space-6);
    }
}

/* 12. Pages d'erreur ---------------------------------------------------------------------------------------- */
.ma-guide {
    display: grid;
    gap: var(--ma-space-6);
}

.ma-guide__section {
    min-width: 0;
    padding-top: var(--ma-space-5);
    border-top: 1px solid var(--ma-color-border);
}

.ma-guide__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ma-space-2);
    margin-bottom: var(--ma-space-4);
}

.ma-guide__note {
    margin: var(--ma-space-4) 0 0;
    color: var(--ma-color-muted);
    font-size: var(--ma-text-xs);
}

.ma-guide__logo {
    display: block;
    width: 12.25rem;
    height: 2rem;
    margin-bottom: var(--ma-space-4);
}

.ma-guide__token {
    padding: var(--ma-space-2) var(--ma-space-3);
    border-radius: var(--ma-radius-small);
    color: var(--ma-color-primary-text);
    font-size: var(--ma-text-sm);
}

.ma-guide__token--primary { background: var(--ma-color-primary); }
.ma-guide__token--success { background: var(--ma-menthe); }
.ma-guide__token--warning { background: var(--ma-jaune); }
.ma-guide__token--danger { background: var(--ma-color-danger); color: var(--ma-color-surface); }

@media (min-width: 1200px) {
    .ma-guide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .ma-guide__section--wide {
        grid-column: 1 / -1;
    }
}

.ma-error__code {
    margin: 0 0 var(--ma-space-2);
    color: var(--ma-violet-texte);
    font-family: var(--ma-font-display);
    text-transform: uppercase;
    font-size: var(--ma-text-sm);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.ma-error__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ma-space-2);
    margin-top: var(--ma-space-5);
}

/* 13. Grands écrans : un seul facteur d'échelle (Allan travaille en 2560 px) --------------------------------- */
@media (min-width: 1800px) {
    :root {
        --ma-scale: 1.125;
    }
}

@media (min-width: 2400px) {
    :root {
        --ma-scale: 1.25;
    }
}

/* 14. Type de compte (mode développeur) : templates/ui/_type_compte.html.twig, en bas à droite de toutes les pages
   quand un compte est connecté. Badge seul (compte marque) ou bouton qui ouvre au-dessus le choix Admin / marques
   (administrateur). Au-dessus de la barre d'inscription du téléphone (30), sous le panneau latéral (39-40). */
.ma-dev-account {
    position: fixed;
    right: var(--ma-space-4);
    bottom: var(--ma-space-4);
    z-index: 35;
    max-width: calc(100vw - 2 * var(--ma-space-4));
    margin: 0;
}

.ma-dev-account--fixe,
.ma-dev-account__bouton {
    display: flex;
    align-items: center;
    gap: var(--ma-space-2);
    height: var(--ma-control-height);
    padding: 0 var(--ma-space-3) 0 var(--ma-space-1);
    background: var(--ma-sideral);
    color: var(--ma-papier);
    font-size: var(--ma-text-sm);
    font-weight: 600;
}

.ma-dev-account--fixe {
    pointer-events: none;
}

.ma-dev-account__bouton {
    cursor: pointer;
    list-style: none;
    transition: background var(--ma-duration) ease;
}

.ma-dev-account__bouton::-webkit-details-marker {
    display: none;
}

.ma-dev-account__bouton:hover,
.ma-dev-account[open] .ma-dev-account__bouton {
    background: var(--ma-sideral-bleu);
}

.ma-dev-account__bouton:focus-visible {
    outline: 2px solid var(--ma-color-focus);
    outline-offset: 3px;
}

.ma-dev-account__bouton .ma-icon {
    transition: transform var(--ma-duration) ease;
}

.ma-dev-account[open] .ma-dev-account__bouton .ma-icon {
    transform: rotate(180deg);
}

.ma-dev-account__dev {
    display: grid;
    place-items: center;
    height: calc(var(--ma-control-height) - 2 * var(--ma-space-1));
    padding: 0 var(--ma-space-2);
    background: var(--ma-rose);
    color: var(--ma-encre);
    font-family: var(--ma-font-display);
    font-size: var(--ma-text-xs);
    font-style: italic;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.ma-dev-account__brand {
    min-width: 0;
    max-width: 14rem;
    overflow: hidden;
    color: color-mix(in srgb, var(--ma-papier) 72%, transparent);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Menu au-dessus du bouton : fond sidéral comme le bouton, aucune ombre ni bordure (charte v2). */
.ma-dev-account__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + var(--ma-space-2));
    display: grid;
    gap: 2px;
    width: min(18rem, calc(100vw - 2 * var(--ma-space-4)));
    max-height: min(24rem, 60vh);
    margin: 0;
    padding: var(--ma-space-2);
    overflow-y: auto;
    background: var(--ma-sideral);
    color: var(--ma-papier);
}

.ma-dev-account__titre {
    margin: var(--ma-space-1) var(--ma-space-2) var(--ma-space-2);
    color: color-mix(in srgb, var(--ma-papier) 64%, transparent);
    font-size: var(--ma-text-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ma-dev-account__choix {
    display: flex;
    align-items: center;
    gap: var(--ma-space-3);
    width: 100%;
    min-height: 2.75rem;
    padding: 0 var(--ma-space-3);
    border: 0;
    background: transparent;
    color: inherit;
    font: 500 var(--ma-text-sm)/1.2 var(--ma-font);
    text-align: left;
    cursor: pointer;
}

.ma-dev-account__choix:hover,
.ma-dev-account__choix[aria-current="true"] {
    background: var(--ma-sideral-bleu);
}

.ma-dev-account__choix:focus-visible {
    outline: 2px solid var(--ma-rose);
    outline-offset: -2px;
}

.ma-dev-account__choix span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ma-dev-account__choix[aria-current="true"] .ma-icon:last-child {
    color: var(--ma-rose);
}

.ma-dev-account__vide {
    margin: 0;
    padding: var(--ma-space-2) var(--ma-space-3);
    color: color-mix(in srgb, var(--ma-papier) 72%, transparent);
    font-size: var(--ma-text-sm);
}

/* Téléphone : au-dessus de la barre « Je deviens ambassadeur » des landings (5,25 rem de haut, landing/shell.css). */
@media (max-width: 767px) {
    html:has(.ma-landing__sticky:not([hidden])) .ma-dev-account {
        bottom: calc(5.25rem + var(--ma-space-3) + env(safe-area-inset-bottom, 0px));
    }
}

/* Mouvement réduit : ni transition ni animation. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
