/* =====================================================================================================
   Administration de Page Directe : système de design (Digital Freedom, noir et or, clair et sombre).
   Aucun style en ligne (CSP style-src 'self') : tout est ici. Les écrans futurs réutilisent ces jetons
   et ces composants au lieu d'écrire des couleurs ou des tailles en dur.

   THÈMES
   - Clair par défaut (premier bloc de jetons). Sombre : bloc [data-theme="sombre"] (bouton soleil/lune ou
     Réglages, cookie pd_theme lu par le serveur), ou système en mode sombre quand le thème est « auto ».
     Les deux blocs sombres doivent rester identiques (un test le vérifie) ; même palette dans public.css.
   - L'en-tête reste noir dans les deux thèmes : c'est la plaque du logo crème et or.

   JETONS (contrat partagé avec public.css et les tâches suivantes)
   Couleurs, toujours en #rrggbb, contrastes AA vérifiés par tests/Unit/StylesheetsTest.php :
     --fond            arrière-plan de la page             --surface      cartes, panneaux, champs
     --surface-2       second plan : en-têtes de tableau,  --survol       survol d'une ligne
                       préfixes, zone de dépôt, code
     --texte           texte principal                     --texte-doux   aides, libellés, métadonnées
     --trait           bordures décoratives                --trait-fort   bordures de champs (3:1)
     --lien            liens et accents textuels           --focus        anneau de focus (3:1 sur --fond)
     --accent          or : action principale              --sur-accent   texte posé sur --accent
     --accent-survol   or au survol                        --accent-fond / --accent-trait : bandeau d'information
     --danger          destruction, erreur                 --sur-danger   texte posé sur --danger
     --danger-fond / --danger-trait : bandeau d'erreur     --succes / --succes-fond / --succes-trait : réussite
     --entete / --entete-trait / --entete-texte / --entete-doux : barre du haut (noire)
   Effets : --ombre-1 (cartes), --ombre-2 (éléments flottants, dialogues), --voile (fond d'un dialogue).
   Éditeur de code : --code-clair-* et --code-sombre-* (fond, gouttiere, numero, texte, balise, attribut, valeur, commentaire,
     chaine, mot, selecteur, propriete, trouve, courant, selection), ses deux palettes ; --code-* suit le thème de
     l'administration, .code-editor[data-code-theme] le remplace par le thème choisi dans l'éditeur.
   Police : --police-code (chasse fixe, éditeur de code) ; --police (pile Open Sans ; les fichiers éventuels se branchent dans polices.css), graisses 400, 600, 700.
   Échelle de texte (rem) : --t-xs 0.8125, --t-sm 0.875, --t-base 1, --t-lg 1.125, --t-xl 1.375, --t-2xl 1.75.
   Espacements (4 px) : --e-1 4, --e-2 8, --e-3 12, --e-4 16, --e-5 24, --e-6 32, --e-7 48.
   Rayons : --rayon-petit 6 px (badges carrés, code), --rayon 10 px (boutons, champs), --rayon-grand 16 px (cartes).
   Mouvement : --duree 160 ms, --courbe (sortie douce) ; tout s'arrête avec prefers-reduced-motion.
   Cible tactile : --cible 44 px (hauteur minimale des boutons, champs et liens d'action).

   COMPOSANTS (classes réutilisables)
     Mise en page    .page  .heading  .narrow  .stack  .buttons  .toolbar ; menu à gauche : .shell > .sidebar (.side-list, .side-admin,
                     .side-foot, .count) + .mobile-bar et .menu-toggle (sous 900 px)
     Fiche de page   .page-head (état, adresse, boutons) + .page-tabs (onglets, aria-current = courant) ; .notes-view ; onglet Code : .code-bar, .code-layout, textarea.code-area, .code-preview ;
                     éditeur (editeur.js) : .code-editor (.code-gutter, .code-layer, .c-*), .code-search, .code-splitter
     Cartes          .panel (carte), .panel.empty (état vide), .facts (liste dt/dd en grille), .device-list > .device (appareils connectés)
     Boutons         button / .button + .primary | .secondary | .danger | .small ; .icon-button (44 px carré) ;
                     .link-button (bouton qui ressemble à un lien) ; .done (copie réussie) ;
                     .switch (interrupteur : bouton aria-pressed, écran Fonctionnalités)
     Champs          input, select, textarea ; .field-with-button ; .slug-field (+ .prefix) ; .check (case) ;
                     .choices + .choice (boutons radio en cartes) ; .plan-features (groupe de cases encadré) ; .help (aide sous un champ) ; input.short
     Listes          table.pages (tableau, en cartes sous 68rem grâce à data-label) ; .tree (arborescence)
     Dossiers        .browser.has-tree (navigation + liste) ; .folder-nav + .tree (arborescence, <details> repliables) ;
                     .breadcrumb (fil d'Ariane) ; .folder-list + .folder-row ; .row-actions ; .row-menu (<details> dont le
                     résumé est un bouton, avec .row-menu-form ou, pour une page, .row-menu-panel) ; .inline-form ; .heading-actions
     Filtres         .chips + .chip (pastille-lien, aria-current = courante) + .chip-count ; .star-form + .star (étoile des favoris, aria-pressed)
     Badges          .badge +.on | .off | .attention | .state-sent | .state-failed | .state-pending | .state-grouped | .state-recapped
     Bandeaux        .notice (réussite ; .notice-undo avec le bouton « Annuler »), .alert (information, attention), .delete-warning (danger)
     Corbeille       .trash-selection (barre d'actions sur la sélection), table.trash-pages, .trash-address, .trash-confirm-list
     Lot de pages    .batch-form (.batch-prefix, table.batch-table, .batch-common) ; .field-error ; .published-list
     Dépôt           .dropzone (+ .over pendant un glisser, .busy pendant l'envoi) ; .progress (barre de progression)
     Dialogue        dialog.dialog (+ ::backdrop) ; .dialog-actions
     Limites         ul.usage (+ .usage-compact au tableau de bord) : .usage-item, .usage-label, .usage-value, <meter>
     Accès public    .access (carte d'inscription, mot de passe oublié, réinitialisation) : .access-intro, .access-links ;
                     .piege (champ piège à robots, hors écran) ; .guide + .guide-section + .guide-address (page d'aide)
     Tableau de bord .figures + .figure (chiffres), svg.chart (.chart-bar, .chart-bar-visitors, .chart-axis, .chart-label), .ranking, .recent-list, .activity-list, .first-steps
     Statistiques    .period-links, .stats-figures, .chart-wide, .chart-line-*, .hour-bar, .stats-dims, .stats-table
     Divers          .badge, .disk (pastille d'information), pre.snippet (code), .password-output, .sr-only, .skip-link
   ===================================================================================================== */

:root {
    color-scheme: light;
    --police-code: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
    --police: "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

    --fond: #f6f4ef;
    --surface: #ffffff;
    --surface-2: #efebe2;
    --survol: #faf8f3;
    --texte: #1c1a17;
    --texte-doux: #5d574c;
    --trait: #e3ded3;
    --trait-fort: #8f8879;
    --lien: #8a6410;
    --focus: #9a6f0e;
    --accent: #c9a24a;
    --accent-survol: #d6b25e;
    --sur-accent: #1c1a17;
    --accent-fond: #f8efd9;
    --accent-trait: #dcc58c;
    --danger: #b42318;
    --sur-danger: #ffffff;
    --danger-fond: #fbe9e7;
    --danger-trait: #eab0a9;
    --succes: #2e6b22;
    --succes-fond: #e8f2e1;
    --succes-trait: #a9cd9a;
    --entete: #15130f;
    --entete-trait: #15130f;
    --entete-texte: #ece7dc;
    --entete-doux: #a9a291;


    /* Éditeur de code : ses deux palettes (son thème se choisit à part), puis celle qui suit l'administration. */
    --code-clair-fond: #fbfaf7;
    --code-clair-gouttiere: #efebe2;
    --code-clair-numero: #5f584b;
    --code-clair-texte: #1c1a17;
    --code-clair-balise: #8a2f1c;
    --code-clair-attribut: #7a4f00;
    --code-clair-valeur: #1a5e33;
    --code-clair-commentaire: #5f584b;
    --code-clair-chaine: #1a5e33;
    --code-clair-mot: #6b2fa0;
    --code-clair-selecteur: #1d4f91;
    --code-clair-propriete: #7a4f00;
    --code-clair-trouve: #f6e7b4;
    --code-clair-courant: #f3cf6b;
    --code-clair-selection: rgb(201 162 74 / 0.35);

    --code-sombre-fond: #0f1b2e;
    --code-sombre-gouttiere: #16243b;
    --code-sombre-numero: #a9b9cf;
    --code-sombre-texte: #e6ebf3;
    --code-sombre-balise: #f6ab9d;
    --code-sombre-attribut: #e2be6a;
    --code-sombre-valeur: #9ad18a;
    --code-sombre-commentaire: #a9b9cf;
    --code-sombre-chaine: #9ad18a;
    --code-sombre-mot: #d0b2f5;
    --code-sombre-selecteur: #8cc4ff;
    --code-sombre-propriete: #e2be6a;
    --code-sombre-trouve: #3a3415;
    --code-sombre-courant: #574510;
    --code-sombre-selection: rgb(214 176 90 / 0.35);

    --code-fond: var(--code-clair-fond);
    --code-gouttiere: var(--code-clair-gouttiere);
    --code-numero: var(--code-clair-numero);
    --code-texte: var(--code-clair-texte);
    --code-balise: var(--code-clair-balise);
    --code-attribut: var(--code-clair-attribut);
    --code-valeur: var(--code-clair-valeur);
    --code-commentaire: var(--code-clair-commentaire);
    --code-chaine: var(--code-clair-chaine);
    --code-mot: var(--code-clair-mot);
    --code-selecteur: var(--code-clair-selecteur);
    --code-propriete: var(--code-clair-propriete);
    --code-trouve: var(--code-clair-trouve);
    --code-courant: var(--code-clair-courant);
    --code-selection: var(--code-clair-selection);

    --ombre-1: 0 1px 2px rgb(28 26 23 / 0.05), 0 2px 6px rgb(28 26 23 / 0.05);
    --ombre-2: 0 12px 32px rgb(28 26 23 / 0.16);
    --voile: rgb(21 19 15 / 0.5);
    --icone-soleil: none;
    --icone-lune: block;

    --t-xs: 0.8125rem;
    --t-sm: 0.875rem;
    --t-base: 1rem;
    --t-lg: 1.125rem;
    --t-xl: 1.375rem;
    --t-2xl: 1.75rem;

    --e-1: 0.25rem;
    --e-2: 0.5rem;
    --e-3: 0.75rem;
    --e-4: 1rem;
    --e-5: 1.5rem;
    --e-6: 2rem;
    --e-7: 3rem;

    --rayon-petit: 6px;
    --rayon: 10px;
    --rayon-grand: 16px;
    --cible: 2.75rem;
    --largeur: 76rem;
    --duree: 160ms;
    --courbe: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="sombre"] {
    color-scheme: dark;
    --fond: #12213a;
    --surface: #1a2c49;
    --surface-2: #22375a;
    --survol: #1f3355;
    --texte: #eef2f8;
    --texte-doux: #a9b9cf;
    --trait: #2e4569;
    --trait-fort: #7489a8;
    --lien: #e2be6a;
    --focus: #e8c670;
    --accent: #d6b05a;
    --accent-survol: #e4c274;
    --sur-accent: #17140e;
    --accent-fond: #3a3625;
    --accent-trait: #6b5527;
    --danger: #f4978e;
    --sur-danger: #1a0f0e;
    --danger-fond: #3d2030;
    --danger-trait: #7a3a36;
    --succes: #94d07f;
    --succes-fond: #163225;
    --succes-trait: #3f6334;
    --entete: #0b1524;
    --entete-trait: #1f3557;
    --ombre-1: 0 1px 2px rgb(0 0 0 / 0.35), 0 2px 8px rgb(0 0 0 / 0.25);
    --ombre-2: 0 12px 32px rgb(0 0 0 / 0.55);
    --voile: rgb(5 12 25 / 0.7);
    --code-fond: var(--code-sombre-fond);
    --code-gouttiere: var(--code-sombre-gouttiere);
    --code-numero: var(--code-sombre-numero);
    --code-texte: var(--code-sombre-texte);
    --code-balise: var(--code-sombre-balise);
    --code-attribut: var(--code-sombre-attribut);
    --code-valeur: var(--code-sombre-valeur);
    --code-commentaire: var(--code-sombre-commentaire);
    --code-chaine: var(--code-sombre-chaine);
    --code-mot: var(--code-sombre-mot);
    --code-selecteur: var(--code-sombre-selecteur);
    --code-propriete: var(--code-sombre-propriete);
    --code-trouve: var(--code-sombre-trouve);
    --code-courant: var(--code-sombre-courant);
    --code-selection: var(--code-sombre-selection);
    --icone-soleil: block;
    --icone-lune: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="clair"]) {
        color-scheme: dark;
        --fond: #12213a;
        --surface: #1a2c49;
        --surface-2: #22375a;
        --survol: #1f3355;
        --texte: #eef2f8;
        --texte-doux: #a9b9cf;
        --trait: #2e4569;
        --trait-fort: #7489a8;
        --lien: #e2be6a;
        --focus: #e8c670;
        --accent: #d6b05a;
        --accent-survol: #e4c274;
        --sur-accent: #17140e;
        --accent-fond: #3a3625;
        --accent-trait: #6b5527;
        --danger: #f4978e;
        --sur-danger: #1a0f0e;
        --danger-fond: #3d2030;
        --danger-trait: #7a3a36;
        --succes: #94d07f;
        --succes-fond: #163225;
        --succes-trait: #3f6334;
        --entete: #0b1524;
        --entete-trait: #1f3557;
        --ombre-1: 0 1px 2px rgb(0 0 0 / 0.35), 0 2px 8px rgb(0 0 0 / 0.25);
        --ombre-2: 0 12px 32px rgb(0 0 0 / 0.55);
        --voile: rgb(5 12 25 / 0.7);
        --code-fond: var(--code-sombre-fond);
        --code-gouttiere: var(--code-sombre-gouttiere);
        --code-numero: var(--code-sombre-numero);
        --code-texte: var(--code-sombre-texte);
        --code-balise: var(--code-sombre-balise);
        --code-attribut: var(--code-sombre-attribut);
        --code-valeur: var(--code-sombre-valeur);
        --code-commentaire: var(--code-sombre-commentaire);
        --code-chaine: var(--code-sombre-chaine);
        --code-mot: var(--code-sombre-mot);
        --code-selecteur: var(--code-sombre-selecteur);
        --code-propriete: var(--code-sombre-propriete);
        --code-trouve: var(--code-sombre-trouve);
        --code-courant: var(--code-sombre-courant);
        --code-selection: var(--code-sombre-selection);
        --icone-soleil: block;
        --icone-lune: none;
    }
}

