/*
 * StylesBandeauActions — bandeau de mise en forme (4 colonnes : format, typo, alignement, insertion)
 *
 * Structure commune : fieldset > legend + ul.bandeau-actions__outils > li
 * Dimensions en vh / vw / % — typographie en rem (--ba-*)
 */

.bandeau-actions {
    width: 100%;
    min-height: 0;
}

.bandeau-actions-grilles {
    --bandeau-hauteur: 16vh;
    /* dimensions bandeau — vh / vw / % (typo = rem) */
    --ba-gouttiere: 0.75vh;
    --ba-ecart-l: 0.55vh;
    --ba-ecart: 0.5vh;
    --ba-ecart-s: 0.4vh;
    --ba-ecart-xs: 0.35vh;
    --ba-ecart-xxs: 0.25vh;
    --ba-pad-block: 2%;
    --ba-pad-inline: 4%;
    --ba-legend-pad: 1%;
    --ba-section-pad-top: 3.5%;
    --ba-ecart-section: 3.5%;
    --ba-ecart-section-1-2: 0.45vh;
    --ba-bouton-h: 2.4vh;
    --ba-bouton-h-s: 2.25vh;
    --ba-bouton-h-l: 2.55vh;
    --ba-bouton-pad-v: 0.25vh;
    --ba-bouton-pad-h: 0.55vw;
    --ba-bouton-pad-h-l: 0.85vw;
    --ba-min-bouton-w: 16%;
    --ba-min-bouton-w-m: 30%;
    --ba-min-bouton-w-l: 36%;
    --ba-min-bouton-w-xl: 40%;
    --ba-rayon: 0.3vh;
    --ba-legend-reserve: 2.5vh;
    --ba-icone-portrait-w: 1.1vh;
    --ba-icone-portrait-h: 1.55vh;
    --ba-icone-paysage-w: 1.55vh;
    --ba-icone-paysage-h: 1.1vh;
    --ba-couleur-w: 1.45vh;
    --ba-select-fleche: 0.5vh;
    --ba-aide-taille: 1.85vh;
    --ba-typo-label: 1.2rem;
    --ba-typo-controle: 1.2rem;
    --ba-typo-legend: 1.3rem;
    --ba-controle-h: 2.1vh;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: var(--ba-gouttiere);
    height: var(--bandeau-hauteur);
    min-height: var(--bandeau-hauteur);
    max-height: var(--bandeau-hauteur);
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: stretch;
    box-sizing: border-box;
}