/* ---------------------------------------------------------------- Base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    /* La barre de défilement garde sa place : un menu qui s'ouvre en surimpression en bas de page allonge le document,
       et sans cela la barre qui apparaît rétrécirait le tableau (décalage de mise en page). */
    scrollbar-gutter: stable;
    background: var(--fond);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--texte);
    background: var(--fond);
    font-family: var(--police);
    font-size: var(--t-base);
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

::selection {
    color: var(--texte);
    background: var(--accent-fond);
}

h1,
h2,
h3 {
    margin: 0 0 var(--e-4);
    color: var(--texte);
    line-height: 1.25;
    text-wrap: balance;
}

h1 {
    font-size: var(--t-2xl);
    font-weight: 700;
    letter-spacing: -0.015em;
}

h2 {
    font-size: var(--t-xl);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    margin-top: var(--e-6);
    font-size: var(--t-lg);
    font-weight: 600;
}

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

a {
    color: var(--lien);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--duree) var(--courbe), text-decoration-thickness var(--duree) var(--courbe);
}

a:hover {
    text-decoration-thickness: 2px;
}

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

main:focus {
    outline: none;
}

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

.skip-link {
    position: absolute;
    top: var(--e-2);
    left: var(--e-2);
    z-index: 100;
    padding: var(--e-2) var(--e-4);
    color: var(--sur-accent);
    background: var(--accent);
    border-radius: var(--rayon);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

.muted,
.help {
    color: var(--texte-doux);
    font-size: var(--t-sm);
}

.help {
    margin: calc(var(--e-1) * -1) 0 0;
}

.panel > .help {
    margin: 0 0 var(--e-4);
}

/* Explication au-dessus de la liste des pages (ordre manuel décroissant) */
.help.list-hint {
    margin: var(--e-2) 0 var(--e-3);
}

/* ---------------------------------------------------------------- En-tête (noir dans les deux thèmes) */

.topbar {
    color: var(--entete-texte);
    background: var(--entete);
    border-bottom: 1px solid var(--entete-trait);
}

.topbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-3) var(--e-6);
    max-width: var(--largeur);
    margin: 0 auto;
    padding: var(--e-3) var(--e-5);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--e-3);
    min-height: var(--cible);
    color: var(--entete-texte);
    font-size: var(--t-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.brand img {
    display: block;
    height: 32px;
    width: auto;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--e-3);
    margin-left: auto;
}

.logout {
    display: flex;
    align-items: center;
    gap: var(--e-3);
    min-width: 0;
}

.who {
    max-width: 16rem;
    overflow: hidden;
    color: var(--entete-doux);
    font-size: var(--t-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar .link-button,
.sidebar .link-button {
    color: var(--entete-texte);
}

.topbar :focus-visible,
.sidebar :focus-visible,
.mobile-bar :focus-visible {
    outline-color: var(--accent);
}

/* Bouton soleil/lune : icône de l'action suivante (lune en clair, soleil en sombre), via --icone-*. */

.icon-button,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--cible);
    min-width: var(--cible);
    height: var(--cible);
    min-height: var(--cible);
    padding: 0;
    color: var(--texte);
    background: transparent;
    border: 1px solid var(--trait);
    border-radius: 999px;
}

.icon-button:hover,
.theme-toggle:hover {
    background: var(--surface-2);
}

.topbar .theme-toggle,
.sidebar .theme-toggle {
    color: var(--entete-texte);
    border-color: rgb(255 255 255 / 0.16);
}

.topbar .theme-toggle:hover,
.sidebar .theme-toggle:hover {
    background: rgb(255 255 255 / 0.08);
}

.theme-toggle .icon-sun {
    display: var(--icone-soleil);
}

.theme-toggle .icon-moon {
    display: var(--icone-lune);
}

/* ---------------------------------------------------------------- Menu à gauche (noir dans les deux thèmes, comme l'en-tête)
   Écran large : colonne fixe. Sous 56.25rem (900 px) : cachée, ouverte par le bouton « Menu » (admin.js pose .menu-open
   sur <html>), dès le premier affichage. Sans JavaScript, sans-js.css (chargée dans <noscript>) met le menu à plat, en
   haut de la page. */

.shell {
    display: flex;
    flex: 1;
    align-items: flex-start;
}

.shell-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex: 0 0 16rem;
    flex-direction: column;
    gap: var(--e-4);
    width: 16rem;
    height: 100vh;
    height: 100dvh;
    padding: var(--e-4) var(--e-3);
    overflow-y: auto;
    color: var(--entete-texte);
    background: var(--entete);
    border-right: 1px solid var(--entete-trait);
}

.sidebar .brand {
    padding: 0 var(--e-2);
}

.side-list {
    display: flex;
    flex-direction: column;
    gap: var(--e-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Les entrées réservées à Jérôme, séparées par un trait. */
.side-admin {
    padding-top: var(--e-4);
    border-top: 1px solid var(--entete-trait);
}

.side-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-2);
    min-height: var(--cible);
    padding: 0 var(--e-4);
    color: var(--entete-doux);
    border-radius: var(--rayon);
    font-weight: 600;
    font-size: var(--t-sm);
    text-decoration: none;
    transition: color var(--duree) var(--courbe), background-color var(--duree) var(--courbe);
}

.side-list a:hover {
    color: var(--entete-texte);
    background: rgb(255 255 255 / 0.07);
}

.side-list a[aria-current="page"] {
    color: var(--entete);
    background: var(--accent);
}

.side-list .count {
    min-width: 1.5rem;
    padding: 0 var(--e-2);
    color: var(--entete-texte);
    background: rgb(255 255 255 / 0.14);
    border-radius: 999px;
    font-size: var(--t-xs);
    line-height: 1.5rem;
    text-align: center;
}

.side-list a[aria-current="page"] .count {
    color: var(--entete);
    background: rgb(0 0 0 / 0.12);
}

/* Le bas de la colonne : Mon compte et Aide (clients), nom, thème, déconnexion. */
.side-foot {
    display: flex;
    flex-direction: column;
    gap: var(--e-3);
    margin-top: auto;
    padding-top: var(--e-4);
    border-top: 1px solid var(--entete-trait);
}

.side-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-3);
    padding: 0 var(--e-2);
}

.sidebar .who {
    flex: 1;
    min-width: 0;
    max-width: none;
}

.sidebar .logout {
    padding: 0 var(--e-2);
}

/* Barre du haut des petits écrans : le nom et le bouton « Menu ». Cachée sur grand écran. */
.mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-3);
    padding: var(--e-2) var(--e-4);
    color: var(--entete-texte);
    background: var(--entete);
    border-bottom: 1px solid var(--entete-trait);
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--e-2);
    min-height: var(--cible);
    padding: 0 var(--e-4);
    color: var(--entete-texte);
    background: transparent;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 999px;
    font-weight: 600;
}

.menu-toggle:hover {
    background: rgb(255 255 255 / 0.08);
}

@media (max-width: 56.25rem) {
    .shell {
        flex-direction: column;
        align-items: stretch;
    }

    .shell-main {
        min-height: 0;
    }

    .mobile-bar {
        display: flex;
    }

    .sidebar .brand {
        display: none;
    }

    /* Cachée, puis ouverte par-dessus la page (sans JavaScript : sans-js.css). */
    .sidebar {
        display: none;
    }

    html.menu-open .sidebar {
        position: fixed;
        z-index: 30;
        top: 0;
        bottom: 0;
        left: 0;
        display: flex;
        width: min(18rem, 85vw);
        height: auto;
        box-shadow: var(--ombre-2);
    }

    html.menu-open .sidebar .brand {
        display: inline-flex;
    }

    html.menu-open .shell::after {
        content: "";
        position: fixed;
        z-index: 20;
        inset: 0;
        background: var(--voile);
    }
}

/* ---------------------------------------------------------------- Page */

.page {
    flex: 1;
    width: 100%;
    max-width: var(--largeur);
    margin: 0 auto;
    padding: var(--e-6) var(--e-5) var(--e-7);
}

.signature {
    padding: var(--e-5);
    color: var(--texte-doux);
    font-size: var(--t-xs);
    letter-spacing: 0.04em;
    text-align: center;
}

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

.heading h1 {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.panel {
    padding: var(--e-6);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-1);
}

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

.panel + .panel,
.notice + .panel,
.alert + .panel,
.heading + .panel {
    margin-top: var(--e-5);
}

.panel > h2:first-child,
.panel > h1:first-child {
    margin-top: 0;
}

.narrow {
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.empty {
    padding: var(--e-7) var(--e-5);
    color: var(--texte-doux);
    text-align: center;
}

/* ---------------------------------------------------------------- Bandeaux */

.notice,
.alert,
.delete-warning {
    padding: var(--e-3) var(--e-4);
    color: var(--texte);
    border: 1px solid;
    border-radius: var(--rayon);
}

.notice {
    background: var(--succes-fond);
    border-color: var(--succes-trait);
}

.alert {
    background: var(--accent-fond);
    border-color: var(--accent-trait);
}

/* Bandeau « Page mise à la corbeille. » : le message et le bouton « Annuler » sur une ligne. */
.notice-undo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-3);
}

.notice-undo p {
    margin: 0;
}

.delete-warning {
    background: var(--danger-fond);
    border-color: var(--danger-trait);
}

.heading + .notice,
.heading + .alert,
.notice + .alert {
    margin-top: 0;
}

.notice + .heading,
.notice + .panel,
.notice + .toolbar,
.alert + .toolbar {
    margin-top: var(--e-5);
}

/* ---------------------------------------------------------------- Formulaires */

.stack {
    display: flex;
    flex-direction: column;
    gap: var(--e-3);
}

.stack > h3 {
    margin: var(--e-4) 0 0;
}

label {
    font-size: var(--t-sm);
    font-weight: 600;
}

.stack > label:not(.check):not(.dropzone) {
    margin-top: var(--e-2);
}

.stack > label:first-of-type {
    margin-top: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100%;
    min-height: var(--cible);
    padding: var(--e-2) var(--e-3);
    color: var(--texte);
    background: var(--surface);
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon);
    font: inherit;
    transition: border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe);
}

input::placeholder,
textarea::placeholder {
    color: var(--texte-doux);
    opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--texte-doux);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--focus);
    outline: 2px solid var(--focus);
    outline-offset: 0;
}

.field-with-button {
    display: flex;
    gap: var(--e-2);
}

.field-with-button input {
    flex: 1 1 auto;
    min-width: 0;
}

.slug-field {
    display: flex;
    align-items: stretch;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon);
    overflow: hidden;
}

.slug-field:focus-within {
    outline: 2px solid var(--focus);
    outline-offset: 0;
    border-color: var(--focus);
}

.slug-field .prefix {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    max-width: 60%;
    padding: 0 var(--e-3);
    overflow: hidden;
    color: var(--texte-doux);
    background: var(--surface-2);
    border-right: 1px solid var(--trait);
    font-size: var(--t-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slug-field input,
.slug-field input:hover,
.slug-field input:focus-visible {
    flex: 1 0 8rem;
    min-width: 0;
    border: 0;
    border-radius: 0;
    outline: none;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: var(--e-3);
    min-height: var(--cible);
    padding: var(--e-2) 0;
    font-size: var(--t-base);
    font-weight: 400;
    cursor: pointer;
}

.check input,
.choice input {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.15rem 0 0;
    accent-color: var(--lien);
    cursor: pointer;
}

/* Groupe de cases encadré (fonctionnalités d'une formule). */

.plan-features {
    margin: var(--e-4) 0;
    padding: var(--e-2) var(--e-4) var(--e-3);
    background: var(--surface);
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon);
}

.plan-features legend {
    padding: 0 var(--e-2);
    font-weight: 600;
}

/* Boutons radio présentés en cartes (Réglages › Apparence). */

.choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--e-3);
    margin: 0;
    padding: 0;
    border: 0;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: var(--e-3);
    min-height: var(--cible);
    padding: var(--e-3) var(--e-4);
    background: var(--surface);
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon);
    font-size: var(--t-base);
    font-weight: 400;
    cursor: pointer;
    transition: border-color var(--duree) var(--courbe), background-color var(--duree) var(--courbe);
}

.choice:hover {
    background: var(--survol);
}

.choice:has(input:checked) {
    background: var(--accent-fond);
    border-color: var(--lien);
}

.choice:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

input.short {
    max-width: 6rem;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-3);
}

/* « Nouvelle page » d'un client : place retenue par ses dépôts en attente, et le bouton qui les annule */
.pending-deposits {
    display: grid;
    gap: var(--e-2);
    margin: 0 0 var(--e-4);
}

.pending-deposits .help {
    margin: 0;
}

.stack > .buttons,
.stack > button:last-child {
    margin-top: var(--e-3);
}

/* ---------------------------------------------------------------- Boutons */

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--e-2);
    min-height: var(--cible);
    padding: 0 var(--e-5);
    color: var(--texte);
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--rayon);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: color var(--duree) var(--courbe), background-color var(--duree) var(--courbe),
        border-color var(--duree) var(--courbe), transform var(--duree) var(--courbe);
}

button:active,
.button:active {
    transform: translateY(1px);
}