.bandeau-actions__colonne {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.bandeau-actions-grilles fieldset {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: var(--ba-pad-block) var(--ba-pad-inline);
    border: 1px solid var(--color-border);
    border-radius: var(--ba-rayon);
    background-color: var(--color-surface);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    text-align: center;
}

.bandeau-actions-grilles legend {
    flex: 0 0 auto;
    position: relative;
    padding: 0.1vh var(--ba-legend-pad) 0.4vh;
    font-size: var(--ba-typo-legend);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    display: table;
    margin-inline: auto;
    text-align: center;
    color: var(--color-accent);
    background-image: linear-gradient(
        115deg,
        var(--color-accent) 0%,
        color-mix(in srgb, var(--color-accent) 55%, #6eb5ff) 50%,
        var(--color-accent) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 18px color-mix(in srgb, var(--color-accent) 18%, transparent);
}

.bandeau-actions-grilles legend::after {
    content: "";
    display: block;
    width: 70%;
    height: 1px;
    margin: 0.28vh auto 0;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        color-mix(in srgb, var(--color-accent) 70%, #8ec5ff) 50%,
        transparent 100%
    );
    box-shadow: 0 0 5px color-mix(in srgb, var(--color-accent) 30%, transparent);
    opacity: 0.85;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .bandeau-actions-grilles legend {
        -webkit-text-fill-color: unset;
        color: var(--color-accent);
        background-image: none;
    }
}

/* Modèle commun — legend + ul.outils (sections en li) */
.bandeau-actions-grilles fieldset > .bandeau-actions__outils {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: var(--ba-ecart-section);
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.bandeau-actions__outils > li {
    flex: 0 0 auto;
    width: 100%;
}

.bandeau-actions__outils > li > ul {
    width: 100%;
}

.bandeau-actions__outils > li:nth-child(2):not(.bandeau-actions__section--bas) {
    padding-top: var(--ba-ecart-section-1-2);
}

.bandeau-actions__section--bas {
    padding-top: var(--ba-section-pad-top);
    border-top: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
}

/* Grille 2×2 — Gauche/Centre, Droite/Justifier */
.bandeau-actions__grille-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    gap: var(--ba-ecart-l);
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bandeau-actions__grille-2 > li {
    min-width: 0;
}

.bandeau-actions__grille-2 .bouton-secondaire {
    width: 100%;
    min-height: var(--ba-bouton-h);
    padding: var(--ba-bouton-pad-v) var(--ba-bouton-pad-h);
    font-size: 1.1rem;
}

.bandeau-actions__boutons-rangee {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    gap: var(--ba-ecart);
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bandeau-actions__typographie .bandeau-actions__outils > li {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--ba-ecart-s);
    width: 100%;
}

.bandeau-actions__typographie .bandeau-actions__outils > li:not(.bandeau-actions__typographie-taille-couleur) {
    flex-direction: column;
}

.bandeau-actions__typographie .bandeau-actions__outils > li.bandeau-actions__typographie-taille-couleur {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-around;
    gap: var(--ba-ecart-l);
    width: 100%;
}

.bandeau-actions__typographie-paire {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: var(--ba-ecart-s);
}

.bandeau-actions__typographie-paire label {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: var(--ba-typo-label);
    font-weight: 600;
}

.bandeau-actions__typographie .bandeau-actions__typographie-paire .bandeau-actions__taille-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 4.5rem;
    max-width: 9vw;
    min-height: var(--ba-controle-h);
    padding: 0.12vh 1.35vw 0.12vh var(--ba-ecart-l);
    font-size: var(--ba-typo-controle);
    line-height: 1.15;
}

.bandeau-actions__typographie .bandeau-actions__typographie-paire input[type="color"] {
    width: var(--ba-couleur-w);
    height: var(--ba-controle-h);
    min-height: var(--ba-controle-h);
    padding: 0.12vh;
}

.bandeau-actions__style-texte-liste .bouton-secondaire {
    min-width: var(--ba-min-bouton-w-l);
    min-height: var(--ba-bouton-h-l);
    padding: calc(var(--ba-bouton-pad-v) * 1.5) var(--ba-bouton-pad-h-l);
    font-size: 1.05rem;
    line-height: 1.25;
}

.bandeau-actions__style-texte-gras {
    font-weight: 700;
}

.bandeau-actions__style-texte-italique {
    font-style: italic;
}

.bandeau-actions__style-texte-souligne {
    text-decoration: underline;
}

.bandeau-actions__style-texte-liste .bouton-secondaire[aria-pressed="true"].bandeau-actions__style-texte-gras {
    font-weight: 700;
}

.bandeau-actions__style-texte-liste .bouton-secondaire[aria-pressed="true"].bandeau-actions__style-texte-italique {
    font-style: italic;
}

.bandeau-actions__style-texte-liste .bouton-secondaire[aria-pressed="true"].bandeau-actions__style-texte-souligne {
    text-decoration: underline;
}

.bandeau-actions__marges-ligne {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: var(--ba-ecart-l);
    width: 100%;
    margin: 0;
}

.bandeau-actions__sens-texte {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-around;
    gap: var(--ba-ecart-xs);
}

.bandeau-actions__sens-texte > .bandeau-actions__orientations-liste {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.bandeau-actions__insertion-centre {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: var(--ba-ecart-s);
}

.bandeau-actions__insertion-principale {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    gap: var(--ba-ecart-xs);
}

.bandeau-actions__insertion-principale .bouton-secondaire {
    flex: 1 1 0;
    min-width: 0;
    min-height: var(--ba-bouton-h-s);
    padding: calc(var(--ba-bouton-pad-v) * 0.9) var(--ba-bouton-pad-h);
    font-size: 1.05rem;
    line-height: 1.2;
}

.bandeau-actions__insertion-alignements .bouton-secondaire {
    min-width: var(--ba-min-bouton-w-l);
    min-height: var(--ba-bouton-h-l);
    padding: calc(var(--ba-bouton-pad-v) * 1.5) var(--ba-bouton-pad-h-l);
    font-size: 1.05rem;
    line-height: 1.25;
}

.bandeau-actions__outils label {
    font-size: var(--ba-typo-label);
}

.bandeau-actions__typographie .bandeau-actions__outils label {
    font-weight: 600;
}

.bandeau-actions__taille-select,
.bandeau-actions__typographie .bandeau-actions__outils select {
    min-width: var(--ba-min-bouton-w-xl);
    min-height: var(--ba-controle-h);
    padding: 0.12vh 1.35vw 0.12vh var(--ba-ecart-l);
    font-family: inherit;
    font-size: var(--ba-typo-controle);
    font-weight: 600;
    line-height: 1.15;
    cursor: pointer;
    border: 1px solid var(--color-accent);
    border-radius: var(--ba-rayon);
    background-color: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface));
    color: var(--color-accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='none' stroke='%232c5282' stroke-width='1.5' stroke-linecap='round' d='M1 1l5 4 5-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7vw center;
    background-size: var(--ba-select-fleche) auto;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.bandeau-actions__taille-select:hover,
.bandeau-actions__typographie .bandeau-actions__outils select:hover {
    background-color: color-mix(in srgb, var(--color-accent) 22%, var(--color-surface));
    box-shadow: 0 1px 4px color-mix(in srgb, var(--color-accent) 20%, transparent);
}

.bandeau-actions__taille-select:focus-visible,
.bandeau-actions__typographie .bandeau-actions__outils select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.bandeau-actions__outils button:not(.bouton-aide):not(.bandeau-actions__format-actif) {
    min-width: var(--ba-min-bouton-w);
    min-height: var(--ba-bouton-h);
    padding: var(--ba-bouton-pad-v) var(--ba-bouton-pad-h);
    font-size: 1.1rem;
    line-height: 1.2;
}

/* Bouton ? — taille fixe, identique partout dans le bandeau */
.bandeau-actions-grilles .bouton-aide {
    width: var(--ba-aide-taille);
    height: var(--ba-aide-taille);
    min-width: var(--ba-aide-taille);
    min-height: var(--ba-aide-taille);
    padding: 0;
    font-size: 0.95rem;
}

.bandeau-actions__outils select {
    min-width: var(--ba-min-bouton-w-l);
    padding: var(--ba-bouton-pad-v) var(--ba-bouton-pad-h);
    font-family: inherit;
    font-size: 1.1rem;
}

.bandeau-actions__outils input[type="color"] {
    width: var(--ba-couleur-w);
    height: var(--ba-bouton-h);
    padding: 0.12vh;
    cursor: pointer;
}

.bandeau-actions__outils button:disabled {
    cursor: default;
    opacity: 1;
    font-weight: 600;
}

/* Colonne Format — A4 + portrait + paysage ; marges centrées, largeurs cohérentes */
.bandeau-actions__format {
    --ba-format-controle-w: calc((100% - 2 * var(--ba-ecart-xxs)) / 3);
}

.bandeau-actions__format .bandeau-actions__marges {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--ba-ecart-s);
    width: 100%;
}

.bandeau-actions__format .bandeau-actions__marges-ligne {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: var(--ba-ecart-s);
    width: 100%;
    margin: 0;
}

.bandeau-actions__format .bandeau-actions__marges-label {
    flex-shrink: 0;
    white-space: nowrap;
    text-align: center;
    font-size: var(--ba-typo-label);
    font-weight: 600;
}

.bandeau-actions__format .bandeau-actions__marges .bandeau-actions__marges-select {
    flex: 0 0 auto;
    width: var(--ba-format-controle-w);
    min-width: 0;
    max-width: 100%;
    min-height: var(--ba-controle-h);
    padding: 0.12vh 1.35vw 0.12vh var(--ba-ecart-l);
    font-size: var(--ba-typo-controle);
    line-height: 1.15;
}

.bandeau-actions__format .bandeau-actions__marges .bandeau-actions__marges-bouton {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: var(--ba-controle-h);
    padding: 0.12vh 0.35vw;
    font-size: var(--ba-typo-controle);
    line-height: 1.2;
    align-self: stretch;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
    overflow-wrap: break-word;
    hyphens: auto;
}

@media (max-width: 1400px) {
    .bandeau-actions__format .bandeau-actions__marges .bandeau-actions__marges-bouton {
        font-size: clamp(0.95rem, 2.4vw, var(--ba-typo-controle));
    }
}

/* Format A4 fixe — compact pour laisser de la place aux marges */
.bandeau-actions__format-actif {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: var(--ba-controle-h);
    padding: 0.12vh 0.45vw;
    font-size: var(--ba-typo-controle);
    font-weight: 600;
    line-height: 1.15;
    background-color: var(--color-accent);
    color: #ffffff;
    border: 1px solid var(--color-accent);
    border-radius: var(--ba-rayon);
    cursor: default;
}

.bandeau-actions__format-ligne .bandeau-actions__orientation {
    min-height: var(--ba-controle-h);
    padding: 0.12vh 0.45vw;
    font-size: var(--ba-typo-controle);
    line-height: 1.15;
}

/* Portrait / paysage / horizontal / vertical — icône rectangle + libellé */
.bandeau-actions__orientations-liste {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-around;
    align-items: center;
    gap: var(--ba-ecart-xxs);
    list-style: none;
    padding: 0;
    margin: 0;
}

.bandeau-actions__orientations-liste > li {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
}

.bandeau-actions__orientation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ba-ecart-xs);
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    white-space: nowrap;
}

.bandeau-actions__orientation::before {
    content: "";
    flex-shrink: 0;
    border: 1.5px solid currentColor;
    border-radius: 1px;
}

.bandeau-actions__orientation--portrait::before {
    width: var(--ba-icone-portrait-w);
    height: var(--ba-icone-portrait-h);
}

.bandeau-actions__orientation--paysage::before {
    width: var(--ba-icone-paysage-w);
    height: var(--ba-icone-paysage-h);
}

/* Bloc marges — menu puis personnalisation en dessous */
.bandeau-actions__marges {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-around;
    gap: var(--ba-ecart-xs);
    width: 100%;
    flex: 0 0 100%;
    min-height: 0;
}

.bandeau-actions__marges-label {
    font-size: var(--ba-typo-label);
    font-weight: 600;
}

.bandeau-actions__marges .bandeau-actions__marges-select {
    width: 100%;
    min-width: var(--ba-min-bouton-w-xl);
    min-height: var(--ba-controle-h);
    padding: 0.12vh 1.35vw 0.12vh var(--ba-ecart-l);
    font-family: inherit;
    font-size: var(--ba-typo-controle);
    font-weight: 600;
    line-height: 1.15;
    cursor: pointer;
    border: 1px solid var(--color-accent);
    border-radius: var(--ba-rayon);
    background-color: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface));
    color: var(--color-accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='none' stroke='%232c5282' stroke-width='1.5' stroke-linecap='round' d='M1 1l5 4 5-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7vw center;
    background-size: var(--ba-select-fleche) auto;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.bandeau-actions__marges .bandeau-actions__marges-select:hover {
    background-color: color-mix(in srgb, var(--color-accent) 22%, var(--color-surface));
    box-shadow: 0 1px 4px color-mix(in srgb, var(--color-accent) 20%, transparent);
}

.bandeau-actions__marges .bandeau-actions__marges-select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.bandeau-actions__marges .bandeau-actions__marges-bouton {
    padding: 0.12vh 0.45vw;
    font-size: var(--ba-typo-controle);
    line-height: 1.15;
    white-space: nowrap;
}

/* Fenêtre marges sur mesure — large, peu haute, lisible */
.dialog-marges {
    margin: auto;
    position: fixed;
    inset: 0;
    width: min(100%, 90vw);
    height: fit-content;
    max-height: calc(100dvh - 2vh);
    padding: 1.25vh 1.75vw;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--ba-rayon);
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 1.0625rem;
    line-height: 1.45;
}