button:disabled,
button[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.primary {
    color: var(--sur-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.primary:hover {
    color: var(--sur-accent);
    background: var(--accent-survol);
    border-color: var(--accent-survol);
}

.secondary {
    color: var(--texte);
    background: var(--surface);
    border-color: var(--trait-fort);
}

.secondary:hover {
    color: var(--texte);
    background: var(--surface-2);
}

.danger {
    color: var(--danger);
    background: var(--surface);
    border-color: var(--danger-trait);
}

.danger:hover {
    color: var(--danger);
    background: var(--danger-fond);
}

button.danger[type="submit"] {
    color: var(--sur-danger);
    background: var(--danger);
    border-color: var(--danger);
}

button.danger[type="submit"]:hover {
    color: var(--sur-danger);
    background: var(--danger);
    border-color: var(--texte);
}

.small {
    padding: 0 var(--e-4);
    font-size: var(--t-sm);
    white-space: nowrap;
}

button.done,
button.done:hover {
    color: var(--succes);
    background: var(--succes-fond);
    border-color: var(--succes-trait);
}

.link-button {
    min-height: var(--cible);
    padding: 0 var(--e-1);
    color: var(--lien);
    background: none;
    border: 0;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

.link-button:hover {
    text-decoration-thickness: 2px;
}

/* ---------------------------------------------------------------- Zone de dépôt et progression */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--e-2);
    padding: var(--e-7) var(--e-5);
    color: var(--texte-doux);
    background: var(--surface-2);
    border: 2px dashed var(--trait-fort);
    border-radius: var(--rayon-grand);
    font-size: var(--t-sm);
    font-weight: 400;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--duree) var(--courbe), background-color var(--duree) var(--courbe);
}

.dropzone:hover {
    border-color: var(--lien);
}

.dropzone:focus-within {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.dropzone strong {
    color: var(--texte);
    font-size: var(--t-lg);
    font-weight: 600;
}

.dropzone input[type="file"] {
    width: 22rem;
    max-width: 100%;
    margin-top: var(--e-2);
    color: var(--texte-doux);
    font: inherit;
    font-size: var(--t-sm);
}

.dropzone input[type="file"]::file-selector-button {
    min-height: var(--cible);
    margin-right: var(--e-3);
    padding: 0 var(--e-4);
    color: var(--texte);
    background: var(--surface);
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.dropzone.over {
    background: var(--accent-fond);
    border-style: solid;
    border-color: var(--lien);
}

.dropzone.busy {
    opacity: 0.7;
    cursor: progress;
}

/* Barre de progression : <div class="progress"><span class="progress-bar" …></span></div>
   (la largeur se pose avec element.style.width en JavaScript, autorisé par la CSP, jamais avec un attribut style). */

.progress {
    width: 100%;
    height: 0.5rem;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: 999px;
}

.progress-bar {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    transition: width var(--duree) var(--courbe);
}

/* Liste des fichiers en cours d'envoi (public_admin/assets/envoi.js) : une ligne par fichier, une barre <progress> chacune. */

.upload-progress {
    display: grid;
    gap: var(--e-3);
}

.upload-progress[hidden],
.custom-limits-fields[hidden],
.upload-form [data-upload-cancel][hidden],
.upload-form [data-upload-submit][hidden] {
    display: none;
}

.upload-list {
    display: grid;
    gap: var(--e-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.upload-file {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--e-1) var(--e-3);
    align-items: baseline;
    padding: var(--e-3) var(--e-4);
    background: var(--surface-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}

.upload-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.upload-status {
    color: var(--texte-doux);
    font-size: var(--t-sm);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.upload-file progress {
    grid-column: 1 / -1;
    width: 100%;
    height: 0.5rem;
    overflow: hidden;
    background: var(--surface);
    border: 0;
    border-radius: 999px;
    appearance: none;
    accent-color: var(--accent);
}

.upload-file progress::-webkit-progress-bar {
    background: var(--trait);
    border-radius: 999px;
}

.upload-file progress::-webkit-progress-value {
    background: var(--accent);
    border-radius: 999px;
    transition: width var(--duree) var(--courbe);
}

.upload-file progress::-moz-progress-bar {
    background: var(--accent);
    border-radius: 999px;
}

@media (max-width: 30rem) {
    .upload-file {
        grid-template-columns: 1fr;
    }

    .upload-status {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .upload-file progress::-webkit-progress-value {
        transition: none;
    }
}

/* ---------------------------------------------------------------- Fiche d'une page */

.public-link {
    font-size: var(--t-lg);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: var(--e-4) var(--e-5);
    margin: var(--e-5) 0 0;
    padding-top: var(--e-5);
    border-top: 1px solid var(--trait);
}

.facts dt {
    color: var(--texte-doux);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.facts dd {
    margin: var(--e-1) 0 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* En-tête commun de la fiche (templates/admin/page_header.php) : état, adresse, boutons du lien, puis les onglets */

.page-head {
    margin-bottom: var(--e-4);
}

.page-head-state {
    margin: 0 0 var(--e-2);
}

.page-head .public-link {
    margin: 0 0 var(--e-3);
}

.page-tabs {
    margin-bottom: var(--e-5);
    border-bottom: 1px solid var(--trait);
    overflow-x: auto;
}

.page-tabs ul {
    display: flex;
    gap: var(--e-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: var(--cible);
    padding: 0 var(--e-4);
    color: var(--texte-doux);
    border-bottom: 3px solid transparent;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.page-tabs a:hover {
    color: var(--texte);
    background: var(--surface-2);
}

.page-tabs a[aria-current="page"] {
    color: var(--texte);
    border-bottom-color: var(--accent);
}

/* Remplacement du fichier depuis l'en-tête de la fiche (page_header.php, fiche.js). Avec JavaScript, seul son compte rendu
   d'envoi se voit : le fichier se dépose n'importe où dans la fenêtre. Sans JavaScript (html.no-js), c'est une ligne simple. */

.fiche-drop-area {
    margin-bottom: var(--e-4);
}

.fiche-drop {
    display: grid;
    gap: var(--e-3);
}

.fiche-drop-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2) var(--e-3);
    font-weight: 600;
}

html:not(.no-js) .fiche-drop [data-dropzone],
html:not(.no-js) .fiche-drop [data-upload-submit],
.fiche-drop [data-upload-submit][hidden],
.fiche-drop [data-upload-cancel][hidden] {
    display: none;
}

/* Un fichier est glissé au-dessus de la fenêtre : un contour pointillé encadre toute la page. */
body.fiche-dropping::after {
    content: "";
    position: fixed;
    inset: var(--e-2);
    z-index: 100;
    border: 3px dashed var(--lien);
    border-radius: var(--rayon-grand);
    background: var(--accent-fond);
    opacity: 0.45;
    pointer-events: none;
}

/* Onglet Versions : une carte par ancienne version. */
.version-list {
    display: grid;
    gap: var(--e-3);
    margin: var(--e-3) 0 0;
    padding: 0;
    list-style: none;
}

.version-item {
    display: grid;
    gap: var(--e-2);
    padding: var(--e-3) var(--e-4);
    background: var(--surface-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}

.version-item p,
.version-current {
    margin: 0;
    overflow-wrap: anywhere;
}

.notes-view {
    overflow-wrap: anywhere;
}

/* « Mes appareils connectés » : une ligne par appareil, son bouton « Déconnecter » à droite */
.device-list {
    display: grid;
    gap: var(--e-3);
    margin: var(--e-4) 0;
    padding: 0;
    list-style: none;
}

.device {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-3) var(--e-4);
    padding: var(--e-3) var(--e-4);
    background: var(--surface-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}

.device-info {
    min-width: 0;
}

.device-info p {
    margin: 0;
}

.device-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.password-output {
    padding: var(--e-3) var(--e-4);
    background: var(--surface-2);
    border: 1px dashed var(--trait-fort);
    border-radius: var(--rayon);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- Barre d'outils et tableau des pages */

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

.toolbar p {
    margin: 0;
}

.search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2);
    flex: 1 1 22rem;
    max-width: 34rem;
}

.search input {
    flex: 1 1 12rem;
    width: auto;
}

.search a {
    display: inline-flex;
    align-items: center;
    min-height: var(--cible);
    padding: 0 var(--e-2);
    font-size: var(--t-sm);
    font-weight: 600;
}

.sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2);
}

.sort label:not(.sr-only) {
    color: var(--texte-doux);
    font-size: var(--t-sm);
    font-weight: 600;
}

.sort select {
    flex: 1 1 9rem;
    width: auto;
    min-width: 9rem;
}

.disk {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0 var(--e-4);
    color: var(--texte-doux);
    background: var(--surface-2);
    border-radius: 999px;
    font-size: var(--t-sm);
    font-variant-numeric: tabular-nums;
}

/* Jauge des limites d'un client (templates/admin/usage.php) : « 3 / 20 pages », « 12 Mo / 500 Mo », chacune avec une
   barre <meter> (low 75 %, high 90 %, optimum 0 : la barre passe au rouge près de la limite ; le chiffre dit tout). */

.usage {
    display: grid;
    gap: var(--e-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.usage-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: var(--e-1) var(--e-3);
}

.usage-label {
    color: var(--texte-doux);
    font-size: var(--t-sm);
    font-weight: 600;
}

.usage-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.usage meter {
    grid-column: 1 / -1;
    width: 100%;
    height: 0.5rem;
    background: var(--trait);
    border: 0;
    border-radius: 999px;
    appearance: none;
}

.usage meter::-webkit-meter-bar {
    height: 0.5rem;
    background: var(--trait);
    border: 0;
    border-radius: 999px;
}

.usage meter::-webkit-meter-optimum-value,
.usage meter::-webkit-meter-suboptimum-value {
    background: var(--accent);
    border-radius: 999px;
}

.usage meter::-webkit-meter-even-less-good-value {
    background: var(--danger);
    border-radius: 999px;
}

.usage meter::-moz-meter-bar {
    background: var(--accent);
    border-radius: 999px;
}

.usage meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
    background: var(--danger);
}

.panel > .usage {
    margin-bottom: var(--e-4);
}

/* Version courte, dans la barre d'outils du tableau de bord : deux pastilles côte à côte. */

.usage-compact {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: var(--e-2) var(--e-3);
}

.usage-compact .usage-label,
.usage-compact .usage-value {
    white-space: nowrap;
}

.usage-compact .usage-item {
    flex: 1 1 13rem;
    max-width: 18rem;
    padding: var(--e-2) var(--e-4);
    background: var(--surface-2);
    border-radius: var(--rayon);
    font-size: var(--t-sm);
}

.usage-compact .usage-label {
    font-size: var(--t-xs);
}

@media (max-width: 30rem) {
    .usage-compact .usage-item {
        max-width: none;
    }
}

.account-address {
    overflow-wrap: anywhere;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-1);
}

table.pages {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-sm);
}

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

table.pages th {
    color: var(--texte-doux);
    background: var(--surface-2);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

table.pages tbody tr {
    transition: background-color var(--duree) var(--courbe);
}

table.pages tbody tr:hover {
    background: var(--survol);
}

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

table.pages .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

table.pages td.title {
    font-size: var(--t-base);
    font-weight: 600;
}

table.pages td.title a {
    color: var(--texte);
    text-decoration: none;
}

table.pages td.title a:hover {
    color: var(--lien);
    text-decoration: underline;
}

table.pages td.url {
    max-width: 12rem;
    overflow-wrap: anywhere;
}

table.pages td.actions {
    text-align: right;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--e-1);
    padding: 0.125rem 0.625rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: var(--t-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.badge.on,
.badge.state-sent,
.badge.state-recapped {
    color: var(--succes);
    background: var(--succes-fond);
    border-color: var(--succes-trait);
}

.badge.off,
.badge.state-pending,
.badge.state-grouped {
    color: var(--texte-doux);
    background: var(--surface-2);
    border-color: var(--trait);
}

.badge.state-failed {
    color: var(--danger);
    background: var(--danger-fond);
    border-color: var(--danger-trait);
}

/* Pastille « N en échec » à côté du titre : visible seulement quand la colonne Réponses est masquée (voir plus bas). */
.title-warn {
    display: none;
    text-decoration: none;
}

a.warn {
    margin-left: var(--e-2);
    color: var(--danger);
    font-size: var(--t-xs);
    font-weight: 600;
}

/* ---------------------------------------------------------------- Arborescence (dossiers) */

.tree,
.tree ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree ul {
    padding-left: var(--e-4);
    border-left: 1px solid var(--trait);
    margin-left: var(--e-4);
}

.tree a,
.tree button {
    display: flex;
    align-items: center;
    gap: var(--e-2);
    width: 100%;
    min-height: var(--cible);
    padding: 0 var(--e-3);
    color: var(--texte);
    background: transparent;
    border: 0;
    border-radius: var(--rayon);
    font-size: var(--t-sm);
    font-weight: 400;
    text-align: left;
    text-decoration: none;
}

.tree a:hover,
.tree button:hover {
    background: var(--surface-2);
}

.tree [aria-current="page"],
.tree [aria-selected="true"] {
    color: var(--texte);
    background: var(--accent-fond);
    font-weight: 600;
}

/* ---------------------------------------------------------------- Dossiers : navigation, fil d'Ariane, lignes de dossier, menus */

.browser.has-tree {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
    gap: var(--e-5);
    align-items: start;
}

.browser-main {
    min-width: 0;
}

.folder-nav {
    position: sticky;
    top: var(--e-4);
    padding: var(--e-2);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-1);
}

.tree summary {
    display: flex;
    align-items: center;
    border-radius: var(--rayon);
    list-style: none;
    cursor: pointer;
}

.tree summary::-webkit-details-marker {
    display: none;
}

.tree summary::before {
    content: "";
    flex: none;
    width: 0.45rem;
    height: 0.45rem;
    margin: 0 var(--e-2) 0 var(--e-3);
    border-right: 2px solid var(--texte-doux);
    border-bottom: 2px solid var(--texte-doux);
    transform: rotate(-45deg);
    transition: transform var(--duree) var(--courbe);
}

.tree details[open] > summary::before {
    transform: rotate(45deg);
}

.tree summary > a {
    flex: 1 1 auto;
    width: auto;
    padding-left: var(--e-1);
}

.tree ul > li > a {
    padding-left: calc(var(--e-3) + 1.1rem);
}

.tree-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tree-count {
    margin-left: auto;
    color: var(--texte-doux);
    font-size: var(--t-xs);
    font-variant-numeric: tabular-nums;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-1) var(--e-2);
    margin: 0 0 var(--e-3);
    padding: 0;
    color: var(--texte-doux);
    font-size: var(--t-sm);
    list-style: none;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
}

.breadcrumb li + li::before {
    content: "\203A";
    margin-right: var(--e-2);
}

.breadcrumb a {
    font-weight: 600;
}

.breadcrumb [aria-current="page"] {
    color: var(--texte);
    font-weight: 600;
}

@media (pointer: coarse) {
    .breadcrumb li {
        min-height: var(--cible);
    }
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-3);
}

.folder-list {
    display: grid;
    gap: var(--e-2);
    margin: 0 0 var(--e-4);
    padding: 0;
    list-style: none;
}

.folder-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2) var(--e-4);
    padding: var(--e-2) var(--e-4);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-1);
}

.folder-name {
    display: inline-flex;
    flex: 1 1 12rem;
    align-items: center;
    gap: var(--e-3);
    min-height: var(--cible);
    min-width: 0;
    color: var(--texte);
    font-weight: 600;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.folder-name::before {
    content: "";
    flex: none;
    width: 1.25rem;
    height: 1rem;
    background: var(--accent);
    border-radius: 2px 5px 5px 5px;
}

.folder-name:hover {
    color: var(--lien);
    text-decoration: underline;
}

.folder-count {
    color: var(--texte-doux);
    font-size: var(--t-sm);
    font-variant-numeric: tabular-nums;
}

.folder-path {
    color: var(--texte-doux);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2);
}

.inline-form {
    margin: 0;
}

/* Pastilles de filtre (Toutes, En ligne, Hors ligne, Favoris) : des liens ; la courante porte aria-current. */

.chips ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--e-2);
    margin: 0 0 var(--e-4);
    padding: 0;
    list-style: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--e-2);
    min-height: var(--cible);
    padding: 0 var(--e-4);
    color: var(--texte);
    background: var(--surface);
    border: 1px solid var(--trait-fort);
    border-radius: 999px;
    font-size: var(--t-sm);
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--duree) var(--courbe);
}

.chip:hover {
    background: var(--surface-2);
}

.chip[aria-current="page"] {
    color: var(--sur-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.chip[aria-current="page"]:hover {
    background: var(--accent-survol);
}

.chip-count {
    font-size: var(--t-xs);
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}

/* Étoile des favoris : un bouton dans son propre petit formulaire, en tête de la ligne ; aria-pressed dit l'état. */

.star-form {
    display: inline-block;
    margin: 0;
}

table.pages th.star-cell,
table.pages td.star-cell {
    width: 1%;
    padding-right: 0;
}

.star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--cible);
    min-width: var(--cible);
    height: var(--cible);
    min-height: var(--cible);
    padding: 0;
    color: var(--texte-doux);
    background: transparent;
    border: 0;
    border-radius: 999px;
}

.star:hover {
    color: var(--texte);
    background: var(--surface-2);
}

.star svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linejoin: round;
}

.star[aria-pressed="true"] svg {
    fill: var(--accent);
    stroke: var(--texte);
}

/* Sélection de plusieurs pages : une case par ligne (à côté de l'étoile) et, sous la liste, la barre d'actions (admin.js). Sans JavaScript,
   la barre reste visible ; avec, elle n'apparaît qu'à la première case cochée et reste en bas de l'écran. */

table.pages th.check-cell,
table.pages td.check-cell {
    width: 1%;
    padding-right: 0;
}

.row-check {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    vertical-align: middle;
    accent-color: var(--lien);
    cursor: pointer;
}

html.no-js [data-select-all] {
    display: none;
}

.selection-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2) var(--e-4);
    margin-top: var(--e-4);
    padding: var(--e-3) var(--e-4);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-1);
}

.selection-bar.is-scripted {
    position: sticky;
    bottom: var(--e-4);
    z-index: 5;
    box-shadow: var(--ombre-2);
}

.selection-bar.is-scripted:not(.is-open),
.selection-bar.is-scripted .selection-hint {
    display: none;
}

.selection-hint,
.selection-count {
    margin: 0;
    font-size: var(--t-sm);
}

.selection-hint {
    color: var(--texte-doux);
}

.selection-count {
    font-weight: 600;
}

.selection-count:empty {
    display: none;
}

.selection-actions,
.selection-move {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2) var(--e-3);
}

.selection-move {
    flex-wrap: nowrap;
}

.selection-move label {
    flex: none;
    font-size: var(--t-sm);
    font-weight: 600;
}

.selection-move select {
    width: auto;
    min-width: 0;
    max-width: 14rem;
}

@media (pointer: coarse) {
    .row-check {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* Menu « Renommer », « Déplacer vers… », « Nouveau dossier » : un <details> dont le résumé est un bouton. */

.row-menu {
    position: relative;
}

.row-menu > summary {
    list-style: none;
}

.row-menu > summary::-webkit-details-marker {
    display: none;
}

.row-menu[open] > summary {
    background: var(--surface-2);
}

.row-menu-form {
    position: absolute;
    top: calc(100% + var(--e-1));
    right: 0;
    z-index: 10;
    width: min(20rem, calc(100vw - 2 * var(--e-4)));
    padding: var(--e-4);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-2);
    text-align: left;
}

/* Tableau des pages : une seule colonne d'actions, un bouton « Actions » qui ouvre un menu (copier, ordre, déplacer). */

.has-tree table.pages th,
.has-tree table.pages td {
    padding: var(--e-3) var(--e-2);
}

.has-tree table.pages th {
    white-space: normal;
}

table.pages td.url a {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table.pages td.actions .row-menu {
    display: inline-block;
}

.row-menu-panel {
    display: grid;
    gap: var(--e-2);
    min-width: 13rem;
    margin-top: var(--e-2);
    padding: var(--e-3);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    text-align: left;
}

.row-menu-panel button {
    width: 100%;
}

.row-menu-panel .panel-form {
    display: grid;
    gap: var(--e-2);
    margin: 0;
    padding-top: var(--e-3);
    border-top: 1px solid var(--trait);
}

.row-menu-panel .panel-form label {
    font-size: var(--t-sm);
    font-weight: 600;
}

.row-menu-panel .button {
    width: 100%;
}

/* Le clic droit (menu.js) : le menu des actions d'une ligne, posé à l'écran (position fixed, left et top viennent du script). */

.ctx-menu {
    position: fixed;
    z-index: 60;
    display: grid;
    min-width: 14rem;
    max-width: calc(100vw - 2 * var(--e-2));
    padding: var(--e-1);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    box-shadow: var(--ombre-2);
    text-align: left;
    /* Un long menu défile en lui-même (menu.js ne le ferme pas pour un défilement intérieur). */
    max-height: calc(100vh - 16px);
    overflow-y: auto;
}

.ctx-menu:focus {
    outline: none;
}

.ctx-heading {
    margin: 0;
    padding: var(--e-2) var(--e-3);
    color: var(--texte-doux);
    border-bottom: 1px solid var(--trait);
    font-size: var(--t-xs);
    font-weight: 600;
}

.ctx-item {
    justify-content: flex-start;
    width: 100%;
    padding: 0 var(--e-3);
    color: var(--texte);
    background: none;
    border: 0;
    border-radius: var(--rayon-petit);
    font-weight: 400;
    text-align: left;
}

.ctx-item:hover:not(:disabled),
.ctx-item:focus-visible {
    background: var(--surface-2);
}

.ctx-item:disabled {
    color: var(--texte-doux);
    cursor: not-allowed;
}

.ctx-item.ctx-danger {
    color: var(--danger);
}

/* Grand écran : le menu s'ouvre en surimpression, la ligne ne grandit pas. */

@media (min-width: 70rem) {
    .table-wrap {
        overflow: visible;
    }

    table.pages thead th:first-child {
        border-top-left-radius: calc(var(--rayon-grand) - 1px);
    }

    table.pages thead th:last-child {
        border-top-right-radius: calc(var(--rayon-grand) - 1px);
    }

    .row-menu-panel {
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 10;
        width: 16rem;
        box-shadow: var(--ombre-2);
    }
}

/* Mes pages : la navigation à gauche (16 rem) et, quand il y a des dossiers, l'arborescence laissent peu de place au tableau. Les colonnes
   secondaires (Accès, Vues (total), Réponses : repérées par leur classe, quelles que soient les colonnes présentes) restent dans la fiche
   de la page : sous 1470 px, et toujours à côté de l'arborescence (la page ne dépasse pas 76 rem). Le titre garde une largeur utile et
   les marges se serrent. Sous 1100 px, le tableau laisse la place aux cartes. */

@media (min-width: 68.01rem) and (max-width: 92rem) {
    .browser table.pages :is(th, td):is(.col-acces, .col-vues-total, .col-reponses) {
        display: none;
    }

    .browser table.pages :is(th, td) {
        padding-right: var(--e-2);
        padding-left: var(--e-2);
    }

    .browser table.pages th {
        white-space: normal;
    }

    .browser table.pages td.title {
        min-width: 11rem;
    }

    .browser table.pages td.url {
        max-width: 10rem;
    }

    .browser.has-tree table.pages td.url {
        max-width: 9rem;
    }

    /* La colonne Réponses (et son « N en échec ») est masquée : le même avertissement se lit à côté du titre. */
    .browser table.pages .title-warn {
        display: inline-flex;
        margin-left: var(--e-2);
        vertical-align: middle;
    }
}

@media (min-width: 92.01rem) {
    .browser table.pages :is(th, td) {
        padding-right: var(--e-3);
        padding-left: var(--e-3);
    }

    .browser.has-tree table.pages :is(th, td):is(.col-acces, .col-vues-total, .col-reponses) {
        display: none;
    }

    .browser.has-tree table.pages .title-warn {
        display: inline-flex;
        margin-left: var(--e-2);
        vertical-align: middle;
    }
}

/* « Mis à jour » (la date se lit dans la fiche) cède la place quand le tableau est le plus serré : avec l'arborescence jusqu'à 1400 px,
   sans elle sous 1200 px. Sous 1265 px, l'arborescence passe au-dessus de la liste. */

@media (min-width: 79.01rem) and (max-width: 87.5rem) {
    .browser.has-tree table.pages :is(th, td).col-maj {
        display: none;
    }
}

@media (min-width: 68.01rem) and (max-width: 75rem) {
    .browser table.pages :is(th, td).col-maj {
        display: none;
    }
}

@media (max-width: 79rem) {
    .browser.has-tree {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--e-4);
    }

    .folder-nav {
        position: static;
    }
}

@media (max-width: 52rem) {
    .heading-actions {
        flex: 1 1 100%;
    }

    .heading-actions > * {
        flex: 1 1 auto;
    }

    .heading-actions .row-menu[open] {
        flex-basis: 100%;
    }

    .row-menu-form {
        position: static;
        width: auto;
        margin-top: var(--e-2);
        box-shadow: none;
    }

    .folder-row .row-actions {
        flex: 1 1 100%;
    }

    .folder-row .row-actions > * {
        flex: 1 1 auto;
    }

    .folder-row .row-menu[open] {
        flex-basis: 100%;
    }

    .row-menu > summary {
        width: 100%;
    }

    table.pages td.actions .row-menu {
        display: block;
    }

    .row-menu-panel {
        position: static;
        width: auto;
    }
}

/* ---------------------------------------------------------------- Glisser-déposer (public_admin/assets/dossiers.js) */

/* Page ou dossier qu'on peut saisir : la poignée est la ligne entière, le curseur le dit. */
[data-item] {
    cursor: grab;
}

[data-item].is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

[data-item].is-moving {
    opacity: 0.6;
    pointer-events: none;
}

/* Cible survolée (dossier de l'arborescence, ligne de dossier, « Mes pages ») : fond doré et cadre en pointillés
   (--focus fait au moins 3:1 sur les surfaces des deux thèmes). */
.drop-over {
    background: var(--accent-fond);
    outline: 2px dashed var(--focus);
    outline-offset: -2px;
}

.folder-nav a.drop-over,
.folder-nav summary.drop-over {
    color: var(--texte);
}

/* Repère d'insertion entre deux lignes du tableau en ordre manuel : un trait doré au-dessus ou au-dessous. */
table.pages tbody tr.drop-before > td {
    box-shadow: inset 0 3px 0 0 var(--focus);
}

table.pages tbody tr.drop-after > td {
    box-shadow: inset 0 -3px 0 0 var(--focus);
}

/* Bandeau de confirmation ou d'erreur (le même texte est annoncé par la zone aria-live). */
.drag-toast {
    position: fixed;
    right: var(--e-4);
    bottom: var(--e-4);
    left: var(--e-4);
    z-index: 30;
    max-width: 32rem;
    margin: 0 auto;
    padding: var(--e-3) var(--e-4);
    color: var(--texte);
    background: var(--surface);
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon);
    box-shadow: var(--ombre-2);
    font-size: var(--t-sm);
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.5rem);
    transition: opacity var(--duree) var(--courbe), transform var(--duree) var(--courbe);
}