.dialog-marges::backdrop {
    background-color: rgba(0, 0, 0, 0.35);
}

.dialog-marges__titre {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

.dialog-marges__but {
    margin-top: 0.5vh;
    font-size: 1.0625rem;
    line-height: 1.4;
}

.dialog-marges__aide {
    margin-top: 0.35vh;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

.dialog-marges__reglages {
    display: flex;
    flex-direction: column;
    gap: 1vh;
    margin: 0.75vh 0 0;
    padding: 0;
    border: none;
}

.dialog-marges__portee {
    width: 100%;
    margin: 0;
    padding: 0.75vh 1vw;
    border: 1px solid var(--color-border);
    border-radius: var(--ba-rayon);
    text-align: center;
}

.dialog-marges__portee legend {
    display: table;
    margin-inline: auto;
    padding: 0 0.35vw;
    font-size: 1rem;
    font-weight: 600;
}

.dialog-marges__portee-liste {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75vh 2vw;
    list-style: none;
    padding: 0;
    margin: 0.5vh 0 0;
}

.dialog-marges__portee-liste li + li {
    margin-top: 0;
}

.dialog-marges__portee-option {
    display: flex;
    align-items: center;
    gap: var(--ba-ecart);
    font-size: 1.0625rem;
    cursor: pointer;
}

.dialog-marges__choix-page {
    flex: 1 1 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75vh;
}

.dialog-marges__choix-page label {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    white-space: nowrap;
}

.dialog-marges__choix-page select {
    flex: 1;
    max-width: 28vw;
    padding: 0.5vh 0.65vw;
    font-family: inherit;
    font-size: 1.0625rem;
}

.dialog-marges__champs {
    --marges-sep: color-mix(in srgb, var(--color-accent) 35%, var(--color-border));

    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(12vw, 1fr));
    gap: 2.5vh 5vw;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    list-style: none;
    padding: 2vh 3.25vw;
    border-radius: var(--ba-rayon);
    background:
        radial-gradient(
            circle at center,
            color-mix(in srgb, var(--color-accent) 30%, transparent) 0,
            transparent 0.4vh
        ),
        linear-gradient(
            to bottom,
            transparent 8%,
            color-mix(in srgb, var(--color-accent) 12%, transparent) 42%,
            var(--marges-sep) 50%,
            color-mix(in srgb, var(--color-accent) 12%, transparent) 58%,
            transparent 92%
        )
            center / 1px calc(100% - 2.5vh) no-repeat,
        linear-gradient(
            to right,
            transparent 8%,
            color-mix(in srgb, var(--color-accent) 12%, transparent) 42%,
            var(--marges-sep) 50%,
            color-mix(in srgb, var(--color-accent) 12%, transparent) 58%,
            transparent 92%
        )
            center / calc(100% - 2.5vh) 1px no-repeat,
        color-mix(in srgb, var(--color-accent) 5%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-accent) 22%, var(--color-border));
    box-shadow:
        inset 0 0 28px color-mix(in srgb, var(--color-accent) 7%, transparent),
        0 0 20px color-mix(in srgb, var(--color-accent) 9%, transparent);
}

.dialog-marges__champs li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45vh;
    padding: 0.75vh 1.15vw;
    text-align: center;
    border-radius: 0.3vh;
    background-color: color-mix(in srgb, var(--color-surface) 88%, var(--color-accent) 12%);
    border: 1px solid color-mix(in srgb, var(--color-accent) 14%, var(--color-border));
    box-shadow: 0 0 14px color-mix(in srgb, var(--color-accent) 6%, transparent);
}

.dialog-marges__champs label {
    font-size: 1.0625rem;
    font-weight: 600;
}

.dialog-marges__valeur {
    display: flex;
    align-items: center;
    gap: var(--ba-ecart);
}

.dialog-marges__valeur input {
    width: 8vw;
    padding: 0.5vh 0.65vw;
    font-family: inherit;
    font-size: 1.125rem;
    border: 1px solid color-mix(in srgb, var(--color-accent) 28%, var(--color-border));
    border-radius: var(--ba-rayon);
    background-color: var(--color-surface);
    box-shadow: inset 0 0 8px color-mix(in srgb, var(--color-accent) 5%, transparent);
}

.dialog-marges__unite {
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

.dialog-marges__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65vh;
    margin: 0.85vh 0 0;
    padding: 0;
    list-style: none;
}

/* Fenêtres d'aide — sens du texte, images et vidéos */
.dialog-aide-sens-texte {
    margin: auto;
    position: fixed;
    inset: 0;
    width: min(100%, 85vw);
    height: fit-content;
    max-height: calc(100dvh - 2vh);
    padding: 1.5vh 2vw;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--ba-rayon);
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 1.2rem;
    line-height: 1.55;
}