.drag-toast.is-shown {
    opacity: 1;
    transform: none;
}

.drag-toast.is-ok {
    background: var(--succes-fond);
    border-color: var(--succes-trait);
    color: var(--succes);
}

.drag-toast.is-error {
    background: var(--danger-fond);
    border-color: var(--danger-trait);
    color: var(--danger);
}

/* ---------------------------------------------------------------- Dialogue (<dialog class="dialog">) */

dialog.dialog {
    width: min(32rem, calc(100vw - 2 * var(--e-4)));
    padding: var(--e-6);
    color: var(--texte);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-2);
}

dialog.dialog::backdrop {
    background: var(--voile);
}

.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--e-3);
    margin-top: var(--e-5);
}

/* ---------------------------------------------------------------- Réponses aux formulaires et codes exemples */

.response + .response,
.toolbar + .response {
    margin-top: var(--e-4);
}

.response-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-3);
    margin-bottom: var(--e-4);
}

.response-head h2 {
    margin: 0;
    font-size: var(--t-base);
    font-variant-numeric: tabular-nums;
}

.response-fields {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.response-fields dd {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-weight: 400;
}

.channels {
    display: flex;
    flex-wrap: wrap;
    gap: var(--e-2) var(--e-5);
    margin: var(--e-4) 0 0;
    padding: var(--e-4) 0 0;
    border-top: 1px solid var(--trait);
    list-style: none;
    font-size: var(--t-sm);
}

pre.snippet {
    margin: 0 0 var(--e-3);
    padding: var(--e-4);
    overflow-x: auto;
    color: var(--texte);
    background: var(--surface-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-petit);
    font-size: var(--t-xs);
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- Petits écrans */

@media (max-width: 52rem) {
    .topbar-inner {
        gap: var(--e-2) var(--e-3);
        padding: var(--e-2) var(--e-4);
    }

    .topbar-actions {
        gap: var(--e-2);
    }

    .who {
        max-width: 9rem;
    }

    .page {
        padding: var(--e-5) var(--e-4) var(--e-6);
    }

    h1 {
        font-size: var(--t-xl);
    }

    h2 {
        font-size: var(--t-lg);
    }

    .panel {
        padding: var(--e-5) var(--e-4);
    }

    .heading .button {
        flex: 1 1 auto;
    }

}

/* Tableau des pages : une carte par page, libellés tirés de data-label. Sous 68 rem, la navigation à gauche (16 rem) ne laisse plus
   que 52 rem de contenu. */

@media (max-width: 68rem) {

    .table-wrap {
        overflow: visible;
        background: none;
        border: 0;
        box-shadow: none;
    }

    table.pages,
    table.pages tbody,
    table.pages tr,
    table.pages td {
        display: block;
    }

    table.pages thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    table.pages tr {
        margin-bottom: var(--e-3);
        padding: var(--e-2) var(--e-4);
        background: var(--surface);
        border: 1px solid var(--trait);
        border-radius: var(--rayon-grand);
        box-shadow: var(--ombre-1);
    }

    table.pages tbody tr:hover {
        background: var(--surface);
    }

    table.pages td,
    table.pages td.url {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--e-4);
        max-width: none;
        padding: var(--e-2) 0;
        text-align: right;
    }

    table.pages td::before {
        content: attr(data-label);
        flex: none;
        color: var(--texte-doux);
        font-size: var(--t-xs);
        font-weight: 600;
        letter-spacing: 0.04em;
        text-align: left;
        text-transform: uppercase;
    }

    table.pages tbody tr:last-child td {
        border-bottom: 1px solid var(--trait);
    }

    table.pages td.title {
        display: block;
        padding: var(--e-2) 0 var(--e-3);
        font-size: var(--t-lg);
        text-align: left;
    }

    table.pages td.title::before,
    table.pages td.check-cell::before,
    table.pages td.star-cell::before {
        content: none;
    }

    /* La case et l'étoile se suivent sur une ligne, au-dessus du titre. */
    table.pages td.check-cell,
    table.pages td.star-cell {
        display: inline-block;
        width: auto;
        padding: 0 var(--e-2) 0 0;
        vertical-align: middle;
        text-align: left;
        border-bottom: 0;
    }

    table.pages td.actions,
    table.pages tbody tr:last-child td.actions {
        display: block;
        padding: var(--e-3) 0 var(--e-2);
        border-bottom: 0;
    }

    table.pages td.actions::before {
        content: none;
    }

    table.pages td.actions .row-menu {
        display: block;
    }

    table.pages td.actions .button,
    table.pages td.actions button {
        width: 100%;
    }
}

/* ---------------------------------------------------------------- Dépôt de plusieurs pages (écran du lot, récapitulatif des liens) */

.batch-prefix {
    max-width: 36rem;
}

.batch-prefix label,
.batch-field label {
    display: block;
    margin-bottom: var(--e-2);
}

.batch-prefix button {
    flex: none;
}

.batch-prefix .help,
.batch-field .help {
    margin: var(--e-2) 0 0;
}

table.batch-table td {
    vertical-align: top;
}

table.batch-table td.file {
    max-width: 14rem;
    padding-top: var(--e-4);
    font-weight: 600;
    overflow-wrap: anywhere;
}

table.batch-table td input[type="text"] {
    min-width: 12rem;
}

table.batch-table .slug-field .prefix {
    max-width: 45%;
}

table.batch-table td.remove {
    white-space: nowrap;
}

table.batch-table .check {
    align-items: center;
    padding: 0;
}

/* Ligne retirée : atténuée, elle ne sera pas publiée. */
table.batch-table tr.is-removed td:not(.remove),
table.batch-table tr:has(.remove input:checked) td:not(.remove) {
    opacity: 0.55;
}

.field-error {
    margin: var(--e-1) 0 0;
    color: var(--danger);
    font-size: var(--t-sm);
    font-weight: 600;
}

input[aria-invalid="true"],
.slug-field:has(input[aria-invalid="true"]) {
    border-color: var(--danger);
}

.batch-common {
    padding-top: var(--e-5);
    border-top: 1px solid var(--trait);
}

.batch-common h2 {
    margin: 0 0 var(--e-4);
    font-size: var(--t-lg);
}

.batch-common-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--e-4) var(--e-5);
    align-items: start;
    margin-bottom: var(--e-2);
}

.published-list {
    display: grid;
    gap: var(--e-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.published-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-4);
    padding: var(--e-4) var(--e-5);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-1);
}

.published-text {
    display: flex;
    flex-direction: column;
    gap: var(--e-1);
    min-width: 0;
    overflow-wrap: anywhere;
}

.published-text a {
    color: var(--lien);
}

@media (max-width: 68rem) {
    table.batch-table td {
        display: block;
        padding: var(--e-2) 0;
        text-align: left;
    }

    table.batch-table td::before {
        display: block;
        margin-bottom: var(--e-1);
    }

    table.batch-table td.file {
        max-width: none;
        padding-top: var(--e-2);
        font-size: var(--t-lg);
    }

    table.batch-table td.file::before,
    table.batch-table td.remove::before {
        content: none;
    }

    table.batch-table td input[type="text"] {
        min-width: 0;
    }

    table.batch-table .slug-field .prefix {
        display: none;
    }

    .batch-prefix .field-with-button {
        flex-wrap: wrap;
    }

    .batch-prefix .field-with-button input {
        flex: 1 1 100%;
    }

    .published-item {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Téléphones : l'adresse e-mail laisse la place au logo, au bouton de thème et à la déconnexion sur une ligne. */

@media (max-width: 30rem) {
    .who {
        display: none;
    }
}

/* ---------------------------------------------------------------- Mouvement réduit */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    button:active,
    .button:active {
        transform: none;
    }
}

/* ---------------------------------------------------------------- Écran « Fonctionnalités » : tableau (cartes sous 68rem, comme table.pages) et interrupteur */

table.features td.title {
    max-width: 16rem;
}

table.features td.desc {
    max-width: 26rem;
    color: var(--texte-doux);
}

/* Mise en garde sous une description (inscription libre) */
table.features td.desc .help {
    display: block;
    margin: var(--e-1) 0 0;
    font-weight: 600;
}

table.features td.setting {
    white-space: nowrap;
}

table.features td.setting .muted {
    white-space: normal;
}

/* Interrupteur : un vrai bouton (aria-pressed), le texte dit l'état ; la piste et le rond ne sont qu'un repère de plus. */
.switch {
    gap: var(--e-3);
    padding: 0 var(--e-4) 0 var(--e-3);
    color: var(--texte);
    background: var(--surface);
    border-color: var(--trait-fort);
    white-space: nowrap;
}

.switch:hover {
    background: var(--surface-2);
}

.switch::before {
    content: "";
    flex: none;
    width: 2.25rem;
    height: 1.25rem;
    background-color: var(--surface-2);
    background-image: radial-gradient(circle, var(--texte-doux) 0.375rem, transparent calc(0.375rem + 1px));
    background-repeat: no-repeat;
    background-size: 1.25rem 1.25rem;
    background-position: left center;
    border: 1px solid var(--trait-fort);
    border-radius: 999px;
    transition: background-color var(--duree) var(--courbe), background-position var(--duree) var(--courbe);
}

.switch[aria-pressed="true"]::before {
    background-color: var(--accent);
    background-image: radial-gradient(circle, var(--sur-accent) 0.375rem, transparent calc(0.375rem + 1px));
    background-position: right center;
    border-color: var(--accent);
}

@media (max-width: 68rem) {
    table.features td.title,
    table.features td.desc {
        max-width: none;
    }

    table.features td.desc {
        display: block;
        text-align: left;
    }

    table.features td.desc::before {
        content: none;
    }

    table.features td.setting {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .switch::before {
        transition: none;
    }
}

/* ---------------------------------------------------------------- Écran « Utilisateurs » : sections, demandes, limites par défaut */

.users-section {
    margin-top: var(--e-6);
}

.users-section > h2 {
    margin-bottom: var(--e-3);
}

.users-section > .empty {
    padding: var(--e-5);
}

.who-name,
.who-email {
    display: block;
}

.who-email {
    color: var(--texte-doux);
    font-size: var(--t-sm);
    font-weight: 400;
    overflow-wrap: anywhere;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--e-1) var(--e-2);
    margin-top: var(--e-2);
}

/* Attention (pas une erreur) : fond et trait du bandeau d'information. */
.badge.attention {
    color: var(--texte);
    background: var(--accent-fond);
    border-color: var(--accent-trait);
}

/* Message d'un visiteur : retours à la ligne gardés, mots longs coupés. */
.request-message {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

table.requests td.request-message-cell {
    max-width: 24rem;
}

table.failures td.failure-error {
    max-width: 20rem;
    color: var(--texte-doux);
    overflow-wrap: anywhere;
}

.request-facts .wide {
    grid-column: 1 / -1;
}

.request-facts dd {
    overflow-wrap: anywhere;
}

.request-facts dd.request-message {
    font-weight: 400;
}

.request-facts + .alert,
.request-facts + form {
    margin-top: var(--e-5);
}

.limits-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--e-4);
}