.dialog-aide-sens-texte::backdrop {
    background-color: rgba(0, 0, 0, 0.35);
}

.dialog-aide-sens-texte__titre {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.dialog-aide-sens-texte__texte {
    margin-top: 1vh;
    padding: 0;
    border: none;
}

.dialog-aide-sens-texte__texte p {
    margin: 0;
}

.dialog-aide-sens-texte__texte p + p {
    margin-top: 0.75vh;
}

.dialog-aide-sens-texte__exemple {
    margin-top: 1vh;
    padding: 0.85vh 1vw;
    border-left: 3px solid var(--color-accent);
    border-radius: 0 0.35vh 0.35vh 0;
    background-color: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
    font-size: 1.15rem;
    line-height: 1.5;
}

.dialog-aide-sens-texte__actions {
    display: flex;
    justify-content: center;
    gap: 0.75vh;
    margin: 1.25vh 0 0;
    padding: 0;
    list-style: none;
}

/* Colonne Typographie — pleine largeur comme les autres colonnes */
.bandeau-actions__typographie-police {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
}

.bandeau-actions__typographie-ligne {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-around;
    gap: var(--ba-ecart-l);
    width: 100%;
    margin: 0;
}

.bandeau-actions__typographie-bouton {
    flex: 0 0 auto;
    min-width: var(--ba-min-bouton-w-m);
}

.bandeau-actions__typographie-actuelle {
    flex: 0 0 auto;
    min-width: 0;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1.25;
    letter-spacing: 0.01em;
    text-align: center;
}

.bandeau-actions__typographie .bandeau-actions__style-texte-liste {
    justify-content: space-between;
    gap: var(--ba-ecart-xs);
}

.bandeau-actions__typographie .bandeau-actions__style-texte-liste > li {
    flex: 1 1 0;
    min-width: 0;
}

.bandeau-actions__typographie .bandeau-actions__style-texte-liste .bouton-secondaire {
    width: 100%;
    min-width: 0;
}

/* Fenêtre Typographie — centrée, 4 groupes */
.dialog-typographie {
    margin: auto;
    position: fixed;
    inset: 0;
    width: min(100%, 95vw);
    height: fit-content;
    max-height: calc(100dvh - 2vh);
    padding: 1.35vh 1.75vw 1.25vh;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--ba-rayon);
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 1.05rem;
    line-height: 1.45;
}

.dialog-typographie::backdrop {
    background-color: rgba(0, 0, 0, 0.35);
}

.dialog-typographie__titre {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.dialog-typographie__but {
    margin: 0.45vh 0 0;
    color: var(--color-text-muted);
    font-size: 1rem;
    text-align: center;
}

.dialog-typographie__grilles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1vh;
    margin-top: 1.1vh;
}

.dialog-typographie__groupe {
    display: flex;
    flex-direction: column;
    gap: 0.65vh;
    min-height: 0;
    padding: 0.85vh 0.9vw;
    border: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
    border-radius: 0.3vh;
    background-color: color-mix(in srgb, var(--color-bg) 45%, var(--color-surface));
}

.dialog-typographie__groupe-titre {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.dialog-typographie__polices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45vh;
}

.dialog-typographie__police {
    width: 100%;
    min-height: 2.4vh;
    padding: 0.25vh 0.5vw;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--color-accent);
    border-radius: 0.35vh;
    background-color: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
    color: var(--color-accent);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.dialog-typographie__police:hover {
    background-color: color-mix(in srgb, var(--color-accent) 18%, var(--color-surface));
    box-shadow: 0 1px 4px color-mix(in srgb, var(--color-accent) 18%, transparent);
}

.dialog-typographie__police[aria-pressed="true"] {
    background-color: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
}

.dialog-typographie__police[aria-pressed="true"]:hover {
    background-color: color-mix(in srgb, var(--color-accent) 88%, #000000);
    color: #ffffff;
}

.dialog-typographie__police:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.dialog-typographie__police--roboto { font-family: "Roboto", sans-serif; }
.dialog-typographie__police--opensans { font-family: "Open Sans", sans-serif; }
.dialog-typographie__police--notosans { font-family: "Noto Sans", sans-serif; }
.dialog-typographie__police--sourcesans3 { font-family: "Source Sans 3", sans-serif; }
.dialog-typographie__police--lexend { font-family: "Lexend", sans-serif; }
.dialog-typographie__police--atkinsonhyperlegible { font-family: "Atkinson Hyperlegible", sans-serif; }
.dialog-typographie__police--comicneue { font-family: "Comic Neue", sans-serif; }
.dialog-typographie__police--inter { font-family: "Inter", sans-serif; }
.dialog-typographie__police--montserrat { font-family: "Montserrat", sans-serif; }
.dialog-typographie__police--ibmplexsans { font-family: "IBM Plex Sans", sans-serif; }
.dialog-typographie__police--lato { font-family: "Lato", sans-serif; }
.dialog-typographie__police--caveat { font-family: "Caveat", cursive; font-size: 1.35rem; }
.dialog-typographie__police--pacifico { font-family: "Pacifico", cursive; font-size: 1.25rem; }
.dialog-typographie__police--dancingscript { font-family: "Dancing Script", cursive; font-size: 1.35rem; }
.dialog-typographie__police--patrickhand { font-family: "Patrick Hand", cursive; font-size: 1.25rem; }

.dialog-typographie__actions {
    display: flex;
    justify-content: center;
    gap: 0.75vh;
    margin: 1.1vh 0 0;
    padding: 0;
    list-style: none;
}