.limits-form .field {
    display: flex;
    flex-direction: column;
    gap: var(--e-2);
}

.panel > .help + .alert,
.panel > .alert + .limits-form {
    margin-top: var(--e-3);
}

@media (max-width: 68rem) {
    table.requests td.request-message-cell,
    table.failures td.failure-error {
        max-width: none;
    }

    table.requests td.request-message-cell {
        display: block;
        text-align: left;
    }

    table.requests td.request-message-cell::before {
        display: block;
        margin-bottom: var(--e-1);
    }

    table.requests .row-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    table.requests .row-actions .button,
    table.requests .row-actions button {
        width: 100%;
    }

    .limits-form .field,
    .limits-form button {
        flex: 1 1 100%;
    }

    .limits-form input.short {
        max-width: none;
    }
}

/* ---------------------------------------------------------------- Écran « Utilisateurs » : clients et fiche d'un client */

table.clients td.client-host,
table.client-pages td.client-link {
    overflow-wrap: break-word;
}

table.client-pages td.actions .row-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

/* « Supprimer » d'une ligne : contour rouge (la confirmation data-confirm vient ensuite), pas un bloc plein par ligne. */
table.client-pages button.danger[type="submit"] {
    color: var(--danger);
    background: var(--surface);
    border-color: var(--danger-trait);
}

table.client-pages button.danger[type="submit"]:hover {
    color: var(--danger);
    background: var(--danger-fond);
    border-color: var(--danger);
}

table.clients a.who-name {
    color: var(--texte);
    font-weight: 600;
}

table.clients a.who-name:hover {
    color: var(--lien);
}

/* Fiche : le compte en grille (l'adresse des pages, longue, prend la ligne entière quand il le faut). */
.client-facts {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.client-facts dd {
    overflow-wrap: break-word;
}

.panel > .usage + .help {
    margin-top: 0;
}

/* Zone dangereuse : cadre complet teinté de rouge, jamais une barre sur un seul côté. */
.panel.danger-zone {
    border-color: var(--danger-trait);
}

.panel.danger-zone > h1,
.panel.danger-zone > h2 {
    color: var(--danger);
}

.danger-zone .delete-warning + .alert,
.danger-zone .delete-warning + form,
.danger-zone .alert + form {
    margin-top: var(--e-5);
}

.users-section + .panel {
    margin-top: var(--e-6);
}

@media (max-width: 68rem) {
    table.client-pages .row-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    table.client-pages .row-actions .inline-form:only-child {
        grid-column: 1 / -1;
    }

    table.client-pages .row-actions button {
        width: 100%;
    }
}

/* ---------------------------------------------------------------- Écrans publics : inscription, mot de passe, aide */

/* Piège à robots : hors écran, jamais atteint au clavier (tabindex="-1") ni lu (aria-hidden). */
.piege {
    position: absolute;
    left: -100vw;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.access > h1 {
    margin-bottom: var(--e-2);
}

.access-intro {
    margin: 0 0 var(--e-5);
    color: var(--texte-doux);
}

.access > .alert {
    margin: 0 0 var(--e-5);
}

/* L'adresse des pages du futur client, mise en avant au-dessus du formulaire. */
.access > .facts {
    margin: 0 0 var(--e-5);
    padding: var(--e-4);
    background: var(--surface-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}

input[readonly] {
    color: var(--texte-doux);
    background: var(--surface-2);
    border-color: var(--trait);
}

input[readonly]:hover {
    border-color: var(--trait);
}

.access .check a {
    font-weight: 600;
}

.access-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 var(--e-4);
    margin: var(--e-4) 0 0;
    padding-top: var(--e-3);
    border-top: 1px solid var(--trait);
    font-size: var(--t-sm);
}

.access-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--cible);
}

.access > .buttons {
    margin: var(--e-5) 0 0;
}

.guide {
    max-width: 46rem;
    margin-left: auto;
    margin-right: auto;
}

.guide > h1 {
    margin-bottom: var(--e-2);
}

.guide p {
    max-width: 65ch;
}

.guide-section {
    padding-top: var(--e-5);
    margin-top: var(--e-5);
    border-top: 1px solid var(--trait);
}

.guide-section h2 {
    margin: 0 0 var(--e-2);
    font-size: var(--t-lg);
}

.guide-section p {
    margin: 0;
}

.guide-address {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.guide > .buttons {
    margin: var(--e-6) 0 0;
}

@media (max-width: 30rem) {
    .access-links {
        flex-direction: column;
        gap: 0;
    }
}

/* ---------------------------------------------------------------- Corbeille */

.trash-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-3);
    margin-bottom: var(--e-4);
}

table.trash-pages td.choice-cell {
    width: 2rem;
}

.trash-address {
    display: block;
    font-size: 0.875em;
    overflow-wrap: anywhere;
}

.trash-confirm-list {
    margin: 0 0 var(--e-4);
    padding-left: var(--e-5);
}

/* ---------------------------------------------------------------- Tableau de bord (/) */

.figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: var(--e-4) var(--e-5);
    margin: 0 0 var(--e-4);
}

.figure dt {
    color: var(--texte-doux);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.figure dd {
    margin: var(--e-1) 0 0;
    font-size: var(--t-2xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.disk-line {
    margin: 0 0 var(--e-3);
    color: var(--texte-doux);
    font-size: var(--t-sm);
}

.chart {
    display: block;
    width: 100%;
    max-width: 36rem;
    height: auto;
}

.chart-bar {
    fill: var(--accent);
}

.chart-bar:hover {
    fill: var(--accent-survol);
}

/* Visiteurs : seconde barre, plus fine, de la couleur de la série « visiteurs » de l'onglet Statistiques. */
.chart-bar-visitors {
    fill: var(--succes);
}

.chart-axis {
    stroke: var(--trait-fort);
    stroke-width: 1;
}

.chart-label {
    fill: var(--texte-doux);
    font-family: var(--police);
    font-size: 9px;
}

/* Onglet Statistiques : période, variations, courbe à deux séries (tout en attributs SVG), heures, répartitions.
   Les deux séries se distinguent par la couleur (--accent, --succes) et par le trait (plein, pointillé). */

.stats-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-3);
    margin-bottom: var(--e-3);
}

.stats-toolbar h2 {
    margin: 0;
}

.period-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--e-2);
    margin: 0 0 var(--e-4);
    padding: 0;
    list-style: none;
}

.period-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--cible);
    padding: 0 var(--e-4);
    color: var(--texte-doux);
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon-petit);
    font-weight: 600;
    text-decoration: none;
}

.period-links a:hover {
    color: var(--texte);
    background: var(--surface-2);
}

.period-links a[aria-current="page"] {
    color: var(--sur-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.stats-figures .change,
.figure .figure-note {
    margin: var(--e-1) 0 0;
    font-size: var(--t-sm);
    font-weight: 600;
}

.figure .figure-note {
    color: var(--texte-doux);
    font-weight: 400;
}

.change-up {
    color: var(--succes);
}

.change-down {
    color: var(--danger);
}

.change-flat {
    color: var(--texte-doux);
}

.chart-wide {
    max-width: 48rem;
}

.chart-hours {
    max-width: 30rem;
}

.chart-grid {
    stroke: var(--trait);
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.chart-line-views {
    stroke: var(--accent);
}

.chart-line-visitors {
    stroke: var(--succes);
    stroke-dasharray: 5 3;
}

.chart-dot-views {
    fill: var(--accent);
}

.chart-dot-visitors {
    fill: var(--succes);
}

.hour-bar {
    fill: var(--accent);
}

.hour-bar:hover {
    fill: var(--accent-survol);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--e-2) var(--e-5);
    margin: 0 0 var(--e-2);
    color: var(--texte-doux);
    font-size: var(--t-sm);
}

.chart-legend span::before {
    content: "";
    display: inline-block;
    width: 1.5rem;
    height: 0;
    margin-right: var(--e-2);
    vertical-align: middle;
    border-top: 3px solid var(--accent);
}

.chart-legend .legend-visitors::before {
    border-top: 3px dashed var(--succes);
}

.stats-dims {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--e-4);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-sm);
}

.stats-table th,
.stats-table td {
    padding: var(--e-2) var(--e-2);
    border-bottom: 1px solid var(--trait);
    text-align: left;
    overflow-wrap: anywhere;
}

.stats-table thead th {
    color: var(--texte-doux);
    font-size: var(--t-xs);
    font-weight: 600;
}

.stats-table tbody th {
    font-weight: 400;
}

.stats-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ranking,
.first-steps {
    margin: 0 0 var(--e-4);
    padding-left: var(--e-5);
}

.recent-list,
.activity-list {
    margin: 0 0 var(--e-4);
    padding: 0;
    list-style: none;
}

.ranking li,
.first-steps li,
.recent-list li,
.activity-list li {
    padding: var(--e-1) 0;
}

.recent-list li,
.activity-list li {
    border-bottom: 1px solid var(--trait);
}

.recent-list li:last-child,
.activity-list li:last-child {
    border-bottom: 0;
}

.recent-list .muted,
.activity-list .muted,
.ranking .muted {
    margin-left: var(--e-2);
    font-size: var(--t-sm);
}

/* L'aperçu d'une page dans une fenêtre (apercu.js) : un <dialog> modal, la liste reste visible et floutée derrière. */

.row-hint {
    color: var(--texte-doux);
    font-size: var(--t-xs);
}

/* « Lien copié » sur la ligne de Mes pages (admin.js), quelques secondes. */
.row-status:not(:empty) {
    margin-left: var(--e-2);
    color: var(--succes);
    font-size: var(--t-xs);
    font-weight: 600;
}

html:has(dialog.preview[open]) {
    overflow: hidden;
}

dialog.preview {
    width: min(96vw, 80rem);
    max-width: none;
    height: calc(100dvh - 2 * var(--e-4));
    max-height: none;
    margin: auto;
    padding: 0;
    color: var(--texte);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-2);
    overflow: hidden;
}

dialog.preview[open] {
    display: flex;
    flex-direction: column;
}

dialog.preview::backdrop {
    background: var(--voile, rgb(21 19 15 / 0.5));
    backdrop-filter: blur(4px);
}

.preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2) var(--e-3);
    padding: var(--e-3) var(--e-4);
    border-bottom: 1px solid var(--trait);
}

.preview-title {
    flex: 1 1 12rem;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-modes {
    display: inline-flex;
    gap: var(--e-1);
}

.preview-modes button[aria-pressed="true"] {
    background: var(--accent-fond);
    border-color: var(--accent-trait);
}

.preview-stage {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-height: 0;
    background: var(--surface-2);
}

.preview-frame {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 0;
}

dialog.preview-phone .preview-frame {
    width: 390px;
    max-width: 100%;
    border-inline: 1px solid var(--trait-fort);
}

/* Onglet Partage : carte d'aperçu du lien, puis les images de la page à choisir */

.share-card {
    display: grid;
    overflow: hidden;
    max-width: 32rem;
    margin-bottom: var(--e-4);
    background: var(--surface-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}

.share-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 1.91 / 1;
    object-fit: cover;
}

.share-card-noimage {
    margin: 0;
    padding: var(--e-4);
    overflow-wrap: anywhere;
}

.share-card-text {
    padding: var(--e-3) var(--e-4);
}

.share-card-text p {
    margin: 0 0 var(--e-1);
    overflow-wrap: anywhere;
}

.share-card-domain {
    color: var(--texte-doux);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.share-card-title {
    font-weight: 700;
}

.share-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: var(--e-3);
    margin: var(--e-3) 0 var(--e-4);
    padding: 0;
    list-style: none;
}

.share-thumb {
    display: grid;
    gap: var(--e-1);
    width: 100%;
    padding: var(--e-2);
    font-size: 0.8rem;
    text-align: left;
    background: var(--surface-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}

.share-thumb img {
    display: block;
    width: 100%;
    height: 5rem;
    object-fit: cover;
}

.share-thumb span {
    overflow-wrap: anywhere;
}

/* QR code de la page : le SVG porte son propre fond blanc et sa marge, lisibles aussi en thème sombre */

.qr-code {
    display: block;
    width: 12.5rem;
    max-width: 100%;
    height: auto;
    margin-bottom: var(--e-3);
}

/* Vérification à l'envoi : encadré informatif sous le nom du fichier reçu */

.upload-warnings {
    margin: var(--e-3) 0;
    padding: var(--e-3) var(--e-4);
    color: var(--texte);
    background: var(--accent-fond);
    border: 1px solid var(--accent-trait);
    border-radius: var(--rayon);
    overflow-wrap: anywhere;
}

.upload-warnings p {
    margin: 0;
}

.upload-warnings-title {
    font-weight: 700;
}

.upload-warnings .upload-warnings-label {
    margin-top: var(--e-3);
    font-weight: 600;
}

.upload-warnings ul {
    margin: var(--e-1) 0 0;
    padding-left: var(--e-5);
}

.upload-warnings .upload-warnings-advice {
    margin-top: var(--e-3);
    font-weight: 600;
}

table.batch-table td.upload-warnings-cell {
    padding-top: 0;
}

table.batch-table td.upload-warnings-cell::before {
    content: none;
}

/* Onglet Code de la fiche : barre (modifié, outils, Enregistrer), code à gauche et aperçu à droite (l'un sous l'autre
   sous 60rem). Le navigateur retire « hidden » de la barre d'outils et de l'aperçu quand il les anime. */
.code-files {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2) var(--e-3);
    margin-bottom: var(--e-4);
}

.code-files select {
    width: auto;
    max-width: 100%;
}

.code-file {
    margin: 0 0 var(--e-4);
}

.code-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-2) var(--e-3);
    margin-bottom: var(--e-3);
}

.code-tools {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2);
}

.code-tools[hidden],
.code-preview-pane[hidden],
.code-bar [data-modified][hidden] {
    display: none;
}

.code-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--e-4);
}

.code-layout:has(.code-preview-pane:not([hidden])) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 60rem) {
    .code-layout:has(.code-preview-pane:not([hidden])) {
        grid-template-columns: minmax(0, 1fr);
    }
}

textarea.code-area {
    display: block;
    width: 100%;
    min-height: 28rem;
    background: var(--surface-2);
    font-family: var(--police-code);
    font-size: var(--t-sm);
    line-height: 1.5;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
    resize: vertical;
}

.code-preview {
    display: block;
    width: 100%;
    min-height: 28rem;
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon);
    background: #ffffff;
}

.code-preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--e-2) var(--e-4);
    margin-top: var(--e-2);
}

/* Éditeur du navigateur (editeur.js) : gouttière des numéros, couche colorée sous la zone de texte rendue transparente
   (.code-colore), barre de recherche, séparation déplaçable. La couche et la zone partagent police, taille, interligne,
   marges et tabulations : leurs lignes tombent exactement les unes sur les autres. Thème propre à l'éditeur : data-code-theme. */
.code-editor[data-code-theme="clair"] {
    --code-fond: var(--code-clair-fond);
    --code-gouttiere: var(--code-clair-gouttiere);
    --code-numero: var(--code-clair-numero);
    --code-texte: var(--code-clair-texte);
    --code-balise: var(--code-clair-balise);
    --code-attribut: var(--code-clair-attribut);
    --code-valeur: var(--code-clair-valeur);
    --code-commentaire: var(--code-clair-commentaire);
    --code-chaine: var(--code-clair-chaine);
    --code-mot: var(--code-clair-mot);
    --code-selecteur: var(--code-clair-selecteur);
    --code-propriete: var(--code-clair-propriete);
    --code-trouve: var(--code-clair-trouve);
    --code-courant: var(--code-clair-courant);
    --code-selection: var(--code-clair-selection);
}

.code-editor[data-code-theme="sombre"] {
    --code-fond: var(--code-sombre-fond);
    --code-gouttiere: var(--code-sombre-gouttiere);
    --code-numero: var(--code-sombre-numero);
    --code-texte: var(--code-sombre-texte);
    --code-balise: var(--code-sombre-balise);
    --code-attribut: var(--code-sombre-attribut);
    --code-valeur: var(--code-sombre-valeur);
    --code-commentaire: var(--code-sombre-commentaire);
    --code-chaine: var(--code-sombre-chaine);
    --code-mot: var(--code-sombre-mot);
    --code-selecteur: var(--code-sombre-selecteur);
    --code-propriete: var(--code-sombre-propriete);
    --code-trouve: var(--code-sombre-trouve);
    --code-courant: var(--code-sombre-courant);
    --code-selection: var(--code-sombre-selection);
}

.code-editor {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    border: 1px solid var(--trait-fort);
    border-radius: var(--rayon);
    background: var(--code-fond);
    color: var(--code-texte);
    overflow: hidden;
}

.code-editor:focus-within {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.code-gutter {
    overflow: hidden;
    background: var(--code-gouttiere);
    color: var(--code-numero);
    font-family: var(--police-code);
    font-size: var(--t-sm);
    line-height: 1.5;
    text-align: right;
    user-select: none;
}

.code-gutter-inner,
.code-layer-inner {
    white-space: pre;
    will-change: transform;
}

.code-gutter-inner {
    padding: 0 var(--e-2) 0 var(--e-3);
}

.code-stack {
    position: relative;
    min-width: 0;
}

.code-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    padding: 0 var(--e-3);
    pointer-events: none;
}

.code-layer-inner,
.code-editor textarea.code-area {
    font-family: var(--police-code);
    font-size: var(--t-sm);
    line-height: 1.5;
    tab-size: 4;
    font-variant-ligatures: none;
    letter-spacing: normal;
}

.code-layer-inner {
    color: var(--code-texte);
}

.code-editor textarea.code-area {
    position: relative;
    z-index: 1;
    padding: var(--e-3);
    color: var(--code-texte);
    caret-color: var(--code-texte);
    background: transparent;
    border: 0;
    border-radius: 0;
}

.code-editor textarea.code-area:focus-visible {
    outline: none;
}

.code-editor textarea.code-area::selection {
    background: var(--code-selection);
}

.code-editor.code-colore textarea.code-area,
.code-editor.code-colore textarea.code-area::selection {
    color: transparent;
}

.c-balise {
    color: var(--code-balise);
}

.c-attribut {
    color: var(--code-attribut);
}

.c-valeur {
    color: var(--code-valeur);
}

.c-commentaire {
    color: var(--code-commentaire);
}

.c-chaine {
    color: var(--code-chaine);
}

.c-mot {
    color: var(--code-mot);
}

.c-selecteur {
    color: var(--code-selecteur);
}

.c-propriete {
    color: var(--code-propriete);
}

.c-trouve {
    background: var(--code-trouve);
}

.c-courant {
    background: var(--code-courant);
    outline: 1px solid var(--code-texte);
}

.code-status {
    margin: 0 0 var(--e-3);
}

.code-status[hidden],
.code-keys[hidden],
.code-color-note[hidden],
.code-search[hidden],
.code-bar [data-draft-button][hidden] {
    display: none;
}

.code-keys,
.code-color-note {
    margin: var(--e-2) 0 0;
}

.code-theme {
    display: inline-flex;
    align-items: center;
    gap: var(--e-2);
    font-size: var(--t-sm);
    color: var(--texte-doux);
}

.code-theme select {
    width: auto;
}

.code-search {
    display: grid;
    gap: var(--e-2);
    margin-bottom: var(--e-3);
    padding: var(--e-3);
    background: var(--surface-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}

.code-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--e-2) var(--e-3);
}

.code-search-field {
    display: grid;
    flex: 1 1 14rem;
    gap: var(--e-1);
    font-size: var(--t-sm);
    color: var(--texte-doux);
}

.code-search-count {
    align-self: center;
    min-width: 8rem;
    font-size: var(--t-sm);
    color: var(--texte-doux);
}

.code-search-row .check {
    margin-right: auto;
}

.code-preview-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.code-preview-pane .code-preview {
    flex: 1 1 auto;
}

.code-preview-status {
    margin-right: auto;
    font-size: var(--t-sm);
    color: var(--texte-doux);
}

.code-preview-status.code-preview-error {
    color: var(--danger);
}

.code-splitter {
    display: none;
}

.code-dragging {
    cursor: col-resize;
    user-select: none;
}

.code-dragging .code-preview {
    pointer-events: none;
}

@media (min-width: 60.01rem) {
    .code-layout.code-layout-split:has(.code-preview-pane:not([hidden])) {
        grid-template-columns: minmax(0, var(--code-gauche, 1fr)) auto minmax(0, var(--code-droite, 1fr));
        gap: 0;
    }

    .code-layout-split .code-splitter {
        position: relative;
        display: block;
        width: var(--e-5);
        cursor: col-resize;
        touch-action: none;
    }

    .code-layout-split .code-splitter::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 4px;
        margin-left: -2px;
        background: var(--trait);
        border-radius: 2px;
    }

    .code-layout-split .code-splitter:hover::before,
    .code-layout-split .code-splitter:focus-visible::before,
    .code-dragging .code-splitter::before {
        background: var(--accent);
    }
}
